Library | File

Class uifcButtonBase

# include <uifcButtonBase.h>

class uifcButtonBase
 : public virtual uifcComponent
{
    xaideclare(uifcButtonBase)
    ...
};



Description


Direct Known Subclasses:
uifcCascadeButton, uifcCheckButton, uifcPushButton



Method Summary

xboolCanResizeWhenNeeded ()
 
xboolCanTruncateText ()
 
xboolCanWrap ()
 
xboolDoesAllowKeyboardInput ()
 
uifcKey_ptrGetAcceleratorKey ()
 
xstringGetAcceleratorText ()
 
uifcButtonStyleGetButtonStyle ()
 
xintGetContentArrangement ()
 
xstringGetDragCursorImage ()
 
xstringGetDragNotValidCursorImage ()
 
uifcFontClassGetFontClass ()
 
xstringGetFontName ()
 
xrealGetFontSize ()
 
uifcFontStyleGetFontStyle ()
 
xstringGetHelpText ()
 
xstringGetImage ()
 
xintGetImageBackgroundColor ()
 
xintGetImageColor ()
 
xstringGetText ()
 
uifcAlignmentGetTextAlignment ()
 
uifcRichTextGetTextFormat ()
 
xboolIsEnabled ()
 
xboolIsValidDragSite ()
 
voidSetAcceleratorKey (uifcKey_ptr key)
 
voidSetAllowKeyboardInput (xbool flag)
 
voidSetButtonStyle (uifcButtonStyle value)
 
voidSetCanResizeWhenNeeded (xbool flag)
 
voidSetCanTruncateText (xbool flag)
 
voidSetCanWrap (xbool flag)
 
voidSetContentArrangement (xint value)
 
voidSetDragCursorImage (xrstring value)
 
voidSetDragNotValidCursorImage (xrstring value)
 
voidSetEnabled (xbool flag)
 
voidSetFontClass (uifcFontClass value)
 
voidSetFontName (xrstring value)
 
voidSetFontSize (xreal value)
 
voidSetFontStyle (uifcFontStyle value)
 
voidSetHelpText (xrstring value)
 
voidSetImage (xrstring value)
 
voidSetImageBackgroundColor (xint value)
 
voidSetImageColor (xint value)
 
voidSetText (xrstring value)
 
voidSetTextAlignment (uifcAlignment value)
 
voidSetTextFormat (uifcRichText value)
 
voidSetValidDragSite (xbool flag)
 


Methods Inherited from Class uifcComponent:

GetDialog, GetComponent, CreateInParent, AddPopupMenu, IsVisible, SetVisible, GetComponentClass, GetComponentClassName, IsAlwaysAtFront, SetAlwaysAtFront, GetBackgroundColor, SetBackgroundColor, IsAttachedAtBottom, SetAttachedAtBottom, GetBottomOffset, SetBottomOffset, GetCursorImage, SetCursorImage, GetTextColor, SetTextColor, GetHelpTextAlignment, SetHelpTextAlignment, GetHelpTextWidth, SetHelpTextWidth, GetHelpTextOriginX, SetHelpTextOriginX, GetHelpTextOriginY, SetHelpTextOriginY, CanInheritPopupMenu, SetCanInheritPopupMenu, IsAttachedAtLeft, SetAttachedAtLeft, GetLeftOffset, SetLeftOffset, DoesReserveSpace, SetReserveSpace, GetParentName, GetPopupMenuName, SetPopupMenuName, CanPopupMenuWhenDisabled, SetCanPopupMenuWhenDisabled, IsAttachedAtRight, SetAttachedAtRight, GetRightOffset, SetRightOffset, IsAttachedAtTop, SetAttachedAtTop, GetTopOffset, SetTopOffset, IsValidDropSite, SetValidDropSite, GetValidDropTypeFlags, SetValidDropTypeFlags, GetChildNameArray, DoesAllowTrailRecording, SetAllowTrailRecording, CanReduceHeight, SetCanReduceHeight, CanReduceWidth, SetCanReduceWidth



Method Detail

xintGetImageColor ()

 
Returns:
The foreground color of the image of the PushButton, if the image has a depth of 1, as a uifcColor.



voidSetImageColor (xint value)

 

Sets the foreground color of the image of the PushButton, if the image has a depth of 1, as a uifcColor.
Parameters:
value
Returns:



uifcKey_ptrGetAcceleratorKey ()

 
Returns:
The accelerator key which, when pressed, will activate the PushButton.



voidSetAcceleratorKey (uifcKey_ptr key)

 

Sets the accelerator key which, when pressed, will activate the PushButton.
Parameters:
key
Returns:



