andreafran@gmail.com wrote:
Hello, first of all the question: is it possible to delete a drawing
done by using tools such as dc.drawline or dc.drawcircle?
No. Well, OK, it depends.
There is no notion of "objects" in a DC. There is just a box of
pixels. What DrawLine and DrawCircle do is change the color of some of
those pixels. You can always redraw the line or circle using the
background color, but that fails if (a) the line or circle drew over the
top of something else, or (b) you draw on top of the line or circle. In
that case, the pixels that got overwritten are gone forever.
The only way to do what you ask is to redraw the scene from scratch
without the line or circle.
Ok, now the explanation: I have a panel with three toggle buttons each
of which performs a drawing, a cross, a square and a circle ... when I
click on the associated button the drawing's color change from red to
yellow and vice versa (see attached files)
As next step I would like that, instead of changing the color, the
drawing disappear... so button's state = "on" => red circle, state =
"off" => no circleIs there a way to get this?
For something with only three objects, just redraw the whole scene each
time. So, just have your button click event toggle a "present/absent"
variable and do a Refresh. Have the paint handler actually do the drawing.
ยทยทยท
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.