CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
CFxUIToolButton Class Reference

#include <FxUIToolButton.h>

Inheritance diagram for CFxUIToolButton:
CFxUIBaseView CFxUIObject

Public Types

enum  UIToolButtonStyle {
  eIconOnly , eTextOnly , eTextBesideIcon , eTextUnderIcon ,
  eFollowStyle
}
 
- Public Types inherited from CFxUIBaseView
enum  TextAlignment {
  AlignLeft = 0x0001 , AlignRight = 0x0002 , AlignHCenter = 0x0004 , AlignJustify = 0x0008 ,
  AlignTop = 0x0020 , AlignBottom = 0x0040 , AlignVCenter = 0x0080 , AlignBaseline = 0x0100 ,
  AlignCenter = AlignVCenter | AlignHCenter
}
 
enum  FocusPolicyType {
  eNoFocus = 0 , eTabFocus = 0x1 , eClickFocus = 0x2 , eStrongFocus = eTabFocus | eClickFocus | 0x8 ,
  eWheelFocus = eStrongFocus | 0x4 , eKeyboardOnSetfocus = 0x10
}
 
enum  UIWidthSizePolicy {
  eExpanding = -1 , eXS = 0 , eS , eM ,
  eL , eXL
}
 
enum  UIScrollBarPolicy { eScrollBarAsNeeded = 0 , eScrollBarAlwaysOff , eScrollBarAlwaysOn }
 

Public Member Functions

 CFxUIToolButton ()
 
 ~CFxUIToolButton ()
 
void setText (const CFxUIString &text)
 
CFxUIString text () const
 
void setResourceIcon (const CFxUIString &resourceIcon)
 
void setIconSize (const CFxUISize &size)
 
CFxUISize iconSize () const
 
void setIcon (const CFxUIIcon &icon)
 
CFxUIIcon icon () const
 
void setTextAlignment (TextAlignment iAlignment)
 
void setBoldText (bool bBold)
 
void setCheckable (const bool bCheckable)
 
void setChecked (bool bChecked)
 
bool isChecked () const
 
void setElideTextEnabled (const bool bEnableElideText)
 
void setMenu (CFxUIMenu *pMenu)
 
void setMenuArrowVisible (bool bVisible)
 
void setToolButtonStyle (UIToolButtonStyle iStyle)
 
CFxUIToolButton::UIToolButtonStyle toolButtonStyle ()
 
CFxUISignal< void(bool)> & clicked ()
 
CFxUISignal< void(bool)> & toggled ()
 
CFxUISignal< void(int, int) > & keyWentDown ()
 
- Public Member Functions inherited from CFxUIBaseView
 CFxUIBaseView ()
 
virtual ~CFxUIBaseView ()
 
void setDisabled (bool on)
 
void setEnabled (bool on)
 
bool isEnabled () const
 
CFxUIPalette::FxUIColorRole backgroundRole ()
 
void setPalette (const CFxUIPalette &)
 
const CFxUIPalettepalette () const
 
bool isVisible ()
 
void setVisible (bool bVisible)
 
bool isHidden ()
 
void setHidden (bool bHidden)
 
bool hasFocus () const
 
void setFocus ()
 
void setFocus (int iReason)
 
void setFocusPolicy (int iPolicy)
 
int width ()
 
void setWidth (int w)
 
int height ()
 
void setHeight (int h)
 
void update ()
 
void setBusyState (bool bBusy=false)
 
void resize (int w, int h)
 
void setCornerRadius (float radius)
 
void setBorderWidth (float width)
 
void setBorderWidth (float left, float top, float right, float bottom)
 
void setBorderColor (int r, int g, int b)
 
virtual void showEvent (CFxUIShowEvent *event)
 
virtual void hideEvent (CFxUIHideEvent *event)
 
virtual void paintEvent (CFxUIPaintEvent *event)
 
virtual void resizeEvent (CFxUIResizeEvent *event)
 
virtual void focusInEvent (CFxUIFocusEvent *focusInEvent)
 
virtual void focusOutEvent (CFxUIFocusEvent *focusOutEvent)
 
virtual void mousePressEvent (CFxUIMouseEvent *mouseEvent)
 
void setEventAccepted (bool bAccepted=false)
 
void setEventRejected (bool bRejected=false)
 
void addView (CFxUIBaseView *pChild, float fWeight=0.0)
 
void insertView (CFxUIBaseView *pChild, int index=0, float fWeight=0.0)
 
int indexOf (CFxUIBaseView *pChild)
 
void removeView (CFxUIBaseView *pChild)
 
void setPreferableSize (int w, int h)
 
void setMinimumWidth (int iWidth)
 
void setMinimumHeight (int iHeight)
 
void setMinimumSize (const CFxUISize &size)
 
void setMaximumWidth (int iWidth)
 
void setMaximumHeight (int iHeight)
 
void setMaximumSize (const CFxUISize &size)
 
int minimumWidth ()
 
int minimumHeight ()
 
int maximumWidth ()
 
int maximumHeight ()
 
void setToolTip (const CFxUIString &sToolTip)
 
const CFxUIString toolTip ()
 
bool underMouse ()
 
void setMask (const CFxUIRegion &region)
 
void move (const CFxUIPoint &pos)
 
CFxUISize sizeHint () const
 
CFxUIPoint mapToGlobal (const CFxUIPoint &pos)
 
void setMargin (int left, int top, int right, int bottom)
 
void setParentWidget (CFxUIBaseView *pParent)
 
float getViewOpacity () const
 
void setViewOpacity (const float &opacity)
 
CFxUISignal< void(void)> & aboutToPassEventToParent ()
 
CFxUISignal< void(void)> & aboutToShow ()
 
CFxUISignal< void(void)> & hoverEnter ()
 
