demo tweaks

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-07-11 20:41:21 +00:00
parent 47b2f647b9
commit 63b6646e5d
10 changed files with 73 additions and 43 deletions

View File

@@ -60,10 +60,13 @@ class MySTC(wxStyledTextCtrl):
EVT_STC_START_DRAG(self, ID, self.OnStartDrag)
EVT_STC_MODIFIED(self, ID, self.OnModified)
## EVT_WINDOW_DESTROY(self, self.OnDestroy)
## def OnDestroy(self, evt):
## wxTheClipboard.Flush()
## evt.Skip()
EVT_WINDOW_DESTROY(self, self.OnDestroy)
def OnDestroy(self, evt):
# This is how the clipboard contents can be preserved after
# the app has exited.
wxTheClipboard.Flush()
evt.Skip()
def OnStartDrag(self, evt):
@@ -151,7 +154,7 @@ def runTest(frame, nb, log):
ed = p = MySTC(nb, -1, log)
else:
p = wxPanel(nb, -1)
p = wxPanel(nb, -1, style=wxNO_FULL_REPAINT_ON_RESIZE)
ed = MySTC(p, -1, log)
s = wxBoxSizer(wxHORIZONTAL)
s.Add(ed, 1, wxEXPAND)
@@ -248,10 +251,12 @@ def runTest(frame, nb, log):
ed.SetSelection(25, 35)
print "GetSelectedText(): ", repr(ed.GetSelectedText())
print "GetTextRange(25, 35): ", repr(ed.GetTextRange(25, 35))
print "FindText(0, max, 'indicators'): ",
print ed.FindText(0, ed.GetTextLength(), "indicators")
ed.GotoPos(0)
return p