List Info

Thread: pywxrc




pywxrc
user name
2006-02-28 10:13:55
It took me much longer than I expected but I've made the changes I wanted to pywxrc.
It now has a -u option that will generate Python code for USING the XRC resources and it can be used as a module from other tools like XRCed.
 
After quite a lot of refactoring I still don't like the way the code is organized, but it's better than before.
 
The generated code contains an attribute for each of the controls in the XRC file and some code to make it easier to create inherited classes.
You can see an example of the generated code below.
 
Now I'd really like some help with testing. I've regression tested the other features of pywxrc (actual resource compiling) against both the current pywxrc and the the binary wxrc using some sample XRC files. I need help doing it on a wide range of XRC files with references to bitmaps, urls and projects that use multiple XRC files.
 
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
# This file was automatically generated by wxrc, do not edit by hand.
 
import wx
from wx.xrc import *
class TopFrameBase(wx.wxFrame):
   ; def OnInit(self):
   ;     """ This function is called during the class's initialization.
       
       ; Override it for custom setup (setting additional styles, etc.)"""
  ;      pass
 
    def __init__(self, parent, res):
        """ Pass an initialized wx.xrc.XmlResource into res """
 ;      
       ; # Two stage creation (see http://wiki.wxpython.org/index.cgi/TwoStageCreation)
  ;      pre = wx.PrewxFrame()
 ;       res.LoadOnPanel(pre, parent, "TopFrame")
       ; self.OnInit()
   ;     self.PostCreate(pre)
 
        # Define variables for the controls
  ;      self.BP_Panel = XRCCTRL(self, "BP_Panel")
        self.PeriodUnit = XRCCTRL(self, "PeriodUnit")
   ;     self.NumPeriodUnits = XRCCTRL(self, "NumPeriodUnits")
        self.AddNumPeriods = XRCCTRL(self, "AddNumPeriods")
        self.AddPeriodStart = XRCCTRL(self, "AddPeriodStart")
.....
 
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )