NXWidgets  1.19
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NXWidgets::CMultiLineTextBox Class Reference

#include <cmultilinetextbox.hxx>

Inheritance diagram for NXWidgets::CMultiLineTextBox:
Inheritance graph

Public Types

enum  TextAlignmentHoriz { TEXT_ALIGNMENT_HORIZ_CENTER = 0, TEXT_ALIGNMENT_HORIZ_LEFT = 1, TEXT_ALIGNMENT_HORIZ_RIGHT = 2 }
 
enum  TextAlignmentVert { TEXT_ALIGNMENT_VERT_CENTER = 0, TEXT_ALIGNMENT_VERT_TOP = 1, TEXT_ALIGNMENT_VERT_BOTTOM = 2 }
 
- Public Types inherited from NXWidgets::CNxWidget
enum  WidgetFlagType {
  WIDGET_BORDERLESS = 0x0001, WIDGET_DRAGGABLE = 0x0002, WIDGET_PERMEABLE = 0x0004, WIDGET_DOUBLE_CLICKABLE = 0x0008,
  WIDGET_NO_RAISE_EVENTS = 0x0010
}
 

Public Member Functions

 CMultiLineTextBox (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, const CNxString &text, uint32_t flags, nxgl_coord_t maxRows=0, CWidgetStyle *style=(CWidgetStyle *) NULL)
 
virtual void setTextAlignmentHoriz (TextAlignmentHoriz alignment)
 
virtual void setTextAlignmentVert (TextAlignmentVert alignment)
 
virtual const int getPageCount (void) const
 
virtual const int getCurrentPage (void) const
 
virtual const CTextgetText (void) const
 
virtual void setText (const CNxString &text)
 
virtual void appendText (const CNxString &text)
 
virtual void removeText (const unsigned int startIndex)
 
virtual void removeText (const unsigned int startIndex, const unsigned int count)
 
virtual void setFont (CNxFont *font)
 
virtual void setLineSpacing (nxgl_coord_t lineSpacing)
 
virtual const int getTextLength (void) const
 
virtual void showCursor (EShowCursor cursorMode)
 
virtual void showCursor (void)
 
virtual void hideCursor (void)
 
virtual void wrapCursor (bool wrap)
 
virtual void moveCursorToPosition (const int position)
 
virtual const int getCursorPosition (void) const
 
virtual void insertText (const CNxString &text, const unsigned int index)
 
virtual void insertTextAtCursor (const CNxString &ext)
 
- Public Member Functions inherited from NXWidgets::ITextBox
virtual ~ITextBox (void)
 
- Public Member Functions inherited from NXWidgets::CScrollingPanel
 CScrollingPanel (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, uint32_t flags, CWidgetStyle *style=(CWidgetStyle *) NULL)
 
virtual void scroll (int32_t dx, int32_t dy)
 
virtual void jump (int32_t x, int32_t y)
 
bool allowsVerticalScroll (void) const
 
bool allowsHorizontalScroll (void) const
 
virtual const int32_t getCanvasX (void) const
 
virtual const int32_t getCanvasY (void) const
 
virtual const int32_t getCanvasWidth (void) const
 
virtual const int32_t getCanvasHeight (void) const
 
void setAllowsVerticalScroll (bool allow)
 
void setAllowsHorizontalScroll (bool allow)
 
void setContentScrolled (bool scrolled)
 
bool IsContentScrolled (void)
 
virtual void setCanvasWidth (const int32_t width)
 
virtual void setCanvasHeight (const int32_t height)
 
- Public Member Functions inherited from NXWidgets::CNxWidget
 CNxWidget (CWidgetControl *pWidgetControl, nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height, uint32_t flags, FAR const CWidgetStyle *style=(FAR const CWidgetStyle *) NULL)
 
virtual ~CNxWidget (void)
 
nxgl_coord_t getX (void) const
 
nxgl_coord_t getY (void) const
 
nxgl_coord_t getRelativeX (void) const
 
nxgl_coord_t getRelativeY (void) const
 
bool hasFocus (void) const
 
bool isDeleted (void) const
 
bool isDrawingEnabled (void) const
 
bool isHidden (void) const
 
bool isEnabled (void) const
 
bool isPermeable (void) const
 
bool isDoubleClickable (void) const
 
bool isBorderless (void) const
 
bool isClicked (void) const
 
