SDK:Progress Dialog: Difference between revisions
Jump to navigation
Jump to search
(Created page with "The class VWFC::Tools::CProgressDlg is designed so Start and End define one loop of work and DoYield must be called on each iteration (internal times will make sure it doesn't...") |
No edit summary |
||
Line 11: | Line 11: | ||
CProgressDlg progressDlg; | CProgressDlg progressDlg; | ||
progressDlg.Open( "title" ); | progressDlg.Open( "title" ); | ||
progressDlg.SetTopText( "something if needed" ); | |||
progressDlg.SetBottomText( "something if needed" ); | |||
progressDlg.SetMeterText( "something if needed" ); | |||
progressDlg.Start( 40, 100 ); // 40% of the work will be done in 100 loops | progressDlg.Start( 40, 100 ); // 40% of the work will be done in 100 loops |
Latest revision as of 13:28, 25 May 2016
The class VWFC::Tools::CProgressDlg is designed so Start and End define one loop of work and DoYield must be called on each iteration (internal times will make sure it doesn't spend too much time)
The VectorScript call VS:ProgressDlgOpen uses this class.
Note: The infinite progress dialog doesn't require Start and End, just DoYield to let the messages go through for the animation
Example:
using namespace VWFC::Tools; CProgressDlg progressDlg; progressDlg.Open( "title" ); progressDlg.SetTopText( "something if needed" ); progressDlg.SetBottomText( "something if needed" ); progressDlg.SetMeterText( "something if needed" ); progressDlg.Start( 40, 100 ); // 40% of the work will be done in 100 loops for(size_t i=0; i<100; ++i) { ... progressDlg.DoYield(); } progressDlg.End(); progressDlg.Start( 60, 12 ); // 60% of the work will be done in 12 loops for(size_t i=0; i<12; ++i) { ... progressDlg.DoYield(); } progressDlg.End(); progressDlg.Close();