Subversion Repositories Kolibri OS

Rev

Rev 7636 | Rev 7806 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7636 Rev 7654
1
#ifndef AUTOBUILD
1
#ifndef AUTOBUILD
2
#include "lang.h--"
2
#include "lang.h--"
3
#endif
3
#endif
4
 
4
 
5
#define MEMSIZE 0x23E80
5
#define MEMSIZE 0x23E80
6
#include "..\lib\kolibri.h" 
6
#include "..\lib\kolibri.h" 
7
#include "..\lib\strings.h" 
7
#include "..\lib\strings.h" 
8
#include "..\lib\mem.h" 
8
#include "..\lib\mem.h" 
9
#include "..\lib\fs.h"
9
#include "..\lib\fs.h"
10
#include "..\lib\dll.h"
10
#include "..\lib\dll.h"
11
#include "..\lib\gui.h"
11
#include "..\lib\gui.h"
12
 
12
 
13
#include "..\lib\obj\libio.h"
13
#include "..\lib\obj\libio.h"
14
#include "..\lib\obj\libini.h"
14
#include "..\lib\obj\libini.h"
15
#include "..\lib\obj\box_lib.h"
15
#include "..\lib\obj\box_lib.h"
16
 
16
 
17
#include "..\lib\patterns\restart_process.h"
17
#include "..\lib\patterns\restart_process.h"
18
 
18
 
19
#ifdef LANG_RUS
19
#ifdef LANG_RUS
20
	?define WINDOW_TITLE " áâனª¨ ¯ ­¥«¨ § ¤ ç ¨ „®ª "
20
	?define WINDOW_TITLE " áâனª¨ ¯ ­¥«¨ § ¤ ç ¨ „®ª "
21
    ?define TASK_FRAME_T "    ­¥«ì § ¤ ç "
21
    ?define TASK_FRAME_T "    ­¥«ì § ¤ ç "
22
	?define DOCK_FRAME_T "   㨻 "
22
	?define DOCK_FRAME_T "   㨻 "
23
	?define MIN_LEFT_BUTTON "Š­®¯ª  áªàëâ¨ï á«¥¢ "
23
	?define MIN_LEFT_BUTTON "Š­®¯ª  áªàëâ¨ï á«¥¢ "
24
	?define MIN_RIGHT_BUTTON "Š­®¯ª  áªàëâ¨ï á¯à ¢ "
24
	?define MIN_RIGHT_BUTTON "Š­®¯ª  áªàëâ¨ï á¯à ¢ "
25
	?define SOFTEN_UP   "‘£« ¦¨¢ ­¨¥ ᢥàåã"
25
	?define SOFTEN_UP   "‘£« ¦¨¢ ­¨¥ ᢥàåã"
26
	?define SOFTEN_DOWN "‘£« ¦¨¢ ­¨¥ á­¨§ã"
26
	?define SOFTEN_DOWN "‘£« ¦¨¢ ­¨¥ á­¨§ã"
27
	?define CLOCK    "— áë"
27
	?define CLOCK    "— áë"
28
	?define CPU_USAGE "‡ £à㧪  –"
28
	?define CPU_USAGE "‡ £à㧪  –"
29
	?define CHANGE_LANG "Ÿ§ëª ¢¢®¤ "
29
	?define CHANGE_LANG "Ÿ§ëª ¢¢®¤ "
30
	?define MENU_BUTTON "Š­®¯ª  ¬¥­î"
30
	?define MENU_BUTTON "Š­®¯ª  ¬¥­î"
31
	?define PANEL_HEIGHT "‚ëá®â  ¯ ­¥«¨"
31
	?define PANEL_HEIGHT "‚ëá®â  ¯ ­¥«¨"
32
	?define SOFTEN_HEIGHT "‚ëá®â  ᣫ ¦¨¢ ­¨ï"
32
	?define SOFTEN_HEIGHT "‚ëá®â  ᣫ ¦¨¢ ­¨ï"
33
	?define BUTTON_OFFSET "®«¥ ¢®ªà㣠ª­®¯®ª"
