Changeset 1488 for trunk/peppy/actions/minibuffer.py
- Timestamp:
- 07/11/08 08:03:25 (4 months ago)
- Files:
-
- 1 modified
-
trunk/peppy/actions/minibuffer.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/peppy/actions/minibuffer.py
r1487 r1488 185 185 if self.mode: 186 186 wx.CallAfter(self.mode.removeMinibuffer, self) 187 187 188 def performAction(self, value): 189 """Execute the processMinibuffer method of the action""" 190 error = self.action.processMinibuffer(self, self.mode, value) 191 if error is not None: 192 self.mode.frame.SetStatusText(error) 188 193 189 194 … … 235 240 self.finish_callback() 236 241 else: 237 self.mode.removeMinibuffer(detach_only=True) 242 # Remove the minibuffer and perform the action in CallAfters so 243 # the tab focus doesn't get confused. If you try to perform these 244 # actions directly, the focus will return to the original tab if 245 # the action causes a new tab to be created. Moving everything to 246 # CallAfters prevents this. 247 wx.CallAfter(self.removeFromParent) 238 248 if text is not None: 239 error = self.action.processMinibuffer(self, self.mode, text) 240 if error is not None: 241 self.mode.frame.SetStatusText(error) 242 self.close() 243 #self.removeFromParent() 249 wx.CallAfter(self.performAction, text) 250 244 251 245 252 class IntMinibuffer(TextMinibuffer): … … 390 397 #self.text.SetInsertionPointEnd() 391 398 399 # FIXME: Using the EVT_SET_FOCUS doesn't seem to work to set the cursor 400 # to the end of the text. It doesn't seem to get called at all, so 401 # the only way to do it appears to be to co-opt the Panel's SetFocus 402 # method 392 403 self.win.saveSetFocus = self.win.SetFocus 393 404 self.win.SetFocus = self.SetFocus 394 405 395 406 def SetFocus(self): 396 dprint(self)407 #dprint(self) 397 408 self.win.saveSetFocus() 398 409 self.text.SetInsertionPointEnd() 399 410 400 411 def OnFocus(self, evt): 401 dprint()412 #dprint() 402 413 self.text.SetInsertionPointEnd() 403 414 … … 486 497 return 487 498 488 error = self.action.processMinibuffer(self, self.mode, results) 489 if error is not None: 490 self.mode.frame.SetStatusText(error) 491 self.removeFromParent() 499 wx.CallAfter(self.removeFromParent) 500 wx.CallAfter(self.performAction, results)
