Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
3840 mario79 1
;------------------------------------------------------------------------------
1792 yogev_ezra 2
draw_buttons_panel:
3840 mario79 3
	mov	ecx,[skin_high]
4
	add	ecx,19
5
	shl	ecx,16
6
	mov	cx,18
7
	mov	ebx,[window_width]
8
	sub	ebx,9
9
	add	ebx,5 shl 16
10
	mcall	13,,,0xffffff
11
	mov	edx,15 shl 16+20
12
	add	edx,[skin_high]
13
	pusha
14
	call	.calculate_button
15
	mcall	,,,150
16
	popa
17
	mcall	7,[buttons_img_start],<16,16>
18
	add	edx,26 shl 16
19
	add	ebx,16*16*3
20
	pusha
21
	call	.calculate_button
22
	mcall	,,,151
23
	popa
24
	mcall
25
	add	edx,26 shl 16
26
	add	ebx,16*16*3
27
	pusha
28
	call	.calculate_button
29
	mcall	,,,152
30
	popa
31
	mcall
32
	add	edx,26 shl 16
33
	add	ebx,16*16*3
34
	pusha
35
	call	.calculate_button
36
	mcall	,,,153
37
	popa
38
	mcall
39
	add	edx,26 shl 16
40
	add	ebx,16*16*3
41
	pusha
42
	call	.calculate_button
43
	mcall	,,,154
44
	popa
45
	mcall
46
	add	edx,26 shl 16
47
	add	ebx,16*16*3
48
	pusha
49
	call	.calculate_button
50
	mcall	,,,155
51
	popa
52
	mcall
53
	add	edx,26 shl 16
54
	add	ebx,16*16*3
55
	pusha
56
	call	.calculate_button
57
	mcall	,,,156
58
	popa
59
	mcall
60
	add	edx,26 shl 16
61
	add	ebx,16*16*3
62
	pusha
63
	call	.calculate_button
64
	mcall	,,,157
65
	popa
66
	mcall
67
	ret
68
;--------------------------------------
1792 yogev_ezra 69
.calculate_button:
3840 mario79 70
	mov	esi,0xffffff
71
	mov	ebx,edx
72
	mov	bx,15
73
	mov	ecx,edx
74
	shl	ecx,16
75
	mov	cx,bx
76
	mov	eax,8
77
	ret
78
;------------------------------------------------------------------------------
1792 yogev_ezra 79
draw_left_sort_button:
3840 mario79 80
	mov	bx,[left_panel_x.start_x]
81
	add	bx,[left_panel_x.size_x]
82
	sub	ebx,50+15
83
	mov	cx,[left_panel_y.start_y]
84
	call	calclulate_sort_button_1
85
	mov	edx,145
86
;--------------------------------------
1792 yogev_ezra 87
.start:
3840 mario79 88
	mov	esi,0xffffff
89
	dec	ebp
90
	cmp	[left_sort_flag],ebp
91
	jne	@f
92
 
93
	mov	esi,0xccccff
94
;--------------------------------------
1792 yogev_ezra 95
@@:
3840 mario79 96
	call	calclulate_sort_button_2
97
	jnz	.start
98
 
99
	ret
100
;------------------------------------------------------------------------------
1792 yogev_ezra 101
calclulate_sort_button_1:
3840 mario79 102
	shl	ebx,16
103
	mov	bx,50
104
	sub	cx,14
105
	shl	ecx,16
106
	mov	cx,12
107
	mov	eax,8
108
	mov	ebp,4
109
	ret
110
;------------------------------------------------------------------------------
1792 yogev_ezra 111
calclulate_sort_button_2:
3840 mario79 112
	inc	ebp
113
	mcall
114
	pusha
115
	push	ebx
116
	mov	eax,ebx
117
	inc	eax
118
	shl	eax,16
119
	add	ebx,eax
120
	cmp	ebp,4
121
	jne	@f
122
 
123
	mov	bx,15
124
	jmp	.continue
125
;--------------------------------------
1792 yogev_ezra 126
@@:
3840 mario79 127
	mov	bx,1
128
;--------------------------------------
1792 yogev_ezra 129
.continue:
3840 mario79 130
	inc	ecx
131
	mcall	13,,,0xcccccc
132
	pop	ebx
133
	cmp	ebp,1
134
	jne	@f
135
 
136
	mov	eax,[temp_panel_end]
137
	shl	eax,16
138
	add	eax,[temp_panel_end]
139
	shr	eax,16
140
	shr	ebx,16
141
	sub	ebx,eax
142
	shl	ebx,16
143
	mov	bx,ax
144
	rol	ebx,16
145
	mcall	13
146
	mov	[temp_panel_end],ebx
147
;--------------------------------------
1792 yogev_ezra 148
@@:
3840 mario79 149
	popa
150
	pusha
151
	shr	ecx,16
152
	mov	bx,cx
153
	add	ebx,3 shl 16+2
154
	mov	edx,ebp
155
	dec	edx
156
	shl	edx,2
157
	add	edx,sort_button_name
158
	mov	eax,4
159
	mov	esi,eax
160
	mcall	,,0x10000000
161
	popa
162
	dec	edx
163
	sub	ebx,38 shl 16
164
	mov	bx,36
165
	dec	ebp
166
	ret
167
;------------------------------------------------------------------------------
1792 yogev_ezra 168
draw_right_sort_button:
3840 mario79 169
	mov	bx,[right_panel_x.start_x]
170
	add	bx,[right_panel_x.size_x]
171
	sub	ebx,50+15
172
	mov	cx,[right_panel_y.start_y]
173
	call	calclulate_sort_button_1
174
	mov	edx,149
175
;--------------------------------------
1792 yogev_ezra 176
.start:
3840 mario79 177
	mov	esi,0xffffff
178
	dec	ebp
179
	cmp	[right_sort_flag],ebp
180
	jne	@f
181
 
182
	mov	esi,0xccccff
183
;--------------------------------------
1792 yogev_ezra 184
@@:
3840 mario79 185
	call	calclulate_sort_button_2
