2016-01-07 16:26:59 +01:00
|
|
|
#define MEMSIZE 4096*10
|
|
|
|
|
|
|
|
#include "../lib/io.h"
|
|
|
|
#include "../lib/list_box.h"
|
|
|
|
#include "../lib/gui.h"
|
|
|
|
#include "../lib/menu.h"
|
|
|
|
|
|
|
|
struct _object
|
|
|
|
{
|
|
|
|
int x,y,w,h,id;
|
|
|
|
};
|
|
|
|
|
|
|
|
_object butv = { 20, 20, 100, 30, 10};
|
|
|
|
_object buta = {150, 20, 100, 30, 20};
|
|
|
|
|
|
|
|
char vegetables[] =
|
|
|
|
"Onion
|
|
|
|
Melon
|
|
|
|
Tomato
|
|
|
|
Squash
|
|
|
|
Salad";
|
|
|
|
|
|
|
|
char animals[] =
|
|
|
|
"Cat
|
|
|
|
Dog
|
|
|
|
Pig
|
|
|
|
Cow
|
|
|
|
Goat
|
|
|
|
Rabbit";
|
|
|
|
|
|
|
|
byte category;
|
|
|
|
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
proc_info Form;
|
|
|
|
int id;
|
|
|
|
|
|
|
|
loop() switch(WaitEvent())
|
|
|
|
{
|
|
|
|
case evButton:
|
|
|
|
id=GetButtonID();
|
|
|
|
if (id==1) ExitProcess();
|
|
|
|
if (id==butv.id) {
|
|
|
|
menu.selected = category+1;
|
2016-12-04 17:50:34 +01:00
|
|
|
menu.show(Form.left+5 + butv.x, Form.top+skin_height + butv.y + butv.h, 140, #vegetables, butv.id);
|
2016-01-07 16:26:59 +01:00
|
|
|
}
|
|
|
|
if (id==buta.id) {
|
|
|
|
menu.selected = 0;
|
2016-12-04 17:50:34 +01:00
|
|
|
menu.show(Form.left+5 + buta.x, Form.top+skin_height + buta.y + buta.h, 140, #animals, buta.id);
|
2016-01-07 16:26:59 +01:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case evKey:
|
|
|
|
GetKeys();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case evReDraw:
|
|
|
|
if (menu.list.cur_y) {
|
|
|
|
if (menu.list.cur_y > butv.id) && (menu.list.cur_y < buta.id) category = menu.list.cur_y - butv.id;
|
|
|
|
}
|
2016-11-23 12:37:13 +01:00
|
|
|
DefineAndDrawWindow(215,100,350,300,0x34,0xFFFFFF,"Window header",0);
|
2016-01-07 16:26:59 +01:00
|
|
|
GetProcessInfo(#Form, SelfInfo);
|
|
|
|
WriteText(10,110,0x80,0,#param);
|
|
|
|
DrawCaptButton(butv.x, butv.y, butv.w, butv.h, butv.id, 0xCCCccc, 0x000000, "Vegetables");
|
|
|
|
DrawCaptButton(buta.x, buta.y, buta.w, buta.h, buta.id, 0xCCCccc, 0x000000, "Aminal");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|