PGSliderBar

from panda3d.core import PGSliderBar
class PGSliderBar

Bases: PGItem

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.

Inheritance diagram

Inheritance diagram of PGSliderBar

__init__(*args, **kwargs)
active

Returns whether the PGItem is currently active for mouse events. See set_active().

adjust_prefix = 'adjust-'
axis
button_down
clearLeftButton()

C++ Interface: clear_left_button(const PGSliderBar self)

/**
  • Removes the left button object from control of the frame. It is your

  • responsibility to actually remove or hide the button itself.

*/

clearRightButton()

C++ Interface: clear_right_button(const PGSliderBar self)

/**
  • Removes the right button object from control of the frame. It is your

  • responsibility to actually remove or hide the button itself.

*/

clearThumbButton()

C++ Interface: clear_thumb_button(const PGSliderBar self)

/**
  • Removes the thumb button object from control of the frame. It is your

  • responsibility to actually remove or hide the button itself.

*/

clear_left_button()

C++ Interface: clear_left_button(const PGSliderBar self)

/**
  • Removes the left button object from control of the frame. It is your

  • responsibility to actually remove or hide the button itself.

*/

clear_right_button()

C++ Interface: clear_right_button(const PGSliderBar self)

/**
  • Removes the right button object from control of the frame. It is your

  • responsibility to actually remove or hide the button itself.

*/

clear_thumb_button()

C++ Interface: clear_thumb_button(const PGSliderBar self)

/**
  • Removes the thumb button object from control of the frame. It is your

  • responsibility to actually remove or hide the button itself.

*/

getAdjustEvent()

C++ Interface: get_adjust_event(PGSliderBar self)

/**
  • Returns the event name that will be thrown when the slider bar value is

  • adjusted by the user or programmatically.

*/

getAdjustPrefix()

C++ Interface: get_adjust_prefix()

/**
  • 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().

*/

getAxis()

C++ Interface: get_axis(PGSliderBar self)

/**
  • Returns the axis of the slider bar’s motion. See set_axis().

*/

getClassType()

C++ Interface: get_class_type()

getLeftButton()

C++ Interface: get_left_button(PGSliderBar self)

/**
  • Returns the PGButton that serves as the left scroll button for this slider,

  • if any, or NULL if it is not set.

*/

getManagePieces()

C++ Interface: get_manage_pieces(PGSliderBar self)

/**
  • Returns the manage_pieces flag. See set_manage_pieces().

*/

getMaxValue()

C++ Interface: get_max_value(PGSliderBar self)

/**
  • Returns the value when the slider is all the way to the right.

*/

getMinValue()

C++ Interface: get_min_value(PGSliderBar self)

/**
  • Returns the value when the slider is all the way to the left.

*/

getPageSize()

C++ Interface: get_page_size(PGSliderBar self)

/**
  • Returns the value last set by set_page_size().

*/

getRatio()

C++ Interface: get_ratio(PGSliderBar self)

/**
  • Returns the current value of the slider, expressed in the range 0 .. 1.

*/

getResizeThumb()

C++ Interface: get_resize_thumb(PGSliderBar self)

/**
  • Returns the resize_thumb flag. See set_resize_thumb().

*/

getRightButton()

C++ Interface: get_right_button(PGSliderBar self)

/**
  • Returns the PGButton that serves as the right scroll button for this

  • slider, if any, or NULL if it is not set.

*/

getScrollSize()

C++ Interface: get_scroll_size(PGSliderBar self)

/**
  • Returns the value last set by set_scroll_size().

*/

getThumbButton()

C++ Interface: get_thumb_button(PGSliderBar self)

/**
  • Returns the PGButton that serves as the thumb for this slider, or NULL if

  • it is not set.

*/

getValue()

C++ Interface: get_value(PGSliderBar self)

/**
  • Returns the current value of the slider.

*/

get_adjust_event()

C++ Interface: get_adjust_event(PGSliderBar self)

/**
  • Returns the event name that will be thrown when the slider bar value is

  • adjusted by the user or programmatically.

*/

get_adjust_prefix()

C++ Interface: get_adjust_prefix()

/**
  • 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().

*/

get_axis()

C++ Interface: get_axis(PGSliderBar self)

/**
  • Returns the axis of the slider bar’s motion. See set_axis().

*/

get_class_type()

C++ Interface: get_class_type()

get_left_button()

C++ Interface: get_left_button(PGSliderBar self)

/**
  • Returns the PGButton that serves as the left scroll button for this slider,

  • if any, or NULL if it is not set.

*/

get_manage_pieces()

C++ Interface: get_manage_pieces(PGSliderBar self)

/**
  • Returns the manage_pieces flag. See set_manage_pieces().

*/

get_max_value()

C++ Interface: get_max_value(PGSliderBar self)

/**
  • Returns the value when the slider is all the way to the right.

*/

get_min_value()

C++ Interface: get_min_value(PGSliderBar self)

/**
  • Returns the value when the slider is all the way to the left.

*/

get_page_size()

C++ Interface: get_page_size(PGSliderBar self)

/**
  • Returns the value last set by set_page_size().

*/

get_ratio()

C++ Interface: get_ratio(PGSliderBar self)

