igor::iWidgetGridLayout Class Reference

#include <iWidgetGridLayout.h>

Inherits igor::iWidget.

Public Member Functions

 iWidgetGridLayout (const iWidgetPtr parent=nullptr)
 
 ~iWidgetGridLayout ()=default
 
void appendRows (uint32 count)
 
void appendColumns (uint32 count)
 
void insertRow (uint32 at)
 
void insertColumn (uint32 at)
 
void removeRow (uint32 at)
 
void removeColumn (uint32 at)
 
void clear ()
 
uint32 getRowCount ()
 
uint32 getColumnCount ()
 
int32 getCellSpacing ()
 
void setCellSpacing (int32 cellSpacing)
 
int32 getBorder ()
 
void setBorder (int32 border)
 
void addWidget (iWidgetPtr widget)
 
void removeWidget (iWidgetPtr widget)
 
void addWidget (iWidgetPtr widget, int32 col, int32 row, const std::any &userData=std::any())
 
void setSelectMode (iSelectionMode selectMode)
 
void setHighlightMode (iSelectionMode highlightMode)
 
iSelectionMode getSelectMode () const
 
iSelectionMode getHighlightMode () const
 
void select (int32 column, int32 row)
 
void unselect ()
 
bool isSelected ()
 
int32 getSelectedRow () const
 
int32 getSelectedColumn () const
 
const std::any getSelectedUserData ()
 
std::any getUserData (int32 col, int32 row)
 
void setStretchRow (int32 row)
 
int32 getStretchRow () const
 
void setStretchColumn (int32 col)
 
int32 getStretchColumn () const
 
int32 getMouseOverRow () const
 
int32 getMouseOverColumn () const
 
void setEmptyCellsSelectable (bool emptyCellsSelectable=true)
 
bool getEmptyCellsSelectable () const
 
bool isCellEmpty (int32 col, int32 row)
 
- 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 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)
 

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
 
- 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 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 inherited from igor::iWidget
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
 

Detailed Description

grid layout widget

Constructor & Destructor Documentation

◆ iWidgetGridLayout()

igor::iWidgetGridLayout::iWidgetGridLayout ( const iWidgetPtr  parent = nullptr)

ctor initializes member variables

Parameters
parentoptional parent

◆ ~iWidgetGridLayout()

igor::iWidgetGridLayout::~iWidgetGridLayout ( )
default

does nothing

Member Function Documentation

◆ addWidget() [1/2]

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

adds a child widget to this widget at position 0, 0

Parameters
widgetthe child widget to be added

Reimplemented from igor::iWidget.

◆ addWidget() [2/2]

void igor::iWidgetGridLayout::addWidget ( iWidgetPtr  widget,
int32  col,
int32  row,
const std::any &  userData = std::any() 
)

add widget and set it at given position

Parameters
widgetthe widget pointer
colcolumn index
rowrow index
userDataany kind of data

◆ appendColumns()

void igor::iWidgetGridLayout::appendColumns ( uint32  count)

appends columns on the right of the grid

Parameters
countthe amount of columns to be added

◆ appendRows()

void igor::iWidgetGridLayout::appendRows ( uint32  count)

appends rows at the bottom of the grid

Parameters
countthe amount of rows to be added

◆ clear()

void igor::iWidgetGridLayout::clear ( )
virtual

clears the whole grid

Reimplemented from igor::iWidget.

◆ getBorder()

int32 igor::iWidgetGridLayout::getBorder ( )
Returns
border

◆ getCellSpacing()

int32 igor::iWidgetGridLayout::getCellSpacing ( )
Returns
cell spacing

◆ getColumnCount()

uint32 igor::iWidgetGridLayout::getColumnCount ( )
Returns
column count

◆ getEmptyCellsSelectable()

bool igor::iWidgetGridLayout::getEmptyCellsSelectable ( ) const
Returns
true if empty cells are selectable

◆ getHighlightMode()

iSelectionMode igor::iWidgetGridLayout::getHighlightMode ( ) const
Returns
highlight mode

◆ getMouseOverColumn()

