AddToolbarTarget (set the FormVCR toolbar)

Top  Previous  Next

 

AddToolbarTarget( toolbar )

AddToolbarTarget

Registers the FormVCR object as a potential target of the specified toolbar.

toolbar

The label of the ToolbarClass object that directs toolbar events to this FormVCRClass object.

The AddToolbarTarget method registers the FormVCRClass object as a potential target of the specified toolbar.

The ToolbarClass.SetTarget method sets the active target for a ToolbarClass object.

Implementation:

The Toolbar object for a FormVCR is the object that detects toolbar events, such as scroll down or page down, and passes them on to the active ToolbarTarget object. In the standard template implementation, there is a single global toolbar, and a Toolbar object per procedure that may drive several different browses and forms, each of which is a ToolbarTarget. Only one ToolbarTarget is active at a time.

Example:

 OPEN(QuickWindow)                                       ! Open window

 SELF.Opened=True

 FormVCR6.Init|

 (?FormVCRControls,10,FormVCR6::View,Relate:people,SELF) ! Initialize the FormVCR manager

 FormVCR6.InsertWhenNoRecords = True

 FormVCR6.SetVCRControls|

(?FormVCR:Top,?FormVCR:PageUp,?FormVCR:Up,?FormVCR:Down,?FormVCR:PageDown,?FormVCR:Bottom)

 FormVCR6.SetRequestControl|

(?FormVCR:Request,?FormVCR:Request:View,?FormVCR:Request:Insert,?FormVCR:Request:Change,|

?FormVCR:Request:Delete)

 Do DefineListboxStyle

 FormVCR6.AddSortOrder()                            !Add the sort order for  for sort order 1

! Controls like list boxes will resize, whilst controls like buttons will move

 Resizer.Init(AppStrategy:Surface,Resize:SetMinSize)

 SELF.AddItem(Resizer)                              ! Add resizer to window manager

 SELF.AddItem(ToolbarForm)

 FormVCR6.AddToolbarTarget(Toolbar)                 ! Browse accepts toolbar control

 FormVCR6.Reset

 SELF.SetAlerts()

 RETURN ReturnValue

 

See Also:     Toolbar, ToolbarItem, ToolbarClass.SetTarget