home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / msj / msjv4_4 / select / select.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-10-10  |  3.1 KB  |  80 lines

  1. /*
  2.  
  3. Author: Gregg Spaulding
  4.         Tencor Instruments
  5.         2400 Charleston Road
  6.         Mountain View, Ca. 94043
  7.  
  8.     The following defines apply to the "select" control type.
  9.  
  10.     Both a mouse and a keyboard interface are provided.  Clicking
  11.     the left mouse button advances the control to the next string.
  12.     Clicking the right button moves to the previous string.  The
  13.     control may obtain the input focus via the normal dialog box 
  14.     method of the tab and back tab keys.  Once highlighted, the 
  15.     arrow keys will advance through the strings.
  16.  
  17.     Notes:
  18.         (My development was done with an EGA)
  19.         when using this control in a dialog box, it must be 18 units
  20.         in height (as defined in the CONTROL statement).  It can be 
  21.         most easily placed using an "edit" control in the DIALOG.EXE 
  22.         utility and stretching it to the 18 units necessary.  The width
  23.         is arbitrary but should be large enough to accomodate the largest
  24.         string which may appear in it.  The circular arrows are part of
  25.         the control and occupy approximately two character widths.
  26.         Once the .DLG file is created, it should be edited and the 
  27.         CONTROL type "edit" replaced with "select".  The window styles
  28.         should be modified to read only 'WS_TABSTOP | WS_CHILD'.
  29. */
  30. /* messages processed by control */
  31. #define SL_ADDSTRING        LB_ADDSTRING
  32. #define SL_SETCURSEL        LB_SETCURSEL
  33. #define SL_GETCURSEL        LB_GETCURSEL
  34. #define SL_GETTEXT          LB_GETTEXT
  35. #define SL_GETCOUNT         LB_GETCOUNT
  36.  
  37. /* notification messages */
  38. #define SLN_SELCHANGE       LBN_SELCHANGE
  39.  
  40. /*
  41.     SL_ADDSTRING
  42.     wParam:        not used
  43.     lParam:        long pointer to zero terminated string to be added
  44.     Comments:      strings take on ordinal numbers in the sequentially as
  45.                    they are added.  i.e. the first string is 0, the second
  46.                    is 1, the third is 2, and so on.  These are the numbers
  47.                    used by SL_SETCURSEL and SL_GETCURSEL.
  48.  
  49.     SL_SETCURSEL
  50.     wParam:        ordinal number of string to set as the current selection
  51.     lParam:        not used
  52.     Comments:      has no effect if wParam is not a legel value
  53.  
  54.     SL_GETCURSEL
  55.     wParam:        not used
  56.     lParam:        not used
  57.     Comments:      returns ordinal number of current selection as return
  58.                    value of SendMessage or SendDlgItemMessage.
  59.  
  60.     SL_GETTEXT
  61.     wParam:        ordinal number of string to copy
  62.     lParam:        long pointer to location where string should be copied to
  63.     Comments:      copies the null string if wParam is not a legal value
  64.  
  65.     SL_GETCOUNT
  66.     wParam:        not used
  67.     lParam:        not used
  68.     Comments:      returns the number of currently defined strings for the 
  69.                    control as the return value of SendMessage or 
  70.                    SendDlgItemMessage
  71.  
  72.  
  73.     WM_COMMAND
  74.     wParam:        control ID
  75.     lParam:        LOWORD = window handle, HIWORD = SLN_SELCHANGE
  76.     Comments:      this message is sent BY the control TO the dialog function
  77.                    when the selection has been changed
  78. */
  79.  
  80.