#include <iWidget.h>
Inherited by igor::iDialog, igor::iUserControl, igor::iWidgetBoxLayout, igor::iWidgetButton, igor::iWidgetCheckBox, igor::iWidgetColor, igor::iWidgetColorGradient, igor::iWidgetDockingLayout, igor::iWidgetFixedGridLayout, igor::iWidgetGraph, igor::iWidgetGridLayout, igor::iWidgetGroupBox, igor::iWidgetLabel, igor::iWidgetLineTextEdit, igor::iWidgetMenu, igor::iWidgetMenuBar, igor::iWidgetNumberChooser, igor::iWidgetPicture, igor::iWidgetScroll, igor::iWidgetSelectBox, igor::iWidgetSlider, igor::iWidgetSpacer, igor::iWidgetSplitter, igor::iWidgetTextEdit, and igor::iWidgetViewport.
GUI widget base class
coordinate systems origin within widgets is the upper left corner with x positive to the right and y positive down
◆ iWidget()
initializes members
- Parameters
-
parent | the optional parent |
◆ ~iWidget()
igor::iWidget::~iWidget |
( |
| ) |
|
|
protectedvirtual |
◆ addWidget()
void igor::iWidget::addWidget |
( |
iWidgetPtr |
widget | ) |
|
|
virtual |
◆ blockEvents()
void igor::iWidget::blockEvents |
( |
| ) |
|
|
virtual |
◆ calcChildOffsets()
void igor::iWidget::calcChildOffsets |
( |
std::vector< iaRectanglef > & |
offsets | ) |
|
|
protectedvirtual |
calculates childrens offsets relative to their parent
Needs to be implemented for widgets with multiple children
- Parameters
-
[out] | offsets | vector to be filled with childrens offsets |
◆ calcMinSize()
void igor::iWidget::calcMinSize |
( |
| ) |
|
|
protectedvirtual |
◆ clear()
void igor::iWidget::clear |
( |
| ) |
|
|
virtual |
◆ clearChildren()
void igor::iWidget::clearChildren |
( |
| ) |
|
|
protected |
removes and deletes all children
this will also cause all children deleting their children and so on
◆ clearSelection()
void igor::iWidget::clearSelection |
( |
| ) |
|
clear selection of children
◆ draw()
void igor::iWidget::draw |
( |
| ) |
|
|
virtual |
◆ drawOverlay()
void igor::iWidget::drawOverlay |
( |
| ) |
|
|
virtual |
draws overlay of the widget
Called after all widgets are drawn Only called if widget has overlay enabled
◆ getAcceptOutOfBoundsClicks()
bool igor::iWidget::getAcceptOutOfBoundsClicks |
( |
| ) |
const |
- Returns
- true if out of bound mouse clicks will be handeled
◆ getActualClientRect()
- Returns
- actual client rectangle (absolute and in pixel)
◆ getActualHeight()
int32 igor::iWidget::getActualHeight |
( |
| ) |
const |
◆ getActualPos()
- Returns
- actual absolute position
◆ getActualPosX()
int32 igor::iWidget::getActualPosX |
( |
| ) |
const |
- Returns
- actual absolute horizontal position
◆ getActualPosY()
int32 igor::iWidget::getActualPosY |
( |
| ) |
const |
- Returns
- actual absolute vertical position
◆ getActualRect()
- Returns
- actual rectangle (absolute and in pixel)
◆ getActualWidth()
int32 igor::iWidget::getActualWidth |
( |
| ) |
const |
◆ getBackground()
const iaColor4f & igor::iWidget::getBackground |
( |
| ) |
const |
- Returns
- the background color
◆ getChangeEvent()
iChangeEvent & igor::iWidget::getChangeEvent |
( |
| ) |
|
◆ getChildren()
const std::vector< iWidgetPtr > & igor::iWidget::getChildren |
( |
| ) |
const |
- Returns
- children of this widget
◆ getClickEvent()
iClickEvent & igor::iWidget::getClickEvent |
( |
| ) |
|
◆ getConfiguredMinHeight()
int32 igor::iWidget::getConfiguredMinHeight |
( |
| ) |
const |
- Returns
- configured minimum height
◆ getConfiguredMinWidth()
int32 igor::iWidget::getConfiguredMinWidth |
( |
| ) |
const |
- Returns
- configured minimum width
◆ getContextMenuEvent()
iContextMenuEvent & igor::iWidget::getContextMenuEvent |
( |
| ) |
|
- Returns
- context menu event
◆ getDoubleClickEvent()
iDoubleClickEvent & igor::iWidget::getDoubleClickEvent |
( |
| ) |
|
- Returns
- double click event
◆ getFocusEvent()
iFocusEvent & igor::iWidget::getFocusEvent |
( |
| ) |
|
◆ getForeground()
const iaColor4f & igor::iWidget::getForeground |
( |
| ) |
const |
- Returns
- the foreground color
◆ getHorizontalAlignment()
- Returns
- horizontal alignment relative to parent widget
◆ getID()
uint64 igor::iWidget::getID |
( |
| ) |
const |
◆ getInfo()
iaString igor::iWidget::getInfo |
( |
| ) |
const |
- Returns
- an information string about this widget
◆ getKeyboardFocusWidget()
iWidgetPtr igor::iWidget::getKeyboardFocusWidget |
( |
| ) |
|
|
static |
- Returns
- the widget that is currently in focus
◆ getLastMousePos()
const iaVector2f & igor::iWidget::getLastMousePos |
( |
| ) |
const |
|
protected |
- Returns
- last mouse position
◆ getMinHeight()
int32 igor::iWidget::getMinHeight |
( |
| ) |
const |
- Returns
- actual minimum height
this can vary based on min size of it's children
◆ getMinWidth()
int32 igor::iWidget::getMinWidth |
( |
| ) |
const |
- Returns
- actual minimum width
this can vary based on min size of it's children
◆ getMouseOffClickEvent()
iMouseOffClickEvent & igor::iWidget::getMouseOffClickEvent |
( |
| ) |
|
- Returns
- mouse off click event
◆ getMouseOffEvent()
iMouseOffEvent & igor::iWidget::getMouseOffEvent |
( |
| ) |
|
◆ getMouseOverEvent()
iMouseOverEvent & igor::iWidget::getMouseOverEvent |
( |
| ) |
|
◆ getParent()
◆ getParentID()
iWidgetID igor::iWidget::getParentID |
( |
| ) |
const |
- Returns
- id of parenting widget
◆ getRelativePosX()
int32 igor::iWidget::getRelativePosX |
( |
| ) |
const |
- Returns
- actual relative to it's parent horizontal position
◆ getRelativePosY()
int32 igor::iWidget::getRelativePosY |
( |
| ) |
const |
- Returns
- actual relative to it's parent vertical position
◆ getRoot()
- Returns
- the root widget which owns this widget
returns nullptr if there is no parent
◆ getScale()
static IGOR_INLINE float32 igor::iWidget::getScale |
( |
| ) |
|
|
inlinestatic |
- Returns
- system wide UI scale
◆ getSelection()
const std::vector< iWidgetPtr > igor::iWidget::getSelection |
( |
| ) |
const |
- Returns
- list of selected child widgets
◆ getSelectionChangedEvent()
iSelectionChangedEvent & igor::iWidget::getSelectionChangedEvent |
( |
| ) |
|
- Returns
- selection changed events
◆ getState()
- Returns
- current interaction state of widget
◆ getTooltip()
iaString igor::iWidget::getTooltip |
( |
| ) |
const |
◆ getUserData()
std::any igor::iWidget::getUserData |
( |
| ) |
const |
- Returns
- pointer to user data
◆ getVerticalAlignment()
- Returns
- vertical alignment relative to parent widget
◆ getWheelDownEvent()
iWheelDownEvent & igor::iWidget::getWheelDownEvent |
( |
| ) |
|
◆ getWheelUpEvent()
iWheelUpEvent & igor::iWidget::getWheelUpEvent |
( |
| ) |
|
◆ getWidgetKind()
◆ getWidgetType()
◆ getZValue()
uint32 igor::iWidget::getZValue |
( |
| ) |
const |
- Returns
- the z value of this widget
0 is furthest in the front
◆ hasKeyboardFocus()
bool igor::iWidget::hasKeyboardFocus |
( |
| ) |
const |
- Returns
- true if widget has keyboard focus
◆ hasParent()
bool igor::iWidget::hasParent |
( |
| ) |
const |
- Returns
- true if has parent
◆ isAcceptingDrag()
bool igor::iWidget::isAcceptingDrag |
( |
| ) |
|
- Returns
- true if widget accepts to be dragged
◆ isAcceptingDrop()
bool igor::iWidget::isAcceptingDrop |
( |
| ) |
|
- Returns
- true: widget accepts drop from drag; false: it does not accept drop
◆ isBlocked()
bool igor::iWidget::isBlocked |
( |
| ) |
const |
- Returns
- true if events on this widget are blocked
◆ isEnabled()
bool igor::iWidget::isEnabled |
( |
| ) |
const |
◆ isGrowingByContent()
bool igor::iWidget::isGrowingByContent |
( |
| ) |
const |
- Returns
- if the widget grows by content
◆ isIgnoringChildEventConsumption()
bool igor::iWidget::isIgnoringChildEventConsumption |
( |
| ) |
const |
- Returns
- true if this widget ignores if a child already has consumed an event
◆ isMouseOver()
bool igor::iWidget::isMouseOver |
( |
| ) |
|
- Returns
- true if mouse over widget
◆ isMultiSelectionEnabled()
bool igor::iWidget::isMultiSelectionEnabled |
( |
| ) |
const |
- Returns
- true if multi selection of children is enabled
◆ isOverlayEnabled()
bool igor::iWidget::isOverlayEnabled |
( |
| ) |
const |
- Returns
- true if overlay is enabled for this widget
◆ isSelectable()
bool igor::iWidget::isSelectable |
( |
| ) |
const |
- Returns
- true if selectable
◆ isSelected()
bool igor::iWidget::isSelected |
( |
| ) |
const |
- Returns
- true if widget is selected
◆ isVisible()
bool igor::iWidget::isVisible |
( |
| ) |
const |
◆ onASCII()
◆ onDrag()
void igor::iWidget::onDrag |
( |
| ) |
|
|
protectedvirtual |
◆ onDragEnter()
void igor::iWidget::onDragEnter |
( |
iDrag & |
drag | ) |
|
|
protectedvirtual |
drag enter handle
- Parameters
-
◆ onDragLeave()
void igor::iWidget::onDragLeave |
( |
iDrag & |
drag | ) |
|
|
protectedvirtual |
drag leave handle
- Parameters
-
◆ onDragMove()
void igor::iWidget::onDragMove |
( |
iDrag & |
drag, |
|
|
const iaVector2f & |
mousePos |
|
) |
| |
|
protectedvirtual |
drag move handle
- Parameters
-
drag | the drag data |
mousePos | the current mouse pos |
◆ onDrop()
void igor::iWidget::onDrop |
( |
const iDrag & |
drag, |
|
|
const iaVector2f & |
mousePos |
|
) |
| |
|
protectedvirtual |
drop handle
- Parameters
-
drag | the drag data |
mousePos | the current mouse pos |
◆ onEvent()
bool igor::iWidget::onEvent |
( |
iEvent & |
event | ) |
|
|
protectedvirtual |
handles incoming generic event
the only place where an entity can directly consume an event
- Parameters
-
◆ onGainedKeyboardFocus()
void igor::iWidget::onGainedKeyboardFocus |
( |
| ) |
|
|
protectedvirtual |
◆ onKeyDown()
◆ onKeyUp()
bool igor::iWidget::onKeyUp |
( |
const iEventKeyUp & |
event | ) |
|
|
protectedvirtual |
◆ onLostKeyboardFocus()
void igor::iWidget::onLostKeyboardFocus |
( |
| ) |
|
|
protectedvirtual |
◆ onMouseDoubleClick()
handles incoming double click
- Parameters
-
event | the mouse double click event |
- Returns
- true: if event was consumed and therefore ignored by the parent
◆ onMouseKeyDown()
handles incoming mouse key down events
- Parameters
-
event | mouse key down event |
- Returns
- true: if event was consumed and therefore ignored by the parent
Reimplemented in igor::iDialog.
◆ onMouseKeyUp()
handles mouse key up events
- Parameters
-
event | the mouse key up event |
- Returns
- true: if event was consumed and therefore ignored by the parent
Reimplemented in igor::iDialog, and igor::iWidgetCheckBox.
◆ onMouseMove()
handles incoming mouse move events
- Parameters
-
event | mouse move event |
consumed | if true mouse move was already consumed |
Reimplemented in igor::iDialog.
◆ onMouseWheel()
handles incoming mouse wheel event
- Parameters
-
- Returns
- true: if event was consumed and therefore ignored by the parent
◆ onRefresh()
void igor::iWidget::onRefresh |
( |
| ) |
|
|
protectedvirtual |
called when widget was queued for refresh in last frame
◆ refresh()
void igor::iWidget::refresh |
( |
| ) |
|
queue this widget for refresh in next frame
◆ removeWidget()
void igor::iWidget::removeWidget |
( |
iWidgetPtr |
widget | ) |
|
|
virtual |
◆ resetKeyboardFocus()
void igor::iWidget::resetKeyboardFocus |
( |
| ) |
|
|
protected |
resets the keyboard focus
◆ setAcceptDrag()
void igor::iWidget::setAcceptDrag |
( |
bool |
acceptDrag | ) |
|
sets the drag accept flag
- Parameters
-
acceptDrag | if true widget accepts drag |
◆ setAcceptDrop()
void igor::iWidget::setAcceptDrop |
( |
bool |
acceptDrop | ) |
|
sets the drop accept flag
- Parameters
-
acceptDrop | if true widget accepts drop from drag |
◆ setAcceptOutOfBoundsClicks()
void igor::iWidget::setAcceptOutOfBoundsClicks |
( |
bool |
acceptOutOfBoundsClick = true | ) |
|
sets if the widget accepts mouse clicks outside of the widget's area
- Parameters
-
acceptOutOfBoundsClick | if true mouse clicks outside will result in iMouseOffClickEvent |
◆ setBackground()
void igor::iWidget::setBackground |
( |
const iaColor4f & |
color | ) |
|
sets background color
- Parameters
-
color | the new background color |
◆ setClientArea()
sets client area. it's something like a padding but the parent defines it
- Parameters
-
left | left client area border |
right | right client area border |
top | top client area border |
bottom | bottom client area border |
◆ setCursor()
sets cursor type
- Parameters
-
cursorType | the cursor type to set |
◆ setEnabled()
void igor::iWidget::setEnabled |
( |
bool |
enabled = true | ) |
|
set widget enabled
- Parameters
-
enabled | if true widget is enabled |
◆ setForeground()
void igor::iWidget::setForeground |
( |
const iaColor4f & |
color | ) |
|
sets foreground color
- Parameters
-
color | the new foreground color |
◆ setGrowingByContent()
void igor::iWidget::setGrowingByContent |
( |
bool |
grow = true | ) |
|
sets the grow by content flag
- Parameters
-
grow | if true the widget will grow if it's content is bigger than the configured size |
◆ setHorizontalAlignment()
set horizontal alignment relative to parent widget
- Parameters
-
horizontalAlignment | the horizontal alignment |
◆ setIgnoreChildEventConsumption()
void igor::iWidget::setIgnoreChildEventConsumption |
( |
bool |
value = true | ) |
|
sets wether or not this widget ignores if a child already consumed an event
- Parameters
-
value | if true this widget ignores if a child already has consumed an event |
◆ setKeyboardFocus()
void igor::iWidget::setKeyboardFocus |
( |
| ) |
|
|
protected |
sets the keyboard focus to this widget
◆ setMinHeight()
void igor::iWidget::setMinHeight |
( |
int32 |
height | ) |
|
sets the configured minimum height
- Parameters
-
height | the minimum height defined |
◆ setMinSize()
void igor::iWidget::setMinSize |
( |
int32 |
width, |
|
|
int32 |
height |
|
) |
| |
sets minimum width and height of the widget
- Parameters
-
width | the minimum width defined |
height | the minimum height defined |
◆ setMinWidth()
void igor::iWidget::setMinWidth |
( |
int32 |
width | ) |
|
sets the configured minimum width
- Parameters
-
width | the minimum width defined |
◆ setMultiSelection()
void igor::iWidget::setMultiSelection |
( |
bool |
enabled | ) |
|
sets multi selection for children
- Parameters
-
enabled | if true multiple children can be selected at the same time |
◆ setOverlayEnabled()
void igor::iWidget::setOverlayEnabled |
( |
bool |
overlay | ) |
|
if true this widget will additionally be called during overlay processing
Overlay means that after all widgets are processed/drawn there is a second round of processing/drawing. This can be used to handle mouse inputs when the widget is not visible. Or to draw on top of widgets that are in front of this widget.
- Parameters
-
overlay | if true widget is part of overlay |
◆ setParent()
void igor::iWidget::setParent |
( |
iWidgetPtr |
parent | ) |
|
|
protected |
set/reset parent of widget
- Parameters
-
parent | pointer to parent. if set to nullptr caller must retain ownership |
◆ setSelect()
void igor::iWidget::setSelect |
( |
bool |
select | ) |
|
selects or unselects widget
◆ setSelectable()
void igor::iWidget::setSelectable |
( |
bool |
selectable | ) |
|
sets widget selectable
- Parameters
-
selectable | if true widget is selectable |
◆ setSelection()
void igor::iWidget::setSelection |
( |
const std::vector< iWidgetPtr > & |
selection | ) |
|
sets selected children
- Parameters
-
selection | list of children to select |
◆ setTooltip()
void igor::iWidget::setTooltip |
( |
const iaString & |
text | ) |
|
sets the tooltip text
- Parameters
-
◆ setUserData()
void igor::iWidget::setUserData |
( |
const std::any & |
userData | ) |
|
sets user data
- Parameters
-
userData | pointer to user data |
◆ setVerticalAlignment()
set vertical alignment relative to parent widget
- Parameters
-
verticalAlignment | the horizontal vertical |
◆ setVisible()
void igor::iWidget::setVisible |
( |
bool |
visible = true | ) |
|
set widget visible
\parma visible boolean to set is visible or invisible
◆ setZValue()
void igor::iWidget::setZValue |
( |
uint32 |
zvalue | ) |
|
sets the z value which determines the render order of siblings
0 is furthest in the front
- Parameters
-
◆ unblockEvents()
void igor::iWidget::unblockEvents |
( |
| ) |
|
|
virtual |
◆ updateAlignment()
void igor::iWidget::updateAlignment |
( |
int32 |
clientWidth, |
|
|
int32 |
clientHeight |
|
) |
| |
|
protectedvirtual |
updates widget alignment
- Parameters
-
clientWidth | maximum width this widget can align to |
clientHeight | maximum height this widget can align to |
◆ updateMinSize()
void igor::iWidget::updateMinSize |
( |
int32 |
width, |
|
|
int32 |
height |
|
) |
| |
|
protected |
sets the widget's min size
◆ iDialog
◆ iWidgetCheckBox
◆ iWidgetGridLayout
◆ iWidgetGroupBox
◆ iWidgetLineTextEdit
◆ iWidgetManager
◆ iWidgetNumberChooser
◆ iWidgetPicture
◆ iWidgetScroll
◆ iWidgetSlider
◆ iWidgetSplitter
◆ iWidgetTextEdit
◆ _acceptDrag
bool igor::iWidget::_acceptDrag = false |
|
protected |
if true widget accepts to be dragged
◆ _acceptDrop
bool igor::iWidget::_acceptDrop = false |
|
protected |
flag if widget accepts drop
◆ _acceptOutOfBoundsClicks
bool igor::iWidget::_acceptOutOfBoundsClicks = false |
|
protected |
if true this widget will process mouse clicks outside of the widgets boundings
◆ _blockedEvents
bool igor::iWidget::_blockedEvents = false |
|
protected |
if true events on this widget are blocked
◆ _change
iChangeEvent igor::iWidget::_change |
|
protected |
◆ _children
◆ _click
iClickEvent igor::iWidget::_click |
|
protected |
◆ _configuredMinHeight
int32 igor::iWidget::_configuredMinHeight = 0 |
|
protected |
configured height of the widget
◆ _configuredMinWidth
int32 igor::iWidget::_configuredMinWidth = 0 |
|
protected |
configured width of the widget
◆ _contextMenu
iContextMenuEvent igor::iWidget::_contextMenu |
|
protected |
◆ _doubleClick
iDoubleClickEvent igor::iWidget::_doubleClick |
|
protected |
◆ _focus
iFocusEvent igor::iWidget::_focus |
|
protected |
◆ _ignoreChildEventConsumption
bool igor::iWidget::_ignoreChildEventConsumption = false |
|
protected |
if true this widget ignores if a child already has consumed an event
◆ _initTooltip
bool igor::iWidget::_initTooltip = false |
|
protected |
◆ _isMouseOver
bool igor::iWidget::_isMouseOver = false |
|
protected |
true: if currently mouse is over widget
◆ _isMultiSelectionEnabled
bool igor::iWidget::_isMultiSelectionEnabled = false |
|
protected |
if true multi selection is enabled
◆ _isSelectable
bool igor::iWidget::_isSelectable = false |
|
protected |
if true widget is selectable
◆ _lastMousePos
◆ _lastMousePressPos
mouse position when last time pressed
◆ _mouseOff
iMouseOffEvent igor::iWidget::_mouseOff |
|
protected |
◆ _mouseOffClick
iMouseOffClickEvent igor::iWidget::_mouseOffClick |
|
protected |
◆ _mouseOver
iMouseOverEvent igor::iWidget::_mouseOver |
|
protected |
◆ _needRefresh
bool igor::iWidget::_needRefresh = true |
|
protected |
if true widget will be refreshed next frame
◆ _reactOnMouseWheel
bool igor::iWidget::_reactOnMouseWheel = true |
|
protected |
if true widget will react on mouse wheel
◆ _selected
bool igor::iWidget::_selected = false |
|
protected |
if true widget is selected
◆ _selectionChanged
iSelectionChangedEvent igor::iWidget::_selectionChanged |
|
protected |
◆ _tooltip
◆ _tooltipPos
position for the tooltip to appear
◆ _tooltipTime
◆ _wheelDown
iWheelDownEvent igor::iWidget::_wheelDown |
|
protected |
◆ _wheelUp
iWheelUpEvent igor::iWidget::_wheelUp |
|
protected |
◆ _zValue
uint32 igor::iWidget::_zValue = 0 |
|
protected |
◆ INVALID_WIDGET_ID
const iWidgetID igor::iWidget::INVALID_WIDGET_ID = 0 |
|
static |
The documentation for this class was generated from the following files:
- /home/martin/dev/Igor/src/igor/igor/ui/widgets/iWidget.h
- /home/martin/dev/Igor/src/igor/igor/ui/widgets/iWidget.cpp