Subversion Repositories Kolibri OS

Rev

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

Rev 1373 Rev 1417
Line 1... Line 1...
1
;*****************************************************************************
1
;*****************************************************************************
2
; Open Dialog - for Kolibri OS
2
; Open Dialog - for Kolibri OS
3
; Copyright (c) 2009, Marat Zakiyanov aka Mario79, aka Mario
3
; Copyright (c) 2009, 2010, Marat Zakiyanov aka Mario79, aka Mario
4
; All rights reserved.
4
; All rights reserved.
5
;
5
;
6
; Redistribution and use in source and binary forms, with or without
6
; Redistribution and use in source and binary forms, with or without
7
; modification, are permitted provided that the following conditions are met:
7
; modification, are permitted provided that the following conditions are met:
8
;        * Redistributions of source code must retain the above copyright
8
;        * Redistributions of source code must retain the above copyright
Line 41... Line 41...
41
include '../../../../../macros.inc'
41
include '../../../../../macros.inc'
42
include '../../load_lib.mac'
42
include '../../load_lib.mac'
43
include '../../trunk/box_lib.mac'
43
include '../../trunk/box_lib.mac'
44
;include 'macros.inc'
44
;include 'macros.inc'
45
;include 'load_lib.mac'
45
;include 'load_lib.mac'
-
 
46
;include 'box_lib.mac'
46
@use_library
47
@use_library
47
;---------------------------------------------------------------------
48
;---------------------------------------------------------------------
48
;---------------------------------------------------------------------
49
;---------------------------------------------------------------------
49
START:
50
START:
50
	mcall	68,11
51
	mcall	68,11
Line 321... Line 322...
321
key_ASCII:
322
key_ASCII:
322
	mcall	2
323
	mcall	2
323
	cmp	ah,9
324
	cmp	ah,9
324
	je	change_focus_area_Tab_key_ASCII
325
	je	change_focus_area_Tab_key_ASCII
325
	cmp	ah,13
326
	cmp	ah,13
326
	je	.load_dir
327
	je	.13
327
	cmp	ah,27
328
	cmp	ah,27
328
	je	button.exit
329
	je	button.exit
329
	push	dword name_editboxes
330
	push	dword name_editboxes
330
	call	[edit_box_key]
331
	call	[edit_box_key]
331
	jmp	still
332
	jmp	still
-
 
333
.13:
-
 
334
	cmp	[open_dialog_type],2 ; Select dir
-
 
335
	je	file_no_folder
-
 
336
	cmp	[open_dialog_type],1 ; Save file
-
 
337
	jne .load_dir
-
 
338
	inc	[open_dialog_type]
-
 
339
	jmp file_no_folder	
332
.load_dir:
340
.load_dir:
333
	mov	[file_browser_data_1.select_panel_counter],1
341
	mov	[file_browser_data_1.select_panel_counter],1
334
	xor	eax,eax
342
	xor	eax,eax
335
	mov	[focus_pointer],al
343
	mov	[focus_pointer],al
336
	mcall	66, 1, 1
344
	mcall	66, 1, 1
Line 511... Line 519...
511
	jne	still
519
	jne	still
512
.exit:
520
.exit:
513
	mov	eax,[communication_area]
521
	mov	eax,[communication_area]
514
	test	eax,eax
522
	test	eax,eax
515
	jz	@f
523
	jz	@f
516
	cmp	[eax],dword 1
524
	cmp	[eax],word 1
517
	je	@f
525
	je	@f
518
	mov	[eax],dword 3
526
	mov	[eax],word 3
519
@@:
527
@@:
520
	mov	eax,[N_error]
528
	mov	eax,[N_error]
521
	test	eax,eax
529
	test	eax,eax
522
	jz	@f
530
	jz	@f
523
	call	start_error_window_thread
531
	call	start_error_window_thread
Line 533... Line 541...
533
.exit_dir:
541
.exit_dir:
534
	call	load_next_dir.exit_dir
542
	call	load_next_dir.exit_dir
535
	jmp	still
543
	jmp	still
536
;---------------------------------------------------------------------
544
;---------------------------------------------------------------------
537
.open_dir_or_file:
545
.open_dir_or_file:
-
 
546
	cmp	[open_dialog_type],2 ;Select dir
-
 
547
	je	file_no_folder
-
 
548
;	cmp	[open_dialog_type],1 ;Save file
-
 
549
;	je	file_no_folder	
538
	xor	ebx,ebx
550
	xor	ebx,ebx
539
	jmp	key.7
551
	jmp	key.7
540
;---------------------------------------------------------------------
552
;---------------------------------------------------------------------
541
thread_start:
553
thread_start:
542
	mov	eax,[N_error]
554
	mov	eax,[N_error]
Line 606... Line 618...
606
	jmp	.still
618
	jmp	.still
607
;---------------------------------------------------------------------
619
;---------------------------------------------------------------------
608
draw_error_window:
620
draw_error_window:
609
	mcall	12, 1
