Subversion Repositories Kolibri OS

Rev

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