Changeset 3367


Ignore:
Timestamp:
May 2, 2018 4:32:13 PM (3 years ago)
Author:
toby
Message:

fixes for parameter display: scroll only list; don't display too much (takes forever)

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r3352 r3367  
    32673267        wx.Dialog.__init__(self,parent,wx.ID_ANY,title,size=size,
    32683268                           style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
    3269         self.panel = wxscroll.ScrolledPanel(self)
    32703269        self.parmChoice = 'Phase'
    32713270        self.parmDict = parmDict
     
    33303329            wx.CallLater(100,self.DrawPanel)
    33313330
    3332         if self.panel.GetSizer(): self.panel.GetSizer().Clear(True)
     3331        if self.GetSizer(): self.GetSizer().Clear(True)
    33333332        mainSizer = wx.BoxSizer(wx.VERTICAL)
    33343333        num = len(self.varyList)
    3335         mainSizer.Add(wx.StaticText(self.panel,label=' Number of refined variables: '+str(num)),0)
     3334        mainSizer.Add(wx.StaticText(self,label=' Number of refined variables: '+str(num)),0)
    33363335        if len(self.varyList) != len(self.fullVaryList):
    33373336            num = len(self.fullVaryList) - len(self.varyList)
    3338             mainSizer.Add(wx.StaticText(self.panel,label=' + '+str(num)+' parameters are varied via constraints'))
     3337            mainSizer.Add(wx.StaticText(self,label=' + '+str(num)+' parameters are varied via constraints'))
    33393338        choiceDict = {'Global':self.globNames,'Phase':self.phasNames,'Phase/Histo':self.hapNames,'Histogram':self.hisNames}
    33403339        choice = ['Phase','Phase/Histo','Histogram']
     
    33423341            choice += ['Global',]
    33433342        parmSizer = wx.FlexGridSizer(0,3,5,5)
    3344         parmSel = wx.RadioBox(self.panel,wx.ID_ANY,'Parameter type:',choices=choice,
     3343        parmSel = wx.RadioBox(self,wx.ID_ANY,'Parameter type:',choices=choice,
    33453344            majorDimension=1,style=wx.RA_SPECIFY_COLS)
    33463345        parmSel.Bind(wx.EVT_RADIOBOX,_OnParmSel)
     
    33503349        numSizer.Add((5,25),0)
    33513350        if self.parmChoice in ['Phase','Phase/Histo'] and len(self.phasNums) > 1:
    3352             numSizer.Add(wx.StaticText(self.panel,label='Phase'),0)
    3353             phasSel = wx.ComboBox(self.panel,choices=self.phasNums,value=self.phasNum,
     3351            numSizer.Add(wx.StaticText(self,label='Phase'),0)
     3352            phasSel = wx.ComboBox(self,choices=self.phasNums,value=self.phasNum,
    33543353                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    33553354            phasSel.Bind(wx.EVT_COMBOBOX,OnPhasSel)
    33563355            numSizer.Add(phasSel,0)
    33573356        if self.parmChoice in ['Histogram','Phase/Histo'] and len(self.hisNums) > 1:
    3358             numSizer.Add(wx.StaticText(self.panel,label='Histogram'),0)
    3359             histSel = wx.ComboBox(self.panel,choices=self.hisNums,value=self.hisNum,
     3357            numSizer.Add(wx.StaticText(self,label='Histogram'),0)
     3358            histSel = wx.ComboBox(self,choices=self.hisNums,value=self.hisNum,
    33603359                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    33613360            histSel.Bind(wx.EVT_COMBOBOX,OnHistSel)
    3362 #            histSel = wx.TextCtrl(self.panel,size=(50,25),value='0',style=wx.TE_PROCESS_ENTER)
     3361#            histSel = wx.TextCtrl(self,size=(50,25),value='0',style=wx.TE_PROCESS_ENTER)
    33633362#            histSel.Bind(wx.EVT_TEXT_ENTER,OnHistSel)
    33643363#            histSel.Bind(wx.EVT_KILL_FOCUS,OnHistSel)
     
    33673366        varSizer = wx.BoxSizer(wx.VERTICAL)
    33683367        if self.parmChoice in ['Phase',]:
    3369             varSel = wx.ComboBox(self.panel,choices=self.phasVars,value=self.varName,
     3368            varSel = wx.ComboBox(self,choices=self.phasVars,value=self.varName,
    33703369                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    33713370            varSel.Bind(wx.EVT_COMBOBOX,OnVarSel)
    33723371        elif self.parmChoice in ['Histogram',]:
    3373             varSel = wx.ComboBox(self.panel,choices=self.hisVars,value=self.varName,
     3372            varSel = wx.ComboBox(self,choices=self.hisVars,value=self.varName,
    33743373                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    33753374            varSel.Bind(wx.EVT_COMBOBOX,OnVarSel)
    33763375        elif self.parmChoice in ['Phase/Histo',]:
    3377             varSel = wx.ComboBox(self.panel,choices=self.hapVars,value=self.varName,
     3376            varSel = wx.ComboBox(self,choices=self.hapVars,value=self.varName,
    33783377                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    33793378            varSel.Bind(wx.EVT_COMBOBOX,OnVarSel)
    33803379        if self.parmChoice != 'Global':
    3381             varSizer.Add(wx.StaticText(self.panel,label='Parameter'))
     3380            varSizer.Add(wx.StaticText(self,label='Parameter'))
    33823381            varSizer.Add(varSel,0)
    33833382        parmSizer.Add(varSizer,0)
    33843383        mainSizer.Add(parmSizer,0)
    3385         listChoice = ['All','Refined']
    3386         listSel = wx.RadioBox(self.panel,wx.ID_ANY,'Parameter type:',choices=listChoice,
     3384        listSel = wx.RadioBox(self,wx.ID_ANY,'Parameter type:',
     3385            choices=['All','Refined'],
    33873386            majorDimension=0,style=wx.RA_SPECIFY_COLS)
    33883387        listSel.SetStringSelection(self.listSel)
    33893388        listSel.Bind(wx.EVT_RADIOBOX,OnListSel)
    33903389        mainSizer.Add(listSel,0)
     3390
     3391        self.panel = wxscroll.ScrolledPanel(self)       
    33913392        subSizer = wx.FlexGridSizer(cols=4,hgap=2,vgap=2)
    33923393        subSizer.Add((-1,-1))
     
    33953396        subSizer.Add(wx.StaticText(self.panel,wx.ID_ANY,'value'),0,wx.ALIGN_RIGHT)
    33963397        explainRefine = False
     3398        count = 0
    33973399        for name in choiceDict[self.parmChoice]:
    33983400            # skip entries without numerical values
     
    34263428                subSizer.Add((-1,-1))
    34273429            subSizer.Add(wx.StaticText(self.panel,label=value),0,wx.ALIGN_RIGHT)
    3428 
    3429         mainSizer.Add(subSizer,0)
     3430            count += 1
     3431            if count > 200:
     3432                msg = wx.StaticText(self,label='Too many parameters selected. Showing first 200')
     3433                msg.SetBackgroundColour(wx.YELLOW)
     3434                mainSizer.Add(msg,0,wx.ALIGN_LEFT)
     3435                mainSizer.Add((-1,10))
     3436                break
     3437        self.panel.SetSizer(subSizer)
     3438        mainSizer.Add(self.panel,1,wx.ALL|wx.EXPAND,1)
     3439       
    34303440        if explainRefine:
    34313441            mainSizer.Add(
    3432                 wx.StaticText(self.panel,label='"R" indicates a refined variable\n'+
     3442                wx.StaticText(self,label='"R" indicates a refined variable\n'+
    34333443                    '"C" indicates generated from a constraint'),0, wx.ALL,0)
    34343444        # make OK button
    34353445        btnsizer = wx.BoxSizer(wx.HORIZONTAL)
    3436         btn = wx.Button(self.panel, wx.ID_CLOSE,"Close")
     3446        btn = wx.Button(self, wx.ID_CLOSE,"Close")
    34373447        btn.Bind(wx.EVT_BUTTON,self._onClose)
    34383448        btnsizer.Add(btn)
    34393449        mainSizer.Add(btnsizer, 0, wx.ALIGN_CENTER|wx.ALL, 5)
    3440         # Allow window to be enlarged but not made smaller
    3441         self.panel.SetSizer(mainSizer)
     3450        self.SetSizer(mainSizer)
    34423451        self.panel.SetAutoLayout(1)
    34433452        self.panel.SetupScrolling()
    3444         self.panel.SetMinSize(self.GetSize())
    3445 
     3453        self.SetMinSize(self.GetSize())        # Allow window to be enlarged but not made smaller
     3454        self.SendSizeEvent()
     3455       
    34463456    def _onClose(self,event):
    34473457        self.EndModal(wx.ID_CANCEL)
  • trunk/GSASIIdataGUI.py

    r3365 r3367  
    42574257           
    42584258        reqVaryList = tuple(varyList) # save requested variables
     4259        wx.BeginBusyCursor()
    42594260        try:
    42604261            # process constraints
     
    42724273        except:
    42734274            pass
     4275        wx.EndBusyCursor()
    42744276        dlg = G2G.ShowLSParms(self,'Least Squares Parameters',parmValDict,varyList,reqVaryList)
    42754277        dlg.ShowModal()
Note: See TracChangeset for help on using the changeset viewer.