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
f376ef09
Kaydet (Commit)
f376ef09
authored
Kas 18, 2001
tarafından
Just van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
a whole bunch of OSX tweaks
üst
ebbd14d7
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
102 additions
and
66 deletions
+102
-66
PyBrowser.py
Mac/Tools/IDE/PyBrowser.py
+2
-1
PyDebugger.py
Mac/Tools/IDE/PyDebugger.py
+0
-1
PyEdit.py
Mac/Tools/IDE/PyEdit.py
+5
-4
W.py
Mac/Tools/IDE/W.py
+2
-1
Wapplication.py
Mac/Tools/IDE/Wapplication.py
+1
-1
Wbase.py
Mac/Tools/IDE/Wbase.py
+2
-10
Wcontrols.py
Mac/Tools/IDE/Wcontrols.py
+46
-9
Widgets.rsrc
Mac/Tools/IDE/Widgets.rsrc
+0
-0
Wlists.py
Mac/Tools/IDE/Wlists.py
+11
-6
Wtext.py
Mac/Tools/IDE/Wtext.py
+33
-33
No files found.
Mac/Tools/IDE/PyBrowser.py
Dosyayı görüntüle @
f376ef09
...
@@ -143,6 +143,7 @@ class BrowserWidget(W.List):
...
@@ -143,6 +143,7 @@ class BrowserWidget(W.List):
newcol
=
-
1
newcol
=
-
1
#W.SetCursor('fist')
#W.SetCursor('fist')
while
Evt
.
Button
():
while
Evt
.
Button
():
Evt
.
WaitNextEvent
(
0
,
1
,
None
)
# needed for OSX
(
x
,
y
)
=
Evt
.
GetMouse
()
(
x
,
y
)
=
Evt
.
GetMouse
()
if
(
x
,
y
)
<>
lastpoint
:
if
(
x
,
y
)
<>
lastpoint
:
newcol
=
x
+
diff
newcol
=
x
+
diff
...
@@ -307,7 +308,7 @@ class Browser:
...
@@ -307,7 +308,7 @@ class Browser:
title
=
title
+
': '
+
name
title
=
title
+
': '
+
name
self
.
w
=
w
=
W
.
Window
((
300
,
400
),
title
,
minsize
=
(
100
,
100
))
self
.
w
=
w
=
W
.
Window
((
300
,
400
),
title
,
minsize
=
(
100
,
100
))
w
.
info
=
W
.
TextBox
((
18
,
8
,
-
70
,
15
))
w
.
info
=
W
.
TextBox
((
18
,
8
,
-
70
,
15
))
w
.
updatebutton
=
W
.
Button
((
-
64
,
4
,
50
,
16
),
'Update'
,
self
.
update
)
w
.
updatebutton
=
W
.
B
evelB
utton
((
-
64
,
4
,
50
,
16
),
'Update'
,
self
.
update
)
w
.
browser
=
BrowserWidget
((
-
1
,
24
,
1
,
-
14
),
None
)
w
.
browser
=
BrowserWidget
((
-
1
,
24
,
1
,
-
14
),
None
)
w
.
bind
(
'cmdu'
,
w
.
updatebutton
.
push
)
w
.
bind
(
'cmdu'
,
w
.
updatebutton
.
push
)
w
.
open
()
w
.
open
()
...
...
Mac/Tools/IDE/PyDebugger.py
Dosyayı görüntüle @
f376ef09
...
@@ -681,7 +681,6 @@ class BreakpointsViewer:
...
@@ -681,7 +681,6 @@ class BreakpointsViewer:
def
__init__
(
self
,
debugger
):
def
__init__
(
self
,
debugger
):
self
.
debugger
=
debugger
self
.
debugger
=
debugger
import
Lists
self
.
w
=
W
.
Window
((
300
,
250
),
'Breakpoints'
,
minsize
=
(
200
,
200
))
self
.
w
=
W
.
Window
((
300
,
250
),
'Breakpoints'
,
minsize
=
(
200
,
200
))
self
.
w
.
panes
=
W
.
HorizontalPanes
((
8
,
8
,
-
8
,
-
32
),
(
0.3
,
0.7
))
self
.
w
.
panes
=
W
.
HorizontalPanes
((
8
,
8
,
-
8
,
-
32
),
(
0.3
,
0.7
))
self
.
w
.
panes
.
files
=
W
.
List
(
None
,
callback
=
self
.
filehit
)
#, flags = Lists.lOnlyOne)
self
.
w
.
panes
.
files
=
W
.
List
(
None
,
callback
=
self
.
filehit
)
#, flags = Lists.lOnlyOne)
...
...
Mac/Tools/IDE/PyEdit.py
Dosyayı görüntüle @
f376ef09
...
@@ -174,7 +174,7 @@ class Editor(W.Window):
...
@@ -174,7 +174,7 @@ class Editor(W.Window):
return
'<
%
s>'
%
self
.
title
return
'<
%
s>'
%
self
.
title
def
setupwidgets
(
self
,
text
):
def
setupwidgets
(
self
,
text
):
topbarheight
=
2
8
topbarheight
=
2
4
popfieldwidth
=
80
popfieldwidth
=
80
self
.
lastlineno
=
None
self
.
lastlineno
=
None
...
@@ -197,9 +197,9 @@ class Editor(W.Window):
...
@@ -197,9 +197,9 @@ class Editor(W.Window):
self
.
bevelbox
=
W
.
BevelBox
((
0
,
0
,
0
,
topbarheight
))
self
.
bevelbox
=
W
.
BevelBox
((
0
,
0
,
0
,
topbarheight
))
self
.
hline
=
W
.
HorizontalLine
((
0
,
topbarheight
,
0
,
0
))
self
.
hline
=
W
.
HorizontalLine
((
0
,
topbarheight
,
0
,
0
))
self
.
infotext
=
W
.
TextBox
((
175
,
7
,
-
4
,
14
),
backgroundcolor
=
(
0xe000
,
0xe000
,
0xe000
))
self
.
infotext
=
W
.
TextBox
((
175
,
6
,
-
4
,
14
),
backgroundcolor
=
(
0xe000
,
0xe000
,
0xe000
))
self
.
runbutton
=
W
.
B
utton
((
6
,
5
,
6
0
,
16
),
runButtonLabels
[
0
],
self
.
run
)
self
.
runbutton
=
W
.
B
evelButton
((
6
,
4
,
8
0
,
16
),
runButtonLabels
[
0
],
self
.
run
)
self
.
runselbutton
=
W
.
B
utton
((
78
,
5
,
9
0
,
16
),
runSelButtonLabels
[
0
],
self
.
runselection
)
self
.
runselbutton
=
W
.
B
evelButton
((
90
,
4
,
8
0
,
16
),
runSelButtonLabels
[
0
],
self
.
runselection
)
# bind some keys
# bind some keys
editor
.
bind
(
"cmdr"
,
self
.
runbutton
.
push
)
editor
.
bind
(
"cmdr"
,
self
.
runbutton
.
push
)
...
@@ -801,6 +801,7 @@ def _makewholewordpattern(word):
...
@@ -801,6 +801,7 @@ def _makewholewordpattern(word):
pattern
=
pattern
+
notwordcharspat
pattern
=
pattern
+
notwordcharspat
return
re
.
compile
(
pattern
)
return
re
.
compile
(
pattern
)
class
SearchEngine
:
class
SearchEngine
:
def
__init__
(
self
):
def
__init__
(
self
):
...
...
Mac/Tools/IDE/W.py
Dosyayı görüntüle @
f376ef09
...
@@ -31,7 +31,8 @@ def getdefaultfont():
...
@@ -31,7 +31,8 @@ def getdefaultfont():
return
prefs
.
defaultfont
return
prefs
.
defaultfont
def
Message
(
text
):
def
Message
(
text
):
import
EasyDialogs
,
Qd
,
string
import
EasyDialogs
,
string
from
Carbon
import
Qd
Qd
.
InitCursor
()
Qd
.
InitCursor
()
text
=
string
.
replace
(
text
,
"
\n
"
,
"
\r
"
)
text
=
string
.
replace
(
text
,
"
\n
"
,
"
\r
"
)
if
not
text
:
if
not
text
:
...
...
Mac/Tools/IDE/Wapplication.py
Dosyayı görüntüle @
f376ef09
...
@@ -9,7 +9,7 @@ from types import *
...
@@ -9,7 +9,7 @@ from types import *
from
Carbon
import
Menu
;
MenuToolbox
=
Menu
;
del
Menu
from
Carbon
import
Menu
;
MenuToolbox
=
Menu
;
del
Menu
KILLUNKNOWNWINDOWS
=
1
# Set to 0 for debugging.
KILLUNKNOWNWINDOWS
=
0
# Set to 0 for debugging.
class
Application
(
FrameWork
.
Application
):
class
Application
(
FrameWork
.
Application
):
...
...
Mac/Tools/IDE/Wbase.py
Dosyayı görüntüle @
f376ef09
from
Carbon
import
Evt
,
Qd
,
QuickDraw
,
Win
from
Carbon
import
App
,
Evt
,
Qd
,
QuickDraw
,
Win
import
string
import
string
from
types
import
*
from
types
import
*
import
sys
import
sys
...
@@ -329,15 +329,7 @@ class SelectableWidget(ClickableWidget):
...
@@ -329,15 +329,7 @@ class SelectableWidget(ClickableWidget):
def
drawselframe
(
self
,
onoff
):
def
drawselframe
(
self
,
onoff
):
if
not
self
.
_parentwindow
.
_hasselframes
:
if
not
self
.
_parentwindow
.
_hasselframes
:
return
return
thickrect
=
Qd
.
InsetRect
(
self
.
_bounds
,
-
3
,
-
3
)
App
.
DrawThemeFocusRect
(
self
.
_bounds
,
onoff
)
state
=
Qd
.
GetPenState
()
Qd
.
PenSize
(
2
,
2
)
if
onoff
:
Qd
.
PenPat
(
Qd
.
qd
.
black
)
else
:
Qd
.
PenPat
(
Qd
.
qd
.
white
)
Qd
.
FrameRect
(
thickrect
)
Qd
.
SetPenState
(
state
)
def
adjust
(
self
,
oldbounds
):
def
adjust
(
self
,
oldbounds
):
self
.
SetPort
()
self
.
SetPort
()
...
...
Mac/Tools/IDE/Wcontrols.py
Dosyayı görüntüle @
f376ef09
...
@@ -17,6 +17,7 @@ class ControlWidget(Wbase.ClickableWidget):
...
@@ -17,6 +17,7 @@ class ControlWidget(Wbase.ClickableWidget):
self
.
_min
=
min
self
.
_min
=
min
self
.
_max
=
max
self
.
_max
=
max
self
.
_enabled
=
1
self
.
_enabled
=
1
self
.
_viewsize
=
0
def
open
(
self
):
def
open
(
self
):
self
.
_calcbounds
()
self
.
_calcbounds
()
...
@@ -29,8 +30,8 @@ class ControlWidget(Wbase.ClickableWidget):
...
@@ -29,8 +30,8 @@ class ControlWidget(Wbase.ClickableWidget):
self
.
_max
,
self
.
_max
,
self
.
_procID
,
self
.
_procID
,
0
)
0
)
self
.
SetPort
()
if
self
.
_viewsize
:
#self.GetWindow().ValidWindowRect(self._bounds
)
self
.
_control
.
SetControlViewSize
(
self
.
_viewsize
)
self
.
enable
(
self
.
_enabled
)
self
.
enable
(
self
.
_enabled
)
def
adjust
(
self
,
oldbounds
):
def
adjust
(
self
,
oldbounds
):
...
@@ -75,9 +76,11 @@ class ControlWidget(Wbase.ClickableWidget):
...
@@ -75,9 +76,11 @@ class ControlWidget(Wbase.ClickableWidget):
self
.
_control
.
Draw1Control
()
self
.
_control
.
Draw1Control
()
def
test
(
self
,
point
):
def
test
(
self
,
point
):
ctltype
,
control
=
Ctl
.
FindControl
(
point
,
self
.
_parentwindow
.
wid
)
if
Qd
.
PtInRect
(
point
,
self
.
_bounds
)
and
self
.
_enabled
:
if
self
.
_enabled
and
control
==
self
.
_control
:
return
1
return
1
#ctltype, control = Ctl.FindControl(point, self._parentwindow.wid)
#if self._enabled and control == self._control:
# return 1
def
click
(
self
,
point
,
modifiers
):
def
click
(
self
,
point
,
modifiers
):
if
not
self
.
_enabled
:
if
not
self
.
_enabled
:
...
@@ -112,16 +115,19 @@ class Button(ControlWidget):
...
@@ -112,16 +115,19 @@ class Button(ControlWidget):
"""Standard push button."""
"""Standard push button."""
def
__init__
(
self
,
possize
,
title
=
"Button"
,
callback
=
None
):
procID
=
Controls
.
pushButProc
|
Controls
.
useWFont
procID
=
Controls
.
pushButProc
|
Controls
.
useWFont
ControlWidget
.
__init__
(
self
,
possize
,
title
,
procID
,
callback
,
0
,
0
,
1
)
def
__init__
(
self
,
possize
,
title
=
"Button"
,
callback
=
None
):
ControlWidget
.
__init__
(
self
,
possize
,
title
,
self
.
procID
,
callback
,
0
,
0
,
1
)
self
.
_isdefault
=
0
self
.
_isdefault
=
0
def
push
(
self
):
def
push
(
self
):
if
not
self
.
_enabled
:
if
not
self
.
_enabled
:
return
return
# emulate the pushing of the button
import
time
import
time
self
.
_control
.
HiliteControl
(
Controls
.
kControlButtonPart
)
self
.
_control
.
HiliteControl
(
Controls
.
kControlButtonPart
)
Qd
.
QDFlushPortBuffer
(
self
.
_parentwindow
.
wid
,
None
)
# needed under OSX
time
.
sleep
(
0.1
)
time
.
sleep
(
0.1
)
self
.
_control
.
HiliteControl
(
0
)
self
.
_control
.
HiliteControl
(
0
)
if
self
.
_callback
:
if
self
.
_callback
:
...
@@ -139,7 +145,25 @@ class Button(ControlWidget):
...
@@ -139,7 +145,25 @@ class Button(ControlWidget):
if
self
.
_visible
:
if
self
.
_visible
:
self
.
_control
.
Draw1Control
()
self
.
_control
.
Draw1Control
()
def
open
(
self
):
ControlWidget
.
open
(
self
)
if
self
.
_isdefault
:
self
.
_setdefault
(
self
.
_isdefault
)
def
_setdefault
(
self
,
onoff
):
def
_setdefault
(
self
,
onoff
):
c
=
self
.
_control
if
c
is
not
None
:
if
onoff
:
data
=
"
\xFF
"
else
:
data
=
"
\0
"
# hide before changing state, otherwise the button isn't always
# redrawn correctly, although it's quite different under Aqua
# and Classic...
c
.
HideControl
()
c
.
SetControlData
(
Controls
.
kControlNoPart
,
Controls
.
kControlPushButtonDefaultTag
,
data
)
c
.
ShowControl
()
self
.
_isdefault
=
onoff
self
.
_isdefault
=
onoff
def
adjust
(
self
,
oldbounds
):
def
adjust
(
self
,
oldbounds
):
...
@@ -152,6 +176,10 @@ class Button(ControlWidget):
...
@@ -152,6 +176,10 @@ class Button(ControlWidget):
ControlWidget
.
adjust
(
self
,
oldbounds
)
ControlWidget
.
adjust
(
self
,
oldbounds
)
class
BevelButton
(
Button
):
procID
=
Controls
.
kControlBevelButtonNormalBevelProc
|
Controls
.
useWFont
class
CheckBox
(
ControlWidget
):
class
CheckBox
(
ControlWidget
):
"""Standard checkbox."""
"""Standard checkbox."""
...
@@ -250,13 +278,22 @@ class Scrollbar(ControlWidget):
...
@@ -250,13 +278,22 @@ class Scrollbar(ControlWidget):
Wbase
.
CallbackCall
(
self
.
_callback
,
1
,
'--'
)
Wbase
.
CallbackCall
(
self
.
_callback
,
1
,
'--'
)
def
setmin
(
self
,
min
):
def
setmin
(
self
,
min
):
if
self
.
_control
is
not
None
:
self
.
_control
.
SetControl32BitMinimum
(
min
)
self
.
_control
.
SetControl32BitMinimum
(
min
)
else
:
self
.
_min
=
min
def
setmax
(
self
,
max
):
def
setmax
(
self
,
max
):
if
self
.
_control
is
not
None
:
self
.
_control
.
SetControl32BitMaximum
(
max
)
self
.
_control
.
SetControl32BitMaximum
(
max
)
else
:
self
.
_max
=
max
def
setviewsize
(
self
,
view
):
def
setviewsize
(
self
,
viewsize
):
self
.
_control
.
SetControlViewSize
(
view
)
if
self
.
_control
is
not
None
:
self
.
_control
.
SetControlViewSize
(
viewsize
)
else
:
self
.
_viewsize
=
viewsize
def
getmin
(
self
):
def
getmin
(
self
):
return
self
.
_control
.
GetControl32BitMinimum
()
return
self
.
_control
.
GetControl32BitMinimum
()
...
@@ -312,7 +349,7 @@ class Scrollbar(ControlWidget):
...
@@ -312,7 +349,7 @@ class Scrollbar(ControlWidget):
def
draw
(
self
,
visRgn
=
None
):
def
draw
(
self
,
visRgn
=
None
):
if
self
.
_visible
:
if
self
.
_visible
:
self
.
_control
.
Draw1Control
()
self
.
_control
.
Draw1Control
()
Qd
.
FrameRect
(
self
.
_bounds
)
#
Qd.FrameRect(self._bounds)
def
adjust
(
self
,
oldbounds
):
def
adjust
(
self
,
oldbounds
):
self
.
SetPort
()
self
.
SetPort
()
...
...
Mac/Tools/IDE/Widgets.rsrc
Dosyayı görüntüle @
f376ef09
No preview for this file type
Mac/Tools/IDE/Wlists.py
Dosyayı görüntüle @
f376ef09
...
@@ -5,6 +5,8 @@ from Carbon import Evt, Events, Fm, Lists, Qd, Scrap, Win
...
@@ -5,6 +5,8 @@ from Carbon import Evt, Events, Fm, Lists, Qd, Scrap, Win
from
Carbon.List
import
LNew
,
CreateCustomList
,
GetListPort
from
Carbon.List
import
LNew
,
CreateCustomList
,
GetListPort
from
Carbon.Lists
import
kListDefUserProcType
,
lInitMsg
,
lDrawMsg
,
lHiliteMsg
,
lCloseMsg
from
Carbon.Lists
import
kListDefUserProcType
,
lInitMsg
,
lDrawMsg
,
lHiliteMsg
,
lCloseMsg
from
Carbon.QuickDraw
import
hilitetransfermode
from
Carbon.QuickDraw
import
hilitetransfermode
from
Carbon
import
App
from
Carbon.Appearance
import
kThemeStateActive
,
kThemeStateInactive
,
kThemeStatePressed
class
List
(
Wbase
.
SelectableWidget
):
class
List
(
Wbase
.
SelectableWidget
):
...
@@ -253,22 +255,24 @@ class List(Wbase.SelectableWidget):
...
@@ -253,22 +255,24 @@ class List(Wbase.SelectableWidget):
if
not
visRgn
:
if
not
visRgn
:
visRgn
=
self
.
_parentwindow
.
wid
.
GetWindowPort
()
.
visRgn
visRgn
=
self
.
_parentwindow
.
wid
.
GetWindowPort
()
.
visRgn
self
.
_list
.
LUpdate
(
visRgn
)
self
.
_list
.
LUpdate
(
visRgn
)
Qd
.
FrameRect
(
self
.
_bounds
)
App
.
DrawThemeListBoxFrame
(
self
.
_bounds
,
kThemeStateActive
)
if
self
.
_selected
and
self
.
_activated
:
#
if self._selected and self._activated:
self
.
drawselframe
(
1
)
#
self.drawselframe(1)
def
select
(
self
,
onoff
,
isclick
=
0
):
def
select
(
self
,
onoff
,
isclick
=
0
):
if
Wbase
.
SelectableWidget
.
select
(
self
,
onoff
):
if
Wbase
.
SelectableWidget
.
select
(
self
,
onoff
):
return
return
self
.
SetPort
()
self
.
SetPort
()
self
.
drawselframe
(
onoff
)
state
=
[
kThemeStateActive
,
kThemeStatePressed
][
onoff
]
App
.
DrawThemeListBoxFrame
(
self
.
_bounds
,
kThemeStateActive
)
#self.drawselframe(onoff)
def
activate
(
self
,
onoff
):
def
activate
(
self
,
onoff
):
self
.
_activated
=
onoff
self
.
_activated
=
onoff
if
self
.
_visible
:
if
self
.
_visible
:
self
.
_list
.
LActivate
(
onoff
)
self
.
_list
.
LActivate
(
onoff
)
if
self
.
_selected
:
#
if self._selected:
self
.
drawselframe
(
onoff
)
#
self.drawselframe(onoff)
def
get
(
self
):
def
get
(
self
):
return
self
.
items
return
self
.
items
...
@@ -449,6 +453,7 @@ class TwoLineList(CustomList):
...
@@ -449,6 +453,7 @@ class TwoLineList(CustomList):
Qd
.
MoveTo
(
left
+
4
,
top
+
ascent
+
linefeed
)
Qd
.
MoveTo
(
left
+
4
,
top
+
ascent
+
linefeed
)
Qd
.
DrawText
(
line2
,
0
,
len
(
line2
))
Qd
.
DrawText
(
line2
,
0
,
len
(
line2
))
Qd
.
PenPat
(
"
\x11\x11\x11\x11\x11\x11\x11\x11
"
)
Qd
.
PenPat
(
"
\x11\x11\x11\x11\x11\x11\x11\x11
"
)
bottom
=
top
+
theList
.
cellSize
[
1
]
Qd
.
MoveTo
(
left
,
bottom
-
1
)
Qd
.
MoveTo
(
left
,
bottom
-
1
)
Qd
.
LineTo
(
right
,
bottom
-
1
)
Qd
.
LineTo
(
right
,
bottom
-
1
)
if
selected
:
if
selected
:
...
...
Mac/Tools/IDE/Wtext.py
Dosyayı görüntüle @
f376ef09
from
Carbon
import
Evt
,
Events
,
Fm
,
Fonts
from
Carbon
import
Evt
,
Events
,
Fm
,
Fonts
from
Carbon
import
Qd
,
Res
,
Scrap
from
Carbon
import
Qd
,
Res
,
Scrap
from
Carbon
import
TE
,
TextEdit
,
Win
from
Carbon
import
TE
,
TextEdit
,
Win
from
Carbon
import
App
from
Carbon.Appearance
import
kThemeStateActive
,
kThemeStateInactive
import
waste
import
waste
import
WASTEconst
import
WASTEconst
import
Wbase
import
Wbase
...
@@ -55,24 +57,28 @@ class TextBox(Wbase.Widget):
...
@@ -55,24 +57,28 @@ class TextBox(Wbase.Widget):
class
_ScrollWidget
:
class
_ScrollWidget
:
# to be overridden
# to be overridden
def
getscrollbarvalues
(
self
):
def
getscrollrects
(
self
):
"""Return (destrect, viewrect)."""
return
None
,
None
return
None
,
None
# internal method
# internal method
def
updatescrollbars
(
self
):
def
updatescrollbars
(
self
):
vx
,
vy
=
self
.
getscrollbarvalue
s
()
(
dl
,
dt
,
dr
,
db
),
(
vl
,
vt
,
vr
,
vb
)
=
self
.
getscrollrect
s
()
if
self
.
_parent
.
_barx
:
if
self
.
_parent
.
_barx
:
if
vx
<>
None
:
viewwidth
=
vr
-
vl
self
.
_parent
.
_barx
.
enable
(
1
)
destwidth
=
dr
-
dl
self
.
_parent
.
_barx
.
set
(
vx
)
bar
=
self
.
_parent
.
_barx
else
:
bar
.
setmax
(
destwidth
-
viewwidth
)
self
.
_parent
.
_barx
.
enable
(
0
)
bar
.
setviewsize
(
viewwidth
)
bar
.
set
(
vl
-
dl
)
if
self
.
_parent
.
_bary
:
if
self
.
_parent
.
_bary
:
if
vy
<>
None
:
viewheight
=
vb
-
vt
self
.
_parent
.
_bary
.
enable
(
1
)
destheight
=
db
-
dt
self
.
_parent
.
_bary
.
set
(
vy
)
bar
=
self
.
_parent
.
_bary
else
:
bar
.
setmax
(
destheight
-
viewheight
)
self
.
_parent
.
_bary
.
enable
(
0
)
bar
.
setviewsize
(
viewheight
)
bar
.
set
(
vt
-
dt
)
UNDOLABELS
=
[
# Indexed by WEGetUndoInfo() value
UNDOLABELS
=
[
# Indexed by WEGetUndoInfo() value
...
@@ -373,6 +379,7 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
...
@@ -373,6 +379,7 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
if
self
.
_selected
and
self
.
_activated
:
if
self
.
_selected
and
self
.
_activated
:
self
.
drawselframe
(
1
)
self
.
drawselframe
(
1
)
Qd
.
FrameRect
(
self
.
_bounds
)
Qd
.
FrameRect
(
self
.
_bounds
)
#App.DrawThemeEditTextFrame(self._bounds, kThemeStateActive)
# scrolling
# scrolling
def
scrollpageup
(
self
):
def
scrollpageup
(
self
):
...
@@ -385,13 +392,13 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
...
@@ -385,13 +392,13 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
def
scrolltop
(
self
):
def
scrolltop
(
self
):
if
self
.
_parent
.
_bary
and
self
.
_parent
.
_bary
.
_enabled
:
if
self
.
_parent
.
_bary
and
self
.
_parent
.
_bary
.
_enabled
:
self
.
vscroll
(
0
)
self
.
vscroll
(
self
.
_parent
.
_bary
.
getmin
()
)
if
self
.
_parent
.
_barx
and
self
.
_parent
.
_barx
.
_enabled
:
if
self
.
_parent
.
_barx
and
self
.
_parent
.
_barx
.
_enabled
:
self
.
hscroll
(
0
)
self
.
hscroll
(
self
.
_parent
.
_barx
.
getmin
()
)
def
scrollbottom
(
self
):
def
scrollbottom
(
self
):
if
self
.
_parent
.
_bary
and
self
.
_parent
.
_bary
.
_enabled
:
if
self
.
_parent
.
_bary
and
self
.
_parent
.
_bary
.
_enabled
:
self
.
vscroll
(
32767
)
self
.
vscroll
(
self
.
_parent
.
_bary
.
getmax
()
)
# menu handlers
# menu handlers
def
domenu_copy
(
self
,
*
args
):
def
domenu_copy
(
self
,
*
args
):
...
@@ -469,20 +476,15 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
...
@@ -469,20 +476,15 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
self
.
selectall
()
self
.
selectall
()
# private
# private
def
getscrollbarvalues
(
self
):
def
getscrollrects
(
self
):
dr
=
self
.
ted
.
WEGetDestRect
()
return
self
.
ted
.
WEGetDestRect
(),
self
.
ted
.
WEGetViewRect
()
vr
=
self
.
ted
.
WEGetViewRect
()
vx
=
Wcontrols
.
_scalebarvalue
(
dr
[
0
],
dr
[
2
],
vr
[
0
],
vr
[
2
])
vy
=
Wcontrols
.
_scalebarvalue
(
dr
[
1
],
dr
[
3
],
vr
[
1
],
vr
[
3
])
return
vx
,
vy
def
vscroll
(
self
,
value
):
def
vscroll
(
self
,
value
):
lineheight
=
self
.
ted
.
WEGetHeight
(
0
,
1
)
lineheight
=
self
.
ted
.
WEGetHeight
(
0
,
1
)
dr
=
self
.
ted
.
WEGetDestRect
()
dr
=
self
.
ted
.
WEGetDestRect
()
vr
=
self
.
ted
.
WEGetViewRect
()
vr
=
self
.
ted
.
WEGetViewRect
()
destheight
=
dr
[
3
]
-
dr
[
1
]
viewheight
=
vr
[
3
]
-
vr
[
1
]
viewheight
=
vr
[
3
]
-
vr
[
1
]
viewoffset
=
maxdelta
=
vr
[
1
]
-
dr
[
1
]
maxdelta
=
vr
[
1
]
-
dr
[
1
]
mindelta
=
vr
[
3
]
-
dr
[
3
]
mindelta
=
vr
[
3
]
-
dr
[
3
]
if
value
==
"+"
:
if
value
==
"+"
:
delta
=
lineheight
delta
=
lineheight
...
@@ -493,11 +495,7 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
...
@@ -493,11 +495,7 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
elif
value
==
"--"
:
elif
value
==
"--"
:
delta
=
lineheight
-
viewheight
delta
=
lineheight
-
viewheight
else
:
# in thumb
else
:
# in thumb
cur
=
(
32767L
*
viewoffset
)
/
(
destheight
-
viewheight
)
delta
=
vr
[
1
]
-
dr
[
1
]
-
value
delta
=
(
cur
-
value
)
*
(
destheight
-
viewheight
)
/
32767
if
abs
(
delta
-
viewoffset
)
<=
2
:
# compensate for irritating rounding error
delta
=
viewoffset
delta
=
min
(
maxdelta
,
delta
)
delta
=
min
(
maxdelta
,
delta
)
delta
=
max
(
mindelta
,
delta
)
delta
=
max
(
mindelta
,
delta
)
self
.
ted
.
WEScroll
(
0
,
delta
)
self
.
ted
.
WEScroll
(
0
,
delta
)
...
@@ -519,11 +517,12 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
...
@@ -519,11 +517,12 @@ class EditText(Wbase.SelectableWidget, _ScrollWidget):
elif
value
==
"--"
:
elif
value
==
"--"
:
delta
=
0.5
*
(
vr
[
0
]
-
vr
[
2
])
delta
=
0.5
*
(
vr
[
0
]
-
vr
[
2
])
else
:
# in thumb
else
:
# in thumb
cur
=
(
32767
*
viewoffset
)
/
(
destwidth
-
viewwidth
)
delta
=
vr
[
0
]
-
dr
[
0
]
-
value
delta
=
(
cur
-
value
)
*
(
destwidth
-
viewwidth
)
/
32767
#cur = (32767 * viewoffset) / (destwidth - viewwidth)
if
abs
(
delta
-
viewoffset
)
<=
2
:
#delta = (cur-value)*(destwidth - viewwidth)/32767
# compensate for irritating rounding error
#if abs(delta - viewoffset) <=2:
delta
=
viewoffset
# # compensate for irritating rounding error
# delta = viewoffset
delta
=
min
(
maxdelta
,
delta
)
delta
=
min
(
maxdelta
,
delta
)
delta
=
max
(
mindelta
,
delta
)
delta
=
max
(
mindelta
,
delta
)
self
.
ted
.
WEScroll
(
delta
,
0
)
self
.
ted
.
WEScroll
(
delta
,
0
)
...
@@ -923,6 +922,7 @@ class PyEditor(TextEditor):
...
@@ -923,6 +922,7 @@ class PyEditor(TextEditor):
if
autoscroll
:
if
autoscroll
:
self
.
ted
.
WEFeatureFlag
(
WASTEconst
.
weFAutoScroll
,
0
)
self
.
ted
.
WEFeatureFlag
(
WASTEconst
.
weFAutoScroll
,
0
)
self
.
ted
.
WESetSelection
(
count
,
count
+
1
)
self
.
ted
.
WESetSelection
(
count
,
count
+
1
)
Qd
.
QDFlushPortBuffer
(
self
.
_parentwindow
.
wid
,
None
)
# needed under OSX
time
.
sleep
(
0.2
)
time
.
sleep
(
0.2
)
self
.
ted
.
WESetSelection
(
selstart
,
selend
)
self
.
ted
.
WESetSelection
(
selstart
,
selend
)
if
autoscroll
:
if
autoscroll
:
...
...
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