home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDSFMODS.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  6.7 KB  |  160 lines

  1.  
  2.  /*=======================================================================*/
  3.  /*                                                                       */
  4.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  5.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  6.  /*                       Schaumburg, Illinois 60173                      */
  7.  /*                          All Rights Reserved                          */
  8.  /*                           InstallShield (R)                           */
  9.  /*                                                                       */
  10.  /*   File    : sdsfmods.rul                                              */
  11.  /*                                                                       */
  12.  /*   Purpose : This file contains the code for the SdShowFileMods        */
  13.  /*             script dialog function.                                   */
  14.  /*                                                                       */
  15.  /*=======================================================================*/
  16.  
  17.  /*------------------------------------------------------------------------*/
  18.  /*                                                                        */
  19.  /*   Function: SdShowFileMods                                             */
  20.  /*                                                                        */
  21.  /*   Descrip:  This dialog will let user to choose how modify system file.*/
  22.  /*                                                                        */
  23.  /*   Misc:                                                                */
  24.  /*                                                                        */
  25.  /*------------------------------------------------------------------------*/
  26. function SdShowFileMods( szTitle, szMsg, szTargetFile, szAltFile, listChanges, nvSelection )
  27.           STRING  szDlg, szLine, szSrcDir, szTargetDir, szTemp;
  28.           STRING  szTargetBatchName, szDlgBatchName, szName;
  29.           NUMBER  nId, bDone, nCheckMessage, nFile, nListCheck, nTemp;
  30.           HWND    hwndDlg;
  31.         begin
  32.  
  33.            szDlg     = SD_DLG_SHOWFILEMODS;
  34.            nSdDialog = SD_NDLG_SHOWFILEMODS;
  35.  
  36.           // record data produced by this dialog
  37.           if (MODE=SILENTMODE) then
  38.             SdMakeName( szAppKey, szDlg, szTitle, nSdShowFileMods );
  39.             SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  40.             if ((nId != BACK) && (nId != CANCEL)) then
  41.                SilentReadData( szAppKey, "nSelection", DATA_NUMBER, szTemp, nvSelection );
  42.             endif;
  43.  
  44.             return nId;
  45.           endif;
  46.  
  47.            // ensure general initialization is complete
  48.            if (!bSdInit) then
  49.               SdInit();
  50.            endif;
  51.  
  52.            if (EzDefineDialog( szDlg, "", "", SD_NDLG_SHOWFILEMODS ) = DLG_ERR) then
  53.               return -1;
  54.            endif;
  55.  
  56.            // Loop in dialog until the user selects a standard button
  57.            bDone = FALSE;
  58.  
  59.            while (!bDone)
  60.  
  61.               nId = WaitOnDialog( szDlg );
  62.  
  63.               switch (nId)
  64.               case DLG_INIT:
  65.                    if( szMsg != "" ) then
  66.                        SdSetStatic(szDlg, SD_STA_MSG, szMsg);
  67.                    endif;
  68.  
  69.                    CtrlSetMLEText( szDlg, SD_LIST_BATCH, listChanges );
  70.  
  71.                    CtrlGetText(szDlg, SD_RBUT_CHANGE, szDlgBatchName);
  72.                    Sprintf(szTargetBatchName, szDlgBatchName, szTargetFile);
  73.                    CtrlSetText(szDlg, SD_RBUT_CHANGE, szTargetBatchName);
  74.  
  75.                    CtrlGetText(szDlg, SD_RBUT_SAVE, szDlgBatchName);
  76.                    if(szAltFile != "") then
  77.                        Sprintf(szTargetBatchName, szDlgBatchName, szAltFile);
  78.                        CtrlSetText(szDlg, SD_RBUT_SAVE, szTargetBatchName);
  79.                    else
  80.                        ParsePath(szName, szTargetFile, FILENAME_ONLY);
  81.                        Sprintf(szTargetBatchName, szDlgBatchName, szName+".BAK");
  82.                        CtrlSetText(szDlg, SD_RBUT_SAVE, szTargetBatchName);
  83.                    endif;
  84.  
  85.                    if ( nvSelection = 101 ) then
  86.                        CtrlSetState( szDlg, SD_RBUT_CHANGE, BUTTON_CHECKED );
  87.                    elseif ( nvSelection = 102 ) then
  88.                        CtrlSetState( szDlg, SD_RBUT_SAVE, BUTTON_CHECKED );
  89.                    elseif ( nvSelection = 103 ) then
  90.                        CtrlSetState( szDlg, SD_RBUT_NOCHANGE, BUTTON_CHECKED );
  91.                    else
  92.                        nvSelection = 101;
  93.                        CtrlSetState( szDlg, SD_RBUT_CHANGE, BUTTON_CHECKED );
  94.                    endif;
  95.  
  96.                    hwndDlg = CmdGetHwndDlg( szDlg );
  97.                    SdGeneralInit( szDlg, hwndDlg, STYLE_BOLD, szSdProduct );
  98.  
  99.                    if(szTitle != "") then
  100.                        SetWindowText(hwndDlg, szTitle);
  101.                   endif;
  102.  
  103.               case SD_RBUT_CHANGE:
  104.                    nCheckMessage = CtrlGetState( szDlg, SD_RBUT_CHANGE );
  105.                    if (nCheckMessage = BUTTON_CHECKED) then
  106.                        nvSelection   =  101;
  107.                    endif;
  108.  
  109.               case SD_RBUT_SAVE:
  110.                    nCheckMessage = CtrlGetState( szDlg, SD_RBUT_SAVE );
  111.                    if (nCheckMessage = BUTTON_CHECKED) then
  112.                        nvSelection   =  102;
  113.                    endif;
  114.  
  115.               case SD_RBUT_NOCHANGE:
  116.                    nCheckMessage = CtrlGetState( szDlg, SD_RBUT_NOCHANGE );
  117.                    if (nCheckMessage = BUTTON_CHECKED) then
  118.                        nvSelection   =  103;
  119.                    endif;
  120.  
  121.               case SD_PBUT_OK:
  122.                    nId   = OK;
  123.                    bDone = TRUE;
  124.  
  125.               case BACK:
  126.                    nId    = BACK;
  127.                    bDone  = TRUE;
  128.  
  129.               case DLG_ERR:
  130.                    SdError( -1, "SdShowFileMods" );
  131.                    nId   = -1;
  132.                    bDone = TRUE;
  133.  
  134.               case DLG_CLOSE:
  135.                    SdCloseDlg( hwndDlg, nId, bDone );
  136.  
  137.               default:
  138.                    // check standard handling
  139.                    if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  140.                       bDone = TRUE;
  141.                    endif;
  142.               endswitch;
  143.  
  144.            endwhile;
  145.  
  146.            EndDialog( szDlg );
  147.            ReleaseDialog( szDlg );
  148.  
  149.            SdUnInit( );
  150.  
  151.            // record data produced by this dialog
  152.            SdMakeName( szAppKey, szDlg, szTitle, nSdShowFileMods );
  153.            SilentWriteData( szAppKey, "nSelection", DATA_NUMBER, szTemp, nvSelection );
  154.            SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  155.  
  156.            return nId;
  157.  
  158.         end;
  159.  
  160.