Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2764 | leency | 1 | //Leency - 2012 |
2 | |||
3 | #define ITEM_HEIGHT 18 |
||
4 | #define ITEM_WIDTH 138 |
||
5 | |||
6 | char *ITEMS_LIST[]={ |
||
2839 | leency | 7 | "View in Tinypad F3",52, |
3005 | leency | 8 | "WIN F5",REFRESH, |
9 | "DOS Ctrl+D",04, |
||
3058 | leency | 10 | "KOI Ctrl+K",11, |
2839 | leency | 11 | "UTF Ctrl+U",21, |
2874 | leency | 12 | "Line breaks ON" ,01, |
3062 | leency | 13 | "Free image cache" ,02, |
3005 | leency | 14 | "TrueType fonts" ,05, |
2764 | leency | 15 | 0}; |
16 | |||
2839 | leency | 17 | |
2764 | leency | 18 | proc_info MenuForm; |
19 | |||
20 | |||
21 | void menu_rmb() |
||
22 | { |
||
23 | mouse mm; |
||
2793 | leency | 24 | int items_num, items_cur; |
2839 | leency | 25 | int id1, key, i; |
2764 | leency | 26 | |
27 | SetEventMask(100111b); |
||
3062 | leency | 28 | |
2799 | leency | 29 | loop() switch(WaitEvent()) |
2764 | leency | 30 | { |
2803 | leency | 31 | case evMouse: |
2793 | leency | 32 | mm.get(); |
2803 | leency | 33 | |
34 | GetProcessInfo(#MenuForm, SelfInfo); |
||
2825 | leency | 35 | id1=GetProcessSlot(MenuForm.ID); |
36 | if (id1<>GetActiveProcess()) ExitProcess(); |
||
2799 | leency | 37 | |
2803 | leency | 38 | id1=mm.y/ITEM_HEIGHT; |
39 | if (id1<0) || (id1+1>items_num) || (mm.x<0) || (mm.x>ITEM_WIDTH) break; |
||
2874 | leency | 40 | if (mm.lkm) || (mm.pkm) |
41 | { |
||
42 | WB1.Scan(ITEMS_LIST[items_cur*2+1]); |
||
43 | ExitProcess(); |
||
44 | } |
||
2803 | leency | 45 | if (items_cur<>id1) |
2793 | leency | 46 | { |
2803 | leency | 47 | items_cur=id1; |
2793 | leency | 48 | goto _ITEMS_DRAW; |
49 | } |
||
2764 | leency | 50 | break; |
51 | |||
52 | case evButton: |
||
2839 | leency | 53 | id1=GetButtonID()-10; |
54 | WB1.Scan(ITEMS_LIST[id1*2+1]); |
||
55 | ExitProcess(); |
||
2764 | leency | 56 | break; |
57 | |||
58 | case evKey: |
||
2793 | leency | 59 | key = GetKey(); |
60 | if (key==27) ExitProcess(); |
||
61 | if (key==178) && (items_cur) |
||
62 | { |
||
63 | items_cur--; |
||
64 | goto _ITEMS_DRAW; |
||
65 | } |
||
66 | if (key==177) && (items_cur+1 |
||
67 | { |
||
68 | items_cur++; |
||
69 | goto _ITEMS_DRAW; |
||
70 | } |
||
71 | if (key==13) |
||
72 | { |
||
2839 | leency | 73 | WB1.Scan(ITEMS_LIST[items_cur*2+1]); |
74 | ExitProcess(); |
||
2793 | leency | 75 | } |
2764 | leency | 76 | break; |
77 | |||
78 | case evReDraw: |
||
2839 | leency | 79 | while (ITEMS_LIST[items_num*2]) items_num++; |
3058 | leency | 80 | DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x01,0x10FFFFFF,0,0x01fffFFF); |
2764 | leency | 81 | |
3058 | leency | 82 | DrawRectangle(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //ободок |
2793 | leency | 83 | _ITEMS_DRAW: |
2764 | leency | 84 | for (i=0; i |
85 | { |
||
2793 | leency | 86 | if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE; |
87 | DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX); |
||
2839 | leency | 88 | WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2],0); |
2874 | leency | 89 | if (ITEMS_LIST[i*2+1]==1) && (pre_text==2) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444); |
3005 | leency | 90 | if (ITEMS_LIST[i*2+1]==5) && (use_truetype==1) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444); |
2764 | leency | 91 | } |
3058 | leency | 92 | DrawBar(33, cur_encoding+1*ITEM_HEIGHT+8, 4, 4, 0x444444); //показывает выбраную кодировку |
2764 | leency | 93 | } |
2803 | leency | 94 | }> |
95 | |||
96 |