[GRASS-SVN] r67856 - grass/trunk/gui/wxpython/gmodeler

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Feb 17 00:39:45 PST 2016


Author: martinl
Date: 2016-02-17 00:39:45 -0800 (Wed, 17 Feb 2016)
New Revision: 67856

Modified:
   grass/trunk/gui/wxpython/gmodeler/frame.py
   grass/trunk/gui/wxpython/gmodeler/model.py
Log:
wxGUI: fixes g.gui.gmodeler - Set comment after erasure (#2904)


Modified: grass/trunk/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/frame.py	2016-02-17 08:25:29 UTC (rev 67855)
+++ grass/trunk/gui/wxpython/gmodeler/frame.py	2016-02-17 08:39:45 UTC (rev 67856)
@@ -1374,6 +1374,7 @@
             comment = dlg.GetValue()
             shape.SetComment(comment)
             self.frame.ModelChanged()
+            self.frame.canvas.Refresh()
         dlg.Destroy()
 
     def _onSelectShape(self, shape, append=False):

Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py	2016-02-17 08:25:29 UTC (rev 67855)
+++ grass/trunk/gui/wxpython/gmodeler/model.py	2016-02-17 08:39:45 UTC (rev 67856)
@@ -1071,17 +1071,25 @@
 
     def SetComment(self, comment):
         """Set comment"""
+        self.comment = comment
+
         if self.regionComment is None:
             self.regionComment = ogl.ShapeRegion()
             self.regionComment.SetFormatMode(ogl.FORMAT_CENTRE_HORIZ)
             font = wx.SystemSettings_GetFont(wx.SYS_DEFAULT_GUI_FONT)
             font.SetStyle(wx.ITALIC)
             self.regionComment.SetFont(font)
+
+        self.regionComment.SetText(comment)
+            
+        if self.comment:
             self.AddRegion(self.regionComment)
             self.regionLabel.SetProportions(0.0, 0.4)
-            
-        self.comment = comment
-        self.regionComment.SetText(comment)
+        else:
+            self.ClearRegions()
+            self.AddRegion(self.regionLabel)
+            self.regionLabel.SetProportions(0.0, 1.0)
+        
         self.SetRegionSizes()
         self.ReformatRegions()
 



More information about the grass-commit mailing list