kolibrios/programs/develop/libraries/box_lib/trunk/optionbox.asm

174 lines
4.6 KiB
NASM
Raw Normal View History

; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Optionbox <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> box_lib.obj
; <20><> <20><><EFBFBD> <20><EFBFBD><E0A8AC><EFBFBD><EFBFBD><EFBFBD> GPL2 <20><><EFBFBD><E6A5AD><EFBFBD>
; 䠩<><><E1AEA7><EFBFBD> 13.02.2009 <Lrz>
; <20><><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E4A8AA><EFBFBD><EFBFBD> 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 ;<3B><><EFBFBD><EFBFBD><E0A0AD> <20><><EFBFBD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD>
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 ;<3B><><EFBFBD>㥬 ࠬ<><E0A0AC>
add ebx,1 shl 16 - 2
add ecx,1 shl 16 - 2
mcall ,,,op_color ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E8A8A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E0A5AD><EFBFBD><EFBFBD><EFBFBD><><E7A5AA><EFBFBD><EFBFBD><EFBFBD>
; mov eax,dword option_group
; mov eax,[eax]
; cmp eax,edi
; jne @f
; call option_box_draw_op ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD><EFBFBD><20><><EFBFBD><EFBFBD>
;----------------------------
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><20><EFBFBD> <20><EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><><E2A5AA><EFBFBD>
;----------------------------
@@:
movzx ebx,word op_left ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20><><EFBFBD><EFBFBD><E7A5AD> <20> <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>
add ebx,dword op_size
add ebx,dword op_text_margin ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><20><><EFBFBD><E7ADA5><EFBFBD> <20><EFBFBD><><E2A5AA><EFBFBD>
shl ebx,16 ;ᤢ<><E1A4A2><EFBFBD><EFBFBD> <20><> 16 ࠧ<><EFBFBD> <20> <20><><EFBFBD><EFBFBD> (㬭<><E3ACAD><EFBFBD><EFBFBD> <20><> 65536)
mov bx,word op_top ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> <20><> y
mov eax,op_size
shr eax,1
add eax,4
add ebx,eax
sub ebx,7 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> -9+2
mov esi,dword op_text_length
mcall SF_DRAW_TEXT,,op_text_color,op_text_ptr ;<3B><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
popa ;<3B><><EFBFBD><EFBFBD><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD><><E0A5A3><EFBFBD><20><> <20><EFBFBD>
ret ;<3B><EFBFBD><EBA9A4> <20><> <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD>
option_box_clear_op: ;<3B><><EFBFBD><EFBFBD>⪠ 祪 <20><><EFBFBD><EFBFBD><EFBFBD>
mov edx,dword op_color ;梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>
jmp @f ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1ABAE><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> @@
option_box_draw_op: ;<3B><><EFBFBD><EFBFBD><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD><EFBFBD><20><><EFBFBD><EFBFBD>
mov edx,dword op_border_color ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8><>
@@:
movzx ebx,word op_left ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20>
mov eax,dword op_size
mov bp,ax
shr eax,2
push ax
push ax
add ebx,eax
shl ebx,16 ;ᤢ<><E1A4A2><EFBFBD><EFBFBD> <20><> 16 ࠧ<><EFBFBD> <20> <20><><EFBFBD><EFBFBD> (㬭<><E3ACAD><EFBFBD><EFBFBD> <20><> 65536)
pop ax
lea eax,[eax*2]
sub bp,ax ;<3B><><EFBFBD><EFBFBD><E0A0AD><><E0A5A3><EFBFBD><EFBFBD> bx <20><><E0A5A3><EFBFBD><EFBFBD><EFBFBD><><E3AAA0><EFBFBD> <20><><EFBFBD><EFBFBD>
mov bx,bp
movzx ecx,word op_top ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><> <20>
pop ax
add cx,ax
shl ecx,16 ;ᤢ<><E1A4A2><EFBFBD><EFBFBD> <20><> 16 ࠧ<><EFBFBD> <20> <20><><EFBFBD><EFBFBD> (㬭<><E3ACAD><EFBFBD><EFBFBD> <20><> 65536)
mov cx,bp ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E7A5AD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD><><E3AAA0><EFBFBD> <20><><EFBFBD><EFBFBD> <20> cx
mcall SF_DRAW_RECT ;<3B><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E>. <20><> <20><><EFBFBD><EFBFBD> <20><>אַ㣮<EFACAE><EFBFBD><ECADA8>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><E7A5AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD>
ret ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B><><EFBFBD><E0A0A1>稪 mouse
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 16
option_box_mouse_op: ;<3B><><EFBFBD><20><><EFBFBD><EFBFBD>
pusha
mov esi,dword op_text_length ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E2AEA2> <20><><EFBFBD>
imul esi,6 ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> ⠪ 㬭<><E3ACAD><EFBFBD><EFBFBD><EFBFBD> <20><> 6
add esi,dword op_text_margin ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 3 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E2ADAE>⥫쭮 <20><><EFBFBD><EFBFBD>
movzx ebx,word op_top ;<3B><><EFBFBD><EFBFBD><EFBFBD><E3A7A8> <20> bx <20><><EFBFBD><EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20>
cmp ax,bx ;<3B><EFBFBD><E0A0A2><EFBFBD><EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><E0A4A8><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
jl option_box_mouse_end ;SF <> OF <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
add ebx,dword op_size ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A0A7><EFBFBD>
cmp ax,bx ;<3B><EFBFBD><E0A0A2><EFBFBD><EFBFBD>
jg option_box_mouse_end ;ZF = 0 <20> SF = OF <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
shr eax,16 ;ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD> <20><> 65536 <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1A4A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> 16 <20><><EFBFBD><EFBFBD><E7A5AD>
movzx ebx,word op_left ;<3B><EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD>
cmp ax,bx ;<3B><EFBFBD><E0A0A2><EFBFBD><EFBFBD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD>
jl option_box_mouse_end ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
add ebx,dword op_size ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>אַ㣮<EFACAE><EFBFBD><ECADA8>
add ebx,esi ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><E7A5AD> <20><> <20> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><E7A5AA><EFBFBD><EFBFBD><EFBFBD>
cmp ax,bx ;<3B><><EFBFBD><E0A0A2><EFBFBD><EFBFBD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD>
jg option_box_mouse_end ;<3B><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov eax,dword option_group
mov [eax],edi
option_box_mouse_end:
popa ;<3B><><EFBFBD><EFBFBD><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><><E0A5A3><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD>
ret ;<3B><><EFBFBD><EFBFBD><EFBFBD>