Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b8e121d0
Commit
b8e121d0
authored
Dec 26, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New class syntax.
parent
1229a6be
Changes
29
Hide whitespace changes
Inline
Side-by-side
Showing
29 changed files
with
81 additions
and
81 deletions
+81
-81
Lib/lib-stdwin/Abstract.py
Lib/lib-stdwin/Abstract.py
+3
-3
Lib/lib-stdwin/BoxParent.py
Lib/lib-stdwin/BoxParent.py
+1
-1
Lib/lib-stdwin/Buttons.py
Lib/lib-stdwin/Buttons.py
+18
-18
Lib/lib-stdwin/CSplit.py
Lib/lib-stdwin/CSplit.py
+1
-1
Lib/lib-stdwin/FormSplit.py
Lib/lib-stdwin/FormSplit.py
+1
-1
Lib/lib-stdwin/HVSplit.py
Lib/lib-stdwin/HVSplit.py
+3
-3
Lib/lib-stdwin/Histogram.py
Lib/lib-stdwin/Histogram.py
+2
-2
Lib/lib-stdwin/Sliders.py
Lib/lib-stdwin/Sliders.py
+5
-5
Lib/lib-stdwin/Soundogram.py
Lib/lib-stdwin/Soundogram.py
+1
-1
Lib/lib-stdwin/Split.py
Lib/lib-stdwin/Split.py
+1
-1
Lib/lib-stdwin/StripChart.py
Lib/lib-stdwin/StripChart.py
+1
-1
Lib/lib-stdwin/VUMeter.py
Lib/lib-stdwin/VUMeter.py
+1
-1
Lib/lib-stdwin/WindowParent.py
Lib/lib-stdwin/WindowParent.py
+1
-1
Lib/mutex.py
Lib/mutex.py
+1
-1
Lib/sched.py
Lib/sched.py
+1
-1
Lib/stdwin/Abstract.py
Lib/stdwin/Abstract.py
+3
-3
Lib/stdwin/BoxParent.py
Lib/stdwin/BoxParent.py
+1
-1
Lib/stdwin/Buttons.py
Lib/stdwin/Buttons.py
+18
-18
Lib/stdwin/CSplit.py
Lib/stdwin/CSplit.py
+1
-1
Lib/stdwin/FormSplit.py
Lib/stdwin/FormSplit.py
+1
-1
Lib/stdwin/HVSplit.py
Lib/stdwin/HVSplit.py
+3
-3
Lib/stdwin/Histogram.py
Lib/stdwin/Histogram.py
+2
-2
Lib/stdwin/Sliders.py
Lib/stdwin/Sliders.py
+5
-5
Lib/stdwin/Soundogram.py
Lib/stdwin/Soundogram.py
+1
-1
Lib/stdwin/Split.py
Lib/stdwin/Split.py
+1
-1
Lib/stdwin/StripChart.py
Lib/stdwin/StripChart.py
+1
-1
Lib/stdwin/VUMeter.py
Lib/stdwin/VUMeter.py
+1
-1
Lib/stdwin/WindowParent.py
Lib/stdwin/WindowParent.py
+1
-1
Lib/tempfile.py
Lib/tempfile.py
+1
-1
No files found.
Lib/lib-stdwin/Abstract.py
View file @
b8e121d0
...
...
@@ -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
Lib/lib-stdwin/BoxParent.py
View file @
b8e121d0
from
TransParent
import
TransParent
class
BoxParent
(
)
=
TransParent
(
):
class
BoxParent
(
TransParent
):
#
def
create
(
self
,
(
parent
,
(
dh
,
dv
))):
self
=
TransParent
.
create
(
self
,
parent
)
...
...
Lib/lib-stdwin/Buttons.py
View file @
b8e121d0
...
...
@@ -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
Lib/lib-stdwin/CSplit.py
View file @
b8e121d0
...
...
@@ -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
...
...
Lib/lib-stdwin/FormSplit.py
View file @
b8e121d0
...
...
@@ -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
...
...
Lib/lib-stdwin/HVSplit.py
View file @
b8e121d0
...
...
@@ -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
))
Lib/lib-stdwin/Histogram.py
View file @
b8e121d0
...
...
@@ -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
Lib/lib-stdwin/Sliders.py
View file @
b8e121d0
...
...
@@ -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
#
...
...
Lib/lib-stdwin/Soundogram.py
View file @
b8e121d0
...
...
@@ -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
()
...
...
Lib/lib-stdwin/Split.py
View file @
b8e121d0
...
...
@@ -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()
...
...
Lib/lib-stdwin/StripChart.py
View file @
b8e121d0
...
...
@@ -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
...
...
Lib/lib-stdwin/VUMeter.py
View file @
b8e121d0
...
...
@@ -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
#
...
...
Lib/lib-stdwin/WindowParent.py
View file @
b8e121d0
...
...
@@ -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
...
...
Lib/mutex.py
View file @
b8e121d0
...
...
@@ -11,7 +11,7 @@
# Of course, no multi-threading is implied -- hence the funny interface
# for lock, where a function is called once the lock is aquired.
#
class
mutex
()
:
class
mutex
:
#
# Create a new mutex -- initially unlocked
#
...
...
Lib/sched.py
View file @
b8e121d0
...
...
@@ -28,7 +28,7 @@
# XXX instead of having to define a module or class just to hold
# XXX the global state of your particular time and delay functtions.
class
scheduler
()
:
class
scheduler
:
#
# Initialize a new instance, passing the time and delay functions
#
...
...
Lib/stdwin/Abstract.py
View file @
b8e121d0
...
...
@@ -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
Lib/stdwin/BoxParent.py
View file @
b8e121d0
from
TransParent
import
TransParent
class
BoxParent
(
)
=
TransParent
(
):
class
BoxParent
(
TransParent
):
#
def
create
(
self
,
(
parent
,
(
dh
,
dv
))):
self
=
TransParent
.
create
(
self
,
parent
)
...
...
Lib/stdwin/Buttons.py
View file @
b8e121d0
...
...
@@ -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
Lib/stdwin/CSplit.py
View file @
b8e121d0
...
...
@@ -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
...
...
Lib/stdwin/FormSplit.py
View file @
b8e121d0
...
...
@@ -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
...
...
Lib/stdwin/HVSplit.py
View file @
b8e121d0
...
...
@@ -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
))
Lib/stdwin/Histogram.py
View file @
b8e121d0
...
...
@@ -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
Lib/stdwin/Sliders.py
View file @
b8e121d0
...
...
@@ -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
#
...
...
Lib/stdwin/Soundogram.py
View file @
b8e121d0
...
...
@@ -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
()
...
...
Lib/stdwin/Split.py
View file @
b8e121d0
...
...
@@ -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()
...
...
Lib/stdwin/StripChart.py
View file @
b8e121d0
...
...
@@ -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
...
...
Lib/stdwin/VUMeter.py
View file @
b8e121d0
...
...
@@ -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
#
...
...
Lib/stdwin/WindowParent.py
View file @
b8e121d0
...
...
@@ -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
...
...
Lib/tempfile.py
View file @
b8e121d0
...
...
@@ -13,7 +13,7 @@ template = '@'
# Kludge to hold mutable state
class
Struct
()
:
pass
class
Struct
:
pass
G
=
Struct
()
G
.
i
=
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment