Ignore:
Timestamp:
Jan 4, 2017 10:46:36 PM (5 years ago)
Author:
toby
Message:

Change PDF defaults; option for multiple element addition (added to PDF); replace old single-spot mask option with new; stop overwriting image limits on Copy Controls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIElemGUI.py

    r2546 r2611  
    2424import wx.lib.colourselect as wscs
    2525class PickElement(wx.Dialog):
    26     "Makes periodic table widget for picking element - caller maintains element list"
     26    '''Makes periodic table widget for picking element. Modes:
     27        oneOnly if True element symbols are provided, otherwise select isotope
     28        ifNone ?
     29        ifMag if True present magnetic scatters only
     30        multiple if True multiple elements can be selected
     31    '''
    2732    Elem=None
    2833    def _init_ctrls(self,prnt,ifMag=False):
     
    5055               tip=E[3],color=color)
    5156            i+=1
    52 
    53     def __init__(self, parent,oneOnly=False,ifNone=False,ifMag=False):
     57        if self.multiple:
     58            b = wx.Button(self,wx.ID_CLOSE,
     59                          pos=wx.Point(16.5*self.butWid+25,7.75*24+24),
     60                          label="Done")
     61            b.Bind(wx.EVT_BUTTON, self.OnClose)
     62
     63    def __init__(self, parent,oneOnly=False,ifNone=False,ifMag=False,multiple=False):
    5464        'Needs a doc string'
    5565        self.oneOnly = oneOnly
    5666        self.ifNone = ifNone
     67        self.multiple = multiple
    5768        self._init_ctrls(parent,ifMag=ifMag)
     69        self.elementList = []
    5870       
    5971    def ElButton(self, name, pos, tip, color):
     
    90102            El = event.GetEventObject().GetValue()
    91103        self.Elem = El
    92         self.EndModal(wx.ID_OK)       
    93        
     104        if self.multiple:
     105            self.elementList.append(El)
     106            event.GetEventObject().SetBackgroundColour('black') # Shows on Mac
     107            event.GetEventObject().SetColour(
     108                wx.Colour(*[int(i/2) for i in event.GetEventObject().GetColour()]))
     109        else:
     110            self.EndModal(wx.ID_OK)
     111
     112    def OnClose(self,event):
     113        self.EndModal(wx.ID_OK)
     114               
    94115class PickElements(wx.Dialog):
    95116    """Makes periodic table widget for picking elements - caller maintains element list"""
Note: See TracChangeset for help on using the changeset viewer.