Kaydet (Commit) c9c0dd34 authored tarafından Jack Jansen's avatar Jack Jansen

Fixed ttedit to actually work

Fixed minor update bug in tlist
üst cef2c597
...@@ -19,20 +19,16 @@ class ListWindow(Window): ...@@ -19,20 +19,16 @@ class ListWindow(Window):
r = (40, 40, 400, 300) r = (40, 40, 400, 300)
w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555)
r2 = (0, 0, 345, 245) r2 = (0, 0, 345, 245)
Qd.SetPort(w)
self.wid = w
self.list = List.LNew(r2, (0, 0, 1, 1), (0,0), 0, w, 0, 1, 1, 1) self.list = List.LNew(r2, (0, 0, 1, 1), (0,0), 0, w, 0, 1, 1, 1)
self.filllist() self.filllist()
w.DrawGrowIcon() w.DrawGrowIcon()
self.wid = w
self.do_postopen() self.do_postopen()
def do_activate(self, onoff, evt): def do_activate(self, onoff, evt):
self.list.LActivate(onoff) self.list.LActivate(onoff)
def do_rawupdate(self, window, event):
window.BeginUpdate()
self.do_update(window, event)
window.EndUpdate()
def do_update(self, *args): def do_update(self, *args):
self.list.LUpdate(self.wid.GetWindowPort().visRgn) self.list.LUpdate(self.wid.GetWindowPort().visRgn)
......
...@@ -19,6 +19,7 @@ class TEWindow(Window): ...@@ -19,6 +19,7 @@ class TEWindow(Window):
r2 = (0, 0, 345, 245) r2 = (0, 0, 345, 245)
Qd.SetPort(w) Qd.SetPort(w)
self.ted = TE.TENew(r2, r2) self.ted = TE.TENew(r2, r2)
self.ted.TEAutoView(1)
w.DrawGrowIcon() w.DrawGrowIcon()
self.wid = w self.wid = w
self.do_postopen() self.do_postopen()
...@@ -32,21 +33,16 @@ class TEWindow(Window): ...@@ -32,21 +33,16 @@ class TEWindow(Window):
else: else:
self.ted.TEDeactivate() self.ted.TEDeactivate()
def do_rawupdate(self, window, event): def do_update(self, wid, event):
window.BeginUpdate() Qd.EraseRect(wid.GetWindowPort().portRect)
self.do_update(window, event) self.ted.TEUpdate(wid.GetWindowPort().portRect)
window.EndUpdate()
def do_update(self, *args):
Qd.EraseRect(self.wid.GetWindowPort().portRect)
self.ted.TEUpdate(self.wid.GetWindowPort().portRect)
def do_contentclick(self, local, modifiers, evt): def do_contentclick(self, local, modifiers, evt):
shifted = (modifiers & 0x200) shifted = (modifiers & 0x200)
self.ted.TEClick(local, shifted) self.ted.TEClick(local, shifted)
def do_char(self, ch, event): def do_char(self, ch, event):
self.ted.TEKey(ch) self.ted.TEKey(ord(ch))
class TestList(Application): class TestList(Application):
def __init__(self): def __init__(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment