Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.
- void MyTreeCtrl::PopulateElementNode(wxTreeItemId &id)
- 2.
- {
- 3.
- 4.
- //adding panel control elements and setting its sizer
- 5.
- 6.
- //the next two lines do not work . A MyTreeCtrl and a MyPanel are children of MyFrame ,which is the top level window. A MyPanel object exists inside MyTreeCtrl Class.An event on a node in the tree should populate the panel.I am setting a sizer with the panel ,but it does not get set. The sizer for the toplevel frame was set at a different place before this event.
- 7.
- 8.
- wxBoxSizer *paneltopsizer = new wxBoxSizer(wxVERTICAL);
- 9.
- (this->mypanel)->SetSizer(paneltopsizer);
- 10.
- 11.
- 12.
- this->MyListCtrl=new wxListCtrl(this->mypanel,
- 13.
- wxID_LISTCTRL,wxDefaultPosition,wxSize(245,100),wxLC_REPORT);
- 14.
- wxButton *Add=new wxButton(this->mypanel,wxID_ADD,wxT("Add"));
- 15.
- *Delete=new wxButton(this->mypanel,wxID_DELETE,wxT("Delete"));
- 16.
- wxButton *ApplyChanges=new wxButton(this->mypanel,wxID_APPLYCHANGES,wxT("ApplyChanges"));
- 17.
- 18.
- wxBoxSizer *panelbuttonsizer = new wxBoxSizer(wxHORIZONTAL);
- 19.
- panelbuttonsizer->Add(Add,0,wxALL|wxALIGN_RIGHT,5);
- 20.
- panelbuttonsizer->Add(Delete,0,wxALL|wxALIGN_RIGHT,5);
- 21.
- panelbuttonsizer->Add(ApplyChanges,0,wxALL|wxALIGN_RIGHT,5);
- 22.
- paneltopsizer->Add(this->MyListCtrl,1,wxALL|wxEXPAND,10);
- 23.
- paneltopsizer->Add(panelbuttonsizer,0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
- 24.
- 25.
- //panel control ends
- 26.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement