Progress Bar status indicator
I would like to put a progress indicator on the project status bar.
I have been experimenting with concepts for a project. So far so good.
I have been able to stream quite large files in and out of my project. One of these processes requires a progress indication to the user because it takes a few minutes without any indication on the Taskwindow, though I know I could switch focus from the input/output stream to the message window and switch back again to the streams. To me that seems to be a waste of resources.
I have a good calculation for the progress, but I am having some difficulties finding the correct code to put the progress number on the status bar. A simple progress percentage would be good, but a graphic control similar to that shown when a "Build All" is executed would be better.
I know the information is somewhere in the pfc documentation or the VP knowledgebase, but after a good deal of searching I have not yet found it. I know I will find it eventually, though a pointer to the correct help or an example would be appreciated.
I have found some hints from the PIE project, but either that is a little out of date or more likely I am missing something.
Any pointers will be appreciated.
Regards,
Loffy
I have been experimenting with concepts for a project. So far so good.
I have been able to stream quite large files in and out of my project. One of these processes requires a progress indication to the user because it takes a few minutes without any indication on the Taskwindow, though I know I could switch focus from the input/output stream to the message window and switch back again to the streams. To me that seems to be a waste of resources.
I have a good calculation for the progress, but I am having some difficulties finding the correct code to put the progress number on the status bar. A simple progress percentage would be good, but a graphic control similar to that shown when a "Build All" is executed would be better.
I know the information is somewhere in the pfc documentation or the VP knowledgebase, but after a good deal of searching I have not yet found it. I know I will find it eventually, though a pointer to the correct help or an example would be appreciated.
I have found some hints from the PIE project, but either that is a little out of date or more likely I am missing something.
Any pointers will be appreciated.
Regards,
Loffy
-
- VIP Member
- Posts: 329
- Joined: 14 Nov 2002 0:01
Re: Progress Bar status indicator
I have no experiences with progress bars. But there is a demo for it named "progress" in the examples (which can be installed by "Help" / "Install Examples...").
Regards Martin
Re: Progress Bar status indicator
Martin,
Thanks. I have found the files.
Regards,
Loffy
Thanks. I have found the files.
Regards,
Loffy
Re: Progress Bar status indicator
Martin,
Thanks for the pointer to the progress files, though they are a bit obtuse and a little dated, at least to me. Maybe I am a bit "frazzled" after a day out with my grandchildren. That also makes me "dated".
My current plan is to spend a few hours optimising my stream out code for greater efficiency. I think I have some options.
If anyone has other suggestions re the status bar then I would be appreciative.
A really good option would be for someone to point me to the predicate and clauses for the "tiny" bit of code that displays on the status bar when the "Build All" option is selected when generating projects. The Status bar is really nicely laid out and informative.
After my optimisation work I will go back to trying to find the VP code that generates that really nice status bar. Again, I know it is there somewhere.
Regards,
Loffy
Thanks for the pointer to the progress files, though they are a bit obtuse and a little dated, at least to me. Maybe I am a bit "frazzled" after a day out with my grandchildren. That also makes me "dated".
My current plan is to spend a few hours optimising my stream out code for greater efficiency. I think I have some options.
If anyone has other suggestions re the status bar then I would be appreciative.
A really good option would be for someone to point me to the predicate and clauses for the "tiny" bit of code that displays on the status bar when the "Build All" option is selected when generating projects. The Status bar is really nicely laid out and informative.
After my optimisation work I will go back to trying to find the VP code that generates that really nice status bar. Again, I know it is there somewhere.
Regards,
Loffy
-
- VIP Member
- Posts: 329
- Joined: 14 Nov 2002 0:01
Re: Progress Bar status indicator
"Compile", "Rebuild All", etc. are displaying infos about what is currently going on at the bottom of VIP's main window. Analogously you want to display your own progress infos in a status line at the bottom of the application window. So your question is how to get texts to there.
As said I am not very experienced in these matters, but I have tried it and it worked out like this:
I create a new GUI application style project: I create a new toolbar: I add a static text field in the toolbar: In the attributes of the new toolbar I set style "Bottom": In the task window attributes I remove the default ProjectToolbar (also deleting the strange empty line) and add my new toolbar: continuing in next post because it lets me attach only 5 pics in this post...
As said I am not very experienced in these matters, but I have tried it and it worked out like this:
I create a new GUI application style project: I create a new toolbar: I add a static text field in the toolbar: In the attributes of the new toolbar I set style "Bottom": In the task window attributes I remove the default ProjectToolbar (also deleting the strange empty line) and add my new toolbar: continuing in next post because it lets me attach only 5 pics in this post...
Regards Martin
-
- VIP Member
- Posts: 329
- Joined: 14 Nov 2002 0:01
Re: Progress Bar status indicator
...continued from previous post
I add a timer listener in the task window: I insert some code in the onTimer listener which will display the time in the text field of the new toolbar: In the onShow listener I add a line to start a timer: I run the project, voilà!
I add a timer listener in the task window: I insert some code in the onTimer listener which will display the time in the text field of the new toolbar: In the onShow listener I add a line to start a timer: I run the project, voilà!
Regards Martin
Re: Progress Bar status indicator
Martin,
Thanks for all the work you put into that. I did not expect that much help.
Regards,
Loffy
Thanks for all the work you put into that. I did not expect that much help.
Regards,
Loffy
Re: Progress Bar status indicator
Martin,
Thanks again. Your solution worked.
Now it is up to me to provide the toolbar indications I need.
Regards,
Loffy
Thanks again. Your solution worked.
Now it is up to me to provide the toolbar indications I need.
Regards,
Loffy
-
- VIP Member
- Posts: 329
- Joined: 14 Nov 2002 0:01
Re: Progress Bar status indicator
I have found an easier solution. In a newly created GUI style project do as follows:
Add the declaration for a predicate displayStatus/1 in projectToolbar.cl:
Edit projectToolbar.pro a little so that it becomes:
Now you can display progress info texts by calls to projectToolbar::displayStatus/1.
Add the declaration for a predicate displayStatus/1 in projectToolbar.cl:
Code: Select all
class projectToolbar
predicates
create : (vpiDomains::windowHandle Parent).
predicates
displayStatus : (string Text).
end class projectToolbar
Code: Select all
implement projectToolbar
open vpiDomains, vpiToolbar, resourceIdentifiers
class facts
statusCell : statusBarCell := erroneous.
clauses
create(Parent) :-
StatusBar = statusBar::newApplicationWindow(),
statusCell := statusBarCell::new(StatusBar, 0),
StatusBar:cells := [statusCell],
Toolbar = vpiToolbar::create(style, Parent, controlList),
setStatusHandler(Toolbar, displayStatus).
clauses
displayStatus(Text) :-
statusCell:text := Text.
% This code is maintained automatically, do not update it manually. 16:42:04-24.4.2013
...the automatically generated code, leave it as it is...
% end of automatic code
end implement projectToolbar
Regards Martin
Re: Progress Bar status indicator
Martin,
Thanks again.
I will try this solution.
Regards,
Loffy
Thanks again.
I will try this solution.
Regards,
Loffy
Re: Progress Bar status indicator
Martin,
I have tried this solution, though I have a problem when I go to display the progress bar.
I can send you some code grabs, though I (stupid me) still do not understand how to encapsulate the code so that it is nicely readable. I have seen references to code/hash code symbols, but I have not yet found an explicate example (for an old dummy like me) to grab the code to send it to you "nicely". Any help here would be good.
Back to the problem.
Everything is fine until I attempt to display the text message on the toolbar. I think the problem is that I have not "declared" a toolbar to display the message.
To go back to your previous solution, everything worked fine when it was incorporated into my project. I may have been getting ahead of myself by not understanding properly your indications to install your latest solution into a "newly created GUI style project". I installed your suggested code into my current project and removed all of the previous solution re the status bar.
My guess is that I still need to install a status bar at the bottom of my project.
I have saved the error messages if you need them.
Regards,
Loffy
I have tried this solution, though I have a problem when I go to display the progress bar.
I can send you some code grabs, though I (stupid me) still do not understand how to encapsulate the code so that it is nicely readable. I have seen references to code/hash code symbols, but I have not yet found an explicate example (for an old dummy like me) to grab the code to send it to you "nicely". Any help here would be good.
Back to the problem.
Everything is fine until I attempt to display the text message on the toolbar. I think the problem is that I have not "declared" a toolbar to display the message.
To go back to your previous solution, everything worked fine when it was incorporated into my project. I may have been getting ahead of myself by not understanding properly your indications to install your latest solution into a "newly created GUI style project". I installed your suggested code into my current project and removed all of the previous solution re the status bar.
My guess is that I still need to install a status bar at the bottom of my project.
I have saved the error messages if you need them.
Regards,
Loffy
-
- VIP Member
- Posts: 329
- Joined: 14 Nov 2002 0:01
Re: Progress Bar status indicator
To put a code grab into the post, click the "Code display" button
which will insert a BBCode tag pair template into the text. Then place your code via copy/paste between the tags.
When you create a new project, VIP makes a copy of a default project template to start with. For GUI style projects it already contains a top and a bottom toolbar in the application window. You see these toolbars when you execute a newly created GUI style project. If you move the mouse on the "File" menu label, the text "Open File" is displayed on the bottom toolbar.
The easier solution utilizes that bottom toolbar which comes by default with new GUI projects. Thatfore I said start with a "newly created GUI style project" because when you have already removed that toolbar, as done in the first solution, the easier solution will not work anymore (at least not, until you re-establish the default toolbar).
I suppose the cause of your problem with the easier solution is that you have already removed the default toolbars. If so, you need to re-establish them (if you do not want to start over creating a new project). I think adding the "ProjectToolbar" in the attributes of the task window should suffice. Probably the strange empty line, which is also there in new projects, is not needed.
which will insert a BBCode tag pair template into the text. Then place your code via copy/paste between the tags.
When you create a new project, VIP makes a copy of a default project template to start with. For GUI style projects it already contains a top and a bottom toolbar in the application window. You see these toolbars when you execute a newly created GUI style project. If you move the mouse on the "File" menu label, the text "Open File" is displayed on the bottom toolbar.
The easier solution utilizes that bottom toolbar which comes by default with new GUI projects. Thatfore I said start with a "newly created GUI style project" because when you have already removed that toolbar, as done in the first solution, the easier solution will not work anymore (at least not, until you re-establish the default toolbar).
I suppose the cause of your problem with the easier solution is that you have already removed the default toolbars. If so, you need to re-establish them (if you do not want to start over creating a new project). I think adding the "ProjectToolbar" in the attributes of the task window should suffice. Probably the strange empty line, which is also there in new projects, is not needed.
Regards Martin
Re: Progress Bar status indicator
Martin,
Re the code display icon:
I get none of these icons in my installation of VIP. I first installed the personal version a few months ago, then upgraded to the commercial version.
I have played again tonight and I cannot see any of the icons you displayed re Code display, nor any of the other icons in the same display.
I may be missing an option setting?
Re the status bar question I originally asked about; tomorrow I will revert to your first solution as I can see a way where I can change your timer display into something closer to what I am trying to display. I am not complaining here re your solution as you could not possibly have guessed what I wanted to do.
I thank you again for all of your work.
Regards,
Loffy
Re the code display icon:
I get none of these icons in my installation of VIP. I first installed the personal version a few months ago, then upgraded to the commercial version.
I have played again tonight and I cannot see any of the icons you displayed re Code display, nor any of the other icons in the same display.
I may be missing an option setting?
Re the status bar question I originally asked about; tomorrow I will revert to your first solution as I can see a way where I can change your timer display into something closer to what I am trying to display. I am not complaining here re your solution as you could not possibly have guessed what I wanted to do.
I thank you again for all of your work.
Regards,
Loffy
-
- VIP Member
- Posts: 329
- Joined: 14 Nov 2002 0:01
Re: Progress Bar status indicator
Hit the Post Reply Button as you did before, if necessary login,
and have a look above the message editor box.
![Very Happy :D](./images/smilies/icon_biggrin.gif)
and have a look above the message editor box.
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Very Happy :D](./images/smilies/icon_biggrin.gif)
- Attachments
-
- pic11.jpg (122.42 KiB) Viewed 147812 times
Regards Martin
Re: Progress Bar status indicator
Martin,
Thanks again. My fault.
Gee it is hard to get good help these days.
Regards,
Loffy
Thanks again. My fault.
Gee it is hard to get good help these days.
Regards,
Loffy