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

WoopsiUI::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

virtual void WoopsiUI::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.
virtual void WoopsiUI::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.
virtual void WoopsiUI::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.

virtual const u16 WoopsiUI::ScrollingTextBox::getCurrentPage (  )  const [virtual]

Returns the current page.

Returns:
The current page.
See also:
getPageCount().
virtual const u16 WoopsiUI::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.
virtual const Text* WoopsiUI::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.
virtual void WoopsiUI::ScrollingTextBox::handleScrollEvent ( const GadgetEventArgs e  )  [virtual]

Handles events raised by its sub-gadgets.

Parameters:
e Event arguments.

Reimplemented from WoopsiUI::GadgetEventHandler.

virtual void WoopsiUI::ScrollingTextBox::handleValueChangeEvent ( const GadgetEventArgs e  )  [virtual]

Handles events raised by its sub-gadgets.

Parameters:
e Event arguments.

Reimplemented from WoopsiUI::GadgetEventHandler.

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

virtual void WoopsiUI::ScrollingTextBox::setFont ( FontBase font  )  [virtual]

Set the font used in the textbox.

Parameters:
font Pointer to the new font.

Reimplemented from WoopsiUI::Gadget.

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

Set the text displayed in the textbox.

Parameters:
text Character to display.
virtual void WoopsiUI::ScrollingTextBox::setText ( const char *  text  )  [virtual]

Set the text displayed in the textbox.

Parameters:
text String to display.
virtual void WoopsiUI::ScrollingTextBox::setTextAlignmentHoriz ( MultiLineTextBox::TextAlignmentHoriz  alignment  )  [virtual]

Set the horizontal alignment of text within the textbox.

Parameters:
alignment The horizontal position of the text.
virtual void WoopsiUI::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 file:

Generated on Sun Nov 15 11:35:37 2009 for Woopsi by  doxygen 1.6.1