(a menubar for a panel).
On this, I add a few wxString's. I calculate the total width/height of the control.
Now I got the following functions overridden:
- DoGetSize
- DoGetClientSize ( used by DC.GetSize() )
- DoGetBestSize ( used by sizer-calculations )
But now when I want to erase the background, I do like this:
Code: Select all
void MenuBar_Control::OnEraseBackground( wxEraseEvent& WXUNUSED(event) )
{
wxClientDC clientDC(this);
clientDC.BeginDrawing();
clientDC.SetBrush( wxBrush(wxColour(0xff,0,0)) );
clientDC.DrawRectangle( 0,0, clientDC.GetSize().GetWidth(), clientDC.GetSize().GetHeight() );
clientDC.EndDrawing();
}
What am I missing here?
Thanks for any help.