예제 #1
0
 def on_close(self, event=None):
     self.engine.translator.set_state(self.previous_state)
     try:
         util.SetForegroundWindow(self.last_window)
     except:
         pass
     self.other_instances.remove(self)
     self.Destroy()
예제 #2
0
 def on_close(self, event=None):
     self.engine.translator.set_state(self.previous_state)
     self.other_instances.remove(self)
     self.Destroy()
     self.Update()  # confirm dialog is removed before setting fg window
     try:
         util.SetForegroundWindow(self.last_window)
     except:
         pass
예제 #3
0
 def on_close(self, event=None):
     self._restore_engine_state()
     self.other_instances.remove(self)
     self.Destroy()
     self.Update()
     try:
         util.SetForegroundWindow(self.last_window)
     except:
         pass
예제 #4
0
 def on_close(self, event=None):
     self.Disconnect(-1, -1, wx.wxEVT_ACTIVATE)
     self._unfocus_strokes()
     self._unfocus_translation()
     self.other_instances.remove(self)
     self.Destroy()
     try:
         util.SetForegroundWindow(self.last_window)
     except:
         pass
예제 #5
0
 def _on_close(self, event=None):
     result = wx.ID_YES
     if self.store.pending_changes:
         dlg = wx.MessageDialog(
             self, "You will lose your changes. Are you sure?", "Cancel",
             wx.YES_NO | wx.ICON_QUESTION)
         result = dlg.ShowModal()
         dlg.Destroy()
     if result == wx.ID_YES:
         try:
             util.SetForegroundWindow(self.last_window)
         except:
             pass
         self.on_exit()
         self.Destroy()