igor::iWidget Class Reference

#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.

Public Member Functions

iWidgetType getWidgetType () const
 
iWidgetKind getWidgetKind () const
 
void setZValue (uint32 zvalue)
 
uint32 getZValue () const
 
void setBackground (const iaColor4f &color)
 
const iaColor4fgetBackground () const
 
void setForeground (const iaColor4f &color)
 
const iaColor4fgetForeground () const
 
bool isBlocked () const
 
bool hasKeyboardFocus () const
 
iWidgetState getState () const
 
iClickEvent & getClickEvent ()
 
iMouseOffClickEvent & getMouseOffClickEvent ()
 
iDoubleClickEvent & getDoubleClickEvent ()
 
iMouseOverEvent & getMouseOverEvent ()
 
iMouseOffEvent & getMouseOffEvent ()
 
iChangeEvent & getChangeEvent ()
 
iFocusEvent & getFocusEvent ()
 
iWheelUpEvent & getWheelUpEvent ()
 
iWheelDownEvent & getWheelDownEvent ()
 
iContextMenuEvent & getContextMenuEvent ()
 
iSelectionChangedEvent & getSelectionChangedEvent ()
 
iaVector2f getActualPos () const
 
int32 getActualPosX () const
 
int32 getActualPosY () const
 
int32 getActualWidth () const
 
int32 getActualHeight () const
 
iaRectanglef getActualRect () const
 
iaRectanglef getActualClientRect () 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 setSelect (bool select)
 
bool isSelected () const
 
void clearSelection ()
 
const std::vector< iWidgetPtrgetSelection () const
 
void setSelection (const std::vector< iWidgetPtr > &selection)
 
void refresh ()
 

Static Public Member Functions

static iWidgetPtr getKeyboardFocusWidget ()
 
static IGOR_INLINE float32 getScale ()
 

Static Public Attributes

static const iWidgetID INVALID_WIDGET_ID = 0
 

Protected Member Functions

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 iaVector2fgetLastMousePos () const
 
 iWidget (iWidgetType type, iWidgetKind kind, const iWidgetPtr parent=nullptr)
 
virtual ~iWidget ()
 
virtual bool onEvent (iEvent &event)
 
virtual bool onMouseWheel (const iEventMouseWheel &event)
 
virtual bool onMouseKeyDown (const iEventMouseKeyDown &event)
 
virtual bool onMouseDoubleClick (const iEventMouseKeyDoubleClick &event)
 
virtual bool onMouseKeyUp (const iEventMouseKeyUp &event)
 
virtual void onMouseMove (const iEventMouseMove &event)
 
virtual bool onASCII (const iEventKeyASCII &event)
 
virtual bool onKeyDown (const iEventKeyDown &event)
 
virtual bool onKeyUp (const 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, const iaVector2f &mousePos)
 
virtual void onDrag ()
 
virtual void onRefresh ()
 

Protected Attributes

bool _selected = false
 
bool _isSelectable = false
 
bool _isMultiSelectionEnabled = false
 
std::vector< iWidgetPtr_children
 
int32 _configuredMinWidth = 0
 
int32 _configuredMinHeight = 0
 
iClickEvent _click
 
iMouseOffClickEvent _mouseOffClick
 
iContextMenuEvent _contextMenu
 
iDoubleClickEvent _doubleClick
 
iMouseOverEvent _mouseOver
 
iMouseOffEvent _mouseOff
 
iChangeEvent _change
 
iFocusEvent _focus
 
iWheelUpEvent _wheelUp
 
iWheelDownEvent _wheelDown
 
iSelectionChangedEvent _selectionChanged
 
iaString _tooltip
 
iaVector2f _tooltipPos
 
iaTime _tooltipTime = iaTime(0)
 
bool _initTooltip = false
 
uint32 _zValue = 0
 
bool _reactOnMouseWheel = true
 
bool _blockedEvents = false
 
bool _acceptOutOfBoundsClicks = false
 
bool _acceptDrop = false
 
bool _acceptDrag = false
 
bool _isMouseOver = false
 
bool _ignoreChildEventConsumption = false
 
iaVector2f _lastMousePos
 
iaVector2f _lastMousePressPos
 
bool _needRefresh = true
 

Friends

class iWidgetManager
 
class iDialog
 
class iWidgetGridLayout
 
class iWidgetScroll
 
class iWidgetGroupBox
 
class iWidgetCheckBox
 
class iWidgetNumberChooser
 
class iWidgetPicture
 
class iWidgetLineTextEdit
 
class iWidgetTextEdit
 
class iWidgetSlider
 
class iWidgetSplitter
 

Detailed Description

GUI widget base class

coordinate systems origin within widgets is the upper left corner with x positive to the right and y positive down

Constructor & Destructor Documentation

◆ iWidget()

igor::iWidget::iWidget ( iWidgetType  type,
iWidgetKind  kind,
const iWidgetPtr  parent = nullptr 
)
protected

initializes members

Parameters
parentthe optional parent

◆ ~iWidget()

igor::iWidget::~iWidget ( )
protectedvirtual

clean up

Member Function Documentation

◆ addWidget()

void igor::iWidget::addWidget ( iWidgetPtr  widget)
virtual

adds a child widget to this widget

Parameters
widgetthe child widget to be added

Reimplemented in igor::iWidgetGridLayout, igor::iWidgetBoxLayout, igor::iWidgetDockingLayout, igor::iWidgetScroll, and igor::iWidgetSplitter.

◆ blockEvents()

void igor::iWidget::blockEvents ( )
virtual

blocks all outgoing events from this widget

Reimplemented in igor::iUserControlColor, and igor::iWidgetColorGradient.

◆ 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]offsetsvector to be filled with childrens offsets

◆ calcMinSize()

void igor::iWidget::calcMinSize ( )
protectedvirtual

updates size based on widgets content

all widgets have to derive from this

Reimplemented in igor::iUserControl, igor::iWidgetButton, and igor::iWidgetCheckBox.

◆ clear()

void igor::iWidget::clear ( )
virtual

clears the widget back to default

This can mean different things for different derivatives of iWidget

Reimplemented in igor::iWidgetGridLayout, igor::iWidgetSelectBox, igor::iDialogMenu, igor::iUserControlTreeView, and igor::iWidgetMenu.

◆ 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

draws the widget

Reimplemented in igor::iWidgetButton, igor::iWidgetCheckBox, and igor::iWidgetSpacer.

◆ 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()

iaRectanglef igor::iWidget::getActualClientRect ( ) const
Returns
actual client rectangle (absolute and in pixel)

◆ getActualHeight()

int32 igor::iWidget::getActualHeight ( ) const
Returns
actual height

◆ getActualPos()

iaVector2f igor::iWidget::getActualPos ( ) const
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()

iaRectanglef igor::iWidget::getActualRect ( ) const
Returns
actual rectangle (absolute and in pixel)

◆ getActualWidth()

int32 igor::iWidget::getActualWidth ( ) const
Returns
actual width

◆ getBackground()

const iaColor4f & igor::iWidget::getBackground ( ) const
Returns
the background color

◆ getChangeEvent()

iChangeEvent & igor::iWidget::getChangeEvent ( )
Returns
change event

◆ getChildren()

const std::vector< iWidgetPtr > & igor::iWidget::getChildren ( ) const
Returns
children of this widget

◆ getClickEvent()

iClickEvent & igor::iWidget::getClickEvent ( )
Returns
click event

◆ 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 ( )
Returns
focus event

◆ getForeground()

const iaColor4f & igor::iWidget::getForeground ( ) const
Returns
the foreground color

◆ getHorizontalAlignment()

iHorizontalAlignment igor::iWidget::getHorizontalAlignment ( ) const
Returns
horizontal alignment relative to parent widget

◆ getID()

uint64 igor::iWidget::getID ( ) const
Returns
id of widget

◆ 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 ( )
Returns
mouse off event

◆ getMouseOverEvent()

iMouseOverEvent & igor::iWidget::getMouseOverEvent ( )
Returns
mouse over event

◆ getParent()

iWidgetPtr igor::iWidget::getParent ( ) const
Returns
parenting widget

◆ 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()

iWidgetPtr igor::iWidget::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()

iWidgetState igor::iWidget::getState ( ) const
Returns
current interaction state of widget

◆ getTooltip()

iaString igor::iWidget::getTooltip ( ) const
Returns
tooltip text

◆ getUserData()

std::any igor::iWidget::getUserData ( ) const
Returns
pointer to user data

◆ getVerticalAlignment()

iVerticalAlignment igor::iWidget::getVerticalAlignment ( ) const
Returns
vertical alignment relative to parent widget

◆ getWheelDownEvent()

iWheelDownEvent & igor::iWidget::getWheelDownEvent ( )
Returns
wheel down event

◆ getWheelUpEvent()

iWheelUpEvent & igor::iWidget::getWheelUpEvent ( )
Returns
wheel up event

◆ getWidgetKind()

iWidgetKind igor::iWidget::getWidgetKind ( ) const
Returns
the widgets kind

◆ getWidgetType()

iWidgetType igor::iWidget::getWidgetType ( ) const
Returns
the widgets type

◆ 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
Returns
true if enabled

◆ 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
Returns
true if visible

◆ onASCII()

bool igor::iWidget::onASCII ( const iEventKeyASCII event)
protectedvirtual

handles incoming acsii codes from keyboard

Parameters
eventthe key ascii event

Reimplemented in igor::iWidgetLineTextEdit.

◆ onDrag()

void igor::iWidget::onDrag ( )
protectedvirtual

called when dragged

◆ onDragEnter()

void igor::iWidget::onDragEnter ( iDrag drag)
protectedvirtual

drag enter handle

Parameters
dragthe drag data

◆ onDragLeave()

void igor::iWidget::onDragLeave ( iDrag drag)
protectedvirtual

drag leave handle

Parameters
dragthe drag data

◆ onDragMove()

void igor::iWidget::onDragMove ( iDrag drag,
const iaVector2f mousePos 
)
protectedvirtual

drag move handle

Parameters
dragthe drag data
mousePosthe current mouse pos

◆ onDrop()

void igor::iWidget::onDrop ( const iDrag drag,
const iaVector2f mousePos 
)
protectedvirtual

drop handle

Parameters
dragthe drag data
mousePosthe 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
eventthe event

◆ onGainedKeyboardFocus()

void igor::iWidget::onGainedKeyboardFocus ( )
protectedvirtual

handles gained keyboard focus

Reimplemented in igor::iWidgetLineTextEdit.

◆ onKeyDown()

bool igor::iWidget::onKeyDown ( const iEventKeyDown event)
protectedvirtual

handles pressed key event

Parameters
eventthe key down event

Reimplemented in igor::iDialog, and igor::iWidgetLineTextEdit.

◆ onKeyUp()

bool igor::iWidget::onKeyUp ( const iEventKeyUp event)
protectedvirtual

handles released key event

Parameters
eventthe key up event

Reimplemented in igor::iWidgetLineTextEdit.

◆ onLostKeyboardFocus()

void igor::iWidget::onLostKeyboardFocus ( )
protectedvirtual

handles lost keyboard focus

Reimplemented in igor::iWidgetLineTextEdit.

◆ onMouseDoubleClick()

bool igor::iWidget::onMouseDoubleClick ( const iEventMouseKeyDoubleClick event)
protectedvirtual

handles incoming double click

Parameters
eventthe mouse double click event
Returns
true: if event was consumed and therefore ignored by the parent

◆ onMouseKeyDown()

bool igor::iWidget::onMouseKeyDown ( const iEventMouseKeyDown event)
protectedvirtual

