2018-10-10 17:44:01 +03:00
|
|
|
#ifndef INCLUDE_MENU_H
|
|
|
|
#define INCLUDE_MENU_H
|
2016-01-07 18:26:59 +03:00
|
|
|
|
2018-10-10 17:44:01 +03:00
|
|
|
:dword menu_process_id;
|
|
|
|
|
2020-06-04 01:21:39 +03:00
|
|
|
#define MENU_TOP_LEFT 0
|
|
|
|
#define MENU_TOP_RIGHT 1
|
|
|
|
#define MENU_BOT_LEFT 2
|
|
|
|
#define MENU_BOT_RIGHT 3
|
2020-04-12 00:17:55 +03:00
|
|
|
|
|
|
|
:dword shared_mem = NULL;
|
|
|
|
:char shared_name[] = "LMENU";
|
2020-04-13 17:47:37 +03:00
|
|
|
:void open_lmenu(dword _x, _y, _position, _selected, _text1)
|
2020-04-12 00:17:55 +03:00
|
|
|
{
|
|
|
|
if (!shared_mem) {
|
2020-04-13 14:51:56 +03:00
|
|
|
shared_mem = memopen(#shared_name, 16, SHM_CREATE + SHM_WRITE);
|
|
|
|
if (EDX) shared_mem = memopen(#shared_name, 16, SHM_WRITE);
|
2020-04-12 00:17:55 +03:00
|
|
|
}
|
2020-04-13 14:51:56 +03:00
|
|
|
ESDWORD[shared_mem ] = _selected;
|
2020-06-04 01:21:39 +03:00
|
|
|
ESDWORD[shared_mem + 4] = _x + Form.left + 5;
|
|
|
|
ESDWORD[shared_mem + 8] = _y + Form.top + skin_height;
|
2020-04-12 00:17:55 +03:00
|
|
|
ESDWORD[shared_mem + 12] = _position;
|
2020-04-13 17:47:37 +03:00
|
|
|
menu_process_id = RunProgram("/sys/develop/menu", _text1);
|
2020-04-12 00:17:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
:dword get_menu_click()
|
|
|
|
{
|
2020-04-13 14:51:56 +03:00
|
|
|
if (menu_process_id) && (GetProcessSlot(menu_process_id)) {
|
|
|
|
return NULL;
|
|
|
|
} else {
|
|
|
|
menu_process_id = NULL;
|
2020-04-13 16:16:55 +03:00
|
|
|
EAX = ESDWORD[shared_mem];
|
|
|
|
ESDWORD[shared_mem] = 0;
|
|
|
|
return EAX;
|
2020-04-13 14:51:56 +03:00
|
|
|
}
|
2020-04-12 00:17:55 +03:00
|
|
|
}
|
|
|
|
|
2018-10-10 17:44:01 +03:00
|
|
|
#endif
|