summaryrefslogtreecommitdiff
path: root/examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp')
-rw-r--r--examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp75
1 files changed, 75 insertions, 0 deletions
diff --git a/examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp b/examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp
new file mode 100644
index 0000000..3ddc77d
--- /dev/null
+++ b/examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp
@@ -0,0 +1,75 @@
+/***********************************************
+** Source Dump From QtEZ http://qtez.zax.net/qtez
+** ---------------------------------------------
+** Dumped: Mon Sep 21 01:22:44 1998
+** To: /usr/src/sword/examples/X11/qt/simplefrontend/SimpleFrontEndProject.cpp
+** By: root
+***********************************************/
+
+#include "/usr/src/sword/examples/X11/qt/simplefrontend/SimpleFrontEndProject.h"
+#include <string>
+#include <swmgr.h>
+
+SimpleFrontEndProject::SimpleFrontEndProject(QWidget *parent, char *name)
+ : QDialog(parent,name,FALSE,WStyle_Customize | WStyle_NormalBorder)
+{
+ resize(420,320);
+
+ label2 = new QLabel(this, "label2");
+ label2->setText("Module Name");
+ label2->setAlignment(AlignLeft | AlignTop);
+ label2->setGeometry(21,6,115,28);
+
+ label1 = new QLabel(this, "label1");
+ label1->setText("KeyText");
+ label1->setAlignment(AlignLeft | AlignTop);
+ label1->setGeometry(21,51,115,28);
+
+ label3 = new QLabel(this, "label3");
+ label3->setText("[ none ]");
+ label3->setAlignment(AlignLeft | AlignTop);
+ label3->setGeometry(21,96,115,28);
+
+ combo1 = new QComboBox((bool)0,this,"combo1");
+ combo1->setGeometry(143,6,270,28);
+
+ mlined1 = new QMultiLineEdit(this, "mlined1");
+ mlined1->setGeometry(21,141,390,160);
+ mlined1->setReadOnly(TRUE);
+
+ text1 = new QLineEdit(this, "text1");
+ text1->setGeometry(143,50,270,28);
+
+ QObject::connect(text1,SIGNAL(textChanged(const char *)),
+ this,SLOT(lookup(const char *)));
+
+ QObject::connect(combo1,SIGNAL(activated(const char *)),
+ this,SLOT(lookup(const char *)));
+
+// use SWMgr to traverse installed modules and insert into QComboBox
+
+ ModMap::iterator modIterator;
+
+ for (modIterator = manager.Modules.begin(); modIterator != manager.Modules.end(); modIterator++)
+ combo1->insertItem(modIterator->first.c_str());
+}
+
+void
+SimpleFrontEndProject::lookup(const char *)
+{
+ string keyText;
+ string modName;
+ ModMap::iterator it;
+
+ keyText = text1->text();
+ modName = combo1->currentText();
+
+ it = manager.Modules.find(modName.c_str());
+ if (it != manager.Modules.end()) {
+ it->second->SetKey(keyText.c_str());
+ mlined1->setText(*it->second);
+ label3->setText(it->second->KeyText());
+ }
+
+}
+