bool isBeingDragged (void) const
 
nxgl_coord_t getWidth (void) const
 
nxgl_coord_t getHeight (void) const
 
void getSize (struct nxgl_size_s &size) const
 
void getPos (struct nxgl_point_s &pos) const
 
CRect getBoundingBox (void)
 
void getBorderSize (WidgetBorderSize &borderSize)
 
CNxWidgetgetParent (void) const
 
CNxWidgetgetFocusedWidget (void)
 
virtual void getPreferredDimensions (CRect &rect) const
 
void getClientRect (CRect &rect) const
 
void getRect (CRect &rect) const
 
CNxFontgetFont (void) const
 
nxgl_mxpixel_t getBackgroundColor (void) const
 
nxgl_mxpixel_t getSelectedBackgroundColor (void) const
 
nxgl_mxpixel_t getShineEdgeColor (void) const
 
nxgl_mxpixel_t getShadowEdgeColor (void) const
 
nxgl_mxpixel_t getHighlightColor (void) const
 
nxgl_mxpixel_t getDisabledTextColor (void) const
 
nxgl_mxpixel_t getEnabledTextColor (void) const
 
nxgl_mxpixel_t getSelectedTextColor (void) const
 
const CWidgetStylegetWidgetStyle () const
 
void setBorderless (bool isBorderless)
 
void setDraggable (bool isDraggable)
 
void setPermeable (bool permeable)
 
void setDoubleClickable (bool doubleClickable)
 
void addWidgetEventHandler (CWidgetEventHandler *eventHandler)
 
void removeWidgetEventHandler (CWidgetEventHandler *eventHandler)
 
int nWidgetEventHandlers (void) const
 
void setRaisesEvents (bool raises)
 
bool raisesEvents (void) const
 
void disableDrawing (void)
 
void enableDrawing (void)
 
void setBackgroundColor (nxgl_mxpixel_t color)
 
void setSelectedBackgroundColor (nxgl_mxpixel_t color)
 
void setShineEdgeColor (nxgl_mxpixel_t color)
 
void setShadowEdgeColor (nxgl_mxpixel_t color)
 
void setHighlightColor (nxgl_mxpixel_t color)
 
void setDisabledTextColor (nxgl_mxpixel_t color)
 
void setEnabledTextColor (nxgl_mxpixel_t color)
 
void setSelectedTextColor (nxgl_mxpixel_t color)
 
void redraw (void)
 
bool enable (void)
 
bool disable (void)
 
void close (void)
 
bool show (void)
 
bool hide (void)
 
virtual bool click (nxgl_coord_t x, nxgl_coord_t y)
 
virtual bool isDoubleClick (nxgl_coord_t x, nxgl_coord_t y)
 
bool doubleClick (nxgl_coord_t x, nxgl_coord_t y)
 
bool release (nxgl_coord_t x, nxgl_coord_t y)
 
bool drag (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY)
 
bool keyPress (nxwidget_char_t key)
 
bool cursorControl (ECursorControl control)
 
bool focus (void)
 
bool blur (void)
 
bool moveTo (nxgl_coord_t x, nxgl_coord_t y)
 
bool resize (nxgl_coord_t width, nxgl_coord_t height)
 
bool changeDimensions (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height)
 
void moveChildToDeleteQueue (CNxWidget *widget)
 
void setFocusedWidget (CNxWidget *widget)
 
virtual bool checkCollision (nxgl_coord_t x, nxgl_coord_t y) const
 
virtual bool checkCollision (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t width, nxgl_coord_t height) const
 
bool checkCollision (CNxWidget *widget) const
 
void addWidget (CNxWidget *widget)
 
void insertWidget (CNxWidget *widget)
 
void setParent (CNxWidget *parent)
 
void destroy (void)
 
bool remove (void)
 
bool removeChild (CNxWidget *widget)
 
const CNxWidgetgetChild (int index) const
 
int getChildCount (void) const
 
void setBorderSize (const WidgetBorderSize &borderSize)
 
- Public Member Functions inherited from NXWidgets::IScrollable
virtual ~IScrollable (void)
 
- Public Member Functions inherited from NXWidgets::CWidgetEventHandler
 CWidgetEventHandler ()
 
virtual ~CWidgetEventHandler ()
 
virtual void handleClickEvent (const CWidgetEventArgs &e)
 
