Rev 2825 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2825 | Rev 2839 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | 2 | ||
3 | #define ITEM_HEIGHT 18 |
3 | #define ITEM_HEIGHT 18 |
Line 4... | Line 4... | ||
4 | #define ITEM_WIDTH 138 |
4 | #define ITEM_WIDTH 138 |
5 | 5 | ||
6 | char *ITEMS_LIST[]={ |
6 | char *ITEMS_LIST[]={ |
7 | "View in Tinypad F3", |
7 | "View in Tinypad F3",52, |
8 | "View in TextEdit F4", |
8 | "View in TextEdit F4",53, |
9 | "-", |
9 | "-",0, |
10 | "KOI-8 Ctrl+K", |
10 | "KOI-8 Ctrl+K",11, |
Line -... | Line 11... | ||
- | 11 | "UTF Ctrl+U",21, |
|
11 | "UTF Ctrl+U", |
12 | 0}; |
Line 12... | Line 13... | ||
12 | 0}; |
13 | |
13 | 14 | ||
Line 14... | Line 15... | ||
14 | proc_info MenuForm; |
15 | proc_info MenuForm; |
15 | 16 | ||
16 | 17 | ||
Line 17... | Line 18... | ||
17 | void menu_rmb() |
18 | void menu_rmb() |
Line 18... | Line 19... | ||
18 | { |
19 | { |
19 | 20 | ||
Line 41... | Line 42... | ||
41 | } |
42 | } |
Line 42... | Line 43... | ||
42 | 43 | ||
Line 43... | Line 44... | ||
43 | break; |
44 | break; |
44 | 45 | ||
- | 46 | case evButton: |
|
- | 47 | id1=GetButtonID()-10; |
|
45 | case evButton: |
48 | WB1.Scan(ITEMS_LIST[id1*2+1]); |
Line 46... | Line 49... | ||
46 | ItemProcess(GetButtonID()); |
49 | ExitProcess(); |
47 | break; |
50 | break; |
48 | 51 | ||
Line 59... | Line 62... | ||
59 | items_cur++; |
62 | items_cur++; |
60 | goto _ITEMS_DRAW; |
63 | goto _ITEMS_DRAW; |
61 | } |
64 | } |
62 | if (key==13) |
65 | if (key==13) |
63 | { |
66 | { |
- | 67 | WB1.Scan(ITEMS_LIST[items_cur*2+1]); |
|
64 | ItemProcess(items_cur+10); |
68 | ExitProcess(); |
65 | } |
69 | } |
66 | break; |
70 | break; |
Line 67... | Line 71... | ||
67 | 71 | ||
68 | case evReDraw: |
72 | case evReDraw: |
69 | for (items_num=0; ITEMS_LIST[items_num]<>0; items_num++;) {}; |
73 | while (ITEMS_LIST[items_num*2]) items_num++; |
Line 70... | Line 74... | ||
70 | DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinWidth()+3,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x01,0x10FFFFFF,0,0,0); |
74 | DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinWidth()+3,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x01,0x10FFFFFF,0,0,0); |
71 | 75 | ||
72 | DrawRegion(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //îáîäîê |
76 | DrawRegion(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //îáîäîê |
73 | _ITEMS_DRAW: |
77 | _ITEMS_DRAW: |
74 | for (i=0; i |
78 | for (i=0; i |
75 | { |
79 | { |
76 | if (!strcmp(ITEMS_LIST[i],"-")) |
80 | if (!strcmp(ITEMS_LIST[i*2],"-")) |
77 | { |
81 | { |
78 | DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, 0xFFFFFF); |
82 | DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, 0xFFFFFF); |
79 | DrawBar(1, i*ITEM_HEIGHT+1+9, ITEM_WIDTH-1, 1, 0x999999); |
83 | DrawBar(1, i*ITEM_HEIGHT+1+9, ITEM_WIDTH-1, 1, 0x999999); |
80 | continue; |
84 | continue; |
81 | } |
85 | } |
82 | DefineButton(0, i*ITEM_HEIGHT, ITEM_WIDTH, ITEM_HEIGHT, i+10+BT_HIDE, 0xFFFFFF); |
86 | DefineButton(0, i*ITEM_HEIGHT, ITEM_WIDTH, ITEM_HEIGHT, i+10+BT_HIDE, 0xFFFFFF); |
83 | if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE; |
87 | if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE; |
84 | DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX); |
- | |
85 | WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i],0); |
88 | DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX); |
86 | } |
89 | WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2],0); |
87 | } |
- | |
88 | } |
- | |
89 | - | ||
90 | void ItemProcess(int num_id) |
- | |
91 | { |
- | |
92 | if (num_id==10) WB1.Scan(52); |
- | |
93 | if (num_id==11) WB1.Scan(53); |
- | |
94 | //----------------------- |
- | |
95 | if (num_id==13) WB1.Scan(11); //KOI |
- | |
96 | if (num_id==14) WB1.Scan(21); //UTF |
90 | } |