modification event handler mouse

git-svn-id: svn://kolibrios.org@449 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Alexey Teplov ( 2007-04-04 06:40:20 +00:00
parent 1408306a87
commit 3e1c43afe7
2 changed files with 78 additions and 27 deletions

View File

@ -1,3 +1,4 @@
; <Lrz> 04.04.2007 Œ®¤¥à­¨§¨à®¢ « á¨á⥬㠢뤥«¥­¨ï, áãé¥á⢥­­® ¯¥à¥¤¥« ­® ã¯à ¢«¥­¨¥ ¨ ®¡à ¡®âª , ¤®¡ ¢«¥­­® ¡«®ª¨à®¢ ­¨ï ®¡à ¡®âª¨ ¤àã£¨å ¡®ªá®¢, ¢® ¢à¥¬ï ¢ë¤¥«¥­¨ï ¬ë誮© ⥪áâ , ¤«ï í⮣® ¢ ⥪á⠯ணࠬ¬ë ­¥®¡å®¤¨¬® ¤®¡ ¢¨âì ¨¤¥­â¨ä¨ª â®à ¡®ªá  â.¥. dd 0x0 ¨ ¢ ­¥£® ¡ã¤¥â ¯®¬¥é âìáï 㪠 â¥«ì ­  editbox
; <Lrz> 30.03.2007 <20>¥à¥¤¥« « ¯à®æ¥¤ãà㠢뤥«¥­¨ï, ⥯¥àì ⥪á⠢뤥«ï¥âáï ⮫쪮 ⮫쪮 ¬ë誮© ; <Lrz> 30.03.2007 <20>¥à¥¤¥« « ¯à®æ¥¤ãà㠢뤥«¥­¨ï, ⥯¥àì ⥪á⠢뤥«ï¥âáï ⮫쪮 ⮫쪮 ¬ë誮©
; <Lrz> 09.03.2007 „®¯¨á « ã¯à ¢«¥­¨¥ mouse + shift ¢ë¤¥«¥­¨¥ ¨ ¯¥à¥¬¥é¥­¨¥ ; <Lrz> 09.03.2007 „®¯¨á « ã¯à ¢«¥­¨¥ mouse + shift ¢ë¤¥«¥­¨¥ ¨ ¯¥à¥¬¥é¥­¨¥
; <Lrz> 07.03.2007 „®¯¨á « ã¯à ¢«¥­¨¥ á shift home + end ãá¯à ¢¨« ­¥áª®«ìª® ¡ £®¢ ; <Lrz> 07.03.2007 „®¯¨á « ã¯à ¢«¥­¨¥ á shift home + end ãá¯à ¢¨« ­¥áª®«ìª® ¡ £®¢
@ -891,9 +892,18 @@ pusha ;
;========================================================== ;==========================================================
.mouse: .mouse:
pusha pusha
mov eax,dword [mouse_flag]
test eax,eax
jz @f
cmp eax,edi
je @f
popa
ret
;---------------------------------------------------------- ;----------------------------------------------------------
;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ ----------------------- ;--- ¯®«ãç ¥¬ á®áâ®ï­¨¥ ª­®¯®ª ¬ëè¨ -----------------------
;---------------------------------------------------------- ;----------------------------------------------------------
@@:
mov eax,37 mov eax,37
mov ebx,2 mov ebx,2
int 0x40 int 0x40
@ -903,35 +913,70 @@ pusha
test eax,1 test eax,1
jnz .mouse_left_button jnz .mouse_left_button
and word ed_flags,ed_mouse_on_off and word ed_flags,ed_mouse_on_off
xor ebx,ebx
mov dword [mouse_flag],ebx
popa popa
ret ret
;----------------------------------------------------------
;--- Ž¡à ¡®âª  .mouse_wigwag
;----------------------------------------------------------
.mouse_wigwag:
shr eax,16
or word ed_flags,ed_shift_on+ed_shift
mov ecx,structure_of_potock
mov ebx,dword [ecx+34]
add ebx,ed_left
add ebx,5
cmp eax,ebx
jl .left
add ebx,ed_width
cmp eax,ebx
jg .right
jmp ._mvpos
.mouse_left_button: .mouse_left_button:
;---------------------------------------------------------- ;----------------------------------------------------------
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ----------------------------- ;--- ¬®¤¨ä¨æ¨à㥬 ª®®à¤¨­ âë, â.¥. ¤®¡ ¢«ï¥¬ ª®®à¤¨­ âë ®ª­ .
;----------------------------------------------------------
mov eax,9
mov ebx,structure_of_potock
or ecx,-1
int 0x40
;----------------------------------------------------------
;--- ¯®«ãç ¥¬ ª®®à¤¨­ âë ¬ëè¨ ®â­®á¨â¥«ì­® 0 â.¥ ¢á¥© ®¡« á⨠íªà ­ 
;---------------------------------------------------------- ;----------------------------------------------------------
mov eax,37 mov eax,37
xor ebx,ebx xor ebx,ebx
inc ebx
int 0x40 int 0x40
;---------------------------------------------------------- ;----------------------------------------------------------
;--- € ­¥ 㤥ন¢ ¥¬ «¨ ¬ë ª« ¢¨èã ¬ë誨, ¯¥à¥¬¥é ï ªãàá®à, ¢® ¢á¥ à §­ë¥ áâ®à®­ë?
;----------------------------------------------------------
mov ecx,structure_of_potock
test word ed_flags,ed_mouse_on
jne .mouse_wigwag
;----------------------------------------------------------
;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box ------------- ;--- ¯à®¢¥à塞, ¯®¯ ¤ ¥â «¨ ªãàá®à ¢ edit box -------------
;---------------------------------------------------------- ;----------------------------------------------------------
mov ebx,ed_top mov ebx,dword [ecx+38]
add ebx,ed_top
add ebx,22
cmp ax,bx cmp ax,bx
jl ._blur;.mouse_end_no_focus jl ._blur;.mouse_end_no_focus
add bx,ed_height add ebx,ed_height
cmp ax,bx cmp ax,bx
jg ._blur;.mouse_end_no_focus jg ._blur;.mouse_end_no_focus
shr eax,16 shr eax,16
mov bx,ed_left mov ebx,dword [ecx+34]
add ebx,ed_left
add ebx,5
cmp ax,bx cmp ax,bx
jl ._blur;.mouse_end_no_focus jl ._blur;.mouse_end_no_focus
add bx,ed_width add ebx,ed_width
cmp ax,bx cmp ax,bx
jg ._blur;.mouse_end_no_focus jg ._blur;.mouse_end_no_focus
;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  --- ;--- ¨§¬¥­ï¥¬ ¯®§¨æ¨î ªãàá®à  ---
@ -939,16 +984,20 @@ pusha
mov ebp,ed_color mov ebp,ed_color
call .clear_cursor call .clear_cursor
pop eax pop eax
xor dx,dx ._mvpos:
sub ax,ed_left mov ecx,structure_of_potock
add ax,2 mov ebx,dword [ecx+34]
mov bx,6 xor edx,edx
sub eax,ed_left
sub eax,ebx
sub eax,5-2 ;⮫騭  ®¡¢®¤ª¨ ᪨­  =5
mov ebx,6
div bx div bx
add ax,ed_offset add eax,ed_offset
cmp ax,ed_size cmp eax,ed_size
jna @f jna ._mshift
mov ax,ed_size mov eax,ed_size
@@: ._mshift:
;;;;;;; ;;;;;;;
;;‘¥ªæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift ;;‘¥ªæ¨ï ®¡à ¡®âª¨ shift ¨ ¢ë¤¥«¥­¨ï ¯® shift
;;;;;;; ;;;;;;;
@ -965,39 +1014,39 @@ pusha
jne @f jne @f
mov dword ed_shift_pos,eax mov dword ed_shift_pos,eax
or word ed_flags,ed_mouse_on or word ed_flags,ed_mous_adn_b;ed_mouse_on
mov dword ed_pos,eax mov dword ed_pos,eax
jmp .m_sh jmp .m_sh
@@: @@:
cmp eax,dword ed_shift_pos ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì cmp eax,dword ed_shift_pos ;¥á«¨ ¯®§¨æ¨¨ ­¥ ¨§¬¥­¨«¨áì
je @f je .mouse_ex
mov ed_pos,eax mov ed_pos,eax
mov ebp,dword shift_color mov ebp,dword shift_color
mov ebx,dword ed_shift_pos mov ebx,dword ed_shift_pos
call .sh_cl_ call .sh_cl_
or word ed_flags,ed_mous_adn_b ;ãáâ ­®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨ or word ed_flags,ed_mous_adn_b ;ãáâ ­®¢¨¬ ¡¨â çâ® ¬ë ¢ë¤¥«¨«¨ +shift_on +
mov dword [mouse_flag],edi
.m_sh: call .draw_text .m_sh: call .draw_text
call .draw_cursor call .draw_cursor
;---------------------------------------------------------- ;----------------------------------------------------------
;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  --------------------------- ;--- ¯à®æ¥¤ãà  ãáâ ­®¢ª¨ 䮪ãá  ---------------------------
;---------------------------------------------------------- ;----------------------------------------------------------
bts word ed_flags,1 bts word ed_flags,1
jc @f jc .mouse_ex
jmp .drc jmp .drc
._blur: ._blur:
test word ed_flags,ed_always_focus test word ed_flags,ed_always_focus
jne @f jne .mouse_ex
btr word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬ btr word ed_flags,1 ; ¥á«¨ ­¥ ¢ 䮪ãá¥, ¢ë室¨¬
jnc @f jnc .mouse_ex
mov ebp,ed_color mov ebp,ed_color
call .clear_cursor call .clear_cursor
.drc: call .draw_border .drc: call .draw_border
@@: .mouse_ex:
popa popa
ret ret
;---------------------------------------------------------- ;----------------------------------------------------------
;--- ¯à®æ¥¤ãà  à §¬ë¢ ­¨ï 䮪ãá  -------------------------- ;--- ¯à®æ¥¤ãà  à §¬ë¢ ­¨ï 䮪ãá  --------------------------
;---------------------------------------------------------- ;----------------------------------------------------------

