Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | Related Pages

gcn::ScrollArea Class Reference

#include <scrollarea.hpp>

Inheritance diagram for gcn::ScrollArea:

gcn::BasicContainer gcn::MouseListener gcn::Widget List of all members.

Detailed Description

A ScrollArea in which another Widget can be added.

It the other Widget is bigger then the ScrollArea, the ScrollArea will only display the part of the Widget that fits the ScrollArea and make it possible to scroll to the other areas of the Widget.

NOTE: A TextBox or a ListBox looks really ugly unless they exist in a ScrollArea.

Definition at line 75 of file scrollarea.hpp.

Public Types

enum  { SHOW_ALWAYS, SHOW_NEVER, SHOW_AUTO }
 Scrollpolicies for the horizontal and vertical scrollbar. More...

Public Member Functions

 ScrollArea ()
 Constructor.
 ScrollArea (Widget *content)
 Constructor.
 ScrollArea (Widget *content, unsigned int hPolicy, unsigned int vPolicy)
 Constructor.
virtual ~ScrollArea ()
 Destructor.
virtual void setContent (Widget *widget)
 Sets the content.
virtual WidgetgetContent ()
 Gets the content.
virtual void setHorizontalScrollPolicy (unsigned int hPolicy)
 Sets the horizontal scrollbar policy.
virtual unsigned int getHorizontalScrollPolicy ()
 Gets the horizontal scrollbar policy.
virtual void setVerticalScrollPolicy (unsigned int vPolicy)
 Sets the vertical scrollbar policy.
virtual unsigned int getVerticalScrollPolicy ()
 Gets the vertical scrollbar policy.
virtual void setScrollPolicy (unsigned int hPolicy, unsigned int vPolicy)
 Sets the horizontal and vertical scrollbar policy.
virtual void setVerticalScrollAmount (int vScroll)
 Sets the amount to scroll verticaly.
virtual int getVerticalScrollAmount ()
 Gets the amount that is scrolled verticaly.
virtual void setHorizontalScrollAmount (int hScroll)
 Sets the amount to scroll horizontaly.
virtual int getHorizontalScrollAmount ()
 Gets the amount that is scrolled horizontaly.
virtual void setScrollAmount (int hScroll, int vScroll)
 Sets the amount to scroll horizontaly and verticaly.
virtual int getHorizontalMaxScroll ()
 Gets the maximum amount of horizontal scroll.
virtual int getVerticalMaxScroll ()
 Gets the maximum amount of vertical scroll.
virtual void setScrollbarWidth (int width)
 Sets the width.
virtual int getScrollbarWidth ()
 Gets the width.
virtual void scrollToRectangle (const Rectangle &rectangle)
 Tries to scroll to a specific rectangle.
virtual void draw (Graphics *graphics)
 Draws the Widget.
virtual void drawBorder (Graphics *graphics)
 Draws a the Widget border.
virtual void logic ()
 Called for all Widgets in the gui each time Gui::logic is called.
virtual void _mouseInputMessage (const MouseInput &mouseInput)
 Called when a Widget recieves a MouseInput.
virtual void _mouseOutMessage ()
 Called when the mouse leaves the Widget area.
virtual void _setFocusHandler (FocusHandler *focusHandler)
 Sets the FocusHandler to be used.
virtual void _announceDeath (Widget *widget)
 Called when a child of the BasicContainer gets destroyed.
virtual void getDrawSize (int &width, int &height, Widget *widget)
 Gets the drawing space size a Widget has in the BasicContainer.
virtual void moveToBottom (Widget *widget)
 Moves a widget to the bottom of the BasicContainer.
virtual void moveToTop (Widget *widget)
 Moves a Widget to the top of the BasicContainer.
virtual void mousePress (int x, int y, int button)
 Called when a mouse button is pressed when the mouse is in the Widget area or if the Widget has focus.