33
	?define BUTTON_OFFSET "®«¥ ¢®ªà㣠ª­®¯®ª"
34
	?define FSIZE "¥¦¨¬ ¯ ­¥«¨"
34
	?define FSIZE "¥¦¨¬ ¯ ­¥«¨"
35
	?define ASHOW "¥ áªà뢠âì"
35
	?define ASHOW "¥ áªà뢠âì"
36
	?define CHANGE_POS " ¦¬¨â¥ ­  ¨§®¡à ¦¥­¨¥ ¤«ï ᬥ­ë ¯®§¨æ¨¨"
36
	?define CHANGE_POS " ¦¬¨â¥ ­  ¨§®¡à ¦¥­¨¥ ¤«ï ᬥ­ë ¯®§¨æ¨¨"
37
#else
37
#else
38
	?define WINDOW_TITLE "Taskbar and Docky configuration"
38
	?define WINDOW_TITLE "Taskbar and Docky configuration"
39
    ?define TASK_FRAME_T "   Taskbar "
39
    ?define TASK_FRAME_T "   Taskbar "
40
	?define DOCK_FRAME_T "   Docky "
40
	?define DOCK_FRAME_T "   Docky "
41
	?define MIN_LEFT_BUTTON "Min Left Button"
41
	?define MIN_LEFT_BUTTON "Min Left Button"
42
	?define MIN_RIGHT_BUTTON "Min Right Button"
42
	?define MIN_RIGHT_BUTTON "Min Right Button"
43
	?define SOFTEN_UP   "Soften Up"
43
	?define SOFTEN_UP   "Soften Up"
44
	?define SOFTEN_DOWN "Soften Down"
44
	?define SOFTEN_DOWN "Soften Down"
45
	?define CLOCK    "Clock"
45
	?define CLOCK    "Clock"
46
	?define CPU_USAGE "Cpu Usage"
46
	?define CPU_USAGE "Cpu Usage"
47
	?define CHANGE_LANG "Change Language"
47
	?define CHANGE_LANG "Change Language"
48
	?define MENU_BUTTON "Menu Button"
48
	?define MENU_BUTTON "Menu Button"
49
	?define PANEL_HEIGHT "Panel Height"
49
	?define PANEL_HEIGHT "Panel Height"
50
	?define SOFTEN_HEIGHT "Soften Height"
50
	?define SOFTEN_HEIGHT "Soften Height"
51
	?define BUTTON_OFFSET "Button Offset"
51
	?define BUTTON_OFFSET "Button Offset"
52
	?define FSIZE "Full width"
52
	?define FSIZE "Full width"
53
	?define ASHOW "Always show"
53
	?define ASHOW "Always show"
54
	?define CHANGE_POS "Click on image to change position"
54
	?define CHANGE_POS "Click on image to change position"
55
#endif
55
#endif
56
 
56
 
