[GRASS-SVN] r53707 - grass/branches/releasebranch_6_4/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Nov 6 07:19:52 PST 2012


Author: martinl
Date: 2012-11-06 07:19:51 -0800 (Tue, 06 Nov 2012)
New Revision: 53707

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/dialogs.py
Log:
wxGUI/legend: enable 'resize' button when map is defined


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/dialogs.py	2012-11-06 14:53:46 UTC (rev 53706)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/dialogs.py	2012-11-06 15:19:51 UTC (rev 53707)
@@ -530,8 +530,7 @@
             resize.SetToolTipString(_("Click and drag on the map display to set legend"
                                         " size and position and then press OK"))
             resize.SetName('resize')
-            if self.parent.IsPaneShown('3d'):
-                resize.Disable()
+            resize.Disable()
             box.Add(item = resize, proportion = 0, flag = wx.ALIGN_CENTRE|wx.ALL, border = 5)
             sizer.Add(item = box, proportion = 0,
                       flag = wx.GROW|wx.ALIGN_CENTER_VERTICAL|wx.ALL, border = 5)
@@ -587,8 +586,11 @@
             if name == 'legend':
                 mapName, found = GetLayerNameFromCmd(self.parent.MapWindow.overlays[self.ovlId]['cmd'])
                 if found:
-                    # enable 'OK' button
+                    # enable 'OK' and 'Resize' button
                     self.btnOK.Enable()
+                    if not self.parent.IsPaneShown('3d'):
+                        self.FindWindowByName('resize').Enable()
+                    
                     # set title
                     self.SetTitle(_('Legend of raster map <%s>') % \
                                       mapName)
@@ -632,7 +634,7 @@
                 self.parent.MapWindow.overlays[self.ovlId]['propwin'].Show()
     
     def OnResize(self, event):
-        if self.FindWindowByName('resize').GetValue():
+        if self.FindWindowByName('resize').GetValue(): 
             self.parent.MapWindow.SetCursor(self.parent.cursors["cross"])
             self.parent.MapWindow.mouse['use'] = 'legend'
             self.parent.MapWindow.mouse['box'] = 'box'
@@ -692,6 +694,8 @@
         if  self.name == 'legend':
             if params and not self.btnOK.IsEnabled():
                 self.btnOK.Enable()
+                if not self.parent.IsPaneShown('3d'):
+                    self.FindWindowByName('resize').Enable()
             
 class TextLayerDialog(wx.Dialog):
     """



More information about the grass-commit mailing list