186
	jnz	.start
187
 
188
	ret
189
;------------------------------------------------------------------------------
1792 yogev_ezra 190
draw_left_select_disk_button:
3840 mario79 191
	mov	bx,[left_panel_x.start_x]
192
	mov	cx,[left_panel_y.start_y]
193
	mov	ebp,read_folder_name	      ;read_folder.name
194
	mov	edx,0x40000000+140
195
;--------------------------------------
1792 yogev_ezra 196
.1:
3840 mario79 197
	shl	ebx,16
198
	mov	bx,60
199
	sub	cx,14
200
	shl	ecx,16
201
	mov	cx,13
202
	mcall	8,,,,0xffffff
203
	mcall	13,,,0xffffff
204
	pusha
205
	mov	esi,ebp
206
	add	esi,2
207
;--------------------------------------
1792 yogev_ezra 208
@@:
3840 mario79 209
	inc	esi
210
	cmp	[esi],byte 0
211
	je	@f
212
 
213
	cmp	[esi],byte '/'
214
	jne	@r
215
 
216
	add	esi,2
217
;--------------------------------------
1792 yogev_ezra 218
@@:
3840 mario79 219
	sub	esi,ebp  ;read_folder.name
220
	add	ebx,1 shl 16
221
	shr	ecx,16
222
	mov	bx,cx
223
	add	ebx,3
224
	mov	edx,ebp
225
	mcall	4,,0  ;,read_folder.name
226
	popa
227
	add	ebx,50 shl 16
228
	mov	bx,10
229
	mcall	,,,0x6060ff
230
	mov	[temp_panel_end],ebx
231
	add	ebx,1 shl 16
232
	shr	ecx,16
233
	mov	bx,cx
234
	add	ebx,3
235
	mcall	4, ,0x80ffffff,select_disk_char
236
	add	ebx,1 shl 16
237
	mcall
238
	ret
239
;------------------------------------------------------------------------------
1792 yogev_ezra 240
draw_right_select_disk_button:
3840 mario79 241
	mov	bx,[right_panel_x.start_x]
242
	mov	cx,[right_panel_y.start_y]
243
	mov	ebp,read_folder_1_name   ;read_folder_1.name
244
	mov	edx,0x40000000+141
245
	jmp	draw_left_select_disk_button.1
246
;------------------------------------------------------------------------------
1792 yogev_ezra 247
draw_device_button:
3840 mario79 248
	mov	edi,device_present
249
	mov	edx,120
250
	mov	bx,[left_panel_x.start_x]
251
	mov	cx,[left_panel_y.start_y]
252
	mov	eax,[left_panel_x]
253
	mov	[temp_panel_end],eax
254
	mov	[temp_counter],0
255
	call	.draw
256
	mov	edx,130
257
	mov	bx,[right_panel_x.start_x]
258
	mov	cx,[right_panel_y.start_y]
259
	mov	eax,[right_panel_x]
260
	mov	[temp_panel_end],eax
261
	mov	[temp_counter],1
262
;--------------------------------------
1792 yogev_ezra 263
.draw:
3840 mario79 264
	shl	ebx,16
265
	mov	bx,25
266
	sub	cx,30
267
	shl	ecx,16
268
	mov	cx,12
269
	mov	eax,8
270
	mov	esi,0xaa00
271
	cmp	[edi],byte 1
272
	jne	@f
273
 
274
	mov	ebp,read_folder_device_name.rd
275
	call	.draw_1
276
;--------------------------------------
1792 yogev_ezra 277
@@:
3840 mario79 278
	inc	edx
279
	cmp	[edi+1],byte 1
280
	jne	@f
281
 
282
	mov	ebp,read_folder_device_name.fd
283
	call	.draw_1
284
;--------------------------------------
1792 yogev_ezra 285
@@:
3840 mario79 286
	inc	edx
287
	cmp	[edi+2],byte 1
288
	jne	@f
289
 
290
	mov	ebp,read_folder_device_name.hd0
291
	call	.draw_1
292
;--------------------------------------
1792 yogev_ezra 293
@@:
3840 mario79 294
	inc	edx
295
	cmp	[edi+3],byte 1
296
	jne	@f
297
 
298
	mov	ebp,read_folder_device_name.hd1
299
	call	.draw_1
300
;--------------------------------------
1792 yogev_ezra 301
@@:
3840 mario79 302
	inc	edx
303
	cmp	[edi+4],byte 1
304
	jne	@f
305
 
306
	mov	ebp,read_folder_device_name.hd2
307
	call	.draw_1
308
;--------------------------------------
1792 yogev_ezra 309
@@:
3840 mario79 310
	inc	edx
311
	cmp	[edi+5],byte 1
312
	jne	@f
313
 
314
	mov	ebp,read_folder_device_name.hd3
315
	call	.draw_1
316
;--------------------------------------
1792 yogev_ezra 317
@@:
3840 mario79 318
	inc	edx
319
	cmp	[edi+6],byte 1
320
	jne	@f
321
 
322
	mov	ebp,read_folder_device_name.cd0
323
	call	.draw_1
324
;--------------------------------------
1792 yogev_ezra 325
@@:
3840 mario79 326
	inc	edx
327
	cmp	[edi+7],byte 1
328
	jne	@f
329
 
330
	mov	ebp,read_folder_device_name.cd1
331
	call	.draw_1
332
;--------------------------------------
1792 yogev_ezra 333
@@:
3840 mario79 334
	inc	edx
335
	cmp	[edi+8],byte 1
336
	jne	@f
337
 
338
	mov	ebp,read_folder_device_name.cd2
339
	call	.draw_1
340
;--------------------------------------
1792 yogev_ezra 341
@@:
3840 mario79 342
	inc	edx
343
	cmp	[edi+9],byte 1
344
	jne	@f
345
 
346
	mov	ebp,read_folder_device_name.cd3
347
	call	.draw_1
348
;--------------------------------------
1792 yogev_ezra 349
@@:
3840 mario79 350
	push	ebx
