igor::iWidgetLineTextEdit Class Reference

#include <iWidgetLineTextEdit.h>

Inherits igor::iWidget.

Public Member Functions

 iWidgetLineTextEdit (const iWidgetPtr parent=nullptr)
 
virtual ~iWidgetLineTextEdit ()=default
 
void setHorizontalTextAlignment (iHorizontalAlignment align)
 
iHorizontalAlignment getHorizontalTextAlignment () const
 
void setVerticalTextAlignment (iVerticalAlignment valign)
 
iVerticalAlignment getVerticalTextAlignment () const
 
void setMaxTextLength (int32 chars)
 
int32 getMaxTextLength ()
 
void setWriteProtected (bool writeProtected)
 
bool isWriteProtected ()
 
void setChangeEventAtOnce ()
 
void setChangeEventOnEnterAndLostFocus ()
 
void setText (const iaString &text)
 
const iaStringgetText () const
 
void setCursorPos (uint64 cursorPos)
 
uint64 getCursorPos () const
 
void incCursorPos ()
 
void decCursorPos ()
 
- 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)
 

Protected Member Functions

bool onASCII (iEventKeyASCII &event) override
 
virtual bool onKeyDown (iEventKeyDown &event) override
 
virtual bool onKeyUp (iEventKeyUp &event) override
 
virtual void onGainedKeyboardFocus () override
 
virtual void onLostKeyboardFocus () override
 
void handleChanges ()
 
- 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

iHorizontalAlignment _horizontalTextAlignment = iHorizontalAlignment::Left
 
iVerticalAlignment _verticalTextAlignment = iVerticalAlignment::Center
 
bool _triggerChangeAtOnce = false
 
iaString _text
 
iaString _textBackup
 
- 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
 

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
 

Detailed Description

single line text edit widget

Constructor & Destructor Documentation

◆ iWidgetLineTextEdit()

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

initializes member variables

Parameters
parentoptional parent

◆ ~iWidgetLineTextEdit()

virtual igor::iWidgetLineTextEdit::~iWidgetLineTextEdit ( )
virtualdefault

deinitializes member variables

Member Function Documentation

◆ decCursorPos()

void igor::iWidgetLineTextEdit::decCursorPos ( )

decrease cursor pos by one

◆ getCursorPos()

uint64 igor::iWidgetLineTextEdit::getCursorPos ( ) const

◆ getHorizontalTextAlignment()

iHorizontalAlignment igor::iWidgetLineTextEdit::getHorizontalTextAlignment ( ) const
Returns
horizontal text alignment

◆ getMaxTextLength()

int32 igor::iWidgetLineTextEdit::getMaxTextLength ( )
Returns
the max length of text in characters

◆ getText()

const iaString & igor::iWidgetLineTextEdit::getText ( ) const
Returns
the text

◆ getVerticalTextAlignment()

iVerticalAlignment igor::iWidgetLineTextEdit::getVerticalTextAlignment ( ) const
Returns
vertical text alignment

◆ handleChanges()

void igor::iWidgetLineTextEdit::handleChanges ( )
protected

triggers a change event if the content has changed

◆ incCursorPos()

void igor::iWidgetLineTextEdit::incCursorPos ( )

increase cursor pos by one

◆ isWriteProtected()

bool igor::iWidgetLineTextEdit::isWriteProtected ( )

\retruns if text edit is write protected

◆ onASCII()

bool igor::iWidgetLineTextEdit::onASCII ( iEventKeyASCII event)
overrideprotectedvirtual

handles incoming acsii codes from keyboard

Parameters
eventthe key ascii event

Reimplemented from igor::iWidget.

◆ onGainedKeyboardFocus()

void igor::iWidgetLineTextEdit::onGainedKeyboardFocus ( )
overrideprotectedvirtual

handles gained kayboard focus

Reimplemented from igor::iWidget.

◆ onKeyDown()

bool igor::iWidgetLineTextEdit::onKeyDown ( iEventKeyDown event)
overrideprotectedvirtual

handles incoming released key events

Parameters
eventthe key down event

Reimplemented from igor::iWidget.

◆ onKeyUp()

bool igor::iWidgetLineTextEdit::onKeyUp ( iEventKeyUp event)
overrideprotectedvirtual

handles incoming released key events

Parameters
eventthe key up event

Reimplemented from igor::iWidget.

◆ onLostKeyboardFocus()

void igor::iWidgetLineTextEdit::onLostKeyboardFocus ( )
overrideprotectedvirtual

handles lost keyboard focus

Reimplemented from igor::iWidget.

◆ setChangeEventAtOnce()

void igor::iWidgetLineTextEdit::setChangeEventAtOnce ( )

set up that the change event will only triggered if you press enter

◆ setChangeEventOnEnterAndLostFocus()

void igor::iWidgetLineTextEdit::setChangeEventOnEnterAndLostFocus ( )

set up that the change event will be triggered for every change in the text field

◆ setCursorPos()

void igor::iWidgetLineTextEdit::setCursorPos ( uint64  cursorPos)

sets cursor pos

cursor pos will be clamped by current text size

Parameters
cursorPosthe new cursor pos

◆ setHorizontalTextAlignment()

void igor::iWidgetLineTextEdit::setHorizontalTextAlignment ( iHorizontalAlignment  align)

sets horrizotnal text aligment

Parameters
alignthe horizontal allignment of the text

◆ setMaxTextLength()

void igor::iWidgetLineTextEdit::setMaxTextLength ( int32  chars)

sets the text max length in characters

Parameters
charsnumber of characters

◆ setText()

void igor::iWidgetLineTextEdit::setText ( const iaString text)

sets the text

Parameters
textthe text to be set

◆ setVerticalTextAlignment()

void igor::iWidgetLineTextEdit::setVerticalTextAlignment ( iVerticalAlignment  valign)

sets vertical text aligment

Parameters
valignthe vertical allignment of the text

◆ setWriteProtected()

void igor::iWidgetLineTextEdit::setWriteProtected ( bool  writeProtected)

sets text edit write protected

Parameters
writeProtectedtrue: text edit will be write protected

Member Data Documentation

◆ _horizontalTextAlignment

iHorizontalAlignment igor::iWidgetLineTextEdit::_horizontalTextAlignment = iHorizontalAlignment::Left
protected

the horizontal alignment

◆ _text

iaString igor::iWidgetLineTextEdit::_text
protected

the text

◆ _textBackup

iaString igor::iWidgetLineTextEdit::_textBackup
protected

backup text

◆ _triggerChangeAtOnce

bool igor::iWidgetLineTextEdit::_triggerChangeAtOnce = false
protected

flat to handle change event trigger behaviour

◆ _verticalTextAlignment

iVerticalAlignment igor::iWidgetLineTextEdit::_verticalTextAlignment = iVerticalAlignment::Center
protected

the vertical alignment


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