virtual void handleDragEvent (const CWidgetEventArgs &e)
 
virtual void handleDropEvent (const CWidgetEventArgs &e)
 
virtual void handleReleaseEvent (const CWidgetEventArgs &e)
 
virtual void handleReleaseOutsideEvent (const CWidgetEventArgs &e)
 
virtual void handleFocusEvent (const CWidgetEventArgs &e)
 
virtual void handleBlurEvent (const CWidgetEventArgs &e)
 
virtual void handleCloseEvent (const CWidgetEventArgs &e)
 
virtual void handleHideEvent (const CWidgetEventArgs &e)
 
virtual void handleShowEvent (const CWidgetEventArgs &e)
 
virtual void handleEnableEvent (const CWidgetEventArgs &e)
 
virtual void handleDisableEvent (const CWidgetEventArgs &e)
 
virtual void handleValueChangeEvent (const CWidgetEventArgs &e)
 
virtual void handleResizeEvent (const CWidgetEventArgs &e)
 
virtual void handleMoveEvent (const CWidgetEventArgs &e)
 
virtual void handleScrollEvent (const CWidgetEventArgs &e)
 
virtual void handleDoubleClickEvent (const CWidgetEventArgs &e)
 
virtual void handleActionEvent (const CWidgetEventArgs &e)
 

Protected Member Functions

virtual void getCursorCoordinates (nxgl_coord_t &x, nxgl_coord_t &y) const
 
virtual int getCharIndexAtCoordinate (nxgl_coord_t x, int rowIndex) const
 
virtual unsigned int getCharIndexAtCoordinates (nxgl_coord_t x, nxgl_coord_t y) const
 
int getRowContainingCoordinate (nxgl_coord_t y) const
 
virtual void drawContents (CGraphicsPort *port)
 
virtual void drawBorder (CGraphicsPort *port)
 
virtual void moveCursorLeft (void)
 
virtual void moveCursorRight (void)
 
virtual void moveCursorUp (void)
 
virtual void moveCursorDown (void)
 
virtual bool cullTopLines (void)
 
virtual void limitCanvasHeight (void)
 
virtual void limitCanvasY (void)
 
void jumpToCursor (void)
 
void jumpToTextBottom (void)
 
virtual void onResize (nxgl_coord_t width, nxgl_coord_t height)
 
virtual void onClick (nxgl_coord_t x, nxgl_coord_t y)
 
virtual void onDoubleClick (nxgl_coord_t x, nxgl_coord_t y)
 
void processPhysicalKey (nxwidget_char_t key)
 
void handleKeyPressEvent (const CWidgetEventArgs &e)
 
void handleCursorControlEvent (const CWidgetEventArgs &e)
 
nxgl_coord_t getRowX (int row) const
 
nxgl_coord_t getRowY (int row) const
 
virtual bool isCursorVisible (void) const
 
nxwidget_char_t getCursorChar (void) const
 
void calculateVisibleRows (void)
 
void drawText (CGraphicsPort *port)
 
void drawCursor (CGraphicsPort *port)
 
void drawRow (CGraphicsPort *port, int row)
 
virtual ~CMultiLineTextBox (void)
 
 CMultiLineTextBox (const CMultiLineTextBox &multiLineTextBox)
 
- Protected Member Functions inherited from NXWidgets::CScrollingPanel
virtual void onDrag (nxgl_coord_t x, nxgl_coord_t y, nxgl_coord_t vX, nxgl_coord_t vY)
 
void scrollChildren (int32_t dx, int32_t dy, bool do_redraw)
 
virtual ~CScrollingPanel (void)
 
 CScrollingPanel (const CScrollingPanel &scrollingPanel)
 
- Protected Member Functions inherited from NXWidgets::CNxWidget
void useWidgetStyle (const CWidgetStyle *style)
 
void drawChildren (void)
 
void closeChild (CNxWidget *widget)
 
void startDragging (nxgl_coord_t x, nxgl_coord_t y)
 
void stopDragging (nxgl_coord_t x, nxgl_coord_t y)
 
 CNxWidget (const CNxWidget &widget)
 
virtual void onPreRelease (nxgl_coord_t x, nxgl_coord_t y)
 
virtual void onRelease (nxgl_coord_t x, nxgl_coord_t y)
 
virtual void onReleaseOutside (nxgl_coord_t x, nxgl_coord_t y)
 