virtual void mouseRelease (int x, int y, int button)
 Called when a mouse button is released when the mouse is in the Widget area or if the Widget has focus.
virtual void mouseMotion (int x, int y)
 Called when the mouse moves and the mouse is in the Widget area or if the Widget has focus.
virtual void mouseWheelUp (int x, int y)
 Called on a mouse wheel up when the mouse is in the Widget area or if the Widget has focus.
virtual void mouseWheelDown (int x, int y)
 Called on a mouse wheel down when the mouse is in the Widget area or if the Widget has focus.

Protected Member Functions

virtual void drawUpButton (Graphics *graphics)
 Draws the up button.
virtual void drawDownButton (Graphics *graphics)
 Draws the down button.
virtual void drawLeftButton (Graphics *graphics)
 Draws the left button.
virtual void drawRightButton (Graphics *graphics)
 Draws the right button.
virtual void drawContent (Graphics *graphics)
 Draws the content in the ScrollArea.
virtual void drawVBar (Graphics *graphics)
 Draws the vertical scrollbar.
virtual void drawHBar (Graphics *graphics)
 Draws the horizontal scrollbar.
virtual void drawVMarker (Graphics *graphics)
 Draws the vertical marker.
virtual void drawHMarker (Graphics *graphics)
 Draws the horizontal marker.
virtual void checkPolicies ()
 Checks the policies for the scrollbars.
virtual Rectangle getUpButtonDimension ()
 Gets the up button dimension.
virtual Rectangle getDownButtonDimension ()
 Gets the down button dimension.
virtual Rectangle getLeftButtonDimension ()
 Gets the left button dimension.
virtual Rectangle getRightButtonDimension ()
 Gets the right button dimension.
virtual Rectangle getContentDimension ()
 Gets the content dimension.
virtual Rectangle getVerticalBarDimension ()
 Gets the vertical scrollbar dimension.
virtual Rectangle getHorizontalBarDimension ()
 Gets the horizontal scrollbar dimension.
virtual Rectangle getVerticalMarkerDimension ()
 Gets the vertical marker dimension.
virtual Rectangle getHorizontalMarkerDimension ()
 Gets the horizontal marker dimension.

Protected Attributes

WidgetmContent
int mVScroll
int mHScroll
int mScrollbarWidth
unsigned int mHPolicy
unsigned int mVPolicy
bool mVBarVisible
bool mHBarVisible
bool mUpButtonPressed
bool mDownButtonPressed
bool mLeftButtonPressed
bool mRightButtonPressed
bool mVerticalMarkerPressed
int mVerticalMarkerMousePosition
bool mHorizontalMarkerPressed
int mHorizontalMarkerMousePosition


Member Enumeration Documentation

anonymous enum
 

Scrollpolicies for the horizontal and vertical scrollbar.

The policies are:

SHOW_ALWAYS - Always show the scrollbars no matter what. SHOW_NEVER - Never show the scrollbars no matter waht. SHOW_AUTO - Show the scrollbars only when needed. That is if the content grows larger then the ScrollArea.

Definition at line 286 of file scrollarea.hpp.


Constructor & Destructor Documentation

gcn::ScrollArea::ScrollArea Widget content  ) 
 

Constructor.

Parameters:
content the content of the ScrollArea.

Definition at line 84 of file scrollarea.cpp.

References gcn::Widget::addMouseListener(), and setContent().

gcn::ScrollArea::ScrollArea Widget content,
unsigned int  hPolicy,
unsigned int  vPolicy
 

Constructor.

Parameters:
content the content of the ScrollArea.
hPolicy the policy for the horizontal scrollbar. See enum with policies.
vPolicy the policy for the vertical scrollbar. See enum with policies.

Definition at line 105 of file scrollarea.cpp.

References gcn::Widget::addMouseListener(), and setContent().


Member Function Documentation

void gcn::ScrollArea::_announceDeath Widget widget  )  [virtual]
 