/**
  • Returns the current value of the slider, expressed in the range 0 .. 1.

*/

get_resize_thumb()

C++ Interface: get_resize_thumb(PGSliderBar self)

/**
  • Returns the resize_thumb flag. See set_resize_thumb().

*/

get_right_button()

C++ Interface: get_right_button(PGSliderBar self)

/**
  • Returns the PGButton that serves as the right scroll button for this

  • slider, if any, or NULL if it is not set.

*/

get_scroll_size()

C++ Interface: get_scroll_size(PGSliderBar self)

/**
  • Returns the value last set by set_scroll_size().

*/

get_thumb_button()

C++ Interface: get_thumb_button(PGSliderBar self)

/**
  • Returns the PGButton that serves as the thumb for this slider, or NULL if

  • it is not set.

*/

get_value()

C++ Interface: get_value(PGSliderBar self)

/**
  • Returns the current value of the slider.

*/

isButtonDown()

C++ Interface: is_button_down(PGSliderBar self)

/**
  • 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.

*/

is_button_down()

C++ Interface: is_button_down(PGSliderBar self)

/**
  • 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.

*/

left_button
manage_pieces
page_size
ratio
recompute()

C++ Interface: recompute(const PGSliderBar self)

/**
  • Recomputes the position and size of the thumb. Normally this should not

  • need to be called directly.

*/

remanage()

C++ Interface: remanage(const PGSliderBar self)

/**
  • Manages the position and size of the scroll bars and the thumb. Normally

  • this should not need to be called directly.

*/

resize_thumb
right_button
scroll_size
setActive()

C++ Interface: set_active(const PGSliderBar self, bool active)

/**
  • 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.

*/

setAxis()

C++ Interface: set_axis(const PGSliderBar self, const LVector3f axis)

/**
  • 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()

C++ Interface: set_left_button(const PGSliderBar self, 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()

C++ Interface: set_manage_pieces(const PGSliderBar self, 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()

C++ Interface: set_page_size(const PGSliderBar self, 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()

C++ Interface: set_range(const PGSliderBar self, float min_value, float max_value)

/**
  • Sets the minimum and maxmimum value for the slider.

*/

setRatio()

C++ Interface: set_ratio(const PGSliderBar self, float ratio)

/**
  • Sets the current value of the slider, expressed in the range 0 .. 1.

*/

setResizeThumb()

C++ Interface: set_resize_thumb(const PGSliderBar self, 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()

C++ Interface: set_right_button(const PGSliderBar self, 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()

C++ Interface: set_scroll_size(const PGSliderBar self, float scroll_size)

/**
  • Specifies the amount the slider will move when the user clicks on the left

  • or right buttons.

*/

setThumbButton()

C++ Interface: set_thumb_button(const PGSliderBar self, 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.

*/

setValue()

C++ Interface: set_value(const PGSliderBar self, float value)

/**
  • Sets the current value of the slider programmatically. This should range

  • between get_min_value() and get_max_value().

*/

set_active()

C++ Interface: set_active(const PGSliderBar self, bool active)

/**
  • 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.

*/

set_axis()

C++ Interface: set_axis(const PGSliderBar self, const LVector3f axis)

/**
  • 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.

*/

set_left_button()

C++ Interface: set_left_button(const PGSliderBar self, 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.

*/

set_manage_pieces()

C++ Interface: set_manage_pieces(const PGSliderBar self, 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.

*/

set_page_size()

C++ Interface: set_page_size(const PGSliderBar self, 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.

*/

set_range()

C++ Interface: set_range(const PGSliderBar self, float min_value, float max_value)

/**
  • Sets the minimum and maxmimum value for the slider.

*/

set_ratio()

C++ Interface: set_ratio(const PGSliderBar self, float ratio)

/**
  • Sets the current value of the slider, expressed in the range 0 .. 1.

*/

set_resize_thumb()

C++ Interface: set_resize_thumb(const PGSliderBar self, 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.

*/

set_right_button()

C++ Interface: set_right_button(const PGSliderBar self, 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.

*/

set_scroll_size()

C++ Interface: set_scroll_size(const PGSliderBar self, float scroll_size)

/**
  • Specifies the amount the slider will move when the user clicks on the left

  • or right buttons.

*/

set_thumb_button()

C++ Interface: set_thumb_button(const PGSliderBar self, 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.

*/

set_value()

C++ Interface: set_value(const PGSliderBar self, float value)

/**
  • Sets the current value of the slider programmatically. This should range

  • between get_min_value() and get_max_value().

*/

setupScrollBar()

C++ Interface: setup_scroll_bar(const PGSliderBar self, 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()

C++ Interface: setup_slider(const PGSliderBar self, 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.

*/

setup_scroll_bar()

C++ Interface: setup_scroll_bar(const PGSliderBar self, 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).

*/

setup_slider()

C++ Interface: setup_slider(const PGSliderBar self, 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.

*/

thumb_button
upcastToPGItem()

C++ Interface: upcast_to_PGItem(const PGSliderBar self)

upcast from PGSliderBar to PGItem

upcast_to_PGItem()

C++ Interface: upcast_to_PGItem(const PGSliderBar self)

upcast from PGSliderBar to PGItem

value