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

Skip to content

Commit 7302340

Browse files
committed
Sigh... First test before committing. InvalWindowRect and friends are window object methods. Fixed.
1 parent 43bb2a4 commit 7302340

14 files changed

Lines changed: 55 additions & 48 deletions

File tree

Mac/Demo/waste/htmled.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def do_postresize(self, width, height, window):
194194
l, t, r, b = self.ted.WEGetViewRect()
195195
vr = (l, t, l+width-15, t+height-15)
196196
self.ted.WESetViewRect(vr)
197-
Win.InvalWindowRect(vr)
197+
self.wid.InvalWindowRect(vr)
198198
ScrolledWindow.do_postresize(self, width, height, window)
199199

200200
def do_contentclick(self, local, modifiers, evt):
@@ -290,7 +290,7 @@ def menu_insert_html(self, fp):
290290
self.ted.WESetSelection(start, end)
291291
self.ted.WESelView()
292292
self.ted.WEFeatureFlag(WASTEconst.weFInhibitRecal, 0)
293-
Win.InvalWindowRect(self.ted.WEGetViewRect())
293+
self.wid.InvalWindowRect(self.ted.WEGetViewRect())
294294

295295
self.updatescrollbars()
296296
self.parent.updatemenubar()

Mac/Demo/waste/swed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def do_postresize(self, width, height, window):
163163
l, t, r, b = self.ted.WEGetViewRect()
164164
vr = (l, t, l+width-15, t+height-15)
165165
self.ted.WESetViewRect(vr)
166-
Win.InvalWindowRect(vr)
166+
self.wid.InvalWindowRect(vr)
167167
ScrolledWindow.do_postresize(self, width, height, window)
168168

169169
def do_contentclick(self, local, modifiers, evt):

Mac/Demo/waste/wed.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def do_postresize(self, width, height, window):
136136
l, t, r, b = self.ted.WEGetViewRect()
137137
vr = (l, t, l+width-15, t+height-15)
138138
self.ted.WESetViewRect(vr)
139-
Win.InvalWindowRect(vr)
139+
self.wid.InvalWindowRect(vr)
140140
ScrolledWindow.do_postresize(self, width, height, window)
141141

142142
def do_contentclick(self, local, modifiers, evt):

Mac/Lib/FrameWork.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,9 @@ def do_postclose(self):
713713
def SetPort(self):
714714
# Convinience method
715715
SetPort(self.wid)
716+
717+
def GetWindow(self):
718+
return self.wid
716719

717720
def do_inDrag(self, partcode, window, event):
718721
where = event[3]
@@ -753,13 +756,13 @@ def do_inGrow(self, partcode, window, event):
753756
def do_resize(self, width, height, window):
754757
l, t, r, b = self.wid.GetWindowPort().portRect # jvr, forGrowIcon
755758
self.SetPort() # jvr
756-
InvalWindowRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr
759+
self.wid.InvalWindowRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr
757760
window.SizeWindow(width, height, 1) # changed updateFlag to true jvr
758761
self.do_postresize(width, height, window)
759762

760763
def do_postresize(self, width, height, window):
761764
SetPort(window)
762-
InvalWindowRect(window.GetWindowPort().portRect)
765+
self.wid.InvalWindowRect(window.GetWindowPort().portRect)
763766

764767
def do_inContent(self, partcode, window, event):
765768
#
@@ -853,12 +856,12 @@ def scrollbars(self, wantx=1, wanty=1):
853856
rect = x0-1, y1-(SCROLLBARWIDTH-1), x1-(SCROLLBARWIDTH-2), y1+1
854857
self.barx = NewControl(self.wid, rect, "", 1, vx, 0, 32767, 16, 0)
855858
if not self.barx_enabled: self.barx.HiliteControl(255)
856-
## InvalWindowRect(rect)
859+
## self.wid.InvalWindowRect(rect)
857860
if wanty:
858861
rect = x1-(SCROLLBARWIDTH-1), y0-1, x1+1, y1-(SCROLLBARWIDTH-2)
859862
self.bary = NewControl(self.wid, rect, "", 1, vy, 0, 32767, 16, 0)
860863
if not self.bary_enabled: self.bary.HiliteControl(255)
861-
## InvalWindowRect(rect)
864+
## self.wid.InvalWindowRect(rect)
862865

