Rev 8106 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8106 | maxcodehac | 1 | #include |
8104 | maxcodehac | 2 | #include |
3 | #include |
||
4 | |||
8106 | maxcodehac | 5 | #define evReDraw 1 |
6 | #define evKey 2 |
||
7 | #define evButton 3 |
||
8 | #define evExit 4 |
||
9 | #define evDesktop 5 |
||
10 | #define evMouse 6 |
||
11 | #define evIPC 7 |
||
12 | #define evNetwork 8 |
||
13 | #define evDebug 9 |
||
8104 | maxcodehac | 14 | |
8106 | maxcodehac | 15 | #define WIN_W 640 |
16 | #define WIN_H 563 |
||
8104 | maxcodehac | 17 | |
8106 | maxcodehac | 18 | char* title = "Boxlib example"; |
19 | int win_bg_color = 0x858585; |
||
20 | scrollbar scroll = {15, WIN_W - 26, WIN_H - 29, 0, 0, 2, 115, 15, 0,0x707070,0xD2CED0,0x555555,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1}; |
||
8104 | maxcodehac | 21 | |
8106 | maxcodehac | 22 | void draw_window(){ |
23 | begin_draw(); |
||
24 | sys_create_window(215,100,WIN_W,WIN_H,title,win_bg_color,0x34); |
||
25 | scrollbar_v_draw(&scroll); |
||
26 | end_draw(); |
||
27 | } |
||
8104 | maxcodehac | 28 | |
8106 | maxcodehac | 29 | //// EVENTMASK |
30 | #define EVM_REDRAW 1 |
||
31 | #define EVM_KEY 2 |
||
32 | #define EVM_BUTTON 4 |
||
33 | #define EVM_EXIT 8 |
||
34 | #define EVM_BACKGROUND 16 |
||
35 | #define EVM_MOUSE 32 |
||
36 | #define EVM_IPC 64 |
||
37 | #define EVM_STACK 128 |
||
38 | #define EVM_DEBUG 256 |
||
39 | #define EVM_STACK2 512 |
||
40 | #define EVM_MOUSE_FILTER 0x80000000 |
||
41 | #define EVM_CURSOR_FILTER 0x40000000 |
||
42 | //// EVENTMASK |
||
8104 | maxcodehac | 43 | |
44 | |||
8106 | maxcodehac | 45 | int main() |
46 | { |
||
47 | kolibri_boxlib_init(); |
||
48 | |||
49 | set_event_mask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); |
||
50 | while(1) |
||
51 | { |
||
52 | switch(get_os_event()) |
||
53 | { |
||
54 | case evButton: |
||
55 | if (get_os_button() == 1) exit(0); |
||
56 | break; |
||
57 | |||
58 | case evKey: |
||
59 | get_key(); |
||
60 | break; |
||
61 | |||
62 | case evReDraw: |
||
63 | draw_window(); |
||
64 | break; |
||
65 | case evMouse: |
||
66 | scrollbar_v_mouse(&scroll); |
||
67 | break; |
||
68 | } |
||
69 | } |
||
8104 | maxcodehac | 70 | } |