summaryrefslogtreecommitdiffstats
path: root/tdeui/tests/kpanelmenutest.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-06 15:56:40 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-11-06 15:56:40 -0600
commite16866e072f94410321d70daedbcb855ea878cac (patch)
treeee3f52eabde7da1a0e6ca845fb9c2813cf1558cf /tdeui/tests/kpanelmenutest.cpp
parenta58c20c1a7593631a1b50213c805507ebc16adaf (diff)
downloadtdelibs-e16866e072f94410321d70daedbcb855ea878cac.tar.gz
tdelibs-e16866e072f94410321d70daedbcb855ea878cac.zip
Actually move the kde files that were renamed in the last commit
Diffstat (limited to 'tdeui/tests/kpanelmenutest.cpp')
-rw-r--r--tdeui/tests/kpanelmenutest.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/tdeui/tests/kpanelmenutest.cpp b/tdeui/tests/kpanelmenutest.cpp
new file mode 100644
index 000000000..e081e467f
--- /dev/null
+++ b/tdeui/tests/kpanelmenutest.cpp
@@ -0,0 +1,72 @@
+#include "kpanelmenutest.h"
+#include <kapplication.h>
+#include <kstandarddirs.h>
+#include <dcopclient.h>
+
+TestWidget::TestWidget(TQWidget *parent, const char *name)
+ : TQLabel(parent, name)
+{
+ testMenu = new KPanelAppMenu(locate("mini", "x.png"), "Client Test", this,
+ "menu1");
+
+ subMenu = testMenu->insertMenu(locate("mini", "x.png"), "Submenu Test");
+ subMenu->insertItem(locate("mini", "bx2.png"), "First Entry", 100);
+ subMenu->insertItem(locate("mini", "bx2.png"), "Second Entry", 101);
+
+ KPanelAppMenu *ssub = subMenu->insertMenu(locate("mini", "x.png"), "One more");
+
+ connect(testMenu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotMenuCalled(int)));
+ connect(subMenu, TQT_SIGNAL(activated(int)), TQT_SLOT(slotSubMenuCalled(int)));
+ init();
+
+ setText("We added \"Client Test\" to kicker. Click the K Menu to check.");
+ resize(tqsizeHint());
+}
+
+void TestWidget::init()
+{
+ testMenu->insertItem(locate("mini", "bx2.png"),
+ "Add another entry!", 1);
+ testMenu->insertItem("Attention, this will clear the menu", 2);
+}
+
+void TestWidget::slotMenuCalled(int id)
+{
+ switch ( id ) {
+ case 1:
+ setText("Selected \"Add another entry!\" ");
+ testMenu->insertItem("Another entry");
+ break;
+ case 2:
+ setText("Selected \"Attention, this will clear the menu\"");
+ testMenu->clear();
+ init();
+ break;
+ default:
+ setText("Selected \"Another entry...\"");
+ }
+}
+
+
+void TestWidget::slotSubMenuCalled(int id)
+{
+ TQString msg("Called with id=%1");
+ setText(msg.arg(id));
+}
+
+
+int main(int argc, char **argv)
+{
+ KApplication *app = new KApplication(argc, argv, "menutest");
+
+ TestWidget w;
+ app->setMainWidget(&w);
+ w.show();
+
+ app->exec();
+}
+
+#include "kpanelmenutest.moc"
+
+
+