Changeset 1257 for trunk/GSASII.py


Ignore:
Timestamp:
Mar 20, 2014 12:52:14 PM (8 years ago)
Author:
toby
Message:

change selector for hist. copy & copy flags; change seq ref hist select; change enabling of seq ref menu item; rework G2MultiChoiceDialog to save selections and add SetSelections?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1256 r1257  
    202202            state = False
    203203        item.Enable(state)
    204         self.SeqRefine.append(item)
     204        self.SeqRefine.append(item) # save menu obj for use in self.EnableSeqRefineMenu
    205205        self.Bind(wx.EVT_MENU, self.OnSeqRefine, id=item.GetId())
    206206       
     
    264264                pass
    265265            if fp: fp.close()
     266
     267    def EnableSeqRefineMenu(self):
     268        '''Enable or disable the sequential refinement menu items based on the
     269        contents of the Controls 'Seq Data' item (if present)
     270        '''
     271        controls = self.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(self,self.root, 'Controls'))
     272        if controls.get('Seq Data'):
     273            for i in self.SeqRefine: i.Enable(True)
     274        else:
     275            for i in self.SeqRefine: i.Enable(False)
    266276
    267277    def OnImportGeneric(self,reader,readerlist,label,multiple=False,usedRanIdList=[]):
     
    17971807        self.MakePDF = []
    17981808        self.Refine = []
    1799         self.SeqRefine = []
     1809        self.SeqRefine = [] # pointer(s) to Sequential Refinement menu objects
    18001810        #self.ExportPattern = []
    18011811        self.ExportPeakList = []
     
    19011911                self.PatternTree.Expand(self.root)
    19021912                for item in self.Refine: item.Enable(True)
    1903                 for item in self.SeqRefine: item.Enable(True)
     1913                self.EnableSeqRefineMenu()
     1914
    19041915            except:
    19051916                print 'Error opening file',arg[1]
     
    26292640                if data:
    26302641                    for item in self.Refine: item.Enable(True)
    2631                     for item in self.SeqRefine: item.Enable(True)
     2642                    self.EnableSeqRefineMenu()
    26322643            item, cookie = self.PatternTree.GetNextChild(self.root, cookie)
    26332644        if Id:
Note: See TracChangeset for help on using the changeset viewer.