863866
def do_postclose(self):
864867
self.barx = self.bary = None
@@ -893,11 +896,11 @@ def do_postresize(self, width, height, window):
893896
self.bary.SizeControl(SCROLLBARWIDTH, (b-t)-(SCROLLBARWIDTH-3)) # jvr
894897
if self.barx:
895898
self.barx.ShowControl() # jvr
896-
ValidWindowRect((l, b - SCROLLBARWIDTH + 1, r - SCROLLBARWIDTH + 2, b)) # jvr
899+
self.wid.ValidWindowRect((l, b - SCROLLBARWIDTH + 1, r - SCROLLBARWIDTH + 2, b)) # jvr
897900
if self.bary:
898901
self.bary.ShowControl() # jvr
899-
ValidWindowRect((r - SCROLLBARWIDTH + 1, t, r, b - SCROLLBARWIDTH + 2)) # jvr
900-
InvalWindowRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr, growicon
902+
self.wid.ValidWindowRect((r - SCROLLBARWIDTH + 1, t, r, b - SCROLLBARWIDTH + 2)) # jvr
903+
self.wid.InvalWindowRect((r - SCROLLBARWIDTH + 1, b - SCROLLBARWIDTH + 1, r, b)) # jvr, growicon
901904

902905

903906
def do_rawcontrolhit(self, window, control, pcode, local, event):

Mac/Lib/test/tscrollwin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def scrollbar_callback(self, which, what, value):
4747
self.vy = value
4848
else:
4949
self.vy = self.vy + delta
50-
Win.InvalWindowRect(self.ourrect)
50+
self.wid.InvalWindowRect(self.ourrect)
5151

5252
def do_update(self, wid, event):
5353
Qd.EraseRect(self.ourrect)

Mac/Tools/IDE/PyEdit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -957,7 +957,7 @@ def replaceall(self):
957957
editor.ted.WEUseText(Res.Resource(Text))
958958
editor.ted.WECalText()
959959
editor.SetPort()
960-
Win.InvalWindowRect(editor._bounds)
960+
editor.GetWindow().InvalWindowRect(editor._bounds)
961961
#editor.ted.WEUpdate(self.w.wid.GetWindowPort().visRgn)
962962
EasyDialogs.Message("Replaced %d occurrences" % counter)
963963

Mac/Tools/IDE/Splash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def UpdateSplash(drawdialog = 0, what = 0):
100100
if drawdialog:
101101
splash.DrawDialog()
102102
drawtext(what)
103-
Win.ValidWindowRect(splash.GetWindowPort().portRect)
103+
splash.GetDialogWindow().ValidWindowRect(splash.GetDialogPort().portRect)
104104

105105
def drawtext(what = 0):
106106
Qd.SetPort(splash)

Mac/Tools/IDE/Wbase.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ def bind(self, key, callback):
104104

105105
def adjust(self, oldbounds):
106106
self.SetPort()
107-
Win.InvalWindowRect(oldbounds)
108-
Win.InvalWindowRect(self._bounds)
107+
self.GetWindow().InvalWindowRect(oldbounds)
108+
self.GetWindow().InvalWindowRect(self._bounds)
109109

110110
def _calcbounds(self):
111111
# calculate absolute bounds relative to the window origin from our
@@ -218,7 +218,7 @@ def _addwidget(self, key, widget):
218218
self._setparentwindow(widget)
219219
if self._parentwindow and self._parentwindow.wid:
220220
widget.forall_frombottom("open")
221-
Win.InvalWindowRect(widget._bounds)
221+
self.GetWindow().InvalWindowRect(widget._bounds)
222222

223223
def _setparentwindow(self, widget):
224224
widget._parentwindow = self._parentwindow
@@ -235,7 +235,7 @@ def _removewidget(self, key):
235235
widget.select(0)
236236
self._parentwindow._currentwidget = None
237237
self.SetPort()
238-
Win.InvalWindowRect(widget._bounds)
238+
self.GetWindow().InvalWindowRect(widget._bounds)
239239
widget.close()
240240
del self._widgetsdict[key]
241241
self._widgets.remove(widget)
@@ -274,7 +274,11 @@ def __delitem__(self, key):
274274

