Subversion Repositories Kolibri OS

Rev

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

  1. ;Œ ªà®á ¤«ï ¢ë¢®¤  ®á­®¢­ëå ä㭪権 ª®â®àë¥ ¨á¯«ì§ãîâáï ¡®ªá®¬
  2. macro use_general_func
  3. {
  4. ;debug_func
  5. ;----------------------------------------------------------
  6. ;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ¢ë¤¥«¥­®© ç á⨠-----------------
  7. ;----------------------------------------------------------
  8. .draw_shift:
  9.         test    word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
  10.         jz      @f
  11.         mov     ebp,shift_color
  12.         mov     ebx,dword       ed_shift_pos
  13.         call    .sh_cl_
  14. @@:     ret
  15. ;----------------------------------------------------------
  16. ;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
  17. ;----------------------------------------------------------
  18. .draw_text:
  19. ;--- ¢ëç¨á«ï¥¬, ᪮«ìª® ¯®¬¥é ¥âáï ᨬ¢®«®¢ ---
  20. ;--- çâ®¡ë ¬ãá®à ­¥ à¨á®¢ âì ---
  21.         call    .get_n
  22.         mov     esi,ed_size
  23.         mov     ebx,ed_offset
  24.         sub     esi,ebx
  25.         cmp     eax,esi
  26.         jae     @F
  27.         mov     esi,eax         ;çâ®¡ë ­¥ ¢ë室¨âì §  ¯à¥¤¥«ë íªà ­ 
  28. ;--- à¨á㥬 ⥪áâ ---                                            
  29. @@:     mov     eax,4
  30.         mov     ebx,ed_left
  31.         mov     edx,ed_offset
  32.         add     ebx,2
  33.         shl     ebx,16
  34.         add     ebx,ed_top
  35.         mov     ecx,ed_text_color
  36.         add     ebx,4
  37.         add     edx,ed_text
  38.         mcall
  39. ret
  40. ;----------------------------------------------------------
  41. ;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ä®­  ----------------------------
  42. ;¢å®¤­ë¥ ¤ ­­ë¥
  43. ;eax
  44. ;edx - color
  45. ;----------------------------------------------------------
  46. ;¢å®¤ ⮫쪮 梥â edx
  47. .draw_bg:
  48.         mov     ebx,ed_left
  49.         add     ebx,1
  50.         mov     edx,ed_color
  51.         shl     ebx,16
  52.         add     ebx,ed_width
  53.         sub     ebx,1
  54. .draw_bg_eax:
  55.         mov     ecx,ed_top
  56.         mov     eax,13
  57.         add     ecx,1
  58.         shl     ecx,16
  59.         add     ecx,ed_height
  60.         dec     ecx
  61.         mcall  
  62. ret
  63. ;----------------------------------------------------------
  64. ;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ª®«¨ç¥á⢠ ᨬ¢®«®¢ ¢ ⥪ã饩 é¨à¨­¥ ª®¬¯®­¥­â 
  65. ;----------------------------------------------------------
  66. .get_n:
  67.         mov     eax,ed_width    ;¯®«ã祬 è¨à¨­ã ª®¬¯®­¥­â 
  68.         xor     edx,edx   ;१ã«ìâ â à á¯®«®£ ¥âáï ¢ ¯ à¥ edx:eax ¢ eax - ®áâ â®ª
  69.         sub     eax,4           ;¢ëç⨬ 4
  70.         mov     ebx,6           ;§ £à㧬¨ ¤¥«¨â¥«ì
  71.         div     ebx             ;à §¬¤¥«¨¬ ­  6
  72. ret
  73. ;----------------------------------------------------------
  74. ;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï ªãàá®à  --------------------------
  75. ;----------------------------------------------------------
  76. ;¢å®¤­ë¥ ebp- 梥â
  77. .clear_cursor:
  78.         mov     edx,ebp
  79.         mov     ebx,cl_curs_x
  80.         mov     ecx,cl_curs_y
  81.         jmp     .draw_curs
  82. .draw_cursor:
  83.         mov     edx,ed_text_color
  84.         mov     ebx,ed_pos
  85.         mov     ecx,ed_offset
  86.         sub     ebx,ecx
  87.  
  88.         lea     ebx,[ebx*2+ebx]
  89.         shl     ebx,1
  90.         ;imul   ebx,6
  91.         add     ebx,ed_left
  92.         mov     ecx,ed_top
  93.         inc     ebx
  94.         add     ecx,2
  95.         mov     ebp,ebx
  96.         shl     ebx,16
  97.         mov     bx,bp
  98.         mov     ebp,ecx
  99.        
  100.         shl     ecx,16
  101.         mov     cx,bp
  102.         add     ecx,ed_height-4
  103.        
  104.         mov     cl_curs_x,ebx
  105.         mov     cl_curs_y,ecx
  106. .draw_curs:              
  107.         mcall   38
  108. ret
  109. ;----------------------------------------------------------
  110. ;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï à ¬ª¨ ----------------------------
  111. ;----------------------------------------------------------
  112. .draw_border:
  113. ;--- 梥â à ¬ª¨ ---
  114.         test    word ed_flags,ed_focus
  115.         mov     edx,ed_focus_border_color
  116.         jne     @f
  117.         mov     edx,ed_blur_border_color
  118. @@:
  119. ;--- ᢥàåã ---
  120.         mov     eax,38
  121.         mov     ebx,ed_left
  122.         mov     ecx,ebx
  123.         shl     ebx,16
  124.         mov     bx,cx
  125.         add     ebx,ed_width
  126.         mov     ecx,ed_top
  127.         mov     esi,ecx
  128.         shl     ecx,16
  129.         mov     cx,si
  130.         mcall
  131. ;--- á­¨§ã ---
  132.         mov     esi,ecx
  133.         add     ecx,ed_height
  134.         mov     ebp,ecx
  135.         shl     ecx,16
  136.         mov     cx,bp
  137.         mcall
  138. ;--- á«¥¢  ---
  139.         mov     cx,si
  140.         mov     ebp,ebx
  141.         sub     ebx,ed_width
  142.         mcall
  143. ;--- á¯à ¢  ---
  144.         mov     ebx,ebp
  145.         shl     ebx,16
  146.         mov     bx,bp
  147.         mcall
  148. ret
  149. ;----------------------------------------------------------
  150. ;--- ¯à®¢¥àª , § è¥« «¨ ªãàá®à §  £à ­¨æë ¨, ¥á«¨ ­ ¤®, ---
  151. ;--- ¨§¬¥­ï¥¬ ᬥ饭¨¥ ------------------------------------
  152. ;--- ¥á«¨ ᬥ饭¨¥ ¡ë«® ãáâ ­®¢ª  ä« £  ed_offset_cl ¨­ ç¥
  153. ; ¥á«¨ ­¨ç¥£® ­¥ ¨§¬¥­¨«®áì â® ¢ëáâ ¢«¥­¨¥ ed_offset_fl
  154. ; ¢ ®¡é¥© ¡¨â®¢®© ¬ àà¨æ¥ á®áâ®ï­¨ï ª®¬¯®­¥­â®¢ word ed_flags
  155. ;----------------------------------------------------------
  156. .check_offset:
  157. pusha
  158.         mov     ecx,ed_pos
  159.         mov     ebx,ed_offset
  160.         cmp     ebx,ecx
  161.         ja      .sub_8
  162.  
  163.         push    ebx
  164.         call    .get_n                  ;¯®«ã稬 ª®«-¢® ᨬ¢®«®¢ ¢ ¯ à¥ ॣ¨áâ஢ edx:eax
  165.         pop     ebx
  166.         mov     edx,ebx
  167.         add     edx,eax         ;ed_offset+width editbox
  168.         inc     edx             ;­¥®¡å®¤¨¬® ¤«ï ­®¬ «ì­®£® ¯®«®¦¥­¨ï ªãàá®à  ¢ ªà ©­¥© «¥¢®© ¯®§¨æ¨¨
  169.         cmp     edx,ecx
  170.         ja      @f
  171.  
  172.         mov     edx,ed_size
  173.         cmp     edx,ecx
  174.         je      .add_end
  175.  
  176.         sub     edx,ecx
  177.         cmp     edx,8
  178.         jbe     .add_8
  179.         add     ebx,8
  180.         jmp     .chk_d
  181.  
  182. .sub_8: cmp     ecx,0
  183.         je      .sub_min
  184.         cmp     ebx,8
  185.         jbe     .sub_min
  186.         sub     ebx,8   ;ebx=ed_offset
  187.         jmp     .chk_d
  188. .sub_min:
  189.         xor     ebx,ebx
  190.         jmp     .chk_d
  191.  
  192. .add_end:sub    edx,eax
  193.         mov     ebx,edx
  194.         jmp     .chk_d
  195. .add_8: add     ebx,edx
  196. .chk_d: mov     ed_offset,ebx
  197.         call    .draw_bg
  198.         and     word ed_flags,ed_offset_cl
  199. edit_ex
  200. @@:
  201.         or      word ed_flags,ed_offset_fl
  202. edit_ex
  203. }
  204.  
  205. macro use_key_func
  206. {
  207. ;Ž¡à ¡®âª  Shift ¤«ï á­ïâ¨ï ¢ë¤¥«¥­¨ï ­¥¨§¢¥áâ­®© ®¡« áâ¨
  208. .shift: ;;;;;;;SHIFT
  209.         test    word ed_flags,ed_shift
  210.         je      .f_exit
  211.  
  212. @@:     mov     ebp,shift_color
  213.         or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
  214.         mov     ebx,dword       ed_shift_pos
  215.         call    .sh_cl_
  216.         jmp     .draw_cursor_text
  217. ;;;;;;;;;;;;;;;;;;;;;
  218. .f_exit:call    .check_offset
  219.         and     word ed_flags,ed_shift_cl
  220.         call    .enable_null
  221.         jmp     .draw_cursor_text
  222. .sh_cl_:
  223. ;;;;;;SHIFT end
  224. ;®¡à ¡®âª  ®ç¨á⪨, ¯à¨ «¥¢®¬ - ¯à ¢®¬ ¤¢¨¦¥­¨¨ ¢ë¤¥«¥­¨ï
  225. ;¤«ï ®¡à ¡®âª¨ á­ïâ¨ï ¢ë¤¥«¥­¨ï
  226. ;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
  227.         mov     eax,dword       ed_pos
  228.         cmp     eax,ebx
  229.  
  230.         jae     .sh_n
  231.         push    eax  ;¬¥­ì襥 ¢ eax
  232.         push    ebx  ;¡®«ì襥
  233.         jmp     .sh_n1
  234.                      ;¥á«¨ ¨­ ç¥
  235. .sh_n:  push    ebx  
  236.         push    eax
  237. .sh_n1:
  238.         call    .check_offset
  239.         call    .get_n
  240.         mov     edx,eax ;size of ed_box
  241.         mov     ecx,ed_offset
  242.         add     eax,ecx ;eax = w_off= ed_offset+width
  243.         mov     edx,eax ;save
  244.         pop     ebx     ;¡®«ì襥
  245.         pop     eax     ;¬¥­ì襥
  246.  
  247.         cmp     eax,ecx         ;áà ¢­¥­¨¥ á ¬¥­ì襣® á offset.
  248.         jae     .f_f            ;¥á«¨ ¡®«ìè¥
  249.         xor     eax,eax
  250.         cmp     edx,ebx         ;cà ¢­¨¬ à §¬¥à w_off á ¡®«ì訬
  251.         jb      @f
  252.         sub     ebx,ecx
  253.         jmp     .nxt_f
  254. @@:     mov     ebx,edx
  255.         sub     ebx,ecx
  256.         jmp     .nxt_f
  257. .f_f:  
  258.         sub     eax,ecx
  259.         cmp     edx,ebx         ;cà ¢­¨¬ à §¬¥à w_off á ¡®«ì訬
  260.         jle     @f
  261.         sub     ebx,ecx
  262.         sub     ebx,eax
  263.         jmp     .nxt_f
  264. @@:
  265.         mov     ebx,edx
  266.         sub     ebx,ecx
  267.         sub     ebx,eax
  268. .nxt_f:
  269.         mov     edx,ebx
  270.         lea     ebx,[eax*2+eax]
  271.         shl     ebx,1
  272.         add     ebx,ed_left
  273.         inc     ebx
  274.         shl     ebx,16
  275.         lea     ecx,[edx*2+edx]
  276.         shl     ecx,1  
  277.         mov     bx,cx
  278.         inc     ebx
  279.         mov     edx,ebp;shift_color
  280.  
  281.         call    .draw_bg_eax
  282. @@:     call    .enable_null
  283.         ret
  284. ;;;;;;;;;;;;;;;;;;;;;
  285. ;“áâ ­®¢ª - á­ï⨥ ¢ë¤¥«¥­¨ï ¢ ®¤¨­ ᨬ¢®«
  286. ;;;;;;;;;;;;;;;;;;;;;
  287. .drw_sim:
  288.         mov     eax,dword       ed_pos
  289.         call    .draw_rectangle   ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª á § ¤ ­­ë¬ 梥⮬
  290.         jmp     @b
  291. ;;;;;;;;;;;;;;;;;;;;;
  292. ;”ãªæ¨ï ãáâ ­®¢ª¨ ¢ë¤¥«¥­¨ï ¯à¨ ¤¢¨¦¥­¨ï ¢«¥¢® ¨ ¢¯à ¢® ¨ ­ ¦ â¨¨ shift
  293. ;‹®£¨ª :
  294. ;;;;;;;;;;
  295. .draw_wigwag:
  296. ;äã­ªæ¨ï ãáâ ­®¢ª¨ ¯¥à¥¬¥­­ëå
  297.         mov     ebp,shift_color
  298.         call    .clear_cursor
  299.  
  300.         or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
  301.         mov     ebp,shift_color
  302.         mov     eax,dword       ed_pos
  303.         test    word ed_flags,ed_left_fl
  304.         jz      .low
  305.         jmp     @f
  306. ;;;;;;;;;;
  307. ;”ãªæ¨ï 㤠«¥­¨ï ¢ë¤¥«¥­¨ï ¯à¨ ¤¢¨¦¥­¨ï ¢«¥¢® ¨ ¢¯à ¢® ¨ ­ ¦ â¨¨ shift
  308. ;‹®£¨ª :
  309. ;;;;;;;;;;
  310. .draw_wigwag_cl:
  311. ;äã­ªæ¨ï ãáâ ­®¢ª¨ ¯¥à¥¬¥­­ëå
  312.         mov     ebp,ed_color
  313.         call    .clear_cursor
  314.  
  315.         mov     ebp,ed_color
  316.         mov     eax,dword       ed_pos
  317.         test    word ed_flags,ed_left_fl
  318.         jz      .low
  319. @@:     call    .draw_rectangle  ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª § ªà è¨¢ ¥¬®© ®¡« áâ¨
  320.         ret
  321. .low:   dec     eax
  322.         jmp     @b
  323. ;¢å®¤­®© ¯ à ¬¥âà ebx - ed_pos
  324. .sh_first_sh:
  325.         test    word ed_flags,ed_shift
  326.         je      @f
  327.         mov     dword ed_shift_pos_old,ebx
  328.         test    word ed_flags,ed_shift_on
  329.         jne     @f
  330.         mov     dword ed_shift_pos,ebx
  331.         or      word ed_flags,ed_shift_on
  332. @@:     ret
  333. ;Ž¡à ¡®âª  ªà ©­¨å ¯®«®¦¥­¨© ¢ editbox ¯à¨ ­ ¦ â®¬ shift
  334. ;¯à®¨§¢®¤¨â á­ï⨥ ¢ë¤¥«¥­¨¥, ¥á«¨ ­¥â shift
  335. ;¨­ ç¥ ¢®®¡é¥ ¢ë室¨â
  336. .sh_st_of:
  337.         test    word ed_flags,ed_shift
  338.         jne     @f
  339.         test    word ed_flags,ed_shift_bac
  340.         je      @f
  341.         mov     ebp,ed_color
  342.         mov     ebx,dword       ed_shift_pos
  343.         call    .sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
  344.         and     word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣® çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥
  345.         jmp     .draw_cursor_text
  346. @@:
  347.         and     word ed_flags,ed_shift_off
  348. edit_ex
  349. ;¯à®¢¥àª  á®áâ®ï­¨ï shift ¡ë« «¨ ®­ ­ ¦ â à ­ìè¥?
  350. .sh_enable:
  351.         test    word ed_flags,ed_shift
  352.         jne     .sh_ext_en ;­ à¨á®¢ âì § ªà è¥­ë© ¯àאַ㣮«ì­¨ª
  353.  
  354.         test    word ed_flags,ed_shift_bac
  355.         je      @f
  356.         call    .check_offset
  357.  
  358.         mov     ebp,ed_color
  359.         mov     ebx,dword       ed_shift_pos
  360.         call    .sh_cl_  ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
  361.         call    .draw_wigwag_cl
  362.         and     word ed_flags,ed_shift_cl ; 1¢ à ­¥ ­ã¦­®
  363.         ret
  364.  
  365. @@:     mov     ebp,ed_color
  366.         call    .clear_cursor
  367.         call    .check_offset
  368.         ret
  369. .sh_ext_en:    
  370.         call    .check_offset
  371.         test    word ed_flags,ed_offset_fl
  372.         je      @f
  373. ;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
  374.         mov     eax,dword       ed_shift_pos
  375.         mov     ebx,dword       ed_pos
  376.         mov     ecx,dword       ed_shift_pos_old
  377. ;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­ëå ®¡« á⥩
  378.         cmp     eax,ecx
  379.         je      .1_shem
  380.         jb      .smaller
  381.         cmp     ecx,ebx
  382.         ja      .1_shem
  383.         call    .draw_wigwag_cl ;clear
  384.         jmp     .sh_e_end
  385. .smaller:
  386.         cmp     ecx,ebx
  387.         jb      .1_shem
  388.         call    .draw_wigwag_cl ;clear
  389.         jmp     .sh_e_end
  390. ;alike  =
  391. .1_shem: call   .draw_wigwag
  392. .sh_e_end:      and     word ed_flags,ed_shift_off
  393.         ret
  394. @@:     mov     ebp,shift_color
  395.         mov     ebx,dword       ed_shift_pos
  396.         call    .sh_cl_
  397.         jmp     .sh_e_end
  398. ;äã­ªæ¨ï ¤«ï ®¡à ¡®âª¨ shift ¯à¨ ­ ¦ â¨¨ home and end
  399. .sh_home_end:
  400.         mov     ebp,ed_color
  401.         call    .clear_cursor
  402.         test    word ed_flags,ed_shift_bac
  403.         je      @f
  404.         mov     ebp,ed_color
  405.         mov     ebx,dword       ed_shift_pos_old
  406.         call    .sh_cl_
  407.  
  408. @@:     test    word ed_flags,ed_shift
  409.         je      .sh_exit_ ;¢ë©â¨
  410.         mov     ebp,shift_color
  411.         mov     ebx,dword       ed_shift_pos
  412.         call    .sh_cl_
  413.         or      word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
  414.         jmp     .sh_e_end
  415. .sh_exit_:      call    .check_offset
  416.         ret
  417. ;äã­ªæ¨ï ¢­¥á¥­¨ï 0 ¯®  ¤à¥áã ed_size+1
  418. .enable_null:
  419.         pusha
  420.         mov     eax,ed_size
  421.         mov     ebx,ed_text
  422.         test    eax,eax
  423.         add     eax,ebx
  424.         jne     @f
  425.         inc     eax
  426. @@:     xor     ebx,ebx
  427.         mov     [eax],bl
  428. edit_ex
  429. ;- 㤠«¥­¨¥ ᨬ¢®« 
  430. ;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
  431. .del_char:
  432.         mov     esi,ed_text
  433.         test    word ed_flags,ed_shift_on
  434.         je      @f
  435.         mov     eax,dword ed_shift_pos
  436.         mov     ebx,esi
  437.         cmp     eax,ecx
  438.         jae     .dh_n
  439.  
  440.         mov     ed_pos,eax      ;çâ® ¡ë ­¥ ¡ë«® ã¡¥£ ­¨ï ªãàá®à 
  441.         mov     ebp,ecx
  442.         sub     ebp,eax
  443.         add     ebx,eax  ;eax ¬¥­ìè¥
  444.         sub     edx,ecx
  445.         add     esi,ecx
  446.  
  447.         mov     dword ed_shift_pos,ebp
  448.         jmp     .del_ch_sh
  449.                      ;¥á«¨ ¨­ ç¥
  450. .dh_n:  
  451.         mov     ebp,eax
  452.         sub     ebp,ecx
  453.         add     ebx,ecx
  454.         sub     edx,eax
  455.         add     esi,eax
  456.         mov     dword ed_shift_pos,ebp
  457.         jmp     .del_ch_sh
  458.  
  459. @@:     add     esi,ecx ;㪠§ â¥«ì + ᬥ饭¨¥ ª ॠ«ì­®¬ã ¡ãää¥àã
  460.         mov     ebx,esi
  461.         inc     esi
  462.         cld
  463.  
  464.         sub     edx,ecx
  465. .del_ch_sh:
  466.  
  467.         push    edi
  468.         mov     edi,ebx
  469. @@:
  470.         lodsb
  471.         stosb
  472.         dec edx
  473.         jns @b
  474.        
  475.         pop edi
  476.         ret
  477. ;¢ëç¨á«¨âì § ªà è¨¢ ¥¬ãî ®¡« áâì
  478. ;ᮣ« è¥­¨¥ ¢ ebp - ¯¥à¥¤ ¥âáï ed_size
  479. .clear_bg:
  480.         call    .get_n  ;¯®«ãç¨âì à §¬¥à ¢ ᨬ¢®« å è¨à¨­ë ª®¬¯®­¥­â 
  481.         push    eax
  482.         mov     ebx,ed_offset
  483.         add     eax,ebx ;eax = w_off= ed_offset+width
  484.         mov     ebx,ebp ;ed_size
  485.        
  486.         cmp     eax,ebx
  487.         jb      @f
  488.         mov     eax,ed_pos
  489.         sub     ebx,eax
  490.         mov     ecx,ed_offset
  491.         sub     eax,ecx
  492.         jmp     .nxt
  493. @@:     mov     ebx,ed_pos
  494.         push    ebx
  495.         sub     eax,ebx
  496.         mov     ebx,eax ;It is don't optimal
  497.        
  498.         pop     eax     ;ed_pos
  499.         mov     ecx,ed_offset
  500.         sub     eax,ecx
  501. .nxt:
  502.         mov     ebp,eax  ;¯à®¢¥àª  ­  ¢ë室 § ªà è¨¢ ¥¬®© ®¡« á⨠§  ¯à¥¤¥«ë ¤«¨­ë
  503.         add     ebp,ebx
  504.         pop     edx
  505.         cmp     ebp,edx
  506.         je      @f
  507.         inc     ebx
  508.  
  509. @@:     mov     edx,ebx
  510.         lea     ebx,[eax*2+eax]
  511.         shl     ebx,1
  512.         add     ebx,ed_left
  513.         inc     ebx
  514.         shl     ebx,16
  515.         lea     ecx,[edx*2+edx]
  516.         shl     ecx,1  
  517.         mov     bx,cx
  518.         mov     edx,ed_color
  519.         call    .draw_bg_eax
  520.         ret
  521. ;;;;;;;;;;;;;;;;;;;
  522. ;;; Ž¡à ¡®âª  ¯à¨¬¨â¨¢®¢
  523. ;;;;;;;;;;;;;;;;;;;;
  524. ; à¨á®¢ âì ¯àאַ㣮«ì­¨ª, 梥⠯¥à¥¤ ¥âáï ¢ ebp
  525. ;¢å®¤­ë¥ ¯ à ¬¥âàë:
  526. ;eax=dword ed_pos
  527. ;ebp=-梥â ed_color or shift_color
  528. .draw_rectangle:
  529.         mov     ecx,dword ed_offset
  530.         sub     eax,ecx
  531.         lea     ebx,[eax*2+eax]
  532.         shl     ebx,1
  533.         inc     ebx
  534.         add     ebx,ed_left
  535.         shl     ebx,16
  536.         add     ebx,6
  537.         mov     edx,ebp
  538.         call    .draw_bg_eax
  539.         ret
  540. ;;;;;;;;;;;;;;;;;;
  541. ;;à®¢¥àª  ­ ¦ â «¨ shift
  542. ;;;;;;;;;;;;;;;;;;
  543. .check_shift:
  544. pusha   ;á®åà ­¨¬ ¢á¥ ॣ¨áâàë
  545.         mcall   66,3
  546.         test    al,0x03
  547.         je      @f
  548.         or      word ed_flags,ed_shift   ;ãáâ ­®¢¨¬ ä« £
  549. @@:edit_ex
  550. }
  551. ;¬ ªà®á ª« ¢¨è ­  ª®â®àë¥ ¯à®¨á室¨â ॠªæ¨ï
  552. macro use_key_process backspase,delete,left,right,home,end,insert
  553. {
  554. if backspase eq
  555. else
  556.         cmp     ah,8
  557.         jz      .backspace
  558. end if
  559. if delete eq
  560. else
  561.         cmp     ah,0xb6
  562.         jz      .delete
  563. end if
  564. if left eq
  565. else
  566.         cmp     ah,176
  567.         jz      .left
  568. end if
  569. if right eq
  570. else
  571.         cmp     ah,179
  572.         jz      .right
  573. end if
  574. if home eq
  575. else
  576.         cmp     ah,180
  577.         jz      .home
  578. end if
  579. if home eq
  580. else
  581.         cmp     ah,181
  582.         jz      .end
  583. end if
  584. if insert eq
  585. else
  586.         cmp     ah,185  ;insert
  587.         jz      .insert
  588. end if
  589. }
  590. macro use_key_no_process  up,down,esc,enter,tab,numl,capsl,scrolll
  591. {
  592. if up eq
  593. else
  594.         cmp     ah,177
  595.         jz      edit_box.editbox_exit
  596. end if
  597. if down eq
  598. else
  599.         cmp     ah,178
  600.         jz      edit_box.editbox_exit
  601. end if
  602. if esc eq
  603. else
  604.         cmp     ah,27   ;ESC - ª« ¢¨è  ))
  605.         jz      edit_box.editbox_exit
  606. end if
  607. if enter eq
  608. else
  609.         cmp     ah,13   ;ENTER - ª« ¢¨è  ))
  610.         jz      edit_box.editbox_exit
  611. end if
  612. if tab eq
  613. else
  614.         cmp     ah,9   ;TAB - ª« ¢¨è  ))
  615.         jz      edit_box.editbox_exit
  616. end if
  617.  
  618. if numl eq
  619. else
  620.         cmp     ah,4   ;Num Lock - ª« ¢¨è  ))
  621.         jz      edit_box.editbox_exit
  622. end if
  623.  
  624. if capsl eq
  625. else
  626.         cmp     ah,2   ;Caps Lock - ª« ¢¨è  ))
  627.         jz      edit_box.editbox_exit
  628. end if
  629.  
  630. if scrolll eq
  631. else
  632.         cmp     ah,1   ;Scroll Lock - ª« ¢¨è  ))
  633.         jz      edit_box.editbox_exit
  634. end if
  635.  
  636. }
  637.  
  638. macro use_key_figures_only
  639. {
  640.         test    word ed_flags,ed_figure_only  ; ⮫쪮 æ¨äàë ?
  641.         jz      @f
  642.         cmp     ah,'0'
  643.         jb      .editbox_exit
  644.         cmp     ah,'9'
  645.         ja      .editbox_exit
  646. @@:
  647. }
  648. macro are_key_shift_press
  649. {
  650.         test    word ed_flags,ed_shift_on
  651.         je      @f
  652.         ;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
  653.         push    eax
  654.         mov     edx,ed_size
  655.         mov     ecx, ed_pos
  656.         pusha
  657. ;;;;;;;;;;;;;;;;;;;;;
  658. ;clear input arrea
  659.         mov     ebp,ed_color
  660.         mov     ebx,dword       ed_shift_pos
  661.         call    .sh_cl_
  662.         mov     ebp,ed_size
  663.         call    .clear_bg
  664. ;;;;;;;;;;;;;;;;;;;;;
  665.         popa
  666.         call    .del_char
  667. ;;;;
  668.         mov     eax,dword ed_shift_pos
  669.         mov     ebx,ed_size
  670.         sub     ebx,eax
  671.         mov     ed_size,ebx
  672.         pop     eax
  673. @@:
  674. }
  675. macro are_key_cur_end
  676. {
  677.         mov     ecx,ed_size
  678.         mov     edx, ed_max
  679.         test    word ed_flags,ed_insert
  680.         jne     @f
  681.         cmp     ecx,edx
  682.         jae     .editbox_exit
  683. @@:     mov     ebx, ed_pos
  684.         cmp     ebx,edx
  685.         jl      @f ; ¥á«¨ ¬¥­ìè¥ ¨«¨ à ¢­®
  686.         jmp     .editbox_exit
  687.  
  688. @@:     ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à  ¢¯à ¢®
  689.         mov     ecx,ed_size
  690.         push    edi eax
  691.         mov     ebp,edi
  692.         mov     esi,ed_text     ; “ª § â¥«ì ­  ¡ãä¥à
  693.                                 ;ã¤¥¬ à ¡®â âì á® áâப®©
  694.         add     esi,ecx         ;add ed_size ¤®¡ ¢¨¬ max size
  695.         mov     edi,esi
  696.  
  697.         cmp     ecx,ebx         ;…᫨ ã ­ á ¯®§¨æ¨ï ªãàá®à  = ⥪ã饬ã à §¬¥àã ­ ¯¥ç â ­­ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®­æ¥
  698.         je      .In_k
  699.  
  700.         test    word [ebp+40],ed_insert ;IF insert is enable  â.ª. edi ¨§¬¥­¥­  ¤à¥á㥬 ç¥à¥§ ebp
  701.         jne     .ins_v
  702. ;clear
  703. pusha
  704.         mov     edi,ebp
  705.         mov     ebp,ed_size
  706.         call    .clear_bg
  707. popa
  708.         sub     ecx,ebx         ; ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥­¨ï.
  709.         inc     edi             ;‘¬¥á⨬ ­ è¨ ᨬ¢®«ë ¢ ¯à ¢®
  710.         std
  711.         inc     ecx
  712.    @@:  
  713.         ;--------
  714.         lodsb
  715.         stosb
  716.         ;--------
  717.         loop    @b
  718. .In_k:  cld
  719.         pop eax
  720.         mov al,ah
  721.         stosb
  722.         pop edi
  723. ; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à
  724.         ; 㢥«¨ç¨¢ ¥¬ §­ ç¥­¨¥ à §¬¥à  ¨ ¯®§¨æ¨¨
  725.         inc      dword ed_size
  726.         inc      dword ed_pos
  727.         call    .draw_all2
  728.         jmp     .shift
  729. }
  730. macro use_work_key
  731. {
  732. .insert: test   word ed_flags,ed_insert ;not    word ed_insert
  733.          je     @f
  734.          and    word ed_flags,ed_insert_cl
  735.         jmp     .editbox_exit
  736. @@:
  737.         or      word ed_flags,ed_insert
  738.         jmp     .editbox_exit
  739. .ins_v:
  740.         dec     dword [ebp+42];ed_size    ;processing is insert
  741.         sub     esi,ecx
  742.         add     esi,ebx
  743.         mov     edi,esi
  744. ;clear
  745. pusha
  746.         mov     edi,ebp
  747.         mov     ebp,ed_pos
  748.         call    .clear_bg
  749. popa
  750.         jmp     .In_k
  751. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  752. .delete:        
  753.         mov     edx,ed_size
  754.         mov     ecx,ed_pos
  755.         cmp     edx,ecx
  756.         jg      .bac_del
  757.         test    word ed_flags,ed_shift_on
  758.         jne     .del_bac
  759. edit_ex
  760. .bac_del:      
  761.         call    .del_char
  762.         jmp     .draw_all
  763. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;        
  764. ;--- ­ ¦ â  ª« ¢¨è  backspace ---
  765. .backspace:
  766.         ; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï ?
  767.         mov     ecx,ed_pos
  768.         test    ecx,ecx
  769.         jnz     .del_bac
  770.         test    word ed_flags,ed_shift_on
  771.         jne     .bac_del
  772.  
  773. edit_ex
  774. .del_bac:
  775.         mov     edx,ed_size
  776.         cmp     edx,ecx ;if ed_pos=ed_size
  777.         je      @f
  778.         dec     ecx
  779.         call    .del_char
  780. @@:     test    word ed_flags,ed_shift_on
  781.         jne     .bac_del
  782.         dec      dword ed_pos
  783. .draw_all:
  784.         push    .shift;.draw_cursor_text;eax
  785.  
  786.         test    word ed_flags,ed_shift_on
  787.         je      @f
  788.         mov     eax,dword ed_shift_pos
  789.         mov     ebx,ed_size
  790.         sub     ebx,eax
  791.         mov     ed_size,ebx
  792.  
  793.         mov     ebp,ed_color
  794.         call    .clear_cursor
  795.         call    .check_offset
  796.         call    .draw_bg
  797.         ret
  798. @@:     dec      dword ed_size
  799.  
  800. .draw_all2:
  801.         and    word ed_flags,ed_shift_cl
  802.         mov     ebp,ed_color
  803.         call    .clear_cursor
  804.         call    .check_offset
  805.         mov     ebp,ed_size
  806.         call    .clear_bg
  807.         ret
  808. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  809. ;--- ­ ¦ â  ª« ¢¨è  left ---
  810. .left:  mov     ebx,ed_pos
  811.         test    ebx,ebx
  812.         jz      .sh_st_of
  813.         or      word ed_flags,ed_left_fl
  814.         call    .sh_first_sh
  815.         dec      dword ed_pos
  816.         call    .sh_enable
  817.         jmp     .draw_cursor_text
  818. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  819. ;--- ­ ¦ â  ª« ¢¨è  right ---
  820. .right: mov     ebx,ed_pos
  821.         cmp     ebx,ed_size
  822.         je      .sh_st_of
  823.         and     word ed_flags,ed_right_fl
  824.         call    .sh_first_sh
  825.         inc     dword  ed_pos
  826.         call    .sh_enable
  827.         jmp     .draw_cursor_text
  828. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  829. .home:  
  830.         mov     ebx,ed_pos
  831.         test    ebx,ebx
  832.         jz      .sh_st_of
  833.         call    .sh_first_sh
  834.         xor     eax,eax
  835.         mov     ed_pos,eax
  836.         call    .sh_home_end
  837.         jmp     .draw_cursor_text
  838. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  839. .end:  
  840.         mov     ebx,ed_pos
  841.         cmp     ebx,dword ed_size
  842.         je      .sh_st_of
  843.         call    .sh_first_sh
  844.         mov     eax,ed_size
  845.         mov     ed_pos,eax
  846.         call    .sh_home_end
  847.         jmp     .draw_cursor_text
  848. }
  849.  
  850. macro use_mouse_func
  851. {
  852. ;----------------------------------------------------------
  853. ;--- Ž¡à ¡®âª  .mouse_wigwag
  854. ;----------------------------------------------------------
  855. .mouse_wigwag:
  856.         shr     eax,16
  857.         or      word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
  858. ;;;;;;;;;;;;;;;;;;
  859. ;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ª®£¤  ¯à®¨á室¨â ¢ë室 §  ¯à¥¤¥«ë editbox
  860. ;;;;;;;;;;;;;;;;;;
  861.         test    ax,0x8000
  862.         jnz     .mleft
  863.  
  864.         mov     ebx,ed_left
  865.         cmp     eax,ebx
  866.         jb      .mleft
  867.  
  868.         add     ebx,ed_width
  869.         cmp     eax,ebx
  870.         ja      .mright
  871.  
  872.         sub     ebx,ed_width
  873.  
  874.         xor     edx,edx
  875.         sub     eax,ebx ; ¢ëç⨬ ¨§ ª®®à¤¨­ â ¬ë誨 ¯® ®á¨ å ª®®à¤¨­ âë ¤® editbox ¯® ®á¨ å
  876.         mov     ebx,6
  877.         div     ebx
  878. ;;;;;;;;;;;;;;;;;;
  879. ;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ¢ ¯à¥¤¥« å ®¡« á⨠editbox
  880. ;;;;;;;;;;;;;;;;;;
  881. ;®«ã稫¨ ª®®à¤¨­ âë ¢ eax ¬ë誨, â.¥. ªã¤  ®­  ¯¥à¥¬¥á⨫ áì
  882. ;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
  883.         add     eax,ed_offset   ;¤®¡ ¢¨¬ ᬥ饭¨¥
  884.         cmp     eax,dword ed_size       ;¥á«¨ ¢ë諨 §  ¯à¥¤¥«ë, â® ­¨ç¥£® ­¥ ¤¥« âì
  885.         ja      .mwigvag
  886. .mdraw:
  887.         mov     dword   ed_pos,eax ;á®åà ­¨¬ ­®¢®¥ §­ ç¥­¨¥
  888. ;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
  889.         mov     ecx,dword       ed_shift_pos
  890.         mov     ebx,dword       ed_shift_pos_old
  891.         mov     dword   ed_shift_pos_old,eax    ;¢­¥á¥¬ ­®¢®¥ §­ ç¥­¨¥ áâ à®© ¯®§¨æ¨¨ ªãàá®à 
  892. ;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­ëå ®¡« á⥩
  893.         cmp     ecx,ebx         ;¢ëïá­ï¥¬ ªã¤  ¡ë«® ¤¢¨¦¥­¨¥ ­  ®¤¨­ è £ ­ § ¤
  894.         je      .m1_shem        ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥
  895.         jb      .msmaller       ;¤¢¨¦¥­¨¥ ¡ë«® ->
  896.         cmp     ebx,eax         ;¤¢¨¦¥­¨¥ ¡ë«® ¤® í⮣® <- ¨ âãâ ¬ë ¯à®¢¥à塞 ᥩç á ªã¤  ¤¢¨¦¥­¨¥ ¯à®¨á室¨â
  897.         ja      .m1_shem        ;¥á«¨ ¡ë«® ¤¢¨¦¥­¨¥ <- â® ­ã¦­® § ªà á¨âì ®¡« áâì
  898.         je      .mwigvag        ;¥á«¨ ¨§¬¥­¥­¨ï ­¥ ¡ë«®, â® ­¨ç¥£® ­¥ ¤¥« âì
  899.         mov     ebp,ed_color    ;âã⠭㦭® ®ç¨áâ¨âì ®¡« áâì c ed_pos ed_shift_pos_old
  900. ;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
  901.         call    .sh_cl_
  902.         jmp     .mwigvag
  903. .msmaller:
  904.         cmp     ebx,eax
  905.         jb      .m1_shem
  906.         mov     ebp,ed_color
  907. ;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
  908.         call    .sh_cl_
  909.         jmp     .mwigvag
  910. ;alike  =
  911. .m1_shem:
  912.         mov     ebp,shift_color
  913. ;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
  914.         mov     ebx,ecx
  915.         call    .sh_cl_
  916.         jmp     .mwigvag
  917. .mwigvag:
  918.         and     word ed_flags,ed_shift_mcl
  919.         jmp     .draw_cursor_text
  920. ;       popa
  921. ;       ret
  922. .mleft:
  923.  
  924.         mov     eax,ed_pos
  925.         cmp     eax,0                                        
  926.         jbe      .mwigvag
  927.         dec     eax
  928.         call    .check_offset
  929.         push    eax
  930.         mov     ebx,ed_shift_pos
  931.         mov     ebp,shift_color
  932.         call    .sh_cl_
  933.         pop     eax
  934.         jmp     .mdraw
  935. .mright:
  936.         mov     eax,ed_pos
  937.         mov     ebx,ed_size
  938.         cmp     eax,ebx
  939.         jae     .mwigvag
  940.         inc     eax
  941.         call    .check_offset
  942.         mov     ebx,ed_shift_pos
  943.         mov     ebp,shift_color
  944.         push    eax
  945.         call    .sh_cl_
  946.         pop     eax
  947.         jmp     .mdraw  
  948. }
  949.  
  950. macro use_work_mouse
  951. ;----------------------------------------------------------
  952. ;--- € ­¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §­ë¥ áâ®à®­ë?
  953. ;----------------------------------------------------------
  954. {
  955.         test    word ed_flags,ed_mouse_on
  956.         jne     .mouse_wigwag
  957. ;----------------------------------------------------------
  958. ;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box -------------
  959. ;----------------------------------------------------------
  960.  
  961.         mov     ebx,ed_top
  962.         cmp     ax,bx
  963.         jl      ._blur;.mouse_end_no_focus
  964.        
  965.         add     ebx,ed_height
  966.         cmp     ax,bx
  967.         jg      ._blur;.mouse_end_no_focus
  968.  
  969.         shr     eax,16
  970.  
  971.         mov     ebx,ed_left
  972.         cmp     ax,bx
  973.         jl      ._blur;.mouse_end_no_focus
  974.  
  975.         add     ebx,ed_width
  976.  
  977.         cmp     ax,bx
  978.         jg      ._blur;.mouse_end_no_focus        
  979.  
  980. ;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  ---
  981.         push    eax
  982.         mov     ebp,ed_color
  983.         call    .clear_cursor
  984.         pop     eax
  985. ._mvpos:
  986.      
  987.         xor     edx,edx
  988.         sub     eax,ed_left
  989.  
  990.         mov     ebx,6
  991.         div     bx
  992.         add     eax,ed_offset
  993.         cmp     eax,ed_size
  994.         jna     ._mshift
  995.         mov     eax,ed_size
  996. ._mshift:
  997. ;;;;;;;
  998. ;;‘¥ªæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift
  999. ;;;;;;;
  1000.         test    word ed_flags,ed_shift_bac
  1001.         je      @f
  1002.         mov     ebp,dword       ed_color
  1003.         mov     ebx,dword ed_shift_pos
  1004.         push    eax
  1005.         call    .sh_cl_
  1006.         and     word ed_flags,ed_shift_bac_cl
  1007.         pop     eax
  1008. @@:    
  1009.         test    word ed_flags,ed_mouse_on
  1010.         jne     @f
  1011.        
  1012.         mov     dword ed_shift_pos,eax
  1013.         or      word  ed_flags,ed_mouse_on
  1014.         mov     dword ed_pos,eax
  1015.         mov     dword [mouse_flag],edi          ;ãáâ ­®¢¨¬ ¨¤¥­â¨ä¨ª â®à
  1016.         bts     word ed_flags,1                 ;ãáâ ­®¢ª  䮪ãá 
  1017.         jmp     .m_sh
  1018. @@:            
  1019.         cmp     eax,dword ed_shift_pos  ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì
  1020.         je      .editbox_exit
  1021.         mov     ed_pos,eax
  1022.         mov     ebp,dword shift_color
  1023.         mov     ebx,dword ed_shift_pos
  1024.         call    .sh_cl_
  1025.         or      word ed_flags,ed_mous_adn_b     ;ãáâ ­®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on +
  1026. .m_sh:  call    .draw_text
  1027.         call    .draw_cursor
  1028. ;----------------------------------------------------------
  1029. ;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
  1030. ;----------------------------------------------------------
  1031.         jmp     .drc
  1032. ._blur:
  1033.         test    word ed_flags,ed_always_focus
  1034.         jne     .editbox_exit
  1035.         btr     word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
  1036.         jnc     .editbox_exit
  1037.  
  1038.         mov     ebp,ed_color
  1039.         call    .clear_cursor
  1040. .drc:   call    .draw_border
  1041.         jmp     .editbox_exit
  1042. }
  1043.  
  1044.  
  1045. ; Œ ªà®á ¢ë室 
  1046. macro edit_ex
  1047. {
  1048. popad          
  1049. ret
  1050. }
  1051. macro debug
  1052. {
  1053.         ;-----------  ®â« ¤ª 
  1054.         pushad
  1055. ;        mov     dword [ed_buffer.2],0
  1056. ;        mov     eax,edi
  1057.         mov eax,dword [ed_buffer.2]
  1058.         mov edi,ed_buffer.3
  1059.         call .str
  1060.         ;à¨á®¢ ­¨¥ ä®­ 
  1061.         mov eax,13
  1062.         mov ebx,178*65536+70
  1063.         mov ecx,28*65536+10
  1064.         xor edx,edx
  1065.         int 0x40
  1066.         ;¢ë¢®¤ §­ ç¥­¨ï ­  íªà ­
  1067.         mov eax,4
  1068.         mov ebx,180*65536+30
  1069.         mov ecx,0x10DDBBCC
  1070.         mov edx,ed_buffer.3
  1071.         mov esi,8
  1072.         int 0x40
  1073.         popad
  1074.         ;----------- ®â« ¤ª 
  1075. }
  1076. macro   debug_func
  1077. {
  1078. .str:
  1079.         mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
  1080.          ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
  1081.         cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
  1082.         jb @f
  1083.         xor edx,edx  ;®ç¨áâ¨âì edx
  1084.         div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
  1085.         push edx     ;¯®«®¦¨âì ¢ á⥪
  1086.         ;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
  1087.         call .str;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
  1088.         pop eax
  1089.         @@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
  1090.         ;sbb al,$69  ;- ç¥áâ­® ¤ ­­ ï ¨­áâàãªæ¨ï ¬¥­ï § áâ ¢«ï¥â § ¤ã¬ âìáï â.¥. ï ­¥ §­ î ª ª íâ® à ¡®â ¥â
  1091.         ;das        ;¯®á«¥ ¤ ­­®© ª®¬ ­¤ë ª ª ¡ë ¯à®¨á室¨â 㬥­ì襭¨¥ al ­  66h  (¢ ª­¨£¥ ­ ¯¨á ­® ¤à㣮¥)
  1092.         or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  ç¥¬ ¤¢¥ ¢ëè¥
  1093.         stosb       ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
  1094.  
  1095.         ret         ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
  1096. }
  1097.  
  1098. ;;;;;;;;;;;;;;;
  1099. ;For LibGui
  1100. ;;;;;;;;;;;;;;;
  1101. macro srt_ed_libgui
  1102. {
  1103. ed_width        equ [EditBox.ed_width]            ;è¨à¨­  ª®¬¯®­¥­â 
  1104. ed_left         equ [EditBox.ed_left]             ;¯®«®¦¥­¨¥ ¯® ®á¨ å
  1105. ed_top          equ [EditBox.ed_top]              ;¯®«®¦¥­¨¥ ¯® ®á¨ ã
  1106. ed_color        equ [EditBox.ed_color]            ;梥â ä®­  ª®¬¯®­¥­â 
  1107. shift_color     equ [EditBox.shift_color]         ;=0x6a9480
  1108. ed_focus_border_color   equ [EditBox.ed_focus_border_color]   ;梥â à ¬ª¨ ª®¬¯®­¥­â 
  1109. ed_blur_border_color    equ [EditBox.ed_blur_border_color]    ;梥⠭¥  ªâ¨¢­®£® ª®¬¯®­¥­â 
  1110. ed_text_color   equ [EditBox.ed_text_color]       ;梥â ⥪áâ 
  1111. ed_max          equ [EditBox.ed_max]              ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
  1112. ed_text         equ [EditBox.ed_text]             ;㪠§ â¥«ì ­  ¡ãä¥à
  1113. ed_flags        equ [EditBox.ed_flags]            ;ä« £¨
  1114. ed_size equ [EditBox.ed_size]                     ;ª®«-¢® ᨬ¢®«®¢
  1115. ed_pos  equ [EditBox.ed_poz]                      ;¯®§¨æ¨ï ªãàá®à 
  1116. ed_offset       equ [EditBox.ed_offset]           ;ᬥ饭¨¥
  1117. cl_curs_x       equ [EditBox.cl_curs_x]           ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
  1118. cl_curs_y       equ [EditBox.cl_curs_y]           ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
  1119. ed_shift_pos    equ [EditBox.ed_shift_pos]        ;¯®«®¦¥­¨¥ ªãàá®à 
  1120. ed_shift_pos_old equ [EditBox.ed_shift_pos_old]   ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
  1121. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1122. ;Bit mask from editbox
  1123. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1124. ed_figure_only= 1000000000000000b   ;®¤­¨ ᨬ¢®«ë
  1125. ed_always_focus= 100000000000000b
  1126. ed_focus=                     10b   ;䮪ãá ¯à¨«®¦¥­¨ï
  1127. ed_shift_on=                1000b   ;¥á«¨ ­¥ ãáâ ­®¢«¥­ -§­ ç¨â ¢¯¥à¢ë¥ ­ ¦ â shift,¥á«¨ ¡ë« ãáâ ­®¢«¥­, §­ ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
  1128. ed_shift_on_off=1111111111110111b
  1129. ed_shift=                    100b   ;¢ª«îç ¥âáï ¯à¨ ­ ¦ â¨¨ ­  shift â.¥. ¥á«¨ ­ ¦¨¬ î
  1130. ed_shift_off=   1111111111111011b
  1131. ed_shift_bac=              10000b   ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥­®£® shift â.¥. ¯à¨ ãáâ ­®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥­¨¥
  1132. ed_shift_bac_cl=1111111111101111b   ;®ç¨á⪠ ¯à¨ 㤠«¥­¨¨ ¢ë¤¥«¥­¨ï
  1133. ed_shift_cl=    1111111111100011b
  1134. ed_shift_mcl=   1111111111111011b
  1135. ed_left_fl=               100000b
  1136. ed_right_fl=    1111111111011111b
  1137. ed_offset_fl=            1000000b
  1138. ed_offset_cl=   1111111110111111b
  1139. ed_insert=              10000000b
  1140. ed_insert_cl=   1111111101111111b
  1141. ed_mouse_on =          100000000b
  1142. ed_mous_adn_b=         100011000b
  1143. ed_mouse_on_off=1111111011111111b
  1144. ed_height=14 ; ¢ëá®â 
  1145. }