Subversion Repositories Kolibri OS

Rev

Rev 3840 | Rev 5684 | 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
;------------------------------------------------------------------------------
4631 mario79 247
;draw_ATAPI_tray_control:
248
;	ret
3840 mario79 249
;------------------------------------------------------------------------------
1792 yogev_ezra 250
calc_max_panel_line:
3840 mario79 251
	xor	eax,eax
252
	mov	ax,[left_panel_y.size_y]
253
	mov	ebx,10
254
	xor	edx,edx
255
	div	ebx
256
	mov	[max_panel_line],eax
257
	ret
258
;------------------------------------------------------------------------------
1792 yogev_ezra 259
draw_icon:
3840 mario79 260
	pusha
261
	test	[edx-40],byte 0x10
262
	jnz	.draw_dir_pic
263
 
264
	call	get_icon_number
265
	imul	ebx,270
266
	add	ebx,mem
267
	jmp	.draw
268
;--------------------------------------
1792 yogev_ezra 269
.draw_dir_pic:
3840 mario79 270
	mov	ebx,mem
271
	cmp	[edx],word '..'
272
	jne	 .draw
273
 
274
	add	ebx,270   ;*17
275
;--------------------------------------
1792 yogev_ezra 276
.draw:
3840 mario79 277
	mov	edx,[esp+16]	;ebx
278
	ror	edx,16
279
	sub	edx,12
280
	rol	edx,16
281
	mcall	7, ,<10,9>
282
	popa
283
	ret
284
;------------------------------------------------------------------------------
1792 yogev_ezra 285
;       ПЕРЕВОД 10-НЫХ ЧИСЕЛ СО ЗНАКОМ В СТРОКОВЫЙ ВИД
286
;       Вход:
287
;               AX - число
288
;               EBX - адрес строки
289
;       Выход:
290
;               строка содержит число, конец отмечен кодом 0
3840 mario79 291
;------------------------------------------------------------------------------
1792 yogev_ezra 292
decimal_string_2:
3840 mario79 293
	push	eax ebx ecx edx
294
	xor	ecx,ecx
295
	mov	[ebx],byte '0'
296
	inc	ebx
297
;--------------------------------------
1792 yogev_ezra 298
.p3:
3840 mario79 299
	xor	edx,edx
300
	push	ebx
301
	mov	ebx,10
302
	div	ebx
303
	pop	ebx
304
	add	edx,48
305
	push	edx
306
	inc	ecx
307
	cmp	ax,0
308
	jne	.p3
309
 
310
	cmp	ecx,1
311
	jbe	.p4
312
 
313
	mov	ecx,2
314
	dec	ebx
315
;--------------------------------------
1792 yogev_ezra 316
.p4:
3840 mario79 317
	pop	edx
318
	mov	[ebx],dl
319
	inc	ebx
320
	loop	.p4
321
	pop	edx ecx ebx eax
1792 yogev_ezra 322
	ret
3840 mario79 323
;------------------------------------------------------------------------------
1792 yogev_ezra 324
decimal_string_4:
3840 mario79 325
	push	eax ecx edx
326
	xor	ecx,ecx
327
	mov	[ebx],byte '0'
328
	inc	ebx
329
;--------------------------------------
1792 yogev_ezra 330
.p3:
3840 mario79 331
	xor	edx,edx
332
	push	ebx
333
	mov	ebx,10
334
	div	ebx
335
	pop	ebx
336
	add	edx,48
337
	push	edx
338
	inc	ecx
339
	cmp	eax,0
340
	jne	.p3
341
 
342
	cmp	ecx,3
343
	jbe	.p4
344
 
345
	mov	ecx,4
346
	dec	ebx
347
;--------------------------------------
1792 yogev_ezra 348
.p4:
3840 mario79 349
	pop	edx
350
	mov	[ebx],dl
351
	inc	ebx
352
	loop	.p4
353
 
354
	pop	edx ecx eax
1792 yogev_ezra 355
	ret
3840 mario79 356
;------------------------------------------------------------------------------
1792 yogev_ezra 357
draw_type_size_date:
3840 mario79 358
	pusha
359
	test	[edx-40],byte 0x10
360
	jz	.copy_type
361
 
362
	mov	[type_table],dword '
363
	mov	[type_table+4],word '> '
364
	mov	[file_name_length],0
365
	mov	[extension_size],0
366
	jmp	.start  ;.size
367
;--------------------------------------
1792 yogev_ezra 368
.copy_type:
3840 mario79 369
	mov	[type_table],dword '    '
370
	mov	[type_table+4],word '  '
371
;--------------------------------------
1792 yogev_ezra 372
.start:
3840 mario79 373
	mov	esi,edx
374
	xor	eax,eax
375
;--------------------------------------
1792 yogev_ezra 376
@@:
3840 mario79 377
	cld
378
	lodsb
379
	test	eax,eax
380
	jnz	@b
381
 
382
	mov	[file_name_length],esi
383
	sub	[file_name_length],edx
384
	mov	[temp_counter_1],esi
385
	test	[edx-40],byte 0x10
386
	jnz	 .size
387
 
388
	dec	esi
389
	dec	edx
390
;--------------------------------------
1792 yogev_ezra 391
@@:
3840 mario79 392
	std
393
	lodsb
394
	cmp	esi,edx
395
	je	.extension_size_0
396
 
397
	cmp	al,'.'
398
	jnz	@b
399
 
400
	add	esi,2
401
	mov	[extension_start],esi
402
	mov	ecx,[temp_counter_1]
403
	sub	ecx,esi
404
	inc	ecx
405
	mov	[extension_size],ecx
406
	sub	[file_name_length],ecx
407
	cmp	ecx,2
408
	ja	@f
409
 
410
	inc	[file_name_length]
411
;--------------------------------------
1792 yogev_ezra 412
@@:
3840 mario79 413
	sub	ecx,2
414
	cmp	ecx,4
415
	jbe	@f
416
 
417
	mov	ecx,4
418
	mov	[type_table+4],word '..'
419
;--------------------------------------
1792 yogev_ezra 420
@@:
3840 mario79 421
	mov	edi,type_table  ;+1
422
	cld
423
	rep	movsb
424
	mov	[edi],byte ' '
425
	inc	edx
426
	jmp	.size
427
;--------------------------------------
1792 yogev_ezra 428
.extension_size_0:
3840 mario79 429
	inc	edx
430
	mov	[extension_size],0
431
;--------------------------------------
1792 yogev_ezra 432
.size:
3840 mario79 433
	test	[edx-40],byte 0x10
434
	jz	.copy_size
435
 
436
	mov	[size_table],dword '----'
437
	mov	[size_table+4],word '- '
438
	jmp	.date
439
;--------------------------------------
1792 yogev_ezra 440
.copy_size:
441
;/0x40000000 - Gb
442
;/0x100000 - Mb
443
;/0x400 Kb
3840 mario79 444
	mov	[size_table],dword '    '
445
	mov	[size_table+4],word '  '
446
	push	ebx
447
	push	edx
448
	mov	eax,[edx-40+32]
449
	mov	ebx,0x40000000
450
	xor	edx,edx
451
	div	ebx
452
	cmp	eax,0
453
	je	@f
454
 
455
	mov	ebx,size_table
456
	call	decimal_string_4
457
	mov	[ebx],byte 'G'
458
	jmp	.size_convert_end
459
;--------------------------------------
1792 yogev_ezra 460
@@:
3840 mario79 461
	mov	edx,[esp]
462
	mov	eax,[edx-40+32]
463
	mov	ebx,0x100000
464
	xor	edx,edx
465
	div	ebx
466
	cmp	eax,0
467
	je	@f
468
 
469
	mov	ebx,size_table
470
	call	decimal_string_4
471
	mov	[ebx],byte 'M'
472
	jmp	.size_convert_end
473
;--------------------------------------
1792 yogev_ezra 474
@@:
3840 mario79 475
	mov	edx,[esp]
476
	mov	eax,[edx-40+32]
477
	mov	ebx,0x400
478
	xor	edx,edx
479
	div	ebx
480
	cmp	eax,0
481
	je	@f
482
 
483
	mov	ebx,size_table
484
	call	decimal_string_4
485
	mov	[ebx],byte 'K'
486
	jmp	.size_convert_end
487
;--------------------------------------
1792 yogev_ezra 488
@@:
3840 mario79 489
	mov	edx,[esp]
