# WoopsiUI::ScrollingTextBox Class Reference

`#include <scrollingtextbox.h>`

Inheritance diagram for WoopsiUI::ScrollingTextBox:

List of all members.

## Public Member Functions
| ScrollingTextBox (s16 x, s16 y, u16 width, u16 height, const char *text, u32 flags, s16 maxRows=0, FontBase *font=NULL)
virtual void | setTextAlignmentHoriz (MultiLineTextBox::TextAlignmentHoriz alignment)
virtual void | setTextAlignmentVert (MultiLineTextBox::TextAlignmentVert alignment)
virtual const u16 | getPageCount () const
virtual const u16 | getCurrentPage () const
virtual const Text * | getText () const
virtual void | setText (const char *text)
virtual void | setText (const char text)
virtual void | appendText (const char *text)
virtual void | appendText (const char text)
virtual void | setFont (FontBase *font)
virtual bool | resize (u16 width, u16 height)
virtual void | handleValueChangeEvent (const GadgetEventArgs &e)
virtual void | handleScrollEvent (const GadgetEventArgs &e)
virtual void | draw (Rect clipRect)
## Protected Member Functions
virtual | ~ScrollingTextBox ()
| ScrollingTextBox (const ScrollingTextBox &scrollingTextBox)
## Protected Attributes
MultiLineTextBox * | _textbox
ScrollbarVertical * | _scrollbar
u8 | _scrollbarWidth

## Detailed Description

Gadget containing a MultiLineTextBox and a vertical scrollbar. Exposed methods are more or less identical to the methods exposed by the MultiLineTextBox to ensure that the two are interchangeable.

## Constructor & Destructor Documentation

ScrollingTextBox::ScrollingTextBox | ( | s16 | x,
|  | s16 | y,
|  | u16 | width,
|  | u16 | height,
|  | const char * | text,
|  | u32 | flags,
|  | s16 | maxRows = `0`,
|  | FontBase * | font = `NULL` |
| ) |  |  |

Constructor.

Parameters:

  | x | The x co-ordinate of the text box, relative to its parent.
  | y | The y co-ordinate of the text box, relative to its parent.
  | width | The width of the textbox.
  | height | The height of the textbox.
  | text | Pointer to a string to display in the textbox.
  | flags | Standard gadget flag options.
  | maxRows | The maximum number of rows the textbox can track. Adding text beyond this number will cause rows at the start of the text to be forgotten; text is essentially stored as a queue, and adding to the back of a full queue causes the front items to be popped off. Setting this to 0 will make the textbox track only the visible rows.
  | font | The font to use in this text box.

virtual WoopsiUI::ScrollingTextBox::~ScrollingTextBox | ( |  | ) | `[inline, protected, virtual]`

Destructor.

WoopsiUI::ScrollingTextBox::ScrollingTextBox | ( | const ScrollingTextBox & | scrollingTextBox | ) | `[inline, protected]`

Copy constructor is protected to prevent usage.

## Member Function Documentation

void ScrollingTextBox::appendText | ( | const char | text | ) | `[virtual]`

Append new text to the end of the current text displayed in the textbox.

Parameters:

  | text | Char to append.

void ScrollingTextBox::appendText | ( | const char * | text | ) | `[virtual]`

Append new text to the end of the current text displayed in the textbox.

Parameters:

  | text | String to append.

void ScrollingTextBox::draw | ( | Rect | clipRect | ) | `[virtual]`

Draw the region of the textbox within the clipping rect. Should not be called directly.

Parameters:

  | clipRect | The clipping rect to limit drawing to.

Reimplemented from WoopsiUI::Gadget.

const u16 ScrollingTextBox::getCurrentPage | ( |  | ) | const`[virtual]`

Returns the current page.

Returns:
  The current page.

See also:
  getPageCount().

const u16 ScrollingTextBox::getPageCount | ( |  | ) | const`[virtual]`

Returns the number of "pages" that the text spans. A page is defined as the amount of text that can be displayed within the textbox at one time.

Returns:
  The page count.

const Text * ScrollingTextBox::getText | ( |  | ) | const`[virtual]`

Returns a pointer to the Text object that contains the wrapped text used in the textbox. It is used as the pre-processed data source for the textbox, and should not be altered.

Returns:
  Pointer to the Text object.

void ScrollingTextBox::handleScrollEvent | ( | const GadgetEventArgs & | e | ) | `[virtual]`

Handles events raised by its sub-gadgets.

Parameters:

  | e | Event arguments.

Reimplemented from WoopsiUI::GadgetEventHandler.

void ScrollingTextBox::handleValueChangeEvent | ( | const GadgetEventArgs & | e | ) | `[virtual]`

Handles events raised by its sub-gadgets.

Parameters:

  | e | Event arguments.

Reimplemented from WoopsiUI::GadgetEventHandler.

bool ScrollingTextBox::resize | ( | u16 | width,
|  | u16 | height |
| ) |  |  | `[virtual]`

Resize the textbox to the new dimensions.

Parameters:

  | width | The new width.
  | height | The new height.

Returns:
  True if the resize was successful.

Reimplemented from WoopsiUI::Gadget.

void ScrollingTextBox::setFont | ( | FontBase * | font | ) | `[virtual]`

Set the font used in the textbox.

Parameters:

  | font | Pointer to the new font.

Reimplemented from WoopsiUI::Gadget.

void ScrollingTextBox::setText | ( | const char | text | ) | `[virtual]`

Set the text displayed in the textbox.

Parameters:

  | text | Character to display.

void ScrollingTextBox::setText | ( | const char * | text | ) | `[virtual]`

Set the text displayed in the textbox.

Parameters:

  | text | String to display.

void ScrollingTextBox::setTextAlignmentHoriz | ( | MultiLineTextBox::TextAlignmentHoriz | alignment | ) | `[virtual]`

Set the horizontal alignment of text within the textbox.

Parameters:

  | alignment | The horizontal position of the text.

void ScrollingTextBox::setTextAlignmentVert | ( | MultiLineTextBox::TextAlignmentVert | alignment | ) | `[virtual]`

Set the vertical alignment of text within the textbox.

Parameters:

  | alignment | The vertical position of the text.

## Member Data Documentation

ScrollbarVertical* WoopsiUI::ScrollingTextBox::_scrollbar`[protected]`

Pointer to the scrollbar

u8 WoopsiUI::ScrollingTextBox::_scrollbarWidth`[protected]`

Width of the scrollbar

MultiLineTextBox* WoopsiUI::ScrollingTextBox::_textbox`[protected]`

Pointer to the textbox

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

- C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/scrollingtextbox.h
- C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/scrollingtextbox.cpp

All Classes Functions Variables Enumerations Enumerator