virtual void onDragStart (void)
 
virtual void onDragStop (void)
 
virtual void onFocus (void)
 
virtual void onBlur (void)
 
virtual void onEnable (void)
 
virtual void onDisable (void)
 

Protected Attributes

CTextm_text
 
uint8_t m_visibleRows
 
nxgl_coord_t m_maxRows
 
int32_t m_topRow
 
TextAlignmentHoriz m_hAlignment
 
TextAlignmentVert m_vAlignment
 
int m_cursorPos
 
uint8_t m_showCursor
 
bool m_wrapCursor
 
- Protected Attributes inherited from NXWidgets::CScrollingPanel
CWidgetControlm_widgetControl
 
int32_t m_canvasX
 
int32_t m_canvasY
 
int32_t m_canvasWidth
 
int32_t m_canvasHeight
 
bool m_allowVerticalScroll
 
bool m_allowHorizontalScroll
 
bool m_isContentScrolled
 
- Protected Attributes inherited from NXWidgets::CNxWidget
CWidgetControlm_widgetControl
 
CRect m_rect
 
nxgl_coord_t m_grabPointX
 
nxgl_coord_t m_grabPointY
 
nxgl_coord_t m_newX
 
nxgl_coord_t m_newY
 
CWidgetStyle m_style
 
Flags m_flags
 
CWidgetEventHandlerListm_widgetEventHandlers
 
struct timespec m_lastClickTime
 
nxgl_coord_t m_lastClickX
 
nxgl_coord_t m_lastClickY
 
int m_doubleClickBounds
 
CNxWidgetm_parent
 
CNxWidgetm_focusedChild
 
TNxArray< CNxWidget * > m_children
 
WidgetBorderSize m_borderSize
 

Detailed Description

Textbox that offers multiple lines of text. Has scrolling capability and can be dragged using the mouse. The text it contains can be changed or added to. It can remember more rows of text than it can display, and these additional rows can be scrolled through.

Definition at line 114 of file cmultilinetextbox.hxx.

Member Enumeration Documentation

◆ TextAlignmentHoriz

enum NXWidgets::CMultiLineTextBox::TextAlignmentHoriz

Enum of horizontal alignment options.

Enumerator
TEXT_ALIGNMENT_HORIZ_CENTER 

Centre the text

TEXT_ALIGNMENT_HORIZ_LEFT 

Align left

TEXT_ALIGNMENT_HORIZ_RIGHT 

Align right

Definition at line 123 of file cmultilinetextbox.hxx.

◆ TextAlignmentVert

enum NXWidgets::CMultiLineTextBox::TextAlignmentVert

Enum of vertical alignment options.

Enumerator
TEXT_ALIGNMENT_VERT_CENTER 

Align to centre of textbox

TEXT_ALIGNMENT_VERT_TOP 

Align to top of textbox

TEXT_ALIGNMENT_VERT_BOTTOM 

Align to bottom of textbox

Definition at line 134 of file cmultilinetextbox.hxx.

Constructor & Destructor Documentation

◆ ~CMultiLineTextBox()

virtual NXWidgets::CMultiLineTextBox::~CMultiLineTextBox ( void  )
inlineprotectedvirtual

Destructor.

Definition at line 397 of file cmultilinetextbox.hxx.

◆ CMultiLineTextBox() [1/2]

NXWidgets::CMultiLineTextBox::CMultiLineTextBox ( const CMultiLineTextBox multiLineTextBox)
inlineprotected

Copy constructor is protected to prevent usage.

Definition at line 407 of file cmultilinetextbox.hxx.

◆ CMultiLineTextBox() [2/2]

CMultiLineTextBox::CMultiLineTextBox ( CWidgetControl pWidgetControl,
nxgl_coord_t  x,
nxgl_coord_t  y,
nxgl_coord_t  width,
nxgl_coord_t  height,
const CNxString text,
uint32_t  flags,
nxgl_coord_t  maxRows = 0,
CWidgetStyle style = (CWidgetStyle *)NULL 
)

Constructor.

