summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/CAnnoEdit.h
authorllornkcor <llornkcor>2002-09-14 02:19:09 (UTC)
committer llornkcor <llornkcor>2002-09-14 02:19:09 (UTC)
commit2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975 (patch) (side-by-side diff)
treeeeed16b5f80dd5883991a7a06133f5f7a6936256 /noncore/apps/opie-reader/CAnnoEdit.h
parent5a95ed6a000a56849b8f093deea500214856c626 (diff)
downloadopie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.zip
opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.gz
opie-2d0c1ffcb39f9fac8193ed2e9e93794de0bd7975.tar.bz2
update by Tim
Diffstat (limited to 'noncore/apps/opie-reader/CAnnoEdit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/CAnnoEdit.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/CAnnoEdit.h b/noncore/apps/opie-reader/CAnnoEdit.h
new file mode 100644
index 0000000..3cc9f78
--- a/dev/null
+++ b/noncore/apps/opie-reader/CAnnoEdit.h
@@ -0,0 +1,58 @@
+#ifndef __CANNOEDIT_H
+#define __CANNOEDIT_H
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qpushbutton.h>
+#include <qlineedit.h>
+#include <qmultilineedit.h>
+
+class CAnnoEdit : public QWidget
+{
+ Q_OBJECT
+
+ QLineEdit* m_name;
+ QMultiLineEdit* m_anno;
+ size_t m_posn;
+ public:
+ void setPosn(size_t p) { m_posn = p; }
+ size_t getPosn() { return m_posn; }
+ void setName(const QString& name)
+ {
+ m_name->setText(name);
+ }
+ void setAnno(const QString& name)
+ {
+ m_anno->setText(name);
+ m_anno->setEdited(false);
+ }
+ bool edited() { return m_anno->edited(); }
+ CAnnoEdit(QWidget *parent=0, const char *name=0, WFlags f = 0) :
+ QWidget(parent, name, f)
+ {
+ QVBoxLayout* grid = new QVBoxLayout(this);
+ m_name = new QLineEdit(this, "Name");
+ m_anno = new QMultiLineEdit(this, "Annotation");
+ QPushButton* exitButton = new QPushButton("Okay", this);
+ connect(exitButton, SIGNAL( released() ), this, SLOT( slotOkay() ) );
+ QPushButton* cancelButton = new QPushButton("Cancel", this);
+ connect(cancelButton, SIGNAL( released() ), this, SLOT( slotCancel() ) );
+ QLabel *l = new QLabel("Text",this);
+ grid->addWidget(l);
+ grid->addWidget(m_name);
+ l = new QLabel("Annotation",this);
+ grid->addWidget(l);
+ grid->addWidget(m_anno,1);
+ QHBoxLayout* hgrid = new QHBoxLayout(grid);
+ hgrid->addWidget(cancelButton);
+ hgrid->addWidget(exitButton);
+ }
+ private slots:
+ void slotOkay() { emit finished(m_name->text(), m_anno->text()); }
+ void slotCancel() { emit cancelled(); }
+ public:
+ signals:
+ void finished(const QString&, const QString&);
+ void cancelled();
+};
+
+#endif