Ignore:
Timestamp:
Aug 14, 2019 5:17:47 PM (2 years ago)
Author:
toby
Message:

more work on menu hot keys & ask to save on exit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r4087 r4093  
    466466        item = parent.Append(wx.ID_ANY,'&Open project...\tCtrl+O','Open a GSAS-II project file (*.gpx)')           
    467467        self.Bind(wx.EVT_MENU, self.OnFileOpen, id=item.GetId())
    468         item = parent.Append(wx.ID_ANY,'Reopen recent...\tCtrl+R','Reopen a previously used GSAS-II project file (*.gpx)')
     468        item = parent.Append(wx.ID_ANY,'Reopen recent...\tCtrl+E','Reopen a previously used GSAS-II project file (*.gpx)')
    469469        self.Bind(wx.EVT_MENU, self.OnFileReopen, id=item.GetId())
    470470        item = parent.Append(wx.ID_ANY,'&Save project\tCtrl+S','Save project under current name')
     
    490490            self.Bind(wx.EVT_MENU, OnwxInspect, item)
    491491           
    492         item = parent.Append(wx.ID_ANY,'&Exit','Exit from GSAS-II')
     492        item = parent.Append(wx.ID_EXIT,'Exit\tALT+F4','Exit from GSAS-II')
    493493        self.Bind(wx.EVT_MENU, self.ExitMain, id=item.GetId())
    494494       
     
    539539        self.Bind(wx.EVT_MENU, self.OnShowLSParms, id=item.GetId())
    540540       
    541         item = parent.Append(wx.ID_ANY,'&Refine','')
     541        item = parent.Append(wx.ID_ANY,'&Refine\tCTRL+R','Perform a refinement')
    542542        if len(self.Refine): # extend state for new menus to match main (on mac)
    543543            state = self.Refine[0].IsEnabled()
     
    586586        if seqSetting:
    587587            for item in self.Refine:
    588                 item.SetText('Se&quential refine')
     588                item.SetText('Se&quential refine\tCtrl+R')
    589589            seqMode = True
    590590        else:
    591591            for item in self.Refine:
    592                 item.SetText('&Refine')
     592                item.SetText('&Refine\tCtrl+R')
    593593            seqMode = False
    594594        for menu,Id in self.ExportSeq:
     
    39803980            self.CheckNotebook()
    39813981            G2IO.ProjFileSave(self)
     3982            return True
    39823983        else:
    3983             self.OnFileSaveas(event)
     3984            return self.OnFileSaveas(event)
    39843985           
    39853986    def SetTitleByGPX(self):
     
    40174018                self.SetTitleByGPX()
    40184019                os.chdir(dlg.GetDirectory())           # to get Mac/Linux to change directory!
     4020                return True
     4021            else:
     4022                return False
    40194023        finally:
    40204024            dlg.Destroy()
     
    40754079        NB: not called if console window closed
    40764080        '''
     4081        if self.GPXtree.GetCount() > 1:
     4082            dlg = wx.MessageDialog(self,
     4083                    'Do you want to save and exit?\n(Use No to exit without save or Cancel to prevent exiting)',
     4084                    'Confirm exit/save?',
     4085                    wx.YES|wx.NO|wx.CANCEL)
     4086            try:
     4087                result = dlg.ShowModal()
     4088            finally:
     4089                dlg.Destroy()
     4090        else:
     4091            result = wx.ID_NO
     4092        if result == wx.ID_NO:
     4093            pass
     4094        elif result == wx.ID_CANCEL:
     4095            return
     4096        else:
     4097            if not self.OnFileSave(event):
     4098                return
    40774099        FrameInfo = {'Main_Pos':tuple(self.GetPosition()),
    40784100                     'Main_Size':tuple(self.GetSize()),
Note: See TracChangeset for help on using the changeset viewer.