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:
hidnplayr 2013-01-28 13:55:17 +00:00
parent 2d54529003
commit 44f2d6661d

View File

@ -11,11 +11,11 @@ ed_blur_border_color equ [edi+24] ;梥
ed_text_color equ [edi+28] ;梥â ⥪áâ  ed_text_color equ [edi+28] ;梥â ⥪áâ 
ed_max equ [edi+32] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥á⨠ed_max equ [edi+32] ;ª®«-¢® ᨬ¢®«®¢ ª®â®àë¥ ¬®¦­® ¬ ªá¨¬ «ì­® ¢¢¥áâ¨
ed_text equ [edi+36] ;㪠§ â¥«ì ­  ¡ãä¥à ed_text equ [edi+36] ;㪠§ â¥«ì ­  ¡ãä¥à
ed_mouse_variable equ [edi+40] ; 㪠§ â¥«ì ­  ¯¥à¥¬¥­­ãî ¤«ï ¡®ªá /£à㯯ë ed_mouse_variable equ [edi+40] ; 㪠§ â¥«ì ­  ¯¥à¥¬¥­­ãî ¤«ï ¡®ªá /£à㯯ë
ed_flags equ [edi+44] ;ä« £¨ ed_flags equ [edi+44] ;ä« £¨
bp_flags equ [ebp+44] ;¢ ­¥ª®â®àëå ¯à®æ¥¤ãà å edi ¨á¯®«ì§ã¥âáï, ¢§ ¬¥­ 㪠§ â¥«ì åà ­¨âìáï ¢ ebp bp_flags equ [ebp+44] ;¢ ­¥ª®â®àëå ¯à®æ¥¤ãà å edi ¨á¯®«ì§ã¥âáï, ¢§ ¬¥­ 㪠§ â¥«ì åà ­¨âìáï ¢ ebp
ed_size equ [edi+48] ;ª®«-¢® ᨬ¢®«®¢ 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_pos equ [edi+52] ;¯®§¨æ¨ï ªãàá®à 
ed_offset equ [edi+56] ;ᬥ饭¨¥ ed_offset equ [edi+56] ;ᬥ饭¨¥
cl_curs_x equ [edi+60] ;¯à¥¤ë¤ã饥 ª®®à¤¨­ â  ªãàá®à  ¯® å 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 eax,dword [esi+36] ;梥⠣à ä¨ª¨ ¢ ®ª­¥ (à §¤¥«¨â¥«ì­ë¥ «¨­¨¨ ¨ â.¯.)
mov ebx,dword [esi+20] ;梥â à ¡®ç¥© ®¡« á⨠®ª­  mov ebx,dword [esi+20] ;梥â à ¡®ç¥© ®¡« á⨠®ª­ 
push dword eax push dword eax
pop dword ed_focus_border_color pop dword ed_focus_border_color
shr bh,1 shr bh,1
shr bl,1 shr bl,1
shr ah,1 shr ah,1
@ -97,10 +97,10 @@ macro edit_boxes_set_sys_color start,end,color_table
shr al,1 shr al,1
add al,bl add al,bl
ror eax,16 ror eax,16
mov dword ed_blur_border_color,eax mov dword ed_blur_border_color,eax
mov dword shift_color,eax mov dword shift_color,eax
push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­  push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­ 
pop dword ed_text_color pop dword ed_text_color
add edi,ed_struc_size add edi,ed_struc_size
loop @b loop @b
} }
@ -117,51 +117,51 @@ ch_text_color equ [edi+20] ;[edi+4] ;梥
ch_text_ptr equ [edi+24] ;㪠§ â¥«ì ­  ­ ç «® ⥪á⮢®© áâப¨ ch_text_ptr equ [edi+24] ;㪠§ â¥«ì ­  ­ ç «® ⥪á⮢®© áâப¨
ch_flags equ [edi+28] ;ä« £¨ ch_flags equ [edi+28] ;ä« £¨
ch_struc_size=36 ;à §¬¥à áâàãªâãàë ch_struc_size=36 ;à §¬¥à áâàãªâãàë
ch_flag_en=10b ;ä« £ ãáâ ­®¢«¥­­®£® 祪 ¡®ªá . ch_flag_en=10b ;ä« £ ãáâ ­®¢«¥­­®£® 祪 ¡®ªá .
ch_flag_top=0x0 ;ä« £ à á¯®«®¦¥­¨ï ⥪áâ  ¢¢¥àåã â.¥. 3-© ¡¨â ch_flag_top=0x0 ;ä« £ à á¯®«®¦¥­¨ï ⥪áâ  ¢¢¥àåã â.¥. 3-© ¡¨â
ch_flag_middle=100b ;ä« £ à á¯®«®¦¥­¨ï ⥪áâ  ¢ 業âॠâ.¥. 4-© ¡¨â. ch_flag_middle=100b ;ä« £ à á¯®«®¦¥­¨ï ⥪áâ  ¢ 業âॠâ.¥. 4-© ¡¨â.
ch_flag_bottom=1000b ;ä« £ à á¯®«®¦¥­¨ï ⥪áâ  ¢ ­¨§ã â.¥. ¯® 㬮«ç ­¨î ¯à¨­¨¬ ¥âáï §­ ç¥­¨¥ ¢­¨§ã â.¥. ®âáãá⢨¥ 3-£® ¨ 4-£® ¡¨â  ch_flag_bottom=1000b ;ä« £ à á¯®«®¦¥­¨ï ⥪áâ  ¢ ­¨§ã â.¥. ¯® 㬮«ç ­¨î ¯à¨­¨¬ ¥âáï §­ ç¥­¨¥ ¢­¨§ã â.¥. ®âáãá⢨¥ 3-£® ¨ 4-£® ¡¨â 
2ch_left_s equ [ebp] ;ª®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® å 2ch_left_s equ [ebp] ;ª®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® å
2ch_top_s equ [ebp+4] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® ã 2ch_top_s equ [ebp+4] ;ª®®à¤¨­ â  ­ ç «  à¨á®¢ ­¨ï ¯® ã
2ch_text_margin equ [ebp+8] ;=4 à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨ 2ch_text_margin equ [ebp+8] ;=4 à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨
2ch_color equ [ebp+12] ;梥⠢­ãâਠcheckbox 2ch_color equ [ebp+12] ;梥⠢­ãâਠcheckbox
2ch_border_color equ [ebp+16] ; or [edi+4] ;梥â à ¬ª¨ checkbox ¥¥ ¬®¦­® § ¤ âì á ¬®áâ®ï⥫쭮 2ch_border_color equ [ebp+16] ; or [edi+4] ;梥â à ¬ª¨ checkbox ¥¥ ¬®¦­® § ¤ âì á ¬®áâ®ï⥫쭮
2ch_text_color equ [ebp+20] ;[edi+4] ;梥â ⥪áâ  2ch_text_color equ [ebp+20] ;[edi+4] ;梥â ⥪áâ 
2ch_text_ptr equ [ebp+24] ;㪠§ â¥«ì ­  ­ ç «® ⥪á⮢®© áâப¨ 2ch_text_ptr equ [ebp+24] ;㪠§ â¥«ì ­  ­ ç «® ⥪á⮢®© áâப¨
2ch_flags equ [ebp+28] ;ä« £¨ 2ch_flags equ [ebp+28] ;ä« £¨
2ch_sz_str equ [ebp+32] ;¤«¨­­  áâப¨, ¢ëç¨á«ï¥âáï ¯à¨ ¨­¨æ¨ «¨§ æ¨¨ ª®¬¯®­¥­â  2ch_sz_str equ [ebp+32] ;¤«¨­­  áâப¨, ¢ëç¨á«ï¥âáï ¯à¨ ¨­¨æ¨ «¨§ æ¨¨ ª®¬¯®­¥­â 
struc check_box2 left_s,top_s,ch_text_margin,color,border_color,text_color,text,flags 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 .left_s: dd left_s ;+0 ¯®«®¦¥­¨¥ ¯® å dw + à §¬¥à dw
.top_s: dd top_s ;+4 ¯®«®¦¥­¨¥ ¯® ã dw + à §¬¥à dw .top_s: dd top_s ;+4 ¯®«®¦¥­¨¥ ¯® ã dw + à §¬¥à dw
.ch_text_margin: dd ch_text_margin ;à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨ .ch_text_margin: dd ch_text_margin ;à ááâ®ï­¨¥ ®â ¯àאַ㣮«ì­¨ª  祪 ¡®ªá  ¤® ­ ¤¯¨á¨
.color: dd color ;梥⠢­ãâਠ祪¡®ªá  .color: dd color ;梥⠢­ãâਠ祪¡®ªá 
.border_color: dd border_color ;梥â à ¬ª¨ .border_color: dd border_color ;梥â à ¬ª¨
.text_color: dd text_color ;梥⠭ ¤¯¨á¨ .text_color: dd text_color ;梥⠭ ¤¯¨á¨
.text: dd text ; ¤à¥á ¢ ª®¤¥ ¯à®£à ¬¬ë £¤¥ à á¯®«®¦¥­ ⥪áâ .text: dd text ; ¤à¥á ¢ ª®¤¥ ¯à®£à ¬¬ë £¤¥ à á¯®«®¦¥­ ⥪áâ
.flags: dd flags+0 ;ä« £¨ .flags: dd flags+0 ;ä« £¨
.size_of_str: dd 0x0 ;¤«¨­­  áâப¨, ¢ëç¨á«ï¥âáï ¯à¨ ¨­¨æ¨ «¨§ æ¨¨ ª®¬¯®­¥­â  .size_of_str: dd 0x0 ;¤«¨­­  áâப¨, ¢ëç¨á«ï¥âáï ¯à¨ ¨­¨æ¨ «¨§ æ¨¨ ª®¬¯®­¥­â 
} }
;Œ ªà®á ¯à®¢¥àª¨ 饫窠 ¬ë誨 ­ ¤ £à㯯®© checkboxes. ;Œ ªà®á ¯à®¢¥àª¨ 饫窠 ¬ë誨 ­ ¤ £à㯯®© checkboxes.
macro init_checkboxes2 start,end_cb macro init_checkboxes2 start,end_cb
{ {
if start+ch_struc_size eq end_cb if start+ch_struc_size eq end_cb
;ª®£¤  ®¤¨­ í«¥¬¥­â ;ª®£¤  ®¤¨­ í«¥¬¥­â
push start ;㪠§ â¥«ì ­  checkbox push start ;㪠§ â¥«ì ­  checkbox
call [init_checkbox] ;­ áâனª  checkbox'  call [init_checkbox] ;­ áâனª  checkbox' 
else else
;ª®£¤  ­¥áª®«ìª® í«¥¬¥­â®¢ ;ª®£¤  ­¥áª®«ìª® í«¥¬¥­â®¢
mov ebp,start mov ebp,start
mov ecx,((end_cb-start)/ch_struc_size) mov ecx,((end_cb-start)/ch_struc_size)
@@: @@:
push ebp ;㪠§ â¥«ì ­  ¯¥à¢ë© checkbox push ebp ;㪠§ â¥«ì ­  ¯¥à¢ë© checkbox
call [init_checkbox] ;­ áâனª  checkbox'®¢ call [init_checkbox] ;­ áâனª  checkbox'®¢
add ebp,ch_struc_size add ebp,ch_struc_size
loop @b loop @b
end if end if
} }
@ -169,18 +169,18 @@ end if
macro checkboxes_mouse2 start,end_cb macro checkboxes_mouse2 start,end_cb
{ {
if start+ch_struc_size eq end_cb if start+ch_struc_size eq end_cb
;ª®£¤  ®¤¨­ í«¥¬¥­â ;ª®£¤  ®¤¨­ í«¥¬¥­â
push start ;㪠§ â¥«ì ­  checkbox push start ;㪠§ â¥«ì ­  checkbox
call [check_box_mouse] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ­ ¤ checkbox'®¬ call [check_box_mouse] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ­ ¤ checkbox'®¬
else else
;ª®£¤  ­¥áª®«ìª® í«¥¬¥­â®¢ ;ª®£¤  ­¥áª®«ìª® í«¥¬¥­â®¢
mov ebp,start mov ebp,start
mov ecx,((end_cb-start)/ch_struc_size) mov ecx,((end_cb-start)/ch_struc_size)
@@: @@:
push ebp ;㪠§ â¥«ì ­  ¯¥à¢ë© checkbox push ebp ;㪠§ â¥«ì ­  ¯¥à¢ë© checkbox
call [check_box_mouse] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ­ ¤ checkbox' ¬¨ call [check_box_mouse] ;¬ ªà®á ¯à®¢¥àª¨ ¬ë誨 ­ ¤ checkbox' ¬¨
add ebp,ch_struc_size add ebp,ch_struc_size
loop @b loop @b
end if end if
} }
@ -188,34 +188,34 @@ end if
macro checkboxes_draw2 start,end_cb macro checkboxes_draw2 start,end_cb
{ {
if start+ch_struc_size eq end_cb if start+ch_struc_size eq end_cb
;ª®£¤  ®¤¨­ í«¥¬¥­â ;ª®£¤  ®¤¨­ í«¥¬¥­â
push start ;㪠§ â¥«ì ­  checkbox push start ;㪠§ â¥«ì ­  checkbox
call [check_box_draw] ;­ à¨á®¢ âì checkbox call [check_box_draw] ;­ à¨á®¢ âì checkbox
else else
;ª®£¤  ­¥áª®«ìª® í«¥¬¥­â®¢ ;ª®£¤  ­¥áª®«ìª® í«¥¬¥­â®¢
mov ebp,start mov ebp,start
mov ecx,((end_cb-start)/ch_struc_size) mov ecx,((end_cb-start)/ch_struc_size)
@@: @@:
push ebp ;㪠§ â¥«ì ­  ¯¥à¢ë© checkbox push ebp ;㪠§ â¥«ì ­  ¯¥à¢ë© checkbox
call [check_box_draw] ;­ à¨á®¢ âì checkbox'ë call [check_box_draw] ;­ à¨á®¢ âì checkbox'ë
add ebp,ch_struc_size add ebp,ch_struc_size
loop @b loop @b
end if end if
} }
macro check_boxes_set_sys_color2 start,end,color_table macro check_boxes_set_sys_color2 start,end,color_table
{ {
mov ebp,start mov ebp,start
mov ecx,((end-start)/ch_struc_size) mov ecx,((end-start)/ch_struc_size)
mov esi,color_table mov esi,color_table
@@: @@:
push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­  push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­ 
or dword [esp],0x80000000 ;­¥®¡å®¤¨¬® ¤«ï ¢ë¢®¤  ASCIIZ áâப or dword [esp],0x80000000 ;­¥®¡å®¤¨¬® ¤«ï ¢ë¢®¤  ASCIIZ áâப
pop dword 2ch_text_color pop dword 2ch_text_color
push dword [esi+36] ;梥⠣à ä¨ª¨ ¢ ®ª­¥ (à §¤¥«¨â¥«ì­ë¥ «¨­¨¨ ¨ â.¯.) push dword [esi+36] ;梥⠣à ä¨ª¨ ¢ ®ª­¥ (à §¤¥«¨â¥«ì­ë¥ «¨­¨¨ ¨ â.¯.)
pop dword 2ch_border_color pop dword 2ch_border_color
add ebp,ch_struc_size add ebp,ch_struc_size
loop @b loop @b
} }
@ -257,20 +257,20 @@ op_flags equ [edi+36] ;䫠
macro option_boxes_set_sys_color color_table,group macro option_boxes_set_sys_color color_table,group
{ {
mov ecx,group mov ecx,group
mov esi,color_table mov esi,color_table
mov edi,[ecx] mov edi,[ecx]
mov eax,[esi+24] ;梥⠪­®¯ª¨ ¢ à ¡®ç¥© ®¡« á⨠®ª­  mov eax,[esi+24] ;梥⠪­®¯ª¨ ¢ à ¡®ç¥© ®¡« á⨠®ª­ 
mov ebx,[esi+28] ;梥â ⥪áâ  ­  ª­®¯ª¥ mov ebx,[esi+28] ;梥â ⥪áâ  ­  ª­®¯ª¥
@@: @@:
mov op_border_color,eax mov op_border_color,eax
mov op_color,ebx mov op_color,ebx
push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­  push dword [esi+32] ;梥â ⥪áâ  ¢ à ¡®ç¥© ®¡« á⨠®ª­ 
pop dword op_text_color pop dword op_text_color
add ecx,4 add ecx,4
mov edi,[ecx] mov edi,[ecx]
cmp edi,0 cmp edi,0
jne @b jne @b
} }
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Basic macros for use TreeList ; ;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,\ 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,\ 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 { info_capt_len,el_focus, p_scrol,on_press {
.data_info dd 0 .data_info dd 0
.info_size dw info_size .info_size dw info_size
.info_max_count dd info_max_count .info_max_count dd info_max_count
.style dd style .style dd style
.data_nodes dd 0 .data_nodes dd 0
.data_img dd 0 .data_img dd 0
.img_cx dw img_cx .img_cx dw img_cx
.img_cy dw img_cy .img_cy dw img_cy
.data_img_sys dd 0 .data_img_sys dd 0
.ch_tim dd 0 .ch_tim dd 0
.ls_tim dd 0 .ls_tim dd 0
.tim_undo dd 0 .tim_undo dd 0
.cur_pos dd 0 .cur_pos dd 0
.col_bkg dd col_bkg .col_bkg dd col_bkg
.col_zag dd col_zag .col_zag dd col_zag
.col_txt dd col_txt .col_txt dd col_txt
.box_left dd box_l .box_left dd box_l
.box_top dd box_t .box_top dd box_t
.box_width dd box_w .box_width dd box_w
.box_height dd box_h .box_height dd box_h
.capt_cy dw capt_cy .capt_cy dw capt_cy
.info_capt_offs dw info_capt_offs .info_capt_offs dw info_capt_offs
.info_capt_len dw info_capt_len .info_capt_len dw info_capt_len
.el_focus dd el_focus .el_focus dd el_focus
@ -334,8 +334,8 @@ tl_el_focus equ dword[edi+80] ;㪠
tl_p_scrol equ dword[edi+84] ;㪠§ â¥«ì ­  áâàãªâãàã áªà®««¨­£  tl_p_scrol equ dword[edi+84] ;㪠§ â¥«ì ­  áâàãªâãàã áªà®««¨­£ 
tl_on_press equ dword[edi+96] ;㪠§ â¥«ì ­  äã­ªæ¨î, ª®â®à ï ¢ë§ë¢ ¥âáï ¯à¨ ­ ¦ â¨¨ Enter tl_on_press equ dword[edi+96] ;㪠§ â¥«ì ­  äã­ªæ¨î, ª®â®à ï ¢ë§ë¢ ¥âáï ¯à¨ ­ ¦ â¨¨ Enter
;data_info dd ? ;+ 0 㪠§ â¥«ì ­  ®á­®¢­ë¥ ¤ ­ë¥ ;data_info dd ? ;+ 0 㪠§ â¥«ì ­  ®á­®¢­ë¥ ¤ ­ë¥
;ls_tim dd ? ;+34 ¢à¥¬ï ¯®á«¥¤­¥£® á®åà ­¥­¨ï ;ls_tim dd ? ;+34 ¢à¥¬ï ¯®á«¥¤­¥£® á®åà ­¥­¨ï
;on_activate dd ? ;+92 㪠§ â¥«ì ­  äã­ªæ¨î ¯à¨  ªâ¨¢¨à®¢ ­¨¨ 㧫  ;on_activate dd ? ;+92 㪠§ â¥«ì ­  äã­ªæ¨î ¯à¨  ªâ¨¢¨à®¢ ­¨¨ 㧫 
;ª®­áâ ­âë á⨫ï ;ª®­áâ ­âë á⨫ï
@ -454,3 +454,35 @@ sb_offs_redraw equ 40
sb_offs_delta2 equ 46 sb_offs_delta2 equ 46
sb_offs_all_redraw equ 80 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
}