Ticket #15214 (closed defect: fixed)
wxPanel needs Refresh() after calling Layout()
|Reported by:||elirips||Owned by:||vadz|
After calling Layout() on a wxPanel you may need to call Refresh() on the panel too to make its controls be drawn correct:
I have a wxPanel inside a wxBoxSizer inside a wxFrame.
Inside the wxPanel there is a horizontal wxBoxSizer.
Inside the sizer is a wxButton, a wxStaticText and then 5 wxCheckBoxes.
Now I set the Label of the wxStaticText to a text that is longer (takes more horizontal space) than the initial text. Then I call Layout() so that there is enough space for the wxStaticText. The wxButton and the wxCheckBoxes get moved to the right (as the wxStaticText needs more text).
Now the last two wxCheckBoxes are not painted correctly: You still see part of the "old" picture. If you move the mouse over them, or minimize/maximize the frame they get redrawn and appear correct.
They also appear correct if you call Refresh() after calling Layout(). From what I know it should not be necessarily to call Refresh() after calling Layout().
I have attached a minimal example to reproduce the problem and a screenshot of how things look like on my Windows 7 Professional 64 bit. I tested this with wx 2.9.4 in a DLL Debug and Release build and with the 2.9.5 daily snapshot from today in Debug DLL build, builded with Visual Studio 2010.
This also happens if you use wxRadioButtons or wxTextCtrls instead of wxCheckBoxes.