Subversion Repositories Kolibri OS

Rev

Rev 5487 | Rev 5513 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5487 Rev 5510
Line 71... Line 71...
71
			}
71
			}
72
		}
72
		}
73
	}
73
	}
74
}
74
}
Line -... Line 75...
-
 
75
 
-
 
76
void GetSizeMoreFiles(dword way)
-
 
77
{
-
 
78
	int all_file_count, all_dir_count, all_size;
-
 
79
	char cur_file[4096];
-
 
80
	dword selected_offset2;
-
 
81
	
-
 
82
	all_file_count = 0;
-
 
83
	all_dir_count = 0; 
-
 
84
	all_size = 0;
-
 
85
	
-
 
86
	for (i=0; i
-
 
87
    {
-
 
88
        selected_offset2 = file_mas[i]*304 + buf+32 + 7;
-
 
89
        if (ESBYTE[selected_offset2]) {
-
 
90
            strcpy(#cur_file, way);
-
 
91
            strcat(#cur_file, file_mas[i]*304+buf+72);
-
 
92
 
-
 
93
			GetFileInfo(#cur_file, #file_info_general);
-
 
94
			if ( file_info_general.isfolder )
-
 
95
			{
-
 
96
				GetSizeDir(#cur_file);
-
 
97
				all_file_count = all_file_count + file_count;
-
 
98
				all_dir_count = all_dir_count + dir_count +1;
-
 
99
				all_size = all_size + size_dir;
-
 
100
			}
-
 
101
			else
-
 
102
			{
-
 
103
				all_file_count++;
-
 
104
				all_size = all_size + file_info_general.sizelo;
-
 
105
			}
-
 
106
        }
-
 
107
	}  
-
 
108
	file_count = all_file_count;
-
 
109
	dir_count = all_dir_count;
-
 
110
	size_dir = all_size;
-
 
111
}
75
 
112
 
76
void properties_dialog()
113
void properties_dialog()
77
{
114
{
78
	byte id;
115
	byte id;
79
	byte key;
116
	byte key;
80
	dword file_name_off;
117
	dword file_name_off;
-
 
118
	dword element_size;
-
 
119
	dword selected_offset2;
81
	dword element_size;
120
	int cont = 0;
82
	char element_size_label[32];
121
	char element_size_label[32];
Line 83... Line 122...
83
	proc_info settings_form;
122
	proc_info settings_form;
84
	
123
	
85
	strcpy(#folder_info, "\0");
124
	strcpy(#folder_info, "\0");
86
	file_count = 0;
125
	file_count = 0;
-
 
126
	dir_count = 0;	
-
 
127
	size_dir = 0;
-
 
128
	
-
 
129
	for (i=0; i
-
 
130
	{
-
 
131
		selected_offset2 = file_mas[i]*304 + buf+32 + 7;
-
 
132
		if (ESBYTE[selected_offset2]) cont++;
-
 
133
	}
-
 
134
			
-
 
135
	if (cont) GetSizeMoreFiles(#path);
87
	dir_count = 0;	
136
	else
88
	size_dir = 0;
137
	{
89
	GetFileInfo(#file_path, #file_info_general);
138
		GetFileInfo(#file_path, #file_info_general);
-
 
139
		strcpy(#file_name2, #file_name);
-
 
140
		file_name_ed.size = strlen(#file_name2);	
90
	strcpy(#file_name2, #file_name);
141
		if (itdir) GetSizeDir(#file_path);
91
	file_name_ed.size = strlen(#file_name2);
142
	}
92
	strcpy(#path_to_file, #path);
-
 
93
	path_to_file_ed.size = strlen(#path_to_file);
-
 
Line 94... Line 143...
94
 
143
	strcpy(#path_to_file, #path);
95
	if (itdir) GetSizeDir(#file_path);
144
	path_to_file_ed.size = strlen(#path_to_file);
96
	
145
	
97
	SetEventMask(0x27);
146
	SetEventMask(0x27);
Line 118... Line 167...
118
		case evReDraw:
167
		case evReDraw:
119
				DefineAndDrawWindow(Form.left + 150,150,270,285+GetSkinHeight(),0x34,sc.work,WINDOW_TITLE_PROPERTIES);
168
				DefineAndDrawWindow(Form.left + 150,150,270,285+GetSkinHeight(),0x34,sc.work,WINDOW_TITLE_PROPERTIES);
120
				GetProcessInfo(#settings_form, SelfInfo);
169
				GetProcessInfo(#settings_form, SelfInfo);
121
				DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE);
170
				DrawFlatButton(settings_form.cwidth - 70 - 13, settings_form.cheight - 34, 70, 22, 10, 0xE4DFE1, BTN_CLOSE);
122
				DrawBar(10, 10, 32, 32, 0xFFFfff);
171
				DrawBar(10, 10, 32, 32, 0xFFFfff);
123
				if ( file_info_general.isfolder ) 
-
 
124
					Put_icon("", 18, 20, 0xFFFfff, 0);
-
 
125
				else 
-
 
126
					Put_icon(#file_name2+strrchr(#file_name2,'.'), 18, 20, 0xFFFfff, 0);
-
 
127
 
-
 
128
				WriteText(50, 13, 0x80, 0x000000, PR_T_NAME);				
-
 
129
				edit_box_draw stdcall (#file_name_ed);
-
 
130
 
172
				
131
				WriteText(10, 50, 0x80, 0x000000, PR_T_DEST);
173
				WriteText(10, 50, 0x80, 0x000000, PR_T_DEST);
132
				edit_box_draw stdcall (#path_to_file_ed);
174
				edit_box_draw stdcall (#path_to_file_ed);
Line 133... Line 175...
133
 
175
 
134
				WriteText(10, 65, 0x80, 0x000000, PR_T_SIZE);
-
 
135
				if (!itdir)
-
 
136
				{
-
 
137
					element_size = file_info_general.sizelo;
176
				WriteText(10, 65, 0x80, 0x000000, PR_T_SIZE);
138
				}
177
				
139
				else
178
				if (cont)
140
				{
179
				{
141
					WriteText(10, 80, 0x80, 0x000000, PR_T_CONTAINS);				
180
					Put_icon('', 18, 20, 0xFFFfff, 0);
142
					strcpy(#folder_info, SET_6);
181
					strcpy(#folder_info, SET_6);
143
					strcat(#folder_info, itoa(file_count));
182
					strcat(#folder_info, itoa(file_count));
144
					strcat(#folder_info, SET_7);
183
					strcat(#folder_info, SET_7);
-
 
184
					strcat(#folder_info, itoa(dir_count));
-
 
185
					WriteText(50, 23, 0x80, 0x000000, #folder_info);
-
 
186
					EAX = ConvertSize(size_dir);
-
 
187
					strcpy(#element_size_label, EAX);
-
 
188
					strcat(#element_size_label, " (");
-
 
189
					strcat(#element_size_label, itoa(size_dir));
-
 
190
					strcat(#element_size_label, " b)");
-
 
191
					WriteText(100, 65, 0x80, 0x000000, #element_size_label);
-
 
192
				}
-
 
193
				else
-
 
194
				{
-
 
195
					if ( file_info_general.isfolder ) 
-
 
196
						Put_icon("", 18, 20, 0xFFFfff, 0);
-
 
197
					else 
-
 
198
						Put_icon(#file_name2+strrchr(#file_name2,'.'), 18, 20, 0xFFFfff, 0);
-
 
199
 
-
 
200
					WriteText(50, 13, 0x80, 0x000000, PR_T_NAME);				
-
 
201
					edit_box_draw stdcall (#file_name_ed);
-
 
202
					
-
 
203
					if (!itdir)
-
 
204
					{
-
 
205
						element_size = file_info_general.sizelo;
-
 
206
					}
-
 
207
					else
-
 
208
					{
-
 
209
						WriteText(10, 80, 0x80, 0x000000, PR_T_CONTAINS);				
-
 
210
						strcpy(#folder_info, SET_6);
-
 
211
						strcat(#folder_info, itoa(file_count));
-
 
212
						strcat(#folder_info, SET_7);
145
					strcat(#folder_info, itoa(dir_count));
213
						strcat(#folder_info, itoa(dir_count));
146
					WriteText(100, 80, 0x80, 0x000000, #folder_info);
214
						WriteText(100, 80, 0x80, 0x000000, #folder_info);
-
 
215
						element_size = size_dir;
-
 
216
					}
-
 
217
	
-
 
218
					WriteText(10,  95, 0x80, 0x000000, SET_3);
-
 
219
					WriteText(10, 110, 0x80, 0x000000, SET_4);
-
 
220
					WriteText(10, 125, 0x80, 0x000000, SET_5);
-
 
221
					DrawDate(100,  95, 0, #file_info_general.datecreate);
-
 
222
					DrawDate(100, 110, 0, #file_info_general.datelastaccess);
-
 
223
					DrawDate(100, 125, 0, #file_info_general.datelastedit);
-
 
224
	
-
 
225
					EAX = ConvertSize(element_size);
-
 
226
					strcpy(#element_size_label, EAX);
-
 
227
					strcat(#element_size_label, " (");
-
 
228
					strcat(#element_size_label, itoa(element_size));
-
 
229
					strcat(#element_size_label, " b)");
-
 
230
					WriteText(100, 65, 0x80, 0x000000, #element_size_label);
-
 
231
	
-
 
232
					flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2;
-
 
233
					flags_frame.font_color = sc.work_text;
-
 
234
					flags_frame.font_backgr_color = sc.work;
-
 
235
					flags_frame.ext_col = sc.work_graph;
-
 
236
					frame_draw stdcall (#flags_frame);
-
 
237
	
147
					element_size = size_dir;
238
					DrawPropertiesCheckBoxes();
148
				}
-
 
149
 
-
 
150
				WriteText(10,  95, 0x80, 0x000000, SET_3);
-
 
151
				WriteText(10, 110, 0x80, 0x000000, SET_4);
-
 
152
				WriteText(10, 125, 0x80, 0x000000, SET_5);
-
 
153
				DrawDate(100,  95, 0, #file_info_general.datecreate);
-
 
154
				DrawDate(100, 110, 0, #file_info_general.datelastaccess);
-
 
155
				DrawDate(100, 125, 0, #file_info_general.datelastedit);
-
 
156
 
-
 
157
				EAX = ConvertSize(element_size);
-
 
158
				strcpy(#element_size_label, EAX);
-
 
159
				strcat(#element_size_label, " (");
-
 
160
				strcat(#element_size_label, itoa(element_size));
-
 
161
				strcat(#element_size_label, " b)");
-
 
162
				WriteText(100, 65, 0x80, 0x000000, #element_size_label);
-
 
163
 
-
 
164
				flags_frame.size_x = - flags_frame.start_x * 2 + settings_form.cwidth - 2;
-
 
165
				flags_frame.font_color = sc.work_text;
-
 
166
				flags_frame.font_backgr_color = sc.work;
-
 
167
				flags_frame.ext_col = sc.work_graph;
-
 
168
				frame_draw stdcall (#flags_frame);
-
 
169
 
-
 
170
				DrawPropertiesCheckBoxes();
239
				}
171
	}
240
	}
Line 172... Line 241...
172
}
241
}
173
 
242