Parameters
pWidgetControlThe widget control for the display.
xThe x coordinate of the text box, relative to its parent.
yThe y coordinate of the text box, relative to its parent.
widthThe width of the textbox.
heightThe height of the textbox.
textPointer to a string to display in the textbox.
flagsStandard widget flag options.
maxRowsThe maximum number of rows the textbox can track. Adding text beyond this number will cause rows at the start of the text to be forgotten; text is essentially stored as a queue, and adding to the back of a full queue causes the front items to be popped off. Setting this to 0 will make the textbox track only the visible rows.
styleThe style that the widget should use. If this is not specified, the widget will use the values stored in the global g_defaultWidgetStyle object. The widget will copy the properties of the style into its own internal style object.

Definition at line 119 of file cmultilinetextbox.cxx.

Member Function Documentation

◆ appendText()

void CMultiLineTextBox::appendText ( const CNxString text)
virtual

Append new text to the end of the current text displayed in the textbox.

Parameters
textString to append.

Implements NXWidgets::ITextBox.

Definition at line 264 of file cmultilinetextbox.cxx.

◆ calculateVisibleRows()

void CMultiLineTextBox::calculateVisibleRows ( void  )
protected

Works out the number of visible rows within the textbox.

Definition at line 1151 of file cmultilinetextbox.cxx.

◆ cullTopLines()

bool CMultiLineTextBox::cullTopLines ( void  )
protectedvirtual

Ensures that the textbox only contains the maximum allowed number of rows by culling any excess rows from the top of the text.

Returns
True if lines were removed from the text; false if not.

Definition at line 792 of file cmultilinetextbox.cxx.

◆ drawBorder()

void CMultiLineTextBox::drawBorder ( CGraphicsPort port)
protectedvirtual

Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters
portThe CGraphicsPort to draw to.
See also
redraw()

Reimplemented from NXWidgets::CScrollingPanel.

Definition at line 692 of file cmultilinetextbox.cxx.

◆ drawContents()

void CMultiLineTextBox::drawContents ( CGraphicsPort port)
protectedvirtual

Draw the area of this widget that falls within the clipping region. Called by the redraw() function to draw all visible regions.

Parameters
portThe CGraphicsPort to draw to.
See also
redraw()

Reimplemented from NXWidgets::CScrollingPanel.

Definition at line 675 of file cmultilinetextbox.cxx.

◆ drawCursor()

void CMultiLineTextBox::drawCursor ( CGraphicsPort port)
protected

Draws the cursor.

Parameters
portThe CGraphicsPort to draw to.

Definition at line 1224 of file cmultilinetextbox.cxx.

◆ drawRow()

void CMultiLineTextBox::drawRow ( CGraphicsPort port,
int  row 
)
protected

Draws a single line of text.

Parameters
portThe CGraphicsPort to draw to.
rowThe index of the row to draw.

Definition at line 1255 of file cmultilinetextbox.cxx.

◆ drawText()

void CMultiLineTextBox::drawText ( CGraphicsPort port)
protected

Draws text.

Parameters
portThe CGraphicsPort to draw to.

Definition at line 1165 of file cmultilinetextbox.cxx.

◆ getCharIndexAtCoordinate()

int CMultiLineTextBox::getCharIndexAtCoordinate ( nxgl_coord_t  x,
int  rowIndex 
) const
protectedvirtual

Gets the index of the character at the specified x coordinate in the specified row.

Parameters
xX coordinate of the character.
rowIndexIndex of the row containing the character.
Returns
The index of the character at the specified coordinate.

Definition at line 538 of file cmultilinetextbox.cxx.

◆ getCharIndexAtCoordinates()

unsigned int CMultiLineTextBox::getCharIndexAtCoordinates ( nxgl_coord_t  x,
nxgl_coord_t  y 
) const
protectedvirtual

Get the index of the character at the specified coordinates.

Parameters
xX coordinate of the character.
yY coordinate of the character.
Returns
The index of the character at the specified coordinates.

Definition at line 612 of file cmultilinetextbox.cxx.

◆ getCurrentPage()

const int CMultiLineTextBox::getCurrentPage ( void  ) const
virtual

Returns the current page.

Returns
The current page.
See also
getPageCount().

Definition at line 213 of file cmultilinetextbox.cxx.

◆ getCursorChar()

nxwidget_char_t CMultiLineTextBox::getCursorChar ( void  ) const
protected

Gets the character under the cursor.

Returns
The character under the cursor.

Definition at line 1135 of file cmultilinetextbox.cxx.

◆ getCursorCoordinates()

