diff options
author | Guido van Rossum <guido@python.org> | 1991-12-26 13:06:29 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1991-12-26 13:06:29 (GMT) |
commit | ce08448165249b8be2181f231178db52504e2b01 (patch) | |
tree | 65e19b98f946c41b91c720f84ceb5a901fa44ea7 /Lib/stdwin | |
parent | decc4b99e136000e4f03df676ff672c0eccafd3c (diff) | |
download | cpython-ce08448165249b8be2181f231178db52504e2b01.zip cpython-ce08448165249b8be2181f231178db52504e2b01.tar.gz cpython-ce08448165249b8be2181f231178db52504e2b01.tar.bz2 |
New class syntax.
Diffstat (limited to 'Lib/stdwin')
-rwxr-xr-x | Lib/stdwin/Abstract.py | 6 | ||||
-rwxr-xr-x | Lib/stdwin/BoxParent.py | 2 | ||||
-rwxr-xr-x | Lib/stdwin/Buttons.py | 36 | ||||
-rwxr-xr-x | Lib/stdwin/CSplit.py | 2 | ||||
-rwxr-xr-x | Lib/stdwin/FormSplit.py | 2 | ||||
-rwxr-xr-x | Lib/stdwin/HVSplit.py | 6 | ||||
-rwxr-xr-x | Lib/stdwin/Histogram.py | 4 | ||||
-rwxr-xr-x | Lib/stdwin/Sliders.py | 10 | ||||
-rwxr-xr-x | Lib/stdwin/Soundogram.py | 2 | ||||
-rwxr-xr-x | Lib/stdwin/Split.py | 2 | ||||
-rwxr-xr-x | Lib/stdwin/StripChart.py | 2 | ||||
-rwxr-xr-x | Lib/stdwin/VUMeter.py | 2 | ||||
-rwxr-xr-x | Lib/stdwin/WindowParent.py | 2 |
13 files changed, 39 insertions, 39 deletions
diff --git a/Lib/stdwin/Abstract.py b/Lib/stdwin/Abstract.py index 45d68ae..c6fe137 100755 --- a/Lib/stdwin/Abstract.py +++ b/Lib/stdwin/Abstract.py @@ -10,7 +10,7 @@ # For historical reasons, button creation methods are called # define() while split creation methods are called create(). -class AbstractParent(): +class AbstractParent: # # Upcalls from child to parent # @@ -33,7 +33,7 @@ class AbstractParent(): def scroll(self, (area, (dh, dv))): unimpl() def settimer(self, itimer): unimpl() -class AbstractChild(): +class AbstractChild: # # Downcalls from parent to child # @@ -59,5 +59,5 @@ class AbstractChild(): # Certain upcalls and downcalls can be handled transparently, but # for others (e.g., all geometry related calls) this is not possible. -class AbstractSplit() = AbstractChild(), AbstractParent(): +class AbstractSplit(AbstractChild, AbstractParent): pass diff --git a/Lib/stdwin/BoxParent.py b/Lib/stdwin/BoxParent.py index 7a0723a..d042e88 100755 --- a/Lib/stdwin/BoxParent.py +++ b/Lib/stdwin/BoxParent.py @@ -1,6 +1,6 @@ from TransParent import TransParent -class BoxParent() = TransParent(): +class BoxParent(TransParent): # def create(self, (parent, (dh, dv))): self = TransParent.create(self, parent) diff --git a/Lib/stdwin/Buttons.py b/Lib/stdwin/Buttons.py index a218a99..949e128 100755 --- a/Lib/stdwin/Buttons.py +++ b/Lib/stdwin/Buttons.py @@ -22,7 +22,7 @@ _MASK = 3 # disabled --> crossed out # hilited --> inverted # -class LabelAppearance(): +class LabelAppearance: # # Initialization # @@ -143,7 +143,7 @@ class LabelAppearance(): # A Strut is a label with no width of its own. -class StrutAppearance() = LabelAppearance(): +class StrutAppearance(LabelAppearance): # def getminsize(self, (m, (width, height))): height = max(height, m.lineheight() + 6) @@ -156,7 +156,7 @@ class StrutAppearance() = LabelAppearance(): # disabled --> crossed out # hilited --> inverted # -class ButtonAppearance() = LabelAppearance(): +class ButtonAppearance(LabelAppearance): # def drawpict(self, d): d.box(_rect.inset(self.bounds, (1, 1))) @@ -173,7 +173,7 @@ class ButtonAppearance() = LabelAppearance(): # disabled --> whole button crossed out # hilited --> box is inverted # -class CheckAppearance() = LabelAppearance(): +class CheckAppearance(LabelAppearance): # def getminsize(self, (m, (width, height))): minwidth = m.textwidth(self.text) + 6 @@ -207,7 +207,7 @@ class CheckAppearance() = LabelAppearance(): # disabled --> whole button crossed out # hilited --> indicator is inverted # -class RadioAppearance() = CheckAppearance(): +class RadioAppearance(CheckAppearance): # def drawpict(self, d): (left, top), (right, bottom) = self.boxbounds @@ -221,7 +221,7 @@ class RadioAppearance() = CheckAppearance(): # NoReactivity ignores mouse events. # -class NoReactivity(): +class NoReactivity: def init_reactivity(self): pass @@ -237,7 +237,7 @@ class NoReactivity(): # There are usually extra conditions, e.g., hooks are only called # when the button is enabled, or active, or selected (on). # -class BaseReactivity(): +class BaseReactivity: # def init_reactivity(self): self.down_hook = self.move_hook = self.up_hook = \ @@ -279,7 +279,7 @@ class BaseReactivity(): # ToggleReactivity acts like a simple pushbutton. # It toggles its hilite state on mouse down events. # -class ToggleReactivity() = BaseReactivity(): +class ToggleReactivity(BaseReactivity): # def mouse_down(self, detail): if self.enabled and self.mousetest(detail[_HV]): @@ -308,7 +308,7 @@ class ToggleReactivity() = BaseReactivity(): # TriggerReactivity acts like a fancy pushbutton. # It hilites itself while the mouse is down within its bounds. # -class TriggerReactivity() = BaseReactivity(): +class TriggerReactivity(BaseReactivity): # def mouse_down(self, detail): if self.enabled and self.mousetest(detail[_HV]): @@ -336,7 +336,7 @@ class TriggerReactivity() = BaseReactivity(): # CheckReactivity handles mouse events like TriggerReactivity, # It overrides the up_trigger method to flip its selected state. # -class CheckReactivity() = TriggerReactivity(): +class CheckReactivity(TriggerReactivity): # def up_trigger(self): self.select(not self.selected) @@ -350,7 +350,7 @@ class CheckReactivity() = TriggerReactivity(): # RadioReactivity turns itself on and the other buttons in its group # off when its up_trigger method is called. # -class RadioReactivity() = TriggerReactivity(): +class RadioReactivity(TriggerReactivity): # def init_reactivity(self): TriggerReactivity.init_reactivity(self) @@ -370,7 +370,7 @@ class RadioReactivity() = TriggerReactivity(): # Auxiliary class for 'define' method. # Call the initializers in the right order. # -class Define(): +class Define: # def define(self, parent): self.parent = parent @@ -403,9 +403,9 @@ def _xorcross(d, bounds): # Ready-made button classes. # -class Label() = NoReactivity(), LabelAppearance(), Define(): pass -class Strut() = NoReactivity(), StrutAppearance(), Define(): pass -class PushButton() = TriggerReactivity(), ButtonAppearance(), Define(): pass -class CheckButton() = CheckReactivity(), CheckAppearance(), Define(): pass -class RadioButton() = RadioReactivity(), RadioAppearance(), Define(): pass -class ToggleButton() = ToggleReactivity(), ButtonAppearance(), Define(): pass +class Label(NoReactivity, LabelAppearance, Define): pass +class Strut(NoReactivity, StrutAppearance, Define): pass +class PushButton(TriggerReactivity, ButtonAppearance, Define): pass +class CheckButton(CheckReactivity, CheckAppearance, Define): pass +class RadioButton(RadioReactivity, RadioAppearance, Define): pass +class ToggleButton(ToggleReactivity, ButtonAppearance, Define): pass diff --git a/Lib/stdwin/CSplit.py b/Lib/stdwin/CSplit.py index a9d3556..5c57d90 100755 --- a/Lib/stdwin/CSplit.py +++ b/Lib/stdwin/CSplit.py @@ -7,7 +7,7 @@ from math import pi, sin, cos from Split import Split -class CSplit() = Split(): +class CSplit(Split): # def getminsize(self, (m, (width, height))): # Since things look best if the children are spaced evenly diff --git a/Lib/stdwin/FormSplit.py b/Lib/stdwin/FormSplit.py index 521b9a8..16f3293 100755 --- a/Lib/stdwin/FormSplit.py +++ b/Lib/stdwin/FormSplit.py @@ -13,7 +13,7 @@ from Split import Split -class FormSplit() = Split(): +class FormSplit(Split): # def create(self, parent): self.next_left = self.next_top = 0 diff --git a/Lib/stdwin/HVSplit.py b/Lib/stdwin/HVSplit.py index c35ce4c..9790b7b 100755 --- a/Lib/stdwin/HVSplit.py +++ b/Lib/stdwin/HVSplit.py @@ -7,7 +7,7 @@ from Split import Split -class HVSplit() = Split(): +class HVSplit(Split): # def create(self, (parent, hv)): # hv is 0 for HSplit, 1 for VSplit @@ -53,10 +53,10 @@ class HVSplit() = Split(): # XXX too-small # -class HSplit() = HVSplit(): +class HSplit(HVSplit): def create(self, parent): return HVSplit.create(self, (parent, 0)) -class VSplit() = HVSplit(): +class VSplit(HVSplit): def create(self, parent): return HVSplit.create(self, (parent, 1)) diff --git a/Lib/stdwin/Histogram.py b/Lib/stdwin/Histogram.py index 505bbaf..27ae673 100755 --- a/Lib/stdwin/Histogram.py +++ b/Lib/stdwin/Histogram.py @@ -4,7 +4,7 @@ from Buttons import * # A Histogram displays a histogram of numeric data. # -class HistogramAppearance() = LabelAppearance(), Define(): +class HistogramAppearance(LabelAppearance, Define): # def define(self, parent): Define.define(self, (parent, '')) @@ -33,4 +33,4 @@ class HistogramAppearance() = LabelAppearance(), Define(): d.paint((h0, v0), (h1, v1)) # -class Histogram() = NoReactivity(), HistogramAppearance(): pass +class Histogram(NoReactivity, HistogramAppearance): pass diff --git a/Lib/stdwin/Sliders.py b/Lib/stdwin/Sliders.py index a07c3c4..0a709d6 100755 --- a/Lib/stdwin/Sliders.py +++ b/Lib/stdwin/Sliders.py @@ -22,7 +22,7 @@ _MASK = 3 # It does not support any of the triggers or hooks defined by Buttons, # but defines its own setval_trigger and setval_hook. # -class DragSliderReactivity() = BaseReactivity(): +class DragSliderReactivity(BaseReactivity): # def mouse_down(self, detail): h, v = hv = detail[_HV] @@ -43,7 +43,7 @@ class DragSliderReactivity() = BaseReactivity(): self.active = 0 # -class DragSliderAppearance() = ButtonAppearance(): +class DragSliderAppearance(ButtonAppearance): # # INVARIANTS maintained by the setval method: # @@ -94,14 +94,14 @@ class DragSliderAppearance() = ButtonAppearance(): self.settext(self.pretext + `self.val` + self.postext) # -class DragSlider() = DragSliderReactivity(), DragSliderAppearance(), Define(): +class DragSlider(DragSliderReactivity, DragSliderAppearance, Define): def definetext(self, (parent, text)): raise RuntimeError, 'DragSlider.definetext() not supported' # Auxiliary class for PushButton incorporated in ComplexSlider # -class _StepButton() = PushButton(): +class _StepButton(PushButton): def define(self, parent): self = PushButton.define(self, parent) self.step = 0 @@ -130,7 +130,7 @@ class _StepButton() = PushButton(): # A complex slider is an HSplit initialized to three buttons: # one to step down, a dragslider, and one to step up. # -class ComplexSlider() = HSplit(): +class ComplexSlider(HSplit): # # Override Slider define() method # diff --git a/Lib/stdwin/Soundogram.py b/Lib/stdwin/Soundogram.py index aa2edd1..a68d4b3 100755 --- a/Lib/stdwin/Soundogram.py +++ b/Lib/stdwin/Soundogram.py @@ -3,7 +3,7 @@ import audio from Histogram import Histogram -class Soundogram() = Histogram(): +class Soundogram(Histogram): # def define(self, (win, chunk)): width, height = corner = win.getwinsize() diff --git a/Lib/stdwin/Split.py b/Lib/stdwin/Split.py index a5a6542..b169d72 100755 --- a/Lib/stdwin/Split.py +++ b/Lib/stdwin/Split.py @@ -8,7 +8,7 @@ Error = 'Split.Error' # Exception import rect from stdwinevents import * -class Split(): +class Split: # # Calls from creator # NB derived classes may add parameters to create() diff --git a/Lib/stdwin/StripChart.py b/Lib/stdwin/StripChart.py index 67d7de1..d58f835 100755 --- a/Lib/stdwin/StripChart.py +++ b/Lib/stdwin/StripChart.py @@ -6,7 +6,7 @@ from Buttons import LabelAppearance, NoReactivity # A StripChart doesn't really look like a label but it needs a base class. # LabelAppearance allows it to be disabled and hilited. -class StripChart() = LabelAppearance(), NoReactivity(): +class StripChart(LabelAppearance, NoReactivity): # def define(self, (parent, scale)): self.parent = parent diff --git a/Lib/stdwin/VUMeter.py b/Lib/stdwin/VUMeter.py index 31fe155..ed9a473 100755 --- a/Lib/stdwin/VUMeter.py +++ b/Lib/stdwin/VUMeter.py @@ -6,7 +6,7 @@ from StripChart import StripChart K = 1024 Rates = [0, 32*K, 16*K, 8*K] -class VUMeter() = StripChart(): +class VUMeter(StripChart): # # Override define() and timer() methods # diff --git a/Lib/stdwin/WindowParent.py b/Lib/stdwin/WindowParent.py index 7b965f9..a0593c5 100755 --- a/Lib/stdwin/WindowParent.py +++ b/Lib/stdwin/WindowParent.py @@ -12,7 +12,7 @@ from TransParent import ManageOneChild Error = 'WindowParent.Error' # Exception -class WindowParent() = ManageOneChild(): +class WindowParent(ManageOneChild): # def create(self, (title, size)): self.title = title |