#include <scrollarea.h>
Contrary to Guichan's scroll area, this scroll area takes ownership over its content. However, it won't delete a previously set content widget when setContent is called!
Definition at line 39 of file scrollarea.h.
Public Member Functions | |
ScrollArea () | |
Constructor that takes no content. | |
ScrollArea (gcn::Widget *content) | |
Constructor. | |
~ScrollArea () | |
Destructor. | |
void | logic () |
Logic function optionally adapts width or height of contents. | |
void | draw (gcn::Graphics *graphics) |
Draws the scroll area. | |
void | drawFrame (gcn::Graphics *graphics) |
Draws the background and border of the scroll area. | |
void | setOpaque (bool opaque) |
Sets whether the widget should draw its background or not. | |
bool | isOpaque () const |
Returns whether the widget draws its background or not. | |
Protected Types | |
enum | BUTTON_DIR { UP, DOWN, LEFT, RIGHT } |
Protected Member Functions | |
void | init () |
Initializes the scroll area. | |
void | drawButton (gcn::Graphics *graphics, BUTTON_DIR dir) |
void | drawUpButton (gcn::Graphics *graphics) |
void | drawDownButton (gcn::Graphics *graphics) |
void | drawLeftButton (gcn::Graphics *graphics) |
void | drawRightButton (gcn::Graphics *graphics) |
void | drawVBar (gcn::Graphics *graphics) |
void | drawHBar (gcn::Graphics *graphics) |
void | drawVMarker (gcn::Graphics *graphics) |
void | drawHMarker (gcn::Graphics *graphics) |
Protected Attributes | |
bool | mOpaque |
Static Protected Attributes | |
static int | instances = 0 |
static float | mAlpha = 1.0 |
static ImageRect | background |
static ImageRect | vMarker |
static Image * | buttons [4][2] |
enum ScrollArea::BUTTON_DIR [protected] |
ScrollArea::ScrollArea | ( | ) |
Constructor that takes no content.
Needed for use with the DropDown class.
Definition at line 38 of file scrollarea.cpp.
ScrollArea::ScrollArea | ( | gcn::Widget * | content | ) |
Constructor.
content | the initial content to show in the scroll area |
Definition at line 45 of file scrollarea.cpp.
ScrollArea::~ScrollArea | ( | ) |
void ScrollArea::logic | ( | ) |
Logic function optionally adapts width or height of contents.
This depends on the scrollbar settings.
Definition at line 146 of file scrollarea.cpp.
void ScrollArea::draw | ( | gcn::Graphics * | graphics | ) |
void ScrollArea::drawFrame | ( | gcn::Graphics * | graphics | ) |
void ScrollArea::setOpaque | ( | bool | opaque | ) |
Sets whether the widget should draw its background or not.
Definition at line 224 of file scrollarea.cpp.
bool ScrollArea::isOpaque | ( | ) | const [inline] |
void ScrollArea::init | ( | ) | [protected] |
void ScrollArea::drawButton | ( | gcn::Graphics * | graphics, | |
BUTTON_DIR | dir | |||
) | [protected] |
Definition at line 230 of file scrollarea.cpp.
void ScrollArea::drawUpButton | ( | gcn::Graphics * | graphics | ) | [protected] |
Definition at line 259 of file scrollarea.cpp.
void ScrollArea::drawDownButton | ( | gcn::Graphics * | graphics | ) | [protected] |
Definition at line 264 of file scrollarea.cpp.
void ScrollArea::drawLeftButton | ( | gcn::Graphics * | graphics | ) | [protected] |
Definition at line 269 of file scrollarea.cpp.
void ScrollArea::drawRightButton | ( | gcn::Graphics * | graphics | ) | [protected] |
Definition at line 274 of file scrollarea.cpp.
void ScrollArea::drawVBar | ( | gcn::Graphics * | graphics | ) | [protected] |
Definition at line 279 of file scrollarea.cpp.
void ScrollArea::drawHBar | ( | gcn::Graphics * | graphics | ) | [protected] |
Definition at line 287 of file scrollarea.cpp.
void ScrollArea::drawVMarker | ( | gcn::Graphics * | graphics | ) | [protected] |
Definition at line 295 of file scrollarea.cpp.
void ScrollArea::drawHMarker | ( | gcn::Graphics * | graphics | ) | [protected] |
Definition at line 303 of file scrollarea.cpp.
int ScrollArea::instances = 0 [static, protected] |
Definition at line 109 of file scrollarea.h.
float ScrollArea::mAlpha = 1.0 [static, protected] |
Definition at line 110 of file scrollarea.h.
ImageRect ScrollArea::background [static, protected] |
Definition at line 111 of file scrollarea.h.
ImageRect ScrollArea::vMarker [static, protected] |
Definition at line 112 of file scrollarea.h.
Image * ScrollArea::buttons [static, protected] |
Definition at line 113 of file scrollarea.h.
bool ScrollArea::mOpaque [protected] |
Definition at line 115 of file scrollarea.h.