void CMultiLineTextBox::getCursorCoordinates ( nxgl_coord_t &  x,
nxgl_coord_t &  y 
) const
protectedvirtual

Get the coordinates of the cursor relative to the text.

Parameters
xWill be populated with the x coordinate of the cursor.
yWill be populated with the y coordinate of the cursor.

Definition at line 485 of file cmultilinetextbox.cxx.

◆ getCursorPosition()

virtual const int NXWidgets::CMultiLineTextBox::getCursorPosition ( void  ) const
inlinevirtual

Get the cursor position. This is the index within the string that the cursor is currently positioned over.

Returns
position The cursor position.

Implements NXWidgets::ITextBox.

Definition at line 605 of file cmultilinetextbox.hxx.

◆ getPageCount()

const int CMultiLineTextBox::getPageCount ( void  ) const
virtual

Returns the number of "pages" that the text spans. A page is defined as the amount of text that can be displayed within the textbox at one time.

Returns
The page count.

Definition at line 194 of file cmultilinetextbox.cxx.

◆ getRowContainingCoordinate()

int CMultiLineTextBox::getRowContainingCoordinate ( nxgl_coord_t  y) const
protected

Get the row containing the specified Y coordinate.

Parameters
yY coordinate to locate.
Returns
The index of the row containing the specified Y coordinate.

Definition at line 625 of file cmultilinetextbox.cxx.

◆ getRowX()

nxgl_coord_t CMultiLineTextBox::getRowX ( int  row) const
protected

Gets the x position of a row of text based on the width of the row and the type of horizontal alignment currently set.

Parameters
rowThe index of the row.
Returns
The x coordinate of the row.

Definition at line 1019 of file cmultilinetextbox.cxx.

◆ getRowY()

nxgl_coord_t CMultiLineTextBox::getRowY ( int  row) const
protected

Gets the y position of the specified row of text based on the type of vertical alignment currently set.

Parameters
rowThe row number to find the y coordinate of.
Returns
The y coordinate of the specified row of text.

Definition at line 1054 of file cmultilinetextbox.cxx.

◆ getText()

virtual const CText* NXWidgets::CMultiLineTextBox::getText ( void  ) const
inlinevirtual

Returns a pointer to the CText object that contains the wrapped text used in the textbox. It is used as the pre-processed data source for the textbox, and should not be altered.

Returns
Pointer to the CText object.

Definition at line 484 of file cmultilinetextbox.hxx.

◆ getTextLength()

const int CMultiLineTextBox::getTextLength ( void  ) const
virtual

Get the length of the text string.

Returns
The length of the text string.

Definition at line 358 of file cmultilinetextbox.cxx.

◆ handleCursorControlEvent()

void CMultiLineTextBox::handleCursorControlEvent ( const CWidgetEventArgs e)
protectedvirtual

Handle a cursor control event. Replaces CWidgetEventHandler method.

Parameters
eThe event data.

Handles cursor control events. Moves the cursor in the direction selected.

Parameters
keyThe key that was pressed.

Reimplemented from NXWidgets::CWidgetEventHandler.

Definition at line 974 of file cmultilinetextbox.cxx.

◆ handleKeyPressEvent()

void CMultiLineTextBox::handleKeyPressEvent ( const CWidgetEventArgs e)
protectedvirtual

Handle a keyboard press event.

Parameters
eThe event data.

Reimplemented from NXWidgets::CWidgetEventHandler.

Definition at line 457 of file cmultilinetextbox.cxx.

◆ hideCursor()

virtual void NXWidgets::CMultiLineTextBox::hideCursor ( void  )
inlinevirtual

Hides the cursor.

Definition at line 572 of file cmultilinetextbox.hxx.

◆ insertText()

void CMultiLineTextBox::insertText ( const CNxString text,
const unsigned int  index 
)
virtual

Insert text at the specified index.

Parameters
textThe text to insert.
indexIndex at which to insert the text.

Implements NXWidgets::ITextBox.

Definition at line 418 of file cmultilinetextbox.cxx.

◆ insertTextAtCursor()

void CMultiLineTextBox::insertTextAtCursor ( const CNxString text)
virtual

Insert text at the current cursor position.

Parameters
textThe text to insert.

Implements NXWidgets::ITextBox.

Definition at line 446 of file cmultilinetextbox.cxx.

◆ isCursorVisible()

