[GRASS-SVN] r62659 - in grass/branches/releasebranch_7_0: . gui/wxpython/mapwin
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Nov 7 12:57:20 PST 2014
Author: martinl
Date: 2014-11-07 12:57:20 -0800 (Fri, 07 Nov 2014)
New Revision: 62659
Modified:
grass/branches/releasebranch_7_0/
grass/branches/releasebranch_7_0/gui/wxpython/mapwin/decorations.py
Log:
wxGUI: make TextLayerDialog resizable
(merge r62655-6 from trunk)
Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
- /grass/trunk:61096,62179-62180,62182,62403,62422,62424,62437,62466,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62570,62573,62575,62585,62588,62597,62603,62606,62609,62614,62618,62632,62642,62649,62652
+ /grass/trunk:61096,62179-62180,62182,62403,62422,62424,62437,62466,62487,62491,62494,62501,62506,62508-62509,62515,62518-62519,62521,62526,62533,62539,62541,62555,62562,62570,62573,62575,62585,62588,62597,62603,62606,62609,62614,62618,62632,62642,62649,62652,62655-62657
Modified: grass/branches/releasebranch_7_0/gui/wxpython/mapwin/decorations.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/mapwin/decorations.py 2014-11-07 20:56:06 UTC (rev 62658)
+++ grass/branches/releasebranch_7_0/gui/wxpython/mapwin/decorations.py 2014-11-07 20:57:20 UTC (rev 62659)
@@ -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)
@@ -408,6 +407,8 @@
self.Bind(wx.EVT_TEXT, self.OnText, self.textentry)
self.Bind(wx.EVT_SPINCTRL, self.OnRotation, self.rotation)
+ self.SetMinSize((400, 230))
+
def OnRefit(self, event):
"""!Resize text entry to match text"""
self.sizer.Fit(self)
More information about the grass-commit
mailing list