Called when a child of the BasicContainer gets destroyed.

Parameters:
widget the destroyed Widget.

Implements gcn::BasicContainer.

Definition at line 889 of file scrollarea.cpp.

References checkPolicies().

void gcn::ScrollArea::_mouseInputMessage const MouseInput mouseInput  )  [virtual]
 

Called when a Widget recieves a MouseInput.

WARNING: This function is used internally to handle all mouse messages. Don't call or overload it unless you know what you are doing.

Parameters:
mouseInput the MouseInput message.

Reimplemented from gcn::Widget.

Definition at line 300 of file scrollarea.cpp.

References gcn::Widget::_mouseInMessage(), gcn::Widget::_mouseInputMessage(), gcn::Widget::_mouseOutMessage(), getContentDimension(), gcn::Widget::getX(), gcn::Widget::getY(), gcn::Widget::hasMouse(), gcn::MouseInput::x, and gcn::MouseInput::y.

Referenced by gcn::DropDown::_mouseInputMessage().

void gcn::ScrollArea::_mouseOutMessage  )  [virtual]
 

Called when the mouse leaves the Widget area.

WARNING: This function is used internally be to handle mouse out messages. Don't call or overload this function unless you know what you are doing.

Reimplemented from gcn::Widget.

Definition at line 327 of file scrollarea.cpp.

References gcn::Widget::_mouseOutMessage(), and gcn::Widget::hasMouse().

void gcn::ScrollArea::_setFocusHandler FocusHandler focusHandler  )  [virtual]
 

Sets the FocusHandler to be used.

WARNING: This function is used internally and should not be called or overloaded unless you know what you are doing.

Parameters:
focusHandler the FocusHandler to use.

Reimplemented from gcn::Widget.

Definition at line 290 of file scrollarea.cpp.

References gcn::Widget::_setFocusHandler().

Referenced by gcn::DropDown::DropDown(), gcn::DropDown::setScrollArea(), and gcn::DropDown::~DropDown().

void gcn::ScrollArea::draw Graphics graphics  )  [virtual]
 

Draws the Widget.

It is called by the parent widget when it is time for the Widget to draw itself. The graphics object is set up so that all drawing is relative to the Widget, i.e coordinate (0,0) is the top-left corner of the Widget. It is not possible to draw outside of a Widgets dimension.

Parameters:
graphics a Graphics object to draw with.

Implements gcn::Widget.

Definition at line 419 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::draw(), gcn::Widget::drawBorder(), drawDownButton(), drawHBar(), drawHMarker(), drawLeftButton(), drawRightButton(), drawUpButton(), drawVBar(), drawVMarker(), gcn::Widget::getBackgroundColor(), gcn::Widget::getBaseColor(), gcn::Widget::getBorderSize(), getContentDimension(), gcn::Widget::getDimension(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), gcn::Rectangle::height, gcn::Rectangle::width, gcn::Rectangle::x, and gcn::Rectangle::y.

Referenced by gcn::DropDown::draw().

void gcn::ScrollArea::drawBorder Graphics graphics  )  [virtual]
 

Draws a the Widget border.

A border is drawn around a Widget. The width and height of the border is therefore the Widgets height+2*bordersize. Think of a painting that has a certain size, the border surrounds the painting.

Parameters:
graphics a Graphics object to draw with.

Reimplemented from gcn::Widget.

Definition at line 479 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::getBaseColor(), gcn::Widget::getBorderSize(), gcn::Widget::getHeight(), and gcn::Widget::getWidth().

void gcn::ScrollArea::drawContent Graphics graphics  )  [protected, virtual]
 

Draws the content in the ScrollArea.

Parameters:
graphics a Graphics object to draw with.

Definition at line 915 of file scrollarea.cpp.

References gcn::Widget::draw().

void gcn::ScrollArea::drawDownButton Graphics graphics  )  [protected, virtual]
 

Draws the down button.

