I want to have borders with rounded corners in my sizer (wxBoxSizer), so I capture the OnPaint event and I draw these borders in the panel that I am working on (wxScrolledWindow).
That works fine, but when I put widgets on the sizer that goes inside that panel, the widgets are drawn over the border, and I need the to be inside, so it looks under the border and not over it.
Any ideas to draw after the sizer has been drawn?
Thanks
My code is:
Code: Select all
void ScrolledPanel::OnPaint(wxPaintEvent& event)
{
wxPaintDC dc(this);
wxSize size = GetSize();
int width = size.GetWidth();
int height = size.GetHeight();
dc.SetPen(wxPen(this->GetForegroundColour(), 8));
dc.SetBrush(this->GetBackgroundColour());
dc.DrawRoundedRectangle(0,0,width, height, 20);
}
