SDK:Progress Dialog

From Vectorworks Developer
Revision as of 13:25, 25 May 2016 by Root (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.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();