Rev 7220 | Rev 7244 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7220 | Rev 7227 | ||
---|---|---|---|
1 | #ifdef LANG_RUS |
1 | #ifdef LANG_RUS |
2 | ?define WINDOW_TITLE_PROPERTIES "¢®©á⢠" |
2 | ?define WINDOW_TITLE_PROPERTIES "¢®©á⢠" |
3 | ?define BTN_CLOSE " ªàëâì" |
3 | ?define BTN_CLOSE " ªàëâì" |
4 | ?define BTN_APPLY "ਬ¥¨âì" |
4 | ?define BTN_APPLY "ਬ¥¨âì" |
5 | ?define QUEST_1 "ਬ¥¨âì ª® ¢á¥¬ ¢«®¦¥ë¬" |
5 | ?define QUEST_1 "ਬ¥¨âì ª® ¢á¥¬ ¢«®¦¥ë¬" |
6 | ?define QUEST_2 "ä ©« ¬ ¨ ¯ ¯ª ¬?" |
6 | ?define QUEST_2 "ä ©« ¬ ¨ ¯ ¯ª ¬?" |
7 | ?define PR_T_NAME "•:" |
7 | ?define PR_T_NAME "•:" |
8 | ?define PR_T_DEST " ᯮ«®¦¥¨¥:" |
8 | ?define PR_T_DEST " ᯮ«®¦¥¨¥:" |
9 | ?define PR_T_SIZE " §¬¥à:" |
9 | ?define PR_T_SIZE " §¬¥à:" |
10 | ?define CREATED_OPENED_MODIFIED "®§¤ :\nâªàëâ:\n§¬¥¥:" |
10 | ?define CREATED_OPENED_MODIFIED "®§¤ :\nâªàëâ:\n§¬¥¥:" |
11 | ?define SET_6 " ©«®¢: " |
11 | ?define SET_6 " ©«®¢: " |
12 | ?define SET_7 " ¯®ª: " |
12 | ?define SET_7 " ¯®ª: " |
13 | ?define PR_T_CONTAINS "®¤¥à¦¨â: " |
13 | ?define PR_T_CONTAINS "®¤¥à¦¨â: " |
14 | ?define FLAGS " ââਡãâë " |
14 | ?define FLAGS " ââਡãâë " |
15 | ?define PR_T_HIDDEN "ªàëâë©" |
15 | ?define PR_T_HIDDEN "ªàëâë©" |
16 | ?define PR_T_SYSTEM "¨á⥬ë©" |
16 | ?define PR_T_SYSTEM "¨á⥬ë©" |
17 | ?define PR_T_ONLY_READ "®«ìª® ç⥨¥" |
17 | ?define PR_T_ONLY_READ "®«ìª® ç⥨¥" |
18 | ?define SET_BYTE_LANG "¡ ©â" |
18 | ?define SET_BYTE_LANG "¡ ©â" |
19 | #else // Apply to all subfolders |
19 | #else // Apply to all subfolders |
20 | ?define WINDOW_TITLE_PROPERTIES "Properties" |
20 | ?define WINDOW_TITLE_PROPERTIES "Properties" |
21 | ?define BTN_CLOSE "Close" |
21 | ?define BTN_CLOSE "Close" |
22 | ?define BTN_APPLY "Apply" |
22 | ?define BTN_APPLY "Apply" |
23 | ?define QUEST_1 "Apply to all subfolders" |
23 | ?define QUEST_1 "Apply to all subfolders" |
24 | ?define QUEST_2 "files and Folders?" |
24 | ?define QUEST_2 "files and Folders?" |
25 | ?define PR_T_NAME "Name:" |
25 | ?define PR_T_NAME "Name:" |
26 | ?define PR_T_DEST "Destination:" |
26 | ?define PR_T_DEST "Destination:" |
27 | ?define PR_T_SIZE "Size:" |
27 | ?define PR_T_SIZE "Size:" |
28 | ?define CREATED_OPENED_MODIFIED "Created:\nOpened:\nModified:" |
28 | ?define CREATED_OPENED_MODIFIED "Created:\nOpened:\nModified:" |
29 | ?define SET_6 "Files: " |
29 | ?define SET_6 "Files: " |
30 | ?define SET_7 " Folders: " |
30 | ?define SET_7 " Folders: " |
31 | ?define PR_T_CONTAINS "Contains: " |
31 | ?define PR_T_CONTAINS "Contains: " |
32 | ?define FLAGS " Attributes " |
32 | ?define FLAGS " Attributes " |
33 | ?define PR_T_HIDDEN "Hidden" |
33 | ?define PR_T_HIDDEN "Hidden" |
34 | ?define PR_T_SYSTEM "System" |
34 | ?define PR_T_SYSTEM "System" |
35 | ?define PR_T_ONLY_READ "Read-only" |
35 | ?define PR_T_ONLY_READ "Read-only" |
36 | ?define SET_BYTE_LANG "byte" |
36 | ?define SET_BYTE_LANG "byte" |
37 | #endif |
37 | #endif |
38 | 38 | ||
39 | dword mouse_2; |
39 | dword mouse_2; |
40 | char path_to_file[4096]; |
40 | char path_to_file[4096]; |
41 | char file_name2[4096]; |
41 | char file_name2[4096]; |
42 | edit_box file_name_ed = {230,55,35,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2),#file_name2,#mouse_2, 1000000000000000b,2,2}; |
42 | edit_box file_name_ed = {230,59,32,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(file_name2),#file_name2,#mouse_2, 1000000000000000b,2,2}; |
43 | edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file),#path_to_file,#mouse_2, 1000000000000000b,2,2}; |
43 | edit_box path_to_file_ed = {160,120,79,0xffffff,0x94AECE,0xFFFfff,0xffffff,2,sizeof(path_to_file),#path_to_file,#mouse_2, 1000000000000000b,2,2}; |
44 | frame flags_frame = { 0, NULL, 10, 92, 212, 0x000111, 0xFFFfff, 1, FLAGS, 0, 1, 12, 0x000111, 0xFFFFFF }; |
- | |
45 | 44 | ||
46 | int file_count, dir_count, size_dir; |
45 | int file_count, dir_count, size_dir; |
47 | char folder_info[200]; |
46 | char folder_info[200]; |
48 | dword element_size; |
47 | dword element_size; |
49 | char element_size_label[32]; |
48 | char element_size_label[32]; |
50 | BDVK file_info_general; |
49 | BDVK file_info_general; |
51 | BDVK file_info_dirsize; |
50 | BDVK file_info_dirsize; |
52 | 51 | ||
53 | proc_info settings_form; |
52 | proc_info settings_form; |
54 | bool quest_active, atr_readonly, atr_hidden, atr_system; |
53 | bool quest_active, atr_readonly, atr_hidden, atr_system; |
55 | 54 | ||
56 | void SetPropertiesDir(dword way) |
55 | void SetPropertiesDir(dword way) |
57 | { |
56 | { |
58 | dword dirbuf, fcount, i, filename; |
57 | dword dirbuf, fcount, i, filename; |
59 | dword cur_file; |
58 | dword cur_file; |
60 | if (dir_exists(way)) |
59 | if (dir_exists(way)) |
61 | { |
60 | { |
62 | cur_file = malloc(4096); |
61 | cur_file = malloc(4096); |
63 | GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); |
62 | GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); |
64 | for (i=0; i |
63 | for (i=0; i |
65 | { |
64 | { |
66 | filename = i*304+dirbuf+72; |
65 | filename = i*304+dirbuf+72; |
67 | strcpy(cur_file, way); |
66 | strcpy(cur_file, way); |
68 | chrcat(cur_file, '/'); |
67 | chrcat(cur_file, '/'); |
69 | strcat(cur_file, filename); |
68 | strcat(cur_file, filename); |
70 | if ( TestBit(ESDWORD[filename-40], 4) ) |
69 | if ( TestBit(ESDWORD[filename-40], 4) ) |
71 | { |
70 | { |
72 | SetPropertiesDir(cur_file); |
71 | SetPropertiesDir(cur_file); |
73 | } |
72 | } |
74 | GetFileInfo(cur_file, #file_info_dirsize); |
73 | GetFileInfo(cur_file, #file_info_dirsize); |
75 | file_info_dirsize.readonly = atr_readonly; |
74 | file_info_dirsize.readonly = atr_readonly; |
76 | file_info_dirsize.hidden = atr_hidden; |
75 | file_info_dirsize.hidden = atr_hidden; |
77 | file_info_dirsize.system = atr_system; |
76 | file_info_dirsize.system = atr_system; |
78 | SetFileInfo(cur_file, #file_info_dirsize); |
77 | SetFileInfo(cur_file, #file_info_dirsize); |
79 | } |
78 | } |
80 | free(cur_file); |
79 | free(cur_file); |
81 | } |
80 | } |
82 | } |
81 | } |
83 | 82 | ||
84 | void SetProperties(byte prop) |
83 | void SetProperties(byte prop) |
85 | { |
84 | { |
86 | dword cur_file; |
85 | dword cur_file; |
87 | 86 | ||
88 | if (prop==1) || (prop==2) |
87 | if (prop==1) || (prop==2) |
89 | { |
88 | { |
90 | if (selected_count) |
89 | if (selected_count) |
91 | { |
90 | { |
92 | cur_file = malloc(4096); |
91 | cur_file = malloc(4096); |
93 | for (i=0; i |
92 | for (i=0; i |
94 | { |
93 | { |
95 | if (getElementSelectedFlag(i) == true) |
94 | if (getElementSelectedFlag(i) == true) |
96 | { |
95 | { |
97 | strcpy(cur_file, #path); |
96 | strcpy(cur_file, #path); |
98 | strcat(cur_file, file_mas[i]*304+buf+72); |
97 | strcat(cur_file, file_mas[i]*304+buf+72); |
99 | GetFileInfo(cur_file, #file_info_general); |
98 | GetFileInfo(cur_file, #file_info_general); |
100 | file_info_general.readonly = atr_readonly; |
99 | file_info_general.readonly = atr_readonly; |
101 | file_info_general.hidden = atr_hidden; |
100 | file_info_general.hidden = atr_hidden; |
102 | file_info_general.system = atr_system; |
101 | file_info_general.system = atr_system; |
103 | SetFileInfo(cur_file, #file_info_general); |
102 | SetFileInfo(cur_file, #file_info_general); |
104 | if (prop==2) |
103 | if (prop==2) |
105 | { |
104 | { |
106 | if (dir_exists(cur_file)) |
105 | if (dir_exists(cur_file)) |
107 | { |
106 | { |
108 | SetPropertiesDir(cur_file); |
107 | SetPropertiesDir(cur_file); |
109 | } |
108 | } |
110 | } |
109 | } |
111 | } |
110 | } |
112 | } |
111 | } |
113 | free(cur_file); |
112 | free(cur_file); |
114 | } |
113 | } |
115 | else |
114 | else |
116 | { |
115 | { |
117 | GetFileInfo(#file_path, #file_info_general); |
116 | GetFileInfo(#file_path, #file_info_general); |
118 | file_info_general.readonly = atr_readonly; |
117 | file_info_general.readonly = atr_readonly; |
119 | file_info_general.hidden = atr_hidden; |
118 | file_info_general.hidden = atr_hidden; |
120 | file_info_general.system = atr_system; |
119 | file_info_general.system = atr_system; |
121 | SetFileInfo(#file_path, #file_info_general); |
120 | SetFileInfo(#file_path, #file_info_general); |
122 | if (prop==2) SetPropertiesDir(#file_path); |
121 | if (prop==2) SetPropertiesDir(#file_path); |
123 | } |
122 | } |
124 | quest_active = 0; |
123 | quest_active = 0; |
125 | DrawPropertiesWindow(); |
124 | DrawPropertiesWindow(); |
126 | } |
125 | } |
127 | else |
126 | else |
128 | { |
127 | { |
129 | GetFileInfo(#file_path, #file_info_general); |
128 | GetFileInfo(#file_path, #file_info_general); |
130 | file_info_general.readonly = atr_readonly; |
129 | file_info_general.readonly = atr_readonly; |
131 | file_info_general.hidden = atr_hidden; |
130 | file_info_general.hidden = atr_hidden; |
132 | file_info_general.system = atr_system; |
131 | file_info_general.system = atr_system; |
133 | SetFileInfo(#file_path, #file_info_general); |
132 | SetFileInfo(#file_path, #file_info_general); |
134 | } |
133 | } |
135 | cmd_free=3; |
134 | cmd_free=3; |
136 | _not_draw = true; |
135 | _not_draw = true; |
137 | Open_Dir(#path,WITH_REDRAW); |
136 | Open_Dir(#path,WITH_REDRAW); |
138 | _not_draw = false; |
137 | _not_draw = false; |
139 | EventRedrawWindow(Form.left,Form.top); |
138 | EventRedrawWindow(Form.left,Form.top); |
140 | ExitProcess(); |
139 | ExitProcess(); |
141 | } |
140 | } |
142 | 141 | ||
143 | void ShowConfirmQuestionPopin() |
142 | void ShowConfirmQuestionPopin() |
144 | { |
143 | { |
145 | quest_active = 1; |
144 | quest_active = 1; |
146 | DrawPopup(15,80,250,90,1,system.color.work, system.color.work_graph); |
145 | DrawPopup(15,80,250,90,1,system.color.work, system.color.work_graph); |
147 | WriteText(35, 102, 0x90, 0x000000, QUEST_1); |
146 | WriteText(35, 102, 0x90, 0x000000, QUEST_1); |
148 | WriteText(65, 117, 0x90, 0x000000, QUEST_2); |
147 | WriteText(65, 117, 0x90, 0x000000, QUEST_2); |
149 | DrawFlatButton(62,138,301,T_YES); |
148 | DrawFlatButton(62,138,301,T_YES); |
150 | DrawFlatButton(155,138,302,T_NO); |
149 | DrawFlatButton(155,138,302,T_NO); |
151 | } |
150 | } |
152 | 151 | ||
153 | void GetSizeDir(dword way) |
152 | void GetSizeDir(dword way) |
154 | { |
153 | { |
155 | dword dirbuf, fcount, i, filename; |
154 | dword dirbuf, fcount, i, filename; |
156 | dword cur_file; |
155 | dword cur_file; |
157 | if (dir_exists(way)) |
156 | if (dir_exists(way)) |
158 | { |
157 | { |
159 | cur_file = malloc(4096); |
158 | cur_file = malloc(4096); |
160 | // In the process of recursive descent, memory must be allocated dynamically, |
159 | // In the process of recursive descent, memory must be allocated dynamically, |
161 | // because the static memory -> was a bug !!! But unfortunately pass away to sacrifice speed. |
160 | // because the static memory -> was a bug !!! But unfortunately pass away to sacrifice speed. |
162 | GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); |
161 | GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL); |
163 | for (i=0; i |
162 | for (i=0; i |
164 | { |
163 | { |
165 | filename = i*304+dirbuf+72; |
164 | filename = i*304+dirbuf+72; |
166 | sprintf(cur_file,"%s/%s",way,filename); |
165 | sprintf(cur_file,"%s/%s",way,filename); |
167 | 166 | ||
168 | if (TestBit(ESDWORD[filename-40], 4) ) |
167 | if (TestBit(ESDWORD[filename-40], 4) ) |
169 | { |
168 | { |
170 | dir_count++; |
169 | dir_count++; |
171 | GetSizeDir(cur_file); |
170 | GetSizeDir(cur_file); |
172 | } |
171 | } |
173 | else |
172 | else |
174 | { |
173 | { |
175 | GetFileInfo(cur_file, #file_info_dirsize); |
174 | GetFileInfo(cur_file, #file_info_dirsize); |
176 | size_dir += file_info_dirsize.sizelo; |
175 | size_dir += file_info_dirsize.sizelo; |
177 | file_count++; |
176 | file_count++; |
178 | } |
177 | } |
179 | } |
178 | } |
180 | free(cur_file); |
179 | free(cur_file); |
181 | } |
180 | } |
182 | } |
181 | } |
183 | 182 | ||
184 | void GetSizeMoreFiles(dword way) |
183 | void GetSizeMoreFiles(dword way) |
185 | { |
184 | { |
186 | char cur_file[4096]; |
185 | char cur_file[4096]; |
187 | 186 | ||
188 | for (i=0; i |
187 | for (i=0; i |
189 | { |
188 | { |
190 | if (getElementSelectedFlag(i) == true) |
189 | if (getElementSelectedFlag(i) == true) |
191 | { |
190 | { |
192 | sprintf(#cur_file,"%s/%s",way,file_mas[i]*304+buf+72); |
191 | sprintf(#cur_file,"%s/%s",way,file_mas[i]*304+buf+72); |
193 | if (TestBit(ESDWORD[file_mas[i]*304+buf+32], 4) ) |
192 | if (TestBit(ESDWORD[file_mas[i]*304+buf+32], 4) ) |
194 | { |
193 | { |
195 | GetSizeDir(#cur_file); |
194 | GetSizeDir(#cur_file); |
196 | dir_count++; |
195 | dir_count++; |
197 | } |
196 | } |
198 | else |
197 | else |
199 | { |
198 | { |
200 | GetFileInfo(#cur_file, #file_info_dirsize); |
199 | GetFileInfo(#cur_file, #file_info_dirsize); |
201 | size_dir += file_info_dirsize.sizelo; |
200 | size_dir += file_info_dirsize.sizelo; |
202 | file_count++; |
201 | file_count++; |
203 | } |
202 | } |
204 | } |
203 | } |
205 | } |
204 | } |
206 | } |
205 | } |
207 | 206 | ||
208 | void properties_dialog() |
207 | void properties_dialog() |
209 | { |
208 | { |
210 | byte id; |
209 | byte id; |
211 | 210 | ||
212 | DSBYTE[#folder_info]=0; |
211 | DSBYTE[#folder_info]=0; |
213 | file_count = 0; |
212 | file_count = 0; |
214 | dir_count = 0; |
213 | dir_count = 0; |
215 | size_dir = 0; |
214 | size_dir = 0; |
216 | 215 | ||
217 | if (selected_count) |
216 | if (selected_count) |
218 | { |
217 | { |
219 | GetSizeMoreFiles(#path); |
218 | GetSizeMoreFiles(#path); |
220 | atr_readonly = 0; |
219 | atr_readonly = 0; |
221 | atr_hidden = 0; |
220 | atr_hidden = 0; |
222 | atr_system = 0; |
221 | atr_system = 0; |
223 | } |
222 | } |
224 | else |
223 | else |
225 | { |
224 | { |
226 | GetFileInfo(#file_path, #file_info_general); |
225 | GetFileInfo(#file_path, #file_info_general); |
227 | strcpy(#file_name2, #file_name); |
226 | strcpy(#file_name2, #file_name); |
228 | file_name_ed.size = strlen(#file_name2); |
227 | file_name_ed.size = strlen(#file_name2); |
229 | if(itdir) GetSizeDir(#file_path); |
228 | if(itdir) GetSizeDir(#file_path); |
230 | atr_readonly = file_info_general.readonly; |
229 | atr_readonly = file_info_general.readonly; |
231 | atr_hidden = file_info_general.hidden; |
230 | atr_hidden = file_info_general.hidden; |
232 | atr_system = file_info_general.system; |
231 | atr_system = file_info_general.system; |
233 | } |
232 | } |
234 | strcpy(#path_to_file, #path); |
233 | strcpy(#path_to_file, #path); |
235 | path_to_file_ed.size = strlen(#path_to_file); |
234 | path_to_file_ed.size = strlen(#path_to_file); |
236 | 235 | ||
237 | SetEventMask(0x27); |
236 | SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); |
238 | loop() switch(WaitEvent()) |
237 | loop() switch(WaitEvent()) |
239 | { |
238 | { |
240 | case evButton: |
239 | case evButton: |
241 | id=GetButtonID(); |
240 | id=GetButtonID(); |
242 | if (quest_active) |
241 | if (quest_active) |
243 | { |
242 | { |
244 | IF (id==301) SetProperties(2); |
243 | IF (id==301) SetProperties(2); |
245 | IF (id==302) SetProperties(1); |
244 | IF (id==302) SetProperties(1); |
246 | quest_active=false; |
245 | quest_active=false; |
247 | break; |
246 | break; |
248 | } |
247 | } |
249 | if (id==1) || (id==10) |
248 | if (id==1) || (id==10) |
250 | { |
249 | { |
251 | cmd_free=3; |
250 | cmd_free=3; |
252 | ExitProcess(); |
251 | ExitProcess(); |
253 | } |
252 | } |
254 | IF (id==11) |
253 | IF (id==11) |
255 | { |
254 | { |
256 | if (selected_count) || (itdir) |
255 | if (selected_count) || (itdir) |
257 | { |
256 | { |
258 | ShowConfirmQuestionPopin(); |
257 | ShowConfirmQuestionPopin(); |
259 | } |
258 | } |
260 | else |
259 | else |
261 | { |
260 | { |
262 | SetProperties(0); |
261 | SetProperties(0); |
263 | } |
262 | } |
264 | break; |
263 | break; |
265 | } |
264 | } |
266 | if (id==20) |
265 | if (id==20) |
267 | { |
266 | { |
268 | atr_readonly ^= 1; |
267 | atr_readonly ^= 1; |
269 | DrawPropertiesCheckBoxes(); |
268 | DrawPropertiesCheckBoxes(); |
270 | } |
269 | } |
271 | if (id==21) |
270 | if (id==21) |
272 | { |
271 | { |
273 | atr_hidden ^= 1; |
272 | atr_hidden ^= 1; |
274 | DrawPropertiesCheckBoxes(); |
273 | DrawPropertiesCheckBoxes(); |
275 | } |
274 | } |
276 | if (id==22) |
275 | if (id==22) |
277 | { |
276 | { |
278 | atr_system ^= 1; |
277 | atr_system ^= 1; |
279 | DrawPropertiesCheckBoxes(); |
278 | DrawPropertiesCheckBoxes(); |
280 | } |
279 | } |
281 | break; |
280 | break; |
282 | 281 | ||
283 | case evMouse: |
282 | case evMouse: |
284 | edit_box_mouse stdcall (#file_name_ed); |
283 | edit_box_mouse stdcall (#file_name_ed); |
285 | edit_box_mouse stdcall (#path_to_file_ed); |
284 | edit_box_mouse stdcall (#path_to_file_ed); |
286 | break; |
285 | break; |
287 | 286 | ||
288 | case evKey: |
287 | case evKey: |
289 | GetKeys(); |
288 | GetKeys(); |
290 | 289 | ||
291 | if (quest_active) |
290 | if (quest_active) |
292 | { |
291 | { |
293 | IF (key_scancode==SCAN_CODE_ENTER) SetProperties(2); |
292 | IF (key_scancode==SCAN_CODE_ENTER) SetProperties(2); |
294 | IF (key_scancode==SCAN_CODE_ESC) SetProperties(1); |
293 | IF (key_scancode==SCAN_CODE_ESC) SetProperties(1); |
295 | quest_active=false; |
294 | quest_active=false; |
296 | break; |
295 | break; |
297 | } |
296 | } |
298 | if (key_scancode==SCAN_CODE_ESC) |
297 | if (key_scancode==SCAN_CODE_ESC) |
299 | { |
298 | { |
300 | cmd_free=3; |
299 | cmd_free=3; |
301 | ExitProcess(); |
300 | ExitProcess(); |
302 | } |
301 | } |
303 | if (key_scancode==SCAN_CODE_ENTER) |
302 | if (key_scancode==SCAN_CODE_ENTER) |
304 | { |
303 | { |
305 | if (selected_count) || (itdir) |
304 | if (selected_count) || (itdir) |
306 | { |
305 | { |
307 | ShowConfirmQuestionPopin(); |
306 | ShowConfirmQuestionPopin(); |
308 | } |
307 | } |
309 | else |
308 | else |
310 | { |
309 | { |
311 | SetProperties(0); |
310 | SetProperties(0); |
312 | } |
311 | } |
313 | break; |
312 | break; |
314 | } |
313 | } |
315 | edit_box_key stdcall(#file_name_ed); |
314 | edit_box_key stdcall(#file_name_ed); |
316 | edit_box_key stdcall(#path_to_file_ed); |
315 | edit_box_key stdcall(#path_to_file_ed); |
317 | break; |
316 | break; |
318 | 317 | ||
319 | case evReDraw: |
318 | case evReDraw: |
320 | DrawPropertiesWindow(); |
319 | DrawPropertiesWindow(); |
321 | } |
320 | } |
322 | } |
321 | } |
323 | 322 | ||
324 | void DrawPropertiesWindow() |
323 | void DrawPropertiesWindow() |
325 | { |
324 | { |
326 | dword ext1; |
325 | dword ext1; |
327 | char temp_path[sizeof(file_path)]; |
326 | char temp_path[sizeof(file_path)]; |
328 | DefineAndDrawWindow(Form.left + 150,150,305,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0); |
327 | DefineAndDrawWindow(Form.left + 150,150,315,360+skin_height,0x34,system.color.work,WINDOW_TITLE_PROPERTIES,0); |
329 | if ( !asm test path_to_file_ed.flags, 2) |
- | |
330 | { |
- | |
331 | path_to_file_ed.blur_border_color = system.color.work; |
- | |
332 | path_to_file_ed.color = system.color.work; |
- | |
333 | } |
- | |
334 | else |
- | |
335 | { |
- | |
336 | path_to_file_ed.blur_border_color = 0x000000; |
- | |
337 | path_to_file_ed.color = 0xffffff; |
- | |
338 | } |
- | |
339 | if ( !asm test path_to_file_ed.flags, 2) |
- | |
340 | { |
- | |
341 | file_name_ed.blur_border_color = system.color.work; |
- | |
342 | file_name_ed.color = system.color.work; |
- | |
343 | } |
- | |
344 | else |
- | |
345 | { |
- | |
346 | file_name_ed.blur_border_color = 0x000000; |
- | |
347 | file_name_ed.color = 0xffffff; |
- | |
348 | } |
- | |
349 | GetProcessInfo(#settings_form, SelfInfo); |
328 | GetProcessInfo(#settings_form, SelfInfo); |
350 | 329 | ||
351 | DrawFlatButton(settings_form.cwidth - 96, settings_form.cheight-34, 10, BTN_CLOSE); |
330 | DrawFlatButton(settings_form.cwidth - 96, settings_form.cheight-34, 10, BTN_CLOSE); |
352 | DrawFlatButton(settings_form.cwidth -208, settings_form.cheight-34, 11, BTN_APPLY); |
331 | DrawFlatButton(settings_form.cwidth -208, settings_form.cheight-34, 11, BTN_APPLY); |
353 | 332 | ||
354 | WriteText(10, 78, 0x90, system.color.work_text, PR_T_DEST); |
333 | WriteText(10, 78, 0x90, system.color.work_text, PR_T_DEST); |
355 | edit_box_draw stdcall (#path_to_file_ed); |
334 | edit_box_draw stdcall (#path_to_file_ed); |
356 | 335 | ||
357 | WriteText(10, 97, 0x90, system.color.work_text, PR_T_SIZE); |
336 | WriteText(10, 97, 0x90, system.color.work_text, PR_T_SIZE); |
358 | 337 | ||
359 | if (selected_count) |
338 | if (selected_count) |
360 | { |
339 | { |
361 | PropertiesDrawIcon(NULL, " |
340 | PropertiesDrawIcon(NULL, " |
362 | sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
341 | sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
363 | WriteText(file_name_ed.left+4, 30, 0x90, system.color.work_text, #folder_info); |
342 | WriteText(file_name_ed.left+4, 30, 0x90, system.color.work_text, #folder_info); |
364 | sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(size_dir, NULL),size_dir,SET_BYTE_LANG); |
343 | sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(size_dir, NULL),size_dir,SET_BYTE_LANG); |
365 | WriteText(120, 97, 0x90, system.color.work_text, #element_size_label); |
344 | WriteText(120, 97, 0x90, system.color.work_text, #element_size_label); |
366 | } |
345 | } |
367 | else |
346 | else |
368 | { |
347 | { |
369 | if ( file_info_general.isfolder ) |
348 | if ( file_info_general.isfolder ) |
370 | PropertiesDrawIcon(NULL, " |
349 | PropertiesDrawIcon(NULL, " |
371 | else { |
350 | else { |
372 | sprintf(#temp_path,"%s/%s",#path,#file_name2); |
351 | sprintf(#temp_path,"%s/%s",#path,#file_name2); |
373 | ext1 = strrchr(#file_name2,'.'); |
352 | ext1 = strrchr(#file_name2,'.'); |
374 | if (ext1) ext1 += #file_name2; |
353 | if (ext1) ext1 += #file_name2; |
375 | PropertiesDrawIcon(#temp_path, ext1); |
354 | PropertiesDrawIcon(#temp_path, ext1); |
376 | } |
355 | } |
377 | WriteText(file_name_ed.left+4, 20, 0x80, system.color.work_text, PR_T_NAME); |
356 | WriteText(file_name_ed.left, file_name_ed.top-15, 0x80, system.color.work_text, PR_T_NAME); |
378 | edit_box_draw stdcall (#file_name_ed); |
357 | DrawEditBox(#file_name_ed); |
379 | 358 | ||
380 | if (!itdir) element_size = file_info_general.sizelo; |
359 | if (!itdir) element_size = file_info_general.sizelo; |
381 | else |
360 | else |
382 | { |
361 | { |
383 | WriteText(10,116, 0x90, system.color.work_text, PR_T_CONTAINS); |
362 | WriteText(10,116, 0x90, system.color.work_text, PR_T_CONTAINS); |
384 | sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
363 | sprintf(#folder_info,"%s%d%s%d",SET_6,file_count,SET_7,dir_count); |
385 | WriteText(120, 116, 0x90, system.color.work_text, #folder_info); |
364 | WriteText(120, 116, 0x90, system.color.work_text, #folder_info); |
386 | element_size = size_dir; |
365 | element_size = size_dir; |
387 | } |
366 | } |
388 | WriteTextLines(10, 136, 0x90, system.color.work_text, CREATED_OPENED_MODIFIED, 20); |
367 | WriteTextLines(10, 136, 0x90, system.color.work_text, CREATED_OPENED_MODIFIED, 20); |
389 | DrawDate(120, 136, system.color.work_text, #file_info_general.datecreate); |
368 | DrawDate(120, 136, system.color.work_text, #file_info_general.datecreate); |
390 | DrawDate(120, 156, system.color.work_text, #file_info_general.datelastaccess); |
369 | DrawDate(120, 156, system.color.work_text, #file_info_general.datelastaccess); |
391 | DrawDate(120, 176, system.color.work_text, #file_info_general.datelastedit); |
370 | DrawDate(120, 176, system.color.work_text, #file_info_general.datelastedit); |
392 | 371 | ||
393 | sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(element_size, NULL),element_size,SET_BYTE_LANG); |
372 | sprintf(#element_size_label,"%s (%d %s)",ConvertSize64(element_size, NULL),element_size,SET_BYTE_LANG); |
394 | WriteText(120, 99, 0x90, system.color.work_text, #element_size_label); |
373 | WriteText(120, 99, 0x90, system.color.work_text, #element_size_label); |
395 | } |
374 | } |
396 | flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2; |
375 | DrawFrame(10, 212, -10*2 + settings_form.cwidth - 2, 92, FLAGS); |
397 | flags_frame.font_color = system.color.work_text; |
- | |
398 | flags_frame.ext_col = system.color.work_graph; |
- | |
399 | flags_frame.font_backgr_color = system.color.work; |
- | |
400 | frame_draw stdcall (#flags_frame); |
- | |
401 | DrawPropertiesCheckBoxes(); |
376 | DrawPropertiesCheckBoxes(); |
402 | } |
377 | } |
403 | 378 | ||
404 | void PropertiesDrawIcon(dword file_path, extension) |
379 | void PropertiesDrawIcon(dword file_path, extension) |
405 | { |
380 | { |
406 | #define ICON_PADDING 10 |
381 | #define ICON_PADDING 11 |
407 | DrawBar(20-ICON_PADDING, 30-ICON_PADDING-1, ICON_PADDING*2+16, ICON_PADDING*2+16, system.color.work_light); |
382 | DrawBar(20-ICON_PADDING, 30-ICON_PADDING-1, ICON_PADDING*2+16, ICON_PADDING*2+16, 0xFFFfff); |
408 | DrawIconByExtension(file_path, extension, 20, 30, system.color.work_light); |
383 | DrawIconByExtension(file_path, extension, 20, 30, system.color.work_light); |
409 | } |
384 | } |
410 | 385 | ||
411 | void DrawPropertiesCheckBoxes() |
386 | void DrawPropertiesCheckBoxes() |
412 | { |
387 | { |
413 | incn y; |
388 | incn y; |
414 | y.n = flags_frame.start_y; |
389 | y.n = 212; //212 => attributes_frame.y |
415 | CheckBox(24, y.inc(18), 20, PR_T_ONLY_READ, atr_readonly); |
390 | CheckBox(24, y.inc(18), 20, PR_T_ONLY_READ, atr_readonly); |
416 | CheckBox(24, y.inc(24), 21, PR_T_HIDDEN, atr_hidden); |
391 | CheckBox(24, y.inc(24), 21, PR_T_HIDDEN, atr_hidden); |
417 | CheckBox(24, y.inc(24), 22, PR_T_SYSTEM, atr_system); |
392 | CheckBox(24, y.inc(24), 22, PR_T_SYSTEM, atr_system); |
418 | } |
393 | } |