PGButton¶
-
class PGButton¶
Bases:
PGItemThis is a particular kind of
PGItemthat is specialized to behave like a normal button object. It keeps track of its own state, and handles mouse events sensibly.Inheritance diagram
digraph inheritance7db147b0e9 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "AcronNode" [URL="acron.core.AcronNode.html#acron.core.AcronNode",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedWritableReferenceCount" -> "AcronNode" [arrowsize=0.75,style=""]; "Namable" -> "AcronNode" [arrowsize=0.75,style=""]; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "Namable" [URL="acron.core.Namable.html#acron.core.Namable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "Namable" [arrowsize=0.75,style=""]; "PGButton" [URL="acron.core.PGButton.html#acron.core.PGButton",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "PGItem" -> "PGButton" [arrowsize=0.75,style=""]; "PGItem" [URL="acron.core.PGItem.html#acron.core.PGItem",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "AcronNode" -> "PGItem" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedWritable" [URL="acron.core.TypedWritable.html#acron.core.TypedWritable",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedWritable" [arrowsize=0.75,style=""]; "TypedWritableReferenceCount" [URL="acron.core.TypedWritableReferenceCount.html#acron.core.TypedWritableReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedWritable" -> "TypedWritableReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedWritableReferenceCount" [arrowsize=0.75,style=""]; }-
enum State¶
-
enumerator S_ready = 0¶
-
enumerator S_depressed = 1¶
-
enumerator S_rollover = 2¶
-
enumerator S_inactive = 3¶
-
enumerator S_ready = 0¶
- PGButton.__init__()¶
- PGButton.add_click_button()¶
Adds the indicated button to the set of buttons that can effectively “click” the
PGButton. Normally, this is justMouseButton::one(). Returns true if the button was added, or false if it was already there.
- static PGButton.get_class_type()¶
- PGButton.get_click_event()¶
Returns the event name that will be thrown when the button is clicked normally.
- static PGButton.get_click_prefix()¶
Returns the prefix that is used to define the click event for all
PGButtons. The click event is the concatenation of this string followed byget_id().
- PGButton.has_click_button()¶
Returns true if the indicated button is on the set of buttons that can effectively “click” the
PGButton. Normally, this is justMouseButton::one().
- PGButton.is_button_down()¶
Returns true if the user is currently holding the mouse button down on the button, false otherwise.
- PGButton.remove_click_button()¶
Removes the indicated button from the set of buttons that can effectively “click” the
PGButton. Normally, this is justMouseButton::one(). Returns true if the button was removed, or false if it was not in the set.
- PGButton.setup()¶
Sets up the button using the indicated
NodePathas arbitrary geometry.Sets up the button using the indicated
NodePathas arbitrary geometry.Sets up the button using the indicated
NodePathas arbitrary geometry.Sets up the button as a default text button using the indicated label string. The
TextNodedefined byPGItem::get_text_node()will be used to create the label geometry. This automatically sets up the frame according to the size of the text.Sets up the button using the indicated
NodePathas arbitrary geometry.
-
enum State¶