Changeset 814
- Timestamp:
- Dec 12, 2012 3:26:21 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASII.py
r812 r814 105 105 item = parent.Append( 106 106 help='Open a gsasii project file (*.gpx)', id=wx.ID_ANY, 107 kind=wx.ITEM_NORMAL,text=' Open project...')107 kind=wx.ITEM_NORMAL,text='&Open project...') 108 108 self.Bind(wx.EVT_MENU, self.OnFileOpen, id=item.GetId()) 109 109 item = parent.Append( 110 110 help='Save project to old file', id=wx.ID_ANY, 111 kind=wx.ITEM_NORMAL,text=' Save project')111 kind=wx.ITEM_NORMAL,text='&Save project') 112 112 self.Bind(wx.EVT_MENU, self.OnFileSave, id=item.GetId()) 113 113 item = parent.Append( … … 117 117 item = parent.Append( 118 118 help='Close project, saving is optional', id=wx.ID_ANY, 119 kind=wx.ITEM_NORMAL,text=' Close project')119 kind=wx.ITEM_NORMAL,text='&Close project') 120 120 self.Bind(wx.EVT_MENU, self.OnFileClose, id=item.GetId()) 121 121 item = parent.Append( 122 122 help='Exit from gsasii', id=wx.ID_ANY, 123 kind=wx.ITEM_NORMAL,text=' Exit')123 kind=wx.ITEM_NORMAL,text='&Exit') 124 124 self.Bind(wx.EVT_MENU, self.OnFileExit, id=item.GetId()) 125 125 … … 174 174 175 175 item = parent.Append(help='View least squares parameters', 176 id=wx.ID_ANY, kind=wx.ITEM_NORMAL,text=' View LS parms')176 id=wx.ID_ANY, kind=wx.ITEM_NORMAL,text='&View LS parms') 177 177 self.Bind(wx.EVT_MENU, self.OnViewLSParms, id=item.GetId()) 178 178 179 179 item = parent.Append(help='', id=wx.ID_ANY, kind=wx.ITEM_NORMAL, 180 text=' Refine')180 text='&Refine') 181 181 self.Refine.append(item) 182 182 item.Enable(False) … … 989 989 ''' 990 990 File = wx.Menu(title='') 991 menubar.Append(menu=File, title=' File')991 menubar.Append(menu=File, title='&File') 992 992 self._Add_FileMenuItems(File) 993 993 Data = wx.Menu(title='') -
trunk/GSASIIphsGUI.py
r808 r814 485 485 if not generalData['AtomTypes']: #can change only if no atoms! 486 486 generalData['Type'] = TypeTxt.GetValue() 487 dataDisplay.DestroyChildren() #needed to clear away bad cellSizer, etc.488 487 wx.CallAfter(UpdateGeneral) 489 488 else: … … 513 512 Text += line+'\n' 514 513 wx.MessageBox(Text,caption=msg,style=Style) 515 dataDisplay.DestroyChildren() #needed to clear away bad cellSizer, etc.514 # dataDisplay.DestroyChildren() #needed to clear away bad cellSizer, etc. 516 515 wx.CallAfter(UpdateGeneral) 517 516 -
trunk/GSASIIpwdGUI.py
r808 r814 262 262 if not G2frame.dataFrame.GetStatusBar(): 263 263 Status = G2frame.dataFrame.CreateStatusBar() 264 Status.SetStatusText('Global refine: select refine column & press Y or N') 264 265 G2frame.Bind(wx.EVT_MENU, OnAutoSearch, id=G2gd.wxID_AUTOSEARCH) 265 266 G2frame.Bind(wx.EVT_MENU, OnUnDo, id=G2gd.wxID_UNDO) -
trunk/GSASIIrestrGUI.py
r813 r814 181 181 else: 182 182 Topstr = str(Top) 183 bondRestData['Bonds'].append([[Oid,Tid],['1',Topstr], \ 184 ma.getdata(dist[indb])[i],1.54,0.01]) 183 newBond = [[Oid,Tid],['1',Topstr], \ 184 ma.getdata(dist[indb])[i],1.54,0.01] 185 if newBond not in bondRestData['Bonds']: 186 bondRestData['Bonds'].append(newBond) 185 187 finally: 186 188 dlg.Destroy() … … 222 224 obsd = np.sqrt(np.sum(np.inner(Amat,tCoord-oCoord)**2)) 223 225 if dist*Factor < obsd < dist/Factor: 224 bondRestData['Bonds'].append([[oId,tId],['1','1'],obsd,dist,esd]) 226 newBond = [[oId,tId],['1','1'],obsd,dist,esd] 227 if newBond not in bondRestData['Bonds']: 228 bondRestData['Bonds'].append(newBond) 225 229 macStr = macro.readline() 226 230 macro.close() … … 250 254 for Oid,Otype,Ocoord in origAtoms: 251 255 IndBlist = [] 252 angles = []253 256 VectB = [] 254 257 for Tid,Ttype,Tcoord in targAtoms: … … 283 286 XYZ = np.array([vecta[5],vecta[2],vectb[5]]) 284 287 angle = G2mth.getRestAngle(XYZ,Amat) 285 angles.append([ids,ops,angle,109.5,1.0])286 angleRestData['Angles'] += angles288 if angle not in angleRestData['Angles']: 289 angleRestData['Angles'].append([ids,ops,angle,109.5,1.0]) 287 290 UpdateAngleRestr(angleRestData) 288 291 … … 436 439 return wtBox 437 440 441 def OnRowSelect(event): 442 r,c = event.GetRow(),event.GetCol() 443 Obj = event.GetEventObject() 444 if r < 0 and c < 0: 445 if Obj.IsSelection(): 446 Obj.ClearSelection() 447 else: 448 for row in range(Bonds.GetNumberRows()): 449 Obj.SelectRow(row,True) 450 elif c < 0: #only row clicks 451 if event.ControlDown(): 452 if r in Obj.GetSelectedRows(): 453 Obj.DeselectRow(r) 454 else: 455 Obj.SelectRow(r,True) 456 elif event.ShiftDown(): 457 indxs = Obj.GetSelectedRows() 458 Obj.ClearSelection() 459 ibeg = 0 460 if indxs: 461 ibeg = indxs[-1] 462 for row in range(ibeg,r+1): 463 Obj.SelectRow(row,True) 464 else: 465 Obj.ClearSelection() 466 Obj.SelectRow(r,True) 467 438 468 def UpdateBondRestr(bondRestData): 439 440 def OnColSort(event):441 r,c = event.GetRow(),event.GetCol()442 if r < 0 and c == 0:443 names = G2mth.sortArray(table,0)444 bonds = []445 for name in names:446 idx = table.index(name)447 bonds.append(bondList[idx])448 bondRestData['Bonds'] = bonds449 UpdateBondRestr(bondRestData)450 469 451 470 def OnChangeValue(event): … … 524 543 Bonds.SetReadOnly(r,c,True) 525 544 Bonds.SetCellStyle(r,c,VERY_LIGHT_GREY,True) 526 Bonds.Bind(wg.EVT_GRID_LABEL_LEFT_ DCLICK,OnColSort)545 Bonds.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect) 527 546 G2frame.dataFrame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE) 528 547 G2frame.dataFrame.Bind(wx.EVT_MENU, OnChangeValue, id=G2gd.wxID_RESRCHANGEVAL) … … 626 645 Angles.SetReadOnly(r,c,True) 627 646 Angles.SetCellStyle(r,c,VERY_LIGHT_GREY,True) 628 Angles.Bind(wg.EVT_GRID_LABEL_LEFT_ DCLICK,OnColSort)647 Angles.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect) 629 648 G2frame.dataFrame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE) 630 649 G2frame.dataFrame.Bind(wx.EVT_MENU, OnChangeValue, id=G2gd.wxID_RESRCHANGEVAL) … … 715 734 Planes.SetReadOnly(r,c,True) 716 735 Planes.SetCellStyle(r,c,VERY_LIGHT_GREY,True) 736 Planes.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect) 717 737 G2frame.dataFrame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE) 718 738 G2frame.dataFrame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD) … … 804 824 Volumes.SetReadOnly(r,c,True) 805 825 Volumes.SetCellStyle(r,c,VERY_LIGHT_GREY,True) 826 Volumes.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect) 806 827 G2frame.dataFrame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE) 807 828 G2frame.dataFrame.Bind(wx.EVT_MENU, OnChangeValue, id=G2gd.wxID_RESRCHANGEVAL) … … 866 887 Torsions.SetReadOnly(r,c,True) 867 888 Torsions.SetCellStyle(r,c,VERY_LIGHT_GREY,True) 889 Torsions.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect) 868 890 G2frame.dataFrame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE) 869 891 G2frame.dataFrame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD) … … 927 949 Ramas.SetReadOnly(r,c,True) 928 950 Ramas.SetCellStyle(r,c,VERY_LIGHT_GREY,True) 951 Ramas.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect) 929 952 G2frame.dataFrame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE) 930 953 G2frame.dataFrame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD)
Note: See TracChangeset
for help on using the changeset viewer.