#include <Slider.h>
Signal Types | |
typedef boost::signal< void(int, int, int)> | SlidSignalType |
typedef boost::signal< void(int, int, int)> | SlidAndStoppedSignalType |
Accessors | |
SlidSignalType | SlidSignal |
SlidAndStoppedSignalType | SlidAndStoppedSignal |
virtual Pt | MinUsableSize () const |
int | Posn () const |
std::pair< int, int > | SliderRange () const |
unsigned int | PageSize () const |
Orientation | GetOrientation () const |
unsigned int | TabWidth () const |
unsigned int | LineWidth () const |
SliderLineStyle | LineStyle () const |
Structors | |
Slider (X x, Y y, X w, Y h, int min, int max, Orientation orientation, SliderLineStyle style, Clr color, unsigned int tab_width, unsigned int line_width=5, Flags< WndFlag > flags=INTERACTIVE) | |
Mutators | |
virtual void | Render () |
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 (unsigned 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 void | LClick (const Pt &pt, Flags< ModKey > mod_keys) |
virtual void | KeyPress (Key key, boost::uint32_t key_code_point, Flags< ModKey > mod_keys) |
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 51 of file Slider.h.
typedef boost::signal<void (int, int, int)> GG::Slider::SlidSignalType |
typedef boost::signal<void (int, int, int)> GG::Slider::SlidAndStoppedSignalType |
GG::Slider::Slider | ( | X | x, | |
Y | y, | |||
X | w, | |||
Y | h, | |||
int | min, | |||
int | max, | |||
Orientation | orientation, | |||
SliderLineStyle | style, | |||
Clr | color, | |||
unsigned int | tab_width, | |||
unsigned int | line_width = 5 , |
|||
Flags< WndFlag > | flags = INTERACTIVE | |||
) |
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 MinUsableSize() 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
unsigned 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)
unsigned int GG::Slider::TabWidth | ( | ) | const |
returns the width of the slider's tab, in pixels
unsigned 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.
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 | ( | unsigned 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
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.
virtual void GG::Slider::KeyPress | ( | Key | key, | |
boost::uint32_t | key_code_point, | |||
Flags< ModKey > | mod_keys | |||
) | [protected, virtual] |
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.
key_code_point will be zero if Unicode support is unavailable.
Reimplemented from GG::Control.
void GG::Slider::MoveTabToPosn | ( | ) | [protected] |
moves the tab to the current logical position
SlidSignalType GG::Slider::SlidSignal [mutable] |