Subversion Repositories Kolibri OS

Rev

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