kolibrios-gitea/programs/system/run/trunk/txtbut.inc

127 lines
3.0 KiB
PHP
Raw Normal View History

;--------------------------------------------------------------------
;--- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> --------------------------
;--------------------------------------------------------------------
macro use_txt_button
{
txt_button:
.draw:
pusha
;--- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ---
mov eax,8
mov ebx,[edi] ; [but.width]
mov ecx,[edi+4] ;[but.height]
mov edx,[edi+8];[but.id]
mov esi,[edi+12];[but.color]
int 0x40
;--- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> ---
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
mov edx,[edi+20]
xor esi,esi
.check_next_symbol:
cmp [edx+esi],byte 0
je .str_end
inc esi ; <EFBFBD> esi <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
jmp .check_next_symbol
.str_end:
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
lea ebx,[esi*2+esi]
lea ebx,[ebx*2] ; <EFBFBD> ebx <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
;not ebx
neg ebx
add bx,[edi] ; [but.width]
sar bx,1
inc bx
add bx,[edi+2];[but.left] ; <EFBFBD> bx <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
shl ebx,16
mov bx,[edi+4];[but.height]
sub bx,8-1
sar bx,1
add bx,[edi+6];[but.top] ; <EFBFBD> bx <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
mov ecx,[edi+16] ;[but.text_color]
shr eax,1
int 0x40
popa
ret
}
struc txt_button width,left,height,top,id,color,text_color,text_ptr,\
proc_addres
{
.width dw width ;+0
.left dw left ;+2
.height dw height ;+4
.top dw top ;+6
.id dd id ;+8
.color dd color ;+12
.text_color dd text_color ;+16
.text_ptr dd text_ptr ;+20
.proc_addres dd proc_addres+0 ;+24
}
but_struc_size=24+4
macro draw_txt_buttons start,end
{
mov edi,start
mov ecx,((end-start)/but_struc_size)
@@:
call txt_button.draw
add edi,but_struc_size
loop @b
}
macro txt_but_set_sys_color start,end,color_table
{
mov edi,start
mov esi,color_table
mov ecx,((end-start)/but_struc_size)
@@:
push dword [esi+24]
pop dword [edi+12]
push dword [esi+28]
pop dword [edi+16]
add edi,but_struc_size
loop @b
}
macro txt_but_ev start,end
{
mov edi,start
mov ecx,((end-start)/but_struc_size)
.txt_but_next:
cmp ah,[edi+8]
jne @f
cmp dword [edi+24],0
je @f
pusha
call dword [edi+24]
popa
@@:
add edi,but_struc_size
loop .txt_but_next
}
macro draw_txt_button ptr
{
mov edi,ptr
call txt_button.draw
}
macro set_sys_colors_txt_button but,sc
{
mov esi,sc
mov edi,but
push dword [esi+24]
pop dword [edi+12]
push dword [esi+28]
pop dword [edi+16]
}
macro event_txt_button but,sc
{
}