[Boa Constr] wxGrid in Boa
Status: Beta
Brought to you by:
riaan
From: Harnell, L. <lyn...@up...> - 2001-08-21 00:22:03
|
>FROM: Riaan Booysen >DATE: 08/20/2001 10:43:42 >SUBJECT: RE: [Boa Constr] wxGrid in Boa >Hi Lynndon, please send plain text mail to the mailing list! Will do. Is this OK? >Luckily there is support already built into Boa to do what you want. >It's called 'custom classes'. The first change you need to make, is to >change your dbGrid class to have the same constructor as the original >wxGrid class. By this do you mean the line?: wxGrid.__init__(self,parent,-1, style= wxSIMPLE_BORDER|wxSUNKEN_BORDER) Boa inserts code like this: self.grid1 = wxGrid(id = wxID_WXFRAME1GRID1, name = 'grid1', parent = self.panel1, pos = wxPoint(104, 24), size = wxSize(136, 80), style= 0) So that I should change the first to something like?: wxGrid.__init__(ID, self,parent,-1, pos, size, style= wxSIMPLE_BORDER|wxSUNKEN_BORDER) >Then uncomment the line ># self.grid1 = wxGrid ... > >and delete the line you added > > self.grid1 = dbGrid ... OK understood >Now add the following _custom_classes line to the top of the wxFrame1 >definition as a class attribute: >class wxFrame1(wxFrame): > _custom_classes = {'wxGrid': ['dbGrid']} > def _init_utils(self): Got that. >Now open the Designer, select the Grid and change the Class property >from wxGrid to dbGrid. That too. >You will notice that the constructor you defined takes 1 parameter, >yet it is called with 5 keyword parameters in the source. Is this the line you mean in referring to the constructor definition, and is the one parameter the style? wxGrid.__init__(self,parent,-1, style= wxSIMPLE_BORDER|wxSUNKEN_BORDER) and is this the line you mean with 5 keywords in the source? There are 6 parameters within the wxGrid brackets (ID,NAME,PARENT,POS,SIZE,STYLE) or is one ignored? self.grid1 = wxGrid(id = wxID_WXFRAME1GRID1, name = 'grid1', parent = self.panel1, pos = wxPoint(104, 24), size = wxSize(136, 80), style= 0) Thanks for all your help. Lynndon |