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
 
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< iWidgetPtrgetSelection () const
 
void setSelection (const std::vector< iWidgetPtr > &selection)
 

Static Public Member Functions

static iWidgetPtr getKeyboardFocusWidget ()
 

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

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
 

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::iUserControlColorChooser, 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

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

◆ 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

◆ 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

◆ getChildren()

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

◆ getConfiguredMinHeight()

int32 igor::iWidget::getConfiguredMinHeight ( ) const
Returns
configured minimum height

◆ getConfiguredMinWidth()

int32 igor::iWidget::getConfiguredMinWidth ( ) const
Returns
configured minimum width

◆ 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

◆ 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

◆ getSelection()

const std::vector< iWidgetPtr > igor::iWidget::getSelection ( ) const
Returns
list of selected child widgets

◆ 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

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

◆ onDrop()

void igor::iWidget::onDrop ( const iDrag drag)
protectedvirtual

drop handle

Parameters
dragthe drag data

◆ onEvent()

bool igor::iWidget::onEvent ( iEvent event)
protectedvirtual

handles incoming generic event

Parameters
eventthe event

◆ onGainedKeyboardFocus()

void igor::iWidget::onGainedKeyboardFocus ( )
protectedvirtual

handles gained keyboard focus

Reimplemented in igor::iWidgetLineTextEdit.

◆ onKeyDown()

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

handles pressed key event

Parameters
eventthe key down event

Reimplemented in igor::iWidgetLineTextEdit.

◆ onKeyUp()

bool igor::iWidget::onKeyUp ( 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 ( 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 ( 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

◆ onMouseKeyUp()

bool igor::iWidget::onMouseKeyUp ( 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::iWidgetCheckBox.

◆ onMouseMove()

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

handles incoming mouse move events

Parameters
eventmouse move event
consumedif true mouse move was already consumed

◆ onMouseWheel()

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

handles incoming mouse wheel event

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

◆ registerOnChangeEvent()

void igor::iWidget::registerOnChangeEvent ( iChangeDelegate  changeDelegate)

registers delegate to content change event

Parameters
changeDelegatethe delegate to register

◆ registerOnClickEvent()

void igor::iWidget::registerOnClickEvent ( iClickDelegate  clickDelegate)

registers delegate to click event (click is left mouse button)

Parameters
clickDelegatethe delegate to register

◆ registerOnContextMenuEvent()

void igor::iWidget::registerOnContextMenuEvent ( iContextMenuDelegate  contextMenuDelegate)

registers delegate to context menu event

Parameters
contextMenuDelegatethe delegate to register

◆ registerOnDoubleClickEvent()

void igor::iWidget::registerOnDoubleClickEvent ( iDoubleClickDelegate  doubleClickDelegate)

registers delegate to double click event

Parameters
doubleClickDelegatethe delegate to register

◆ registerOnFocusEvent()

void igor::iWidget::registerOnFocusEvent ( iFocusDelegate  focusDelegate)

registers delegate to keyboard focus event

Parameters
focusDelegatethe delegate to register

◆ registerOnMouseOffClickEvent()

void igor::iWidget::registerOnMouseOffClickEvent ( iMouseOffClickDelegate  clickDelegate)

registers delegate to mouse out of bounds click events

Parameters
clickDelegatethe delegate to register

◆ registerOnMouseOffEvent()

void igor::iWidget::registerOnMouseOffEvent ( iMouseOffDelegate  mouseOffDelegate)

registers delegate to mouse off event (opposite of mouse over)

Parameters
mouseOffDelegatethe delegate to register

◆ registerOnMouseOverEvent()

void igor::iWidget::registerOnMouseOverEvent ( iMouseOverDelegate  mouseOverDelegate)

registers delegate to mouse over event

Parameters
mouseOverDelegatethe delegate to register

◆ registerOnSelectionChangedEvent()

void igor::iWidget::registerOnSelectionChangedEvent ( iSelectionChangedDelegate  delegate)

registers delegate to selection changed event

Parameters
delegatethe delegate to register

◆ registerOnWheelDownEvent()

void igor::iWidget::registerOnWheelDownEvent ( iWheelDownDelegate  wheelDownDelegate)

registers delegate to wheel down event

Parameters
wheelDownDelegatethe delegate to register

◆ registerOnWheelUpEvent()

void igor::iWidget::registerOnWheelUpEvent ( iWheelUpDelegate  wheelUpDelegate)

registers delegate to wheel up event

Parameters
wheelUpDelegatethe delegate to register

◆ 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

◆ select()

void igor::iWidget::select ( )

selects widget

Parameters
exclusiveif true it unselects siblings

◆ 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

◆ 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::iUserControlColorChooser, and igor::iWidgetColorGradient.

◆ unregisterOnChangeEvent()

void igor::iWidget::unregisterOnChangeEvent ( iChangeDelegate  changeDelegate)

unregisters delegate content change event

Parameters
changeDelegatethe delegate to unregister

◆ unregisterOnClickEvent()

void igor::iWidget::unregisterOnClickEvent ( iClickDelegate  clickDelegate)

unregisters delegate from click event (click is left mouse button)

Parameters
clickDelegatethe delegate to unregister

◆ unregisterOnContextMenuEvent()

void igor::iWidget::unregisterOnContextMenuEvent ( iContextMenuDelegate  contextMenuDelegate)

unregister delegate from context menu event

Parameters
contextMenuDelegatethe delegate to unregister

◆ unregisterOnDoubleClickEvent()

void igor::iWidget::unregisterOnDoubleClickEvent ( iDoubleClickDelegate  doubleClickDelegate)

unregisters delegate from double click event

Parameters
doubleClickDelegatethe delegate to unregister

◆ unregisterOnFocusEvent()

void igor::iWidget::unregisterOnFocusEvent ( iFocusDelegate  focusDelegate)

unregisters delegate keyboard focus event

Parameters
focusDelegatethe delegate to unregister

◆ unregisterOnMouseOffClickEvent()

void igor::iWidget::unregisterOnMouseOffClickEvent ( iMouseOffClickDelegate  clickDelegate)

unregisters delegate from mouse off click event

Parameters
clickDelegatethe delegate to unregister

◆ unregisterOnMouseOffEvent()

void igor::iWidget::unregisterOnMouseOffEvent ( iMouseOffDelegate  mouseOffDelegate)

unregisters delegate mouse off event

Parameters
mouseOffDelegatethe delegate to unregister

◆ unregisterOnMouseOverEvent()

void igor::iWidget::unregisterOnMouseOverEvent ( iMouseOverDelegate  mouseOverDelegate)

unregisters delegate mouse over event

Parameters
mouseOverDelegatethe delegate to unregister

◆ unregisterOnSelectionChangedEvent()

void igor::iWidget::unregisterOnSelectionChangedEvent ( iSelectionChangedDelegate  delegate)

unregisters delegate from selection changed event

Parameters
delegatethe delegate to unregister

◆ unregisterOnWheelDownEvent()

void igor::iWidget::unregisterOnWheelDownEvent ( iWheelDownDelegate  wheelDownDelegate)

unregister delegate from wheel down event

Parameters
wheelDownDelegatethe delegate to unregister

◆ unregisterOnWheelUpEvent()

void igor::iWidget::unregisterOnWheelUpEvent ( iWheelUpDelegate  wheelUpDelegate)

unregister delegate from wheel up event

Parameters
wheelUpDelegatethe delegate to unregister

◆ unselect()

void igor::iWidget::unselect ( )

unselect widget

◆ 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

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