490
	mov	eax,[edx-40+32]
1792 yogev_ezra 491
;.size_convert:
3840 mario79 492
	mov	ebx,size_table
493
	call	decimal_string_4
494
;--------------------------------------
1792 yogev_ezra 495
.size_convert_end:
3840 mario79 496
	cmp	[size_table],byte '0'
497
	jne	@f
498
 
499
	mov	[size_table],byte ' '
500
;--------------------------------------
1792 yogev_ezra 501
@@:
3840 mario79 502
	cmp	[size_table+4],byte ' '
503
	jne	@f
504
 
505
	mov	esi,size_table+3
506
	mov	edi,esi
507
	inc	edi
508
	mov	ecx,5
509
	std
510
	rep	movsb
511
	jmp	@r
512
;--------------------------------------
1792 yogev_ezra 513
@@:
3840 mario79 514
	pop	edx
515
	pop	ebx
516
;--------------------------------------
1792 yogev_ezra 517
.date:
3840 mario79 518
	xor	eax,eax
519
	mov	al,[edx-40+28]
520
	push	ebx
521
	mov	ebx,date_table
522
	call	decimal_string_2
523
	mov	al,[edx-40+29]
524
	mov	ebx,date_table+3
525
	call	decimal_string_2
526
	mov	ax,[edx-40+30]
527
	mov	ebx,year_table
528
	call	decimal_string_4
529
	mov	ax,[year_table+2]
530
	mov	[date_table+6],ax
531
	pop	ebx
532
	ror	ebx,16
533
	add	bx,[left_panel_x.size_x]
534
	sub	ebx,122+12+15
535
	rol	ebx,16
536
	mov	ecx,0
537
	cmp	[marked_file],byte 0
538
	je	@f
539
 
540
	mov	ecx,0xff0000
541
;--------------------------------------
1792 yogev_ezra 542
@@:
3840 mario79 543
	mcall	4,,,type_table,20
544
	popa
545
	ret
546
;------------------------------------------------------------------------------
1792 yogev_ezra 547
draw_folder_data:
3840 mario79 548
	cmp	[drawing_panel_folder],1
549
	jne	.right_panel
550
 
551
	mov	eax,[left_folder_block]
552
	sub	eax,[max_panel_line]
553
	test	eax,0x8000000
554
	jz	.ok_left
555
 
556
	mov	[left_start_draw_line],0
557
	jmp	@f
558
;--------------------------------------
1792 yogev_ezra 559
.ok_left:
3840 mario79 560
	cmp	eax,[left_start_draw_line]
561
	jae	@f
562
 
563
	mov	[left_start_draw_line],eax
564
;--------------------------------------
1792 yogev_ezra 565
@@:
3840 mario79 566
	mov	bx,[left_panel_x.start_x]
567
	add	bx,12
568
	shl	ebx,16
569
	mov	bx,[left_panel_y.start_y]
570
	inc	bx
571
	mov	edx,[left_start_draw_line]
572
	imul	edx,304
573
	add	edx,[left_folder_data]
574
	add	edx,32+40
575
	mov	[temp_counter],0
576
	jmp	.type_folder
577
;--------------------------------------
1792 yogev_ezra 578
.right_panel:
3840 mario79 579
	mov	eax,[right_folder_block]
580
	sub	eax,[max_panel_line]
581
	test	eax,0x8000000
582
	jz	.ok_right
583
 
584
	mov	[right_start_draw_line],0
585
	jmp	@f
586
;--------------------------------------
1792 yogev_ezra 587
.ok_right:
3840 mario79 588
	cmp	eax,[right_start_draw_line]
589
	jae	@f
590
 
591
	mov	[right_start_draw_line],eax
592
;--------------------------------------
1792 yogev_ezra 593
@@:
3840 mario79 594
	mov	bx,[right_panel_x.start_x]
595
	add	bx,12
596
	shl	ebx,16
597
	mov	bx,[right_panel_y.start_y]
598
	inc	bx
599
	mov	edx,[right_start_draw_line]
600
	imul	edx,304
601
	add	edx,[right_folder_data]
602
	add	edx,32+40
603
	mov	[temp_counter],1
604
;--------------------------------------
1792 yogev_ezra 605
.type_folder:
3840 mario79 606
	xor	eax,eax
