]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/wxStyledTextCtrl_1.py
fix Union(empty rect) bug
[wxWidgets.git] / wxPython / demo / wxStyledTextCtrl_1.py
index 4cbdddfecba8a7624f03a3beed39e72ccdcda6b1..e0964cf78a367a2f9a071c65cfcb237ddab87e56 100644 (file)
@@ -60,6 +60,14 @@ 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):
+        # This is how the clipboard contents can be preserved after
+        # the app has exited.
+        wxTheClipboard.Flush()
+        evt.Skip()
+
 
     def OnStartDrag(self, evt):
         self.log.write("OnStartDrag: %d, %s\n"
@@ -146,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)
@@ -243,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
 
 
@@ -263,17 +273,8 @@ be helpful.
 """
 
 
-
-## if __name__ == '__main__':
-##     import sys
-##     app = wxPySimpleApp()
-##     frame = wxFrame(None, -1, "Tester...", size=(640, 480))
-##     win = runTest(frame, frame, sys.stdout)
-##     frame.Show(true)
-##     app.MainLoop()
-
-
 if __name__ == '__main__':
+    import sys,os
     import run
-    run.main(['', 'wxStyledTextCtrl_1'])
+    run.main(['', os.path.basename(sys.argv[0])])