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