Communicator UI: 5.3 FoamProgressDialog: Using a FoamProgressDialog

Up: GEOS SDK TechDocs | Up | Prev: 5.2 Setting Up the Template | Next: 6 Routines for Lists

MSG_FOAM_PROGRESS_DIALOG_APPEND_STATUS_TEXT

Code Display 2-13 Using a FoamProgressDialog

 
static ShowProgressDialog ()
{
    optr			progressDialog;
    word			i;
    SemaphoreError			semResult;
    TCHAR			statusAppendStr[] = " . ";
    progressDialog = PutUpDialogViaUIThread(@FoamProgressDialogTemplate);
    for ( i=0; i<5; i++) {
	semResult = ThreadPTimedSem(cancelSemaphore, 0);
	if (semResult == SE_TIMEOUT) {
	    @send ProgressDialog::MSG_MY_PROGRESS_DIALOG_CANCEL_RECEIVED();
	break;
	}
	else (
	    ThreadVSem(cancelSempahore);
	    TimerSkeep(30);
	    @call progressDialog::MSG_FOAM_PROGRESS_DIALOG_APPEND_STATUS_TEXT(
				statusAAppendStr);
	}
    }
    TimerSleep(30);
    TakeDownDialogViaUIThread(progressDialog);
}
/* Handler for MSG_MY_PROGRESS_DIALOG_CANCEL_TRIGGERED */
@method MyProgressDialogClass, MSG_MY_PROGRESS_DIALOG_CANCEL_TRIGGERED
{
    SemaphoreError			semResult;
    semResult = ThreadPSem(cancelSemaphore);
    EC_ERROR_IF(
	(semResult == SE_TIMEOUT), CANNOT_GRAB_SEMAPHORE_CANCELPROGDIALOG);
}
/* Handler for MSG_MY_PROGRESS_DIALOG_CANCEL_RECEIVED */
@method MyProgressDialogClass, MSG_MY_PROGRESS_DIALOG_CANCEL_RECEIVED
{
    ThreadVSem(cancelSemaphore);
}

Up: GEOS SDK TechDocs | Up | Prev: 5.2 Setting Up the Template | Next: 6 Routines for Lists