- const wxSize sizeList = m_list->GetSize();
-
- wxPoint pt(0, 0);
- wxRect rectPage(pt, GetClientSize());
- switch ( GetWindowStyle() & wxLB_ALIGN_MASK )
- {
- default:
- wxFAIL_MSG( _T("unexpected wxListbook alignment") );
- // fall through
-
- case wxLB_TOP:
- rectPage.y = sizeList.y + MARGIN;
- // fall through
-
- case wxLB_BOTTOM:
- rectPage.height -= sizeList.y + MARGIN;
- break;
-
- case wxLB_LEFT:
- rectPage.x = sizeList.x + MARGIN;
- // fall through
-
- case wxLB_RIGHT:
- rectPage.width -= sizeList.x + MARGIN;
- break;
- }
-
- return rectPage;
+ // arrange the icons before calling SetClientSize(), otherwise it wouldn't
+ // account for the scrollbars the list control might need and, at least
+ // under MSW, we'd finish with an ugly looking list control with both
+ // vertical and horizontal scrollbar (with one of them being added because
+ // the other one is not accounted for in client size computations)
+ wxListView *list = GetListView();
+ if (list) list->Arrange();
+ wxBookCtrlBase::OnSize(event);