第二讲准备kodigo的排版服务n_svc_resize
讲这个服务前,先介绍一下结构str_resize
global type str_resize from structure
dragobject control//待排对象的引用
string controlname//对象类名
integer sizeorder//排版序(即多个同级排版的先后序)
boolean dock//是否按停靠方式
integer docktype
//停靠类型:1 向顶靠 2 向左靠 3 向右靠 4 向底靠 5 填充全部
integer dockpadtop//向顶预留
integer dockpadleft//向左预留
integer dockpadright//向右预留
integer dockpadbottom//向底预留
boolean anchortop//是否向顶瞄定
boolean anchorleft//是否向左瞄定
boolean anchorright//是否向右瞄定
boolean anchorbottom//是否向度瞄定
//(注:除了动态建立的对象,PB的对象名,和类名一般一样)
string reftop//顶接对象类名
string refleft//左接对象类名
string refright//右接对象类名
string refbottom//底接对象类名
rect bounds//对象边界,实际上就是对象resize前的矩形
string ancestor//kodigo级祖先类名(cfbase中有定义)
integer reftopindex//顶接对象索引
integer refleftindex//左接对象索引
integer refrightindex//右接对象索引
integer refbottomindex//底接对象索引
boolean ignorevisible//虽然不显视,但是否预留空间
end type
再注意观查fcmain的u打头的对象,是不是每个对象都有:
type variables
Public:
Long #SizeOrder
Boolean #AnchorTop
Boolean #AnchorLeft
Boolean #AnchorRight
Boolean #AnchorBottom
Boolean #Dock
Long #DockType, #DockPadTop, #DockPadLeft, #DockPadRight, #DockPadBottom
String #Dock_Control_Top, #Dock_Control_Left, #Dock_Control_Right, #Dock_Control_Bottom
Boolean #Tooltip
string #TooltipText
Boolean #BalloonTooltip
icon #TooltipIcon = none!
string #TooltipTitle
Private:
str_resize istr_resize
end variables
public function str_resize of_getresizeattrib ();istr_resize.Control = this
istr_resize.ControlName = ClassName(this)
istr_resize.SizeOrder = #SizeOrder
istr_resize.SizeOrder = #SizeOrder
istr_resize.Dock = #Dock
istr_resize.DockType = #DockType
istr_resize.DockPadTop = #DockPadTop
istr_resize.DockPadLeft = #DockPadLeft
istr_resize.DockPadRight = #DockPadRight
istr_resize.DockPadBottom = #DockPadBottom
istr_resize.AnchorTop = #AnchorTop
istr_resize.AnchorLeft = #AnchorLeft
istr_resize.AnchorRight = #Anchorright
istr_resize.AnchorBottom = #Anchorbottom
istr_resize.reftop = #Dock_Control_top
istr_resize.refleft = #Dock_Control_left
istr_resize.refright = #Dock_Control_right
istr_resize.refbottom = #Dock_Control_bottom
istr_resize.bounds.left = X
istr_resize.bounds.top = Y
istr_resize.bounds.right = width
istr_resize.bounds.bottom = height
RETURN istr_resize