Page 1 of 1

PostPosted: Tue Nov 07, 2006 11:46 pm
by Gazza
Which events execute the ondraw handle. I don't want to redraw if it is not necessary as it will slow down the app.

Draw d;
bool redrawActive = true;

Code: Select all
handler frmProgress.ondraw()
   if (redrawActive == true)
                 // Draw Goodies to Screen

        redrawActive = false;

handler cmdClose.onselect()
   redrawActive = true;

This only draws the content of ondraw once and then resets the global variable [redrawActive] for drawing when the form is called again. I know globals are bad!!! but this seems the most logical way of redrawing?

PostPosted: Fri Nov 10, 2006 4:21 am
by dewey
ondraw will be called only when the form is initially drawn, or the OS asks it to be redrawn (like when a dialog is shown on top of it, and closed)

PostPosted: Sat Nov 18, 2006 3:56 pm
by Gazza
Thanks Dewey,

I have a problem, I have drawn a bar-chart to a modal form. When I close out the form, reset the bar-char variables and then load the modal form back up. The bar-chart displays the old values.

I have checked the variables, and then are all set back to zero. I can draw a large rectangle to erase the area of the bar-chart, though there must be a better solution to this problem.

Thanks Gaz.

PostPosted: Thu Nov 30, 2006 6:39 pm
by dewey
If the form is closed, it should not maintain it's graphical state. Is it possible that your code is redrawing the data before clearing it out?