Parameters:
graphics a Graphics object to draw with.

Definition at line 606 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::getBaseColor(), getDownButtonDimension(), gcn::Widget::getForegroundColor(), gcn::Rectangle::height, and gcn::Rectangle::width.

Referenced by draw().

void gcn::ScrollArea::drawHBar Graphics graphics  )  [protected, virtual]
 

Draws the horizontal scrollbar.

Parameters:
graphics a Graphics object to draw with.

Definition at line 503 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::getBaseColor(), getHorizontalBarDimension(), gcn::Rectangle::height, and gcn::Rectangle::width.

Referenced by draw().

void gcn::ScrollArea::drawHMarker Graphics graphics  )  [protected, virtual]
 

Draws the horizontal marker.

Parameters:
graphics a Graphics object to draw with.

Definition at line 816 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::getBaseColor(), getHorizontalMarkerDimension(), gcn::Rectangle::height, and gcn::Rectangle::width.

Referenced by draw().

void gcn::ScrollArea::drawLeftButton Graphics graphics  )  [protected, virtual]
 

Draws the left button.

Parameters:
graphics a Graphics object to draw with.

Definition at line 667 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::getBaseColor(), gcn::Widget::getForegroundColor(), getLeftButtonDimension(), gcn::Rectangle::height, and gcn::Rectangle::width.

Referenced by draw().

void gcn::ScrollArea::drawRightButton Graphics graphics  )  [protected, virtual]
 

Draws the right button.

Parameters:
graphics a Graphics object to draw with.

Definition at line 728 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::getBaseColor(), gcn::Widget::getForegroundColor(), getRightButtonDimension(), gcn::Rectangle::height, and gcn::Rectangle::width.

Referenced by draw().

void gcn::ScrollArea::drawUpButton Graphics graphics  )  [protected, virtual]
 

Draws the up button.

Parameters:
graphics a Graphics object to draw with.

Definition at line 545 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::getBaseColor(), gcn::Widget::getForegroundColor(), getUpButtonDimension(), gcn::Rectangle::height, and gcn::Rectangle::width.

Referenced by draw().

void gcn::ScrollArea::drawVBar Graphics graphics  )  [protected, virtual]
 

Draws the vertical scrollbar.

Parameters:
graphics a Graphics object to draw with.

Definition at line 524 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::getBaseColor(), getVerticalBarDimension(), gcn::Rectangle::height, and gcn::Rectangle::width.

Referenced by draw().

void gcn::ScrollArea::drawVMarker Graphics graphics  )  [protected, virtual]
 

Draws the vertical marker.

Parameters:
graphics a Graphics object to draw with.

Definition at line 789 of file scrollarea.cpp.

References gcn::Color::a, gcn::Widget::getBaseColor(), getVerticalMarkerDimension(), gcn::Rectangle::height, and gcn::Rectangle::width.

Referenced by draw().

Widget * gcn::ScrollArea::getContent  )  [virtual]
 

Gets the content.

Returns:
the content of the ScrollArea.

Definition at line 150 of file scrollarea.cpp.

Referenced by gcn::DropDown::_keyInputMessage(), gcn::DropDown::_mouseInputMessage(), gcn::DropDown::adjustHeight(), gcn::DropDown::draw(), gcn::DropDown::dropDown(), gcn::DropDown::getListModel(), gcn::DropDown::getSelected(), gcn::DropDown::keyPress(), gcn::DropDown::logic(), gcn::DropDown::setListBox(), gcn::DropDown::setListModel(), and gcn::DropDown::setSelected().

Rectangle gcn::ScrollArea::getContentDimension  )  [protected, virtual]
 

Gets the content dimension.

Returns:
the dimension of the content.

Definition at line 1086 of file scrollarea.cpp.

References gcn::Widget::getHeight(), and gcn::Widget::getWidth().

