From: Alex T. <al...@tw...> - 2007-11-05 00:38:29
|
Hugh Kernohan wrote: > Alex, > > Thank you. As I don't have a suitable site I'll send you the file > for you to put on your website as you offer. > > Thanks Hugh. It can now be found at http://www.tweedly.org/Python/sizerEditorV1a.zip Note - I haven't yet looked at it all, so please treat it with some care. Here are Hugh's accompanying instructions ..... Alex, This is my Sizer Editor code. The zipped file is a self-standing directory tree ..\sizerEditor_version1\.. etc. The file advancedSizer.py should be copied to the PythonCard directory. My findfilestree.py is a cosmetic variation on a old favourite. I'd be happy to be corrected on anything, including points of principle and good practice. Some of the code looks clunky and inefficient, others bits quite taut. I haven't done any testing with older versions but it certainly won't work with less than wxPython 2.8.4.2 of 8 Aug 07. The bulk of the new code for the editor is in a BaseSizer class, and an all-new sizerpropertyEditor window which co-exists with the existing multipropertyEditor window. Other additions to existing code are clearly marked (and sometimes annotated) in the files. To use PythonCard.advancedsizer use the Sizer Editor to set the layout, then include the following in the on_initialize of the .py file: try: from PythonCard.advancedSizer import autoSizer self.useSizersFlag = True autoSizer(self) except: self.useSizersFlag = False This ensures that if PythonCard.advancedSizer is not available the code will still run, provided that useSizersFlag is checked before any sizer-specific routines are run. (Its use can be seen in the Sizer Editor itself). -- Alex Tweedly mailto:al...@tw... www.tweedly.net |