Rev 7227 | Rev 7362 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7227 | Rev 7244 | ||
---|---|---|---|
Line 48... | Line 48... | ||
48 | char element_size_label[32]; |
48 | char element_size_label[32]; |
49 | BDVK file_info_general; |
49 | BDVK file_info_general; |
50 | BDVK file_info_dirsize; |
50 | BDVK file_info_dirsize; |
Line 51... | Line 51... | ||
51 | 51 | ||
- | 52 | proc_info settings_form; |
|
- | 53 | bool quest_active; |
|
- | 54 | ||
- | 55 | checkbox ch_read_only = { PR_T_ONLY_READ, NULL }; |
|
- | 56 | checkbox ch_hidden = { PR_T_HIDDEN, NULL }; |
|
- | 57 | checkbox ch_system = { PR_T_SYSTEM, NULL }; |
|
52 | proc_info settings_form; |
58 | |
- | 59 | void SetPropertiesFile(dword cur_file, bdvk_pointer) |
|
- | 60 | { |
|
- | 61 | GetFileInfo(cur_file, bdvk_pointer); |
|
- | 62 | ESI = bdvk_pointer; |
|
- | 63 | ESI.BDVK.readonly = ch_read_only.checked; |
|
- | 64 | ESI.BDVK.hidden = ch_hidden.checked; |
|
- | 65 | ESI.BDVK.system = ch_system.checked; |
|
- | 66 | SetFileInfo(cur_file, bdvk_pointer); |
|
Line 53... | Line 67... | ||
53 | bool quest_active, atr_readonly, atr_hidden, atr_system; |
67 | } |
54 | 68 | ||
55 | void SetPropertiesDir(dword way) |
69 | void SetPropertiesDir(dword way) |
56 | { |
70 | { |
Line 68... | Line 82... | ||
68 | strcat(cur_file, filename); |
82 | strcat(cur_file, filename); |
69 | if ( TestBit(ESDWORD[filename-40], 4) ) |
83 | if ( TestBit(ESDWORD[filename-40], 4) ) |
70 | { |
84 | { |
71 | SetPropertiesDir(cur_file); |
85 | SetPropertiesDir(cur_file); |
72 | } |
86 | } |
73 | GetFileInfo(cur_file, #file_info_dirsize); |
- | |
74 | file_info_dirsize.readonly = atr_readonly; |
- | |
75 | file_info_dirsize.hidden = atr_hidden; |
- | |
76 | file_info_dirsize.system = atr_system; |
- | |
77 | SetFileInfo(cur_file, #file_info_dirsize); |
87 | SetPropertiesFile(cur_file, #file_info_dirsize); |
78 | } |
88 | } |
79 | free(cur_file); |
89 | free(cur_file); |
80 | } |
90 | } |
81 | } |
91 | } |
Line 93... | Line 103... | ||
93 | { |
103 | { |
94 | if (getElementSelectedFlag(i) == true) |
104 | if (getElementSelectedFlag(i) == true) |
95 | { |
105 | { |
96 | strcpy(cur_file, #path); |
106 | strcpy(cur_file, #path); |
97 | strcat(cur_file, file_mas[i]*304+buf+72); |
107 | strcat(cur_file, file_mas[i]*304+buf+72); |
98 | GetFileInfo(cur_file, #file_info_general); |
- | |
99 | file_info_general.readonly = atr_readonly; |
- | |
100 | file_info_general.hidden = atr_hidden; |
108 | SetPropertiesDir(cur_file); |
101 | file_info_general.system = atr_system; |
- | |
102 | SetFileInfo(cur_file, #file_info_general); |
- | |
103 | if (prop==2) |
109 | if (prop==2) |
104 | { |
110 | { |
105 | if (dir_exists(cur_file)) |
111 | if (dir_exists(cur_file)) |
106 | { |
112 | { |
107 | SetPropertiesDir(cur_file); |
113 | SetPropertiesDir(cur_file); |
Line 111... | Line 117... | ||
111 | } |
117 | } |
112 | free(cur_file); |
118 | free(cur_file); |
113 | } |
119 | } |
114 | else |
120 | else |
115 | { |
121 | { |
116 | GetFileInfo(#file_path, #file_info_general); |
- | |
117 | file_info_general.readonly = atr_readonly; |
- | |
118 | file_info_general.hidden = atr_hidden; |
- | |
119 | file_info_general.system = atr_system; |
- | |
120 | SetFileInfo(#file_path, #file_info_general); |
122 | SetPropertiesFile(#file_path, #file_info_general); |
121 | if (prop==2) SetPropertiesDir(#file_path); |
123 | if (prop==2) SetPropertiesDir(#file_path); |
122 | } |
124 | } |
123 | quest_active = 0; |
125 | quest_active = 0; |
124 | DrawPropertiesWindow(); |
126 | DrawPropertiesWindow(); |
125 | } |
127 | } |
126 | else |
128 | else |
127 | { |
129 | { |
128 | GetFileInfo(#file_path, #file_info_general); |
- | |
129 | file_info_general.readonly = atr_readonly; |
- | |
130 | file_info_general.hidden = atr_hidden; |
- | |
131 | file_info_general.system = atr_system; |
- | |
132 | SetFileInfo(#file_path, #file_info_general); |
130 | SetPropertiesFile(#file_path, #file_info_general); |
133 | } |
131 | } |
134 | cmd_free=3; |
132 | cmd_free=3; |
135 | _not_draw = true; |
133 | _not_draw = true; |
136 | Open_Dir(#path,WITH_REDRAW); |
134 | Open_Dir(#path,WITH_REDRAW); |
137 | _not_draw = false; |
135 | _not_draw = false; |
Line 204... | Line 202... | ||
204 | } |
202 | } |
205 | } |
203 | } |
Line 206... | Line 204... | ||
206 | 204 | ||
207 | void properties_dialog() |
205 | void properties_dialog() |
208 | { |
206 | { |
Line 209... | Line 207... | ||
209 | byte id; |
207 | int id; |
210 | 208 | ||
211 | DSBYTE[#folder_info]=0; |
209 | DSBYTE[#folder_info]=0; |
212 | file_count = 0; |
210 | file_count = 0; |
Line 213... | Line 211... | ||
213 | dir_count = 0; |
211 | dir_count = 0; |
214 | size_dir = 0; |
212 | size_dir = 0; |
215 | 213 | ||
216 | if (selected_count) |
214 | if (selected_count) |
217 | { |
215 | { |
218 | GetSizeMoreFiles(#path); |
216 | GetSizeMoreFiles(#path); |
219 | atr_readonly = 0; |
217 | ch_read_only.checked = 0; |
220 | atr_hidden = 0; |
218 | ch_hidden.checked = 0; |
221 | atr_system = 0; |
219 | ch_system.checked = 0; |
222 | } |
220 | } |
223 | else |
221 | else |
224 | { |
222 | { |
225 | GetFileInfo(#file_path, #file_info_general); |
223 | GetFileInfo(#file_path, #file_info_general); |
226 | strcpy(#file_name2, #file_name); |
224 | strcpy(#file_name2, #file_name); |
227 | file_name_ed.size = strlen(#file_name2); |
225 | file_name_ed.size = strlen(#file_name2); |
228 | if(itdir) GetSizeDir(#file_path); |
226 | if(itdir) GetSizeDir(#file_path); |
229 | atr_readonly = file_info_general.readonly; |
227 | ch_read_only.checked = file_info_general.readonly; |
230 | atr_hidden = file_info_general.hidden; |
228 | ch_hidden.checked = file_info_general.hidden; |
231 | atr_system = file_info_general.system; |
229 | ch_system.checked = file_info_general.system; |
Line 232... | Line 230... | ||
232 | } |
230 | } |
233 | strcpy(#path_to_file, #path); |
231 | strcpy(#path_to_file, #path); |
234 | path_to_file_ed.size = strlen(#path_to_file); |
232 | path_to_file_ed.size = strlen(#path_to_file); |
235 | 233 | ||
236 | SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); |
234 | SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); |
- | 235 | loop() switch(WaitEvent()) |
|
- | 236 | { |
|
- | 237 | case evButton: |
|
237 | loop() switch(WaitEvent()) |
238 | id=GetButtonID(); |
238 | { |
239 | ch_read_only.click(id); |
239 | case evButton: |
240 | ch_hidden.click(id); |
240 | id=GetButtonID(); |
241 | ch_system.click(id); |
241 | if (quest_active) |
242 | if (quest_active) |
Line 260... | Line 261... | ||
260 | { |
261 | { |
261 | SetProperties(0); |
262 | SetProperties(0); |
262 | } |
263 | } |
263 | break; |
264 | break; |
264 | } |
265 | } |
265 | if (id==20) |
- | |
266 | { |
- | |
267 | atr_readonly ^= 1; |
- | |
268 | DrawPropertiesCheckBoxes(); |
- | |
269 | } |
- | |
270 | if (id==21) |
- | |
271 | { |
- | |
272 | atr_hidden ^= 1; |
- | |
273 | DrawPropertiesCheckBoxes(); |
- | |
274 | } |
- | |
275 | if (id==22) |
- | |
276 | { |
- | |
277 | atr_system ^= 1; |
- | |
278 | DrawPropertiesCheckBoxes(); |
- | |
279 | } |
- | |
280 | break; |
266 | break; |
Line 281... | Line 267... | ||
281 | 267 | ||
282 | case evMouse: |
268 | case evMouse: |
283 | edit_box_mouse stdcall (#file_name_ed); |
269 | edit_box_mouse stdcall (#file_name_ed); |
Line 321... | Line 307... | ||
321 | } |
307 | } |
Line 322... | Line 308... | ||
322 | 308 | ||
323 | void DrawPropertiesWindow() |
309 | void DrawPropertiesWindow() |
324 | { |
310 | { |
- | 311 | dword ext1; |
|
325 | dword ext1; |
312 | incn y; |
326 | char temp_path[sizeof(file_path)]; |
313 | char temp_path[sizeof(file_path)]; |
327 | DefineAndDrawWindow(Form.left + 150,150,315,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0); |
314 | DefineAndDrawWindow(Form.left + 150,150,315,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0); |
Line 328... | Line 315... | ||
328 | GetProcessInfo(#settings_form, SelfInfo); |
315 | GetProcessInfo(#settings_form, SelfInfo); |
Line 371... | Line 358... | ||
371 | 358 | ||
372 | sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(element_size, NULL),element_size,SET_BYTE_LANG); |
359 | sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(element_size, NULL),element_size,SET_BYTE_LANG); |
373 | WriteText(120, 99, 0x90, system.color.work_text, #element_size_label); |
360 | WriteText(120, 99, 0x90, system.color.work_text, #element_size_label); |
374 | } |
361 | } |
- | 362 | DrawFrame(10, 212, -10*2 + settings_form.cwidth - 2, 92, FLAGS); |
|
375 | DrawFrame(10, 212, -10*2 + settings_form.cwidth - 2, 92, FLAGS); |
363 | y.n = 212; //212 => attributes_frame.y |
- | 364 | ch_read_only.draw(24, y.inc(18)); |
|
- | 365 | ch_hidden.draw(24, y.inc(24)); |
|
376 | DrawPropertiesCheckBoxes(); |
366 | ch_system.draw(24, y.inc(24)); |
Line 377... | Line 367... | ||
377 | } |
367 | } |
378 | 368 | ||
379 | void PropertiesDrawIcon(dword file_path, extension) |
369 | void PropertiesDrawIcon(dword file_path, extension) |
380 | { |
370 | { |
381 | #define ICON_PADDING 11 |
371 | #define ICON_PADDING 11 |
382 | DrawBar(20-ICON_PADDING, 30-ICON_PADDING-1, ICON_PADDING*2+16, ICON_PADDING*2+16, 0xFFFfff); |
372 | DrawBar(20-ICON_PADDING, 30-ICON_PADDING-1, ICON_PADDING*2+16, ICON_PADDING*2+16, 0xFFFfff); |
383 | DrawIconByExtension(file_path, extension, 20, 30, system.color.work_light); |
- | |
384 | } |
- | |
385 | - | ||
386 | void DrawPropertiesCheckBoxes() |
- | |
387 | { |
- | |
388 | incn y; |
- | |
389 | y.n = 212; //212 => attributes_frame.y |
- | |
390 | CheckBox(24, y.inc(18), 20, PR_T_ONLY_READ, atr_readonly); |
- | |
391 | CheckBox(24, y.inc(24), 21, PR_T_HIDDEN, atr_hidden); |
- |