From 8f2e4dc9b31f03763ee4f416be34ee95b2bb279a Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Thu, 26 Dec 2013 23:52:42 +0000 Subject: [PATCH] add forgotten file git-svn-id: svn://kolibrios.org@4412 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/browser/menu_rmb.h | 77 +++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 programs/cmm/browser/menu_rmb.h diff --git a/programs/cmm/browser/menu_rmb.h b/programs/cmm/browser/menu_rmb.h new file mode 100644 index 0000000000..cf6e2da3b1 --- /dev/null +++ b/programs/cmm/browser/menu_rmb.h @@ -0,0 +1,77 @@ +//Leency - 2012-2013 + +char *ITEMS_LIST[]={ +"WIN F5",54, +"DOS Ctrl+D",04, +"KOI Ctrl+K",11, +"UTF Ctrl+U",21, +#ifdef LANG_RUS +"Исходник страницы F3",52, +"Очистить кэш картинок" ,02, +#else +"View source F3",52, +"Free image cache" ,02, +#endif +0}; + +llist menu; +dword col_work = 0xE4DFE1; +dword col_border = 0x9098B0; + +void menu_rmb() +{ + mouse mm; + proc_info MenuForm; + int key; + + menu.first = menu.current = 0; + 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); + if (!CheckActiveProcess(MenuForm.ID)) ExitProcess(); + + mm.get(); + 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)) DrawMenuList(); + if (key==13) + { + action_buf = ITEMS_LIST[menu.current*2+1]; + ExitProcess(); + } + break; + + case evReDraw: + DefineAndDrawWindow(Form.left+m.x,Form.top+m.y+GetSkinHeight()+3,menu.w+2,menu.h+4,0x01, 0, 0, 0x01fffFFF); + DrawPopup(0,0,menu.w,menu.h+3,0, col_work,col_border); + DrawMenuList(); + } +} + +void DrawMenuList() +{ + int N; + + for (N=0; N