]> granicus.if.org Git - python/commitdiff
- rearranged some imports
authorJust van Rossum <just@letterror.com>
Fri, 2 Nov 2001 19:17:16 +0000 (19:17 +0000)
committerJust van Rossum <just@letterror.com>
Fri, 2 Nov 2001 19:17:16 +0000 (19:17 +0000)
- removed default button drawing code: this doesn't work well
  under OSX. Needs to be replaced by SetWindowDefaultButton()
  calls, once we have those.

Mac/Tools/IDE/Wcontrols.py

index 6742d9f4d59e8862b40d38f73791c706820da8ce..399a930f7cfbd04f20ec9215002cfd7279b41c8b 100644 (file)
@@ -1,9 +1,7 @@
-from Carbon import Ctl
-from Carbon import Controls
-from Carbon import Win
+from Carbon import Ctl, Controls
+from Carbon import Evt, Qd, Win
 import Wbase
-from Carbon import Qd
-from Carbon import Evt
+
 
 class ControlWidget(Wbase.ClickableWidget):
        
@@ -117,45 +115,21 @@ class Button(ControlWidget):
                if self._control and self._enabled <> onoff:
                        self._control.HiliteControl((not onoff) and 255)
                        self._enabled = onoff
-                       if self._isdefault and self._visible:
-                               self.SetPort()
-                               self.drawfatframe(onoff)
        
        def activate(self, onoff):
                self._activated = onoff
                if self._enabled:
                        self._control.HiliteControl((not onoff) and 255)
-                       if self._isdefault and self._visible:
-                               self.SetPort()
-                               self.drawfatframe(onoff)
        
        def show(self, onoff):
                ControlWidget.show(self, onoff)
-               if self._isdefault:
-                       self.drawfatframe(onoff and self._enabled)
        
        def draw(self, visRgn = None):
                if self._visible:
                        self._control.Draw1Control()
-                       if self._isdefault and self._activated:
-                               self.drawfatframe(self._enabled)
-       
-       def drawfatframe(self, onoff):
-               state = Qd.GetPenState()
-               if onoff:
-                       Qd.PenPat(Qd.qd.black)
-               else:
-                       Qd.PenPat(Qd.qd.white)
-               fatrect = Qd.InsetRect(self._bounds, -4, -4)
-               Qd.PenSize(3, 3)
-               Qd.FrameRoundRect(fatrect, 16, 16)
-               Qd.SetPenState(state)
        
        def _setdefault(self, onoff):
                self._isdefault = onoff
-               if self._control and self._enabled:
-                       self.SetPort()
-                       self.drawfatframe(onoff)
        
        def adjust(self, oldbounds):
                if self._isdefault: