Planeshift
Public Member Functions | Protected Member Functions | Protected Attributes

pawsMultiPageTextBox Class Reference

#include <pawstextbox.h>

List of all members.

Public Member Functions

void Draw ()
 Draws the widget and all of it's children.
int GetCurrentPageNum ()
int GetNumPages ()
const char * GetText ()
virtual bool OnGainFocus (bool=true)
 Changes hasFocus to TRUE and reports status to parent.
virtual bool OnMouseDown (int button, int modifiers, int x, int y)
 Manage mouse down event to test for and apply window changes.
bool OnScroll (int direction, pawsScrollBar *widget)
 Called whenever a window is scrolled.
virtual void OnUpdateData (const char *dataname, PAWSData &data)
 pawsMultiPageTextBox (const pawsMultiPageTextBox &origin)
 pawsMultiPageTextBox ()
bool PostSetup ()
 This is called after the widget and all of it's children have been created.
void Resize ()
 Resize a widget based on it's parent's size.
void SetCurrentPageNum (int n)
void SetText (const char *text)
bool Setup (iDocumentNode *node)
 Setup this widget.
virtual ~pawsMultiPageTextBox ()

Protected Member Functions

pawsScrollBarGetScrollBar ()
 checks for a child of type pawsScrollBar.
void OrganizeText (const char *text)

Protected Attributes

size_t canDrawLines
int currentPageNum
csArray< csString > lines
 The text, broken into separate lines by OrganizeText()
int maxHeight
int maxWidth
int numPages
pawsScrollBarscrollBar
size_t startLine
csString text
 The text for this box.
bool usingScrollBar

Detailed Description

Definition at line 670 of file pawstextbox.h.


Constructor & Destructor Documentation

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

Member Function Documentation

void pawsMultiPageTextBox::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.

Reimplemented in pawsMultiPageDocumentView.

int pawsMultiPageTextBox::GetCurrentPageNum ( )
int pawsMultiPageTextBox::GetNumPages ( )
pawsScrollBar* pawsMultiPageTextBox::GetScrollBar ( ) [protected]

checks for a child of type pawsScrollBar.

Returns:
pawsScrollBar* pointer to child or NULL
const char* pawsMultiPageTextBox::GetText ( ) [inline]

Definition at line 686 of file pawstextbox.h.

virtual bool pawsMultiPageTextBox::OnGainFocus ( bool  = true) [inline, virtual]

Changes hasFocus to TRUE and reports status to parent.

Returns:
bool
Remarks:
Acts recursively on it's parents. If the widget cannot be focused, this function needs be overridden.

Reimplemented from pawsWidget.

Definition at line 696 of file pawstextbox.h.

virtual bool pawsMultiPageTextBox::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.

bool pawsMultiPageTextBox::OnScroll ( int  scrollDirection,
pawsScrollBar widget 
) [virtual]

Called whenever a window is scrolled.

Parameters:
scrollDirectionThe direction to move.
widgetThe scrollbar widget being manipulated.
Returns:
bool Parent's result or FALSE if no parent.

Reimplemented from pawsWidget.

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

Reimplemented from pawsWidget.

void pawsMultiPageTextBox::OrganizeText ( const char *  text) [protected]
bool pawsMultiPageTextBox::PostSetup ( ) [virtual]

This is called after the widget and all of it's children have been created.

Remarks:
This can be useful for widgets that want to get pointers to some of it's children for quick access.

Reimplemented from pawsWidget.

void pawsMultiPageTextBox::Resize ( ) [virtual]

Resize a widget based on it's parent's size.

Reimplemented from pawsWidget.

Reimplemented in pawsMultiPageDocumentView.

void pawsMultiPageTextBox::SetCurrentPageNum ( int  n)
void pawsMultiPageTextBox::SetText ( const char *  text)

Reimplemented in pawsMultiPageDocumentView.

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

Setup this widget.

Reimplemented from pawsWidget.


Member Data Documentation

Definition at line 726 of file pawstextbox.h.

Definition at line 731 of file pawstextbox.h.

csArray<csString> pawsMultiPageTextBox::lines [protected]

The text, broken into separate lines by OrganizeText()

Definition at line 721 of file pawstextbox.h.

Definition at line 729 of file pawstextbox.h.

Definition at line 728 of file pawstextbox.h.

Definition at line 732 of file pawstextbox.h.

Definition at line 730 of file pawstextbox.h.

size_t pawsMultiPageTextBox::startLine [protected]

Definition at line 724 of file pawstextbox.h.

csString pawsMultiPageTextBox::text [protected]

The text for this box.

Definition at line 719 of file pawstextbox.h.

Definition at line 727 of file pawstextbox.h.


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