Changeset 163 for trunk/GSASIIgrid.py


Ignore:
Timestamp:
Oct 13, 2010 10:17:22 AM (15 years ago)
Author:
vondreele
Message:

new versions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/GSASIIgrid.py

    r158 r163  
    1414] = [wx.NewId() for _init_coll_Atom_Items in range(8)]
    1515
    16 [ wxID_DRAWATOMSTYLE, wxID_DRAWATOMLABEL, wxID_DRAWVIEWPOINT, wxID_DRAWTRANSFORM,
    17     wxID_DRAWDELETE, wxID_DRAWFILLCELL, wxID_DRAWADDEQUIV, wxID_DRAWFILLCOORD,
    18 ] = [wx.NewId() for _init_coll_DrawAtom_Items in range(8)]
     16[ wxID_PWDRADD, wxID_HKLFADD, wxID_DATADELETE,
     17] = [wx.NewId() for _init_coll_Data_Items in range(3)]
     18
     19[ wxID_DRAWATOMSTYLE, wxID_DRAWATOMLABEL, wxID_DRAWATOMCOLOR, wxID_DRAWATOMRESETCOLOR,
     20    wxID_DRAWVIEWPOINT, wxID_DRAWTRANSFORM, wxID_DRAWDELETE, wxID_DRAWFILLCELL,
     21    wxID_DRAWADDEQUIV, wxID_DRAWFILLCOORD,
     22] = [wx.NewId() for _init_coll_DrawAtom_Items in range(10)]
    1923
    2024[ wxID_IMCALIBRATE, wxID_IMINTEGRATE, wxID_IMCLEARCALIB, wxID_SAVEINTG,
     
    4549    def _init_coll_AtomsMenu(self,parent):
    4650        parent.Append(menu=self.AtomEdit, title='Edit')
     51       
     52    def _init_coll_DataMenu(self,parent):
     53        parent.Append(menu=self.DataEdit, title='Edit')
    4754       
    4855    def _init_coll_DrawAtomsMenu(self,parent):
     
    8592            help='Select atoms to transform first')
    8693           
     94    def _init_coll_Data_Items(self,parent):
     95        parent.Append(id=wxID_PWDRADD, kind=wx.ITEM_NORMAL,text='Add powder histograms',
     96            help='Select new powder histograms to be used for this phase')
     97        parent.Append(id=wxID_HKLFADD, kind=wx.ITEM_NORMAL,text='Add single crystal histograms',
     98            help='Select new single crystal histograms to be used for this phase')
     99        parent.Append(id=wxID_DATADELETE, kind=wx.ITEM_NORMAL,text='Delete histograms',
     100            help='Delete histograms from use for this phase')
     101           
    87102    def _init_coll_DrawAtom_Items(self,parent):
    88103        parent.Append(id=wxID_DRAWATOMSTYLE, kind=wx.ITEM_NORMAL,text='Atom style',
     
    90105        parent.Append(id=wxID_DRAWATOMLABEL, kind=wx.ITEM_NORMAL,text='Atom label',
    91106            help='Select atoms first')
     107        parent.Append(id=wxID_DRAWATOMCOLOR, kind=wx.ITEM_NORMAL,text='Atom color',
     108            help='Select atoms first')
     109        parent.Append(id=wxID_DRAWATOMRESETCOLOR, kind=wx.ITEM_NORMAL,text='Reset atom colors',
     110            help='Resets all atom colors to defaults')
    92111        parent.Append(id=wxID_DRAWVIEWPOINT, kind=wx.ITEM_NORMAL,text='View point',
    93112            help='View point is 1st atom selected')
     
    151170       
    152171        self.AtomsMenu = wx.MenuBar()
     172        self.DataMenu = wx.MenuBar()
    153173        self.DrawAtomsMenu = wx.MenuBar()
    154174        self.ImageMenu = wx.MenuBar()
     
    159179        self.IndexMenu = wx.MenuBar()
    160180        self.AtomEdit = wx.Menu(title='')
     181        self.DataEdit = wx.Menu(title='')
    161182        self.DrawAtomEdit = wx.Menu(title='')
    162183        self.ImageEdit = wx.Menu(title='')
     
    168189        self._init_coll_AtomsMenu(self.AtomsMenu)
    169190        self._init_coll_Atom_Items(self.AtomEdit)
     191        self._init_coll_DataMenu(self.DataMenu)
     192        self._init_coll_Data_Items(self.DataEdit)
    170193        self._init_coll_DrawAtomsMenu(self.DrawAtomsMenu)
    171194        self._init_coll_DrawAtom_Items(self.DrawAtomEdit)
     
    218241        self.DestroyChildren()
    219242                   
    220 class GSGrid(wg.Grid):
    221     def __init__(self, parent, name=''):
    222         wg.Grid.__init__(self,parent,-1,name=name)                   
    223         self.SetSize(parent.GetClientSize())
    224            
    225     def Clear(self):
    226         wg.Grid.ClearGrid(self)
    227        
    228     def SetCellStyle(self,r,c,color="white",readonly=True):
    229         self.SetCellBackgroundColour(r,c,color)
    230         self.SetReadOnly(r,c,isReadOnly=readonly)
    231                        
    232243class GSNoteBook(wx.Notebook):
    233244    def __init__(self, parent, name='',size = None):
     
    238249        GSNoteBook.DeleteAllPages(self)
    239250       
     251    def FindPage(self,name):
     252        numPage = self.GetPageCount()
     253        for page in range(numPage):
     254            if self.GetPageText(page) == name:
     255                return page
     256       
     257class GSGrid(wg.Grid):
     258    def __init__(self, parent, name=''):
     259        wg.Grid.__init__(self,parent,-1,name=name)                   
     260        self.SetSize(parent.GetClientSize())
     261           
     262    def Clear(self):
     263        wg.Grid.ClearGrid(self)
     264       
     265    def SetCellStyle(self,r,c,color="white",readonly=True):
     266        self.SetCellBackgroundColour(r,c,color)
     267        self.SetReadOnly(r,c,isReadOnly=readonly)
     268                       
    240269class Table(wg.PyGridTableBase):
    241270    def __init__(self, data=[], rowLabels=None, colLabels=None, types = None):
Note: See TracChangeset for help on using the changeset viewer.