2012-06-13 16:11:10 +02:00
|
|
|
|
//Leency - 2012
|
|
|
|
|
|
|
|
|
|
#define ITEM_HEIGHT 18
|
|
|
|
|
#define ITEM_WIDTH 138
|
|
|
|
|
|
|
|
|
|
char *ITEMS_LIST[]={
|
2012-07-02 20:24:48 +02:00
|
|
|
|
"View in Tinypad F3",52,
|
|
|
|
|
"View in TextEdit F4",53,
|
|
|
|
|
"KOI-8 Ctrl+K",11,
|
|
|
|
|
"UTF Ctrl+U",21,
|
2012-07-16 13:52:03 +02:00
|
|
|
|
"DOS Ctrl+D",04,
|
|
|
|
|
"Line breaks ON" ,01,
|
2012-06-13 16:11:10 +02:00
|
|
|
|
0};
|
|
|
|
|
|
2012-07-02 20:24:48 +02:00
|
|
|
|
|
2012-06-13 16:11:10 +02:00
|
|
|
|
proc_info MenuForm;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void menu_rmb()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
mouse mm;
|
2012-06-16 15:39:38 +02:00
|
|
|
|
int items_num, items_cur;
|
2012-07-02 20:24:48 +02:00
|
|
|
|
int id1, key, i;
|
2012-06-13 16:11:10 +02:00
|
|
|
|
|
|
|
|
|
SetEventMask(100111b);
|
|
|
|
|
|
2012-06-16 20:35:16 +02:00
|
|
|
|
loop() switch(WaitEvent())
|
2012-06-13 16:11:10 +02:00
|
|
|
|
{
|
2012-06-17 14:03:52 +02:00
|
|
|
|
case evMouse:
|
2012-06-16 15:39:38 +02:00
|
|
|
|
mm.get();
|
2012-06-17 14:03:52 +02:00
|
|
|
|
|
|
|
|
|
GetProcessInfo(#MenuForm, SelfInfo);
|
2012-06-25 16:14:43 +02:00
|
|
|
|
id1=GetProcessSlot(MenuForm.ID);
|
|
|
|
|
if (id1<>GetActiveProcess()) ExitProcess();
|
2012-06-16 20:35:16 +02:00
|
|
|
|
|
2012-06-17 14:03:52 +02:00
|
|
|
|
id1=mm.y/ITEM_HEIGHT;
|
|
|
|
|
if (id1<0) || (id1+1>items_num) || (mm.x<0) || (mm.x>ITEM_WIDTH) break;
|
2012-07-16 13:52:03 +02:00
|
|
|
|
if (mm.lkm) || (mm.pkm)
|
|
|
|
|
{
|
|
|
|
|
WB1.Scan(ITEMS_LIST[items_cur*2+1]);
|
|
|
|
|
ExitProcess();
|
|
|
|
|
}
|
2012-06-17 14:03:52 +02:00
|
|
|
|
if (items_cur<>id1)
|
2012-06-16 15:39:38 +02:00
|
|
|
|
{
|
2012-06-17 14:03:52 +02:00
|
|
|
|
items_cur=id1;
|
2012-06-16 15:39:38 +02:00
|
|
|
|
goto _ITEMS_DRAW;
|
|
|
|
|
}
|
|
|
|
|
|
2012-06-13 16:11:10 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evButton:
|
2012-07-02 20:24:48 +02:00
|
|
|
|
id1=GetButtonID()-10;
|
|
|
|
|
WB1.Scan(ITEMS_LIST[id1*2+1]);
|
|
|
|
|
ExitProcess();
|
2012-06-13 16:11:10 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evKey:
|
2012-06-16 15:39:38 +02:00
|
|
|
|
key = GetKey();
|
|
|
|
|
if (key==27) ExitProcess();
|
|
|
|
|
if (key==178) && (items_cur)
|
|
|
|
|
{
|
|
|
|
|
items_cur--;
|
|
|
|
|
goto _ITEMS_DRAW;
|
|
|
|
|
}
|
|
|
|
|
if (key==177) && (items_cur+1<items_num)
|
|
|
|
|
{
|
|
|
|
|
items_cur++;
|
|
|
|
|
goto _ITEMS_DRAW;
|
|
|
|
|
}
|
|
|
|
|
if (key==13)
|
|
|
|
|
{
|
2012-07-02 20:24:48 +02:00
|
|
|
|
WB1.Scan(ITEMS_LIST[items_cur*2+1]);
|
|
|
|
|
ExitProcess();
|
2012-06-16 15:39:38 +02:00
|
|
|
|
}
|
2012-06-13 16:11:10 +02:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case evReDraw:
|
2012-07-02 20:24:48 +02:00
|
|
|
|
while (ITEMS_LIST[items_num*2]) items_num++;
|
2012-07-16 13:52:03 +02:00
|
|
|
|
DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x01,0x10FFFFFF,0);
|
|
|
|
|
DefineButton(0, 0, ITEM_WIDTH, ITEM_HEIGHT, 10+BT_HIDE+BT_NOFRAME, 0); //hack
|
2012-06-13 16:11:10 +02:00
|
|
|
|
|
2012-06-16 15:39:38 +02:00
|
|
|
|
DrawRegion(0,0,ITEM_WIDTH,items_num*ITEM_HEIGHT+1,0x777777); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
_ITEMS_DRAW:
|
2012-06-13 16:11:10 +02:00
|
|
|
|
for (i=0; i<items_num; i++;)
|
|
|
|
|
{
|
2012-06-16 15:39:38 +02:00
|
|
|
|
if (i<>items_cur) EDX=0xFFFFFF; else EDX=0x94AECE;
|
|
|
|
|
DrawBar(1, i*ITEM_HEIGHT+1, ITEM_WIDTH-1, ITEM_HEIGHT, EDX);
|
2012-07-02 20:24:48 +02:00
|
|
|
|
WriteText(8,i*ITEM_HEIGHT+6,0x80,0x000000,ITEMS_LIST[i*2],0);
|
2012-07-16 13:52:03 +02:00
|
|
|
|
if (ITEMS_LIST[i*2+1]==1) && (pre_text==2) DrawBar(ITEM_WIDTH-18, i*ITEM_HEIGHT+8, 4, 4, 0x444444);
|
2012-06-13 16:11:10 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2012-06-17 14:03:52 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|