[GRASS-SVN] r30880 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Apr 6 12:10:46 EDT 2008


Author: martinl
Date: 2008-04-06 12:10:46 -0400 (Sun, 06 Apr 2008)
New Revision: 30880

Modified:
   grass/trunk/gui/wxpython/gui_modules/gdialogs.py
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
Log:
wxGUI: require map name for legend


Modified: grass/trunk/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gdialogs.py	2008-04-06 15:46:35 UTC (rev 30879)
+++ grass/trunk/gui/wxpython/gui_modules/gdialogs.py	2008-04-06 16:10:46 UTC (rev 30880)
@@ -248,9 +248,11 @@
         # buttons
         btnsizer = wx.StdDialogButtonSizer()
 
-        btnOK = wx.Button(parent=self, id=wx.ID_OK)
-        btnOK.SetDefault()
-        btnsizer.AddButton(btnOK)
+        self.btnOK = wx.Button(parent=self, id=wx.ID_OK)
+        self.btnOK.SetDefault()
+        if self.name == 'legend':
+            self.btnOK.Enable(False)
+        btnsizer.AddButton(self.btnOK)
 
         btnCancel = wx.Button(parent=self, id=wx.ID_CANCEL)
         btnsizer.AddButton(btnCancel)
@@ -264,7 +266,7 @@
         #
         self.Bind(wx.EVT_BUTTON,   self.OnOptions, optnbtn)
         self.Bind(wx.EVT_BUTTON,   self.OnCancel,  btnCancel)
-        self.Bind(wx.EVT_BUTTON,   self.OnOK,      btnOK)
+        self.Bind(wx.EVT_BUTTON,   self.OnOK,      self.btnOK)
 
         self.SetSizer(sizer)
         sizer.Fit(self)
@@ -336,6 +338,11 @@
                                       l_active=self.parent.MapWindow.overlays[self.ovlId]['layer'].IsActive(),
                                       l_render=False, l_hidden=True)
 
+        if self.name == 'legend' and \
+                params and \
+                not self.btnOK.IsEnabled():
+            self.btnOK.Enable()
+
 class TextLayerDialog(wx.Dialog):
     """
     Controls setting options and displaying/hiding map overlay decorations

Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-04-06 15:46:35 UTC (rev 30879)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-04-06 16:10:46 UTC (rev 30880)
@@ -508,10 +508,8 @@
         for overlay in self.Map.GetListOfLayers(l_type="overlay", l_active=True):
             if os.path.isfile(overlay.mapfile) and os.path.getsize(overlay.mapfile):
                 img = wx.Image(overlay.mapfile, wx.BITMAP_TYPE_ANY)
-                pdc_id = self.Map.overlays.index(overlay) # ?
-                self.imagedict[img] = { 'id' : pdc_id,
-                                        'layer' : overlay,
-                                        'coords' : wx.Rect(0, 0, 0, 0) }
+                self.imagedict[img] = { 'id' : overlay.id,
+                                        'layer' : overlay }
                 imgs.append(img)
 
         return imgs



More information about the grass-commit mailing list