Subversion Repositories Kolibri OS

Rev

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

  1. ;------------------------------------------------------------------------------
  2. align 4
  3. context_menu_start:
  4.         mcall   40,00100111b
  5.         mov     ecx, [ctx_menu_PID]
  6.         mcall   18,21
  7.         mov     ecx, eax
  8.         mcall   18,3
  9.         call    draw_ctx_menu
  10. ;------------------------------------------------------------------------------
  11. align 4
  12. ctx_menu_still:
  13.         mcall   10
  14.         cmp     eax, 2
  15.         jz      ctx_menu_key
  16.  
  17.         cmp     eax, 3
  18.         jz      ctx_menu_button
  19.  
  20.         cmp     eax, 6
  21.         jz      ctx_menu_mouse
  22.  
  23.         call    draw_ctx_menu
  24.         jmp     ctx_menu_still
  25. ;------------------------------------------------------------------------------
  26. align 4
  27. ctx_menu_mouse:
  28.         mcall   37,2
  29.         xchg    eax,ecx ; …᫨ ­¥ ®¤­  ¨§ ª­®¯®ª ­¥ ­ ¦ â  ¢®§¢à é ¥¬áï
  30.                         ; ¢ £« ¢­ë© 横« ¯®â®ª 
  31.         jecxz   ctx_menu_still
  32.  
  33.         mcall   37,1
  34.  
  35.         cmp     ax, 0           ; ’ã⠯஢¥à塞 ¯à®¨§®èñ«-«¨ ª«¨ª §  ¯à¥¤¥« ¬¨ ®ª­  ª®­â¥ªáâ­®£®
  36.         jb      ctx_menu_exit   ; ¬¥­î, ¥á«¨ §  ¯à¥¤¥« ¬¨ â® § ªà뢠¥¬ ª®­â¥ªáâ­®¥ ¬¥­î
  37.  
  38.         cmp     ax, 60           ; 41
  39.         ja      ctx_menu_exit
  40.  
  41.         shr     eax, 16
  42.         cmp     ax, 0
  43.         jb      ctx_menu_exit
  44.  
  45.         cmp     ax, 133
  46.         ja      ctx_menu_exit
  47.  
  48.         jmp     ctx_menu_still
  49. ;------------------------------------------------------------------------------
  50. align 4
  51. ctx_menu_key:
  52.         mcall   2
  53. ;--------------------------------------
  54. align 4
  55. ctx_menu_button:
  56.         mcall   17
  57.         cmp     ah, 1
  58.         jne     @f
  59.  
  60. ;       mov     eax, 18
  61. ;       mov     ebx, 2
  62. ;       mov     ecx, [n_slot]
  63. ;       jmp     .lllxxx
  64.         mcall   18,3,[n_slot]
  65.         mcall   72,1,3,1
  66.         mcall   68,1
  67.         jmp     ctx_menu_exit
  68. ;--------------------------------------
  69. align 4
  70. @@:
  71.         cmp     ah, 2
  72.         jne     ctx_menu_still
  73.         mov     eax, 18
  74.         mov     ebx, 22
  75.         mov     edx, [n_slot]
  76.         xor     ecx, ecx
  77.  
  78.         test    [procinfo_for_detect+70],byte 2
  79.         setnz   cl
  80.         add     cl, cl
  81. ;--------------------------------------
  82. align 4
  83. .lllxxx:
  84.         mcall
  85.         jmp     ctx_menu_exit
  86. ;--------------------------------------
  87. align 4
  88. ctx_menu_exit:
  89.         or      eax,-1
  90.         mcall
  91. ;------------------------------------------------------------------------------
  92. align 4
  93. ;func  draw_ctx_menu
  94. draw_ctx_menu:
  95.         mcall   12, 1
  96.  
  97.         xor     eax, eax
  98.         movzx   ebx, [x_coord]
  99.         shl     ebx, 16
  100.         add     ebx, 133
  101.         movzx   ecx, [y_coord]
  102.         sub     ecx, 60         ; 41
  103.         shl     ecx, 16
  104.         add     ecx, 60         ; 41
  105.         mov     esi, [system_colours + 4]     ; sc.grab
  106.         or      esi, 0x81000000
  107.         mcall   ,,,[system_colours + 20],,[system_colours+8]
  108.  
  109.         mcall   8,<0,133>,<22,17>,0x40000001
  110.  
  111.         inc     edx
  112.         mcall   ,,<40,17>
  113.        
  114.         mov     ecx, [system_colours + 16]    ; sc.grab_text
  115.         or      ecx, 0x10000000
  116.         mcall   4,<32,4>,,ctx_menu_title,ctx_menu_title_end - ctx_menu_title
  117.  
  118.         add     ebx, 1 * 65536
  119.         mcall
  120.  
  121.         mcall   ,<4,28>,0x80000000,ctx_menu_text
  122.  
  123.         mov     edx, ctx_menu_text2
  124.  
  125.         test    byte [procinfo_for_detect+70], 2
  126.         jz      @f
  127.         mov     edx, ctx_menu_text3
  128. ;--------------------------------------
  129. align 4
  130. @@:
  131.         add     bx, 18
  132.         mcall
  133.  
  134.         mcall   12,2
  135.         ret
  136. ;endf
  137. ;------------------------------------------------------------------------------
  138. align 4
  139. x_coord rw      1
  140. y_coord rw      1
  141. n_slot  rd      1
  142. ctx_menu_PID    rd      1
  143. ;------------------------------------------------------------------------------
  144. lsz ctx_menu_text,\
  145.   ru, <"X ‡ ªàëâì    Alt + F4",0>,\
  146.   en, <"X Close      Alt + F4",0>,\
  147.   et, <"X Sulge      Alt + F4",0>,\
  148. ;------------------------------------------------------------------------------
  149. lsz ctx_menu_text2,\
  150.   ru, <25," ‘¢¥à­ãâì           ",0>,\
  151.   en, <25," Minimize           ",0>,\
  152.   et, <25," Minimeeri          ",0>,\
  153. ;------------------------------------------------------------------------------
  154. lsz ctx_menu_text3,\
  155.   ru, <24," ‚®ááâ ­®¢¨âì       ",0>,\
  156.   en, <24," Restore            ",0>,\
  157.   et, <24," Taasta             ",0>
  158. ;------------------------------------------------------------------------------
  159. ctx_menu_title:
  160.         db 'KolibriOS'
  161. ctx_menu_title_end:
  162. ;------------------------------------------------------------------------------