Setting client area size/scrollbars in wxScrolledWindow

Richard Danter radanter at googlemail.com
Fri Nov 2 01:56:55 PDT 2007


> RD> I guess there are two things I need to do:
> RD>
> RD>   1. increase the width requested by DoGetBestSize() by enough to
> RD> include the space required by the vertical scrollbar.
> RD>   2. Force the vertical scrollbar to always be visible without also
> RD> having the horizontal scrollbar visible.
> RD>
> RD> Any suggestions how to do this?
>
>  Unfortunately (2) is not currently possible (just as with your other
> questions, there is a pending patch which does make it possible but it's
> for 2.9 only). So right now you should fiddle with the return value of your
> DoGetBestSize() to add wxSystemSettings::GetMetric(wxSYS_VSCROLL_X) to
> leave enough space for the automatically shown scrollbar if necessary. This
> is rather ugly and I'd really like to allow people implementing just some
> DoGetBestClientSize() and dealing with the scrollbars automatically but
> we still haven't had time to do it...

Having both scroll bars is not ideal, but maybe I can make some use of
the horizontal bar so it is not redundant.

Thanks for the tip about GetMetric() that will help a lot.

Rich




More information about the wx-users mailing list