Subversion Repositories Kolibri OS

Rev

Rev 9461 | Rev 9726 | 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
;--------------------------------------
9691 sober_dev 402
.qword_div:
403
	mov	eax,[edx-40+32]
404
	mov	ebx,[edx-40+32+4]
405
@@:	; /1024
406
	shrd	eax,ebx,5 ; /32
407
	shr	ebx,5 ; /32
408
	shrd	eax,ebx,5 ; /32
409
	shr	ebx,5 ; /32
410
	dec	ecx
411
	jnz	@b
412
; /(1024*1024)
413
	shr	eax,20
414
	test	eax,eax
415
	ret
416
;--------------------------------------
1792 yogev_ezra 417
.copy_size:
9691 sober_dev 418
;/0x1000000000000000 - EB
419
;/0x4000000000000 - PB
420
;/0x10000000000 - TB
421
;/0x40000000 - GB
422
;/0x100000 - MB
423
;/0x400 - KB
3840 mario79 424
	mov	[size_table],dword '    '
425
	mov	[size_table+4],word '  '
9691 sober_dev 426
	push	ebx edx
427
	push	ecx
428
	mov	ecx,4
429
	call	.qword_div
430
	pop	ecx
431
	jz	@f
3840 mario79 432
 
433
	mov	ebx,size_table
434
	call	decimal_string_4
9691 sober_dev 435
	mov	[ebx],byte 'E' ; Exa Byte
3840 mario79 436
	jmp	.size_convert_end
437
;--------------------------------------
1792 yogev_ezra 438
@@:
9691 sober_dev 439
	push	ecx
440
	mov	ecx,3
441
	call	.qword_div
442
	pop	ecx
443
	jz	@f
3840 mario79 444
 
445
	mov	ebx,size_table
446
	call	decimal_string_4
9691 sober_dev 447
	mov	[ebx],byte 'P' ; Peta Byte
3840 mario79 448
	jmp	.size_convert_end
449
;--------------------------------------
1792 yogev_ezra 450
@@:
9691 sober_dev 451
	push	ecx
452
	mov	ecx,2
453
	call	.qword_div
454
	pop	ecx
455
	jz	@f
456
 
457
	mov	ebx,size_table
458
	call	decimal_string_4
459
	mov	[ebx],byte 'T' ; Tera Byte
460
	jmp	.size_convert_end
461
;--------------------------------------
462
@@:
463
	push	ecx
464
	mov	ecx,1
465
	call	.qword_div
466
	pop	ecx
467
	jz	@f
468
 
469
	mov	ebx,size_table
470
	call	decimal_string_4
471
	mov	[ebx],byte 'G' ; Giga Byte
472
	jmp	.size_convert_end
473
;--------------------------------------
474
@@:
3840 mario79 475
	mov	eax,[edx-40+32]
9691 sober_dev 476
	mov	ebx,eax
477
	shr	eax,20 ; /(1024*1024)
478
	test	eax,eax
479
	jz	@f
3840 mario79 480
 
481
	mov	ebx,size_table
482
	call	decimal_string_4
9691 sober_dev 483
	mov	[ebx],byte 'M' ; Mega Byte
3840 mario79 484
	jmp	.size_convert_end
485
;--------------------------------------
1792 yogev_ezra 486
@@:
9691 sober_dev 487
	mov	eax,ebx
488
	shr	eax,10 ; /1024
489
	test	eax,eax
490
	jz	@f
491
 
492
	mov	ebx,size_table
493
	call	decimal_string_4
494
	mov	[ebx],byte 'K' ; Kilo Byte
495
	jmp	.size_convert_end
496
;--------------------------------------
497
@@:
498
	mov	eax,ebx
1792 yogev_ezra 499
;.size_convert:
3840 mario79 500
	mov	ebx,size_table
501
	call	decimal_string_4
502
;--------------------------------------
1792 yogev_ezra 503
.size_convert_end:
3840 mario79 504
	cmp	[size_table],byte '0'
505
	jne	@f
506
 
507
	mov	[size_table],byte ' '
508
;--------------------------------------
1792 yogev_ezra 509
@@:
3840 mario79 510
	cmp	[size_table+4],byte ' '
