Changeset 172
- Timestamp:
- Nov 12, 2010 1:41:27 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIplot.py
r171 r172 1149 1149 [uBox[4],uBox[5]],[uBox[5],uBox[6]],[uBox[6],uBox[7]],[uBox[7],uBox[4]]]) 1150 1150 uColors = [Rd,Gr,Bl,Wt, Wt,Wt,Wt,Wt, Wt,Wt,Wt,Wt] 1151 altDown = False 1152 shiftDown = False 1153 ctrlDown = False 1151 1154 1152 1155 def OnKeyBox(event): … … 1173 1176 Model = glGetDoublev(GL_MODELVIEW_MATRIX) 1174 1177 Zmax = 1. 1178 ClearSelectedAtoms() 1175 1179 for i,atom in enumerate(drawAtoms): 1176 1180 x,y,z = atom[cx:cx+3] … … 1183 1187 def OnMouseDown(event): 1184 1188 xy = event.GetPosition() 1185 if event. AltDown():1189 if event.ShiftDown(): 1186 1190 GetTruePosition(xy) 1187 1191 else: 1188 1192 drawingData['Rotation'][3] = xy 1193 Draw() 1194 1195 def OnMouseMove(event): 1196 newxy = event.GetPosition() 1197 if event.AltDown() and drawingData['showABC']: 1198 if event.RightIsDown(): 1199 altDown = True 1200 SetTestPos(newxy) 1201 if event.Dragging() and not event.AltDown(): 1202 altDown = False 1203 if event.LeftIsDown(): 1204 SetRotation(newxy) 1205 elif event.RightIsDown(): 1206 SetTranslation(newxy) 1207 elif event.MiddleIsDown(): 1208 SetRotationZ(newxy) 1209 Draw() 1189 1210 1190 1211 def OnMouseWheel(event): … … 1206 1227 panel[names.index('viewPoint')].SetValue('%.3f, %.3f, %.3f'%(VP[0],VP[1],VP[2])) 1207 1228 1229 def ClearSelectedAtoms(): 1230 page = self.dataDisplay.GetSelection() 1231 if self.dataDisplay.GetPageText(page) == 'Draw Atoms': 1232 self.dataDisplay.GetPage(page).ClearSelection() #this is the Atoms grid in Draw Atoms 1233 1208 1234 def SetSelectedAtoms(ind): 1209 1235 page = self.dataDisplay.GetSelection() 1210 1236 if self.dataDisplay.GetPageText(page) == 'Draw Atoms': 1211 1237 self.dataDisplay.GetPage(page).SelectRow(ind) #this is the Atoms grid in Draw Atoms 1212 1213 1238 1214 1239 def GetSelectedAtoms(): 1215 1240 page = self.dataDisplay.GetSelection() … … 1265 1290 Draw() 1266 1291 1267 def OnMouseMove(event):1268 newxy = event.GetPosition()1269 if event.ShiftDown() and drawingData['showABC']:1270 if event.RightIsDown():1271 SetTestPos(newxy)1272 if event.LeftIsDown():1273 SetNewPos(newxy)1274 if event.Dragging() and not event.AltDown():1275 if event.LeftIsDown():1276 SetRotation(newxy)1277 elif event.RightIsDown():1278 SetTranslation(newxy)1279 elif event.MiddleIsDown():1280 SetRotationZ(newxy)1281 Draw()1282 1283 1292 def SetBackground(): 1284 1293 R,G,B,A = Page.camera['backColor'] … … 1486 1495 Ind = GetSelectedAtoms() 1487 1496 x,y,z = drawingData['testPos'] 1488 self.G2plotNB.status.SetStatusText('test point %.4f,%.4f,%.4f'%(x,y,z),1) 1497 if altDown: 1498 self.G2plotNB.status.SetStatusText('moving test point %.4f,%.4f,%.4f'%(x,y,z),1) 1499 else: 1500 self.G2plotNB.status.SetStatusText('test point %.4f,%.4f,%.4f'%(x,y,z),1) 1489 1501 VS = np.array(Page.canvas.GetSize()) 1490 1502 aspect = float(VS[0])/float(VS[1]) … … 1647 1659 Page.views = False 1648 1660 view = False 1661 altDown = False 1649 1662 Page.SetFocus() 1650 1663 cb = wx.ComboBox(self.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY,
Note: See TracChangeset
for help on using the changeset viewer.