nGuiTextView Class Reference
[Graphical User Interface]
#include <nguitextview.h>
Inheritance diagram for nGuiTextView:

Detailed Description
A multiline text viewing widgets, which can display lines of text.This is the basis for more advanced widgets which need to display text in multiple lines.
(C) 2004 RadonLabs GmbH
Definition at line 21 of file nguitextview.h.
Public Member Functions | |
| nGuiTextView () | |
| constructor | |
| virtual | ~nGuiTextView () |
| destructor | |
| void | SetFont (const nString &fontName) |
| set the font to use (see nGuiServer::AddFont()) | |
| const nString & | GetFont () const |
| get the font definition | |
| void | SetTextColor (const vector4 &c) |
| set text color | |
| const vector4 & | GetTextColor () const |
| get text color | |
| void | SetBorder (float b) |
| set horizontal border | |
| float | GetBorder () const |
| get horizontal border | |
| virtual void | BeginAppend () |
| begin appending text | |
| virtual void | AppendLine (const nString &t) |
| append a line of text (copies the text) | |
| virtual void | AppendColoredLine (const nString &t, const vector4 &color) |
| append a colored line of text (copies the text) | |
| virtual void | AppendEmptyLine () |
| append a empty line | |
| virtual void | AppendText (const nString &t) |
| append a text (copies the text), breaks into lines | |
| virtual void | AppendColoredText (const nString &t, const vector4 &color) |
| append a text (copies the text), breaks into lines | |
| void | EndAppend () |
| finish appending text | |
| const nString & | GetLineAt (int i) const |
| get line at index | |
| void | SetLineOffset (int i) |
| set the line offset (the index of the first visible line) | |
| int | GetLineOffset () const |
| get the line offset | |
| void | SetSelectionEnabled (bool b) |
| enable/disable selection handling | |
| bool | GetSelectionEnabled () const |
| get selection handling flag | |
| void | SetLookUpEnabled (bool b) |
| set selection index | |
| bool | GetLookUpEnabled () const |
| get selection handling flag | |
| void | SetSelectionIndex (int i) |
| set selection index | |
| int | GetSelectionIndex () const |
| get the selection index | |
| const char * | GetSelection () const |
| get the currently selected text, or 0 if nothing selected | |
| virtual int | GetNumLines () const |
| get overall number of lines | |
| int | GetNumVisibleLines () |
| get the number of lines that would currently fit into the text view | |
| virtual void | OnShow () |
| called when widget is becoming visible | |
| virtual void | OnHide () |
| called when widget is becoming invisible | |
| virtual void | OnRectChange (const rectangle &newRect) |
| called when widget position or size changes | |
| virtual void | OnFrame () |
| called per frame when parent widget is visible | |
| virtual void | OnEvent (const nGuiEvent &event) |
| notify widget of an event | |
| virtual bool | OnButtonDown (const vector2 &mousePos) |
| handle button down | |
| virtual bool | OnKeyDown (nKey key) |
| handle key down | |
| virtual void | ScrollToLastLine () |
| snap to the end | |
| virtual bool | Render () |
| rendering | |
| void | ActivateFont () |
| set the font in the gfxserver | |
| void | SetCalculateTextAlwaysWithSlider (bool enable) |
| set if the textfield size will always take the slider into account | |
| bool | GetCalculateTextAlwaysWithSlider () const |
| get if the textfield size will always take the slider into account | |
Protected Member Functions | |
| void | ValidateFont () |
| validate the font resource | |
| void | UpdateSliderValues () |
| update the slider range values | |
| void | UpdateSliderVisibility () |
| update slider visibility status | |
| void | ScrollUp (int numLines) |
| scroll up one line | |
| void | ScrollDown (int numLines) |
| scroll down one line | |
Protected Attributes | |
| nRef< nFont2 > | refFont |
| nRef< nGuiSlider2 > | refSlider |
| nString | fontName |
| float | lineHeight |
| float | border |
| vector4 | textColor |
| nArray< nString > | textArray |
| nArray< vector4 > | colorArray |
| bool | selectionEnabled |
| bool | lookupEnabled |
| int | lineOffset |
| int | selectionIndex |
| bool | calculateTextAlwaysWithSlider |
Constructor & Destructor Documentation
|
|
constructor
Definition at line 19 of file nguitextview_main.cc. |
|
|
destructor
Definition at line 37 of file nguitextview_main.cc. |
Member Function Documentation
|
|
set the font to use (see nGuiServer::AddFont())
Definition at line 348 of file nguitextview.h. |
|
|
get the font definition
Definition at line 358 of file nguitextview.h. |
|
|
set text color
Definition at line 328 of file nguitextview.h. |
|
|
get text color
Definition at line 338 of file nguitextview.h. |
|
|
set horizontal border
Definition at line 137 of file nguitextview.h. |
|
|
get horizontal border
Definition at line 147 of file nguitextview.h. |
|
|
begin appending text
Definition at line 251 of file nguitextview.h. |
|
|
append a line of text (copies the text)
Definition at line 262 of file nguitextview.h. |
|
||||||||||||
|
append a colored line of text (copies the text)
Definition at line 282 of file nguitextview.h. |
|
|
append a empty line
Definition at line 272 of file nguitextview.h. |
|
|
append a text (copies the text), breaks into lines
Definition at line 293 of file nguitextview.h. |
|
||||||||||||
|
append a text (copies the text), breaks into lines
Definition at line 486 of file nguitextview_main.cc. |
|
|
finish appending text
Definition at line 318 of file nguitextview.h. |
|
|
get line at index
Definition at line 368 of file nguitextview.h. |
|
|
set the line offset (the index of the first visible line)
Definition at line 227 of file nguitextview.h. |
|
|
get the line offset
Definition at line 241 of file nguitextview.h. |
|
|
enable/disable selection handling
Definition at line 157 of file nguitextview.h. |
|
|
get selection handling flag
Definition at line 167 of file nguitextview.h. |
|
|
set selection index
Definition at line 177 of file nguitextview.h. |
|
|
get selection handling flag
Definition at line 187 of file nguitextview.h. |
|
|
set selection index
Definition at line 197 of file nguitextview.h. |
|
|
get the selection index
Definition at line 207 of file nguitextview.h. |
|
|
get the currently selected text, or 0 if nothing selected Returns a pointer to the selected text, or 0 if no valid selection exists. Definition at line 380 of file nguitextview.h. |
|
|
get overall number of lines
Definition at line 217 of file nguitextview.h. |
|
|
get the number of lines that would currently fit into the text view Compute the number of lines that would fully fit into this widget. Definition at line 127 of file nguitextview_main.cc. |
|
|
called when widget is becoming visible
Reimplemented from nGuiWidget. Reimplemented in nGuiCmdEntry, nGuiDirLister, and nGuiHardpointsLister. Definition at line 46 of file nguitextview_main.cc. |
|
|
called when widget is becoming invisible
Reimplemented from nGuiWidget. Definition at line 73 of file nguitextview_main.cc. |
|
|
called when widget position or size changes
Reimplemented from nGuiFormLayout. Definition at line 89 of file nguitextview_main.cc. |
|
|
called per frame when parent widget is visible Check if full range of text is visible, and show/hide slider. 23-Nov-04 floh removed the HasFocus(), this doesn't make sense here... Reimplemented from nGuiWidget. Reimplemented in nGuiCmdEntry, nGuiDirLister, and nGuiHardpointsLister. Definition at line 166 of file nguitextview_main.cc. |
|
|
notify widget of an event Listen to events from our slider. Reimplemented from nGuiWidget. Definition at line 189 of file nguitextview_main.cc. |
|
|
handle button down If selection is enabled, the selection index will be updated with the entry under the mouse, and a SelectionChanged event will be thrown. Reimplemented from nGuiWidget. Definition at line 328 of file nguitextview_main.cc. |
|
|
handle key down If selection is enabled, the selection index will be updated with the entry under the mouse, and a SelectionChanged event will be thrown. Reimplemented from nGuiWidget. Reimplemented in nGuiCmdEntry. Definition at line 228 of file nguitextview_main.cc. |
|
|
snap to the end Scroll down to last line Definition at line 405 of file nguitextview_main.cc. |
|
|
rendering Render the widget. Reimplemented from nGuiWidget. Definition at line 421 of file nguitextview_main.cc. |
|
|
set the font in the gfxserver
Definition at line 476 of file nguitextview_main.cc. |
|
|
set if the textfield size will always take the slider into account
Definition at line 398 of file nguitextview.h. |
|
|
get if the textfield size will always take the slider into account
Definition at line 408 of file nguitextview.h. |
|
|
validate the font resource This validates the font resource if not happened yet. Definition at line 104 of file nguitextview_main.cc. |
|
|
update the slider range values
Definition at line 303 of file nguitextview.h. |
|
|
update slider visibility status Show or hide the vertical slider, depending on number of visible lines versus overall number of lines. Definition at line 139 of file nguitextview_main.cc. |
|
|
scroll up one line Scroll up one line. Definition at line 368 of file nguitextview_main.cc. |
|
|
scroll down one line Scroll down one line. Definition at line 388 of file nguitextview_main.cc. |
Member Data Documentation
|
|
Definition at line 116 of file nguitextview.h. |
|
|
Definition at line 117 of file nguitextview.h. |
|
|
Definition at line 119 of file nguitextview.h. |
|
|
Definition at line 120 of file nguitextview.h. |
|
|
Definition at line 121 of file nguitextview.h. |
|
|
Definition at line 122 of file nguitextview.h. |
|
|
Definition at line 123 of file nguitextview.h. |
|
|
Definition at line 124 of file nguitextview.h. |
|
|
Definition at line 125 of file nguitextview.h. |
|
|
Definition at line 126 of file nguitextview.h. |
|
|
Definition at line 127 of file nguitextview.h. |
|
|
Definition at line 128 of file nguitextview.h. |
|
|
Definition at line 129 of file nguitextview.h. |
The documentation for this class was generated from the following files: