X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec873c943d71f0d5f13e3398557071448cda6c23..a4027e74873007e3430af3bd77019bcab76f6c04:/wxPython/demo/FancyText.py?ds=sidebyside diff --git a/wxPython/demo/FancyText.py b/wxPython/demo/FancyText.py deleted file mode 100644 index b7c954c276..0000000000 --- a/wxPython/demo/FancyText.py +++ /dev/null @@ -1,82 +0,0 @@ - -import wx -import wx.lib.fancytext as fancytext - -#---------------------------------------------------------------------- - -test_str = ('' - 'some |23 textwith subscript' - ' some other text') - -test_str2 = 'big green text' - - -class TestPanel(wx.Panel): - def __init__(self, parent): - wx.Panel.__init__(self, parent, -1) - self.Bind(wx.EVT_PAINT, self.OnPaint) - - def OnPaint(self, evt): - dc = wx.PaintDC(self) - - w, h = fancytext.GetExtent(test_str, dc) - fancytext.RenderToDC(test_str, dc, 20, 20) - - fancytext.RenderToDC(test_str2, dc, 20, 20 + h + 10) - - -#---------------------------------------------------------------------- - -def runTest(frame, nb, log): - win = TestPanel(nb) - return win - -#---------------------------------------------------------------------- - - - -overview = \ -""" - - -

FancyText -- methods for rendering XML specified text

- -

This module exports four main methods:: -

-    def GetExtent(str, dc=None, enclose=True)
-    def GetFullExtent(str, dc=None, enclose=True)
-    def RenderToBitmap(str, background=None, enclose=True)
-    def RenderToDC(str, dc, x, y, enclose=True)
-
- -In all cases, 'str' is an XML string. Note that start and end tags -are only required if *enclose* is set to False. In this case the -text should be wrapped in FancyText tags. - -

In addition, the module exports one class:: -

-    class StaticFancyText(self, window, id, text, background, ...)
-
-This class works similar to StaticText except it interprets its text -as FancyText. - -

The text can supportsuperscripts and subscripts, text -in different sizes, colors, -styles, weights and -families. It also supports a limited set of symbols, -currently , , as well as greek letters in both -upper case (...) and lower case (...). - - -The End - - -""" - - - -if __name__ == '__main__': - import sys,os - import run - run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:]) -