Subversion Repositories Kolibri OS

Rev

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