Subversion Repositories Kolibri OS

Rev

Rev 8165 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8153 maxcodehac 1
#include 
2
#include 
3
#include 
4
 
5
using namespace Kolibri;
6
 
8166 maxcodehac 7
const char header[] = "Colors";
8153 maxcodehac 8
 
9
bool KolibriOnStart(TStartData &kos_start, TThreadData th)
10
{
11
	kos_start.Left = 10;
12
	kos_start.Top = 40;
8166 maxcodehac 13
	kos_start.Width = 135;
8153 maxcodehac 14
	kos_start.Height = 80;
15
	kos_start.WinData.WindowColor = 0xFFFFFF;
8166 maxcodehac 16
	kos_start.WinData.WindowType = 0x34; // 0x34 - fixed, 0x33 - not fixed
8153 maxcodehac 17
	kos_start.WinData.Title = header;
18
	return true;
19
}
20
 
21
void KolibriOnPaint(void)
22
{
8166 maxcodehac 23
	// If button have ID 1, this is close button
8165 IgorA 24
	DrawButton(2,0xff0000, 10,40,50,20);
25
	DrawButton(3,0x00ff00, 70,10,50,20);
26
	DrawButton(4,0x0000ff, 70,40,50,20);
8166 maxcodehac 27
	DrawButton(5,0xFFFE00, 10,10,50,20);
8153 maxcodehac 28
}
8165 IgorA 29
 
30
void KolibriOnButton(long id, TThreadData th)
31
{
32
	switch(id){
33
	case 2:
34
		SetWindowCaption("Red");
35
		break;
36
	case 3:
37
		SetWindowCaption("Green");
38
		break;
39
	case 4:
40
		SetWindowCaption("Blue");
8166 maxcodehac 41
		break;
42
	case 5:
43
		SetWindowCaption("Yellow");
8165 IgorA 44
		//break;
45
	};
46
}
47
/*
8153 maxcodehac 48
int KolibriOnIdle(TThreadData th)
49
{
50
	return -1;
51
}
52
void KolibriOnSize(int window_rect[], TThreadData th) {}
53
void KolibriOnKeyPress(TThreadData th)
54
{
55
	GetKey();
56
}
57
void KolibriOnMouse(TThreadData th) {}
8166 maxcodehac 58
*/