I like to have a scrollbar over 2 windows and just scroll the right side one. See the picture below.
The scrollbars appears if I resize the wxScrolledWindow width the mouse.
But if I set the SetTargetWindow() the scrollbars will not appear anymore.
Code: Select all
coBasicView::coBasicView(wxWindow *wParent, wxWindowID iId, int iStyle)
: wxScrolledWindow(wParent, iId, wxDefaultPosition, wxDefaultSize, iStyle){
// Top sizer
wxBoxSizer *szrTop = new wxBoxSizer(wxHORIZONTAL);
SetSizer(szrTop);
// Windows
wxWindow *w1 = new wxWindow(this, ID_LEFT);
wxWindow *w2 = new wxWindow(this, ID_BODY);
szrTop->Add(w1, 0, wxALL | wxEXPAND, 0);
szrTop->Add(w2, 1, wxALL | wxEXPAND, 0);
w1->SetBackgroundColour("#ededed");
w2->SetBackgroundColour("#e6e6e6");
wxStaticText *stt1 = new wxStaticText(w1, 100, "my head", wxDefaultPosition, wxSize(120, 75));
wxStaticText *stt2 = new wxStaticText(w2, 101, "my body", wxDefaultPosition, wxSize(100, 75));
//SetTargetWindow(w2);
SetScrollRate(2, 2);
}
coBasicView::~coBasicView(){}
Please give me a hint.