mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-18 12:43:44 -04:00
make label and frame unclickable by default
This commit is contained in:
parent
f63a1f74c2
commit
f4866cc88d
@ -27,6 +27,7 @@ class DirectButton(DirectFrame):
|
||||
# Define type of DirectGuiWidget
|
||||
('pgFunc', PGButton, None),
|
||||
('numStates', 4, None),
|
||||
('state', NORMAL, None),
|
||||
('invertedFrames', (1,), None),
|
||||
# Command to be called on button click
|
||||
('command', None, None),
|
||||
|
@ -25,6 +25,7 @@ class DirectEntry(DirectFrame):
|
||||
# Define type of DirectGuiWidget
|
||||
('pgFunc', PGEntry, None),
|
||||
('numStates', 3, None),
|
||||
('state', NORMAL, None),
|
||||
('width', 10, self.setup),
|
||||
('numLines', 5, self.setup),
|
||||
('focus', 0, self.setFocus),
|
||||
|
@ -15,6 +15,7 @@ class DirectFrame(DirectGuiWidget):
|
||||
# Define type of DirectGuiWidget
|
||||
('pgFunc', PGItem, None),
|
||||
('numStates', 1, None),
|
||||
('state', self.inactiveInitState, None),
|
||||
# Frame can have:
|
||||
# A background texture
|
||||
('image', None, self.setImage),
|
||||
|
@ -643,7 +643,17 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
|
||||
# Toggle if you wish widget's to snap to grid when draggin
|
||||
snapToGrid = 0
|
||||
gridSpacing = 0.05
|
||||
|
||||
|
||||
# Determine the default initial state for inactive (or
|
||||
# unclickable) components. If we are in edit mode, these are
|
||||
# actually clickable by default.
|
||||
guiEdit = base.config.GetBool('direct-gui-edit', 0)
|
||||
if guiEdit:
|
||||
inactiveInitState = NORMAL
|
||||
else:
|
||||
inactiveInitState = DISABLED
|
||||
|
||||
|
||||
def __init__(self, parent = guiTop, **kw):
|
||||
# Direct gui widgets are node paths
|
||||
# Direct gui widgets have:
|
||||
@ -730,7 +740,7 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
|
||||
self.ur = Point3(0)
|
||||
|
||||
# Is drag and drop enabled?
|
||||
if base.config.GetBool('direct-gui-edit', 0):
|
||||
if self.guiEdit:
|
||||
self.enableEdit()
|
||||
|
||||
# Bind destroy hook
|
||||
|
@ -16,10 +16,12 @@ class DirectLabel(DirectFrame):
|
||||
# The same image/geom/text can be used for all states or each
|
||||
# state can have a different text/geom/image
|
||||
# State transitions happen under user control
|
||||
|
||||
optiondefs = (
|
||||
# Define type of DirectGuiWidget
|
||||
('pgFunc', PGItem, None),
|
||||
('numStates', 1, None),
|
||||
('state', self.inactiveInitState, None),
|
||||
('activeState', 0, self.setActiveState),
|
||||
)
|
||||
# Merge keyword options with default options
|
||||
|
Loading…
x
Reference in New Issue
Block a user