Subversion Repositories Kolibri OS

Rev

Rev 3808 | Rev 3815 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1954 mario79 1
;*****************************************************************************
2
; Open Dialog - for Kolibri OS
3381 mario79 3
; Copyright (c) 2009-2013, Marat Zakiyanov aka Mario79, aka Mario
1954 mario79 4
; All rights reserved.
5
;
6
; Redistribution and use in source and binary forms, with or without
7
; modification, are permitted provided that the following conditions are met:
8
;        * Redistributions of source code must retain the above copyright
9
;          notice, this list of conditions and the following disclaimer.
10
;        * Redistributions in binary form must reproduce the above copyright
11
;          notice, this list of conditions and the following disclaimer in the
12
;          documentation and/or other materials provided with the distribution.
13
;        * Neither the name of the  nor the
14
;          names of its contributors may be used to endorse or promote products
15
;          derived from this software without specific prior written permission.
16
;
17
; THIS SOFTWARE IS PROVIDED BY Marat Zakiyanov ''AS IS'' AND ANY
18
; EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
; DISCLAIMED. IN NO EVENT SHALL  BE LIABLE FOR ANY
21
; DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
;*****************************************************************************
3381 mario79 28
;---------------------------------------------------------------------
29
;Some documentation for memory
30
;
31
;area name db 'FFFFFFFF_open_dialog',0 ; FFFFFFFF = PID
32
;
33
; communication area data
3382 mario79 34
; flag  ; +0
35
; dw 0   ; 0 - empty, 1 - file for open, 2 -folder for open,
36
;          3 - cancel, 4 - path=name of area 6822.
37
;
38
; type of dialog:  0-Open, 1-Save, 2-Dir
39
; dw 0 ; +2
40
;
41
; window X size ; +4
42
; dw 0
43
;
44
; window X position ; +6
45
; dw 0
46
;
47
; window y size ; +8
48
; dw 0
49
;
50
; window Y position ; +10
51
; dw 0
52
;
53
; OpenDialog WINDOW SLOT ; +12
54
; dd 0
55
;
56
; file_path ; +16
57
; rb 3824 ; path to file
58
;
59
; file name ; +3840
60
; rb 256
61
;
62
; filtration flag ; +4096
63
; dd 0 ; flag 0 - no filtration,  1 - filtering
64
;
65
; area for storage of filtering values ; +4100
66
; rb 4092
3381 mario79 67
;---------------------------------------------------------------------
1954 mario79 68
	use32
69
	org	0x0
70
 
71
	db 'MENUET01'
72
	dd 0x01
73
	dd START
74
	dd IM_END
75
	dd I_END
76
	dd stacktop
77
	dd param
78
	dd path
79
 
80
include '../../macros.inc'
81
include '../../develop/libraries/box_lib/load_lib.mac'
82
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
83
;include 'macros.inc'
84
;include 'load_lib.mac'
85
;include 'box_lib.mac'
86
@use_library
87
 
88
x_minimal_size equ 350
89
y_minimal_size equ 250
90
;---------------------------------------------------------------------
91
;---------------------------------------------------------------------
92
START:
93
	mcall	68,11
94
	mcall	66,1,1
95
	mcall	40,0x27
96
	call	get_communication_area
97
 
98
	call	get_active_pocess
99
 
100
load_libraries	l_libs_start,end_l_libs
101
	test	eax,eax
102
	jnz	button.exit
103
; initialize sort
104
	push	dword 1
105
	call	dword [sort_init]
106
; unpack deflate
107
	mov	eax,[unpack_DeflateUnpack2]
108
	mov	[deflate_unpack],eax
109
 
2144 mario79 110
	mov	esi,start_pach
111
	mov	edi,previous_dir_path
112
	call	copy_dir_name.1
113
 
1954 mario79 114
	call	load_root_directory
115
	call	load_start_directory
116
	call	sort_directory
117
	call	load_icons
118
	call	convert_icons
119
	call	load_ini
120
	call	calc_ini
121
	jmp	red_1
122
;---------------------------------------------------------------------
123
red:
124
	call	control_minimal_window_size
125
red_1:
126
	call	draw_window
127
;---------------------------------------------------------------------
128
still:
129
	mcall	10
130
	cmp	eax,1
131
	je	red
132
	cmp	eax,2
133
	je	key
134
	cmp	eax,3
135
	je	button
136
	cmp	eax,6
137
	je	mouse
138
	jmp	still
139
;---------------------------------------------------------------------
140
control_minimal_window_size:
141
	pusha
142
	call	get_window_param
143
	test	[window_status],10b
144
	jnz	.end	;red_1
145
	test	[window_status],100b
146
	jnz	.end	;red_1
147
	test	[window_status],1b
148
	jnz	.end	;red_1
149
	mov	esi,-1
150
	mov	eax,procinfo
151
	mov	eax,[eax+46]
152
	cmp	eax,dword y_minimal_size ;200
153
	jae	@f
154
	mov	esi,dword y_minimal_size ;200
155
	mcall	67,-1,ebx,ebx
156
@@:
157
	mov	edx,-1
158
	mov	eax,procinfo
159
	mov	eax,[eax+42]
160
	cmp	eax,dword x_minimal_size ;300
161
	jae	@f
162
	mov	edx,dword x_minimal_size ;300
163
	mcall	67,-1,ebx,,ebx
164
@@:
165
.end:
166
	popa
167
	ret
168
;---------------------------------------------------------------------
169
key:
170
	mov	al,[focus_pointer]
171
	test	al,al
172
	jne	key_ASCII
173
	mcall	2
174
	xor	ebx,ebx
175
	cmp	[extended_key],1
176
	je	.extended_key
177
	test	al,al
178
	jnz	still
179
	cmp	ah,0xE0
180
	jne	@f
181
	mov	[extended_key],1
182
	jmp	still
183
@@:
184
	cmp	ah,72	; arrow	up
185
	je	.2
186
	cmp	ah,80	; arrow	down
187
	je	.1
188
	cmp	ah,28	; Enter
189
	je	.7
190
	cmp	ah,1	; Esc
191
	je	button.exit
192
	cmp	ah,14	; Backspace
193
	je	button.exit_dir
194
	cmp	ah,187	; F1
195
	je	select_disk
196
	cmp	ah,188	; F2
197
	je	select_sort
198
	cmp	ah,189	; F3
199
	je	select_filter
200
	cmp	ah,19	; R
201
	je	button.reload_dir
202
	cmp	ah,42
203
	je	key_shift_up
204
	cmp	ah,54
205
	je	key_shift_up
206
	cmp	ah,170
207
	je	key_shift_down
208
	cmp	ah,182
209
	je	key_shift_down
210
	cmp	ah,29
211
	je	key_ctrl_up
212
	cmp	ah,157
213
	je	key_ctrl_down
214
	cmp	ah,56
215
	je	key_alt_up
216
	cmp	ah,184
217
	je	key_alt_down
218
	cmp	ah,206	; NumPad+ Up
219
	je	NumPad_plus_Up
220
	cmp	ah,202	; NumPad- Up
221
	je	NumPad_minus_Up
222
	cmp	ah,183	; NumPad* Up
223
	je	NumPad_invert_Up
224
	cmp	ah,158
225
	je	symbol_a_up
226
	cmp	ah,15	; Tab down
227
	je	change_focus_area_press_Tab_key
228
	cmp	ah,143	; Tab up
229
	je	change_focus_area_check_Tab_key
230
	jmp	still
231
.extended_key:
232
	mov	[extended_key],0
233
	cmp	ah,80	; arrow down
234
	je	.1
235
	cmp	ah,72	; arrow up
236
	je	.2
237
	cmp	ah,81	; PageDown
238
	je	.3
239
	cmp	ah,73	; PageUp
240
	je	.4
241
	cmp	ah,71	; Home
242
	je	.5
243
	cmp	ah,79	; End
244
	je	.6
245
	cmp	ah,28	; Enter
246
	je	.7
247
	cmp	ah,82	; Insert
248
	je	.8
249
 
250
	cmp	ah,29
251
	je	key_ctrl_up
252
	cmp	ah,157
253
	je	key_ctrl_down
254
	cmp	ah,56
255
	je	key_alt_up
256
	cmp	ah,184
257
	je	key_alt_down
258
	jmp	still
259
;---------------------------------
260
.11:
261
	inc	ebx	; 11
262
;---------------------------------
263
.10:
264
	inc	ebx	; 10
265
;---------------------------------
266
.9:
267
	inc	ebx	; 9
268
;---------------------------------
269
.8:
270
	inc	ebx	; 8
271
;---------------------------------
272
.7:
273
	inc	ebx	; 7
274
;---------------------------------
275
.6:
276
	inc	ebx	; 6
277
;---------------------------------
278
.5:
279
	inc	ebx	; 5
280
;---------------------------------
281
.4:
282
	inc	ebx	; 4
283
;---------------------------------
284
.3:
285
	inc	ebx	; 3
286
;---------------------------------
287
.2:
288
	inc	ebx	; 2
289
;---------------------------------
290
.1:
291
	inc	ebx	; 1
292
;---------------------------------
293
	call	.key_action
294
 
295
;	movzx	ecx,word [file_browser_data_1.start_draw_cursor_line]
296
;	mcall	47,0x80000,,<50,0>,0x40000000,0xffffff
297
;	movzx	ecx,word [file_browser_data_1.size_y]
298
;	mcall	47,0x80000,,<150,0>,0x40000000,0xffffff
299
 
300
	mov	eax,file_browser_data_1.mouse_keys_delta
301
	cmp	[eax],dword 3
302
	jne	still
303
	xor	ebx,ebx
304
	mov	[eax],ebx
305
	call	load_next_dir
306
	jmp	still
307
;-------------------------------------------------------
308
.key_action:
309
	mov	[file_browser_data_1.key_action],ebx
310
 
311
	push	dword file_browser_data_1
312
	call	[FileBrowser_key]
313
 
3812 mario79 314
	call	draw_open_button_label
315
 
1954 mario79 316
	cmp	[file_browser_data_1.draw_scroll_bar],0
317
	je	@f
318
	call	draw_scrollbar1
319
	mov	[file_browser_data_1.draw_scroll_bar],0
320
@@:
321
	ret
322
;---------------------------------------------------------------------
323
change_focus_area_Tab_key_ASCII:
324
	xor	eax,eax
325
	inc	eax
326
	mov	[Tab_key_block],al
327
	jmp	change_focus_area
328
;---------------------------------------------------------------------
329
change_focus_area_press_Tab_key:
330
	cmp	[open_dialog_type],1
331
	jne	still
332
	mov	al,[Tab_key_block]
333
	test	al,al
334
	jnz	still
335
	xor	eax,eax
336
	inc	eax
337
	mov	[Tab_key],al
338
	jmp	still
339
;---------------------------------------------------------------------
340
change_focus_area_check_Tab_key:
341
	cmp	[open_dialog_type],1
342
	jne	still
343
	xor	eax,eax
344
	mov	[Tab_key_block],al
345
	mov	al,[Tab_key]
346
	test	al,al
347
	jz	still
348
	xor	eax,eax
349
	mov	[Tab_key],al
350
;---------------------------------------------------------------------
351
change_focus_area:
352
	mov	al,[focus_pointer]
353
	inc	al
354
	and	al,1
355
	mov	[focus_pointer],al
356
.1:
357
	mov	edi,edit1
358
	test	al,al
359
	jne	@f
360
	mov	[file_browser_data_1.select_panel_counter],1
361
	and	[edi+44],dword 0xFFFFFFFD	; ed_focus
362
	mov	[edi+12],dword 0xffffff	; color white
363
	call	draw_draw_file_browser1
364
	mcall	66,1,1
365
	jmp	still
366
@@:
367
	mov	[file_browser_data_1.select_panel_counter],0
368
	or	[edi+44],dword ed_focus
369
	mov	[edi+12],dword 0xffffb0	; color yellow
370
	call	draw_draw_file_browser1
371
	mcall	66,1,0
372
	jmp	still
373
;---------------------------------------------------------------------
374
key_ASCII:
375
	mcall	2
376
	cmp	ah,9
377
	je	change_focus_area_Tab_key_ASCII
378
	cmp	ah,13
379
	je	.13
380
	cmp	ah,27
381
	je	button.exit
382
	push	dword name_editboxes
383
	call	[edit_box_key]
384
	jmp	still
385
.13:
386
;	cmp [open_dialog_type],2	; Select dir
387
;	je	file_no_folder
388
;	cmp	[open_dialog_type],1	; Save file
389
;	jne	user_selected_name_action	; load_dir
390
;	inc	[open_dialog_type]
391
	jmp	file_no_folder
392
;.load_dir:
393
;	mov	[file_browser_data_1.select_panel_counter],1
394
;	xor	eax,eax
395
;	mov	[focus_pointer],al
396
;	mcall	66,1,1
397
 
398
;	xor	eax,eax
2144 mario79 399
;	mov	esi,dir_path
1954 mario79 400
;	cld
401
;@@:
402
;	lodsb
403
;	test	al,al
404
;	jne	@r
405
;	sub	esi,2
406
;	cmp	[esi],byte '/'
407
;	jne	@f
408
;	xor	eax,eax
409
;	mov	[esi],al
410
;@@:
411
;	call	load_next_dir.1
412
;	jmp	still
413
;---------------------------------------------------------------------
414
user_selected_name_action:
415
	mov	eax,[communication_area]
416
	test	eax,eax
417
	jnz	@f
418
	call	control_minimal_window_size
419
	call	draw_window
420
	ret
421
@@:
422
	add	eax,16	;12
2144 mario79 423
;copy_path	user_selected_name,dir_path,eax,0
424
	mov	esi,dir_path
1954 mario79 425
	mov	edi,eax
426
	call	copy_dir_name
427
	mov	[edi-1],byte '/'
428
	mov	esi,user_selected_name
429
	call	copy_dir_name
430
 
431
	mov	eax,[communication_area]
432
	mov	[eax],word 1
433
	jmp	button.exit
