Changeset 163 for trunk/GSASIIgrid.py
- Timestamp:
- Oct 13, 2010 10:17:22 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/GSASIIgrid.py ¶
r158 r163 14 14 ] = [wx.NewId() for _init_coll_Atom_Items in range(8)] 15 15 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)] 19 23 20 24 [ wxID_IMCALIBRATE, wxID_IMINTEGRATE, wxID_IMCLEARCALIB, wxID_SAVEINTG, … … 45 49 def _init_coll_AtomsMenu(self,parent): 46 50 parent.Append(menu=self.AtomEdit, title='Edit') 51 52 def _init_coll_DataMenu(self,parent): 53 parent.Append(menu=self.DataEdit, title='Edit') 47 54 48 55 def _init_coll_DrawAtomsMenu(self,parent): … … 85 92 help='Select atoms to transform first') 86 93 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 87 102 def _init_coll_DrawAtom_Items(self,parent): 88 103 parent.Append(id=wxID_DRAWATOMSTYLE, kind=wx.ITEM_NORMAL,text='Atom style', … … 90 105 parent.Append(id=wxID_DRAWATOMLABEL, kind=wx.ITEM_NORMAL,text='Atom label', 91 106 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') 92 111 parent.Append(id=wxID_DRAWVIEWPOINT, kind=wx.ITEM_NORMAL,text='View point', 93 112 help='View point is 1st atom selected') … … 151 170 152 171 self.AtomsMenu = wx.MenuBar() 172 self.DataMenu = wx.MenuBar() 153 173 self.DrawAtomsMenu = wx.MenuBar() 154 174 self.ImageMenu = wx.MenuBar() … … 159 179 self.IndexMenu = wx.MenuBar() 160 180 self.AtomEdit = wx.Menu(title='') 181 self.DataEdit = wx.Menu(title='') 161 182 self.DrawAtomEdit = wx.Menu(title='') 162 183 self.ImageEdit = wx.Menu(title='') … … 168 189 self._init_coll_AtomsMenu(self.AtomsMenu) 169 190 self._init_coll_Atom_Items(self.AtomEdit) 191 self._init_coll_DataMenu(self.DataMenu) 192 self._init_coll_Data_Items(self.DataEdit) 170 193 self._init_coll_DrawAtomsMenu(self.DrawAtomsMenu) 171 194 self._init_coll_DrawAtom_Items(self.DrawAtomEdit) … … 218 241 self.DestroyChildren() 219 242 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 232 243 class GSNoteBook(wx.Notebook): 233 244 def __init__(self, parent, name='',size = None): … … 238 249 GSNoteBook.DeleteAllPages(self) 239 250 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 257 class 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 240 269 class Table(wg.PyGridTableBase): 241 270 def __init__(self, data=[], rowLabels=None, colLabels=None, types = None):
Note: See TracChangeset
for help on using the changeset viewer.