handles incoming mouse key down events

Parameters
eventmouse key down event
Returns
true: if event was consumed and therefore ignored by the parent

Reimplemented in igor::iDialog.

◆ onMouseKeyUp()

bool igor::iWidget::onMouseKeyUp ( const iEventMouseKeyUp event)
protectedvirtual

handles mouse key up events

Parameters
eventthe mouse key up event
Returns
true: if event was consumed and therefore ignored by the parent

Reimplemented in igor::iDialog, and igor::iWidgetCheckBox.

◆ onMouseMove()

void igor::iWidget::onMouseMove ( const iEventMouseMove event)
protectedvirtual

handles incoming mouse move events

Parameters
eventmouse move event
consumedif true mouse move was already consumed

Reimplemented in igor::iDialog.

◆ onMouseWheel()

bool igor::iWidget::onMouseWheel ( const iEventMouseWheel event)
protectedvirtual

handles incoming mouse wheel event

Parameters
eventmouse wheel event
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

removes a child widget from this widget

Parameters
widgetthe child widget to be removed

Reimplemented in igor::iWidgetGridLayout, igor::iWidgetBoxLayout, and igor::iWidgetDockingLayout.

◆ resetKeyboardFocus()

void igor::iWidget::resetKeyboardFocus ( )
protected

resets the keyboard focus

◆ setAcceptDrag()

void igor::iWidget::setAcceptDrag ( bool  acceptDrag)

sets the drag accept flag

Parameters
acceptDragif true widget accepts drag

◆ setAcceptDrop()

void igor::iWidget::setAcceptDrop ( bool  acceptDrop)

sets the drop accept flag

Parameters
acceptDropif 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
acceptOutOfBoundsClickif true mouse clicks outside will result in iMouseOffClickEvent

◆ setBackground()

void igor::iWidget::setBackground ( const iaColor4f color)

sets background color

Parameters
colorthe new background color

◆ setClientArea()

void igor::iWidget::setClientArea ( int32  left,
int32  right,
int32  top,
int32  bottom 
)
protected

sets client area. it's something like a padding but the parent defines it

Parameters
leftleft client area border
rightright client area border
toptop client area border
bottombottom client area border

◆ setCursor()

void igor::iWidget::setCursor ( iMouseCursorType  cursorType)

sets cursor type

Parameters
cursorTypethe cursor type to set

◆ setEnabled()

void igor::iWidget::setEnabled ( bool  enabled = true)

set widget enabled

Parameters
enabledif true widget is enabled

◆ setForeground()

void igor::iWidget::setForeground ( const iaColor4f color)

sets foreground color

Parameters
colorthe new foreground color

◆ setGrowingByContent()

void igor::iWidget::setGrowingByContent ( bool  grow = true)

sets the grow by content flag

Parameters
growif true the widget will grow if it's content is bigger than the configured size

◆ setHorizontalAlignment()

void igor::iWidget::setHorizontalAlignment ( iHorizontalAlignment  horizontalAlignment)

set horizontal alignment relative to parent widget

Parameters
horizontalAlignmentthe 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
valueif 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
heightthe minimum height defined

◆ setMinSize()

void igor::iWidget::setMinSize ( int32  width,
int32  height 
)

sets minimum width and height of the widget

Parameters
widththe minimum width defined
heightthe minimum height defined

◆ setMinWidth()

void igor::iWidget::setMinWidth ( int32  width)

sets the configured minimum width

Parameters
widththe minimum width defined

◆ setMultiSelection()

void igor::iWidget::setMultiSelection ( bool  enabled)

sets multi selection for children

Parameters
enabledif 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
overlayif true widget is part of overlay

◆ setParent()

void igor::iWidget::setParent ( iWidgetPtr  parent)
protected

set/reset parent of widget

Parameters
parentpointer 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
selectableif true widget is selectable

◆ setSelection()

void igor::iWidget::setSelection ( const std::vector< iWidgetPtr > &  selection)

sets selected children