607
;--------------------------------------
1792 yogev_ezra 608
.start:
3840 mario79 609
	pusha
610
	mov	eax,edx
611
	cmp	[temp_counter],1
612
	je	@f
613
 
614
	sub	eax,[left_folder_data]
615
	sub	eax,32+40
616
	xor	edx,edx
617
	mov	ebx,304
618
	div	ebx
619
	cmp	eax,[left_folder_block]
620
	je	.end_1
621
 
622
	jmp	.continue_1
623
;--------------------------------------
1792 yogev_ezra 624
@@:
3840 mario79 625
	sub	eax,[right_folder_data]
626
	sub	eax,32+40
627
	xor	edx,edx
628
	mov	ebx,304
629
	div	ebx
630
	cmp	eax,[right_folder_block]
631
	je	.end_1
632
;--------------------------------------
1792 yogev_ezra 633
.continue_1:
3840 mario79 634
	popa
635
	cmp	eax,[max_panel_line]	;  20
636
	je	.end_2
637
 
638
	mov	[marked_file],0
639
	cmp	[edx+299-40],byte 0
640
	je	@f
641
 
642
	mov	[marked_file],1
643
;--------------------------------------
1792 yogev_ezra 644
@@:
3840 mario79 645
	call	clear_line
646
	call	draw_type_size_date
647
	call	draw_icon
648
	push	eax
649
	xor	eax,eax
650
	mov	ax,[left_panel_x.size_x]
651
	push	ebx edx
652
	mov	ebx,6
653
	xor	edx,edx
654
	div	ebx
655
	pop	edx ebx
656
	sub	eax,23+2+2
657
	mov	esi,[file_name_length]
658
	mov	[temp_counter_1],0
659
	cmp	esi,eax
660
	jbe	@f
661
 
662
	mov	esi,eax
663
	mov	[temp_counter_1],1
664
;--------------------------------------
1792 yogev_ezra 665
@@:
3840 mario79 666
	mov	ecx,0
667
	cmp	[marked_file],byte 0
668
	je	@f
669
 
670
	mov	ecx,0xff0000
671
;--------------------------------------
1792 yogev_ezra 672
@@:
3840 mario79 673
	mcall	4
674
	cmp	[temp_counter_1],0
675
	je	.continue
676
 
677
	mov	eax,esi ;[file_name_length]
678
	imul	eax,6
679
	shl	eax,16
680
	push	ebx edx
681
	add	ebx,eax
682
	mcall	4,,0xff0000,truncated_filename_char,2
683
	add	ebx,1 shl 16
684
	mcall
685
	pop	edx ebx
686
;--------------------------------------
1792 yogev_ezra 687
.continue:
3840 mario79 688
	add	ebx,10
689
	add	edx,304 ;10
690
	pop	eax
691
	inc	eax
692
	jmp	.start
693
;--------------------------------------
1792 yogev_ezra 694
.end_1:
3840 mario79 695
	popa
696
;--------------------------------------
1792 yogev_ezra 697
.end_2:
3840 mario79 698
	mov	ax,[left_panel_y.start_y]
699
	add	ax,[left_panel_y.size_y]
700
	mov	cx,bx
701
	dec	cx
702
	rol	ecx,16
703
	mov	cx,ax
704
	mov	eax,ecx
705
	shr	eax,16
706
	sub	cx,ax
707
	cmp	cx,0
708
	jbe	@f
709
 
710
	mov	bx,[left_panel_x.size_x]
711
	sub	ebx,12 shl 16
712
	mcall	13,,,0xffffff
713
;--------------------------------------
1792 yogev_ezra 714
@@:
3840 mario79 715
.end:
716
	cmp	[drawing_panel_folder],1
717
	jne	@f
1792 yogev_ezra 718
 
3840 mario79 719
	call	draw_scroll_bar_left
720
	ret
721
;--------------------------------------
1792 yogev_ezra 722
@@:
3840 mario79 723
	call	draw_scroll_bar_right
724
	ret
725
;------------------------------------------------------------------------------
1792 yogev_ezra 726
clear_line:
3840 mario79 727
	cmp	[not_clear_lines],0
728
	jne	.end_1
729
 
730
	pusha
731
	shl	ebx,16
