diff options
Diffstat (limited to 'src/Alerts.cpp')
-rw-r--r-- | src/Alerts.cpp | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/src/Alerts.cpp b/src/Alerts.cpp index acfefae..2e01ca9 100644 --- a/src/Alerts.cpp +++ b/src/Alerts.cpp @@ -1,11 +1,9 @@ /**> HEADER FILES <**/ #include "Alerts.h" - /********************> SelectResolution() <*****/ int SelectResolution( void ) { - DialogPtr dialog; Boolean dialogDone = false; short itemHit, itemType; @@ -13,29 +11,28 @@ int SelectResolution( void ) Handle resolutionItem; Rect itemRect; int selectionNum; - + // Load the dialog dialog = GetNewDialog( kResID_DLOG_SelectResolution, nil, kMoveToFront ); - + // Display the dialog ShowWindow( dialog ); SetPort( dialog ); - + // Load dialog items SetDialogDefaultItem( dialog, iOK ); SetDialogTracksCursor( dialog, true ); GetDialogItem( dialog, iOK, &itemType, &okItem, &itemRect ); GetDialogItem( dialog, iResolutionPopUp, &itemType, &resolutionItem, &itemRect ); - + // Set item values SetControlValue( ( ControlHandle )resolutionItem, i640x480 ); - - + while ( !dialogDone ) { - + ModalDialog( nil, &itemHit ); - + switch( itemHit ) { case iOK: @@ -47,9 +44,9 @@ int SelectResolution( void ) // We don't actually need to do anything here break; } - + } - + DisposeDialog( dialog ); // Return the item selected in the popup menu @@ -59,35 +56,34 @@ int SelectResolution( void ) /********************> MessageAlert() <*****/ void MessageAlert( unsigned char *theMessage ) { - + // Set parameter ^0 to our message (I could set up to three, but for simplicity's sake I won't) ParamText( ( unsigned char * )theMessage, NULL, NULL, NULL ); - + // Do the Alert NoteAlert( kResID_ALRT_MessageAlert, nil ); - + } /********************> FatalErrorAlert() <*****/ void FatalErrorAlert( UInt16 errorNum, OSErr osError ) { - + Str15 errNumStr; Str255 mainMessage; - + // Convert the OSErr to a string NumToString( osError, errNumStr ); - + // Get the error description (inErrorDesc) from the STR# resource GetIndString( mainMessage, kResID_STRn_ErrorStrings, errorNum ); - + // Set the parameters (^0 and ^1) in the ALRT to our error messages ParamText( mainMessage, errNumStr, NULL, NULL ); - + // Do the alert (which now has our messages in it) StopAlert( kResID_ALRT_ErrorAlert, NULL ); - + // Quit exit( EXIT_SUCCESS ); - } |