511
	jne	@f
512
 
513
	mov	esi,size_table+3
514
	mov	edi,esi
515
	inc	edi
516
	mov	ecx,5
517
	std
518
	rep	movsb
519
	jmp	@r
520
;--------------------------------------
1792 yogev_ezra 521
@@:
9691 sober_dev 522
	pop	edx ebx
3840 mario79 523
;--------------------------------------
1792 yogev_ezra 524
.date:
3840 mario79 525
	xor	eax,eax
526
	mov	al,[edx-40+28]
527
	push	ebx
528
	mov	ebx,date_table
529
	call	decimal_string_2
530
	mov	al,[edx-40+29]
531
	mov	ebx,date_table+3
532
	call	decimal_string_2
533
	mov	ax,[edx-40+30]
534
	mov	ebx,year_table
535
	call	decimal_string_4
536
	mov	ax,[year_table+2]
537
	mov	[date_table+6],ax
538
	pop	ebx
539
	ror	ebx,16
540
	add	bx,[left_panel_x.size_x]
541
	sub	ebx,122+12+15
542
	rol	ebx,16
543
	mov	ecx,0
544
	cmp	[marked_file],byte 0
545
	je	@f
546
 
547
	mov	ecx,0xff0000
548
;--------------------------------------
1792 yogev_ezra 549
@@:
3840 mario79 550
	mcall	4,,,type_table,20
551
	popa
552
	ret
553
;------------------------------------------------------------------------------
1792 yogev_ezra 554
draw_folder_data:
3840 mario79 555
	cmp	[drawing_panel_folder],1
556
	jne	.right_panel
557
 
558
	mov	eax,[left_folder_block]
559
	sub	eax,[max_panel_line]
560
	test	eax,0x8000000
561
	jz	.ok_left
562
 
563
	mov	[left_start_draw_line],0
564
	jmp	@f
565
;--------------------------------------
1792 yogev_ezra 566
.ok_left:
3840 mario79 567
	cmp	eax,[left_start_draw_line]
568
	jae	@f
569
 
570
	mov	[left_start_draw_line],eax
571
;--------------------------------------
1792 yogev_ezra 572
@@:
3840 mario79 573
	mov	bx,[left_panel_x.start_x]
574
	add	bx,12
575
	shl	ebx,16
576
	mov	bx,[left_panel_y.start_y]
577
	inc	bx
578
	mov	edx,[left_start_draw_line]
579
	imul	edx,304
580
	add	edx,[left_folder_data]
581
	add	edx,32+40
582
	mov	[temp_counter],0
583
	jmp	.type_folder
584
;--------------------------------------
1792 yogev_ezra 585
.right_panel:
3840 mario79 586
	mov	eax,[right_folder_block]
587
	sub	eax,[max_panel_line]
588
	test	eax,0x8000000
589
	jz	.ok_right
590
 
591
	mov	[right_start_draw_line],0
592
	jmp	@f
593
;--------------------------------------
1792 yogev_ezra 594
.ok_right:
3840 mario79 595
	cmp	eax,[right_start_draw_line]
596
	jae	@f
597
 
598
	mov	[right_start_draw_line],eax
599
;--------------------------------------
1792 yogev_ezra 600
@@:
3840 mario79 601
	mov	bx,[right_panel_x.start_x]
602
	add	bx,12
603
	shl	ebx,16
604
	mov	bx,[right_panel_y.start_y]
605
	inc	bx
606
	mov	edx,[right_start_draw_line]
607
	imul	edx,304
608
	add	edx,[right_folder_data]
609
	add	edx,32+40
610
	mov	[temp_counter],1
611
;--------------------------------------
1792 yogev_ezra 612
.type_folder:
3840 mario79 613
	xor	eax,eax
614
;--------------------------------------
1792 yogev_ezra 615
.start:
3840 mario79 616
	pusha
617
	mov	eax,edx
618
	cmp	[temp_counter],1
619
	je	@f
620
 
621
	sub	eax,[left_folder_data]
622
	sub	eax,32+40
623
	xor	edx,edx
624
	mov	ebx,304
625
	div	ebx
626
	cmp	eax,[left_folder_block]
627
	je	.end_1
628
 
629
	jmp	.continue_1
630
;--------------------------------------
1792 yogev_ezra 631
@@:
3840 mario79 632
	sub	eax,[right_folder_data]
633
	sub	eax,32+40
634
	xor	edx,edx
635
	mov	ebx,304
636
	div	ebx
637
	cmp	eax,[right_folder_block]
638
	je	.end_1
639
;--------------------------------------
1792 yogev_ezra 640
.continue_1:
3840 mario79 641
	popa
642
	cmp	eax,[max_panel_line]	;  20
643
	je	.end_2
644
 
645
	mov	[marked_file],0
646
	cmp	[edx+299-40],byte 0
647
	je	@f
648
 
649
	mov	[marked_file],1
650
;--------------------------------------
1792 yogev_ezra 651
@@:
3840 mario79 652
	call	clear_line
653
	call	draw_type_size_date
654
	call	draw_icon
655
	push	eax
656
	xor	eax,eax
657
	mov	ax,[left_panel_x.size_x]
658
	push	ebx edx
659
	mov	ebx,6
660
	xor	edx,edx
661
	div	ebx
662
	pop	edx ebx
663
	sub	eax,23+2+2
664
	mov	esi,[file_name_length]
665
	mov	[temp_counter_1],0
666
	cmp	esi,eax
667
	jbe	@f
668
 
669
	mov	esi,eax
670
	mov	[temp_counter_1],1
671
;--------------------------------------
1792 yogev_ezra 672
@@:
3840 mario79 673
	mov	ecx,0
674
	cmp	[marked_file],byte 0
675
	je	@f
676
 
677
	mov	ecx,0xff0000
678
;--------------------------------------
1792 yogev_ezra 679
@@:
3840 mario79 680
	mcall	4
681
	cmp	[temp_counter_1],0
682
	je	.continue
683
 
684
	mov	eax,esi ;[file_name_length]
685
	imul	eax,6
686
	shl	eax,16
687
	push	ebx edx
688
	add	ebx,eax
689
	mcall	4,,0xff0000,truncated_filename_char,2
690
	add	ebx,1 shl 16
691
	mcall
692
	pop	edx ebx
693
;--------------------------------------
1792 yogev_ezra 694
.continue:
3840 mario79 695
	add	ebx,10
696
	add	edx,304 ;10
697
	pop	eax
698
	inc	eax
699
	jmp	.start
700
;--------------------------------------
1792 yogev_ezra 701
.end_1:
3840 mario79 702
	popa
703
;--------------------------------------
1792 yogev_ezra 704
.end_2:
3840 mario79 705
	mov	ax,[left_panel_y.start_y]
706
	add	ax,[left_panel_y.size_y]
707
	mov	cx,bx
708
	dec	cx
709
	rol	ecx,16
710
	mov	cx,ax
711
	mov	eax,ecx
712
	shr	eax,16
713
	sub	cx,ax
714
	cmp	cx,0
715
	jbe	@f
716
 
717
	mov	bx,[left_panel_x.size_x]
718
	sub	ebx,12 shl 16
719
	mcall	13,,,0xffffff
720
;--------------------------------------
1792 yogev_ezra 721
@@:
3840 mario79 722
.end:
723
	cmp	[drawing_panel_folder],1
724
	jne	@f
1792 yogev_ezra 725
 
3840 mario79 726
	call	draw_scroll_bar_left
727
	ret
728
;--------------------------------------
1792 yogev_ezra 729
@@:
3840 mario79 730
	call	draw_scroll_bar_right
731
	ret
732
;------------------------------------------------------------------------------
1792 yogev_ezra 733
clear_line:
3840 mario79 734
	cmp	[not_clear_lines],0
735
	jne	.end_1
736
 
737
	pusha
738
	shl	ebx,16
739
	shr	ebx,16
740
	dec	ebx
741
	cmp	[drawing_panel_folder],1
742
	jne	.right
743
 
744
	cmp	[select_panel_counter],0
745
	jne	.continue
746
 
747
	mov	ax,[left_start_draw_cursor_line]
748
	add	ax,[left_panel_y.start_y]
749
	cmp	bx,ax
750
	je	.end
751
 
752
	jmp	.continue
