NXWidgets: NXWidgets::ITextBox Class Reference

NXWidgets 1.19

Public Member Functions | List of all members
NXWidgets::ITextBox Class Referenceabstract

`#include <itextbox.hxx>`

Inheritance diagram for NXWidgets::ITextBox:

## Public Member Functions
virtual | ~ITextBox (void)
virtual void | showCursor (EShowCursor cursorMode)=0
virtual void | wrapCursor (bool wrap)=0
virtual void | setText (const CNxString &text)=0
virtual void | appendText (const CNxString &text)=0
virtual void | removeText (const unsigned int startIndex)=0
virtual void | removeText (const unsigned int startIndex, const unsigned int count)=0
virtual void | insertText (const CNxString &text, const unsigned int index)=0
virtual void | insertTextAtCursor (const CNxString &text)=0
virtual void | moveCursorToPosition (const int position)=0
virtual const int | getCursorPosition (void) const =0

## Detailed Description

Defines the interface that textbox-like classes should implement.

Definition at line 115 of file itextbox.hxx.

## Constructor & Destructor Documentation

## ◆ ~ITextBox()

virtual NXWidgets::ITextBox::~ITextBox | ( | void |  | ) |
| inlinevirtual

A virtual destructor is required in order to override the ITextBox destructor. We do this because if we delete ITextBox, we want the destructor of the class that inherits from ITextBox to run, not this one.

Definition at line 125 of file itextbox.hxx.

## Member Function Documentation

## ◆ appendText()

virtual void NXWidgets::ITextBox::appendText | ( | const CNxString & | text | ) |
| pure virtual

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

Parameters

  text | String to append.

Implemented in NXWidgets::CMultiLineTextBox, NXWidgets::CTextBox, and NXWidgets::CScrollingTextBox.

## ◆ getCursorPosition()

virtual const int NXWidgets::ITextBox::getCursorPosition | ( | void |  | ) | const
| pure virtual

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

Returns
  position The cursor position.

Implemented in NXWidgets::CMultiLineTextBox, NXWidgets::CTextBox, and NXWidgets::CScrollingTextBox.

## ◆ insertText()

virtual void NXWidgets::ITextBox::insertText | ( | const CNxString & | text,
|  | const unsigned int | index
| ) |  |
| pure virtual

Insert text at the specified index.

Parameters

  text | The text to insert.
  index | Index at which to insert the text.

Implemented in NXWidgets::CMultiLineTextBox, NXWidgets::CScrollingTextBox, and NXWidgets::CTextBox.

## ◆ insertTextAtCursor()

virtual void NXWidgets::ITextBox::insertTextAtCursor | ( | const CNxString & | text | ) |
| pure virtual

Insert text at the current cursor position.

Parameters

  text | The text to insert.

Implemented in NXWidgets::CMultiLineTextBox, NXWidgets::CScrollingTextBox, and NXWidgets::CTextBox.

## ◆ moveCursorToPosition()

virtual void NXWidgets::ITextBox::moveCursorToPosition | ( | const int | position | ) |
| pure 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

  position | The new cursor position.

Implemented in NXWidgets::CMultiLineTextBox, and NXWidgets::CTextBox.

## ◆ removeText() [1/2]

virtual void NXWidgets::ITextBox::removeText | ( | const unsigned int | startIndex | ) |
| pure virtual

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

Parameters

  startIndex | Index to remove from.

Implemented in NXWidgets::CMultiLineTextBox, NXWidgets::CTextBox, and NXWidgets::CScrollingTextBox.

## ◆ removeText() [2/2]

virtual void NXWidgets::ITextBox::removeText | ( | const unsigned int | startIndex,
|  | const unsigned int | count
| ) |  |
| pure virtual

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

Parameters

  startIndex | Index to remove from.
  count | Number of characters to remove.

Implemented in NXWidgets::CMultiLineTextBox, NXWidgets::CTextBox, and NXWidgets::CScrollingTextBox.

## ◆ setText()

virtual void NXWidgets::ITextBox::setText | ( | const CNxString & | text | ) |
| pure virtual

Set the text displayed in the label.

Parameters

  text | String to display.

Implemented in NXWidgets::CMultiLineTextBox, NXWidgets::CTextBox, and NXWidgets::CScrollingTextBox.

## ◆ showCursor()

virtual void NXWidgets::ITextBox::showCursor | ( | EShowCursor | cursorMode | ) |
| pure virtual

Sets the cursor display mode.

Parameters

  cursorMode | Determines cursor display mode

Implemented in NXWidgets::CMultiLineTextBox, NXWidgets::CScrollingTextBox, and NXWidgets::CTextBox.

## ◆ wrapCursor()

virtual void NXWidgets::ITextBox::wrapCursor | ( | bool | wrap | ) |
| pure virtual

Enables/disables cursor wrapping

Parameters

  wrap | True enables cursor wrapping

Implemented in NXWidgets::CMultiLineTextBox, NXWidgets::CScrollingTextBox, and NXWidgets::CTextBox.

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

- itextbox.hxx