Subversion Repositories Kolibri OS

Rev

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

  1. ;---------------------------------------------------------------------
  2. key_menu:
  3.     mcall 2
  4.     cmp  [extended_key],1
  5.     je   .extended_key
  6.     test al, al
  7.     jnz  .end_1
  8.     cmp  ah, 0xE0
  9.     jne  @f
  10.     mov  [extended_key],1
  11. .end_1:
  12.     ret
  13. @@:
  14.     cmp  ah,72
  15.     je  menu_key_72.1
  16.     cmp  ah,80
  17.     je  menu_key_80.1
  18.     cmp  ah,28
  19.     je  menu_key_28.1
  20. .end:
  21.     cmp  ah,208
  22.     je  .end_1
  23.     cmp  ah,200
  24.     je  .end_1
  25.     cmp  ah,156
  26.     je  .end_1
  27.     cmp  ah,184
  28.     je  .end_5
  29.     cmp  ah,187
  30.     je  .end_1
  31.     cmp  ah,188
  32.     je  .end_1
  33.     cmp  ah,199
  34.     je  .end_1
  35.     cmp  ah,207
  36.     je  .end_1
  37.     cmp  ah,201
  38.     je  .end_1
  39.     cmp  ah,209
  40.     je  .end_1
  41.     cmp  ah,42  ; NumLock ON
  42.     je  .end_1
  43.     cmp  ah,170  ; NumLock ON
  44.     je  .end_1
  45.     cmp  ah,210
  46.     je  .end_1
  47.     cmp  ah,211
  48.     je  .end_1
  49.     cmp  ah,56
  50.     je  .end_4
  51.     cmp  ah,59
  52.     je  .end_2
  53.     cmp  ah,60
  54.     je  .end_3
  55. .for_all:
  56.     mov [close_menu],1
  57.     ret
  58.  
  59. .end_2:
  60.     cmp  [alt_flag],0
  61.     je   .for_all
  62.     cmp  [select_panel_counter],0
  63.     je  .end_1
  64.     mov [close_menu],2
  65.     ret
  66. .end_3:
  67.     cmp  [alt_flag],0
  68.     je   .for_all
  69.     cmp  [select_panel_counter],0
  70.     jne  .end_1
  71.     mov [close_menu],2
  72.     ret
  73. .end_4:
  74.     cmp  [alt_flag],1
  75.     je   .end_1
  76.     mov  [alt_flag],1
  77.     jmp  @f
  78. .end_5:
  79.     cmp  [alt_flag],0
  80.     je   .end_1
  81.     mov  [alt_flag],0
  82. @@:
  83.     call erase_fbutton
  84.     call draw_fbutton
  85.     ret
  86. ;---------------------------------------------------------------------
  87. .extended_key:
  88.     mov  [extended_key],0
  89. menu_key_80:
  90.     cmp  ah,80  ; arrow down
  91.     jne  menu_key_72
  92. .1:
  93.     mov  eax,[retrieved_devices_table_counter]
  94.     dec  eax
  95.     cmp  eax,[start_draw_menu_cursor_line]
  96.     je   @f
  97.     inc  [start_draw_menu_cursor_line]
  98. @@:
  99.     ret
  100. ;---------------------------------------------------------------------
  101. menu_key_72:
  102.     cmp  ah,72  ;arrow up
  103.     jne  menu_key_71
  104. .1:
  105.     cmp  [start_draw_menu_cursor_line],0
  106.     je   @f
  107.     dec  [start_draw_menu_cursor_line]
  108. @@:
  109.     ret
  110. ;---------------------------------------------------------------------
  111. menu_key_71:
  112.     cmp  ah,71    ;Home
  113.     je   @f
  114.     cmp  ah,73    ;PageUp
  115.     jne  menu_key_79
  116. @@:
  117.     mov   [start_draw_menu_cursor_line],0
  118.     ret
  119. ;---------------------------------------------------------------------
  120. menu_key_79:
  121.     cmp  ah,79    ; End
  122.     je   @f
  123.     cmp  ah,81    ; PageDown
  124.     jne  menu_key_82
  125. @@:
  126.     mov  eax,[retrieved_devices_table_counter]
  127.     dec  eax
  128.     mov   [start_draw_menu_cursor_line],eax
  129.     ret
  130. ;---------------------------------------------------------------------
  131. menu_key_82:
  132.     cmp  ah,82  ; Insert
  133.     jne  menu_key_83
  134.     mov  esi,[start_draw_menu_cursor_line]
  135.     imul esi,10
  136.     add  esi,retrieved_devices_table
  137.     inc  esi
  138.     cmp  [esi],word 'cd'
  139.     jne  @f
  140.     xor  ecx,ecx
  141.     mov  cl,[esi+2]
  142.     sub  ecx,0x30
  143.     mcall 24,5
  144. @@:
  145.     ret
  146. ;---------------------------------------------------------------------
  147. menu_key_83:
  148.     cmp  ah,83  ; Delete
  149.     jne  menu_key_28
  150.     mov  esi,[start_draw_menu_cursor_line]
  151.     imul esi,10
  152.     add  esi,retrieved_devices_table
  153.     inc  esi
  154.     cmp  [esi],word 'cd'
  155.     jne  @f
  156.     xor  ecx,ecx
  157.     mov  cl,[esi+2]
  158.     sub  ecx,0x30
  159.     mcall 24,4
  160. @@:
  161.     ret
  162. ;---------------------------------------------------------------------
  163. menu_key_28:
  164.     cmp  ah,28 ; Enter
  165.     jne  menu_key_end
  166. .1:
  167.     mov [press_enter_menu],1
  168.     ret
  169. menu_key_end:
  170.     jmp  key_menu.end
  171. ;---------------------------------------------------------------------
  172. key_menu_left:
  173.     mov  [close_menu],0
  174.     mov [press_enter_menu],0
  175.     call key_menu
  176.     cmp  [press_enter_menu],1
  177.     je   .press_enter_menu
  178.     cmp  [close_menu],0
  179.     je   draw_left_select_disk_menu.red
  180. .1:
  181. ;    mov   [left_panel_clear_all],1
  182.     call draw_left_panel
  183. ;    mov   [right_panel_clear_all],1
  184.     call draw_right_panel
  185.     cmp  [alt_flag],0
  186.     je   still
  187.     cmp  [close_menu],2
  188.     je   draw_right_select_disk_menu
  189.     jmp  still
  190. .press_enter_menu:
  191.     mov  esi,[start_draw_menu_cursor_line]
  192.     imul esi,10
  193.     add  esi,retrieved_devices_table
  194.     inc  esi
  195.     call copy_folder_name
  196.     mov  [left_start_draw_cursor_line],0
  197.     call proc_read_folder
  198.     jmp  still
  199. ;---------------------------------------------------------------------
  200. key_menu_right:
  201.     mov  [close_menu],0
  202.     mov [press_enter_menu],0
  203.     call key_menu
  204.     cmp  [press_enter_menu],1
  205.     je   .press_enter_menu
  206.     cmp  [close_menu],0
  207.     je   draw_right_select_disk_menu.red
  208. .1:
  209. ;    mov   [left_panel_clear_all],1
  210.     call draw_left_panel
  211. ;    mov   [right_panel_clear_all],1
  212.     call draw_right_panel
  213.     cmp  [alt_flag],0
  214.     je   still
  215.     cmp  [close_menu],2
  216.     je   draw_left_select_disk_menu
  217.     jmp  still
  218. .press_enter_menu:
  219.     mov  esi,[start_draw_menu_cursor_line]
  220.     imul esi,10
  221.     add  esi,retrieved_devices_table
  222.     inc  esi
  223.     call copy_folder_name_1
  224.     mov  [right_start_draw_cursor_line],0
  225.     call proc_read_folder_1
  226.     jmp  still
  227. ;---------------------------------------------------------------------
  228. draw_left_select_disk_menu:
  229.     call  device_detect_f70
  230.     mov  [select_panel_counter],0
  231.     call  draw_left_panel
  232.     call  draw_right_panel
  233.     mov  [start_draw_menu_cursor_line],0
  234. .red:
  235.     call  draw_left_menu
  236. .still:
  237.     mcall 10
  238.     cmp  eax,1
  239.     je   red
  240.     cmp  eax,2
  241.     je   key_menu_left
  242.     cmp  eax,3
  243.     je   @f
  244.     cmp   eax,6
  245.     je    mouse_menu_left
  246.     jmp  .still
  247. @@:
  248.     call draw_left_panel
  249.     jmp  button
  250. ;---------------------------------------------------------------------
  251. draw_right_select_disk_menu:
  252.     call  device_detect_f70
  253.     mov  [select_panel_counter],1
  254.     call  draw_left_panel
  255.     call  draw_right_panel
  256.     mov  [start_draw_menu_cursor_line],0
  257. .red:
  258.     call  draw_right_menu
  259. .still:
  260.     mcall 10
  261.     cmp  eax,1
  262.     je   red
  263.     cmp  eax,2
  264.     je   key_menu_right
  265.     cmp  eax,3
  266.     je   @f
  267.     cmp   eax,6
  268.     je    mouse_menu_right
  269.     jmp  .still
  270. @@:
  271.     call draw_right_panel
  272.     jmp  button
  273. ;---------------------------------------------------------------------
  274. draw_left_menu:
  275.     mov  ebx,[left_panel_x]
  276.     mov  bx,60
  277.     mov  ecx,[left_panel_y]
  278.     mov  eax,[retrieved_devices_table_counter]
  279.     mov  cx,ax
  280.     imul cx,10
  281.     mov  edx,0xffffcc
  282.         dec  ebx
  283.     mov  eax,13
  284.         mcall
  285.     call draw_menu_Selection
  286.     call draw_menu_data
  287.     ret
  288. ;---------------------------------------------------------------------
  289. draw_right_menu:
  290.     mov  ebx,[right_panel_x]
  291.     mov  bx,60
  292.     mov  ecx,[right_panel_y]
  293.     mov  eax,[retrieved_devices_table_counter]
  294.     mov  cx,ax
  295.     imul cx,10
  296.     mov  edx,0xffffcc
  297.     mov  eax,13
  298.         mcall
  299.     call draw_menu_Selection
  300.     call draw_menu_data
  301.     ret
  302. ;---------------------------------------------------------------------
  303. draw_menu_data:
  304.     mov  edx,retrieved_devices_table
  305.     shr  ecx,16
  306.     mov  bx,cx
  307.     mov  ebp,0
  308. .start:
  309.     mcall 4, ,0x80000000
  310.     add   ebx,10
  311.     add   edx,10
  312.     inc   ebp
  313.     cmp   ebp,[retrieved_devices_table_counter]
  314.     jne   .start
  315.     ret
  316. ;---------------------------------------------------------------------
  317. draw_menu_Selection:
  318.     push ebx ecx
  319.     mov  eax,[start_draw_menu_cursor_line]
  320.     imul eax,10
  321.     shl  eax,16
  322.     add  ecx,eax
  323.     mov  cx,10
  324.     mov  edx,0xbbffbb
  325.     mov  eax,13
  326.         mcall
  327.     pop  ecx ebx
  328.     ret
  329. ;---------------------------------------------------------------------
  330. mouse_menu_left:
  331.     mcall 37,2
  332.     mov  [mouse_keys],eax
  333.     mcall 37,1
  334.     mov  [mouse_position],eax
  335.     test eax,0x80000000
  336.     jnz   draw_left_select_disk_menu.still
  337.     test eax,0x8000
  338.     jnz   draw_left_select_disk_menu.still
  339.     mov   ebx,eax
  340.     shr   ebx,16
  341.     shl   eax,16
  342.     shr   eax,16
  343.     cmp   ebx,[window_width]
  344.     ja    draw_left_select_disk_menu.still
  345.     cmp   eax,[window_high]
  346.     ja    draw_left_select_disk_menu.still
  347.     xor   ecx,ecx
  348.     mov   cx,[left_panel_y.start_y]
  349.     cmp   ax,cx
  350.     jbe    .close
  351.     mov   edx,[retrieved_devices_table_counter]
  352.     imul  edx,10
  353.     add   cx,dx
  354.     cmp   ax,cx
  355.     jae    .close
  356.     mov   cx,[left_panel_x.start_x]
  357.     cmp   bx,cx
  358.     jbe    .close
  359.     add   cx,60
  360.     cmp   bx,cx
  361.     jae    .close
  362.     sub   ax,[left_panel_y.start_y]
  363.     mov   ebx,10
  364.     xor   edx,edx
  365.     div   ebx
  366.     mov   [start_draw_menu_cursor_line],eax
  367.     cmp   [mouse_keys],0
  368.     je    draw_left_select_disk_menu.red
  369.     jmp   key_menu_left.press_enter_menu
  370. .close:
  371.     cmp   [mouse_keys],0
  372.     je    draw_left_select_disk_menu.still
  373. ;    mov   [left_panel_clear_all],1
  374.     call  draw_left_panel
  375.     jmp   still
  376. ;---------------------------------------------------------------------
  377. mouse_menu_right:
  378.     mcall 37,2
  379.     mov  [mouse_keys],eax
  380.     mcall 37,1
  381.     mov  [mouse_position],eax
  382.     test eax,0x80000000
  383.     jnz   draw_right_select_disk_menu.still
  384.     test eax,0x8000
  385.     jnz   draw_right_select_disk_menu.still
  386.     mov   ebx,eax
  387.     shr   ebx,16
  388.     shl   eax,16
  389.     shr   eax,16
  390.     cmp   ebx,[window_width]
  391.     ja    draw_right_select_disk_menu.still
  392.     cmp   eax,[window_high]
  393.     ja    draw_right_select_disk_menu.still
  394.     xor   ecx,ecx
  395.     mov   cx,[right_panel_y.start_y]
  396.     cmp   ax,cx
  397.     jbe    .close
  398.     mov   edx,[retrieved_devices_table_counter]
  399.     imul  edx,10
  400.     add   cx,dx
  401.     cmp   ax,cx
  402.     jae    .close
  403.     mov   cx,[right_panel_x.start_x]
  404.     cmp   bx,cx
  405.     jbe    .close
  406.     add   cx,60
  407.     cmp   bx,cx
  408.     jae    .close
  409.     sub   ax,[right_panel_y.start_y]
  410.     mov   ebx,10
  411.     xor   edx,edx
  412.     div   ebx
  413.     mov   [start_draw_menu_cursor_line],eax
  414.     cmp   [mouse_keys],0
  415.     je    draw_right_select_disk_menu.red
  416.     jmp   key_menu_right.press_enter_menu
  417. .close:
  418.     cmp   [mouse_keys],0
  419.     je    draw_right_select_disk_menu.still
  420. ;    mov   [right_panel_clear_all],1
  421.     call  draw_right_panel
  422.     jmp   still
  423. ;---------------------------------------------------------------------