753
;--------------------------------------
1792 yogev_ezra 754
.right:
3840 mario79 755
	cmp	[select_panel_counter],0
756
	je	.continue
757
 
758
	mov	ax,[right_start_draw_cursor_line]
759
	add	ax,[right_panel_y.start_y]
760
	cmp	bx,ax
761
	je	.end
762
;--------------------------------------
1792 yogev_ezra 763
.continue:
3840 mario79 764
	mov	ebx,[esp+16]
765
	mov	cx,bx
766
	dec	cx
767
	rol	ecx,16
768
	mov	cx,10
769
	mov	bx,[left_panel_x.size_x]
770
	cmp	[drawing_panel_folder],1
771
	je	@f
772
 
773
	dec	ebx
774
;--------------------------------------
1792 yogev_ezra 775
@@:
3840 mario79 776
	sub	ebx,12 shl 16+15
777
	mcall	13,,,0xffffff
778
;--------------------------------------
1792 yogev_ezra 779
.end:
3840 mario79 780
	popa
781
;--------------------------------------
1792 yogev_ezra 782
.end_1:
3840 mario79 783
	ret
784
;------------------------------------------------------------------------------
1792 yogev_ezra 785
draw_left_panel:
3840 mario79 786
	call	clear_left_panel
787
	call	calc_max_panel_line
788
	call	draw_left_panel_selection
789
	mov	[drawing_panel_folder],1
790
	call	draw_folder_data
791
	call	draw_left_panel_patch
792
	ret
793
;------------------------------------------------------------------------------
1792 yogev_ezra 794
draw_right_panel:
3840 mario79 795
	call	clear_right_panel
796
	call	calc_max_panel_line
797
	call	draw_right_panel_selection
798
	mov	[drawing_panel_folder],2
799
	call	draw_folder_data
800
	call	draw_right_panel_patch
801
	ret
802
;------------------------------------------------------------------------------
1792 yogev_ezra 803
draw_left_panel_patch:
3840 mario79 804
	cmp	[select_panel_counter],0
805
	jne	.end
806
 
807
	mov	edx,read_folder_name	   ;read_folder.name
808
;--------------------------------------
1792 yogev_ezra 809
.1:
3840 mario79 810
	call	clear_patch_area
811
	mov	ebx,[window_high]
812
	sub	ebx,33
813
	add	ebx,8 shl 16
814
	mcall	4,,0x80000000  ; ,read_folder.name
815
;--------------------------------------
1792 yogev_ezra 816
.end:
3840 mario79 817
	ret
818
;------------------------------------------------------------------------------
1792 yogev_ezra 819
draw_right_panel_patch:
3840 mario79 820
	cmp	[select_panel_counter],1
821
	jne	draw_left_panel_patch.end
822
 
823
	mov	edx,read_folder_1_name    ;read_folder_1.name
824
	jmp	draw_left_panel_patch.1
825
;------------------------------------------------------------------------------
1792 yogev_ezra 826
clear_patch_area:
3840 mario79 827
	push	edx
828
	mov	ebx,[window_width]
829
	sub	ebx,9
830
	add	ebx,5 shl 16
831
	mov	ecx,[window_high]
832
	sub	ecx,35
833
	shl	ecx,16
834
	mov	cx,12
835
	mcall	13,,,0xffffcc
836
	pop	edx
837
	ret
838
;------------------------------------------------------------------------------
1792 yogev_ezra 839
draw_left_panel_selection:
3840 mario79 840
	cmp	[select_panel_counter],0
841
	jne	.end
5684 leency 842
 
3840 mario79 843
	mov	eax,[left_folder_block]
844
	sub	eax,[left_start_draw_line]
845
	mov	edx,left_start_draw_cursor_line
846
	mov	cx,[edx]
847
	call	for_all_panel_selection
848
	mov	eax,[left_folder_block]
849
	dec	eax
850
	imul	eax,10
851
	cmp	ax,cx
852
	jae	 @f
853
 
854
	mov	cx,ax
855
;--------------------------------------
1792 yogev_ezra 856
@@:
3840 mario79 857
	mov	[edx],cx
858
	mov	ebx,[left_panel_x]
859
	add	cx,[left_panel_y.start_y]