434
;---------------------------------------------------------------------
435
select_disk:
436
	call	check_alt
437
.1:
3734 mario79 438
	call	load_root_directory
1954 mario79 439
	xor	eax,eax
440
	mov	[menu_data_1.ret_key],eax
441
 
442
	push	dword menu_data_1
443
	call	[menu_bar_activate]
444
 
445
	call	clear_control_key_flag
446
 
447
	mov	eax,[menu_data_1.ret_key]
448
	mov	[menu_data_1.ret_key],dword 0
449
	cmp	eax,1
450
	je	select_filter.1
451
 
452
	cmp	eax,2
453
	je	select_sort.1
454
 
455
	cmp	[menu_data_1.click],dword 1
456
	jne	still
457
 
458
	cmp	[menu_data_1.cursor_out],dword 0
459
	jne	analyse_out_menu_1
460
	jmp	still
461
;---------------------------------------------------------------------
462
select_sort:
463
	call	check_alt
464
.1:
465
	xor	eax,eax
466
	mov	[menu_data_2.ret_key],eax
467
 
468
	push	dword menu_data_2
469
	call	[menu_bar_activate]
470
 
471
	call	clear_control_key_flag
472
 
473
	mov	eax,[menu_data_2.ret_key]
474
	mov	[menu_data_2.ret_key],dword 0
475
	cmp	eax,1
476
	je	select_disk.1
477
 
478
	cmp	eax,2
479
	je	select_filter.1
480
 
481
 
482
	cmp	[menu_data_2.click],dword 1
483
	jne	still
484
 
485
	cmp	[menu_data_2.cursor_out],dword 0
486
	jne	analyse_out_menu_2
487
	jmp	still
488
;---------------------------------------------------------------------
489
select_filter:
490
	call	check_alt
491
.1:
492
	xor	eax,eax
493
	mov	[menu_data_3.ret_key],eax
494
 
495
	push	dword menu_data_3
496
	call	[menu_bar_activate]
497
 
498
	call	clear_control_key_flag
499
 
500
	mov	eax,[menu_data_3.ret_key]
501
	mov	[menu_data_3.ret_key],dword 0
502
	cmp	eax,1
503
	je	select_sort.1
504
 
505
	cmp	eax,2
506
	je	select_disk.1
507
 
508
 
509
	cmp	[menu_data_3.click],dword 1
510
	jne	still
511
 
512
	cmp	[menu_data_3.cursor_out],dword 0
513
	jne	analyse_out_menu_3
514
	jmp	still
515
;---------------------------------------------------------------------
516
symbol_a_up:
517
NumPad_plus_Up:
518
	call	check_ctrl
519
	jmp	key.9
520
;---------------------------------------
521
NumPad_minus_Up:
522
	call	check_ctrl
523
	jmp	key.10
524
;---------------------------------------
525
NumPad_invert_Up:
526
	call	check_ctrl
527
	jmp	key.11
528
;---------------------------------------
529
check_alt:
530
	xor	eax,eax
531
	mov	al,[alt_flag]
532
	test	eax,eax
533
	jz	@f
534
	xor	ebx,ebx
535
	ret
536
@@:
537
	add	esp,4
538
	jmp	still
539
;---------------------------------------
540
check_ctrl:
541
	xor	eax,eax
542
	mov	al,[ctrl_flag]
543
	test	eax,eax
544
	jz	@f
545
	xor	ebx,ebx
546
	ret
547
@@:
548
	add	esp,4
549
	jmp	still
550
;---------------------------------------------------------------------
551
clear_control_key_flag:
552
	xor	eax,eax
553
	mov	[shift_flag],al
554
	mov	[ctrl_flag],al
555
	mov	[alt_flag],al
556
	ret
557
;---------------------------------------------------------------------
558
key_shift_up:
559
	mov	[shift_flag],1
560
	jmp	still
561
;---------------------------------------------------------------------
562
key_shift_down:
563
	mov	[shift_flag],0
564
	jmp	still
565
;---------------------------------------------------------------------
566
key_ctrl_up:
567
	mov	[ctrl_flag],1
568
	jmp	still
569
;---------------------------------------------------------------------
570
key_ctrl_down:
571
	mov	[ctrl_flag],0
572
	jmp	still
573
;---------------------------------------------------------------------
574
key_alt_up:
575
	mov	[alt_flag],1
576
	jmp	still
577
;---------------------------------------------------------------------
578
key_alt_down:
579
	mov	[alt_flag],0
580
	jmp	still
581
;---------------------------------------------------------------------
582
button:
583
	mcall	17
584
	cmp	ah,6
585
	je	.reload_dir_1
586
	cmp	ah,4
587
	je	.open_dir_or_file
588
	cmp	ah,3
589
	je	.exit
590
	cmp	ah,2
591
	je	.exit_dir
592
	cmp	ah,1
593
	jne	still
594
.exit:
595
	mov	eax,[communication_area]
596
	test	eax,eax
597
	jz	@f
598
	cmp	[eax],word 1
599
	je	@f
600
	mov	[eax],word 3
601
@@:
602
	mov	eax,[N_error]
603
	test	eax,eax
604
	jz	@f
605
	call	start_error_window_thread
606
@@:
607
	call	get_window_param
608
	mov	ebx,[communication_area]
609
	mov	ecx,procinfo
610
;	mov	eax,[window_x]
611
	mov	eax,[ecx+34]
612
	shl	eax,16
613
	add	eax,[ecx+42]
614
	mov	[ebx+4],eax
615
;	mov	eax,[window_y]
616
	mov	eax,[ecx+38]
617
	shl	eax,16
618
	add	eax,[ecx+46]
619
	mov	[ebx+8],eax
620
 
621
	mcall	-1
622
;---------------------------------------------------------------------
623
.reload_dir:
624
	call	check_ctrl
625
.reload_dir_1:
626
	call	load_next_dir.1
627
	jmp	still
628
;---------------------------------------------------------------------
629
.exit_dir:
630
	call	load_next_dir.exit_dir
631
	jmp	still
632
;---------------------------------------------------------------------
633
.open_dir_or_file:
634
	cmp	[open_dialog_type],2	;Select	dir
635
	je	file_no_folder
636
 
637
	cmp	[open_dialog_type],1	;Save file
638
	jne	@f
639
	mov	al,[focus_pointer]
640
	test	al,al
641
	jne	file_no_folder
642
@@:
643
	xor	ebx,ebx
644
	jmp	key.7
645
;---------------------------------------------------------------------
646
thread_start:
647
	mov	eax,[N_error]
648
	cmp	al,1
649
	jne	@f
650
	mov	[N_error],load_ini_error_type
651
	mov	[error_path],file_name
652
	jmp	.error_type
653
@@:
654
	cmp	al,2
655
	jne	@f
656
	mov	[N_error],load_icons_error_type
657
	mov	[error_path],file_name
658
	jmp	.error_type
659
@@:
660
	cmp	al,3
661
	jne	@f
662
	mov	[N_error],memory_free_error_type
663
	xor	eax,eax
664
	mov	[error_path],eax
665
	mov	[error_type],eax
666
	jmp	.red
667
@@:
668
	cmp	al,4
669
	jne	@f
670
	mov	[N_error],memory_get_error_type
671
	xor	eax,eax
672
	mov	[error_path],eax
673
	mov	[error_type],eax
674
	jmp	.red
675
@@:
676
	cmp	al,5
677
	jne	@f
678
	mov	[N_error],load_directory_error_type
2144 mario79 679
	mov	[error_path],dir_path
1954 mario79 680
	jmp	.error_type
681
@@:
682
	cmp	al,6
683
	jne	.button
684
	mov	[N_error],convert_icons_error_type
685
	mov	[error_path],file_name
686
	xor	eax,eax
687
	mov	[error_type],eax
688
	jmp	.red
689
.error_type:
690
	mov	eax,[error_type]
691
	shl	eax,2
692
	add	eax,error_fs_text_pointers
693
	mov	eax,[eax]
694
	mov	[error_type],eax
695
.red:
696
	call	draw_error_window
697
.still:
698
	mcall	10
699
	cmp	eax,1
700
	je	.red
701
	cmp	eax,2
702
	je	.key
703
	cmp	eax,3
704
	je	.button
705
	jmp	.still
706
.key:
707
	mcall	2
708
	jmp	.still
709
.button:
710
	mcall	-1
711
	jmp	.still
712
;---------------------------------------------------------------------
713
draw_error_window:
714
	mcall	12,1
715
	mcall	0,[error_window_x],[error_window_y],0x03ff0000
716
	call	type_title
717
	mcall	4,<10,30>,0x90ffffff,[N_error]
718
	mov	eax,[error_path]
719
	test	eax,eax
720
	jz	@f
721
	mcall	4,<10,50>,,[error_path]
722
@@:
723
	mov	eax,[error_type]
724
	test	eax,eax
725
	jz	@f
726
	mcall	4,<10,70>,,[error_type]
727
@@:
728
	mcall	12,2
729
	ret
730
;---------------------------------------------------------------------
731
start_error_window_thread:
732
	mcall	9,procinfo,-1
733
	mov	eax,[ebx+46]
734
	shr	eax,1
735
	add	eax,[ebx+38]
736
	sub	eax,40
737
	mov	[error_window_y+2],ax
738
	mov	eax,[ebx+42]
739
	shr	eax,1
740
	add	eax,[ebx+34]
741
	sub	eax,125
742
	mov	[error_window_x+2],ax
743
	mcall	51,1,thread_start,thread_stack
744
	ret
745
;---------------------------------------------------------------------
746
mouse:
747
	mcall	18,7
748
	cmp	[active_process],eax
749
	jne	still
750
 
751
	mcall	37,7
752
	mov	[mouse_scroll_data],eax
753
 
754
	mcall	37,1
755
	mov	[mouse_position],eax
756
 
757
	cmp	[scroll_bar_data_vertical.delta2],0
758
	jne	.scrollbar
759
 
760
	mov	[file_browser_data_1.select_flag],0
761
 
762
	push	dword file_browser_data_1
763
	call	[FileBrowser_mouse]
764
 
3812 mario79 765
	call	draw_open_button_label
766
 
1954 mario79 767
	mov	eax,file_browser_data_1.mouse_keys_delta
768
	cmp	[eax],dword 3
769
	jne	.check_focus	; scrollbar
770
	mov	[eax],dword 0
771
	call	load_next_dir
772
	jmp	still
773
;---------------------------------------------------
774
.check_focus:
775
	mov	ebx,[file_browser_data_1.select_flag]
776
	test	ebx,ebx
777
	jz	.scrollbar	;@f
778
	mov	al,[focus_pointer]
779
	test	al,al
780
	jz	.scrollbar
781
	xor	eax,eax
782
	mov	[focus_pointer],al
783
	jmp	change_focus_area.1
784
;---------------------------------------------------
785
.scrollbar:
786
	mov	eax,[scroll_bar_data_vertical.max_area]
787
	cmp	eax,[scroll_bar_data_vertical.cur_area]
788
	jbe	.menu_bar	;still
789
 
790
	push	dword scroll_bar_data_vertical
791
	call	[scrollbar_ver_mouse]
792
 
793
	cmp	[scroll_bar_data_vertical.redraw],0
794
	je	.menu_bar	;still
795
	mov	[scroll_bar_data_vertical.redraw],0
796
.draw:
797
	call	draw_draw_file_browser2
798
	jmp	still
799
 
800
;---------------------------------------------------
801
.menu_bar:
802
	cmp	[scroll_bar_data_vertical.delta2],0
803
	jne	still
804
 
805
.menu_bar_1:
806
	call	.set_mouse_flag
807
@@:
808
	push	dword menu_data_1
809
	call	[menu_bar_mouse]
810
 
811
	cmp	[menu_data_1.click],dword 1
812
	jne	.menu_bar_2
813
 
814
	cmp	[menu_data_1.cursor_out],dword 0
3734 mario79 815
	jne	select_disk.1	;analyse_out_menu_1
1954 mario79 816
	jmp	.menu_bar_1
817
;--------------------------------------------
818
.menu_bar_2:
819
	push	dword menu_data_2
820
	call	[menu_bar_mouse]
821
 
822
	cmp	[menu_data_2.click],dword 1
823
	jne	.menu_bar_3
824
 
825
	cmp	[menu_data_2.cursor_out],dword 0
826
	jne	analyse_out_menu_2
827
	jmp	.menu_bar_1
828
;---------------------------------------------------
829
.menu_bar_3:
830
	push	dword menu_data_3
831
	call	[menu_bar_mouse]
832
 
833
	cmp	[menu_data_3.click],dword 1
834
	jne	.check_editboxes
835
 
836
	cmp	[menu_data_3.cursor_out],dword 0
837
	jne	analyse_out_menu_3
838
	jmp	.menu_bar_1
839
;---------------------------------------------------
840
.check_editboxes:
841
	cmp	[open_dialog_type],1
842
	jne	.check_scroll_event
843
	mov	eax,[edit1+44]
844
	and	eax,10b
845
	push	dword name_editboxes
846
	call	[edit_box_mouse]
847
	mov	ebx,[edit1+44]
848
	and	ebx,10b
849
	cmp	eax,ebx
850
	je	.check_scroll_event
851
	mov	al,[focus_pointer]
852
	test	al,al
853
	jnz	.check_scroll_event
854
	xor	eax,eax
855
	test	ebx,10b
856
	jz	@f
857
	inc	eax
858
@@:
859
	mov	[focus_pointer],al
860
	jmp	change_focus_area.1
861
;---------------------------------------------------
862
.check_scroll_event:
863
	mov	eax,[mouse_position]
864
	xor	ebx,ebx
865
	mov	bx,ax	; EBX mouse y
866
	shr	eax,16	; EAX mouse x
867
 
868
	mov	cx,[file_browser_data_1.start_x]
869
	mov	dx,[file_browser_data_1.start_y]
870
 
871
	cmp	ax,cx
872
	jb	.mouse_next	; min x
873
 
874
	cmp	bx,dx
875
	jb	.mouse_next	; min y
