Changeset 439


Ignore:
Timestamp:
Dec 10, 2011 7:04:47 PM (10 years ago)
Author:
toby
Message:

do not destroy contents of scrolledwindow, as this deletes the scrollbars on Mac. Instead destroy the sizer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r437 r439  
    19931993                textureData['PFxyz'] = xyz
    19941994            G2plt.PlotTexture(self,data)
    1995                
    1996         Texture.DestroyChildren()
    1997         dataDisplay = wx.Panel(Texture)
     1995
     1996        if Texture.GetSizer():
     1997            Texture.GetSizer().Clear(True)
    19981998        mainSizer = wx.BoxSizer(wx.VERTICAL)
    19991999        titleSizer = wx.BoxSizer(wx.HORIZONTAL)
    2000         titleSizer.Add(wx.StaticText(dataDisplay,-1,'Spherical harmonics texture data for '+PhaseName+':'),0,wx.ALIGN_CENTER_VERTICAL)
    2001         titleSizer.Add(wx.StaticText(dataDisplay,-1,
     2000        titleSizer.Add(wx.StaticText(Texture,-1,'Spherical harmonics texture data for '+PhaseName+':'),0,wx.ALIGN_CENTER_VERTICAL)
     2001        titleSizer.Add(wx.StaticText(Texture,-1,
    20022002            ' Texture Index J = %7.3f'%(G2lat.textureIndex(textureData['SH Coeff'][1]))),
    20032003            0,wx.ALIGN_CENTER_VERTICAL)
     
    20052005        mainSizer.Add((0,5),0)
    20062006        shSizer = wx.FlexGridSizer(1,6,5,5)
    2007         shSizer.Add(wx.StaticText(dataDisplay,-1,'Texture model: '),0,wx.ALIGN_CENTER_VERTICAL)
    2008         shModel = wx.ComboBox(dataDisplay,-1,value=textureData['Model'],choices=shModels,
     2007        shSizer.Add(wx.StaticText(Texture,-1,'Texture model: '),0,wx.ALIGN_CENTER_VERTICAL)
     2008        shModel = wx.ComboBox(Texture,-1,value=textureData['Model'],choices=shModels,
    20092009            style=wx.CB_READONLY|wx.CB_DROPDOWN)
    20102010        shModel.Bind(wx.EVT_COMBOBOX,OnShModel)
    20112011        shSizer.Add(shModel,0,wx.ALIGN_CENTER_VERTICAL)
    2012         shSizer.Add(wx.StaticText(dataDisplay,-1,'  Harmonic order: '),0,wx.ALIGN_CENTER_VERTICAL)
    2013         shOrder = wx.ComboBox(dataDisplay,-1,value=str(textureData['Order']),choices=[str(2*i) for i in range(18)],
     2012        shSizer.Add(wx.StaticText(Texture,-1,'  Harmonic order: '),0,wx.ALIGN_CENTER_VERTICAL)
     2013        shOrder = wx.ComboBox(Texture,-1,value=str(textureData['Order']),choices=[str(2*i) for i in range(18)],
    20142014            style=wx.CB_READONLY|wx.CB_DROPDOWN)
    20152015        shOrder.Bind(wx.EVT_COMBOBOX,OnShOrder)
    20162016        shSizer.Add(shOrder,0,wx.ALIGN_CENTER_VERTICAL)
    2017         shRef = wx.CheckBox(dataDisplay,-1,label=' Refine texture?')
     2017        shRef = wx.CheckBox(Texture,-1,label=' Refine texture?')
    20182018        shRef.SetValue(textureData['SH Coeff'][0])
    20192019        shRef.Bind(wx.EVT_CHECKBOX, OnSHRefine)
    20202020        shSizer.Add(shRef,0,wx.ALIGN_CENTER_VERTICAL)
    2021         shShow = wx.CheckBox(dataDisplay,-1,label=' Show coeff.?')
     2021        shShow = wx.CheckBox(Texture,-1,label=' Show coeff.?')
    20222022        shShow.SetValue(textureData['SHShow'])
    20232023        shShow.Bind(wx.EVT_CHECKBOX, OnSHShow)
     
    20262026        mainSizer.Add((0,5),0)
    20272027        PTSizer = wx.FlexGridSizer(2,4,5,5)
    2028         PTSizer.Add(wx.StaticText(dataDisplay,-1,' Texture plot type: '),0,wx.ALIGN_CENTER_VERTICAL)
     2028        PTSizer.Add(wx.StaticText(Texture,-1,' Texture plot type: '),0,wx.ALIGN_CENTER_VERTICAL)
    20292029        choices = ['Axial pole distribution','Pole figure','Inverse pole figure']           
    2030         pfType = wx.ComboBox(dataDisplay,-1,value=str(textureData['PlotType']),choices=choices,
     2030        pfType = wx.ComboBox(Texture,-1,value=str(textureData['PlotType']),choices=choices,
    20312031            style=wx.CB_READONLY|wx.CB_DROPDOWN)
    20322032        pfType.Bind(wx.EVT_COMBOBOX,OnPfType)
    20332033        PTSizer.Add(pfType,0,wx.ALIGN_CENTER_VERTICAL)
    20342034        if 'Axial' not in textureData['PlotType']:
    2035             PTSizer.Add(wx.StaticText(dataDisplay,-1,' Projection type: '),0,wx.ALIGN_CENTER_VERTICAL)
    2036             projSel = wx.ComboBox(dataDisplay,-1,value=self.Projection,choices=['equal area','stereographic','3D display'],
     2035            PTSizer.Add(wx.StaticText(Texture,-1,' Projection type: '),0,wx.ALIGN_CENTER_VERTICAL)
     2036            projSel = wx.ComboBox(Texture,-1,value=self.Projection,choices=['equal area','stereographic','3D display'],
    20372037                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    20382038            projSel.Bind(wx.EVT_COMBOBOX,OnProjSel)
    20392039            PTSizer.Add(projSel,0,wx.ALIGN_CENTER_VERTICAL)
    20402040        if textureData['PlotType'] in ['Pole figure','Axial pole distribution']:
    2041             PTSizer.Add(wx.StaticText(dataDisplay,-1,' Pole figure HKL: '),0,wx.ALIGN_CENTER_VERTICAL)
     2041            PTSizer.Add(wx.StaticText(Texture,-1,' Pole figure HKL: '),0,wx.ALIGN_CENTER_VERTICAL)
    20422042            PH = textureData['PFhkl']
    2043             pfVal = wx.TextCtrl(dataDisplay,-1,'%d %d %d'%(PH[0],PH[1],PH[2]),style=wx.TE_PROCESS_ENTER)
     2043            pfVal = wx.TextCtrl(Texture,-1,'%d %d %d'%(PH[0],PH[1],PH[2]),style=wx.TE_PROCESS_ENTER)
    20442044        else:
    2045             PTSizer.Add(wx.StaticText(dataDisplay,-1,' Inverse pole figure XYZ: '),0,wx.ALIGN_CENTER_VERTICAL)
     2045            PTSizer.Add(wx.StaticText(Texture,-1,' Inverse pole figure XYZ: '),0,wx.ALIGN_CENTER_VERTICAL)
    20462046            PX = textureData['PFxyz']
    2047             pfVal = wx.TextCtrl(dataDisplay,-1,'%3.1f %3.1f %3.1f'%(PX[0],PX[1],PX[2]),style=wx.TE_PROCESS_ENTER)
     2047            pfVal = wx.TextCtrl(Texture,-1,'%3.1f %3.1f %3.1f'%(PX[0],PX[1],PX[2]),style=wx.TE_PROCESS_ENTER)
    20482048        pfVal.Bind(wx.EVT_TEXT_ENTER,OnPFValue)
    20492049        pfVal.Bind(wx.EVT_KILL_FOCUS,OnPFValue)
    20502050        PTSizer.Add(pfVal,0,wx.ALIGN_CENTER_VERTICAL)
    20512051        if 'Axial' not in textureData['PlotType']:
    2052             PTSizer.Add(wx.StaticText(dataDisplay,-1,' Color scheme'),0,wx.ALIGN_CENTER_VERTICAL)
     2052            PTSizer.Add(wx.StaticText(Texture,-1,' Color scheme'),0,wx.ALIGN_CENTER_VERTICAL)
    20532053            choice = [m for m in mpl.cm.datad.keys() if not m.endswith("_r")]
    20542054            choice.sort()
    2055             colorSel = wx.ComboBox(dataDisplay,-1,value=self.ContourColor,choices=choice,
     2055            colorSel = wx.ComboBox(Texture,-1,value=self.ContourColor,choices=choice,
    20562056                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    20572057            colorSel.Bind(wx.EVT_COMBOBOX,OnColorSel)
     
    20602060        mainSizer.Add((0,5),0)
    20612061        if textureData['SHShow']:
    2062             mainSizer.Add(wx.StaticText(dataDisplay,-1,'Spherical harmonic coefficients: '),0,wx.ALIGN_CENTER_VERTICAL)
     2062            mainSizer.Add(wx.StaticText(Texture,-1,'Spherical harmonic coefficients: '),0,wx.ALIGN_CENTER_VERTICAL)
    20632063            mainSizer.Add((0,5),0)
    20642064            ODFSizer = wx.FlexGridSizer(2,8,2,2)
     
    20672067            ODFkeys.sort()
    20682068            for item in ODFkeys:
    2069                 ODFSizer.Add(wx.StaticText(dataDisplay,-1,item),0,wx.ALIGN_CENTER_VERTICAL)
    2070                 ODFval = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%8.3f'%(textureData['SH Coeff'][1][item]),style=wx.TE_PROCESS_ENTER)
     2069                ODFSizer.Add(wx.StaticText(Texture,-1,item),0,wx.ALIGN_CENTER_VERTICAL)
     2070                ODFval = wx.TextCtrl(Texture,wx.ID_ANY,'%8.3f'%(textureData['SH Coeff'][1][item]),style=wx.TE_PROCESS_ENTER)
    20712071                ODFIndx[ODFval.GetId()] = item
    20722072                ODFval.Bind(wx.EVT_TEXT_ENTER,OnODFValue)
     
    20762076            mainSizer.Add((0,5),0)
    20772077        mainSizer.Add((0,5),0)
    2078         mainSizer.Add(wx.StaticText(dataDisplay,-1,'Sample orientation angles: '),0,wx.ALIGN_CENTER_VERTICAL)
     2078        mainSizer.Add(wx.StaticText(Texture,-1,'Sample orientation angles: '),0,wx.ALIGN_CENTER_VERTICAL)
    20792079        mainSizer.Add((0,5),0)
    20802080        angSizer = wx.BoxSizer(wx.HORIZONTAL)
     
    20822082        valIndx = {}
    20832083        for item in ['Sample omega','Sample chi','Sample phi']:
    2084             angRef = wx.CheckBox(dataDisplay,-1,label=item+': ')
     2084            angRef = wx.CheckBox(Texture,-1,label=item+': ')
    20852085            angRef.SetValue(textureData[item][0])
    20862086            angIndx[angRef.GetId()] = item
    20872087            angRef.Bind(wx.EVT_CHECKBOX, OnAngRef)
    20882088            angSizer.Add(angRef,0,wx.ALIGN_CENTER_VERTICAL)
    2089             angVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%8.2f'%(textureData[item][1]),style=wx.TE_PROCESS_ENTER)
     2089            angVal = wx.TextCtrl(Texture,wx.ID_ANY,'%8.2f'%(textureData[item][1]),style=wx.TE_PROCESS_ENTER)
    20902090            valIndx[angVal.GetId()] = item
    20912091            angVal.Bind(wx.EVT_TEXT_ENTER,OnAngValue)
     
    20942094            angSizer.Add((5,0),0)
    20952095        mainSizer.Add(angSizer,0,wx.ALIGN_CENTER_VERTICAL)
    2096         dataDisplay.SetSizer(mainSizer,True)
     2096        Texture.SetSizer(mainSizer,True)
    20972097        mainSizer.Fit(self.dataFrame)
    20982098        Size = mainSizer.GetMinSize()
    20992099        Size[0] += 40
    21002100        Size[1] = max(Size[1],250) + 20
    2101         dataDisplay.SetSize(Size)
     2101        Texture.SetSize(Size)
    21022102        Texture.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1)
    21032103        Size[1] = min(Size[1],450)
     
    23852385            plotSizer = wx.BoxSizer(wx.VERTICAL)
    23862386            choice = ['Mustrain','Size','Preferred orientation']
    2387             plotSel = wx.RadioBox(dataDisplay,-1,'Select plot type:',choices=choice,
     2387            plotSel = wx.RadioBox(DData,-1,'Select plot type:',choices=choice,
    23882388                majorDimension=3,style=wx.RA_SPECIFY_COLS)
    23892389            plotSel.SetStringSelection(generalData['Data plot type'])
     
    23922392            if generalData['Data plot type'] == 'Preferred orientation':
    23932393                POhklSizer = wx.BoxSizer(wx.HORIZONTAL)
    2394                 POhklSizer.Add(wx.StaticText(dataDisplay,-1,' Plot preferred orientation for H K L: '),0,wx.ALIGN_CENTER_VERTICAL)
     2394                POhklSizer.Add(wx.StaticText(DData,-1,' Plot preferred orientation for H K L: '),0,wx.ALIGN_CENTER_VERTICAL)
    23952395                h,k,l = generalData['POhkl']
    2396                 poAxis = wx.TextCtrl(dataDisplay,-1,'%3d %3d %3d'%(h,k,l),style=wx.TE_PROCESS_ENTER)
     2396                poAxis = wx.TextCtrl(DData,-1,'%3d %3d %3d'%(h,k,l),style=wx.TE_PROCESS_ENTER)
    23972397                poAxis.Bind(wx.EVT_TEXT_ENTER,OnPOhkl)
    23982398                poAxis.Bind(wx.EVT_KILL_FOCUS,OnPOhkl)
     
    24032403        def ScaleSizer():
    24042404            scaleSizer = wx.BoxSizer(wx.HORIZONTAL)
    2405             scaleRef = wx.CheckBox(dataDisplay,-1,label=' Phase fraction: ')
     2405            scaleRef = wx.CheckBox(DData,-1,label=' Phase fraction: ')
    24062406            scaleRef.SetValue(UseList[item]['Scale'][1])
    24072407            Indx[scaleRef.GetId()] = item
    24082408            scaleRef.Bind(wx.EVT_CHECKBOX, OnScaleRef)
    24092409            scaleSizer.Add(scaleRef,0,wx.ALIGN_CENTER_VERTICAL)
    2410             scaleVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,
     2410            scaleVal = wx.TextCtrl(DData,wx.ID_ANY,
    24112411                '%.4f'%(UseList[item]['Scale'][0]),style=wx.TE_PROCESS_ENTER)
    24122412            Indx[scaleVal.GetId()] = item
     
    24182418        def TopSizer(name,choices,parm,OnType):
    24192419            topSizer = wx.BoxSizer(wx.HORIZONTAL)
    2420             topSizer.Add(wx.StaticText(dataDisplay,-1,name),0,wx.ALIGN_CENTER_VERTICAL)
    2421             sizeType = wx.ComboBox(dataDisplay,wx.ID_ANY,value=UseList[item][parm][0],choices=choices,
     2420            topSizer.Add(wx.StaticText(DData,-1,name),0,wx.ALIGN_CENTER_VERTICAL)
     2421            sizeType = wx.ComboBox(DData,wx.ID_ANY,value=UseList[item][parm][0],choices=choices,
    24222422                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    24232423            sizeType.Bind(wx.EVT_COMBOBOX, OnType)
     
    24292429        def IsoSizer(name,parm,fmt,OnVal,OnRef):
    24302430            isoSizer = wx.BoxSizer(wx.HORIZONTAL)
    2431             sizeRef = wx.CheckBox(dataDisplay,-1,label=name)
     2431            sizeRef = wx.CheckBox(DData,-1,label=name)
    24322432            sizeRef.thisown = False
    24332433            sizeRef.SetValue(UseList[item][parm][2][0])
     
    24352435            sizeRef.Bind(wx.EVT_CHECKBOX, OnRef)
    24362436            isoSizer.Add(sizeRef,0,wx.ALIGN_CENTER_VERTICAL)
    2437             sizeVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,
     2437            sizeVal = wx.TextCtrl(DData,wx.ID_ANY,
    24382438                fmt%(UseList[item][parm][1][0]),style=wx.TE_PROCESS_ENTER)
    24392439            Indx[sizeVal.GetId()] = [item,0]
     
    24452445        def UniSizer(parm,OnAxis):
    24462446            uniSizer = wx.BoxSizer(wx.HORIZONTAL)
    2447             uniSizer.Add(wx.StaticText(dataDisplay,-1,' Unique axis, H K L: '),0,wx.ALIGN_CENTER_VERTICAL)
     2447            uniSizer.Add(wx.StaticText(DData,-1,' Unique axis, H K L: '),0,wx.ALIGN_CENTER_VERTICAL)
    24482448            h,k,l = UseList[item][parm][3]
    2449             Axis = wx.TextCtrl(dataDisplay,-1,'%3d %3d %3d'%(h,k,l),style=wx.TE_PROCESS_ENTER)
     2449            Axis = wx.TextCtrl(DData,-1,'%3d %3d %3d'%(h,k,l),style=wx.TE_PROCESS_ENTER)
    24502450            Indx[Axis.GetId()] = item
    24512451            Axis.Bind(wx.EVT_TEXT_ENTER,OnAxis)
     
    24592459                UseList[item][parm][1],UseList[item][parm][2],range(2))
    24602460            for Pa,val,ref,id in parms:
    2461                 sizeRef = wx.CheckBox(dataDisplay,-1,label=Pa)
     2461                sizeRef = wx.CheckBox(DData,-1,label=Pa)
    24622462                sizeRef.thisown = False
    24632463                sizeRef.SetValue(ref)
     
    24652465                sizeRef.Bind(wx.EVT_CHECKBOX, OnRef)
    24662466                dataSizer.Add(sizeRef,0,wx.ALIGN_CENTER_VERTICAL)
    2467                 sizeVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,fmt%(val),style=wx.TE_PROCESS_ENTER)
     2467                sizeVal = wx.TextCtrl(DData,wx.ID_ANY,fmt%(val),style=wx.TE_PROCESS_ENTER)
    24682468                Indx[sizeVal.GetId()] = [item,id]
    24692469                sizeVal.Bind(wx.EVT_TEXT_ENTER,OnVal)
     
    24782478            dataSizer = wx.FlexGridSizer(1,6,5,5)
    24792479            for Pa,val,ref,id in parms:
    2480                 sizeRef = wx.CheckBox(dataDisplay,-1,label=Pa)
     2480                sizeRef = wx.CheckBox(DData,-1,label=Pa)
    24812481                sizeRef.thisown = False
    24822482                sizeRef.SetValue(ref)
     
    24842484                sizeRef.Bind(wx.EVT_CHECKBOX, OnSizeRef)
    24852485                dataSizer.Add(sizeRef,0,wx.ALIGN_CENTER_VERTICAL)
    2486                 sizeVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%.3f'%(val),style=wx.TE_PROCESS_ENTER)
     2486                sizeVal = wx.TextCtrl(DData,wx.ID_ANY,'%.3f'%(val),style=wx.TE_PROCESS_ENTER)
    24872487                Indx[sizeVal.GetId()] = [item,id]
    24882488                sizeVal.Bind(wx.EVT_TEXT_ENTER,OnSizeVal)
     
    25002500            dataSizer = wx.FlexGridSizer(1,6,5,5)
    25012501            for Pa,val,ref,id in parms:
    2502                 strainRef = wx.CheckBox(dataDisplay,-1,label=Pa)
     2502                strainRef = wx.CheckBox(DData,-1,label=Pa)
    25032503                strainRef.thisown = False
    25042504                strainRef.SetValue(ref)
     
    25062506                strainRef.Bind(wx.EVT_CHECKBOX, OnStrainRef)
    25072507                dataSizer.Add(strainRef,0,wx.ALIGN_CENTER_VERTICAL)
    2508                 strainVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%.5f'%(val),style=wx.TE_PROCESS_ENTER)
     2508                strainVal = wx.TextCtrl(DData,wx.ID_ANY,'%.5f'%(val),style=wx.TE_PROCESS_ENTER)
    25092509                Indx[strainVal.GetId()] = [item,id]
    25102510                strainVal.Bind(wx.EVT_TEXT_ENTER,OnStrainVal)
     
    25182518            parms = zip(Hsnames,UseList[item]['HStrain'][0],UseList[item]['HStrain'][1],range(len(Hsnames)))
    25192519            for Pa,val,ref,id in parms:
    2520                 hstrainRef = wx.CheckBox(dataDisplay,-1,label=Pa)
     2520                hstrainRef = wx.CheckBox(DData,-1,label=Pa)
    25212521                hstrainRef.thisown = False
    25222522                hstrainRef.SetValue(ref)
     
    25242524                hstrainRef.Bind(wx.EVT_CHECKBOX, OnHstrainRef)
    25252525                hstrainSizer.Add(hstrainRef,0,wx.ALIGN_CENTER_VERTICAL)
    2526                 hstrainVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%.5f'%(val),style=wx.TE_PROCESS_ENTER)
     2526                hstrainVal = wx.TextCtrl(DData,wx.ID_ANY,'%.5f'%(val),style=wx.TE_PROCESS_ENTER)
    25272527                Indx[hstrainVal.GetId()] = [item,id]
    25282528                hstrainVal.Bind(wx.EVT_TEXT_ENTER,OnHstrainVal)
     
    25352535            choice = ['March-Dollase','Spherical harmonics']
    25362536            POtype = choice[['MD','SH'].index(POData[0])]
    2537             poSizer.Add(wx.StaticText(dataDisplay,-1,' Preferred orientation model '),0,wx.ALIGN_CENTER_VERTICAL)
    2538             POType = wx.ComboBox(dataDisplay,wx.ID_ANY,value=POtype,choices=choice,
     2537            poSizer.Add(wx.StaticText(DData,-1,' Preferred orientation model '),0,wx.ALIGN_CENTER_VERTICAL)
     2538            POType = wx.ComboBox(DData,wx.ID_ANY,value=POtype,choices=choice,
    25392539                style=wx.CB_READONLY|wx.CB_DROPDOWN)
    25402540            Indx[POType.GetId()] = item
     
    25422542            poSizer.Add(POType)
    25432543            if POData[0] == 'SH':
    2544                 poSizer.Add(wx.StaticText(dataDisplay,-1,' Harmonic order: '),0,wx.ALIGN_CENTER_VERTICAL)
    2545                 poOrder = wx.ComboBox(dataDisplay,wx.ID_ANY,value=str(POData[4]),choices=[str(2*i) for i in range(18)],
     2544                poSizer.Add(wx.StaticText(DData,-1,' Harmonic order: '),0,wx.ALIGN_CENTER_VERTICAL)
     2545                poOrder = wx.ComboBox(DData,wx.ID_ANY,value=str(POData[4]),choices=[str(2*i) for i in range(18)],
    25462546                    style=wx.CB_READONLY|wx.CB_DROPDOWN)
    25472547                Indx[poOrder.GetId()] = item
    25482548                poOrder.Bind(wx.EVT_COMBOBOX,OnPOOrder)
    25492549                poSizer.Add(poOrder,0,wx.ALIGN_CENTER_VERTICAL)
    2550                 poRef = wx.CheckBox(dataDisplay,-1,label=' Refine? ')
     2550                poRef = wx.CheckBox(DData,-1,label=' Refine? ')
    25512551                poRef.SetValue(POData[2])
    25522552                Indx[poRef.GetId()] = item
     
    25572557        def MDDataSizer(POData):
    25582558            poSizer = wx.BoxSizer(wx.HORIZONTAL)
    2559             poRef = wx.CheckBox(dataDisplay,-1,label=' March-Dollase ratio: ')
     2559            poRef = wx.CheckBox(DData,-1,label=' March-Dollase ratio: ')
    25602560            poRef.SetValue(POData[2])
    25612561            Indx[poRef.GetId()] = item
    25622562            poRef.Bind(wx.EVT_CHECKBOX,OnPORef)
    25632563            poSizer.Add(poRef,0,wx.ALIGN_CENTER_VERTICAL)
    2564             poVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,
     2564            poVal = wx.TextCtrl(DData,wx.ID_ANY,
    25652565                '%.3f'%(POData[1]),style=wx.TE_PROCESS_ENTER)
    25662566            Indx[poVal.GetId()] = item
     
    25682568            poVal.Bind(wx.EVT_KILL_FOCUS,OnPOVal)
    25692569            poSizer.Add(poVal,0,wx.ALIGN_CENTER_VERTICAL)
    2570             poSizer.Add(wx.StaticText(dataDisplay,-1,' Unique axis, H K L: '),0,wx.ALIGN_CENTER_VERTICAL)
     2570            poSizer.Add(wx.StaticText(DData,-1,' Unique axis, H K L: '),0,wx.ALIGN_CENTER_VERTICAL)
    25712571            h,k,l =POData[3]
    2572             poAxis = wx.TextCtrl(dataDisplay,-1,'%3d %3d %3d'%(h,k,l),style=wx.TE_PROCESS_ENTER)
     2572            poAxis = wx.TextCtrl(DData,-1,'%3d %3d %3d'%(h,k,l),style=wx.TE_PROCESS_ENTER)
    25732573            Indx[poAxis.GetId()] = item
    25742574            poAxis.Bind(wx.EVT_TEXT_ENTER,OnPOAxis)
     
    25792579        def SHDataSizer(POData):
    25802580            textJ = G2lat.textureIndex(POData[5])
    2581             mainSizer.Add(wx.StaticText(dataDisplay,-1,' Spherical harmonic coefficients: '+'Texture index: %.3f'%(textJ)),0,wx.ALIGN_CENTER_VERTICAL)
     2581            mainSizer.Add(wx.StaticText(DData,-1,' Spherical harmonic coefficients: '+'Texture index: %.3f'%(textJ)),0,wx.ALIGN_CENTER_VERTICAL)
    25822582            mainSizer.Add((0,5),0)
    25832583            ODFSizer = wx.FlexGridSizer(2,8,2,2)
     
    25862586            ODFkeys.sort()
    25872587            for odf in ODFkeys:
    2588                 ODFSizer.Add(wx.StaticText(dataDisplay,-1,odf),0,wx.ALIGN_CENTER_VERTICAL)
    2589                 ODFval = wx.TextCtrl(dataDisplay,wx.ID_ANY,'%8.3f'%(POData[5][odf]),style=wx.TE_PROCESS_ENTER)
     2588                ODFSizer.Add(wx.StaticText(DData,-1,odf),0,wx.ALIGN_CENTER_VERTICAL)
     2589                ODFval = wx.TextCtrl(DData,wx.ID_ANY,'%8.3f'%(POData[5][odf]),style=wx.TE_PROCESS_ENTER)
    25902590                ODFIndx[ODFval.GetId()] = odf
    25912591#                ODFval.Bind(wx.EVT_TEXT_ENTER,OnODFValue)
     
    25962596        def ExtSizer():           
    25972597            extSizer = wx.BoxSizer(wx.HORIZONTAL)
    2598             extRef = wx.CheckBox(dataDisplay,-1,label=' Extinction: ')
     2598            extRef = wx.CheckBox(DData,-1,label=' Extinction: ')
    25992599            extRef.SetValue(UseList[item]['Extinction'][1])
    26002600            Indx[extRef.GetId()] = item
    26012601            extRef.Bind(wx.EVT_CHECKBOX, OnExtRef)
    26022602            extSizer.Add(extRef,0,wx.ALIGN_CENTER_VERTICAL)
    2603             extVal = wx.TextCtrl(dataDisplay,wx.ID_ANY,
     2603            extVal = wx.TextCtrl(DData,wx.ID_ANY,
    26042604                '%.2f'%(UseList[item]['Extinction'][0]),style=wx.TE_PROCESS_ENTER)
    26052605            Indx[extVal.GetId()] = item
     
    26092609            return extSizer
    26102610           
    2611 
    2612         DData.DestroyChildren()
    2613         dataDisplay = wx.Panel(DData)
     2611        if DData.GetSizer():
     2612            DData.GetSizer().Clear(True)
    26142613        mainSizer = wx.BoxSizer(wx.VERTICAL)
    2615         mainSizer.Add(wx.StaticText(dataDisplay,-1,'Histogram data for '+PhaseName+':'),0,wx.ALIGN_CENTER_VERTICAL)
     2614        mainSizer.Add(wx.StaticText(DData,-1,'Histogram data for '+PhaseName+':'),0,wx.ALIGN_CENTER_VERTICAL)
    26162615        mainSizer.Add(PlotSizer())           
    26172616           
     
    26202619           
    26212620            showSizer = wx.BoxSizer(wx.HORIZONTAL)
    2622             showData = wx.CheckBox(dataDisplay,-1,label=' Show '+item)
     2621            showData = wx.CheckBox(DData,-1,label=' Show '+item)
    26232622            showData.SetValue(UseList[item]['Show'])
    26242623            Indx[showData.GetId()] = item
    26252624            showData.Bind(wx.EVT_CHECKBOX, OnShowData)
    26262625            showSizer.Add(showData,0,wx.ALIGN_CENTER_VERTICAL)
    2627             copyData = wx.Button(dataDisplay,-1,label=' Copy?')
     2626            copyData = wx.Button(DData,-1,label=' Copy?')
    26282627            Indx[copyData.GetId()] = item
    26292628            copyData.Bind(wx.EVT_BUTTON,OnCopyData)
     
    26562655                    ellSizer.Add(TopSizer(' Size model: ',['isotropic','uniaxial','ellipsoidal'],
    26572656                        'Size',OnSizeType),0,wx.ALIGN_CENTER_VERTICAL)
    2658                     ellSizer.Add(wx.StaticText(dataDisplay,-1,u' Coefficients(\xb5m): '),0,wx.ALIGN_CENTER_VERTICAL)
     2657                    ellSizer.Add(wx.StaticText(DData,-1,u' Coefficients(\xb5m): '),0,wx.ALIGN_CENTER_VERTICAL)
    26592658                    mainSizer.Add(ellSizer)
    26602659                    mainSizer.Add(EllSizeDataSizer())
     
    26802679                    genSizer.Add(TopSizer(' Mustrain model: ',['isotropic','uniaxial','generalized',],
    26812680                        'Mustrain',OnStrainType),0,wx.ALIGN_CENTER_VERTICAL)
    2682                     genSizer.Add(wx.StaticText(dataDisplay,-1,' Coefficients: '),0,wx.ALIGN_CENTER_VERTICAL)
     2681                    genSizer.Add(wx.StaticText(DData,-1,' Coefficients: '),0,wx.ALIGN_CENTER_VERTICAL)
    26832682                    mainSizer.Add(genSizer)
    26842683                    mainSizer.Add(GenStrainDataSizer())                       
    26852684                mainSizer.Add((0,5),0)
    26862685               
    2687                 mainSizer.Add(wx.StaticText(dataDisplay,-1,' Hydrostatic/elastic strain:'))
     2686                mainSizer.Add(wx.StaticText(DData,-1,' Hydrostatic/elastic strain:'))
    26882687                mainSizer.Add(HstrainSizer())
    26892688                   
     
    27072706        mainSizer.Add((5,5),0)
    27082707
    2709         dataDisplay.SetSizer(mainSizer,True)
     2708        DData.SetSizer(mainSizer,True)
    27102709        mainSizer.FitInside(self.dataFrame)
    27112710        Size = mainSizer.GetMinSize()
    27122711        Size[0] += 40
    27132712        Size[1] = max(Size[1],250) + 20
    2714         dataDisplay.SetSize(Size)
     2713        DData.SetSize(Size)
    27152714        DData.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1)
    27162715        Size[1] = min(Size[1],450)
Note: See TracChangeset for help on using the changeset viewer.