From d829e9e8e319dfb7f6ac04c4b4b4c25f544064c0 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Tue, 23 Jan 2001 14:34:49 +0000 Subject: [PATCH] Replaced InvalRect and friends with the Carbon-compliant InvalWindowRect. --- Mac/Demo/PICTbrowse/oldPICTbrowse.py | 2 +- Mac/Demo/waste/htmled.py | 4 ++-- Mac/Demo/waste/swed.py | 2 +- Mac/Demo/waste/wed.py | 2 +- Mac/Lib/FrameWork.py | 14 +++++++------- Mac/Lib/test/tscrollwin.py | 2 +- Mac/Tools/IDE/PyEdit.py | 2 +- Mac/Tools/IDE/Splash.py | 2 +- Mac/Tools/IDE/Wbase.py | 16 ++++++++-------- Mac/Tools/IDE/Wcontrols.py | 14 +++++++------- Mac/Tools/IDE/Wlists.py | 10 +++++----- Mac/Tools/IDE/Wquicktime.py | 8 ++++---- Mac/Tools/IDE/Wtext.py | 10 +++++----- Mac/Tools/IDE/Wwindows.py | 6 +++--- Mac/scripts/MkDistr_ui.py | 2 +- 15 files changed, 48 insertions(+), 48 deletions(-) diff --git a/Mac/Demo/PICTbrowse/oldPICTbrowse.py b/Mac/Demo/PICTbrowse/oldPICTbrowse.py index 70b910e7d0d..72a29def63f 100644 --- a/Mac/Demo/PICTbrowse/oldPICTbrowse.py +++ b/Mac/Demo/PICTbrowse/oldPICTbrowse.py @@ -24,7 +24,7 @@ def main(): dummy = Res.GetResource('DLOG', ID_MAIN) except Res.Error: try: - Res.OpenResFile("oldPICTbrowse.rsrc") + Res.FSpOpenResFile("oldPICTbrowse.rsrc", 0) except Res.Error, arg: EasyDialogs.Message("Cannot open PICTbrowse.rsrc: "+arg[1]) sys.exit(1) diff --git a/Mac/Demo/waste/htmled.py b/Mac/Demo/waste/htmled.py index c6ae2e73a2c..ec6f58b9730 100644 --- a/Mac/Demo/waste/htmled.py +++ b/Mac/Demo/waste/htmled.py @@ -194,7 +194,7 @@ def do_postresize(self, width, height, window): l, t, r, b = self.ted.WEGetViewRect() vr = (l, t, l+width-15, t+height-15) self.ted.WESetViewRect(vr) - Win.InvalRect(vr) + Win.InvalWindowRect(vr) ScrolledWindow.do_postresize(self, width, height, window) def do_contentclick(self, local, modifiers, evt): @@ -290,7 +290,7 @@ def menu_insert_html(self, fp): self.ted.WESetSelection(start, end) self.ted.WESelView() self.ted.WEFeatureFlag(WASTEconst.weFInhibitRecal, 0) - Win.InvalRect(self.ted.WEGetViewRect()) + Win.InvalWindowRect(self.ted.WEGetViewRect()) self.updatescrollbars() self.parent.updatemenubar() diff --git a/Mac/Demo/waste/swed.py b/Mac/Demo/waste/swed.py index 473d777bc17..cfaae9df88b 100644 --- a/Mac/Demo/waste/swed.py +++ b/Mac/Demo/waste/swed.py @@ -163,7 +163,7 @@ def do_postresize(self, width, height, window): l, t, r, b = self.ted.WEGetViewRect() vr = (l, t, l+width-15, t+height-15) self.ted.WESetViewRect(vr) - Win.InvalRect(vr) + Win.InvalWindowRect(vr) ScrolledWindow.do_postresize(self, width, height, window) def do_contentclick(self, local, modifiers, evt): diff --git a/Mac/Demo/waste/wed.py b/Mac/Demo/waste/wed.py index c56ce2b6f7b..276bd72a1da 100644 --- a/Mac/Demo/waste/wed.py +++ b/Mac/Demo/waste/wed.py @@ -136,7 +136,7 @@ def do_postresize(self, width, height, window): l, t, r, b = self.ted.WEGetViewRect() vr = (l, t, l+width-15, t+height-15) self.ted.WESetViewRect(vr) - Win.InvalRect(vr) + Win.InvalWindowRect(vr) ScrolledWindow.do_postresize(self, width, height, window) def do_contentclick(self, local, modifiers, evt): diff --git a/Mac/Lib/FrameWork.py b/Mac/Lib/FrameWork.py index 2d75965db01..733e94e5547 100644 --- a/Mac/Lib/FrameWork.py +++ b/Mac/Lib/FrameWork.py @@ -753,13 +753,13 @@ def do_inGrow(self, partcode, window, event): def do_resize(self, width, height, window): l, t, r, b = self.wid.GetWindowPort().portRect # jvr, forGrowIcon self.SetPort() # jvr - InvalRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr + InvalWindowRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr window.SizeWindow(width, height, 1) # changed updateFlag to true jvr self.do_postresize(width, height, window) def do_postresize(self, width, height, window): SetPort(window) - InvalRect(window.GetWindowPort().portRect) + InvalWindowRect(window.GetWindowPort().portRect) def do_inContent(self, partcode, window, event): # @@ -853,12 +853,12 @@ def scrollbars(self, wantx=1, wanty=1): 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) +## InvalWindowRect(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) +## InvalWindowRect(rect) def do_postclose(self): self.barx = self.bary = None @@ -893,11 +893,11 @@ def do_postresize(self, width, height, window): self.bary.SizeControl(SCROLLBARWIDTH, (b-t)-(SCROLLBARWIDTH-3)) # jvr if self.barx: self.barx.ShowControl() # jvr - ValidRect((l, b - SCROLLBARWIDTH + 1, r - SCROLLBARWIDTH + 2, b)) # jvr + ValidWindowRect((l, b - SCROLLBARWIDTH + 1, r - SCROLLBARWIDTH + 2, b)) # jvr if self.bary: self.bary.ShowControl() # jvr - ValidRect((r - SCROLLBARWIDTH + 1, t, r, b - SCROLLBARWIDTH + 2)) # jvr - InvalRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr, growicon + ValidWindowRect((r - SCROLLBARWIDTH + 1, t, r, b - SCROLLBARWIDTH + 2)) # jvr + InvalWindowRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr, growicon def do_rawcontrolhit(self, window, control, pcode, local, event): diff --git a/Mac/Lib/test/tscrollwin.py b/Mac/Lib/test/tscrollwin.py index 40e9d67b646..d91f6b91da5 100644 --- a/Mac/Lib/test/tscrollwin.py +++ b/Mac/Lib/test/tscrollwin.py @@ -47,7 +47,7 @@ def scrollbar_callback(self, which, what, value): self.vy = value else: self.vy = self.vy + delta - Win.InvalRect(self.ourrect) + Win.InvalWindowRect(self.ourrect) def do_update(self, wid, event): Qd.EraseRect(self.ourrect) diff --git a/Mac/Tools/IDE/PyEdit.py b/Mac/Tools/IDE/PyEdit.py index 59cf7add19c..c18e31f9e22 100644 --- a/Mac/Tools/IDE/PyEdit.py +++ b/Mac/Tools/IDE/PyEdit.py @@ -957,7 +957,7 @@ def replaceall(self): editor.ted.WEUseText(Res.Resource(Text)) editor.ted.WECalText() editor.SetPort() - Win.InvalRect(editor._bounds) + Win.InvalWindowRect(editor._bounds) #editor.ted.WEUpdate(self.w.wid.GetWindowPort().visRgn) EasyDialogs.Message("Replaced %d occurrences" % counter) diff --git a/Mac/Tools/IDE/Splash.py b/Mac/Tools/IDE/Splash.py index 21acd6d0794..1544b674d4a 100644 --- a/Mac/Tools/IDE/Splash.py +++ b/Mac/Tools/IDE/Splash.py @@ -100,7 +100,7 @@ def UpdateSplash(drawdialog = 0, what = 0): if drawdialog: splash.DrawDialog() drawtext(what) - Win.ValidRect(splash.GetWindowPort().portRect) + Win.ValidWindowRect(splash.GetWindowPort().portRect) def drawtext(what = 0): Qd.SetPort(splash) diff --git a/Mac/Tools/IDE/Wbase.py b/Mac/Tools/IDE/Wbase.py index e1e71b2d7cd..0a987c6105e 100644 --- a/Mac/Tools/IDE/Wbase.py +++ b/Mac/Tools/IDE/Wbase.py @@ -104,8 +104,8 @@ def bind(self, key, callback): def adjust(self, oldbounds): self.SetPort() - Win.InvalRect(oldbounds) - Win.InvalRect(self._bounds) + Win.InvalWindowRect(oldbounds) + Win.InvalWindowRect(self._bounds) def _calcbounds(self): # calculate absolute bounds relative to the window origin from our @@ -218,7 +218,7 @@ def _addwidget(self, key, widget): self._setparentwindow(widget) if self._parentwindow and self._parentwindow.wid: widget.forall_frombottom("open") - Win.InvalRect(widget._bounds) + Win.InvalWindowRect(widget._bounds) def _setparentwindow(self, widget): widget._parentwindow = self._parentwindow @@ -235,7 +235,7 @@ def _removewidget(self, key): widget.select(0) self._parentwindow._currentwidget = None self.SetPort() - Win.InvalRect(widget._bounds) + Win.InvalWindowRect(widget._bounds) widget.close() del self._widgetsdict[key] self._widgets.remove(widget) @@ -340,11 +340,11 @@ def drawselframe(self, onoff): def adjust(self, oldbounds): self.SetPort() if self._selected: - Win.InvalRect(Qd.InsetRect(oldbounds, -3, -3)) - Win.InvalRect(Qd.InsetRect(self._bounds, -3, -3)) + Win.InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3)) + Win.InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3)) else: - Win.InvalRect(oldbounds) - Win.InvalRect(self._bounds) + Win.InvalWindowRect(oldbounds) + Win.InvalWindowRect(self._bounds) class _Line(Widget): diff --git a/Mac/Tools/IDE/Wcontrols.py b/Mac/Tools/IDE/Wcontrols.py index 7add904ff21..1a0fe88f72d 100644 --- a/Mac/Tools/IDE/Wcontrols.py +++ b/Mac/Tools/IDE/Wcontrols.py @@ -32,7 +32,7 @@ def open(self): self._procID, 0) self.SetPort() - #Win.ValidRect(self._bounds) + #Win.ValidWindowRect(self._bounds) self.enable(self._enabled) def adjust(self, oldbounds): @@ -43,7 +43,7 @@ def adjust(self, oldbounds): if self._visible: Qd.EraseRect(self._bounds) self._control.ShowControl() - Win.ValidRect(self._bounds) + Win.ValidWindowRect(self._bounds) def close(self): self._control.HideControl() @@ -162,8 +162,8 @@ def adjust(self, oldbounds): old = Qd.InsetRect(oldbounds, -4, -4) new = Qd.InsetRect(self._bounds, -4, -4) Qd.EraseRect(old) - Win.InvalRect(old) - Win.InvalRect(new) + Win.InvalWindowRect(old) + Win.InvalWindowRect(new) ControlWidget.adjust(self, oldbounds) @@ -346,7 +346,7 @@ def draw(self, visRgn = None): def adjust(self, oldbounds): self.SetPort() - Win.InvalRect(oldbounds) + Win.InvalWindowRect(oldbounds) self._control.HideControl() self._control.MoveControl(self._bounds[0], self._bounds[1]) self._control.SizeControl(self._bounds[2] - self._bounds[0], self._bounds[3] - self._bounds[1]) @@ -356,7 +356,7 @@ def adjust(self, oldbounds): self._control.ShowControl() else: Qd.FrameRect(self._bounds) - Win.ValidRect(self._bounds) + Win.ValidWindowRect(self._bounds) def activate(self, onoff): self._activated = onoff @@ -366,7 +366,7 @@ def activate(self, onoff): else: self._control.HideControl() self.draw(None) - Win.ValidRect(self._bounds) + Win.ValidWindowRect(self._bounds) def set(self, value): if self._control: diff --git a/Mac/Tools/IDE/Wlists.py b/Mac/Tools/IDE/Wlists.py index d9470a89538..08853f484c7 100644 --- a/Mac/Tools/IDE/Wlists.py +++ b/Mac/Tools/IDE/Wlists.py @@ -57,11 +57,11 @@ def createlist(self): def adjust(self, oldbounds): self.SetPort() if self._selected: - Win.InvalRect(Qd.InsetRect(oldbounds, -3, -3)) - Win.InvalRect(Qd.InsetRect(self._bounds, -3, -3)) + Win.InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3)) + Win.InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3)) else: - Win.InvalRect(oldbounds) - Win.InvalRect(self._bounds) + Win.InvalWindowRect(oldbounds) + Win.InvalWindowRect(self._bounds) if oldbounds[:2] == self._bounds[:2]: # set visRgn to empty, to prevent nasty drawing side effect of LSize() Qd.RectRgn(self._parentwindow.wid.GetWindowPort().visRgn, (0, 0, 0, 0)) @@ -359,7 +359,7 @@ def setdrawingmode(self, onoff): self.SetPort() Qd.EraseRect((l, cb, cr, b)) self._list.LUpdate(self._parentwindow.wid.GetWindowPort().visRgn) - Win.ValidRect(bounds) + Win.ValidWindowRect(bounds) else: if self.drawingmode == 0 and self._list is not None: self._list.LSetDrawingMode(0) diff --git a/Mac/Tools/IDE/Wquicktime.py b/Mac/Tools/IDE/Wquicktime.py index a33462a9b68..224fd5ff907 100644 --- a/Mac/Tools/IDE/Wquicktime.py +++ b/Mac/Tools/IDE/Wquicktime.py @@ -24,14 +24,14 @@ def __init__(self, possize): def adjust(self, oldbounds): self.SetPort() - Win.InvalRect(oldbounds) - Win.InvalRect(self._bounds) + Win.InvalWindowRect(oldbounds) + Win.InvalWindowRect(self._bounds) self.calcmoviebox() def set(self, path_or_fss, start = 0): self.SetPort() if self.movie: - #Win.InvalRect(self.movie.GetMovieBox()) + #Win.InvalWindowRect(self.movie.GetMovieBox()) Qd.PaintRect(self.movie.GetMovieBox()) if type(path_or_fss) == type(''): path = path_or_fss @@ -106,7 +106,7 @@ def idle(self, *args): elif self.running: box = self.movie.GetMovieBox() self.SetPort() - Win.InvalRect(box) + Win.InvalWindowRect(box) self.movie = None self.running = 0 diff --git a/Mac/Tools/IDE/Wtext.py b/Mac/Tools/IDE/Wtext.py index ac9d48e8bc4..759a9ea1d26 100644 --- a/Mac/Tools/IDE/Wtext.py +++ b/Mac/Tools/IDE/Wtext.py @@ -213,11 +213,11 @@ def setfontsettings(self, (font, style, size, color)): def adjust(self, oldbounds): self.SetPort() if self._selected and self._parentwindow._hasselframes: - Win.InvalRect(Qd.InsetRect(oldbounds, -3, -3)) - Win.InvalRect(Qd.InsetRect(self._bounds, -3, -3)) + Win.InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3)) + Win.InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3)) else: - Win.InvalRect(oldbounds) - Win.InvalRect(self._bounds) + Win.InvalWindowRect(oldbounds) + Win.InvalWindowRect(self._bounds) viewrect, destrect = self._calctextbounds() self.ted.WESetViewRect(viewrect) self.ted.WESetDestRect(destrect) @@ -305,7 +305,7 @@ def set(self, text): Qd.RectRgn(rgn, viewrect) Qd.EraseRect(viewrect) self.draw(rgn) - #Win.InvalRect(self.ted.WEGetViewRect()) + #Win.InvalWindowRect(self.ted.WEGetViewRect()) self.updatescrollbars() def get(self): diff --git a/Mac/Tools/IDE/Wwindows.py b/Mac/Tools/IDE/Wwindows.py index 37ad47ef816..1ab505630c6 100644 --- a/Mac/Tools/IDE/Wwindows.py +++ b/Mac/Tools/IDE/Wwindows.py @@ -157,7 +157,7 @@ def resize(self, x, y = None): if y == None: x, y = x self.SetPort() - Win.InvalRect(self.getgrowrect()) + Win.InvalWindowRect(self.getgrowrect()) self.wid.SizeWindow(x, y, 1) self._calcbounds() @@ -247,7 +247,7 @@ def previouswidget(self): def drawwidgetbounds(self, onoff): self._drawwidgetbounds = onoff self.SetPort() - Win.InvalRect(self._bounds) + Win.InvalWindowRect(self._bounds) def _drawbounds(self): pass @@ -353,7 +353,7 @@ def do_activate(self, onoff, event): self.draw() def do_postresize(self, width, height, window): - Win.InvalRect(self.getgrowrect()) + Win.InvalWindowRect(self.getgrowrect()) self._calcbounds() def do_inGoAway(self, partcode, window, event): diff --git a/Mac/scripts/MkDistr_ui.py b/Mac/scripts/MkDistr_ui.py index 002e2bd9d9a..6d2f2c2222e 100644 --- a/Mac/scripts/MkDistr_ui.py +++ b/Mac/scripts/MkDistr_ui.py @@ -115,7 +115,7 @@ def setlist(self, contents): self.list.LSetCell(contents[i], (0, i)) self.list.LSetDrawingMode(1) ##self.list.LUpdate(self.wid.GetWindowPort().visRgn) - Win.InvalRect(self.listrect) + Win.InvalWindowRect(self.listrect) def additem(self, item): where = self.list.LAddRow(1, 0)