#include <Slider.h>
Inheritance diagram for GG::Slider:
Signal Types | |
typedef boost::signal< void(int, int, int)> | SlidSignalType |
typedef boost::signal< void(int, int, int)> | SlidAndStoppedSignalType |
Slot Types | |
typedef SlidSignalType::slot_type | SlidSlotType |
typedef SlidSignalType::slot_type | SlidAndStoppedSlotType |
Accessors | |
SlidSignalType | SlidSignal |
SlidAndStoppedSignalType | SlidAndStoppedSignal |
virtual Pt | MinUsableSize () const |
int | Posn () const |
std::pair< int, int > | SliderRange () const |
int | PageSize () const |
Orientation | GetOrientation () const |
int | TabWidth () const |
int | LineWidth () const |
SliderLineStyle | LineStyle () const |
Structors | |
Slider (int x, int y, int w, int h, int min, int max, Orientation orientation, SliderLineStyle style, Clr color, int tab_width, int line_width=5, Flags< WndFlag > flags=CLICKABLE) | |
Mutators | |
virtual void | Render () |
virtual void | LClick (const Pt &pt, Flags< ModKey > mod_keys) |
virtual void | KeyPress (Key key, Flags< ModKey > mod_keys) |
virtual void | SizeMove (const Pt &ul, const Pt &lr) |
virtual void | Disable (bool b=true) |
virtual void | SetColor (Clr c) |
void | SizeSlider (int min, int max) |
void | SetMax (int max) |
void | SetMin (int min) |
void | SlideTo (int p) |
void | SetPageSize (int size) |
void | SetLineStyle (SliderLineStyle style) |
virtual void | DefineAttributes (WndEditor *editor) |
Structors | |
Slider () | |
Accessors | |
Button * | Tab () const |
int | PtToPosn (const Pt &pt) const |
Mutators | |
virtual bool | EventFilter (Wnd *w, const WndEvent &event) |
void | MoveTabToPosn () |
This control allows the user to drag a tab to a desired setting; it is somewhat like a Scroll. Sliders can be either vertical or horizontal, but cannot switch between the two. Unlike vertical Scrolls, whose values increase downward, vertical Sliders increase upward by default. Note that it is acceptible to define a range that increases from min to max, or one that decreases from min to max; both are legal.
Definition at line 47 of file Slider.h.
typedef boost::signal<void (int, int, int)> GG::Slider::SlidSignalType |
typedef boost::signal<void (int, int, int)> GG::Slider::SlidAndStoppedSignalType |
typedef SlidSignalType::slot_type GG::Slider::SlidSlotType |
typedef SlidSignalType::slot_type GG::Slider::SlidAndStoppedSlotType |
GG::Slider::Slider | ( | int | x, | |
int | y, | |||
int | w, | |||
int | h, | |||
int | min, | |||
int | max, | |||
Orientation | orientation, | |||
SliderLineStyle | style, | |||
Clr | color, | |||
int | tab_width, | |||
int | line_width = 5 , |
|||
Flags< WndFlag > | flags = CLICKABLE | |||
) |
ctor
GG::Slider::Slider | ( | ) | [protected] |
default ctor
virtual Pt GG::Slider::MinUsableSize | ( | ) | const [virtual] |
returns the size of the minimum bounding box that can enclose the Wnd and still show all of its elements, plus enough room for interaction with those elements (if applicable).
For example, a TextControl's MinUsableSize() is just the area of its text, and a Scroll's RenderableMinSize() is the combined sizes of its up-button, down-button, and tab (plus a bit of room in which to drag the tab).
Reimplemented from GG::Wnd.
int GG::Slider::Posn | ( | ) | const |
returns the current tab position
std::pair<int, int> GG::Slider::SliderRange | ( | ) | const |
returns the defined possible range of control
int GG::Slider::PageSize | ( | ) | const |
returns the current page size, or the amount that the slider increments/decrements when a click occurs off of the tab.
If not set, this defaults to 10% of the slider's range.
Orientation GG::Slider::GetOrientation | ( | ) | const |
returns the orientation of the slider (VERTICAL or HORIZONTAL)
int GG::Slider::TabWidth | ( | ) | const |
returns the width of the slider's tab, in pixels
int GG::Slider::LineWidth | ( | ) | const |
returns the width of the line along which the tab slides, in pixels
SliderLineStyle GG::Slider::LineStyle | ( | ) | const |
returns the style of line used to render the control
virtual void GG::Slider::Render | ( | ) | [virtual] |
draws this Wnd.
Note that Wnds being dragged for a drag-and-drop operation are rendered twice -- once in-place as normal, once in the location of the drag operation, attached to the cursor. Such Wnds may wish to render themselves differently in those two cases. To determine which render is being performed, they can call GUI::GetGUI()->RenderingDragDropWnds().
Implements GG::Control.
respond to release of left mouse button over this Wnd, if it was also originally depressed over this Wnd.
A Wnd will receive an LButtonUp() message whenever a drag that started over its area ends over its area as well.
Reimplemented from GG::Wnd.
respond to down-keystrokes (focus window only).
A window may receive KeyPress() messages passed up to it from its children. For instance, Control-derived classes pass KeyPress() messages to their Parent() windows by default.
Reimplemented from GG::Control.
resizes and/or moves window to new upper-left and lower right boundaries
Reimplemented from GG::Wnd.
virtual void GG::Slider::Disable | ( | bool | b = true |
) | [virtual] |
virtual void GG::Slider::SetColor | ( | Clr | c | ) | [virtual] |
void GG::Slider::SizeSlider | ( | int | min, | |
int | max | |||
) |
sets the logical range of the control; min must not equal max
void GG::Slider::SetMax | ( | int | max | ) |
sets the maximum value of the control
void GG::Slider::SetMin | ( | int | min | ) |
sets the minimum value of the control
void GG::Slider::SlideTo | ( | int | p | ) |
slides the control to a certain spot
void GG::Slider::SetPageSize | ( | int | size | ) |
sets the size of a "page", or the amount that the slider increments/decrements when a click occurs off of the tab.
If not set, this defaults to 10% of the slider's range. To disable clicks off the tab, set the page size to 0.
void GG::Slider::SetLineStyle | ( | SliderLineStyle | style | ) |
returns the style of line used to render the control
virtual void GG::Slider::DefineAttributes | ( | WndEditor * | editor | ) | [virtual] |
provides the attributes of this object that are appropriate for a user to edit in a WndEditor; see WndEditor for details.
Reimplemented from GG::Control.
Button* GG::Slider::Tab | ( | ) | const [protected] |
returns a pointer to the Button used as this control's sliding tab
int GG::Slider::PtToPosn | ( | const Pt & | pt | ) | const [protected] |
maps an arbitrary screen point to its nearest logical slider position
void GG::Slider::MoveTabToPosn | ( | ) | [protected] |
moves the tab to the current logical position
SlidSignalType GG::Slider::SlidSignal [mutable] |