Planeshift
Classes | Public Member Functions | Protected Member Functions | Protected Attributes

pawsEditTextBox Class Reference

An edit box widget/. More...

#include <pawstextbox.h>

List of all members.

Classes

struct  Word
 struct to contain the end boundry of a word and it's spellcheck status More...

Public Member Functions

void Clear ()
virtual void Draw ()
 Draws the widget and all of it's children.
virtual int GetBorderStyle ()
 This returns the BORDER_BUMP style.
virtual bool GetFocusOverridesControls () const
 Test if the widget should intercept all key presses.
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 ()
unsigned int GetTopLine ()
 Set & Get top line funcs.
unsigned int getTypoColour ()
 Method the get the current colour used for typos.
virtual bool OnClipboard (const csString &content)
 Called as a callback to a request for clipboard content if avaliabe.
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 void OnUpdateData (const char *dataname, PAWSData &data)
 pawsEditTextBox ()
 pawsEditTextBox (const pawsEditTextBox &origin)
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 SetMultiline (bool multi)
void SetPassword (bool pass)
void SetSizeByText ()
 Sets size of the widget to fit the text that it displays.
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 (unsigned int newTopLine)
void setTypoColour (unsigned int col)
 Method to set the colour used for typos.
bool Setup (iDocumentNode *node)
 Setup this widget.
void toggleSpellChecked ()
 toggels the current setting of the spellchecker
virtual ~pawsEditTextBox ()

Protected Member Functions

void checkSpelling ()
 Helper method that does the actual spellchecking.

Protected Attributes

bool blink
 The current blink status.
csTicks blinkTicks
 Keep track of ticks for flashing.
csRef< iVirtualClock > clock
unsigned int cursorLine
size_t cursorPosition
 The position of the cursor blink (in code units not points)
int lineHeight
unsigned int maxLen
 The maximum length the text is allowed to be.
size_t maxLines
bool multiLine
bool password
bool spellChecked
 Should the text be checked by the spellchecker plugin (if available)
csRef< iSpellChecker > spellChecker
 PS spellChecker plugin.
int start
 Position of first character that we display.
csString text
 Current input line.
unsigned int topLine
unsigned int typoColour
 Colour used for typos.
size_t usedLines
pawsScrollBarvScrollBar
csArray< Wordwords
 Array that contains the boundries of the words and if the spellchecker recognizes them or not.

Detailed Description

An edit box widget/.

Definition at line 409 of file pawstextbox.h.


Constructor & Destructor Documentation

pawsEditTextBox::pawsEditTextBox ( )
virtual pawsEditTextBox::~pawsEditTextBox ( ) [virtual]
pawsEditTextBox::pawsEditTextBox ( const pawsEditTextBox origin)

Member Function Documentation

void pawsEditTextBox::checkSpelling ( ) [protected]

Helper method that does the actual spellchecking.

Called from OnKeyDown

void pawsEditTextBox::Clear ( )
virtual void pawsEditTextBox::Draw ( ) [virtual]

Draws the widget and all of it's children.

Remarks:
Uses clipping rect of it's parent to define drawing area. If the drawing area defined is empty it returns.

Reimplemented from pawsWidget.

virtual int pawsEditTextBox::GetBorderStyle ( ) [inline, virtual]

This returns the BORDER_BUMP style.

Remarks:
Other styles available include: BORDER_RAISED, BORDER_SUNKEN and BORDER_ETCHED.

Reimplemented from pawsWidget.

Definition at line 456 of file pawstextbox.h.

virtual bool pawsEditTextBox::GetFocusOverridesControls ( ) const [inline, virtual]

Test if the widget should intercept all key presses.

Remarks:
False by default, should be true for text entry widgets

Reimplemented from pawsWidget.

Definition at line 485 of file pawstextbox.h.

unsigned int pawsEditTextBox::GetMaxLength ( ) const [inline]

Returns the max length for the text box.

Returns:
maxLen

Definition at line 499 of file pawstextbox.h.

unsigned int pawsEditTextBox::GetRemainingChars ( ) const [inline]

Gets the remaining characters that can be input.

Returns:
Remaining characters or UINT_MAX if no max length specified

Definition at line 507 of file pawstextbox.h.

bool pawsEditTextBox::getSpellChecked ( ) const [inline]

returns if the spellchecker is used in this widget

Definition at line 516 of file pawstextbox.h.

const char* pawsEditTextBox::GetText ( ) [inline]

Definition at line 422 of file pawstextbox.h.

unsigned int pawsEditTextBox::GetTopLine ( ) [inline]

Set & Get top line funcs.

Definition at line 471 of file pawstextbox.h.

unsigned int pawsEditTextBox::getTypoColour ( ) [inline]

Method the get the current colour used for typos.

Definition at line 537 of file pawstextbox.h.

virtual bool pawsEditTextBox::OnClipboard ( const csString &  content) [virtual]

