Browse Source

wxGUI: fix OnSearchModule (SearchModuleWindow)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53659 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 years ago
parent
commit
81f9d9fd43
2 changed files with 11 additions and 11 deletions
  1. 9 8
      gui/wxpython/gui_core/ghelp.py
  2. 2 3
      gui/wxpython/gui_core/menu.py

+ 9 - 8
gui/wxpython/gui_core/ghelp.py

@@ -92,15 +92,15 @@ class SearchModuleWindow(wx.Panel):
         gridSizer.Add(item = self.search,
                       flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos = (0, 1))
         row = 1
+        if self.showChoice:
+            gridSizer.Add(item = self.searchChoice,
+                          flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos = (row, 0), span = (1, 2))
+            row += 1
         if self.showTip:
             gridSizer.Add(item = self.searchTip,
                           flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos = (row, 0), span = (1, 2))
             row += 1
         
-        if self.showChoice:
-            gridSizer.Add(item = self.searchChoice,
-                          flag = wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, pos = (row, 0), span = (1, 2))
-        
         gridSizer.AddGrowableCol(1)
 
         sizer.Add(item = gridSizer, proportion = 1)
@@ -128,7 +128,7 @@ class SearchModuleWindow(wx.Panel):
             event.Skip()
             return
         
-        text = event.GetString()
+        text = event.GetEventObject().GetValue()
         if not text:
             self.cmdPrompt.SetFilter(None)
             mList = self.cmdPrompt.GetCommandItems()
@@ -166,8 +166,9 @@ class SearchModuleWindow(wx.Panel):
                 
         self.cmdPrompt.SetFilter(modules)
         self.searchChoice.SetItems(self.cmdPrompt.GetCommandItems())
+        self.searchChoice.SetSelection(0)
         if self.showTip:
-            self.searchTip.SetLabel(_("%d modules found") % iFound)
+            self.searchTip.SetLabel(_("%d modules match") % iFound)
         
         event.Skip()
         
@@ -176,7 +177,7 @@ class SearchModuleWindow(wx.Panel):
         cmd  = event.GetString().split(' ', 1)[0]
         text = cmd + ' '
         pos = len(text)
-
+        
         if self.cmdPrompt:
             self.cmdPrompt.SetText(text)
             self.cmdPrompt.SetSelectionStart(pos)
@@ -186,7 +187,7 @@ class SearchModuleWindow(wx.Panel):
         desc = self.cmdPrompt.GetCommandDesc(cmd)
         if self.showTip:
             self.searchTip.SetLabel(desc)
-    
+        
     def Reset(self):
         """!Reset widget"""
         self.searchBy.SetSelection(0)

+ 2 - 3
gui/wxpython/gui_core/menu.py

@@ -149,9 +149,8 @@ class MenuTreeWindow(wx.Panel):
         self.btnRun.Bind(wx.EVT_BUTTON,            self.OnRun)
         self.tree.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnItemActivated)
         self.tree.Bind(wx.EVT_TREE_SEL_CHANGED,    self.OnItemSelected)
-#        self.search.GetCtrl().Bind(wx.EVT_TEXT_ENTER,  self.OnShowItem)
-        self.search.GetCtrl().Bind(wx.EVT_TEXT,        self.OnUpdateStatusBar)
-        self.search.GetCtrl().Bind(wx.EVT_KEY_UP,      self.OnKeyUp)
+        self.search.GetCtrl().Bind(wx.EVT_TEXT,    self.OnUpdateStatusBar)
+        self.search.GetCtrl().Bind(wx.EVT_KEY_UP,  self.OnKeyUp)
         
         self._layout()