home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Visual Database / IShield for Visual C++ 6.0 / DATA1.CAB / Include_Files / SDSEDT3.RUL < prev    next >
Encoding:
Text File  |  1997-11-20  |  6.1 KB  |  155 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    : sdsedt3.rul                                               */
  10.  /*                                                                       */
  11.  /*   Purpose : This file contains the code for the SdShowDlgEdit3        */
  12.  /*             script dialog function.                                   */
  13.  /*                                                                       */
  14.  /*=======================================================================*/
  15.  
  16.  /*------------------------------------------------------------------------*/
  17.  /*                                                                        */
  18.  /*   Function: SdShowDlgEdit3                                             */
  19.  /*                                                                        */
  20.  /*   Descrip:  This dialog will allow user three edit field for           */
  21.  /*             confirmation purpose.                                      */
  22.  /*   Misc:                                                                */
  23.  /*                                                                        */
  24.  /*------------------------------------------------------------------------*/
  25. function SdShowDlgEdit3( szTitle, szMsg, szField1, szField2, szField3, svEdit1, svEdit2, svEdit3 )
  26.           STRING  szDlg, szTemp;
  27.           NUMBER  nId, nMessage, nTemp;
  28.           HWND    hwndDlg;
  29.           BOOL    bDone;
  30.         begin
  31.  
  32.            szDlg     = SD_DLG_SHOWDLGEDIT3;
  33.            nSdDialog = SD_NDLG_SHOWDLGEDIT3;
  34.  
  35.           // record data produced by this dialog
  36.           if (MODE=SILENTMODE) then
  37.             SdMakeName( szAppKey, szDlg, szTitle, nSdShowDlgEdit3 );
  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.                SilentReadData( szAppKey, "szEdit3", DATA_STRING, svEdit3, nTemp );
  43.             endif;
  44.  
  45.             return nId;
  46.           endif;
  47.  
  48.            // ensure general initialization is complete
  49.            if (!bSdInit) then
  50.               SdInit();
  51.            endif;
  52.  
  53.            if (EzDefineDialog( szDlg, "", "", SD_NDLG_SHOWDLGEDIT3 ) = DLG_ERR) then
  54.               return -1;
  55.            endif;
  56.  
  57.  
  58.            // Loop in dialog until the user selects a standard button
  59.            bDone = FALSE;
  60.  
  61.            while (!bDone)
  62.  
  63.               nId = WaitOnDialog( szDlg );
  64.  
  65.               switch (nId)
  66.               case DLG_INIT:
  67.                    if( szMsg != "" ) then
  68.                        SdSetStatic(szDlg, SD_STA_MSG1, szMsg);
  69.                    endif;
  70.  
  71.                    if( szField1 != "" ) then
  72.                        SdSetStatic(szDlg, SD_STA_FIELD1, szField1 );
  73.                    endif;
  74.  
  75.                    if( szField2 != "" ) then
  76.                        SdSetStatic(szDlg, SD_STA_FIELD2, szField2 );
  77.                    endif;
  78.  
  79.                    if( szField3 != "" ) then
  80.                        SdSetStatic(szDlg, SD_STA_FIELD3, szField3 );
  81.                    endif;
  82.  
  83.                    CtrlSetText(szDlg, SD_EDIT1, svEdit1);
  84.                    CtrlSetText(szDlg, SD_EDIT2, svEdit2);
  85.                    CtrlSetText(szDlg, SD_EDIT3, svEdit3);
  86.  
  87.                    hwndDlg = CmdGetHwndDlg( szDlg );
  88.                    SdGeneralInit( szDlg, hwndDlg, STYLE_BOLD, szSdProduct );
  89.  
  90.                    if(szTitle != "") then
  91.                        SetWindowText(hwndDlg, szTitle);
  92.                    endif;
  93.  
  94.               case SD_EDIT1:
  95.                    nMessage = CtrlGetSubCommand(szDlg);
  96.  
  97.                    if(nMessage = EDITBOX_CHANGE) then
  98.                        CtrlGetText(szDlg, SD_EDIT1, svEdit1);
  99.                    endif;
  100.  
  101.               case SD_EDIT2:
  102.                    nMessage = CtrlGetSubCommand(szDlg);
  103.  
  104.                    if(nMessage = EDITBOX_CHANGE) then
  105.                        CtrlGetText(szDlg, SD_EDIT2, svEdit2);
  106.                    endif;
  107.  
  108.               case SD_EDIT3:
  109.                    nMessage = CtrlGetSubCommand(szDlg);
  110.  
  111.                    if(nMessage = EDITBOX_CHANGE) then
  112.                        CtrlGetText(szDlg, SD_EDIT3, svEdit3);
  113.                    endif;
  114.  
  115.               case SD_PBUT_OK:
  116.                    nId   = OK;
  117.                    bDone = TRUE;
  118.  
  119.               case BACK:
  120.                    nId    = BACK;
  121.                    bDone  = TRUE;
  122.  
  123.               case DLG_ERR:
  124.                    SdError( -1, "SdShowEdit3" );
  125.                    nId   = -1;
  126.                    bDone = TRUE;
  127.  
  128.               case DLG_CLOSE:
  129.                    SdCloseDlg( hwndDlg, nId, bDone );
  130.  
  131.               default:
  132.                    // check standard handling
  133.                    if (SdIsStdButton( nId ) && SdDoStdButton( nId )) then
  134.                        bDone = TRUE;
  135.                    endif;
  136.               endswitch;
  137.  
  138.            endwhile;
  139.  
  140.            EndDialog( szDlg );
  141.            ReleaseDialog( szDlg );
  142.  
  143.            SdUnInit( );
  144.  
  145.            // record data produced by this dialog
  146.            SdMakeName( szAppKey, szDlg, szTitle, nSdShowDlgEdit3 );
  147.            SilentWriteData( szAppKey, "szEdit1", DATA_STRING, svEdit1, 0 );
  148.            SilentWriteData( szAppKey, "szEdit2", DATA_STRING, svEdit2, 0 );
  149.            SilentWriteData( szAppKey, "szEdit3", DATA_STRING, svEdit3, 0 );
  150.            SilentWriteData( szAppKey, "Result", DATA_NUMBER, "", nId );
  151.  
  152.            return nId;
  153.  
  154.         end;
  155.