621
	mcall	12, 1
610
	mcall	0,[error_window_x] ,[error_window_y], 0x03ff0000
622
	mcall	0,[error_window_x] ,[error_window_y], 0x03ff0000
611
	mcall	71,1,title 
623
	call	type_title
612
	mcall	4,<10,30>,0x90ffffff,[N_error]
624
	mcall	4,<10,30>,0x90ffffff,[N_error]
613
	mov	eax,[error_path]
625
	mov	eax,[error_path]
614
	test	eax,eax
626
	test	eax,eax
615
	jz	@f
627
	jz	@f
616
	mcall	4,<10,50>, ,[error_path]
628
	mcall	4,<10,50>, ,[error_path]
Line 884... Line 896...
884
	mov	al,[param]
896
	mov	al,[param]
885
	test	eax,eax
897
	test	eax,eax
886
	jz	@f
898
	jz	@f
887
	mcall	68,22,param,,0x01
899
	mcall	68,22,param,,0x01
888
	mov	[communication_area],eax
900
	mov	[communication_area],eax
-
 
901
	movzx eax,word [eax+2]
-
 
902
	mov [open_dialog_type],eax
889
@@:
903
@@:
890
	ret
904
	ret
891
;---------------------------------------------------------------------
905
;---------------------------------------------------------------------
892
load_start_directory:
906
load_start_directory:
893
	mov	eax,[communication_area]	
907
	mov	eax,[communication_area]	
894
	test	eax,eax
908
	test	eax,eax
895
	jz	@f
909
	jz	@f
896
	mov	ebx,[eax]
910
	movzx	ebx,word [eax]
897
	test	eax,eax
911
	test	eax,eax
898
	jz	@f
912
	jz	@f
899
	add	eax,4
913
	add	eax,4
900
	mov	esi,eax
914
	mov	esi,eax
901
	jmp	.1
915
	jmp	.1
Line 1011... Line 1025...
1011
file_no_folder:
1025
file_no_folder:
1012
	mov	esi,dir_pach
1026
	mov	esi,dir_pach
1013
	mov	edi,file_name
1027
	mov	edi,file_name
1014
	call	copy_dir_name
1028
	call	copy_dir_name
Line -... Line 1029...
-
 
1029
 
-
 
1030
	cmp	[open_dialog_type],2
1015
 
1031
	je	@f
1016
	mov	esi,file_name
1032
	mov	esi,file_name
1017
	call	copy_dir_path
1033
	call	copy_dir_path
1018
 
1034
@@:
1019
	mov	eax,[communication_area]
1035
	mov	eax,[communication_area]
1020
	test	eax,eax
1036
	test	eax,eax
1021
	jnz	@f
1037
	jnz	@f
1022
	call	control_minimal_window_size
1038
	call	control_minimal_window_size
Line 1026... Line 1042...
1026
	mov	edi,eax
1042
	mov	edi,eax
1027
	add	edi,4
1043
	add	edi,4
1028
	mov	esi,file_name	
1044
	mov	esi,file_name	
1029
	call	copy_dir_name
1045
	call	copy_dir_name
1030
	mov	eax,[communication_area]
1046
	mov	eax,[communication_area]
1031
	mov	[eax],dword 1
1047
	mov	[eax],word 1
1032
	jmp	button.exit
1048
	jmp	button.exit
1033
;---------------------------------------------------------------------
1049
;---------------------------------------------------------------------
1034
load_root_directory:
1050
load_root_directory:
1035
	mov	esi,root_pach
1051
	mov	esi,root_pach
1036
	mov	edi,dir_pach
1052
	mov	edi,dir_pach
Line 1126... Line 1142...
1126
;---------------------------------------------------------------------
1142
;---------------------------------------------------------------------
1127
memory_get_error:
1143
memory_get_error:
1128
	mov	[N_error],4
1144
	mov	[N_error],4
1129
	jmp	button.exit
1145
	jmp	button.exit
1130
;---------------------------------------------------------------------
1146
;---------------------------------------------------------------------
-
 
1147
type_title:
-
 
1148
	mov	ecx,[open_dialog_type]
-
 
1149
	shl ecx,2
-
 
1150
	add ecx,open_dialog_title_pointer
-
 
1151
	mov ecx,[ecx]
-
 
1152
	test	ecx,ecx
-
 
1153
	jz	@f
-
 
1154
	mcall	71,1,  ; title ;;param  ;file_name   ;dir_pach
-
 
1155
@@:
-
 
1156
	ret
-
 
1157
;---------------------------------------------------------------------
1131
draw_window:
1158
draw_window:
Line 1132... Line 1159...
1132
 
1159
 
Line 1133... Line 1160...
1133
	mcall	12,1
1160
	mcall	12,1
Line 1134... Line 1161...
1134
 
1161
 
1135
	mcall	0,<10,420>,<10,320>,0x63AABBCC,
