Subversion Repositories Kolibri OS

Rev

Rev 5674 | Rev 5691 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5674 Rev 5688
Line 1... Line 1...
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 "à¨¬¥­¨âì"
-
 
5
	?define QUEST_1 "à¨¬¥­¨âì ª® ¢á¥¬ ¢«®¦¥­­ë¬"
-
 
6
	?define QUEST_2 "ä ©« ¬ ¨ ¯ ¯ª ¬"
4
	?define PR_T_NAME "ˆ¬ï:"
7
	?define PR_T_NAME "ˆ¬ï:"
5
	?define PR_T_DEST " á¯®«®¦¥­¨¥:"
8
	?define PR_T_DEST " á¯®«®¦¥­¨¥:"
6
	?define PR_T_SIZE " §¬¥à:"
9
	?define PR_T_SIZE " §¬¥à:"
7
	?define SET_3 "‘®§¤ ­:"
10
	?define SET_3 "‘®§¤ ­:"
8
	?define SET_4 "Žâªàëâ:"
11
	?define SET_4 "Žâªàëâ:"
Line 16... Line 19...
16
	?define PR_T_ONLY_READ "’®«ìª® ç⥭¨¥"
19
	?define PR_T_ONLY_READ "’®«ìª® ç⥭¨¥"
17
	?define SET_BYTE_LANG "¡ ©â"
20
	?define SET_BYTE_LANG "¡ ©â"
18
#else
21
#else
19
	?define WINDOW_TITLE_PROPERTIES "Properties"
22
	?define WINDOW_TITLE_PROPERTIES "Properties"
20
	?define BTN_CLOSE "Close"
23
	?define BTN_CLOSE "Close"
-
 
24
	?define BTN_APPLY "Apply"
-
 
25
	?define QUEST_1 "à¨¬¥­¨âì ª® ¢á¥¬ ¢«®¦¥­­ë¬"
-
 
26
	?define QUEST_2 "ä ©« ¬ ¨ ¯ ¯ª ¬"
21
	?define PR_T_NAME "Name:"
27
	?define PR_T_NAME "Name:"
22
	?define PR_T_DEST "Destination:"
28
	?define PR_T_DEST "Destination:"
23
	?define PR_T_SIZE "Size:"
29
	?define PR_T_SIZE "Size:"
24
	?define SET_3 "Created:"
30
	?define SET_3 "Created:"
25
	?define SET_4 "Opened:"
31
	?define SET_4 "Opened:"
