Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 362c7cd

Browse files
committed
Lots of minor tweaks for the pep252 checkins, mainly because Qd
attributes are no longer supported.
1 parent 202355a commit 362c7cd

25 files changed

Lines changed: 60 additions & 61 deletions

Mac/Contrib/ImageHelpers/MovieUtils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def Blit(self,destRect):
124124

125125
#Qd.MoveTo(10,10)
126126
#Qd.LineTo(200,150)
127-
Qd.CopyBits(self.gw.portBits,Qd.GetPort().portBits,self.myRect,destRect,srcCopy,None)
127+
Qd.CopyBits(self.gw.GetPortBitMapForCopyBits(),Qd.GetPort().GetPortBitMapForCopyBits(),self.myRect,destRect,srcCopy,None)
128128

129129
class MovieWin(W.Window):
130130

Mac/Demo/PICTbrowse/ICONbrowse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def do_update(self, *args):
9393
def fitrect(self):
9494
"""Return self.pictrect scaled to fit in window"""
9595
graf = self.wid.GetWindowPort()
96-
screenrect = graf.portRect
96+
screenrect = graf.GetPortBounds()
9797
picwidth = self.pictrect[2] - self.pictrect[0]
9898
picheight = self.pictrect[3] - self.pictrect[1]
9999
if picwidth > screenrect[2] - screenrect[0]:

Mac/Demo/PICTbrowse/PICTbrowse2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def do_update(self, *args):
9393
def fitrect(self):
9494
"""Return self.pictrect scaled to fit in window"""
9595
graf = self.dlg.GetWindowPort()
96-
screenrect = graf.portRect
96+
screenrect = graf.GetPortBounds()
9797
picwidth = self.pictrect[2] - self.pictrect[0]
9898
picheight = self.pictrect[3] - self.pictrect[1]
9999
if picwidth > screenrect[2] - screenrect[0]:

Mac/Demo/PICTbrowse/cicnbrowse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def do_update(self, *args):
9393
def fitrect(self):
9494
"""Return self.pictrect scaled to fit in window"""
9595
graf = self.wid.GetWindowPort()
96-
screenrect = graf.portRect
96+
screenrect = graf.GetPortBounds()
9797
picwidth = self.pictrect[2] - self.pictrect[0]
9898
picheight = self.pictrect[3] - self.pictrect[1]
9999
if picwidth > screenrect[2] - screenrect[0]:

Mac/Demo/imgbrowse/imgbrowse.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""imgbrowse - Display pictures using img"""
1+
GetPortBounds()"""imgbrowse - Display pictures using img"""
22

33
import FrameWork
44
import EasyDialogs
@@ -88,16 +88,16 @@ def do_update(self, *args):
8888
currect = self.fitrect()
8989
print 'PICT:', self.pictrect
9090
print 'WIND:', currect
91-
print 'ARGS:', (self.pixmap, self.wid.GetWindowPort().portBits, self.pictrect,
91+
print 'ARGS:', (self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect,
9292
currect, QuickDraw.srcCopy, None)
9393
self.info()
94-
Qd.CopyBits(self.pixmap, self.wid.GetWindowPort().portBits, self.pictrect,
94+
Qd.CopyBits(self.pixmap, self.wid.GetWindowPort().GetPortBitMapForCopyBits(), self.pictrect,
9595
currect, QuickDraw.srcCopy, None)
9696

9797
def fitrect(self):
9898
"""Return self.pictrect scaled to fit in window"""
9999
graf = self.wid.GetWindowPort()
100-
screenrect = graf.portRect
100+
screenrect = graf.GetPortBounds()
101101
picwidth = self.pictrect[2] - self.pictrect[0]
102102
picheight = self.pictrect[3] - self.pictrect[1]
103103
if picwidth > screenrect[2] - screenrect[0]:
@@ -113,7 +113,7 @@ def fitrect(self):
113113

114114
def info(self):
115115
graf = self.wid.GetWindowPort()
116-
bits = graf.portBits
116+
bits = graf.GetPortBitMapForCopyBits()
117117
mac_image.dumppixmap(bits.pixmap_data)
118118

119119
main()

Mac/Demo/mlte/mlted.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def idle(self, event):
362362
if self.active:
363363
self.active.do_idle(event)
364364
else:
365-
Qd.SetCursor(Qd.qd.arrow)
365+
Qd.SetCursor(Qd.GetQDGlobalsArrow())
366366

367367
def main():
368368
Mlte.TXNInitTextension(0)

Mac/Demo/quicktime/MovieInWindow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def main():
3131
Qd.SetPort(theWindow)
3232
# XXXX Needed? SetGWorld((CGrafPtr)theWindow, nil)
3333

34-
playMovieInWindow(theWindow, fss, theWindow.GetWindowPort().portRect)
34+
playMovieInWindow(theWindow, fss, theWindow.GetWindowPort().GetPortBounds())
3535

3636
def playMovieInWindow(theWindow, theFile, movieBox):
3737
"""Play a movie in a window"""

Mac/Demo/quicktime/VerySimplePlayer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def main():
7878
else:
7979
Qd.SetPort(whichWindow)
8080
whichWindow.BeginUpdate()
81-
Qd.EraseRect(whichWindow.GetWindowPort().portRect)
81+
Qd.EraseRect(whichWindow.GetWindowPort().GetPortBounds())
8282
whichWindow.EndUpdate()
8383

8484
def loadMovie(theFile):

Mac/Demo/textedit/ped.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def open(self, path, name, data):
2121
r = windowbounds(400, 400)
2222
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0)
2323
self.wid = w
24-
x0, y0, x1, y1 = self.wid.GetWindowPort().portRect
24+
x0, y0, x1, y1 = self.wid.GetWindowPort().GetPortBounds()
2525
x0 = x0 + 4
2626
y0 = y0 + 4
2727
x1 = x1 - 20
@@ -87,8 +87,8 @@ def do_activate(self, onoff, evt):
8787
self.ted.TEDeactivate()
8888

8989
def do_update(self, wid, event):
90-
Qd.EraseRect(wid.GetWindowPort().portRect)
91-
self.ted.TEUpdate(wid.GetWindowPort().portRect)
90+
Qd.EraseRect(wid.GetWindowPort().GetPortBounds())
91+
self.ted.TEUpdate(wid.GetWindowPort().GetPortBounds())
9292
self.updatescrollbars()
9393

9494
def do_contentclick(self, local, modifiers, evt):
@@ -350,7 +350,7 @@ def idle(self, *args):
350350
if self.active:
351351
self.active.do_idle()
352352
else:
353-
Qd.SetCursor(Qd.qd.arrow)
353+
Qd.SetCursor(Qd.GetQDGlobalsArrow())
354354

355355
def main():
356356
App = Ped()

Mac/Demo/waste/htmled.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def do_idle(self, event):
9595
self.ted.WEIdle()
9696
if self.ted.WEAdjustCursor(where, BIGREGION):
9797
return
98-
Qd.SetCursor(Qd.qd.arrow)
98+
Qd.SetCursor(Qd.GetQDGlobalsArrow())
9999

100100
def getscrollbarvalues(self):
101101
dr = self.ted.WEGetDestRect()
@@ -780,7 +780,7 @@ def idle(self, event):
780780
if self.active:
781781
self.active.do_idle(event)
782782
else:
783-
Qd.SetCursor(Qd.qd.arrow)
783+
Qd.SetCursor(Qd.GetQDGlobalsArrow())
784784

785785
def newRuler(self, obj):
786786
"""Insert a new ruler. Make it as wide as the window minus 2 pxls"""

0 commit comments

Comments
 (0)