351
	mov	ebx,[temp_panel_end]
352
	mov	ax,bx
353
	shr	ebx,16
354
	add	eax,ebx
355
	pop	ebx
356
	ror	ebx,16
357
	sub	ax,bx
358
	rol	ebx,16
359
	mov	bx,ax
360
	add	ecx,1
361
	add	ebx,1
362
	mcall	13,,,0xcccccc
363
	cmp	[temp_counter],0
364
	je	@f
365
 
366
	mov	ax,bx
367
	shr	ebx,16
368
	add	bx,ax
369
	mov	eax,[window_width]
370
	sub	eax,4
371
	sub	ax,bx
372
	cmp	eax,0
373
	jbe	@f
374
 
375
	shl	ebx,16
376
	mov	bx,ax
377
	mov	ax,[right_panel_y.size_y]
378
	add	ax,[right_panel_y.start_y]
379
	shr	ecx,16
380
	sub	ax,cx
381
	shl	ecx,16
382
	mov	cx,ax
383
	mcall	13,,,0xcccccc
384
	ret
385
;--------------------------------------
1792 yogev_ezra 386
.draw_1:
3840 mario79 387
	mcall
388
	pusha
389
	mov	eax,ebx
390
	inc	eax
391
	shl	eax,16
392
	add	ebx,eax
393
	mov	bx,1
394
	inc	ecx
395
	mcall	13,,,0xcccccc
396
	popa
397
	pusha
398
	mov	edx,ebp
399
	shr	ecx,16
400
	mov	bx,cx
401
	add	ebx,2 shl 16 +3
402
	mcall	4,,0x90000000
403
	sub	ebx,1 shl 16 + 1
404
	mcall	,,0x90ffffff
405
	popa
406
	add	ebx,27 shl 16
407
;--------------------------------------
1792 yogev_ezra 408
@@:
3840 mario79 409
	ret
410
;------------------------------------------------------------------------------
1792 yogev_ezra 411
draw_ATAPI_tray_control:
3840 mario79 412
	ret
413
;------------------------------------------------------------------------------
1792 yogev_ezra 414
calc_max_panel_line:
3840 mario79 415
	xor	eax,eax
416
	mov	ax,[left_panel_y.size_y]
417
	mov	ebx,10
418
	xor	edx,edx
419
	div	ebx
420
	mov	[max_panel_line],eax
421
	ret
422
;------------------------------------------------------------------------------
1792 yogev_ezra 423
draw_icon:
3840 mario79 424
	pusha
425
	test	[edx-40],byte 0x10
426
	jnz	.draw_dir_pic
427
 
428
	call	get_icon_number
429
	imul	ebx,270
430
	add	ebx,mem
431
	jmp	.draw
432
;--------------------------------------
1792 yogev_ezra 433
.draw_dir_pic:
3840 mario79 434
	mov	ebx,mem
435
	cmp	[edx],word '..'
436
	jne	 .draw
437
 
438
	add	ebx,270   ;*17
439
;--------------------------------------
1792 yogev_ezra 440
.draw:
3840 mario79 441
	mov	edx,[esp+16]	;ebx
442
	ror	edx,16
443
	sub	edx,12
444
	rol	edx,16
445
	mcall	7, ,<10,9>
446
	popa
447
	ret
448
;------------------------------------------------------------------------------
1792 yogev_ezra 449
;       ПЕРЕВОД 10-НЫХ ЧИСЕЛ СО ЗНАКОМ В СТРОКОВЫЙ ВИД
450
;       Вход:
451
;               AX - число
452
;               EBX - адрес строки
453
;       Выход:
454
;               строка содержит число, конец отмечен кодом 0
3840 mario79 455
;------------------------------------------------------------------------------
1792 yogev_ezra 456
decimal_string_2:
3840 mario79 457
	push	eax ebx ecx edx
458
	xor	ecx,ecx
459
	mov	[ebx],byte '0'
460
	inc	ebx
461
;--------------------------------------
1792 yogev_ezra 462
.p3:
3840 mario79 463
	xor	edx,edx
464
	push	ebx
465
	mov	ebx,10
466
	div	ebx
467
	pop	ebx
468
	add	edx,48
469
	push	edx
470
	inc	ecx
471
	cmp	ax,0
472
	jne	.p3
473
 
474
	cmp	ecx,1
475
	jbe	.p4
476
 
477
	mov	ecx,2
478
	dec	ebx
479
;--------------------------------------
1792 yogev_ezra 480
.p4:
3840 mario79 481
	pop	edx
482
	mov	[ebx],dl
483
	inc	ebx
484
	loop	.p4
485
	pop	edx ecx ebx eax
1792 yogev_ezra 486
	ret
3840 mario79 487
;------------------------------------------------------------------------------
1792 yogev_ezra 488
decimal_string_4:
3840 mario79 489
	push	eax ecx edx
490
	xor	ecx,ecx
491
	mov	[ebx],byte '0'
492
	inc	ebx
493
;--------------------------------------
1792 yogev_ezra 494
.p3:
3840 mario79 495
	xor	edx,edx
496
	push	ebx
497
	mov	ebx,10
498
	div	ebx
499
	pop	ebx
500
	add	edx,48
501
	push	edx
502
	inc	ecx
503
	cmp	eax,0
504
	jne	.p3
505
 
506
	cmp	ecx,3
507
	jbe	.p4
508
 
509
	mov	ecx,4
510
	dec	ebx
511
;--------------------------------------
1792 yogev_ezra 512
.p4:
3840 mario79 513
	pop	edx
514
	mov	[ebx],dl
515
	inc	ebx
516
	loop	.p4
517
 
518
	pop	edx ecx eax
1792 yogev_ezra 519
	ret
3840 mario79 520
;------------------------------------------------------------------------------
1792 yogev_ezra 521
draw_type_size_date:
3840 mario79 522
	pusha
523
	test	[edx-40],byte 0x10
524
	jz	.copy_type
525
 
526
	mov	[type_table],dword '
527
	mov	[type_table+4],word '> '
528
	mov	[file_name_length],0
529
	mov	[extension_size],0
530
	jmp	.start  ;.size
531
;--------------------------------------
1792 yogev_ezra 532
.copy_type:
3840 mario79 533
	mov	[type_table],dword '    '
534
	mov	[type_table+4],word '  '
535
;--------------------------------------
1792 yogev_ezra 536
.start:
3840 mario79 537
	mov	esi,edx
538
	xor	eax,eax
539
;--------------------------------------
1792 yogev_ezra 540
@@:
3840 mario79 541
	cld
542
	lodsb
543
	test	eax,eax
544
	jnz	@b
545
 
546
	mov	[file_name_length],esi
547
	sub	[file_name_length],edx
548
	mov	[temp_counter_1],esi
549
	test	[edx-40],byte 0x10
550
	jnz	 .size
551
 
552
	dec	esi
553
	dec	edx
554
;--------------------------------------
1792 yogev_ezra 555
@@:
3840 mario79 556
	std
557
	lodsb
558
	cmp	esi,edx
559
	je	.extension_size_0
560
 
561
	cmp	al,'.'
562
	jnz	@b
563
 
564
	add	esi,2
565
	mov	[extension_start],esi
566
	mov	ecx,[temp_counter_1]
567
	sub	ecx,esi
568
	inc	ecx
569
	mov	[extension_size],ecx
570
	sub	[file_name_length],ecx
571
	cmp	ecx,2
572
	ja	@f
573
 
574
	inc	[file_name_length]
575
;--------------------------------------
1792 yogev_ezra 576
@@:
3840 mario79 577
	sub	ecx,2
578
	cmp	ecx,4
579
	jbe	@f
580
 
581
	mov	ecx,4
582
	mov	[type_table+4],word '..'
583
;--------------------------------------
1792 yogev_ezra 584
@@:
3840 mario79 585
	mov	edi,type_table  ;+1
586
	cld
587
	rep	movsb
588
	mov	[edi],byte ' '
589
	inc	edx
590
	jmp	.size
591
;--------------------------------------
1792 yogev_ezra 592
.extension_size_0:
3840 mario79 593
	inc	edx
594
	mov	[extension_size],0
595
;--------------------------------------
1792 yogev_ezra 596
.size:
3840 mario79 597
	test	[edx-40],byte 0x10
598
	jz	.copy_size
599
 
600
	mov	[size_table],dword '----'
601
	mov	[size_table+4],word '- '
602
	jmp	.date
603
;--------------------------------------
1792 yogev_ezra 604
.copy_size:
605
;/0x40000000 - Gb
606
;/0x100000 - Mb
607
;/0x400 Kb
3840 mario79 608
	mov	[size_table],dword '    '
609
	mov	[size_table+4],word '  '
610
	push	ebx
611
	push	edx
612
	mov	eax,[edx-40+32]
613
	mov	ebx,0x40000000
614
	xor	edx,edx
615
	div	ebx
616
	cmp	eax,0
617
	je	@f
618
 
619
	mov	ebx,size_table
620
	call	decimal_string_4
621
	mov	[ebx],byte 'G'
622
	jmp	.size_convert_end
623
;--------------------------------------
1792 yogev_ezra 624
@@:
3840 mario79 625
	mov	edx,[esp]
626
	mov	eax,[edx-40+32]
627
	mov	ebx,0x100000
628
	xor	edx,edx
629
	div	ebx
630
	cmp	eax,0
631
	je	@f
632
 
633
	mov	ebx,size_table
634
	call	decimal_string_4
635
	mov	[ebx],byte 'M'
636
	jmp	.size_convert_end
637
;--------------------------------------
1792 yogev_ezra 638
@@:
3840 mario79 639
	mov	edx,[esp]
640
	mov	eax,[edx-40+32]
641
	mov	ebx,0x400
642
	xor	edx,edx
643
	div	ebx
644
	cmp	eax,0
645
	je	@f
646
 
647
	mov	ebx,size_table
648
	call	decimal_string_4
649
	mov	[ebx],byte 'K'
650
	jmp	.size_convert_end
651
;--------------------------------------
1792 yogev_ezra 652
@@:
3840 mario79 653
	mov	edx,[esp]
654
	mov	eax,[edx-40+32]
1792 yogev_ezra 655
;.size_convert:
3840 mario79 656
	mov	ebx,size_table
657
	call	decimal_string_4
658
;--------------------------------------
1792 yogev_ezra 659
.size_convert_end:
3840 mario79 660
	cmp	[size_table],byte '0'
661
	jne	@f
662
 
663
	mov	[size_table],byte ' '
664
;--------------------------------------
1792 yogev_ezra 665
@@:
3840 mario79 666
	cmp	[size_table+4],byte ' '
667
	jne	@f
668
 
669
	mov	esi,size_table+3
670
	mov	edi,esi
671
	inc	edi
672
	mov	ecx,5
673
	std
674
	rep	movsb
675
	jmp	@r
676
;--------------------------------------
1792 yogev_ezra 677
@@:
3840 mario79 678
	pop	edx
679
	pop	ebx
680
;--------------------------------------
1792 yogev_ezra 681
.date:
3840 mario79 682
	xor	eax,eax
683
	mov	al,[edx-40+28]
684
	push	ebx
685
	mov	ebx,date_table
686
	call	decimal_string_2
687
	mov	al,[edx-40+29]
688
	mov	ebx,date_table+3
689
	call	decimal_string_2
690
	mov	ax,[edx-40+30]
691
	mov	ebx,year_table
692
	call	decimal_string_4
693
	mov	ax,[year_table+2]
694
	mov	[date_table+6],ax
695
	pop	ebx
696
	ror	ebx,16
697
	add	bx,[left_panel_x.size_x]
698
	sub	ebx,122+12+15
699
	rol	ebx,16
700
	mov	ecx,0
701
	cmp	[marked_file],byte 0
702
	je	@f
703
 
