Fix ribbon bar initial scroll buttons issue
|Reported by:||wxBen||Owned by:|
|Keywords:||ribbon bar scroll buttons||Cc:|
If you create a new ribbon bar you initially call Layout after adding everything to it. If a page is initially too wide to fit, it will create a right scroll button for it at this time, but the height of the bar and hence the scroll button will still be the initial default zero. If the user then flips to a page with such a scroll button, it will show those scroll bars, but since their size is zero, you get a black square or dirty left over to the far right where the scroll button normally sits. The page knows how big it should be and reserves that space but the scroll bar does not cover and paint it. These scroll buttons remain stuck with size zero unless you widen your application to make the scroll bars disappear (which deletes them) and then shrink it back down again (which recreates them with the right size).
The bar calls Layout continually which creates or destroys the scroll bars as necessary. This change tweaks that code slightly so that if scroll buttons are present on a page, it goes through the ShowScrollButtons method which now merely updates the scroll button sizes, rather than just create them if they are missing.