732
	shr	ebx,16
733
	dec	ebx
734
	cmp	[drawing_panel_folder],1
735
	jne	.right
736
 
737
	cmp	[select_panel_counter],0
738
	jne	.continue
739
 
740
	mov	ax,[left_start_draw_cursor_line]
741
	add	ax,[left_panel_y.start_y]
742
	cmp	bx,ax
743
	je	.end
744
 
745
	jmp	.continue
746
;--------------------------------------
1792 yogev_ezra 747
.right:
3840 mario79 748
	cmp	[select_panel_counter],0
749
	je	.continue
750
 
751
	mov	ax,[right_start_draw_cursor_line]
752
	add	ax,[right_panel_y.start_y]
753
	cmp	bx,ax
754
	je	.end
755
;--------------------------------------
1792 yogev_ezra 756
.continue:
3840 mario79 757
	mov	ebx,[esp+16]
758
	mov	cx,bx
759
	dec	cx
760
	rol	ecx,16
761
	mov	cx,10
762
	mov	bx,[left_panel_x.size_x]
763
	cmp	[drawing_panel_folder],1
764
	je	@f
765
 
766
	dec	ebx
767
;--------------------------------------
1792 yogev_ezra 768
@@:
3840 mario79 769
	sub	ebx,12 shl 16+15
770
	mcall	13,,,0xffffff
771
;--------------------------------------
1792 yogev_ezra 772
.end:
3840 mario79 773
	popa
774
;--------------------------------------
1792 yogev_ezra 775
.end_1:
3840 mario79 776
	ret
777
;------------------------------------------------------------------------------
1792 yogev_ezra 778
draw_left_panel:
3840 mario79 779
	call	clear_left_panel
780
	call	calc_max_panel_line
781
	call	draw_left_panel_selection
782
	mov	[drawing_panel_folder],1
783
	call	draw_folder_data
784
	call	draw_left_panel_patch
785
	ret
786
;------------------------------------------------------------------------------
1792 yogev_ezra 787
draw_right_panel:
3840 mario79 788
	call	clear_right_panel
789
	call	calc_max_panel_line
790
	call	draw_right_panel_selection
791
	mov	[drawing_panel_folder],2
792
	call	draw_folder_data
793
	call	draw_right_panel_patch
794
	ret
795
;------------------------------------------------------------------------------
1792 yogev_ezra 796
draw_left_panel_patch:
3840 mario79 797
	cmp	[select_panel_counter],0
798
	jne	.end
799
 
800
	mov	edx,read_folder_name	   ;read_folder.name
801
;--------------------------------------
1792 yogev_ezra 802
.1:
3840 mario79 803
	call	clear_patch_area
804
	mov	ebx,[window_high]
805
	sub	ebx,33
806
	add	ebx,8 shl 16
807
	mcall	4,,0x80000000  ; ,read_folder.name
808
;--------------------------------------
1792 yogev_ezra 809
.end:
3840 mario79 810
	ret
811
;------------------------------------------------------------------------------
1792 yogev_ezra 812
draw_right_panel_patch:
3840 mario79 813
	cmp	[select_panel_counter],1
814
	jne	draw_left_panel_patch.end
815
 
816
	mov	edx,read_folder_1_name    ;read_folder_1.name
817
	jmp	draw_left_panel_patch.1
818
;------------------------------------------------------------------------------
1792 yogev_ezra 819
clear_patch_area:
3840 mario79 820
	push	edx
821
	mov	ebx,[window_width]
822
	sub	ebx,9
823
	add	ebx,5 shl 16
824
	mov	ecx,[window_high]
825
	sub	ecx,35
826
	shl	ecx,16
827
	mov	cx,12
828
	mcall	13,,,0xffffcc
829
	pop	edx
830
	ret
831
;------------------------------------------------------------------------------
1792 yogev_ezra 832
draw_left_panel_selection:
3840 mario79 833
	cmp	[select_panel_counter],0
834
	jne	.end
835
 
836
	mov	eax,[left_folder_block]
837
	sub	eax,[left_start_draw_line]
838
	mov	edx,left_start_draw_cursor_line
839
	mov	cx,[edx]
840
	call	for_all_panel_selection
841
	mov	eax,[left_folder_block]
842
	dec	eax