704
	mov	ecx,0xff0000
705
;--------------------------------------
1792 yogev_ezra 706
@@:
3840 mario79 707
	mcall	4,,,type_table,20
708
	popa
709
	ret
710
;------------------------------------------------------------------------------
1792 yogev_ezra 711
draw_folder_data:
3840 mario79 712
	cmp	[drawing_panel_folder],1
713
	jne	.right_panel
714
 
715
	mov	eax,[left_folder_block]
716
	sub	eax,[max_panel_line]
717
	test	eax,0x8000000
718
	jz	.ok_left
719
 
720
	mov	[left_start_draw_line],0
721
	jmp	@f
722
;--------------------------------------
1792 yogev_ezra 723
.ok_left:
3840 mario79 724
	cmp	eax,[left_start_draw_line]
725
	jae	@f
726
 
727
	mov	[left_start_draw_line],eax
728
;--------------------------------------
1792 yogev_ezra 729
@@:
3840 mario79 730
	mov	bx,[left_panel_x.start_x]
731
	add	bx,12
732
	shl	ebx,16
733
	mov	bx,[left_panel_y.start_y]
734
	inc	bx
735
	mov	edx,[left_start_draw_line]
736
	imul	edx,304
737
	add	edx,[left_folder_data]
738
	add	edx,32+40
739
	mov	[temp_counter],0
740
	jmp	.type_folder
741
;--------------------------------------
1792 yogev_ezra 742
.right_panel:
3840 mario79 743
	mov	eax,[right_folder_block]
744
	sub	eax,[max_panel_line]
745
	test	eax,0x8000000
746
	jz	.ok_right
747
 
748
	mov	[right_start_draw_line],0
749
	jmp	@f
750
;--------------------------------------
1792 yogev_ezra 751
.ok_right:
3840 mario79 752
	cmp	eax,[right_start_draw_line]
753
	jae	@f
754
 
755
	mov	[right_start_draw_line],eax
756
;--------------------------------------
1792 yogev_ezra 757
@@:
3840 mario79 758
	mov	bx,[right_panel_x.start_x]
759
	add	bx,12
760
	shl	ebx,16
761
	mov	bx,[right_panel_y.start_y]
762
	inc	bx
763
	mov	edx,[right_start_draw_line]
764
	imul	edx,304
765
	add	edx,[right_folder_data]
766
	add	edx,32+40
767
	mov	[temp_counter],1
768
;--------------------------------------
1792 yogev_ezra 769
.type_folder:
3840 mario79 770
	xor	eax,eax
771
;--------------------------------------
1792 yogev_ezra 772
.start:
3840 mario79 773
	pusha
774
	mov	eax,edx
775
	cmp	[temp_counter],1
776
	je	@f
777
 
778
	sub	eax,[left_folder_data]
779
	sub	eax,32+40
780
	xor	edx,edx
781
	mov	ebx,304
782
	div	ebx
783
	cmp	eax,[left_folder_block]
784
	je	.end_1
785
 
786
	jmp	.continue_1
787
;--------------------------------------
1792 yogev_ezra 788
@@:
3840 mario79 789
	sub	eax,[right_folder_data]
790
	sub	eax,32+40
791
	xor	edx,edx
792
	mov	ebx,304
793
	div	ebx
794
	cmp	eax,[right_folder_block]
795
	je	.end_1
796
;--------------------------------------
1792 yogev_ezra 797
.continue_1:
3840 mario79 798
	popa
799
	cmp	eax,[max_panel_line]	;  20
800
	je	.end_2
801
 
802
	mov	[marked_file],0
803
	cmp	[edx+299-40],byte 0
804
	je	@f
805
 
806
	mov	[marked_file],1
807
;--------------------------------------
1792 yogev_ezra 808
@@:
3840 mario79 809
	call	clear_line
810
	call	draw_type_size_date
811
	call	draw_icon
812
	push	eax
813
	xor	eax,eax
814
	mov	ax,[left_panel_x.size_x]
815
	push	ebx edx
816
	mov	ebx,6
817
	xor	edx,edx
818
	div	ebx
819
	pop	edx ebx
820
	sub	eax,23+2+2
821
	mov	esi,[file_name_length]
822
	mov	[temp_counter_1],0
823
	cmp	esi,eax
824
	jbe	@f
825
 
826
	mov	esi,eax
827
	mov	[temp_counter_1],1
828
;--------------------------------------
1792 yogev_ezra 829
@@:
3840 mario79 830
	mov	ecx,0
831
	cmp	[marked_file],byte 0
832
	je	@f
833
 
834
	mov	ecx,0xff0000
835
;--------------------------------------
1792 yogev_ezra 836
@@:
3840 mario79 837
	mcall	4
838
	cmp	[temp_counter_1],0
839
	je	.continue
840
 
841
	mov	eax,esi ;[file_name_length]
842
	imul	eax,6
843
	shl	eax,16
844
	push	ebx edx
845
	add	ebx,eax
846
	mcall	4,,0xff0000,truncated_filename_char,2
847
	add	ebx,1 shl 16
848
	mcall
849
	pop	edx ebx
850
;--------------------------------------
1792 yogev_ezra 851
.continue:
3840 mario79 852
	add	ebx,10
853
	add	edx,304 ;10
854
	pop	eax
855
	inc	eax
856
	jmp	.start
857
;--------------------------------------
1792 yogev_ezra 858
.end_1:
3840 mario79 859
	popa
860
;--------------------------------------
1792 yogev_ezra 861
.end_2:
3840 mario79 862
	mov	ax,[left_panel_y.start_y]
863
	add	ax,[left_panel_y.size_y]
864
	mov	cx,bx
865
	dec	cx
866
	rol	ecx,16
867
	mov	cx,ax
868
	mov	eax,ecx
869
	shr	eax,16
870
	sub	cx,ax
871
	cmp	cx,0
872
	jbe	@f
873
 
874
	mov	bx,[left_panel_x.size_x]
875
	sub	ebx,12 shl 16
