Timer test: First release

git-svn-id: svn://ultimatepp.org/upp/trunk@2100 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
koldo 2010-02-19 23:07:46 +00:00
parent abaf765ca0
commit b286a613b6
5 changed files with 80 additions and 0 deletions

View file

@ -0,0 +1,25 @@
#ifndef _TimerTest_TimerTest_h
#define _TimerTest_TimerTest_h
#include <CtrlLib/CtrlLib.h>
using namespace Upp;
#define LAYOUTFILE <TimerTest/TimerTest.lay>
#include <CtrlCore/lay.h>
#include <Timer/Timer.h>
class TimerTest : public WithLayout<TopWindow> {
public:
typedef TimerTest CLASSNAME;
TimerTest();
void Info(const String & s);
void Test();
private:
Timer t;
};
#endif

View file

@ -0,0 +1,4 @@
LAYOUT(Layout, 200, 100)
ITEM(DocEdit, info, LeftPosZ(20, 160).TopPosZ(16, 76))
END_LAYOUT

View file

@ -0,0 +1,12 @@
uses
CtrlLib,
Timer;
file
TimerTest.h,
main.cpp,
TimerTest.lay;
mainconfig
"" = "GUI MT";

5
bazaar/TimerTest/init Normal file
View file

@ -0,0 +1,5 @@
#ifndef _TimerTest_icpp_init_stub
#define _TimerTest_icpp_init_stub
#include "CtrlLib/init"
#include "Timer/init"
#endif

34
bazaar/TimerTest/main.cpp Normal file
View file

@ -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();
}