Subversion Repositories Kolibri OS

Rev

Rev 720 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 720 Rev 721
Line 13... Line 13...
13
include 'INTRINS.ASM'
13
include 'INTRINS.ASM'
14
#endasm
14
#endasm
Line 15... Line 15...
15
 
15
 
Line -... Line 16...
-
 
16
#include "klib.h" 
-
 
17
 
-
 
18
// CONTROLS:   
-
 
19
#define CONTROLS 2
-
 
20
int control[CONTROLS];
-
 
21
int cont1[7] = { CheckBox,4,10,40,0x111111,0xFFFFFF,0};
16
#include "klib.h" 
22
int cont2[7] = { CheckBox,5,25,55,0xBBBBBB,0,0};
-
 
23
   
17
   
24
void main()
18
void main()
25
{
Line -... Line 26...
-
 
26
	int  event;
-
 
27
	int  button_id;
-
 
28
	
19
{int  event;
29
	control[0]=&cont1[0];
20
 int  button_id;
30
	control[1]=&cont2[0];	
21
   
31
 
22
 draw_window();
32
	draw_window();
23
 while(1)
33
	while(1)
24
 {
34
	{
25
	event=get_event();
35
		event=get_event();
26
	switch(event)
36
		switch(event)
27
	{
37
		{
-
 
38
			case 1: draw_window(); break;
28
		case 1: draw_window(); break;
39
			case 2: get_button(); break;
29
		case 2: get_button(); break;
40
			case 3: button_id=get_button();
30
		case 3: button_id=get_button();
41
			    eventControls(control,CONTROLS,button_id);
31
			if(button_id==1) s_quit();
42
				if(button_id==1) s_quit();
32
		break;
43
			break;
Line 38... Line 49...
38
char text2[50]="PROGRAM IN KOLIBRIOS";
49
char text2[50]="PROGRAM IN KOLIBRIOS";
39
char text3[50]="";
50
char text3[50]="";
40
char text4[50]="SUCCESS";
51
char text4[50]="SUCCESS";
41
int  p_text[4];
52
int  p_text[4];
Line -... Line 53...
-
 
53
 
-
 
54
 
42
   
55
   
-
 
56
draw_window()
43
draw_window()
57
{
44
{int i; /* for index */
58
	int i; /* for index */
Line 45... Line 59...
45
 int y;y=25;
59
	int y;y=25;	
46
   
60
 
47
 p_text[0]=&text1[0];
61
	p_text[0]=&text1[0];
Line 52... Line 66...
52
 begin_draw();
66
	begin_draw();
Line 53... Line 67...
53
   
67
 
54
 window(100,100,320,150,0x03ffffff,0x805080d0,0x005080d0);
68
	window(100,100,320,150,0x03ffffff,0x805080d0,0x005080d0);
55
 label(8,8,0x10ddeeff,"Example application");
69
	label(8,8,0x10ddeeff,"Example application");
-
 
70
	buttonT(50,35,60,12,0x111111,1, "Click Me!", 0xFFFFFF);
-
 
71
	//checkbox(cbTest);
-
 
72
	
Line 56... Line 73...
56
 buttonT(50,35,60,12,0x111111,1, "Click Me!", 0xFFFFFF);
73
	renderControls(control, CONTROLS);
57
   
74
 
Line 58... Line 75...
58
 for(i=0;i<4;i++)
75
	for(i=0;i<4;i++)