876
	mcall	13,,,0xffffff
877
;--------------------------------------
1792 yogev_ezra 878
@@:
3840 mario79 879
.end:
880
	cmp	[drawing_panel_folder],1
881
	jne	@f
1792 yogev_ezra 882
 
3840 mario79 883
	call	draw_scroll_bar_left
884
	ret
885
;--------------------------------------
1792 yogev_ezra 886
@@:
3840 mario79 887
	call	draw_scroll_bar_right
888
	ret
889
;------------------------------------------------------------------------------
1792 yogev_ezra 890
clear_line:
3840 mario79 891
	cmp	[not_clear_lines],0
892
	jne	.end_1
893
 
894
	pusha
895
	shl	ebx,16
896
	shr	ebx,16
897
	dec	ebx
898
	cmp	[drawing_panel_folder],1
899
	jne	.right
900
 
901
	cmp	[select_panel_counter],0
902
	jne	.continue
903
 
904
	mov	ax,[left_start_draw_cursor_line]
905
	add	ax,[left_panel_y.start_y]
906
	cmp	bx,ax
907
	je	.end
908
 
909
	jmp	.continue
910
;--------------------------------------
1792 yogev_ezra 911
.right:
3840 mario79 912
	cmp	[select_panel_counter],0
913
	je	.continue
914
 
915
	mov	ax,[right_start_draw_cursor_line]
916
	add	ax,[right_panel_y.start_y]
917
	cmp	bx,ax
918
	je	.end
919
;--------------------------------------
1792 yogev_ezra 920
.continue:
3840 mario79 921
	mov	ebx,[esp+16]
922
	mov	cx,bx
923
	dec	cx
924
	rol	ecx,16
925
	mov	cx,10
926
	mov	bx,[left_panel_x.size_x]
927
	cmp	[drawing_panel_folder],1
928
	je	@f
929
 
930
	dec	ebx
931
;--------------------------------------
1792 yogev_ezra 932
@@:
3840 mario79 933
	sub	ebx,12 shl 16+15
934
	mcall	13,,,0xffffff
935
;--------------------------------------
1792 yogev_ezra 936
.end:
3840 mario79 937
	popa
938
;--------------------------------------
1792 yogev_ezra 939
.end_1:
3840 mario79 940
	ret
941
;------------------------------------------------------------------------------
1792 yogev_ezra 942
draw_left_panel:
3840 mario79 943
	call	clear_left_panel
944
	call	calc_max_panel_line
945
	call	draw_left_panel_selection
946
	mov	[drawing_panel_folder],1
947
	call	draw_folder_data
948
	call	draw_left_panel_patch
949
	ret
950
;------------------------------------------------------------------------------
1792 yogev_ezra 951
draw_right_panel:
3840 mario79 952
	call	clear_right_panel
953
	call	calc_max_panel_line
954
	call	draw_right_panel_selection
955
	mov	[drawing_panel_folder],2
956
	call	draw_folder_data
957
	call	draw_right_panel_patch
958
	ret
959
;------------------------------------------------------------------------------
1792 yogev_ezra 960
draw_left_panel_patch:
3840 mario79 961
	cmp	[select_panel_counter],0
962
	jne	.end
963
 
964
	mov	edx,read_folder_name	   ;read_folder.name
965
;--------------------------------------
1792 yogev_ezra 966
.1:
3840 mario79 967
	call	clear_patch_area
968
	mov	ebx,[window_high]
969
	sub	ebx,33
970
	add	ebx,8 shl 16
971
	mcall	4,,0x80000000  ; ,read_folder.name
972
;--------------------------------------
1792 yogev_ezra 973
.end:
3840 mario79 974
	ret
975
;------------------------------------------------------------------------------
1792 yogev_ezra 976
draw_right_panel_patch:
3840 mario79 977
	cmp	[select_panel_counter],1
978
	jne	draw_left_panel_patch.end
979
 
980
	mov	edx,read_folder_1_name    ;read_folder_1.name
981
	jmp	draw_left_panel_patch.1
982
;------------------------------------------------------------------------------
1792 yogev_ezra 983
clear_patch_area:
3840 mario79 984
	push	edx
985
	mov	ebx,[window_width]
986
	sub	ebx,9
987
	add	ebx,5 shl 16
988
	mov	ecx,[window_high]
989
	sub	ecx,35
990
	shl	ecx,16
991
	mov	cx,12
992
	mcall	13,,,0xffffcc
993
	pop	edx
994
	ret
995
;------------------------------------------------------------------------------
1792 yogev_ezra 996
draw_left_panel_selection:
3840 mario79 997
	cmp	[select_panel_counter],0
998
	jne	.end
999
 
1000
	mov	eax,[left_folder_block]
1001
	sub	eax,[left_start_draw_line]
1002
	mov	edx,left_start_draw_cursor_line
1003
	mov	cx,[edx]
1004
	call	for_all_panel_selection
1005
	mov	eax,[left_folder_block]
1006
	dec	eax
1007
	imul	eax,10
1008
	cmp	ax,cx
1009
	jae	 @f
1010
 
1011
	mov	cx,ax
1012
;--------------------------------------
1792 yogev_ezra 1013
@@:
3840 mario79 1014
	mov	[edx],cx
1015
	mov	ebx,[left_panel_x]
1016
	add	cx,[left_panel_y.start_y]
1017
;--------------------------------------
1792 yogev_ezra 1018
.1:
3840 mario79 1019
	shl	ecx,16
1020
	mov	cx,10
1021
	sub	ebx,15
1022
	mcall	13,,,0xbbddff
1023
;--------------------------------------
1792 yogev_ezra 1024
.end:
3840 mario79 1025
	ret
1026
;------------------------------------------------------------------------------
1792 yogev_ezra 1027
draw_right_panel_selection:
3840 mario79 1028
	cmp	[select_panel_counter],1
1029
	jne	draw_left_panel_selection.end
1030
 
1031
	mov	eax,[right_folder_block]
1032
	sub	eax,[right_start_draw_line]
