Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

PG_ScrollBar Class Reference

Inheritance diagram for PG_ScrollBar:

Inheritance graph
[legend]
Collaboration diagram for PG_ScrollBar:

Collaboration graph
[legend]
List of all members.

Detailed Description

A vertical or horizontal scrollbar.

Author:
Alexander Pipelka

Doesn't actually tie itself to any object to be scrolled, just get's told it's current state through function calls.

Examples:

paratest.cpp.


Public Types

enum  ScrollDirection { VERTICAL, HORIZONTAL }
 ScrollbarType. More...

enum  {
  IDSCROLLBAR_UP = PG_WIDGETID_INTERNAL + 1, IDSCROLLBAR_DOWN = PG_WIDGETID_INTERNAL + 2, IDSCROLLBAR_LEFT = PG_WIDGETID_INTERNAL + 3, IDSCROLLBAR_RIGHT = PG_WIDGETID_INTERNAL + 4,
  IDSCROLLBAR_DRAG = PG_WIDGETID_INTERNAL + 5
}
 Widget ID's. More...


Public Member Functions

 PG_ScrollBar (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, ScrollDirection direction=VERTICAL, int id=-1, const char *style="Scrollbar")
virtual ~PG_ScrollBar ()
void LoadThemeStyle (const char *widgettype)
 Load a specific themestyle.

void SetPosition (int pos)
int GetPosition ()
void SetRange (Uint32 min, Uint32 max)
int GetMinRange ()
int GetMaxRange ()
void SetLineSize (int ls)
void SetPageSize (int ps)

Public Attributes

SignalScrollPos< long > sigScrollPos
SignalScrollTrack< long > sigScrollTrack

Protected Member Functions

void eventSizeWidget (Uint16 w, Uint16 h)
 Callback for the SizeWidget event.

bool eventMouseMotion (const SDL_MouseMotionEvent *motion)
 Overridable Eventhandler for a SDL_MouseMotionEvent message.

bool eventMouseButtonDown (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.

bool handleButtonClick (PG_Button *button)
bool eventMouseButtonUp (const SDL_MouseButtonEvent *button)
 Overridable Eventhandler for a SDL_MouseButtonEvent message.

virtual void RecalcPositions ()

Protected Attributes

int scroll_min
int scroll_max
int scroll_current
int my_linesize
int my_pagesize
PG_Buttonscrollbutton [2]
ScrollButton * dragbutton
PG_Rect position [4]
ScrollDirection sb_direction

Friends

class ScrollButton


Member Enumeration Documentation

anonymous enum
 

Widget ID's.

Enumeration values:
IDSCROLLBAR_UP  ID Scrollbar Button "up".
IDSCROLLBAR_DOWN  ID Scrollbar Button "down".
IDSCROLLBAR_LEFT  ID Scrollbar Button "left".
IDSCROLLBAR_RIGHT  ID Scrollbar Button "right".
IDSCROLLBAR_DRAG  ID Scrollbar Button "drag".

enum PG_ScrollBar::ScrollDirection
 

ScrollbarType.

Enumeration values:
VERTICAL  vertical scrollbar
HORIZONTAL  horizontal scrollbar


Constructor & Destructor Documentation

PG_ScrollBar::PG_ScrollBar PG_Widget parent,
const PG_Rect r = PG_Rect::null,
ScrollDirection  direction = VERTICAL,
int  id = -1,
const char *  style = "Scrollbar"
 

virtual PG_ScrollBar::~PG_ScrollBar  )  [virtual]
 


Member Function Documentation

bool PG_ScrollBar::eventMouseButtonDown const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is pressed. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

bool PG_ScrollBar::eventMouseButtonUp const SDL_MouseButtonEvent *  button  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseButtonEvent message.

This handler is called when a mouse button is released. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
button SDL_MouseButtonEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

Reimplemented in PG_Slider.

bool PG_ScrollBar::eventMouseMotion const SDL_MouseMotionEvent *  motion  )  [protected, virtual]
 

Overridable Eventhandler for a SDL_MouseMotionEvent message.

This handler is called when mouse movement is detected. The default implementation returns 'false' which indicates that this message is not processed by this object.

Parameters:
motion SDL_MouseMotionEvent message
Returns:
Notifies the message pump if this message is processed by this object or it should be routed to the next message receiver.

Reimplemented from PG_MessageObject.

void PG_ScrollBar::eventSizeWidget Uint16  w,
Uint16  h
[protected, virtual]
 

Callback for the SizeWidget event.

Parameters:
w new width
h new height This virtual function can be used to implement custom behavior for SizeWidget events.

Reimplemented from PG_ThemeWidget.

int PG_ScrollBar::GetMaxRange  ) 
 

int PG_ScrollBar::GetMinRange  ) 
 

int PG_ScrollBar::GetPosition  ) 
 

bool PG_ScrollBar::handleButtonClick PG_Button button  )  [protected]
 

void PG_ScrollBar::LoadThemeStyle const char *  widgettype  ) 
 

Load a specific themestyle.

Parameters:
widgettype name of widget type to load

Reimplemented from PG_ThemeWidget.

Reimplemented in PG_Slider.

virtual void PG_ScrollBar::RecalcPositions  )  [protected, virtual]
 

Reimplemented in PG_Slider.

void PG_ScrollBar::SetLineSize int  ls  ) 
 

void PG_ScrollBar::SetPageSize int  ps  ) 
 

void PG_ScrollBar::SetPosition int  pos  ) 
 

Examples:
paratest.cpp.

void PG_ScrollBar::SetRange Uint32  min,
Uint32  max
 

Examples:
paratest.cpp.


Friends And Related Function Documentation

friend class ScrollButton [friend]
 


Member Data Documentation

ScrollButton* PG_ScrollBar::dragbutton [protected]
 

int PG_ScrollBar::my_linesize [protected]
 

int PG_ScrollBar::my_pagesize [protected]
 

PG_Rect PG_ScrollBar::position[4] [protected]
 

ScrollDirection PG_ScrollBar::sb_direction [protected]
 

int PG_ScrollBar::scroll_current [protected]
 

int PG_ScrollBar::scroll_max [protected]
 

int PG_ScrollBar::scroll_min [protected]
 

PG_Button* PG_ScrollBar::scrollbutton[2] [protected]
 

SignalScrollPos<long> PG_ScrollBar::sigScrollPos
 

Examples:
paratest.cpp.

SignalScrollTrack<long> PG_ScrollBar::sigScrollTrack
 

Examples:
paratest.cpp.


The ParaGUI Project - Alexander Pipelka