876
 
877
	add	cx,[file_browser_data_1.size_x]
878
	cmp	ax,cx
879
	ja	.mouse_next	; max x
880
 
881
	add	dx,[file_browser_data_1.size_y]
882
	cmp	bx,dx
883
	ja	.mouse_next	; max y
884
 
885
	xor	ecx,ecx
886
	xor	ebx,ebx
887
	mov	eax,[mouse_scroll_data]
888
	test	eax,eax
889
	jz	.mouse_next
890
	test	ax,0x8000
891
	jnz	.decr
892
	shr	eax,16
893
	test	ax,0x8000
894
	jnz	.decr_1
895
 
896
	mov	cx,[mouse_scroll_data.vertical]
897
	test	ecx,ecx
898
	jnz	@f
899
	mov	cx,[mouse_scroll_data.horizontal]
900
	test	ecx,ecx
901
	jz	.mouse_next
902
@@:
903
	mov	ebx,1
904
@@:
905
	push	ebx ecx
906
	call	key.key_action
907
	pop	ecx ebx
908
	dec	ecx
909
	jnz	@r
910
	jmp	still
911
;----------------------------------------
912
.decr:
913
	mov	bx,[mouse_scroll_data.vertical]
914
	jmp	@f
915
.decr_1:
916
	mov	bx,[mouse_scroll_data.horizontal]
917
@@:
918
	mov	ecx,0xffff
919
	sub	ecx,ebx
920
	inc	ecx
921
	mov	ebx,2
922
@@:
923
	push	ebx ecx
924
	call	key.key_action
925
	pop	ecx ebx
926
	dec	ecx
927
	jnz	@r
928
	jmp	still
929
;---------------------------------------------------
930
.mouse_next:
931
	jmp	still
932
;---------------------------------------------------------------------
933
.set_mouse_flag:
934
	xor	eax,eax
935
	inc	eax
936
	mov	[menu_data_1.get_mouse_flag],eax
937
	mov	[menu_data_2.get_mouse_flag],eax
938
	ret
939
;---------------------------------------------------------------------
940
analyse_out_menu_1:
941
; Available disks
942
	mov	eax,[menu_data_1.cursor_out]
943
	dec	eax
944
	imul	esi,eax,10
945
	add	esi,retrieved_devices_table
2144 mario79 946
	mov	edi,dir_path
1954 mario79 947
	call	copy_dir_name
948
	call	load_next_dir.1
949
	jmp	still
950
;---------------------------------------------------------------------
951
analyse_out_menu_2:
952
; Sort
953
	mov	eax,[menu_data_2.cursor_out]
954
	xor	ebx,ebx
955
	cmp	eax,dword 1
956
	je	.1
957
	cmp	eax,dword 2
958
	je	.2
959
	cmp	eax,dword 3
960
	je	.3
961
	cmp	eax,dword 4
962
	je	.4
963
	jmp	still
964
.4:
965
	add	ebx,2
966
.3:
967
	add	ebx,2
968
.2:
969
	add	ebx,2
970
.1:
971
	mov	[sort_type],ebx
972
	call	sort_directory
973
	call	draw_draw_file_browser1
974
	jmp	still
975
;---------------------------------------------------------------------
976
analyse_out_menu_3:
977
; Filter
978
	mov	eax,[menu_data_3.cursor_out]
979
	cmp	eax,dword 1
980
	jne	@f
981
	mov	[filter_flag],0
982
	call	load_next_dir.1
983
	jmp	still
984
@@:
985
	cmp	eax,dword 2
986
	jne	still
987
	mov	[filter_flag],1
988
	call	load_next_dir.1
989
	jmp	still
990
;---------------------------------------------------------------------
991
get_communication_area:
992
	xor	eax,eax
993
	mov	al,[param]
994
	test	eax,eax
995
	jz	@f
996
	mcall	68,22,param,,0x01
997
	mov	[communication_area],eax
998
	movzx	ebx,word [eax+2]
999
	mov	[open_dialog_type],ebx
1000
	mov	ebx,[eax+4]
1001
	cmp	bx,word x_minimal_size ;300
1002
	jb	@f
1003
	mov	[window_x],ebx
1004
	mov	ebx,[eax+8]
1005
	cmp	bx,word y_minimal_size ;200
1006
	jb	@f
1007
	mov	[window_y],ebx
1008
@@:
1009
	ret
1010
;---------------------------------------------------------------------
1011
load_start_directory:
1012
	mov	eax,[communication_area]
1013
	test	eax,eax
1014
	jz	.1
1015
	movzx	ebx,word [eax]
1016
	test	eax,eax
1017
	jz	.1
1018
	add	eax,16	;12 ;4
1019
	mov	esi,eax
1020
	push	esi
1021
	mov	esi,[communication_area]
1022
	add	esi,3840 ;4096-256
1023
	mov	eax,[esi]
1024
	test	eax,eax
1025
	jnz	@f
1026
	mov	esi,example_name_temp
1027
@@:
1028
	mov	edi,user_selected_name
1029
	call	copy_dir_name
1030
	pop	esi
1031
	jmp	.2
1032
.1:
1033
	mov	esi,start_pach
1034
.2:
2144 mario79 1035
	mov	edi,dir_path
1954 mario79 1036
	call	copy_dir_name
1037
 
1038
;	call	load_directory
1039
;	mov	eax,[N_error]
1040
;	test	eax,eax
1041
;	jnz	button.exit
1042
.3:
1043
	call	load_directory
1044
	mov	eax,[N_error]
1045
	test	eax,eax
1046
	jz	@f
1047
	call	error_handler
1048
	jmp	.3
1049
@@:
1050
	ret
1051
;---------------------------------------------------------------------
1052
load_next_dir:
1053
	mov	ebx,[file_browser_data_1.selected_BDVK_adress]
1054
	add	ebx,40
1055
	test	[ebx-40],byte 0x10
1056
	jz	file_no_folder
1057
	cmp	[ebx],word '..'
1058
	jne	@f
1059
	cmp	[ebx+2],byte 0
1060
	je	.exit_dir
1061
@@:
2144 mario79 1062
	mov	esi,dir_path
1954 mario79 1063
	call	copy_dir_path
1064
 
1065
@@:
1066
.1:
1067
	call	load_directory
1068
	mov	eax,[N_error]
1069
	test	eax,eax
1070
	jz	@f
1071
	call	error_handler
1072
	jmp	.1
1073
@@:
1074
	call	sort_directory
1075
 
1076
	mov	ebx,[scroll_bar_data_vertical.x]
1077
	inc	ebx
1078
	mov	ecx,[scroll_bar_data_vertical.y]
1079
	inc	ecx
1080
	mcall	13,,,0xcccccc
1081
	mov	edi,edit1
1082
	xor	eax,eax
1083
	mov	[edi+44],eax
1084
	mov	[edi+12],dword 0xffffff	; color white
1085
	call	draw_draw_file_browser1
1086
	ret
1087
.exit_dir:
2144 mario79 1088
	mov	esi,dir_path
1954 mario79 1089
	call	copy_exit_dir
1090
	jmp	.1
1091
;---------------------------------------------------------------------
1092
error_handler:
1093
.red:
1094
	call	.draw_window
1095
;------------------------------------
1096
.still:
1097
	mcall	10
1098
	cmp	eax,1
1099
	je	.red
1100
	cmp	eax,2
1101
	je	.key
1102
	cmp	eax,3
1103
	je	.button
1104
	jmp	.still
1105
;------------------------------------
1106
.draw_window:
1107
	xor	eax,eax
1108
	inc	eax
1109
	mov	[error_window],al
1110
	call	control_minimal_window_size
1111
	call	draw_window
1112
	xor	eax,eax
1113
	mov	[error_window],al
1114
	ret
1115
;------------------------------------
1116
.key:
1117
	mcall	2
1118
	xor	ebx,ebx
1119
	cmp	[extended_key],1
1120
	je	.extended_key
1121
	test	al,al
1122
	jnz	.still
1123
	cmp	ah,0xE0
1124
	jne	@f
1125
	mov	[extended_key],1
1126
	jmp	.still
1127
@@:
1128
	cmp	ah,129	; Esc
1129
	je	.exit
1130
	jmp	.still
1131
.extended_key:
1132
	jmp	.still
1133
;------------------------------------
1134
.button:
1135
	mcall	17
1136
	cmp	ah,5
1137
	je	.exit
1138
	cmp	ah,1
1139
	jne	.still
1140
	xor	eax,eax
1141
	mov	[N_error],eax
1142
	jmp	button.exit
1143
;------------------------------------
1144
.exit:
2144 mario79 1145
	mov	esi,previous_dir_path
1146
	mov	edi,dir_path
1147
	call	copy_dir_name.1
1954 mario79 1148
	mov	esi,start_pach
2144 mario79 1149
	mov	edi,previous_dir_path
1150
	call	copy_dir_name.1
1954 mario79 1151
	ret
1152
;---------------------------------------------------------------------
1153
file_no_folder:
2144 mario79 1154
	mov	esi,dir_path
1954 mario79 1155
	mov	edi,file_name
1156
	call	copy_dir_name
1157
	push	ebx
1158
	mov	al,[focus_pointer]
1159
	test	al,al
1160
	je	@f
1161
	mov	ebx,user_selected_name
1162
@@:
1163
	cmp	[open_dialog_type],2
1164
	je	@f
1165
	mov	esi,file_name
1166
	call	copy_dir_path
1167
@@:
1168
	mov	eax,[communication_area]
1169
	test	eax,eax
1170
	jnz	@f
1171
	call	control_minimal_window_size
1172
	call	draw_window
1173
	pop	ebx
1174
	ret
1175
@@:
1176
	mov	edi,eax
1177
	add	edi,16	;12
1178
	mov	esi,file_name
1179
	call	copy_dir_name
1180
 
1181
	pop	esi
1182
	mov	al,[focus_pointer]
1183
	test	al,al
1184
	jz	@f
1185
	mov	esi,user_selected_name
1186
@@:
1187
	mov	edi,[communication_area]
1188
	add	edi,3840 ;4096-256
1189
	call	copy_dir_name
1190
 
1191
	mov	eax,[communication_area]
1192
	mov	[eax],word 1
1193
	jmp	button.exit
1194
;---------------------------------------------------------------------
1195
load_root_directory:
3734 mario79 1196
	mov	[dirinfo.name],dword dir_path_temp
1197
	mov	eax,[dirinfo.return]
1198
	push	eax
1199
	mov	eax,[file_browser_data_1.folder_data]
1200
	push	eax
1201
	xor	eax,eax
1202
	mov	[dirinfo.return],eax
1203
	mov	[file_browser_data_1.folder_data],eax
1954 mario79 1204
	mov	esi,root_pach
3734 mario79 1205
	mov	edi,dir_path_temp
1954 mario79 1206
	call	copy_dir_name
1207
	call	load_directory
1208
	mov	eax,[N_error]
1209
	test	eax,eax
1210
	jnz	button.exit
1211
 
1212
	mov	eax,[dirinfo.return]
1213
	mov	[root_folder_area],eax
1214
	mov	eax,[eax+4]
1215
	mov	[root_folder_block],eax
1216
 
1217
	xor	eax,eax
1218
	mov	[dirinfo.return],eax
1219
	mov	[file_browser_data_1.folder_data],eax
1220
	mov	[temp_counter_1],eax	;0
1221
 
1222
	mov	[retrieved_devices_table_counter],eax	;0
1223
.start_temp_counter_1:
1224
	imul	esi,[temp_counter_1],304
1225
	add	esi,[root_folder_area]
1226
	add	esi,32+40
3734 mario79 1227
	mov	edi,dir_path_temp+1
1954 mario79 1228
	mov	[edi-1],byte '/'
1229
	call	copy_dir_name
1230
	call	load_directory
1231
	mov	eax,[N_error]
1232
	test	eax,eax
1233
	jnz	button.exit
1234
 
1235
	mov	eax,[dirinfo.return]
1236
	mov	[root1_folder_area],eax
1237
	mov	eax,[eax+4]
1238
	test	eax,eax
1239
	jz	.continue
1240
	mov	[root1_folder_block],eax
1241
 
1242
	mov	ebp,0
1243
.start_copy_device_patch:
1244
	imul	edi,[retrieved_devices_table_counter],10
1245
	add	edi,retrieved_devices_table
1246
	mov	[edi],byte '/'
1247
	inc	edi
1248
	imul	esi,[temp_counter_1],304
1249
	add	esi,[root_folder_area]
1250
	add	esi,32+40
1251
 
1252
	call	copy_dir_name
1253
 
1254
	imul	esi,ebp,304
1255
	add	esi,[root1_folder_area]
1256
	add	esi,32+40
1257
	mov	[edi-1],byte '/'
1258
 
1259
	call	copy_dir_name
1260
 
1261
	inc	[retrieved_devices_table_counter]
1262
	inc	ebp
1263
	cmp	ebp,[root1_folder_block]
1264
	jb	.start_copy_device_patch
1265
.continue:
1266
	inc	[temp_counter_1]
1267
	mov	eax,[temp_counter_1]
1268
	cmp	eax,[root_folder_block]
1269
	jb	.start_temp_counter_1
1270
 
1271
	cmp	[root_folder_area],dword 0
1272
	je	@f
1273
	mcall	68,13,[root_folder_area]
1274
	test	eax,eax
1275
	jz	memory_free_error
1276
@@:
1277
 
1278
	xor	ecx,ecx
1279
	mov	edi,menu_text_area_1_1	;.1
1280
@@:
1281
	imul	esi,ecx,10
1282
	add	esi,retrieved_devices_table
1283
	call	copy_dir_name
1284
	inc	ecx
1285
	cmp	ecx,[retrieved_devices_table_counter]
1286
	jb	@b
1287
	mov	[menu_data_1.text_end],edi
1288
	xor	eax,eax
1289
	mov	[edi],eax
3734 mario79 1290
	pop	eax
1291
	mov	[file_browser_data_1.folder_data],eax
1292
	pop	eax
