[GRASS-CVS] [addons] r1242 - trunk/grassaddons/gui/gui_modules

grass-commit-addons at grass.itc.it grass-commit-addons at grass.itc.it
Wed Dec 5 05:16:28 EST 2007


Author: landa
Date: 2007-12-05 11:16:28 +0100 (Wed, 05 Dec 2007)
New Revision: 1242

Modified:
   trunk/grassaddons/gui/gui_modules/dbm.py
Log:
'Extract selected' enabled only when at least one item is selected

Modified: trunk/grassaddons/gui/gui_modules/dbm.py
===================================================================
--- trunk/grassaddons/gui/gui_modules/dbm.py	2007-12-05 09:39:57 UTC (rev 1241)
+++ trunk/grassaddons/gui/gui_modules/dbm.py	2007-12-05 10:16:28 UTC (rev 1242)
@@ -61,8 +61,8 @@
 
 class VirtualAttributeList(wx.ListCtrl,
                            listmix.ListCtrlAutoWidthMixin,
-                           listmix.ColumnSorterMixin,
-                           listmix.TextEditMixin):
+                           listmix.ColumnSorterMixin):
+    #                           listmix.TextEditMixin):
     """
     Support virtual list class
     """
@@ -906,13 +906,16 @@
             self.popupDataID5 = wx.NewId()
             self.popupDataID6 = wx.NewId()
             self.popupDataID7 = wx.NewId()
+            self.popupDataID8 = wx.NewId()
+
             self.Bind(wx.EVT_MENU, self.OnDataItemEdit,       id=self.popupDataID1)
             self.Bind(wx.EVT_MENU, self.OnDataItemAdd,        id=self.popupDataID2)
             self.Bind(wx.EVT_MENU, self.OnDataItemDelete,     id=self.popupDataID3)
             self.Bind(wx.EVT_MENU, self.OnDataItemDeleteAll,  id=self.popupDataID4)
             self.Bind(wx.EVT_MENU, self.OnDataReload,         id=self.popupDataID5)
-            self.Bind(wx.EVT_MENU, self.OnDataDrawSelected,   id=self.popupDataID6)
-            self.Bind(wx.EVT_MENU, self.OnExtractSelected,    id=self.popupDataID7)
+            self.Bind(wx.EVT_MENU, self.OnDataSelectAll,      id=self.popupDataID6)
+            self.Bind(wx.EVT_MENU, self.OnDataDrawSelected,   id=self.popupDataID7)
+            self.Bind(wx.EVT_MENU, self.OnExtractSelected,    id=self.popupDataID8)
 
         list = self.FindWindowById(self.layerPage[self.layer]['data'])
         # generate popup-menu
@@ -921,21 +924,22 @@
         selected = list.GetFirstSelected()
         if selected == -1 or list.GetNextSelected(selected) != -1:
             menu.Enable(self.popupDataID1, False)
-        menu.AppendSeparator()
         menu.Append(self.popupDataID2, _("Insert new record"))
-        menu.AppendSeparator()
         menu.Append(self.popupDataID3, _("Delete selected record(s)"))
         menu.Append(self.popupDataID4, _("Delete all records"))
         menu.AppendSeparator()
-        menu.Append(self.popupDataID5, _("Reload"))
+        menu.Append(self.popupDataID6, _("Select all"))
+        menu.Append(self.popupDataID6, _("Select none"))
         menu.AppendSeparator()
-        menu.Append(self.popupDataID6, _("Display selected"))
+        menu.Append(self.popupDataID7, _("Display selected"))
         if not self.map:
-            menu.Enable(self.popupDataID6, False)
-        menu.Append(self.popupDataID7, _("Extract selected"))
+            menu.Enable(self.popupDataID7, False)
+        menu.Append(self.popupDataID8, _("Extract selected"))
         if list.GetFirstSelected() == -1:
             menu.Enable(self.popupDataID3, False)
-            menu.Enable(self.popupDataID7, False)
+            menu.Enable(self.popupDataID8, False)
+        menu.AppendSeparator()
+        menu.Append(self.popupDataID5, _("Reload"))
 
         self.PopupMenu(menu)
         menu.Destroy()
@@ -1183,6 +1187,10 @@
         self.OnApplySqlStatement(None)
         self.listOfSQLStatements = []
 
+    def OnDataSelectAll(self, event):
+        """Select all items"""
+        pass
+
     def OnTableChangeType(self, event):
         """Data type for new column changed. Enable or disable
         data length widget"""



More information about the grass-commit mailing list