kolibrios-fun/programs/develop/libraries/box_lib/trunk/box_lib.mac

219 lines
8.6 KiB
Plaintext
Raw Normal View History

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use EditBox ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ed_width equ [edi] ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_left equ [edi+4] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20>
ed_top equ [edi+8] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD> <20>
ed_color equ [edi+12] ;梥<><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
shift_color equ [edi+16] ;=0x6a9480 <20><><EFBFBD> <20><EFBFBD><E0A8AC><EFBFBD> <20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><> <20><><EFBFBD><EFBFBD><EFBFBD>
ed_focus_border_color equ [edi+20] ;梥<><><E0A0AC> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_blur_border_color equ [edi+24] ;梥<> <20><> <20><><EFBFBD><E2A8A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_text_color equ [edi+28] ;梥<><><E2A5AA><EFBFBD>
ed_max equ [edi+32] ;<3B><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E1A8AC><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_text equ [edi+36] ;㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
ed_mouse_variable equ [edi+40] ; 㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>/<2F><><EFBFBD>
ed_flags equ [edi+44] ;䫠<><E4ABA0>
bp_flags equ [ebp+44] ;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E6A5A4><EFBFBD><EFBFBD> edi <20><EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E3AAA0><EFBFBD> <20><EFBFBD><E0A0AD><EFBFBD><EFBFBD><EFBFBD> <20> ebp
ed_size equ [edi+48] ;<3B><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD>
bp_size equ [ebp+48] ;<3B><><EFBFBD>-<2D><><><E1A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><EFBFBD><E1AFAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ebp<62> edi <20><><EFBFBD><EFBFBD><EFBFBD>
ed_pos equ [edi+52] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_offset equ [edi+56] ;ᬥ饭<E1ACA5><E9A5AD>
cl_curs_x equ [edi+60] ;<3B><EFBFBD><E0A5A4><EFBFBD><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
cl_curs_y equ [edi+64] ;<3B><EFBFBD><E0A5A4><EFBFBD><20><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
ed_shift_pos equ [edi+68] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_shift_pos_old equ [edi+72] ;<3B><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_struc_size=76
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Bit mask from editbox
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ed_figure_only= 1000000000000000b ;<3B><><EFBFBD><EFBFBD><><E1A8AC><EFBFBD><EFBFBD>
ed_always_focus= 100000000000000b
ed_focus= 10b ;䮪<><E4AEAA> <20><EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_shift_on= 1000b ;<3B><20><> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD> -<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> shift,<2C><20><><EFBFBD> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><20><><EFBFBD> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㤥ন<E3A4A5><E0A6A8><EFBFBD> shift
ed_shift_on_off=1111111111110111b
ed_shift= 100b ;<3B><><EFBFBD><EFBFBD><EFBFBD><E7A0A5><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><20><> shift <20>.<2E>. <20><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ed_shift_off= 1111111111111011b
ed_shift_bac= 10000b ;<3B><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> shift <20>.<2E>. <20><><EFBFBD> <20><><EFBFBD><E2A0AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
ed_shift_bac_cl=1111111111101111b ;<3B><><EFBFBD><EFBFBD><20><><EFBFBD><><E3A4A0><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD>
ed_shift_cl= 1111111111100011b
ed_shift_mcl= 1111111111111011b
ed_left_fl= 100000b
ed_right_fl= 1111111111011111b
ed_offset_fl= 1000000b
ed_offset_cl= 1111111110111111b
ed_insert= 10000000b
ed_insert_cl= 1111111101111111b
ed_mouse_on = 100000000b
ed_mous_adn_b= 100011000b
ed_mouse_on_off=1111111011111111b
ed_height=14 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
struc edit_box width,left,top,color,shift_color,focus_border_color,\
blur_border_color,text_color,max,text,mouse_variable,flags,size,pos
{
.width dd width
.left dd left
.top dd top
.color dd color
.shift_color dd shift_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
.mouse_variable dd mouse_variable
.flags dd flags+0
.size dd size+0
.pos dd pos+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
mov ecx,((end-start)/ed_struc_size)
mov esi,color_table
@@:
mov eax,dword [esi+36]
mov ebx,dword [esi+20]
push dword eax
pop dword ed_focus_border_color
shr bh,1
shr bl,1
shr ah,1
shr al,1
add ah,bh
add al,bl
ror eax,16
ror ebx,16
shr bl,1
shr al,1
add al,bl
ror eax,16
mov dword ed_blur_border_color,eax
mov dword shift_color,eax
add edi,ed_struc_size
loop @b
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use CheckBox ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ch_struc_size=36
ch_flag_en=10b ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
ch_left equ [edi] ;<3B><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><> <20>
ch_top equ [edi+2] ;<3B><><EFBFBD><EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><> <20>
ch_text_margin equ [edi+4] ;=4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>אַ㣮<EFACAE><EFBFBD><ECADA8><20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ch_size equ [edi+8] ;12 ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>
ch_color equ [edi+12] ;梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> checkbox
ch_border_color equ [edi+16] ; or [edi+4] ;梥<><><E0A0AC> checkbox <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E1A0AC><EFBFBD><EFBFBD><EFBFBD>⥫쭮
ch_text_color equ [edi+20] ;[edi+4] ;梥<><><E2A5AA><EFBFBD>
ch_text_ptr equ [edi+24] ;㪠<><E3AAA0><EFBFBD> <20><> <20><><EFBFBD><><EFBFBD><E2AEA2> <20><><EFBFBD>
ch_text_length equ [edi+28]
ch_flags equ [edi+32] ;䫠<><E4ABA0>
struc check_box left,top,ch_text_margin,ch_size,color,border_color,text_color,text,ch_text_length,flags
{ ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E0A0AC><20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>
.left: dw left ;+0 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
.top: dw top ;+2 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
.ch_text_margin: dd ch_text_margin ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>אַ㣮<EFACAE><EFBFBD><ECADA8><20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.ch_size: dd ch_size ;ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><EFBFBD><E0A8AC><EFBFBD> 12
.color: dd color ;梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E7A5AA><EFBFBD><EFBFBD><EFBFBD>
.border_color: dd border_color ;梥<><><E0A0AC>
.text_color: dd text_color ;梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.text: dd text ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD> <20><><EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><><E2A5AA>
.ch_text_length: dd ch_text_length ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><E1A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.flags: dd flags+0 ; 䫠<><E4ABA0>
}
macro check_boxes_set_sys_color start,end,color_table
{
mov edi,start
mov ecx,((end-start)/ch_struc_size)
mov esi,color_table
@@:
; push dword [esi+20] ;梥<><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
; pop dword ch_color
push dword [esi+32] ;梥<><><E2A5AA><EFBFBD> <20><><20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
pop dword ch_text_color
push dword [esi+36] ;梥<> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> (ࠧ<><E0A0A7><EFBFBD><EFBFBD><EFBFBD><E2A5AB><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20>.<2E>.)
pop dword ch_border_color
add edi,ch_struc_size
loop @b
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use OptionBox ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
struc option_box point_gr,left,top,op_text_margin,op_size,color,border_color,text_color,text,op_text_length,flags
{ ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E0A0AC><20><><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>
op_flag_en=10b
.option_group: dd point_gr
.left: dw left ;+0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
.top: dw top ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>
.ch_text_margin: dd op_text_margin ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>אַ㣮<EFACAE><EFBFBD><ECADA8><20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.ch_size: dd op_size ;ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><20><><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20><EFBFBD><E0A8AC><EFBFBD> 12
.color: dd color ;梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E7A5AA><EFBFBD><EFBFBD><EFBFBD>
.border_color: dd border_color ;梥<><><E0A0AC>
.text_color: dd text_color ;梥<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.text: dd text ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> <20><><EFBFBD> <20><><EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><><E2A5AA>
.ch_text_length: dd op_text_length ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><E1A8AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
.flags: dd flags+0 ; 䫠<><E4ABA0>
}
struc tree_list info_size,info_max_count,style, img_cx,img_cy,\
col_bkg,col_zag,col_txt, box_l,box_t,box_w,box_h, capt_cy,info_capt_offs,\
info_capt_len,el_focus, p_scrol,on_press {
.data_info dd 0
.info_size dw info_size
.info_max_count dd info_max_count
.style dd style
.data_nodes dd 0
.data_img dd 0
.img_cx dw img_cx
.img_cy dw img_cy
.data_img_sys dd 0
.ch_tim dd 0
.ls_tim dd 0
.tim_undo dd 0
.cur_pos dd 0
.col_bkg dd col_bkg
.col_zag dd col_zag
.col_txt dd col_txt
.box_left dd box_l
.box_top dd box_t
.box_width dd box_w
.box_height dd box_h
.capt_cy dw capt_cy
.info_capt_offs dw info_capt_offs
.info_capt_len dw info_capt_len
.el_focus dd el_focus
.p_scrol dd p_scrol
rb 4
.on_activate dd 0
.on_press dd on_press
}
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use TreeList ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;<3B><><EFBFBD><EFBFBD><EFBFBD><E2A0AD> <20><EFBFBD>
tl_key_no_edit equ 1b ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A5A4><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2>, 㤠<><E3A4A0><EFBFBD><EFBFBD>)
tl_draw_par_line equ 10b ;<3B><><EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><E1AAAE><>
tl_list_box_mode equ 100b ;<3B><EFBFBD> <20><> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD> <20><EFBFBD><E0AEA2> (<28><><EFBFBD> <20> ListBox <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEA2>)
;<3B><><EFBFBD><EFBFBD><EFBFBD><E2A0AD> <20><><EFBFBD> <20>㭪権
tl_err_save_memory_size equ 10b ;<3B><> 墠⠥<E5A2A0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><E0A0AD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
tl_err_load_caption equ 1b ;<3B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 'tree'
tl_err_load_info_size equ 100b ;<3B><><><E1AEA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><E0ACA0><E6A8AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
tl_load_mode_add equ 0x20000 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EBA2A0><EFBFBD> <20> <><E0A5A6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
tl_save_load_heder_size equ 26 ;ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F><EFBFBD><E2A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>