int32 igor::iWidgetGridLayout::getMouseOverColumn ( ) const
Returns
mouse over column

◆ getMouseOverRow()

int32 igor::iWidgetGridLayout::getMouseOverRow ( ) const
Returns
mouse over row

◆ getRowCount()

uint32 igor::iWidgetGridLayout::getRowCount ( )
Returns
row count

◆ getSelectedColumn()

int32 igor::iWidgetGridLayout::getSelectedColumn ( ) const
Returns
selected column

if not selected it will return -1

◆ getSelectedRow()

int32 igor::iWidgetGridLayout::getSelectedRow ( ) const
Returns
selected row

if not selected it will return -1

◆ getSelectedUserData()

const std::any igor::iWidgetGridLayout::getSelectedUserData ( )
Returns
pointer to user Data of selected field

◆ getSelectMode()

iSelectionMode igor::iWidgetGridLayout::getSelectMode ( ) const
Returns
selection mode

◆ getStretchColumn()

int32 igor::iWidgetGridLayout::getStretchColumn ( ) const
Returns
column number to be stretched

◆ getStretchRow()

int32 igor::iWidgetGridLayout::getStretchRow ( ) const
Returns
row number to be stretched

◆ getUserData()

std::any igor::iWidgetGridLayout::getUserData ( int32  col,
int32  row 
)
Returns
pointer to user Data of specified field
Parameters
colspecfied column
rowspecfied row

◆ insertColumn()

void igor::iWidgetGridLayout::insertColumn ( uint32  at)

insert a single column before given position

Parameters
atthe given position

◆ insertRow()

void igor::iWidgetGridLayout::insertRow ( uint32  at)

insert a single row before given position

Parameters
atthe given position

◆ isCellEmpty()

bool igor::iWidgetGridLayout::isCellEmpty ( int32  col,
int32  row 
)
Returns
true if a cell is empty
Parameters
colthe column of the cell
rowthe row of the cell

◆ isSelected()

bool igor::iWidgetGridLayout::isSelected ( )
Returns
true: if grid is selected

◆ removeColumn()

void igor::iWidgetGridLayout::removeColumn ( uint32  at)

removed column at given position

Parameters
atthe given position

◆ removeRow()

void igor::iWidgetGridLayout::removeRow ( uint32  at)

removes row at given position

Parameters
atthe given position

◆ removeWidget()

void igor::iWidgetGridLayout::removeWidget ( iWidgetPtr  widget)
virtual

removes a child widget from this widget regardless of it's position

the former position will be cleared

Parameters
widgetthe child widget to be removed

Reimplemented from igor::iWidget.

◆ select()

void igor::iWidgetGridLayout::select ( int32  column,
int32  row 
)

◆ setBorder()

void igor::iWidgetGridLayout::setBorder ( int32  border)

sets border

◆ setCellSpacing()

void igor::iWidgetGridLayout::setCellSpacing ( int32  cellSpacing)

sets cell spacing

◆ setEmptyCellsSelectable()

void igor::iWidgetGridLayout::setEmptyCellsSelectable ( bool  emptyCellsSelectable = true)

sets wether or not an empty cell is selectable

only active for iSelectionMode::Cell

Parameters
emptyCellsSelectableif true empty cells are selectable (default is false)

◆ setHighlightMode()

void igor::iWidgetGridLayout::setHighlightMode ( iSelectionMode  highlightMode)

sets highlight mode

Parameters
highlightModethe mode of highlight

◆ setSelectMode()

void igor::iWidgetGridLayout::setSelectMode ( iSelectionMode  selectMode)

sets selection mode of grid

Parameters
selectModethe mode of selection

◆ setStretchColumn()

void igor::iWidgetGridLayout::setStretchColumn ( int32  col)

defines which column will be stretched if the grid is horizontally stretched

Parameters
colcolumn number to be stretched

◆ setStretchRow()

void igor::iWidgetGridLayout::setStretchRow ( int32  row)

defines which row will be stretched if the grid is vertically stretched

Parameters
rowrow number to be stretched

◆ unselect()

void igor::iWidgetGridLayout::unselect ( )

unselects the grid


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