home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 21.ddi / XLIST.H_ / XLIST.bin
Encoding:
Text File  |  1993-02-14  |  7.8 KB  |  232 lines

  1. //---------------------------------------------------------------------------
  2. //        Copyright (C) 1992, Microsoft Corporation
  3. //
  4. // You have a royalty-free right to use, modify, reproduce and distribute
  5. // the Sample Custom Control Files (and/or any modified version) in any way
  6. // you find useful, provided that you agree that Microsoft has no warranty,
  7. // obligation or liability for any Custom Control File.
  8. //---------------------------------------------------------------------------
  9. // XList.h
  10. //---------------------------------------------------------------------------
  11.  
  12. //---------------------------------------------------------------------------
  13. // Resource Information
  14. //---------------------------------------------------------------------------
  15. // Toolbox bitmap resource IDs numbers.
  16. //---------------------------------------------------------------------------
  17. #define IDBMP_XLISTUP     8000
  18. #define IDBMP_XLISTDOWN   8001
  19. #define IDBMP_XLISTMONO   8003
  20. #define IDBMP_XLISTEGA    8006
  21.  
  22.  
  23. //---------------------------------------------------------------------------
  24. // Change these for each new VBX file
  25. //---------------------------------------------------------------------------
  26. #define VBX_COMPANYNAME        "Microsoft Corporation\0"
  27. #define VBX_FILEDESCRIPTION       "Visual Basic XList Custom Control Example\0"
  28. #define VBX_INTERNALNAME       "XLIST\0"
  29. #define VBX_LEGALCOPYRIGHT       "Copyright \251 Microsoft Corp. 1991-92\0"
  30. #define VBX_LEGALTRADEMARKS       "Microsoft\256 is a registered trademark of Microsoft Corporation. Visual Basic\231 is a trademark of Microsoft Corporation. Windows\231 is a trademark of Microsoft Corporation.\0"
  31. #define VBX_ORIGINALFILENAME       "XLIST.VBX\0"
  32. #define VBX_PRODUCTNAME        "Microsoft\256 Visual Basic\231 for Windows\231\0"
  33.  
  34.  
  35. //---------------------------------------------------------------------------
  36. // Update these fields for each build.
  37. //---------------------------------------------------------------------------
  38. #define VBX_VERSION            2,00,6,01
  39. #define VBX_VERSION_STR        "2.00.601\0"
  40.  
  41.  
  42. #ifndef RC_INVOKED
  43. //---------------------------------------------------------------------------
  44. // Macro for referencing member of structure
  45. //---------------------------------------------------------------------------
  46. #define OFFSETIN(struc, field)        ((USHORT)&(((struc *)0)->field))
  47.  
  48.  
  49. //---------------------------------------------------------------------------
  50. // Control and Window Procedures
  51. //---------------------------------------------------------------------------
  52. LONG FAR PASCAL _export XListCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  53.  
  54.  
  55. //---------------------------------------------------------------------------
  56. // Global Constants
  57. //---------------------------------------------------------------------------
  58. #define DEFAULT_ITEM_HEIGHT  195
  59.  
  60.  
  61. //---------------------------------------------------------------------------
  62. // Structure describing listbox entry
  63. //---------------------------------------------------------------------------
  64. typedef struct tagATTR
  65.     {
  66.     COLORREF cBack;
  67.     COLORREF cFore;
  68.     HFONT    hFont;
  69.     HPIC     hPic;
  70.     USHORT   fontSize;
  71.     } ATTR, FAR *LPATTR;
  72.  
  73.  
  74. //---------------------------------------------------------------------------
  75. // XLIST control data and structs
  76. //---------------------------------------------------------------------------
  77. typedef struct tagXLIST
  78.     {
  79.     LONG itemDefHeight;
  80.     BOOL bInvert;
  81.     } XLIST, FAR * LPXLIST;
  82.  
  83.  
  84. //---------------------------------------------------------------------------
  85. // Property info
  86. //---------------------------------------------------------------------------
  87. PROPINFO Property_ItemBackColor =
  88.     {
  89.     "ItemBackColor",
  90.     DT_COLOR | PF_fPropArray| PF_fGetMsg | PF_fSetMsg  | PF_fNoShow
  91.     };
  92.  
  93. PROPINFO Property_ItemDefHeight =
  94.     {
  95.     "ItemDefHeight",
  96.     DT_YSIZE | PF_fGetData | PF_fSetData | PF_fSaveData,
  97.     OFFSETIN(XLIST, itemDefHeight)
  98.     };
  99.  
  100. PROPINFO Property_ItemFontName =
  101.     {
  102.     "ItemFontName",
  103.     DT_HSZ | PF_fPropArray| PF_fGetMsg | PF_fSetMsg  | PF_fNoShow
  104.     };
  105.  
  106. PROPINFO Property_ItemFontSize =
  107.     {
  108.     "ItemFontSize",
  109.     DT_SHORT | PF_fPropArray| PF_fGetMsg | PF_fSetMsg  | PF_fNoShow
  110.     };
  111.  
  112. PROPINFO Property_ItemForeColor =
  113.     {
  114.     "ItemForeColor",
  115.     DT_COLOR | PF_fPropArray| PF_fGetMsg | PF_fSetMsg  | PF_fNoShow
  116.     };
  117.  
  118. PROPINFO Property_ItemImage =
  119.     {
  120.     "ItemImage",
  121.     DT_PICTURE | PF_fPropArray | PF_fGetMsg | PF_fSetMsg | PF_fNoShow
  122.     };
  123.  
  124. PROPINFO Property_ItemInvert =
  125.     {
  126.     "ItemInvert",
  127.     DT_BOOL | PF_fGetData | PF_fSetData | PF_fSaveData,
  128.     OFFSETIN(XLIST, bInvert)
  129.     };
  130.  
  131.  
  132. //---------------------------------------------------------------------------
  133. // Property list
  134. //---------------------------------------------------------------------------
  135. // Define the consecutive indicies for the properties
  136. //---------------------------------------------------------------------------
  137. #define IPROP_XLIST_CTLNAME         0
  138. #define IPROP_XLIST_INDEX         1
  139. #define IPROP_XLIST_TAG          2
  140. #define IPROP_XLIST_LEFT         3
  141. #define IPROP_XLIST_HEIGHT         6
  142. #define IPROP_XLIST_ITEMBACKCOLOR     9
  143. #define IPROP_XLIST_ITEMDEFHEIGHT    10
  144. #define IPROP_XLIST_ITEMFONTNAME    11
  145. #define IPROP_XLIST_ITEMFONTSIZE    12
  146. #define IPROP_XLIST_ITEMFORECOLOR    13
  147. #define IPROP_XLIST_ITEMIMAGE        14
  148. #define IPROP_XLIST_ITEMINVERT        15
  149.  
  150. PPROPINFO XList_Properties[] =
  151.     {
  152.     PPROPINFO_STD_CTLNAME,
  153.     PPROPINFO_STD_INDEX,
  154.     PPROPINFO_STD_TAG,
  155.     PPROPINFO_STD_LEFT,
  156.     PPROPINFO_STD_TOP,
  157.     PPROPINFO_STD_WIDTH,
  158.     PPROPINFO_STD_HEIGHT,
  159.     PPROPINFO_STD_FONTNAME,
  160.     PPROPINFO_STD_FONTSIZE,
  161.     &Property_ItemBackColor,
  162.     &Property_ItemDefHeight,
  163.     &Property_ItemFontName,
  164.     &Property_ItemFontSize,
  165.     &Property_ItemForeColor,
  166.     &Property_ItemImage,
  167.     &Property_ItemInvert,
  168.     PPROPINFO_STD_HWND,
  169.     PPROPINFO_STD_HELPCONTEXTID,
  170.     PPROPINFO_STD_ALIGN,
  171.     NULL
  172.     };
  173.  
  174.  
  175. //---------------------------------------------------------------------------
  176. // Event list
  177. //---------------------------------------------------------------------------
  178. // Define the consecutive indicies for the events
  179. //---------------------------------------------------------------------------
  180. #define IEVENT_XLIST_CLICK            0
  181.  
  182. PEVENTINFO XList_Events[] =
  183.     {
  184.     PEVENTINFO_STD_CLICK,
  185.     NULL
  186.     };
  187.  
  188.  
  189. //---------------------------------------------------------------------------
  190. // Model struct
  191. //---------------------------------------------------------------------------
  192. // Define the control model (using the event and property structures).
  193. //---------------------------------------------------------------------------
  194. MODEL modelXList =
  195.     {
  196.     VB_VERSION,             // VB version being used
  197.     MODEL_fFocusOk | MODEL_fArrows    // MODEL flags
  198.            | MODEL_fInitMsg,
  199.     (PCTLPROC)XListCtlProc,             // Control procedures
  200.     CS_DBLCLKS | CS_HREDRAW        // Class style
  201.            | CS_VREDRAW,
  202.     WS_VSCROLL | WS_BORDER        // Window style
  203.            | WS_CHILD
  204.            | LBS_NOTIFY
  205.            | LBS_OWNERDRAWVARIABLE
  206.            | LBS_HASSTRINGS,
  207.     sizeof(XLIST),            // Size of XLIST structure
  208.     IDBMP_XLISTUP,            // Palette bitmap ID
  209.     "XList",                // Default control name
  210.     "XListBox",             // Visual Basic class name
  211.     "LISTBOX",                // Parent class name
  212.     XList_Properties,                   // Property information table
  213.     XList_Events,            // Event information table
  214.     -1                    // Property representing value of ctl
  215.     };
  216.  
  217. LPMODEL modelListXlist[] =
  218.     {
  219.     &modelXList,
  220.     NULL
  221.     };
  222.  
  223. MODELINFO modelInfoXList =
  224.     {
  225.     VB_VERSION,                         // VB version being used
  226.     modelListXlist                      // MODEL list
  227.     };
  228.  
  229. #endif  // RC_INVOKED
  230.  
  231. //---------------------------------------------------------------------------
  232.