ScrollArea Class Reference
[Core GUI related classes (widgets)]

#include <scrollarea.h>

List of all members.


Detailed Description

A scroll area.

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 Imagebuttons [4][2]

Member Enumeration Documentation

enum ScrollArea::BUTTON_DIR [protected]

Enumerator:
UP 
DOWN 
LEFT 
RIGHT 

Definition at line 87 of file scrollarea.h.


Constructor & Destructor Documentation

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.

Parameters:
content the initial content to show in the scroll area

Definition at line 45 of file scrollarea.cpp.

ScrollArea::~ScrollArea (  ) 

Destructor.

Also deletes the content.

Definition at line 52 of file scrollarea.cpp.


Member Function Documentation

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  ) 

Draws the scroll area.

Definition at line 171 of file scrollarea.cpp.

void ScrollArea::drawFrame ( gcn::Graphics *  graphics  ) 

Draws the background and border of the scroll area.

Definition at line 211 of file scrollarea.cpp.

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]

Returns whether the widget draws its background or not.

Definition at line 84 of file scrollarea.h.

void ScrollArea::init (  )  [protected]

Initializes the scroll area.

Definition at line 75 of file scrollarea.cpp.

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.


Member Data Documentation

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.


The documentation for this class was generated from the following files:

Generated on Sun Apr 26 17:30:44 2009 for The Mana World by  doxygen 1.5.5