Referenced by _mouseInputMessage(), draw(), getDrawSize(), getHorizontalMarkerDimension(), getHorizontalMaxScroll(), getVerticalMarkerDimension(), getVerticalMaxScroll(), logic(), mouseWheelDown(), mouseWheelUp(), and scrollToRectangle().

Rectangle gcn::ScrollArea::getDownButtonDimension  )  [protected, virtual]
 

Gets the down button dimension.

Returns:
the dimension of the down button.

Definition at line 1031 of file scrollarea.cpp.

References gcn::Widget::getHeight(), and gcn::Widget::getWidth().

Referenced by drawDownButton(), getVerticalBarDimension(), and mousePress().

void gcn::ScrollArea::getDrawSize int &  width,
int &  height,
Widget widget
[virtual]
 

Gets the drawing space size a Widget has in the BasicContainer.

It may not be the same size as the Widgets width and height.

NOTE: Size is not checked recursively all the way back to the top Widget. If the BasicContainer itself is clipped, the size may be inaccurate.

Parameters:
width the width the Widget's draw space has.
height the height the Widget's draw space has.
widget the Widget calling the function.

Implements gcn::BasicContainer.

Definition at line 902 of file scrollarea.cpp.

References getContentDimension(), gcn::Rectangle::height, and gcn::Rectangle::width.

Rectangle gcn::ScrollArea::getHorizontalBarDimension  )  [protected, virtual]
 

Gets the horizontal scrollbar dimension.

Returns:
the dimension of the horizontal scrollbar.

Definition at line 1133 of file scrollarea.cpp.

References gcn::Widget::getHeight(), getLeftButtonDimension(), getRightButtonDimension(), and gcn::Widget::getWidth().

Referenced by drawHBar(), getHorizontalMarkerDimension(), and mouseMotion().

Rectangle gcn::ScrollArea::getHorizontalMarkerDimension  )  [protected, virtual]
 

Gets the horizontal marker dimension.

Returns:
the dimension of the horizontal marker.

Definition at line 1202 of file scrollarea.cpp.

References getContentDimension(), getHorizontalBarDimension(), getHorizontalMaxScroll(), getHorizontalScrollAmount(), gcn::Widget::getWidth(), gcn::Rectangle::width, gcn::Rectangle::x, and gcn::Rectangle::y.

Referenced by drawHMarker(), mouseMotion(), and mousePress().

int gcn::ScrollArea::getHorizontalMaxScroll  )  [virtual]
 

Gets the maximum amount of horizontal scroll.

Returns:
the horizontal max scroll.

Definition at line 233 of file scrollarea.cpp.

References checkPolicies(), gcn::Widget::getBorderSize(), getContentDimension(), gcn::Widget::getWidth(), and gcn::Rectangle::width.

Referenced by getHorizontalMarkerDimension(), mouseMotion(), and setHorizontalScrollAmount().

int gcn::ScrollArea::getHorizontalScrollAmount  )  [virtual]
 

Gets the amount that is scrolled horizontaly.

Returns:
the scroll amount on horizontal scroll.

Definition at line 222 of file scrollarea.cpp.

Referenced by getHorizontalMarkerDimension(), logic(), mousePress(), and scrollToRectangle().

unsigned int gcn::ScrollArea::getHorizontalScrollPolicy  )  [virtual]
 

Gets the horizontal scrollbar policy.

See enum with policies.

Returns:
the policy for the horizontal scrollbar policy. See enum with policies.

Definition at line 161 of file scrollarea.cpp.

Rectangle gcn::ScrollArea::getLeftButtonDimension  )  [protected, virtual]
 

Gets the left button dimension.

Returns:
the dimension of the left button.

Definition at line 1052 of file scrollarea.cpp.

References gcn::Widget::getHeight().

Referenced by drawLeftButton(), getHorizontalBarDimension(), and mousePress().

Rectangle gcn::ScrollArea::getRightButtonDimension  )  [protected, virtual]
 

