Jelajahi Sumber

*** empty log message ***

gregw 25 tahun lalu
induk
melakukan
9f49b9531a
2 mengubah file dengan 8 tambahan dan 3 penghapusan
  1. 3 2
      direct/src/gui/Button.py
  2. 5 1
      direct/src/gui/Label.py

+ 3 - 2
direct/src/gui/Button.py

@@ -14,7 +14,8 @@ class Button(DirectObject):
                  drawOrder = getDefaultDrawOrder(),
                  drawOrder = getDefaultDrawOrder(),
                  font = getDefaultFont(),
                  font = getDefaultFont(),
                  pos = (0, 0),
                  pos = (0, 0),
-                 geomRect = None):
+                 geomRect = None,
+                 style = Label.ButtonUp):
         self.name = name
         self.name = name
         self.width = width
         self.width = width
         # if no label given, use the button name
         # if no label given, use the button name
@@ -26,7 +27,7 @@ class Button(DirectObject):
             # text label, make text button
             # text label, make text button
             self.label = label
             self.label = label
 
 
-            self.l1 = Label.textLabel(self.label, Label.ButtonUp,
+            self.l1 = Label.textLabel(self.label, style,
                                       scale, width, drawOrder, font)
                                       scale, width, drawOrder, font)
 
 
             if width == None:
             if width == None:

+ 5 - 1
direct/src/gui/Label.py

@@ -11,7 +11,7 @@ ButtonDown = 3
 Sign = 4
 Sign = 4
 ScrollTitle = 5
 ScrollTitle = 5
 ScrollItem = 6
 ScrollItem = 6
-
+ButtonUpGui = 7
 
 
 def textLabel(string, style,
 def textLabel(string, style,
               scale = 0.1,
               scale = 0.1,
@@ -64,6 +64,10 @@ def textLabelAndText(string, style,
     if style == ButtonUp:
     if style == ButtonUp:
         # This is the default: black on white.
         # This is the default: black on white.
         pass
         pass
+
+    elif style == ButtonUpGui:
+        # special GUI button with our lovely gui color
+        text.setCardColor(0.25, 0.7, 0.85, 1.0)
         
         
     elif style == ButtonLit:
     elif style == ButtonLit:
         # When the mouse is over the button, the background turns
         # When the mouse is over the button, the background turns