Subversion Repositories Kolibri OS

Rev

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

  1. ;--------------------------------------------------------------------
  2. ;--- à¨á®¢ ­¨¥ ª­®¯ª¨ á ⥪á⮬ ¢ á¥à¥¤¨­¥ --------------------------
  3. ;--------------------------------------------------------------------
  4. macro use_txt_button
  5. {
  6. txt_button:
  7. .draw:
  8. pusha
  9. ;--- ¯à®à¨á®¢ª  á ¬®© ª­®¯ª¨ ---
  10.         mov     eax,8
  11.         mov     ebx,[edi] ; [but.width]
  12.         mov     ecx,[edi+4] ;[but.height]
  13.         mov     edx,[edi+8];[but.id]
  14.         mov     esi,[edi+12];[but.color]
  15.         int     0x40
  16. ;--- ⥪áâ ­  ­¥© ---
  17.         ; áç¨â ¥¬ ª®«¨ç¥á⢮ ᨬ¢®«®¢
  18.         mov     edx,[edi+20]
  19.         xor     esi,esi
  20. .check_next_symbol:
  21.         cmp     [edx+esi],byte 0
  22.         je      .str_end
  23.         inc     esi      ; ¢ esi ¤«¨­  áâப¨ ¢ ᨬ¢®« å
  24.         jmp     .check_next_symbol
  25. .str_end:
  26.  
  27.         ; ¢ëç¨á«ï¥¬ ª®®à¤¨­ âë
  28.         lea     ebx,[esi*2+esi]
  29.         lea     ebx,[ebx*2] ; ¢ ebx ¤«¨­  áâப¨ ¢ ¯¨ªá¥«ïå
  30.  
  31.         ;not     ebx
  32.         neg     ebx
  33.         add     bx,[edi] ; [but.width]
  34.         sar     bx,1
  35.         inc     bx
  36.         add     bx,[edi+2];[but.left]  ; ¢ bx ¯®§¨æ¨ï á«¥¢ 
  37.         shl     ebx,16
  38.  
  39.  
  40.         mov     bx,[edi+4];[but.height]
  41.         sub     bx,8
  42.         sar     bx,1
  43.         add     bx,[edi+6];[but.top]   ; ¢ bx ¯®§¨æ¨ï ᢥàåã
  44.  
  45.         ; à¨á㥬 áâபã ⥪áâ 
  46.         mov     ecx,[edi+16] ;[but.text_color]
  47.         shr     eax,1
  48.         int     0x40
  49. popa
  50. ret
  51. }
  52.  
  53. struc txt_button width,left,height,top,id,color,text_color,text_ptr,\
  54. proc_addres
  55. {
  56. .width dw width ;+0
  57. .left dw left   ;+2
  58. .height dw height ;+4
  59. .top dw top       ;+6
  60. .id dd id         ;+8
  61. .color dd color   ;+12
  62. .text_color dd text_color  ;+16
  63. .text_ptr dd text_ptr      ;+20
  64. .proc_addres dd proc_addres+0 ;+24
  65. }
  66. but_struc_size=24+4
  67. macro draw_txt_buttons start,end
  68. {
  69.         mov     edi,start
  70.         mov     ecx,((end-start)/but_struc_size)
  71. @@:
  72.         call    txt_button.draw
  73.         add     edi,but_struc_size
  74.         loop    @b
  75. }
  76.  
  77. macro txt_but_set_sys_color start,end,color_table
  78. {
  79.         mov     edi,start
  80.         mov     esi,color_table
  81.         mov     ecx,((end-start)/but_struc_size)
  82. @@:
  83.         push    dword [esi+24]
  84.         pop     dword [edi+12]
  85.         push    dword [esi+28]
  86.         pop     dword [edi+16]
  87.         add     edi,but_struc_size
  88.         loop    @b
  89. }
  90.  
  91. macro txt_but_ev start,end
  92. {
  93.         mov     edi,start
  94.         mov     ecx,((end-start)/but_struc_size)
  95. .txt_but_next:
  96.         cmp     ah,[edi+8]
  97.         jne     @f
  98.         cmp     dword [edi+24],0
  99.         je      @f
  100.         pusha
  101.         call    dword [edi+24]
  102.         popa
  103. @@:
  104.         add     edi,but_struc_size
  105.         loop    .txt_but_next
  106. }