xstringGetDragCursorImage ()

 
Returns:
The cursor to use when the user starts a drag & drop operation by dragging the component and the pointer is over a valid drop-site.



voidSetDragCursorImage (xrstring value)

 

Sets the cursor to use when the user starts a drag & drop operation by dragging the component and the pointer is over a valid drop-site.
Parameters:
value
Returns:



xstringGetImage ()

 
Returns:
The image of the PushButton.
This may be a BIF (the .bif extension is optional) file or a JPG, PNG, PCX, GIF, BMP, ICO or CUR file.



voidSetImage (xrstring value)

 

Sets the image of the PushButton.
This may be a BIF (the .bif extension is optional) file or a JPG, PNG, PCX, GIF, BMP, ICO or CUR file.
Parameters:
value
Returns:



uifcAlignmentGetTextAlignment ()

 
Returns:
The justification of the label of the PushButton if the label is multi-line.

ALIGNMENT_LEFT Left justified
ALIGNMENT_CENTER Center justified
ALIGNMENT_RIGHT Right justified



voidSetTextAlignment (uifcAlignment value)

 

Sets the justification of the label of the PushButton if the label is multi-line.

ALIGNMENT_LEFT Left justified
ALIGNMENT_CENTER Center justified
ALIGNMENT_RIGHT Right justified

Parameters:
value
Returns:



uifcButtonStyleGetButtonStyle ()

 
Returns:
The display style of the PushButton.

BUTTON_STYLE_TOGGLE The horizontal margin is twice as wide as the vertical margin, the shadow border is always drawn and by default the button accepts keyboard input
BUTTON_STYLE_TOOL The horizontal and vertical margins are equal, the shadow border is always drawn and by default the button does not accept keyboard input
BUTTON_STYLE_FLAT The horizontal and vertical margins are equal, the shadow border is only drawn when the pointer is moved over the component and by default the button does not accept keyboard input



voidSetButtonStyle (uifcButtonStyle value)

 

Sets the display style of the PushButton.

BUTTON_STYLE_TOGGLE The horizontal margin is twice as wide as the vertical margin, the shadow border is always drawn and by default the button accepts keyboard input
BUTTON_STYLE_TOOL The horizontal and vertical margins are equal, the shadow border is always drawn and by default the button does not accept keyboard input
BUTTON_STYLE_FLAT The horizontal and vertical margins are equal, the shadow border is only drawn when the pointer is moved over the component and by default the button does not accept keyboard input

Parameters:
value
Returns:



xboolCanWrap ()

 
Returns:
Flag indicating whether the label of the component should wrap within the available space granted to the component by its parent. Currently this flag is only supported for components which are the children of a MenuPane, where the MenuPane has been assigned a given size by the application code.



voidSetCanWrap (xbool flag)

 

Sets flag indicating whether the label of the component should wrap within the available space granted to the component by its parent. Currently this flag is only supported for components which are the children of a MenuPane, where the MenuPane has been assigned a given size by the application code.
Parameters:
flag
Returns:



uifcRichTextGetTextFormat ()

 
Returns:
The format of the display text of the component.

RICHTEXT_OFF Plain text
RICHTEXT_ON A very restricted subset of HTML
RICHTEXT_ON + <HTML> HTML as supported by the HTMLWindow

The UI RichText format supports the following styles, controlled by their corresponding tokens:

Style Switch on Switch off
Bold \b \b0
Italic \i \i0
Underlined \ul \ulnone
Strike-through \strike \strike0
Superscript \super \nosupersub
Subscript \sub \nosupersub
Foreground Color \cfRRGGBB \cf0
Background Color \cbRRGGBB \cb0
Picture \pictNAME n/a

N.B. Each token must be followed immediately by another token or a whitespace character (e.g. space, newline).
The very restricted subset of HTML supports the following styles, controlled by their corresponding tokens:

Style Switch on Switch off
Bold <b> </b>
Italic <i> </i>
Underlined <u> </u>
Strike-through <strike> </strike>
Superscript <sup> </sup>
Subscript <sub> </sub>
Foreground Color <font color=#RRGGBB> </font>
Background Color <span style="background:#RRGGBB"> </span>
Picture <img src="NAME"> n/a



voidSetTextFormat (uifcRichText value)

 

Sets the format of the display text of the component.

RICHTEXT_OFF Plain text
RICHTEXT_ON A very restricted subset of HTML
RICHTEXT_ON + <HTML> HTML as supported by the HTMLWindow

The UI RichText format supports the following styles, controlled by their corresponding tokens:

