0.44.0
|
#include <iWidgetButton.h>
Inherits igor::iWidget.
Public Member Functions | |
iWidgetButton (const iWidgetPtr parent=nullptr) | |
virtual | ~iWidgetButton () |
void | setAction (const iActionPtr action, const iActionContextPtr context=nullptr) |
void | setAction (const iaString &actionName, const iActionContextPtr context) |
iActionPtr | getAction () const |
iActionContextPtr | getActionContext () const |
void | setText (const iaString &text) |
const iaString & | getText () const |
void | setHorizontalTextAlignment (iHorizontalAlignment align) |
iHorizontalAlignment | getHorizontalTextAlignment () const |
void | setVerticalTextAlignment (iVerticalAlignment valign) |
iVerticalAlignment | getVerticalTextAlignment () const |
void | setTexture (const iaString &textureAlias) |
void | setTexture (iTexturePtr texture) |
void | setIcon (const iaString &iconAlias) |
void | setIcon (iTexturePtr texture) |
void | setCheckable (bool checkable) |
bool | isCheckable () const |
void | setChecked (bool check) |
bool | isChecked () const |
Public Member Functions inherited from igor::iWidget | |
iWidgetType | getWidgetType () const |
iWidgetKind | getWidgetKind () const |
void | setZValue (uint32 zvalue) |
uint32 | getZValue () const |
void | setBackground (const iaColor4f &color) |
const iaColor4f & | getBackground () const |
void | setForeground (const iaColor4f &color) |
const iaColor4f & | getForeground () const |
bool | isBlocked () const |
bool | hasKeyboardFocus () const |
iWidgetState | getState () const |
void | registerOnClickEvent (iClickDelegate clickDelegate) |
void | registerOnMouseOffClickEvent (iMouseOffClickDelegate clickDelegate) |
void | registerOnDoubleClickEvent (iDoubleClickDelegate doubleClickDelegate) |
void | registerOnMouseOverEvent (iMouseOverDelegate mouseOverDelegate) |
void | registerOnMouseOffEvent (iMouseOffDelegate mouseOffDelegate) |
void | registerOnChangeEvent (iChangeDelegate changeDelegate) |
void | registerOnFocusEvent (iFocusDelegate focusDelegate) |
void | registerOnWheelUpEvent (iWheelUpDelegate wheelUpDelegate) |
void | unregisterOnWheelUpEvent (iWheelUpDelegate wheelUpDelegate) |
void | registerOnWheelDownEvent (iWheelDownDelegate wheelDownDelegate) |
void | unregisterOnWheelDownEvent (iWheelDownDelegate wheelDownDelegate) |
void | unregisterOnClickEvent (iClickDelegate clickDelegate) |
void | unregisterOnMouseOffClickEvent (iMouseOffClickDelegate clickDelegate) |
void | unregisterOnDoubleClickEvent (iDoubleClickDelegate doubleClickDelegate) |
void | unregisterOnMouseOverEvent (iMouseOverDelegate mouseOverDelegate) |
void | unregisterOnMouseOffEvent (iMouseOffDelegate mouseOffDelegate) |
void | unregisterOnChangeEvent (iChangeDelegate changeDelegate) |
void | unregisterOnFocusEvent (iFocusDelegate focusDelegate) |
void | registerOnContextMenuEvent (iContextMenuDelegate contextMenuDelegate) |
void | unregisterOnContextMenuEvent (iContextMenuDelegate contextMenuDelegate) |
void | registerOnSelectionChangedEvent (iSelectionChangedDelegate delegate) |
void | unregisterOnSelectionChangedEvent (iSelectionChangedDelegate delegate) |
iaVector2f | getActualPos () const |
int32 | getActualPosX () const |
int32 | getActualPosY () const |
int32 | getActualWidth () const |
int32 | getActualHeight () const |
iaRectanglef | getActualRect () const |
int32 | getRelativePosX () const |
int32 | getRelativePosY () const |
int32 | getMinWidth () const |
int32 | getMinHeight () const |
int32 | getConfiguredMinWidth () const |
int32 | getConfiguredMinHeight () const |
void | setMinWidth (int32 width) |
void | setMinHeight (int32 height) |
void | setMinSize (int32 width, int32 height) |
void | setAcceptOutOfBoundsClicks (bool acceptOutOfBoundsClick=true) |
bool | getAcceptOutOfBoundsClicks () const |
iHorizontalAlignment | getHorizontalAlignment () const |
iVerticalAlignment | getVerticalAlignment () const |
void | setHorizontalAlignment (iHorizontalAlignment horizontalAlignment) |
void | setVerticalAlignment (iVerticalAlignment verticalAlignment) |
bool | isVisible () const |
bool | isEnabled () const |
void | setVisible (bool visible=true) |
void | setEnabled (bool enabled=true) |
iWidgetID | getID () const |
iWidgetID | getParentID () const |
iWidgetPtr | getParent () const |
bool | isMouseOver () |
void | setAcceptDrag (bool acceptDrag) |
bool | isAcceptingDrag () |
void | setAcceptDrop (bool acceptDrop) |
bool | isAcceptingDrop () |
bool | hasParent () const |
void | setGrowingByContent (bool grow=true) |
bool | isGrowingByContent () const |
iaString | getInfo () const |
void | setTooltip (const iaString &text) |
iaString | getTooltip () const |
const std::vector< iWidgetPtr > & | getChildren () const |
virtual void | clear () |
void | setIgnoreChildEventConsumption (bool value=true) |
bool | isIgnoringChildEventConsumption () const |
iWidgetPtr | getRoot () |
virtual void | blockEvents () |
virtual void | unblockEvents () |
void | setOverlayEnabled (bool overlay) |
bool | isOverlayEnabled () const |
virtual void | draw () |
virtual void | drawOverlay () |
virtual void | addWidget (iWidgetPtr widget) |
virtual void | removeWidget (iWidgetPtr widget) |
void | setCursor (iMouseCursorType cursorType) |
void | setUserData (const std::any &userData) |
std::any | getUserData () const |
void | setSelectable (bool selectable) |
bool | isSelectable () const |
void | setMultiSelection (bool enabled) |
bool | isMultiSelectionEnabled () const |
void | select () |
void | unselect () |
bool | isSelected () const |
void | clearSelection () |
const std::vector< iWidgetPtr > | getSelection () const |
void | setSelection (const std::vector< iWidgetPtr > &selection) |
Protected Member Functions | |
void | onInternalClick (const iWidgetPtr source) |
void | calcMinSize () override |
void | draw () override |
Protected Member Functions inherited from igor::iWidget | |
void | clearChildren () |
void | updateMinSize (int32 width, int32 height) |
void | setParent (iWidgetPtr parent) |
void | setKeyboardFocus () |
void | resetKeyboardFocus () |
void | setClientArea (int32 left, int32 right, int32 top, int32 bottom) |
const iaVector2f & | getLastMousePos () const |
iWidget (iWidgetType type, iWidgetKind kind, const iWidgetPtr parent=nullptr) | |
virtual | ~iWidget () |
virtual bool | onEvent (iEvent &event) |
virtual bool | onMouseWheel (iEventMouseWheel &event) |
virtual bool | onMouseKeyDown (iEventMouseKeyDown &event) |
virtual bool | onMouseDoubleClick (iEventMouseKeyDoubleClick &event) |
virtual bool | onMouseKeyUp (iEventMouseKeyUp &event) |
virtual void | onMouseMove (iEventMouseMove &event) |
virtual bool | onASCII (iEventKeyASCII &event) |
virtual bool | onKeyDown (iEventKeyDown &event) |
virtual bool | onKeyUp (iEventKeyUp &event) |
virtual void | onLostKeyboardFocus () |
virtual void | onGainedKeyboardFocus () |
virtual void | calcMinSize () |
virtual void | updateAlignment (int32 clientWidth, int32 clientHeight) |
virtual void | calcChildOffsets (std::vector< iaRectanglef > &offsets) |
virtual void | onDragEnter (iDrag &drag) |
virtual void | onDragMove (iDrag &drag, const iaVector2f &mousePos) |
virtual void | onDragLeave (iDrag &drag) |
virtual void | onDrop (const iDrag &drag) |
virtual void | onDrag () |
Additional Inherited Members | |
Static Public Member Functions inherited from igor::iWidget | |
static iWidgetPtr | getKeyboardFocusWidget () |
Static Public Attributes inherited from igor::iWidget | |
static const iWidgetID | INVALID_WIDGET_ID = 0 |
button widget
igor::iWidgetButton::iWidgetButton | ( | const iWidgetPtr | parent = nullptr | ) |
ctor initializes member variables
parent | the optional parent |
|
virtual |
release texture
|
overrideprotectedvirtual |
updates size based on it's content
Reimplemented from igor::iWidget.
|
overrideprotectedvirtual |
draws the widget
Reimplemented from igor::iWidget.
iActionPtr igor::iWidgetButton::getAction | ( | ) | const |
iActionContextPtr igor::iWidgetButton::getActionContext | ( | ) | const |
iHorizontalAlignment igor::iWidgetButton::getHorizontalTextAlignment | ( | ) | const |
const iaString & igor::iWidgetButton::getText | ( | ) | const |
iVerticalAlignment igor::iWidgetButton::getVerticalTextAlignment | ( | ) | const |
bool igor::iWidgetButton::isCheckable | ( | ) | const |
bool igor::iWidgetButton::isChecked | ( | ) | const |
|
protected |
internal click handler
void igor::iWidgetButton::setAction | ( | const iActionPtr | action, |
const iActionContextPtr | context = nullptr |
||
) |
sets the action this widget is associated with
action | the action to be set |
context | the optional action context |
void igor::iWidgetButton::setAction | ( | const iaString & | actionName, |
const iActionContextPtr | context | ||
) |
sets the action this widget is associated with by action name
actionName | the action to be set |
context | the optional action context |
void igor::iWidgetButton::setCheckable | ( | bool | checkable | ) |
sets the button checkable
checkable | if true button is checkable |
void igor::iWidgetButton::setChecked | ( | bool | check | ) |
sets button checked
check | if true button is checked |
void igor::iWidgetButton::setHorizontalTextAlignment | ( | iHorizontalAlignment | align | ) |
sets horizontal text alignment
align | the horizontal alignment of the text |
void igor::iWidgetButton::setIcon | ( | const iaString & | iconAlias | ) |
sets the icon texture by name
the icon is rendered in the foreground. if there is no text then centred if there is text then on the opposite side of the text
iconAlias | alias or id to icon texture |
void igor::iWidgetButton::setIcon | ( | iTexturePtr | texture | ) |
sets the icon texture
the icon is rendered in the foreground. if there is no text then centred if there is text then on the opposite side of the text
texture | the texture to use |
void igor::iWidgetButton::setText | ( | const iaString & | text | ) |
sets text of the widget
text | new text to set |
void igor::iWidgetButton::setTexture | ( | const iaString & | textureAlias | ) |
sets the background texture to use for the whole button by name
textureAlias | alias or id to texture |
void igor::iWidgetButton::setTexture | ( | iTexturePtr | texture | ) |
sets the background texture to use for the whole button
texture | the texture |
void igor::iWidgetButton::setVerticalTextAlignment | ( | iVerticalAlignment | valign | ) |
sets vertical text alignment
valign | the vertical alignment of the text |
|
protected |
the action
|
protected |
the action context
|
protected |
if true button is checkable
|
protected |
if true button is checked
|
protected |
the horizontal alignment
|
protected |
the icon texture
|
protected |
current text of the button
|
protected |
the background texture
|
protected |
the vertical alignment