1293
	mov	[dirinfo.return],eax
1294
	mov	[dirinfo.name],dword dir_path
1954 mario79 1295
	ret
1296
;---------------------------------------------------------------------
1297
memory_free_error:
1298
	mov	[N_error],3
1299
	jmp	button.exit
1300
;---------------------------------------------------------------------
1301
memory_get_error:
1302
	mov	[N_error],4
1303
	jmp	button.exit
1304
;---------------------------------------------------------------------
1305
type_title:
1306
	mov	ecx,[open_dialog_type]
1307
	shl	ecx,2
1308
	add	ecx,open_dialog_title_pointer
1309
	mov	ecx,[ecx]
1310
	test	ecx,ecx
1311
	jz	@f
2144 mario79 1312
	mcall	71,1,; title ;;param ;file_name ;dir_path
1954 mario79 1313
@@:
1314
	ret
1315
;---------------------------------------------------------------------
1316
draw_window:
1317
 
1318
	mcall	12,1
3808 mario79 1319
 
1320
	call	prepare_system_colors
1954 mario79 1321
 
1322
;	mcall	0,<10,420>,<10,320>,0x63AABBCC,
1323
	xor	esi,esi
3808 mario79 1324
;	mov	edx,[w_work]	; color of work area RRGGBB,8->color
1325
;	or	edx,0x63000000
1326
	mcall	0,[window_x],[window_y],0x63AABBCC
1954 mario79 1327
 
1328
;	mov	ecx,[communication_area]
1329
;	add	ecx,4096+4+4
1330
	call	type_title
1331
	call	get_window_param
2055 mario79 1332
 
1333
	mov	eax,[procinfo+70] ;status of window
1334
	test	eax,100b
1335
	jne	.end
1336
 
1954 mario79 1337
	mov	eax,[window_high]
1338
	sub	eax,25+45
1339
	mov	[file_browser_data_1.size_y],ax
1340
	mov	[scroll_bar_data_vertical.size_y],ax
1341
 
1342
	mov	eax,[window_width]
1343
	sub	eax,10+20
1344
	mov	[file_browser_data_1.size_x],ax
1345
	add	ax,10
1346
	mov	[scroll_bar_data_vertical.start_x],ax
1347
 
3808 mario79 1348
	mov	edx,[w_work]	; color of work area RRGGBB,8->color
1349
	or	edx,0x63000000
1350
	mcall	13,[window_width],45	;,0xcccccc
1954 mario79 1351
 
1352
	push	ecx
1353
	rol	ecx,16
1354
	add	cx,[file_browser_data_1.size_y]
1355
	add	cx,45
1356
	ror	ecx,16
1357
	mov	cx,25
1358
	mcall
1359
	pop	ecx
1360
	add	ecx,45 shl 16
1361
	mov	cx,[file_browser_data_1.size_y]
1362
	mov	bx,10
1363
	mcall
1364
	mov	bx,[file_browser_data_1.size_x]
1365
	add	bx,10
1366
	shl	ebx,16
1367
	mov	bx,20
1368
	mcall
1369
 
1370
	cmp	[error_window],0
1371
	je	@f
1372
	call	draw_for_fs_errors
1373
	jmp	.1
1374
@@:
3812 mario79 1375
	mov	[do_not_draw_open_button_label],1
1954 mario79 1376
	call	draw_draw_file_browser1
3812 mario79 1377
	mov	[do_not_draw_open_button_label],0
1954 mario79 1378
.1:
1379
	push	dword menu_data_1
1380
	call	[menu_bar_draw]
1381
	push	dword menu_data_2
1382
	call	[menu_bar_draw]
1383
	push	dword menu_data_3
1384
	call	[menu_bar_draw]
1385
 
1386
	mov	ebx,[file_browser_data_1.x]
1387
	mov	ax,bx
1388
	shl	eax,16
1389
	add	ebx,eax
1390
	mov	eax,50
1391
	mov	bx,ax
1392
	shl	eax,16
1393
	sub	ebx,eax
1394
	mov	ecx,26 shl 16+15
1395
 
3808 mario79 1396
	mcall	8,,,2,[w_work_button]	;0xffffff
1954 mario79 1397
 
1398
	pusha
1399
	shr	ecx,16
1400
	mov	bx,cx
1401
	add	ebx,20 shl 16+2
3808 mario79 1402
	mov	ecx,[w_work_button_text]
1403
	or	ecx,0x90000000
1404
	mcall	4,,,message_ExitDir_button
1954 mario79 1405
	add	ebx,4
1406
	mcall
1407
	add	ebx,4
1408
	mcall
1409
	popa
1410
 
1411
	push	ebx
1412
	sub	ebx,70 shl 16
1413
	mov	bx,60
1414
	mcall	8,,,6
1415
 
1416
	shr	ecx,16
1417
	mov	bx,cx
1418
	add	ebx,5 shl 16+4
3808 mario79 1419
	mov	ecx,[w_work_button_text]
1420
	or	ecx,0x90000000
1421
	mcall	4,,,message_ReloadDir_button
1954 mario79 1422
	pop	ebx
1423
 
1424
	mov	ebx,[file_browser_data_1.x]
1425
 
1426
	mov	ax,bx
1427
	shl	eax,16
1428
	add	ebx,eax
1429
	mov	eax,55
1430
	mov	bx,ax
1431
	shl	eax,16
1432
	sub	ebx,eax
1433
 
1434
	mov	ecx,[file_browser_data_1.y]
1435
	mov	ax,cx
1436
	add	eax,3
1437
	shl	eax,16
1438
	add	ecx,eax
1439
	mov	cx,15
1440
 
1441
	mcall	8,,,3
1442
 
1443
	pusha
1444
 
1445
	shr	ecx,16
1446
	mov	bx,cx
1447
	add	ebx,6 shl 16+ 4
3808 mario79 1448
	mov	ecx,[w_work_button_text]
1449
	or	ecx,0x90000000
1450
	mcall	4,,,message_cancel_button
1954 mario79 1451
	popa
1452
 
1453
	sub	ebx,65 shl 16
1454
	mcall	8,,,4
1455
 
1456
	shr	ecx,16
1457
	mov	bx,cx
3812 mario79 1458
	add	ebx,6 shl 16+4
1954 mario79 1459
 
1460
	mov	edx,[open_dialog_type]
1461
	shl	edx,2
1462
	add	edx,message_open_dialog_button
1463
	mov	edx,[edx]
1464
 
3812 mario79 1465
	mov	eax,[file_browser_data_1.selected_BDVK_adress]
1466
	test	[eax],byte 0x10
1467
	jz	@f
1468
 
1469
	mov	edx,message_0 	; Open Dir
1954 mario79 1470
@@:
3812 mario79 1471
	mov	[open_button_coordinates],ebx
3808 mario79 1472
	mov	ecx,[w_work_button_text]
1473
	or	ecx,0x90000000
1474
	mcall	4	;message_open_button
1954 mario79 1475
 
1476
;	mcall	47,0x80000,[file_browser_data_1.ini_file_start],<250,0>,0x0
1477
;	mcall	4,<3,420>,0,fb_extension_start,3
2055 mario79 1478
.end:
1954 mario79 1479
	mcall	12,2
1480
 
1481
	ret
1482
;---------------------------------------------------------------------
3812 mario79 1483
draw_open_button_label:
1484
	cmp	[do_not_draw_open_button_label],1
1485
	je	.exit_1
1486
 
1487
	cmp	[open_dialog_type],1
1488
	jne	.exit_1
1489
 
1490
	pusha
1491
	mov	ebx,[open_button_coordinates]
1492
	test	ebx,ebx
1493
	jz	.exit
1494
 
1495
	mov	edx,[open_dialog_type]
1496
	shl	edx,2
1497
	add	edx,message_open_dialog_button
1498
	mov	edx,[edx]
1499
 
1500
	mov	eax,[file_browser_data_1.selected_BDVK_adress]
1501
	test	[eax],byte 0x10
1502
	jz	@f
1503
 
1504
	mov	edx,message_0	; Open Dir
1505
	jmp	.1
1506
@@:
1507
	call	copy_new_file_name
1508
.1:
1509
	mov	ecx,[w_work_button_text]
1510
	or	ecx,0xd0000000
1511
	mov	edi,[w_work_button]
1512
	mcall	4	;message_open_button
1513
.exit:
1514
	popa
1515
.exit_1:
1516
	ret
1517
;---------------------------------------------------------------------
1518
copy_new_file_name:
1519
	mov	esi,[file_browser_data_1.selected_BDVK_adress]
1520
	add	esi,40
1521
	mov	edi,user_selected_name
1522
	cld
1523
@@:
1524
	lodsb
1525
	stosb
1526
	test	al,al
1527
	jnz	@r
1528
 
1529
	sub	edi,user_selected_name
1530
	dec	edi
1531
 
1532
	mov	esi,edit1
1533
	mov	[esi+48],edi ;ed_size
1534
	mov	[esi+52],edi ;ed_pos
1535
 
1536
	push	dword name_editboxes
1537
	call	[edit_box_draw]
1538
	ret
1539
;---------------------------------------------------------------------
3808 mario79 1540
prepare_system_colors:
1541
	mcall	48,3,app_colours,10*4
1542
 
1543
	mov	eax,[w_work]
1544
	mov	[menu_data_1.bckg_col],eax
1545
	mov	[menu_data_2.bckg_col],eax
1546
	mov	[menu_data_3.bckg_col],eax
1547
 
1548
	mov	[menu_data_1.menu_col],eax
1549
	mov	[menu_data_2.menu_col],eax
1550
	mov	[menu_data_3.menu_col],eax
1551
 
1552
	mov	[scroll_bar_data_vertical.bckg_col],eax
1553
 
1554
	mov	eax,[w_work_button]
1555
	mov	[menu_data_1.frnt_col],eax
1556
	mov	[menu_data_2.frnt_col],eax
1557
	mov	[menu_data_3.frnt_col],eax
1558
 
1559
	mov	[scroll_bar_data_vertical.frnt_col],eax
1560
 
1561
	mov	eax,[w_work_button]
1562
	mov	[menu_data_1.menu_sel_col],eax
1563
	mov	[menu_data_2.menu_sel_col],eax
1564
	mov	[menu_data_3.menu_sel_col],eax
1565
 
1566
	mov	eax,[w_work_text]
1567
	mov	[menu_data_1.bckg_text_col],eax
1568
	mov	[menu_data_2.bckg_text_col],eax
1569
	mov	[menu_data_3.bckg_text_col],eax
1570
 
1571
	mov	eax,[w_work_button_text]
1572
	mov	[menu_data_1.frnt_text_col],eax
1573
	mov	[menu_data_2.frnt_text_col],eax
1574
	mov	[menu_data_3.frnt_text_col],eax
1575
 
1576
	mov	[scroll_bar_data_vertical.line_col],eax
1577
	ret
1578
;---------------------------------------------------------------------
1954 mario79 1579
draw_for_fs_errors:
2144 mario79 1580
	call	draw_dir_path
1954 mario79 1581
 
1582
	mov	ebx,[file_browser_data_1.x]
1583
	mov	ecx,[file_browser_data_1.y]
1584
	mcall	13,,,[file_browser_data_1.background_color]
1585
	push	ebx ecx
1586
	add	ebx,10 shl 16
1587
	sub	ebx,20
1588
	add	ecx,10 shl 16
1589
	sub	ecx,20
1590
	mov	edx,0xff0000
1591
	mcall
1592
 
1593
	shr	ecx,16
1594
	mov	bx,cx
1595
	add	ebx,5 shl 16+15
1596
	mcall	4,,0x90ffffff,load_directory_error_type
1597
 
1598
	add	ebx,20
2144 mario79 1599
	mcall	4,,,dir_path
1954 mario79 1600
 
1601
	mov	eax,[error_type]
1602
	shl	eax,2
1603
	add	eax,error_fs_text_pointers
1604
	mov	edx,[eax]
1605
	add	ebx,20
1606
	mcall	4
1607
 
1608
	pop	ecx ebx
1609
 
1610
	mov	ebx,[file_browser_data_1.x]
1611
	mov	ax,bx
1612
	shr	eax,1
1613
	shl	eax,16
1614
	add	ebx,eax
1615
	mov	eax,50
1616
	mov	bx,ax
1617
	shr	eax,1
1618
	shl	eax,16
1619
	sub	ebx,eax
1620
 
1621
	mov	ecx,[file_browser_data_1.y]
1622
	mov	ax,cx
1623
	sub	eax,40
1624
	shl	eax,16
1625
	add	ecx,eax
1626
	mov	cx,15
1627
 
1628
	mcall	8,,,5,0xffffff
1629
 
1630
	shr	ecx,16
1631
	mov	bx,cx
1632
	add	ebx,4 shl 16+4
1633
	mcall	4,,0x90000000,message_cancel_button
1634
 
1635
 
1636
	ret
1637
;---------------------------------------------------------------------
1638
draw_file_name:
1639
	mov	esi,user_selected_name
1640
	cld
1641
@@:
1642
	lodsb
1643
	test	al,al
1644
	jne	@r
1645
	sub	esi,user_selected_name
1646
	mov	eax,esi
1647
	dec	eax
1648
 
1649
	mov	edi,edit1
1650
	mov	[edi+48],eax ;ed_size
1651
	mov	[edi+52],eax ;ed_pos
1652
;--------------------------------------
1653
	mov	eax,[file_browser_data_1.x]
1654
	mov	ebx,eax
1655
	shr	ebx,16
1656
	and	eax,0xffff
1657
	sub	eax,200
1658
	mov	[edi],eax
1659
	add	ebx,70
1660
	mov	[edi+4],ebx
1661
 
1662
	mov	eax,[file_browser_data_1.y]
1663
	mov	ebx,eax
1664
	shr	ebx,16
1665
	and	eax,0xffff
1666
	add	eax,ebx
1667
	add	eax,5
1668
	mov	[edi+8],eax
1669
 
1670
	push	dword name_editboxes
1671
	call	[edit_box_draw]
