Copied/merged from the 2.2 branch.
Changes needed to build with new event system git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9374 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
41
wxPython/demo/FancyText.py
Normal file
41
wxPython/demo/FancyText.py
Normal file
@@ -0,0 +1,41 @@
|
||||
|
||||
from wxPython.wx import *
|
||||
from wxPython.lib import fancytext
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
test_str = ('<font style="italic" family="swiss" color="red" weight="bold" >'
|
||||
'some |<sup>23</sup> <angle/>text<sub>with <angle/> subscript</sub>'
|
||||
'</font> some other text')
|
||||
|
||||
test_str2 = '<font family="swiss" color="dark green" size="40">big green text</font>'
|
||||
|
||||
|
||||
class TestPanel(wxPanel):
|
||||
def __init__(self, parent):
|
||||
wxPanel.__init__(self, parent, -1)
|
||||
EVT_PAINT(self, self.OnPaint)
|
||||
|
||||
|
||||
def OnPaint(self, evt):
|
||||
dc = wxPaintDC(self)
|
||||
|
||||
sz = fancytext.getExtent(test_str, dc)
|
||||
fancytext.renderToDC(test_str, dc, 20, 20)
|
||||
|
||||
fancytext.renderToDC(test_str2, dc, 20, 20 + sz.height + 10)
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
win = TestPanel(nb)
|
||||
return win
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
import string
|
||||
overview = string.replace(fancytext.__doc__, "<", "<")
|
||||
|
Reference in New Issue
Block a user