fixed bug

git-svn-id: svn://kolibrios.org@306 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2007-02-01 07:20:59 +00:00
parent dbd82dd523
commit e7be690de5
2 changed files with 37 additions and 29 deletions

View File

@ -1,3 +1,4 @@
; <Lrz> 01.02.2007 ¤®à ¡®âª  edit_box, ¨á¯à ¢¨« ¡ £¨.
; <Lrz> 26.01.2007 ­®à¬ «ì­ ï à ¡®â  ª®¬¯ ­¥­â  ¨á¯à ¢¨« äãªæ¨î .check_offset ; <Lrz> 26.01.2007 ­®à¬ «ì­ ï à ¡®â  ª®¬¯ ­¥­â  ¨á¯à ¢¨« äãªæ¨î .check_offset
; <Lrz> 24.01.2007 ¯®ä¨ªá¥« ¡ £¨ ¢ë§¢ ­ë¥ ­¥ ¯à ¢¨«ì­ë¬ ª®¤®¬ )). ; <Lrz> 24.01.2007 ¯®ä¨ªá¥« ¡ £¨ ¢ë§¢ ­ë¥ ­¥ ¯à ¢¨«ì­ë¬ ª®¤®¬ )).
; <Lrz> 22.01.2007 ¨§¡ ¢¨«áï ®â £«îª®¢ ¯à¨ à ¡®â¥ á ¢ë¤¥«¥­¨¥¬ ¨ 㤠«¥­¨¥, ª®à४⭠ï à ¡®â  ª« ¢¨è¥© del & backspase ; <Lrz> 22.01.2007 ¨§¡ ¢¨«áï ®â £«îª®¢ ¯à¨ à ¡®â¥ á ¢ë¤¥«¥­¨¥¬ ¨ 㤠«¥­¨¥, ª®à४⭠ï à ¡®â  ª« ¢¨è¥© del & backspase
@ -127,12 +128,12 @@ ret
;--- à¨á㥬 ⥪áâ --- ;--- à¨á㥬 ⥪áâ ---
@@: mov eax,4 @@: mov eax,4
mov ebx,ed_left mov ebx,ed_left
mov edx,ed_offset
add ebx,2 add ebx,2
shl ebx,16 shl ebx,16
mov bx,ed_top mov bx,ed_top
add ebx,4 add ebx,4
mov ecx,ed_text_color mov ecx,ed_text_color
mov edx,ed_offset
add edx,ed_text add edx,ed_text
int 0x40 int 0x40
ret ret
@ -143,19 +144,16 @@ ret
;edx - color ;edx - color
;---------------------------------------------------------- ;----------------------------------------------------------
.draw_bg_eax: .draw_bg_eax:
;pusha
mov ecx,ed_top mov ecx,ed_top
add ecx,1 add ecx,1
shl ecx,16 shl ecx,16
mov cx,13 mov cx,13
mov eax,13 mov eax,13
int 0x40 int 0x40
;popa
ret ret
jmp @f jmp @f
.draw_bg: .draw_bg:
;pusha
mov ebx,ed_left mov ebx,ed_left
add ebx,1 add ebx,1
shl ebx,16 shl ebx,16
@ -164,23 +162,21 @@ ret
@@: @@:
mov ecx,ed_top mov ecx,ed_top
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 sub ecx,1
int 0x40
mov edx,ed_color
mov eax,13
int 0x40
;popa
ret ret
;---------------------------------------------------------- ;----------------------------------------------------------
;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ª®«¨ç¥á⢠ ᨬ¢®«®¢ ¢ ⥪ã饩 é¨à¨­¥ ª®¬¯®­¥­â  -------------- ;--- ¯à®æ¥¤ãà  ¯®«ã祭¨ï ª®«¨ç¥á⢠ ᨬ¢®«®¢ ¢ ⥪ã饩 é¨à¨­¥ ª®¬¯®­¥­â  --------------
;---------------------------------------------------------- ;----------------------------------------------------------
.get_n: .get_n:
xor edx,edx ;१ã«ìâ â à á¯®«®£ ¥âáï ¢ ¯ à¥ edx:eax ¢ eax - ®áâ â®ª
mov eax,ed_width ;¯®«ã祬 è¨à¨­ã ª®¬¯®­¥­â  mov eax,ed_width ;¯®«ã祬 è¨à¨­ã ª®¬¯®­¥­â 
xor edx,edx ;१ã«ìâ â à á¯®«®£ ¥âáï ¢ ¯ à¥ edx:eax ¢ eax - ®áâ â®ª
sub eax,4 ;¢ëç⨬ 4 sub eax,4 ;¢ëç⨬ 4
mov ebx,6 ;§ £à㧬¨ ¤¥«¨â¥«ì mov ebx,6 ;§ £à㧬¨ ¤¥«¨â¥«ì
div ebx ;à §¬¤¥«¨¬ ­  6 div ebx ;à §¬¤¥«¨¬ ­  6
@ -210,14 +206,12 @@ ret
shl ebx,1 shl ebx,1
;imul ebx,6 ;imul ebx,6
add bx,ed_left add bx,ed_left
mov ecx,ed_top
inc ebx inc ebx
add ecx,2
mov ebp,ebx mov ebp,ebx
;push bx
shl ebx,16 shl ebx,16
mov bx,bp mov bx,bp
;pop bx
mov ecx,ed_top
add ecx,2
mov ebp,ecx mov ebp,ecx
shl ecx,16 shl ecx,16
@ -281,7 +275,7 @@ ret
; ¨§¬¥­¨«®áì ; ¨§¬¥­¨«®áì
;---------------------------------------------------------- ;----------------------------------------------------------
.check_offset: .check_offset:
pushad pushad
mov ecx,ed_pos mov ecx,ed_pos
mov ebx,ed_offset mov ebx,ed_offset
cmp ebx,ecx cmp ebx,ecx
@ -346,12 +340,12 @@ ret
call .draw_bg call .draw_bg
mov dword [esp+28],-1 mov dword [esp+28],-1
popad popad
ret ret
@@: @@:
mov dword [esp+28],0 mov dword [esp+28],0
popad popad
ret ret
@ -432,7 +426,7 @@ pusha
;¯à®¢¥àª  ­  shift ;¯à®¢¥àª  ­  shift
test word ed_flags,ed_shift_on @@: test word ed_flags,ed_shift_on
je @f je @f
;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos ;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
push eax push eax
@ -465,9 +459,7 @@ pusha
or word ed_flags,ed_insert or word ed_flags,ed_insert
jmp .no_figure jmp .no_figure
.ins_v: .ins_v:
pop eax edi dec dword [ebp+38];ed_size ;processing is insert
dec dword ed_size ;processing is insert
push edi eax
sub esi,ecx sub esi,ecx
add esi,ebx add esi,ebx
mov edi,esi mov edi,esi
@ -530,9 +522,6 @@ pusha
jnz .del_bac jnz .del_bac
test word ed_flags,ed_shift_on test word ed_flags,ed_shift_on
jne .bac_del jne .bac_del
;jmp @b
popa popa
ret ret
.del_bac: .del_bac:
@ -562,8 +551,8 @@ pusha
call .clear_cursor call .clear_cursor
call .check_offset call .check_offset
;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
cmp eax,0 test eax,eax
je @f jne @f
call .draw_bg call .draw_bg
ret ret
;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
@ -737,8 +726,6 @@ pusha
;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos ;‚室­ë¥ ¤ ­­ë¥ edx=ed_size;ecx=ed_pos
.del_char: .del_char:
mov esi,ed_text mov esi,ed_text
test word ed_flags,ed_shift_on test word ed_flags,ed_shift_on
je @f je @f
mov eax,dword ed_shift_pos mov eax,dword ed_shift_pos
@ -865,6 +852,8 @@ ret
;.blur: ;.blur:
;pusha ;pusha
._blur: ._blur:
test word ed_flags,ed_always_focus
jne @f
btr word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬ btr word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
jnc @f jnc @f
call .clear_cursor call .clear_cursor
@ -888,6 +877,7 @@ ret
;ret ;ret
} }
ed_figure_only=1000000000000000b ed_figure_only=1000000000000000b
ed_always_focus=100000000000000b
ed_focus=10b ed_focus=10b
ed_shift_on=1000b ed_shift_on=1000b
ed_shift=100b ed_shift=100b
@ -967,4 +957,22 @@ macro edit_boxes_set_sys_color start,end,color_table
mov ed_blur_border_color,eax mov ed_blur_border_color,eax
add edi,ed_struc_size add edi,ed_struc_size
loop @b loop @b
}
macro draw_edit_box ed_ptr
{
mov edi,ed_ptr
call edit_box.draw
}
macro mouse_edit_box ed_ptr
{
mov edi,ed_ptr
call edit_box.mouse
}
macro key_edit_box ed_ptr
{
mov edi,ed_ptr
call edit_box.key
} }

View File

@ -101,7 +101,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 26.01.2007' hed db 'EDITBOX optimization and retype <Lrz> date 01.02.2007'
i_end1: i_end1:
rb 2048 rb 2048
i_end: i_end: