[GRASS-SVN] r36452 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Mar 22 17:37:53 EDT 2009


Author: martinl
Date: 2009-03-22 17:37:53 -0400 (Sun, 22 Mar 2009)
New Revision: 36452

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
Log:
wxGUI/dbm: remove collapse pane
          (merge from relbr64, r36447)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py	2009-03-22 21:14:02 UTC (rev 36451)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/dbm.py	2009-03-22 21:37:53 UTC (rev 36452)
@@ -526,10 +526,7 @@
         #self.notebook.AddPage(self.manageLayerPage, caption=_("Manage layers"))
         self.notebook.AddPage(self.manageLayerPage, text=_("Manage layers")) # FN
         self.manageLayerPage.SetTabAreaColour(globalvar.FNPageColor)
-
-        self.infoCollapseLabelExp = _("Click here to show database connection information")
-        self.infoCollapseLabelCol = _("Click here to hide database connection information")
-
+        
         self.__createBrowsePage()
         self.__createManageTablePage()
         self.__createManageLayerPage()
@@ -717,13 +714,13 @@
             #
             # dbInfo
             #
-            infoCollapse = wx.CollapsiblePane(parent=panel,
-                                              label=self.infoCollapseLabelExp,
-                                              style=wx.CP_DEFAULT_STYLE |
-                                              wx.CP_NO_TLW_RESIZE | wx.EXPAND)
-            self.MakeInfoPaneContent(layer, infoCollapse.GetPane())
-            infoCollapse.Collapse(False)
-            self.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.OnInfoPaneChanged, infoCollapse)
+            dbBox = wx.StaticBox(parent=panel, id=wx.ID_ANY,
+                                          label=" %s " % _("Database connection"))
+            dbSizer = wx.StaticBoxSizer(dbBox, wx.VERTICAL)
+            dbSizer.Add(item=self.__createDbInfoDesc(panel, layer),
+                        proportion=1,
+                        flag=wx.EXPAND | wx.ALL,
+                        border=3)
             
             #
             # table description
@@ -843,7 +840,7 @@
                            proportion=1,
                            border=3)
             
-            pageSizer.Add(item=infoCollapse,
+            pageSizer.Add(item=dbSizer,
                           flag=wx.ALL | wx.EXPAND,
                           proportion=0,
                           border=3)
@@ -851,16 +848,14 @@
             pageSizer.Add(item=tableSizer,
                           flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND,
                           proportion=1,
-                          border=5)
+                          border=3)
  
             pageSizer.Add(item=columnSizer,
                           flag=wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND,
                           proportion=0,
-                          border=5)
+                          border=3)
             
             panel.SetSizer(pageSizer)
-            
-            self.layerPage[layer]['dbinfo'] = infoCollapse.GetId()
         
         self.manageTablePage.SetSelection(0) # select first layer
         try:
@@ -1848,63 +1843,30 @@
         
         return (cols, where)
     
-    def OnInfoPaneChanged(self, event):
-        """Collapse database connection info box"""
-
-        if self.FindWindowById(self.layerPage[self.layer]['dbinfo']).IsExpanded():
-            self.FindWindowById(self.layerPage[self.layer]['dbinfo']).SetLabel( \
-                self.infoCollapseLabelCol)
-        else:
-             self.FindWindowById(self.layerPage[self.layer]['dbinfo']).SetLabel( \
-                 self.infoCollapseLabelExp)
-
-        # redo layout
-        self.Layout()
-
-    def MakeInfoPaneContent(self, layer, pane):
+    def __createDbInfoDesc(self, panel, layer):
         """Create database connection information content"""
-            # connection info
-        border = wx.BoxSizer(wx.VERTICAL)
-
-        connectionInfoBox = wx.StaticBox(parent=pane, id=wx.ID_ANY,
-                                         label=" %s " % _("Database connection"))
-        infoSizer = wx.StaticBoxSizer(connectionInfoBox, wx.VERTICAL)
         infoFlexSizer = wx.FlexGridSizer (cols=2, hgap=1, vgap=1)
         infoFlexSizer.AddGrowableCol(1)
-
-        infoFlexSizer.Add(item=wx.StaticText(parent=pane, id=wx.ID_ANY,
+        
+        infoFlexSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
                                              label="Driver:"))
-        infoFlexSizer.Add(item=wx.StaticText(parent=pane, id=wx.ID_ANY,
-                                             label="%s" % \
-                                                 self.mapDBInfo.layers[layer]['driver']))
-        infoFlexSizer.Add(item=wx.StaticText(parent=pane, id=wx.ID_ANY,
+        infoFlexSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
+                                             label=self.mapDBInfo.layers[layer]['driver']))
+        infoFlexSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
                                              label="Database:"))
-        infoFlexSizer.Add(item=wx.StaticText(parent=pane, id=wx.ID_ANY,
-                                             label="%s" % \
-                                                 self.mapDBInfo.layers[layer]['database']))
-        infoFlexSizer.Add(item=wx.StaticText(parent=pane, id=wx.ID_ANY,
+        infoFlexSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
+                                             label=self.mapDBInfo.layers[layer]['database']))
+        infoFlexSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
                                              label="Table:"))
-        infoFlexSizer.Add(item=wx.StaticText(parent=pane, id=wx.ID_ANY,
-                                             label="%s" % \
-                                                 self.mapDBInfo.layers[layer]['table']))
-        infoFlexSizer.Add(item=wx.StaticText(parent=pane, id=wx.ID_ANY,
+        infoFlexSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
+                                             label=self.mapDBInfo.layers[layer]['table']))
+        infoFlexSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
                                              label="Key:"))
-        infoFlexSizer.Add(item=wx.StaticText(parent=pane, id=wx.ID_ANY,
-                                             label="%s" % \
-                                                 self.mapDBInfo.layers[layer]['key']))
+        infoFlexSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
+                                             label=self.mapDBInfo.layers[layer]['key']))
 
-        infoSizer.Add(item=infoFlexSizer,
-                      proportion=1,
-                      flag=wx.EXPAND | wx.ALL,
-                      border=3)
-
-        border.Add(item=infoSizer,
-                   proportion=1,
-                   flag=wx.EXPAND | wx.ALL,
-                   border=3)
-
-        pane.SetSizer(border)
-
+        return infoFlexSizer
+        
     def OnCloseWindow(self, event):
         """Cancel button pressed"""
         self.Close()



More information about the grass-commit mailing list