Changeset 1500


Ignore:
Timestamp:
Sep 17, 2014 3:59:40 PM (7 years ago)
Author:
vondreele
Message:

Improve drag/drop - put terse instruction in tree window status bar & eliminate error when dragging item to end of tree.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1499 r1500  
    8888# else should care much about this.
    8989sys.stderr = sys.stdout
    90 
    91 # useful degree trig functions
    92 sind = lambda x: math.sin(x*math.pi/180.)
    93 cosd = lambda x: math.cos(x*math.pi/180.)
    94 tand = lambda x: math.tan(x*math.pi/180.)
    95 asind = lambda x: 180.*math.asin(x)/math.pi
    96 acosd = lambda x: 180.*math.acos(x)/math.pi
    97 atan2d = lambda x,y: 180.*math.atan2(y,x)/math.pi
    9890
    9991def create(parent):
     
    18501842        self.SetMenuBar(self.GSASIIMenu)
    18511843        self.Bind(wx.EVT_SIZE, self.OnSize)
    1852         self.CreateStatusBar()
     1844        self.Status = self.CreateStatusBar()
    18531845        self.mainPanel = wx.Panel(self,-1)
    18541846       
     
    20092001        event.Allow()
    20102002        self.EndDragId = event.GetItem()
    2011         if self.ParentId != self.PatternTree.GetItemParent(self.EndDragId):
    2012             print 'drag not allowed - wrong parent'
     2003        try:
     2004            NewParent = self.PatternTree.GetItemParent(self.EndDragId)
     2005        except:
     2006            self.EndDragId = self.PatternTree.GetLastChild(self.root)
     2007            NewParent = self.root
     2008        if self.ParentId != NewParent:
     2009            self.ErrorDialog('Drag not allowed','Wrong parent for item dragged')
    20132010        else:
    20142011            Name,Item = self.DragData[0]
     
    29162913        '''Calculates PDFs
    29172914        '''
     2915        sind = lambda x: math.sin(x*math.pi/180.)
    29182916        tth2q = lambda t,w:4.0*math.pi*sind(t/2.0)/w
    29192917        TextList = ['All PWDR']
  • trunk/GSASIIIO.py

    r1459 r1500  
    933933    finally:
    934934        wx.EndBusyCursor()
     935        G2frame.Status.SetStatusText('To reorder tree items, use mouse RB to drag/drop them')
    935936   
    936937def ProjFileSave(G2frame):
Note: See TracChangeset for help on using the changeset viewer.