View File

@ -82,7 +82,7 @@ draw_window: ;
;DATA ¤ ­­ë¥ ;DATA ¤ ­­ë¥
editboxes: editboxes:
edit1 edit_box 168,5,10,0xffffff,0,0,0,99,ed_buffer.2,ed_figure_only edit1 edit_box 168,5,10,0xffffff,0,0,0,99,ed_buffer.2,ed_figure_only
edit2 edit_box 250,5,30,0xffffff,0,0,0,308,hed,ed_focus,53 edit2 edit_box 250,5,30,0xffffff,0,0xAABBCC,0,308,hed,ed_focus,53
edit3 edit_box 35,5,50,0xffffff,0,0,0,9,ed_buffer.3,ed_figure_only 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 edit4 edit_box 16,5,70,0xffffff,0,0,0,1,ed_buffer.4,ed_figure_only
editboxes_end: editboxes_end:
@ -94,8 +94,10 @@ ed_buffer:
.4: rb 3 .4: rb 3
;¤¢  § ¯ á­ëå ¡ ©â  ­¥®¡å®¤¨¬ë ¤«ï ⮣® çâ® ¡ë ­¥ ¯¥¯¥à¥¯¨á âì á«¥¤ãî騥© ¡ ©âë, ¢ ª®­æ¥ ¡ãä¥à  0 ;¤¢  § ¯ á­ëå ¡ ©â  ­¥®¡å®¤¨¬ë ¤«ï ⮣® çâ® ¡ë ­¥ ¯¥¯¥à¥¯¨á âì á«¥¤ãî騥© ¡ ©âë, ¢ ª®­æ¥ ¡ãä¥à  0
buffer_end: buffer_end:
hed db 'EDITBOX optimization and retype <Lrz> date 30.03.2007',0 hed db 'EDITBOX optimization and retype <Lrz> date 04.04.2007',0
rb 256 rb 256
i_end1: mouse_flag: dd 0x0
structure_of_potock:
rb 1024 ;1 ª¡ ¤«ï ¯®«ã祭¨ï ®¡é¥© áâàãªâãàë
rb 1024 rb 1024
i_end: i_end: