[SOLVED] Is there a way to make a loading progress bar
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-03-03
09:32 AM
- last edited on
2023-08-01
01:36 PM
by
Doreena Deng
2015-03-03
09:32 AM
Hi
I would like to know is there a way to make a loading progress bar by AC API.
I'm getting information from web service and somethimes it's take 10 second or more so I want to show loading process.
If there is not a solution by AC API then is it right to do it by third party library, for example by BOOST ?
Please give me an advice.
I would like to know is there a way to make a loading progress bar by AC API.
I'm getting information from web service and somethimes it's take 10 second or more so I want to show loading process.
If there is not a solution by AC API then is it right to do it by third party library, for example by BOOST ?
Please give me an advice.
Labels:
- Labels:
-
Add-On (C++)
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-03-05 10:21 AM
2015-03-05
10:21 AM
Hi,
yes, AC API provides two options to make progressbar:
1) You can use DG::ProgressBar class (defined in DGBarControl.hpp).
- first define the progressbar in your GRC resource file:
- add DG::ProgressBar to your dialog class:
- in the constructor of your dialog don't forget to initialize the progressbar:
- now you can use the initialized progressbar in you code the following way:
2) You can use the ACAPI_Interface ProcessWindow methodgroup to show a processwindow with a progressbar.
- This is much more easier.
Regards,
Tibor
yes, AC API provides two options to make progressbar:
1) You can use DG::ProgressBar class (defined in DGBarControl.hpp).
- first define the progressbar in your GRC resource file:
'GDLG' 32500 Modal | noGrow 0 0 312 195 "Dialog with ProgressBar" { //... /* [ 6] */ ProgressBar 13 140 286 15 /*minValue:*/ 0 /*maxValue:*/ 100 ClientEdge //... }
- add DG::ProgressBar to your dialog class:
class MyDialog : public DG::ModalDialog { private: // friend classes friend class MyObserver; private: //... DG::ProgressBar m_progressBar; //... public: MyDialog (GSResModule dialResModule, short resId, GSResModule dialIconResModule); ~MyDialog (); };
- in the constructor of your dialog don't forget to initialize the progressbar:
MyDialog::MyDialog (GSResModule dialResModule, short resId, GSResModule dialIconResModule): DG::ModalDialog (dialResModule, resId, dialIconResModule), m_progressBar (GetReference (), 6), //... { }
- now you can use the initialized progressbar in you code the following way:
m_progressBar.SetValue (<new value between minValue and maxValue>);
2) You can use the ACAPI_Interface ProcessWindow methodgroup to show a processwindow with a progressbar.
// Init processwindow: short nPhase = 1; Int32 maxValue = 100; ACAPI_Interface (APIIo_InitProcessWindowID, "<progressTitle>", &nPhase); // you can define more phases also // Start progressbar: ACAPI_Interface (APIIo_SetNextProcessPhaseID, "<progressSubtitle>", &maxValue); // Update progressbar with new value: Int32 progress = 0; ACAPI_Interface (APIIo_SetProcessValueID, &progress, NULL); progress++; ACAPI_Interface (APIIo_SetProcessValueID, &progress, NULL); // Processwindow contains a Cancel button also: if (ACAPI_Interface (APIIo_IsProcessCanceledID, NULL, NULL)) { // user cancelled the process! }
- This is much more easier.
Regards,
Tibor
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2015-03-19 02:15 PM
2015-03-19
02:15 PM
Thank you for the help. I use second one!