Navigation:  Reference > Form Objects >

TColorButton

Print this Topic Previous pageReturn to chapter overviewNext page

 

This will display the  Windows  color button on the form.  The user will be able to 'click' on this button (press the left mouse button while the arrow is over the object) and have this execute an Event that will call a routine in your program.  This is a enhanced object this is like the TButton and will probably be used often on your forms.  The icon for this object is on the standard page.

 

PALETTE ICON & EXAMPLE

 

 

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

 

CaptionThis is the text that is displayed on the face of the button.  This is any standard string and can be changed at runtime.

 

Cursor

 

WordWrapIf the Caption is too long to fit within a single line you can stretch the label box and check this option (set to .True.).  The label will then be treated like a minor memo and the Caption will word wrap within the box provided.  You can adjust the box and the Caption will wrap to fit.

 

 

Behavior

 

CancelIf this is checked (set to .True.) the Click event (see below) will execute if the user presses the ESC key.  This property can be set during runtime.

 

DefaultIf this is checked (set to .True.) the button will be the default object on the form.  This means if the user presses the ENTER key it will have the same effect as if they had clicked the button.

 

       NOTE:  If you have entry objects on the form, e.g. TTASEnter, with the ReturnIsTab property checked (set to .True.) then this will be ignored.

 

Enabled

TabOrder

TabStop

Visible

 

Font

 

Font

ParentFont

 

Hint

 

Hint

ParentShowHint

ShowHint

 

Misc

 

HelpContext

Name

PopupMenu

Tag

 

Other

 

Anchors

 

BackGroundColorIn  This is the color when the button is activated or pushed.

 

BackGroundColorOut  This is the color of the button when the button is at rest or not pushed

 

Constraints

 

FontColorIn          This is the color of the font when the button is pushed.

 

FontColorOut       This is the color of the font when the button is not active or pushed.

 

ModalResultIf this button is on a form loaded using the LOAD_MODAL_FORM() function this would be one way to set the Modal_Result property for that form.  This will release the form and return the appropriate value from the function.  If it is placed on a non-modal form (most often) you can still determine which button is calling by setting up a separate event (see below) or putting a value in the Tag property and checking that property in the common event called.  These values are defined in COMPILERCONSTANTS.TXT.  This property can be modified during runtime.

 

Position

 

Height

Left

Top

Width

 

 

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 button, 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 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:

 

btnFirstButton.click:

btnSecondButton.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/tcolorbutton.htm