1162
	mcall	0,<10,420>,<10,320>,0x63AABBCC,
1136
 
-
 
1137
;       mov     ecx,[communication_area]
1163
 
1138
;       add     ecx,4096+4+4
-
 
1139
 
1164
;       mov     ecx,[communication_area]
Line 1140... Line 1165...
1140
	mcall	71,1,  title ;;param  ;file_name   ;dir_pach
1165
;       add     ecx,4096+4+4
1141
 
1166
	call	type_title
1142
	call	get_window_param
1167
	call	get_window_param
Line 1242... Line 1267...
1242
 
1267
 
1243
	pusha
1268
	pusha
1244
	shr	ecx,16
1269
	shr	ecx,16
1245
	mov	bx,cx
1270
	mov	bx,cx
-
 
1271
	add	ebx,12 shl 16+ 4
-
 
1272
	
-
 
1273
	mov	edx,[open_dialog_type]
-
 
1274
	shl edx,2
-
 
1275
	add edx,message_open_dialog_button
-
 
1276
	mov edx,[edx]
-
 
1277
	
-
 
1278
	cmp	[open_dialog_type],2 ; Select dir
-
 
1279
	jne	@f
-
 
1280
	sub	ebx,5 shl 16
-
 
1281
@@:
1246
	add	ebx,12 shl 16+ 4
1282
	
1247
	mcall	4,,0x90000000,message_open_button
1283
	mcall	4,,0x90000000    ;message_open_button
Line 1248... Line 1284...
1248
	popa
1284
	popa
1249
 
1285
 
Line 1685... Line 1721...
1685
	je	.delete
1721
	je	.delete
1686
@@:
1722
@@:
1687
	test	[eax-40],byte 0x10
1723
	test	[eax-40],byte 0x10
1688
	jnz	.start
1724
	jnz	.start
Line -... Line 1725...
-
 
1725
	
-
 
1726
	cmp	[open_dialog_type],2 ; Select dir
-
 
1727
	je	.delete
1689
 
1728
	
1690
	push	eax ebx
1729
	push	eax ebx
1691
	mov	esi,eax
1730
	mov	esi,eax
1692
	call	search_expansion
1731
	call	search_expansion
1693
	test	eax,eax
1732
	test	eax,eax
Line 2218... Line 2257...
2218
root1_folder_area	dd 0
2257
root1_folder_area	dd 0
2219
root1_folder_block	dd 0
2258
root1_folder_block	dd 0
2220
temp_counter_1		dd 0
2259
temp_counter_1		dd 0
2221
retrieved_devices_table_counter dd 0
2260
retrieved_devices_table_counter dd 0
2222
communication_area	dd 0
2261
communication_area	dd 0
-
 
2262
open_dialog_type	dd 0
-
 
2263
open_dialog_title_pointer:
-
 
2264
	dd	title_0
-
 
2265
	dd	title_1
-
 
2266
	dd	title_2
-
 
2267
	dd	0
-
 
2268
	
-
 
2269
message_open_dialog_button:
-
 
2270
	dd	message_0
-
 
2271
	dd	message_1
-
 
2272
	dd	message_2
-
 
2273
	dd	0
2223
;---------------------------------------------------------------------
2274
;---------------------------------------------------------------------
2224
expansion_length	dd	0
2275
expansion_length	dd	0
2225
;---------------------------------------------------------------------
2276
;---------------------------------------------------------------------
2226
N_error 		dd 0
2277
N_error 		dd 0
2227
error_type		dd 0
2278
error_type		dd 0
Line 2354... Line 2405...
2354
	db 'Press any key...',0
2405
	db 'Press any key...',0
Line 2355... Line 2406...
2355
 
2406
 
2356
message_cancel_button:
2407
message_cancel_button:
Line 2357... Line -...
2357
	db 'Cancel',0
-
 
2358
 
-
 
2359
message_open_button:
-
 
2360
	db 'Open',0
2408
	db 'Cancel',0
2361
 
2409
 
Line 2362... Line 2410...
2362
message_ReloadDir_button:
2410
message_ReloadDir_button:
2363
	db 'Refresh',0
2411
	db 'Refresh',0
Line -... Line 2412...
-
 
2412
 
-
 
2413
message_ExitDir_button:
-
 
2414
	db '^',0
-
 
2415
 
-
 
2416
message_0:
-
 
2417
	db 'Open',0
-
 
2418
message_1:
-
 
2419
	db 'Save',0
2364
 
2420
message_2:
2365
message_ExitDir_button:
2421
	db 'Select',0
-
 
2422
	
-
 
2423
	
-
 
2424
title_0:
-
 
2425
	db 'Open Dialog',0
2366
	db '^',0
2426
title_1:
2367
 
2427
	db 'Save Dialog',0
2368
title:
2428
title_2:
2369
	db 'Open Dialog',0
2429
	db 'Select Dir',0
2370
;---------------------------------------------------------------------
2430
;---------------------------------------------------------------------