Advertisement
Guest User

Untitled

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