CFxUISignal< void(void)> & hoverLeave ()
 
CFxUISignal< void(bool)> & visibilityChanged ()
 
- Public Member Functions inherited from CFxUIObject
 CFxUIObject ()
 
virtual ~CFxUIObject ()
 
FxNativeHandle getHandle () const
 
void setHandle (FxNativeHandle handle)
 
void setParent (CFxUIObject *parent)
 
CFxUIObjectparent ()
 
const CFxUIObjectparent () const
 
void setObjectName (const CFxUIString &objectName)
 
CFxUIString objectName () const
 
bool setProperty (const char *name, const CFxUIVariant &value)
 
CFxUIVariant property (const char *name)
 
CFxUIList< CFxUIObject * > children () const
 
template<typename T>
CFxUIList< T > findChildren (const CFxUIString &name=CFxUIString())
 
void blockSignals (bool block)
 
bool signalsBlocked () const
 

Additional Inherited Members

- Static Public Member Functions inherited from CFxUIBaseView
static void setTabOrder (CFxUIObject *first, CFxUIObject *second)
 
- Protected Member Functions inherited from CFxUIObject
CFxUIObjectsender ()
 
- Protected Attributes inherited from CFxUIObject
CFxUIObjectImpl * m_pImpl
 
CFxUIObjectData * m_pData
 

Detailed Description

Definition at line 31 of file FxUIToolButton.h.

Member Enumeration Documentation

◆ UIToolButtonStyle

This enum type defines the Tool Button Style.

Enumerator
eIconOnly 

This enum displays icon only.

eTextOnly 

This enum displays text only.

eTextBesideIcon 

This enum displays text beside icon.

eTextUnderIcon 

This enum displays text under icon.

eFollowStyle 

This enum follow the style.

Definition at line 37 of file FxUIToolButton.h.

Constructor & Destructor Documentation

◆ CFxUIToolButton()

CFxUIToolButton::CFxUIToolButton ( )

Constructor

◆ ~CFxUIToolButton()

CFxUIToolButton::~CFxUIToolButton ( )

Destructor

Member Function Documentation

◆ clicked()

CFxUISignal< void(bool)> & CFxUIToolButton::clicked ( )

Signal is emitted when the button pressed down then released while the mouse cursor is inside the box.

◆ icon()

CFxUIIcon CFxUIToolButton::icon ( ) const

Gets the icon.

Returns
the icon

◆ iconSize()

CFxUISize CFxUIToolButton::iconSize ( ) const

Gets the size of the icon.

Returns
the size of the icon

◆ isChecked()

bool CFxUIToolButton::isChecked ( ) const

Returns if button is checked.

Returns
true if button is checked, otherwise false.

◆ keyWentDown()

CFxUISignal< void(int, int) > & CFxUIToolButton::keyWentDown ( )

Signal is emitted whenever a key is pressed.

◆ setBoldText()

void CFxUIToolButton::setBoldText ( bool bBold)

Sets font of text in tool button as bold.

Parameters
bBoldIf parameter is true font is set to bold, otherwise not.

◆ setCheckable()

void CFxUIToolButton::setCheckable ( const bool bCheckable)

Set the control checkable.

By default, the control is not checkable.

Parameters
bCheckableInput

◆ setChecked()

void CFxUIToolButton::setChecked ( bool bChecked)

Set the button checked.

Only checkable controls can be checked.

Parameters
bCheckedThe button is set to checked only if the value of the parameter is true.

◆ setElideTextEnabled()

void CFxUIToolButton::setElideTextEnabled ( const bool bEnableElideText)

Enable or disable text elision.

By default, this property will be disabled.

Parameters
bEnableElideTextInput

◆ setIcon()

void CFxUIToolButton::setIcon ( const CFxUIIcon & icon)

Sets the icon.

Parameters
icon

◆ setIconSize()

void CFxUIToolButton::setIconSize ( const CFxUISize & size)

Sets the size of the icon.

Parameters
sizeThe icon is resized to the value passed in parameter.

◆ setMenu()

void CFxUIToolButton::setMenu ( CFxUIMenu * pMenu)

Sets the popup menu.

Parameters
pMenuPointer to the popup menu.

◆ setMenuArrowVisible()

void CFxUIToolButton::setMenuArrowVisible ( bool bVisible)

Sets whether the menu arrow is visible.

Parameters
bShowthe menu arrow is visible if this parameter is true, otherwise it's hidden.

◆ setResourceIcon()

void CFxUIToolButton::setResourceIcon ( const CFxUIString & resourceIcon)

Sets the icon.

Parameters
resourceIconThe resource path is passed in parameter.

◆ setText()

void CFxUIToolButton::setText ( const CFxUIString & text)

Sets the text.

Parameters
textInput

◆ setTextAlignment()

void CFxUIToolButton::setTextAlignment ( TextAlignment iAlignment)

Sets alignment of text on tool button.

Parameters
iAlignmentThe value is to be from enums defined in TextAlignment.

◆ setToolButtonStyle()

void CFxUIToolButton::setToolButtonStyle ( UIToolButtonStyle iStyle)

Sets style on tool button.

Parameters
iStyleThe value is to be from enums defined in ToolButtonStyle.

◆ text()

CFxUIString CFxUIToolButton::text ( ) const

Returns the text.

Returns
string

◆ toggled()

CFxUISignal< void(bool)> & CFxUIToolButton::toggled ( )

Signal is emitted when the button is toggled. This signal is emitted only for buttons which are checkable.

◆ toolButtonStyle()

CFxUIToolButton::UIToolButtonStyle CFxUIToolButton::toolButtonStyle ( )

Returns the style.

Returns
tool button style

The documentation for this class was generated from the following file: