Attachment 'AddLinearSpacer.py'

Download

   1 """ Simple foolproof function to properly insert a
   2 one-dimensional BoxSizer spacer along its major axis 
   3 regardless of the sizer's orientation.
   4 
   5 Ray Pasco
   6 2010-09-25-Sat__PM-03-14-19__September
   7 
   8 """
   9 
  10 def AddLinearSpacer( boxsizer, pixelSpacing ) :
  11     """ A one-dimensional spacer for use with any BoxSizer """
  12 
  13     orientation = boxsizer.GetOrientation()
  14     if   (orientation == wx.HORIZONTAL) :
  15         boxsizer.Add( (pixelSpacing, 0) )
  16 
  17     elif (orientation == wx.VERTICAL) :
  18         boxsizer.Add( (0, pixelSpacing) )
  19     #end if
  20 
  21 #end def

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2010-09-25 19:34:39, 0.6 KB) [[attachment:AddLinearSpacer.py]]
  • [get | view] (2010-09-25 04:41:13, 15.1 KB) [[attachment:SIMPLE_SINGLE_SIZER_2_B.PNG]]
  • [get | view] (2010-09-25 05:00:32, 15.1 KB) [[attachment:SIMPLE_SINGLE_SIZER_2_C.PNG]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.