From e16866e072f94410321d70daedbcb855ea878cac Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 6 Nov 2011 15:56:40 -0600 Subject: Actually move the kde files that were renamed in the last commit --- tdeui/tests/kpopuptest.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tdeui/tests/kpopuptest.cpp (limited to 'tdeui/tests/kpopuptest.cpp') diff --git a/tdeui/tests/kpopuptest.cpp b/tdeui/tests/kpopuptest.cpp new file mode 100644 index 000000000..3db71106b --- /dev/null +++ b/tdeui/tests/kpopuptest.cpp @@ -0,0 +1,40 @@ +#include +#include +#include +#include "kpopupmenu.h" + +class DemoWidget : public TQWidget { +private: + KPopupMenu *menu; + +void mousePressEvent(TQMouseEvent *) +{ + menu->popup(TQCursor::pos()); +} + +void paintEvent(TQPaintEvent *) +{ + drawText(32, 32, "Press a Mouse Button!"); +} + +public: + DemoWidget() : TQWidget() + { + menu = new KPopupMenu("Popup Menu:"); + menu->insertItem("Item1"); + menu->insertItem("Item2"); + menu->insertSeparator(); + menu->insertItem("Quit", tqApp, TQT_SLOT(quit())); + } +}; + +int main(int argc, char **argv) +{ + KApplication app(argc, argv, "kpopupmenutest"); + DemoWidget w; + app.setMainWidget(&w); + w.setFont(TQFont("helvetica", 12, TQFont::Bold), true); + w.show(); + return app.exec(); +} + -- cgit v1.2.1