Matthew Hawn - 2005-02-27

BoxSizers currently only have static spacers and the FlexGridSizer seems to be broken.  Here is a patch i quickly put together for SizerCompanions.py and FlexGridGrowableDlg.py.  Hope this helps somebody.

Index: SizerCompanions.py

RCS file: /cvsroot/boa-constructor/boa/Companions/SizerCompanions.py,v
retrieving revision 1.5.2.2
diff -w -b -c -r1.5.2.2 SizerCompanions.py
*** SizerCompanions.py    21 Jan 2005 12:35:16 -0000    1.5.2.2
--- SizerCompanions.py    27 Feb 2005 18:21:21 -0000
***************
*** 126,132 ****
      deletionMethod = 'RemovePos'
 
      additionalMethods = { 'AddSizer': ('Add sizer', 0, '(None)'),
!                           'AddSpacer': ('Add spacer', '', '(None)')
                          }
 
      def __init__(self, name, designer, parentCompanion, ctrl):
--- 126,132 ----
      deletionMethod = 'RemovePos'
 
      additionalMethods = { 'AddSizer': ('Add sizer', 0, '(None)'),
!                           'Add': ('Add spacer', 0, '(None)')
                          }
 
      def __init__(self, name, designer, parentCompanion, ctrl):
***************
*** 153,160 ****
          elif tcl.method == 'AddSizer':
              return {'Sizer': 0, 'Proportion': 1, 'Flag': 'flag',
                      'Border': 'border'}
!         elif tcl.method == 'AddSpacer':
!             return {'Size': 0, 'Flag': 'flag',
                      'Border': 'border'}
 
      def designTimeSource(self, wId, method=None):
--- 153,160 ----
          elif tcl.method == 'AddSizer':
              return {'Sizer': 0, 'Proportion': 1, 'Flag': 'flag',
                      'Border': 'border'}
!         elif tcl.method == 'Add':
!             return {'Size': 0, 'Proportion': 1, 'Flag': 'flag',
                      'Border': 'border'}
 
      def designTimeSource(self, wId, method=None):
***************
*** 165,172 ****
              return {0: 'None', 1: '0', 'flag': '0', 'border': '0'}
          elif method == 'AddSizer':
              return {0: 'None', 1: '0', 'flag': '0', 'border': '0'}
!         elif method == 'AddSpacer':
!             return {0:  'wx.Size(8, 8)', 'flag': '0', 'border': '0'}
 
      def notification(self, compn, action):
          if action == 'delete':
--- 165,172 ----
              return {0: 'None', 1: '0', 'flag': '0', 'border': '0'}
          elif method == 'AddSizer':
              return {0: 'None', 1: '0', 'flag': '0', 'border': '0'}
!         elif method == 'Add':
!             return {0:  'wx.Size(8, 8)', 1: '0', 'flag': '0', 'border': '0'}
 
      def notification(self, compn, action):
          if action == 'delete':
Index: FlexGridGrowableDlg.py
===================================================================
RCS file: /cvsroot/boa-constructor/boa/Companions/FlexGridGrowableDlg.py,v
retrieving revision 1.3.2.1
diff -w -b -c -r1.3.2.1 FlexGridGrowableDlg.py
*** FlexGridGrowableDlg.py    3 Jan 2005 18:22:06 -0000    1.3.2.1
--- FlexGridGrowableDlg.py    27 Feb 2005 18:21:21 -0000
***************
*** 181,187 ****
          self.boxSizer1.Insert(0, self.flex, 1, border=0, flag=wxGROW | wxALL)
               
          rows, cols = self.rows, self.cols
!         self.flex.Add(10, 10)
          for idx, col in zip(range(len(cols)), cols):
              self.flex.Add(self.colBtns[idx], 0, wxGROW)
              if col:
--- 181,187 ----
          self.boxSizer1.Insert(0, self.flex, 1, border=0, flag=wxGROW | wxALL)
               
          rows, cols = self.rows, self.cols
!         self.flex.Add((10, 10))
          for idx, col in zip(range(len(cols)), cols):
              self.flex.Add(self.colBtns[idx], 0, wxGROW)
              if col:
***************
*** 190,196 ****
          for idx, row in zip(range(len(rows)), rows):
              self.flex.Add(self.rowBtns[idx], 0, wxGROW)
              for s in range(len(cols)):
!                 self.flex.Add(10, 10)
              if row:
                  self.flex.AddGrowableRow(idx+1)
         
--- 190,196 ----
          for idx, row in zip(range(len(rows)), rows):
              self.flex.Add(self.rowBtns[idx], 0, wxGROW)
              for s in range(len(cols)):
!                 self.flex.Add((10, 10))
              if row:
                  self.flex.AddGrowableRow(idx+1)