Rev 7450 | Rev 8020 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7450 | Rev 7782 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #define MEMSIZE 4096*10 |
1 | #define MEMSIZE 4096*10 |
Line 2... | Line 2... | ||
2 | 2 | ||
3 | #include "../lib/io.h" |
3 | #include "../lib/io.h" |
4 | #include "../lib/list_box.h" |
4 | #include "../lib/list_box.h" |
- | 5 | #include "../lib/gui.h" |
|
Line 5... | Line 6... | ||
5 | #include "../lib/gui.h" |
6 | #include "../lib/fs.h" |
6 | 7 | ||
7 | struct _object |
8 | struct _object |
8 | { |
9 | { |
Line 9... | Line 10... | ||
9 | int x,y,w,h,id; |
10 | int x,y,w,h,id; |
10 | }; |
11 | }; |
Line 11... | Line 12... | ||
11 | 12 | ||
12 | _object butv = { 20, 20, 100, 30, 10}; |
13 | _object butv = { 20, 20, 100, 20, 10}; |
13 | _object buta = {150, 20, 100, 30, 20}; |
14 | _object buta = {150, 20, 100, 20, 20}; |
14 | 15 | ||
Line 25... | Line 26... | ||
25 | Pig |
26 | Pig |
26 | Cow |
27 | Cow |
27 | Goat |
28 | Goat |
28 | Rabbit"; |
29 | Rabbit"; |
Line 29... | Line -... | ||
29 | - | ||
Line 30... | Line 30... | ||
30 | byte category; |
30 | |
31 | 31 | ||
- | 32 | ||
32 | 33 | void main() |
|
- | 34 | { |
|
33 | void main() |
35 | dword menu_id=0, click_id; |
Line 34... | Line 36... | ||
34 | { |
36 | proc_info Form; |
35 | proc_info Form; |
37 | byte current_animal=1, current_veg=3; |
36 | int id; |
38 | int id; |
37 | 39 | ||
38 | loop() switch(WaitEvent()) |
40 | loop() switch(WaitEvent()) |
39 | { |
41 | { |
40 | case evButton: |
42 | case evButton: |
41 | id=GetButtonID(); |
43 | id=GetButtonID(); |
- | 44 | if (id==1) ExitProcess(); |
|
42 | if (id==1) ExitProcess(); |
45 | if (id==butv.id) { |
43 | if (id==butv.id) { |
46 | menu_id = butv.id; |
44 | menu.selected = category+1; |
47 | open_lmenu(Form.left+3 + butv.x, Form.top+skin_height + butv.y + butv.h, |
45 | menu.show(Form.left+5 + butv.x, Form.top+skin_height + butv.y + butv.h, 140, #vegetables, butv.id); |
48 | MENU_ALIGN_TOP_LEFT, current_veg, #vegetables); |
- | 49 | } |
|
46 | } |
50 | if (id==buta.id) { |
47 | if (id==buta.id) { |
51 | menu_id = buta.id; |
Line 48... | Line 52... | ||
48 | menu.selected = 0; |
52 | open_lmenu(Form.left+5 + buta.x + buta.w, Form.top+skin_height + buta.y + buta.h, |
49 | menu.show(Form.left+5 + buta.x, Form.top+skin_height + buta.y + buta.h, 140, #animals, buta.id); |
53 | MENU_ALIGN_TOP_RIGHT, current_animal, #animals); |
50 | } |
54 | } |
Line 51... | Line 55... | ||
51 | break; |
55 | break; |
52 | 56 | ||
- | 57 | case evKey: |
|
53 | case evKey: |
58 | GetKeys(); |
- | 59 | break; |
|
54 | GetKeys(); |
60 | |
55 | break; |
61 | case evReDraw: |
56 | 62 | if (click_id = get_menu_click()) { |
|
57 | case evReDraw: |
63 | if (menu_id == butv.id) current_veg = click_id; |
58 | if (menu.cur_y) { |
64 | if (menu_id == buta.id) current_animal = click_id; |