home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / zfamily.zip / zfamily / ZISFUNCS / SAMPLE / TSTINIT.INC < prev    next >
Text File  |  1993-09-01  |  3KB  |  77 lines

  1. /*
  2. ** /----------------------------------------------------------------------\
  3. ** |             IBM Z Family Reusable Libraries/2 (5641-504)             |
  4. ** |----------------------------------------------------------------------|
  5. ** | (C) Copyright International Business Machines Corporation 1993, 1994 |
  6. ** |----------------------------------------------------------------------|
  7. ** |                       DISCLAIMER OF WARRANTIES                       |
  8. ** |                       ------------------------                       |
  9. ** | The following code is sample code created by IBM Corporation.        |
  10. ** | Such a code is provided to you solely for the purpose of assisting   |
  11. ** | you in the development of your applications. The code is provided    |
  12. ** | "AS IS", without warranty of any kind.  IBM shall not be liable for  |
  13. ** | any damages arising out of your use of the following code, even if   |
  14. ** | they have been advised of the possibility of such damages.           |                                                                         *
  15. ** \----------------------------------------------------------------------/
  16. **
  17. **  Header  : TSTINIT.INC
  18. **  Authors : Alessandro Cavallini (CAVALLI at ROMEPPC)
  19. **            Pino Venturella (VENTUREL at ROMEPPC)
  20. **  Reviewer: Dario de Judicibus (DEJUDICI at ROMEPPC)
  21. **  Created : 06 Jul 1992
  22. **  Updated : 31 Aug 1993
  23. **  Version : 3.12
  24. **  Content : Called by TSTFUNMsgProc in the WM_INITDLG case statement.
  25. **            Fill the list tables and display the content.
  26. **
  27. */
  28.  {
  29.     GLBL  gbl ;
  30.     LIST  lst ;
  31.     FIELD fld ;
  32.     int   i   ; // Loop counter
  33.  
  34.   /*
  35.   **  Initialize field lengths
  36.   */
  37.     WinSendDlgItemMsg (hWndDlg, TSTFUNNOTDDL, EM_SETTEXTLIMIT, MPFROMSHORT(32), 0L) ;
  38.     WinSendDlgItemMsg (hWndDlg, TSTFUNTYPDDL, EM_SETTEXTLIMIT, MPFROMSHORT(32), 0L) ;
  39.     WinSendDlgItemMsg (hWndDlg, TSTFUNSMPFLD, EM_SETTEXTLIMIT, MPFROMSHORT(32), 0L) ; 
  40.  
  41.   /*
  42.   **  Define size, dim and pointer to the table of types
  43.   */
  44.     lst.size = 16 ;
  45.     lst.dim  = 32 ;
  46.     lst.psz = (PSZ)Tstfun->TstFunTypeTbl ;
  47.  
  48.     gbl.data = &(hAB) ;
  49.  
  50.   /*
  51.   **  Load the list of types
  52.   */
  53.    tstLoadTbl(TST_TYPE, 0, &gbl, &lst) ;
  54.  
  55.   /*
  56.   ** Initialize Type List with Table
  57.   */
  58.    for (i=0; i < 16; i++)
  59.      if (Tstfun->TstFunTypeTbl[i][0])
  60.        WinSendDlgItemMsg(hWndDlg, TSTFUNTYPDDL, LM_INSERTITEM,
  61.                          MPFROM2SHORT(LIT_END, 0),
  62.                          MPFROMP(Tstfun->TstFunTypeTbl[i])) ;
  63.  
  64.   /*
  65.   **  Set default type value. Note that such action sends a CBN_EFCHANGE
  66.   **  message to TSTFUNTYPDLL, which is handled by the code in TSTTYPE.INC
  67.   */
  68.    WinLoadString(hAB, 0, TST_ID_TYPE_NAT, 32, Tstfun->TstFunType) ;
  69.    WinSetDlgItemText(hWndDlg, TSTFUNTYPDDL, Tstfun->TstFunType);
  70.  
  71.   /*
  72.   **  Initialize radio button control: TstFunResult
  73.   */
  74.    cwCheckDlgItem(hWndDlg, TSTFUNFALRDB, FALSE) ;
  75.    cwCheckDlgItem(hWndDlg, TSTFUNTRURDB, FALSE) ;
  76.  }
  77.