Line progress bar progress along with timer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-31 11:45 PM
Hi,
I'm working on a screen where in I need to display both down timer (using text box) and a line progress bar.
I want the progress bar to fill along with the down timer.
Example : Lets say my timer is running down for 10 seconds, I want the line progress to complete filling within 10 seconds.
Can somebody please suggest how this can be achieved?
I feel passing the right value to setvalue will be the solution for this issue.
ProgressBar.setValue(tick + 1);
ProgressBar.invalidate();
Please guide.
- Labels:
-
TouchGFX
-
TouchGFX Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-01 4:38 AM
Hello @KNara.2 ,
Yes, your solution is correct. Just to mention you don't need to use invalidate(). The setValue() suffices.
You can also read more about the Progress Indicators here:
https://support.touchgfx.com/docs/category/progress-indicators
ST Software Developer | TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-02 9:49 AM
Any timing on screen can be handled from model tick over MVP or simpler in screen implement
virtual void handleTickEvent();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-02 4:52 PM
Thank you @Mohammad MORADI ESFAHANIASL and @MM..1 .
I'm on the right track as suggested by you both I'm using setValue() to get the progress bar indicator moving and using handletickevent() to keep the timer up and running.
I'm only stuck at keeping the progress bar indicator filling in sync with down timer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-03 2:57 AM
All is based on your design , but simply when you start timer you too call
lineProgress.setRange(0, calculated timer2bar max);
and in tick events you set value together with set label
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-04 6:40 AM
@MM..1 Thanks for pointing to
lineProgress.setRange(0, calculated timer2bar max);
I was looking at the AbstractProgressIndicator.hpp ....function description above setRange();
it says if your box is 200 pixels wide and "0%" is 40 pixels wide.
How this calculation done?
Line progress bar in my case is 344 pixels.
Does it mean 68 pixels wide is 0%?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-04 8:43 AM
You waste time. Test and see. I mean range is values you need use. Lib recalc it to pixels, you dont require this.
Example you set range 0, 5 and visual size is 344 then simple if 0 is set no progress, if 1 ..344/5 pixels ...
If your code require can you set range -33 to +33 ...