1672
 
1673
	mov	bx,[file_browser_data_1.start_x]
1674
	add	bx,5
1675
	shl	ebx,16
1676
	mov	bx,[file_browser_data_1.start_y]
1677
	add	bx,[file_browser_data_1.size_y]
1678
	add	bx,9
1679
	mcall	4,,0x80000000,message_file_name
1680
	ret
1681
;---------------------------------------------------------------------
2144 mario79 1682
draw_dir_path:
1954 mario79 1683
	mov	eax,[file_browser_data_1.x]
1684
	mov	ebx,eax
1685
	shr	ebx,16
1686
	add	ebx,3
1687
	and	eax,0xffff
1688
	sub	eax,5
1689
 
1690
	mov	[PathShow_data_1.area_size_x],ax
1691
	mov	[PathShow_data_1.start_x],bx
1692
;--------------------------------------
3808 mario79 1693
;; top line
1694
;	mov	ebx,[file_browser_data_1.x]
1695
;	mcall	13,,<7,1>,0x0
1954 mario79 1696
; down line
3808 mario79 1697
;	push	ebx ecx
1698
;	mcall	,,<21,1>,
1699
;	pop	ecx ebx
1954 mario79 1700
; left line
3808 mario79 1701
;	push	ebx
1702
;	mov	bx,1
1703
;	mov	cx,15
1704
;	mcall
1705
;	pop	ebx
1954 mario79 1706
; right line
3808 mario79 1707
;	mov	ax,bx
1708
;	shr	ebx,16
1709
;	add	bx,ax
1710
;	dec	ebx
1711
;	shl	ebx,16
1712
;	mov	bx,1
1713
;	mcall	13
1954 mario79 1714
;--------------------------------------
1715
	mov	ebx,[file_browser_data_1.x]
1716
	sub	ebx,2
1717
	add	ebx,1 shl 16
3808 mario79 1718
	mcall	13,,<8,13>,0xffffcc
1954 mario79 1719
;--------------------------------------
1720
; prepare for PathShow
1721
	push	dword PathShow_data_1
1722
	call	[PathShow_prepare]
1723
 
1724
; draw for PathShow
1725
	push	dword PathShow_data_1
1726
	call	[PathShow_draw]
1727
 
1728
	ret
1729
;---------------------------------------------------------------------
1730
draw_draw_file_browser1:
2144 mario79 1731
	call	draw_dir_path
1954 mario79 1732
	cmp	[open_dialog_type],1
1733
	jne	@f
1734
	call	draw_file_name
1735
@@:
1736
	xor	eax,eax
1737
	inc	eax
1738
	mov	[file_browser_data_1.all_redraw],eax
1739
	mov	[scroll_bar_data_vertical.all_redraw],eax
1740
 
1741
	push	dword file_browser_data_1
1742
	call	[FileBrowser_draw]
3812 mario79 1743
 
1744
	call	draw_open_button_label
1954 mario79 1745
 
1746
	call	prepare_scrollbar_data
1747
 
1748
	call	draw_scrollbar
1749
 
1750
	xor	eax,eax
1751
	mov	[file_browser_data_1.all_redraw],eax
1752
	mov	[scroll_bar_data_vertical.all_redraw],eax
1753
	ret
1754
;---------------------------------------------------------------------
1755
draw_draw_file_browser2:
1756
	mov	eax,2
1757
	mov	[file_browser_data_1.all_redraw],eax
1758
 
1759
	call	get_scrollbar_data
1760
 
1761
	push	dword file_browser_data_1
1762
	call	[FileBrowser_draw]
1763
 
3812 mario79 1764
	call	draw_open_button_label
1765
 
1954 mario79 1766
	xor	eax,eax
1767
	mov	[file_browser_data_1.all_redraw],eax
1768
	ret
1769
;---------------------------------------------------------------------
1770
draw_scrollbar1:
1771
	mov	eax,[file_browser_data_1.start_draw_line]
1772
	mov	[scroll_bar_data_vertical.position],eax
1773
 
1774
	call	draw_scrollbar
1775
 
1776
	ret
1777
;---------------------------------------------------------------------
1778
draw_scrollbar:
1779
	mov	eax,[scroll_bar_data_vertical.max_area]
1780
	cmp	eax,[scroll_bar_data_vertical.cur_area]
1781
	jbe	@f
1782
	cmp	[scroll_bar_data_vertical.cur_area],0
1783
	je	@f
1784
	push	dword scroll_bar_data_vertical
1785
	call	[scrollbar_ver_draw]
1786
@@:
1787
	ret
1788
;---------------------------------------------------------------------
1789
get_scrollbar_data:
1790
	mov	eax,[scroll_bar_data_vertical.position]
1791
	mov	[file_browser_data_1.start_draw_line],eax
1792
	ret
1793
;---------------------------------------------------------------------
1794
prepare_scrollbar_data:
1795
	mov	eax,[file_browser_data_1.folder_block]
1796
	mov	[scroll_bar_data_vertical.max_area],eax
1797
	mov	eax,[file_browser_data_1.max_panel_line]
1798
	mov	[scroll_bar_data_vertical.cur_area],eax
1799
	ret
1800
;---------------------------------------------------------------------
1801
get_active_pocess:
1802
	mcall	9,procinfo,-1
1803
	mov	ecx,[ebx+30]	; PID
1804
	mcall	18,21
1805
	mov	[active_process],eax	; WINDOW SLOT
1806
	mov	ebx,[communication_area]
1807
	test	ebx,ebx
1808
	jz	.1
1809
	mov	[ebx+12],eax	; WINDOW SLOT to com. area
1810
.1:
1811
	ret
1812
;---------------------------------------------------------------------
1813
get_window_param:
1814
	mcall	9,procinfo,-1
1815
	mov	eax,[ebx+66]
1816
	inc	eax
1817
	mov	[window_high],eax
1818
	mov	eax,[ebx+62]
1819
	inc	eax
1820
	mov	[window_width],eax
1821
	mov	eax,[ebx+70]
1822
	mov	[window_status],eax
1823
	ret
1824
;---------------------------------------------------------------------
1825
convert_icons:
1826
	xor	eax,eax
1827
	mov	[return_code],eax
1828
;	mov	eax,image_file
1829
	push	image_file
1830
	call	[cnv_png_import.Start]
1831
 
1832
	mov	ecx,[image_file]
1833
	mcall	68,13,
1834
	test	eax,eax
1835
	jz	memory_free_error
1836
 
1837
	cmp	[return_code],dword 0
1838
	je	@f
1839
	mov	[N_error],6
1840
	jmp	button.exit
1841
@@:
1842
 
1843
	mov	ebx,[raw_pointer]
1844
	mov	eax,[ebx+4]
1845
; set of icon size x
1846
	mov	[file_browser_data_1.icon_size_x],ax
1847
; mov eax,[ebx+8]
1848
; set of icon size y
1849
	mov	[file_browser_data_1.icon_size_y],ax
1850
	inc	ax
1851
	mov	[file_browser_data_1.line_size_y],ax
1852
	mov	eax,[ebx+12]
1853
; set of RAW resolution to pixel
1854
	mov	[file_browser_data_1.resolution_raw],eax
1855
 
1856
	mov	eax,[ebx+20]
1857
	add	eax,ebx
1858
; set RAW palette,use else resolution 8bit or less
1859
	mov	[file_browser_data_1.palette_raw],eax
1860
 
1861
	mov	eax,[ebx+28]
1862
	add	eax,ebx
1863
; set RAW area for icon
1864
	mov	[file_browser_data_1.icon_raw_area],eax
1865
	ret
1866
;---------------------------------------------------------------------
1867
calc_ini:
1868
	mov	eax,[image_file]
1869
	mov	[file_browser_data_1.ini_file_start],eax
1870
	add	eax,[img_size]
1871
	mov	[file_browser_data_1.ini_file_end],eax
1872
	ret
1873
;---------------------------------------------------------------------
1874
load_ini:
1875
	mov	ebx,ini_file_name
1876
	mov	esi,path
1877
	mov	edi,file_name
1878
	call	copy_file_path
1879
 
1880
	mov	[fileinfo.subfunction],dword 5
1881
	mov	[fileinfo.size],dword 0
1882
	mov	[fileinfo.return],dword file_info
1883
	mcall	70,fileinfo
1884
	test	eax,eax
1885
	jnz	.error
1886
 
1887
	mov	[fileinfo.subfunction],dword 0
1888
 
1889
	mov	ecx,[file_info+32]
1890
	mov	[fileinfo.size],ecx
1891
	mov	[img_size],ecx
1892
 
1893
	mcall	68,12
1894
	test	eax,eax
1895
	jz	memory_get_error
1896
 
1897
	mov	[fileinfo.return],eax
1898
	mov	[image_file],eax
1899
 
1900
	mcall	70,fileinfo
1901
	test	eax,eax
1902
	jnz	.error
1903
	ret
1904
.error:
1905
	mov	[N_error],1
1906
	mov	[error_type],eax
1907
	jmp	button.exit
1908
;---------------------------------------------------------------------
1909
load_icons:
1910
	mov	ebx,icons_file_name_2
1911
	mov	esi,path
1912
	mov	edi,file_name
1913
	call	copy_file_path
1914
 
1915
	mov	[fileinfo.subfunction],dword 5
1916
	mov	[fileinfo.size],dword 0
1917
	mov	[fileinfo.return],dword file_info
1918
	mcall	70,fileinfo
1919
	test	eax,eax
1920
	jz	@f
1921
 
1922
	mov	ebx,icons_file_name
1923
	mov	esi,path
1924
	mov	edi,file_name
1925
	call	copy_file_path
1926
 
1927
	mov	[fileinfo.subfunction],dword 5
1928
	mov	[fileinfo.size],dword 0
1929
	mov	[fileinfo.return],dword file_info
1930
	mcall	70,fileinfo
1931
	test	eax,eax
1932
	jnz	.error
1933
@@:
1934
	mov	[fileinfo.subfunction],dword 0
1935
 
1936
	mov	ecx,[file_info+32]
1937
	mov	[fileinfo.size],ecx
1938
	mov	[img_size],ecx
1939
 
1940
	mcall	68,12
1941
	test	eax,eax
1942
	jz	memory_get_error
1943
 
1944
	mov	[fileinfo.return],eax
1945
	mov	[image_file],eax
1946
 
1947
	mcall	70,fileinfo
1948
	test	eax,eax
1949
	jnz	.error
1950
	ret
1951
.error:
1952
	mov	[N_error],2
1953
	mov	[error_type],eax
1954
	jmp	button.exit
1955
;---------------------------------------------------------------------
1956
sort_directory:
1957
	mov	eax,[file_browser_data_1.folder_data]
1958
	mov	ebx,[eax+4]	; number of files
1959
	add	eax,32
1960
	cmp	[eax+40],word '..'
1961
	jne	@f
1962
	cmp	[eax+40+2],byte 0
1963
	jne	@f
1964
	dec	ebx
1965
	add	eax,304
1966
@@:
1967
	push	dword [sort_type]	; sort mode
1968
	push	ebx	; number of files
1969
	push	eax	; data files
1970
	call	[sort_dir]
1971
	ret
1972
;--------------------------------------------------------------------
1973
load_directory:
1974
	xor	eax,eax
1975
	mov	[N_error],eax
1976
	cmp	[file_browser_data_1.folder_data],eax
1977
	je	@f
1978
	mcall	68,13,[file_browser_data_1.folder_data]
1979
	test	eax,eax
1980
	jz	memory_free_error
1981
 
1982
@@:
1983
	mov	[dirinfo.size],dword 0
1984
	mov	[dirinfo.return],dir_header
1985
	mcall	70,dirinfo
1986
	test	eax,eax
1987
	jz	@f
2144 mario79 1988
;	mov	esi,previous_dir_path
1989
;	mov	edi,dir_path
1990
;	call	copy_dir_name.1
1991
;	mcall	70,dirinfo
1992
;	test	eax,eax
1993
;	jz	@f
1954 mario79 1994
	xor	ebx,ebx
1995
	mov	[file_browser_data_1.folder_data],ebx
1996
	jmp	.error
1997
@@:
1998
 
1999
	mov	ecx,[dir_header.totl_blocks]
2000
	mov	[dirinfo.size],ecx
2001
	imul	ecx,304
2002
	add	ecx,32
2003
	mcall	68,12
2004
	test	eax,eax
2005
	jz	memory_get_error
2006
 
2007
	mov	[dirinfo.return],eax
2008
	mov	[file_browser_data_1.folder_data],eax
2009
 
2010
	mcall	70,dirinfo
2011
	test	eax,eax
2012
	jnz	.error
2013
 
2014
; test for empty directory
2015
	mov	eax,[dirinfo.return]
2016
	mov	eax,[eax+4]
2017
	test	eax,eax
2018
	jz	@f
2019
 
2020
	call	delete_point_dir
3730 mario79 2021
;	call	files_name_normalize
1954 mario79 2022
	call	check_filter
2023
	call	prepare_extension_and_mark
2024
	call	clear_data_fb_and_sb
2025
@@:
2026
	ret
2027
 
2028
.error:
2029
	mov	[N_error],5
2030
	mov	[error_type],eax
2031
	ret
2032
;---------------------------------------------------------------------
2033
clear_data_fb_and_sb:
2034
	xor	eax,eax
2035
	mov	[file_browser_data_1.start_draw_cursor_line],ax
2036
	mov	[file_browser_data_1.start_draw_line],eax
2037
	mov	[scroll_bar_data_vertical.position],eax
2038
	ret
2039
;---------------------------------------------------------------------
2040
check_filter:
2041
	cmp [open_dialog_type],2	; Select dir
2042
	je	.1
2043
	xor	eax,eax
2044
	mov	al,[filter_flag]
2045
	test	eax,eax
2046
	jz	@f
2047
 
2048
	mov	eax,[communication_area]
2049
	test	eax,eax
2050
	jz	@f
2051
	mov	eax,[eax+4096]
2052
	test	eax,eax
