我在我的應用程序下面的父子relasions:wxScrolledWindow滾動條不工作
的問題是,有在wxScrolledWindow不可見(或工作)滾動條。
代碼:
wxCollapsiblePane* collpane = new wxCollapsiblePane(this, ID_COLLPANE, "Tiles\t\t\t\t", wxDefaultPosition, wxDefaultSize, wxCP_NO_TLW_RESIZE);
wxSizer* sz = new wxBoxSizer(wxVERTICAL);
sz->Add(collpane,0,wxALIGN_RIGHT,10);
SetSizer(sz);
wxWindow* cPane = collpane->GetPane();
wxSizer* panesz = new wxBoxSizer(wxVERTICAL);
wxBitmap pic("test.bmp",wxBITMAP_TYPE_BMP);
wxScrolledWindow* scr = new wxScrolledWindow(cPane,ID_PANEL,wxDefaultPosition, wxSize(150,300));
scr->SetScrollbars(2,2,10,10);
wxClientDC dc(this);
scr->DoPrepareDC(dc);
panesz->Add(new wxBitmapButton(scr,-1,pic, wxDefaultPosition, wxSize(50,50)), 1, wxALIGN_CENTER, 0);
/* more button adding here */
cPane->SetSizer(panesz);
panesz->SetSizeHints(cPane);
我怎樣才能獲得滾動顯示和滾動按鈕?
這工作!謝謝! – user1233963