我是继承自动缩放窗口,自动缩放窗口函数如下:请问怎么修改?
函数uf_resize:
DragObject dragcontrol
line line_contr
Oval oval_contr
Rectangle rect_contr
RoundRectangle roun_contr
tab l_tab
userobject luo_control
choose case v_winobj.typeof()
case commandbutton!,picturebutton!,checkbox!,radiobutton!, &
statictext!,staticHyperLink!,picture!, &
pictureHyperLink!,groupbox!,singlelineedit!,editmask!, &
multilineedit!,richtextedit!,hscrollbar!,Vscrollbar!, &
Htrackbar!,VtrackBar!,HprogressBar!,VprogressBar!, &
dropdownlistbox!,dropdownpicturelistbox!,listbox!, &
picturelistbox!,listview!,treeview!,datawindow!, &
graph!,olecontrol!
dragcontrol=v_winobj
dragcontrol.move(s_consize.s_conx[v_lj]*ll_width,s_consize.s_cony[v_lj]*ll_height)
dragcontrol.resize(s_consize.s_conw[v_lj]*ll_width,s_consize.s_conh[v_lj]*ll_height)
v_lj=v_lj+1
case Line!
line_contr=v_winobj
line_contr.beginx=s_consize.s_conx[v_lj]*ll_width
line_contr.beginy=s_consize.s_cony[v_lj]*ll_height
line_contr.endx=s_consize.s_conw[v_lj]*ll_width
line_contr.endy=s_consize.s_conh[v_lj]*ll_height
v_lj=v_lj+1
case Oval!
oval_contr=v_winobj
oval_contr.x=s_consize.s_conx[v_lj]*ll_width
oval_contr.y=s_consize.s_cony[v_lj]*ll_height
oval_contr.width=s_consize.s_conw[v_lj]*ll_width
oval_contr.height=s_consize.s_conh[v_lj]*ll_height
v_lj=v_lj+1
case Rectangle!
rect_contr=v_winobj
rect_contr.x=s_consize.s_conx[v_lj]*ll_width
rect_contr.y=s_consize.s_cony[v_lj]*ll_height
rect_contr.width=s_consize.s_conw[v_lj]*ll_width
rect_contr.height=s_consize.s_conh[v_lj]*ll_height
v_lj=v_lj+1
case RoundRectangle!
roun_contr=v_winobj
roun_contr.x=s_consize.s_conx[v_lj]*ll_width
roun_contr.y=s_consize.s_cony[v_lj]*ll_height
roun_contr.width=s_consize.s_conw[v_lj]*ll_width
roun_contr.height=s_consize.s_conh[v_lj]*ll_height
v_lj=v_lj+1
case tab!
l_tab=v_winobj
l_tab.x=s_consize.s_conx[v_lj]*ll_width
l_tab.y=s_consize.s_cony[v_lj]*ll_height
l_tab.width=s_consize.s_conw[v_lj]*ll_width
l_tab.height=s_consize.s_conh[v_lj]*ll_height
v_lj=v_lj+1
integer li_ti1,li_ti2
for li_ti1=1 to upperbound(l_tab.control[])
for li_ti2=1 to upperbound(l_tab.control[li_ti1].control[])
uf_resize(l_tab.control[li_ti1].control[li_ti2],ll_width,ll_height)
next
next
case userobject!
luo_control=v_winobj
luo_control.x=s_consize.s_conx[v_lj]*ll_width
luo_control.y=s_consize.s_cony[v_lj]*ll_height
luo_control.width=s_consize.s_conw[v_lj]*ll_width
luo_control.height=s_consize.s_conh[v_lj]*ll_height
v_lj=v_lj+1
integer li_uconnum,li_ui
li_uconnum=upperbound(luo_control.control[])
for li_ui=1 to li_uconnum
uf_resize(luo_control.control[li_ui],ll_width,ll_height)
next
end choose
return 0
函数uf_position:
DragObject dragcontrol
Line line_contr
Oval oval_contr
Rectangle rect_contr
RoundRectangle roun_contr
Tab l_tab
Userobject luo_control
Choose Case v_winobj.typeof()
Case commandbutton!,picturebutton!,checkbox!,radiobutton!, &
statictext!,staticHyperLink!,picture!, &
pictureHyperLink!,groupbox!,singlelineedit!,editmask!, &
multilineedit!,richtextedit!,hscrollbar!,Vscrollbar!, &
Htrackbar!,VtrackBar!,HprogressBar!,VprogressBar!, &
dropdownlistbox!,dropdownpicturelistbox!,listbox!, &
picturelistbox!,listview!,treeview!,datawindow!, &
graph!,olecontrol!
dragcontrol=v_winobj
s_consize.s_conx[v_li]=dragcontrol.x/ll_width
s_consize.s_cony[v_li]=dragcontrol.y/ll_height
s_consize.s_conw[v_li]=dragcontrol.width/ll_width
s_consize.s_conh[v_li]=dragcontrol.height/ll_height
v_li=v_li+1
Case Line!
line_contr=v_winobj
s_consize.s_conx[v_li]=line_contr.beginx/ll_width
s_consize.s_cony[v_li]=line_contr.beginy/ll_height
s_consize.s_conw[v_li]=line_contr.endx/ll_width
s_consize.s_conh[v_li]=line_contr.endy/ll_height
v_li=v_li+1
Case Oval!
oval_contr=v_winobj
s_consize.s_conx[v_li]=oval_contr.x/ll_width
s_consize.s_cony[v_li]=oval_contr.y/ll_height
s_consize.s_conw[v_li]=oval_contr.width/ll_width
s_consize.s_conh[v_li]=oval_contr.height/ll_height
v_li=v_li+1
Case Rectangle!
rect_contr=v_winobj
s_consize.s_conx[v_li]=rect_contr.x/ll_width
s_consize.s_cony[v_li]=rect_contr.y/ll_height
s_consize.s_conw[v_li]=rect_contr.width/ll_width
s_consize.s_conh[v_li]=rect_contr.height/ll_height
v_li=v_li+1
Case RoundRectangle!
roun_contr=v_winobj
s_consize.s_conx[v_li]=roun_contr.x/ll_width
s_consize.s_cony[v_li]=roun_contr.y/ll_height
s_consize.s_conw[v_li]=roun_contr.width/ll_width
s_consize.s_conh[v_li]=roun_contr.height/ll_height
v_li=v_li+1
Case tab!
l_tab=v_winobj
s_consize.s_conx[v_li]=l_tab.x/ll_width
s_consize.s_cony[v_li]=l_tab.y/ll_height
s_consize.s_conw[v_li]=l_tab.width/ll_width
s_consize.s_conh[v_li]=l_tab.height/ll_height
v_li=v_li+1
integer li_ti1,li_ti2
for li_ti1=1 to upperbound(l_tab.control[])
for li_ti2=1 to upperbound(l_tab.control[li_ti1].control[])
uf_position(l_tab.control[li_ti1].control[li_ti2],ll_width,ll_height)
next
next
Case userobject!
luo_control=v_winobj
s_consize.s_conx[v_li]=luo_control.x/ll_width
s_consize.s_cony[v_li]=luo_control.y/ll_height
s_consize.s_conw[v_li]=luo_control.width/ll_width
s_consize.s_conh[v_li]=luo_control.height/ll_height
v_li=v_li+1
integer li_uconnum,li_ui
li_uconnum=upperbound(luo_control.control[])
for li_ui=1 to li_uconnum
uf_position(luo_control.control[li_ui],ll_width,ll_height)
next
End Choose
Return 0
[此贴子已经被作者于2006-6-21 12:42:38编辑过]