Subversion Repositories Kolibri OS

Rev

Blame | 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,1
  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
  591. {
  592. if up eq
  593. else
  594.         cmp     ah,177
  595.         jz      .editbox_exit
  596. end if
  597. if down eq
  598. else
  599.         cmp     ah,178
  600.         jz      .editbox_exit
  601. end if
  602. if esc eq
  603. else
  604.         cmp     ah,27   ;ESC - ª« ¢¨è  ))
  605.         jz      .editbox_exit
  606. end if
  607. }
  608.  
  609. macro use_key_figures_only
  610. {
  611.         test    word ed_flags,ed_figure_only  ; ⮫쪮 æ¨äàë ?
  612.         jz      @f
  613.         cmp     ah,'0'
  614.         jb      .editbox_exit
  615.         cmp     ah,'9'
  616.         ja      .editbox_exit
  617. @@:
  618. }
  619. macro are_key_shift_press
  620. {
  621.         test    word ed_flags,ed_shift_on
  622.         je      @f
  623.         ;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
  624.         push    eax
  625.         mov     edx,ed_size
  626.         mov     ecx, ed_pos
  627.         pusha
  628. ;;;;;;;;;;;;;;;;;;;;;
  629. ;clear input arrea
  630.         mov     ebp,ed_color
  631.         mov     ebx,dword       ed_shift_pos
  632.         call    .sh_cl_
  633.         mov     ebp,ed_size
  634.         call    .clear_bg
  635. ;;;;;;;;;;;;;;;;;;;;;
  636.         popa
  637.         call    .del_char
  638. ;;;;
  639.         mov     eax,dword ed_shift_pos
  640.         mov     ebx,ed_size
  641.         sub     ebx,eax
  642.         mov     ed_size,ebx
  643.         pop     eax
  644. @@:
  645. }
  646. macro are_key_cur_end
  647. {
  648.         mov     ecx,ed_size
  649.         mov     edx, ed_max
  650.         test    word ed_flags,ed_insert
  651.         jne     @f
  652.         cmp     ecx,edx
  653.         jae     .editbox_exit
  654. @@:     mov     ebx, ed_pos
  655.         cmp     ebx,edx
  656.         jl      @f ; ¥á«¨ ¬¥­ìè¥ ¨«¨ à ¢­®
  657.         jmp     .editbox_exit
  658.  
  659. @@:     ; ᤢ¨£ ¥¬ ᨬ¢®«ë ¯®á«¥ ªãàá®à  ¢¯à ¢®
  660.         mov     ecx,ed_size
  661.         push    edi eax
  662.         mov     ebp,edi
  663.         mov     esi,ed_text     ; “ª § â¥«ì ­  ¡ãä¥à
  664.                                 ;ã¤¥¬ à ¡®â âì á® áâப®©
  665.         add     esi,ecx         ;add ed_size ¤®¡ ¢¨¬ max size
  666.         mov     edi,esi
  667.  
  668.         cmp     ecx,ebx         ;…᫨ ã ­ á ¯®§¨æ¨ï ªãàá®à  = ⥪ã饬ã à §¬¥àã ­ ¯¥ç â ­­ëå ᨬ¢®«®¢ â.¥. ªãàá®à á⮨⠢ ª®­æ¥
  669.         je      .In_k
  670.  
  671.         test    word [ebp+40],ed_insert ;IF insert is enable  â.ª. edi ¨§¬¥­¥­  ¤à¥á㥬 ç¥à¥§ ebp
  672.         jne     .ins_v
  673. ;clear
  674. pusha
  675.         mov     edi,ebp
  676.         mov     ebp,ed_size
  677.         call    .clear_bg
  678. popa
  679.         sub     ecx,ebx         ; ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥­¨ï.
  680.         inc     edi             ;‘¬¥á⨬ ­ è¨ ᨬ¢®«ë ¢ ¯à ¢®
  681.         std
  682.         inc     ecx
  683.    @@:  
  684.         ;--------
  685.         lodsb
  686.         stosb
  687.         ;--------
  688.         loop    @b
  689. .In_k:  cld
  690.         pop eax
  691.         mov al,ah
  692.         stosb
  693.         pop edi
  694. ; ¢áâ ¢«ï¥¬ ª®¤ ª« ¢¨è¨ â㤠, £¤¥ ªãàá®à
  695.         ; 㢥«¨ç¨¢ ¥¬ §­ ç¥­¨¥ à §¬¥à  ¨ ¯®§¨æ¨¨
  696.         inc      dword ed_size
  697.         inc      dword ed_pos
  698.         call    .draw_all2
  699.         jmp     .shift
  700. }
  701. macro use_work_key
  702. {
  703. .insert: test   word ed_flags,ed_insert ;not    word ed_insert
  704.          je     @f
  705.          and    word ed_flags,ed_insert_cl
  706.         jmp     .editbox_exit
  707. @@:
  708.         or      word ed_flags,ed_insert
  709.         jmp     .editbox_exit
  710. .ins_v:
  711.         dec     dword [ebp+42];ed_size    ;processing is insert
  712.         sub     esi,ecx
  713.         add     esi,ebx
  714.         mov     edi,esi
  715. ;clear
  716. pusha
  717.         mov     edi,ebp
  718.         mov     ebp,ed_pos
  719.         call    .clear_bg
  720. popa
  721.         jmp     .In_k
  722. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  723. .delete:        
  724.         mov     edx,ed_size
  725.         mov     ecx,ed_pos
  726.         cmp     edx,ecx
  727.         jg      .bac_del
  728.         test    word ed_flags,ed_shift_on
  729.         jne     .del_bac
  730. edit_ex
  731. .bac_del:      
  732.         call    .del_char
  733.         jmp     .draw_all
  734. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;        
  735. ;--- ­ ¦ â  ª« ¢¨è  backspace ---
  736. .backspace:
  737.         ; ¯à®¢¥à塞, ªãàá®à ã «¥¢®£® ªà ï ?
  738.         mov     ecx,ed_pos
  739.         test    ecx,ecx
  740.         jnz     .del_bac
  741.         test    word ed_flags,ed_shift_on
  742.         jne     .bac_del
  743.  
  744. edit_ex
  745. .del_bac:
  746.         mov     edx,ed_size
  747.         cmp     edx,ecx ;if ed_pos=ed_size
  748.         je      @f
  749.         dec     ecx
  750.         call    .del_char
  751. @@:     test    word ed_flags,ed_shift_on
  752.         jne     .bac_del
  753.         dec      dword ed_pos
  754. .draw_all:
  755.         push    .shift;.draw_cursor_text;eax
  756.  
  757.         test    word ed_flags,ed_shift_on
  758.         je      @f
  759.         mov     eax,dword ed_shift_pos
  760.         mov     ebx,ed_size
  761.         sub     ebx,eax
  762.         mov     ed_size,ebx
  763.  
  764.         mov     ebp,ed_color
  765.         call    .clear_cursor
  766.         call    .check_offset
  767.         call    .draw_bg
  768.         ret
  769. @@:     dec      dword ed_size
  770.  
  771. .draw_all2:
  772.         and    word ed_flags,ed_shift_cl
  773.         mov     ebp,ed_color
  774.         call    .clear_cursor
  775.         call    .check_offset
  776.         mov     ebp,ed_size
  777.         call    .clear_bg
  778.         ret
  779. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  780. ;--- ­ ¦ â  ª« ¢¨è  left ---
  781. .left:  mov     ebx,ed_pos
  782.         test    ebx,ebx
  783.         jz      .sh_st_of
  784.         or      word ed_flags,ed_left_fl
  785.         call    .sh_first_sh
  786.         dec      dword ed_pos
  787.         call    .sh_enable
  788.         jmp     .draw_cursor_text
  789. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  790. ;--- ­ ¦ â  ª« ¢¨è  right ---
  791. .right: mov     ebx,ed_pos
  792.         cmp     ebx,ed_size
  793.         je      .sh_st_of
  794.         and     word ed_flags,ed_right_fl
  795.         call    .sh_first_sh
  796.         inc     dword  ed_pos
  797.         call    .sh_enable
  798.         jmp     .draw_cursor_text
  799. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  800. .home:  
  801.         mov     ebx,ed_pos
  802.         test    ebx,ebx
  803.         jz      .sh_st_of
  804.         call    .sh_first_sh
  805.         xor     eax,eax
  806.         mov     ed_pos,eax
  807.         call    .sh_home_end
  808.         jmp     .draw_cursor_text
  809. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  810. .end:  
  811.         mov     ebx,ed_pos
  812.         cmp     ebx,dword ed_size
  813.         je      .sh_st_of
  814.         call    .sh_first_sh
  815.         mov     eax,ed_size
  816.         mov     ed_pos,eax
  817.         call    .sh_home_end
  818.         jmp     .draw_cursor_text
  819. }
  820.  
  821. macro use_mouse_func scr_w
  822. {
  823. ;----------------------------------------------------------
  824. ;--- Ž¡à ¡®âª  .mouse_wigwag
  825. ;----------------------------------------------------------
  826. .mouse_wigwag:
  827.         shr     eax,16
  828.         or      word ed_flags,ed_shift_bac+ed_shift_on+ed_shift
  829. ;;;;;;;;;;;;;;;;;;
  830. ;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ª®£¤  ¯à®¨á室¨â ¢ë室 §  ¯à¥¤¥«ë editbox
  831. ;;;;;;;;;;;;;;;;;;
  832.         mov     ebx,dword [procinfo+34]
  833.         add     ebx,ed_left
  834. if scr_w eq
  835. else
  836.         add     ebx,dword scr_w
  837. end if
  838.         cmp     eax,ebx
  839.         jb      .mleft
  840.  
  841.         add     ebx,ed_width
  842.         cmp     eax,ebx
  843.         ja      .mright
  844.  
  845.         sub     ebx,ed_width
  846.  
  847.         xor     edx,edx
  848.         sub     eax,ebx ; ¢ëç⨬ ¨§ ª®®à¤¨­ â ¬ë誨 ¯® ®á¨ å ª®®à¤¨­ âë ¤® editbox ¯® ®á¨ å
  849.         mov     ebx,6
  850.         div     ebx
  851. ;;;;;;;;;;;;;;;;;;
  852. ;;¯à®æ¥¤ãà  ®¡à ¡®âª¨ ¯®«®¦¥­¨ï ¢ë¤¥«¥­­®£® ⥪áâ , ¢ ¯à¥¤¥« å ®¡« á⨠editbox
  853. ;;;;;;;;;;;;;;;;;;
  854. ;®«ã稫¨ ª®®à¤¨­ âë ¢ eax ¬ë誨, â.¥. ªã¤  ®­  ¯¥à¥¬¥á⨫ áì
  855. ;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
  856.         add     eax,ed_offset   ;¤®¡ ¢¨¬ ᬥ饭¨¥
  857.         cmp     eax,dword ed_size       ;¥á«¨ ¢ë諨 §  ¯à¥¤¥«ë, â® ­¨ç¥£® ­¥ ¤¥« âì
  858.         ja      .mwigvag
  859. .mdraw:
  860.         mov     dword   ed_pos,eax ;á®åà ­¨¬ ­®¢®¥ §­ ç¥­¨¥
  861. ;¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
  862.         mov     ecx,dword       ed_shift_pos
  863.         mov     ebx,dword       ed_shift_pos_old
  864.         mov     dword   ed_shift_pos_old,eax    ;¢­¥á¥¬ ­®¢®¥ §­ ç¥­¨¥ áâ à®© ¯®§¨æ¨¨ ªãàá®à 
  865. ;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­ëå ®¡« á⥩
  866.         cmp     ecx,ebx         ;¢ëïá­ï¥¬ ªã¤  ¡ë«® ¤¢¨¦¥­¨¥ ­  ®¤¨­ è £ ­ § ¤
  867.         je      .m1_shem        ;¤¢¨¦¥­¨ï ­¥ ¡ë«® à ­¥¥
  868.         jb      .msmaller       ;¤¢¨¦¥­¨¥ ¡ë«® ->
  869.         cmp     ebx,eax         ;¤¢¨¦¥­¨¥ ¡ë«® ¤® í⮣® <- ¨ âãâ ¬ë ¯à®¢¥à塞 ᥩç á ªã¤  ¤¢¨¦¥­¨¥ ¯à®¨á室¨â
  870.         ja      .m1_shem        ;¥á«¨ ¡ë«® ¤¢¨¦¥­¨¥ <- â® ­ã¦­® § ªà á¨âì ®¡« áâì
  871.         je      .mwigvag        ;¥á«¨ ¨§¬¥­¥­¨ï ­¥ ¡ë«®, â® ­¨ç¥£® ­¥ ¤¥« âì
  872.         mov     ebp,ed_color    ;âã⠭㦭® ®ç¨áâ¨âì ®¡« áâì c ed_pos ed_shift_pos_old
  873. ;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
  874.         call    .sh_cl_
  875.         jmp     .mwigvag
  876. .msmaller:
  877.         cmp     ebx,eax
  878.         jb      .m1_shem
  879.         mov     ebp,ed_color
  880. ;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
  881.         call    .sh_cl_
  882.         jmp     .mwigvag
  883. ;alike  =
  884. .m1_shem:
  885.         mov     ebp,shift_color
  886. ;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
  887.         mov     ebx,ecx
  888.         call    .sh_cl_
  889.         jmp     .mwigvag
  890. .mwigvag:
  891.         and     word ed_flags,ed_shift_mcl
  892.         jmp     .draw_cursor_text
  893. ;       popa
  894. ;       ret
  895. .mleft:
  896.         mov     eax,ed_pos
  897.         cmp     eax,0                                        
  898.         jbe      .mwigvag
  899.         dec     eax
  900.         call    .check_offset
  901.         push    eax
  902.         mov     ebx,ed_shift_pos
  903.         mov     ebp,shift_color
  904.         call    .sh_cl_
  905.         pop     eax
  906.         jmp     .mdraw
  907. .mright:
  908.         mov     eax,ed_pos
  909.         mov     ebx,ed_size
  910.         cmp     eax,ebx
  911.         jae     .mwigvag
  912.         inc     eax
  913.         call    .check_offset
  914.         mov     ebx,ed_shift_pos
  915.         mov     ebp,shift_color
  916.         push    eax
  917.         call    .sh_cl_
  918.         pop     eax
  919.         jmp     .mdraw  
  920. }
  921.  
  922. macro use_work_mause scr_h,scr_w
  923. ;----------------------------------------------------------
  924. ;--- € ­¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §­ë¥ áâ®à®­ë?
  925. ;----------------------------------------------------------
  926. {
  927.         test    word ed_flags,ed_mouse_on
  928.         jne     .mouse_wigwag
  929. ;----------------------------------------------------------
  930. ;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box -------------
  931. ;----------------------------------------------------------
  932.         mov     ebx,dword [procinfo + 38]
  933.         add     ebx,ed_top
  934. if scr_h eq
  935. else
  936.         add     ebx,scr_h
  937. end if
  938.         cmp     ax,bx
  939.         jl      ._blur;.mouse_end_no_focus
  940.  
  941.         add     ebx,ed_height
  942.         cmp     ax,bx
  943.         jg      ._blur;.mouse_end_no_focus
  944.  
  945.         shr     eax,16
  946.  
  947.         mov     ebx,dword [procinfo + 34]
  948.         add     ebx,ed_left
  949. if scr_w eq
  950. else
  951.         add     ebx,scr_w
  952. end if
  953.         cmp     ax,bx
  954.         jl      ._blur;.mouse_end_no_focus
  955.  
  956.         add     ebx,ed_width
  957.         cmp     ax,bx
  958.         jg      ._blur;.mouse_end_no_focus
  959. ;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  ---
  960.         push    eax
  961.         mov     ebp,ed_color
  962.         call    .clear_cursor
  963.         pop     eax
  964. ._mvpos:
  965.         mov     ebx,dword [procinfo+ 34]
  966.         xor     edx,edx
  967.         sub     eax,ed_left
  968.         sub     eax,ebx
  969. if scr_w eq
  970. else
  971.         add     ebx,scr_w
  972.         sub     eax,2
  973. end if
  974.         mov     ebx,6
  975.         div     bx
  976.         add     eax,ed_offset
  977.         cmp     eax,ed_size
  978.         jna     ._mshift
  979.         mov     eax,ed_size
  980. ._mshift:
  981. ;;;;;;;
  982. ;;‘¥ªæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift
  983. ;;;;;;;
  984.         test    word ed_flags,ed_shift_bac
  985.         je      @f
  986.         mov     ebp,dword       ed_color
  987.         mov     ebx,dword ed_shift_pos
  988.         push    eax
  989.         call    .sh_cl_
  990.         and     word ed_flags,ed_shift_bac_cl
  991.         pop     eax
  992. @@:    
  993.         test    word ed_flags,ed_mouse_on
  994.         jne     @f
  995.        
  996.         mov     dword ed_shift_pos,eax
  997.         or      word  ed_flags,ed_mouse_on
  998.         mov     dword ed_pos,eax
  999.         mov     dword [mouse_flag],edi          ;ãáâ ­®¢¨¬ ¨¤¥­â¨ä¨ª â®à
  1000.         bts     word ed_flags,1                 ;ãáâ ­®¢ª  䮪ãá 
  1001.         jmp     .m_sh
  1002. @@:            
  1003.         cmp     eax,dword ed_shift_pos  ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì
  1004.         je      .editbox_exit
  1005.         mov     ed_pos,eax
  1006.         mov     ebp,dword shift_color
  1007.         mov     ebx,dword ed_shift_pos
  1008.         call    .sh_cl_
  1009.         or      word ed_flags,ed_mous_adn_b     ;ãáâ ­®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on +
  1010. .m_sh:  call    .draw_text
  1011.         call    .draw_cursor
  1012. ;----------------------------------------------------------
  1013. ;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
  1014. ;----------------------------------------------------------
  1015.         jmp     .drc
  1016. ._blur:
  1017.         test    word ed_flags,ed_always_focus
  1018.         jne     .editbox_exit
  1019.         btr     word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
  1020.         jnc     .editbox_exit
  1021.  
  1022.         mov     ebp,ed_color
  1023.         call    .clear_cursor
  1024. .drc:   call    .draw_border
  1025.         jmp     .editbox_exit
  1026. }
  1027.  
  1028.  
  1029. ; Œ ªà®á ¢ë室 
  1030. macro edit_ex
  1031. {
  1032. popa          
  1033. ret
  1034. }
  1035. macro debug
  1036. {
  1037.         ;-----------  ®â« ¤ª 
  1038.         pushad
  1039. ;        mov     dword [ed_buffer.2],0
  1040. ;        mov     eax,edi
  1041.         mov eax,dword [ed_buffer.2]
  1042.         mov edi,ed_buffer.3
  1043.         call .str
  1044.         ;à¨á®¢ ­¨¥ ä®­ 
  1045.         mov eax,13
  1046.         mov ebx,178*65536+70
  1047.         mov ecx,28*65536+10
  1048.         xor edx,edx
  1049.         int 0x40
  1050.         ;¢ë¢®¤ §­ ç¥­¨ï ­  íªà ­
  1051.         mov eax,4
  1052.         mov ebx,180*65536+30
  1053.         mov ecx,0x10DDBBCC
  1054.         mov edx,ed_buffer.3
  1055.         mov esi,8
  1056.         int 0x40
  1057.         popad
  1058.         ;----------- ®â« ¤ª 
  1059. }
  1060. macro   debug_func
  1061. {
  1062. .str:
  1063.         mov ecx,0x0a ;§ ¤ ¥âáï á¨á⥬  áç¨á«¥­¨ï ¨§¬¥­ïîâáï ॣ¨áâàë ebx,eax,ecx,edx ¢å®¤­ë¥ ¯ à ¬¥âàë eax - ç¨á«®
  1064.          ;¯à¥à¥¢®¤ ç¨á«  ¢ ASCII áâப㠢§®¤­ë¥ ¤ ­­ë¥ ecx=á¨á⥬  áç¨á«¥­ï edi  ¤à¥á ªã¤  § ¯¨á뢠âì, ¡ã¤¥¬ áâபã, ¯à¨ç¥¬ ª®­¥æ ¯¥à¥¬¥­­®©
  1065.         cmp eax,ecx  ;áà ¢­¨âì ¥á«¨ ¢ eax ¬¥­ìè¥ ç¥¬ ¢ ecx â® ¯¥à¥©â¨ ­  @@-1 â.¥. ­  pop eax
  1066.         jb @f
  1067.         xor edx,edx  ;®ç¨áâ¨âì edx
  1068.         div ecx      ;à §¤¥«¨âì - ®áâ â®ª ¢ edx
  1069.         push edx     ;¯®«®¦¨âì ¢ á⥪
  1070.         ;dec edi             ;ᬥ饭¨¥ ­¥®¡å®¤¨¬®¥ ¤«ï § ¯¨á¨ á ª®­æ  áâப¨
  1071.         call .str;¯¥à¥©â¨ ­  á ¬ã ᥡï â.¥. ¢ë§¢ âì á ¬ã á¥¡ï ¨ â ª ¤® ⮣® ¬®¬¥­â  ¯®ª  ¢ eax ­¥ áâ ­¥â ¬¥­ìè¥ ç¥¬ ¢ ecx
  1072.         pop eax
  1073.         @@: ;cmp al,10 ;¯à®¢¥à¨âì ­¥ ¬¥­ìè¥ «¨ §­ ç¥­¨¥ ¢ al 祬 10 (¤«ï á¨á⥬ë áç¨á«¥­ï 10 ¤ ­­ ï ª®¬ ­¤  - «¨è­ ï))
  1074.         ;sbb al,$69  ;- ç¥áâ­® ¤ ­­ ï ¨­áâàãªæ¨ï ¬¥­ï § áâ ¢«ï¥â § ¤ã¬ âìáï â.¥. ï ­¥ §­ î ª ª íâ® à ¡®â ¥â
  1075.         ;das        ;¯®á«¥ ¤ ­­®© ª®¬ ­¤ë ª ª ¡ë ¯à®¨á室¨â 㬥­ì襭¨¥ al ­  66h  (¢ ª­¨£¥ ­ ¯¨á ­® ¤à㣮¥)
  1076.         or al,0x30  ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥  ç¥¬ ¤¢¥ ¢ëè¥
  1077.         stosb       ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
  1078.  
  1079.         ret         ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
  1080. }
  1081.  
  1082. ;;;;;;;;;;;;;;;
  1083. ;For LibGui
  1084. ;;;;;;;;;;;;;;;
  1085. macro srt_ed_libgui
  1086. {
  1087. ed_width        equ [EditBox.ed_width]            ;è¨à¨­  ª®¬¯®­¥­â 
  1088. ed_left         equ [EditBox.ed_left]             ;¯®«®¦¥­¨¥ ¯® ®á¨ å
  1089. ed_top          equ [EditBox.ed_top]              ;¯®«®¦¥­¨¥ ¯® ®á¨ ã
  1090. ed_color        equ [EditBox.ed_color]            ;梥â ä®­  ª®¬¯®­¥­â 
  1091. shift_color     equ [EditBox.shift_color]         ;=0x6a9480
  1092. ed_focus_border_color   equ [EditBox.ed_focus_border_color]   ;梥â à ¬ª¨ ª®¬¯®­¥­â 
  1093. ed_blur_border_color    equ [EditBox.ed_blur_border_color]    ;梥⠭¥  ªâ¨¢­®£® ª®¬¯®­¥­â 
  1094. ed_text_color   equ [EditBox.ed_text_color]       ;梥â ⥪áâ 
  1095. ed_max          equ [EditBox.ed_max]              ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
  1096. ed_text         equ [EditBox.ed_text]             ;㪠§ â¥«ì ­  ¡ãä¥à
  1097. ed_flags        equ [EditBox.ed_flags]            ;ä« £¨
  1098. ed_size equ [EditBox.ed_size]                     ;ª®«-¢® ᨬ¢®«®¢
  1099. ed_pos  equ [EditBox.ed_poz]                      ;¯®§¨æ¨ï ªãàá®à 
  1100. ed_offset       equ [EditBox.ed_offset]           ;ᬥ饭¨¥
  1101. cl_curs_x       equ [EditBox.cl_curs_x]           ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
  1102. cl_curs_y       equ [EditBox.cl_curs_y]           ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
  1103. ed_shift_pos    equ [EditBox.ed_shift_pos]        ;¯®«®¦¥­¨¥ ªãàá®à 
  1104. ed_shift_pos_old equ [EditBox.ed_shift_pos_old]   ;áâ à®¥ ¯®«®¦¥­¨¥ ªãàá®à 
  1105. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1106. ;Bit mask from editbox
  1107. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  1108. ed_figure_only= 1000000000000000b   ;®¤­¨ ᨬ¢®«ë
  1109. ed_always_focus= 100000000000000b
  1110. ed_focus=                     10b   ;䮪ãá ¯à¨«®¦¥­¨ï
  1111. ed_shift_on=                1000b   ;¥á«¨ ­¥ ãáâ ­®¢«¥­ -§­ ç¨â ¢¯¥à¢ë¥ ­ ¦ â shift,¥á«¨ ¡ë« ãáâ ­®¢«¥­, §­ ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
  1112. ed_shift_on_off=1111111111110111b
  1113. ed_shift=                    100b   ;¢ª«îç ¥âáï ¯à¨ ­ ¦ â¨¨ ­  shift â.¥. ¥á«¨ ­ ¦¨¬ î
  1114. ed_shift_off=   1111111111111011b
  1115. ed_shift_bac=              10000b   ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥­®£® shift â.¥. ¯à¨ ãáâ ­®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥­¨¥
  1116. ed_shift_bac_cl=1111111111101111b   ;®ç¨á⪠ ¯à¨ 㤠«¥­¨¨ ¢ë¤¥«¥­¨ï
  1117. ed_shift_cl=    1111111111100011b
  1118. ed_shift_mcl=   1111111111111011b
  1119. ed_left_fl=               100000b
  1120. ed_right_fl=    1111111111011111b
  1121. ed_offset_fl=            1000000b
  1122. ed_offset_cl=   1111111110111111b
  1123. ed_insert=              10000000b
  1124. ed_insert_cl=   1111111101111111b
  1125. ed_mouse_on =          100000000b
  1126. ed_mous_adn_b=         100011000b
  1127. ed_mouse_on_off=1111111011111111b
  1128. ed_height=14 ; ¢ëá®â 
  1129. }