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
14d53bf1
Kaydet (Commit)
14d53bf1
authored
Agu 16, 1991
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added vspacepixels.
Integrated with stdwinq.
üst
48154be1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
formatter.py
Lib/lib-stdwin/formatter.py
+10
-6
formatter.py
Lib/stdwin/formatter.py
+10
-6
No files found.
Lib/lib-stdwin/formatter.py
Dosyayı görüntüle @
14d53bf1
...
@@ -20,7 +20,7 @@ class formatter():
...
@@ -20,7 +20,7 @@ class formatter():
self
.
v
=
top
# Top of current line
self
.
v
=
top
# Top of current line
self
.
center
=
0
self
.
center
=
0
self
.
justify
=
1
self
.
justify
=
1
self
.
setfont
(
''
)
#
Curren
t font
self
.
setfont
(
''
)
#
Defaul
t font
self
.
_reset
()
# Prepare for new line
self
.
_reset
()
# Prepare for new line
return
self
return
self
#
#
...
@@ -122,10 +122,14 @@ class formatter():
...
@@ -122,10 +122,14 @@ class formatter():
# Vertical space is expressed in fractions of the current
# Vertical space is expressed in fractions of the current
# font's line height.
# font's line height.
#
#
def
vspace
(
self
,
dy
):
def
vspace
(
self
,
lines
):
self
.
vspacepixels
(
int
(
lines
*
self
.
d
.
lineheight
()))
#
# Add vertical space given in pixels.
#
def
vspacepixels
(
self
,
dv
):
self
.
flush
()
self
.
flush
()
dy
=
int
(
float
(
dy
)
*
float
(
self
.
d
.
lineheight
()))
self
.
v
=
self
.
v
+
dv
self
.
v
=
self
.
v
+
dy
#
#
# Set temporary (hanging) indent, for paragraph start.
# Set temporary (hanging) indent, for paragraph start.
# First flush.
# First flush.
...
@@ -149,7 +153,7 @@ class formatter():
...
@@ -149,7 +153,7 @@ class formatter():
# Test procedure
# Test procedure
#
#
def
test
():
def
test
():
import
stdwin
import
stdwin
,
stdwinq
from
stdwinevents
import
*
from
stdwinevents
import
*
try
:
try
:
import
mac
import
mac
...
@@ -170,7 +174,7 @@ def test():
...
@@ -170,7 +174,7 @@ def test():
w
=
stdwin
.
open
(
title
)
w
=
stdwin
.
open
(
title
)
winsize
=
w
.
getwinsize
()
winsize
=
w
.
getwinsize
()
while
1
:
while
1
:
type
,
window
,
detail
=
stdwin
.
getevent
()
type
,
window
,
detail
=
stdwin
q
.
getevent
()
if
type
=
WE_CLOSE
:
if
type
=
WE_CLOSE
:
break
break
elif
type
=
WE_SIZE
:
elif
type
=
WE_SIZE
:
...
...
Lib/stdwin/formatter.py
Dosyayı görüntüle @
14d53bf1
...
@@ -20,7 +20,7 @@ class formatter():
...
@@ -20,7 +20,7 @@ class formatter():
self
.
v
=
top
# Top of current line
self
.
v
=
top
# Top of current line
self
.
center
=
0
self
.
center
=
0
self
.
justify
=
1
self
.
justify
=
1
self
.
setfont
(
''
)
#
Curren
t font
self
.
setfont
(
''
)
#
Defaul
t font
self
.
_reset
()
# Prepare for new line
self
.
_reset
()
# Prepare for new line
return
self
return
self
#
#
...
@@ -122,10 +122,14 @@ class formatter():
...
@@ -122,10 +122,14 @@ class formatter():
# Vertical space is expressed in fractions of the current
# Vertical space is expressed in fractions of the current
# font's line height.
# font's line height.
#
#
def
vspace
(
self
,
dy
):
def
vspace
(
self
,
lines
):
self
.
vspacepixels
(
int
(
lines
*
self
.
d
.
lineheight
()))
#
# Add vertical space given in pixels.
#
def
vspacepixels
(
self
,
dv
):
self
.
flush
()
self
.
flush
()
dy
=
int
(
float
(
dy
)
*
float
(
self
.
d
.
lineheight
()))
self
.
v
=
self
.
v
+
dv
self
.
v
=
self
.
v
+
dy
#
#
# Set temporary (hanging) indent, for paragraph start.
# Set temporary (hanging) indent, for paragraph start.
# First flush.
# First flush.
...
@@ -149,7 +153,7 @@ class formatter():
...
@@ -149,7 +153,7 @@ class formatter():
# Test procedure
# Test procedure
#
#
def
test
():
def
test
():
import
stdwin
import
stdwin
,
stdwinq
from
stdwinevents
import
*
from
stdwinevents
import
*
try
:
try
:
import
mac
import
mac
...
@@ -170,7 +174,7 @@ def test():
...
@@ -170,7 +174,7 @@ def test():
w
=
stdwin
.
open
(
title
)
w
=
stdwin
.
open
(
title
)
winsize
=
w
.
getwinsize
()
winsize
=
w
.
getwinsize
()
while
1
:
while
1
:
type
,
window
,
detail
=
stdwin
.
getevent
()
type
,
window
,
detail
=
stdwin
q
.
getevent
()
if
type
=
WE_CLOSE
:
if
type
=
WE_CLOSE
:
break
break
elif
type
=
WE_SIZE
:
elif
type
=
WE_SIZE
:
...
...
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