/* How to Display a Progress Bar */
/* This is a simple example of how to display a status bar progress bar */
// Assumes inclusion of
main()
{
short itemType;
short i,
old_right;
float limit;
long counter;
GetDItem(barDlogPtr,1,&itemType,&iHndl,&box); old_right = box.right;
limit = (box.right - box.left)/36.0; /* use a float to get good*/
while(1) [TOKEN:12074] accuracy*/
{
for(i = 1; i<=36 ;i++)
{
box.right = box.left + i*limit;
Delay(10L,&counter); /* you won't need this! */ {
return;
}
}
box.right = old_right; [TOKEN:12074] since there is round off error*/
FillRect(&box,gray); [TOKEN:12074] when we get close, */ Delay(20,&counter); [TOKEN:12074] wait a 1/3 of a second*/ FillRect(&box,white); /* and get back to the original*/ }
}
/* Rez file for the DLOG and DITL resources used by the progress dialog */
#include "Types.r
resource 'DITL' (128) {
{ /* array DITL array: 1 elements */
/* [1] */
{68, 8, 96, 340},
UserItem {
enabled
}
}
};
resource 'DLOG' (128) {
{46, 81, 296, 431},
dBoxProc,
visible,
noGoAway,
0x0,
128,
};