It works almost ok, but there are some quirks when repainting the window, (i) sometimes
the rulers are not erased and (ii) they are not redrawn when the window is fully repainted,
for example after being covered/discovered by other window. I want to put the
ruler redrawing routine into the paint event handler in order to see if this solves the
problem (which is caused by odd sequences of xor or invert -in my case- line plots).
I suspect that this is exactly what you need to do to solve the problem. My approach in wxmpl has been to stop drawing the crosshairs when the mouse is outside of the plot panel, which has allowed me to sidestep this particular problem.
I have been experimenting a little using Blit() in the PaintDC to save the rulers
background to a MemoryDC before drawing them and then restoring this
buffer again via the "inverse" Blit(). It works pretty well, don't have the
odd-xor-sequence problem and the lines' colours are not altered by xoring
with the colours below.
Once I decide how to implement my widget (which include the rulers
and some map-coordination between two function plots) I will send you
my code as an example. Perhaps it could be useful for someone.
___________________________________________________________ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar