*** empty log message ***

This commit is contained in:
gregw 2001-03-01 21:05:14 +00:00
parent 59388d00c1
commit 44f4f3af87
2 changed files with 28 additions and 17 deletions

View File

@ -15,23 +15,34 @@ class Button(DirectObject):
if (label == None): if (label == None):
self.label = name self.label = name
else: else:
self.label = label # check to see if this is an actual guiLabel or just text
# up if (type(label) == type('')):
self.l1 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label, font) # text label, make text button
self.l1.setForegroundColor(0., 0., 0., 1.) self.label = label
self.l1.thaw() # up
# roll-over up self.l1 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label,
self.l2 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label, font) font)
self.l2.setForegroundColor(0., 0., 0., 1.) self.l1.setForegroundColor(0., 0., 0., 1.)
self.l2.setBackgroundColor(1., 1., 0., 1.) self.l1.thaw()
self.l2.thaw() # roll-over up
# roll-over down self.l2 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label,
self.l3 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label, font) font)
self.l3.setForegroundColor(1., 1., 1., 1.) self.l2.setForegroundColor(0., 0., 0., 1.)
self.l3.setBackgroundColor(0., 0., 0., 1.) self.l2.setBackgroundColor(1., 1., 0., 1.)
self.l3.thaw() self.l2.thaw()
# roll-over down
self.l3 = GuiLabel.GuiLabel.makeSimpleTextLabel(self.label,
font)
self.l3.setForegroundColor(1., 1., 1., 1.)
self.l3.setBackgroundColor(0., 0., 0., 1.)
self.l3.thaw()
else:
# label provided, use it for all labels
self.l1 = self.l2 = self.l3 = label
self.button = GuiButton.GuiButton(self.name, self.l1, self.l2, self.button = GuiButton.GuiButton(self.name, self.l1, self.l2,
self.l3, self.l3, self.l1) self.l3, self.l3, self.l1)
self.setScale(0.1) self.setScale(0.1)
self.managed = 0 self.managed = 0

View File

@ -111,13 +111,11 @@ class Frame(DirectObject):
def makeWideAsWidest(self): def makeWideAsWidest(self):
# make all the buttons as wide as the widest button in # make all the buttons as wide as the widest button in
# the frame # the frame
widest = 0
widestWidth = 0.0 widestWidth = 0.0
# find the widest # find the widest
for item in self.items: for item in self.items:
thisWidth = item.getWidth() thisWidth = item.getWidth()
if (thisWidth > widestWidth): if (thisWidth > widestWidth):
widest = self.items.index(item)
widestWidth = thisWidth widestWidth = thisWidth
# make them all this wide # make them all this wide
@ -126,3 +124,5 @@ class Frame(DirectObject):