This is a particular kind of PGItem that draws a little bar with a slider that moves from left to right indicating a value between the ranges. More...
Public Member Functions | |
PGSliderBar (string name) | |
PGSliderBar () | |
clearLeftButton () | |
Removes the left button object from control of the frame. | |
clearRightButton () | |
Removes the right button object from control of the frame. | |
clearThumbButton () | |
Removes the thumb button object from control of the frame. | |
string | getAdjustEvent () |
Returns the event name that will be thrown when the slider bar value is adjusted by the user or programmatically. | |
Vec3 const | getAxis () |
Returns the axis of the slider bar's motion. | |
PGButton | getLeftButton () |
Returns the PGButton that serves as the left scroll button for this slider, if any, or NULL if it is not set. | |
bool | getManagePieces () |
Returns the manage_pieces flag. | |
float | getMaxValue () |
Returns the value when the slider is all the way to the right. | |
float | getMinValue () |
Returns the value when the slider is all the way to the left. | |
float | getPageSize () |
Returns the value last set by set_page_size(). | |
float | getRatio () |
Returns the current value of the slider, expressed in the range 0 . | |
bool | getResizeThumb () |
Returns the resize_thumb flag. | |
PGButton | getRightButton () |
Returns the PGButton that serves as the right scroll button for this slider, if any, or NULL if it is not set. | |
float | getScrollSize () |
Returns the value last set by set_scroll_size(). | |
PGButton | getThumbButton () |
Returns the PGButton that serves as the thumb for this slider, or NULL if it is not set. | |
float | getValue () |
Returns the current value of the slider. | |
bool | isButtonDown () |
Returns true if the user is currently holding down the mouse button to manipulate the slider. | |
recompute () | |
Recomputes the position and size of the thumb. | |
remanage () | |
Manages the position and size of the scroll bars and the thumb. | |
setActive (bool active) | |
Sets whether the PGItem is active for mouse watching. | |
setAxis (Vec3 const axis) | |
Specifies the axis of the slider bar's motion. | |
setLeftButton (PGButton left_button) | |
Sets the PGButton object that will serve as the left scroll button for this slider. | |
setManagePieces (bool manage_pieces) | |
Sets the manage_pieces flag. | |
setPageSize (float page_size) | |
Specifies the amount of data contained in a single page. | |
setRange (float min_value, float max_value) | |
Sets the minimum and maxmimum value for the slider. | |
setRatio (float ratio) | |
Sets the current value of the slider, expressed in the range 0 . | |
setResizeThumb (bool resize_thumb) | |
Sets the resize_thumb flag. | |
setRightButton (PGButton right_button) | |
Sets the PGButton object that will serve as the right scroll button for this slider. | |
setScrollSize (float scroll_size) | |
Specifies the amount the slider will move when the user clicks on the left or right buttons. | |
setThumbButton (PGButton thumb_button) | |
Sets the PGButton object that will serve as the thumb for this slider. | |
setupScrollBar (bool vertical, float length, float width, float bevel) | |
Creates PGSliderBar that represents a vertical or horizontal scroll bar (if vertical is true or false, respectively), with additional buttons for scrolling, and a range of 0 . | |
setupSlider (bool vertical, float length, float width, float bevel) | |
Creates PGSliderBar that represents a slider that the user can use to control an analog quantity. | |
setValue (float value) | |
Sets the current value of the slider programmatically. | |
Static Public Member Functions | |
static string | getAdjustPrefix () |
Returns the prefix that is used to define the adjust event for all PGSliderBars. | |
static TypeHandle | getClassType () |
This is a particular kind of PGItem that draws a little bar with a slider that moves from left to right indicating a value between the ranges.
This is used as an implementation for both DirectSlider and for DirectScrollBar.
PGSliderBar | ( | string | name | ) |
PGSliderBar | ( | ) |
clearLeftButton | ( | ) |
Removes the left button object from control of the frame.
It is your responsibility to actually remove or hide the button itself.
clearRightButton | ( | ) |
Removes the right button object from control of the frame.
It is your responsibility to actually remove or hide the button itself.
clearThumbButton | ( | ) |
Removes the thumb button object from control of the frame.
It is your responsibility to actually remove or hide the button itself.
string getAdjustEvent | ( | ) |
Returns the event name that will be thrown when the slider bar value is adjusted by the user or programmatically.
static string getAdjustPrefix | ( | ) | [static] |
Returns the prefix that is used to define the adjust event for all PGSliderBars.
The adjust event is the concatenation of this string followed by get_id().
static TypeHandle getClassType | ( | ) | [static] |
Reimplemented from PGItem.
Returns the PGButton that serves as the left scroll button for this slider, if any, or NULL if it is not set.
bool getManagePieces | ( | ) |
Returns the manage_pieces flag.
See set_manage_pieces().
float getMaxValue | ( | ) |
Returns the value when the slider is all the way to the right.
float getMinValue | ( | ) |
Returns the value when the slider is all the way to the left.
float getPageSize | ( | ) |
Returns the value last set by set_page_size().
float getRatio | ( | ) |
Returns the current value of the slider, expressed in the range 0 .
. 1.
bool getResizeThumb | ( | ) |
Returns the resize_thumb flag.
See set_resize_thumb().
Returns the PGButton that serves as the right scroll button for this slider, if any, or NULL if it is not set.
float getScrollSize | ( | ) |
Returns the value last set by set_scroll_size().
Returns the PGButton that serves as the thumb for this slider, or NULL if it is not set.
float getValue | ( | ) |
Returns the current value of the slider.
bool isButtonDown | ( | ) |
Returns true if the user is currently holding down the mouse button to manipulate the slider.
When true, calls to set_ratio() or set_value() will have no effect.
recompute | ( | ) |
Recomputes the position and size of the thumb.
Normally this should not need to be called directly.
remanage | ( | ) |
Manages the position and size of the scroll bars and the thumb.
Normally this should not need to be called directly.
setActive | ( | bool | active | ) |
Specifies the axis of the slider bar's motion.
This should be only one of four vectors: (1, 0, 0), (0, 0, 1), (-1, 0, 0), or (0, 0, -1).
This specifies the vector in which the thumb moves when it is moving from the minimum to the maximum value.
The axis must be parallel to one of the screen axes, and it must be normalized. Hence, it may only be one of the above four possibilities; anything else is an error and will result in indeterminate behavior.
Normally, you should not try to set the axis directly.
setLeftButton | ( | PGButton | left_button | ) |
Sets the PGButton object that will serve as the left scroll button for this slider.
This button is optional; if present, the user can click on it to move scroll_size units at a time to the left.
It is the responsibility of the caller to ensure that the button object is parented to the PGSliderBar node.
setManagePieces | ( | bool | manage_pieces | ) |
Sets the manage_pieces flag.
When this is true, the sub-pieces of the slider bar--that is, the thumb, and the left and right scroll buttons--are automatically positioned and/or resized when the slider bar's overall frame is changed.
setPageSize | ( | float | page_size | ) |
Specifies the amount of data contained in a single page.
This indicates how much the thumb will jump when the trough is directly clicked; and if resize_thumb is true, it also controls the visible size of the thumb button.
setRange | ( | float | min_value, |
float | max_value | ||
) |
Sets the minimum and maxmimum value for the slider.
setRatio | ( | float | ratio | ) |
Sets the current value of the slider, expressed in the range 0 .
. 1.
setResizeThumb | ( | bool | resize_thumb | ) |
Sets the resize_thumb flag.
When this is true, the thumb button's frame will be adjusted so that its width visually represents the page size. When this is false, the thumb button will be left alone.
setRightButton | ( | PGButton | right_button | ) |
Sets the PGButton object that will serve as the right scroll button for this slider.
This button is optional; if present, the user can click on it to move scroll_size units at a time to the right.
It is the responsibility of the caller to ensure that the button object is parented to the PGSliderBar node.
setScrollSize | ( | float | scroll_size | ) |
Specifies the amount the slider will move when the user clicks on the left or right buttons.
setThumbButton | ( | PGButton | thumb_button | ) |
Sets the PGButton object that will serve as the thumb for this slider.
This button visually represents the position of the slider, and can be dragged left and right by the user.
It is the responsibility of the caller to ensure that the button object is parented to the PGSliderBar node.
setupScrollBar | ( | bool | vertical, |
float | length, | ||
float | width, | ||
float | bevel | ||
) |
Creates PGSliderBar that represents a vertical or horizontal scroll bar (if vertical is true or false, respectively), with additional buttons for scrolling, and a range of 0 .
. 1.
length here is the measurement along the scroll bar, and width is the measurement across the scroll bar, whether it is vertical or horizontal (so for a horizontal scroll bar, the length is actually the x dimension, and the width is the y dimension).
setupSlider | ( | bool | vertical, |
float | length, | ||
float | width, | ||
float | bevel | ||
) |
Creates PGSliderBar that represents a slider that the user can use to control an analog quantity.
This is functionally the same as a scroll bar, but it has a distinctive look.
setValue | ( | float | value | ) |
Sets the current value of the slider programmatically.
This should range between get_min_value() and get_max_value().