#include <scrollarea.hpp>
Inheritance diagram for gcn::ScrollArea:
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 77 of file scrollarea.hpp.
Public Types | |
SHOW_ALWAYS | |
SHOW_NEVER | |
SHOW_AUTO | |
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 Widget * | getContent () |
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 vertically. | |
virtual int | getVerticalScrollAmount () |
Gets the amount that is scrolled vertically. | |
virtual void | setHorizontalScrollAmount (int hScroll) |
Sets the amount to scroll horizontally. | |
virtual int | getHorizontalScrollAmount () |
Gets the amount that is scrolled horizontally. | |
virtual void | setScrollAmount (int hScroll, int vScroll) |
Sets the amount to scroll horizontally and vertically. | |
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 | setLeftButtonScrollAmount (int amount) |
Sets the amount to scroll in pixels when the left scroll button is pushed. | |
virtual void | setRightButtonScrollAmount (int amount) |
Sets the amount to scroll in pixels when the right scroll button is pushed. | |
virtual void | setUpButtonScrollAmount (int amount) |
Sets the amount to scroll in pixels when the up scroll button is pushed. | |
virtual void | setDownButtonScrollAmount (int amount) |
Sets the amount to scroll in pixels when the down scroll button is pushed. | |
virtual int | getLeftButtonScrollAmount () |
Gets the amount to scroll in pixels when the left scroll button is pushed. | |
virtual int | getRightButtonScrollAmount () |
Gets the amount to scroll in pixels when the right scroll button is pushed. | |
virtual int | getUpButtonScrollAmount () |
Gets the amount to scroll in pixels when the up scroll button is pushed. | |
virtual int | getDownButtonScrollAmount () |
Gets the amount to scroll in pixels when the down scroll button is pushed. | |
virtual void | showWidgetPart (Widget *widget, Rectangle area) |
Tries to show a specific part of a Widget by moving it. | |
virtual Rectangle | getChildrenArea () |
Gets the subarea of the BasicContainer that the children occupy. | |
virtual Widget * | getWidgetAt (int x, int y) |
Gets a widget from a certain position in the container. | |
virtual void | draw (Graphics *graphics) |
Draws the Widget. | |
virtual void | drawBorder (Graphics *graphics) |
Draws the Widget border. | |
virtual void | logic () |
Called for all Widgets in the gui each time Gui::logic is called. | |
virtual void | setWidth (int width) |
Sets the width of the Widget in pixels. | |
virtual void | setHeight (int height) |
Sets the height of the Widget in pixels. | |
virtual void | setDimension (const Rectangle &dimension) |
Sets the dimension of the Widget. | |
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 | drawBackground (Graphics *graphics) |
Draws the background of the ScrollArea (the area behind the content). | |
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 | 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 | 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 | |
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 |
int | mUpButtonScrollAmount |
int | mDownButtonScrollAmount |
int | mLeftButtonScrollAmount |
int | mRightButtonScrollAmount |
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 333 of file scrollarea.hpp.
gcn::ScrollArea::ScrollArea | ( | Widget * | content | ) |
Constructor.
content | the content of the ScrollArea. |
Definition at line 91 of file scrollarea.cpp.
References gcn::Widget::addMouseListener(), mDownButtonPressed, mDownButtonScrollAmount, mHorizontalMarkerMousePosition, mHorizontalMarkerPressed, mHPolicy, mHScroll, mLeftButtonPressed, mLeftButtonScrollAmount, mRightButtonPressed, mRightButtonScrollAmount, mScrollbarWidth, mUpButtonPressed, mUpButtonScrollAmount, mVerticalMarkerMousePosition, mVerticalMarkerPressed, mVPolicy, mVScroll, and setContent().
gcn::ScrollArea::ScrollArea | ( | Widget * | content, | |
unsigned int | hPolicy, | |||
unsigned int | vPolicy | |||
) |
Constructor.
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 115 of file scrollarea.cpp.
References gcn::Widget::addMouseListener(), mDownButtonPressed, mDownButtonScrollAmount, mHorizontalMarkerMousePosition, mHorizontalMarkerPressed, mHPolicy, mHScroll, mLeftButtonPressed, mLeftButtonScrollAmount, mRightButtonPressed, mRightButtonScrollAmount, mScrollbarWidth, mUpButtonPressed, mUpButtonScrollAmount, mVerticalMarkerMousePosition, mVerticalMarkerPressed, mVPolicy, mVScroll, and setContent().
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.
graphics | a Graphics object to draw with. |
Implements gcn::Widget.
Definition at line 419 of file scrollarea.cpp.
References drawBackground(), gcn::BasicContainer::drawChildren(), drawDownButton(), drawHBar(), drawHMarker(), drawLeftButton(), drawRightButton(), drawUpButton(), drawVBar(), drawVMarker(), gcn::Graphics::fillRectangle(), gcn::Widget::getBaseColor(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, mVBarVisible, and gcn::Graphics::setColor().
void gcn::ScrollArea::drawBackground | ( | Graphics * | graphics | ) | [protected, virtual] |
Draws the background of the ScrollArea (the area behind the content).
graphics | a Graphics object to draw with. |
Definition at line 517 of file scrollarea.cpp.
References gcn::Graphics::fillRectangle(), gcn::Widget::getBackgroundColor(), getChildrenArea(), and gcn::Graphics::setColor().
Referenced by draw().
void gcn::ScrollArea::drawBorder | ( | Graphics * | graphics | ) | [virtual] |
Draws 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.
graphics | a Graphics object to draw with. |
Reimplemented from gcn::Widget.
Definition at line 451 of file scrollarea.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Widget::getBaseColor(), gcn::Widget::getBorderSize(), gcn::Widget::getHeight(), gcn::Widget::getWidth(), and gcn::Graphics::setColor().
void gcn::ScrollArea::drawDownButton | ( | Graphics * | graphics | ) | [protected, virtual] |
Draws the down button.
graphics | a Graphics object to draw with. |
Definition at line 584 of file scrollarea.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Graphics::fillRectangle(), gcn::Widget::getBaseColor(), getDownButtonDimension(), gcn::Widget::getForegroundColor(), gcn::Rectangle::height, mDownButtonPressed, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Graphics::setColor(), and gcn::Rectangle::width.
Referenced by draw().
void gcn::ScrollArea::drawHBar | ( | Graphics * | graphics | ) | [protected, virtual] |
Draws the horizontal scrollbar.
graphics | a Graphics object to draw with. |
Definition at line 475 of file scrollarea.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Graphics::fillRectangle(), gcn::Widget::getBaseColor(), getHorizontalBarDimension(), gcn::Rectangle::height, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Graphics::setColor(), and gcn::Rectangle::width.
Referenced by draw().
void gcn::ScrollArea::drawHMarker | ( | Graphics * | graphics | ) | [protected, virtual] |
Draws the horizontal marker.
graphics | a Graphics object to draw with. |
Definition at line 794 of file scrollarea.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Graphics::fillRectangle(), gcn::Widget::getBaseColor(), getHorizontalMarkerDimension(), gcn::Rectangle::height, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Graphics::setColor(), and gcn::Rectangle::width.
Referenced by draw().
void gcn::ScrollArea::drawLeftButton | ( | Graphics * | graphics | ) | [protected, virtual] |
Draws the left button.
graphics | a Graphics object to draw with. |
Definition at line 645 of file scrollarea.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Graphics::fillRectangle(), gcn::Widget::getBaseColor(), gcn::Widget::getForegroundColor(), getLeftButtonDimension(), gcn::Rectangle::height, mLeftButtonPressed, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Graphics::setColor(), and gcn::Rectangle::width.
Referenced by draw().
void gcn::ScrollArea::drawRightButton | ( | Graphics * | graphics | ) | [protected, virtual] |
Draws the right button.
graphics | a Graphics object to draw with. |
Definition at line 706 of file scrollarea.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Graphics::fillRectangle(), gcn::Widget::getBaseColor(), gcn::Widget::getForegroundColor(), getRightButtonDimension(), gcn::Rectangle::height, mRightButtonPressed, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Graphics::setColor(), and gcn::Rectangle::width.
Referenced by draw().
void gcn::ScrollArea::drawUpButton | ( | Graphics * | graphics | ) | [protected, virtual] |
Draws the up button.
graphics | a Graphics object to draw with. |
Definition at line 523 of file scrollarea.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Graphics::fillRectangle(), gcn::Widget::getBaseColor(), gcn::Widget::getForegroundColor(), getUpButtonDimension(), gcn::Rectangle::height, mUpButtonPressed, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Graphics::setColor(), and gcn::Rectangle::width.
Referenced by draw().
void gcn::ScrollArea::drawVBar | ( | Graphics * | graphics | ) | [protected, virtual] |
Draws the vertical scrollbar.
graphics | a Graphics object to draw with. |
Definition at line 496 of file scrollarea.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Graphics::fillRectangle(), gcn::Widget::getBaseColor(), getVerticalBarDimension(), gcn::Rectangle::height, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Graphics::setColor(), and gcn::Rectangle::width.
Referenced by draw().
void gcn::ScrollArea::drawVMarker | ( | Graphics * | graphics | ) | [protected, virtual] |
Draws the vertical marker.
graphics | a Graphics object to draw with. |
Definition at line 767 of file scrollarea.cpp.
References gcn::Color::a, gcn::Graphics::drawLine(), gcn::Graphics::fillRectangle(), gcn::Widget::getBaseColor(), getVerticalMarkerDimension(), gcn::Rectangle::height, gcn::Graphics::popClipArea(), gcn::Graphics::pushClipArea(), gcn::Graphics::setColor(), and gcn::Rectangle::width.
Referenced by draw().
Rectangle gcn::ScrollArea::getChildrenArea | ( | ) | [virtual] |
Gets the subarea of the BasicContainer that the children occupy.
Reimplemented from gcn::BasicContainer.
Definition at line 999 of file scrollarea.cpp.
References gcn::Widget::getHeight(), gcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, and mVBarVisible.
Referenced by gcn::DropDown::adjustHeight(), drawBackground(), getHorizontalMarkerDimension(), getHorizontalMaxScroll(), getVerticalMarkerDimension(), getVerticalMaxScroll(), getWidgetAt(), mousePress(), mouseWheelDown(), and mouseWheelUp().
Widget * gcn::ScrollArea::getContent | ( | ) | [virtual] |
Gets the content.
Definition at line 160 of file scrollarea.cpp.
References gcn::BasicContainer::mWidgets.
Referenced by checkPolicies(), getHorizontalMarkerDimension(), getHorizontalMaxScroll(), getVerticalMarkerDimension(), getVerticalMaxScroll(), getWidgetAt(), logic(), and showWidgetPart().
Rectangle gcn::ScrollArea::getDownButtonDimension | ( | ) | [protected, virtual] |
Gets the down button dimension.
Definition at line 944 of file scrollarea.cpp.
References gcn::Widget::getHeight(), gcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, and mVBarVisible.
Referenced by drawDownButton(), getVerticalBarDimension(), and mousePress().
int gcn::ScrollArea::getDownButtonScrollAmount | ( | ) | [virtual] |
Gets the amount to scroll in pixels when the down scroll button is pushed.
Definition at line 1250 of file scrollarea.cpp.
References mDownButtonScrollAmount.
Rectangle gcn::ScrollArea::getHorizontalBarDimension | ( | ) | [protected, virtual] |
Gets the horizontal scrollbar dimension.
Definition at line 1046 of file scrollarea.cpp.
References gcn::Widget::getHeight(), getLeftButtonDimension(), getRightButtonDimension(), gcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, and mVBarVisible.
Referenced by drawHBar(), getHorizontalMarkerDimension(), mouseMotion(), and mousePress().
Rectangle gcn::ScrollArea::getHorizontalMarkerDimension | ( | ) | [protected, virtual] |
Gets the horizontal marker dimension.
Definition at line 1115 of file scrollarea.cpp.
References getChildrenArea(), getContent(), getHorizontalBarDimension(), getHorizontalMaxScroll(), getHorizontalScrollAmount(), gcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, 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.
Definition at line 248 of file scrollarea.cpp.
References checkPolicies(), gcn::Widget::getBorderSize(), getChildrenArea(), getContent(), gcn::Widget::getWidth(), and gcn::Rectangle::width.
Referenced by getHorizontalMarkerDimension(), mouseMotion(), and setHorizontalScrollAmount().
int gcn::ScrollArea::getHorizontalScrollAmount | ( | ) | [virtual] |
Gets the amount that is scrolled horizontally.
Definition at line 237 of file scrollarea.cpp.
References mHScroll.
Referenced by getHorizontalMarkerDimension(), logic(), and mousePress().
unsigned int gcn::ScrollArea::getHorizontalScrollPolicy | ( | ) | [virtual] |
Gets the horizontal scrollbar policy.
See enum with policies.
Definition at line 176 of file scrollarea.cpp.
References mHPolicy.
Rectangle gcn::ScrollArea::getLeftButtonDimension | ( | ) | [protected, virtual] |
Gets the left button dimension.
Definition at line 965 of file scrollarea.cpp.
References gcn::Widget::getHeight(), mHBarVisible, and mScrollbarWidth.
Referenced by drawLeftButton(), getHorizontalBarDimension(), and mousePress().
int gcn::ScrollArea::getLeftButtonScrollAmount | ( | ) | [virtual] |
Gets the amount to scroll in pixels when the left scroll button is pushed.
Definition at line 1235 of file scrollarea.cpp.
References mLeftButtonScrollAmount.
Rectangle gcn::ScrollArea::getRightButtonDimension | ( | ) | [protected, virtual] |
Gets the right button dimension.
Definition at line 978 of file scrollarea.cpp.
References gcn::Widget::getHeight(), gcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, and mVBarVisible.
Referenced by drawRightButton(), getHorizontalBarDimension(), and mousePress().
int gcn::ScrollArea::getRightButtonScrollAmount | ( | ) | [virtual] |
Gets the amount to scroll in pixels when the right scroll button is pushed.
Definition at line 1240 of file scrollarea.cpp.
References mRightButtonScrollAmount.
int gcn::ScrollArea::getScrollbarWidth | ( | ) | [virtual] |
Gets the width.
Definition at line 302 of file scrollarea.cpp.
References mScrollbarWidth.
Rectangle gcn::ScrollArea::getUpButtonDimension | ( | ) | [protected, virtual] |
Gets the up button dimension.
Definition at line 931 of file scrollarea.cpp.
References gcn::Widget::getWidth(), mScrollbarWidth, and mVBarVisible.
Referenced by drawUpButton(), getVerticalBarDimension(), and mousePress().
int gcn::ScrollArea::getUpButtonScrollAmount | ( | ) | [virtual] |
Gets the amount to scroll in pixels when the up scroll button is pushed.
Definition at line 1245 of file scrollarea.cpp.
References mUpButtonScrollAmount.
Rectangle gcn::ScrollArea::getVerticalBarDimension | ( | ) | [protected, virtual] |
Gets the vertical scrollbar dimension.
Definition at line 1020 of file scrollarea.cpp.
References getDownButtonDimension(), gcn::Widget::getHeight(), getUpButtonDimension(), gcn::Widget::getWidth(), mHBarVisible, mScrollbarWidth, and mVBarVisible.
Referenced by drawVBar(), getVerticalMarkerDimension(), mouseMotion(), and mousePress().
Rectangle gcn::ScrollArea::getVerticalMarkerDimension | ( | ) | [protected, virtual] |
Gets the vertical marker dimension.
Definition at line 1072 of file scrollarea.cpp.
References getChildrenArea(), getContent(), gcn::Widget::getHeight(), getVerticalBarDimension(), getVerticalMaxScroll(), getVerticalScrollAmount(), gcn::Rectangle::height, mScrollbarWidth, mVBarVisible, 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.
Definition at line 268 of file scrollarea.cpp.
References checkPolicies(), gcn::Widget::getBorderSize(), getChildrenArea(), getContent(), gcn::Widget::getHeight(), and gcn::Rectangle::height.
Referenced by getVerticalMarkerDimension(), mouseMotion(), and setVerticalScrollAmount().
int gcn::ScrollArea::getVerticalScrollAmount | ( | ) | [virtual] |
Gets the amount that is scrolled vertically.
Definition at line 216 of file scrollarea.cpp.
References mVScroll.
Referenced by getVerticalMarkerDimension(), logic(), mousePress(), mouseWheelDown(), and mouseWheelUp().
unsigned int gcn::ScrollArea::getVerticalScrollPolicy | ( | ) | [virtual] |
Gets the vertical scrollbar policy.
See enum with policies.
Definition at line 187 of file scrollarea.cpp.
References mVPolicy.
Widget * gcn::ScrollArea::getWidgetAt | ( | int | x, | |
int | y | |||
) | [virtual] |
Gets a widget from a certain position in the container.
This function is used to decide which gets mouse input, thus it can be overloaded to change that behaviour.
x | the x coordinate. | |
y | the y coordinate. |
Reimplemented from gcn::BasicContainer.
Definition at line 1171 of file scrollarea.cpp.
References getChildrenArea(), and getContent().
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.
Reimplemented from gcn::BasicContainer.
Definition at line 821 of file scrollarea.cpp.
References checkPolicies(), gcn::Widget::getBorderSize(), getContent(), getHorizontalScrollAmount(), getVerticalScrollAmount(), gcn::Widget::logic(), mHScroll, mVScroll, setHorizontalScrollAmount(), gcn::Widget::setPosition(), and setVerticalScrollAmount().
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.
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, mHorizontalMarkerMousePosition, mHorizontalMarkerPressed, mVerticalMarkerMousePosition, mVerticalMarkerPressed, 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.
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 307 of file scrollarea.cpp.
References getChildrenArea(), getDownButtonDimension(), getHorizontalBarDimension(), getHorizontalMarkerDimension(), getHorizontalScrollAmount(), getLeftButtonDimension(), getRightButtonDimension(), getUpButtonDimension(), getVerticalBarDimension(), getVerticalMarkerDimension(), getVerticalScrollAmount(), mDownButtonPressed, mDownButtonScrollAmount, mHorizontalMarkerMousePosition, mHorizontalMarkerPressed, mLeftButtonPressed, mLeftButtonScrollAmount, mRightButtonPressed, mRightButtonScrollAmount, mUpButtonPressed, mUpButtonScrollAmount, mVerticalMarkerMousePosition, mVerticalMarkerPressed, 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.
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.
References mDownButtonPressed, mHorizontalMarkerPressed, mLeftButtonPressed, mRightButtonPressed, mUpButtonPressed, and mVerticalMarkerPressed.
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.
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 1189 of file scrollarea.cpp.
References getChildrenArea(), 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.
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 1181 of file scrollarea.cpp.
References getChildrenArea(), getVerticalScrollAmount(), gcn::Widget::hasMouse(), and setVerticalScrollAmount().
void gcn::ScrollArea::setContent | ( | Widget * | widget | ) | [virtual] |
Sets the content.
widget | the content of the ScrollArea. |
Definition at line 144 of file scrollarea.cpp.
References gcn::BasicContainer::add(), checkPolicies(), gcn::BasicContainer::clear(), and gcn::Widget::setPosition().
Referenced by gcn::DropDown::DropDown(), ScrollArea(), and ~ScrollArea().
void gcn::ScrollArea::setDimension | ( | const Rectangle & | dimension | ) | [virtual] |
Sets the dimension of the Widget.
It is relative to it's parent.
dimension | the Widget dimension. |
Reimplemented from gcn::Widget.
Definition at line 1209 of file scrollarea.cpp.
References checkPolicies(), and gcn::Widget::setDimension().
void gcn::ScrollArea::setHeight | ( | int | height | ) | [virtual] |
Sets the height of the Widget in pixels.
height | the Widget height in pixels. |
Reimplemented from gcn::Widget.
Definition at line 1203 of file scrollarea.cpp.
References checkPolicies(), and gcn::Widget::setHeight().
Referenced by gcn::DropDown::adjustHeight().
void gcn::ScrollArea::setHorizontalScrollAmount | ( | int | hScroll | ) | [virtual] |
Sets the amount to scroll horizontally.
hScroll | the amount to scroll. |
Definition at line 221 of file scrollarea.cpp.
References getHorizontalMaxScroll(), and mHScroll.
Referenced by logic(), mouseMotion(), mousePress(), setScrollAmount(), and showWidgetPart().
void gcn::ScrollArea::setHorizontalScrollPolicy | ( | unsigned int | hPolicy | ) | [virtual] |
Sets the horizontal scrollbar policy.
See enum with policies.
hPolicy | the policy for the horizontal scrollbar. See enum with policies. |
Definition at line 170 of file scrollarea.cpp.
References checkPolicies(), and mHPolicy.
void gcn::ScrollArea::setScrollAmount | ( | int | hScroll, | |
int | vScroll | |||
) | [virtual] |
Sets the amount to scroll horizontally and vertically.
hScroll | the amount to scroll on horizontal scroll. | |
vScroll | the amount to scroll on vertical scroll. |
Definition at line 242 of file scrollarea.cpp.
References setHorizontalScrollAmount(), and setVerticalScrollAmount().
void gcn::ScrollArea::setScrollbarWidth | ( | int | width | ) | [virtual] |
Sets the width.
width | the width of the ScrollBar. |
Definition at line 290 of file scrollarea.cpp.
References mScrollbarWidth.
void gcn::ScrollArea::setScrollPolicy | ( | unsigned int | hPolicy, | |
unsigned int | vPolicy | |||
) | [virtual] |
Sets the horizontal and vertical scrollbar policy.
See enum with policies.
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 192 of file scrollarea.cpp.
References checkPolicies(), mHPolicy, and mVPolicy.
void gcn::ScrollArea::setVerticalScrollAmount | ( | int | vScroll | ) | [virtual] |
Sets the amount to scroll vertically.
vScroll | the amount to scroll. |
Definition at line 199 of file scrollarea.cpp.
References getVerticalMaxScroll(), and mVScroll.
Referenced by logic(), mouseMotion(), mousePress(), mouseWheelDown(), mouseWheelUp(), setScrollAmount(), and showWidgetPart().
void gcn::ScrollArea::setVerticalScrollPolicy | ( | unsigned int | vPolicy | ) | [virtual] |
Sets the vertical scrollbar policy.
See enum with policies.
vPolicy | the policy for the vertical scrollbar. See enum with policies. |
Definition at line 181 of file scrollarea.cpp.
References checkPolicies(), and mVPolicy.
Referenced by gcn::DropDown::DropDown().
void gcn::ScrollArea::setWidth | ( | int | width | ) | [virtual] |
Sets the width of the Widget in pixels.
width | the Widget width in pixels. |
Reimplemented from gcn::Widget.
Definition at line 1197 of file scrollarea.cpp.
References checkPolicies(), and gcn::Widget::setWidth().
Referenced by gcn::DropDown::adjustHeight().
Tries to show a specific part of a Widget by moving it.
widget | the target Widget. | |
area | the area to show. |
Reimplemented from gcn::BasicContainer.
Definition at line 1158 of file scrollarea.cpp.
References gcn::Widget::getBorderSize(), getContent(), gcn::Widget::getX(), gcn::Widget::getY(), setHorizontalScrollAmount(), setVerticalScrollAmount(), and gcn::BasicContainer::showWidgetPart().