Style Switch on Switch off
Bold \b \b0
Italic \i \i0
Underlined \ul \ulnone
Strike-through \strike \strike0
Superscript \super \nosupersub
Subscript \sub \nosupersub
Foreground Color \cfRRGGBB \cf0
Background Color \cbRRGGBB \cb0
Picture \pictNAME n/a

N.B. Each token must be followed immediately by another token or a whitespace character (e.g. space, newline).
The very restricted subset of HTML supports the following styles, controlled by their corresponding tokens:

Style Switch on Switch off
Bold <b> </b>
Italic <i> </i>
Underlined <u> </u>
Strike-through <strike> </strike>
Superscript <sup> </sup>
Subscript <sub> </sub>
Foreground Color <font color=#RRGGBB> </font>
Background Color <span style="background:#RRGGBB"> </span>
Picture <img src="NAME"> n/a

Parameters:
value
Returns:



xstringGetDragNotValidCursorImage ()

 
Returns:
The cursor to use when the user starts a drag & drop operation by dragging the component and the pointer is over an invalid drop-site.



voidSetDragNotValidCursorImage (xrstring value)

 

Sets the cursor to use when the user starts a drag & drop operation by dragging the component and the pointer is over an invalid drop-site.
Parameters:
value
Returns:



xintGetContentArrangement ()

 
Returns:
The alignment of the image and label of the PushButton.
This is made up of between 1 and 4 digits which represent the relative locations of the image and label.
The first digit is the image alignment within the bounds of the PushButton:

1 2 3
4 5 6
7 8 9

The second digit is optional and is the label alignment within the bounds of the PushButton, using the same scheme as above. If no digit is specified then the label alignment is assumed to be the same as the image alignment.
The third digit is also optional and is the relative position of the image and the label if the first 2 digits are equal. If no digit is specified then the relative position is assumed to be 1.

1 The image to the left of the label
2 The image to the right of the label
3 The image above the label
4 The image below the label

The fourth digit is also optional and is a flag representing whether how the image and label should be displayed. If no digit is specified then then fourth digit is assumed to be 1.

1 Display both the image and label
2 Display only the image
3 Display only the label



voidSetContentArrangement (xint value)

 

Sets the alignment of the image and label of the PushButton.
This is made up of between 1 and 4 digits which represent the relative locations of the image and label.
The first digit is the image alignment within the bounds of the PushButton:

1 2 3
4 5 6
7 8 9

The second digit is optional and is the label alignment within the bounds of the PushButton, using the same scheme as above. If no digit is specified then the label alignment is assumed to be the same as the image alignment.
The third digit is also optional and is the relative position of the image and the label if the first 2 digits are equal. If no digit is specified then the relative position is assumed to be 1.

1 The image to the left of the label
2 The image to the right of the label
3 The image above the label
4 The image below the label

The fourth digit is also optional and is a flag representing whether how the image and label should be displayed. If no digit is specified then then fourth digit is assumed to be 1.

1 Display both the image and label
2 Display only the image
3 Display only the label

Parameters:
value
Returns:



xboolDoesAllowKeyboardInput ()

 
Returns:
Flag indicating whether the component is capable of receiving keyboard input (xtrue), and hence is capable of receiving the keyboard input focus, or whether it responds only to mouse input (xfalse).
If this value is left unchanged (i.e. 2) then it is automatically set to xtrue or xfalse based upon the value of the ButtonStyle attribute.



voidSetAllowKeyboardInput (xbool flag)

 

Sets flag indicating whether the component is capable of receiving keyboard input (xtrue), and hence is capable of receiving the keyboard input focus, or whether it responds only to mouse input (xfalse).
If this value is left unchanged (i.e. 2) then it is automatically set to xtrue or xfalse based upon the value of the ButtonStyle attribute.
Parameters:
flag
Returns:



xstringGetFontName ()

 
Returns:
The name of the font used to draw text in the component. This may also contain a comma-separated list of font names, in which case the closest match (or the first exact match, if available) will be used.



voidSetFontName (xrstring value)

 

Sets the name of the font used to draw text in the component. This may also contain a comma-separated list of font names, in which case the closest match (or the first exact match, if available) will be used.
Parameters:
value
Returns:



uifcFontClassGetFontClass ()

 
Returns:
The base font class to be used to draw text in the component.

FONT_CLASS_DEFAULT The default font
FONT_CLASS_DESKTOP The font used by the Window Manager for the text of desktop icons
FONT_CLASS_MENU The font used by MenuBars and components within MenuPanes
FONT_CLASS_POPUPHELP The font used by the popup helptext
FONT_CLASS_MESSAGE The font used for messages in the UI Message Dialog
FONT_CLASS_TITLEBAR The font used to draw the titlebar text of a Dialog
FONT_CLASS_FIXED A system-specific fixed width font for the locale



