Changeset 2572


Ignore:
Timestamp:
Dec 12, 2016 9:41:08 AM (5 years ago)
Author:
vondreele
Message:

TextCtrl? -- ValidatedTextCtrl?

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r2551 r2572  
    647647                cellSizer.Add(wx.StaticText(General,label=txt),0,WACV)
    648648                if ifEdit:          #a,b,c,etc.
     649#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    649650                    cellVal = wx.TextCtrl(General,value=(fmt%(cell[Id+1])),
    650651                        style=wx.TE_PROCESS_ENTER)
     
    740741                        elemSizer.Add((5,0),)
    741742                    else:
     743#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    742744                        gfacTxt = wx.TextCtrl(General,value='%.2f'%(gfac),style=wx.TE_PROCESS_ENTER)
    743745                        Indx[gfacTxt.GetId()] = ig
     
    824826            dminSizer = wx.BoxSizer(wx.HORIZONTAL)
    825827            dminSizer.Add(wx.StaticText(General,label=' Magnetic reflection d-min: '),0,WACV)
     828#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    826829            dminVal = wx.TextCtrl(General,value='%.4f'%(generalData['MagDmin']),style=wx.TE_PROCESS_ENTER)
    827830            dminVal.Bind(wx.EVT_TEXT_ENTER,OnDminVal)       
     
    863866            pawleySizer.Add(pawlRef,0,WACV)
    864867            pawleySizer.Add(wx.StaticText(General,label=' Pawley dmin: '),0,WACV)
     868#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    865869            pawlVal = wx.TextCtrl(General,value='%.5f'%(generalData['Pawley dmin']),style=wx.TE_PROCESS_ENTER)
    866870            pawlVal.Bind(wx.EVT_TEXT_ENTER,OnPawleyVal)       
     
    868872            pawleySizer.Add(pawlVal,0,WACV)
    869873            pawleySizer.Add(wx.StaticText(General,label=' Pawley neg. wt.: '),0,WACV)
     874#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    870875            pawlNegWt = wx.TextCtrl(General,value='%.4f'%(generalData['Pawley neg wt']),style=wx.TE_PROCESS_ENTER)
    871876            pawlNegWt.Bind(wx.EVT_TEXT_ENTER,OnPawleyNegWt)       
     
    944949            for i,[val,show] in enumerate(zip(generalData['SuperVec'][0],ifShow)):
    945950                if show:
     951#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    946952                    modVal = wx.TextCtrl(General,value=('%.4f'%(val)),
    947953                        size=wx.Size(50,20),style=wx.TE_PROCESS_ENTER)
     
    10261032            line2Sizer = wx.BoxSizer(wx.HORIZONTAL)
    10271033            line2Sizer.Add(wx.StaticText(General,label=' Resolution: '),0,WACV)
     1034#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    10281035            mapRes =  wx.TextCtrl(General,value='%.2f'%(Map['Resolution']),style=wx.TE_PROCESS_ENTER)
    10291036            mapRes.Bind(wx.EVT_TEXT_ENTER,OnResVal)       
     
    10311038            line2Sizer.Add(mapRes,0,WACV)
    10321039            line2Sizer.Add(wx.StaticText(General,label=' Peak cutoff %: '),0,WACV)
     1040#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    10331041            cutOff =  wx.TextCtrl(General,value='%.1f'%(Map['cutOff']),style=wx.TE_PROCESS_ENTER)
    10341042            cutOff.Bind(wx.EVT_TEXT_ENTER,OnCutOff)       
     
    11211129            line2Sizer = wx.BoxSizer(wx.HORIZONTAL)
    11221130            line2Sizer.Add(wx.StaticText(General,label=' Resolution: '),0,WACV)
     1131#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    11231132            flipRes =  wx.TextCtrl(General,value='%.2f'%(Flip['Resolution']),style=wx.TE_PROCESS_ENTER)
    11241133            flipRes.Bind(wx.EVT_TEXT_ENTER,OnResVal)       
     
    11261135            line2Sizer.Add(flipRes,0,WACV)
    11271136            line2Sizer.Add(wx.StaticText(General,label=' k-Factor (0.1-1.2): '),0,WACV)
     1137#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    11281138            kFactor =  wx.TextCtrl(General,value='%.3f'%(Flip['k-factor']),style=wx.TE_PROCESS_ENTER)
    11291139            kFactor.Bind(wx.EVT_TEXT_ENTER,OnkFactor)       
     
    11311141            line2Sizer.Add(kFactor,0,WACV)
    11321142            line2Sizer.Add(wx.StaticText(General,label=' k-Max (>=10.0): '),0,WACV)
     1143#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    11331144            kMax = wx.TextCtrl(General,value='%.1f'%(Flip['k-Max']),style=wx.TE_PROCESS_ENTER)
    11341145            kMax.Bind(wx.EVT_TEXT_ENTER,OnkMax)       
     
    12461257            lineSizer.Add(refList,0,WACV)
    12471258            lineSizer.Add(wx.StaticText(General,label=' d-min: '),0,WACV)
     1259#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    12481260            dmin = wx.TextCtrl(General,-1,value='%.3f'%(MCSAdata['dmin']),style=wx.TE_PROCESS_ENTER)
    12491261            dmin.Bind(wx.EVT_TEXT_ENTER,OnDmin)       
     
    12641276            ranStart.SetValue(MCSAdata.get('ranStart',False))
    12651277            line2Sizer.Add(ranStart,0,WACV)
     1278#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    12661279            ranRange = wx.TextCtrl(General,-1,value='%.1f'%(MCSAdata.get('ranRange',0.10)*100),style=wx.TE_PROCESS_ENTER)
    12671280            ranRange.Bind(wx.EVT_TEXT_ENTER,OnRanRange)       
     
    12931306                for i,name in enumerate(Names):
    12941307                    line3Sizer.Add(wx.StaticText(General,label=name),0,WACV)
     1308#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    12951309                    Ajump =  wx.TextCtrl(General,-1,value='%.3f'%(MCSAdata[parms][i]),style=wx.TE_PROCESS_ENTER)
    12961310                    Ajump.Bind(wx.EVT_TEXT_ENTER,OnAjump)       
     
    13001314            elif 'log' in MCSAdata['Algorithm']:
    13011315                line3Sizer.Add(wx.StaticText(General,label=' slope: '),0,WACV)
     1316#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    13021317                slope =  wx.TextCtrl(General,-1,value='%.3f'%(MCSAdata['log slope']),style=wx.TE_PROCESS_ENTER)
    13031318                slope.Bind(wx.EVT_TEXT_ENTER,OnSlope)       
     
    28862901            for txt,fmt,ifEdit,Id in useGUI[2]:
    28872902                cellSizer.Add(wx.StaticText(layerData,label=txt),0,WACV)
     2903#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    28882904                cellVal = wx.TextCtrl(layerData,value=(fmt%(cell[Id+1])),
    28892905                    style=wx.TE_PROCESS_ENTER)
     
    29182934            for i in range(2):
    29192935                widthSizer.Add(wx.StaticText(layerData,label=u' layer width(%s) (<= 1\xb5m): '%(Labels[i])),0,WACV)
     2936#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    29202937                widthVal = wx.TextCtrl(layerData,value='%.3f'%(widths[i]),style=wx.TE_PROCESS_ENTER)
    29212938                widthVal.Bind(wx.EVT_TEXT_ENTER,OnWidthChange)       
     
    33013318            if Layers['Stacking'][0] == 'recursive':
    33023319                topLine.Add(wx.StaticText(layerData,label=' number of layers (<1022 or "infinite"): '),0,WACV)
     3320#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    33033321                numLayers = wx.TextCtrl(layerData,value=data['Layers']['Stacking'][1],style=wx.TE_PROCESS_ENTER)
    33043322                numLayers.Bind(wx.EVT_TEXT_ENTER,OnNumLayers)       
     
    33663384        if Layers['Laue'] == 'unknown':
    33673385            laueSizer.Add(wx.StaticText(layerData,label=' Diffraction symmetry tolerance: '),0,WACV)
     3386#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    33683387            toler = wx.TextCtrl(layerData,value='%.3f'%(Layers['Toler']),style=wx.TE_PROCESS_ENTER)
    33693388            toler.Bind(wx.EVT_TEXT_ENTER,OnToler)       
     
    37673786                        for ival,val in enumerate(wave[0]):
    37683787                            if np.any(CSI[Stype][0][ival]):
     3788#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    37693789                                waveVal = wx.TextCtrl(waveData,value='%.5f'%(val),style=wx.TE_PROCESS_ENTER)
    37703790                                waveVal.Bind(wx.EVT_TEXT_ENTER,OnWaveVal)
     
    47794799            ZstepSizer = wx.BoxSizer(wx.HORIZONTAL)
    47804800            ZstepSizer.Add(wx.StaticText(drawOptions,-1,' Z step:'),0,WACV)
     4801#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    47814802            Zstep = wx.TextCtrl(drawOptions,value='%.2f'%(drawingData['Zstep']),
    47824803                style=wx.TE_PROCESS_ENTER)
     
    49764997            radSizer = wx.BoxSizer(wx.HORIZONTAL)
    49774998            radSizer.Add(wx.StaticText(drawOptions,-1,' Hydrogen radius, A:  '),0,WACV)
     4999#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    49785000            sizeH = wx.TextCtrl(drawOptions,-1,value='%.2f'%(drawingData['sizeH']),size=wx.Size(60,20),style=wx.TE_PROCESS_ENTER)
    49795001            sizeH.Bind(wx.EVT_TEXT_ENTER,OnSizeHatoms)
     
    49825004   
    49835005            radSizer.Add(wx.StaticText(drawOptions,-1,' Bond search factor:  '),0,WACV)
     5006#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    49845007            radFactor = wx.TextCtrl(drawOptions,value='%.2f'%(drawingData['radiusFactor']),size=wx.Size(60,20),style=wx.TE_PROCESS_ENTER)
    49855008            radFactor.Bind(wx.EVT_TEXT_ENTER,OnRadFactor)
     
    50445067            planeSizer2 = wx.BoxSizer(wx.HORIZONTAL)
    50455068            planeSizer2.Add(wx.StaticText(drawOptions,label=' Phase shift (deg): '),0,WACV)
     5069#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    50465070            phase = wx.TextCtrl(drawOptions,value='%.2f'%(drawingData['Plane'][3]),
    50475071                style=wx.TE_PROCESS_ENTER)
     
    53225346            shPenalty.Add(hklList,0,WACV)
    53235347            shPenalty.Add(wx.StaticText(Texture,wx.ID_ANY,' Zero MRD tolerance: '),0,WACV)
     5348#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    53245349            shToler = wx.TextCtrl(Texture,wx.ID_ANY,'%.2f'%(Penalty[1]),style=wx.TE_PROCESS_ENTER)
    53255350            shToler.Bind(wx.EVT_TEXT_ENTER,OnshToler)
     
    54025427            PTSizer.Add(wx.StaticText(Texture,-1,' Inverse pole figure XYZ: '),0,WACV)
    54035428            PX = textureData['PFxyz']
     5429#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    54045430            pfVal = wx.TextCtrl(Texture,-1,'%3.1f %3.1f %3.1f'%(PX[0],PX[1],PX[2]),style=wx.TE_PROCESS_ENTER)
    54055431        pfVal.Bind(wx.EVT_TEXT_ENTER,OnPFValue)
     
    54295455            for item in ODFkeys:
    54305456                ODFSizer.Add(wx.StaticText(Texture,-1,item),0,WACV)
     5457#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    54315458                ODFval = wx.TextCtrl(Texture,wx.ID_ANY,'%8.3f'%(textureData['SH Coeff'][1][item]),style=wx.TE_PROCESS_ENTER)
    54325459                ODFIndx[ODFval.GetId()] = item
     
    54485475            angRef.Bind(wx.EVT_CHECKBOX, OnAngRef)
    54495476            angSizer.Add(angRef,0,WACV)
     5477#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    54505478            angVal = wx.TextCtrl(Texture,wx.ID_ANY,'%8.2f'%(textureData[item][1]),style=wx.TE_PROCESS_ENTER)
    54515479            valIndx[angVal.GetId()] = item
     
    58175845            for i,name in enumerate(names):
    58185846                thermSizer.Add(wx.StaticText(RigidBodies,-1,name+': '),0,WACV)
     5847#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    58195848                thermVal = wx.TextCtrl(RigidBodies,-1,value='%8.4f'%(model[1][i]),
    58205849                    style=wx.TE_PROCESS_ENTER)
     
    58895918            topSizer.Add(wx.StaticText(RigidBodies,-1,'Origin x,y,z:'),0,WACV)
    58905919            for ix,x in enumerate(Orig):
     5920#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    58915921                origX = wx.TextCtrl(RigidBodies,-1,value='%8.5f'%(x),style=wx.TE_PROCESS_ENTER)
    58925922                origX.Bind(wx.EVT_TEXT_ENTER,OnOrigX)
     
    59015931            topSizer.Add(wx.StaticText(RigidBodies,-1,'Rotation angle, vector:'),0,WACV)
    59025932            for ix,x in enumerate(Orien):
     5933#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    59035934                orien = wx.TextCtrl(RigidBodies,-1,value='%8.4f'%(x),style=wx.TE_PROCESS_ENTER)
    59045935                orien.Bind(wx.EVT_TEXT_ENTER,OnOrien)
     
    59665997            for itors,tors in enumerate(RBObj['Torsions']):
    59675998                torSizer.Add(wx.StaticText(RigidBodies,-1,'Torsion '+'%d'%(itors)),0,WACV)
     5999#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    59686000                torsTxt = wx.TextCtrl(RigidBodies,-1,value='%.3f'%(tors[0]),style=wx.TE_PROCESS_ENTER)
    59696001                torsTxt.Bind(wx.EVT_TEXT_ENTER,OnTorsion)
     
    63646396                        TorSizer.Add(torSlide,1,wx.EXPAND|wx.RIGHT)
    63656397                        TorSizer.Add(wx.StaticText(RigidBodies,-1,' Angle: '),0,WACV)
     6398#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    63666399                        ang = wx.TextCtrl(RigidBodies,-1,value='%8.3f'%(torsion[0]),style=wx.TE_PROCESS_ENTER)
    63676400                        ang.Bind(wx.EVT_TEXT_ENTER,OnTorAngle)
     
    66346667                Indx[posRef.GetId()] = [model,'Pos',ix]
    66356668                atomsizer.Add(posRef,0,WACV)
     6669#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    66366670                posVal = wx.TextCtrl(G2frame.MCSA,-1,'%.4f'%(model['Pos'][0][ix]),style=wx.TE_PROCESS_ENTER)
    66376671                posVal.Bind(wx.EVT_TEXT_ENTER,OnPosVal)
     
    67076741                Indx[posRef.GetId()] = [model,'Pos',ix]
    67086742                rbsizer1.Add(posRef,0,WACV)
     6743#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    67096744                posVal = wx.TextCtrl(G2frame.MCSA,-1,'%.4f'%(model['Pos'][0][ix]),style=wx.TE_PROCESS_ENTER)
    67106745                posVal.Bind(wx.EVT_TEXT_ENTER,OnPosVal)
     
    67296764            Ori = model['Ori'][0]
    67306765            rbsizer2.Add(wx.StaticText(G2frame.MCSA,-1,'Oa: '),0,WACV)
     6766#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    67316767            angVal = wx.TextCtrl(G2frame.MCSA,-1,'%.5f'%(Ori[0]),style=wx.TE_PROCESS_ENTER)
    67326768            angVal.Bind(wx.EVT_TEXT_ENTER,OnOriVal)
     
    67766812                    Indx[torRef.GetId()] = [model,'Tor',it]
    67776813                    rbsizer3.Add(torRef,0,WACV)
     6814#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    67786815                    torVal = wx.TextCtrl(G2frame.MCSA,-1,'%.4f'%(tor),style=wx.TE_PROCESS_ENTER)
    67796816                    torVal.Bind(wx.EVT_TEXT_ENTER,OnPosVal)
     
    68396876            poRef.Bind(wx.EVT_CHECKBOX,OnPORef)
    68406877            poSizer.Add(poRef,0,WACV)
     6878#        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    68416879            poVal = wx.TextCtrl(G2frame.MCSA,-1,'%.3f'%(POData['Coef'][0]),style=wx.TE_PROCESS_ENTER)
    68426880            poVal.Bind(wx.EVT_TEXT_ENTER,OnPOVal)
  • trunk/GSASIIpwdGUI.py

    r2570 r2572  
    26552655        G2frame.ifX20 = x20.GetValue()
    26562656       
    2657     def OnStartVol(event):
    2658         event.Skip()
    2659         try:
    2660             stVol = int(float(startVol.GetValue()))
    2661             if stVol < 25:
    2662                 raise ValueError
    2663         except ValueError:
    2664             stVol = 25
    2665         controls[3] = stVol
    2666         startVol.SetValue("%d"%(stVol))
    2667        
    26682657    def OnBravais(event):
    26692658        Obj = event.GetEventObject()
     
    31483137    NcNo.Bind(wx.EVT_SPINCTRL,OnNcNo)
    31493138    littleSizer.Add(NcNo,0,WACV)
    3150     littleSizer.Add(wx.StaticText(parent=G2frame.dataDisplay,label=' Start Volume '),0,WACV)
    3151 #        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    3152     startVol = wx.TextCtrl(G2frame.dataDisplay,value=str('%d'%(controls[3])),style=wx.TE_PROCESS_ENTER)
    3153     startVol.Bind(wx.EVT_TEXT_ENTER,OnStartVol)
    3154     startVol.Bind(wx.EVT_KILL_FOCUS,OnStartVol)
     3139    littleSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Start Volume '),0,WACV)
     3140    startVol = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,controls,3,typeHint=int,min=25)
    31553141    littleSizer.Add(startVol,0,WACV)
    31563142    x20 = wx.CheckBox(G2frame.dataDisplay,label='Use M20/(X20+1)?')
     
    41654151            wx.CallAfter(UpdateModelsGrid,G2frame,data)
    41664152           
    4167         def OnPartVal(event):
    4168             event.Skip()
    4169             try:
    4170                 val = max(0.0,float(partprm.GetValue()))
    4171             except ValueError:
    4172                 val = 1
    4173             data['Size']['Shape'][1] = val
    4174             partprm.SetValue('%.3f'%(val))
    4175            
    41764153        sizeSizer = wx.BoxSizer(wx.VERTICAL)
    41774154        sizeSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Size distribution parameters: '),0,WACV)
     
    42204197        if data['Size']['Shape'][0] not in ['Unified sphere',]:
    42214198            partSizer.Add(wx.StaticText(G2frame.dataDisplay,label=shapes[data['Size']['Shape'][0]]),0,WACV)
    4222 #        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    4223             partprm = wx.TextCtrl(G2frame.dataDisplay,value='%.3f'%(data['Size']['Shape'][1]),
    4224                 style=wx.TE_PROCESS_ENTER)
    4225             partprm.Bind(wx.EVT_TEXT_ENTER,OnPartVal)       
    4226             partprm.Bind(wx.EVT_KILL_FOCUS,OnPartVal)
     4199            partprm = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data['Size']['Shape'],1,
     4200                nDig=(10,3),typeHint=float,min=0.)
    42274201            partSizer.Add(partprm,0,WACV)
    42284202        sizeSizer.Add(partSizer,0)
     
    45234497        RefreshPlots(True)
    45244498       
    4525     def OnBackChange(event):
    4526         event.Skip()
    4527         try:
    4528             value = float(backVal.GetValue())
    4529         except ValueError:
    4530             value = 0.0
    4531         backVal.SetValue('%.3g'%(value))
    4532         data['Back'][0] = value
     4499    def OnBackChange(invalid,value,tc):
    45334500        Profile[4][:] = value
    45344501        RefreshPlots()
     
    45934560    backSizer = wx.BoxSizer(wx.HORIZONTAL)
    45944561    backSizer.Add(wx.StaticText(G2frame.dataDisplay,label=' Background:'),0,WACV)
    4595 #        azmthOff = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data,'azmthOff',nDig=(10,2),typeHint=float,OnLeave=OnAzmthOff)
    4596     backVal = wx.TextCtrl(G2frame.dataDisplay,value='%.3g'%(data['Back'][0]),style=wx.TE_PROCESS_ENTER)
    4597     Indx[backVal.GetId()] = ['Back',0,'%.3g']
    4598     backVal.Bind(wx.EVT_TEXT_ENTER,OnBackChange)       
    4599     backVal.Bind(wx.EVT_KILL_FOCUS,OnBackChange)
     4562    backVal = G2G.ValidatedTxtCtrl(G2frame.dataDisplay,data['Back'],0,
     4563        nDig=(10,3),typeHint=float,OnLeave=OnBackChange)
    46004564    backSizer.Add(backVal,0,WACV)
    46014565    backVar = wx.CheckBox(G2frame.dataDisplay,label='Refine?')
     
    48974861       
    48984862    def OnComputePDF(event):
    4899 #        print 'Calculating PDF:'
    49004863        if not data['ElList']:
    49014864            G2frame.ErrorDialog('PDF error','Chemical formula not defined')
    49024865            return
    49034866        auxPlot = ComputePDF(data)
    4904 #        print 'Done calculating PDF:'
    49054867        if not G2frame.dataFrame.GetStatusBar():
    49064868            Status = G2frame.dataFrame.CreateStatusBar()
Note: See TracChangeset for help on using the changeset viewer.