Subversion Repositories Kolibri OS

Rev

Rev 8020 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7447 leency 1
#ifndef INCLUDE_MENU_H
2
#define INCLUDE_MENU_H
6041 leency 3
 
7447 leency 4
:dword menu_process_id;
5
 
8020 leency 6
#define MENU_TOP_LEFT  0
7
#define MENU_TOP_RIGHT 1
8
#define MENU_BOT_LEFT  2
9
#define MENU_BOT_RIGHT 3
7778 leency 10
 
11
:dword shared_mem = NULL;
12
:char shared_name[] = "LMENU";
7782 leency 13
:void open_lmenu(dword _x, _y, _position, _selected, _text1)
7778 leency 14
{
15
	if (!shared_mem) {
7780 leency 16
		shared_mem = memopen(#shared_name, 16, SHM_CREATE + SHM_WRITE);
17
		if (EDX) shared_mem = memopen(#shared_name, 16, SHM_WRITE);
7778 leency 18
	}
7780 leency 19
	ESDWORD[shared_mem     ] = _selected;
8020 leency 20
	ESDWORD[shared_mem +  4] = _x + Form.left + 5;
9597 leency 21
	ESDWORD[shared_mem +  8] = _y + Form.top + skin_h;
7778 leency 22
	ESDWORD[shared_mem + 12] = _position;
7782 leency 23
	menu_process_id = RunProgram("/sys/develop/menu", _text1);
7778 leency 24
}
25
 
26
:dword get_menu_click()
27
{
7780 leency 28
	if (menu_process_id) && (GetProcessSlot(menu_process_id)) {
29
		return NULL;
30
	} else {
31
		menu_process_id = NULL;
7781 leency 32
		EAX = ESDWORD[shared_mem];
33
		ESDWORD[shared_mem] = 0;
34
		return EAX;
7780 leency 35
	}
7778 leency 36
}
37
 
7447 leency 38
#endif