upgrade editbox

git-svn-id: svn://kolibrios.org@402 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2007-03-09 06:25:26 +00:00
parent e0c5415aa5
commit 03d5be2191
2 changed files with 67 additions and 9 deletions

View File

@ -84,6 +84,8 @@ pusha
call .check_offset ;¢ëç¨á«¥­¨¥ ¯®§¨æ¨¨ ªãàá®à  áâ ¡¨«ì­ 
;--- à¨á㥬 ¢­ãâ७­îî ®¡« áâì ---
call .draw_bg ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª à ¡®ç¥© ®¡« áâ¨
;---- à¨á㥬 ¢ë¤¥«¥­¨¥, ¯® shift ¥á«¨ ¥áâì
call .draw_shift
.draw_cursor_text:
;--- à¨á㥬 ªãàá®à ---
;--- ¬®¦¥â ¥£® ­¥ ­ ¤® à¨á®¢ âì ----
@ -94,6 +96,18 @@ pusha
call .draw_text
popa
ret
;----------------------------------------------------------
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ¢ë¤¥«¥­®© ç á⨠-----------------
;----------------------------------------------------------
.draw_shift:
test word ed_flags,ed_shift_bac ;ãáâ ­®¢ª  ä« £ , ¢ë¤¥«¥­­®© ®¡« áâ¨
jz @f
mov ebp,shift_color
mov ebx,dword ed_shift_pos
call .sh_cl_
@@: ret
;----------------------------------------------------------
;--- ¯à®æ¥¤ãà  ¯à®à¨á®¢ª¨ ⥪áâ  --------------------------
;----------------------------------------------------------
@ -549,7 +563,6 @@ popa
;¤«ï ®¡à ¡®âª¨ á­ïâ¨ï ¢ë¤¥«¥­¨ï
;¢å®¤­ë¥ ¯ à ¬¥âàë ebp=color ebx=ed_shift_pos
mov eax,dword ed_pos
; mov ebx,dword ed_shift_pos
cmp eax,ebx
jae .sh_n
push eax ;¬¥­ì襥 ¢ eax
@ -640,7 +653,6 @@ popa
mov eax,dword ed_pos
test word ed_flags,ed_left_fl
jz .low
;dec eax
@@: call .draw_rectangle ;­ à¨á®¢ âì ¯àאַ㣮«ì­¨ª § ªà è¨¢ ¥¬®© ®¡« áâ¨
ret
.low: dec eax
@ -696,7 +708,7 @@ popa
.sh_ext_en:
call .check_offset
test word ed_flags,ed_offset_fl
jne @f
je @f
;<3B>¨á®¢ ­¨¥ § ªà è¥­ëå ¯àאַ㣮«ì­¨ª®¢ ¨ ®ç¨á⪠ ¨å
mov eax,dword ed_shift_pos
mov ebx,dword ed_pos
@ -733,7 +745,7 @@ popa
call .sh_cl_
@@: test word ed_flags,ed_shift
je .sh_exit_ ;­ à¨á®¢ âì § ªà è¥­ë© ¯àאַ㣮«ì­¨ª (®¡« áâì)
je .sh_exit_ ;¢ë©â¨
mov ebp,shift_color
mov ebx,dword ed_shift_pos
call .sh_cl_
@ -824,7 +836,6 @@ popa
pop eax ;ed_pos
mov ecx,ed_offset
sub eax,ecx
.nxt:
mov ebp,eax ;¯à®¢¥àª  ­  ¢ë室 § ªà è¨¢ ¥¬®© ®¡« á⨠§  ¯à¥¤¥«ë ¤«¨­ë
add ebp,ebx
@ -925,9 +936,32 @@ pusha
cmp ax,ed_size
jna @f
mov ax,ed_size
@@:
test word ed_flags,ed_shift_bac
je @f
mov ebp,dword ed_color
mov ebx,dword ed_shift_pos
push eax
call .sh_cl_
and word ed_flags,ed_shift_cl
pop eax
@@:
test word ed_flags,ed_shift
je @f
mov ebx,ed_pos
mov ed_shift_pos,ebx
mov ed_pos,eax
mov ebp,dword shift_color
call .sh_cl_
or word ed_flags,ed_shift_bac ;ãáâ ­®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨
and word ed_flags,ed_shift_off
jmp .m_sh
@@:
mov ed_pos,ax
call .check_offset
.m_sh: call .draw_text
call .draw_cursor
;----------------------------------------------------------
;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
@ -941,6 +975,7 @@ pusha
jne @f
btr word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
jnc @f
mov ebp,ed_color
call .clear_cursor
.drc: call .draw_border
@ -1032,6 +1067,28 @@ struc edit_box width,left,top,color,focus_border_color,\
.shift_old dd 0
}
struc edit_box1 width,left,top,color,focus_border_color,\
blur_border_color,text_color,max,text,flags,ed_size
{
.width dd width
.left dd left
.top dd top
.color dd color
.focus_border_color dd focus_border_color
.blur_border_color dd blur_border_color
.text_color dd text_color
.max dd max
.text dd text
.flags dw flags+0
.size dd ed_size
.pos dd 0
.offset dd 0
.cl_curs_x dd 0
.cl_curs_y dd 0
.shift dd 0
.shift_old dd 0
}
macro edit_boxes_set_sys_color start,end,color_table
{
mov edi,start

View File

@ -82,7 +82,7 @@ draw_window: ;
;DATA ¤ ­­ë¥
editboxes:
edit1 edit_box 168,5,10,0xffffff,0,0,0,99,ed_buffer.2,ed_figure_only
edit2 edit_box 168,5,30,0xffffff,0,0,0,512,ed_buffer.1,ed_focus
edit2 edit_box1 250,5,30,0xffffff,0,0,0,308,hed,ed_focus,53
edit3 edit_box 35,5,50,0xffffff,0,0,0,9,ed_buffer.3,ed_figure_only
edit4 edit_box 16,5,70,0xffffff,0,0,0,1,ed_buffer.4,ed_figure_only
editboxes_end:
@ -97,6 +97,7 @@ ed_buffer:
;buffer: dd 0
buffer_end:
hed db 'EDITBOX optimization and retype <Lrz> date 07.03.2007',0
rb 256
i_end1:
rb 1024
i_end: