Ignore:
Timestamp:
Jun 7, 2019 7:48:58 AM (5 years ago)
Author:
vondreele
Message:

put directions for delete restraints in status bar; fix bug in G2spc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIrestrGUI.py

    r3856 r4019  
    5252    or individual cells can be selected. The column for selected cells is ignored.
    5353    '''
    54     rows = widget.GetSelectedRows()
     54    try:
     55        rows = widget.GetSelectedRows()
     56    except:
     57        return
    5558    if not rows:
    5659        top = widget.GetSelectionBlockTopLeft()
     
    944947        def OnDeleteRestraint(event):
    945948            rows = GetSelectedRows(Bonds)
     949            G2frame.GetStatusBar().SetStatusText('',1)
    946950            if not rows:
     951                G2frame.GetStatusBar().SetStatusText('First select restraints to be deleted',1)
    947952                return
    948953            Bonds.ClearSelection()
     
    10741079        def OnDeleteRestraint(event):
    10751080            rows = GetSelectedRows(Angles)
     1081            G2frame.GetStatusBar().SetStatusText('',1)
    10761082            if not rows:
     1083                G2frame.GetStatusBar().SetStatusText('First select restraints to be deleted',1)
    10771084                return
    10781085            rows.sort()
     
    11941201        def OnDeleteRestraint(event):
    11951202            rows = GetSelectedRows(Planes)
     1203            G2frame.GetStatusBar().SetStatusText('',1)
    11961204            if not rows:
     1205                G2frame.GetStatusBar().SetStatusText('First select restraints to be deleted',1)
    11971206                return
    11981207            rows.sort()
     
    13011310        def OnDeleteRestraint(event):
    13021311            rows = GetSelectedRows(Volumes)
     1312            G2frame.GetStatusBar().SetStatusText('',1)
    13031313            if not rows:
     1314                G2frame.GetStatusBar().SetStatusText('First select restraints to be deleted',1)
    13041315                return
    13051316            rows.sort()
     
    14291440        def OnDeleteRestraint(event):
    14301441            rows = GetSelectedRows(TorsionRestr.Torsions)
     1442            G2frame.GetStatusBar().SetStatusText('',1)
    14311443            if not rows:
    14321444                return
     1445                G2frame.GetStatusBar().SetStatusText('First select restraints to be deleted',1)
    14331446            rows.sort()
    14341447            rows.reverse()
     
    15531566        def OnDeleteRestraint(event):
    15541567            rows = GetSelectedRows(RamaRestr.Ramas)
     1568            G2frame.GetStatusBar().SetStatusText('',1)
    15551569            if not rows:
     1570                G2frame.GetStatusBar().SetStatusText('First select restraints to be deleted',1)
    15561571                return
    15571572            rows.sort()
     
    16851700            #rows = GetSelectedRows()
    16861701            rows = ChemComps.GetSelectedRows()
     1702            G2frame.GetStatusBar().SetStatusText('',1)
    16871703            if not rows:
     1704                G2frame.GetStatusBar().SetStatusText('First select restraints to be deleted',1)
    16881705                return
    16891706            rowLabl = ChemComps.GetRowLabelValue(r)
     
    17941811        def OnDeleteRestraint(event):
    17951812            rows = GetSelectedRows(Textures)
     1813            G2frame.GetStatusBar().SetStatusText('',1)
    17961814            if not rows:
     1815                G2frame.GetStatusBar().SetStatusText('First select restraints to be deleted',1)
    17971816                return
    17981817            rows.sort()
     
    18781897            '''Delete a restraint expression'''
    18791898            n = event.GetEventObject().index
    1880             del generalRestData['General'][n]
     1899            G2frame.GetStatusBar().SetStatusText('',1)
     1900            if not n:
     1901                G2frame.GetStatusBar().SetStatusText('First select restraints to be deleted',1)
     1902                return
    18811903            wx.CallAfter(UpdateGeneralRestr,restrData['General'])
    18821904           
Note: See TracChangeset for help on using the changeset viewer.