Subversion Repositories Kolibri OS

Rev

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

Rev 5532 Rev 5533
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\file_system.h"
9
#include "..\lib\file_system.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_lib.h"
13
#include "..\lib\obj\libio_lib.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\libimg_load_skin.h"
17
#include "..\lib\patterns\libimg_load_skin.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
	?define BOX_LIB_LOAD_ERR "Žè¨¡ª  ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ /rd/1/lib/box_lib.obj"
37
	?define BOX_LIB_LOAD_ERR "Žè¨¡ª  ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ /rd/1/lib/box_lib.obj"
38
	?define LIBINI_LOAD_ERR "Žè¨¡ª  ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ /rd/1/lib/libini.obj"
38
	?define LIBINI_LOAD_ERR "Žè¨¡ª  ¯à¨ § £à㧪¥ ¡¨¡«¨®â¥ª¨ /rd/1/lib/libini.obj"
39
#else
39
#else
40
	?define WINDOW_TITLE "Taskbar and Docky configuration"
40
	?define WINDOW_TITLE "Taskbar and Docky configuration"
41
    ?define TASK_FRAME_T " Taskbar "
41
    ?define TASK_FRAME_T " Taskbar "
42
	?define DOCK_FRAME_T " Docky "
42
	?define DOCK_FRAME_T " Docky "
43
	?define MIN_LEFT_BUTTON "Min Left Button"
43
	?define MIN_LEFT_BUTTON "Min Left Button"
44
	?define MIN_RIGHT_BUTTON "Min Right Button"
44
	?define MIN_RIGHT_BUTTON "Min Right Button"
45
	?define SOFTEN_UP   "Soften Up"
45
	?define SOFTEN_UP   "Soften Up"
46
	?define SOFTEN_DOWN "Soften Down"
46
	?define SOFTEN_DOWN "Soften Down"
47
	?define CLOCK    "Clock"
47
	?define CLOCK    "Clock"
48
	?define CPU_USAGE "Cpu Usage"
48
	?define CPU_USAGE "Cpu Usage"
49
	?define CHANGE_LANG "Change Language"
49
	?define CHANGE_LANG "Change Language"
50
	?define MENU_BUTTON "Menu Button"
50
	?define MENU_BUTTON "Menu Button"
51
	?define PANEL_HEIGHT "Panel Height"
51
	?define PANEL_HEIGHT "Panel Height"
52
	?define SOFTEN_HEIGHT "Soften Height"
52
	?define SOFTEN_HEIGHT "Soften Height"
53
	?define BUTTON_OFFSET "Button Offset"
53
	?define BUTTON_OFFSET "Button Offset"
54
	?define FSIZE "Full width"
54
	?define FSIZE "Full width"
55
	?define ASHOW "Always show"
55
	?define ASHOW "Always show"
56
	?define CHANGE_POS "Click on image to change position"
56
	?define CHANGE_POS "Click on image to change position"
57
	?define BOX_LIB_LOAD_ERR "Error while loading library /rd/1/lib/box_lib.obj"
57
	?define BOX_LIB_LOAD_ERR "Error while loading library /rd/1/lib/box_lib.obj"
58
	?define LIBINI_LOAD_ERR "Error while loading library /rd/1/lib/libini.obj"
58
	?define LIBINI_LOAD_ERR "Error while loading library /rd/1/lib/libini.obj"
59
#endif
59
#endif
60
 
60
 
61
 
61
 
62
frame taskbar_frame = { 0, 000, 10, 188, 14, 0x000111, 0xFFFfff, 1, TASK_FRAME_T, 0, 0, 6, 0x000111, 0xCCCccc };
62
frame taskbar_frame = { 0, 000, 10, 188, 14, 0x000111, 0xFFFfff, 1, TASK_FRAME_T, 0, 0, 6, 0x000111, 0xCCCccc };
63
frame docky_frame = { 0, 000, 10, 73, 217, 0x000111, 0xFFFfff, 1, DOCK_FRAME_T, 0, 0, 6, 0x000111, 0xCCCccc };
63
frame docky_frame = { 0, 000, 10, 73, 217, 0x000111, 0xFFFfff, 1, DOCK_FRAME_T, 0, 0, 6, 0x000111, 0xCCCccc };
64
 
