| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Editra
Revision: 55440
Author: CJP
Date: 03 Sep 2008 14:25:19
Changes:Set focus to find field when dialog is shown or brought back into focus.
Files:| ... | ...@@ -279,6 +279,8 @@ | |
| 279 | 279 | |
| 280 | 280 | # Event handlers |
| 281 | 281 | self.Bind(wx.EVT_MENU, lambda evt: self._SendCloseEvent(), id=wx.ID_CLOSE) |
| 282 | self.Bind(wx.EVT_SET_FOCUS, | |
| 283 | lambda evt: self._panel.SetFocus() and evt.Skip()) | |
| 282 | 284 | |
| 283 | 285 | def __DoLayout(self): |
| 284 | 286 | """Layout the dialog""" |
| ... | ...@@ -547,6 +549,7 @@ | |
| 547 | 549 | self.Bind(wx.EVT_CHOICE, lambda evt: self._UpdateContext(), id=ID_LOOKIN) |
| 548 | 550 | for bid in (wx.ID_FIND, wx.ID_REPLACE, ID_FIND_ALL, ID_REPLACE_ALL): |
| 549 | 551 | self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=bid) |
| 552 | self._ftxt.Bind(wx.EVT_SET_FOCUS, lambda evt: self._ftxt.SelectAll()) | |
| 550 | 553 | |
| 551 | 554 | def __DoLayout(self): |
| 552 | 555 | """Layout the panel""" |
| ... | ...@@ -115,6 +115,7 @@ | |
| 115 | 115 | |
| 116 | 116 | # Update the text that should be shown in the find replace fields |
| 117 | 117 | self._finddlg.RefreshFindReplaceFields() |
| 118 | self._finddlg.SetFocus() | |
| 118 | 119 | |
| 119 | 120 | def GetClientString(self, multiline=False): |
| 120 | 121 | """Get the selected text in the current client buffer. By default |
| ... | ...@@ -322,11 +323,13 @@ | |
| 322 | 323 | return |
| 323 | 324 | self._finddlg.SetTransparent(240) |
| 324 | 325 | self._finddlg.Show() |
| 326 | self._finddlg.SetFocus() | |
| 325 | 327 | # self._finddlg.SetExtraStyle(wx.WS_EX_PROCESS_UI_UPDATES) |
| 326 | 328 | else: |
| 327 | 329 | # Dialog is open already so just update it |
| 328 | 330 | self._UpdateDialogState(eid) |
| 329 | 331 | self._finddlg.Raise() |
| 332 | self._finddlg.SetFocus() | |
| 330 | 333 | |
| 331 | 334 | @staticmethod |
| 332 | 335 | def ReplaceInStc(stc, matches, rstring): |