843
	imul	eax,10
844
	cmp	ax,cx
845
	jae	 @f
846
 
847
	mov	cx,ax
848
;--------------------------------------
1792 yogev_ezra 849
@@:
3840 mario79 850
	mov	[edx],cx
851
	mov	ebx,[left_panel_x]
852
	add	cx,[left_panel_y.start_y]
853
;--------------------------------------
1792 yogev_ezra 854
.1:
3840 mario79 855
	shl	ecx,16
856
	mov	cx,10
857
	sub	ebx,15
858
	mcall	13,,,0xbbddff
859
;--------------------------------------
1792 yogev_ezra 860
.end:
3840 mario79 861
	ret
862
;------------------------------------------------------------------------------
1792 yogev_ezra 863
draw_right_panel_selection:
3840 mario79 864
	cmp	[select_panel_counter],1
865
	jne	draw_left_panel_selection.end
866
 
867
	mov	eax,[right_folder_block]
868
	sub	eax,[right_start_draw_line]
869
	mov	edx,right_start_draw_cursor_line
870
	mov	cx,[edx]
871
	call	for_all_panel_selection
872
	mov	eax,[right_folder_block]
873
	dec	eax
874
	imul	eax,10
875
	cmp	ax,cx
876
	jae	 @f
877
 
878
	mov	cx,ax
879
;--------------------------------------
1792 yogev_ezra 880
@@:
3840 mario79 881
	mov	[edx],cx
882
	mov	ebx,[right_panel_x]
883
	add	cx,[right_panel_y.start_y]
884
	jmp	draw_left_panel_selection.1
885
;------------------------------------------------------------------------------
1792 yogev_ezra 886
for_all_panel_selection:
3840 mario79 887
	imul	eax,10
888
	cmp	ax,cx
889
	jae	@f
890
 
891
	mov	cx,ax
892
;--------------------------------------
1792 yogev_ezra 893
@@:
3840 mario79 894
	mov	eax,[max_panel_line]
895
	dec	eax
896
	imul	eax,10
897
	cmp	ax,cx
898
	jae	@f
899
 
900
	mov	cx,ax
901
;--------------------------------------
1792 yogev_ezra 902
@@:
3840 mario79 903
	ret
904
;------------------------------------------------------------------------------
1792 yogev_ezra 905
clear_left_panel:
3840 mario79 906
	mov	ebx,7 shl 16
907
	add	ebx,[window_width]
908
	shr	bx,1
909
	sub	ebx,6+1
910
	mov	[left_panel_x],ebx
911
	call	calculate_panel_1
912
	mov	[left_panel_y],ecx
913
	xor	eax,eax
914
	mov	ax,cx
915
	xor	edx,edx
916
	mov	ebx,10
917
	div	ebx
918
; умножение на 10
919
	shl	eax,1      ; умножение на 2
920
	lea	eax,[eax+eax*4] ; умножение на 5
921
	mov	[left_panel_y_correct_size_y],ax
922
	ret
923
;------------------------------------------------------------------------------
1792 yogev_ezra 924
calculate_panel_1:
3840 mario79 925
	mov	ecx,[skin_high]
926
	add	ecx,70
927
	shl	ecx,16
928
	add	ecx,[window_high]
929
	sub	ecx,129
930
	ret
931
;------------------------------------------------------------------------------
1792 yogev_ezra 932
clear_right_panel:
3840 mario79 933
	mov	ebx,[window_width]
934
	shr	ebx,1
935
	add	ebx,3
936
	shl	ebx,16
937
	add	ebx,[window_width]
938
	shr	bx,1
939
	sub	bx,2+6
940
	mov	[right_panel_x],ebx
941
	call	calculate_panel_1
942
	mov	[right_panel_y],ecx
943
	xor	eax,eax
944
	mov	ax,cx
945
	xor	edx,edx
946
	mov	ebx,10
947
	div	ebx
948
; умножение на 10
949
	shl	eax,1      ; умножение на 2
950
	lea	eax,[eax+eax*4] ; умножение на 5
951
	mov	[right_panel_y_correct_size_y],ax
952
	ret
953
;------------------------------------------------------------------------------
1792 yogev_ezra 954
erase_fbutton:
3840 mario79 955
	mov	edx,0x80000065
