Changeset 4093


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

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r4085 r4093  
    42214221        self.HelpById = {}
    42224222        self.frame = frame
    4223         self.Append(wx.ID_ABOUT,'&About GSAS-II','')
     4223        self.Append(wx.ID_ABOUT,'&About GSAS-II',
     4224                        'Shows version and citation info')
    42244225        frame.Bind(wx.EVT_MENU, self.OnHelpAbout, id=wx.ID_ABOUT)
    42254226        if GSASIIpath.whichsvn():
    4226             helpobj = self.Append(wx.ID_ANY,'&Check for updates','')
     4227            helpobj = self.Append(wx.ID_ANY,'&Check for updates\tCtrl+U',
     4228                    'Updates to latest GSAS-II version')
    42274229            frame.Bind(wx.EVT_MENU, self.OnCheckUpdates, helpobj)
    4228             helpobj = self.Append(wx.ID_ANY,'&Regress to an old GSAS-II version','')
     4230            helpobj = self.Append(wx.ID_ANY,'&Regress to old GSAS-II version',
     4231                    'Installs previous GSAS-II version')
    42294232            frame.Bind(wx.EVT_MENU, self.OnSelectVersion, helpobj)
    42304233            # if GSASIIpath.svnTestBranch():
     
    42434246        self.AppendSeparator()
    42444247        if includeTree:
    4245             helpobj = self.Append(wx.ID_ANY,'Help on Data tree','')
     4248            helpobj = self.Append(wx.ID_ANY,'Help on Data tree',
     4249                'Web page on GSAS-II data structure')
    42464250            frame.Bind(wx.EVT_MENU, self.OnHelpById, id=helpobj.GetId())
    42474251            self.HelpById[helpobj.GetId()] = 'Data tree'
    4248         helpobj = self.Append(wx.ID_ANY,'Help on current data tree item','')
     4252        helpobj = self.Append(wx.ID_ANY,'Help on current data tree item\tF1',
     4253                'Web page on selected item in tree')
    42494254        frame.Bind(wx.EVT_MENU, self.OnHelpById, id=helpobj.GetId())
    42504255       
  • 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.