ProgressBar example

Started by domenicomaria, June 16, 2023, 03:40:48 AM

Previous topic - Next topic

domenicomaria

Is there anyone who uses the ProgressBar control and can show me an example of how to use it ?

JustCurious

It is too bad this forum seems near dead, too bad for everyone. In my case I abondoned OpenDCL and took a few steps back, just vanilla CAD now for me.

TCNTRM

Quote from: domenicomaria on June 16, 2023, 03:40:48 AM
Is there anyone who uses the ProgressBar control and can show me an example of how to use it ?

You have an example in Misc odcl sample.

But I'll try to explain a little. I'm using it in a while loop. First you set min (0) and max (length of selection for example) value of progress bar. And then through loop it sets each new value as it goes and redraws it. Here is some simple code:
(DCL-CONTROL-SETMINVALUE TEST/Palette1/ProgressBar1 0)
(DCL-CONTROL-SETMAXVALUE TEST/Palette1/ProgressBar1 length)
(while (< n length)
  (DCL-CONTROL-SETVALUE TEST/Palette1/ProgressBar1 n)
  (DCL-CONTROL-REDRAW TEST/Palette1/ProgressBar1)
  ...
  (setq n (+ n 1))
  );while

domenicomaria

Thank you.

I'll take a look at it

ciao