Changeset 2434


Ignore:
Timestamp:
Aug 18, 2016 6:08:27 PM (6 years ago)
Author:
toby
Message:

Fix constraint edit bug in wx3.0; relabel constraint menu items to avoid Mac glitch & make meaning more clear

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIconstrGUI.py

    r2431 r2434  
    668668                    data[constrDictEnt] += newcons
    669669        dlg.Destroy()
    670         OnPageChanged(None)
     670        wx.CallAfter(OnPageChanged,None)
    671671       
    672672    def OnAddEquivalence(event):
     
    761761                    data[constrDictEnt] += newcons
    762762        dlg.Destroy()
    763         OnPageChanged(None)
     763        wx.CallAfter(OnPageChanged,None)
    764764                       
    765765    def FindNeighbors(phase,FrstName,AtNames):
     
    858858                if CheckAddedConstraint(newcons):
    859859                    data[constrDictEnt] += newcons
    860         OnPageChanged(None)
     860        wx.CallAfter(OnPageChanged,None)
    861861                       
    862862    def MakeConstraintsSizer(name,pageDisplay):
     
    989989        Id,name = Indx[Obj.GetId()]
    990990        del(data[name][Id])
    991         OnPageChanged(None)       
     991        wx.CallAfter(OnPageChanged,None)
    992992       
    993993    def OnConstEdit(event):
     
    10471047            print traceback.format_exc()
    10481048        finally:
    1049             dlg.Destroy()           
    1050         OnPageChanged(None)                     
     1049            dlg.Destroy()
     1050        wx.CallAfter(OnPageChanged,None)
    10511051   
    10521052    def UpdateConstraintPanel(panel,typ):
     
    11041104                 G2gd.wxID_CONSGLOBAL).index(event.GetId())
    11051105            G2frame.dataDisplay.SetSelection(i)
    1106             OnPageChanged(None)
     1106            wx.CallAfter(OnPageChanged,None)
    11071107        except ValueError:
    11081108            print('Unexpected event in RaisePage')
     
    11431143    GlobalConstr = wx.ScrolledWindow(G2frame.dataDisplay)
    11441144    G2frame.dataDisplay.AddPage(GlobalConstr,'Global constraints')
    1145     OnPageChanged(None) # show initial page
     1145    wx.CallAfter(OnPageChanged,None)
    11461146    G2frame.dataDisplay.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, OnPageChanged)
    11471147    # validate all the constrants -- should not see any errors here normally
     
    19721972    UpdateVectorRB()
    19731973    G2frame.dataDisplay.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, OnPageChanged)
    1974     OnPageChanged(None)
     1974    wx.CallAfter(OnPageChanged,None)
  • trunk/GSASIIgrid.py

    r2433 r2434  
    13771377                help='Select '+txt+' constraint editing tab')
    13781378        self.ConstraintEdit = wx.Menu(title='')
    1379         self.ConstraintMenu.Append(menu=self.ConstraintEdit, title='Edit')
     1379        self.ConstraintMenu.Append(menu=self.ConstraintEdit, title='Edit Constr.') # renamed from Edit due to Mac adding extra items to menu
    13801380        self.ConstraintEdit.Append(id=wxID_HOLDADD, kind=wx.ITEM_NORMAL,text='Add hold',
    1381             help='Add hold on a parameter value')
     1381            help='Prevent refinement of parameter values')
    13821382        self.ConstraintEdit.Append(id=wxID_EQUIVADD, kind=wx.ITEM_NORMAL,text='Add equivalence',
    1383             help='Add equivalence between parameter values')
    1384         self.ConstraintEdit.Append(id=wxID_CONSTRAINTADD, kind=wx.ITEM_NORMAL,text='Add constraint',
    1385             help='Add constraint on parameter values')
     1383            help='Force parameter values to be equivalent')
     1384        self.ConstraintEdit.Append(id=wxID_CONSTRAINTADD, kind=wx.ITEM_NORMAL,text='Add constraint equation',
     1385            help='Add a constraint equation to apply to parameter values')
    13861386        self.ConstraintEdit.Append(id=wxID_FUNCTADD, kind=wx.ITEM_NORMAL,text='Add New Var',
    1387             help='Add variable composed of existing parameter')
    1388         self.ConstraintEdit.Append(id=wxID_EQUIVALANCEATOMS, kind=wx.ITEM_NORMAL,text='Add atom equivalence',
    1389             help='Add equivalences between atom parameter values')
     1387            help='Create a variable composed of existing parameters')
     1388        self.ConstraintEdit.Append(id=wxID_EQUIVALANCEATOMS, kind=wx.ITEM_NORMAL,text='Make atoms equivalent',
     1389            help='Force atom parameter values to be equivalent')
    13901390        self.ConstraintEdit.Enable(wxID_EQUIVALANCEATOMS,False)
    13911391#        self.ConstraintEdit.Append(id=wxID_ADDRIDING, kind=wx.ITEM_NORMAL,text='Add H riding constraints',
Note: See TracChangeset for help on using the changeset viewer.