860
;--------------------------------------
1792 yogev_ezra 861
.1:
3840 mario79 862
	shl	ecx,16
863
	mov	cx,10
864
	sub	ebx,15
865
	mcall	13,,,0xbbddff
866
;--------------------------------------
1792 yogev_ezra 867
.end:
3840 mario79 868
	ret
869
;------------------------------------------------------------------------------
1792 yogev_ezra 870
draw_right_panel_selection:
3840 mario79 871
	cmp	[select_panel_counter],1
872
	jne	draw_left_panel_selection.end
873
 
874
	mov	eax,[right_folder_block]
875
	sub	eax,[right_start_draw_line]
876
	mov	edx,right_start_draw_cursor_line
877
	mov	cx,[edx]
878
	call	for_all_panel_selection
879
	mov	eax,[right_folder_block]
880
	dec	eax
881
	imul	eax,10
882
	cmp	ax,cx
883
	jae	 @f
884
 
885
	mov	cx,ax
886
;--------------------------------------
1792 yogev_ezra 887
@@:
3840 mario79 888
	mov	[edx],cx
889
	mov	ebx,[right_panel_x]
890
	add	cx,[right_panel_y.start_y]
891
	jmp	draw_left_panel_selection.1
892
;------------------------------------------------------------------------------
1792 yogev_ezra 893
for_all_panel_selection:
3840 mario79 894
	imul	eax,10
895
	cmp	ax,cx
896
	jae	@f
897
 
898
	mov	cx,ax
899
;--------------------------------------
1792 yogev_ezra 900
@@:
3840 mario79 901
	mov	eax,[max_panel_line]
902
	dec	eax
903
	imul	eax,10
904
	cmp	ax,cx
905
	jae	@f
906
 
907
	mov	cx,ax
908
;--------------------------------------
1792 yogev_ezra 909
@@:
3840 mario79 910
	ret
911
;------------------------------------------------------------------------------
1792 yogev_ezra 912
clear_left_panel:
3840 mario79 913
	mov	ebx,7 shl 16
914
	add	ebx,[window_width]
915
	shr	bx,1
916
	sub	ebx,6+1
917
	mov	[left_panel_x],ebx
918
	call	calculate_panel_1
919
	mov	[left_panel_y],ecx
920
	xor	eax,eax
921
	mov	ax,cx
922
	xor	edx,edx
923
	mov	ebx,10
924
	div	ebx
925
; óìíîæåíèå íà 10
926
	shl	eax,1      ; óìíîæåíèå íà 2
927
	lea	eax,[eax+eax*4] ; óìíîæåíèå íà 5
928
	mov	[left_panel_y_correct_size_y],ax
929
	ret
930
;------------------------------------------------------------------------------
1792 yogev_ezra 931
calculate_panel_1:
3840 mario79 932
	mov	ecx,[skin_high]
933
	add	ecx,70
934
	shl	ecx,16
935
	add	ecx,[window_high]
936
	sub	ecx,129
937
	ret
938
;------------------------------------------------------------------------------
1792 yogev_ezra 939
clear_right_panel:
3840 mario79 940
	mov	ebx,[window_width]
941
	shr	ebx,1
942
	add	ebx,3
943
	shl	ebx,16
944
	add	ebx,[window_width]
945
	shr	bx,1
946
	sub	bx,2+6
947
	mov	[right_panel_x],ebx
948
	call	calculate_panel_1
949
	mov	[right_panel_y],ecx
950
	xor	eax,eax
951
	mov	ax,cx
952
	xor	edx,edx
953
	mov	ebx,10
954
	div	ebx
955
; óìíîæåíèå íà 10
956
	shl	eax,1      ; óìíîæåíèå íà 2
957
	lea	eax,[eax+eax*4] ; óìíîæåíèå íà 5
958
	mov	[right_panel_y_correct_size_y],ax
959
	ret
960
;------------------------------------------------------------------------------
1792 yogev_ezra 961
erase_fbutton:
3840 mario79 962
	mov	edx,0x80000065
963
	mov	eax,8
964
	mov	ebp,12
965
;--------------------------------------
1792 yogev_ezra 966
.start:
3840 mario79 967
	mcall