2053
	jz	@f
2054
.1:
2055
	call	delete_unsupported_BDFE
2056
@@:
2057
	ret
2058
;---------------------------------------------------------------------
2059
delete_unsupported_BDFE:
2060
	mov	ebx,[file_browser_data_1.folder_data]
2061
	add	ebx,4
2062
	xor	ecx,ecx
2063
	dec	ecx
2064
 
2065
	mov	eax,[file_browser_data_1.folder_data]
2066
	add	eax,32+40
2067
	sub	eax,304
2068
.start:
2069
	inc	ecx
2070
	add	eax,304
2071
.1:
2072
	cmp	[ebx],ecx
2073
	je	.end
2074
	cmp	[eax],byte '.'
2075
	jne	@f
2076
	cmp	[eax+1],byte 0
2077
	je	.delete
2078
@@:
2079
	test	[eax-40],byte 0x10
2080
	jnz	.start
2081
 
2082
	cmp	[open_dialog_type],2	; Select dir
2083
	je	.delete
2084
 
2085
	push	eax ebx
2086
	mov	esi,eax
2087
	call	search_expansion
2088
	test	eax,eax
2089
	pop	ebx eax
2090
	jnz	.delete
2091
 
2092
	push	eax ebx ecx esi
2093
	mov	edi,[communication_area]
2094
	add	edi,4100
2095
	call	compare_expansion
2096
	test	eax,eax
2097
	pop	esi ecx ebx eax
2098
	jz	.start
2099
 
2100
;-------------------------------------------
2101
.delete:
2102
	dec	dword [ebx]
2103
	mov	esi,[ebx]
2104
	sub	esi,ecx
2105
 
2106
	push	ecx
2107
	mov	ecx,esi
2108
	imul	ecx,304/4
2109
	mov	edi,eax
2110
	sub	edi,40
2111
	mov	esi,edi
2112
	add	esi,304
2113
	cld
2114
	rep	movsd
2115
	pop	ecx
2116
 
2117
	jmp	.1
2118
.end:
2119
	ret
2120
;---------------------------------------------------------------------
2121
search_expansion:
2122
	mov	edi,esi
2123
	xor	eax,eax
2124
@@:
2125
	cld
2126
	lodsb
2127
	test	eax,eax
2128
	jnz	@b
2129
	mov	ebx,esi
2130
	dec	esi
2131
@@:
2132
	std
2133
	lodsb
2134
	cmp	esi,edi
2135
	jb	.end_err
2136
	cmp	al,'.'
2137
	jne	@b
2138
 
2139
	add	esi,2
2140
	sub	ebx,esi
2141
	mov	[expansion_length],ebx
2142
	cld
2143
	xor	eax,eax
2144
	ret
2145
 
2146
.end_err:
2147
	cld
2148
	xor	eax,eax
2149
	inc	eax
2150
	ret
2151
;---------------------------------------------------------------------
2152
compare_expansion:
2153
	mov	ebx,[edi]
2154
	add	ebx,edi
2155
	add	edi,3
2156
.start:
2157
	cmp	ebx,edi
2158
	jb	.end_err
2159
	mov	ecx,[expansion_length]
2160
	inc	edi
2161
 
2162
	push	esi edi
2163
@@:
2164
	cld
2165
	lodsb
2166
	xchg	esi,edi
2167
	shl	eax,8
2168
	lodsb
2169
	xchg	esi,edi
2170
	call	char_todown
2171
	xchg	al,ah
2172
	call	char_todown
2173
	cmp	al,ah
2174
	jne	@f
2175
	dec	ecx
2176
	jnz	@b
2177
	jmp	.end
2178
@@:
2179
	pop	edi esi
2180
	jmp	.start
2181
.end:
2182
	pop	edi esi
2183
	xor	eax,eax
2184
	ret
2185
 
2186
.end_err:
2187
	xor	eax,eax
2188
	inc	eax
2189
	ret
2190
;---------------------------------------------------------------------
2191
prepare_extension_and_mark:
2192
	mov	esi,[dirinfo.return]
2193
	mov	ebp,[esi+4]
2194
	add	esi,32+40
2195
.start:
2196
	push	esi
2197
	call	search_extension_start
2198
	mov	eax,esi
2199
	pop	esi
2200
	sub	eax,esi
2201
	sub	ebx,esi
2202
	shl	eax,16
2203
	mov	ax,bx
2204
	mov	[esi+300-40],eax
2205
	mov	[esi+299-40],byte 0
2206
	add	esi,304
2207
	dec	ebp
2208
	jnz	.start
2209
	ret
2210
;---------------------------------------------------------------------
2211
search_extension_start:
2212
	mov	edx,esi
2213
	xor	eax,eax
2214
	cld
2215
@@:
2216
	lodsb
2217
	test	eax,eax
2218
	jnz	@b
2219
	dec	esi
2220
	dec	edx
2221
	push	esi
2222
	std
2223
@@:
2224
	lodsb
2225
	cmp	esi,edx
2226
	je	.end
2227
	cmp	al,'.'
2228
	jnz	@b
2229
	add	esi,2
2230
	cld
2231
	pop	ebx
2232
	ret
2233
.end:
2234
	cld
2235
	pop	esi
2236
	mov	ebx,esi
2237
	ret
2238
;---------------------------------------------------------------------
2239
delete_point_dir:
2240
	mov	eax,[dirinfo.return]
2241
	cmp	[eax+32+40],byte '.'
2242
	jne	@f
2243
	cmp	[eax+32+40+1],byte 0
2244
	jne	@f
2245
	mov	edi,eax
2246
	add	edi,32
2247
	mov	esi,edi
2248
	add	esi,304
2249
	mov	ecx,[eax+4]
2250
	dec	ecx
2251
	mov	[eax+4],ecx
2252
	imul	ecx,304
2253
	shr	ecx,2
2254
	cld
2255
	rep	movsd
2256
@@:
2257
	ret
2258
;---------------------------------------------------------------------
3730 mario79 2259
;files_name_normalize:
2260
;	mov	esi,[dirinfo.return]
2261
;	mov	ebp,[esi+4]
2262
;	add	esi,32+40
2263
;.start:
2264
;	push	esi
2265
;	mov	al,[esi]
2266
;	call	char_toupper
2267
;	mov	[esi],al
2268
;@@:
2269
;	inc	esi
2270
;	mov	al,[esi]
2271
;	test	al,al
2272
;	jz	@f
2273
;	call	char_todown
2274
;	mov	[esi],al
2275
;	jmp	@b
2276
;@@:
2277
;	pop	esi
2278
;	add	esi,304
2279
;	dec	ebp
2280
;	jnz	.start
2281
;	ret
1954 mario79 2282
;---------------------------------------------------------------------
2283
char_toupper:
2284
; convert character to uppercase,using cp866 encoding
2285
; in: al=symbol
2286
; out: al=converted symbol
2287
	cmp	al,'a'
2288
	jb	.ret
2289
	cmp	al,'z'
2290
	jbe	.az
2291
	cmp	al,' '
2292
	jb	.ret
2293
	cmp	al,'à'
2294
	jb	.rus1
2295
	cmp	al,'ï'
2296
	ja	.ret
2297
; 0xE0-0xEF -> 0x90-0x9F
2298
	sub	al,'à'-''
2299
.ret:
2300
	ret
2301
.rus1:
2302
; 0xA0-0xAF -> 0x80-0x8F
2303
.az:
2304
	and	al,not	0x20
2305
	ret
2306
;---------------------------------------------------------------------
2307
char_todown:
2308
; convert character to uppercase,using cp866 encoding
2309
; in: al=symbol
2310
; out: al=converted symbol
2311
	cmp	al,'A'
2312
	jb	.ret
2313
	cmp	al,'Z'
2314
	jbe	.az
2315
	cmp	al,'€'
2316
	jb	.ret
2317
	cmp	al,''
2318
	jb	.rus1
2319
	cmp	al,'Ÿ'
2320
	ja	.ret
2321
; 0x90-0x9F -> 0xE0-0xEF
2322
	add	al,'à'-''
2323
.ret:
2324
	ret
2325
.rus1:
2326
; 0x80-0x8F -> 0xA0-0xAF
2327
.az:
2328
	add	al,0x20
2329
	ret
2330
;---------------------------------------------------------------------
2331
copy_file_path:
2332
	xor	eax,eax
2333
	cld
2334
@@:
2335
	lodsb
2336
	stosb
2337
	test	eax,eax
2338
	jnz	@b
2339
	mov	esi,edi
2340
	dec	esi
2341
	std
2342
@@:
2343
	lodsb
2344
	cmp	al,'/'
2345
	jnz	@b
2346
	mov	edi,esi
2347
	add	edi,2
2348
	mov	esi,ebx
2349
	cld
2350
@@:
2351
	lodsb
2352
	stosb
2353
	test	eax,eax
2354
	jnz	@b
2355
	ret
2356
;---------------------------------------------------------------------
2357
copy_dir_path:
2358
	mov	ecx,esi
2359
	inc	ecx
2360
	inc	ecx
2361
	xor	eax,eax
2362
	cld
2363
@@:
2364
	lodsb
2365
	test	eax,eax
2366
	jnz	@b
2367
 
2368
	cmp	ecx,esi
2369
	jb	@f
2370
	dec	esi
2371
@@:
2372
	mov	[esi-1],byte '/'
2373
	mov	edi,esi
2374
	mov	esi,ebx
2375
@@:
2376
	lodsb
2377
	stosb
2378
	test	eax,eax
2379
	jnz	@b
2380
	ret
2381
;---------------------------------------------------------------------
2382
copy_exit_dir:
2383
	mov	ebx,esi
2384
	inc	ebx
2385
	xor	eax,eax
2386
	cld
2387
@@:
2388
	lodsb
2389
	test	eax,eax
2390
	jnz	@b
2391
	sub	esi,2
2392
	std
2393
@@:
2394
	lodsb
2395
	cmp	al,'/'
2396
	jnz	@b
2397
	xor	eax,eax
2398
	cmp	ebx,esi
2399
	jb	@f
2400
	inc	esi
2401
@@:
2402
	mov	[esi+1],al
2403
	cld
2404
	ret
2405
;---------------------------------------------------------------------
2406
copy_dir_name:
2144 mario79 2407
	push	esi edi
2408
	mov	esi,edi
2409
	mov	edi,previous_dir_path
2410
	call	.1
2411
	pop	edi esi
2412
.1:
1954 mario79 2413
	xor	eax,eax
2414
	cld
2415
@@:
2416
	lodsb
2417
	stosb
2418
	test	eax,eax
2419
	jnz	@b
2420
	ret
2421
;---------------------------------------------------------------------
2422
;---------------------------------------------------------------------
2423
 
2424
;plugins_directory	db 'plugins/',0
2425
plugins_directory	db 0
2426
 
2427
system_dir_Boxlib	db '/sys/lib/box_lib.obj',0
2428
system_dir_CnvPNG	db '/sys/lib/cnv_png.obj',0
2429
system_dir_Sort		db '/sys/lib/sort.obj',0
2430
system_dir_UNPACK	db '/sys/lib/archiver.obj',0
2431
 
2432
ihead_f_i:
2433
ihead_f_l	db 'System	error',0
2434
 
2435
er_message_found_lib	db 'box_lib.obj - Not found!',0
2436
er_message_import	db 'box_lib.obj - Wrong import!',0
2437
 
2438
er_message_found_lib2	db 'cnv_png.obj - Not found!',0
2439
er_message_import2	db 'cnv_png.obj - Wrong import!',0
2440
 
2441
err_message_found_lib3	db 'sort.obj - Not found!',0
2442
err_message_import3	db 'sort.obj - Wrong import!',0
2443
 
2444
err_message_found_lib4	db 'archiver.obj - Not found!',0
2445
err_message_import4	db 'archiver.obj - Wrong import!',0
2446
 
2447
align	4
2448
l_libs_start:
2449
library01	l_libs	system_dir_Boxlib+9,path,file_name,system_dir_Boxlib,\
2450
er_message_found_lib,ihead_f_l,Box_lib_import,er_message_import,ihead_f_i,plugins_directory
2451
 
2452
library02	l_libs	system_dir_CnvPNG+9,path,file_name,system_dir_CnvPNG,\
2453
er_message_found_lib2,ihead_f_l,cnv_png_import,er_message_import2,ihead_f_i,plugins_directory
2454
 
2455
library03	l_libs	system_dir_Sort+9,path,file_name,system_dir_Sort,\
2456
err_message_found_lib3,ihead_f_l,Sort_import,err_message_import3,ihead_f_i,plugins_directory
2457
 
2458
library04	l_libs	system_dir_UNPACK+9,path,file_name,system_dir_UNPACK,\
2459
err_message_found_lib4,ihead_f_l,UNPACK_import,err_message_import4,ihead_f_i,plugins_directory
2460
 
2461
end_l_libs:
2462
 
2463
;---------------------------------------------------------------------
2464
align	4
2465
UNPACK_import:
2466
;unpack_Version			dd aUnpack_Version
2467
;unpack_PluginLoad		dd aUnpack_PluginLoad
2468
;unpack_OpenFilePlugin		dd aUnpack_OpenFilePlugin
2469
;unpack_ClosePlugin		dd aUnpack_ClosePlugin
2470
;unpack_ReadFolder		dd aUnpack_ReadFolder
2471
;unpack_SetFolder		dd aUnpack_SetFolder
2472
;unpack_GetFiles		dd aUnpack_GetFiles
2473
;unpack_GetOpenPluginInfo	dd aUnpack_GetOpenPluginInfo
2474
;unpack_Getattr			dd aUnpack_Getattr
2475
;unpack_Open			dd aUnpack_Open
2476
;unpack_Read			dd aUnpack_Read
2477
;unpack_Setpos			dd aUnpack_Setpos
2478
;unpack_Close			dd aUnpack_Close
2479
;unpack_DeflateUnpack		dd aUnpack_DeflateUnpack
2480
unpack_DeflateUnpack2		dd aUnpack_DeflateUnpack2
2481
	dd 0
