Bläddra i källkod

wxGUI: prompt focus cosmetics

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43287 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 14 år sedan
förälder
incheckning
a76cf728ce

+ 1 - 1
gui/wxpython/gui_modules/gmodeler.py

@@ -2366,7 +2366,6 @@ class ModelSearchDialog(wx.Dialog):
         @param parent parent window
         @param parent parent window
         @param id window id
         @param id window id
         @param title window title
         @param title window title
-
         @param kwargs wx.Dialogs' arguments
         @param kwargs wx.Dialogs' arguments
         """
         """
         self.parent = parent
         self.parent = parent
@@ -2382,6 +2381,7 @@ class ModelSearchDialog(wx.Dialog):
         
         
         self.cmd_prompt = prompt.GPromptSTC(parent = self)
         self.cmd_prompt = prompt.GPromptSTC(parent = self)
         self.search = SearchModuleWindow(parent = self.panel, cmdPrompt = self.cmd_prompt, showTip = True)
         self.search = SearchModuleWindow(parent = self.panel, cmdPrompt = self.cmd_prompt, showTip = True)
+        wx.CallAfter(self.cmd_prompt.SetFocus)
         
         
         # get commands
         # get commands
         items = self.cmd_prompt.GetCommandItems()
         items = self.cmd_prompt.GetCommandItems()

+ 1 - 2
gui/wxpython/gui_modules/goutput.py

@@ -198,7 +198,7 @@ class GMConsole(wx.SplitterWindow):
         
         
         # search & command prompt
         # search & command prompt
         self.cmd_prompt = prompt.GPromptSTC(parent = self)
         self.cmd_prompt = prompt.GPromptSTC(parent = self)
-                
+        
         if self.parent.GetName() != 'LayerManager':
         if self.parent.GetName() != 'LayerManager':
             self.search = None
             self.search = None
             self.cmd_prompt.Hide()
             self.cmd_prompt.Hide()
@@ -705,7 +705,6 @@ class GMConsole(wx.SplitterWindow):
 
 
         # set focus on prompt
         # set focus on prompt
         if self.parent.GetName() == "LayerManager":
         if self.parent.GetName() == "LayerManager":
-            self.cmd_prompt.SetFocus()
             self.btn_abort.Enable(False)
             self.btn_abort.Enable(False)
         else:
         else:
             # updated command dialog
             # updated command dialog

+ 6 - 16
gui/wxpython/wxgui.py

@@ -196,7 +196,7 @@ class GMFrame(wx.Frame):
         if self.curr_page:
         if self.curr_page:
             self.curr_page.maptree.mapdisplay.Raise()
             self.curr_page.maptree.mapdisplay.Raise()
         wx.CallAfter(self.Raise)
         wx.CallAfter(self.Raise)
-
+        
     def __createNoteBook(self):
     def __createNoteBook(self):
         """!Creates notebook widgets"""
         """!Creates notebook widgets"""
         if globalvar.hasAgw:
         if globalvar.hasAgw:
@@ -306,26 +306,17 @@ class GMFrame(wx.Frame):
                        onDone = self.OnDone)
                        onDone = self.OnDone)
         
         
     def OnMapsets(self, event):
     def OnMapsets(self, event):
+        """!Launch mapset access dialog
         """
         """
-        Launch mapset access dialog
-        """
-        dlg = preferences.MapsetAccess(parent=self, id=wx.ID_ANY)
+        dlg = preferences.MapsetAccess(parent = self, id = wx.ID_ANY)
         dlg.CenterOnScreen()
         dlg.CenterOnScreen()
-
-        # if OK is pressed...
+        
         if dlg.ShowModal() == wx.ID_OK:
         if dlg.ShowModal() == wx.ID_OK:
             ms = dlg.GetMapsets()
             ms = dlg.GetMapsets()
-            # run g.mapsets with string of accessible mapsets
             gcmd.RunCommand('g.mapsets',
             gcmd.RunCommand('g.mapsets',
                             parent = self,
                             parent = self,
                             mapset = '%s' % ','.join(ms))
                             mapset = '%s' % ','.join(ms))
-            
-    def OnRDigit(self, event):
-        """
-        Launch raster digitizing module
-        """
-        pass
-
+        
     def OnCBPageChanged(self, event):
     def OnCBPageChanged(self, event):
         """!Page in notebook (display) changed"""
         """!Page in notebook (display) changed"""
         old_pgnum = event.GetOldSelection()
         old_pgnum = event.GetOldSelection()
@@ -333,7 +324,6 @@ class GMFrame(wx.Frame):
         
         
         self.curr_page   = self.gm_cb.GetCurrentPage()
         self.curr_page   = self.gm_cb.GetCurrentPage()
         self.curr_pagenum = self.gm_cb.GetSelection()
         self.curr_pagenum = self.gm_cb.GetSelection()
-        
         try:
         try:
             self.curr_page.maptree.mapdisplay.SetFocus()
             self.curr_page.maptree.mapdisplay.SetFocus()
             self.curr_page.maptree.mapdisplay.Raise()
             self.curr_page.maptree.mapdisplay.Raise()
@@ -348,7 +338,7 @@ class GMFrame(wx.Frame):
         if page == self.goutput.pageid:
         if page == self.goutput.pageid:
             # remove '(...)'
             # remove '(...)'
             self.notebook.SetPageText(page, _("Command console"))
             self.notebook.SetPageText(page, _("Command console"))
-            self.goutput.cmd_prompt.SetSTCFocus(True)
+            wx.CallAfter(self.goutput.cmd_prompt.SetFocus)
         self.SetStatusText('', 0)
         self.SetStatusText('', 0)
         
         
         event.Skip()
         event.Skip()