[GRASS-SVN] r48140 - grass/branches/releasebranch_6_4/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Sep 5 12:47:23 EDT 2011


Author: martinl
Date: 2011-09-05 09:47:23 -0700 (Mon, 05 Sep 2011)
New Revision: 48140

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/ghelp.py
   grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gmodeler.py
Log:
wxGUI/modeler: various minor fixes
	       (merge r48133, r48136, r48138 from trunk)


Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/ghelp.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/ghelp.py	2011-09-05 16:43:56 UTC (rev 48139)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/ghelp.py	2011-09-05 16:47:23 UTC (rev 48140)
@@ -204,6 +204,8 @@
         """!Reset widget"""
         self.searchBy.SetSelection(0)
         self.search.SetValue('')
+        if self.showTip:
+            self.searchTip.SetLabel('')
         
 class MenuTreeWindow(wx.Panel):
     """!Show menu tree"""

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gmodeler.py	2011-09-05 16:43:56 UTC (rev 48139)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gmodeler.py	2011-09-05 16:47:23 UTC (rev 48140)
@@ -136,10 +136,17 @@
         return len(self.GetItems())
 
     def GetNextId(self):
-        """!Get next id (data ignored)"""
+        """!Get next id (data ignored)
+
+        @return next id to be used (default: 1)
+        """
+        if len(self.items) < 1:
+            return 1
+        
         currId = self.items[-1].GetId()
         if currId > 0:
             return currId + 1
+        
         return 1
 
     def GetProperties(self):
@@ -2389,7 +2396,7 @@
         self.btnOk.SetDefault()
         self.btnOk.Enable(False)
 
-        self.cmd_prompt.Bind(wx.EVT_CHAR, self.OnText)
+        self.cmd_prompt.Bind(wx.EVT_KEY_UP, self.OnText)
         self.search.searchChoice.Bind(wx.EVT_CHOICE, self.OnText)
         self.Bind(wx.EVT_BUTTON, self.OnOk, self.btnOk)
         
@@ -2438,6 +2445,7 @@
         return cmd
     
     def OnOk(self, event):
+        """!Button 'OK' pressed"""
         self.btnOk.SetFocus()
         cmd = self.GetCmd()
         
@@ -2456,13 +2464,15 @@
         self.EndModal(wx.ID_OK)
         
     def OnText(self, event):
-        """!Text entered"""
+        """!Text in prompt changed"""
         if self.cmd_prompt.AutoCompActive():
             event.Skip()
             return
         
         if isinstance(event, wx.KeyEvent):
-            entry = self.cmd_prompt.GetTextLeft() # FIXME
+            entry = self.cmd_prompt.GetTextLeft()
+        elif isinstance(event, wx.stc.StyledTextEvent):
+            entry = event.GetText()
         else:
             entry = event.GetString()
         
@@ -2477,6 +2487,8 @@
         """!Reset dialog"""
         self.search.Reset()
         self.cmd_prompt.OnCmdErase(None)
+        self.btnOk.Enable(False)
+        self.cmd_prompt.SetFocus()
 
 class ModelRelation(ogl.LineShape):
     """!Data - action relation"""



More information about the grass-commit mailing list