Subversion Repositories Kolibri OS

Rev

Rev 7447 | Rev 7782 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6041 leency 1
#define MEMSIZE 4096*10
2
 
3
#include "../lib/io.h"
4
#include "../lib/list_box.h"
5
#include "../lib/gui.h"
6
 
7
struct _object
8
{
9
	int x,y,w,h,id;
10
};
11
 
12
_object butv = { 20, 20, 100, 30, 10};
13
_object buta = {150, 20, 100, 30, 20};
14
 
15
char vegetables[] =
16
"Onion
17
Melon
18
Tomato
19
Squash
20
Salad";
21
 
22
char animals[] =
23
"Cat
24
Dog
25
Pig
26
Cow
27
Goat
28
Rabbit";
29
 
30
byte category;
31
 
32
 
33
void main()
34
{
35
	proc_info Form;
36
	int id;
37
 
38
	loop() switch(WaitEvent())
39
	{
40
	 case evButton:
41
		id=GetButtonID();
42
		if (id==1) ExitProcess();
43
		if (id==butv.id) {
44
			menu.selected = category+1;
6782 leency 45
			menu.show(Form.left+5 + butv.x, Form.top+skin_height + butv.y + butv.h, 140, #vegetables, butv.id);
6041 leency 46
		}
47
		if (id==buta.id) {
48
			menu.selected = 0;
6782 leency 49
			menu.show(Form.left+5 + buta.x, Form.top+skin_height + buta.y + buta.h, 140,    #animals, buta.id);
6041 leency 50
		}
51
		break;
52
 
53
	case evKey:
54
		GetKeys();
55
		break;
56
 
57
	 case evReDraw:
7450 leency 58
		if (menu.cur_y) {
59
			if (menu.cur_y > butv.id) && (menu.cur_y < buta.id) category = menu.cur_y - butv.id;
6041 leency 60
		}
6746 leency 61
		DefineAndDrawWindow(215,100,350,300,0x34,0xFFFFFF,"Window header",0);
6041 leency 62
		GetProcessInfo(#Form, SelfInfo);
63
		WriteText(10,110,0x80,0,#param);
64
		DrawCaptButton(butv.x, butv.y, butv.w, butv.h, butv.id, 0xCCCccc, 0x000000, "Vegetables");
65
		DrawCaptButton(buta.x, buta.y, buta.w, buta.h, buta.id, 0xCCCccc, 0x000000, "Aminal");
66
		break;
67
	}
68
}