You cant see the sample code on that page? Below is the sample code from
that link.
switch (eventP->data.ctlSelect.controlID)
{
case MainStartButton: { ProgressPtr prg;
Long i=0, cnt=0;
EventType event;
prg = PrgStartDialog("Counting to 1000...", callbackFunction);
//Do something complicated...
while (i<1000)
{
i++;
cnt++;
StrIToA(message, i);
if (cnt==10)
{
PrgUpdateDialog(prg, 0, i, message,
false);
cnt=0;
}
EvtGetEvent(&event, 0);
if (!PrgHandleEvent(prg, &event))
if (PrgUserCancel(prg))
break;
}
PrgStopDialog(prg, false);
break;
}
default:
break;
}
---------------------
typedef struct
{
Word stage;
// <= current stage
CharPtr textP;
// => buffer to hold text to display
Word textLen;
// <= length of text buffer
CharPtr message;
// <= additional text for display
Err error;
// <= current error
Word bitmapId;
// => resource ID of bitmap to display
Word canceled:1;
// <= true if user has
pressed the cancel buttonWord
showDetails:1;
// <= true if user pressed down
arrow for more details
Word textChanged:1;
// => if true then update
text (defaults to true)
Word timedOut:1;
// <= true if update caused by a timeout
ULong timeout;
// <> timeout in ticks to
force next update (for animation)
//progress bar info (Not Implemented)
DWord barMaxValue; DWord barCurValue;
CharPtr barMessage; //
text for display below the progress bar.
Word barFlags;
// reserved for future use.
} PrgCallbackData;
Boolean callbackFunction(PrgCallbackDataPtr cbP)
{ if (cbP->stage<250) { StrCopy(cbP->textP, "Starting: ");
StrCat(cbP->textP, cbP->message); cbP->bitmapId = startBitmap; } else if
(cbP->stage>750) { StrCopy(cbP->textP, "Finishing: "); StrCat(cbP->textP,
cbP->message); cbP->bitmapId = endBitmap; } else { StrCopy(cbP->textP, "In the
middle: "); StrCat(cbP->textP, cbP->message); cbP->bitmapId = middleBitmap; }
cbP->textChanged = true; return true;}--Scott EricksonSoftware Development
Team, FB-4, [EMAIL PROTECTED]"Andre Augusto" <[EMAIL PROTECTED]> wrote in
messagenews:[EMAIL PROTECTED]> Thanks a lot! I already saw this link, but the
problem is that the samplecode is not there.... Does anyone has it?> Thanks!>>
Scott Erickson
wrote:>>>http://www.developer.com/lang/other/article.php/615961>>>>>>>
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/