Sfoglia il codice sorgente

wxGUI/legend: enable 'resize' button when map is defined
(merge https://trac.osgeo.org/grass/changeset/53707 from relbr64)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53711 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 12 anni fa
parent
commit
e83af6cf9c
1 ha cambiato i file con 8 aggiunte e 4 eliminazioni
  1. 8 4
      gui/wxpython/gui_core/dialogs.py

+ 8 - 4
gui/wxpython/gui_core/dialogs.py

@@ -591,8 +591,7 @@ class DecorationDialog(wx.Dialog):
             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)
@@ -648,8 +647,11 @@ class DecorationDialog(wx.Dialog):
             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)
@@ -692,7 +694,7 @@ class DecorationDialog(wx.Dialog):
                 self.parent.MapWindow.overlays[self.ovlId]['propwin'].Show()
         
     def OnResize(self, event):
-        if self.FindWindowByName('resize').GetValue():
+        if self.FindWindowByName('resize').GetValue(): 
             self.parent.SwitchTool(self.parent.toolbars['map'], event)
             self.parent.MapWindow.SetCursor(self.parent.cursors["cross"])
             self.parent.MapWindow.mouse['use'] = 'legend'
@@ -751,6 +753,8 @@ class DecorationDialog(wx.Dialog):
         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):
     """