home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / zfamily.zip / zfamily / ZISFUNCS / SAMPLE / TSTTYPE.INC < prev    next >
Text File  |  1993-09-01  |  3KB  |  83 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  : TSTTYPE.INC
  18. **  Author  : Alessandro Cavallini (CAVALLI at ROMEPPC)
  19. **            Pino Venturella (VENTUREL at ROMEPPC)
  20. **  Created : 06 Jul 1992
  21. **  Updated : 31 Aug 1993
  22. **  Version : 3.12
  23. **  Content : Called by TSTFUNMsgProc in WM_CONTROL and TSTFUNTYPDDL case
  24. **            statement. Display the different notation in the corresponding
  25. **            list box
  26. **
  27. */
  28.  {
  29.    GLBL   gbl ;
  30.    FIELD  fld ;
  31.    char   szWorkBuf[33] ;
  32.    USHORT typeID ;
  33.    LIST   lst ;
  34.    int    i ; // counter
  35.  
  36.    Tstfun = (TSTFUNStruct *)WinQueryWindowULong(hWndClient, OFFSET_TSTFUN) ;
  37.  
  38.   /*
  39.   ** Reset radio button value
  40.   */
  41.    cwCheckDlgItem(hWndDlg, TSTFUNFALRDB, FALSE) ;
  42.    cwCheckDlgItem(hWndDlg, TSTFUNTRURDB, FALSE) ;
  43.  
  44.    WinQueryDlgItemText(hWndDlg, TSTFUNTYPDDL, sizeof(szWorkBuf), szWorkBuf) ;
  45.    strcpy(Tstfun->TstFunType, szWorkBuf) ;
  46.  
  47.    lst.size = 16 ;
  48.    lst.dim = 32 ;
  49.    lst.psz = (PSZ)Tstfun->TstFunNotationTbl ;
  50.  
  51.    gbl.data = &(hAB) ;
  52.    fld.dim = 32 ;
  53.    fld.psz = (PSZ)Tstfun->TstFunType ;
  54.  
  55.    typeID = tstGetTypeID (&gbl, &fld) ;
  56.  
  57.   /*
  58.   ** Load table of notation
  59.   */
  60.    tstLoadTbl (TST_NOTATION, typeID, &gbl, &lst) ;
  61.  
  62.   /*
  63.   **  Delete all item in the DDL notation
  64.   */
  65.    WinSendDlgItemMsg (hWndDlg, TSTFUNNOTDDL, LM_DELETEALL, 0, 0) ;
  66.  
  67.   /*
  68.   ** Initialize Notation List with Table
  69.   */
  70.    for (i=0; i < 16; i++)
  71.      if (Tstfun->TstFunNotationTbl[i][0])
  72.        WinSendDlgItemMsg(hWndDlg, TSTFUNNOTDDL, LM_INSERTITEM,
  73.                          MPFROM2SHORT(LIT_END, 0),
  74.                          MPFROMP(Tstfun->TstFunNotationTbl[i])) ;
  75.  
  76.   /*
  77.   **  Set default notation value. Note that such action sends a CBN_EFCHANGE
  78.   **  message to TSTFUNNOTDLL, which is handled by the code in TSTNOTAT.INC
  79.   */
  80.    WinLoadString(hAB, 0, TST_ID_NTN_FLAT, 32, Tstfun->TstFunNotation) ;
  81.    WinSetDlgItemText (hWndDlg, TSTFUNNOTDDL, Tstfun->TstFunNotation) ;
  82.  }
  83.