ProgressBar example

Started by domenicomaria · 2023-06-16 10:40 UTC · 3 replies · SMF topic #2877

Is there anyone who uses the ProgressBar control and can show me an example of how to use it ?
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.
author=domenicomaria link=topic=2877.msg13864#msg13864 date=1686912048 wrote:
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
Thank you.

I'll take a look at it

ciao