[GRASS-SVN] r62655 - grass/trunk/gui/wxpython/mapwin

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 7 08:41:36 PST 2014


Author: martinl
Date: 2014-11-07 08:41:36 -0800 (Fri, 07 Nov 2014)
New Revision: 62655

Modified:
   grass/trunk/gui/wxpython/mapwin/decorations.py
Log:
wxGUI: make TextLayerDialog resizable


Modified: grass/trunk/gui/wxpython/mapwin/decorations.py
===================================================================
--- grass/trunk/gui/wxpython/mapwin/decorations.py	2014-11-07 15:13:18 UTC (rev 62654)
+++ grass/trunk/gui/wxpython/mapwin/decorations.py	2014-11-07 16:41:36 UTC (rev 62655)
@@ -10,7 +10,7 @@
  - decorations::LegendController
  - decorations::TextLayerDialog
 
-(C) 2006-2013 by the GRASS Development Team
+(C) 2006-2014 by the GRASS Development Team
 
 This program is free software under the GNU General Public License
 (>=v2). Read the file COPYING that comes with GRASS for details.
@@ -18,9 +18,11 @@
 @author Anna Kratochvilova <kratochanna gmail.com>
 """
 
-import wx
 from core.utils import _
 
+import wx
+from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED
+        
 from grass.pydispatch.signal import Signal
 try:
     from PIL import Image
@@ -288,18 +290,13 @@
 
 
 class TextLayerDialog(wx.Dialog):
-
+    """!Controls setting options and displaying/hiding map overlay decorations
     """
-    Controls setting options and displaying/hiding map overlay decorations
-    """
+    def __init__(self, parent, ovlId, title, name='text', size=wx.DefaultSize,
+                 style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER):
 
-    def __init__(self, parent, ovlId, title, name='text',
-                 pos=wx.DefaultPosition, size=wx.DefaultSize,
-                 style=wx.DEFAULT_DIALOG_STYLE):
+        wx.Dialog.__init__(self, parent=parent, id=wx.ID_ANY, title=title, style=style, size=size)
 
-        wx.Dialog.__init__(self, parent, wx.ID_ANY, title, pos, size, style)
-        from wx.lib.expando import ExpandoTextCtrl, EVT_ETC_LAYOUT_NEEDED
-
         self.ovlId = ovlId
         self.parent = parent
 
@@ -320,7 +317,9 @@
 
         self.sizer = wx.BoxSizer(wx.VERTICAL)
         box = wx.GridBagSizer(vgap=5, hgap=5)
-
+        box.AddGrowableCol(1)
+        box.AddGrowableRow(1)
+        
         # show/hide
         self.chkbox = wx.CheckBox(parent=self, id=wx.ID_ANY,
                                   label=_('Show text object'))
@@ -329,17 +328,14 @@
         else:
             self.chkbox.SetValue(self.parent.MapWindow.overlays[self.ovlId]['layer'].IsActive())
         box.Add(item=self.chkbox, span=(1, 2),
-                flag=wx.ALIGN_LEFT | wx.ALL, border=5,
                 pos=(0, 0))
 
         # text entry
-        label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Enter text:"))
-        box.Add(item=label,
+        box.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Text:")),
                 flag=wx.ALIGN_CENTER_VERTICAL,
                 pos=(1, 0))
 
-        self.textentry = ExpandoTextCtrl(
-            parent=self, id=wx.ID_ANY, value="", size=(300, -1))
+        self.textentry = ExpandoTextCtrl(parent=self, id=wx.ID_ANY, value="", size=(300, -1))
         self.textentry.SetFont(self.currFont)
         self.textentry.SetForegroundColour(self.currClr)
         self.textentry.SetValue(self.currText)
@@ -347,11 +343,11 @@
         self.textentry.SetClientSize((300, -1))
 
         box.Add(item=self.textentry,
+                flag=wx.EXPAND,
                 pos=(1, 1))
 
         # rotation
-        label = wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Rotation:"))
-        box.Add(item=label,
+        box.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Rotation:")),
                 flag=wx.ALIGN_CENTER_VERTICAL,
                 pos=(2, 0))
         self.rotation = wx.SpinCtrl(parent=self, id=wx.ID_ANY, value="", pos=(30, 50),
@@ -363,13 +359,16 @@
                 pos=(2, 1))
 
         # font
+        box.Add(item=wx.StaticText(parent=self, id=wx.ID_ANY, label=_("Font:")),
+                flag=wx.ALIGN_CENTER_VERTICAL,
+                pos=(3, 0))
         fontbtn = wx.Button(parent=self, id=wx.ID_ANY, label=_("Set font"))
         box.Add(item=fontbtn,
                 flag=wx.ALIGN_RIGHT,
                 pos=(3, 1))
 
         self.sizer.Add(item=box, proportion=1,
-                       flag=wx.ALL, border=10)
+                       flag=wx.ALL | wx.EXPAND, border=10)
 
         # note
         box = wx.BoxSizer(wx.HORIZONTAL)



More information about the grass-commit mailing list