Gets the right button dimension.

Returns:
the dimension of the right button.

Definition at line 1065 of file scrollarea.cpp.

References gcn::Widget::getHeight(), and gcn::Widget::getWidth().

Referenced by drawRightButton(), getHorizontalBarDimension(), and mousePress().

int gcn::ScrollArea::getScrollbarWidth  )  [virtual]
 

Gets the width.

Returns:
the width of the ScrollBar.

Definition at line 285 of file scrollarea.cpp.

Rectangle gcn::ScrollArea::getUpButtonDimension  )  [protected, virtual]
 

Gets the up button dimension.

Returns:
the dimension of the up button.

Definition at line 1018 of file scrollarea.cpp.

References gcn::Widget::getWidth().

Referenced by drawUpButton(), getVerticalBarDimension(), and mousePress().

Rectangle gcn::ScrollArea::getVerticalBarDimension  )  [protected, virtual]
 

Gets the vertical scrollbar dimension.

Returns:
the dimension of the vertical scrollbar.

Definition at line 1107 of file scrollarea.cpp.

References getDownButtonDimension(), gcn::Widget::getHeight(), getUpButtonDimension(), and gcn::Widget::getWidth().

Referenced by drawVBar(), getVerticalMarkerDimension(), and mouseMotion().

Rectangle gcn::ScrollArea::getVerticalMarkerDimension  )  [protected, virtual]
 

Gets the vertical marker dimension.

Returns:
the dimension of the vertical marker.

Definition at line 1159 of file scrollarea.cpp.

References getContentDimension(), gcn::Widget::getHeight(), getVerticalBarDimension(), getVerticalMaxScroll(), getVerticalScrollAmount(), gcn::Rectangle::height, gcn::Rectangle::x, and gcn::Rectangle::y.

Referenced by drawVMarker(), mouseMotion(), and mousePress().

int gcn::ScrollArea::getVerticalMaxScroll  )  [virtual]
 

Gets the maximum amount of vertical scroll.

Returns:
the vertical max scroll.

Definition at line 252 of file scrollarea.cpp.

References checkPolicies(), gcn::Widget::getBorderSize(), getContentDimension(), gcn::Widget::getHeight(), and gcn::Rectangle::height.

Referenced by getVerticalMarkerDimension(), mouseMotion(), and setVerticalScrollAmount().

int gcn::ScrollArea::getVerticalScrollAmount  )  [virtual]
 

Gets the amount that is scrolled verticaly.

Returns:
the scroll amount on vertical scroll.

Definition at line 201 of file scrollarea.cpp.

Referenced by getVerticalMarkerDimension(), logic(), mousePress(), mouseWheelDown(), mouseWheelUp(), and scrollToRectangle().

unsigned int gcn::ScrollArea::getVerticalScrollPolicy  )  [virtual]
 

Gets the vertical scrollbar policy.

See enum with policies.

Returns:
the policy for the vertical scrollbar. See enum with policies.

Definition at line 172 of file scrollarea.cpp.

void gcn::ScrollArea::logic  )  [virtual]
 

Called for all Widgets in the gui each time Gui::logic is called.

You can do logic stuff here like playing an animation.

See also:
Gui

Reimplemented from gcn::Widget.

Definition at line 843 of file scrollarea.cpp.

References checkPolicies(), gcn::Widget::getBorderSize(), getContentDimension(), getHorizontalScrollAmount(), getVerticalScrollAmount(), gcn::Widget::logic(), setHorizontalScrollAmount(), gcn::Widget::setPosition(), setVerticalScrollAmount(), and gcn::Rectangle::y.

Referenced by gcn::DropDown::logic().

void gcn::ScrollArea::mouseMotion int  x,
int  y
[virtual]
 

Called when the mouse moves and the mouse is in the Widget area or if the Widget has focus.

Parameters:
x the x coordinate of the mouse relative to the Widget itself.
y the y coordinate of the mouse relative to the Widget itself.

