Subversion Repositories Kolibri OS

Rev

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