275275
def SetPort(self):
276276
self._parentwindow.SetPort()
277-
277+
278+
279+
def GetWindow(self):
280+
return self._parentwindow.GetWindow()
281+
278282
def __del__(self):
279283
if DEBUG:
280284
print "%s instance deleted" % self.__class__.__name__
@@ -340,11 +344,11 @@ def drawselframe(self, onoff):
340344
def adjust(self, oldbounds):
341345
self.SetPort()
342346
if self._selected:
343-
Win.InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3))
344-
Win.InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3))
347+
self.GetWindow().InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3))
348+
self.GetWindow().InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3))
345349
else:
346-
Win.InvalWindowRect(oldbounds)
347-
Win.InvalWindowRect(self._bounds)
350+
self.GetWindow().InvalWindowRect(oldbounds)
351+
self.GetWindow().InvalWindowRect(self._bounds)
348352

349353

350354
class _Line(Widget):

Mac/Tools/IDE/Wcontrols.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def open(self):
3232
self._procID,
3333
0)
3434
self.SetPort()
35-
#Win.ValidWindowRect(self._bounds)
35+
#self.GetWindow().ValidWindowRect(self._bounds)
3636
self.enable(self._enabled)
3737

3838
def adjust(self, oldbounds):
@@ -43,7 +43,7 @@ def adjust(self, oldbounds):
4343
if self._visible:
4444
Qd.EraseRect(self._bounds)
4545
self._control.ShowControl()
46-
Win.ValidWindowRect(self._bounds)
46+
self.GetWindow().ValidWindowRect(self._bounds)
4747

4848
def close(self):
4949
self._control.HideControl()
@@ -162,8 +162,8 @@ def adjust(self, oldbounds):
162162
old = Qd.InsetRect(oldbounds, -4, -4)
163163
new = Qd.InsetRect(self._bounds, -4, -4)
164164
Qd.EraseRect(old)
165-
Win.InvalWindowRect(old)
166-
Win.InvalWindowRect(new)
165+
self.GetWindow().InvalWindowRect(old)
166+
self.GetWindow().InvalWindowRect(new)
167167
ControlWidget.adjust(self, oldbounds)
168168

169169

@@ -346,7 +346,7 @@ def draw(self, visRgn = None):
346346

347347
def adjust(self, oldbounds):
348348
self.SetPort()
349-
Win.InvalWindowRect(oldbounds)
349+
self.GetWindow().InvalWindowRect(oldbounds)
350350
self._control.HideControl()
351351
self._control.MoveControl(self._bounds[0], self._bounds[1])
352352
self._control.SizeControl(self._bounds[2] - self._bounds[0], self._bounds[3] - self._bounds[1])
@@ -356,7 +356,7 @@ def adjust(self, oldbounds):
356356
self._control.ShowControl()
357357
else:
358358
Qd.FrameRect(self._bounds)
359-
Win.ValidWindowRect(self._bounds)
359+
self.GetWindow().ValidWindowRect(self._bounds)
360360

361361
def activate(self, onoff):
362362
self._activated = onoff
@@ -366,7 +366,7 @@ def activate(self, onoff):
366366
else:
367367
self._control.HideControl()
368368
self.draw(None)
369-
Win.ValidWindowRect(self._bounds)
369+
self.GetWindow().ValidWindowRect(self._bounds)
370370

371371
def set(self, value):
372372
if self._control:

Mac/Tools/IDE/Wlists.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ def createlist(self):
5757
def adjust(self, oldbounds):
5858
self.SetPort()
5959
if self._selected:
60-
Win.InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3))
61-
Win.InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3))
60+
self.GetWindow().InvalWindowRect(Qd.InsetRect(oldbounds, -3, -3))
61+
self.GetWindow().InvalWindowRect(Qd.InsetRect(self._bounds, -3, -3))
6262
else:
63-
Win.InvalWindowRect(oldbounds)
64-
Win.InvalWindowRect(self._bounds)
63+
self.GetWindow().InvalWindowRect(oldbounds)
64+
self.GetWindow().InvalWindowRect(self._bounds)
6565
if oldbounds[:2] == self._bounds[:2]:
6666
# set visRgn to empty, to prevent nasty drawing side effect of LSize()
6767
Qd.RectRgn(self._parentwindow.wid.GetWindowPort().visRgn, (0, 0, 0, 0))
@@ -359,7 +359,7 @@ def setdrawingmode(self, onoff):
359359
self.SetPort()
360360
Qd.EraseRect((l, cb, cr, b))
361361
self._list.LUpdate(self._parentwindow.wid.GetWindowPort().visRgn)
362-
Win.ValidWindowRect(bounds)
362+
self.GetWindow().ValidWindowRect(bounds)
363363
else:
364364
if self.drawingmode == 0 and self._list is not None:
365365
self._list.LSetDrawingMode(0)

0 commit comments

Comments
 (0)