Reimplemented from gcn::MouseListener.

Definition at line 381 of file scrollarea.cpp.

References getHorizontalBarDimension(), getHorizontalMarkerDimension(), getHorizontalMaxScroll(), getVerticalBarDimension(), getVerticalMarkerDimension(), getVerticalMaxScroll(), gcn::Rectangle::height, setHorizontalScrollAmount(), setVerticalScrollAmount(), gcn::Rectangle::width, gcn::Rectangle::x, and gcn::Rectangle::y.

void gcn::ScrollArea::mousePress int  x,
int  y,
int  button
[virtual]
 

Called when a mouse button is pressed when the mouse is in the Widget area or if the Widget has focus.

NOTE: A mouse press is NOT equal to a mouse click. Use mouseClickMessage to check for mouse clicks.

Parameters:
x the x coordinate of the mouse relative to the Widget itself.
y the y coordinate of the mouse relative to the Widget itself.
button the button pressed.

Reimplemented from gcn::MouseListener.

Definition at line 337 of file scrollarea.cpp.

References getDownButtonDimension(), getHorizontalMarkerDimension(), getHorizontalScrollAmount(), getLeftButtonDimension(), getRightButtonDimension(), getUpButtonDimension(), getVerticalMarkerDimension(), getVerticalScrollAmount(), setHorizontalScrollAmount(), setVerticalScrollAmount(), gcn::Rectangle::x, and gcn::Rectangle::y.

void gcn::ScrollArea::mouseRelease int  x,
int  y,
int  button
[virtual]
 

Called when a mouse button is released when the mouse is in the Widget area or if the Widget has focus.

Parameters:
x the x coordinate of the mouse relative to the Widget itself.
y the y coordinate of the mouse relative to the Widget itself.
button the button released.

Reimplemented from gcn::MouseListener.

Definition at line 371 of file scrollarea.cpp.

void gcn::ScrollArea::mouseWheelDown int  x,
int  y
[virtual]
 

Called on a mouse wheel down when the mouse is in the Widget area or if the Widget has focus.

Parameters:
x the x coordinate of the mouse relative to the Widget itself.
y the y coordinate of the mouse relative to the Widget itself.

Reimplemented from gcn::MouseListener.

Definition at line 1280 of file scrollarea.cpp.

References getContentDimension(), getVerticalScrollAmount(), gcn::Widget::hasMouse(), and setVerticalScrollAmount().

void gcn::ScrollArea::mouseWheelUp int  x,
int  y
[virtual]
 

Called on a mouse wheel up when the mouse is in the Widget area or if the Widget has focus.

Parameters:
x the x coordinate of the mouse relative to the Widget itself.
y the y coordinate of the mouse relative to the Widget itself.

Reimplemented from gcn::MouseListener.

Definition at line 1272 of file scrollarea.cpp.

References getContentDimension(), getVerticalScrollAmount(), gcn::Widget::hasMouse(), and setVerticalScrollAmount().

void gcn::ScrollArea::moveToBottom Widget widget  )  [virtual]
 

Moves a widget to the bottom of the BasicContainer.

The Widget will be drawn below all other Widgets in the BasicContainer.

Parameters:
widget the Widget to move.

Implements gcn::BasicContainer.

Definition at line 874 of file scrollarea.cpp.

References gcn::Widget::getParent(), and gcn::BasicContainer::moveToBottom().

void gcn::ScrollArea::moveToTop Widget widget  )  [virtual]
 

Moves a Widget to the top of the BasicContainer.

The widget will be drawn above all other Widgets in the BasicContainer.

Parameters:
widget the Widget to move.

Implements gcn::BasicContainer.

Definition at line 859 of file scrollarea.cpp.

References gcn::Widget::getParent(), and gcn::BasicContainer::moveToTop().

void gcn::ScrollArea::scrollToRectangle const Rectangle rectangle  )  [virtual]
 