2482
	dd 0
2483
 
2484
;aUnpack_Version		db 'version',0
2485
;aUnpack_PluginLoad		db 'plugin_load',0
2486
;aUnpack_OpenFilePlugin		db 'OpenFilePlugin',0
2487
;aUnpack_ClosePlugin		db 'ClosePlugin',0
2488
;aUnpack_ReadFolder		db 'ReadFolder',0
2489
;aUnpack_SetFolder		db 'SetFolder',0
2490
;aUnpack_GetFiles		db 'GetFiles',0
2491
;aUnpack_GetOpenPluginInfo	db 'GetOpenPluginInfo',0
2492
;aUnpack_Getattr		db 'getattr',0
2493
;aUnpack_Open			db 'open',0
2494
;aUnpack_Read			db 'read',0
2495
;aUnpack_Setpos			db 'setpos',0
2496
;aUnpack_Close			db 'close',0
2497
;aUnpack_DeflateUnpack		db 'deflate_unpack',0
2498
aUnpack_DeflateUnpack2		db 'deflate_unpack2',0
2499
 
2500
;---------------------------------------------------------------------
2501
;---------------------------------------------------------------------
2502
align	4
2503
Sort_import:
2504
sort_init	dd aSort_init
2505
sort_version	dd aSort_version
2506
sort_dir	dd aSort_SortDir
2507
sort_strcmpi	dd aSort_strcmpi
2508
	dd 0
2509
	dd 0
2510
 
2511
aSort_init	db 'START',0
2512
aSort_version	db 'version',0
2513
aSort_SortDir	db 'SortDir',0
2514
aSort_strcmpi	db 'strcmpi',0
2515
 
2516
;---------------------------------------------------------------------
2517
align	4
2518
cnv_png_import:
2519
.Start		dd aCP_Start
2520
.Version	dd aCP_Version
2521
.Check		dd aCP_Check
2522
.Assoc		dd aCP_Assoc
2523
	dd 0
2524
	dd 0
2525
aCP_Start	db 'START',0
2526
aCP_Version	db 'version',0
2527
aCP_Check	db 'Check_Header',0
2528
aCP_Assoc	db 'Associations',0
2529
;---------------------------------------------------------------------
2530
align	4
2531
Box_lib_import:
2532
;init_lib	dd a_init
2533
;version_lib	dd a_version
2534
 
2535
 
2536
edit_box_draw		dd aEdit_box_draw
2537
edit_box_key		dd aEdit_box_key
2538
edit_box_mouse		dd aEdit_box_mouse
2539
;version_ed		dd aVersion_ed
2540
 
2541
;check_box_draw	dd aCheck_box_draw
2542
;check_box_mouse	dd aCheck_box_mouse
2543
;version_ch		dd aVersion_ch
2544
 
2545
;option_box_draw	dd aOption_box_draw
2546
;option_box_mouse	dd aOption_box_mouse
2547
;version_op		dd aVersion_op
2548
 
2549
scrollbar_ver_draw	dd aScrollbar_ver_draw
2550
scrollbar_ver_mouse	dd aScrollbar_ver_mouse
2551
;scrollbar_hor_draw	dd aScrollbar_hor_draw
2552
;scrollbar_hor_mouse	dd aScrollbar_hor_mouse
2553
;version_scrollbar	dd aVersion_scrollbar
2554
 
2555
;dinamic_button_draw	dd aDbutton_draw
2556
;dinamic_button_mouse	dd aDbutton_mouse
2557
;version_dbutton	dd aVersion_dbutton
2558
 
2559
menu_bar_draw		dd aMenu_bar_draw
2560
menu_bar_mouse		dd aMenu_bar_mouse
2561
menu_bar_activate	dd aMenu_bar_activate
2562
;version_menu_bar	dd aVersion_menu_bar
2563
 
2564
FileBrowser_draw	dd aFileBrowser_draw
2565
FileBrowser_mouse	dd aFileBrowser_mouse
2566
FileBrowser_key		dd aFileBrowser_key
2567
;Version_FileBrowser	dd aVersion_FileBrowser
2568
 
2569
PathShow_prepare	dd sz_PathShow_prepare
2570
PathShow_draw		dd sz_PathShow_draw
2571
;Version_path_show	dd szVersion_path_show
2572
	dd 0
2573
	dd 0
2574
 
2575
;a_init			db 'lib_init',0
2576
;a_version		db 'version',0
2577
 
2578
aEdit_box_draw		db 'edit_box',0
2579
aEdit_box_key		db 'edit_box_key',0
2580
aEdit_box_mouse		db 'edit_box_mouse',0
2581
;aVersion_ed		db 'version_ed',0
2582
 
2583
;aCheck_box_draw	db 'check_box_draw',0
2584
;aCheck_box_mouse	db 'check_box_mouse',0
2585
;aVersion_ch		db 'version_ch',0
2586
 
2587
;aOption_box_draw	db 'option_box_draw',0
2588
;aOption_box_mouse	db 'option_box_mouse',0
2589
;aVersion_op		db 'version_op',0
2590
 
2591
aScrollbar_ver_draw	db 'scrollbar_v_draw',0
2592
aScrollbar_ver_mouse	db 'scrollbar_v_mouse',0
2593
;aScrollbar_hor_draw	db 'scrollbar_h_draw',0
2594
;aScrollbar_hor_mouse	db 'scrollbar_h_mouse',0
2595
;aVersion_scrollbar	db 'version_scrollbar',0
2596
 
2597
;aDbutton_draw		db 'dbutton_draw',0
2598
;aDbutton_mouse		db 'dbutton_mouse',0
2599
;aVersion_dbutton	db 'version_dbutton',0
2600
 
2601
aMenu_bar_draw		db 'menu_bar_draw',0
2602
aMenu_bar_mouse		db 'menu_bar_mouse',0
2603
aMenu_bar_activate	db 'menu_bar_activate',0
2604
;aVersion_menu_bar	db 'version_menu_bar',0
2605
 
2606
aFileBrowser_draw	db 'FileBrowser_draw',0
2607
aFileBrowser_mouse	db 'FileBrowser_mouse',0
2608
aFileBrowser_key	db 'FileBrowser_key',0
2609
;aVersion_FileBrowser	db 'version_FileBrowser',0
2610
 
2611
sz_PathShow_prepare	db 'PathShow_prepare',0
2612
sz_PathShow_draw	db 'PathShow_draw',0
2613
;szVersion_path_show	db 'version_PathShow',0
2614
;---------------------------------------------------------------------
2615
;---------------------------------------------------------------------
2616
align	4
2617
window_high			dd 0
2618
window_width			dd 0
2619
window_status			dd 0
2620
 
2621
active_process			dd 0
2622
PID				dd 0
2623
sort_type			dd 2
2624
root_folder_area		dd 0
2625
root_folder_block		dd 0
2626
root1_folder_area		dd 0
2627
root1_folder_block		dd 0
2628
temp_counter_1			dd 0
2629
retrieved_devices_table_counter	dd 0
2630
communication_area		dd 0
2631
open_dialog_type		dd 0
2632
 
2633
open_dialog_title_pointer:
2634
	dd title_0
2635
	dd title_1
2636
	dd title_2
2637
	dd 0
2638
 
2639
message_open_dialog_button:
2640
	dd message_0
2641
	dd message_1
2642
	dd message_2
2643
	dd 0
2644
;---------------------------------------------------------------------
2645
expansion_length	dd 0
2646
;---------------------------------------------------------------------
2647
N_error			dd 0
2648
error_type		dd 0
2649
error_path		dd 0
2650
error_window_x:		dd 100 shl 16+250
2651
error_window_y:		dd 100 shl 16+120
2652
;---------------------------------------------------------------------
2653
mouse_scroll_data:
2654
.vertical	dw 0
2655
.horizontal	dw 0
2656
 
2657
mouse_position:
2658
.y	dw 0
2659
.x	dw 0
2660
;---------------------------------------------------------------------
2661
; not	change	this	section!!!
2662
; start	section
2663
;---------------------------------------------------------------------
2664
align	4
2665
image_file	dd 0
2666
raw_pointer	dd 0
2667
return_code	dd 0
2668
img_size	dd 0
2669
deflate_unpack	dd 0
2670
raw_pointer_2	dd 0	;+20
2671
;---------------------------------------------------------------------
2672
; end	section
2673
;---------------------------------------------------------------------
2674
align	4
2675
fileinfo:
2676
.subfunction	dd 5
2677
.Offset		dd 0
2678
.Offset_1	dd 0
2679
.size		dd 0
2680
.return		dd file_info
2681
		db 0
2682
.name:		dd file_name
2683
;---------------------------------------------------------------------
2684
align	4
2685
dirinfo:
2686
.subfunction	dd 1
2687
.start		dd 0
2688
.flags		dd 0
2689
.size		dd 0
2690
.return		dd 0
2691
		db 0
2144 mario79 2692
.name:		dd dir_path
1954 mario79 2693
;---------------------------------------------------------------------
2694
align	4
2695
dir_header:
2696
.version	dd 0	;+0
2697
.curn_blocks	dd 0	;+4
2698
.totl_blocks	dd 0	;+8
2699
.other	rb	20
2700
;---------------------------------------------------------------------
2701
load_ini_error_type:
2702
	db 'Error loading INI file',0
2703
 
2704
load_icons_error_type:
2705
	db 'Error loading of icons file',0
2706
 
2707
memory_free_error_type:
2708
	db 'Error of free memory',0
2709
 
2710
memory_get_error_type:
2711
	db 'Memory allocation error',0
2712
 
2713
load_directory_error_type:
2714
	db 'Error loading directory',0
2715
 
2716
convert_icons_error_type:
2717
	db 'Unsupported or corrupt data for icons file',0
2718
;---------------------------------------------------------------------
2719
align	4
2720
error_fs_text_pointers:
2721
	dd error_fs_text_0
2722
	dd error_fs_text_1
2723
	dd error_fs_text_2
2724
	dd error_fs_text_3
2725
	dd error_fs_text_4
2726
	dd error_fs_text_5
2727
	dd error_fs_text_6
2728
	dd error_fs_text_7
2729
	dd error_fs_text_8
2730
	dd error_fs_text_9
2731
	dd error_fs_text_10
2732
	dd error_fs_text_11
2733
 
2734
error_fs_text_0:	db '0 - Success full',0
2735
error_fs_text_1:	db '1 - Base and/or partition of a hard disk is not defined',0
2736
error_fs_text_2:	db '2 - Function is not supported for the given file system',0
2737
error_fs_text_3:	db '3 - Unknown file system',0
2738
error_fs_text_4:	db '4 - Reserved, is never returned in the current implementation',0
2739
error_fs_text_5:	db '5 - File not found',0
2740
error_fs_text_6:	db '6 - End of file, EOF',0
2741
error_fs_text_7:	db '7 - Pointer lies outside of application memory',0
2742
error_fs_text_8:	db '8 - Disk is full',0
2743
error_fs_text_9:	db '9 - FAT table is destroyed',0
2744
error_fs_text_10:	db '10 - Access denied',0
2745
error_fs_text_11:	db '11 - Device error',0
2746
;---------------------------------------------------------------------
2747
 
2748
extended_key	db 0
2749
 
2750
shift_flag	db 0
2751
ctrl_flag	db 0
2752
alt_flag	db 0
2753
 
2754
error_window	db 0
2755
 
2756
Tab_key		db 0
2757
Tab_key_block	db 0
2758
 
2759
filter_flag	db 1
2760
 
2761
focus_pointer	db 0
2762
;---------------------------------------------------------------------
2763
start_pach:
2764
	db '/rd/1',0
2765
 
2766
root_pach:
2767
	db '/',0
2768
 
2769
icons_file_name_2	db 'buttons/'
2770
icons_file_name		db 'z_icons.png',0
2771
ini_file_name		db 'icons.ini',0
2772
;---------------------------------------------------------------------
2773
 
2774
message:
2775
	db 'Press any key...',0
2776
 
2777
message_cancel_button:
2778
	db 'Cancel',0
2779
 
2780
message_ReloadDir_button:
2781
	db 'Refresh',0
2782
 
2783
message_ExitDir_button:
2784
	db '^',0
2785
 
2786
message_file_name:
2787
	db 'File name:',0
2788
 
2789
message_0:
3812 mario79 2790
	db ' Open ',0
1954 mario79 2791
message_1:
3812 mario79 2792
	db ' Save ',0
1954 mario79 2793
message_2:
2794
	db 'Select',0
2795
 
2796
title_0:
2797
	db 'Open Dialog',0
2798
title_1:
2799
	db 'Save Dialog',0
2800
title_2:
2801
	db 'Select Dir',0