Parameters
selectionlist of children to select

◆ setTooltip()

void igor::iWidget::setTooltip ( const iaString text)

sets the tooltip text

Parameters
textthe tooltip text

◆ setUserData()

void igor::iWidget::setUserData ( const std::any &  userData)

sets user data

Parameters
userDatapointer to user data

◆ setVerticalAlignment()

void igor::iWidget::setVerticalAlignment ( iVerticalAlignment  verticalAlignment)

set vertical alignment relative to parent widget

Parameters
verticalAlignmentthe 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
zvaluethe z value to set

◆ unblockEvents()

void igor::iWidget::unblockEvents ( )
virtual

unblocks all outgoing events from this widget

Reimplemented in igor::iUserControlColor, and igor::iWidgetColorGradient.

◆ updateAlignment()

void igor::iWidget::updateAlignment ( int32  clientWidth,
int32  clientHeight 
)
protectedvirtual

updates widget alignment

Parameters
clientWidthmaximum width this widget can align to
clientHeightmaximum height this widget can align to

◆ updateMinSize()

void igor::iWidget::updateMinSize ( int32  width,
int32  height 
)
protected

sets the widget's min size

Friends And Related Function Documentation

◆ iDialog

friend class iDialog
friend

◆ iWidgetCheckBox

friend class iWidgetCheckBox
friend

◆ iWidgetGridLayout

friend class iWidgetGridLayout
friend

◆ iWidgetGroupBox

friend class iWidgetGroupBox
friend

◆ iWidgetLineTextEdit

friend class iWidgetLineTextEdit
friend

◆ iWidgetManager

friend class iWidgetManager
friend

◆ iWidgetNumberChooser

friend class iWidgetNumberChooser
friend

◆ iWidgetPicture

friend class iWidgetPicture
friend

◆ iWidgetScroll

friend class iWidgetScroll
friend

◆ iWidgetSlider

friend class iWidgetSlider
friend

◆ iWidgetSplitter

friend class iWidgetSplitter
friend

◆ iWidgetTextEdit

friend class iWidgetTextEdit
friend

Member Data Documentation

◆ _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

content changed event

◆ _children

std::vector<iWidgetPtr> igor::iWidget::_children
protected

list of children

◆ _click

iClickEvent igor::iWidget::_click
protected

click event

◆ _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

context menu event

◆ _doubleClick

iDoubleClickEvent igor::iWidget::_doubleClick
protected

double click event

◆ _focus

iFocusEvent igor::iWidget::_focus
protected

got keyboard focus event

◆ _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

trigger tooltip

◆ _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

iaVector2f igor::iWidget::_lastMousePos
protected

last mouse position

◆ _lastMousePressPos

iaVector2f igor::iWidget::_lastMousePressPos
protected

mouse position when last time pressed

◆ _mouseOff

iMouseOffEvent igor::iWidget::_mouseOff
protected

mouse off event

◆ _mouseOffClick

iMouseOffClickEvent igor::iWidget::_mouseOffClick
protected

mouse off click event

◆ _mouseOver

iMouseOverEvent igor::iWidget::_mouseOver
protected

mouse over event

◆ _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

selection changed event

◆ _tooltip

iaString igor::iWidget::_tooltip
protected

tooltip text

◆ _tooltipPos

iaVector2f igor::iWidget::_tooltipPos
protected

position for the tooltip to appear

◆ _tooltipTime

iaTime igor::iWidget::_tooltipTime = iaTime(0)
protected

tooltip timer

◆ _wheelDown

iWheelDownEvent igor::iWidget::_wheelDown
protected

wheel down event

◆ _wheelUp

iWheelUpEvent igor::iWidget::_wheelUp
protected

wheel up event

◆ _zValue

uint32 igor::iWidget::_zValue = 0
protected

z value of this widget

◆ INVALID_WIDGET_ID

const iWidgetID igor::iWidget::INVALID_WIDGET_ID = 0
static

invalid widget ID


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