voidSetFontClass (uifcFontClass value)

 

Sets the base font class to be used to draw text in the component.

FONT_CLASS_DEFAULT The default font
FONT_CLASS_DESKTOP The font used by the Window Manager for the text of desktop icons
FONT_CLASS_MENU The font used by MenuBars and components within MenuPanes
FONT_CLASS_POPUPHELP The font used by the popup helptext
FONT_CLASS_MESSAGE The font used for messages in the UI Message Dialog
FONT_CLASS_TITLEBAR The font used to draw the titlebar text of a Dialog
FONT_CLASS_FIXED A system-specific fixed width font for the locale

Parameters:
value
Returns:



xboolIsValidDragSite ()

 
Returns:
Flag indicating whether the component can be dragged to start a drag & drop operation.



voidSetValidDragSite (xbool flag)

 

Sets flag indicating whether the component can be dragged to start a drag & drop operation.
Parameters:
flag
Returns:



xboolCanTruncateText ()

 
Returns:
Flag indicating whether to truncate the label of the PushButton with ellipsis if there is insufficient space to display the entire text string.



voidSetCanTruncateText (xbool flag)

 

Sets flag indicating whether to truncate the label of the PushButton with ellipsis if there is insufficient space to display the entire text string.
Parameters:
flag
Returns:



xboolCanResizeWhenNeeded ()

 
Returns:
Flag indicating whether the PushButton should attempt to resize when its contents are changed.



voidSetCanResizeWhenNeeded (xbool flag)

 

Sets flag indicating whether the PushButton should attempt to resize when its contents are changed.
Parameters:
flag
Returns:



xrealGetFontSize ()

 
Returns:
The point-size of the font used to draw text in the component.



voidSetFontSize (xreal value)

 

Sets the point-size of the font used to draw text in the component.
Parameters:
value
Returns:



xboolIsEnabled ()

 
Returns:
Flag indicating whether the component is disabled (xfalse) or sensitive to user input (xtrue).



voidSetEnabled (xbool flag)

 

Sets flag indicating whether the component is disabled (xfalse) or sensitive to user input (xtrue).
Parameters:
flag
Returns:



xstringGetHelpText ()

 
Returns:
The popup help-text to be displayed whilst the pointer is over the component.
If the value begins with <HTML> then the help-text is treated as HTML, and rendered accordingly. It is often wise to use HTML help-text in conjunction with HelpTextWidth attribute, to define the maximum width of the popup help-text window.



voidSetHelpText (xrstring value)

 

Sets the popup help-text to be displayed whilst the pointer is over the component.
If the value begins with <HTML> then the help-text is treated as HTML, and rendered accordingly. It is often wise to use HTML help-text in conjunction with HelpTextWidth attribute, to define the maximum width of the popup help-text window.
Parameters:
value
Returns:



xstringGetText ()

 
Returns:
The label of the PushButton.
The text may be single or multi-line, and may contain a mnemonic by prefixing the mnemonic character with an ampersand.



voidSetText (xrstring value)

 

Sets the label of the PushButton.
The text may be single or multi-line, and may contain a mnemonic by prefixing the mnemonic character with an ampersand.
Parameters:
value
Returns:



uifcFontStyleGetFontStyle ()

 
Returns:
A bitwise OR of the styles of the font used to draw text in the component.

FONT_STYLE_REGULAR The font is regularly spaced, slanted and weighted
FONT_STYLE_CONDENSED The font is condensed
FONT_STYLE_ITALIC The font is italicised
FONT_STYLE_BOLD The font is emboldened



voidSetFontStyle (uifcFontStyle value)

 

Sets a bitwise OR of the styles of the font used to draw text in the component.

FONT_STYLE_REGULAR The font is regularly spaced, slanted and weighted
FONT_STYLE_CONDENSED The font is condensed
FONT_STYLE_ITALIC The font is italicised
FONT_STYLE_BOLD The font is emboldened

Parameters:
value
Returns:



xintGetImageBackgroundColor ()

 
Returns:
The background color of the image of the PushButton, if the image has a depth of 1, as a uifcColor.



voidSetImageBackgroundColor (xint value)

 

Sets the background color of the image of the PushButton, if the image has a depth of 1, as a uifcColor.
Parameters:
value
Returns:



xstringGetAcceleratorText ()

 
Returns:
The translated text representation of the current value of AcceleratorKey attribute.