Changeset 172


Ignore:
Timestamp:
Nov 12, 2010 1:41:27 PM (12 years ago)
Author:
vondreele
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r171 r172  
    11491149        [uBox[4],uBox[5]],[uBox[5],uBox[6]],[uBox[6],uBox[7]],[uBox[7],uBox[4]]])
    11501150    uColors = [Rd,Gr,Bl,Wt, Wt,Wt,Wt,Wt, Wt,Wt,Wt,Wt]
     1151    altDown = False
     1152    shiftDown = False
     1153    ctrlDown = False
    11511154   
    11521155    def OnKeyBox(event):
     
    11731176        Model = glGetDoublev(GL_MODELVIEW_MATRIX)
    11741177        Zmax = 1.
     1178        ClearSelectedAtoms()
    11751179        for i,atom in enumerate(drawAtoms):
    11761180            x,y,z = atom[cx:cx+3]
     
    11831187    def OnMouseDown(event):
    11841188        xy = event.GetPosition()
    1185         if event.AltDown():
     1189        if event.ShiftDown():
    11861190            GetTruePosition(xy)
    11871191        else:
    11881192            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()
    11891210       
    11901211    def OnMouseWheel(event):
     
    12061227            panel[names.index('viewPoint')].SetValue('%.3f, %.3f, %.3f'%(VP[0],VP[1],VP[2]))
    12071228           
     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                   
    12081234    def SetSelectedAtoms(ind):
    12091235        page = self.dataDisplay.GetSelection()
    12101236        if self.dataDisplay.GetPageText(page) == 'Draw Atoms':
    12111237            self.dataDisplay.GetPage(page).SelectRow(ind)      #this is the Atoms grid in Draw Atoms
    1212        
    1213            
     1238                 
    12141239    def GetSelectedAtoms():
    12151240        page = self.dataDisplay.GetSelection()
     
    12651290        Draw()
    12661291           
    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        
    12831292    def SetBackground():
    12841293        R,G,B,A = Page.camera['backColor']
     
    14861495        Ind = GetSelectedAtoms()
    14871496        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)           
    14891501        VS = np.array(Page.canvas.GetSize())
    14901502        aspect = float(VS[0])/float(VS[1])
     
    16471659        Page.views = False
    16481660        view = False
     1661        altDown = False
    16491662    Page.SetFocus()
    16501663    cb = wx.ComboBox(self.G2plotNB.status,style=wx.CB_DROPDOWN|wx.CB_READONLY,
Note: See TracChangeset for help on using the changeset viewer.