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