X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb757066dfea26412c518153f7c4af05a8a43dc9..ae29146343c4c84d80ff907c352e94740d076a3d:/wxPython/wx/lib/wxpTag.py diff --git a/wxPython/wx/lib/wxpTag.py b/wxPython/wx/lib/wxpTag.py index 8dbb7109d4..e6d72dade3 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 @@ -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,19 +102,16 @@ PARAMTAG = 'PARAM' #---------------------------------------------------------------------- -class wxpTagHandler(wxHtmlWinTagHandler): +class wxpTagHandler(wx.html.HtmlWinTagHandler): def __init__(self): - print 'wxpTagHandler' - wxHtmlWinTagHandler.__init__(self) + wx.html.HtmlWinTagHandler.__init__(self) self.ctx = None def GetSupportedTags(self): - print 'wxpTagHandler.GetSupportedTags' return WXPTAG+','+PARAMTAG def HandleTag(self, tag): - print 'wxpTagHandler.HandleTag' name = tag.GetName() if name == WXPTAG: return self.HandleWxpTag(tag) @@ -131,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'): @@ -154,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) @@ -168,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 @@ -201,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 @@ -270,4 +271,4 @@ def _param2dict(param): -wxHtmlWinParser_AddTagHandler(wxpTagHandler) +wx.html.HtmlWinParser_AddTagHandler(wxpTagHandler)