Changeset 1505 for branch/logging/GSASII.py
- Timestamp:
- Sep 20, 2014 8:27:59 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branch/logging/GSASII.py
r1497 r1505 1625 1625 1626 1626 1627 def OnMacroRecordStatus(self,event,setvalue=None): 1628 import log 1629 nextvalue = log.ShowLogStatus() != True 1630 if setvalue is not None: 1631 nextvalue = setvalue 1632 if nextvalue: 1633 log.LogOn() 1634 setto = True 1635 else: 1636 log.LogOff() 1637 setto = False 1638 for menuitem in self.MacroStatusList: 1639 menuitem.Check(setto) 1640 1627 1641 def _init_Macro(self): 1642 import log 1628 1643 menu = self.MacroMenu 1629 self.MacroRecordStatus = menu.Append( 1630 help='Start or stop recording of menu actions, etc.', id=wx.ID_ANY, 1631 kind=wx.ITEM_NORMAL,text='Record actions') 1632 self.MacroRecordStatus.SetText('Stop recording') # debug, start w/logging enabled 1633 import log 1634 log.LogOn() 1635 def OnMacroRecordStatus(event): 1636 import log 1637 if 'actions' in self.MacroRecordStatus.GetText(): 1638 self.MacroRecordStatus.SetText('Stop recording') 1639 log.LogOn() 1640 else: 1641 self.MacroRecordStatus.SetText('Record actions') 1642 log.LogOff() 1643 self.Bind(wx.EVT_MENU, OnMacroRecordStatus, self.MacroRecordStatus) 1644 item = menu.Append( 1645 help='Start or stop recording of menu actions, etc.', id=wx.ID_ANY, 1646 kind=wx.ITEM_CHECK,text='Record actions') 1647 self.MacroStatusList.append(item) 1648 item.Check(log.ShowLogStatus()) 1649 self.Bind(wx.EVT_MENU, self.OnMacroRecordStatus, item) 1644 1650 1645 1651 item = menu.Append( … … 1873 1879 def FillMainMenu(self,menubar): 1874 1880 '''Define contents of the main GSAS-II menu for the (main) data tree window 1875 in the mac, used alsofor the data item windows as well.1881 For the mac this is also call for the data item windows as well. 1876 1882 ''' 1877 1883 File = wx.Menu(title='') … … 1958 1964 # create a list of all dataframe menus (appended in PrefillDataMenu) 1959 1965 self.dataMenuBars = [self.GSASIIMenu] 1966 self.MacroStatusList = [] 1960 1967 self.FillMainMenu(self.GSASIIMenu) 1961 1968 self.SetMenuBar(self.GSASIIMenu)
Note: See TracChangeset
for help on using the changeset viewer.