Planeshift
|
This is a special type of text box that is used for messages. More...
#include <pawstextbox.h>
Classes | |
struct | MessageLine |
struct | MessageSegment |
Public Member Functions | |
void | AddMessage (const char *data, int colour=-1) |
Add a new message to this box. | |
void | AppendLastMessage (const char *data) |
void | Clear () |
virtual void | Draw () |
Draws the widget and all of it's children. | |
void | FullScroll () |
Sets the scrollbar to 100% (offset=max) | |
virtual int | GetBorderStyle () |
This returns the BORDER_BUMP style. | |
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 | OnResize () |
Sets the new position of the close button. | |
virtual bool | OnScroll (int direction, pawsScrollBar *widget) |
Called whenever a window is scrolled. | |
virtual void | OnUpdateData (const char *dataname, PAWSData &data) |
pawsMessageTextBox (const pawsMessageTextBox &origin) | |
pawsMessageTextBox () | |
virtual bool | PostSetup () |
This is called after the widget and all of it's children have been created. | |
void | ReplaceLastMessage (const char *data) |
void | ResetScroll () |
Resets scrollbar to starting position (offset=0) | |
virtual void | Resize () |
Resize a widget based on it's parent's size. | |
bool | SelfPopulate (iDocumentNode *node) |
This function allows a widget to fill in its own contents from an xml node supplied. | |
virtual bool | Setup (iDocumentNode *node) |
Setup this widget. | |
virtual bool | Setup (void) |
virtual | ~pawsMessageTextBox () |
Protected Member Functions | |
void | CalcLineHeight () |
Calculates value of the lineHeight attribute. | |
pawsScrollBar * | GetScrollBar () |
checks for a child of type pawsScrollBar. | |
int | RenderMessage (const char *data, int lineStart, int colour) |
Renders an entire message and returns the total lines it took. | |
void | SplitMessage (const char *newText, int colour, int size, MessageLine *&msgLine, int &startPosition) |
Protected Attributes | |
csPDelArray< MessageLine > | adjusted |
int | lineHeight |
size_t | maxLines |
csPDelArray< MessageLine > | messages |
List of messages this box has. | |
pawsScrollBar * | scrollBar |
int | scrollBarWidth |
int | topLine |
This is a special type of text box that is used for messages.
This text box allows each 'message' to be stored as it's own line with it's own colours.
Definition at line 285 of file pawstextbox.h.
pawsMessageTextBox::pawsMessageTextBox | ( | ) |
pawsMessageTextBox::pawsMessageTextBox | ( | const pawsMessageTextBox & | origin | ) |
virtual pawsMessageTextBox::~pawsMessageTextBox | ( | ) | [virtual] |
void pawsMessageTextBox::AddMessage | ( | const char * | data, |
int | colour = -1 |
||
) |
Add a new message to this box.
data | The new message to add. |
colour | The colour this message should be. -1 means use the default colour that is available. |
void pawsMessageTextBox::AppendLastMessage | ( | const char * | data | ) |
void pawsMessageTextBox::CalcLineHeight | ( | ) | [protected] |
Calculates value of the lineHeight attribute.
void pawsMessageTextBox::Clear | ( | ) |
virtual void pawsMessageTextBox::Draw | ( | ) | [virtual] |
Draws the widget and all of it's children.
Reimplemented from pawsWidget.
void pawsMessageTextBox::FullScroll | ( | ) |
Sets the scrollbar to 100% (offset=max)
virtual int pawsMessageTextBox::GetBorderStyle | ( | ) | [inline, virtual] |
This returns the BORDER_BUMP style.
Reimplemented from pawsWidget.
Definition at line 350 of file pawstextbox.h.
pawsScrollBar* pawsMessageTextBox::GetScrollBar | ( | ) | [protected] |
checks for a child of type pawsScrollBar.
bool pawsMessageTextBox::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.
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 void pawsMessageTextBox::OnResize | ( | ) | [virtual] |
Sets the new position of the close button.
Reimplemented from pawsWidget.
virtual bool pawsMessageTextBox::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 pawsMessageTextBox::OnUpdateData | ( | const char * | dataname, |
PAWSData & | data | ||
) | [virtual] |
Reimplemented from pawsWidget.
virtual bool pawsMessageTextBox::PostSetup | ( | ) | [virtual] |
This is called after the widget and all of it's children have been created.
Reimplemented from pawsWidget.
Renders an entire message and returns the total lines it took.
void pawsMessageTextBox::ReplaceLastMessage | ( | const char * | data | ) |
void pawsMessageTextBox::ResetScroll | ( | ) |
Resets scrollbar to starting position (offset=0)
virtual void pawsMessageTextBox::Resize | ( | ) | [virtual] |
Resize a widget based on it's parent's size.
Reimplemented from pawsWidget.
bool pawsMessageTextBox::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.
virtual bool pawsMessageTextBox::Setup | ( | iDocumentNode * | ) | [virtual] |
Setup this widget.
Reimplemented from pawsWidget.
virtual bool pawsMessageTextBox::Setup | ( | void | ) | [virtual] |
void pawsMessageTextBox::SplitMessage | ( | const char * | newText, |
int | colour, | ||
int | size, | ||
MessageLine *& | msgLine, | ||
int & | startPosition | ||
) | [protected] |
csPDelArray<MessageLine> pawsMessageTextBox::adjusted [protected] |
Definition at line 386 of file pawstextbox.h.
int pawsMessageTextBox::lineHeight [protected] |
Definition at line 388 of file pawstextbox.h.
size_t pawsMessageTextBox::maxLines [protected] |
Definition at line 389 of file pawstextbox.h.
csPDelArray<MessageLine> pawsMessageTextBox::messages [protected] |
List of messages this box has.
Definition at line 371 of file pawstextbox.h.
pawsScrollBar* pawsMessageTextBox::scrollBar [protected] |
Definition at line 393 of file pawstextbox.h.
int pawsMessageTextBox::scrollBarWidth [protected] |
Definition at line 394 of file pawstextbox.h.
int pawsMessageTextBox::topLine [protected] |
Definition at line 391 of file pawstextbox.h.