bool CMultiLineTextBox::isCursorVisible ( void  ) const
protectedvirtual

Return true if the cursor is visible

Definition at line 1123 of file cmultilinetextbox.cxx.

◆ jumpToCursor()

void CMultiLineTextBox::jumpToCursor ( void  )
protected

Jumps to the cursor coordinates of the text.

Definition at line 845 of file cmultilinetextbox.cxx.

◆ jumpToTextBottom()

void CMultiLineTextBox::jumpToTextBottom ( void  )
protected

Jumps to the bottom of the text.

Definition at line 885 of file cmultilinetextbox.cxx.

◆ limitCanvasHeight()

void CMultiLineTextBox::limitCanvasHeight ( void  )
protectedvirtual

Ensures that the canvas height is the height of the widget, if the widget exceeds the size of the text, or the height of the text if the text exceeds the size of the widget.

Definition at line 811 of file cmultilinetextbox.cxx.

◆ limitCanvasY()

void CMultiLineTextBox::limitCanvasY ( void  )
protectedvirtual

Ensures that the canvas cannot scroll beyond its height.

Definition at line 827 of file cmultilinetextbox.cxx.

◆ moveCursorDown()

void CMultiLineTextBox::moveCursorDown ( void  )
protectedvirtual

Move cursor one row downwards.

Definition at line 763 of file cmultilinetextbox.cxx.

◆ moveCursorLeft()

void CMultiLineTextBox::moveCursorLeft ( void  )
protectedvirtual

Move cursor one character to the left.

Definition at line 710 of file cmultilinetextbox.cxx.

◆ moveCursorRight()

void CMultiLineTextBox::moveCursorRight ( void  )
protectedvirtual

Move cursor one character to the right.

Definition at line 724 of file cmultilinetextbox.cxx.

◆ moveCursorToPosition()

void CMultiLineTextBox::moveCursorToPosition ( const int  position)
virtual

Move the cursor to the text position specified. 0 indicates the start of the string. If position is greater than the length of the string, the cursor is moved to the end of the string.

Parameters
positionThe new cursor position.

Implements NXWidgets::ITextBox.

Definition at line 386 of file cmultilinetextbox.cxx.

◆ moveCursorUp()

void CMultiLineTextBox::moveCursorUp ( void  )
protectedvirtual

Move cursor one row upwards.

Definition at line 738 of file cmultilinetextbox.cxx.

◆ onClick()

void CMultiLineTextBox::onClick ( nxgl_coord_t  x,
nxgl_coord_t  y 
)
protectedvirtual

Starts the dragging system.

Parameters
xThe x coordinate of the click.
yThe y coordinate of the click.

Reimplemented from NXWidgets::CScrollingPanel.

Definition at line 939 of file cmultilinetextbox.cxx.

◆ onDoubleClick()

void CMultiLineTextBox::onDoubleClick ( nxgl_coord_t  x,
nxgl_coord_t  y 
)
protectedvirtual

Opens the keyboard on the bottom display.

Parameters
xThe x coordinates of the click.
yThe y coordinates of the click.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 963 of file cmultilinetextbox.cxx.

◆ onResize()

void CMultiLineTextBox::onResize ( nxgl_coord_t  width,
nxgl_coord_t  height 
)
protectedvirtual

Resize the textbox to the new dimensions.

Parameters
widthThe new width.
heightThe new height.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 899 of file cmultilinetextbox.cxx.

◆ processPhysicalKey()

void NXWidgets::CMultiLineTextBox::processPhysicalKey ( nxwidget_char_t  key)
protected

Handles physical button presses. Moves the cursor in the direction pressed.

Parameters
keyThe key that was pressed.

◆ removeText() [1/2]

void CMultiLineTextBox::removeText ( const unsigned int  startIndex)
virtual

Remove all characters from the string from the start index onwards.

Parameters
startIndexIndex to remove from.

Implements NXWidgets::ITextBox.

Definition at line 290 of file cmultilinetextbox.cxx.

◆ removeText() [2/2]

void CMultiLineTextBox::removeText ( const unsigned int  startIndex,
const unsigned int  count 
)
virtual

Remove specified number of characters from the string from the start index onwards.

Parameters
startIndexIndex to remove from.
countNumber of characters to remove.

Implements NXWidgets::ITextBox.

Definition at line 303 of file cmultilinetextbox.cxx.

