Changeset 789
- Timestamp:
- Oct 18, 2012 3:27:45 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIphsGUI.py
r788 r789 1111 1111 if 'Atoms' in data['Drawing']: 1112 1112 DrawAtomsReplaceByID(data['Drawing'],atomData[r],ID) 1113 FillAtomsGrid()1113 Paint() 1114 1114 1115 1115 def ChangeAtomCell(event): … … 1175 1175 if 'Atoms' in data['Drawing']: 1176 1176 DrawAtomsReplaceByID(data['Drawing'],atomData[r],ID) 1177 FindBondsDraw()1177 wx.CallAfter(Paint) 1178 1178 1179 1179 def AtomTypeSelect(event): … … 1191 1191 PE.Destroy() 1192 1192 SetupGeneral() 1193 FillAtomsGrid()1193 Paint() 1194 1194 value = Atoms.GetCellValue(r,c) 1195 1195 atomData[r][c] = value … … 1203 1203 def RowSelect(event): 1204 1204 r,c = event.GetRow(),event.GetCol() 1205 if not event.AltDown(): 1206 Atoms.frm = -1 1207 G2frame.dataFrame.SetStatusText('') 1205 1208 if r < 0 and c < 0: 1206 1209 if Atoms.IsSelection(): … … 1220 1223 for row in range(ibeg,r+1): 1221 1224 Atoms.SelectRow(row,True) 1225 elif event.AltDown(): 1226 if Atoms.frm < 0: #pick atom to be moved 1227 Atoms.frm = r 1228 Atoms.SelectRow(r,True) 1229 n = colLabels.index('Name') 1230 G2frame.dataFrame.SetStatusText('Atom '+atomData[r][n]+' is to be moved') 1231 else: #move it 1232 item = atomData.pop(Atoms.frm) 1233 atomData.insert(r,item) 1234 Atoms.frm = -1 1235 G2frame.dataFrame.SetStatusText('') 1236 Paint() 1222 1237 else: 1223 1238 Atoms.ClearSelection() … … 1239 1254 Atoms.SelectCol(c,True) 1240 1255 1241 def OnRowMove(event):1242 frm = event.GetMoveRow()1243 to = event.GetBeforeRow()1244 print frm,to1245 if frm == to:1246 return1247 item = atomData.pop(frm)1248 atomData.insert(to,item)1249 wx.CallAfter(Paint)1250 1251 1256 def Paint(): 1252 1257 … … 1258 1263 atomTable = G2gd.Table(table,rowLabels=rowLabels,colLabels=colLabels,types=Types) 1259 1264 Atoms.SetTable(atomTable, True) 1265 Atoms.frm = -1 1260 1266 colType = colLabels.index('Type') 1261 1267 colSS = colLabels.index('site sym') … … 1302 1308 Atoms.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK, RowSelect) 1303 1309 Atoms.Bind(wg.EVT_GRID_LABEL_RIGHT_CLICK, ChangeSelection) 1304 wgmove.GridRowMover(Atoms)1305 Atoms.Bind(wgmove.EVT_GRID_ROW_MOVE,OnRowMove)1306 1310 Atoms.SetMargins(0,0) 1307 1311 Paint()
Note: See TracChangeset
for help on using the changeset viewer.