I simply want to draw wxButton on a wxStaticBitmap that is the background image of a wxDialog.
I don't have sizer, I just want to do a simple dialog that show an image with one button on this image, something really simple.
I think a way to do that should be to use the OnPaint event and draw the background bitmap but is this possible with just a wxStaticBitmap ?
In my dialog constructor, I declare 3 buttons, located with x, y coordinates, something ugly but simple :
Code: Select all
wxButton* myButtonResultTab = new wxButton(this, wxID_RESULT_TAB, _S(TLang::Get("result_tab")), wxPoint(20,this->GetSize().y-50-15), wxSize(160,23));
Then I just declare a staticbitmap :
Code: Select all
(void*) new wxStaticBitmap(this, -1, wxBitmap( loc_o_background_image ), wxPoint(0,0));
The result is that the window show well the bitmap, but the buttons aren't drawn.
If I simply move the dialog out of the screen (with a manual user action by the mouse !) and then put it back, buttons appear because it forces the frame to be refreshed.
I tried to add a "Refresh()" call after the staticbitmap declaration, but nothing happen, i still need to move the window with my mouse for the button to be displayed.
There is a way to force the draw of the button or must I do something more complicated ?
Thanks a lot.
Bye.