968
	dec	ebp
969
	jnz	.start
970
 
971
	ret
972
;------------------------------------------------------------------------------
1792 yogev_ezra 973
draw_fbutton:
2584 mario79 974
	test	[window_status],100b	; window is rolled up
975
	jnz	.exit
976
 
977
	test	[window_status],10b	; window is minimized to panel
978
	jnz	.exit
979
 
3840 mario79 980
	mov	ecx,[window_high]
981
	sub	ecx,20
982
	shl	ecx,16
983
	add	ecx,15
984
	mov	eax,[window_width]
985
	mov	ebx,12
986
	xor	edx,edx
987
	div	ebx
988
	mov	[fbutton_width],eax
989
	mov	ebx,5 shl 16
990
	add	ebx,eax
991
	sub	ebx,2
992
	mov	esi,0xaa00
993
	mov	edx,101
994
	mov	eax,8
995
	mov	ebp,12
996
;--------------------------------------
1792 yogev_ezra 997
.start:
3840 mario79 998
	cmp	ebp,1
999
	jne	@f
1000
 
1001
	mov	eax,ebx
1002
	shr	eax,16
1003
	mov	bx,ax
1004
	mov	eax,[window_width]
1005
	sub	ax,bx
1006
	sub	ax,5
1007
	mov	bx,ax
1008
	mov	eax,8
1009
;--------------------------------------
1792 yogev_ezra 1010
@@:
3840 mario79 1011
	mcall
1012
	push	eax ebx edx
1013
	mov	edx,0x6060ff
1014
	mov	bx,10
1015
	cmp	ebp,4
1016
	jae	@f
1017
 
1018
	mov	bx,18
1019
;--------------------------------------
1792 yogev_ezra 1020
@@:
3840 mario79 1021
	mcall	13
1022
	cmp	ebp,1
1023
	je	@f
1024
 
1025
	ror	ebx,16
1026
	add	ebx,[fbutton_width]
1027
	dec	ebx
1028
	rol	ebx,16
1029
	mov	bx,1
1030
	inc	ecx
1031
	mcall	,,,0xcccccc
1032
	dec	ecx
1033
;--------------------------------------
1792 yogev_ezra 1034
@@:
3840 mario79 1035
	pop	edx ebx eax
1036
	call	.rol_ror
1037
	inc	edx
1038
	dec	ebp
1039
	jnz	.start
1040
 
1041
	call	draw_fbutton_name
1042
	ret
1043
;--------------------------------------
1792 yogev_ezra 1044
.rol_ror:
3840 mario79 1045
	rol	ebx,16
1046
	add	ebx,[fbutton_width]
1047
	ror	ebx,16
1048
;--------------------------------------
2584 mario79 1049
.exit:
3840 mario79 1050
	ret
1051
;------------------------------------------------------------------------------
1792 yogev_ezra 1052
draw_fbutton_name:
3840 mario79 1053
	mov	ebx, 7 shl 16
1054
	add	ebx,[window_high]
5887 pathoswith 1055
	sub	ebx,19
3840 mario79 1056
	mov	eax,4
1057
	mov	ecx,0x90000000
1058
	push	ebx
1059
	call	.type_1
1060
	pop	ebx
1061
	mov	ecx,0x90ffffff
1062
	sub	ebx,1 shl 16 + 1
1063
;--------------------------------------
1792 yogev_ezra 1064
.type_1:
3840 mario79 1065
	cmp	[shift_flag],1
1066
	je	.type_shift
1067
 
1068
	cmp	[ctrl_flag],1
1069
	je	.type_ctrl
1070
 
1071
	cmp	[alt_flag],1
1072
	je	.type_alt
1073
;--------------------------------------
1792 yogev_ezra 1074
.type:
3840 mario79 1075
	mov	edx,fbutton_name.f1
1076
	call	.type_all
1077
	mov	edx,fbutton_name.f2
1078
	call	.type_all
1079
	mov	edx,fbutton_name.f3
1080
	call	.type_all
1081
	mov	edx,fbutton_name.f4
1082
	call	.type_all
1083
	mov	edx,fbutton_name.f5
1084
	call	.type_all
1085
	mov	edx,fbutton_name.f6
