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
7bfc8752
Kaydet (Commit)
7bfc8752
authored
Nis 16, 1996
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed ScrolledWindow to disable scrollbars if everything is visible.
üst
111fdcf8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
8 deletions
+48
-8
FrameWork.py
Mac/Lib/FrameWork.py
+48
-8
No files found.
Mac/Lib/FrameWork.py
Dosyayı görüntüle @
7bfc8752
...
...
@@ -617,33 +617,45 @@ class ControlsWindow(Window):
class
ScrolledWindow
(
ControlsWindow
):
def
__init__
(
self
,
parent
):
self
.
barx
=
self
.
bary
=
None
self
.
barx_enabled
=
self
.
bary_enabled
=
1
self
.
activated
=
1
ControlsWindow
.
__init__
(
self
,
parent
)
def
scrollbars
(
self
,
wantx
=
1
,
wanty
=
1
):
SetPort
(
self
.
wid
)
self
.
barx
=
self
.
bary
=
None
self
.
barx_enabled
=
self
.
bary_enabled
=
1
x0
,
y0
,
x1
,
y1
=
self
.
wid
.
GetWindowPort
()
.
portRect
vx
,
vy
=
self
.
getscrollbarvalues
()
if
vx
==
None
:
self
.
barx_enabled
,
vx
=
0
,
0
if
vy
==
None
:
self
.
bary_enabled
,
vy
=
0
,
0
if
wantx
:
rect
=
x0
-
1
,
y1
-
(
SCROLLBARWIDTH
-
1
),
x1
-
(
SCROLLBARWIDTH
-
2
),
y1
+
1
self
.
barx
=
NewControl
(
self
.
wid
,
rect
,
""
,
1
,
vx
,
0
,
32767
,
16
,
0
)
if
not
self
.
barx_enabled
:
self
.
barx
.
HiliteControl
(
255
)
## InvalRect(rect)
if
wanty
:
rect
=
x1
-
(
SCROLLBARWIDTH
-
1
),
y0
-
1
,
x1
+
1
,
y1
-
(
SCROLLBARWIDTH
-
2
)
self
.
bary
=
NewControl
(
self
.
wid
,
rect
,
""
,
1
,
vy
,
0
,
32767
,
16
,
0
)
if
not
self
.
bary_enabled
:
self
.
bary
.
HiliteControl
(
255
)
## InvalRect(rect)
def
do_postclose
(
self
):
self
.
barx
=
self
.
bary
=
None
ControlsWindow
.
do_postclose
(
self
)
def
do_activate
(
self
,
onoff
,
event
):
self
.
activated
=
onoff
if
onoff
:
onoff
=
0
if
self
.
barx
and
self
.
barx_enabled
:
self
.
barx
.
HiliteControl
(
0
)
if
self
.
bary
and
self
.
bary_enabled
:
self
.
bary
.
HiliteControl
(
0
)
else
:
onoff
=
255
if
self
.
barx
:
self
.
barx
.
HiliteControl
(
onoff
)
if
self
.
bary
:
self
.
bary
.
HiliteControl
(
onoff
)
if
self
.
barx
:
self
.
barx
.
HiliteControl
(
255
)
if
self
.
bary
:
self
.
bary
.
HiliteControl
(
255
)
def
do_postresize
(
self
,
width
,
height
,
window
):
l
,
t
,
r
,
b
=
self
.
wid
.
GetWindowPort
()
.
portRect
...
...
@@ -684,9 +696,37 @@ class ScrolledWindow(ControlsWindow):
SetPort
(
self
.
wid
)
vx
,
vy
=
self
.
getscrollbarvalues
()
if
self
.
barx
:
self
.
barx
.
SetControlValue
(
vx
)
if
vx
==
None
:
self
.
barx
.
HiliteControl
(
255
)
self
.
barx_enabled
=
0
else
:
if
not
self
.
barx_enabled
:
self
.
barx_enabled
=
1
if
self
.
activated
:
self
.
barx
.
HiliteControl
(
0
)
self
.
barx
.
SetControlValue
(
vx
)
if
self
.
bary
:
self
.
bary
.
SetControlValue
(
vy
)
if
vy
==
None
:
self
.
bary
.
HiliteControl
(
255
)
self
.
bary_enabled
=
0
else
:
if
not
self
.
bary_enabled
:
self
.
bary_enabled
=
1
if
self
.
activated
:
self
.
bary
.
HiliteControl
(
0
)
self
.
bary
.
SetControlValue
(
vy
)
# Auxiliary function: convert standard text/image/etc coordinate
# to something palatable as getscrollbarvalues() return
def
scalebarvalue
(
self
,
absmin
,
absmax
,
curmin
,
curmax
):
if
curmin
<=
absmin
and
curmax
>=
absmax
:
return
None
if
curmin
<=
absmin
:
return
0
if
curmax
>=
absmax
:
return
32767
perc
=
float
(
curmin
-
absmin
)
/
float
(
absmax
-
absmin
)
return
int
(
perc
*
32767
)
# To be overridden:
...
...
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