mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-15 03:12:35 +03:00
ec2d075e74
git-svn-id: svn://kolibrios.org@6972 a494cfbc-eb01-0410-851d-a64ba20cac60
174 lines
4.6 KiB
NASM
174 lines
4.6 KiB
NASM
; í«¥¬¥â Optionbox ¤«ï ¡¨¡«¨®â¥ª¨ box_lib.obj
|
||
; ª®¤ ¯à¨¬¥¥ GPL2 «¨æ¥§¨ï
|
||
; ä ©« ᮧ¤ 13.02.2009 <Lrz>
|
||
; ¯®á«¥¤ïï ¬®¤¨ä¨ª æ¨ï 12.09.2017 IgorA
|
||
|
||
align 16
|
||
option_box_draw:
|
||
pusha
|
||
|
||
mov eax,dword[esp+36]
|
||
@@:
|
||
mov edi,dword[eax]
|
||
test edi,edi
|
||
je option_check
|
||
call option_box_draw_box
|
||
add eax,4
|
||
jmp @b
|
||
|
||
option_check:
|
||
mov eax,dword[esp+36]
|
||
@@:
|
||
mov edi,dword[eax]
|
||
test edi,edi
|
||
je @f
|
||
|
||
mov ebx,dword[edi]
|
||
mov ebx,dword[ebx]
|
||
cmp edi,ebx
|
||
jne .clear_op
|
||
|
||
pusha
|
||
call option_box_draw_op
|
||
popa
|
||
add eax,4
|
||
jmp @b
|
||
|
||
.clear_op:
|
||
pusha
|
||
call option_box_clear_op
|
||
popa
|
||
add eax,4
|
||
jmp @b
|
||
|
||
@@:
|
||
popa
|
||
ret 4
|
||
|
||
|
||
align 16
|
||
option_box_mouse:
|
||
pusha
|
||
mcall SF_MOUSE_GET,SSF_BUTTON
|
||
test eax,eax
|
||
jnz @f
|
||
popa
|
||
ret 4
|
||
|
||
@@:
|
||
mov eax,dword[esp+36]
|
||
@@:
|
||
mov edi,dword[eax]
|
||
test edi,edi
|
||
je option_check
|
||
call option_box_mouse_op
|
||
add eax,4
|
||
jmp @b
|
||
|
||
align 16
|
||
option_box_draw_box:
|
||
pusha ;á®åà ¨¬ ¢á¥ ॣ¨áâàë
|
||
|
||
movzx ebx,word op_left
|
||
shl ebx,16
|
||
add ebx,dword op_size
|
||
movzx ecx,word op_top
|
||
shl ecx,16
|
||
add ecx,dword op_size
|
||
mcall SF_DRAW_RECT,,,op_border_color ;à¨á㥬 à ¬ªã
|
||
|
||
add ebx,1 shl 16 - 2
|
||
add ecx,1 shl 16 - 2
|
||
mcall ,,,op_color ;§ ªà 訢 ¥¬ ¢ãâ८á⨠祪¡®ªá
|
||
|
||
; mov eax,dword option_group
|
||
; mov eax,[eax]
|
||
; cmp eax,edi
|
||
; jne @f
|
||
; call option_box_draw_op ; à¨á®¢ âì ¢ª«îç¥ë© 祪 ¡®ªá
|
||
|
||
|
||
;----------------------------
|
||
;à áç¥â ªã¤ ¡ã¤¥â ¯à®¨§¢¥¤¥ ¢ë¢®¤ ⥪áâ
|
||
;----------------------------
|
||
@@:
|
||
movzx ebx,word op_left ;§ £à㧨âì § 票¥ å ¤«ï 祪 ¡®ªá
|
||
add ebx,dword op_size
|
||
add ebx,dword op_text_margin ;¤®¡ ¢¨âì à §¬¥à áâ®à®ë ¨ à ááâ®ï¨¥ ª®â®à®¬ ç¥âáï ¢ë¢®¤ ⥪áâ
|
||
shl ebx,16 ;ᤢ¨¥¬ 16 à §à冷¢ ¢ «¥¢® (㬮¦¨¬ 65536)
|
||
mov bx,word op_top ;§ £à㧨¬ § 票¥ ¯® y
|
||
mov eax,op_size
|
||
shr eax,1
|
||
add eax,4
|
||
add ebx,eax
|
||
sub ebx,7 ;¤®¡ ¢¨¬ § 票¥ ¤«¨ë áâ®à®ë -9+2
|
||
mov esi,dword op_text_length
|
||
mcall SF_DRAW_TEXT,,op_text_color,op_text_ptr ;‚뢮¤ ¤¯¨á¨ ª ¢ã
|
||
popa ;¢®ááâ ®¢¨âì § 票ï ॣ¨áâ஢ ¨§ á⥪
|
||
ret ;¢ë©¤¥¬ ¨§ ¯à®æ¥¤ãàë
|
||
|
||
option_box_clear_op: ;®ç¨á⪠祪 ¡®ªá
|
||
mov edx,dword op_color ;梥⠢ãâਠ祪 ¡®ªá
|
||
jmp @f ;¡¥§ãá«®¢ë© ¯à릮ª ¨¦îî ¬¥âªã @@
|
||
|
||
|
||
option_box_draw_op: ; à¨á®¢ âì ¢ª«îç¥ë© 祪 ¡®ªá
|
||
mov edx,dword op_border_color ;§ £à㧨âì 梥â
|
||
@@:
|
||
movzx ebx,word op_left ;§ £à㧨âì ª®®à¤¨ âã ¯® å
|
||
mov eax,dword op_size
|
||
mov bp,ax
|
||
shr eax,2
|
||
push ax
|
||
|
||
push ax
|
||
add ebx,eax
|
||
shl ebx,16 ;ᤢ¨¥¬ 16 à §à冷¢ ¢ «¥¢® (㬮¦¨¬ 65536)
|
||
pop ax
|
||
lea eax,[eax*2]
|
||
sub bp,ax ;á®åà ¨¬ ॣ¨áâà bx ¢ ॣ¨áâॠ㪠§ â¥«ï ¡ §ë
|
||
mov bx,bp
|
||
|
||
movzx ecx,word op_top ;§ £à㧨âì ª®®à¤¨ âã ¯® ã
|
||
pop ax
|
||
add cx,ax
|
||
shl ecx,16 ;ᤢ¨¥¬ 16 à §à冷¢ ¢ «¥¢® (㬮¦¨¬ 65536)
|
||
mov cx,bp ;§ £à㧨¬ § 票ï ॣ¨áâà 㪠§ â¥«ï ¡ §ë ¢ cx
|
||
mcall SF_DRAW_RECT ;¢ë¢®¤ ¯®«®áë â.¥. ¯® áã⨠¯àאַ㣮«ì¨ª , ª®â®àë© ®â®¡à ¦ ¥â ¢ª«îç¥ë© ª®¬¯®¥â 祪 ¡®ªá
|
||
ret ;¢ë©â¨ ¨§ ¯à®æ¥¤ãàë
|
||
|
||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
;Ž¡à ¡®â稪 mouse
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||
align 16
|
||
option_box_mouse_op: ;®¡à ¡®âª ¬ëè¨
|
||
pusha
|
||
mov esi,dword op_text_length ;§ £à㧨âì ª®«-¢® ᨬ¢®«®¢ ¢ ⥪á⮢®© áâப¥
|
||
imul esi,6 ;¨«¨ ¬®¦® ¨ â ª 㬮¦¨âì 6
|
||
add esi,dword op_text_margin ;¤®¡ ¢¨âì 3 - à ááâ®ï¨¥ ®â 祪 ¡®ªá ¤® ¤¯¨á¨
|
||
|
||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION ;¯®«ãç¨âì ª®®à¤¨ âë ªãàá®à ®â®á¨â¥«ì® ®ª
|
||
|
||
movzx ebx,word op_top ;§ £à㧨âì ¢ bx § 票¥ ª®®à¤¨ âë ã
|
||
cmp ax,bx ;áà ¢¨âì á á ª®®à¤¨ ⮩ ªãàá®à
|
||
jl option_box_mouse_end ;SF <> OF ¥á«¨ ¬¥ìè¥
|
||
add ebx,dword op_size ;¤®¡ ¢¨âì à §¬¥à
|
||
cmp ax,bx ;áà ¢¨âì
|
||
jg option_box_mouse_end ;ZF = 0 ¨ SF = OF ¥á«¨ ¡®«ìè¥
|
||
|
||
shr eax,16 ;à §¤¥«¨¬ 65536 ¨«¨ ¯à®á⮠ᤢ¨¥¬ ¡¨âë 16 § 票©
|
||
movzx ebx,word op_left ;¯à®¨§¢¥¤¥¬ «®£¨ç®¥ áà ¢¥¨¥
|
||
cmp ax,bx ;áà ¢¨âì ॣ¨áâàë
|
||
jl option_box_mouse_end ;¥á«¨ ¬¥ìè¥
|
||
add ebx,dword op_size ;¤®¡ ¢¨âì ¤«¨ã áâ®à®ë ¯àאַ㣮«ì¨ª
|
||
add ebx,esi ;“ç¥áâì ¢ § 票¨ ¯® å ¥é¥ ¨ ¤«¨ã ¤¯¨á¨ ª 祪¡®ªáã
|
||
cmp ax,bx ;áâà ¢¨âì ॣ¨áâàë
|
||
jg option_box_mouse_end ;¥á«¨ ¡®«ìè¥
|
||
mov eax,dword option_group
|
||
mov [eax],edi
|
||
|
||
option_box_mouse_end:
|
||
popa ;¢®ááâ ®¢¨âì ॣ¨áâàë ¨§ á⥪
|
||
ret ;¢ë©â¨
|