1086
	call	.type_all
1087
	mov	edx,fbutton_name.f7
1088
	call	.type_all
1089
	mov	edx,fbutton_name.f8
1090
	call	.type_all
1091
	mov	edx,fbutton_name.f9
1092
	call	.type_all
1093
	mov	edx,fbutton_name.f10
1094
	call	.type_all
1095
	mov	edx,fbutton_name.f11
1096
	call	.type_all
1097
	mov	edx,fbutton_name.f12
1098
	mcall
1099
	ret
1100
;--------------------------------------
1792 yogev_ezra 1101
.type_shift:
3840 mario79 1102
	mov	edx,fbutton_name_shift.f1
1103
	call	.type_all
1104
	mov	edx,fbutton_name_shift.f2
1105
	call	.type_all
1106
	mov	edx,fbutton_name_shift.f3
1107
	call	.type_all
1108
	mov	edx,fbutton_name_shift.f4
1109
	call	.type_all
1110
	mov	edx,fbutton_name_shift.f5
1111
	call	.type_all
1112
	mov	edx,fbutton_name_shift.f6
1113
	call	.type_all
1114
	mov	edx,fbutton_name_shift.f7
1115
	call	.type_all
1116
	mov	edx,fbutton_name_shift.f8
1117
	call	.type_all
1118
	mov	edx,fbutton_name_shift.f9
1119
	call	.type_all
1120
	mov	edx,fbutton_name_shift.f10
1121
	call	.type_all
1122
	mov	edx,fbutton_name_shift.f11
1123
	call	.type_all
1124
	mov	edx,fbutton_name_shift.f12
1125
	mcall
1126
	ret
1127
;--------------------------------------
1792 yogev_ezra 1128
.type_ctrl:
3840 mario79 1129
	mov	edx,fbutton_name_ctrl.f1
1130
	call	.type_all
1131
	mov	edx,fbutton_name_ctrl.f2
1132
	call	.type_all
1133
	mov	edx,fbutton_name_ctrl.f3
1134
	call	.type_all
1135
	mov	edx,fbutton_name_ctrl.f4
1136
	call	.type_all
1137
	mov	edx,fbutton_name_ctrl.f5
1138
	call	.type_all
1139
	mov	edx,fbutton_name_ctrl.f6
1140
	call	.type_all
1141
	mov	edx,fbutton_name_ctrl.f7
1142
	call	.type_all
1143
	mov	edx,fbutton_name_ctrl.f8
1144
	call	.type_all
1145
	mov	edx,fbutton_name_ctrl.f9
1146
	call	.type_all
1147
	mov	edx,fbutton_name_ctrl.f10
1148
	call	.type_all
1149
	mov	edx,fbutton_name_ctrl.f11
1150
	call	.type_all
1151
	mov	edx,fbutton_name_ctrl.f12
1152
	mcall
1153
	ret
1154
;--------------------------------------
1792 yogev_ezra 1155
.type_alt:
3840 mario79 1156
	mov	edx,fbutton_name_alt.f1
1157
	call	.type_all
1158
	mov	edx,fbutton_name_alt.f2
1159
	call	.type_all
1160
	mov	edx,fbutton_name_alt.f3
1161
	call	.type_all
1162
	mov	edx,fbutton_name_alt.f4
1163
	call	.type_all
1164
	mov	edx,fbutton_name_alt.f5
1165
	call	.type_all
1166
	mov	edx,fbutton_name_alt.f6
1167
	call	.type_all
1168
	mov	edx,fbutton_name_alt.f7
1169
	call	.type_all
1170
	mov	edx,fbutton_name_alt.f8
1171
	call	.type_all
1172
	mov	edx,fbutton_name_alt.f9
1173
	call	.type_all
1174
	mov	edx,fbutton_name_alt.f10
1175
	call	.type_all
1176
	mov	edx,fbutton_name_alt.f11
1177
	call	.type_all
1178
	mov	edx,fbutton_name_alt.f12
1179
;--------------------------------------
1792 yogev_ezra 1180
.type_all:
3840 mario79 1181
	mcall
1182
	call	draw_fbutton.rol_ror
1183
	ret
1184
;------------------------------------------------------------------------------