/programs/cmm/browser/include/menu_rmb.h |
---|
24,10 → 24,11 |
dword col_work = 0xE4DFE1; |
dword col_border = 0x9098B0; |
menu.first = menu.current = 0; |
while (ITEMS_LIST[menu.count*2]) {menu.count++; menu.visible++;} |
menu.line_h = 19; |
menu.w = 165; |
menu.line_h = 19; |
menu.first = 0; |
while (ITEMS_LIST[menu.count*2]) {menu.count++; menu.visible++;} |
menu.h = menu.count * menu.line_h; |
SetEventMask(100111b); |
loop() switch(WaitEvent()) |
38,18 → 39,8 |
if (N<>GetActiveProcess()) ExitProcess(); |
mm.get(); |
overid=mm.y/menu.line_h; |
if (overid<0) || (overid+1>menu.count) || (mm.x<0) || (mm.x>menu.w) break; |
if (mm.lkm) || (mm.pkm) |
{ |
action_buf = ITEMS_LIST[menu.current*2+1]; |
ExitProcess(); |
} |
if (menu.current<>overid) |
{ |
menu.current=overid; |
goto _ITEMS_DRAW; |
} |
if (menu.ProcessMouse(mm.x, mm.y)) goto _ITEMS_DRAW; |
if (mm.lkm) || (mm.pkm) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); } |
break; |
case evKey: |
/programs/cmm/eolite/include/menu.h |
---|
53,7 → 53,7 |
int index; |
menu.ClearList(); |
menu.SetSizes(m.x+Form.left+5,m.y+Form.top+GetSkinHeight(),10,0,0,18); |
menu.SetSizes(0,0,10,0,0,18); |
for (index=0; file_captions[index]!=0; index+=3) |
{ |
if (itdir) && (file_captions[index+2]>=200) continue; |
72,13 → 72,7 |
slot = GetProcessSlot(MenuForm.ID); |
if (slot != GetActiveProcess()) ExitProcess(); |
mm.get(); |
menu.current_temp = mm.y - 1 / menu.line_h; |
if (mm.y<=0) || (mm.y>menu.h+5) || (mm.x<0) || (mm.x>menu.w) menu.current_temp = -1; |
if (menu.current<>menu.current_temp) |
{ |
menu.current=menu.current_temp; |
MenuListRedraw(); |
} |
if (menu.ProcessMouse(mm.x, mm.y)) MenuListRedraw(); |
if (mm.lkm) {action_buf = cur_action_buf; pause(5); ExitProcess(); } |
break; |
90,7 → 84,7 |
break; |
case evReDraw: _MENU_DRAW: |
DefineAndDrawWindow(menu.x, menu.y,menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF); |
DefineAndDrawWindow(m.x+Form.left+5, m.y+Form.top+GetSkinHeight(),menu.w+3,menu.h+6,0x01, 0, 0, 0x01fffFFF); |
GetProcessInfo(#MenuForm, SelfInfo); |
DrawRectangle(0,0,menu.w+1,menu.h+2,sc.work_graph); |
DrawBar(1,1,menu.w,1,0xFFFfff); |
/programs/cmm/eolite/include/open_with.h |
---|
79,26 → 79,13 |
slot = GetProcessSlot(MenuForm.ID); |
if (slot != GetActiveProcess()) ExitProcess(); |
mm.get(); |
//if (mm.lkm) ExitProcess(); |
if (mm.vert) |
if (mm.vert) && (app_list.MouseScroll(mm.vert)) DrawAppList(); |
if (app_list.ProcessMouse(mm.x, mm.y)) DrawAppList(); |
if (app_list.MouseOver(mm.x, mm.y)) && (mm.lkm) |
{ |
app_list.MouseScroll(mm.vert); |
DrawAppList(); |
} |
if (mm.x>app_list.x) && (mm.x<app_list.x+app_list.w) && (mm.y>app_list.y) && (mm.y<app_list.y+app_list.h) |
{ |
app_list.current_temp = mm.y - app_list.y / app_list.line_h + app_list.first; |
if (app_list.current_temp != app_list.current) |
{ |
app_list.current = app_list.current_temp; |
DrawAppList(); |
} |
if (mm.lkm) |
{ |
RunProgram(#app_paths[app_list.current].item, #file_path); |
ExitProcess(); |
} |
} |
break; |
/programs/cmm/lib/list_box.h |
---|
7,6 → 7,8 |
int current_temp; |
void ClearList(); |
int ProcessKey(dword key); |
int MouseOver(int xx, yy); |
int ProcessMouse(int xx, yy); |
int KeyDown(); |
int KeyUp(); |
int KeyHome(); |
50,6 → 52,26 |
return 0; |
} |
int llist::MouseOver(int xx, yy) |
{ |
if (xx>x) && (xx<x+w) && (yy>y) && (yy<y+h) return 1; |
return 0; |
} |
int llist::ProcessMouse(int xx, yy) |
{ |
if (MouseOver(xx, yy)) |
{ |
current_temp = yy - y / line_h + first; |
if (current_temp != current) |
{ |
current = current_temp; |
return 1; |
} |
} |
return 0; |
} |
int llist::ProcessKey(dword key) |
{ |
switch(key) |