Changeset 408 for trunk/GSASIIpwdGUI.py


Ignore:
Timestamp:
Nov 7, 2011 3:13:29 PM (10 years ago)
Author:
vondreele
Message:

add copy to limits menu
more constraint GUI stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIpwdGUI.py

    r406 r408  
    366366        G2plt.PlotPatterns(self)
    367367       
     368    def OnLimitCopy(event):
     369        histList = ['All',]+G2gd.GetPatternTreeDataNames(self,['PWDR',])
     370        copyList = []
     371        dlg = wx.MultiChoiceDialog(self,
     372            'Copy limits to which histograms?', 'Copy limits',
     373            histList, wx.CHOICEDLG_STYLE)
     374        try:
     375            if dlg.ShowModal() == wx.ID_OK:
     376                result = dlg.GetSelections()
     377                for i in result:
     378                    copyList.append(histList[i])
     379                if 'All' in copyList:
     380                    copyList = histList[1:]
     381            for item in copyList:
     382                Id = G2gd.GetPatternTreeItemId(self,self.root,item)
     383                self.PatternTree.SetItemPyData(G2gd.GetPatternTreeItemId(self,Id,'Limits'),
     384                    copy.copy(data))
     385        finally:
     386            dlg.Destroy()
     387       
    368388    self.LimitsTable = []
    369389    colLabels = ['Tmin','Tmax']
     
    372392    self.LimitsTable = G2gd.Table(data,rowLabels=rowLabels,colLabels=colLabels,types=Types)
    373393    self.dataFrame.SetLabel('Limits')
    374     self.dataFrame.SetMenuBar(self.dataFrame.BlankMenu)
     394    self.dataFrame.SetMenuBar(self.dataFrame.LimitMenu)
     395    if not self.dataFrame.GetStatusBar():
     396        Status = self.dataFrame.CreateStatusBar()
     397    self.Bind(wx.EVT_MENU,OnLimitCopy,id=G2gd.wxID_LIMITCOPY)
    375398    self.dataDisplay = G2gd.GSGrid(parent=self.dataFrame)
    376399    self.dataDisplay.SetTable(self.LimitsTable, True)
     
    378401    self.dataDisplay.SetMargins(0,0)
    379402    self.dataDisplay.AutoSizeColumns(False)
    380     self.dataFrame.setSizePosLeft([230,120])
     403    self.dataFrame.setSizePosLeft([230,160])
    381404   
    382405def UpdateInstrumentGrid(self,data):
Note: See TracChangeset for help on using the changeset viewer.