Line 37... Line 43...
37
dword mouse_ddd2;
43
dword mouse_ddd2;
38
char path_to_file[4096]="\0";
44
char path_to_file[4096]="\0";
39
char file_name2[4096]="\0";
45
char file_name2[4096]="\0";
40
edit_box file_name_ed = {195,50,25,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#file_name2,#mouse_ddd2, 1000000000000000b,2,2};
46
edit_box file_name_ed = {195,50,25,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#file_name2,#mouse_ddd2, 1000000000000000b,2,2};
41
edit_box path_to_file_ed = {145,100,46,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#path_to_file,#mouse_ddd2, 1000000000000000b,2,2};
47
edit_box path_to_file_ed = {145,100,46,0xffffff,0x94AECE,0x000000,0xffffff,2,4098,#path_to_file,#mouse_ddd2, 1000000000000000b,2,2};
42
frame flags_frame = { 0, 280, 10, 83, 151, 0x000111, 0xFFFfff, 1, FLAGS, 0, 0, 6, 0x000111, 0xCCCccc };
48
frame flags_frame = { 0, 280, 10, 83, 151, 0x000111, 0xFFFfff, 1, FLAGS, 0, 0, 6, 0x000111, 0xFFFFFF };
Line 43... Line 49...
43
 
49
 
44
int file_count, dir_count, size_dir;
50
int file_count, dir_count, size_dir;
-
 
51
char folder_info[200];
-
 
52
dword element_size;
45
char folder_info[200];
53
char element_size_label[32];
46
BDVK file_info_general;
54
BDVK file_info_general;
Line -... Line 55...
-
 
55
BDVK file_info_dirsize;
-
 
56
 
-
 
57
proc_info settings_form;
-
 
58
byte quest_active, atr_readonly, atr_hidden, atr_system;
-
 
59
 
-
 
60
void SetPropertiesDir(dword way)
-
 
61
{
-
 
62
	dword dirbuf, fcount, i, filename;
-
 
63
	dword cur_file;
-
 
64
	if (isdir(way))
-
 
65
	{
-
 
66
		cur_file = malloc(4096);
-
 
67
		GetDir(#dirbuf, #fcount, way, DIRS_ONLYREAL);
-
 
68
		for (i=0; i
-
 
69
		{
-
 
70
			filename = i*304+dirbuf+72;
-
 
71
			strcpy(cur_file, way);
-
 
72
			chrcat(cur_file, '/');
-
 
73
			strcat(cur_file, filename);
-
 
74
			if ( TestBit(ESDWORD[filename-40], 4) )
-
 
75
			{
-
 
76
				SetPropertiesDir(cur_file);
-
 
77
			}
-
 
78
			GetFileInfo(cur_file, #file_info_dirsize);
-
 
79
			file_info_dirsize.readonly = atr_readonly;
-
 
80
			file_info_dirsize.hidden = atr_hidden;
-
 
81
			file_info_dirsize.system = atr_system;
-
 
82
			SetFileInfo(cur_file, #file_info_dirsize);
-
 
83
		}
-
 
84
		free(cur_file);
-
 
85
	}
47
BDVK file_info_dirsize;
86
}
48
 
87
 
-
 
88
void SetProperties(byte prop)
-
 
89
{
-
 
90
	dword cur_file;
-
 
91
	dword selected_offset2;
-
 
92
 
49
void SetProperties(byte id)
93
	if (prop==1) || (prop==2)
-
 
94
	{
-
 
95
		if (selected_count)
-
 
96
		{
-
 
97
			cur_file = malloc(4096);
-
 
98
			for (i=0; i
-
 
99
			{
-
 
100
				selected_offset2 = file_mas[i]*304 + buf+32 + 7;
-
 
101
				if (ESBYTE[selected_offset2])
-
 
102
				{
-
 
103
					strcpy(cur_file, #path);
-
 
104
					strcat(cur_file, file_mas[i]*304+buf+72);
-
 
105
					GetFileInfo(cur_file, #file_info_general);
-
 
106
					file_info_general.readonly = atr_readonly;
-
 
107
					file_info_general.hidden = atr_hidden;
-
 
108
					file_info_general.system = atr_system;
-
 
109
					SetFileInfo(cur_file, #file_info_general);
-
 
110
					if (prop==2)
-
 
111
					{
-
 
112
						if (isdir(cur_file))
-
 
113
						{
-
 
114
							SetPropertiesDir(cur_file);
-
 
115
						}
-
 
116
					}
-
 
117
				}
-
 
118
			}
50
{
119
			free(cur_file);
51
	if (selected_count) return;
120
		}
-
 
121
		else
52
	else
122
		{
53
	{
123
			GetFileInfo(#file_path, #file_info_general);
54
		if (id==20) file_info_general.readonly ^= true;
124
			file_info_general.readonly = atr_readonly;
55
		if (id==21) file_info_general.hidden ^= true;
125
			file_info_general.hidden = atr_hidden;
-
 
126
			file_info_general.system = atr_system;
56
		if (id==22) file_info_general.system ^= true;
127
			SetFileInfo(#file_path, #file_info_general);
-
 
128
			if (prop==2) SetPropertiesDir(#file_path);
-
 
129
		}
-
 
130
		quest_active = 0;
-
 
131
		DrawPropertiesWindow();
-
 
132
	}
-
 
133
	else
-
 
134
	{
-
 
135
		GetFileInfo(#file_path, #file_info_general);
-
 
136
		file_info_general.readonly = atr_readonly;
-
 
137
		file_info_general.hidden = atr_hidden;
-
 
138
		file_info_general.system = atr_system;
-
 
139
		SetFileInfo(#file_path, #file_info_general);
-
 
140
	}
-
 
141
	cmd_free=3;
-
 
142
	_not_draw = true;
-
 
143
    Open_Dir(#path,WITH_REDRAW);
-
 
144
    _not_draw = false;
-
 
145
    EventRedrawWindow(Form.left,Form.top);
-
 
146
	ExitProcess();
-
 
147
}
-
 
148
 
-
 
149
void Quest()
-
 
150
{
-
 
151
	DrawPopup(30,80,200,90,1,system.color.work, system.color.work_graph);
-
 
152
	WriteText(50, 100, 0x80, 0x000000, QUEST_1);
-
 
153
	WriteText(80, 115, 0x80, 0x000000, QUEST_2);
57
		SetFileInfo(#file_path, #file_info_general);
154
	DrawFlatButton(52,138,70,20,301,0xFFB6B5,T_YES);
Line 58... Line 155...
58
	}
155
	DrawFlatButton(145,138,70,20,302,0xC6DFC6,T_NO);
59
}
156
}
60
 
157
 
Line 127... Line 224...
127
void properties_dialog()
224
void properties_dialog()
128
{
225
{
129
	byte id;
226
	byte id;
130
	byte key;
227
	byte key;
131
	dword file_name_off;
228
	dword file_name_off;
132
	dword element_size;
-
 
133
	dword selected_offset2;
229
	dword selected_offset2;
134
	char element_size_label[32],tmp;
-
 
135
	proc_info settings_form;
-
 
Line 136... Line 230...
136
	
230
	
137
	DSBYTE[#folder_info]=0;
231
	DSBYTE[#folder_info]=0;
138
	file_count = 0;
232
	file_count = 0;
139
	dir_count = 0;	
233
	dir_count = 0;	
Line -... Line 234...
-
 
234
	size_dir = 0;
-
 
235
			
140
	size_dir = 0;
236
	if (selected_count)
-
 
237
	{
-
 
238
		GetSizeMoreFiles(#path);
-
 
239
		atr_readonly = 0;
-
 
240
		atr_hidden = 0;
141
			
241
		atr_system = 0;
142
	if (selected_count) GetSizeMoreFiles(#path);
242
	}
143
	else
243
	else
144
	{
244
	{
145
		GetFileInfo(#file_path, #file_info_general);
245
		GetFileInfo(#file_path, #file_info_general);
146
		strcpy(#file_name2, #file_name);
246
		strcpy(#file_name2, #file_name);
-
 
247
		file_name_ed.size = strlen(#file_name2);   
-
 
248
		if(itdir) GetSizeDir(#file_path);
-
 
249
		atr_readonly = file_info_general.readonly;
147
		file_name_ed.size = strlen(#file_name2);   
250
		atr_hidden = file_info_general.hidden;
148
		if(itdir) GetSizeDir(#file_path);
251
		atr_system = file_info_general.system;
149
	}
252
	}
Line 150... Line 253...
150
	strcpy(#path_to_file, #path);
253
	strcpy(#path_to_file, #path);
151
	path_to_file_ed.size = strlen(#path_to_file);
254
	path_to_file_ed.size = strlen(#path_to_file);
152
	
255
	
153
	SetEventMask(0x27);
256
	SetEventMask(0x27);
154
	loop() switch(WaitEvent())
257
	loop() switch(WaitEvent())
-
 
258
	{
-
 
259
		case evButton: 
-
 
260
				id=GetButtonID();
-
 
261
				if (quest_active)
-
 
262
				{
-
 
263
					IF (id==301) SetProperties(2);
155
	{
264
					IF (id==302) SetProperties(1);
156
		case evButton: 
265
					break;
157
				id=GetButtonID();
266
				}
158
				if (id==1) || (id==10)
267
				if (id==1) || (id==10)
159
				{
268
				{
160
					cmd_free=3;
-
 
161
					ExitProcess();
269
					cmd_free=3;
162
				}
270
					ExitProcess();
163
				if (id==20) SetProperties(id);
271
				}
164
				if (id==21)
272
				IF (id==11) 
165
				{
273
				{
166
					SetProperties(id);
274
					if (selected_count) || (itdir)
167
					_not_draw = true;
-
 
168
					Open_Dir(#path,WITH_REDRAW);
275
					{
-
 
276
						quest_active = 1;
-
 
277
						Quest();
169
					_not_draw = false;
278
					}
-
 
279
					else 
-
 
280
					{
170
					EventRedrawWindow(Form.left,Form.top);
281
						SetProperties(0);
-
 
282
					}
-
 
283
					break;
-
 
284
				}
171
				}
285
				if (id==20) atr_readonly ^= 1;
172
				if (id==22) SetProperties(id);
286
				if (id==21) atr_hidden ^= 1;
Line 173... Line 287...
173
				
287
				if (id==22) atr_system ^= 1;
174
				DrawPropertiesCheckBoxes();
288
				DrawPropertiesCheckBoxes();
175
				break;
289
				break;
176
				
290
				
Line 177... Line 291...
177
		case evMouse:
291
		case evMouse:
178
				edit_box_mouse stdcall (#file_name_ed);
292
				edit_box_mouse stdcall (#file_name_ed);
-
 
293
				edit_box_mouse stdcall (#path_to_file_ed);
-
 
294
				break;
-
 
295
			
-
 
296
		case evKey:
-
 
297
				key = GetKey();
-
 
298
				if (quest_active)
179
				edit_box_mouse stdcall (#path_to_file_ed);
299
				{
180
				break;
300
					IF (key==013) SetProperties(2);
181
			
301
					IF (key==027) SetProperties(1);
182
		case evKey:
302
					break;
183
				key = GetKey();
303
				}
Line 190... Line 310...
190
				edit_box_key stdcall(#file_name_ed);
310
				edit_box_key stdcall(#file_name_ed);
191
				edit_box_key stdcall(#path_to_file_ed);
311
				edit_box_key stdcall(#path_to_file_ed);
192
				break;
312
				break;
Line 193... Line 313...
193
				
313
				
-
 
314
		case evReDraw:
-
 
315
				DrawPropertiesWindow();
-
 
316
	}
-
 
317
}
-
 
318
 
-
 
319
void DrawPropertiesWindow()
194
		case evReDraw:
320
{
195
				DefineAndDrawWindow(Form.left + 150,150,270,285+GetSkinHeight(),0x34,system.color.work,WINDOW_TITLE_PROPERTIES);
321
	DefineAndDrawWindow(Form.left + 150,150,270,285+GetSkinHeight(),0x34,0xFFFFFF,WINDOW_TITLE_PROPERTIES);
196
				GetProcessInfo(#settings_form, SelfInfo);
322
	GetProcessInfo(#settings_form, SelfInfo);
-
 
323
	DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE);
197
				DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE);
324
	DrawFlatButton(settings_form.cwidth - 150 - 13, settings_form.cheight - 34, 70, 22, 11, 0xE4DFE1, BTN_APPLY);
Line 198... Line 325...
198
				DrawBar(10, 10, 32, 32, 0xFFFfff);
325
	DrawBar(10, 10, 32, 32, 0xFFFfff);
199
				
326
	
Line 235... Line 362...
235
                    DrawDate(100, 110, 0, #file_info_general.datelastaccess);
362
        DrawDate(100, 110, 0, #file_info_general.datelastaccess);
236
                    DrawDate(100, 125, 0, #file_info_general.datelastedit);
363
        DrawDate(100, 125, 0, #file_info_general.datelastedit);
Line 237... Line 364...
237
 
364
 
238
					sprintf(#element_size_label,"%s (%d %s)",ConvertSize(element_size),element_size,SET_BYTE_LANG);
365
		sprintf(#element_size_label,"%s (%d %s)",ConvertSize(element_size),element_size,SET_BYTE_LANG);
239
					WriteText(100, 65, 0x80, 0x000000, #element_size_label);
366
		WriteText(100, 65, 0x80, 0x000000, #element_size_label);
240
					
367
	}
241
					flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2;
368
	flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2;
242
					flags_frame.font_color = system.color.work_text;
-
 
243
					flags_frame.font_backgr_color = system.color.work;
369
	flags_frame.font_color = system.color.work_text;
244
					flags_frame.ext_col = system.color.work_graph;
370
	flags_frame.ext_col = system.color.work_graph;
245
					frame_draw stdcall (#flags_frame);
371
	frame_draw stdcall (#flags_frame);
246
					DrawPropertiesCheckBoxes();
372
	DrawPropertiesCheckBoxes();
247
				}
-
 
248
	}
-
 
Line 249... Line 373...
249
}
373
}
250
 
374
 
251
void DrawPropertiesCheckBoxes()
375
void DrawPropertiesCheckBoxes()
252
{
376
{
253
	CheckBox2(22, flags_frame.start_y + 14, 20, PR_T_ONLY_READ,  file_info_general.readonly);
377
	CheckBox2(22, flags_frame.start_y + 14, 20, PR_T_ONLY_READ, atr_readonly);
254
	CheckBox2(22, flags_frame.start_y + 36, 21, PR_T_HIDDEN,  file_info_general.hidden);
378
	CheckBox2(22, flags_frame.start_y + 36, 21, PR_T_HIDDEN, atr_hidden);
255
	CheckBox2(22, flags_frame.start_y + 58, 22, PR_T_SYSTEM,  file_info_general.system);
379
	CheckBox2(22, flags_frame.start_y + 58, 22, PR_T_SYSTEM, atr_system);