summaryrefslogtreecommitdiffstats
path: root/tdeui/tests/ktabctltest.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/ktabctltest.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/ktabctltest.cpp')
-rw-r--r--tdeui/tests/ktabctltest.cpp105
1 files changed, 105 insertions, 0 deletions
diff --git a/tdeui/tests/ktabctltest.cpp b/tdeui/tests/ktabctltest.cpp
new file mode 100644
index 000000000..33e7fc5b7
--- /dev/null
+++ b/tdeui/tests/ktabctltest.cpp
@@ -0,0 +1,105 @@
+/*
+ *
+ */
+
+#include <kapplication.h>
+#include <tqpushbutton.h>
+#include <tqlabel.h>
+#include <tqobject.h>
+#include <tqlistbox.h>
+#include <tqgroupbox.h>
+#include <tqevent.h>
+#include <tqcombobox.h>
+#include <tqlineedit.h>
+#include <tqradiobutton.h>
+#include <tqcheckbox.h>
+#include <tqtabdialog.h>
+#include <tqtooltip.h>
+#include <tqmessagebox.h>
+#include <tqtabbar.h>
+#include <tqpalette.h>
+#include <tqmultilineedit.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "ktabctl.h"
+#include "ktabctltest.h"
+
+TQFont default_font("Helvetica", 12);
+
+KApplication *a;
+
+TopLevel::TopLevel(TQWidget *parent, const char *name)
+ : TQWidget(parent, name)
+{
+ setCaption("KTabCtl test application");
+ setMinimumSize(300, 200);
+
+ /*
+ * add a tabctrl widget
+ */
+
+ test = new KTabCtl(this, "test");
+ connect(test, TQT_SIGNAL(tabSelected(int)), this, TQT_SLOT(tabChanged(int)));
+ TQWidget *w = new TQWidget(test, "_page1");
+ TQPushButton *bt = new TQPushButton("Click me to quit", w, "_bt1");
+ connect(bt, TQT_SIGNAL(clicked()), this, TQT_SLOT(okPressed()));
+ bt->adjustSize();
+ bt->move(20, 20);
+ test->addTab(w, "Seite 1");
+ pages[0] = w;
+ w = new TQWidget(test, "_page2");
+ e = new TQMultiLineEdit(w, "_editor");
+ e->setText("Write some usesless stuff here :-)");
+ w->resize(width(), height());
+ test->addTab(w, "Seite 2");
+ pages[1] = w;
+ w = new TQWidget(test, "_page3");
+ bt = new TQPushButton("This button does absolutely nothing", w, "_bt3");
+ bt->adjustSize();
+ bt->move(20, 20);
+ test->addTab(w, "Seite 3");
+ pages[2] = w;
+ test->resize(200, 200);
+ test->move(0, 0);
+ move(20, 20);
+ resize(400, 300);
+ adjustSize();
+}
+
+void TopLevel::resizeEvent( TQResizeEvent * )
+{
+ test->resize(width(), height());
+ e->setGeometry(10, 10, pages[1]->width() - 20, pages[1]->height() - 20);
+}
+
+void TopLevel::tabChanged(int newpage)
+{
+ printf("tab number %d selected\n", newpage);
+ if(newpage == 1)
+ e->setFocus();
+}
+
+void TopLevel::okPressed()
+{
+ a->quit();
+}
+
+int main( int argc, char ** argv )
+{
+ a = new KApplication ( argc, argv, "KTabCtlTest" );
+
+ a->setFont(default_font);
+
+ TopLevel *toplevel = new TopLevel(0, "_ktabctl_test");
+
+ toplevel->show();
+ a->setMainWidget(toplevel);
+ a->exec();
+}
+
+#include "ktabctltest.moc"
+