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