*** empty log message ***

This commit is contained in:
gregw 2000-11-15 17:46:48 +00:00
parent 416b3ce269
commit a149926ba7
3 changed files with 21 additions and 11 deletions

View File

@ -470,9 +470,9 @@ class Actor(PandaObject, NodePath):
if (animControlDict.has_key(partName)):
del(animControlDict[partName])
def hidePart(self, partName, lodName="lodName"):
def hidePart(self, partName, lodName="lodRoot"):
"""hidePart(self, string, key="lodName")
Make the given part of the optional given lod not render,
Make the given part of the optionally given lod not render,
even though still in the tree.
NOTE: this will affect child geometry"""
if (self.__partBundleDict.has_key(lodName)):

View File

@ -51,9 +51,9 @@ class Button:
def setWidth(self, width):
self.l1.setWidth(width / self.button.getScale())
self.l2.setWidth(width / self.button.getScale())
self.l3.setWidth(width / self.button.getScale())
self.l1.setWidth(width)
self.l2.setWidth(width)
self.l3.setWidth(width)
def manage(self):
self.button.manage(guiMgr, base.eventMgr.eventHandler)

View File

@ -12,6 +12,7 @@ class Frame:
def __init__(self, name):
self.name = name
self.managed = 0
self.offset = 0
self.frame = GuiFrame.GuiFrame(name)
self.items = []
@ -42,6 +43,12 @@ class Frame:
def setScale(self, scale):
self.frame.setScale(scale)
def getOffset(self):
return self.offset
def setOffset(self, offset):
self.offset = offset
# content functions
def addItem(self, item):
self.frame.addItem(item.getGuiItem())
@ -55,24 +62,24 @@ class Frame:
def packItem(self, itemNum, relation, otherItemNum):
self.frame.packItem(self.items[itemNum].getGuiItem(), relation,
self.items[otherItemNum].getGuiItem())
self.items[otherItemNum].getGuiItem(), self.offset)
# convenience functions
def makeVertical(self):
# remove any previous packing
#self.frame.clearAllPacking()
self.frame.clearAllPacking()
# make each item (except first) align under the last
for itemNum in range(1, len(self.items)):
# self.frame.clearPacking(self.items[itemNum].getGuiItem())
self.packItem(itemNum, GuiFrame.GuiFrame.UNDER, itemNum - 1)
self.packItem(itemNum, GuiFrame.GuiFrame.ALIGNLEFT, itemNum - 1)
def makeHorizontal(self):
# remove any previous packing
#self.frame.clearAllPacking()
self.frame.clearAllPacking()
# make each item (except first) align right of the last
for itemNum in range(1, len(self.items)):
#self.frame.clearPacking(self.items[itemNum].getGuiItem())
self.packItem(itemNum, GuiFrame.GuiFrame.RIGHT, itemNum - 1)
self.packItem(itemNum, GuiFrame.GuiFrame.ALIGNABOVE, itemNum - 1)
def makeWideAsWidest(self):
# make all the buttons as wide as the widest button in
@ -86,6 +93,9 @@ class Frame:
widest = self.items.index(item)
widestWidth = thisWidth
# re-pack based on new widths
self.frame.recompute()
# make them all this wide
for item in self.items:
item.setWidth(widestWidth)