Rev 720 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
719 | jacekm | 1 | #asm |
2 | use32 |
||
3 | org 0x0 |
||
4 | |||
5 | db 'MENUET01' |
||
6 | dd 0x01 |
||
7 | dd _main |
||
8 | dd I_END |
||
9 | dd 0x100000 |
||
10 | dd 0x7fff0 |
||
11 | dd 0x0,0x0 |
||
12 | |||
13 | include 'INTRINS.ASM' |
||
14 | #endasm |
||
15 | |||
16 | #include "klib.h" |
||
721 | jacekm | 17 | |
18 | // CONTROLS: |
||
19 | #define CONTROLS 2 |
||
20 | int control[CONTROLS]; |
||
21 | int cont1[7] = { CheckBox,4,10,40,0x111111,0xFFFFFF,0}; |
||
22 | int cont2[7] = { CheckBox,5,25,55,0xBBBBBB,0,0}; |
||
719 | jacekm | 23 | |
24 | void main() |
||
721 | jacekm | 25 | { |
26 | int event; |
||
27 | int button_id; |
||
28 | |||
29 | control[0]=&cont1[0]; |
||
30 | control[1]=&cont2[0]; |
||
31 | |||
32 | draw_window(); |
||
33 | while(1) |
||
719 | jacekm | 34 | { |
721 | jacekm | 35 | event=get_event(); |
36 | switch(event) |
||
37 | { |
||
38 | case 1: draw_window(); break; |
||
39 | case 2: get_button(); break; |
||
40 | case 3: button_id=get_button(); |
||
41 | eventControls(control,CONTROLS,button_id); |
||
42 | if(button_id==1) s_quit(); |
||
43 | break; |
||
44 | } |
||
719 | jacekm | 45 | } |
46 | } |
||
47 | |||
48 | char text1[50]="THIS IS AN EXAMPLE OF C"; |
||
49 | char text2[50]="PROGRAM IN KOLIBRIOS"; |
||
50 | char text3[50]=""; |
||
51 | char text4[50]="SUCCESS"; |
||
52 | int p_text[4]; |
||
721 | jacekm | 53 | |
54 | |||
719 | jacekm | 55 | |
56 | draw_window() |
||
721 | jacekm | 57 | { |
58 | int i; /* for index */ |
||
59 | int y;y=25; |
||
60 | |||
61 | p_text[0]=&text1[0]; |
||
62 | p_text[1]=&text2[0]; |
||
63 | p_text[2]=&text3[0]; |
||
64 | p_text[3]=&text4[0]; |
||
65 | |||
66 | begin_draw(); |
||
67 | |||
68 | window(100,100,320,150,0x03ffffff,0x805080d0,0x005080d0); |
||
69 | label(8,8,0x10ddeeff,"Example application"); |
||
70 | buttonT(50,35,60,12,0x111111,1, "Click Me!", 0xFFFFFF); |
||
71 | //checkbox(cbTest); |
||
72 | |||
73 | renderControls(control, CONTROLS); |
||
74 | |||
75 | for(i=0;i<4;i++) |
||
76 | label(20,40+(y+=10),0x000000,p_text[i]); |
||
77 | |||
78 | end_draw(); |
||
719 | jacekm | 79 | } |
80 | |||
81 | #asm |
||
82 | I_END: |
||
83 | #endasm4;i++) |
||
84 |