Called as a callback to a request for clipboard content if avaliabe.

Note:
Only implemented for unix

Reimplemented from pawsWidget.

bool pawsEditTextBox::OnKeyDown ( utf32_char  keyCode,
utf32_char  keyChar,
int  modifiers 
) [virtual]

Process keydown messages.

Parameters:
keyCodeThe code for the pressed key.
keyCharThe key pressed.
modifiersUsed to modify tab behavior.
Returns:
bool TRUE for success FALSE if no action.
Remarks:
If you override this, be sure to also override GetFocusOverridesControls() as returning true

Reimplemented from pawsWidget.

virtual bool pawsEditTextBox::OnMouseDown ( int  button,
int  modifiers,
int  x,
int  y 
) [virtual]

Manage mouse down event to test for and apply window changes.

Parameters:
buttonType of button: 1 resizable or movable, 2 context menu or config window.
modifiersUsed with PAWS_CONSTRUCTION.
xUsed to test for resize.
yUsed to test for resize.
Returns:
bool TRUE if movable or resizable.
Remarks:
calls OnMouseDown on it's parent.

Reimplemented from pawsWidget.

virtual void pawsEditTextBox::OnUpdateData ( const char *  dataname,
PAWSData data 
) [virtual]

Reimplemented from pawsWidget.

bool pawsEditTextBox::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 pawsEditTextBox::SetCursorPosition ( size_t  pos) [inline]

Definition at line 480 of file pawstextbox.h.

void pawsEditTextBox::SetMaxLength ( unsigned int  maxlen)

Sets the max length for the text box.

Parameters:
maxlenThe value to set for the max length
void pawsEditTextBox::SetMultiline ( bool  multi)
void pawsEditTextBox::SetPassword ( bool  pass)
void pawsEditTextBox::SetSizeByText ( )

Sets size of the widget to fit the text that it displays.

void pawsEditTextBox::setSpellChecked ( const bool  check) [inline]

set if the spellchecker should be used

Parameters:
checktrue if the spellchecker should be used (the spellchecker will still be only used if the plugin is available)

Definition at line 524 of file pawstextbox.h.

void pawsEditTextBox::SetText ( const char *  text,
bool  publish = true 
)

Change the text in the edit box.

Parameters:
textThe text that will replace whatever is currently there.
publishPublish the text.
void pawsEditTextBox::SetTopLine ( unsigned int  newTopLine) [inline]

Definition at line 475 of file pawstextbox.h.

void pawsEditTextBox::setTypoColour ( unsigned int  col) [inline]

Method to set the colour used for typos.

Parameters:
colThe new colour to be used for typos

Definition at line 544 of file pawstextbox.h.

bool pawsEditTextBox::Setup ( iDocumentNode *  ) [virtual]

Setup this widget.

Reimplemented from pawsWidget.

void pawsEditTextBox::toggleSpellChecked ( ) [inline]

toggels the current setting of the spellchecker

Definition at line 531 of file pawstextbox.h.


Member Data Documentation

bool pawsEditTextBox::blink [protected]

The current blink status.

Definition at line 571 of file pawstextbox.h.

csTicks pawsEditTextBox::blinkTicks [protected]

Keep track of ticks for flashing.

Definition at line 574 of file pawstextbox.h.

csRef<iVirtualClock> pawsEditTextBox::clock [protected]

Definition at line 561 of file pawstextbox.h.

Definition at line 568 of file pawstextbox.h.

size_t pawsEditTextBox::cursorPosition [protected]

The position of the cursor blink (in code units not points)

Definition at line 567 of file pawstextbox.h.

Definition at line 581 of file pawstextbox.h.

The maximum length the text is allowed to be.

Definition at line 589 of file pawstextbox.h.

size_t pawsEditTextBox::maxLines [protected]

Definition at line 582 of file pawstextbox.h.

bool pawsEditTextBox::multiLine [protected]

Definition at line 579 of file pawstextbox.h.

bool pawsEditTextBox::password [protected]

Definition at line 560 of file pawstextbox.h.

Should the text be checked by the spellchecker plugin (if available)

Definition at line 597 of file pawstextbox.h.

csRef<iSpellChecker> pawsEditTextBox::spellChecker [protected]

PS spellChecker plugin.

Definition at line 594 of file pawstextbox.h.

Position of first character that we display.

Definition at line 564 of file pawstextbox.h.

csString pawsEditTextBox::text [protected]

Current input line.

Definition at line 577 of file pawstextbox.h.

Definition at line 587 of file pawstextbox.h.

Colour used for typos.

Definition at line 600 of file pawstextbox.h.

size_t pawsEditTextBox::usedLines [protected]

Definition at line 585 of file pawstextbox.h.

Definition at line 591 of file pawstextbox.h.

Array that contains the boundries of the words and if the spellchecker recognizes them or not.

Definition at line 603 of file pawstextbox.h.


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