wx.BitmapButton does not redraws itself correctly (bug?)

Hello!

Is this a bug in wx.BitmapButton control? I attach a screenshot and small
code that illustrate my problem. You should resize main frame (just use
mouse) to see this behaviour. I think this is a bug because replacing
wx.BitmapButton with wx.Button immediately fix the problem.

My system is: win2000, Python 2.3, wxPython 2.5.1

    Vladimir Ignatov

bad-redraw.png

bad.py (2.32 KB)

Vladimir Ignatov wrote:

Hello!

Is this a bug in wx.BitmapButton control? I attach a screenshot and small
code that illustrate my problem. You should resize main frame (just use
mouse) to see this behaviour. I think this is a bug because replacing
wx.BitmapButton with wx.Button immediately fix the problem.

My system is: win2000, Python 2.3, wxPython 2.5.1

It's a common problem on Windows. If you add the wx.CLIP_SIBLINGS style to the bitmapbutton then it will not let the other buttons overdraw it.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks a much, Robin!

wx.CLIP_SIBLINGS style definitely do the trick. Hope this behaviour will be
mentioned somethere in *wx* documentation. I was not aware about this flag
existing because it is not listed in documentation. Surprisingly that Google
also fails to tell something usefull about it.

For all who is interesting I found a quote from MFC documentation there is
this flag discussed:

*** WS_CLIPSIBLINGS Clips child windows relative to each other; that is,
when a particular child window receives a paint message, the WS_CLIPSIBLINGS
style clips all other overlapped child windows out of the region of the
child window to be updated. (If WS_CLIPSIBLINGS is not given and child
windows overlap, when you draw within the client area of a child window, it
is possible to draw within the client area of a neighboring child window.)
For use with the WS_CHILD style only.***

    Vladimir Ignatov

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwidgets.org>
Sent: Monday, May 24, 2004 9:47 PM
Subject: Re: [wxPython-users] wx.BitmapButton does not redraws itself
correctly (bug?)

Vladimir Ignatov wrote:
> Hello!
>
> Is this a bug in wx.BitmapButton control? I attach a screenshot and

small

> code that illustrate my problem. You should resize main frame (just use
> mouse) to see this behaviour. I think this is a bug because replacing
> wx.BitmapButton with wx.Button immediately fix the problem.
>
> My system is: win2000, Python 2.3, wxPython 2.5.1
>

It's a common problem on Windows. If you add the wx.CLIP_SIBLINGS style
to the bitmapbutton then it will not let the other buttons overdraw it.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!