Changeset 3312


Ignore:
Timestamp:
Mar 7, 2018 11:05:50 AM (4 years ago)
Author:
toby
Message:

fix layers crashes, change checkbuttons to buttons for GUI consistency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIphsGUI.py

    r3311 r3312  
    37903790       
    37913791    def UpdateLayerData(Scroll=0):
     3792        '''Present the contents of the Phase/Layers tab for stacking fault simulation
     3793        '''
    37923794       
    37933795        laueChoice = ['-1','2/m(ab)','2/m(c)','mmm','-3','-3m','4/m','4/mmm',
     
    38033805        Indx = {}
    38043806       
    3805 #        def SetCell(laue,cell):
    3806 #            if laue in ['-3','-3m','6/m','6/mmm','4/m','4/mmm']:                   
    3807 #                cell[4] = cell[5] = 90.
    3808 #                cell[6] = 120.
    3809 #                if laue in ['4/m','4/mmm']:
    3810 #                    cell[6] = 90.
    3811 #                if ObjId == 0:
    3812 #                    cell[1] = cell[2] = value
    3813 #                    Obj.SetValue("%.5f"%(cell[1]))
    3814 #                else:
    3815 #                    cell[3] = value
    3816 #                    Obj.SetValue("%.5f"%(cell[3]))
    3817 #            elif laue in ['mmm']:
    3818 #                cell[ObjId+1] = value
    3819 #                cell[4] = cell[5] = cell[6] = 90.
    3820 #                Obj.SetValue("%.5f"%(cell[ObjId+1]))
    3821 #            elif laue in ['2/m','-1']:
    3822 #                cell[4] = cell[5] = 90.
    3823 #                if ObjId != 3:
    3824 #                    cell[ObjId+1] = value
    3825 #                    Obj.SetValue("%.5f"%(cell[ObjId+1]))
    3826 #                else:
    3827 #                    cell[6] = value
    3828 #                    Obj.SetValue("%.3f"%(cell[6]))
    3829 #            cell[7] = G2lat.calc_V(G2lat.cell2A(cell[1:7]))
    3830 
    38313807        def OnLaue(event):
    38323808            Obj = event.GetEventObject()
     
    39543930                Trans = [[[1.,0.,0.,0.,'',False],],]
    39553931            data['Layers']['Transitions'] = Trans
    3956             UpdateLayerData()
     3932            wx.CallAfter(UpdateLayerData)
    39573933           
    39583934        def OnDeleteLast(event):
     
    39613937            for trans in data['Layers']['Transitions']:
    39623938                del trans[-1]
    3963             UpdateLayerData()
     3939            wx.CallAfter(UpdateLayerData)
    39643940               
    39653941        def OnImportLayer(event):
     
    40033979                Trans = [[[1.,0.,0.,0.,'',False],],]
    40043980            data['Layers']['Transitions'] = Trans
    4005             UpdateLayerData()
     3981            wx.CallAfter(UpdateLayerData)
    40063982           
    40073983        def LayerSizer(il,Layer):
     
    43924368        titleSizer = wx.BoxSizer(wx.HORIZONTAL)
    43934369        titleSizer.Add(wx.StaticText(layerData,label=' Layer descriptions: '),0,WACV)
    4394         newLayer = wx.CheckBox(layerData,label=' Add new layer?')
    4395         newLayer.Bind(wx.EVT_CHECKBOX, OnNewLayer)
     4370        newLayer = wx.Button(layerData,label='Add new layer')
     4371        newLayer.Bind(wx.EVT_BUTTON, OnNewLayer)
    43964372        titleSizer.Add(newLayer,0,WACV)
    4397         importLayer = wx.CheckBox(layerData,label=' Import new layer?')
    4398         importLayer.Bind(wx.EVT_CHECKBOX, OnImportLayer)
     4373        importLayer = wx.Button(layerData,label=' Import new layer')
     4374        importLayer.Bind(wx.EVT_BUTTON, OnImportLayer)
    43994375        titleSizer.Add(importLayer,0,WACV)
    4400         deleteLast = wx.CheckBox(layerData,label=' Delete last layer?')
    4401         deleteLast.Bind(wx.EVT_CHECKBOX, OnDeleteLast)
     4376        deleteLast = wx.Button(layerData,label='Delete last layer')
     4377        deleteLast.Bind(wx.EVT_BUTTON, OnDeleteLast)
    44024378        titleSizer.Add(deleteLast,0,WACV)
    44034379        topSizer.Add(titleSizer,0,WACV)
Note: See TracChangeset for help on using the changeset viewer.