X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a62357c175351b8e046cb5f0636a59b7c9baffb..b887061dd1d7b3a49a111513309b1bb5c308537c:/wxPython/wx/lib/wxpTag.py diff --git a/wxPython/wx/lib/wxpTag.py b/wxPython/wx/lib/wxpTag.py index 49e5c4475b..d93a9fa9b1 100644 --- a/wxPython/wx/lib/wxpTag.py +++ b/wxPython/wx/lib/wxpTag.py @@ -10,6 +10,10 @@ # Copyright: (c) 1999 by Total Control Software # Licence: wxWindows license #---------------------------------------------------------------------- +# 12/13/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o Updated for V2.5 compatability +# ''' wxPython.lib.wxpTag @@ -31,11 +35,11 @@ Tags of the following form are recognised: where modulename is the name of a module (possibly in package notation) to import and classname is the name of a class in that module to create an instance of. If the module tag-attribute is not -given or is an empty string, then wxPython.wx is used. The width and -height attributes are expected to be integers and will be passed to -the __init__ method of the class as a wxSize object named size. -However, if the width attribute ends with the percent (%) symbol then -the value will be used as a percentage of the available width and the +given or is an empty string, then wx is used. The width and height +attributes are expected to be integers and will be passed to the +__init__ method of the class as a wxSize object named size. However, +if the width attribute ends with the percent (%) symbol then the value +will be used as a percentage of the available width and the wxHtmlWindow will manage the size. The name-value pairs in all the nested PARAM tags are packaged up as @@ -69,9 +73,9 @@ be converted from strings to alternate datatypes. They are: An example: - + - + Both the begining and ending WXP tags are required. @@ -85,11 +89,11 @@ server as is done with java applets. ''' #---------------------------------------------------------------------- -from wxPython.wx import * -from wxPython.html import * -import wxPython.wx +import types + +import wx +import wx.html -import types #---------------------------------------------------------------------- @@ -98,9 +102,9 @@ PARAMTAG = 'PARAM' #---------------------------------------------------------------------- -class wxpTagHandler(wxHtmlWinTagHandler): +class wxpTagHandler(wx.html.HtmlWinTagHandler): def __init__(self): - wxHtmlWinTagHandler.__init__(self) + wx.html.HtmlWinTagHandler.__init__(self) self.ctx = None def GetSupportedTags(self): @@ -128,7 +132,7 @@ class wxpTagHandler(wxHtmlWinTagHandler): if modName: self.ctx.classMod = _my_import(modName) else: - self.ctx.classMod = wxPython.wx + self.ctx.classMod = wx # find and verify the class if not tag.HasParam('CLASS'): @@ -151,7 +155,7 @@ class wxpTagHandler(wxHtmlWinTagHandler): width = int(width) if tag.HasParam('HEIGHT'): height = int(tag.GetParam('HEIGHT')) - self.ctx.kwargs['size'] = wxSize(width, height) + self.ctx.kwargs['size'] = wx.Size(width, height) # parse up to the closing tag, and gather any nested Param tags. self.ParseInner(tag) @@ -165,7 +169,7 @@ class wxpTagHandler(wxHtmlWinTagHandler): obj.Show(True) # add it to the HtmlWindow - self.GetParser().GetContainer().InsertCell(wxHtmlWidgetCell(obj, self.ctx.floatWidth)) + self.GetParser().GetContainer().InsertCell(wx.html.HtmlWidgetCell(obj, self.ctx.floatWidth)) self.ctx = None return True @@ -198,13 +202,13 @@ class wxpTagHandler(wxHtmlWinTagHandler): except: value = saveVal - # convert to wxColour + # convert to wx.Colour elif value[0] == '#': try: red = int('0x'+value[1:3], 16) green = int('0x'+value[3:5], 16) blue = int('0x'+value[5:], 16) - value = wxColor(red, green, blue) + value = wx.Color(red, green, blue) except: pass @@ -267,4 +271,4 @@ def _param2dict(param): -wxHtmlWinParser_AddTagHandler(wxpTagHandler) +wx.html.HtmlWinParser_AddTagHandler(wxpTagHandler)