home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mclb.zip / lb.pak / MCLB.H < prev    next >
Text File  |  1995-08-17  |  8KB  |  109 lines

  1. /***************************************************************************/
  2. /***************************************************************************/
  3. /*                        DISCLAIMER OF WARRANTIES.                        */
  4. /***************************************************************************/
  5. /***************************************************************************/
  6. /*                                                                         */
  7. /*  Copyright (C) 1995 IBM Corporation                                     */
  8. /*                                                                         */
  9. /*      DISCLAIMER OF WARRANTIES.  The following [enclosed] code is        */
  10. /*      sample code created by IBM Corporation. This sample code is not    */
  11. /*      part of any standard or IBM product and is provided to you solely  */
  12. /*      for  the purpose of assisting you in the development of your       */
  13. /*      applications.  The code is provided "AS IS", without               */
  14. /*      warranty of any kind.  IBM shall not be liable for any damages     */
  15. /*      arising out of your use of the sample code, even if they have been */
  16. /*      advised of the possibility of such damages.                        */
  17. /***************************************************************************/
  18. /* External MCLB definitions */
  19.  
  20. #define MAX_FONTLEN   FACESIZE+4        /* System fontface size plus room for size spec.*/
  21.  
  22. /* Structure used to create MCLB windows */
  23.  
  24. typedef struct _MCLBINFO { 
  25.   ULONG  Size;                          /* Length of this structure                   */
  26.   char   *Titles;                       /* Title strings (TabChar separated)          */
  27.   char   TitleFont[MAX_FONTLEN];        /* Title font (null to inherit from owner)    */
  28.   char   ListFont[MAX_FONTLEN];         /* List  font (null to inherit from owner)    */
  29.   ULONG  TitleBColor;                   /* Title background color                     */
  30.   ULONG  TitleFColor;                   /* Title foreground color                     */
  31.   ULONG  ListBColor;                    /* List  background color                     */
  32.   ULONG  ListFColor;                    /* List  foreground color                     */
  33.   LONG   *InitSizes;                    /* Ptr to array of initial sizes              */
  34.   char   _Reserved[64];                 /* Reserved for future use                    */
  35.   USHORT Cols;                          /* Number of columns                          */
  36.   char   TabChar;                       /* Data column separator character            */
  37.   char   _Padd;                         /* Padd for separator character (zero)        */
  38. } MCLBINFO;
  39.  
  40. /* Prototype for MCLB create function */
  41.  
  42. HWND EXPENTRY MCLBCreateWindow(
  43.                 HWND      Parent,   // Parent window
  44.                 HWND      Owner,    // Owner to recv messages
  45.                 ULONG     Style,    // Style flags (MCLBS_*)
  46.                 LONG      x,        // Window position
  47.                 LONG      y,
  48.                 LONG      cx,       // Window size
  49.                 LONG      cy,
  50.                 HWND      Behind,   // Place behind this window
  51.                 USHORT    Id,       // Window ID
  52.                 MCLBINFO  *Info);   // MCLB create structure
  53.  
  54. /*********************************************************************/
  55. /* MCLB style flags must not collide with any PM style bits          */
  56. /* which as of V2.1 are:                                             */
  57. /*                                                                   */
  58. /* Std window style  WS_*   XXXX XXXX XX-- ----  ---- ---- ---- ---- */
  59. /* Dlg manager style WS_*   ---- ---- ---- -XXX  ---- ---- ---- ---- */
  60. /* Listbox styles    LS_*   ---- ---- ---- ----  ---- ---- ---X XXXX */
  61. /*                                                                   */
  62. /* ...so we use:  MCLBS_*   ---- ---- ---- ----  XXXX X--- ---- ---- */
  63. /*                                                                   */
  64. /*********************************************************************/
  65.  
  66. #define MCLBS_NOCOLRESIZE        0x00000800L // No resizing of columns allowed (e.g. no splitbars)
  67. #define MCLBS_SIZEMETHOD_PROP    0x00000000L // Resize columns proportially (default) when control size chngs
  68. //#define MCLBS_SIZEMETHOD_EQUAL 0x00001000L // Resize columns equally (PROP is preferred)
  69. #define MCLBS_SIZEMETHOD_LEFT    0x00002000L // Resize left column
  70. #define MCLBS_SIZEMETHOD_CUSTOM  0x00003000L // Application supplies resize algorithm
  71. #define MCLBS_SIZEMETHOD_MASK    0x00003000L // Mask to extract method bits
  72. #define MCLBS_MULTICOLOR         0x00004000L // Allow columns to have different colors
  73. #define MCLBS_CUASELECT          0x00008000L // Perform CUA-style extended selection (like container)
  74. #define MCLBS_MASK               0x0000F800L // Mask to extract all MCLB style bits
  75.  
  76. /*********************************************************************/
  77. /* MCLB notification messages (must not collide with LN_* PM         */
  78. /* values which as of V2.1 were from 1 to 5).  These values          */
  79. /* are in short 2 of mp1 of WM_CONTROL messages.                     */
  80. /*********************************************************************/
  81.  
  82. #define MCLBN_COLSIZED          400 // Column sizes were modified
  83. #define MCLBN_CUSTOMSIZE        401 // Control size changed, set new col sizes (MCLBS_SIZEMETHOD_CUSTOM style only)
  84. #define MCLBN_PPCHANGED         402 // Control pres parm changed:
  85.                                     //    mp2 = (short) Column number or zero for title
  86.                                     //          (short) MCLBPP_FONT/FORECOLOR/BACKCOLOR
  87.  
  88. #define MCLBPP_FONT               1 // Indicates font change in MCLBN_PPCHANGED control message
  89. #define MCLBPP_FORECOLOR          2 // Indicates foreground color change in MCLBN_PPCHANGED control message
  90. #define MCLBPP_BACKCOLOR          3 // Indicates background color change in MCLBN_PPCHANGED control message
  91.  
  92. /*********************************************************************/
  93. /* MCLB messages -- these are messages which can be sent to the MCLB */
  94. /* control to perform MCLB-specific functions.  This is in addition  */
  95. /* to all the normal listbox (LS_*) messages.                        */
  96. /*********************************************************************/
  97.  
  98. #define MCLB_SETTITLES      (WM_USER+100)  // Set new column titles (mp1=delimited string)
  99. #define MCLB_SETTITLEFONT   (WM_USER+101)  // Set title font (mp1=title font).  NULL to use default font.
  100. #define MCLB_SETLISTFONT    (WM_USER+102)  // Set list font (mp1=title font).  NULL to use default font.
  101. #define MCLB_SETTITLECOLORS (WM_USER+103)  // Set title colors (mp1=foreground, mp2=background), RGB values, if mp1=mp1 use defaults
  102. #define MCLB_SETLISTCOLORS  (WM_USER+104)  // Set list colors (mp1=fore, mp2=back), RGB values, if mp1=mp2 use defaults
  103. #define MCLB_SETCOLSIZES    (WM_USER+105)  // Set column sizes (mp1=ptr to array of LONG).  Sizes should addup to MCLB_QUERYFULLSIZE result.
  104. #define MCLB_QUERYCOLSIZES  (WM_USER+106)  // Query current column sizes (mp1=ptr to array of LONG).  Returned values are pixels.
  105. #define MCLB_QUERYINFO      (WM_USER+107)  // Query MCLBINFO structure.  App must free title string & array of sizes.
  106. #define MCLB_QUERYSTYLE     (WM_USER+108)  // Query MCLB style flags.  Only MCLB-specific bits are returned (e.g. not WS_VISIBLE, etc).
  107. #define MCLB_QUERYFULLSIZE  (WM_USER+109)  // Query width of sum of columns (e.g. width available for columns)
  108. #define MCLB_QUERYCTLCOL    (WM_USER+110)  // Query source of current WM_CONTROL message (column number) -- must be SENT, only valid during WM_CONTROL in owner
  109.