[GRASS-SVN] r37422 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 24 10:02:43 EDT 2009


Author: martinl
Date: 2009-05-24 10:02:43 -0400 (Sun, 24 May 2009)
New Revision: 37422

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
Log:
wxGUI: disable autocomplete prompt mode on Mac
reason: missing wx.PopupWindow() on this platform
	(merge from trunk, r37421)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2009-05-24 13:58:07 UTC (rev 37421)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/prompt.py	2009-05-24 14:02:43 UTC (rev 37422)
@@ -8,6 +8,9 @@
  - PromptListCtrl
  - TextCtrlAutoComplete
 
+ at todo: fix TextCtrlAutoComplete to work also on Macs (missing
+wx.PopupWindow())
+
 (C) 2009 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
@@ -18,6 +21,7 @@
 
 import sys
 import shlex
+import platform
 
 import wx
 import wx.lib.mixins.listctrl as listmix
@@ -41,12 +45,20 @@
         label = wx.Button(parent = cmdprompt, id = wx.ID_ANY,
                           label = _("Cmd >"), size = (-1, 25))
         label.SetToolTipString(_("Click for erasing command prompt"))
+
+        ### todo: fix TextCtrlAutoComplete to work also on Macs
+        ### reason: missing wx.PopupWindow()
+        if not platform.mac_ver()[0]:
+            cmdinput = TextCtrlAutoComplete(parent = cmdprompt, id = wx.ID_ANY,
+                                            value = "",
+                                            style = wx.TE_LINEWRAP | wx.TE_PROCESS_ENTER,
+                                            size = (-1, 25))
+        else:
+            cmdinput = wx.TextCtrl(parent = cmdprompt, id = wx.ID_ANY,
+                                   value = "",
+                                   style=wx.TE_LINEWRAP | wx.TE_PROCESS_ENTER,
+                                   size = (-1, 25))
         
-        cmdinput = TextCtrlAutoComplete(parent = cmdprompt, id = wx.ID_ANY,
-                                        value = "",
-                                        style = wx.TE_LINEWRAP | wx.TE_PROCESS_ENTER,
-                                        size = (-1, 25))
-        
         cmdinput.SetFont(wx.Font(10, wx.FONTFAMILY_MODERN, wx.NORMAL, wx.NORMAL, 0, ''))
         
         wx.CallAfter(cmdinput.SetInsertionPoint, 0)



More information about the grass-commit mailing list