1033
	mov	edx,right_start_draw_cursor_line
1034
	mov	cx,[edx]
1035
	call	for_all_panel_selection
1036
	mov	eax,[right_folder_block]
1037
	dec	eax
1038
	imul	eax,10
1039
	cmp	ax,cx
1040
	jae	 @f
1041
 
1042
	mov	cx,ax
1043
;--------------------------------------
1792 yogev_ezra 1044
@@:
3840 mario79 1045
	mov	[edx],cx
1046
	mov	ebx,[right_panel_x]
1047
	add	cx,[right_panel_y.start_y]
1048
	jmp	draw_left_panel_selection.1
1049
;------------------------------------------------------------------------------
1792 yogev_ezra 1050
for_all_panel_selection:
3840 mario79 1051
	imul	eax,10
1052
	cmp	ax,cx
1053
	jae	@f
1054
 
1055
	mov	cx,ax
1056
;--------------------------------------
1792 yogev_ezra 1057
@@:
3840 mario79 1058
	mov	eax,[max_panel_line]
1059
	dec	eax
1060
	imul	eax,10
1061
	cmp	ax,cx
1062
	jae	@f
1063
 
1064
	mov	cx,ax
1065
;--------------------------------------
1792 yogev_ezra 1066
@@:
3840 mario79 1067
	ret
1068
;------------------------------------------------------------------------------
1792 yogev_ezra 1069
clear_left_panel:
3840 mario79 1070
	mov	ebx,7 shl 16
1071
	add	ebx,[window_width]
1072
	shr	bx,1
1073
	sub	ebx,6+1
1074
	mov	[left_panel_x],ebx
1075
	call	calculate_panel_1
1076
	mov	[left_panel_y],ecx
1077
	xor	eax,eax
1078
	mov	ax,cx
1079
	xor	edx,edx
1080
	mov	ebx,10
1081
	div	ebx
1082
; умножение на 10
1083
	shl	eax,1      ; умножение на 2
1084
	lea	eax,[eax+eax*4] ; умножение на 5
1085
	mov	[left_panel_y_correct_size_y],ax
1086
	ret
1087
;------------------------------------------------------------------------------
1792 yogev_ezra 1088
calculate_panel_1:
3840 mario79 1089
	mov	ecx,[skin_high]
1090
	add	ecx,70
1091
	shl	ecx,16
1092
	add	ecx,[window_high]
1093
	sub	ecx,129
1094
	ret
1095
;------------------------------------------------------------------------------
1792 yogev_ezra 1096
clear_right_panel:
3840 mario79 1097
	mov	ebx,[window_width]
1098
	shr	ebx,1
1099
	add	ebx,3
1100
	shl	ebx,16
1101
	add	ebx,[window_width]
1102
	shr	bx,1
1103
	sub	bx,2+6
1104
	mov	[right_panel_x],ebx
1105
	call	calculate_panel_1
1106
	mov	[right_panel_y],ecx
1107
	xor	eax,eax
1108
	mov	ax,cx
1109
	xor	edx,edx
1110
	mov	ebx,10
1111
	div	ebx
1112
; умножение на 10
1113
	shl	eax,1      ; умножение на 2
1114
	lea	eax,[eax+eax*4] ; умножение на 5
1115
	mov	[right_panel_y_correct_size_y],ax
1116
	ret
1117
;------------------------------------------------------------------------------
1792 yogev_ezra 1118
erase_fbutton:
3840 mario79 1119
	mov	edx,0x80000065
1120
	mov	eax,8
1121
	mov	ebp,12
1122
;--------------------------------------
1792 yogev_ezra 1123
.start:
3840 mario79 1124
	mcall
1125
	dec	ebp
1126
	jnz	.start
1127
 
1128
	ret
1129
;------------------------------------------------------------------------------
1792 yogev_ezra 1130
draw_fbutton:
2584 mario79 1131
	test	[window_status],100b	; window is rolled up
1132
	jnz	.exit
1133
 
1134
	test	[window_status],10b	; window is minimized to panel
1135
	jnz	.exit
1136
 
3840 mario79 1137
	mov	ecx,[window_high]
1138
	sub	ecx,20
1139
	shl	ecx,16
1140
	add	ecx,15
1141
	mov	eax,[window_width]
1142
	mov	ebx,12
1143
	xor	edx,edx
1144
	div	ebx
1145
	mov	[fbutton_width],eax
1146
	mov	ebx,5 shl 16
1147
	add	ebx,eax
1148
	sub	ebx,2
1149
	mov	esi,0xaa00
1150
	mov	edx,101
1151
	mov	eax,8
1152
	mov	ebp,12
1153
;--------------------------------------
1792 yogev_ezra 1154
.start:
3840 mario79 1155
	cmp	ebp,1
1156
	jne	@f
1157
 
1158
	mov	eax,ebx
1159
	shr	eax,16
1160
	mov	bx,ax
1161
	mov	eax,[window_width]
1162
	sub	ax,bx
1163
	sub	ax,5
1164
	mov	bx,ax
1165
	mov	eax,8
1166
;--------------------------------------
1792 yogev_ezra 1167
@@:
3840 mario79 1168
	mcall
1169
	push	eax ebx edx
1170
	mov	edx,0x6060ff
1171
	mov	bx,10
1172
	cmp	ebp,4
1173
	jae	@f
1174
 
1175
	mov	bx,18
1176
;--------------------------------------
1792 yogev_ezra 1177
@@:
3840 mario79 1178
	mcall	13
1179
	cmp	ebp,1
1180
	je	@f
1181
 
1182
	ror	ebx,16
1183
	add	ebx,[fbutton_width]
1184
	dec	ebx
1185
	rol	ebx,16
1186
	mov	bx,1
1187
	inc	ecx
1188
	mcall	,,,0xcccccc
1189
	dec	ecx
1190
;--------------------------------------
1792 yogev_ezra 1191
@@:
3840 mario79 1192
	pop	edx ebx eax
1193
	call	.rol_ror
