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