diff --git a/bazaar/TimerTest/TimerTest.h b/bazaar/TimerTest/TimerTest.h new file mode 100644 index 000000000..fb9899563 --- /dev/null +++ b/bazaar/TimerTest/TimerTest.h @@ -0,0 +1,25 @@ +#ifndef _TimerTest_TimerTest_h +#define _TimerTest_TimerTest_h + +#include + +using namespace Upp; + +#define LAYOUTFILE +#include + +#include + +class TimerTest : public WithLayout { +public: + typedef TimerTest CLASSNAME; + TimerTest(); + + void Info(const String & s); + void Test(); +private: + Timer t; +}; + +#endif + diff --git a/bazaar/TimerTest/TimerTest.lay b/bazaar/TimerTest/TimerTest.lay new file mode 100644 index 000000000..3a3775a67 --- /dev/null +++ b/bazaar/TimerTest/TimerTest.lay @@ -0,0 +1,4 @@ +LAYOUT(Layout, 200, 100) + ITEM(DocEdit, info, LeftPosZ(20, 160).TopPosZ(16, 76)) +END_LAYOUT + diff --git a/bazaar/TimerTest/TimerTest.upp b/bazaar/TimerTest/TimerTest.upp new file mode 100644 index 000000000..a7f46d125 --- /dev/null +++ b/bazaar/TimerTest/TimerTest.upp @@ -0,0 +1,12 @@ +uses + CtrlLib, + Timer; + +file + TimerTest.h, + main.cpp, + TimerTest.lay; + +mainconfig + "" = "GUI MT"; + diff --git a/bazaar/TimerTest/init b/bazaar/TimerTest/init new file mode 100644 index 000000000..bb43969d5 --- /dev/null +++ b/bazaar/TimerTest/init @@ -0,0 +1,5 @@ +#ifndef _TimerTest_icpp_init_stub +#define _TimerTest_icpp_init_stub +#include "CtrlLib/init" +#include "Timer/init" +#endif diff --git a/bazaar/TimerTest/main.cpp b/bazaar/TimerTest/main.cpp new file mode 100644 index 000000000..b0447e105 --- /dev/null +++ b/bazaar/TimerTest/main.cpp @@ -0,0 +1,34 @@ +#include "TimerTest.h" + +#define REPEAT_TEST + +TimerTest::TimerTest() +{ + CtrlLayout(*this, "Window title"); +#ifdef REPEAT_TEST + t.SetTimeCallback(-1000, THISBACK(Test), 0); +#else + PostCallback(THISBACK(Test)); +#endif +} + +void TimerTest::Info(const String & s) +{ + info.Insert(info.GetLength(), s); + info.SetCursor(info.GetLength()); +} + +void TimerTest::Test() +{ + Info("O"); +#ifdef REPEAT_TEST +#else + t.SetTimeCallback(1000, THISBACK(Test), 0); +#endif +} + +GUI_APP_MAIN +{ + TimerTest().Run(); +} +