Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.69 KB | None | 0 0
  1.    1.
  2.       void MyTreeCtrl::PopulateElementNode(wxTreeItemId &id)
  3.    2.
  4.       {
  5.    3. //adding panel control elements and setting its sizer
  6.    5.//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.    7.
  8.        
  9.    8.
  10.               wxBoxSizer *paneltopsizer = new wxBoxSizer(wxVERTICAL);
  11.    9.
  12.               (this->mypanel)->SetSizer(paneltopsizer);
  13.   10.
  14.        
  15.   11.
  16.        
  17.   12.
  18.               this->MyListCtrl=new wxListCtrl(this->mypanel,
  19.   13.
  20.                       wxID_LISTCTRL,wxDefaultPosition,wxSize(245,100),wxLC_REPORT);
  21.   14.
  22.               wxButton *Add=new wxButton(this->mypanel,wxID_ADD,wxT("Add"));
  23.   15.
  24.               *Delete=new wxButton(this->mypanel,wxID_DELETE,wxT("Delete"));
  25.   16.
  26.               wxButton *ApplyChanges=new wxButton(this->mypanel,wxID_APPLYCHANGES,wxT("ApplyChanges"));
  27.   17.
  28.        
  29.   18.
  30.               wxBoxSizer *panelbuttonsizer = new wxBoxSizer(wxHORIZONTAL);
  31.   19.
  32.               panelbuttonsizer->Add(Add,0,wxALL|wxALIGN_RIGHT,5);
  33.   20.
  34.               panelbuttonsizer->Add(Delete,0,wxALL|wxALIGN_RIGHT,5);
  35.   21.
  36.               panelbuttonsizer->Add(ApplyChanges,0,wxALL|wxALIGN_RIGHT,5);
  37.   22.
  38.               paneltopsizer->Add(this->MyListCtrl,1,wxALL|wxEXPAND,10);
  39.   23.
  40.               paneltopsizer->Add(panelbuttonsizer,0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
  41.   24.
  42.        
  43.   25.
  44.       //panel control ends
  45.   26.
  46.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement