diff options
author | Just van Rossum <just@letterror.com> | 2001-11-02 19:17:16 (GMT) |
---|---|---|
committer | Just van Rossum <just@letterror.com> | 2001-11-02 19:17:16 (GMT) |
commit | 64350b4610bf7dc5e4840c514b71d74587111d13 (patch) | |
tree | 11423de91b6d61f3ba40e5d86982aa601efd9f0d /Mac/Tools | |
parent | 2e9e71fea6afbe1fc55c9425539bf34e7f9948cd (diff) | |
download | cpython-64350b4610bf7dc5e4840c514b71d74587111d13.zip cpython-64350b4610bf7dc5e4840c514b71d74587111d13.tar.gz cpython-64350b4610bf7dc5e4840c514b71d74587111d13.tar.bz2 |
- rearranged some imports
- removed default button drawing code: this doesn't work well
under OSX. Needs to be replaced by SetWindowDefaultButton()
calls, once we have those.
Diffstat (limited to 'Mac/Tools')
-rw-r--r-- | Mac/Tools/IDE/Wcontrols.py | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/Mac/Tools/IDE/Wcontrols.py b/Mac/Tools/IDE/Wcontrols.py index 6742d9f..399a930 100644 --- a/Mac/Tools/IDE/Wcontrols.py +++ b/Mac/Tools/IDE/Wcontrols.py @@ -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: |