956
	mov	eax,8
957
	mov	ebp,12
958
;--------------------------------------
1792 yogev_ezra 959
.start:
3840 mario79 960
	mcall
961
	dec	ebp
962
	jnz	.start
963
 
964
	ret
965
;------------------------------------------------------------------------------
1792 yogev_ezra 966
draw_fbutton:
2584 mario79 967
	test	[window_status],100b	; window is rolled up
968
	jnz	.exit
969
 
970
	test	[window_status],10b	; window is minimized to panel
971
	jnz	.exit
972
 
3840 mario79 973
	mov	ecx,[window_high]
974
	sub	ecx,20
975
	shl	ecx,16
976
	add	ecx,15
977
	mov	eax,[window_width]
978
	mov	ebx,12
979
	xor	edx,edx
980
	div	ebx
981
	mov	[fbutton_width],eax
982
	mov	ebx,5 shl 16
983
	add	ebx,eax
984
	sub	ebx,2
985
	mov	esi,0xaa00
986
	mov	edx,101
987
	mov	eax,8
988
	mov	ebp,12
989
;--------------------------------------
1792 yogev_ezra 990
.start:
3840 mario79 991
	cmp	ebp,1
992
	jne	@f
993
 
994
	mov	eax,ebx
995
	shr	eax,16
996
	mov	bx,ax
997
	mov	eax,[window_width]
998
	sub	ax,bx
999
	sub	ax,5
1000
	mov	bx,ax
1001
	mov	eax,8
1002
;--------------------------------------
1792 yogev_ezra 1003
@@:
3840 mario79 1004
	mcall
1005
	push	eax ebx edx
1006
	mov	edx,0x6060ff
1007
	mov	bx,10
1008
	cmp	ebp,4
1009
	jae	@f
1010
 
1011
	mov	bx,18
1012
;--------------------------------------
1792 yogev_ezra 1013
@@:
3840 mario79 1014
	mcall	13
1015
	cmp	ebp,1
1016
	je	@f
1017
 
1018
	ror	ebx,16
1019
	add	ebx,[fbutton_width]
1020
	dec	ebx
1021
	rol	ebx,16
1022
	mov	bx,1
1023
	inc	ecx
1024
	mcall	,,,0xcccccc
1025
	dec	ecx
1026
;--------------------------------------
1792 yogev_ezra 1027
@@:
3840 mario79 1028
	pop	edx ebx eax
1029
	call	.rol_ror
1030
	inc	edx
1031
	dec	ebp
1032
	jnz	.start
1033
 
1034
	call	draw_fbutton_name
1035
	ret
1036
;--------------------------------------
1792 yogev_ezra 1037
.rol_ror:
3840 mario79 1038
	rol	ebx,16
1039
	add	ebx,[fbutton_width]
1040
	ror	ebx,16
1041
;--------------------------------------
2584 mario79 1042
.exit:
3840 mario79 1043
	ret
1044
;------------------------------------------------------------------------------
1792 yogev_ezra 1045
draw_fbutton_name:
3840 mario79 1046
	mov	ebx, 7 shl 16
1047
	add	ebx,[window_high]
1048
	sub	ebx,15
1049
	mov	eax,4
1050
	mov	ecx,0x90000000
1051
	push	ebx
1052
	call	.type_1
1053
	pop	ebx
1054
	mov	ecx,0x90ffffff
1055
	sub	ebx,1 shl 16 + 1
1056
;--------------------------------------
1792 yogev_ezra 1057
.type_1:
3840 mario79 1058
	cmp	[shift_flag],1
1059
	je	.type_shift
1060
 
1061
	cmp	[ctrl_flag],1
1062
	je	.type_ctrl
1063
 
1064
	cmp	[alt_flag],1
1065
	je	.type_alt
1066
;--------------------------------------
1792 yogev_ezra 1067
.type:
3840 mario79 1068
	mov	edx,fbutton_name.f1
1069
	call	.type_all
1070
	mov	edx,fbutton_name.f2
1071
	call	.type_all
1072
	mov	edx,fbutton_name.f3
1073
	call	.type_all
1074
	mov	edx,fbutton_name.f4
1075
	call	.type_all
1076
	mov	edx,fbutton_name.f5
1077
	call	.type_all
1078
	mov	edx,fbutton_name.f6
1079
	call	.type_all
1080
	mov	edx,fbutton_name.f7
1081
	call	.type_all
1082
	mov	edx,fbutton_name.f8
1083
	call	.type_all
1084
	mov	edx,fbutton_name.f9
1085
	call	.type_all
1086
	mov	edx,fbutton_name.f10
1087
	call	.type_all
1088
	mov	edx,fbutton_name.f11
1089
	call	.type_all
1090
	mov	edx,fbutton_name.f12
1091
	mcall
1092
	ret
1093
;--------------------------------------
1792 yogev_ezra 1094
.type_shift:
3840 mario79 1095
	mov	edx,fbutton_name_shift.f1
1096
	call	.type_all
1097
	mov	edx,fbutton_name_shift.f2
1098
	call	.type_all
1099
	mov	edx,fbutton_name_shift.f3
1100
	call	.type_all
1101
	mov	edx,fbutton_name_shift.f4
1102
	call	.type_all
1103
	mov	edx,fbutton_name_shift.f5
1104
	call	.type_all
1105
	mov	edx,fbutton_name_shift.f6
1106
	call	.type_all
1107
	mov	edx,fbutton_name_shift.f7
1108
	call	.type_all
1109
	mov	edx,fbutton_name_shift.f8
1110
	call	.type_all
1111
	mov	edx,fbutton_name_shift.f9
1112
	call	.type_all
1113
	mov	edx,fbutton_name_shift.f10
1114
	call	.type_all
1115
	mov	edx,fbutton_name_shift.f11
1116
	call	.type_all
1117
	mov	edx,fbutton_name_shift.f12
1118
	mcall
1119
	ret
1120
;--------------------------------------
1792 yogev_ezra 1121
.type_ctrl:
3840 mario79 1122
	mov	edx,fbutton_name_ctrl.f1
1123
	call	.type_all
1124
	mov	edx,fbutton_name_ctrl.f2
1125
	call	.type_all
1126
	mov	edx,fbutton_name_ctrl.f3
1127
	call	.type_all
1128
	mov	edx,fbutton_name_ctrl.f4
1129
	call	.type_all
1130
	mov	edx,fbutton_name_ctrl.f5
1131
	call	.type_all
1132
	mov	edx,fbutton_name_ctrl.f6
1133
	call	.type_all
1134
	mov	edx,fbutton_name_ctrl.f7
1135
	call	.type_all
1136
	mov	edx,fbutton_name_ctrl.f8
1137
	call	.type_all
1138
	mov	edx,fbutton_name_ctrl.f9
1139
	call	.type_all
1140
	mov	edx,fbutton_name_ctrl.f10
1141
	call	.type_all
1142
	mov	edx,fbutton_name_ctrl.f11
1143
	call	.type_all
1144
	mov	edx,fbutton_name_ctrl.f12
1145
	mcall
1146
	ret
1147
;--------------------------------------
1792 yogev_ezra 1148
.type_alt:
3840 mario79 1149
	mov	edx,fbutton_name_alt.f1
1150
	call	.type_all
1151
	mov	edx,fbutton_name_alt.f2
1152
	call	.type_all
1153
	mov	edx,fbutton_name_alt.f3
1154
	call	.type_all
1155
	mov	edx,fbutton_name_alt.f4
1156
	call	.type_all
1157
	mov	edx,fbutton_name_alt.f5
1158
	call	.type_all
1159
	mov	edx,fbutton_name_alt.f6
1160
	call	.type_all
1161
	mov	edx,fbutton_name_alt.f7
1162
	call	.type_all
1163
	mov	edx,fbutton_name_alt.f8
1164
	call	.type_all
1165
	mov	edx,fbutton_name_alt.f9
1166
	call	.type_all
1167
	mov	edx,fbutton_name_alt.f10
1168
	call	.type_all
1169
	mov	edx,fbutton_name_alt.f11
1170
	call	.type_all
1171
	mov	edx,fbutton_name_alt.f12
1172
;--------------------------------------
1792 yogev_ezra 1173
.type_all:
3840 mario79 1174
	mcall
1175
	call	draw_fbutton.rol_ror
1176
	ret
1177
;------------------------------------------------------------------------------