瀏覽代碼

wxGUI/forms: fix layout for too many checkboxes

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@54298 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 12 年之前
父節點
當前提交
77cd9f0d16
共有 1 個文件被更改,包括 7 次插入5 次删除
  1. 7 5
      gui/wxpython/gui_core/forms.py

+ 7 - 5
gui/wxpython/gui_core/forms.py

@@ -942,10 +942,11 @@ class CmdPanel(wx.Panel):
                         p.get('gisprompt',False) == False and \
                         p.get('type', '') == 'string':
                     title_txt.SetLabel(" %s: (%s, %s) " % (title, p['name'], p['type']))
+                    stSizer = wx.StaticBoxSizer(box = title_txt, orient = wx.VERTICAL)
                     if valuelist_desc:
-                        hSizer = wx.StaticBoxSizer(box = title_txt, orient = wx.VERTICAL)
+                        hSizer = wx.FlexGridSizer(cols = 1, vgap = 1)
                     else:
-                        hSizer = wx.StaticBoxSizer(box = title_txt, orient = wx.HORIZONTAL)
+                        hSizer = wx.FlexGridSizer(cols = 5, vgap = 1, hgap = 1)
                     isEnabled = {}
                     # copy default values
                     if p['value'] == '':
@@ -968,12 +969,13 @@ class CmdPanel(wx.Panel):
                         p[ 'wxId' ].append(chkbox.GetId())
                         if val in isEnabled:
                             chkbox.SetValue(True)
-                        hSizer.Add(item = chkbox, proportion = 0,
-                                    flag = wx.ADJUST_MINSIZE | wx.ALL, border = 1)
+                        hSizer.Add(item = chkbox, proportion = 0)
                         chkbox.Bind(wx.EVT_CHECKBOX, self.OnCheckBoxMulti)
                         idx +=  1
                         
-                    which_sizer.Add(item = hSizer, proportion = 0,
+                    stSizer.Add(item = hSizer, proportion = 0,
+                                flag = wx.ADJUST_MINSIZE | wx.ALL, border = 1)
+                    which_sizer.Add(item = stSizer, proportion = 0,
                                     flag = wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT, border = 5)
                 elif p.get('gisprompt', False) == False:
                     if len(valuelist) == 1: # -> textctrl