- wxRect background(page->GetSize());
- page->AdjustRectToIncludeScrollButtons(&background);
- background.height -= 2;
+ wxRect background;
+ // Expanded panels need a background - the expanded panel at
+ // best size may have a greater Y dimension higher than when
+ // on the bar if it has a sizer. AUI art provider does not need this
+ // because it paints the panel without reference to its parent's size.
+ // Expanded panels use a wxFrame as parent (not a wxRibbonPage).
+
+ if(wnd->GetSizer() && wnd->GetParent() != page)
+ {
+ background = wnd->GetParent()->GetSize();
+ offset = wxPoint(0,0);
+ }
+ else
+ {
+ background = page->GetSize();
+ page->AdjustRectToIncludeScrollButtons(&background);
+ background.height -= 2;
+ }