Thread: [Boa Constr] StaticBoxSizers again
Status: Beta
Brought to you by:
riaan
From: Olivier T. <oli...@gm...> - 2006-11-03 11:11:38
Attachments:
TransfertLotDialog.py
scrsht_1.png
|
MTE6MDM6NDQ6ICAgICB3eC5fY29yZS5QeURlYWRPYmplY3RFcnJvcjogVGhlIEMrKyBwYXJ0IG9m IHRoZSBTdGF0aWNCb3ggb2JqZWN0IGhhcyBiZWVuIGRlbGV0ZWQsIGF0dHJpYnV0ZSBhY2Nlc3Mg bm8gbG9uZ2VyIGFsbG93ZWQuVHJhY2ViYWNrIChtb3N0IHJlY2VudCBjYWxsIGxhc3QpOg0KMTE6 MDM6NDQ6ICAgICB3eC5fY29yZS5QeURlYWRPYmplY3RFcnJvcjogVGhlIEMrKyBwYXJ0IG9mIHRo ZSBTdGF0aWNCb3ggb2JqZWN0IGhhcyBiZWVuIGRlbGV0ZWQsIGF0dHJpYnV0ZSBhY2Nlc3Mgbm8g bG9uZ2VyIGFsbG93ZWQuICBGaWxlICJDOlxQeXRob24yNFxMaWJcc2l0ZS1wYWNrYWdlc1xib2Et Y29uc3RydWN0b3JcVmlld3NcRGVzaWduZXIucHkiLCBsaW5lIDE1ODUsIGluIE9uQ29udHJvbFNl bGVjdA0KMTE6MDM6NDQ6ICAgICBkc2duLnNlbGVjdENvbnRyb2xCeVBvcyhjdHJsLCBwb3MsIGV2 ZW50LlNoaWZ0RG93bigpKSAgICAgICAgICAgICAgICAgICAgICAgDQoxMTowMzo0NDogICAgICAg RmlsZSAiQzpcUHl0aG9uMjRcTGliXHNpdGUtcGFja2FnZXNcYm9hLWNvbnN0cnVjdG9yXFZpZXdz XERlc2lnbmVyLnB5IiwgbGluZSAxMDAyLCBpbiBzZWxlY3RDb250cm9sQnlQb3MNCjExOjAzOjQ0 OiAgICAgY2kgPSBjb2xsRWRpdFZpZXcuY29tcGFuaW9uLmFwcGVuZEl0ZW0oICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIA0KMTE6MDM6N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gICAgICAgICAgICAgICAgICAgICAgICAgIA0KMTE6MDM6NDQ6ICAgICAgIEZp bGUgIkM6XFB5dGhvbjI0XExpYlxzaXRlLXBhY2thZ2VzXGJvYS1jb25zdHJ1Y3RvclxDb21wYW5p b25zXFNpemVyQ29tcGFuaW9ucy5weSIsIGxpbmUgNTA3LCBpbiBkZXNpZ25UaW1lT2JqZWN0DQox MTowMzo0NDogICAgIHNlbGYuY29udHJvbCA9IHNlbGYub2JqQ2xhc3MoKiphcmdzKSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICANCjExOjAzOjQ0OiAgICAgICBGaWxlICJD OlxQeXRob24yNFxsaWJcc2l0ZS1wYWNrYWdlc1x3eC0yLjcuMS1tc3ctdW5pY29kZVx3eFxfY29y ZS5weSIsIGxpbmUgMTIyNDUsIGluIF9faW5pdF9fDQoxMTowMzo0NDogICAgIF9jb3JlXy5TdGF0 aWNCb3hTaXplcl9zd2lnaW5pdChzZWxmLF9jb3JlXy5uZXdfU3RhdGljQm94U2l6ZXIoKmFyZ3Ms ICoqa3dhcmdzKSkNCjExOjAzOjQ0OiAgICAgVHlwZUVycm9yOiBpbiBtZXRob2QgJ25ld19TdGF0 aWNCb3hTaXplcicsIGV4cGVjdGVkIGFyZ3VtZW50IDEgb2YgdHlwZSAnd3hTdGF0aWNCb3ggKicN Cg== |
From: Olivier T. <oli...@gm...> - 2006-11-03 10:42:34
|
Of course this all happens with wxPython 2.7.1.2 and boa 0.5.2 from cvs (checked yesterday after the last fixes from Riaan). Olivier 2006/11/3, Olivier Thiery <oli...@gm...>: > > Hi, > > I'm sorry I have another bug with StaticBoxes and StaticBoxSizers. > > When I try to edit the attached source in the designer I first get an > error about the StaticBitmap relative path (scrsht_1.png). This is not my > point here, and anyway this has never been a real problem to me. > > The interesting part begins when I try to drop a StaticBox to my Dialog. > Once I release the mouse button, I get an error (log.txt). > > The only thing I can do then is to drop a StaticBoxSizer, but then I get > PyDeadObject errors each time I try to click on the dialog. > > In the end I can only cancel the design session. > > I hope this will fix the new sizers features. > > Olivier > > |
From: Riaan B. <riaan@e.co.za> - 2006-11-03 11:51:25
|
Hi Olivier, Sorry I didn't pick this up, I never use wx.StaticBoxSizer. Ok, I've tracked down the problem, but don't know how to fix it yet. The issue is that while working with sizers in the Designer, Boa recreates all the sizers often, but the behaviour of StaticBoxSizers seems to have changed between 2.6 and 2.7. Under 2.6 when a StaticBoxSizer is deleted, it left the StaticBox alone, but under 2.7 when the sizer is deleted, it also deletes the StaticBox, which is very nasty. I'll be looking at how to handle this, but I'm not very optimistic :( Cheers, Riaan. Olivier Thiery wrote: > Hi, > > I'm sorry I have another bug with StaticBoxes and StaticBoxSizers. > > When I try to edit the attached source in the designer I first get an > error about the StaticBitmap relative path (scrsht_1.png). This is not > my point here, and anyway this has never been a real problem to me. > > The interesting part begins when I try to drop a StaticBox to my Dialog. > Once I release the mouse button, I get an error (log.txt). > > The only thing I can do then is to drop a StaticBoxSizer, but then I get > PyDeadObject errors each time I try to click on the dialog. > > In the end I can only cancel the design session. > > I hope this will fix the new sizers features. > > Olivier > > > ------------------------------------------------------------------------ > > #Boa:Dialog:TransfertLotDialog > > import wx > import wx.lib.buttons > import data.CustomTreeCtrl as ctc > from data.CustomTreeCtrl import CustomTreeCtrl > > def create(parent): > return TransfertLotDialog(parent) > > [wxID_TRANSFERTLOTDIALOG, wxID_TRANSFERTLOTDIALOGGENBTNEWLOT, > wxID_TRANSFERTLOTDIALOGSTBXNOUVEAULOT, wxID_TRANSFERTLOTDIALOGTREELOTS, > wxID_TRANSFERTLOTDIALOGTXTNOMLOT, > ] = [wx.NewId() for _init_ctrls in range(5)] > > class TransfertLotDialog(wx.Dialog): > _custom_classes = {'wx.TreeCtrl':['CustomTreeCtrl']} > def _init_coll_Main_Items(self, parent): > # generated method, don't edit > > parent.AddWindow(self.treeLots, 1, border=5, flag=wx.ALL | wx.EXPAND) > parent.AddSizer(self.sb_lot, 0, border=5, flag=wx.ALL | wx.EXPAND) > > def _init_coll_sb_lot_Items(self, parent): > # generated method, don't edit > > parent.AddWindow(self.txtNomLot, 1, border=0, flag=0) > parent.AddWindow(self.genBtNewLot, 0, border=5, > flag=wx.ALIGN_CENTER_VERTICAL | wx.LEFT) > > def _init_sizers(self): > # generated method, don't edit > self.Main = wx.BoxSizer(orient=wx.VERTICAL) > > self.sb_lot = wx.StaticBoxSizer(box=self.stbxNouveauLot, > orient=wx.HORIZONTAL) > > self._init_coll_Main_Items(self.Main) > self._init_coll_sb_lot_Items(self.sb_lot) > > self.SetSizer(self.Main) > > def _init_ctrls(self, prnt): > # generated method, don't edit > wx.Dialog.__init__(self, id=wxID_TRANSFERTLOTDIALOG, > name=u'TransfertLotDialog', parent=prnt, pos=wx.Point(587, 355), > size=wx.Size(318, 368), style=wx.DEFAULT_DIALOG_STYLE, > title=u'Transfert de PMC') > self.SetClientSize(wx.Size(310, 334)) > > self.treeLots = wx.TreeCtrl(id=wxID_TRANSFERTLOTDIALOGTREELOTS, > name=u'treeLots', parent=self, pos=wx.Point(5, 5), > size=wx.Size(300, 271)) > > self.stbxNouveauLot = wx.StaticBox(id=wxID_TRANSFERTLOTDIALOGSTBXNOUVEAULOT, > label=u'Nouveau Lot', name=u'stbxNouveauLot', parent=self, > pos=wx.Point(5, 286), size=wx.Size(300, 43), style=0) > > self.txtNomLot = wx.TextCtrl(id=wxID_TRANSFERTLOTDIALOGTXTNOMLOT, > name=u'txtNomLot', parent=self, pos=wx.Point(10, 303), > size=wx.Size(262, 21), style=0, value=u'') > > self.genBtNewLot = wx.lib.buttons.GenBitmapButton(id=wxID_TRANSFERTLOTDIALOGGENBTNEWLOT, > bitmap=wx.Bitmap(u'img/16/edit_add.png', > wx.BITMAP_TYPE_PNG), name=u'genBtNewLot', parent=self, > pos=wx.Point(277, 305), size=wx.Size(23, 16), style=0) > self.genBtNewLot.Bind(wx.EVT_BUTTON, self.OnGenBtNewLotButton, > id=wxID_TRANSFERTLOTDIALOGGENBTNEWLOT) > > self._init_sizers() > > def __init__(self, parent): > #, ctstyle=ctc.TR_AUTO_CHECK_CHILD | ctc.TR_HIDE_ROOT | ctc.TR_HAS_BUTTONS > self._init_ctrls(parent) > self.init_data() > > def init_data(self): > ds = wxData.getDataSet(wxData.getQuery('pmc.commission', 'pmc.select.lots')) > ds.setParam('id_modalite',self.id) > ds.read() > cur_ref_id = None > cur_root = None > root = self.treeKeys.AddRoot('Lots disponibles') > while ds.hasMore(): > r = ds.nextRow() > if r['id_referentiel'] != cur_ref_id: > if cur_root != None: > self.treeKeys.Expand(cur_root) > cur_ref_id = r['id_referentiel'] > cur_root = self.treeKeys.AppendItem(root, r['libelle_referentiel'], 1, image=0) > self.__roots.append(cur_root) > self.treeKeys.SetItemImage(cur_root, 1, wx.TreeItemIcon_Expanded) > item = self.treeKeys.AppendItem(cur_root, r['libelle_modalite'], 1, image=2) > self.data[item] = r['id_modalite_referentiel'] > if cur_root != None: > self.treeKeys.Expand(cur_root) > > def OnGenBtNewLotButton(self, event): > event.Skip() > > > ------------------------------------------------------------------------ > > > ------------------------------------------------------------------------ > > 11:03:44: wx._core.PyDeadObjectError: The C++ part of the StaticBox object has been deleted, attribute access no longer allowed.Traceback (most recent call last): > 11:03:44: wx._core.PyDeadObjectError: The C++ part of the StaticBox object has been deleted, attribute access no longer allowed. File "C:\Python24\Lib\site-packages\boa-constructor\Views\Designer.py", line 1585, in OnControlSelect > 11:03:44: dsgn.selectControlByPos(ctrl, pos, event.ShiftDown()) > 11:03:44: File "C:\Python24\Lib\site-packages\boa-constructor\Views\Designer.py", line 1002, in selectControlByPos > 11:03:44: ci = collEditView.companion.appendItem( > 11:03:44: File "C:\Python24\Lib\site-packages\boa-constructor\Companions\SizerCompanions.py", line 194, in appendItem > 11:03:44: self.recreateSizers() > 11:03:44: File "C:\Python24\Lib\site-packages\boa-constructor\Companions\SizerCompanions.py", line 323, in recreateSizers > 11:03:44: self.designer.recreateSizers() > 11:03:44: File "C:\Python24\Lib\site-packages\boa-constructor\Views\SizersView.py", line 71, in recreateSizers > 11:03:44: self.objects[sizerName][0].recreateSizer() > 11:03:44: File "C:\Python24\Lib\site-packages\boa-constructor\Companions\SizerCompanions.py", line 87, in recreateSizer > 11:03:44: self.control = self.designTimeObject(args) > 11:03:44: File "C:\Python24\Lib\site-packages\boa-constructor\Companions\SizerCompanions.py", line 507, in designTimeObject > 11:03:44: self.control = self.objClass(**args) > 11:03:44: File "C:\Python24\lib\site-packages\wx-2.7.1-msw-unicode\wx\_core.py", line 12245, in __init__ > 11:03:44: _core_.StaticBoxSizer_swiginit(self,_core_.new_StaticBoxSizer(*args, **kwargs)) > 11:03:44: TypeError: in method 'new_StaticBoxSizer', expected argument 1 of type 'wxStaticBox *' > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > ------------------------------------------------------------------------ > > _______________________________________________ > Boa-constructor-users mailing list > Boa...@li... > https://lists.sourceforge.net/lists/listinfo/boa-constructor-users |