Subversion Repositories Kolibri OS

Rev

Rev 9726 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;------------------------------------------------------------------------------
  2. draw_buttons_panel:
  3.         mov     ecx,[skin_high]
  4.         add     ecx,19
  5.         shl     ecx,16
  6.         mov     cx,18
  7.         mov     ebx,[window_width]
  8.         sub     ebx,9
  9.         add     ebx,5 shl 16
  10.         mcall   13,,,0xffffff
  11.        
  12.         mov     edx,15 shl 16+20
  13.         add     edx,[skin_high]
  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
  25.         mcall
  26.         cmp edx, 157+0x40000000
  27.         jl  _new_but
  28.        
  29.         ret
  30. ;--------------------------------------
  31. .calculate_button:
  32.         mov     ebx,edx
  33.         mov     bx,15
  34.         mov     ecx,edx
  35.         shl     ecx,16
  36.         mov     cx,bx
  37.         ret
  38. ;------------------------------------------------------------------------------
  39. draw_left_sort_button:
  40.         mov     bx,[left_panel_x.start_x]
  41.         add     bx,[left_panel_x.size_x]
  42.         sub     ebx,50+15+12
  43.         mov     cx,[left_panel_y.start_y]
  44.         call    calclulate_sort_button_1
  45.         mov     edx,145
  46. ;--------------------------------------
  47. .start:
  48.         mov     esi,0xffffff
  49.         dec     ebp
  50.         cmp     [left_sort_flag],ebp
  51.         jne     @f
  52.  
  53.         mov     esi,0xccccff
  54. ;--------------------------------------
  55. @@:
  56.         call    calclulate_sort_button_2
  57.         jnz     .start
  58.  
  59.         ret
  60. ;------------------------------------------------------------------------------
  61. calclulate_sort_button_1:
  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. ;------------------------------------------------------------------------------
  71. calclulate_sort_button_2:
  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+12
  84.         jmp     .continue
  85. ;--------------------------------------
  86. @@:
  87.         mov     bx,1
  88. ;--------------------------------------
  89. .continue:
  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. ;--------------------------------------
  108. @@:
  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
  119.         xor     ecx,ecx
  120.         mov     esi,eax
  121.         mcall
  122.         popa
  123.         dec     edx
  124.         sub     ebx,38 shl 16
  125.         mov     bx,36
  126.         dec     ebp
  127.         ret
  128. ;------------------------------------------------------------------------------
  129. draw_right_sort_button:
  130.         mov     bx,[right_panel_x.start_x]
  131.         add     bx,[right_panel_x.size_x]
  132.         sub     ebx,50+15+12
  133.         mov     cx,[right_panel_y.start_y]
  134.         call    calclulate_sort_button_1
  135.         mov     edx,149
  136. ;--------------------------------------
  137. .start:
  138.         mov     esi,0xffffff
  139.         dec     ebp
  140.         cmp     [right_sort_flag],ebp
  141.         jne     @f
  142.  
  143.         mov     esi,0xccccff
  144. ;--------------------------------------
  145. @@:
  146.         call    calclulate_sort_button_2
  147.         jnz     .start
  148.  
  149.         ret
  150. ;------------------------------------------------------------------------------
  151. draw_left_select_disk_button:
  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. ;--------------------------------------
  157. .1:
  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. ;--------------------------------------
  169. @@:
  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. ;--------------------------------------
  179. @@:
  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. ;------------------------------------------------------------------------------
  201. draw_right_select_disk_button:
  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. ;------------------------------------------------------------------------------
  208. ;draw_ATAPI_tray_control:
  209. ;       ret
  210. ;------------------------------------------------------------------------------
  211. calc_max_panel_line:
  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. ;------------------------------------------------------------------------------
  220. draw_icon:
  221.         pusha
  222.         test    [edx-40],byte 0x10
  223.         jnz     .draw_dir_pic
  224.  
  225.         call    get_icon_number
  226.         imul    ebx,270
  227.         add     ebx,icons_file_data
  228.         jmp     .draw
  229. ;--------------------------------------
  230. .draw_dir_pic:
  231.         mov     ebx,icons_file_data
  232.         cmp     [edx],word '..'
  233.         jne      .draw
  234.  
  235.         cmp     [edx+2],byte 0
  236.         jne     .draw
  237.  
  238.         add     ebx,270   ;*17
  239. ;--------------------------------------
  240. .draw:
  241.         mov     edx,[esp+16]    ;ebx
  242.         ror     edx,16
  243.         sub     edx,12
  244.         rol     edx,16
  245.         dec edx
  246.         mcall   7, ,<10,9>
  247.         popa
  248.         ret
  249. ;------------------------------------------------------------------------------
  250. ;       ÏÅÐÅÂÎÄ 10-ÍÛÕ ×ÈÑÅË ÑÎ ÇÍÀÊÎÌ Â ÑÒÐÎÊÎÂÛÉ ÂÈÄ
  251. ;       Âõîä:
  252. ;               AX - ÷èñëî
  253. ;               EBX - àäðåñ ñòðîêè
  254. ;       Âûõîä:
  255. ;               ñòðîêà ñîäåðæèò ÷èñëî, êîíåö îòìå÷åí êîäîì 0
  256. ;------------------------------------------------------------------------------
  257. decimal_string_2:
  258.         push    eax ebx ecx edx
  259.         xor     ecx,ecx
  260.         mov     [ebx],byte '0'
  261.         inc     ebx
  262. ;--------------------------------------
  263. .p3:
  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. ;--------------------------------------
  281. .p4:
  282.         pop     edx
  283.         mov     [ebx],dl
  284.         inc     ebx
  285.         loop    .p4
  286.         pop     edx ecx ebx eax
  287.         ret
  288. ;------------------------------------------------------------------------------
  289. decimal_string:
  290.         push    eax ebx ecx edx
  291.         mov     ecx,10
  292. ;--------------------------------------
  293. .p3:
  294.         xor     edx,edx
  295.         div     ecx
  296.         add     edx,48
  297.         mov     [ebx],dl
  298.         dec     ebx
  299.         test    eax,eax
  300.         jnz     .p3
  301.  
  302.         pop     edx ecx ebx eax
  303.         ret
  304. ;------------------------------------------------------------------------------
  305. draw_type_size_date:
  306.         pusha
  307.         test    [edx-40],byte 0x10
  308.         jz      .copy_type
  309.  
  310.         mov     [type_table],dword '<DIR'
  311.         mov     [type_table+4],word '> '
  312.         mov     [file_name_length],0
  313.         mov     [extension_size],0
  314.         jmp     .start  ;.size
  315. ;--------------------------------------
  316. .copy_type:
  317.         mov     [type_table],dword '    '
  318.         mov     [type_table+4],word '  '
  319. ;--------------------------------------
  320. .start:
  321.         mov     esi,edx
  322.         xor     eax,eax
  323. ;--------------------------------------
  324. @@:
  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. ;--------------------------------------
  339. @@:
  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. ;--------------------------------------
  360. @@:
  361.         sub     ecx,2
  362.         cmp     ecx,4
  363.         jbe     @f
  364.  
  365.         mov     ecx,4
  366.         mov     [type_table+4],word '..'
  367. ;--------------------------------------
  368. @@:
  369.         mov     edi,type_table  ;+1
  370.         cld
  371.         rep     movsb
  372.         mov     [edi],byte ' '
  373.         inc     edx
  374.         jmp     .size
  375. ;--------------------------------------
  376. .extension_size_0:
  377.         inc     edx
  378.         mov     [extension_size],0
  379. ;--------------------------------------
  380. .size:
  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. ;--------------------------------------
  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. ;--------------------------------------
  403. .copy_size:
  404. ;/0x1000000000000000 - EB
  405. ;/0x4000000000000 - PB
  406. ;/0x10000000000 - TB
  407. ;/0x40000000 - GB
  408. ;/0x100000 - MB
  409. ;/0x400 - KB
  410.         mov     [size_table],dword '    '
  411.         mov     [size_table+4],word '  '
  412.         push    ebx edx
  413.         push    ecx
  414.         mov     ecx,4
  415.         call    .qword_div
  416.         pop     ecx
  417.         jz      @f
  418.  
  419.         mov     ebx,size_table+3
  420.         call    decimal_string
  421.         mov     [ebx+1],byte 'E' ; Exa Byte
  422.         jmp     .size_convert_end
  423. ;--------------------------------------
  424. @@:
  425.         push    ecx
  426.         mov     ecx,3
  427.         call    .qword_div
  428.         pop     ecx
  429.         jz      @f
  430.  
  431.         mov     ebx,size_table+3
  432.         call    decimal_string
  433.         mov     [ebx+1],byte 'P' ; Peta Byte
  434.         jmp     .size_convert_end
  435. ;--------------------------------------
  436. @@:
  437.         push    ecx
  438.         mov     ecx,2
  439.         call    .qword_div
  440.         pop     ecx
  441.         jz      @f
  442.  
  443.         mov     ebx,size_table+3
  444.         call    decimal_string
  445.         mov     [ebx+1],byte 'T' ; Tera Byte
  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.  
  455.         mov     ebx,size_table+3
  456.         call    decimal_string
  457.         mov     [ebx+1],byte 'G' ; Giga Byte
  458.         jmp     .size_convert_end
  459. ;--------------------------------------
  460. @@:
  461.         mov     eax,[edx-40+32]
  462.         mov     ebx,eax
  463.         shr     eax,20 ; /(1024*1024)
  464.         test    eax,eax
  465.         jz      @f
  466.  
  467.         mov     ebx,size_table+3
  468.         call    decimal_string
  469.         mov     [ebx+1],byte 'M' ; Mega Byte
  470.         jmp     .size_convert_end
  471. ;--------------------------------------
  472. @@:
  473.         mov     eax,ebx
  474.         shr     eax,10 ; /1024
  475.         test    eax,eax
  476.         jz      @f
  477.  
  478.         mov     ebx,size_table+3
  479.         call    decimal_string
  480.         mov     [ebx+1],byte 'K' ; Kilo Byte
  481.         jmp     .size_convert_end
  482. ;--------------------------------------
  483. @@:
  484.         mov     eax,ebx
  485. ;.size_convert:
  486.         mov     ebx,size_table+4
  487.         call    decimal_string
  488. ;--------------------------------------
  489. .size_convert_end:
  490.         pop     edx ebx
  491. ;--------------------------------------
  492. .date:
  493.         cmp     [edx],word '..'
  494.         jne     @f
  495.        
  496.         cmp     [edx+2],byte 0
  497.         je      .not_show_date
  498. @@:
  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]
  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
  514.         pop     ebx
  515.         ror     ebx,16
  516.         add     bx,[left_panel_x.size_x]
  517.         sub     ebx,161 ;122+12+15
  518.         rol     ebx,16
  519.         mov     ecx,0
  520.         cmp     [marked_file],byte 0
  521.         je      @f
  522.  
  523.         mov     ecx,0xff0000
  524. ;--------------------------------------
  525. @@:
  526.         mcall   4,,,type_table,22
  527. ;--------------------------------------
  528. .not_show_date:
  529.         popa
  530.         ret
  531. ;------------------------------------------------------------------------------
  532. draw_folder_data:
  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. ;--------------------------------------
  544. .ok_left:
  545.         cmp     eax,[left_start_draw_line]
  546.         jae     @f
  547.  
  548.         mov     [left_start_draw_line],eax
  549. ;--------------------------------------
  550. @@:
  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. ;--------------------------------------
  563. .right_panel:
  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. ;--------------------------------------
  572. .ok_right:
  573.         cmp     eax,[right_start_draw_line]
  574.         jae     @f
  575.  
  576.         mov     [right_start_draw_line],eax
  577. ;--------------------------------------
  578. @@:
  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. ;--------------------------------------
  590. .type_folder:
  591.         xor     eax,eax
  592. ;--------------------------------------
  593. .start:
  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. ;--------------------------------------
  609. @@:
  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. ;--------------------------------------
  618. .continue_1:
  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. ;--------------------------------------
  629. @@:
  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
  641.         sub     eax,23+2+2+2
  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. ;--------------------------------------
  650. @@:
  651.         mov     ecx,0
  652.         cmp     [marked_file],byte 0
  653.         je      @f
  654.  
  655.         mov     ecx,0xff0000
  656. ;--------------------------------------
  657. @@:
  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. ;--------------------------------------
  672. .continue:
  673.         add     ebx,10
  674.         add     edx,304 ;10
  675.         pop     eax
  676.         inc     eax
  677.         jmp     .start
  678. ;--------------------------------------
  679. .end_1:
  680.         popa
  681. ;--------------------------------------
  682. .end_2:    
  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. ;--------------------------------------
  699. @@:
  700. .end:
  701.         cmp     [drawing_panel_folder],1
  702.         jne     @f
  703.  
  704.         call    draw_scroll_bar_left
  705.         ret
  706. ;--------------------------------------
  707. @@:
  708.         call    draw_scroll_bar_right
  709.         ret
  710. ;------------------------------------------------------------------------------
  711. clear_line:
  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. ;--------------------------------------
  732. .right:
  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. ;--------------------------------------
  741. .continue:
  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. ;--------------------------------------
  753. @@:
  754.         sub     ebx,12 shl 16+15
  755.         mcall   13,,,0xffffff
  756. ;--------------------------------------
  757. .end:
  758.         popa
  759. ;--------------------------------------
  760. .end_1:
  761.         ret
  762. ;------------------------------------------------------------------------------
  763. draw_left_panel:
  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. ;------------------------------------------------------------------------------
  772. draw_right_panel:
  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. ;------------------------------------------------------------------------------
  781. draw_left_panel_patch:
  782.         cmp     [select_panel_counter],0
  783.         jne     .end
  784.  
  785.         mov     edx,read_folder_name       ;read_folder.name
  786. ;--------------------------------------
  787. .1:
  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. ;--------------------------------------
  794. .end:
  795.         ret
  796. ;------------------------------------------------------------------------------
  797. draw_right_panel_patch:
  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. ;------------------------------------------------------------------------------
  804. clear_patch_area:
  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. ;------------------------------------------------------------------------------
  817. draw_left_panel_selection:
  818.         cmp     [select_panel_counter],0
  819.         jne     .end
  820.        
  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. ;--------------------------------------
  834. @@:
  835.         mov     [edx],cx
  836.         mov     ebx,[left_panel_x]
  837.         add     cx,[left_panel_y.start_y]
  838. ;--------------------------------------
  839. .1:
  840.         shl     ecx,16
  841.         mov     cx,10
  842.         sub     ebx,15
  843.         mcall   13,,,0xbbddff
  844. ;--------------------------------------
  845. .end:
  846.         ret
  847. ;------------------------------------------------------------------------------
  848. draw_right_panel_selection:
  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. ;--------------------------------------
  865. @@:
  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. ;------------------------------------------------------------------------------
  871. for_all_panel_selection:
  872.         imul    eax,10
  873.         cmp     ax,cx
  874.         jae     @f
  875.  
  876.         mov     cx,ax
  877. ;--------------------------------------
  878. @@:
  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. ;--------------------------------------
  887. @@:
  888.         ret
  889. ;------------------------------------------------------------------------------
  890. clear_left_panel:
  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. ;------------------------------------------------------------------------------
  909. calculate_panel_1:
  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. ;------------------------------------------------------------------------------
  917. clear_right_panel:
  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. ;------------------------------------------------------------------------------
  939. erase_fbutton:
  940.         mov     edx,0x80000065
  941.         mov     eax,8
  942.         mov     ebp,12
  943. ;--------------------------------------
  944. .start:
  945.         mcall
  946.         dec     ebp
  947.         jnz     .start
  948.  
  949.         ret
  950. ;------------------------------------------------------------------------------
  951. draw_fbutton:
  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.  
  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. ;--------------------------------------
  975. .start:
  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. ;--------------------------------------
  988. @@:
  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. ;--------------------------------------
  998. @@:
  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. ;--------------------------------------
  1012. @@:
  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. ;--------------------------------------
  1022. .rol_ror:
  1023.         rol     ebx,16
  1024.         add     ebx,[fbutton_width]
  1025.         ror     ebx,16
  1026. ;--------------------------------------
  1027. .exit:
  1028.         ret
  1029. ;------------------------------------------------------------------------------
  1030. draw_fbutton_name:
  1031.         mov     ebx, 7 shl 16
  1032.         add     ebx,[window_high]
  1033.         sub     ebx,19
  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. ;--------------------------------------
  1042. .type_1:
  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. ;--------------------------------------
  1052. .type:
  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. ;--------------------------------------
  1079. .type_shift:
  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. ;--------------------------------------
  1106. .type_ctrl:
  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. ;--------------------------------------
  1133. .type_alt:
  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. ;--------------------------------------
  1158. .type_all:
  1159.         mcall
  1160.         call    draw_fbutton.rol_ror
  1161.         ret
  1162. ;------------------------------------------------------------------------------
  1163.