Navigation:  Reference > Form Objects >

TToolButton

Print this Topic Previous pageReturn to chapter overviewNext page

 

There is no separate item on the palette for this object.  This is created when editing a TToolBar and are the actual tool bar buttons.

 

PROPERTIES

The following are the properties that apply to this object.  Some are defined in Common Properties and are linked to their appropriate page.

 

Appearance

 

CaptionIf the ShowCaption property is set in the parent TToolBar object then this is the text that will appear on the button face.

Cursor

 

Behavior

 

Enabled

Visible

 

Hint

 

Hint

ParentShowHint

ShowHint

 

Misc

 

Name

PopupMenu

Tag

 

Other

 

AllowAllUpIf this property is NOT checked then one button in a group on the tool bar must be selected at all times (including when it's first displayed).  To fulfill this requirement one of the buttons (in the group) must have its Down property checked (set to .True.).  The default value is checked (set to .True.).  This property can be modified during runtime.

 

       NOTE:  Changing this value for one of the buttons in the group changes it for all.

 

DownBy checking this property (set to .True.) you are choosing which button will start in the down position when the form is displayed.  This property can be modified during runtime.

 

DropDownMenuIf the Style of this button is tbsDropDown then this is the TPopupMenu that will be displayed when the user clicks on the down arrow that will appear to the right side of the button.

 

GroupedThis property works in conjunction with the tbsCheck option in Style.  If you have this property checked in a line of buttons that are a group (see COMMENTS below) and have their Style set to tbsCheck, then only one button can be selected in that group at a time.  This would be the equivalent of a group of TTASRadioButtons that would be part of a TGroupBox.

 

ImageIndexIf you have specified a TImageList in the TToolBar parent then this is the number of the image in that list.  The default value is -1.  Images start at 0.

 

       NOTE:  If you have also specified a TImageList in DiabledImages and HotImages then this will use the same image number in those lists also.  If this is set to -1 then no images will be used, regardless of the lists assigned.

 

IndeterminateThis is similar to setting the Enabled value for this button.  If is checked (set to .True.) then the image is 'grayed out' just like it would be if Enabled were unchecked (set to .False.).  This property can be modified at runtime.

 

MarkedIf this property is checked (set to .True.) the face of the button will be shaded.  This can be modified at runtime.

 

StyleThe style for this button.  The options are:  tbsButton (a standard TButton type of object, calls a CLICK event when pushed), tbsCheck (more like a TCheckBox in that the button stays down until it's pushed again - see AllowAllUp and Down above), tbsDivider (puts a dividing line between buttons - has no events itself), tbsDropDown (works in conjunction with a TPopupMenu to display a menu when the user clicks on the drop down arrow - see DropDownMenu above), tbsSeparator (puts a space between buttons).

 

       NOTE:  Both tbsDivider and tbsSeparator can be used to break up groups of buttons (see COMMENTS below).

 

WrapIf this is checked (set to .True.) the button will be the last in its row.  This is ignored if the Wrapable property on the TToolBar is checked.

 

Position

 

AutoSize

Height

Left

Top

Width

 

COMMENTS

Buttons are considered to be part of a group when they are placed side-by-side together on the bar and are not separated by a tbsSeparator or tbsDivider (see Style above).

 

NOTE:  In the case of this object the Height, Top and Width values are more for information than anything else.  All buttons on the TToolBar will have the same height and width unless you set the AutoSize property to .True. (checked).  If you do not set the AutoSize property the width will be determined by the widest button on the bar.

 

EVENTS

This object has a single event that is called if your user clicks the button.  This event looks to your program for a special label.  It is made up of the object Name, a period (.) and the Event name (Click).  The full event name would be ObjectName.Click:.  You would not return a value from the program, just a simple RET is all that is required.  So, the user clicks the menu item, if the event label exists the routine is called, you return from the routine, and the user has control again.

 

NOTE:  You can have multiple tool bar buttons call the same routine by 'stacking' the event labels on top of each other.  For example, if you had two buttons you wanted to call the same event, you could do the following:

 

tbbFirst.click:

tbbSecond.click:

 //event routine code would go here.

 ret

 

The labels are not part of the code executed.  They are just place keepers and tell the program where to go.

 

 

 

 


Page url: http://www.cassoftware.com/tas/manual/ttoolbutton.htm