I'm not sure wether it's a bug or a feature of wxMSW (and wxGTK) version 2.8.0...
I use wx(Auto)BufferedPaintDC for painting something into a window (the "buffered" version to avoid flickering).
If I try to get the size of this window GetSize() returns wrong values if the size of the window was decreased before.
For example:
1. Program has been started: GetSize() returns the correct size
2. Program window has been maximized: GetSize() returns the correct size
3. Program window has been made smaller again to the original size: GetSize() returns the wrong size (still the same size like for the maximized window)
This behaviour happens if I use wxBufferedPaintDC and wxAutoBufferedPaintDC with wxMSW 2.8.0 and wxGTK 2.8.0. For wxMSW 2.6.3 and wxGTK 2.6.3 the function GetSize() returns the correct values (using wxBufferedPaintDC).
A code snipplet:
Code: Select all
void DrawArea::draw_something() {
wxBufferedPaintDC dc_pointer(this);
wxCoord d_width, d_height;
//set background
dc_pointer.Clear();
dc_pointer.SetBackground(*wxWHITE_BRUSH);
this->SetBackgroundStyle(wxBG_STYLE_CUSTOM);
//get the actual size of draw area
dc_pointer.GetSize(&d_width, &d_height);
...
}
Michael