[GRASS-SVN] r67522 - in grass/branches/releasebranch_7_0/gui/wxpython: gmodeler gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Jan 8 03:34:43 PST 2016
Author: martinl
Date: 2016-01-08 03:34:43 -0800 (Fri, 08 Jan 2016)
New Revision: 67522
Modified:
grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py
grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py
Log:
wxGUI/gmodeler: replace wx.TextEntryDialog with gui_core.TextEntryDialog (fix set comment multiline input)
(merge r67519 from trunk)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py 2016-01-08 10:54:22 UTC (rev 67521)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gmodeler/frame.py 2016-01-08 11:34:43 UTC (rev 67522)
@@ -40,7 +40,7 @@
from gui_core.goutput import GConsoleWindow
from core.debug import Debug
from core.gcmd import GMessage, GException, GWarning, GError, RunCommand
-from gui_core.dialogs import GetImageHandlers
+from gui_core.dialogs import GetImageHandlers, TextEntryDialog
from gui_core.ghelp import ShowAboutDialog
from gui_core.preferences import PreferencesBaseDialog
from core.settings import UserSettings
@@ -742,8 +742,9 @@
def OnAddComment(self, event):
"""Add comment to the model"""
- dlg = wx.TextEntryDialog(parent = self, message = _("Comment:"), caption = _("Add comment"),
- style = wx.OK | wx.CANCEL | wx.CENTRE | wx.TE_MULTILINE)
+ dlg = TextEntryDialog(parent = self, message = _("Comment:"), caption = _("Add comment"),
+ textStyle = wx.TE_MULTILINE, textSize = (300, 75))
+
if dlg.ShowModal() == wx.ID_OK:
comment = dlg.GetValue()
if not comment:
@@ -1365,8 +1366,9 @@
def OnSetComment(self, event):
shape = self.GetShape()
- dlg = wx.TextEntryDialog(parent = self.frame, message = _("Comment:"), caption = _("Set comment"),
- defaultValue = shape.GetComment(), style = wx.OK | wx.CANCEL | wx.CENTRE | wx.TE_MULTILINE)
+ dlg = TextEntryDialog(parent = self.frame, message = _("Comment:"), caption = _("Set comment"),
+ defaultValue = shape.GetComment(),
+ textStyle = wx.TE_MULTILINE, textSize = (300, 75))
if dlg.ShowModal() == wx.ID_OK:
comment = dlg.GetValue()
shape.SetComment(comment)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py 2016-01-08 10:54:22 UTC (rev 67521)
+++ grass/branches/releasebranch_7_0/gui/wxpython/gui_core/dialogs.py 2016-01-08 11:34:43 UTC (rev 67522)
@@ -2730,8 +2730,9 @@
It differs from wx.TextEntryDialog because it allows adding validator.
"""
def __init__(self, parent, message, caption='',
- defaultValue='', validator=wx.DefaultValidator,
- style=wx.OK | wx.CANCEL, **kwargs):
+ defaultValue='', validator=wx.DefaultValidator,
+ style=wx.OK | wx.CANCEL | wx.CENTRE, textStyle=0, textSize=(300, -1),
+ **kwargs):
wx.Dialog.__init__(self, parent=parent, id=wx.ID_ANY, title=caption, **kwargs)
vbox = wx.BoxSizer(wx.VERTICAL)
@@ -2739,8 +2740,10 @@
stline = wx.StaticText(self, id=wx.ID_ANY, label=message)
vbox.Add(item=stline, proportion=0, flag=wx.EXPAND | wx.ALL, border=10)
- self._textCtrl = wx.TextCtrl(self, id=wx.ID_ANY, size = (300, -1),
- value=defaultValue, validator=validator)
+ self._textCtrl = wx.TextCtrl(self, id=wx.ID_ANY,
+ value=defaultValue, validator=validator, style=textStyle)
+ self._textCtrl.SetInitialSize(textSize)
+
vbox.Add(item=self._textCtrl, proportion=0, flag=wx.EXPAND | wx.LEFT | wx.RIGHT, border=10)
self._textCtrl.SetFocus()
More information about the grass-commit
mailing list