64
 
65
char taskbar_ini_path[] = "/sys/settings/taskbar.ini";
65
char taskbar_ini_path[] = "/sys/settings/taskbar.ini";
66
char taskbar_c_flags[] = "Flags";
66
char taskbar_c_flags[] = "Flags";
67
char taskbar_c_variables[] = "Variables";
67
char taskbar_c_variables[] = "Variables";
68
char docky_ini_path[] = "/sys/settings/docky.ini";
68
char docky_ini_path[] = "/sys/settings/docky.ini";
69
 
69
 
70
unsigned char panels_img_data[] = FROM "panels_image.raw";
70
unsigned char panels_img_data[] = FROM "panels_image.raw";
71
raw_image panels_img = { 37, 27, #panels_img_data };
71
raw_image panels_img = { 37, 27, #panels_img_data };
72
 
72
 
73
system_colors sc;
73
system_colors sc;
74
proc_info Form;
74
proc_info Form;
75
 
75
 
76
struct docky_cfg {
76
struct docky_cfg {
77
	word fsize;
77
	word fsize;
78
	byte location, ashow;
78
	byte location, ashow;
79
} docky_cfg;
79
} docky_cfg;
80
 
80
 
81
struct taskbar_cfg {
81
struct taskbar_cfg {
82
	byte Attachment;
82
	byte Attachment;
83
	byte PanelHeight, SoftenHeight, ButtonOffset;
83
	byte PanelHeight, SoftenHeight, ButtonOffset;
84
	byte SoftenUp, SoftenDown, MinLeftButton, MinRightButton, MenuButton,
84
	byte SoftenUp, SoftenDown, MinLeftButton, MinRightButton, MenuButton,
85
	     RunApplButton, ClnDeskButton, Clock, CpuUsage, ChangeLang;
85
	     RunApplButton, ClnDeskButton, Clock, CpuUsage, ChangeLang;
86
} taskbar_cfg;
86
} taskbar_cfg;
87
 
87
 
88
enum {
88
enum {
89
	TASKBAR,
89
	TASKBAR,
90
	DOCKY
90
	DOCKY
91
};
91
};
92
 
92
 
93
 
93
 
94
void main()
94
void main()
95
{
95
{
96
	dword id, key;
96
	dword id, key;
97
 
97
 
98
	mem_Init();
98
	mem_Init();
99
	if (load_dll2(libini, #lib_init,1)!=0) notify(LIBINI_LOAD_ERR);
99
	if (load_dll2(libini, #lib_init,1)!=0) notify(LIBINI_LOAD_ERR);
100
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(BOX_LIB_LOAD_ERR);
100
	if (load_dll2(boxlib, #box_lib_init,0)!=0) notify(BOX_LIB_LOAD_ERR);
101
 
101
 
102
	LoadCfg();
102
	LoadCfg();
103
 
103
 
104
	loop() switch(WaitEvent())
104
	loop() switch(WaitEvent())
105
	{
105
	{
106
		case evButton: 
106
		case evButton: 
107
				id=GetButtonID();
107
				id=GetButtonID();
108
				if (id==1) ExitProcess();
108
				if (id==1) ExitProcess();
109
				//taskbar buttons
109
				//taskbar buttons
110
				if (id>=100) && (id<200)
110
				if (id>=100) && (id<200)
111
				{
111
				{
112
					if (id==100) taskbar_cfg.Attachment ^= 1;
112
					if (id==100) taskbar_cfg.Attachment ^= 1;
113
					if (id==105) taskbar_cfg.SoftenUp ^= 1;
113
					if (id==105) taskbar_cfg.SoftenUp ^= 1;
114
					if (id==106) taskbar_cfg.SoftenDown ^= 1;
114
					if (id==106) taskbar_cfg.SoftenDown ^= 1;
115
					if (id==107) taskbar_cfg.MinLeftButton ^= 1;
115
					if (id==107) taskbar_cfg.MinLeftButton ^= 1;
116
					if (id==108) taskbar_cfg.MinRightButton ^= 1;
116
					if (id==108) taskbar_cfg.MinRightButton ^= 1;
117
					if (id==109) taskbar_cfg.RunApplButton ^= 1;
117
					if (id==109) taskbar_cfg.RunApplButton ^= 1;
118
					if (id==110) taskbar_cfg.ClnDeskButton ^= 1;
118
					if (id==110) taskbar_cfg.ClnDeskButton ^= 1;
119
					if (id==111) taskbar_cfg.Clock ^= 1;
119
					if (id==111) taskbar_cfg.Clock ^= 1;
120
					if (id==112) taskbar_cfg.CpuUsage ^= 1;
120
					if (id==112) taskbar_cfg.CpuUsage ^= 1;
121
					if (id==113) taskbar_cfg.ChangeLang ^= 1;
121
					if (id==113) taskbar_cfg.ChangeLang ^= 1;
122
					if (id==114) taskbar_cfg.MenuButton ^= 1;
122
					if (id==114) taskbar_cfg.MenuButton ^= 1;
123
					if (id==120) taskbar_cfg.PanelHeight++;
123
					if (id==120) taskbar_cfg.PanelHeight++;
124
					if (id==121) && (taskbar_cfg.PanelHeight>6) taskbar_cfg.PanelHeight--;
124
					if (id==121) && (taskbar_cfg.PanelHeight>6) taskbar_cfg.PanelHeight--;
125
					if (id==122) taskbar_cfg.SoftenHeight++;
125
					if (id==122) taskbar_cfg.SoftenHeight++;
126
					if (id==123) && (taskbar_cfg.SoftenHeight>0) taskbar_cfg.SoftenHeight--;
126
					if (id==123) && (taskbar_cfg.SoftenHeight>0) taskbar_cfg.SoftenHeight--;
127
					if (id==124) taskbar_cfg.ButtonOffset++;
127
					if (id==124) taskbar_cfg.ButtonOffset++;
128
					if (id==125) && (taskbar_cfg.ButtonOffset>0) taskbar_cfg.ButtonOffset--;
128
					if (id==125) && (taskbar_cfg.ButtonOffset>0) taskbar_cfg.ButtonOffset--;
129
					DrawWindowContent(TASKBAR);
129
					DrawWindowContent(TASKBAR);
130
					SaveCfg(TASKBAR);
130
					SaveCfg(TASKBAR);
131
					RestartProcess(TASKBAR);
131
					RestartProcess(TASKBAR);
132
				}
132
				}
133
				//docky buttons			
133
				//docky buttons			
134
				if (id>=200)
134
				if (id>=200)
135
				{
135
				{
136
					if (id==200)
136
					if (id==200)
137
					{
137
					{
138
						     if (docky_cfg.location==1) docky_cfg.location = 2;
138
						     if (docky_cfg.location==1) docky_cfg.location = 2;
139
						else if (docky_cfg.location==2) docky_cfg.location = 3;
139
						else if (docky_cfg.location==2) docky_cfg.location = 3;
140
						else if (docky_cfg.location==3) docky_cfg.location = 1;
140
						else if (docky_cfg.location==3) docky_cfg.location = 1;
141
					}
141
					}
142
					if (id==201) docky_cfg.fsize ^= 1;
142
					if (id==201) docky_cfg.fsize ^= 1;
143
					if (id==202) docky_cfg.ashow ^= 1;
143
					if (id==202) docky_cfg.ashow ^= 1;
144
					DrawWindowContent(DOCKY);
144
					DrawWindowContent(DOCKY);
145
					SaveCfg(DOCKY);
145
					SaveCfg(DOCKY);
146
					RestartProcess(DOCKY);
146
					RestartProcess(DOCKY);
147
				}
147
				}
148
				break;
148
				break;
149
				
149
				
150
		case evKey:
150
		case evKey:
151
				key = GetKey();
151
				key = GetKey();
152
				if (key==27) ExitProcess();
152
				if (key==27) ExitProcess();
153
				break;
153
				break;
154
			
154
			
155
		case evReDraw:
155
		case evReDraw:
156
				sc.get();
156
				sc.get();
157
				DefineAndDrawWindow(130, 150, 400, 300+GetSkinHeight(),0x34,sc.work,WINDOW_TITLE);
157
				DefineAndDrawWindow(130, 150, 400, 300+GetSkinHeight(),0x34,sc.work,WINDOW_TITLE);
158
				GetProcessInfo(#Form, SelfInfo);
158
				GetProcessInfo(#Form, SelfInfo);
159
				if (Form.status_window>2) break;
159
				if (Form.status_window>2) break;
160
				taskbar_frame.size_x = docky_frame.size_x = - taskbar_frame.start_x * 2 + Form.cwidth;
160
				taskbar_frame.size_x = docky_frame.size_x = - taskbar_frame.start_x * 2 + Form.cwidth;
161
				taskbar_frame.font_color = docky_frame.font_color = sc.work_text;
161
				taskbar_frame.font_color = docky_frame.font_color = sc.work_text;
162
				taskbar_frame.font_backgr_color = docky_frame.font_backgr_color = sc.work;
162
				taskbar_frame.font_backgr_color = docky_frame.font_backgr_color = sc.work;
163
				taskbar_frame.ext_col = docky_frame.ext_col = sc.work_graph;
163
				taskbar_frame.ext_col = docky_frame.ext_col = sc.work_graph;
164
				DrawWindowContent();
164
				DrawWindowContent();
165
	}
165
	}
166
}
166
}
167
 
167
 
168
 
168
 
169
void DrawWindowContent() 
169
void DrawWindowContent() 
170
{
170
{
171
	word win_center_x;
171
	word win_center_x;
172
 
172
 
173
  frame_draw stdcall (#taskbar_frame);
173
  frame_draw stdcall (#taskbar_frame);
174
	DefineButton(22, taskbar_frame.start_y + 12, panels_img.w-1, 27-1, 100 + BT_HIDE, 0);
174
	DefineButton(22, taskbar_frame.start_y + 12, panels_img.w-1, 27-1, 100 + BT_HIDE, 0);
175
	_PutImage(22, taskbar_frame.start_y + 12,  37, 27, taskbar_cfg.Attachment * 37 * 27 * 3 + panels_img.data);
175
	_PutImage(22, taskbar_frame.start_y + 12,  37, 27, taskbar_cfg.Attachment * 37 * 27 * 3 + panels_img.data);
176
	WriteText(68, taskbar_frame.start_y + 20, 0x80, work_text, CHANGE_POS);
176
	WriteText(68, taskbar_frame.start_y + 20, 0x80, sc.work_text, CHANGE_POS);
177
	PanelCfg_CheckBox(22, taskbar_frame.start_y +  48, 105, SOFTEN_UP, taskbar_cfg.SoftenUp);
177
	PanelCfg_CheckBox(22, taskbar_frame.start_y +  48, 105, SOFTEN_UP, taskbar_cfg.SoftenUp);
178
	PanelCfg_CheckBox(22, taskbar_frame.start_y +  68, 106, SOFTEN_DOWN, taskbar_cfg.SoftenDown);
178
	PanelCfg_CheckBox(22, taskbar_frame.start_y +  68, 106, SOFTEN_DOWN, taskbar_cfg.SoftenDown);
179
	PanelCfg_CheckBox(22, taskbar_frame.start_y +  88, 107, MIN_LEFT_BUTTON, taskbar_cfg.MinLeftButton);
179
	PanelCfg_CheckBox(22, taskbar_frame.start_y +  88, 107, MIN_LEFT_BUTTON, taskbar_cfg.MinLeftButton);
180
	PanelCfg_CheckBox(22, taskbar_frame.start_y + 108, 108, MIN_RIGHT_BUTTON, taskbar_cfg.MinRightButton);
180
	PanelCfg_CheckBox(22, taskbar_frame.start_y + 108, 108, MIN_RIGHT_BUTTON, taskbar_cfg.MinRightButton);
181
	win_center_x = Form.cwidth / 2;
181
	win_center_x = Form.cwidth / 2;
182
	PanelCfg_CheckBox(win_center_x, taskbar_frame.start_y +  48, 111, CLOCK, taskbar_cfg.Clock);
182
	PanelCfg_CheckBox(win_center_x, taskbar_frame.start_y +  48, 111, CLOCK, taskbar_cfg.Clock);
183
	PanelCfg_CheckBox(win_center_x, taskbar_frame.start_y +  68, 112, CPU_USAGE, taskbar_cfg.CpuUsage);
183
	PanelCfg_CheckBox(win_center_x, taskbar_frame.start_y +  68, 112, CPU_USAGE, taskbar_cfg.CpuUsage);
184
	PanelCfg_CheckBox(win_center_x, taskbar_frame.start_y +  88, 113, CHANGE_LANG, taskbar_cfg.ChangeLang);
184
	PanelCfg_CheckBox(win_center_x, taskbar_frame.start_y +  88, 113, CHANGE_LANG, taskbar_cfg.ChangeLang);
185
	PanelCfg_CheckBox(win_center_x, taskbar_frame.start_y + 108, 114, MENU_BUTTON, taskbar_cfg.MenuButton);	
185
	PanelCfg_CheckBox(win_center_x, taskbar_frame.start_y + 108, 114, MENU_BUTTON, taskbar_cfg.MenuButton);	
186
	PanelCfg_MoreLessBox(22, taskbar_frame.start_y + 131, 120, 121, taskbar_cfg.PanelHeight, PANEL_HEIGHT);
186
	PanelCfg_MoreLessBox(22, taskbar_frame.start_y + 131, 120, 121, taskbar_cfg.PanelHeight, PANEL_HEIGHT);
187
	PanelCfg_MoreLessBox(win_center_x, taskbar_frame.start_y + 131, 122, 123, taskbar_cfg.SoftenHeight, SOFTEN_HEIGHT);
187
	PanelCfg_MoreLessBox(win_center_x, taskbar_frame.start_y + 131, 122, 123, taskbar_cfg.SoftenHeight, SOFTEN_HEIGHT);
188
	PanelCfg_MoreLessBox(22, taskbar_frame.start_y + 159, 124, 125, taskbar_cfg.ButtonOffset, BUTTON_OFFSET);
188
	PanelCfg_MoreLessBox(22, taskbar_frame.start_y + 159, 124, 125, taskbar_cfg.ButtonOffset, BUTTON_OFFSET);
189
 
189
 
190
  frame_draw stdcall (#docky_frame);
190
  frame_draw stdcall (#docky_frame);
191
	DefineButton(22, docky_frame.start_y + 12, panels_img.w-1, 27-1, 200 + BT_HIDE, 0);
191
	DefineButton(22, docky_frame.start_y + 12, panels_img.w-1, 27-1, 200 + BT_HIDE, 0);
192
	_PutImage(22, docky_frame.start_y + 12,  37, 27, docky_cfg.location + 1 * 37 * 27 * 3 + panels_img.data);
192
	_PutImage(22, docky_frame.start_y + 12,  37, 27, docky_cfg.location + 1 * 37 * 27 * 3 + panels_img.data);
193
	WriteText(68, docky_frame.start_y + 20, 0x80, work_text, CHANGE_POS);
193
	WriteText(68, docky_frame.start_y + 20, 0x80, sc.work_text, CHANGE_POS);
194
 
194
 
195
	PanelCfg_CheckBox(22, docky_frame.start_y + 48, 201, FSIZE,  docky_cfg.fsize);
195
	PanelCfg_CheckBox(22, docky_frame.start_y + 48, 201, FSIZE,  docky_cfg.fsize);
196
	PanelCfg_CheckBox(win_center_x, docky_frame.start_y + 48, 202, ASHOW, docky_cfg.ashow);
196
	PanelCfg_CheckBox(win_center_x, docky_frame.start_y + 48, 202, ASHOW, docky_cfg.ashow);
197
}
197
}
198
 
198
 
199
void LoadCfg()
199
void LoadCfg()
200
{ 
200
{ 
201
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Attachment", 1);     taskbar_cfg.Attachment = EAX;
201
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Attachment", 1);     taskbar_cfg.Attachment = EAX;
202
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "SoftenUp", 1);       taskbar_cfg.SoftenUp = EAX;
202
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "SoftenUp", 1);       taskbar_cfg.SoftenUp = EAX;
203
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "SoftenDown", 1);     taskbar_cfg.SoftenDown = EAX;
203
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "SoftenDown", 1);     taskbar_cfg.SoftenDown = EAX;
204
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MinLeftButton", 1);  taskbar_cfg.MinLeftButton = EAX;
204
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MinLeftButton", 1);  taskbar_cfg.MinLeftButton = EAX;
205
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MinRightButton", 1); taskbar_cfg.MinRightButton = EAX;
205
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MinRightButton", 1); taskbar_cfg.MinRightButton = EAX;
206
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Clock", 1);          taskbar_cfg.Clock = EAX;
206
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Clock", 1);          taskbar_cfg.Clock = EAX;
207
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "CpuUsage", 1);       taskbar_cfg.CpuUsage = EAX;
207
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "CpuUsage", 1);       taskbar_cfg.CpuUsage = EAX;
208
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "ChangeLang", 1);     taskbar_cfg.ChangeLang = EAX;
208
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "ChangeLang", 1);     taskbar_cfg.ChangeLang = EAX;
209
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MenuButton", 1);     taskbar_cfg.MenuButton = EAX;
209
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MenuButton", 1);     taskbar_cfg.MenuButton = EAX;
210
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "PanelHeight", 18);    taskbar_cfg.PanelHeight = EAX;
210
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "PanelHeight", 18);    taskbar_cfg.PanelHeight = EAX;
211
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "SoftenHeight", 4);    taskbar_cfg.SoftenHeight = EAX;
211
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "SoftenHeight", 4);    taskbar_cfg.SoftenHeight = EAX;
212
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "ButtonTopOffset", 3); taskbar_cfg.ButtonOffset = EAX;
212
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "ButtonTopOffset", 3); taskbar_cfg.ButtonOffset = EAX;
213
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "ButtonBotOffset", 3); taskbar_cfg.ButtonOffset = EAX;
213
	ini_get_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "ButtonBotOffset", 3); taskbar_cfg.ButtonOffset = EAX;
