diff --git a/programs/cmm/appearance/appearance.c b/programs/cmm/appearance/appearance.c index 8c22f591b8..924ed41014 100644 --- a/programs/cmm/appearance/appearance.c +++ b/programs/cmm/appearance/appearance.c @@ -142,7 +142,7 @@ void main() mem_Init(); if (param) strcpy(#folder_path, #param); - list[SKINS].current = list[WALLPAPERS].current = 0; + list[SKINS].current = list[WALLPAPERS].current = -1; list[SKINS].first = list[WALLPAPERS].first = 0; GetFiles(WALLPAPERS); list[active].SetSizes(0, 230, 350, 400-PANEL_H, 40, 18); @@ -154,20 +154,13 @@ void main() case evMouse: mm.get(); if (mm.vert) && (list[active].MouseScroll(mm.vert)) Draw_List(); - /* if (mouse_clicked) { - if (!mm.lkm) && (list[active].ProcessMouse(mm.x, mm.y)) Apply(); + if (!mm.lkm) && (active==SKINS) && (list[SKINS].ProcessMouse(mm.x, mm.y)) Apply(); + if (!mm.lkm) && (active==WALLPAPERS) && (list[WALLPAPERS].ProcessMouse(mm.x, mm.y)) Apply(); mouse_clicked=0; } - if (mm.lkm) && (list[active].MouseOver(mm.x, mm.y)) mouse_clicked=1; - */ - EAX = active; - if (mm.lkm) - { - if (active==SKINS) && (list[SKINS].ProcessMouse(mm.x, mm.y)) Apply(); - if if (active==WALLPAPERS) && (list[WALLPAPERS].ProcessMouse(mm.x, mm.y)) Apply(); - } + if (mm.lkm) && (list[SKINS].MouseOver(mm.x, mm.y)) mouse_clicked=1; break; case evButton: diff --git a/programs/cmm/browser/HTMLv.c b/programs/cmm/browser/HTMLv.c index 95e8b260c6..760528e2f4 100644 --- a/programs/cmm/browser/HTMLv.c +++ b/programs/cmm/browser/HTMLv.c @@ -66,7 +66,7 @@ int action_buf; void main() { - int btn, key; + int key, btn; int half_scroll_size; int scroll_used=0, show_menu; @@ -98,8 +98,7 @@ void main() //break; };*/ - btn=GetProcessSlot(Form.ID); - if (btn<>GetActiveProcess()) break; + if (!CheckActiveProcess(Form.ID)) break; edit_box_mouse stdcall (#address_box); diff --git a/programs/cmm/browser/include/menu_rmb.h b/programs/cmm/browser/include/menu_rmb.h index c16ad89f34..cf6e2da3b1 100644 --- a/programs/cmm/browser/include/menu_rmb.h +++ b/programs/cmm/browser/include/menu_rmb.h @@ -14,39 +14,36 @@ char *ITEMS_LIST[]={ #endif 0}; +llist menu; +dword col_work = 0xE4DFE1; +dword col_border = 0x9098B0; void menu_rmb() { mouse mm; proc_info MenuForm; - llist menu; - int overid, key, N; - dword col_work = 0xE4DFE1; - dword col_border = 0x9098B0; + int key; menu.first = menu.current = 0; - while (ITEMS_LIST[menu.count*2]) {menu.count++; menu.visible++;} - menu.line_h = 19; - menu.w = 165; - menu.h = menu.count * menu.line_h; + while (ITEMS_LIST[menu.count*2]) menu.count++; + menu.SetSizes(2,2,165,menu.count*19,0,19); SetEventMask(100111b); loop() switch(WaitEvent()) { case evMouse: GetProcessInfo(#MenuForm, SelfInfo); - N=GetProcessSlot(MenuForm.ID); - if (N<>GetActiveProcess()) ExitProcess(); + if (!CheckActiveProcess(MenuForm.ID)) ExitProcess(); mm.get(); - if (menu.ProcessMouse(mm.x, mm.y)) goto _ITEMS_DRAW; + if (menu.ProcessMouse(mm.x, mm.y)) DrawMenuList(); if (mm.lkm) || (mm.pkm) { action_buf = ITEMS_LIST[menu.current*2+1]; ExitProcess(); } break; case evKey: key = GetKey(); if (key==27) ExitProcess(); - if (menu.ProcessKey(key)) goto _ITEMS_DRAW; + if (menu.ProcessKey(key)) DrawMenuList(); if (key==13) { action_buf = ITEMS_LIST[menu.current*2+1]; @@ -55,26 +52,26 @@ void menu_rmb() break; case evReDraw: - DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.count*menu.line_h+4,0x01, 0, 0, 0x01fffFFF); - DrawPopup(0,0,menu.w,menu.count*menu.line_h+3,0, col_work,col_border); - - _ITEMS_DRAW: - for (N=0; N2) break; - IF (rename_active) { edit_box_mouse stdcall(#edit2); break; } + if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break; + if (rename_active) { edit_box_mouse stdcall(#edit2); break; } m.get(); diff --git a/programs/cmm/eolite/include/menu.h b/programs/cmm/eolite/include/menu.h index bb05377c99..587347a5ac 100644 --- a/programs/cmm/eolite/include/menu.h +++ b/programs/cmm/eolite/include/menu.h @@ -48,7 +48,7 @@ int cur_action_buf; void FileMenu() { mouse mm; - word slot, key; + word key; proc_info MenuForm; int index; @@ -69,8 +69,7 @@ void FileMenu() loop() switch(WaitEvent()) { case evMouse: - slot = GetProcessSlot(MenuForm.ID); - if (slot != GetActiveProcess()) ExitProcess(); + if (!CheckActiveProcess(MenuForm.ID)) ExitProcess(); mm.get(); if (menu.ProcessMouse(mm.x, mm.y)) MenuListRedraw(); if (mm.lkm) {action_buf = cur_action_buf; pause(5); ExitProcess(); } diff --git a/programs/cmm/eolite/include/open_with.h b/programs/cmm/eolite/include/open_with.h index 0125554249..dd8c50035d 100644 --- a/programs/cmm/eolite/include/open_with.h +++ b/programs/cmm/eolite/include/open_with.h @@ -64,20 +64,19 @@ void OpenWith() #define PADDING 8 int WIN_H; mouse mm; - word key, slot; + word key; proc_info MenuForm; app_list.ClearList(); - app_list.SetSizes(PADDING,PANEL_H+1,WIN_W-PADDING-PADDING,OPEN_LIST_VISIBLE_N*OPEN_LIST_LINE_H,150,OPEN_LIST_LINE_H); if (!app_list.count) if (GetListOfPrograms()==-1) return; + app_list.SetSizes(PADDING,PANEL_H+1,WIN_W-PADDING-PADDING,OPEN_LIST_VISIBLE_N*OPEN_LIST_LINE_H,150,OPEN_LIST_LINE_H); SetEventMask(100111b); goto _APP_LIST_DRAW; loop() switch(WaitEvent()) { case evMouse: - slot = GetProcessSlot(MenuForm.ID); - if (slot != GetActiveProcess()) ExitProcess(); + if (!CheckActiveProcess(MenuForm.ID)) ExitProcess(); mm.get(); if (mm.vert) && (app_list.MouseScroll(mm.vert)) DrawAppList(); if (app_list.ProcessMouse(mm.x, mm.y)) DrawAppList(); diff --git a/programs/cmm/lib/kolibri.h b/programs/cmm/lib/kolibri.h index e058c01305..6d8820d985 100644 --- a/programs/cmm/lib/kolibri.h +++ b/programs/cmm/lib/kolibri.h @@ -218,6 +218,13 @@ inline fastcall int GetActiveProcess() $int 0x40 } +:int CheckActiveProcess(int Form_ID) +{ + int id=GetProcessSlot(Form_ID); + if (id==GetActiveProcess()) return 1; + return 0; +} + inline fastcall void ActivateWindow( ECX) { EAX = 18; diff --git a/programs/cmm/rb/rb.c b/programs/cmm/rb/rb.c index 5c83354e27..992159cd95 100644 --- a/programs/cmm/rb/rb.c +++ b/programs/cmm/rb/rb.c @@ -80,10 +80,8 @@ void window() loop() switch(WaitEvent()) { case evMouse: + if (!CheckActiveProcess(MenuForm.ID)) ExitProcess(); m.get(); - - id1=GetProcessSlot(MenuForm.ID); - if (id1<>GetActiveProcess()) ExitProcess(); id1=m.y-1/ITEM_HEIGHT; if (m.y<0) || (id1+1>items_num) || (m.x<0) || (m.x>ITEM_WIDTH) break; if (m.lkm) || (m.pkm)