Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
1e5ad4e9
Kaydet (Commit)
1e5ad4e9
authored
Agu 16, 1991
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added class StrutAppearance (a label with with 0).
Changed minsize to getminsize.
üst
e6afe6a4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
18 deletions
+42
-18
Buttons.py
Lib/lib-stdwin/Buttons.py
+21
-9
Buttons.py
Lib/stdwin/Buttons.py
+21
-9
No files found.
Lib/lib-stdwin/Buttons.py
Dosyayı görüntüle @
1e5ad4e9
...
...
@@ -35,12 +35,10 @@ class LabelAppearance():
#
# Size enquiry
#
def
minsize
(
self
,
m
):
try
:
self
.
text
=
self
.
text
except
NameError
:
self
.
text
=
''
return
m
.
textwidth
(
self
.
text
)
+
6
,
m
.
lineheight
()
+
6
def
getminsize
(
self
,
(
m
,
(
width
,
height
))):
width
=
max
(
width
,
m
.
textwidth
(
self
.
text
)
+
6
)
height
=
max
(
height
,
m
.
lineheight
()
+
6
)
return
width
,
height
#
def
getbounds
(
self
):
return
self
.
bounds
...
...
@@ -143,6 +141,16 @@ class LabelAppearance():
d
.
invert
(
self
.
hilitebounds
)
# A Strut is a label with no width of its own.
class
StrutAppearance
()
=
LabelAppearance
():
#
def
getminsize
(
self
,
(
m
,
(
width
,
height
))):
height
=
max
(
height
,
m
.
lineheight
()
+
6
)
return
width
,
height
#
# ButtonAppearance displays a centered string in a box.
# selected --> bold border
# disabled --> crossed out
...
...
@@ -167,9 +175,12 @@ class ButtonAppearance() = LabelAppearance():
#
class
CheckAppearance
()
=
LabelAppearance
():
#
def
minsize
(
self
,
m
):
width
,
height
=
m
.
textwidth
(
self
.
text
)
+
6
,
m
.
lineheight
()
+
6
return
width
+
height
+
m
.
textwidth
(
' '
),
height
def
getminsize
(
self
,
(
m
,
(
width
,
height
))):
minwidth
=
m
.
textwidth
(
self
.
text
)
+
6
minheight
=
m
.
lineheight
()
+
6
width
=
max
(
width
,
minwidth
+
minheight
+
m
.
textwidth
(
' '
))
height
=
max
(
height
,
minheight
)
return
width
,
height
#
def
drawpict
(
self
,
d
):
d
.
box
(
self
.
boxbounds
)
...
...
@@ -393,6 +404,7 @@ 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
...
...
Lib/stdwin/Buttons.py
Dosyayı görüntüle @
1e5ad4e9
...
...
@@ -35,12 +35,10 @@ class LabelAppearance():
#
# Size enquiry
#
def
minsize
(
self
,
m
):
try
:
self
.
text
=
self
.
text
except
NameError
:
self
.
text
=
''
return
m
.
textwidth
(
self
.
text
)
+
6
,
m
.
lineheight
()
+
6
def
getminsize
(
self
,
(
m
,
(
width
,
height
))):
width
=
max
(
width
,
m
.
textwidth
(
self
.
text
)
+
6
)
height
=
max
(
height
,
m
.
lineheight
()
+
6
)
return
width
,
height
#
def
getbounds
(
self
):
return
self
.
bounds
...
...
@@ -143,6 +141,16 @@ class LabelAppearance():
d
.
invert
(
self
.
hilitebounds
)
# A Strut is a label with no width of its own.
class
StrutAppearance
()
=
LabelAppearance
():
#
def
getminsize
(
self
,
(
m
,
(
width
,
height
))):
height
=
max
(
height
,
m
.
lineheight
()
+
6
)
return
width
,
height
#
# ButtonAppearance displays a centered string in a box.
# selected --> bold border
# disabled --> crossed out
...
...
@@ -167,9 +175,12 @@ class ButtonAppearance() = LabelAppearance():
#
class
CheckAppearance
()
=
LabelAppearance
():
#
def
minsize
(
self
,
m
):
width
,
height
=
m
.
textwidth
(
self
.
text
)
+
6
,
m
.
lineheight
()
+
6
return
width
+
height
+
m
.
textwidth
(
' '
),
height
def
getminsize
(
self
,
(
m
,
(
width
,
height
))):
minwidth
=
m
.
textwidth
(
self
.
text
)
+
6
minheight
=
m
.
lineheight
()
+
6
width
=
max
(
width
,
minwidth
+
minheight
+
m
.
textwidth
(
' '
))
height
=
max
(
height
,
minheight
)
return
width
,
height
#
def
drawpict
(
self
,
d
):
d
.
box
(
self
.
boxbounds
)
...
...
@@ -393,6 +404,7 @@ 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
...
...
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