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
ce272986
Kaydet (Commit)
ce272986
authored
Agu 16, 1991
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
minsize --> getminsize; new implementation of getminsize
üst
cadae0fc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
34 deletions
+44
-34
HVSplit.py
Lib/lib-stdwin/HVSplit.py
+15
-9
Sliders.py
Lib/lib-stdwin/Sliders.py
+7
-8
HVSplit.py
Lib/stdwin/HVSplit.py
+15
-9
Sliders.py
Lib/stdwin/Sliders.py
+7
-8
No files found.
Lib/lib-stdwin/HVSplit.py
Dosyayı görüntüle @
ce272986
...
@@ -10,16 +10,19 @@ from Split import Split
...
@@ -10,16 +10,19 @@ from Split import Split
class
HVSplit
()
=
Split
():
class
HVSplit
()
=
Split
():
#
#
def
create
(
self
,
(
parent
,
hv
)):
def
create
(
self
,
(
parent
,
hv
)):
# hv is 0
or 1 for HSplit
or VSplit
# hv is 0
for HSplit, 1 f
or VSplit
self
=
Split
.
create
(
self
,
parent
)
self
=
Split
.
create
(
self
,
parent
)
self
.
hv
=
hv
self
.
hv
=
hv
return
self
return
self
#
#
def
minsize
(
self
,
m
):
def
getminsize
(
self
,
(
m
,
sugg_size
)
):
hv
,
vh
=
self
.
hv
,
1
-
self
.
hv
hv
,
vh
=
self
.
hv
,
1
-
self
.
hv
size
=
[
0
,
0
]
size
=
[
0
,
0
]
sugg_size
=
[
sugg_size
[
0
],
sugg_size
[
1
]]
sugg_size
[
hv
]
=
0
sugg_size
=
sugg_size
[
0
],
sugg_size
[
1
]
# Make a tuple
for
c
in
self
.
children
:
for
c
in
self
.
children
:
csize
=
c
.
minsize
(
m
)
csize
=
c
.
getminsize
(
m
,
sugg_size
)
if
csize
[
vh
]
>
size
[
vh
]:
size
[
vh
]
=
csize
[
vh
]
if
csize
[
vh
]
>
size
[
vh
]:
size
[
vh
]
=
csize
[
vh
]
size
[
hv
]
=
size
[
hv
]
+
csize
[
hv
]
size
[
hv
]
=
size
[
hv
]
+
csize
[
hv
]
return
size
[
0
],
size
[
1
]
return
size
[
0
],
size
[
1
]
...
@@ -31,14 +34,17 @@ class HVSplit() = Split():
...
@@ -31,14 +34,17 @@ class HVSplit() = Split():
self
.
bounds
=
bounds
self
.
bounds
=
bounds
hv
,
vh
=
self
.
hv
,
1
-
self
.
hv
hv
,
vh
=
self
.
hv
,
1
-
self
.
hv
mf
=
self
.
parent
.
beginmeasuring
mf
=
self
.
parent
.
beginmeasuring
size
=
self
.
minsize
(
mf
())
begin
,
end
=
bounds
# XXX not yet used! Later for stretching
sugg_size
=
end
[
0
]
-
begin
[
0
],
end
[
1
]
-
begin
[
1
]
maxsize_hv
=
bounds
[
1
][
hv
]
-
bounds
[
0
][
hv
]
size
=
self
.
getminsize
(
mf
(),
sugg_size
)
origin
=
[
self
.
bounds
[
0
][
0
],
self
.
bounds
[
0
][
1
]]
origin
=
[
begin
[
0
],
begin
[
1
]]
sugg_size
=
[
sugg_size
[
0
],
sugg_size
[
1
]]
# Make a list
sugg_size
[
hv
]
=
0
sugg_size
=
sugg_size
[
0
],
sugg_size
[
1
]
# Make a tuple
for
c
in
self
.
children
:
for
c
in
self
.
children
:
size
=
c
.
minsize
(
mf
()
)
size
=
c
.
getminsize
(
mf
(),
sugg_size
)
corner
=
[
0
,
0
]
corner
=
[
0
,
0
]
corner
[
vh
]
=
bounds
[
1
]
[
vh
]
corner
[
vh
]
=
end
[
vh
]
corner
[
hv
]
=
origin
[
hv
]
+
size
[
hv
]
corner
[
hv
]
=
origin
[
hv
]
+
size
[
hv
]
c
.
setbounds
((
origin
[
0
],
origin
[
1
]),
\
c
.
setbounds
((
origin
[
0
],
origin
[
1
]),
\
(
corner
[
0
],
corner
[
1
]))
(
corner
[
0
],
corner
[
1
]))
...
...
Lib/lib-stdwin/Sliders.py
Dosyayı görüntüle @
ce272986
...
@@ -145,14 +145,13 @@ class ComplexSlider() = HSplit():
...
@@ -145,14 +145,13 @@ class ComplexSlider() = HSplit():
#
#
# Override HSplit methods
# Override HSplit methods
#
#
def
minsize
(
self
,
m
):
def
getminsize
(
self
,
(
m
,
(
width
,
height
))):
w1
,
h1
=
self
.
downbutton
.
minsize
(
m
)
w1
,
h1
=
self
.
downbutton
.
getminsize
(
m
,
(
0
,
height
))
w2
,
h2
=
self
.
dragbutton
.
minsize
(
m
)
w3
,
h3
=
self
.
upbutton
.
getminsize
(
m
,
(
0
,
height
))
w3
,
h3
=
self
.
upbutton
.
minsize
(
m
)
w1
=
max
(
w1
,
h1
)
height
=
max
(
h1
,
h2
,
h3
)
w3
=
max
(
w3
,
h3
)
w1
=
max
(
w1
,
height
)
w2
,
h2
=
self
.
dragbutton
.
getminsize
(
m
,
(
width
-
w1
-
w3
,
height
))
w3
=
max
(
w3
,
height
)
return
w1
+
w2
+
w3
,
max
(
h1
,
h2
,
h3
)
return
w1
+
w2
+
w3
,
height
#
#
def
setbounds
(
self
,
bounds
):
def
setbounds
(
self
,
bounds
):
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
=
bounds
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
=
bounds
...
...
Lib/stdwin/HVSplit.py
Dosyayı görüntüle @
ce272986
...
@@ -10,16 +10,19 @@ from Split import Split
...
@@ -10,16 +10,19 @@ from Split import Split
class
HVSplit
()
=
Split
():
class
HVSplit
()
=
Split
():
#
#
def
create
(
self
,
(
parent
,
hv
)):
def
create
(
self
,
(
parent
,
hv
)):
# hv is 0
or 1 for HSplit
or VSplit
# hv is 0
for HSplit, 1 f
or VSplit
self
=
Split
.
create
(
self
,
parent
)
self
=
Split
.
create
(
self
,
parent
)
self
.
hv
=
hv
self
.
hv
=
hv
return
self
return
self
#
#
def
minsize
(
self
,
m
):
def
getminsize
(
self
,
(
m
,
sugg_size
)
):
hv
,
vh
=
self
.
hv
,
1
-
self
.
hv
hv
,
vh
=
self
.
hv
,
1
-
self
.
hv
size
=
[
0
,
0
]
size
=
[
0
,
0
]
sugg_size
=
[
sugg_size
[
0
],
sugg_size
[
1
]]
sugg_size
[
hv
]
=
0
sugg_size
=
sugg_size
[
0
],
sugg_size
[
1
]
# Make a tuple
for
c
in
self
.
children
:
for
c
in
self
.
children
:
csize
=
c
.
minsize
(
m
)
csize
=
c
.
getminsize
(
m
,
sugg_size
)
if
csize
[
vh
]
>
size
[
vh
]:
size
[
vh
]
=
csize
[
vh
]
if
csize
[
vh
]
>
size
[
vh
]:
size
[
vh
]
=
csize
[
vh
]
size
[
hv
]
=
size
[
hv
]
+
csize
[
hv
]
size
[
hv
]
=
size
[
hv
]
+
csize
[
hv
]
return
size
[
0
],
size
[
1
]
return
size
[
0
],
size
[
1
]
...
@@ -31,14 +34,17 @@ class HVSplit() = Split():
...
@@ -31,14 +34,17 @@ class HVSplit() = Split():
self
.
bounds
=
bounds
self
.
bounds
=
bounds
hv
,
vh
=
self
.
hv
,
1
-
self
.
hv
hv
,
vh
=
self
.
hv
,
1
-
self
.
hv
mf
=
self
.
parent
.
beginmeasuring
mf
=
self
.
parent
.
beginmeasuring
size
=
self
.
minsize
(
mf
())
begin
,
end
=
bounds
# XXX not yet used! Later for stretching
sugg_size
=
end
[
0
]
-
begin
[
0
],
end
[
1
]
-
begin
[
1
]
maxsize_hv
=
bounds
[
1
][
hv
]
-
bounds
[
0
][
hv
]
size
=
self
.
getminsize
(
mf
(),
sugg_size
)
origin
=
[
self
.
bounds
[
0
][
0
],
self
.
bounds
[
0
][
1
]]
origin
=
[
begin
[
0
],
begin
[
1
]]
sugg_size
=
[
sugg_size
[
0
],
sugg_size
[
1
]]
# Make a list
sugg_size
[
hv
]
=
0
sugg_size
=
sugg_size
[
0
],
sugg_size
[
1
]
# Make a tuple
for
c
in
self
.
children
:
for
c
in
self
.
children
:
size
=
c
.
minsize
(
mf
()
)
size
=
c
.
getminsize
(
mf
(),
sugg_size
)
corner
=
[
0
,
0
]
corner
=
[
0
,
0
]
corner
[
vh
]
=
bounds
[
1
]
[
vh
]
corner
[
vh
]
=
end
[
vh
]
corner
[
hv
]
=
origin
[
hv
]
+
size
[
hv
]
corner
[
hv
]
=
origin
[
hv
]
+
size
[
hv
]
c
.
setbounds
((
origin
[
0
],
origin
[
1
]),
\
c
.
setbounds
((
origin
[
0
],
origin
[
1
]),
\
(
corner
[
0
],
corner
[
1
]))
(
corner
[
0
],
corner
[
1
]))
...
...
Lib/stdwin/Sliders.py
Dosyayı görüntüle @
ce272986
...
@@ -145,14 +145,13 @@ class ComplexSlider() = HSplit():
...
@@ -145,14 +145,13 @@ class ComplexSlider() = HSplit():
#
#
# Override HSplit methods
# Override HSplit methods
#
#
def
minsize
(
self
,
m
):
def
getminsize
(
self
,
(
m
,
(
width
,
height
))):
w1
,
h1
=
self
.
downbutton
.
minsize
(
m
)
w1
,
h1
=
self
.
downbutton
.
getminsize
(
m
,
(
0
,
height
))
w2
,
h2
=
self
.
dragbutton
.
minsize
(
m
)
w3
,
h3
=
self
.
upbutton
.
getminsize
(
m
,
(
0
,
height
))
w3
,
h3
=
self
.
upbutton
.
minsize
(
m
)
w1
=
max
(
w1
,
h1
)
height
=
max
(
h1
,
h2
,
h3
)
w3
=
max
(
w3
,
h3
)
w1
=
max
(
w1
,
height
)
w2
,
h2
=
self
.
dragbutton
.
getminsize
(
m
,
(
width
-
w1
-
w3
,
height
))
w3
=
max
(
w3
,
height
)
return
w1
+
w2
+
w3
,
max
(
h1
,
h2
,
h3
)
return
w1
+
w2
+
w3
,
height
#
#
def
setbounds
(
self
,
bounds
):
def
setbounds
(
self
,
bounds
):
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
=
bounds
(
left
,
top
),
(
right
,
bottom
)
=
self
.
bounds
=
bounds
...
...
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