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

  1.  /*=======================================================================*/
  2.  /*                                                                       */
  3.  /*           (c) InstallShield Software Corporation (1996-1997)          */
  4.  /*            (c)  InstallShield Corporation  (1990-1996)                */
  5.  /*                       Schaumburg, Illinois 60173                      */
  6.  /*                          All Rights Reserved                          */
  7.  /*                           InstallShield (R)                           */
  8.  /*                                                                       */
  9.  /*   File    : sdsedt2.rul                                               */
  10.  /*                                                                       */
  11.  /*   Purpose : This file contains the code for the SdShowDlgEdit2        */
  12.  /*             script dialog function.                                   */
  13.  /*                                                                       */
  14.  /*=======================================================================*/
  15.  
  16.  /*------------------------------------------------------------------------*/
  17.  /*                                                                        */
  18.  /*   Function: SdShowDlgEdit2                                             */
  19.  /*                                                                        */
  20.  /*   Descrip:  This dialog will allow user two edit field for             */
  21.  /*             confirmation purpose.                                      */
  22.  /*   Misc:                                                                */
  23.  /*                                                                        */
  24.  /*------------------------------------------------------------------------*/
  25. function SdShowDlgEdit2(szTitle, szMsg, szField1, szField2, svEdit1, svEdit2 )
  26.           STRING  szDlg, szTemp;
  27.           NUMBER  nId, nMessage, nTemp;
  28.           HWND    hwndDlg;
  29.           BOOL    bDone;
  30.         begin
  31.  
  32.            szDlg     = SD_DLG_SHOWDLGEDIT2;
  33.            nSdDialog = SD_NDLG_SHOWDLGEDIT2;
  34.  
  35.           // record data produced by this dialog
  36.           if (MODE=SILENTMODE) then
  37.             SdMakeName( szAppKey, szDlg, szTitle, nSdShowDlgEdit2 );
  38.             SilentReadData( szAppKey, "Result", DATA_NUMBER, szTemp, nId );
  39.             if ((nId != BACK) && (nId != CANCEL)) then
  40.                SilentReadData( szAppKey, "szEdit1", DATA_STRING, svEdit1, nTemp );
  41.                SilentReadData( szAppKey, "szEdit2", DATA_STRING, svEdit2, nTemp );
  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_SHOWDLGEDIT2 ) = DLG_ERR) then
  53.               return -1;
  54.            endif;
  55.  
  56.  
  57.            // Loop in dialog until the user selects a standard button
  58.            bDone = FALSE;
  59.  
  60.            while (!bDone)
  61.  
  62.               nId = WaitOnDialog( szDlg );
  63.  
  64.               switch (nId)
  65.               case DLG_INIT:
  66.                    if( szMsg != "" ) then
  67.                        SdSetStatic(szDlg, SD_STA_MSG1, szMsg);
  68.                    endif;
  69.  
  70.                    if (szField1 != "") then
  71.                        SdSetStatic(szDlg, SD_STA_FIELD1, szField1 );
  72.                    endif;
  73.  
  74.                    if (szField2 != "") then
  75.                        SdSetStatic(szDlg, SD_STA_FIELD2, szField2 );
  76.                    endif;
  77.  
  78.                    CtrlSetText(szDlg, SD_EDIT1, svEdit1);
  79.                    CtrlSetText(szDlg, SD_EDIT2, svEdit2);
  80.  
  81.                    hwndDlg = CmdGetHwndDlg( szDlg );
  82.                    SdGeneralInit( szDlg, hwndDlg, STYLE_BOLD, szSdProduct );
  83.  
  84.                    if(szTitle != "") then
  85.                        SetWindowText(hwndDlg, szTitle);
  86.                    endif;
  87.  
  88.               case SD_EDIT1:
  89.                    nMessage = CtrlGetSubCommand(szDlg);
  90.  
  91.                    if(nMessage = EDITBOX_CHANGE) then
  92.                        CtrlGetText(szDlg, SD_EDIT1, svEdit1);
  93.                    endif;
  94.  
  95.               case SD_EDIT2:
  96.                    nMessage = CtrlGetSubCommand(szDlg);
  97.  
  98.                    if(nMessage = EDITBOX_CHANGE) then
  99.                        CtrlGetText(szDlg, SD_EDIT2, svEdit2);
  100.                    endif;
  101.  
  102.               case SD_PBUT_OK:
  103.                    nId   = OK;
  104.                    bDone = TRUE;
  105.  
  106.               case BACK:
  107.                    nId    = BACK;
  108.                    bDone  = TRUE;
  109.  
  110.               case DLG_ERR:
  111.                    SdError( -1, "SdShowEdit2" );
  112.                    nId   = -1;
  113.                    bDone = TRUE;
  114.  
  115.               case DLG_CLOSE:
  116.                    SdCloseDlg( hwndDlg, nId, bDone );
  117.  
  118.               default:
  119.                    // check standard handling
  120.                    if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  121.                       bDone = TRUE;
  122.                    endif;
  123.               endswitch;
  124.  
  125.            endwhile;
  126.  
  127.            EndDialog( szDlg );
  128.            ReleaseDialog( szDlg );
  129.  
  130.            SdUnInit();
  131.  
  132.            // record data produced by this dialog
  133.            SdMakeName( szAppKey, szDlg, szTitle, nSdShowDlgEdit2 );
  134.            SilentWriteData( szAppKey, "szEdit1", DATA_STRING, svEdit1, 0 );
  135.            SilentWriteData( szAppKey, "szEdit2", DATA_STRING, svEdit2, 0 );
  136.            SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  137.  
  138.            return nId;
  139.  
  140.         end;
  141.  
  142.