2802
;---------------------------------------------------------------------
2803
align 4
2804
menu_data_1:
3734 mario79 2805
.type:		dd 1   ;+0
1954 mario79 2806
.x:
2807
.size_x 	dw 80  ;+4
2808
.start_x	dw 10	;+6
2809
.y:
2810
.size_y 	dw 15	;+8
2811
.start_y	dw 26  ;+10
2812
.text_pointer:	dd menu_text_area_1  ;0 ;+12
2813
.pos_pointer:	dd menu_text_area_1_1 ;0 ;+16
2814
.text_end	dd menu_text_area_1_1 ;0 ;+20
2815
.ret_key	dd 0  ;+24
2816
.mouse_keys	dd 0  ;+28
2817
.x1:
2818
.size_x1	dw 80  ;+32
2819
.start_x1	dw 10	;+34
2820
.y1:
2821
.size_y1	dw 100	 ;+36
2822
.start_y1	dw 41  ;+38
2823
.bckg_col	dd 0xffffff  ;0xe5e5e5 ;+40
2824
.frnt_col	dd 0xff ;+44
2825
.menu_col	dd 0xeef0ff ;0xffffff ;+48
2826
.select 	dd 0 ;+52
2827
.out_select	dd 0 ;+56
2828
.buf_adress	dd 0 ;+60
2829
.procinfo	dd procinfo ;+64
2830
.click		dd 0 ;+68
2831
.cursor 	dd 0 ;+72
2832
.cursor_old	dd 0 ;+76
2833
.interval	dd 16 ;+80
2834
.cursor_max	dd 0 ;+84
2835
.extended_key	dd 0 ;+88
2836
.menu_sel_col	dd 0x00cc00 ;+92
2837
.bckg_text_col	dd 0 ; +96
2838
.frnt_text_col	dd 0xffffff ;+100
2839
.mouse_keys_old dd 0 ;+104
2840
.font_height	dd 8 ;+108
2841
.cursor_out	dd 0 ;+112
2842
.get_mouse_flag dd 0 ;+116
2843
;---------------------------------------------------------------------
2844
menu_text_area_1:
2845
db 'Select Disk',0
2846
;---------------------------------------------------------------------
2847
align 4
2848
menu_data_2:
2849
.type:		dd 0   ;+0
2850
.x:
2851
.size_x 	dw 30  ;+4
2852
.start_x	dw 95	;+6
2853
.y:
2854
.size_y 	dw 15	;+8
2855
.start_y	dw 26  ;+10
2856
.text_pointer:	dd menu_text_area_2  ;0 ;+12
2857
.pos_pointer:	dd menu_text_area_2.1 ;0 ;+16
2858
.text_end	dd menu_text_area_2.end ;0 ;+20
2859
.ret_key	dd 0  ;+24
2860
.mouse_keys	dd 0  ;+28
2861
.x1:
2862
.size_x1	dw 30  ;+32
2863
.start_x1	dw 95	;+34
2864
.y1:
2865
.size_y1	dw 100	 ;+36
2866
.start_y1	dw 41  ;+38
2867
.bckg_col	dd 0xffffff ; 0xe5e5e5 ;+40
2868
.frnt_col	dd 0xff ;+44
2869
.menu_col	dd 0xeef0ff  ;0xffffff ;+48
2870
.select 	dd 0 ;+52
2871
.out_select	dd 0 ;+56
2872
.buf_adress	dd 0 ;+60
2873
.procinfo	dd procinfo ;+64
2874
.click		dd 0 ;+68
2875
.cursor 	dd 0 ;+72
2876
.cursor_old	dd 0 ;+76
2877
.interval	dd 16 ;+80
2878
.cursor_max	dd 0 ;+84
2879
.extended_key	dd 0 ;+88
2880
.menu_sel_col	dd 0x00cc00 ;+92
2881
.bckg_text_col	dd 0 ; +96
2882
.frnt_text_col	dd 0xffffff ;+100
2883
.mouse_keys_old dd 0 ;+104
2884
.font_height	dd 8 ;+108
2885
.cursor_out	dd 0 ;+112
2886
.get_mouse_flag dd 0 ;+116
2887
;---------------------------------------------------------------------
2888
menu_text_area_2:
2889
db 'Sort',0
2890
.1:
2891
db 'Name',0
2892
db 'Type',0
2893
db 'Date',0
2894
db 'Size',0
2895
.end:
2896
db 0
2897
;---------------------------------------------------------------------
2898
align 4
2899
menu_data_3:
2900
.type:		dd 0   ;+0
2901
.x:
2902
.size_x 	dw 45  ;+4
2903
.start_x	dw 130	 ;+6
2904
.y:
2905
.size_y 	dw 15	;+8
2906
.start_y	dw 26  ;+10
2907
.text_pointer:	dd menu_text_area_3  ;0 ;+12
2908
.pos_pointer:	dd menu_text_area_3.1 ;0 ;+16
2909
.text_end	dd menu_text_area_3.end ;0 ;+20
2910
.ret_key	dd 0  ;+24
2911
.mouse_keys	dd 0  ;+28
2912
.x1:
2913
.size_x1	dw 95  ;+32
2914
.start_x1	dw 130	 ;+34
2915
.y1:
2916
.size_y1	dw 100	 ;+36
2917
.start_y1	dw 41  ;+38
2918
.bckg_col	dd 0xffffff ; 0xe5e5e5 ;+40
2919
.frnt_col	dd 0xff ;+44
2920
.menu_col	dd 0xeef0ff  ;0xffffff ;+48
2921
.select 	dd 0 ;+52
2922
.out_select	dd 0 ;+56
2923
.buf_adress	dd 0 ;+60
2924
.procinfo	dd procinfo ;+64
2925
.click		dd 0 ;+68
2926
.cursor 	dd 0 ;+72
2927
.cursor_old	dd 0 ;+76
2928
.interval	dd 16 ;+80
2929
.cursor_max	dd 0 ;+84
2930
.extended_key	dd 0 ;+88
2931
.menu_sel_col	dd 0x00cc00 ;+92
2932
.bckg_text_col	dd 0 ; +96
2933
.frnt_text_col	dd 0xffffff ;+100
2934
.mouse_keys_old dd 0 ;+104
2935
.font_height	dd 8 ;+108
2936
.cursor_out	dd 0 ;+112
2937
.get_mouse_flag dd 0 ;+116
2938
;---------------------------------------------------------------------
2939
menu_text_area_3:
2940
db 'Filter',0
2941
.1:
2942
db '*.* - show all',0
2943
db 'Only supported',0
2944
.end:
2945
db 0
2946
;---------------------------------------------------------------------
2947
 
2948
align 4
2949
scroll_bar_data_vertical:
2950
.x:
2951
.size_x 	dw 15 ;+0
2952
.start_x	dw 500 ;+2
2953
.y:
2954
.size_y 	dw 300 ;+4
2955
.start_y	dw 45 ;+6
2956
.btn_high	dd 15 ;+8
2355 mario79 2957
.type		dd 2  ;+12
1954 mario79 2958
.max_area	dd 10  ;+16
2959
.cur_area	dd 2  ;+20
2960
.position	dd 0  ;+24
2961
.bckg_col	dd 0xeeeeee ;+28
2962
.frnt_col	dd 0xbbddff ;+32 ;0x8aeaa0
2963
.line_col	dd 0  ;+36
2964
.redraw 	dd 0  ;+40
2965
.delta		dw 0  ;+44
2966
.delta2 	dw 0  ;+46
2967
.run_x:
2968
.r_size_x	dw 0  ;+48
2969
.r_start_x	dw 0  ;+50
2970
.run_y:
2971
.r_size_y	dw 0 ;+52
2972
.r_start_y	dw 0 ;+54
2973
.m_pos		dd 0 ;+56
2974
.m_pos_2	dd 0 ;+60
2975
.m_keys 	dd 0 ;+64
2976
.run_size	dd 0 ;+68
2977
.position2	dd 0 ;+72
2978
.work_size	dd 0 ;+76
2979
.all_redraw	dd 0 ;+80
2980
.ar_offset	dd 1 ;+84
2981
;---------------------------------------------------------------------
2982
align 4
2983
file_browser_data_1:
2984
.type				dd 0 ;+0
2985
.x:
2986
.size_x 			dw 400 ;+4
2987
.start_x			dw 10 ;+6
2988
.y:
2989
.size_y 			dw 550 ;+8
2990
.start_y			dw 45 ;+10
2991
.icon_size_y			dw 16 ; +12
2992
.icon_size_x			dw 16 ; +14
2993
.line_size_x			dw 0 ; +16
2994
.line_size_y			dw 18 ; +18
2995
.type_size_x			dw 0 ; +20
2996
.size_size_x			dw 0 ; +22
2997
.date_size_x			dw 0 ; +24
2998
.attributes_size_x		dw 0 ; +26
2999
.icon_assoc_area		dd 0 ; +28
3000
.icon_raw_area			dd 0 ; +32
3001
.resolution_raw 		dd 0 ; +36
3002
.palette_raw			dd 0 ; +40
3003
.directory_path_area		dd 0 ; +44
3004
.file_name_area 		dd 0 ; +48
3005
.select_flag			dd 0 ; +52
3006
.background_color		dd 0xffffff ; +56
3007
.select_color			dd 0xbbddff ; +60
3008
.seclect_text_color		dd 0 ; +64
3009
.text_color			dd 0 ; +68
3010
.reduct_text_color		dd 0xff0000 ; +72
3011
.marked_text_color		dd 0 ; +76
3012
.max_panel_line 		dd 0 ; +80
3013
.select_panel_counter		dd 1 ; +84
3014
.folder_block			dd 0 ; +88
3015
.start_draw_line		dd 0 ; +92
3016
.start_draw_cursor_line 	dw 0 ; +96 ; pixels
3017
.folder_data			dd 0 ; +98
3018
.temp_counter			dd 0 ; +102
3019
.file_name_length		dd 0 ; +106
3020
.marked_file			dd 0 ; +110
3021
.extension_size 		dd 0 ; +114
3022
.extension_start		dd 0 ; +118
3023
.type_table			dd features_table ; +122
3024
.ini_file_start 		dd 0 ; +126
3025
.ini_file_end			dd 0 ; +130
3026
.draw_scroll_bar		dd 0 ; +134
3027
.font_size_y			dw 9 ; +138
3028
.font_size_x			dw 6 ; +140
3029
.mouse_keys			dd 0 ; +142
3030
.mouse_keys_old 		dd 0 ; +146
3031
.mouse_pos			dd 0 ; +150
3032
.mouse_keys_delta		dd 0 ; +154
3033
.mouse_key_delay		dd 50 ; +158
3034
.mouse_keys_tick		dd 0 ; +162
3035
.start_draw_cursor_line_2	dw 0 ;+166
3036
.all_redraw			dd 0 ;+168
3037
.selected_BDVK_adress		dd 0 ;+172
3038
.key_action			dd 0 ;+176
3039
.name_temp_area 		dd name_temp_area ;+180
3040
.max_name_temp_size		dd 0 ;+184
3041
.display_name_max_length	dd 0 ;+188
3042
.draw_panel_selection_flag	dd 0 ;+192
3043
.mouse_pos_old			dd 0 ;+196
3044
.marked_counter 		dd 0 ;+200
3045
;---------------------------------------------------------------------
3046
PathShow_data_1:
3047
.type			dd 0	;+0
3048
.start_y		dw 11	;+4
3049
.start_x		dw 10	;+6
3050
.font_size_x		dw 6	;+8	; 6 - for font 0, 8 - for font 1
3051
.area_size_x		dw 200	;+10
3052
.font_number		dd 0	;+12	; 0 - monospace, 1 - variable
3053
.background_flag	dd 0	;+16
3054
.font_color		dd 0x0	;+20
3055
.background_color	dd 0x0	;+24
2144 mario79 3056
.text_pointer		dd dir_path	;+28
1954 mario79 3057
.work_area_pointer	dd text_work_area	;+32
3058
.temp_text_length	dd 0	;+36
3059
;---------------------------------------------------------------------
3060
; for EDITBOX
3061
align	4
3062
name_editboxes:
3063
edit1	edit_box 200,10,7,0xffffff,0xbbddff,0,0,0,4095,user_selected_name,mouse_dd,,0
3064
name_editboxes_end:
3065
 
3066
;mouse_flag:	dd 0x0
3067
 
3068
mouse_dd rd	1
3069
;---------------------------------------------------------------------
3070
window_x:
3071
.x_size		dw 420
3072
.x_start	dw 10
3073
window_y:
3074
.y_size		dw 320
3075
.y_start	dw 10
3076
;---------------------------------------------------------------------
3077
features_table:
3078
.type_table:
3079
	db ' '
3080
;---------------------------------------------------------------------
3081
.size_table:
3082
	db '1023b '
3083
;---------------------------------------------------------------------
3084
.date_table:
3085
	db '00.00.00 00:00 '
3086
;---------------------------------------------------------------------
3087
.year_table:
3088
	db '    '
3089
;---------------------------------------------------------------------
3090
example_name_temp:
3091
	db 'temp1.asm',0
3092
;---------------------------------------------------------------------
3093
IM_END:
3808 mario79 3094
;---------------------------------------------------------------------
3812 mario79 3095
do_not_draw_open_button_label	rb 1
3096
;---------------------------------------------------------------------
3808 mario79 3097
align 4
3098
app_colours:
3099
 
3100
w_frame			rd 1
3101
w_grab			rd 1
3102
w_grab_button		rd 1
3103
w_grab_button_text	rd 1
3104
w_grab_text		rd 1
3105
w_work			rd 1
3106
w_work_button		rd 1
3107
w_work_button_text	rd 1
3108
w_work_text		rd 1
3109
w_work_graph		rd 1
3110
;---------------------------------------------------------------------
3812 mario79 3111
open_button_coordinates	rd 1
3112
;---------------------------------------------------------------------
1954 mario79 3113
menu_text_area_1_1:
3114
rb 256
3115
;---------------------------------------------------------------------
3116
	rb 1024
3117
stacktop:
3118
;---------------------------------------------------------------------
3119
; window error message
3120
	rb 1024
3121
thread_stack:
3122
;---------------------------------------------------------------------
3123
retrieved_devices_table:
3124
	rb 200
3125
;---------------------------------------------------------------------
3126
name_temp_area:
3127
	rb 256
3128
;---------------------------------------------------------------------
3129
user_selected_name:
3130
	rb 256
3131
;---------------------------------------------------------------------
3132
param:
3133
	rb 256
3134
;---------------------------------------------------------------------
3135
path:
3136
	rb 4096
3137
;---------------------------------------------------------------------
3138
file_name:
3139
	rb 4096
3140
;---------------------------------------------------------------------
2144 mario79 3141
previous_dir_path:
1954 mario79 3142
	rb 4096
3143
;---------------------------------------------------------------------
2144 mario79 3144
dir_path:
3145
	rb 4096
3146
;---------------------------------------------------------------------
3734 mario79 3147
dir_path_temp:
3148
	rb 4096
3149
;---------------------------------------------------------------------
1954 mario79 3150
text_work_area:
3151
	rb 1024
3152
;---------------------------------------------------------------------
3153
procinfo:
3154
process_info:
3155
	rb 1024
3156
;----------------------
3157
file_info:
3158
	rb 40
3159
I_END: