Planeshift
|
#include <pawstextbox.h>
Classes | |
struct | MessageLine |
struct | Word |
struct to contain the end boundry of a word and it's spellcheck status More... | |
Public Member Functions | |
virtual void | CalcMouseClick (int x, int y, size_t &cursorLine, size_t &cursorChar) |
void | Clear () |
virtual void | Draw () |
Draws the widget and all of it's children. | |
void | DrawWidgetText (const char *text, size_t x, size_t y, int style, int fg, int visLine) |
bool | EndsWithNewLine (int lineNumber) |
char | GetAt (size_t destLine, size_t destCursor) |
virtual int | GetBorderStyle () |
This returns the BORDER_BUMP style. | |
void | GetCursorLocation (size_t pos, size_t &destLine, size_t &destCursor) |
size_t | GetCursorPosition () |
size_t | GetCursorPosition (size_t destLine, size_t destCursor) |
virtual bool | GetFocusOverridesControls () const |
Test if the widget should intercept all key presses. | |
csString | GetLine (size_t line) |
void | GetLinePos (size_t lineNumber, size_t &start, size_t &end) |
void | GetLineRelative (size_t pos, size_t &start, size_t &end) |
int | GetLinesPerPage () |
int | GetLineWidth (int lineNumber) |
unsigned int | GetMaxLength () const |
Returns the max length for the text box. | |
unsigned int | GetRemainingChars () const |
Gets the remaining characters that can be input. | |
bool | getSpellChecked () const |
returns if the spellchecker is used in this widget | |
const char * | GetText () |
size_t | GetTopLine () |
Set & Get top line funcs. | |
unsigned int | getTypoColour () |
Method the get the current colour used for typos. | |
void | LayoutText () |
virtual bool | OnClipboard (const csString &content) |
Called as a callback to a request for clipboard content if avaliabe. | |
virtual bool | OnKeyDown (utf32_char code, utf32_char key, int modifiers) |
Process keydown messages. | |
virtual bool | OnMouseDown (int button, int modifiers, int x, int y) |
Manage mouse down event to test for and apply window changes. | |
virtual bool | OnMouseUp (int button, int modifiers, int x, int y) |
Manage mouse up event. | |
virtual void | OnResize () |
Sets the new position of the close button. | |
bool | OnScroll (int direction, pawsScrollBar *widget) |
Called whenever a window is scrolled. | |
virtual void | OnUpdateData (const char *dataname, PAWSData &data) |
pawsMultilineEditTextBox () | |
pawsMultilineEditTextBox (const pawsMultilineEditTextBox &origin) | |
void | PushLineInfo (size_t lineLength, size_t lineBreak, int lineExtra) |
bool | SelfPopulate (iDocumentNode *node) |
This function allows a widget to fill in its own contents from an xml node supplied. | |
void | SetCursorPosition (size_t pos) |
void | SetMaxLength (unsigned int maxlen) |
Sets the max length for the text box. | |
void | setSpellChecked (const bool check) |
set if the spellchecker should be used | |
void | SetText (const char *text, bool publish=true) |
Change the text in the edit box. | |
void | SetTopLine (size_t newTopLine) |
void | setTypoColour (unsigned int col) |
Method to set the colour used for typos. | |
bool | Setup (iDocumentNode *node) |
Setup this widget. | |
virtual void | SetupScrollBar () |
void | toggleSpellChecked () |
toggels the current setting of the spellchecker | |
void | UpdateScrollBar () |
virtual | ~pawsMultilineEditTextBox () |
Protected Member Functions | |
void | checkSpelling () |
Helper method that does the actual spellchecking. | |
void | drawTextSpellChecked (iFont *font, int x, int y, int fg, csString str, int visLine) |
Helper method for printing text if the spellchecker is enabled. | |
Protected Attributes | |
bool | blink |
The current blink status. | |
csTicks | blinkTicks |
Keep track of ticks for flashing. | |
size_t | canDrawLines |
csRef< iVirtualClock > | clock |
size_t | cursorLine |
size_t | cursorLoc |
size_t | cursorPosition |
int | lineHeight |
csPDelArray< MessageLine > | lineInfo |
csArray< csArray< Word > > | lineTypos |
int | maxHeight |
unsigned int | maxLen |
The maximum length the text is allowed to be. | |
int | maxWidth |
bool | spellChecked |
csRef< iSpellChecker > | spellChecker |
csString | text |
Concatenated contents of lines, only valid after GetText() | |
csString | tmp |
size_t | topLine |
unsigned int | typoColour |
Colour used for typos. | |
bool | usingScrollBar |
pawsScrollBar * | vScrollBar |
int | vScrollBarWidth |
int | yPos |
Definition at line 740 of file pawstextbox.h.
pawsMultilineEditTextBox::pawsMultilineEditTextBox | ( | ) |
virtual pawsMultilineEditTextBox::~pawsMultilineEditTextBox | ( | ) | [virtual] |
pawsMultilineEditTextBox::pawsMultilineEditTextBox | ( | const pawsMultilineEditTextBox & | origin | ) |
virtual void pawsMultilineEditTextBox::CalcMouseClick | ( | int | x, |
int | y, | ||
size_t & | cursorLine, | ||
size_t & | cursorChar | ||
) | [virtual] |
void pawsMultilineEditTextBox::checkSpelling | ( | ) | [protected] |
Helper method that does the actual spellchecking.
Only checks the currently visible text. Called from OnKeyDown and LayoutText
void pawsMultilineEditTextBox::Clear | ( | ) | [inline] |
Definition at line 819 of file pawstextbox.h.
virtual void pawsMultilineEditTextBox::Draw | ( | ) | [virtual] |
Draws the widget and all of it's children.
Reimplemented from pawsWidget.
void pawsMultilineEditTextBox::drawTextSpellChecked | ( | iFont * | font, |
int | x, | ||
int | y, | ||
int | fg, | ||
csString | str, | ||
int | visLine | ||
) | [protected] |
Helper method for printing text if the spellchecker is enabled.
font | The font used for the text. Needed to determine the width in pixel of words |
x | X-Position where the text should be printed |
y | Y-Position where the text should be printed |
fg | The color of the text. This is only used for correct words. Typos use the typeColour (but the alpha from this color) |
str | The text |
visLine | the number (counting from top=0) of the current visual line. Needed for the spellchecker to choose the correct word-boundries from lineTypos |
void pawsMultilineEditTextBox::DrawWidgetText | ( | const char * | text, |
size_t | x, | ||
size_t | y, | ||
int | style, | ||
int | fg, | ||
int | visLine | ||
) |
bool pawsMultilineEditTextBox::EndsWithNewLine | ( | int | lineNumber | ) |
char pawsMultilineEditTextBox::GetAt | ( | size_t | destLine, |
size_t | destCursor | ||
) |
virtual int pawsMultilineEditTextBox::GetBorderStyle | ( | ) | [inline, virtual] |
This returns the BORDER_BUMP style.
Reimplemented from pawsWidget.
Definition at line 789 of file pawstextbox.h.
void pawsMultilineEditTextBox::GetCursorLocation | ( | size_t | pos, |
size_t & | destLine, | ||
size_t & | destCursor | ||
) |
size_t pawsMultilineEditTextBox::GetCursorPosition | ( | ) |
size_t pawsMultilineEditTextBox::GetCursorPosition | ( | size_t | destLine, |
size_t | destCursor | ||
) |
virtual bool pawsMultilineEditTextBox::GetFocusOverridesControls | ( | ) | const [inline, virtual] |
Test if the widget should intercept all key presses.
Reimplemented from pawsWidget.
Definition at line 782 of file pawstextbox.h.
csString pawsMultilineEditTextBox::GetLine | ( | size_t | line | ) |
void pawsMultilineEditTextBox::GetLinePos | ( | size_t | lineNumber, |
size_t & | start, | ||
size_t & | end | ||
) |
void pawsMultilineEditTextBox::GetLineRelative | ( | size_t | pos, |
size_t & | start, | ||
size_t & | end | ||
) |
int pawsMultilineEditTextBox::GetLinesPerPage | ( | ) | [inline] |
Definition at line 890 of file pawstextbox.h.
Returns the max length for the text box.
Definition at line 840 of file pawstextbox.h.
Gets the remaining characters that can be input.
Definition at line 848 of file pawstextbox.h.
bool pawsMultilineEditTextBox::getSpellChecked | ( | ) | const [inline] |
returns if the spellchecker is used in this widget
Definition at line 857 of file pawstextbox.h.
const char* pawsMultilineEditTextBox::GetText | ( | ) |
size_t pawsMultilineEditTextBox::GetTopLine | ( | ) | [inline] |
Set & Get top line funcs.
Definition at line 805 of file pawstextbox.h.
Method the get the current colour used for typos.
Definition at line 878 of file pawstextbox.h.
void pawsMultilineEditTextBox::LayoutText | ( | ) |
virtual bool pawsMultilineEditTextBox::OnClipboard | ( | const csString & | content | ) | [virtual] |
Called as a callback to a request for clipboard content if avaliabe.
Reimplemented from pawsWidget.
virtual bool pawsMultilineEditTextBox::OnKeyDown | ( | utf32_char | keyCode, |
utf32_char | keyChar, | ||
int | modifiers | ||
) | [virtual] |
Process keydown messages.
keyCode | The code for the pressed key. |
keyChar | The key pressed. |
modifiers | Used to modify tab behavior. |
Reimplemented from pawsWidget.
virtual bool pawsMultilineEditTextBox::OnMouseDown | ( | int | button, |
int | modifiers, | ||
int | x, | ||
int | y | ||
) | [virtual] |
Manage mouse down event to test for and apply window changes.
button | Type of button: 1 resizable or movable, 2 context menu or config window. |
modifiers | Used with PAWS_CONSTRUCTION. |
x | Used to test for resize. |
y | Used to test for resize. |
Reimplemented from pawsWidget.
virtual bool pawsMultilineEditTextBox::OnMouseUp | ( | int | button, |
int | modifiers, | ||
int | x, | ||
int | y | ||
) | [virtual] |
Manage mouse up event.
Reimplemented from pawsWidget.
virtual void pawsMultilineEditTextBox::OnResize | ( | ) | [virtual] |
Sets the new position of the close button.
Reimplemented from pawsWidget.
bool pawsMultilineEditTextBox::OnScroll | ( | int | scrollDirection, |
pawsScrollBar * | widget | ||
) | [virtual] |
Called whenever a window is scrolled.
scrollDirection | The direction to move. |
widget | The scrollbar widget being manipulated. |
Reimplemented from pawsWidget.
virtual void pawsMultilineEditTextBox::OnUpdateData | ( | const char * | dataname, |
PAWSData & | data | ||
) | [virtual] |
Reimplemented from pawsWidget.
void pawsMultilineEditTextBox::PushLineInfo | ( | size_t | lineLength, |
size_t | lineBreak, | ||
int | lineExtra | ||
) |
bool pawsMultilineEditTextBox::SelfPopulate | ( | iDocumentNode * | node | ) | [virtual] |
This function allows a widget to fill in its own contents from an xml node supplied.
This is NOT the same as Setup, which is defining height, width, styles, etc. This is data.
Reimplemented from pawsWidget.
void pawsMultilineEditTextBox::SetCursorPosition | ( | size_t | pos | ) | [inline] |
Definition at line 815 of file pawstextbox.h.
Sets the max length for the text box.
maxlen | The value to set for the max length |
void pawsMultilineEditTextBox::setSpellChecked | ( | const bool | check | ) | [inline] |
set if the spellchecker should be used
check | true if the spellchecker should be used (the spellchecker will still be only used if the plugin is available) |
Definition at line 865 of file pawstextbox.h.
void pawsMultilineEditTextBox::SetText | ( | const char * | text, |
bool | publish = true |
||
) |
Change the text in the edit box.
text | The text that will replace whatever is currently there. |
publish | Publish the text. |
void pawsMultilineEditTextBox::SetTopLine | ( | size_t | newTopLine | ) | [inline] |
Definition at line 809 of file pawstextbox.h.
Method to set the colour used for typos.
col | The new colour to be used for typos |
Definition at line 885 of file pawstextbox.h.
bool pawsMultilineEditTextBox::Setup | ( | iDocumentNode * | ) | [virtual] |
Setup this widget.
Reimplemented from pawsWidget.
virtual void pawsMultilineEditTextBox::SetupScrollBar | ( | ) | [virtual] |
void pawsMultilineEditTextBox::toggleSpellChecked | ( | ) | [inline] |
toggels the current setting of the spellchecker
Definition at line 872 of file pawstextbox.h.
void pawsMultilineEditTextBox::UpdateScrollBar | ( | ) |
bool pawsMultilineEditTextBox::blink [protected] |
The current blink status.
Definition at line 928 of file pawstextbox.h.
csTicks pawsMultilineEditTextBox::blinkTicks [protected] |
Keep track of ticks for flashing.
Definition at line 931 of file pawstextbox.h.
size_t pawsMultilineEditTextBox::canDrawLines [protected] |
Definition at line 940 of file pawstextbox.h.
csRef<iVirtualClock> pawsMultilineEditTextBox::clock [protected] |
Definition at line 918 of file pawstextbox.h.
size_t pawsMultilineEditTextBox::cursorLine [protected] |
Definition at line 924 of file pawstextbox.h.
size_t pawsMultilineEditTextBox::cursorLoc [protected] |
Definition at line 925 of file pawstextbox.h.
size_t pawsMultilineEditTextBox::cursorPosition [protected] |
Definition at line 921 of file pawstextbox.h.
int pawsMultilineEditTextBox::lineHeight [protected] |
Definition at line 936 of file pawstextbox.h.
csPDelArray<MessageLine> pawsMultilineEditTextBox::lineInfo [protected] |
Definition at line 935 of file pawstextbox.h.
csArray<csArray<Word> > pawsMultilineEditTextBox::lineTypos [protected] |
Definition at line 965 of file pawstextbox.h.
int pawsMultilineEditTextBox::maxHeight [protected] |
Definition at line 948 of file pawstextbox.h.
unsigned int pawsMultilineEditTextBox::maxLen [protected] |
The maximum length the text is allowed to be.
Definition at line 954 of file pawstextbox.h.
int pawsMultilineEditTextBox::maxWidth [protected] |
Definition at line 947 of file pawstextbox.h.
bool pawsMultilineEditTextBox::spellChecked [protected] |
Definition at line 960 of file pawstextbox.h.
csRef<iSpellChecker> pawsMultilineEditTextBox::spellChecker [protected] |
Definition at line 957 of file pawstextbox.h.
csString pawsMultilineEditTextBox::text [protected] |
Concatenated contents of lines, only valid after GetText()
Definition at line 934 of file pawstextbox.h.
csString pawsMultilineEditTextBox::tmp [protected] |
Definition at line 951 of file pawstextbox.h.
size_t pawsMultilineEditTextBox::topLine [protected] |
Definition at line 942 of file pawstextbox.h.
unsigned int pawsMultilineEditTextBox::typoColour [protected] |
Colour used for typos.
Definition at line 963 of file pawstextbox.h.
bool pawsMultilineEditTextBox::usingScrollBar [protected] |
Definition at line 945 of file pawstextbox.h.
pawsScrollBar* pawsMultilineEditTextBox::vScrollBar [protected] |
Definition at line 943 of file pawstextbox.h.
int pawsMultilineEditTextBox::vScrollBarWidth [protected] |
Definition at line 939 of file pawstextbox.h.
int pawsMultilineEditTextBox::yPos [protected] |
Definition at line 950 of file pawstextbox.h.