Class: cToolbar
Properties | Events | Methods | Index of Classes
A control, usually placed at the top of a window, that contains buttons which act as shortcuts to frequently used functionality
Hierarchy
cObject > cUIObject > DfBaseObject > DfBaseWindow > DfBaseUIWindow > DfBaseControl > cWinControl > cToolbar
Show full hierarchy and direct subclasses
Library: Windows Application Class Library
Package: cToolbar.Pkg
Description
This class is obsolete. Toolbars are now created using the cCJToolbar class.
As of revision 12.1, DataFlex includes full support for Codejock Software's COM Xtreme CommandBars package for creating menus, toolbars and statusbars. See Using Menus, Toolbars and Statusbars for more information.
The toolbar is a control, usually placed at the top of a window, that contains buttons which act as shortcuts to frequently used functionality.
To create the buttons, embed objects derived from cToolbarButton.
Usually, the toolbar is part of the MDI interface. In this mode, the toolbar will automatically size and align itself with the panel's client-area.
If you want to use a toolbar in a non-MDI container, set its pbInMdiPanel property to false, to prevent it from communicating with the MDI interface. To prevent the toolbar from aligning to the bottom of the parent window, change the peAlign property to alNone and size and locate the toolbar manually.
Sample
Object oToolBar is a cToolBar
Object oImages is a cImageList
Set piMaxImages To 4
Procedure OnCreate
Integer iVoid
Get AddTransparentImage "Customer.bmp" clFuchsia To iVoid
Get AddTransparentImage "Cut16.bmp" clFuchsia To iVoid
Get AddTransparentImage "Copy16.bmp" clFuchsia To iVoid
Get AddTransparentImage "Paste16.bmp" clFuchsia To iVoid
End_Procedure
End_Object
Set phoImageList To (oImages(self))
Object oCustomer is a cToolbarButton
Set psTooltip To 'Customer View'
Set psStatusHelp To 'Activate the Customer View'
Set piImage To 0
Procedure OnClick
Send DoShowCustomer
End_Procedure
End_Object
Object oSeparator is a cToolbarButton
Set peStyle To bsSeparator
End_Object
Object oCut is a cToolbarButton
Set psTooltip To 'Cut'
Set psStatusHelp To 'Cuts the selection to the Clipboard'
Set piImage To 1
Procedure OnClick
Send DoSendToFocus msg_cut
End_Procedure
End_Object
Object oCopy is a cToolbarButton
Set psTooltip To 'Copy'
Set psStatusHelp To 'Copies the selection to the Clipboard'
Set piImage To 2
Procedure OnClick
Send DoSendToFocus msg_copy
End_Procedure
End_Object
Object oPaste is a cToolbarButton
Set psTooltip To 'Paste'
Set psStatusHelp To 'Inserts Clipboard contents'
Set piImage To 3
Procedure OnClick
Send DoSendToFocus msg_paste
End_Procedure
End_Object
End_Object // oToolbar