upgrade editbox

git-svn-id: svn://kolibrios.org@391 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2007-03-06 13:53:45 +00:00
parent fd8f50d23f
commit a9a7e05fb6
3 changed files with 259 additions and 121 deletions

View File

@ -1,3 +1,4 @@
; <Lrz> 06.03.2007 <20>¥à¥¯¨á « ¯®«­®áâìî  «£®à¨â¬ ã¯à ¢«¥­¨ï shift
; <Lrz> 15.02.2007 ã«ãç襭¨¥ á­ïâ¨ï ¢ë¤¥«¥­¨ï ¨ ¯¥à¥à¨á®¢ª¨ ®ç¨é ¥¬®© ®¡« áâ¨, §­ ç¨â¥«ì­® ¯à¨ïâ­¥¥ à ¡®â ¥â ª®¬¯®­¥­â ; <Lrz> 15.02.2007 ã«ãç襭¨¥ á­ïâ¨ï ¢ë¤¥«¥­¨ï ¨ ¯¥à¥à¨á®¢ª¨ ®ç¨é ¥¬®© ®¡« áâ¨, §­ ç¨â¥«ì­® ¯à¨ïâ­¥¥ à ¡®â ¥â ª®¬¯®­¥­â
; <Lrz> 13.02.2007 ã¡à « ¯® ¢®§¬®¦­®á⨠¬¥àæ ­¨¥, ã«ãç襭  ®¡à ¡®âª  ¯¥à¥à¨á®¢ª¨ ä®­  ; <Lrz> 13.02.2007 ã¡à « ¯® ¢®§¬®¦­®á⨠¬¥àæ ­¨¥, ã«ãç襭  ®¡à ¡®âª  ¯¥à¥à¨á®¢ª¨ ä®­ 
; ¤®¡ ¢¨« ä¨âçã ¢­¥á¥­¨ï 0å0 ¯®  ¤à¥áã ed_size ¨­ ç¥ ã Maxxx32 ¡ë«¨ ­¥á®áâ몮¢ª¨ ¢ ª®¤¥. <20>à¨ç¨­  ¢ ⮬, çâ® ®¯â¨¬¨§ æ¨ï ¡ë«  ᢥ¤¥­  ª ⮬ã, çâ® ï ­¥ ç¨á⨫ ᨬ¢®«ë ¢ ¡ãä¥à¥, ª®£¤  㤠«ï«, ï ¯à®áâ® ¨å ­¥ ¢ë¢®¤¨«, ¨ ¯®â®¬, ª®£¤  ¢­®á¨«áï ­®¢ë© ᨬ¢®«, ®­ ¯®¯à®áâã § â¨à « 㦥 ¨¬¥î騩áï. …᫨ ¡ë, ¯à®£à ¬¬  ®¡à ¡ â뢠«  ª®­¥æ áâப¨ ¯® ed_size, ¯à®¡«¥¬ë ­¥ ¢®§­¨ª«®. <20>® ᥩç á íâ®â ­¥¤®áâ â®ª ¨á¯à ¢«¥­. ; ¤®¡ ¢¨« ä¨âçã ¢­¥á¥­¨ï 0å0 ¯®  ¤à¥áã ed_size ¨­ ç¥ ã Maxxx32 ¡ë«¨ ­¥á®áâ몮¢ª¨ ¢ ª®¤¥. <20>à¨ç¨­  ¢ ⮬, çâ® ®¯â¨¬¨§ æ¨ï ¡ë«  ᢥ¤¥­  ª ⮬ã, çâ® ï ­¥ ç¨á⨫ ᨬ¢®«ë ¢ ¡ãä¥à¥, ª®£¤  㤠«ï«, ï ¯à®áâ® ¨å ­¥ ¢ë¢®¤¨«, ¨ ¯®â®¬, ª®£¤  ¢­®á¨«áï ­®¢ë© ᨬ¢®«, ®­ ¯®¯à®áâã § â¨à « 㦥 ¨¬¥î騩áï. …᫨ ¡ë, ¯à®£à ¬¬  ®¡à ¡ â뢠«  ª®­¥æ áâப¨ ¯® ed_size, ¯à®¡«¥¬ë ­¥ ¢®§­¨ª«®. <20>® ᥩç á íâ®â ­¥¤®áâ â®ª ¨á¯à ¢«¥­.
@ -69,10 +70,7 @@ ed_offset equ [edi+46] ;ᬥ饭
cl_curs_x equ [edi+50] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å cl_curs_x equ [edi+50] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å
cl_curs_y equ [edi+54] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã cl_curs_y equ [edi+54] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® ã
ed_shift_pos equ [edi+58] ed_shift_pos equ [edi+58]
ed_height=14 ; ¢ëá®â  ed_shift_pos_old equ [edi+62]
shift_color=0x6a9480
ed_insert=100000b
ed_insert_cl=1111111111011111b
;========================================================== ;==========================================================
;=== ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ================================= ;=== ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ =================================
;========================================================== ;==========================================================
@ -112,7 +110,7 @@ ret
; ;das ;¯®á«¥ ¤ ­­®© ª®¬ ­¤ë ª ª ¡ë ¯à®¨á室¨â 㬥­ì襭¨¥ al ­  66h (¢ ª­¨£¥ ­ ¯¨á ­® ¤à㣮¥) ; ;das ;¯®á«¥ ¤ ­­®© ª®¬ ­¤ë ª ª ¡ë ¯à®¨á室¨â 㬥­ì襭¨¥ al ­  66h (¢ ª­¨£¥ ­ ¯¨á ­® ¤à㣮¥)
; or al,0x30 ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥ 祬 ¤¢¥ ¢ëè¥ ; or al,0x30 ;¤ ­­ ï ª®¬ ­¤  ª®à®ç¥ 祬 ¤¢¥ ¢ëè¥
; stosb ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi ; stosb ;§ ¯¨á âì í«¥¬¥­â ¨§ ॣ¨áâà  al ¢ ï祪㠯 ¬ï⨠es:edi
; ;
; ret ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï ; ret ;¢¥à­ãâìáï ç¥­ì ¨­â¥à¥á­ë© 室 â.ª. ¯®ª  ¢ á⥪¥ åà ­¨âìáï ª®«-¢® ¢ë§®¢®¢ â® á⮫쪮 à § ¬ë ¨ ¡ã¤¥¬ ¢ë§ë¢ âìáï
;---------------------------------------------------------- ;----------------------------------------------------------
@ -146,16 +144,6 @@ ret
;eax ;eax
;edx - color ;edx - color
;---------------------------------------------------------- ;----------------------------------------------------------
.draw_bg_eax:
mov ecx,ed_top
add ecx,1
shl ecx,16
mov cx,13
mov eax,13
int 0x40
ret
jmp @f
;¢å®¤ ⮫쪮 梥â edx ;¢å®¤ ⮫쪮 梥â edx
.draw_bg: .draw_bg:
mov ebx,ed_left mov ebx,ed_left
@ -163,15 +151,14 @@ ret
shl ebx,16 shl ebx,16
mov bx,ed_width mov bx,ed_width
sub ebx,1 sub ebx,1
mov edx,ed_color
@@: .draw_bg_eax:
mov ecx,ed_top mov ecx,ed_top
mov eax,13 mov eax,13
add ecx,1 add ecx,1
shl ecx,16 shl ecx,16
mov edx,ed_color
mov cx,ed_height mov cx,ed_height
sub ecx,1 dec ecx
int 0x40 int 0x40
ret ret
@ -189,19 +176,16 @@ ret
;---------------------------------------------------------- ;----------------------------------------------------------
;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï ªãàá®à  -------------------------- ;--- ¯à®æ¥¤ãà  à¨á®¢ ­¨ï ªãàá®à  --------------------------
;---------------------------------------------------------- ;----------------------------------------------------------
;¢å®¤­ë¥ ebp- 梥â
.clear_cursor: .clear_cursor:
mov edx,ed_color mov edx,ebp
test word ed_flags,ed_shift
je @f
mov edx,shift_color
@@:
mov ebx,cl_curs_x mov ebx,cl_curs_x
mov ecx,cl_curs_y mov ecx,cl_curs_y
jmp .draw_curs jmp .draw_curs
.draw_cursor: .draw_cursor:
mov edx,ed_text_color mov edx,ed_text_color
@@: ;@@:
mov ebx,ed_pos mov ebx,ed_pos
mov ecx,ed_offset mov ecx,ed_offset
sub ebx,ecx sub ebx,ecx
@ -317,36 +301,11 @@ pusha
mov ebx,edx mov ebx,edx
jmp .chk_d jmp .chk_d
.add_8: add ebx,edx .add_8: add ebx,edx
; ;----------- ®â« ¤ª 
; pushad
; mov [data_of_code],0
; mov eax,ebx;ed_offset
; mov edi,data_of_code
; call .str
; ;à¨á®¢ ­¨¥ ä®­ 
; mov eax,13
; mov ebx,178*65536+36
; mov ecx,28*65536+10
; xor edx,edx
; int 0x40
; ;¢ë¢®¤ §­ ç¥­¨ï ­  íªà ­
; mov eax,4
; mov ebx,180*65536+30
; mov ecx,0x10DDBBCC
; mov edx,data_of_code
; mov esi,4
; int 0x40
; popad
; ;----------- ®â« ¤ª 
.chk_d: mov ed_offset,ebx .chk_d: mov ed_offset,ebx
call .draw_bg call .draw_bg
mov dword [esp+28],-1 ;mov dword [esp+28],-1
popa popa
ret ret
@@: @@:
mov dword [esp+28],0 mov dword [esp+28],0
popa popa
@ -358,7 +317,6 @@ popa
pusha pusha
test word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬ test word ed_flags,ed_focus ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
je @b je @b
;<3B>஢¥àª  ­  ­ ¦ âë shift ;<3B>஢¥àª  ­  ­ ¦ âë shift
xor ecx,ecx xor ecx,ecx
push eax push eax
@ -416,20 +374,19 @@ pusha
mov ecx,ed_pos mov ecx,ed_pos
pusha pusha
cmp edx,ecx ;cmp edx,ecx
jne .sh_cl ;jne .sh_cl
;clear ;clear
mov ebp,ed_color mov ebp,edx ;ed_size
call .sh_cl_
jmp .sh_nxt
.sh_cl: mov ebp,edx ;ed_size
call .clear_bg call .clear_bg
mov ebp,ed_color
call .sh_cl_
.sh_nxt: popa .sh_nxt:popa
call .del_char call .del_char
;;;; ;;;;
mov eax,ed_shift_pos mov eax,dword ed_shift_pos
mov ebx,ed_size mov ebx,ed_size
sub ebx,eax sub ebx,eax
mov ed_size,ebx mov ed_size,ebx
@ -487,8 +444,6 @@ pusha
mov ebp,ed_size mov ebp,ed_size
call .clear_bg call .clear_bg
popa popa
sub ecx,ebx ;<3B> ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥­¨ï. sub ecx,ebx ;<3B> ©¤¥¬ ª®«-¢® ᨬ¢®«®¢ ¤«ï ¯¥à¥¤¢¨¦¥­¨ï.
inc edi ;‘¬¥á⨬ ­ è¨ ᨬ¢®«ë ¢ ¯à ¢® inc edi ;‘¬¥á⨬ ­ è¨ ᨬ¢®«ë ¢ ¯à ¢®
std std
@ -548,11 +503,12 @@ popa
test word ed_flags,ed_shift_on test word ed_flags,ed_shift_on
je @f je @f
mov eax,ed_shift_pos mov eax,dword ed_shift_pos
mov ebx,ed_size mov ebx,ed_size
sub ebx,eax sub ebx,eax
mov ed_size,ebx mov ed_size,ebx
mov ebp,ed_color
call .clear_cursor call .clear_cursor
call .check_offset call .check_offset
call .draw_bg call .draw_bg
@ -563,6 +519,7 @@ popa
.draw_all2: .draw_all2:
and word ed_flags,ed_shift_cl and word ed_flags,ed_shift_cl
mov ebp,ed_color
call .clear_cursor call .clear_cursor
call .check_offset call .check_offset
mov ebp,ed_size mov ebp,ed_size
@ -570,59 +527,59 @@ popa
ret ret
;jmp .shift ;jmp .shift
;--- ­ ¦ â  ª« ¢¨è  left --- ;--- ­ ¦ â  ª« ¢¨è  left ---
.left: call .sh_enable .left: mov ebx,ed_pos
mov ebx,ed_pos
test ebx,ebx test ebx,ebx
jz .nd_k jz .sh_st_of
call .clear_cursor or word ed_flags,ed_left_fl
call .sh_first_sh
dec dword ed_pos dec dword ed_pos
jmp .nd_k call .sh_enable
jmp .draw_cursor_text
;--- ­ ¦ â  ª« ¢¨è  right --- ;--- ­ ¦ â  ª« ¢¨è  right ---
.right: call .sh_enable .right: mov ebx,ed_pos
mov ebx,ed_pos
cmp ebx,ed_size cmp ebx,ed_size
je .nd_k je .sh_st_of
call .clear_cursor and word ed_flags,ed_right_fl
call .sh_first_sh
inc dword ed_pos inc dword ed_pos
jmp .nd_k call .sh_enable
.home: call .sh_enable jmp .draw_cursor_text
.home:
mov ebx,ed_pos mov ebx,ed_pos
test ebx,ebx test ebx,ebx
jz .nd_k jz .sh_st_of
call .clear_cursor call .sh_first_sh
xor eax,eax xor eax,eax
mov ed_pos,eax mov ed_pos,eax
jmp .nd_k call .sh_home_end
jmp .draw_cursor_text
.end: call .sh_enable .end:
mov ebx,ed_pos mov ebx,ed_pos
cmp ebx,dword ed_size cmp ebx,dword ed_size
je .nd_k je .sh_st_of
call .clear_cursor
mov eax,ed_size mov eax,ed_size
mov ed_pos,eax mov ed_pos,eax
.nd_k: call .check_offset call .sh_home_end
;test eax,eax jmp .draw_cursor_text
;jz .draw_bg_cursor_text ;Ž¡à ¡®âª  Shift ¤«ï á­ïâ¨ï ¢ë¤¥«¥­¨ï ­¥¨§¢¥áâ­®© ®¡« áâ¨
call .draw_cursor
.shift: ;;;;;;;SHIFT .shift: ;;;;;;;SHIFT
test word ed_flags,ed_shift test word ed_flags,ed_shift
je .f_exit je .f_exit
mov ebp,shift_color @@: mov ebp,shift_color
or word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
call .sh_cl_ call .sh_cl_
jmp .draw_cursor_text jmp .draw_cursor_text
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;
.f_exit:call .check_offset
.f_exit: and word ed_flags,ed_shift_cl and word ed_flags,ed_shift_cl
call .enable_null call .enable_null
jmp .draw_cursor_text jmp .draw_cursor_text
.sh_cl_: .sh_cl_:
;;;;;;SHIFT end ;;;;;;SHIFT end
;®¡à ¡®âª  ®ç¨á⪨, ¯à¨ «¥¢®¬ - ¯à ¢®¬ ¤¢¨¦¥­¨¨ ¢ë¤¥«¥­¨ï
;¤«ï ®¡à ¡®âª¨ á­ïâ¨ï ¢ë¤¥«¥­¨ï ;¤«ï ®¡à ¡®âª¨ á­ïâ¨ï ¢ë¤¥«¥­¨ï
or word ed_flags,ed_shift_bac ; or word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
mov eax,dword ed_pos mov eax,dword ed_pos
mov ebx,dword ed_shift_pos mov ebx,dword ed_shift_pos
cmp eax,ebx cmp eax,ebx
@ -635,6 +592,8 @@ popa
push eax push eax
.sh_n1: .sh_n1:
call .check_offset call .check_offset
; test eax,eax
; jz .drw_sim
call .get_n call .get_n
mov edx,eax ;size of ed_box mov edx,eax ;size of ed_box
; push eax ; push eax
@ -644,7 +603,6 @@ popa
pop ebx ;¡®«ì襥 pop ebx ;¡®«ì襥
pop eax ;¬¥­ì襥 pop eax ;¬¥­ì襥
cmp eax,ecx ;áà ¢­¥­¨¥ á ¬¥­ì襣® á offset. cmp eax,ecx ;áà ¢­¥­¨¥ á ¬¥­ì襣® á offset.
jae .f_f ;¥á«¨ ¡®«ìè¥ jae .f_f ;¥á«¨ ¡®«ìè¥
xor eax,eax xor eax,eax
@ -677,34 +635,187 @@ popa
lea ecx,[edx*2+edx] lea ecx,[edx*2+edx]
shl ecx,1 shl ecx,1
mov bx,cx mov bx,cx
inc ebx
mov edx,ebp;shift_color mov edx,ebp;shift_color
call .draw_bg_eax call .draw_bg_eax
and word ed_flags,1111111111111011b @@: ;and word ed_flags,1111111111111011b
call .enable_null call .enable_null
;mov dword ed_shift_pos,0
ret ret
;;;;;;;;;;;;;;;;;;;;;
;“áâ ­®¢ª - á­ï⨥ ¢ë¤¥«¥­¨ï ¢ ®¤¨­ ᨬ¢®«
;;;;;;;;;;;;;;;;;;;;;
.drw_sim:
mov eax,dword ed_pos
call .draw_rectangle ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª á § ¤ ­­ë¬ 梥⮬
jmp @b
;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;
;”ãªæ¨ï ãáâ ­®¢ª¨ ¢ë¤¥«¥­¨ï ¯à¨ ¤¢¨¦¥­¨ï ¢«¥¢® ¨ ¢¯à ¢® ¨ ­ ¦ â¨¨ shift
;‹®£¨ª :
;;;;;;;;;;
.draw_wigwag:
;äã­ªæ¨ï ãáâ ­®¢ª¨ ¯¥à¥¬¥­­ëå
mov ebp,shift_color
call .clear_cursor
or word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
mov ebp,shift_color
mov eax,dword ed_pos
;mov ebx,dword ed_shift_pos
test word ed_flags,ed_left_fl
jz .low
; sub eax,2
;dec eax
jmp @f
;;;;;;;;;;
;”ãªæ¨ï 㤠«¥­¨ï ¢ë¤¥«¥­¨ï ¯à¨ ¤¢¨¦¥­¨ï ¢«¥¢® ¨ ¢¯à ¢® ¨ ­ ¦ â¨¨ shift
;‹®£¨ª :
;;;;;;;;;;
.draw_wigwag_cl:
;äã­ªæ¨ï ãáâ ­®¢ª¨ ¯¥à¥¬¥­­ëå
mov ebp,ed_color
call .clear_cursor
mov ebp,ed_color
mov eax,dword ed_pos
;mov ebx,dword ed_shift_pos
test word ed_flags,ed_left_fl
jz .low
;dec eax
@@: call .draw_rectangle ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª § ªà è¨¢ ¥¬®© ®¡« áâ¨
ret
.low: dec eax
jmp @b
;¢å®¤­®© ¯ à ¬¥âà ebx - ed_pos
.sh_first_sh:
test word ed_flags,ed_shift
je @f
mov dword ed_shift_pos_old,ebx
test word ed_flags,ed_shift_on
jne @f
mov dword ed_shift_pos,ebx
or word ed_flags,ed_shift_on
@@: ret
;Ž¡à ¡®âª  ªà ©­¨å ¯®«®¦¥­¨© ¢ editbox ¯à¨ ­ ¦ â®¬ shift
;¯à®¨§¢®¤¨â á­ï⨥ ¢ë¤¥«¥­¨¥, ¥á«¨ ­¥â shift
;¨­ ç¥ ¢®®¡é¥ ¢ë室¨â
.sh_st_of:
test word ed_flags,ed_shift
jne @f
test word ed_flags,ed_shift_bac
je @f
mov ebp,ed_color
call .sh_cl_ ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
call .draw_wigwag_cl
and word ed_flags,ed_shift_cl ; ®ç¨á⪠ ®â ⮣® çâ® ã¡à «¨ ¢ë¤¥«¥­¨¥
jmp .draw_cursor_text
@@:
;----------- ®â« ¤ª 
; pushad
; mov dword [ed_buffer.3],0
; mov eax,ebx;word ed_flags
; mov edi,ed_buffer.3
; call .str
; ;à¨á®¢ ­¨¥ ä®­ 
; mov eax,13
; mov ebx,178*65536+70
; mov ecx,28*65536+10
; xor edx,edx
; int 0x40
; ;¢ë¢®¤ §­ ç¥­¨ï ­  íªà ­
; mov eax,4
; mov ebx,180*65536+30
; mov ecx,0x10DDBBCC
; mov edx,ed_buffer.3
; mov esi,8
; int 0x40
; popad
;----------- ®â« ¤ª 
and word ed_flags,ed_shift_off
popa
ret
;¯à®¢¥àª  á®áâ®ï­¨ï shift ¡ë« «¨ ®­ ­ ¦ â à ­ìè¥? ;¯à®¢¥àª  á®áâ®ï­¨ï shift ¡ë« «¨ ®­ ­ ¦ â à ­ìè¥?
.sh_enable: .sh_enable:
test word ed_flags,ed_shift test word ed_flags,ed_shift
je @f jne .sh_ext_en ;­ à¨á®¢ âì § ªà è¥­ë© ¯àאַ㣮«ì­¨ª
test word ed_flags,ed_shift_on
jne .sh_ext_en
push dword ed_pos
pop dword ed_shift_pos
or word ed_flags,ed_shift_on
ret
@@: test word ed_flags,ed_shift_bac test word ed_flags,ed_shift_bac
je @f je @f
call .check_offset
mov ebp,ed_color mov ebp,ed_color
call .sh_cl_ ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â  call .sh_cl_ ;®ç¨á⪠ ¢ë¤¥«¥­®£® äà £¬¥­â 
@@: and word ed_flags,ed_shift_cl call .draw_wigwag_cl
; ret and word ed_flags,ed_shift_cl ; 1¢ à ­¥ ­ã¦­®
ret
@@: mov ebp,ed_color
call .clear_cursor
call .check_offset
ret
.sh_ext_en: .sh_ext_en:
ret call .check_offset
test eax,eax
jnz @f
;<3B>¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
mov eax,dword ed_shift_pos
mov ebx,dword ed_pos
mov ecx,dword ed_shift_pos_old
;¯à®¢¥àª  ¨ à¨á®¢ ­¨¥ § ªà è¥­ëå ®¡« á⥩
cmp eax,ecx
je .1_shem
jb .smaller
cmp ecx,ebx
ja .1_shem
call .draw_wigwag_cl ;clear
jmp .sh_e_end
.smaller:
cmp ecx,ebx
jb .1_shem
call .draw_wigwag_cl ;clear
jmp .sh_e_end
;alike =
.1_shem: call .draw_wigwag
.sh_e_end: and word ed_flags,ed_shift_off
ret
@@: mov ebp,shift_color
call .sh_cl_
jmp .sh_e_end
;äã­ªæ¨ï ¤«ï ®¡à ¡®âª¨ shift ¯à¨ ­ ¦ â¨¨ home and end
.sh_home_end:
mov ebp,ed_color
call .clear_cursor
test word ed_flags,ed_shift_bac
je @f
mov ebp,ed_color
call .sh_cl_
@@: test word ed_flags,ed_shift
je .sh_exit_ ;­ à¨á®¢ âì § ªà è¥­ë© ¯àאַ㣮«ì­¨ª (®¡« áâì)
call .check_offset
mov ebp,shift_color
call .sh_cl_
or word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
jmp .sh_e_end
.sh_exit_: ret
; test word ed_flags,ed_shift_bac
; je @f
;äã­ªæ¨ï ¢­¥á¥­¨ï 0 ¯®  ¤à¥áã ed_size+1 ;äã­ªæ¨ï ¢­¥á¥­¨ï 0 ¯®  ¤à¥áã ed_size+1
.enable_null: .enable_null:
pusha pusha
@ -735,8 +846,7 @@ popa
sub edx,ecx sub edx,ecx
add esi,ecx add esi,ecx
mov dword ed_shift_pos,ebp
mov ed_shift_pos,ebp
jmp .del_ch_sh jmp .del_ch_sh
;¥á«¨ ¨­ ç¥ ;¥á«¨ ¨­ ç¥
.dh_n: .dh_n:
@ -745,7 +855,7 @@ popa
add ebx,ecx add ebx,ecx
sub edx,eax sub edx,eax
add esi,eax add esi,eax
mov ed_shift_pos,ebp mov dword ed_shift_pos,ebp
jmp .del_ch_sh jmp .del_ch_sh
@@: add esi,ecx ;㪠§ â¥«ì + ᬥ饭¨¥ ª ॠ«ì­®¬ã ¡ãää¥àã @@: add esi,ecx ;㪠§ â¥«ì + ᬥ饭¨¥ ª ॠ«ì­®¬ã ¡ãää¥àã
@ -812,8 +922,26 @@ popa
mov edx,ed_color mov edx,ed_color
call .draw_bg_eax call .draw_bg_eax
ret ret
;;;;;;;;;;;;;;;;;;;
;;; Ž¡à ¡®âª  ¯à¨¬¨â¨¢®¢
;;;;;;;;;;;;;;;;;;;;
;<3B> à¨á®¢ âì ¯àאַ㣮«ì­¨ª, 梥⠯¥à¥¤ ¥âáï ¢ ebp
;¢å®¤­ë¥ ¯ à ¬¥âàë:
;eax=dword ed_pos
;ebp=-梥â ed_color or shift_color
.draw_rectangle:
; mov eax,dword ed_pos
mov ecx,dword ed_offset
sub eax,ecx
lea ebx,[eax*2+eax]
shl ebx,1
inc ebx
add ebx,ed_left
shl ebx,16
mov bx,6
mov edx,ebp
call .draw_bg_eax
ret
;========================================================== ;==========================================================
;=== ®¡à ¡®âª  ¬ëè¨ ======================================= ;=== ®¡à ¡®âª  ¬ëè¨ =======================================
;========================================================== ;==========================================================
@ -863,6 +991,7 @@ pusha
jg ._blur;.mouse_end_no_focus jg ._blur;.mouse_end_no_focus
;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  --- ;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  ---
push eax push eax
mov ebp,ed_color
call .clear_cursor call .clear_cursor
pop eax pop eax
xor dx,dx xor dx,dx
@ -892,6 +1021,7 @@ pusha
jne @f jne @f
btr word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬ btr word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
jnc @f jnc @f
mov ebp,ed_color
call .clear_cursor call .clear_cursor
.drc: call .draw_border .drc: call .draw_border
@@: @@:
@ -912,13 +1042,20 @@ ret
;popa ;popa
;ret ;ret
} }
ed_figure_only=1000000000000000b ed_figure_only= 1000000000000000b
ed_always_focus=100000000000000b ed_always_focus= 100000000000000b
ed_focus=10b ed_focus=10b
ed_shift_on=1000b ed_shift_on= 1000b ;¥á«¨ ­¥ ãáâ ­®¢«¥­ -§­ ç¨â ¢¯¥à¢ë¥ ­ ¦ â shift,¥á«¨ ¡ë« ãáâ ­®¢«¥­, §­ ç¨â ¬ë 㦥 çâ® - â® ¤¥« «¨ 㤥ন¢ ï shift
ed_shift=100b ed_shift= 100b ;¢ª«îç ¥âáï ¯à¨ ­ ¦ â¨¨ ­  shift â.¥. ¥á«¨ ­ ¦¨¬ î
ed_shift_bac=10000b ed_shift_off= 1111111111111011b
ed_shift_cl=1111111111100011b ed_shift_bac= 10000b ;¡¨â ¤«ï ®ç¨á⪨ ¢ë¤¥«¥­®£® shift â.¥. ¯à¨ ãáâ ­®¢ª¥ £®¢®à¨â çâ® ¥áâì ¢ë¤¥«¥­¨¥
ed_shift_cl= 1111111111100011b
ed_left_fl= 100000b
ed_right_fl= 1111111111011111b
ed_insert= 10000000b
ed_insert_cl= 1111111101111111b
ed_height=14 ; ¢ëá®â 
shift_color=0x6a9480
macro draw_edit_boxes start,end macro draw_edit_boxes start,end
{ {
mov edi,start mov edi,start
@ -948,7 +1085,7 @@ macro key_edit_boxes start,end
add edi,ed_struc_size add edi,ed_struc_size
loop @b loop @b
} }
ed_struc_size=62 ed_struc_size=66
struc edit_box width,left,top,color,focus_border_color,\ struc edit_box width,left,top,color,focus_border_color,\
blur_border_color,text_color,max,text,flags,size blur_border_color,text_color,max,text,flags,size
{ {
@ -967,7 +1104,8 @@ struc edit_box width,left,top,color,focus_border_color,\
.offset dd 0 .offset dd 0
.cl_curs_x dd 0 .cl_curs_x dd 0
.cl_curs_y dd 0 .cl_curs_y dd 0
.shift dd 0 .shift dd 0
.shift_old dd 0
} }
macro edit_boxes_set_sys_color start,end,color_table macro edit_boxes_set_sys_color start,end,color_table

View File

@ -1,3 +1,3 @@
@fasm editbox.asm editbox @fasm editbox.asm editbox
@mtappack editbox @kpack editbox
@pause @pause

View File

@ -95,7 +95,7 @@ ed_buffer:
;text_b: db 'Š®«-¢® ᨬ¢®«®¢' ;text_b: db 'Š®«-¢® ᨬ¢®«®¢'
;buffer: dd 0 ;buffer: dd 0
buffer_end: buffer_end:
hed db 'EDITBOX optimization and retype <Lrz> date 15.02.2007',0 hed db 'EDITBOX optimization and retype <Lrz> date 06.03.2007',0
i_end1: i_end1:
rb 1024 rb 1024
i_end: i_end: