|
|
|
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...
#include "pgSliderBar.h"
List of all members.
Public Member Functions |
|
| PGSliderBar (const string &name="") |
| virtual void | adjust () |
| | This is a callback hook function, called whenever the slider value is adjusted by the user or programmatically.
|
| void | clear_left_button () |
| | Removes the left button object from control of the frame.
|
| void | clear_right_button () |
| | Removes the right button object from control of the frame.
|
| void | clear_thumb_button () |
| | Removes the thumb button object from control of the frame.
|
| virtual bool | cull_callback (CullTraverser *trav, CullTraverserData &data) |
| | This function will be called during the cull traversal to perform any additional operations that should be performed at cull time.
|
|
virtual TypeHandle | force_init_type () |
| string | get_adjust_event () const |
| | Returns the event name that will be thrown when the slider bar value is adjusted by the user or programmatically.
|
| const LVector3 & | get_axis () const |
| | Returns the axis of the slider bar's motion.
|
| PGButton * | get_left_button () const |
| | Returns the PGButton that serves as the left scroll button for this slider, if any, or NULL if it is not set.
|
| bool | get_manage_pieces () const |
| | Returns the manage_pieces flag.
|
| PN_stdfloat | get_max_value () const |
| | Returns the value when the slider is all the way to the right.
|
| PN_stdfloat | get_min_value () const |
| | Returns the value when the slider is all the way to the left.
|
| PGSliderBarNotify * | get_notify () const |
| | Returns the object which will be notified when the PGSliderBar changes, if any.
|
| PN_stdfloat | get_page_size () const |
| | Returns the value last set by set_page_size().
|
| PN_stdfloat | get_ratio () const |
| | Returns the current value of the slider, expressed in the range 0 .
|
| bool | get_resize_thumb () const |
| | Returns the resize_thumb flag.
|
| PGButton * | get_right_button () const |
| | Returns the PGButton that serves as the right scroll button for this slider, if any, or NULL if it is not set.
|
| PN_stdfloat | get_scroll_size () const |
| | Returns the value last set by set_scroll_size().
|
| PGButton * | get_thumb_button () const |
| | Returns the PGButton that serves as the thumb for this slider, or NULL if it is not set.
|
|
virtual TypeHandle | get_type () const |
| PN_stdfloat | get_value () const |
| | Returns the current value of the slider.
|
| bool | is_button_down () const |
| | Returns true if the user is currently holding down the mouse button to manipulate the slider.
|
| virtual PandaNode * | make_copy () const |
| | Returns a newly-allocated Node that is a shallow copy of this one.
|
| virtual void | move (const MouseWatcherParameter ¶m) |
| | This is a callback hook function, called whenever a mouse is moved while within the region.
|
| virtual void | press (const MouseWatcherParameter ¶m, bool background) |
| | This is a callback hook function, called whenever a mouse or keyboard button is depressed while the mouse is within the region.
|
| void | recompute () |
| | Recomputes the position and size of the thumb.
|
| virtual void | release (const MouseWatcherParameter ¶m, bool background) |
| | This is a callback hook function, called whenever a mouse or keyboard button previously depressed with press() is released.
|
| void | remanage () |
| | Manages the position and size of the scroll bars and the thumb.
|
| virtual void | set_active (bool active) |
| | Sets whether the PGItem is active for mouse watching.
|
| void | set_axis (const LVector3 &axis) |
| | Specifies the axis of the slider bar's motion.
|
| void | set_left_button (PGButton *left_button) |
| | Sets the PGButton object that will serve as the left scroll button for this slider.
|
| void | set_manage_pieces (bool manage_pieces) |
| | Sets the manage_pieces flag.
|
| void | set_notify (PGSliderBarNotify *notify) |
| | Sets the object which will be notified when the PGSliderBar changes.
|
| void | set_page_size (PN_stdfloat page_size) |
| | Specifies the amount of data contained in a single page.
|
| void | set_range (PN_stdfloat min_value, PN_stdfloat max_value) |
| | Sets the minimum and maxmimum value for the slider.
|
| void | set_ratio (PN_stdfloat ratio) |
| | Sets the current value of the slider, expressed in the range 0 .
|
| void | set_resize_thumb (bool resize_thumb) |
| | Sets the resize_thumb flag.
|
| void | set_right_button (PGButton *right_button) |
| | Sets the PGButton object that will serve as the right scroll button for this slider.
|
| void | set_scroll_size (PN_stdfloat scroll_size) |
| | Specifies the amount the slider will move when the user clicks on the left or right buttons.
|
| void | set_thumb_button (PGButton *thumb_button) |
| | Sets the PGButton object that will serve as the thumb for this slider.
|
| void | set_value (PN_stdfloat value) |
| | Sets the current value of the slider programmatically.
|
| void | setup_scroll_bar (bool vertical, PN_stdfloat length, PN_stdfloat width, PN_stdfloat 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 .
|
| void | setup_slider (bool vertical, PN_stdfloat length, PN_stdfloat width, PN_stdfloat bevel) |
| | Creates PGSliderBar that represents a slider that the user can use to control an analog quantity.
|
| virtual void | xform (const LMatrix4 &mat) |
| | Transforms the contents of this node by the indicated matrix, if it means anything to do so.
|
Static Public Member Functions |
| static string | get_adjust_prefix () |
| | Returns the prefix that is used to define the adjust event for all PGSliderBars.
|
|
static TypeHandle | get_class_type () |
|
static void | init_type () |
Protected Member Functions |
|
| PGSliderBar (const PGSliderBar ©) |
| virtual void | frame_changed () |
| | Called when the user changes the frame size.
|
| virtual void | item_draw_mask_changed (PGItem *item) |
| | Called whenever a watched PGItem's draw_mask has been changed.
|
| virtual void | item_frame_changed (PGItem *item) |
| | Called whenever a watched PGItem's frame has been changed.
|
| virtual void | item_move (PGItem *item, const MouseWatcherParameter ¶m) |
| | Called whenever the "move" event is triggered on a watched PGItem.
|
| virtual void | item_press (PGItem *item, const MouseWatcherParameter ¶m) |
| | Called whenever the "press" event is triggered on a watched PGItem.
|
| virtual void | item_release (PGItem *item, const MouseWatcherParameter ¶m) |
| | Called whenever the "release" event is triggered on a watched PGItem.
|
| virtual void | item_transform_changed (PGItem *item) |
| | Called whenever a watched PGItem's local transform has been changed.
|
Friends |
|
class | PGButton |
Detailed Description
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.
Definition at line 34 of file pgSliderBar.h.
Member Function Documentation
Removes the left button object from control of the frame.
It is your responsibility to actually remove or hide the button itself.
Definition at line 379 of file pgSliderBar.I.
References set_left_button().
Removes the right button object from control of the frame.
It is your responsibility to actually remove or hide the button itself.
Definition at line 430 of file pgSliderBar.I.
References set_right_button().
Removes the thumb button object from control of the frame.
It is your responsibility to actually remove or hide the button itself.
Definition at line 329 of file pgSliderBar.I.
References set_thumb_button().
This function will be called during the cull traversal to perform any additional operations that should be performed at cull time.
This may include additional manipulation of render state or additional visible/invisible decisions, or any other arbitrary operation.
Note that this function will *not* be called unless set_cull_callback() is called in the constructor of the derived class. It is necessary to call set_cull_callback() to indicated that we require cull_callback() to be called.
By the time this function is called, the node has already passed the bounding-volume test for the viewing frustum, and the node's transform and state have already been applied to the indicated CullTraverserData object.
The return value is true if this node should be visible, or false if it should be culled.
Reimplemented from PGItem.
Definition at line 199 of file pgSliderBar.cxx.
References ClockObject::get_global_clock(), recompute(), and remanage().
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().
Definition at line 455 of file pgSliderBar.I.
Referenced by get_adjust_event().
Returns the PGButton that serves as the left scroll button for this slider, if any, or NULL if it is not set.
Definition at line 391 of file pgSliderBar.I.
Returns the value when the slider is all the way to the right.
Definition at line 118 of file pgSliderBar.I.
Returns the value when the slider is all the way to the left.
Definition at line 106 of file pgSliderBar.I.
Returns the current value of the slider, expressed in the range 0 .
. 1.
Definition at line 219 of file pgSliderBar.I.
Referenced by get_value().
Returns the PGButton that serves as the right scroll button for this slider, if any, or NULL if it is not set.
Definition at line 442 of file pgSliderBar.I.
Returns the PGButton that serves as the thumb for this slider, or NULL if it is not set.
Definition at line 340 of file pgSliderBar.I.
Returns a newly-allocated Node that is a shallow copy of this one.
It will be a different Node pointer, but its internal data may or may not be shared with that of the original Node.
Reimplemented from PGItem.
Definition at line 100 of file pgSliderBar.cxx.
Sets whether the PGItem is active for mouse watching.
This is not necessarily related to the active/inactive appearance of the item, which is controlled by set_state(), but it does affect whether it responds to mouse events.
Reimplemented from PGItem.
Definition at line 412 of file pgSliderBar.cxx.
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.
Definition at line 62 of file pgSliderBar.I.
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.
Definition at line 276 of file pgSliderBar.I.
Referenced by setup_scroll_bar(), and setup_slider().
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.
Definition at line 157 of file pgSliderBar.I.
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.
Definition at line 248 of file pgSliderBar.I.
Referenced by setup_scroll_bar(), and setup_slider().
Specifies the amount the slider will move when the user clicks on the left or right buttons.
Definition at line 130 of file pgSliderBar.I.
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).
Definition at line 282 of file pgSliderBar.cxx.
References PandaNode::add_child(), PGItem::clear_state_def(), PandaNode::remove_child(), LVector3f::rfu(), PGFrameStyle::set_color(), PGItem::set_frame(), PGItem::set_frame_style(), set_left_button(), set_manage_pieces(), set_resize_thumb(), set_right_button(), PGItem::set_state(), set_thumb_button(), PGFrameStyle::set_type(), and PGFrameStyle::set_width().
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.
Definition at line 356 of file pgSliderBar.cxx.
References PandaNode::add_child(), PGItem::clear_state_def(), PandaNode::remove_child(), LVector3f::rfu(), PGFrameStyle::set_color(), PGItem::set_frame(), PGItem::set_frame_style(), set_left_button(), set_manage_pieces(), set_resize_thumb(), set_right_button(), PGItem::set_state(), set_thumb_button(), PGFrameStyle::set_type(), PGFrameStyle::set_visible_scale(), and PGFrameStyle::set_width().
Transforms the contents of this node by the indicated matrix, if it means anything to do so.
For most kinds of nodes, this does nothing.
Reimplemented from PGItem.
Definition at line 233 of file pgSliderBar.cxx.
The documentation for this class was generated from the following files:
| | |