Tries to scroll to a specific rectangle.

If the rectangle is to large to be visible as much as possibly, begining in the rectangles upper corner, will be visible.

Parameters:
rectangle the Rectangle to scroll to.

Definition at line 1245 of file scrollarea.cpp.

References getContentDimension(), getHorizontalScrollAmount(), getVerticalScrollAmount(), gcn::Rectangle::height, setHorizontalScrollAmount(), setVerticalScrollAmount(), and gcn::Rectangle::width.

Referenced by gcn::TextBox::scrollToCaret(), and gcn::ListBox::setSelected().

void gcn::ScrollArea::setContent Widget widget  )  [virtual]
 

Sets the content.

Parameters:
content the content of the ScrollArea.

Definition at line 131 of file scrollarea.cpp.

References gcn::Widget::_getFocusHandler(), gcn::Widget::_setFocusHandler(), gcn::Widget::_setParent(), and checkPolicies().

Referenced by gcn::DropDown::DropDown(), ScrollArea(), gcn::DropDown::setListBox(), gcn::DropDown::setScrollArea(), and ~ScrollArea().

void gcn::ScrollArea::setHorizontalScrollAmount int  hScroll  )  [virtual]
 

Sets the amount to scroll horizontaly.

Parameters:
hScroll the amount to scroll.

Definition at line 206 of file scrollarea.cpp.

References getHorizontalMaxScroll().

Referenced by logic(), mouseMotion(), mousePress(), scrollToRectangle(), and setScrollAmount().

void gcn::ScrollArea::setHorizontalScrollPolicy unsigned int  hPolicy  )  [virtual]
 

Sets the horizontal scrollbar policy.

See enum with policies.

Parameters:
hPolicy the policy for the horizontal scrollbar. See enum with policies.

Definition at line 155 of file scrollarea.cpp.

References checkPolicies().

Referenced by gcn::DropDown::DropDown().

void gcn::ScrollArea::setScrollAmount int  hScroll,
int  vScroll
[virtual]
 

Sets the amount to scroll horizontaly and verticaly.

Parameters:
hScroll the amount to scroll on horizontal scroll.
vScroll the amount to scroll on vertical scroll.

Definition at line 227 of file scrollarea.cpp.

References setHorizontalScrollAmount(), and setVerticalScrollAmount().

void gcn::ScrollArea::setScrollbarWidth int  width  )  [virtual]
 

Sets the width.

Parameters:
width the width of the ScrollBar.

Definition at line 273 of file scrollarea.cpp.

void gcn::ScrollArea::setScrollPolicy unsigned int  hPolicy,
unsigned int  vPolicy
[virtual]
 

Sets the horizontal and vertical scrollbar policy.

See enum with policies.

Parameters:
hPolicy the policy for the horizontal scrollbar. See enum with policies.
vPolicy the policy for the vertical scrollbar. See enum with policies.

Definition at line 177 of file scrollarea.cpp.

References checkPolicies().

void gcn::ScrollArea::setVerticalScrollAmount int  vScroll  )  [virtual]
 

Sets the amount to scroll verticaly.

Parameters:
vScroll the amount to scroll.

Definition at line 184 of file scrollarea.cpp.

References getVerticalMaxScroll().

Referenced by logic(), mouseMotion(), mousePress(), mouseWheelDown(), mouseWheelUp(), scrollToRectangle(), and setScrollAmount().

void gcn::ScrollArea::setVerticalScrollPolicy unsigned int  vPolicy  )  [virtual]
 

Sets the vertical scrollbar policy.

See enum with policies.

Parameters:
vPolicy the policy for the vertical scrollbar. See enum with policies.

Definition at line 166 of file scrollarea.cpp.

References checkPolicies().


The documentation for this class was generated from the following files:
Generated on Tue May 17 21:23:27 2005 for Guichan by  doxygen 1.4.1