◆ setFont()

void CMultiLineTextBox::setFont ( CNxFont font)
virtual

Set the font used in the textbox.

Parameters
fontPointer to the new font.

Reimplemented from NXWidgets::CNxWidget.

Definition at line 331 of file cmultilinetextbox.cxx.

◆ setLineSpacing()

virtual void NXWidgets::CMultiLineTextBox::setLineSpacing ( nxgl_coord_t  lineSpacing)
inlinevirtual

Set the line spacing of the text.

Parameters
spacingExtra space (in pixels) to add between lines.

Definition at line 538 of file cmultilinetextbox.hxx.

◆ setText()

void CMultiLineTextBox::setText ( const CNxString text)
virtual

Set the text displayed in the textbox.

Parameters
textString to display.

Implements NXWidgets::ITextBox.

Definition at line 237 of file cmultilinetextbox.cxx.

◆ setTextAlignmentHoriz()

void CMultiLineTextBox::setTextAlignmentHoriz ( TextAlignmentHoriz  alignment)
virtual

Set the horizontal alignment of text within the textbox.

Parameters
alignmentThe horizontal position of the text.

Definition at line 168 of file cmultilinetextbox.cxx.

◆ setTextAlignmentVert()

void CMultiLineTextBox::setTextAlignmentVert ( TextAlignmentVert  alignment)
virtual

Set the vertical alignment of text within the textbox.

Parameters
alignmentThe vertical position of the text.

Definition at line 180 of file cmultilinetextbox.cxx.

◆ showCursor() [1/2]

void CMultiLineTextBox::showCursor ( EShowCursor  cursorMode)
virtual

Sets the cursor display mode.

Parameters
cursorModeDetermines cursor display mode

Implements NXWidgets::ITextBox.

Definition at line 369 of file cmultilinetextbox.cxx.

◆ showCursor() [2/2]

virtual void NXWidgets::CMultiLineTextBox::showCursor ( void  )
inlinevirtual

Shows the cursor in default mode (only when the TextBox has focus).

Definition at line 563 of file cmultilinetextbox.hxx.

◆ wrapCursor()

virtual void NXWidgets::CMultiLineTextBox::wrapCursor ( bool  wrap)
inlinevirtual

Enables/disables cursor wrapping

Parameters
wrapTrue enables cursor wrapping

Implements NXWidgets::ITextBox.

Definition at line 583 of file cmultilinetextbox.hxx.

Member Data Documentation

◆ m_cursorPos

int NXWidgets::CMultiLineTextBox::m_cursorPos
protected

Position of the cursor within the string.

Definition at line 152 of file cmultilinetextbox.hxx.

◆ m_hAlignment

TextAlignmentHoriz NXWidgets::CMultiLineTextBox::m_hAlignment
protected

Horizontal alignment of the text.

Definition at line 150 of file cmultilinetextbox.hxx.

◆ m_maxRows

nxgl_coord_t NXWidgets::CMultiLineTextBox::m_maxRows
protected

Maximum number of rows that the textbox should buffer.

Definition at line 146 of file cmultilinetextbox.hxx.

◆ m_showCursor

uint8_t NXWidgets::CMultiLineTextBox::m_showCursor
protected

Cursor visibility.

Definition at line 154 of file cmultilinetextbox.hxx.

◆ m_text

CText* NXWidgets::CMultiLineTextBox::m_text
protected

CText object that manipulates and wraps the raw text string.

Definition at line 142 of file cmultilinetextbox.hxx.

◆ m_topRow

int32_t NXWidgets::CMultiLineTextBox::m_topRow
protected

Index of the top row of text currently displayed.

Definition at line 148 of file cmultilinetextbox.hxx.

◆ m_vAlignment

TextAlignmentVert NXWidgets::CMultiLineTextBox::m_vAlignment
protected

Vertical alignment of the text.

Definition at line 151 of file cmultilinetextbox.hxx.

◆ m_visibleRows

uint8_t NXWidgets::CMultiLineTextBox::m_visibleRows
protected

Total number of rows that the textbox can display at once.

Definition at line 144 of file cmultilinetextbox.hxx.

◆ m_wrapCursor

bool NXWidgets::CMultiLineTextBox::m_wrapCursor
protected

True wrap cursor at the ends of the text

Definition at line 155 of file cmultilinetextbox.hxx.


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