File: u_tab.sru
Size: 3396
Date: Mon, 07 Apr 2008 21:31:02 +0200
$PBExportHeader$u_tab.sru
$PBExportComments$Base Tab Object
forward
global type u_tab from tab
end type
end forward

global type u_tab from tab
integer width = 1600
integer height = 1200
integer textsize = -8
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Tahoma"
long backcolor = 67108864
boolean raggedright = true
boolean focusonbuttondown = true
integer selectedtab = 1
event ke_changes ( )
event ke_constructor ( )
end type
global u_tab u_tab

type variables
Public:
//Size Order
Long #SizeOrder
//Anchoring
Boolean #AnchorTop
Boolean #AnchorLeft
Boolean #AnchorRight
Boolean #AnchorBottom
//Docking
Boolean #Dock
//Dock Padding
Long #DockType, #DockPadTop, #DockPadLeft, #DockPadRight, #DockPadBottom
//Dock control reference
String #Dock_Control_Top, #Dock_Control_Left, #Dock_Control_Right, #Dock_Control_Bottom
Private:
str_resize istr_resize
end variables

forward prototypes
public function str_resize of_getresizeattrib ()
public function integer of_broadcast (readonly u_tabpage auo_source, readonly string as_msg)
public function integer of_addtabpage (readonly string as_classname)
public function integer of_savepages ()
public subroutine of_constructcontrols ()
end prototypes

event ke_changes();//bubble up event
IF ISVALID(Parent) THEN Parent.TriggerEvent(Ckevents.CHANGES)
end event

event ke_constructor();of_ConstructControls()
end event

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
end function

public function integer of_broadcast (readonly u_tabpage auo_source, readonly string as_msg);n_svc_mgr lnv_svc
n_svc_tab lnv_tab

lnv_svc.of_LoadSvc(lnv_tab, CSvc.TAB)

RETURN lnv_tab.of_Broadcast(this, auo_source, as_msg)
end function

public function integer of_addtabpage (readonly string as_classname);n_svc_mgr lnv_svc
n_svc_tab lnv_tab

lnv_svc.of_LoadSvc(lnv_tab, CSvc.TAB)

RETURN lnv_tab.of_AddTabpage(lnv_svc, this, as_classname)
end function

public function integer of_savepages ();n_svc_mgr lnv_svc
n_svc_tab lnv_tab

lnv_svc.of_LoadSvc(lnv_tab, CSvc.TAB)

RETURN lnv_tab.of_SavePages(this)
end function

public subroutine of_constructcontrols ();long ll_count, n
any la

ll_count = UPPERBOUND(this.Control)
FOR n = 1 to ll_count
   //if the object does not contain 
   //the ke_constructor() event, this call
   // will fail silently (See PB Help on DYNAMIC calls)
   la = Control[n].EVENT DYNAMIC ke_constructor()
NEXT
end subroutine