Author Topic: ProgressBar example  (Read 3712 times)

domenicomaria

  • Member
  • *
  • Posts: 42
ProgressBar example
« 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 ?

JustCurious

  • Member
  • *
  • Posts: 4
Re: ProgressBar example
« Reply #1 on: June 27, 2023, 04:56:27 AM »
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

  • Member
  • *
  • Posts: 8
Re: ProgressBar example
« Reply #2 on: June 29, 2023, 03:07:05 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:
Code: [Select]
(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

  • Member
  • *
  • Posts: 42
Re: ProgressBar example
« Reply #3 on: July 01, 2023, 08:52:13 AM »
Thank you.

I'll take a look at it

ciao