]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/RichTextCtrl.py
Include wx/gauge.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / wxPython / demo / RichTextCtrl.py
1
2 import wx
3 import wx.richtext as rt
4 import images
5
6 #----------------------------------------------------------------------
7
8 class RichTextFrame(wx.Frame):
9 def __init__(self, *args, **kw):
10 wx.Frame.__init__(self, *args, **kw)
11
12 self.MakeMenuBar()
13 self.MakeToolBar()
14 self.CreateStatusBar()
15 self.SetStatusText("Welcome to wx.richtext.RichTextCtrl!")
16
17 self.rtc = rt.RichTextCtrl(self, style=wx.VSCROLL|wx.HSCROLL|wx.NO_BORDER);
18 wx.CallAfter(self.rtc.SetFocus)
19
20
21 self.rtc.BeginSuppressUndo()
22
23 self.rtc.BeginParagraphSpacing(0, 20)
24
25 self.rtc.BeginAlignment(rt.TEXT_ALIGNMENT_CENTRE)
26 self.rtc.BeginBold()
27
28 self.rtc.BeginFontSize(14)
29 self.rtc.WriteText("Welcome to wxRichTextCtrl, a wxWidgets control for editing and presenting styled text and images")
30 self.rtc.EndFontSize()
31 self.rtc.Newline()
32
33 self.rtc.BeginItalic()
34 self.rtc.WriteText("by Julian Smart")
35 self.rtc.EndItalic()
36
37 self.rtc.EndBold()
38
39 self.rtc.Newline()
40 self.rtc.WriteImage(images.get_rt_zebraImage())
41
42 self.rtc.EndAlignment()
43
44 self.rtc.Newline()
45 self.rtc.Newline()
46
47 self.rtc.WriteText("What can you do with this thing? ")
48 self.rtc.WriteImage(images.get_rt_smileyImage())
49 self.rtc.WriteText(" Well, you can change text ")
50
51 self.rtc.BeginTextColour((255, 0, 0))
52 self.rtc.WriteText("colour, like this red bit.")
53 self.rtc.EndTextColour()
54
55 self.rtc.BeginTextColour((0, 0, 255))
56 self.rtc.WriteText(" And this blue bit.")
57 self.rtc.EndTextColour()
58
59 self.rtc.WriteText(" Naturally you can make things ")
60 self.rtc.BeginBold()
61 self.rtc.WriteText("bold ")
62 self.rtc.EndBold()
63 self.rtc.BeginItalic()
64 self.rtc.WriteText("or italic ")
65 self.rtc.EndItalic()
66 self.rtc.BeginUnderline()
67 self.rtc.WriteText("or underlined.")
68 self.rtc.EndUnderline()
69
70 self.rtc.BeginFontSize(14)
71 self.rtc.WriteText(" Different font sizes on the same line is allowed, too.")
72 self.rtc.EndFontSize()
73
74 self.rtc.WriteText(" Next we'll show an indented paragraph.")
75
76 self.rtc.BeginLeftIndent(60)
77 self.rtc.Newline()
78
79 self.rtc.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.")
80 self.rtc.EndLeftIndent()
81
82 self.rtc.Newline()
83
84 self.rtc.WriteText("Next, we'll show a first-line indent, achieved using BeginLeftIndent(100, -40).")
85
86 self.rtc.BeginLeftIndent(100, -40)
87 self.rtc.Newline()
88
89 self.rtc.WriteText("It was in January, the most down-trodden month of an Edinburgh winteself.rtc. An attractive woman came into the cafe, which is nothing remarkable.")
90 self.rtc.EndLeftIndent()
91
92 self.rtc.Newline()
93
94 self.rtc.WriteText("Numbered bullets are possible, again using subindents:")
95
96 self.rtc.BeginNumberedBullet(1, 100, 60)
97 self.rtc.Newline()
98
99 self.rtc.WriteText("This is my first item. Note that wxRichTextCtrl doesn't automatically do numbering, but this will be added later.")
100 self.rtc.EndNumberedBullet()
101
102 self.rtc.BeginNumberedBullet(2, 100, 60)
103 self.rtc.Newline()
104
105 self.rtc.WriteText("This is my second item.")
106 self.rtc.EndNumberedBullet()
107
108 self.rtc.Newline()
109
110 self.rtc.WriteText("The following paragraph is right-indented:")
111
112 self.rtc.BeginRightIndent(200)
113 self.rtc.Newline()
114
115 self.rtc.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.")
116 self.rtc.EndRightIndent()
117
118 self.rtc.Newline()
119
120 self.rtc.WriteText("The following paragraph is right-aligned with 1.5 line spacing:")
121
122 self.rtc.BeginAlignment(rt.TEXT_ALIGNMENT_RIGHT)
123 self.rtc.BeginLineSpacing(rt.TEXT_ATTR_LINE_SPACING_HALF)
124 self.rtc.Newline()
125
126 self.rtc.WriteText("It was in January, the most down-trodden month of an Edinburgh winter. An attractive woman came into the cafe, which is nothing remarkable.")
127 self.rtc.EndLineSpacing()
128 self.rtc.EndAlignment()
129
130 self.rtc.Newline()
131 self.rtc.WriteText("Other notable features of wxRichTextCtrl include:")
132
133 self.rtc.BeginSymbolBullet('*', 100, 60)
134 self.rtc.Newline()
135 self.rtc.WriteText("Compatibility with wxTextCtrl API")
136 self.rtc.EndSymbolBullet()
137
138 self.rtc.BeginSymbolBullet('*', 100, 60)
139 self.rtc.Newline()
140 self.rtc.WriteText("Easy stack-based BeginXXX()...EndXXX() style setting in addition to SetStyle()")
141 self.rtc.EndSymbolBullet()
142
143 self.rtc.BeginSymbolBullet('*', 100, 60)
144 self.rtc.Newline()
145 self.rtc.WriteText("XML loading and saving")
146 self.rtc.EndSymbolBullet()
147
148 self.rtc.BeginSymbolBullet('*', 100, 60)
149 self.rtc.Newline()
150 self.rtc.WriteText("Undo/Redo, with batching option and Undo suppressing")
151 self.rtc.EndSymbolBullet()
152
153 self.rtc.BeginSymbolBullet('*', 100, 60)
154 self.rtc.Newline()
155 self.rtc.WriteText("Clipboard copy and paste")
156 self.rtc.EndSymbolBullet()
157
158 self.rtc.BeginSymbolBullet('*', 100, 60)
159 self.rtc.Newline()
160 self.rtc.WriteText("wxRichTextStyleSheet with named character and paragraph styles, and control for applying named styles")
161 self.rtc.EndSymbolBullet()
162
163 self.rtc.BeginSymbolBullet('*', 100, 60)
164 self.rtc.Newline()
165 self.rtc.WriteText("A design that can easily be extended to other content types, ultimately with text boxes, tables, controls, and so on")
166 self.rtc.EndSymbolBullet()
167
168 self.rtc.Newline()
169
170 self.rtc.WriteText("Note: this sample content was generated programmatically from within the MyFrame constructor in the demo. The images were loaded from inline XPMs. Enjoy wxRichTextCtrl!")
171
172 self.rtc.EndParagraphSpacing()
173
174 self.rtc.EndSuppressUndo()
175
176
177 def OnFileOpen(self, evt):
178 # TODO: Use RichTextBuffer.GetExtWildcard to get the wildcard string
179 dlg = wx.FileDialog(self, "Choose a filename",
180 wildcard="All files (*.*)|*.*",
181 style=wx.OPEN)
182 if dlg.ShowModal() == wx.ID_OK:
183 path = dlg.GetPath()
184 if path:
185 # TODO: use the filter index to determine what file type to use
186 self.rtc.LoadFile(path, rt.RICHTEXT_TYPE_TEXT)
187 dlg.Destroy()
188
189
190 def OnFileSave(self, evt):
191 if not self.rtc.GetFilename():
192 self.OnFileSaveAs(evt)
193 return
194 self.rtc.SaveFile()
195
196 def OnFileSaveAs(self, evt):
197 # TODO: Use RichTextBuffer.GetExtWildcard to get the wildcard string
198 dlg = wx.FileDialog(self, "Choose a filename",
199 wildcard="All files (*.*)|*.*",
200 style=wx.OPEN)
201 if dlg.ShowModal() == wx.ID_OK:
202 path = dlg.GetPath()
203 if path:
204 self.rtc.SaveFile(path)
205
206
207 def OnFileViewHTML(self, evt): pass
208
209
210 def OnFileExit(self, evt):
211 self.Close(True)
212
213
214 def OnBold(self, evt):
215 self.rtc.ApplyBoldToSelection()
216
217 def OnItalic(self, evt):
218 self.rtc.ApplyItalicToSelection()
219
220 def OnUnderline(self, evt):
221 self.rtc.ApplyUnderlineToSelection()
222
223 def OnAlignLeft(self, evt):
224 self.rtc.ApplyAlignmentToSelection(rt.TEXT_ALIGNMENT_LEFT)
225
226 def OnAlignRight(self, evt):
227 self.rtc.ApplyAlignmentToSelection(rt.TEXT_ALIGNMENT_RIGHT)
228
229 def OnAlignCenter(self, evt):
230 self.rtc.ApplyAlignmentToSelection(rt.TEXT_ALIGNMENT_CENTRE)
231
232 def OnIndentMore(self, evt):
233 attr = rt.RichTextAttr()
234 attr.SetFlags(rt.TEXT_ATTR_LEFT_INDENT)
235 ip = self.rtc.GetInsertionPoint()
236 if self.rtc.GetStyle(ip, attr):
237 r = rt.RichTextRange(ip, ip)
238 if self.rtc.HasSelection():
239 r = self.rtc.GetSelectionRange()
240
241 attr.SetLeftIndent(attr.GetLeftIndent() + 100)
242 attr.SetFlags(rt.TEXT_ATTR_LEFT_INDENT)
243 self.rtc.SetStyle(r, attr)
244
245
246 def OnIndentLess(self, evt):
247 attr = rt.RichTextAttr()
248 attr.SetFlags(rt.TEXT_ATTR_LEFT_INDENT)
249 ip = self.rtc.GetInsertionPoint()
250 if self.rtc.GetStyle(ip, attr):
251 r = rt.RichTextRange(ip, ip)
252 if self.rtc.HasSelection():
253 r = self.rtc.GetSelectionRange()
254
255 if attr.GetLeftIndent() >= 100:
256 attr.SetLeftIndent(attr.GetLeftIndent() - 100)
257 attr.SetFlags(rt.TEXT_ATTR_LEFT_INDENT)
258 self.rtc.SetStyle(r, attr)
259
260
261 def OnParagraphSpacingMore(self, evt):
262 attr = rt.RichTextAttr()
263 attr.SetFlags(rt.TEXT_ATTR_PARA_SPACING_AFTER)
264 ip = self.rtc.GetInsertionPoint()
265 if self.rtc.GetStyle(ip, attr):
266 r = rt.RichTextRange(ip, ip)
267 if self.rtc.HasSelection():
268 r = self.rtc.GetSelectionRange()
269
270 attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() + 20);
271 attr.SetFlags(rt.TEXT_ATTR_PARA_SPACING_AFTER)
272 self.rtc.SetStyle(r, attr)
273
274
275 def OnParagraphSpacingLess(self, evt):
276 attr = rt.RichTextAttr()
277 attr.SetFlags(rt.TEXT_ATTR_PARA_SPACING_AFTER)
278 ip = self.rtc.GetInsertionPoint()
279 if self.rtc.GetStyle(ip, attr):
280 r = rt.RichTextRange(ip, ip)
281 if self.rtc.HasSelection():
282 r = self.rtc.GetSelectionRange()
283
284 if attr.GetParagraphSpacingAfter() >= 20:
285 attr.SetParagraphSpacingAfter(attr.GetParagraphSpacingAfter() - 20);
286 attr.SetFlags(rt.TEXT_ATTR_PARA_SPACING_AFTER)
287 self.rtc.SetStyle(r, attr)
288
289
290 def OnLineSpacingSingle(self, evt):
291 attr = rt.RichTextAttr()
292 attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING)
293 ip = self.rtc.GetInsertionPoint()
294 if self.rtc.GetStyle(ip, attr):
295 r = rt.RichTextRange(ip, ip)
296 if self.rtc.HasSelection():
297 r = self.rtc.GetSelectionRange()
298
299 attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING)
300 attr.SetLineSpacing(10)
301 self.rtc.SetStyle(r, attr)
302
303
304 def OnLineSpacingHalf(self, evt):
305 attr = rt.RichTextAttr()
306 attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING)
307 ip = self.rtc.GetInsertionPoint()
308 if self.rtc.GetStyle(ip, attr):
309 r = rt.RichTextRange(ip, ip)
310 if self.rtc.HasSelection():
311 r = self.rtc.GetSelectionRange()
312
313 attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING)
314 attr.SetLineSpacing(15)
315 self.rtc.SetStyle(r, attr)
316
317
318 def OnLineSpacingDouble(self, evt):
319 attr = rt.RichTextAttr()
320 attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING)
321 ip = self.rtc.GetInsertionPoint()
322 if self.rtc.GetStyle(ip, attr):
323 r = rt.RichTextRange(ip, ip)
324 if self.rtc.HasSelection():
325 r = self.rtc.GetSelectionRange()
326
327 attr.SetFlags(rt.TEXT_ATTR_LINE_SPACING)
328 attr.SetLineSpacing(20)
329 self.rtc.SetStyle(r, attr)
330
331
332 def OnFont(self, evt):
333 if not self.rtc.HasSelection():
334 return
335
336 r = self.rtc.GetSelectionRange()
337 fontData = wx.FontData()
338 attr = rt.RichTextAttr()
339 attr.SetFlags(rt.TEXT_ATTR_FONT)
340 if self.rtc.GetStyle(self.rtc.GetInsertionPoint(), attr):
341 fontData.SetInitialFont(attr.CreateFont())
342
343 dlg = wx.FontDialog(self, fontData)
344 if dlg.ShowModal() == wx.ID_OK:
345 fontData = dlg.GetFontData()
346 font = fontData.GetChosenFont()
347 if font:
348 attr.SetFlags(rt.TEXT_ATTR_FONT)
349 attr.SetFont(font)
350 self.rtc.SetStyle(r, attr)
351 dlg.Destroy()
352
353
354 def OnUpdateBold(self, evt):
355 evt.Check(self.rtc.IsSelectionBold())
356
357 def OnUpdateItalic(self, evt):
358 evt.Check(self.rtc.IsSelectionItalics())
359
360 def OnUpdateUnderline(self, evt):
361 evt.Check(self.rtc.IsSelectionUnderlined())
362
363 def OnUpdateAlignLeft(self, evt):
364 evt.Check(self.rtc.IsSelectionAligned(rt.TEXT_ALIGNMENT_LEFT))
365
366 def OnUpdateAlignCenter(self, evt):
367 evt.Check(self.rtc.IsSelectionAligned(rt.TEXT_ALIGNMENT_CENTRE))
368
369 def OnUpdateAlignRight(self, evt):
370 evt.Check(self.rtc.IsSelectionAligned(rt.TEXT_ALIGNMENT_RIGHT))
371
372
373 def ForwardEvent(self, evt):
374 # The RichTextCtrl can handle menu and update events for undo,
375 # redo, cut, copy, paste, delete, and select all, so just
376 # forward the event to it.
377 self.rtc.ProcessEvent(evt)
378
379
380 def MakeMenuBar(self):
381 def doBind(item, handler, updateUI=None):
382 self.Bind(wx.EVT_MENU, handler, item)
383 if updateUI is not None:
384 self.Bind(wx.EVT_UPDATE_UI, updateUI, item)
385
386 fileMenu = wx.Menu()
387 doBind( fileMenu.Append(-1, "&Open\tCtrl+O", "Open a file"),
388 self.OnFileOpen )
389 doBind( fileMenu.Append(-1, "&Save\tCtrl+S", "Save a file"),
390 self.OnFileSave )
391 doBind( fileMenu.Append(-1, "&Save As...\tF12", "Save to a new file"),
392 self.OnFileSaveAs )
393 fileMenu.AppendSeparator()
394 doBind( fileMenu.Append(-1, "&View as HTML", "View HTML"),
395 self.OnFileViewHTML)
396 fileMenu.AppendSeparator()
397 doBind( fileMenu.Append(-1, "E&xit\tCtrl+Q", "Quit this program"),
398 self.OnFileExit )
399
400 editMenu = wx.Menu()
401 doBind( editMenu.Append(wx.ID_UNDO, "&Undo\tCtrl+Z"),
402 self.ForwardEvent, self.ForwardEvent)
403 doBind( editMenu.Append(wx.ID_REDO, "&Redo\tCtrl+Y"),
404 self.ForwardEvent, self.ForwardEvent )
405 editMenu.AppendSeparator()
406 doBind( editMenu.Append(wx.ID_CUT, "Cu&t\tCtrl+X"),
407 self.ForwardEvent, self.ForwardEvent )
408 doBind( editMenu.Append(wx.ID_COPY, "&Copy\tCtrl+C"),
409 self.ForwardEvent, self.ForwardEvent)
410 doBind( editMenu.Append(wx.ID_PASTE, "&Paste\tCtrl+V"),
411 self.ForwardEvent, self.ForwardEvent)
412 doBind( editMenu.Append(wx.ID_CLEAR, "&Delete\tDel"),
413 self.ForwardEvent, self.ForwardEvent)
414 editMenu.AppendSeparator()
415 doBind( editMenu.Append(wx.ID_SELECTALL, "Select A&ll\tCtrl+A"),
416 self.ForwardEvent, self.ForwardEvent )
417
418 #doBind( editMenu.AppendSeparator(), )
419 #doBind( editMenu.Append(-1, "&Find...\tCtrl+F"), )
420 #doBind( editMenu.Append(-1, "&Replace...\tCtrl+R"), )
421
422 formatMenu = wx.Menu()
423 doBind( formatMenu.AppendCheckItem(-1, "&Bold\tCtrl+B"),
424 self.OnBold, self.OnUpdateBold)
425 doBind( formatMenu.AppendCheckItem(-1, "&Italic\tCtrl+I"),
426 self.OnItalic, self.OnUpdateItalic)
427 doBind( formatMenu.AppendCheckItem(-1, "&Underline\tCtrl+U"),
428 self.OnUnderline, self.OnUpdateUnderline)
429 formatMenu.AppendSeparator()
430 doBind( formatMenu.AppendCheckItem(-1, "L&eft Align"),
431 self.OnAlignLeft, self.OnUpdateAlignLeft)
432 doBind( formatMenu.AppendCheckItem(-1, "&Centre"),
433 self.OnAlignCenter, self.OnUpdateAlignCenter)
434 doBind( formatMenu.AppendCheckItem(-1, "&Right Align"),
435 self.OnAlignRight, self.OnUpdateAlignRight)
436 formatMenu.AppendSeparator()
437 doBind( formatMenu.Append(-1, "Indent &More"), self.OnIndentMore)
438 doBind( formatMenu.Append(-1, "Indent &Less"), self.OnIndentLess)
439 formatMenu.AppendSeparator()
440 doBind( formatMenu.Append(-1, "Increase Paragraph &Spacing"), self.OnParagraphSpacingMore)
441 doBind( formatMenu.Append(-1, "Decrease &Paragraph Spacing"), self.OnParagraphSpacingLess)
442 formatMenu.AppendSeparator()
443 doBind( formatMenu.Append(-1, "Normal Line Spacing"), self.OnLineSpacingSingle)
444 doBind( formatMenu.Append(-1, "1.5 Line Spacing"), self.OnLineSpacingHalf)
445 doBind( formatMenu.Append(-1, "Double Line Spacing"), self.OnLineSpacingDouble)
446 formatMenu.AppendSeparator()
447 doBind( formatMenu.Append(-1, "&Font..."), self.OnFont)
448
449 mb = wx.MenuBar()
450 mb.Append(fileMenu, "&File")
451 mb.Append(editMenu, "&Edit")
452 mb.Append(formatMenu, "F&ormat")
453 self.SetMenuBar(mb)
454
455
456 def MakeToolBar(self):
457 def doBind(item, handler, updateUI=None):
458 self.Bind(wx.EVT_TOOL, handler, item)
459 if updateUI is not None:
460 self.Bind(wx.EVT_UPDATE_UI, updateUI, item)
461
462 tbar = self.CreateToolBar()
463 doBind( tbar.AddTool(-1, images.get_rt_openBitmap(),
464 shortHelpString="Open"), self.OnFileOpen)
465 doBind( tbar.AddTool(-1, images.get_rt_saveBitmap(),
466 shortHelpString="Save"), self.OnFileSave)
467 tbar.AddSeparator()
468 doBind( tbar.AddTool(wx.ID_CUT, images.get_rt_cutBitmap(),
469 shortHelpString="Cut"), self.ForwardEvent, self.ForwardEvent)
470 doBind( tbar.AddTool(wx.ID_COPY, images.get_rt_copyBitmap(),
471 shortHelpString="Copy"), self.ForwardEvent, self.ForwardEvent)
472 doBind( tbar.AddTool(wx.ID_PASTE, images.get_rt_pasteBitmap(),
473 shortHelpString="Paste"), self.ForwardEvent, self.ForwardEvent)
474 tbar.AddSeparator()
475 doBind( tbar.AddTool(wx.ID_UNDO, images.get_rt_undoBitmap(),
476 shortHelpString="Undo"), self.ForwardEvent, self.ForwardEvent)
477 doBind( tbar.AddTool(wx.ID_REDO, images.get_rt_redoBitmap(),
478 shortHelpString="Redo"), self.ForwardEvent, self.ForwardEvent)
479 tbar.AddSeparator()
480 doBind( tbar.AddTool(-1, images.get_rt_boldBitmap(), isToggle=True,
481 shortHelpString="Bold"), self.OnBold, self.OnUpdateBold)
482 doBind( tbar.AddTool(-1, images.get_rt_italicBitmap(), isToggle=True,
483 shortHelpString="Italic"), self.OnItalic, self.OnUpdateItalic)
484 doBind( tbar.AddTool(-1, images.get_rt_underlineBitmap(), isToggle=True,
485 shortHelpString="Underline"), self.OnUnderline, self.OnUpdateUnderline)
486 tbar.AddSeparator()
487 doBind( tbar.AddTool(-1, images.get_rt_alignleftBitmap(), isToggle=True,
488 shortHelpString="Align Left"), self.OnAlignLeft, self.OnUpdateAlignLeft)
489 doBind( tbar.AddTool(-1, images.get_rt_centreBitmap(), isToggle=True,
490 shortHelpString="Center"), self.OnAlignCenter, self.OnUpdateAlignCenter)
491 doBind( tbar.AddTool(-1, images.get_rt_alignrightBitmap(), isToggle=True,
492 shortHelpString="Align Right"), self.OnAlignRight, self.OnUpdateAlignRight)
493 tbar.AddSeparator()
494 doBind( tbar.AddTool(-1, images.get_rt_indentlessBitmap(),
495 shortHelpString="Indent Less"), self.OnIndentLess)
496 doBind( tbar.AddTool(-1, images.get_rt_indentmoreBitmap(),
497 shortHelpString="Indent More"), self.OnIndentMore)
498 tbar.AddSeparator()
499 doBind( tbar.AddTool(-1, images.get_rt_fontBitmap(),
500 shortHelpString="Font"), self.OnFont)
501
502 tbar.Realize()
503
504
505
506 #----------------------------------------------------------------------
507
508 class TestPanel(wx.Panel):
509 def __init__(self, parent, log):
510 self.log = log
511 wx.Panel.__init__(self, parent, -1)
512
513 b = wx.Button(self, -1, "Show the RichTextCtrl sample", (50,50))
514 self.Bind(wx.EVT_BUTTON, self.OnButton, b)
515
516
517 def OnButton(self, evt):
518 win = RichTextFrame(self, -1, "wx.richtext.RichTextCtrl",
519 size=(700, 500),
520 style = wx.DEFAULT_FRAME_STYLE)
521 win.Show(True)
522
523 # give easy access to PyShell if it's running
524 self.rtfrm = win
525 self.rtc = win.rtc
526
527 #----------------------------------------------------------------------
528
529 def runTest(frame, nb, log):
530 win = TestPanel(nb, log)
531 return win
532
533 #----------------------------------------------------------------------
534
535
536
537 overview = """<html><body>
538 <h2><center>wx.richtext.RichTextCtrl</center></h2>
539
540 </body></html>
541 """
542
543
544
545 if __name__ == '__main__':
546 import sys,os
547 import run
548 run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
549