WoopsiUI::ScrollingTextBox Class Reference

#include <scrollingtextbox.h>

Inheritance diagram for WoopsiUI::ScrollingTextBox:
WoopsiUI::Gadget WoopsiUI::GadgetEventHandler

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 TextgetText () 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

Pointer to the scrollbar

Width of the scrollbar

Pointer to the textbox


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Enumerator

Generated on Sat Oct 24 14:33:11 2009 for Woopsi by  doxygen 1.6.1