diff --git a/wxPython/demo/run.py b/wxPython/demo/run.py index fcf5bd9029..24ac322b5b 100755 --- a/wxPython/demo/run.py +++ b/wxPython/demo/run.py @@ -42,6 +42,8 @@ class RunDemoApp(wxApp): wxInitAllImageHandlers() wxLog_SetActiveTarget(wxLogStderr()) + #self.SetAssertMode(wxPYAPP_ASSERT_DIALOG) + frame = wxFrame(None, -1, "RunDemo: " + self.name, pos=(50,50), size=(0,0), style=wxNO_FULL_REPAINT_ON_RESIZE|wxDEFAULT_FRAME_STYLE) frame.CreateStatusBar() diff --git a/wxPython/demo/wxStyledTextCtrl_1.py b/wxPython/demo/wxStyledTextCtrl_1.py index d23c1a6636..fa0d742ebf 100644 --- a/wxPython/demo/wxStyledTextCtrl_1.py +++ b/wxPython/demo/wxStyledTextCtrl_1.py @@ -2,6 +2,8 @@ from wxPython.wx import * from wxPython.stc import * +import images + #---------------------------------------------------------------------- debug = 1 @@ -212,7 +214,8 @@ def runTest(frame, nb, log): # setup some markers ed.SetMarginType(1, wxSTC_MARGIN_SYMBOL) ed.MarkerDefine(0, wxSTC_MARK_ROUNDRECT, "#CCFF00", "RED") - ed.MarkerDefine(1, wxSTC_MARK_CIRCLE, "FOREST GREEN", "SIENNA") + #ed.MarkerDefine(1, wxSTC_MARK_CIRCLE, "FOREST GREEN", "SIENNA") + ed.MarkerDefineBitmap(1, images.getFolder1Bitmap()) ed.MarkerDefine(2, wxSTC_MARK_SHORTARROW, "blue", "blue") ed.MarkerDefine(3, wxSTC_MARK_ARROW, "#00FF00", "#00FF00") diff --git a/wxPython/demo/wxStyledTextCtrl_2.py b/wxPython/demo/wxStyledTextCtrl_2.py index 516383f50f..167ab22a6b 100644 --- a/wxPython/demo/wxStyledTextCtrl_2.py +++ b/wxPython/demo/wxStyledTextCtrl_2.py @@ -1,7 +1,7 @@ from wxPython.wx import * from wxPython.stc import * - +import images import keyword #---------------------------------------------------------------------- @@ -52,7 +52,7 @@ class PythonSTC(wxStyledTextCtrl): self.SetMargins(0,0) self.SetViewWhiteSpace(False) - #self.SetBufferedDraw(False) + ##self.SetBufferedDraw(False) self.SetEdgeMode(wxSTC_EDGE_BACKGROUND) self.SetEdgeColumn(78) @@ -85,6 +85,7 @@ class PythonSTC(wxStyledTextCtrl): EVT_STC_UPDATEUI(self, ID, self.OnUpdateUI) EVT_STC_MARGINCLICK(self, ID, self.OnMarginClick) + EVT_KEY_DOWN(self, self.OnKeyPressed) # Make some styles, The lexer defines what each style is used for, we @@ -130,10 +131,15 @@ class PythonSTC(wxStyledTextCtrl): # End of line where string is not closed self.StyleSetSpec(wxSTC_P_STRINGEOL, "fore:#000000,face:%(mono)s,back:#E0C0E0,eol,size:%(size)d" % faces) - self.SetCaretForeground("BLUE") - EVT_KEY_DOWN(self, self.OnKeyPressed) + + # register some images for use in the AutoComplete box. + self.RegisterImage(1, images.getSmilesBitmap()) + self.RegisterImage(2, images.getFile1Bitmap()) + self.RegisterImage(3, images.getCopyBitmap()) + + def OnKeyPressed(self, event): @@ -145,7 +151,9 @@ class PythonSTC(wxStyledTextCtrl): # Tips if event.ShiftDown(): self.CallTipSetBackground("yellow") - self.CallTipShow(pos, 'param1, param2') + self.CallTipShow(pos, 'lots of of text: blah, blah, blah\n\n' + 'show some suff, maybe parameters..\n\n' + 'fubar(param1, param2)') # Code completion else: #lst = [] @@ -156,17 +164,22 @@ class PythonSTC(wxStyledTextCtrl): #self.AutoCompShow(0, st) kw = keyword.kwlist[:] - kw.append("zzzzzz") - kw.append("aaaaa") - kw.append("__init__") - kw.append("zzaaaaa") - kw.append("zzbaaaa") + kw.append("zzzzzz?2") + kw.append("aaaaa?2") + kw.append("__init__?3") + kw.append("zzaaaaa?2") + kw.append("zzbaaaa?2") kw.append("this_is_a_longer_value") - kw.append("this_is_a_much_much_much_much_much_much_much_longer_value") + #kw.append("this_is_a_much_much_much_much_much_much_much_longer_value") kw.sort() # Python sorts are case sensitive self.AutoCompSetIgnoreCase(False) # so this needs to match + # Images are specified with a appended "?type" + for i in range(len(kw)): + if kw[i] in keyword.kwlist: + kw[i] = kw[i] + "?1" + self.AutoCompShow(0, " ".join(kw)) else: event.Skip() diff --git a/wxPython/demo/wxXmlResourceHandler.py b/wxPython/demo/wxXmlResourceHandler.py index 531457c651..87d8598447 100644 --- a/wxPython/demo/wxXmlResourceHandler.py +++ b/wxPython/demo/wxXmlResourceHandler.py @@ -11,7 +11,7 @@ resourceText = r''' 200,100 - + 10,10