Subversion Repositories Kolibri OS

Rev

Rev 1792 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;------------------------------------------------------------------------------
  2. confirmation_action:
  3.         mov     [work_confirmation],0
  4.         mov     [work_confirmation_yes],0
  5.         jmp     .red
  6. ;--------------------------------------
  7. .red_1:
  8.         call    draw_window
  9. ;--------------------------------------
  10. .red:
  11.         call    draw_confirmation_button
  12.         call    draw_confirmation_menu
  13. ;--------------------------------------
  14. .still:
  15.         mcall   10
  16.         cmp     eax,1
  17.         je      .red_1
  18.  
  19.         cmp     eax,2
  20.         je      key_menu_confirmation
  21.  
  22.         cmp     eax,3
  23.         jne     .still
  24.  
  25.         mcall   17
  26.         cmp     ah,161
  27.         je      .no_del
  28.  
  29.         cmp     ah,160
  30.         je      .del
  31.  
  32.         cmp     ah,1
  33.         jne     .still
  34.  
  35.         mcall   -1
  36. ;--------------------------------------
  37. .del:
  38.         mov     [work_confirmation_yes],1
  39. ;--------------------------------------
  40. .no_del:
  41.         call    draw_window
  42. ;--------------------------------------
  43. .ret:
  44.         ret
  45. ;------------------------------------------------------------------------------
  46. draw_confirmation_button:
  47.         mov     ecx,[window_high]
  48.         mov     ebx,[window_width]
  49.         shr     ecx,1
  50.         shr     ebx,1
  51.         sub     ebx,45
  52.         shl     ecx,16
  53.         shl     ebx,16
  54.         mov     cx,15
  55.         mov     bx,40
  56.         mcall   8,,,0x40000000+160,0xffffff
  57.         add     ebx,50 shl 16
  58.         inc     edx
  59.         mcall
  60.         ret
  61. ;------------------------------------------------------------------------------
  62. draw_confirmation_menu:
  63.         mov     ecx,[window_high]
  64.         mov     ebx,[window_width]
  65.         shr     ecx,1
  66.         shr     ebx,1
  67.         sub     ecx,22
  68.         sub     ebx,60
  69.         shl     ecx,16
  70.         shl     ebx,16
  71.         mov     cx,44
  72.         mov     bx,120
  73.         mcall   13,,,0x6060ff
  74.         push    ebx ecx
  75.         add     ebx,15 shl 16
  76.         add     ecx,22 shl 16
  77.         mov     bx,40
  78.         mov     cx,15
  79.         mov     edx,0
  80.         push    ebx ecx
  81.         cmp     [work_confirmation],0
  82.         jne     @f
  83.  
  84.         add     ebx,50 shl 16
  85. ;--------------------------------------
  86. @@:
  87.         mcall
  88.         add     ecx,1 shl 16
  89.         add     ebx,1 shl 16
  90.         mov     bx,38
  91.         mov     cx,13
  92.         mcall   ,,,0x6060ff
  93.         pop     ecx ebx
  94.         mov     edx,0xff0000
  95.         cmp     [work_confirmation],0
  96.         je      @f
  97.  
  98.         add     ebx,50 shl 16
  99.         mov     edx,0xaa00
  100. ;--------------------------------------
  101. @@:
  102.         mcall
  103.         pop     ecx     ebx
  104.         shr     ecx,16
  105.         mov     bx,cx
  106.         add     ebx,15 shl 16+5
  107.         mcall   4,,0x90ffffff,[confirmation_type]
  108.         add     ebx,7 shl 16+20
  109.         mcall   ,,,type_yes
  110.         add     ebx,56 shl 16
  111.         mcall   ,,,type_no
  112.         ret
  113. ;------------------------------------------------------------------------------
  114. key_menu_confirmation:
  115.         mcall   2
  116.         cmp     [extended_key],1
  117.         je      .extended_key
  118.  
  119.         test    al,al
  120.         jnz     .end_1
  121.  
  122.         cmp     ah,0xE0
  123.         jne     @f
  124. ;--------------------------------------
  125. .end_1:
  126.         jmp     confirmation_action.still
  127. ;--------------------------------------
  128. @@:
  129.         cmp     ah,75
  130.         je      confirmation_key_75.1
  131.  
  132.         cmp     ah,77
  133.         je      confirmation_key_75.1
  134.  
  135.         cmp     ah,28
  136.         je      confirmation_key_28.1
  137. ;--------------------------------------
  138. .end:
  139.         cmp     ah,1
  140.         jne     confirmation_action.still
  141.  
  142.         ret
  143. ;------------------------------------------------------------------------------
  144. .extended_key:
  145.         mov     [extended_key],0
  146. ;------------------------------------------------------------------------------
  147. confirmation_key_75:
  148.         cmp     ah,75   ; arrow left
  149.         je      .1
  150.  
  151.         cmp     ah,77   ; arrow right
  152.         jne     confirmation_key_28
  153. ;--------------------------------------
  154. .1:
  155.         dec     [work_confirmation]
  156.         and     [work_confirmation],1
  157.         jmp     confirmation_action.red
  158. ;------------------------------------------------------------------------------
  159. confirmation_key_28:
  160.         cmp     ah,28   ; Enter
  161.         jne     confirmation_action.still
  162. ;--------------------------------------
  163. .1:
  164.         cmp     [work_confirmation],0
  165.         jne     @f
  166.  
  167.         mov     [work_confirmation_yes],1
  168. ;--------------------------------------
  169. @@:
  170.         ret
  171. ;------------------------------------------------------------------------------