I recently installed the wx 2.9.3 version (from 2.8.12) and I've
found that the wxScrolledWindow is not working the way it did in 2.8.
If you open up the wxpython demo and look at the scrolledWindow
example and move the background image around, the window does not
refresh properly. The image that draws is only the size of the
original window; anything that would be outside in the virtual area
is not refreshed. Or is there a new flag or something that needs to
be called now? (I did notice that some changes were made to
wxScrolledWindow, as it is now a wxScrolled).
The 2.8 demo works as expected, so something is up. Any thoughts,
or am I looking at it wrong?
I recently installed the wx 2.9.3 version (from 2.8.12) and I've
found that the wxScrolledWindow is not working the way it did in 2.8.
Which platform?
If you open up the wxpython demo and look at the scrolledWindow
example and move the background image around, the window does not
refresh properly. The image that draws is only the size of the
original window; anything that would be outside in the virtual area
is not refreshed. Or is there a new flag or something that needs to
be called now? (I did notice that some changes were made to
wxScrolledWindow, as it is now a wxScrolled).
On the C++ side it was changed to a template so it could be used with different base classes. There are specific template instantiations using wxPanel and wxWindow, named wxScrolledWindow and wxScrolledCanvas. The API and features of wxScrolledWindow should be basically the same as before, it's just the organization of the implementation that is different.
The 2.8 demo works as expected, so something is up. Any thoughts,
or am I looking at it wrong?
It looks like the problem may actually be with the buffered DC implementation. If you change the BUFFERED=1 to =0 at the beginning of that sample's code then it is working more like it should. I'll take a closer look at that.
I've committed a fix, which will be in the next preview build. In the meantime you can work around the issue by drawing the buffer bitmap yourself in the EVT_PAINT handler instead of letting wx.BufferedPaintDC do it. For example, this works around the problem for the demo:
dc = wx.PaintDC(self)
self.PrepareDC(dc)
dc.DrawBitmap(self.buffer, 0,0)
You may need to do something similar with wx.BufferedDCs with the wx.BUFFER_VIRTUAL_AREA style that are drawing themselves to a wx.ClientDC or similar.
···
On 6/8/12 9:26 AM, Robin Dunn wrote:
On 6/8/12 2:53 AM, PyMapper Developer wrote:
The 2.8 demo works as expected, so something is up. Any thoughts,
or am I looking at it wrong?
It looks like the problem may actually be with the buffered DC
implementation. If you change the BUFFERED=1 to =0 at the beginning of
that sample's code then it is working more like it should. I'll take a
closer look at that.
Thanks Robin. I found the error on WinXP and Win7, btw.
···
On Jun 8, 1:40 pm, Robin Dunn <ro...@alldunn.com> wrote:
On 6/8/12 9:26 AM, Robin Dunn wrote:
> On 6/8/12 2:53 AM, PyMapper Developer wrote:
>> The 2.8 demo works as expected, so something is up. Any thoughts,
>> or am I looking at it wrong?
> It looks like the problem may actually be with the buffered DC
> implementation. If you change the BUFFERED=1 to =0 at the beginning of
> that sample's code then it is working more like it should. I'll take a
> closer look at that.
I've committed a fix, which will be in the next preview build. In the
meantime you can work around the issue by drawing the buffer bitmap
yourself in the EVT_PAINT handler instead of letting wx.BufferedPaintDC
do it. For example, this works around the problem for the demo:
dc = wx\.PaintDC\(self\)
self\.PrepareDC\(dc\)
dc\.DrawBitmap\(self\.buffer, 0,0\)
You may need to do something similar with wx.BufferedDCs with the
wx.BUFFER_VIRTUAL_AREA style that are drawing themselves to a
wx.ClientDC or similar.
--
Robin Dunn
Software Craftsmanhttp://wxPython.org