]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/FancyText.py
2 from wxPython
.wx
import *
3 from wxPython
.lib
import fancytext
5 #----------------------------------------------------------------------
7 test_str
= ('<font style="italic" family="swiss" color="red" weight="bold" >'
8 'some |<sup>23</sup> <angle/>text<sub>with <angle/> subscript</sub>'
9 '</font> some other text')
11 test_str2
= '<font family="swiss" color="dark green" size="40">big green text</font>'
14 class TestPanel(wxPanel
):
15 def __init__(self
, parent
):
16 wxPanel
.__init
__(self
, parent
, -1)
17 EVT_PAINT(self
, self
.OnPaint
)
20 def OnPaint(self
, evt
):
23 sz
= fancytext
.getExtent(test_str
, dc
)
24 fancytext
.renderToDC(test_str
, dc
, 20, 20)
26 fancytext
.renderToDC(test_str2
, dc
, 20, 20 + sz
.height
+ 10)
29 #----------------------------------------------------------------------
31 def runTest(frame
, nb
, log
):
35 #----------------------------------------------------------------------
40 overview
= string
.replace(fancytext
.__doc
__, "<", "<")