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

PG_Slider Class Reference

Provides a slider. More...

#include <pgslider.h>

Inheritance diagram for PG_Slider:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PG_Slider (PG_Widget *parent, const PG_Rect &r=PG_Rect::null, ScrollDirection direction=VERTICAL, int id=-1, const std::string &style="Slider")
 Contructor of the PG_Slider class.
 ~PG_Slider ()
void LoadThemeStyle (const std::string &widgettype)
 Load a specific themestyle.
void RecalcPositions ()

Public Attributes

SignalSlide< long > sigSlide
SignalSlideEnd< long > sigSlideEnd

Protected Member Functions

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

Classes

class  SignalSlide
 Signal type declaration. More...
class  SignalSlideEnd

Detailed Description

Provides a slider.

Author:
Alexander Pipelka
pgslider_horz.png

horizontal slider screenshot

pgslider_vert.png

vertical slider screenshot

Usually used to get user input for a value where the range is known and fixed. The position of the slider is tied to an interger value which changes as the user moves the slider.

Definition at line 52 of file pgslider.h.


Constructor & Destructor Documentation

PG_Slider::PG_Slider PG_Widget parent,
const PG_Rect r = PG_Rect::null,
ScrollDirection  direction = VERTICAL,
int  id = -1,
const std::string &  style = "Slider"
 

Contructor of the PG_Slider class.

Parameters:
parent pointer to the parent widget or NULL
r position of the PG_Image widget
direction of the widget HORIZONTAL or VERTICAL
id identification number
style widgetstyle to use This constructor creates the slider widget.

Definition at line 33 of file pgslider.cpp.

References LoadThemeStyle(), PG_ScrollBar::scroll_min, PG_ScrollBar::scrollbutton, PG_ScrollBar::SetPosition(), PG_ScrollBar::sigScrollPos, PG_ScrollBar::sigScrollTrack, sigSlide, and sigSlideEnd.

PG_Slider::~PG_Slider  ) 
 

Definition at line 48 of file pgslider.cpp.


Member Function Documentation

bool PG_Slider::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_ScrollBar.

Definition at line 149 of file pgslider.cpp.

References PG_ScrollBar::my_linesize, PG_ScrollBar::scroll_current, PG_ScrollBar::scroll_min, PG_ScrollBar::SetPosition(), and sigSlideEnd.

void PG_Slider::LoadThemeStyle const std::string &  widgettype  ) 
 

Load a specific themestyle.

Parameters:
widgettype name of widget type to load

Reimplemented from PG_ScrollBar.

Definition at line 50 of file pgslider.cpp.

References PG_ScrollBar::dragbutton, PG_Theme::GetProperty(), PG_Application::GetTheme(), PG_ThemeWidget::LoadThemeStyle(), RecalcPositions(), PG_ScrollBar::sb_direction, and PG_ScrollBar::VERTICAL.

Referenced by PG_Slider().

void PG_Slider::RecalcPositions  )  [virtual]
 

Reimplemented from PG_ScrollBar.

Definition at line 72 of file pgslider.cpp.

References PG_ScrollBar::dragbutton, PG_Widget::MoveWidget(), PG_Widget::my_bordersize, PG_Rect::null, PG_ScrollBar::position, PG_ScrollBar::sb_direction, PG_ScrollBar::scroll_current, PG_ScrollBar::scroll_max, PG_ScrollBar::scroll_min, PG_ScrollBar::scrollbutton, and PG_ScrollBar::VERTICAL.

Referenced by LoadThemeStyle().


Member Data Documentation

SignalSlide<long> PG_Slider::sigSlide
 

Definition at line 84 of file pgslider.h.

Referenced by InternalAmmoTransferWidget::InternalAmmoTransferWidget(), MapInfoPanel::MapInfoPanel(), PG_ColorSelector::PG_ColorSelector(), PG_Slider(), ResourcePlacementDialog::ResourcePlacementDialog(), and TransferWidget::TransferWidget().

SignalSlideEnd<long> PG_Slider::sigSlideEnd
 

Definition at line 86 of file pgslider.h.

Referenced by eventMouseButtonUp(), InternalAmmoTransferWidget::InternalAmmoTransferWidget(), PG_Slider(), and TransferWidget::TransferWidget().


The documentation for this class was generated from the following files:
Generated on Tue Jun 24 02:19:33 2008 for Advanced Strategic Command by  doxygen 1.4.2