1194
	inc	edx
1195
	dec	ebp
1196
	jnz	.start
1197
 
1198
	call	draw_fbutton_name
1199
	ret
1200
;--------------------------------------
1792 yogev_ezra 1201
.rol_ror:
3840 mario79 1202
	rol	ebx,16
1203
	add	ebx,[fbutton_width]
1204
	ror	ebx,16
1205
;--------------------------------------
2584 mario79 1206
.exit:
3840 mario79 1207
	ret
1208
;------------------------------------------------------------------------------
1792 yogev_ezra 1209
draw_fbutton_name:
3840 mario79 1210
	mov	ebx, 7 shl 16
1211
	add	ebx,[window_high]
1212
	sub	ebx,15
1213
	mov	eax,4
1214
	mov	ecx,0x90000000
1215
	push	ebx
1216
	call	.type_1
1217
	pop	ebx
1218
	mov	ecx,0x90ffffff
1219
	sub	ebx,1 shl 16 + 1
1220
;--------------------------------------
1792 yogev_ezra 1221
.type_1:
3840 mario79 1222
	cmp	[shift_flag],1
1223
	je	.type_shift
1224
 
1225
	cmp	[ctrl_flag],1
1226
	je	.type_ctrl
1227
 
1228
	cmp	[alt_flag],1
1229
	je	.type_alt
1230
;--------------------------------------
1792 yogev_ezra 1231
.type:
3840 mario79 1232
	mov	edx,fbutton_name.f1
1233
	call	.type_all
1234
	mov	edx,fbutton_name.f2
1235
	call	.type_all
1236
	mov	edx,fbutton_name.f3
1237
	call	.type_all
1238
	mov	edx,fbutton_name.f4
1239
	call	.type_all
1240
	mov	edx,fbutton_name.f5
1241
	call	.type_all
1242
	mov	edx,fbutton_name.f6
1243
	call	.type_all
1244
	mov	edx,fbutton_name.f7
1245
	call	.type_all
1246
	mov	edx,fbutton_name.f8
1247
	call	.type_all
1248
	mov	edx,fbutton_name.f9
1249
	call	.type_all
1250
	mov	edx,fbutton_name.f10
1251
	call	.type_all
1252
	mov	edx,fbutton_name.f11
1253
	call	.type_all
1254
	mov	edx,fbutton_name.f12
1255
	mcall
1256
	ret
1257
;--------------------------------------
1792 yogev_ezra 1258
.type_shift:
3840 mario79 1259
	mov	edx,fbutton_name_shift.f1
1260
	call	.type_all
1261
	mov	edx,fbutton_name_shift.f2
1262
	call	.type_all
1263
	mov	edx,fbutton_name_shift.f3
1264
	call	.type_all
1265
	mov	edx,fbutton_name_shift.f4
1266
	call	.type_all
1267
	mov	edx,fbutton_name_shift.f5
1268
	call	.type_all
1269
	mov	edx,fbutton_name_shift.f6
1270
	call	.type_all
1271
	mov	edx,fbutton_name_shift.f7
1272
	call	.type_all
1273
	mov	edx,fbutton_name_shift.f8
1274
	call	.type_all
1275
	mov	edx,fbutton_name_shift.f9
1276
	call	.type_all
1277
	mov	edx,fbutton_name_shift.f10
1278
	call	.type_all
1279
	mov	edx,fbutton_name_shift.f11
1280
	call	.type_all
1281
	mov	edx,fbutton_name_shift.f12
1282
	mcall
1283
	ret
1284
;--------------------------------------
1792 yogev_ezra 1285
.type_ctrl:
3840 mario79 1286
	mov	edx,fbutton_name_ctrl.f1
1287
	call	.type_all
1288
	mov	edx,fbutton_name_ctrl.f2
1289
	call	.type_all
1290
	mov	edx,fbutton_name_ctrl.f3
1291
	call	.type_all
1292
	mov	edx,fbutton_name_ctrl.f4
1293
	call	.type_all
1294
	mov	edx,fbutton_name_ctrl.f5
1295
	call	.type_all
1296
	mov	edx,fbutton_name_ctrl.f6
1297
	call	.type_all
1298
	mov	edx,fbutton_name_ctrl.f7
1299
	call	.type_all
1300
	mov	edx,fbutton_name_ctrl.f8
1301
	call	.type_all
1302
	mov	edx,fbutton_name_ctrl.f9
1303
	call	.type_all
1304
	mov	edx,fbutton_name_ctrl.f10
1305
	call	.type_all
1306
	mov	edx,fbutton_name_ctrl.f11
1307
	call	.type_all
1308
	mov	edx,fbutton_name_ctrl.f12
1309
	mcall
1310
	ret
1311
;--------------------------------------
1792 yogev_ezra 1312
.type_alt:
3840 mario79 1313
	mov	edx,fbutton_name_alt.f1
1314
	call	.type_all
1315
	mov	edx,fbutton_name_alt.f2
1316
	call	.type_all
1317
	mov	edx,fbutton_name_alt.f3
1318
	call	.type_all
1319
	mov	edx,fbutton_name_alt.f4
1320
	call	.type_all
1321
	mov	edx,fbutton_name_alt.f5
1322
	call	.type_all
1323
	mov	edx,fbutton_name_alt.f6
1324
	call	.type_all
1325
	mov	edx,fbutton_name_alt.f7
1326
	call	.type_all
1327
	mov	edx,fbutton_name_alt.f8
1328
	call	.type_all
1329
	mov	edx,fbutton_name_alt.f9
1330
	call	.type_all
1331
	mov	edx,fbutton_name_alt.f10
1332
	call	.type_all
1333
	mov	edx,fbutton_name_alt.f11
1334
	call	.type_all
1335
	mov	edx,fbutton_name_alt.f12
1336
;--------------------------------------
1792 yogev_ezra 1337
.type_all:
3840 mario79 1338
	mcall
1339
	call	draw_fbutton.rol_ror
1340
	ret
1341
;------------------------------------------------------------------------------