forked from KolibriOS/kolibrios
Added struc to use scrollbar, similar to existing strucs for editbox, checkbox,..
git-svn-id: svn://kolibrios.org@3204 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
2d54529003
commit
44f2d6661d
@ -11,11 +11,11 @@ ed_blur_border_color equ [edi+24] ;梥
|
||||
ed_text_color equ [edi+28] ;梥â ⥪áâ
|
||||
ed_max equ [edi+32] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦® ¬ ªá¨¬ «ì® ¢¢¥áâ¨
|
||||
ed_text equ [edi+36] ;㪠§ â¥«ì ¡ãä¥à
|
||||
ed_mouse_variable equ [edi+40] ; 㪠§ â¥«ì ¯¥à¥¬¥ãî ¤«ï ¡®ªá /£à㯯ë
|
||||
ed_mouse_variable equ [edi+40] ; 㪠§ â¥«ì ¯¥à¥¬¥ãî ¤«ï ¡®ªá /£à㯯ë
|
||||
ed_flags equ [edi+44] ;ä« £¨
|
||||
bp_flags equ [ebp+44] ;¢ ¥ª®â®àëå ¯à®æ¥¤ãà å edi ¨á¯®«ì§ã¥âáï, ¢§ ¬¥ 㪠§ ⥫ì åà ¨âìáï ¢ ebp
|
||||
bp_flags equ [ebp+44] ;¢ ¥ª®â®àëå ¯à®æ¥¤ãà å edi ¨á¯®«ì§ã¥âáï, ¢§ ¬¥ 㪠§ ⥫ì åà ¨âìáï ¢ ebp
|
||||
ed_size equ [edi+48] ;ª®«-¢® ᨬ¢®«®¢
|
||||
bp_size equ [ebp+48] ;ª®«-¢® ᨬ¢¯®«®¢, ¤«ï ¤à¥á 樨 ¨á¯«ì§ã¥âáï ebp¡ edi § ïâ
|
||||
bp_size equ [ebp+48] ;ª®«-¢® ᨬ¢¯®«®¢, ¤«ï ¤à¥á 樨 ¨á¯«ì§ã¥âáï ebp¡ edi § ïâ
|
||||
ed_pos equ [edi+52] ;¯®§¨æ¨ï ªãàá®à
|
||||
ed_offset equ [edi+56] ;ᬥ饨¥
|
||||
cl_curs_x equ [edi+60] ;¯à¥¤ë¤ã饥 ª®®à¤¨ â ªãàá®à ¯® å
|
||||
@ -83,8 +83,8 @@ macro edit_boxes_set_sys_color start,end,color_table
|
||||
@@:
|
||||
mov eax,dword [esi+36] ;梥⠣à 䨪¨ ¢ ®ª¥ (à §¤¥«¨â¥«ìë¥ «¨¨¨ ¨ â.¯.)
|
||||
mov ebx,dword [esi+20] ;梥â à ¡®ç¥© ®¡« á⨠®ª
|
||||
push dword eax
|
||||
pop dword ed_focus_border_color
|
||||
push dword eax
|
||||
pop dword ed_focus_border_color
|
||||
shr bh,1
|
||||
shr bl,1
|
||||
shr ah,1
|
||||
@ -97,10 +97,10 @@ macro edit_boxes_set_sys_color start,end,color_table
|
||||
shr al,1
|
||||
add al,bl
|
||||
ror eax,16
|
||||
mov dword ed_blur_border_color,eax
|
||||
mov dword shift_color,eax
|
||||
push dword [esi+32] ;梥â ⥪áâ ¢ à ¡®ç¥© ®¡« á⨠®ª
|
||||
pop dword ed_text_color
|
||||
mov dword ed_blur_border_color,eax
|
||||
mov dword shift_color,eax
|
||||
push dword [esi+32] ;梥â ⥪áâ ¢ à ¡®ç¥© ®¡« á⨠®ª
|
||||
pop dword ed_text_color
|
||||
add edi,ed_struc_size
|
||||
loop @b
|
||||
}
|
||||
@ -117,51 +117,51 @@ ch_text_color equ [edi+20] ;[edi+4] ;梥
|
||||
ch_text_ptr equ [edi+24] ;㪠§ ⥫ì ç «® ⥪á⮢®© áâப¨
|
||||
ch_flags equ [edi+28] ;ä« £¨
|
||||
|
||||
ch_struc_size=36 ;à §¬¥à áâàãªâãàë
|
||||
ch_flag_en=10b ;ä« £ ãáâ ®¢«¥®£® 祪 ¡®ªá .
|
||||
ch_flag_top=0x0 ;ä« £ à ᯮ«®¦¥¨ï ⥪áâ ¢¢¥àåã â.¥. 3-© ¡¨â
|
||||
ch_flag_middle=100b ;ä« £ à ᯮ«®¦¥¨ï ⥪áâ ¢ æ¥âॠâ.¥. 4-© ¡¨â.
|
||||
ch_flag_bottom=1000b ;ä« £ à ᯮ«®¦¥¨ï ⥪áâ ¢ ¨§ã â.¥. ¯® 㬮«ç ¨î ¯à¨¨¬ ¥âáï § 票¥ ¢¨§ã â.¥. ®âáãá⢨¥ 3-£® ¨ 4-£® ¡¨â
|
||||
ch_struc_size=36 ;à §¬¥à áâàãªâãàë
|
||||
ch_flag_en=10b ;ä« £ ãáâ ®¢«¥®£® 祪 ¡®ªá .
|
||||
ch_flag_top=0x0 ;ä« £ à ᯮ«®¦¥¨ï ⥪áâ ¢¢¥àåã â.¥. 3-© ¡¨â
|
||||
ch_flag_middle=100b ;ä« £ à ᯮ«®¦¥¨ï ⥪áâ ¢ æ¥âॠâ.¥. 4-© ¡¨â.
|
||||
ch_flag_bottom=1000b ;ä« £ à ᯮ«®¦¥¨ï ⥪áâ ¢ ¨§ã â.¥. ¯® 㬮«ç ¨î ¯à¨¨¬ ¥âáï § 票¥ ¢¨§ã â.¥. ®âáãá⢨¥ 3-£® ¨ 4-£® ¡¨â
|
||||
|
||||
2ch_left_s equ [ebp] ;ª®à¤¨ â ç « à¨á®¢ ¨ï ¯® å
|
||||
2ch_top_s equ [ebp+4] ;ª®®à¤¨ â ç « à¨á®¢ ¨ï ¯® ã
|
||||
2ch_text_margin equ [ebp+8] ;=4 à ááâ®ï¨¥ ®â ¯àאַ㣮«ì¨ª 祪 ¡®ªá ¤® ¤¯¨á¨
|
||||
2ch_color equ [ebp+12] ;梥⠢ãâਠcheckbox
|
||||
2ch_border_color equ [ebp+16] ; or [edi+4] ;梥â à ¬ª¨ checkbox ¥¥ ¬®¦® § ¤ âì á ¬®áâ®ï⥫ì®
|
||||
2ch_text_color equ [ebp+20] ;[edi+4] ;梥â ⥪áâ
|
||||
2ch_text_ptr equ [ebp+24] ;㪠§ ⥫ì ç «® ⥪á⮢®© áâப¨
|
||||
2ch_flags equ [ebp+28] ;ä« £¨
|
||||
2ch_sz_str equ [ebp+32] ;¤«¨ áâப¨, ¢ëç¨á«ï¥âáï ¯à¨ ¨¨æ¨ «¨§ 樨 ª®¬¯®¥â
|
||||
2ch_left_s equ [ebp] ;ª®à¤¨ â ç « à¨á®¢ ¨ï ¯® å
|
||||
2ch_top_s equ [ebp+4] ;ª®®à¤¨ â ç « à¨á®¢ ¨ï ¯® ã
|
||||
2ch_text_margin equ [ebp+8] ;=4 à ááâ®ï¨¥ ®â ¯àאַ㣮«ì¨ª 祪 ¡®ªá ¤® ¤¯¨á¨
|
||||
2ch_color equ [ebp+12] ;梥⠢ãâਠcheckbox
|
||||
2ch_border_color equ [ebp+16] ; or [edi+4] ;梥â à ¬ª¨ checkbox ¥¥ ¬®¦® § ¤ âì á ¬®áâ®ï⥫ì®
|
||||
2ch_text_color equ [ebp+20] ;[edi+4] ;梥â ⥪áâ
|
||||
2ch_text_ptr equ [ebp+24] ;㪠§ ⥫ì ç «® ⥪á⮢®© áâப¨
|
||||
2ch_flags equ [ebp+28] ;ä« £¨
|
||||
2ch_sz_str equ [ebp+32] ;¤«¨ áâப¨, ¢ëç¨á«ï¥âáï ¯à¨ ¨¨æ¨ «¨§ 樨 ª®¬¯®¥â
|
||||
|
||||
struc check_box2 left_s,top_s,ch_text_margin,color,border_color,text_color,text,flags
|
||||
{ ;áâàãªâãà ¯ à ¬¥â஢ ¤«ï 祪 ¡®ªá
|
||||
.left_s: dd left_s ;+0 ¯®«®¦¥¨¥ ¯® å dw + à §¬¥à dw
|
||||
.top_s: dd top_s ;+4 ¯®«®¦¥¨¥ ¯® ã dw + à §¬¥à dw
|
||||
{ ;áâàãªâãà ¯ à ¬¥â஢ ¤«ï 祪 ¡®ªá
|
||||
.left_s: dd left_s ;+0 ¯®«®¦¥¨¥ ¯® å dw + à §¬¥à dw
|
||||
.top_s: dd top_s ;+4 ¯®«®¦¥¨¥ ¯® ã dw + à §¬¥à dw
|
||||
.ch_text_margin: dd ch_text_margin ;à ááâ®ï¨¥ ®â ¯àאַ㣮«ì¨ª 祪 ¡®ªá ¤® ¤¯¨á¨
|
||||
.color: dd color ;梥⠢ãâਠ祪¡®ªá
|
||||
.border_color: dd border_color ;梥â à ¬ª¨
|
||||
.text_color: dd text_color ;梥⠤¯¨á¨
|
||||
.text: dd text ; ¤à¥á ¢ ª®¤¥ ¯à®£à ¬¬ë £¤¥ à ᯮ«®¦¥ ⥪áâ
|
||||
.flags: dd flags+0 ;ä« £¨
|
||||
.size_of_str: dd 0x0 ;¤«¨ áâப¨, ¢ëç¨á«ï¥âáï ¯à¨ ¨¨æ¨ «¨§ 樨 ª®¬¯®¥â
|
||||
.color: dd color ;梥⠢ãâਠ祪¡®ªá
|
||||
.border_color: dd border_color ;梥â à ¬ª¨
|
||||
.text_color: dd text_color ;梥⠤¯¨á¨
|
||||
.text: dd text ; ¤à¥á ¢ ª®¤¥ ¯à®£à ¬¬ë £¤¥ à ᯮ«®¦¥ ⥪áâ
|
||||
.flags: dd flags+0 ;ä« £¨
|
||||
.size_of_str: dd 0x0 ;¤«¨ áâப¨, ¢ëç¨á«ï¥âáï ¯à¨ ¨¨æ¨ «¨§ 樨 ª®¬¯®¥â
|
||||
}
|
||||
|
||||
;Œ ªà®á ¯à®¢¥àª¨ é¥«çª ¬ë誨 ¤ £à㯯®© checkboxes.
|
||||
macro init_checkboxes2 start,end_cb
|
||||
{
|
||||
if start+ch_struc_size eq end_cb
|
||||
;ª®£¤ ®¤¨ í«¥¬¥â
|
||||
push start ;㪠§ ⥫ì checkbox
|
||||
call [init_checkbox] ; áâனª checkbox'
|
||||
;ª®£¤ ®¤¨ í«¥¬¥â
|
||||
push start ;㪠§ ⥫ì checkbox
|
||||
call [init_checkbox] ; áâனª checkbox'
|
||||
else
|
||||
;ª®£¤ ¥áª®«ìª® í«¥¬¥â®¢
|
||||
mov ebp,start
|
||||
mov ecx,((end_cb-start)/ch_struc_size)
|
||||
;ª®£¤ ¥áª®«ìª® í«¥¬¥â®¢
|
||||
mov ebp,start
|
||||
mov ecx,((end_cb-start)/ch_struc_size)
|
||||
@@:
|
||||
push ebp ;㪠§ â¥«ì ¯¥à¢ë© checkbox
|
||||
call [init_checkbox] ; áâனª checkbox'®¢
|
||||
add ebp,ch_struc_size
|
||||
loop @b
|
||||
push ebp ;㪠§ â¥«ì ¯¥à¢ë© checkbox
|
||||
call [init_checkbox] ; áâனª checkbox'®¢
|
||||
add ebp,ch_struc_size
|
||||
loop @b
|
||||
end if
|
||||
}
|
||||
|
||||
@ -169,18 +169,18 @@ end if
|
||||
macro checkboxes_mouse2 start,end_cb
|
||||
{
|
||||
if start+ch_struc_size eq end_cb
|
||||
;ª®£¤ ®¤¨ í«¥¬¥â
|
||||
push start ;㪠§ ⥫ì checkbox
|
||||
call [check_box_mouse] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ¤ checkbox'®¬
|
||||
;ª®£¤ ®¤¨ í«¥¬¥â
|
||||
push start ;㪠§ ⥫ì checkbox
|
||||
call [check_box_mouse] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ¤ checkbox'®¬
|
||||
else
|
||||
;ª®£¤ ¥áª®«ìª® í«¥¬¥â®¢
|
||||
mov ebp,start
|
||||
mov ecx,((end_cb-start)/ch_struc_size)
|
||||
;ª®£¤ ¥áª®«ìª® í«¥¬¥â®¢
|
||||
mov ebp,start
|
||||
mov ecx,((end_cb-start)/ch_struc_size)
|
||||
@@:
|
||||
push ebp ;㪠§ â¥«ì ¯¥à¢ë© checkbox
|
||||
call [check_box_mouse] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ¤ checkbox' ¬¨
|
||||
add ebp,ch_struc_size
|
||||
loop @b
|
||||
push ebp ;㪠§ â¥«ì ¯¥à¢ë© checkbox
|
||||
call [check_box_mouse] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ¤ checkbox' ¬¨
|
||||
add ebp,ch_struc_size
|
||||
loop @b
|
||||
end if
|
||||
}
|
||||
|
||||
@ -188,34 +188,34 @@ end if
|
||||
macro checkboxes_draw2 start,end_cb
|
||||
{
|
||||
if start+ch_struc_size eq end_cb
|
||||
;ª®£¤ ®¤¨ í«¥¬¥â
|
||||
push start ;㪠§ ⥫ì checkbox
|
||||
call [check_box_draw] ; à¨á®¢ âì checkbox
|
||||
;ª®£¤ ®¤¨ í«¥¬¥â
|
||||
push start ;㪠§ ⥫ì checkbox
|
||||
call [check_box_draw] ; à¨á®¢ âì checkbox
|
||||
else
|
||||
;ª®£¤ ¥áª®«ìª® í«¥¬¥â®¢
|
||||
mov ebp,start
|
||||
mov ecx,((end_cb-start)/ch_struc_size)
|
||||
;ª®£¤ ¥áª®«ìª® í«¥¬¥â®¢
|
||||
mov ebp,start
|
||||
mov ecx,((end_cb-start)/ch_struc_size)
|
||||
@@:
|
||||
push ebp ;㪠§ â¥«ì ¯¥à¢ë© checkbox
|
||||
call [check_box_draw] ; à¨á®¢ âì checkbox'ë
|
||||
add ebp,ch_struc_size
|
||||
loop @b
|
||||
push ebp ;㪠§ â¥«ì ¯¥à¢ë© checkbox
|
||||
call [check_box_draw] ; à¨á®¢ âì checkbox'ë
|
||||
add ebp,ch_struc_size
|
||||
loop @b
|
||||
end if
|
||||
}
|
||||
|
||||
macro check_boxes_set_sys_color2 start,end,color_table
|
||||
{
|
||||
mov ebp,start
|
||||
mov ecx,((end-start)/ch_struc_size)
|
||||
mov esi,color_table
|
||||
mov ebp,start
|
||||
mov ecx,((end-start)/ch_struc_size)
|
||||
mov esi,color_table
|
||||
@@:
|
||||
push dword [esi+32] ;梥â ⥪áâ ¢ à ¡®ç¥© ®¡« á⨠®ª
|
||||
or dword [esp],0x80000000 ;¥®¡å®¤¨¬® ¤«ï ¢ë¢®¤ ASCIIZ áâப
|
||||
pop dword 2ch_text_color
|
||||
push dword [esi+36] ;梥⠣à 䨪¨ ¢ ®ª¥ (à §¤¥«¨â¥«ìë¥ «¨¨¨ ¨ â.¯.)
|
||||
pop dword 2ch_border_color
|
||||
add ebp,ch_struc_size
|
||||
loop @b
|
||||
push dword [esi+32] ;梥â ⥪áâ ¢ à ¡®ç¥© ®¡« á⨠®ª
|
||||
or dword [esp],0x80000000 ;¥®¡å®¤¨¬® ¤«ï ¢ë¢®¤ ASCIIZ áâப
|
||||
pop dword 2ch_text_color
|
||||
push dword [esi+36] ;梥⠣à 䨪¨ ¢ ®ª¥ (à §¤¥«¨â¥«ìë¥ «¨¨¨ ¨ â.¯.)
|
||||
pop dword 2ch_border_color
|
||||
add ebp,ch_struc_size
|
||||
loop @b
|
||||
}
|
||||
|
||||
|
||||
@ -257,20 +257,20 @@ op_flags equ [edi+36] ;䫠
|
||||
|
||||
macro option_boxes_set_sys_color color_table,group
|
||||
{
|
||||
mov ecx,group
|
||||
mov esi,color_table
|
||||
mov edi,[ecx]
|
||||
mov eax,[esi+24] ;梥⠪®¯ª¨ ¢ à ¡®ç¥© ®¡« á⨠®ª
|
||||
mov ebx,[esi+28] ;梥â ⥪áâ ª®¯ª¥
|
||||
mov ecx,group
|
||||
mov esi,color_table
|
||||
mov edi,[ecx]
|
||||
mov eax,[esi+24] ;梥⠪®¯ª¨ ¢ à ¡®ç¥© ®¡« á⨠®ª
|
||||
mov ebx,[esi+28] ;梥â ⥪áâ ª®¯ª¥
|
||||
@@:
|
||||
mov op_border_color,eax
|
||||
mov op_color,ebx
|
||||
push dword [esi+32] ;梥â ⥪áâ ¢ à ¡®ç¥© ®¡« á⨠®ª
|
||||
pop dword op_text_color
|
||||
mov op_border_color,eax
|
||||
mov op_color,ebx
|
||||
push dword [esi+32] ;梥â ⥪áâ ¢ à ¡®ç¥© ®¡« á⨠®ª
|
||||
pop dword op_text_color
|
||||
add ecx,4
|
||||
mov edi,[ecx]
|
||||
cmp edi,0
|
||||
jne @b
|
||||
cmp edi,0
|
||||
jne @b
|
||||
}
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;Basic macros for use TreeList ;
|
||||
@ -279,27 +279,27 @@ macro option_boxes_set_sys_color color_table,group
|
||||
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
|
||||
.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
|
||||
.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
|
||||
.capt_cy dw capt_cy
|
||||
.info_capt_offs dw info_capt_offs
|
||||
.info_capt_len dw info_capt_len
|
||||
.el_focus dd el_focus
|
||||
@ -334,8 +334,8 @@ tl_el_focus equ dword[edi+80] ;㪠
|
||||
tl_p_scrol equ dword[edi+84] ;㪠§ ⥫ì áâàãªâãàã áªà®««¨£
|
||||
tl_on_press equ dword[edi+96] ;㪠§ ⥫ì äãªæ¨î, ª®â®à ï ¢ë§ë¢ ¥âáï ¯à¨ ¦ ⨨ Enter
|
||||
|
||||
;data_info dd ? ;+ 0 㪠§ â¥«ì ®á®¢ë¥ ¤ ë¥
|
||||
;ls_tim dd ? ;+34 ¢à¥¬ï ¯®á«¥¤¥£® á®åà ¥¨ï
|
||||
;data_info dd ? ;+ 0 㪠§ â¥«ì ®á®¢ë¥ ¤ ë¥
|
||||
;ls_tim dd ? ;+34 ¢à¥¬ï ¯®á«¥¤¥£® á®åà ¥¨ï
|
||||
;on_activate dd ? ;+92 㪠§ ⥫ì äãªæ¨î ¯à¨ ªâ¨¢¨à®¢ ¨¨ 㧫
|
||||
|
||||
;ª®áâ âë á⨫ï
|
||||
@ -454,3 +454,35 @@ sb_offs_redraw equ 40
|
||||
sb_offs_delta2 equ 46
|
||||
sb_offs_all_redraw equ 80
|
||||
;------------------------------------------------------------------------------
|
||||
|
||||
|
||||
struc scrollbar xsize, xpos, ysize, ypos, btn_height, max, cur, pos, bgcol, frcol, linecol, ar_offset
|
||||
{
|
||||
.x_size dw xsize
|
||||
.x_pos dw xpos
|
||||
.y_size dw ysize
|
||||
.y_pos dw ypos
|
||||
.btn_height dd btn_height
|
||||
.type dd ?
|
||||
.max_area dd max
|
||||
.cur_area dd cur
|
||||
.position dd pos
|
||||
.bg_color dd bgcol
|
||||
.front_color dd frcol
|
||||
.line_color dd linecol
|
||||
.redraw dd ?
|
||||
.delta dw ?
|
||||
.delta2 dw ?
|
||||
.r_size_x dw ?
|
||||
.r_start_x dw ?
|
||||
.r_size_y dw ?
|
||||
.r_start_y dw ?
|
||||
.m_pos dd ?
|
||||
.m_pos_2 dd ?
|
||||
.m_keys dd ?
|
||||
.run_size dd ?
|
||||
.position2 dd ?
|
||||
.work_size dd ?
|
||||
.all_redraw dd ?
|
||||
.ar_offset dd ar_offset
|
||||
}
|
Loading…
Reference in New Issue
Block a user