214
 
214
 
215
	ini_get_int stdcall (#docky_ini_path, "@", "location", 0);  docky_cfg.location = EAX;
215
	ini_get_int stdcall (#docky_ini_path, "@", "location", 0);  docky_cfg.location = EAX;
216
	ini_get_int stdcall (#docky_ini_path, "@", "fsize", 0);     docky_cfg.fsize = EAX;
216
	ini_get_int stdcall (#docky_ini_path, "@", "fsize", 0);     docky_cfg.fsize = EAX;
217
	ini_get_int stdcall (#docky_ini_path, "@", "ashow", 0);     docky_cfg.ashow = EAX;
217
	ini_get_int stdcall (#docky_ini_path, "@", "ashow", 0);     docky_cfg.ashow = EAX;
218
}
218
}
219
 
219
 
220
void SaveCfg(byte panel_type)
220
void SaveCfg(byte panel_type)
221
{
221
{
222
	if (panel_type==TASKBAR) {
222
	if (panel_type==TASKBAR) {
223
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Attachment", taskbar_cfg.Attachment);
223
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Attachment", taskbar_cfg.Attachment);
224
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "SoftenUp", taskbar_cfg.SoftenUp);
224
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "SoftenUp", taskbar_cfg.SoftenUp);
225
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "SoftenDown", taskbar_cfg.SoftenDown);
225
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "SoftenDown", taskbar_cfg.SoftenDown);
226
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MinLeftButton", taskbar_cfg.MinLeftButton);
226
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MinLeftButton", taskbar_cfg.MinLeftButton);
227
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MinRightButton", taskbar_cfg.MinRightButton);
227
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MinRightButton", taskbar_cfg.MinRightButton);
228
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "RunApplButton", taskbar_cfg.RunApplButton);
228
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "RunApplButton", taskbar_cfg.RunApplButton);
229
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "ClnDeskButton", taskbar_cfg.ClnDeskButton);
229
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "ClnDeskButton", taskbar_cfg.ClnDeskButton);
230
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Clock", taskbar_cfg.Clock);
230
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Clock", taskbar_cfg.Clock);
231
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "CpuUsage", taskbar_cfg.CpuUsage);
231
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "CpuUsage", taskbar_cfg.CpuUsage);
232
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "ChangeLang", taskbar_cfg.ChangeLang);
232
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "ChangeLang", taskbar_cfg.ChangeLang);
233
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MenuButton", taskbar_cfg.MenuButton);
233
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "MenuButton", taskbar_cfg.MenuButton);
234
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "PanelHeight", taskbar_cfg.PanelHeight);
234
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "PanelHeight", taskbar_cfg.PanelHeight);
235
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "SoftenHeight", taskbar_cfg.SoftenHeight);
235
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "SoftenHeight", taskbar_cfg.SoftenHeight);
236
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "ButtonTopOffset", taskbar_cfg.ButtonOffset);
236
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "ButtonTopOffset", taskbar_cfg.ButtonOffset);
237
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "ButtonBottOffset", taskbar_cfg.ButtonOffset);
237
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_variables, "ButtonBottOffset", taskbar_cfg.ButtonOffset);
238
	}
238
	}
239
	if (panel_type==DOCKY) {
239
	if (panel_type==DOCKY) {
240
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Attachment", taskbar_cfg.Attachment);
240
		ini_set_int stdcall (#taskbar_ini_path, #taskbar_c_flags, "Attachment", taskbar_cfg.Attachment);
241
		ini_set_int stdcall (#docky_ini_path, "@", "location", docky_cfg.location);
241
		ini_set_int stdcall (#docky_ini_path, "@", "location", docky_cfg.location);
242
		ini_set_int stdcall (#docky_ini_path, "@", "fsize", docky_cfg.fsize);
242
		ini_set_int stdcall (#docky_ini_path, "@", "fsize", docky_cfg.fsize);
243
		ini_set_int stdcall (#docky_ini_path, "@", "ashow", docky_cfg.ashow);
243
		ini_set_int stdcall (#docky_ini_path, "@", "ashow", docky_cfg.ashow);
244
	}
244
	}
245
}
245
}
246
 
246
 
247
void RestartProcess(byte panel_type)
247
void RestartProcess(byte panel_type)
248
{
248
{
249
	int i;
249
	int i;
250
	dword proc_name;
250
	dword proc_name;
251
	proc_info Process;
251
	proc_info Process;
252
	if (panel_type == TASKBAR) proc_name = "@taskbar";
252
	if (panel_type == TASKBAR) proc_name = "@taskbar";
253
	if (panel_type == DOCKY) proc_name = "@docky";
253
	if (panel_type == DOCKY) proc_name = "@docky";
254
	for (i=0; i<1000; i++;)
254
	for (i=0; i<1000; i++;)
255
	{
255
	{
256
		GetProcessInfo(#Process, i);
256
		GetProcessInfo(#Process, i);
257
		if (strcmpi(#Process.name, proc_name)==0) { KillProcess(Process.ID); break; }
257
		if (strcmpi(#Process.name, proc_name)==0) { KillProcess(Process.ID); break; }
258
	}
258
	}
259
	RunProgram(proc_name, "");
259
	RunProgram(proc_name, "");
260
 
260
 
261
	if (panel_type == TASKBAR) pause(50);
261
	if (panel_type == TASKBAR) pause(50);
262
	if (panel_type == DOCKY) pause(120);
262
	if (panel_type == DOCKY) pause(120);
263
	GetProcessInfo(#Form, SelfInfo);
263
	GetProcessInfo(#Form, SelfInfo);
264
	ActivateWindow(GetProcessSlot(Form.ID));
264
	ActivateWindow(GetProcessSlot(Form.ID));
265
}
265
}
266
 
266
 
267
 
267
 
268
 
268
 
269
void PanelCfg_CheckBox(dword x, y, id, text, byte value) {
269
void PanelCfg_CheckBox(dword x, y, id, text, byte value) {
270
	CheckBox(x, y, 14, 14, id, text, sc.work_graph, sc.work_text, value);
270
	CheckBox(x, y, 14, 14, id, text, sc.work_graph, sc.work_text, value);
271
}
271
}
272
 
272
 
273
void PanelCfg_MoreLessBox(dword x, y, id_more, id_less; byte value; dword text) {
273
void PanelCfg_MoreLessBox(dword x, y, id_more, id_less; byte value; dword text) {
274
	MoreLessBox(x, y, 18, id_more, id_less, sc.work_graph, sc.work_button, sc.work_text, value, text);
274
	MoreLessBox(x, y, 18, id_more, id_less, sc.work_graph, sc.work_button, sc.work_text, value, text);
275
}
275
}
276
 
276
 
277
 
277
 
278
stop:
278
stop:
279
>
279
>