Subversion Repositories Kolibri OS

Rev

Rev 7774 | Rev 7779 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7774 Rev 7778
Line 1... Line 1...
1
#define MEMSIZE 4096*40
1
#define MEMSIZE 4096*40
Line 2... Line -...
2
 
-
 
3
#include "../lib/io.h"
2
 
-
 
3
#include "../lib/gui.h"
4
#include "../lib/gui.h"
4
#include "../lib/io.h"
5
#include "../lib/collection.h"
5
#include "../lib/collection.h"
6
#include "../lib/list_box.h"
6
#include "../lib/list_box.h"
Line 7... Line 7...
7
#include "../lib/fs.h"
7
#include "../lib/fs.h"
Line 8... Line 8...
8
 
8
 
9
#define ITEM_H 19
9
#define ITEM_H 19
10
 
10
 
11
llist menu1;
-
 
Line 12... Line 11...
12
collection names;
11
llist menu1;
Line 13... Line 12...
13
collection hotkeys;
12
collection names;
14
dword shared_mem;
13
collection hotkeys;
Line 15... Line 14...
15
 
14
 
Line 16... Line -...
16
int win_x, win_y;
-
 
17
 
15
int win_x, win_y;
18
int max_name_len;
16
 
19
int max_hotkey_len;
17
int max_name_len;
20
 
18
int max_hotkey_len;
21
int selected = 0;
19
 
22
 
20
int selected = 0;
23
char shared_name[] = "LMENU";
21
 
24
 
22
/*
25
dword cur_param = #param;
23
dword cur_param = #param;
26
int GetNextParam()
24
int GetNextParam()
27
{
25
{
-
 
26
	int result;
Line 28... Line 27...
28
	int result;
27
	dword next_param = strchr(cur_param, ' ');
29
	dword next_param = strchr(cur_param, ' ');
28
	ESBYTE[next_param] = '\0';
30
	ESBYTE[next_param] = '\0';
29
	result = atoi(cur_param);
31
	result = atoi(cur_param);
30
	cur_param = next_param+1;
32
	cur_param = next_param+1;
31
	return result;	
33
	return result;	
32
}
34
}
33
*/
35
 
34
 
36
void GetWindowPosition()
35
void GetWindowPosition()
37
{
36
{
38
	int position, rez;
37
	int position, rez;
39
	shared_mem = memopen(#shared_name, 4, SHM_WRITE);
38
	shared_mem = memopen(#shared_name, 20, SHM_WRITE);
40
	win_x = GetNextParam();
39
	win_x = ESDWORD[shared_mem +  4];
Line 74... Line 73...
74
 
73
 
75
void main()
74
void main()
76
{
75
{
Line -... Line 76...
-
 
76
	proc_info Form;
-
 
77
 
-
 
78
	if (!param) 
-
 
79
		die(
-
 
80
"'This is a menu component used in Eolite, WebView, etc...
77
	proc_info Form;
81
Please forget it if you are not a developer ;)' -I");
78
 
82
 
79
	GetMenuItems(strchr(#param, '\n') + 2);
83
	GetMenuItems(#param);
Line 80... Line 84...
80
	max_name_len = strlen(names.get(0)) * 6;
84
	max_name_len = strlen(names.get(0)) * 6;
Line 168... Line 172...
168
	if (selected) WriteText(5, selected*ITEM_H + menu1.y + menu1.text_y, 0x80, 0xEE0000, "\x10");
172
	if (selected) WriteText(5, selected*ITEM_H + menu1.y + menu1.text_y, 0x80, 0xEE0000, "\x10");
169
}
173
}
Line 170... Line 174...
170
 
174
 
171
void click()
175
void click()
172
{
176
{
173
	ESBYTE[shared_mem] = byte menu1.cur_y + 1;
177
	ESDWORD[shared_mem] = menu1.cur_y + 1;
174
	ExitProcess();
178
	ExitProcess();
Line 175... Line 179...
175
}
179
}
176
 
180
 
177
void exit()
181
void exit()
178
{
182
{
179
	ESBYTE[shared_mem] = 0;
183
	ESDWORD[shared_mem] = 0;