wxMac: wxINVERT or wxOverlay?

Ian Britten britten at caris.com
Tue Jan 15 13:21:22 PST 2008


Stefan Csomor wrote:
> Hi Robert
> 
> yes, wxOverlay would be the way to do it, I'll copy a few snippets of my 
> GIS apps

[ snip ]

Stefan - Many thanks for the code snippet!  I had been looking for
stuff like this before, but had ended up just trying to invert/xor
some linework...  :(

A couple of things:

- First, as was mentioned, wxOverlay and wxDCOverlay don't seem to
   be documented, which is probably why I had never seen them before.
   What release will these be considered ready to use, in the main
   WX ports?  2.8.x?  2.9.x?  3.0?

- Second, from this (simplified) bit:
 >                wxDCOverlay overlaydc( m_overlay, &dc );
 >                overlaydc.Clear();
 >                dc.SetPen( wxPen( *wxLIGHT_GREY, 2, wxSOLID ) );
 >                dc.SetBrush( *wxRED_BRUSH );
 >                dc.SetAlpha(0xA0);
   I don't seem to have a SetAlpha() method, and I don't see it in
   the docs, nor searching my header files...
   [ I'm using wxGTK 2.8.4 on Linux, but need Windows too... ]
   Is this something new, or perhaps only on OSX?  Without it,
   my box draws solid red (in this case), but transparent would
   be cool!

- Third, whe I use the solid box (as above), there seems to be a
   noticable amount of flicker as the mouse is moved around.
   Is it possible to enhance this to use something like the
   wxAutoBufferedPaintDC (or one of the other DCs) to eliminate
   the flicker?

Again, many thanks!  Keep up the great work!
Ian




More information about the wx-users mailing list