57
char taskbar_ini_path[] = "/sys/settings/taskbar.ini";
57
char taskbar_ini_path[] = "/sys/settings/taskbar.ini";
58
_ini taskbar_flags_ini = { #taskbar_ini_path, "Flags" };
58
_ini taskbar_flags_ini = { #taskbar_ini_path, "Flags" };
59
_ini taskbar_vars_ini = { #taskbar_ini_path, "Variables" };
59
_ini taskbar_vars_ini = { #taskbar_ini_path, "Variables" };
60
 
60
 
61
_ini docky_ini = { "/sys/settings/docky.ini", "@" };
61
_ini docky_ini = { "/sys/settings/docky.ini", "@" };
62
 
62
 
63
unsigned char panels_img_data[] = FROM "panels_image.raw";
63
unsigned char panels_img_data[] = FROM "panels_image.raw";
64
#define PIMG_W 37
64
#define PIMG_W 37
65
#define PIMG_H 27 //27*5
65
#define PIMG_H 27 //27*5
66
 
66
 
67
proc_info Form;
67
proc_info Form;
68
 
68
 
69
enum { BTN_TB_ATTACHEMENT=100, BTN_DOCKY_ATTACHEMENT=200 };
69
enum { BTN_TB_ATTACHEMENT=100, BTN_DOCKY_ATTACHEMENT=200 };
70
enum { TASKBAR, DOCKY };
70
enum { TASKBAR, DOCKY };
71
 
71
 
72
more_less_box tbPanelHeight  = { NULL, 6, 99, PANEL_HEIGHT };
72
more_less_box tbPanelHeight  = { NULL, 6, 99, PANEL_HEIGHT };
73
more_less_box tbSoftenHeight = { NULL, 0, 99, SOFTEN_HEIGHT };
73
more_less_box tbSoftenHeight = { NULL, 0, 99, SOFTEN_HEIGHT };
74
more_less_box tbButtonOffset = { NULL, 0, 99, BUTTON_OFFSET };
74
more_less_box tbButtonOffset = { NULL, 0, 99, BUTTON_OFFSET };
75
 
75
 
76
checkbox taskbar_on = 0;
76
checkbox taskbar_on = 0;
77
checkbox docky_on = 0;
77
checkbox docky_on = 0;
78
 
78
 
79
int tbAttachment;
79
int tbAttachment;
80
checkbox tbSoftenUp = { SOFTEN_UP };
80
checkbox tbSoftenUp = { SOFTEN_UP };
81
checkbox tbClock = { CLOCK };
81
checkbox tbClock = { CLOCK };
82
checkbox tbSoftenDown = { SOFTEN_DOWN };
82
checkbox tbSoftenDown = { SOFTEN_DOWN };
83
checkbox tbCpuUsage = { CPU_USAGE };
83
checkbox tbCpuUsage = { CPU_USAGE };
84
checkbox tbMinLeftButton = { MIN_LEFT_BUTTON };
84
checkbox tbMinLeftButton = { MIN_LEFT_BUTTON };
85
checkbox tbChangeLang = { CHANGE_LANG };
85
checkbox tbChangeLang = { CHANGE_LANG };
86
checkbox tbMinRightButton = { MIN_RIGHT_BUTTON };
86
checkbox tbMinRightButton = { MIN_RIGHT_BUTTON };
87
checkbox tbMenuButton = { MENU_BUTTON };
87
checkbox tbMenuButton = { MENU_BUTTON };
88
checkbox dkFsize = { FSIZE };
88
checkbox dkFsize = { FSIZE };
89
checkbox dkAshow = { ASHOW };
89
checkbox dkAshow = { ASHOW };
90
 
90
 
91
int dkLocation;
91
int dkLocation;
92
checkbox tbRunApplButton;
92
checkbox tbRunApplButton;
93
checkbox tbClnDeskButton;
93
checkbox tbClnDeskButton;
94
 
94
 
95
 
95
 
96
void main()
96
void main()
97
{
97
{
98
	dword id, key;
98
	dword id, key;
99
 
99
 
100
	load_dll(libini, #lib_init,1);
100
	load_dll(libini, #lib_init,1);
101
	load_dll(boxlib, #box_lib_init,0);
101
	load_dll(boxlib, #box_lib_init,0);
102
 
102
 
103
	LoadCfg();
103
	LoadCfg();
104
 
104
 
105
	loop() switch(WaitEvent())
105
	loop() switch(WaitEvent())
106
	{
106
	{
107
		case evButton: 
107
		case evButton: 
108
				id=GetButtonID();
108
				id=GetButtonID();
109
				if (1==id) ExitProcess();
109
				if (1==id) ExitProcess();
110
 
110
 
111
				if (taskbar_on.checked) EventTaskbarProcessButton(id);
111
				if (taskbar_on.checked) EventTaskbarProcessButton(id);
112
				if (docky_on.checked) EventDockyProcessButton(id);
112
				if (docky_on.checked) EventDockyProcessButton(id);
113
 
113
 
114
				if (taskbar_on.click(id)) {
114
				if (taskbar_on.click(id)) {
115
					IF (taskbar_on.checked == true) RunProgram("/sys/@taskbar", 0);
115
					IF (taskbar_on.checked == true) RunProgram("/sys/@taskbar", 0);
116
					ELSE KillProcessByName("@TASKBAR", SINGLE);
116
					ELSE KillProcessByName("@TASKBAR", SINGLE);
117
					EAX = taskbar_on.checked ^ 1;
117
					EAX = taskbar_on.checked ^ 1;
118
					tbSoftenUp.disabled = EAX;
118
					tbSoftenUp.disabled = EAX;
119
					tbSoftenDown.disabled = EAX;
119
					tbSoftenDown.disabled = EAX;
120
					tbMinLeftButton.disabled = EAX;
120
					tbMinLeftButton.disabled = EAX;
121
					tbMinRightButton.disabled = EAX;
121
					tbMinRightButton.disabled = EAX;
122
					tbRunApplButton.disabled = EAX;
122
					tbRunApplButton.disabled = EAX;
123
					tbClnDeskButton.disabled = EAX;
123
					tbClnDeskButton.disabled = EAX;
124
					tbClock.disabled = EAX;
124
					tbClock.disabled = EAX;
125
					tbCpuUsage.disabled = EAX;
125
					tbCpuUsage.disabled = EAX;
126
					tbChangeLang.disabled = EAX;
126
					tbChangeLang.disabled = EAX;
127
					tbMenuButton.disabled = EAX;
127
					tbMenuButton.disabled = EAX;
128
					tbPanelHeight.disabled = EAX;
128
					tbPanelHeight.disabled = EAX;
129
					tbSoftenHeight.disabled = EAX;
129
					tbSoftenHeight.disabled = EAX;
130
					tbButtonOffset.disabled = EAX;
130
					tbButtonOffset.disabled = EAX;
131
					tbButtonOffset.disabled = EAX;
131
					tbButtonOffset.disabled = EAX;
132
					DrawWindowContent();
132
					DrawWindowContent();
133
				}
133
				}
134
				if (docky_on.click(id)) {
134
				if (docky_on.click(id)) {
135
					IF (docky_on.checked == true) RunProgram("/sys/@docky", 0);
135
					IF (docky_on.checked == true) RunProgram("/sys/@docky", 0);
136
					ELSE KillProcessByName("@DOCKY", SINGLE);
136
					ELSE KillProcessByName("@DOCKY", SINGLE);
137
					dkFsize.disabled = docky_on.checked ^ 1;
137
					dkFsize.disabled = docky_on.checked ^ 1;
138
					dkAshow.disabled = docky_on.checked ^ 1;
138
					dkAshow.disabled = docky_on.checked ^ 1;
139
					DrawWindowContent();
139
					DrawWindowContent();
140
				}
140
				}
141
				break;
141
				break;
142
				
142
				
143
		case evKey:
143
		case evKey:
144
				GetKeys();
144
				GetKeys();
145
				if (key_scancode == SCAN_CODE_ESC) ExitProcess();
145
				if (key_scancode == SCAN_CODE_ESC) ExitProcess();
146
				break;
146
				break;
147
			
147
			
148
		case evReDraw:
148
		case evReDraw:
149
				system.color.get();
149
				system.color.get();
150
				DefineAndDrawWindow(130, 150, 465, 398 + skin_height, 0x34, system.color.work, WINDOW_TITLE, 0);
150
				DefineAndDrawWindow(130, 150, 465, 398 + skin_height, 0x34, system.color.work, WINDOW_TITLE, 0);
151
				GetProcessInfo(#Form, SelfInfo);
151
				GetProcessInfo(#Form, SelfInfo);
152
				if (Form.status_window>2) break;
152
				if (Form.status_window>2) break;
153
				DrawWindowContent();
153
				DrawWindowContent();
154
	}
154
	}
155
}
155
}
156
 
156
 
157
void DrawPanelsImage(dword y, n)
157
void DrawPanelsImage(dword y, n)
158
{
158
{
159
	_PutImage(22, y, PIMG_W, PIMG_H, n * PIMG_W * PIMG_H * 3 + #panels_img_data);
159
	_PutImage(22, y, PIMG_W, PIMG_H, n * PIMG_W * PIMG_H * 3 + #panels_img_data);
160
}
160
}
161
 
161
 
162
void DrawWindowContent()
162
void DrawWindowContent()
163
{
163
{
164
	#define PD 10
164
	#define PD 10
165
	dword frame_y;
165
	dword frame_y;
166
	word win_center_x = Form.cwidth / 2 + 20;
166
	word win_center_x = Form.cwidth / 2 + 20;
167
	incn y;
167
	incn y;
168
 
168
 
169
	frame_y = 15;
169
	frame_y = 15;
170
	y.n = frame_y;
170
	y.n = frame_y;
171
	DefineButton(22, y.inc(18), PIMG_W-1, PIMG_H-1, 100 + BT_HIDE, 0);
171
	DefineButton(22, y.inc(18), PIMG_W-1, PIMG_H-1, 100 + BT_HIDE, 0);
172
	DrawPanelsImage(y.n, tbAttachment);
172
	DrawPanelsImage(y.n, tbAttachment);
173
	WriteTextWithBg(68, y.inc(7), 0xD0, system.color.work_text, CHANGE_POS, system.color.work);
173
	WriteTextWithBg(68, y.inc(7), 0xD0, system.color.work_text, CHANGE_POS, system.color.work);
174
	tbSoftenUp.draw(22, y.inc(35));
174
	tbSoftenUp.draw(22, y.inc(35));
175
	tbClock.draw(win_center_x, y.n);
175
	tbClock.draw(win_center_x, y.n);
176
	tbSoftenDown.draw(22, y.inc(24));
176
	tbSoftenDown.draw(22, y.inc(24));
177
	tbCpuUsage.draw(win_center_x, y.n);
177
	tbCpuUsage.draw(win_center_x, y.n);
178
	tbMinLeftButton.draw(22, y.inc(24));
178
	tbMinLeftButton.draw(22, y.inc(24));
179
	tbChangeLang.draw(win_center_x, y.n);
179
	tbChangeLang.draw(win_center_x, y.n);
180
	tbMinRightButton.draw(22, y.inc(24));
180
	tbMinRightButton.draw(22, y.inc(24));
181
	tbMenuButton.draw(win_center_x, y.n);
181
	tbMenuButton.draw(win_center_x, y.n);
182
	tbPanelHeight.draw(22, y.inc(28));
182
	tbPanelHeight.draw(22, y.inc(28));
183
	tbSoftenHeight.draw(22, y.inc(32));
183
	tbSoftenHeight.draw(22, y.inc(32));
184
	tbButtonOffset.draw(22, y.inc(32));
184
	tbButtonOffset.draw(22, y.inc(32));
185
	DrawFrame(PD, frame_y, Form.cwidth-PD-PD, y.inc(32)-frame_y, TASK_FRAME_T);
185
	DrawFrame(PD, frame_y, Form.cwidth-PD-PD, y.inc(32)-frame_y, TASK_FRAME_T);
186
	taskbar_on.draw(22, frame_y-7);
186
	taskbar_on.draw(22, frame_y-7);
187
	//DOCKY
187
	//DOCKY
188
	frame_y = calc(y.inc(20));
188
	frame_y = calc(y.inc(20));
189
	DefineButton(22, y.inc(18), PIMG_W-1, PIMG_H-1, 200 + BT_HIDE, 0);
189
	DefineButton(22, y.inc(18), PIMG_W-1, PIMG_H-1, 200 + BT_HIDE, 0);
190
	DrawPanelsImage(y.n, dkLocation+1);
190
	DrawPanelsImage(y.n, dkLocation+1);
191
	WriteTextWithBg(68, y.inc(7), 0xD0, system.color.work_text, CHANGE_POS, system.color.work);
191
	WriteTextWithBg(68, y.inc(7), 0xD0, system.color.work_text, CHANGE_POS, system.color.work);
192
	dkFsize.draw(22, y.inc(35)); 
192
	dkFsize.draw(22, y.inc(35)); 
193
	dkAshow.draw(win_center_x, y.n);
193
	dkAshow.draw(win_center_x, y.n);
194
	DrawFrame(PD, frame_y, Form.cwidth-PD-PD, Form.cheight-frame_y-PD, DOCK_FRAME_T);
194
	DrawFrame(PD, frame_y, Form.cwidth-PD-PD, Form.cheight-frame_y-PD, DOCK_FRAME_T);
195
	docky_on.draw(22, frame_y-7);
195
	docky_on.draw(22, frame_y-7);
196
}
196
}
197
 
197
 
198
void LoadCfg()
198
void LoadCfg()
199
{ 
199
{ 
200
	tbAttachment = taskbar_flags_ini.GetInt("Attachment", 1);    
200
	tbAttachment = taskbar_flags_ini.GetInt("Attachment", 1);    
201
	tbSoftenUp.checked       = taskbar_flags_ini.GetInt("SoftenUp", 1);      
201
	tbSoftenUp.checked       = taskbar_flags_ini.GetInt("SoftenUp", 1);      
202
	tbSoftenDown.checked     = taskbar_flags_ini.GetInt("SoftenDown", 1);    
202
	tbSoftenDown.checked     = taskbar_flags_ini.GetInt("SoftenDown", 1);    
203
	tbMinLeftButton.checked  = taskbar_flags_ini.GetInt("MinLeftButton", 1); 
203
	tbMinLeftButton.checked  = taskbar_flags_ini.GetInt("MinLeftButton", 1); 
204
	tbMinRightButton.checked = taskbar_flags_ini.GetInt("MinRightButton", 1);
204
	tbMinRightButton.checked = taskbar_flags_ini.GetInt("MinRightButton", 1);
205
	tbClock.checked          = taskbar_flags_ini.GetInt("Clock", 1);         
205
	tbClock.checked          = taskbar_flags_ini.GetInt("Clock", 1);         
206
	tbCpuUsage.checked       = taskbar_flags_ini.GetInt("CpuUsage", 1);      
206
	tbCpuUsage.checked       = taskbar_flags_ini.GetInt("CpuUsage", 1);      
207
	tbChangeLang.checked     = taskbar_flags_ini.GetInt("ChangeLang", 1);    
207
	tbChangeLang.checked     = taskbar_flags_ini.GetInt("ChangeLang", 1);    
208
	tbMenuButton.checked     = taskbar_flags_ini.GetInt("MenuButton", 1);    
208
	tbMenuButton.checked     = taskbar_flags_ini.GetInt("MenuButton", 1);    
209
	tbPanelHeight.value  = taskbar_vars_ini.GetInt("PanelHeight", 28);
209
	tbPanelHeight.value  = taskbar_vars_ini.GetInt("PanelHeight", 28);
210
	tbSoftenHeight.value = taskbar_vars_ini.GetInt("SoftenHeight", 4);   
210
	tbSoftenHeight.value = taskbar_vars_ini.GetInt("SoftenHeight", 4);   
211
	tbButtonOffset.value = taskbar_vars_ini.GetInt("ButtonTopOffset", 3);
211
	tbButtonOffset.value = taskbar_vars_ini.GetInt("ButtonTopOffset", 3);
212
	tbButtonOffset.value = taskbar_vars_ini.GetInt("ButtonBotOffset", 3);
212
	tbButtonOffset.value = taskbar_vars_ini.GetInt("ButtonBotOffset", 3);
213
 
213
 
214
	dkLocation = docky_ini.GetInt("location", 0);
214
	dkLocation = docky_ini.GetInt("location", 0);
215
	dkFsize.checked = docky_ini.GetInt("fsize", 0);   
215
	dkFsize.checked = docky_ini.GetInt("fsize", 0);   
216
	dkAshow.checked = docky_ini.GetInt("ashow", 0);
216
	dkAshow.checked = docky_ini.GetInt("ashow", 0);
217
 
217
 
218
	taskbar_on.checked = CheckProcessExists("@TASKBAR");
218
	taskbar_on.checked = CheckProcessExists("@TASKBAR");
219
	docky_on.checked = CheckProcessExists("@DOCKY");
219
	docky_on.checked = CheckProcessExists("@DOCKY");
220
}
220
}
221
 
221
 
222
void SaveSettingsAndRestartProcess(byte panel_type)
222
void SaveSettingsAndRestartProcess(byte panel_type)
223
{
223
{
224
	if (panel_type==TASKBAR) {
224
	if (panel_type==TASKBAR) {
225
		taskbar_flags_ini.SetInt("Attachment", tbAttachment);
225
		taskbar_flags_ini.SetInt("Attachment", tbAttachment);
226
		taskbar_flags_ini.SetInt("SoftenUp", tbSoftenUp.checked);
226
		taskbar_flags_ini.SetInt("SoftenUp", tbSoftenUp.checked);
227
		taskbar_flags_ini.SetInt("SoftenDown", tbSoftenDown.checked);
227
		taskbar_flags_ini.SetInt("SoftenDown", tbSoftenDown.checked);
228
		taskbar_flags_ini.SetInt("MinLeftButton", tbMinLeftButton.checked);
228
		taskbar_flags_ini.SetInt("MinLeftButton", tbMinLeftButton.checked);
229
		taskbar_flags_ini.SetInt("MinRightButton", tbMinRightButton.checked);
229
		taskbar_flags_ini.SetInt("MinRightButton", tbMinRightButton.checked);
230
		taskbar_flags_ini.SetInt("RunApplButton", tbRunApplButton.checked);
230
		taskbar_flags_ini.SetInt("RunApplButton", tbRunApplButton.checked);
231
		taskbar_flags_ini.SetInt("ClnDeskButton", tbClnDeskButton.checked);
231
		taskbar_flags_ini.SetInt("ClnDeskButton", tbClnDeskButton.checked);
232
		taskbar_flags_ini.SetInt("Clock", tbClock.checked);
232
		taskbar_flags_ini.SetInt("Clock", tbClock.checked);
233
		taskbar_flags_ini.SetInt("CpuUsage", tbCpuUsage.checked);
233
		taskbar_flags_ini.SetInt("CpuUsage", tbCpuUsage.checked);
234
		taskbar_flags_ini.SetInt("ChangeLang", tbChangeLang.checked);
234
		taskbar_flags_ini.SetInt("ChangeLang", tbChangeLang.checked);
235
		taskbar_flags_ini.SetInt("MenuButton", tbMenuButton.checked);
235
		taskbar_flags_ini.SetInt("MenuButton", tbMenuButton.checked);
236
		taskbar_vars_ini.SetInt("PanelHeight", tbPanelHeight.value);
236
		taskbar_vars_ini.SetInt("PanelHeight", tbPanelHeight.value);
237
		taskbar_vars_ini.SetInt("SoftenHeight", tbSoftenHeight.value);
237
		taskbar_vars_ini.SetInt("SoftenHeight", tbSoftenHeight.value);
238
		taskbar_vars_ini.SetInt("ButtonTopOffset", tbButtonOffset.value);
238
		taskbar_vars_ini.SetInt("ButtonTopOffset", tbButtonOffset.value);
239
		taskbar_vars_ini.SetInt("ButtonBottOffset", tbButtonOffset.value);
239
		taskbar_vars_ini.SetInt("ButtonBottOffset", tbButtonOffset.value);
240
	}
240
	}
241
	if (panel_type==DOCKY) {
241
	if (panel_type==DOCKY) {
242
		docky_ini.SetInt("location", dkLocation);
242
		docky_ini.SetInt("location", dkLocation);
243
		docky_ini.SetInt("fsize", dkFsize.checked);
243
		docky_ini.SetInt("fsize", dkFsize.checked);
244
		docky_ini.SetInt("ashow", dkAshow.checked);
244
		docky_ini.SetInt("ashow", dkAshow.checked);
245
	}
245
	}
246
	RestartProcess(panel_type);
246
	RestartProcess(panel_type);
247
}
247
}
248
 
248
 
249
void RestartProcess(byte panel_type)
249
void RestartProcess(byte panel_type)
250
{
250
{
251
	dword proc_name1;
251
	dword proc_name1;
252
	if (panel_type == TASKBAR)
252
	if (panel_type == TASKBAR)
253
	{
253
	{
254
		RestartProcessByName("@taskbar", SINGLE);
254
		RestartProcessByName("/sys/@taskbar", SINGLE);
255
		pause(50);
255
		pause(50);
256
	}
256
	}
257
	else
257
	else
258
	{
258
	{
259
		RestartProcessByName("@docky", SINGLE);
259
		RestartProcessByName("/sys/@docky", SINGLE);
260
		pause(120);
260
		pause(120);
261
	}
261
	}
262
	GetProcessInfo(#Form, SelfInfo);
262
	GetProcessInfo(#Form, SelfInfo);
263
	ActivateWindow(GetProcessSlot(Form.ID));
263
	ActivateWindow(GetProcessSlot(Form.ID));
264
}
264
}
265
 
265
 
266
void EventTaskbarProcessButton(dword id)
266
void EventTaskbarProcessButton(dword id)
267
{
267
{
268
	if (BTN_TB_ATTACHEMENT == id) {
268
	if (BTN_TB_ATTACHEMENT == id) {
269
		tbAttachment ^= 1;
269
		tbAttachment ^= 1;
270
		DrawWindowContent(); 
270
		DrawWindowContent(); 
271
		SaveSettingsAndRestartProcess(TASKBAR);
271
		SaveSettingsAndRestartProcess(TASKBAR);
272
	}
272
	}
273
	if (tbSoftenUp.click(id))      || (tbSoftenDown.click(id))
273
	if (tbSoftenUp.click(id))      || (tbSoftenDown.click(id))
274
	|| (tbMinLeftButton.click(id)) || (tbMinRightButton.click(id))
274
	|| (tbMinLeftButton.click(id)) || (tbMinRightButton.click(id))
275
	|| (tbRunApplButton.click(id)) || (tbClnDeskButton.click(id)) {
275
	|| (tbRunApplButton.click(id)) || (tbClnDeskButton.click(id)) {
276
		SaveSettingsAndRestartProcess(TASKBAR); 
276
		SaveSettingsAndRestartProcess(TASKBAR); 
277
	}
277
	}
278
	if (tbClock.click(id))       || (tbCpuUsage.click(id))
278
	if (tbClock.click(id))       || (tbCpuUsage.click(id))
279
	|| (tbChangeLang.click(id))  || (tbMenuButton.click(id))
279
	|| (tbChangeLang.click(id))  || (tbMenuButton.click(id))
280
	|| (tbPanelHeight.click(id)) || (tbSoftenHeight.click(id)) 
280
	|| (tbPanelHeight.click(id)) || (tbSoftenHeight.click(id)) 
281
	|| (tbButtonOffset.click(id)) {
281
	|| (tbButtonOffset.click(id)) {
282
		SaveSettingsAndRestartProcess(TASKBAR);
282
		SaveSettingsAndRestartProcess(TASKBAR);
283
	}
283
	}
284
}
284
}
285
 
285
 
286
void EventDockyProcessButton(dword id)
286
void EventDockyProcessButton(dword id)
287
{
287
{
288
	if (BTN_DOCKY_ATTACHEMENT == id) {
288
	if (BTN_DOCKY_ATTACHEMENT == id) {
289
		dkLocation++; 
289
		dkLocation++; 
290
		if (dkLocation>3) dkLocation=1; 
290
		if (dkLocation>3) dkLocation=1; 
291
		DrawWindowContent(); 
291
		DrawWindowContent(); 
292
		SaveSettingsAndRestartProcess(DOCKY);
292
		SaveSettingsAndRestartProcess(DOCKY);
293
	}
293
	}
294
	if (dkFsize.click(id)) || (dkAshow.click(id)) {
294
	if (dkFsize.click(id)) || (dkAshow.click(id)) {
295
		SaveSettingsAndRestartProcess(DOCKY);
295
		SaveSettingsAndRestartProcess(DOCKY);
296
	}
296
	}
297
}
297
}
298
 
298
 
299
 
299
 
300
stop:
300
stop: