home *** CD-ROM | disk | FTP | other *** search
-
- /*=======================================================================*/
- /* */
- /* (c) InstallShield Software Corporation (1996-1997) */
- /* (c) InstallShield Corporation (1990-1996) */
- /* Schaumburg, Illinois 60173 */
- /* All Rights Reserved */
- /* InstallShield (R) */
- /* */
- /* File : sdcnewd.rul */
- /* */
- /* Purpose : This file contains the code for the SdConfirmNewDir */
- /* script dialog function. */
- /* */
- /*=======================================================================*/
-
- /*------------------------------------------------------------------------*/
- /* */
- /* Function: SdConfirmNewDir */
- /* */
- /* Descrip: This dialog will confirm the creation of a new directory */
- /* */
- /* Misc: */
- /* */
- /*------------------------------------------------------------------------*/
- function SdConfirmNewDir(szTitle, szDir, nStyle)
- STRING szDlg, szTemp;
- NUMBER nId, nTemp;
- HWND hwndDlg;
- BOOL bDone;
- begin
-
- szDlg = SD_DLG_CONFIRMNEWDIR;
- nSdDialog = SD_NDLG_CONFIRMNEWDIR;
-
- // record data produced by this dialog
- if (MODE=SILENTMODE) then
- SdMakeName( szAppKey, szDlg, szTitle, nSdConfirmNewDir );
- SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
- if ( CreateDir( szDir ) < 0 ) then
- nId = -1;
- endif;
- return nId;
- endif;
-
- // ensure general initialization is complete
- if (!bSdInit) then
- SdInit();
- endif;
-
- if (EzDefineDialog( szDlg, "", "", SD_NDLG_CONFIRMNEWDIR ) = DLG_ERR) then
- return -1;
- endif;
-
-
- // Loop in dialog until the user selects a standard button
- bDone = FALSE;
-
- while (!bDone)
-
- nId = WaitOnDialog( szDlg );
-
- switch (nId)
- case DLG_INIT:
- hwndDlg = CmdGetHwndDlg( szDlg );
- SdGeneralInit( szDlg, hwndDlg, nStyle, szSdProduct );
-
- if(szTitle != "") then
- SetWindowText(hwndDlg, szTitle);
- endif;
-
- if(szDir != "") then
- CtrlSetText(szDlg, SD_STA_NEWDIR, szDir);
- endif;
-
- case SD_PBUT_YES:
- bDone = TRUE;
- nId = YES;
- if ( CreateDir( szDir ) < 0 ) then
- nId = -1;
- bDone = TRUE;
- endif;
-
- case SD_PBUT_NO:
- nId = NO;
- bDone = TRUE;
-
- case BACK:
- nId = BACK;
- bDone = TRUE;
-
- case DLG_ERR:
- SdError( -1, "SdConfirmNewDir" );
- nId = -1;
- bDone = TRUE;
-
- case DLG_CLOSE:
- SdCloseDlg( hwndDlg, nId, bDone );
-
- default:
- // check standard handling
- if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
- bDone = TRUE;
- endif;
-
- endswitch;
-
- endwhile;
-
- EndDialog( szDlg );
- ReleaseDialog( szDlg );
-
- SdUnInit( );
-
- // record data produced by this dialog
- SdMakeName( szAppKey, szDlg, szTitle, nSdConfirmNewDir );
- SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
-
- return nId;
-
- end;
-