mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Timer test: First release
git-svn-id: svn://ultimatepp.org/upp/trunk@2100 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
abaf765ca0
commit
b286a613b6
5 changed files with 80 additions and 0 deletions
25
bazaar/TimerTest/TimerTest.h
Normal file
25
bazaar/TimerTest/TimerTest.h
Normal 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
|
||||
|
||||
4
bazaar/TimerTest/TimerTest.lay
Normal file
4
bazaar/TimerTest/TimerTest.lay
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
LAYOUT(Layout, 200, 100)
|
||||
ITEM(DocEdit, info, LeftPosZ(20, 160).TopPosZ(16, 76))
|
||||
END_LAYOUT
|
||||
|
||||
12
bazaar/TimerTest/TimerTest.upp
Normal file
12
bazaar/TimerTest/TimerTest.upp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
uses
|
||||
CtrlLib,
|
||||
Timer;
|
||||
|
||||
file
|
||||
TimerTest.h,
|
||||
main.cpp,
|
||||
TimerTest.lay;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI MT";
|
||||
|
||||
5
bazaar/TimerTest/init
Normal file
5
bazaar/TimerTest/init
Normal 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
34
bazaar/TimerTest/main.cpp
Normal 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();
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue