Subversion Repositories Kolibri OS

Rev

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