Subversion Repositories Kolibri OS

Rev

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

Rev 5575 Rev 5576
Line 162... Line 162...
162
 
162
 
163
edit_box edit2 = {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xFFFFFF,0,248,#file_name,#mouse_dd,64,6,6};
163
edit_box edit2 = {250,213,80,0xFFFFCC,0x94AECE,0xFFFFCC,0xFFFFFF,0,248,#file_name,#mouse_dd,64,6,6};
164
edit_box new_file_ed = {150,213,80,0xFFFFFF,0x94AECE,0x000000,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0};
164
edit_box new_file_ed = {150,213,80,0xFFFFFF,0x94AECE,0x000000,0xFFFFFF,0,248,#new_element_name,#mouse_dd,100000000000010b,6,0};
165
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
165
PathShow_data PathShow = {0, 17,250, 6, 250, 0, 0, 0x0, 0xFFFfff, #path, #temp, 0};
166
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
166
PathShow_data FileShow = {0, 56,215, 6, 100, 0, 0, 0x0, 0xFFFfff, #file_name, #temp, 0};
167
 
167
byte cmd_free;
168
#include "include\copy.h"
168
#include "include\copy.h"
169
#include "include\gui.h"
169
#include "include\gui.h"
170
#include "include\sorting.h"
170
#include "include\sorting.h"
171
#include "include\icons.h"
171
#include "include\icons.h"
Line 174... Line 174...
174
#include "include\menu.h"
174
#include "include\menu.h"
175
#include "include\about.h"
175
#include "include\about.h"
176
#include "include\settings.h"
176
#include "include\settings.h"
177
#include "include\properties.h"
177
#include "include\properties.h"
Line -... Line 178...
-
 
178
 
-
 
179
dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak;
178
 
180
 
179
void main() 
181
void main() 
180
{
182
{
181
	word key, id, can_show, can_select, m_selected;
183
	word key, id, can_show, can_select, m_selected;
182
	dword selected_offset;
184
	dword selected_offset;
Line 200... Line 202...
200
	{
202
	{
201
		strcpy(#path, "/rd/1/");		
203
		strcpy(#path, "/rd/1/");		
202
	}
204
	}
203
	Open_Dir(#path,ONLY_OPEN);
205
	Open_Dir(#path,ONLY_OPEN);
204
	SetEventMask(0x27);
206
	SetEventMask(0x27);
205
	loop() switch(WaitEvent())
207
	loop(){ switch(WaitEvent())
206
	{
208
	{
207
		case evMouse:
209
		case evMouse:
208
			if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
210
			if (del_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2) break;
209
			if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
211
			if (new_element_active) || (!CheckActiveProcess(Form.ID)) || (Form.status_window>2)
210
			{
212
			{
Line 254... Line 256...
254
						Dir_Up();
256
						Dir_Up();
255
						stats = 0;
257
						stats = 0;
256
					}
258
					}
257
				}
259
				}
258
			}
260
			}	
259
			
-
 
260
			/*
-
 
261
			if (files.MouseOver(m.x, m.y)) && (!can_select)
261
			if (files.MouseOver(m.x, m.y))&&((m.up)||(m.down)||(m.dblclick))
262
			{
262
			{
263
				m_selected = m.y - files.y / files.line_h;
-
 
264
				if (m.lkm) can_select = 1;
-
 
265
				if (m.pkm)
-
 
266
				{
-
 
267
					can_show = 1;
-
 
268
					if (m.y - files.y / files.line_h != files.current) can_select = 1;
-
 
269
				}
-
 
270
			}
-
 
271
 
-
 
272
			//select/open file {
263
				//select/open file {
273
			if (!m.lkm) && (!m.pkm) && (can_select)
-
 
274
			{
-
 
275
				can_select = 0;
-
 
276
				if (m.y>=files.y)
-
 
277
				{
-
 
278
					id = m.y - files.y / files.line_h;
-
 
279
					if (id!=m_selected)
-
 
280
					{
-
 
281
						can_show=0;
-
 
282
						break;
-
 
283
					}
-
 
284
					if (files.current!=id)
-
 
285
					{
-
 
286
						if (id
-
 
287
					}
-
 
288
					else
-
 
289
						Open(0);
-
 
290
				}
-
 
291
			};
-
 
292
			// } select/open file
-
 
293
 
-
 
294
			//file menu {
-
 
295
			if (!m.pkm) && (!m.lkm) && (can_show)
-
 
296
			{
-
 
297
				can_show = 0;
-
 
298
				menu_call_mouse = 1;
-
 
299
				if (m.y>=files.y)
-
 
300
				{
-
 
301
					SwitchToAnotherThread();
-
 
302
					CreateThread(#FileMenu,#menu_stak+4092);
-
 
303
				}
-
 
304
				break;
-
 
305
			}
-
 
306
			// } file menu
-
 
307
			*/
-
 
308
			
-
 
309
			if (files.MouseOver(m.x, m.y))&&(m.up)
-
 
310
			{
-
 
311
				//select/open file {
-
 
312
				if (m.key&MOUSE_LEFT)
264
				if (m.key&MOUSE_LEFT)&&((m.down)||(m.dblclick))
313
				{
265
				{
314
					if (m.y>=files.y)//&&(m.click)
266
					if (m.y>=files.y)//&&(m.click)
315
					{
267
					{
316
						id = m.y - files.y / files.line_h;
268
						id = m.y - files.y / files.line_h;
317
						if (files.current!=id)
269
						if (files.current!=id)
318
						{
270
						{
-
 
271
							m.clearTime();
319
							if (id
272
							if (id
320
						}
273
						}
321
						else if(m.dblclick)Open(0);
274
						else if(m.dblclick)Open(0);
322
					}
275
					}
323
				}
276
				}
324
				// } select/open file
277
				// } select/open file
325
				else
278
				else
326
				//file menu {
279
				//file menu {
327
				if (m.key&MOUSE_RIGHT)
280
				if (m.key&MOUSE_RIGHT)&&(m.up)
328
				{
281
				{
329
					menu_call_mouse = 1;
282
					menu_call_mouse = 1;
330
					if (m.y>=files.y)&&(m.click)
283
					if (m.y>=files.y)//&&(m.click)
331
					{
284
					{
332
						id = m.y - files.y / files.line_h;
285
						id = m.y - files.y / files.line_h;
333
						if (files.current!=id) List_Current(id-files.current);
286
						if (files.current!=id) List_Current(id-files.current);
334
						SwitchToAnotherThread();
287
						//SwitchToAnotherThread();
-
 
288
						menu_stak = malloc(4096);
335
						CreateThread(#FileMenu,#menu_stak+4092);
289
						CreateThread(#FileMenu,menu_stak+4092);
336
					}
290
					}
337
					break;
291
					break;
338
				}
292
				}
339
				// } file menu
293
				// } file menu
340
			}
294
			}
Line 425... Line 379...
425
						break;
379
						break;
426
				case 25: //copy
380
				case 25: //copy
427
						Copy(#file_path, NOCUT);
381
						Copy(#file_path, NOCUT);
428
						break;
382
						break;
429
				case 26: //paste
383
				case 26: //paste
-
 
384
						copy_stak = malloc(4096);
430
						CreateThread(#Paste,#copy_stak+4092);
385
						CreateThread(#Paste,copy_stak+4092);
431
						break;
386
						break;
432
				case 31...33: //sort
387
				case 31...33: //sort
433
						IF(sort_num==1) DrawFilledBar(sorting_arrow_x,42,6,10);
388
						IF(sort_num==1) DrawFilledBar(sorting_arrow_x,42,6,10);
434
						IF(sort_num==2) DrawFilledBar(sorting_arrow_x,42,6,10);
389
						IF(sort_num==2) DrawFilledBar(sorting_arrow_x,42,6,10);
435
						IF(sort_num==3) DrawFilledBar(sorting_arrow_x,42,6,10);
390
						IF(sort_num==3) DrawFilledBar(sorting_arrow_x,42,6,10);
Line 498... Line 453...
498
							break;
453
							break;
499
					case 003: //Ctrl+C
454
					case 003: //Ctrl+C
500
							Copy(#file_path, NOCUT);
455
							Copy(#file_path, NOCUT);
501
							break;
456
							break;
502
					case 022: //Ctrl+V
457
					case 022: //Ctrl+V
-
 
458
							copy_stak = malloc(4096);
503
							CreateThread(#Paste,#copy_stak+4092);
459
							CreateThread(#Paste,copy_stak+4092);
504
							break;
460
							break;
505
					case 001: //Ctrl+A
461
					case 001: //Ctrl+A
506
							debugln("press Ctrl+A");
462
							debugln("press Ctrl+A");
507
							for (i=0; i
463
							for (i=0; i
508
							{
464
							{
Line 528... Line 484...
528
							//IF (rename_active==1) {ReName(true); break;}
484
							//IF (rename_active==1) {ReName(true); break;}
529
							Open(0);
485
							Open(0);
530
							break; 
486
							break; 
531
					case 074: //menu
487
					case 074: //menu
532
							menu_call_mouse=0;
488
							menu_call_mouse=0;
533
							SwitchToAnotherThread();
489
							//SwitchToAnotherThread();
-
 
490
							menu_stak = malloc(4096);
534
							CreateThread(#FileMenu,#menu_stak+4092);
491
							CreateThread(#FileMenu,menu_stak+4092);
535
							break;
492
							break;
536
					case 173: //Ctrl+Enter
493
					case 173: //Ctrl+Enter
537
							if (!itdir) ShowOpenWithDialog();
494
							if (!itdir) ShowOpenWithDialog();
538
							else Open(1);
495
							else Open(1);
539
							break;
496
							break;
Line 589... Line 546...
589
			break;
546
			break;
590
		case evReDraw:
547
		case evReDraw:
591
			draw_window();
548
			draw_window();
592
			if (action_buf) { menu_action(action_buf); action_buf=0;}
549
			if (action_buf) { menu_action(action_buf); action_buf=0;}
593
	}
550
	}
-
 
551
		if(cmd_free){
-
 
552
			if(cmd_free==1)     free(menu_stak);
-
 
553
			else if(cmd_free==2)free(about_stak);
-
 
554
			else if(cmd_free==3)free(properties_stak);
-
 
555
			else if(cmd_free==4)free(settings_stak);
-
 
556
			else if(cmd_free==5)free(copy_stak);
-
 
557
			cmd_free = 0;
-
 
558
		}
-
 
559
	}
594
}
560
}
Line 595... Line 561...
595
 
561
 
596
 
562
 
Line 617... Line 583...
617
	if (id==201) ShowOpenWithDialog();
583
	if (id==201) ShowOpenWithDialog();
618
	if (id==202) FnProcess(3); //F3
584
	if (id==202) FnProcess(3); //F3
619
	if (id==203) FnProcess(4); //F4
585
	if (id==203) FnProcess(4); //F4
620
	if (id==104) Copy(#file_path, NOCUT);
586
	if (id==104) Copy(#file_path, NOCUT);
621
	if (id==105) Copy(#file_path, CUT);
587
	if (id==105) Copy(#file_path, CUT);
622
	if (id==106) CreateThread(#Paste,#copy_stak+4092);
588
	if (id==106) { copy_stak = malloc(4096); CreateThread(#Paste,copy_stak+4092);}
623
	if (id==207) FnProcess(2);
589
	if (id==207) FnProcess(2);
624
	if (id==108) Del_Form();
590
	if (id==108) Del_Form();
625
	if (id==109) FnProcess(5);
591
	if (id==109) FnProcess(5);
626
	if (id==110) FnProcess(8);
592
	if (id==110) FnProcess(8);
627
	if (id==300) { FnProcess(5); List_ReDraw(); }
593
	if (id==300) { FnProcess(5); List_ReDraw(); }
Line 643... Line 609...
643
	for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,sc.work);
609
	for (j=0; j<3; j++) DefineButton(toolbar_buttons_x[j]+2,5+2,31-5,29-5,21+j+BT_HIDE,sc.work);
644
	for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,sc.work);
610
	for (j=3; j<6; j++) DefineButton(toolbar_buttons_x[j],5,31,29,21+j+BT_HIDE,sc.work);
645
	DrawBar(246,0,Form.cwidth - 297,12, sc.work); //upper editbox
611
	DrawBar(246,0,Form.cwidth - 297,12, sc.work); //upper editbox
646
	DrawBar(246,29,Form.cwidth - 297,5,sc.work);  //under editbox
612
	DrawBar(246,29,Form.cwidth - 297,5,sc.work);  //under editbox
647
	DrawRectangle(246,12,Form.cwidth - 303,16,sc.work_graph);
613
	DrawRectangle(246,12,Form.cwidth - 303,16,sc.work_graph);
648
	DefineButton(Form.cwidth - 25,6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
614
	DefineButton(Form.cwidth - 32,6,27,28,51+BT_HIDE+BT_NOFRAME,0); //about
649
	PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
615
	PutPaletteImage(#goto_about,56,34,Form.width-65,0,8,#goto_about_pal);
650
	//main rectangles
616
	//main rectangles
651
	DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),sc.work_graph);
617
	DrawRectangle(1,40,Form.cwidth-3,onTop(46,0),sc.work_graph);
652
	DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg
618
	DrawRectangle(0,39,Form.cwidth-1,onTop(44,0),col_palette[4]); //bg
653
	for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);	
619
	for (i=0; i<5; i++) DrawBar(0, 34+i, Form.cwidth, 1, col_palette[8-i]);	
Line 897... Line 863...
897
			selected_offset2 = file_mas[i]*304 + buf+32 + 7;
863
			selected_offset2 = file_mas[i]*304 + buf+32 + 7;
898
			if (ESBYTE[selected_offset2]) cont++;
864
			if (ESBYTE[selected_offset2]) cont++;
899
		}
865
		}
900
		if (cont)
866
		if (cont)
901
		{
867
		{
902
			strcpy(#f_count, DEL_MORE_FILES_1);
868
			/*strcpy(#f_count, DEL_MORE_FILES_1);
903
			strcat(#f_count, itoa(cont));
869
			strcat(#f_count, itoa(cont));
904
			strcat(#f_count, DEL_MORE_FILES_2);
870
			strcat(#f_count, DEL_MORE_FILES_2);*/
-
 
871
			sprintf(#f_count,"%s%d%s",DEL_MORE_FILES_1,cont,DEL_MORE_FILES_2);
905
			WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,sc.work_text,#f_count);
872
			WriteText(-strlen(#f_count)*3+110+dform_x,190,0x80,sc.work_text,#f_count);
906
		}
873
		}
907
		else
874
		else
908
		{
875
		{
909
			IF (strlen(#file_name)<28) 
876
			IF (strlen(#file_name)<28) 
Line 1155... Line 1122...
1155
	IF (new_element_active==3) DrawFlatButton(dform_x+22,208,85,20,301,0xFFB6B5,T_RENAME);
1122
	IF (new_element_active==3) DrawFlatButton(dform_x+22,208,85,20,301,0xFFB6B5,T_RENAME);
1156
	ELSE DrawFlatButton(dform_x+27,208,70,20,301,0xFFB6B5,T_CREATE);
1123
	ELSE DrawFlatButton(dform_x+27,208,70,20,301,0xFFB6B5,T_CREATE);
1157
	DrawFlatButton(dform_x+120,208,70,20,302,0xC6DFC6,T_CANCEL);
1124
	DrawFlatButton(dform_x+120,208,70,20,302,0xC6DFC6,T_CANCEL);
1158
}
1125
}
Line 1159... Line 1126...
1159
 
1126
 
1160
void FnProcess(char N)
1127
void FnProcess(byte N)
1161
{
1128
{
1162
	switch(N)
1129
	switch(N)
1163
	{
1130
	{
1164
		case 1:
1131
		case 1:
1165
			if (!active_about) 
1132
			if (!active_about) 
1166
			{
1133
			{
-
 
1134
				//SwitchToAnotherThread();
1167
				SwitchToAnotherThread();
1135
				about_stak = malloc(4096);
1168
				about_window=CreateThread(#about_dialog,#about_stak+4092);
1136
				about_window = CreateThread(#about_dialog,about_stak+4092);
1169
				break;
1137
				break;
1170
			}
1138
			}
1171
			else
1139
			else
1172
			{
1140
			{
Line 1229... Line 1197...
1229
				ShowMessage(NOT_CREATE_FILE, 150);
1197
				ShowMessage(NOT_CREATE_FILE, 150);
1230
			}*/
1198
			}*/
1231
			NewElement_Form(1, T_NEW_FILE);
1199
			NewElement_Form(1, T_NEW_FILE);
1232
			break;
1200
			break;
1233
		case 8:
1201
		case 8:
1234
			SwitchToAnotherThread();
1202
			//SwitchToAnotherThread();
-
 
1203
			properties_stak = malloc(8096);
1235
			CreateThread(#properties_dialog, #properties_stak+4092);
1204
			CreateThread(#properties_dialog, properties_stak+8092);
1236
			break;
1205
			break;
1237
		case 10: //F10
1206
		case 10: //F10
1238
			if (!active_settings) 
1207
			if (!active_settings) 
1239
			{
1208
			{
1240
				SwitchToAnotherThread();
1209
				//SwitchToAnotherThread();
-
 
1210
				settings_stak = malloc(4096);
1241
				settings_window=CreateThread(#settings_dialog, #settings_stak+4092);
1211
				settings_window = CreateThread(#settings_dialog, settings_stak+4092);
1242
				break;
1212
				break;
1243
			}
1213
			}
1244
			else
1214
			else
1245
			{
1215
			{
1246
				ActivateWindow(GetProcessSlot(settings_window));
1216
				ActivateWindow(GetProcessSlot(settings_window));
Line 1252... Line 1222...
1252
//need to remove these functiones, they are a very old shit :)
1222
//need to remove these functiones, they are a very old shit :)
1253
dword onTop(dword down,up) {EAX=Form.height-GetSkinHeight()-down-up;}
1223
dword onTop(dword down,up) {EAX=Form.height-GetSkinHeight()-down-up;}
Line 1254... Line 1224...
1254
 
1224
 
1255
 
-
 
1256
stop:
-
 
1257
 
-
 
1258
char menu_stak[4096];
-
 
1259
char copy_stak[4096];
-
 
1260
char open_with_stak[4096];
-
 
1261
char about_stak[4096];
-
 
1262
char properties_stak[4096];
1225