home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk3 / xlist.h_ / xlist.bin
Text File  |  1993-04-28  |  8KB  |  239 lines

  1. //---------------------------------------------------------------------------
  2. //        Copyright (C) 1992-93, 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-93\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            3,00,0,00
  39. #define VBX_VERSION_STR        "3.00.000\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.     0, 0, 0, NULL, 0
  92.     };
  93.  
  94. PROPINFO Property_ItemDefHeight =
  95.     {
  96.     "ItemDefHeight",
  97.     DT_YSIZE | PF_fGetData | PF_fSetData | PF_fSaveData,
  98.     OFFSETIN(XLIST, itemDefHeight),
  99.     0, 0, NULL, 0
  100.     };
  101.  
  102. PROPINFO Property_ItemFontName =
  103.     {
  104.     "ItemFontName",
  105.     DT_HSZ | PF_fPropArray| PF_fGetMsg | PF_fSetMsg  | PF_fNoShow,
  106.     0, 0, 0, NULL, 0
  107.     };
  108.  
  109. PROPINFO Property_ItemFontSize =
  110.     {
  111.     "ItemFontSize",
  112.     DT_SHORT | PF_fPropArray| PF_fGetMsg | PF_fSetMsg  | PF_fNoShow,
  113.     0, 0, 0, NULL, 0
  114.     };
  115.  
  116. PROPINFO Property_ItemForeColor =
  117.     {
  118.     "ItemForeColor",
  119.     DT_COLOR | PF_fPropArray| PF_fGetMsg | PF_fSetMsg  | PF_fNoShow,
  120.     0, 0, 0, NULL, 0
  121.     };
  122.  
  123. PROPINFO Property_ItemImage =
  124.     {
  125.     "ItemImage",
  126.     DT_PICTURE | PF_fPropArray | PF_fGetMsg | PF_fSetMsg | PF_fNoShow,
  127.     0, 0, 0, NULL, 0
  128.     };
  129.  
  130. PROPINFO Property_ItemInvert =
  131.     {
  132.     "ItemInvert",
  133.     DT_BOOL | PF_fGetData | PF_fSetData | PF_fSaveData,
  134.     OFFSETIN(XLIST, bInvert),
  135.     0, 0, NULL, 0
  136.     };
  137.  
  138.  
  139. //---------------------------------------------------------------------------
  140. // Property list
  141. //---------------------------------------------------------------------------
  142. // Define the consecutive indicies for the properties
  143. //---------------------------------------------------------------------------
  144. #define IPROP_XLIST_CTLNAME         0
  145. #define IPROP_XLIST_INDEX         1
  146. #define IPROP_XLIST_TAG          2
  147. #define IPROP_XLIST_LEFT         3
  148. #define IPROP_XLIST_HEIGHT         6
  149. #define IPROP_XLIST_ITEMBACKCOLOR     9
  150. #define IPROP_XLIST_ITEMDEFHEIGHT    10
  151. #define IPROP_XLIST_ITEMFONTNAME    11
  152. #define IPROP_XLIST_ITEMFONTSIZE    12
  153. #define IPROP_XLIST_ITEMFORECOLOR    13
  154. #define IPROP_XLIST_ITEMIMAGE        14
  155. #define IPROP_XLIST_ITEMINVERT        15
  156.  
  157. PPROPINFO XList_Properties[] =
  158.     {
  159.     PPROPINFO_STD_CTLNAME,
  160.     PPROPINFO_STD_INDEX,
  161.     PPROPINFO_STD_TAG,
  162.     PPROPINFO_STD_LEFT,
  163.     PPROPINFO_STD_TOP,
  164.     PPROPINFO_STD_WIDTH,
  165.     PPROPINFO_STD_HEIGHT,
  166.     PPROPINFO_STD_FONTNAME,
  167.     PPROPINFO_STD_FONTSIZE,
  168.     &Property_ItemBackColor,
  169.     &Property_ItemDefHeight,
  170.     &Property_ItemFontName,
  171.     &Property_ItemFontSize,
  172.     &Property_ItemForeColor,
  173.     &Property_ItemImage,
  174.     &Property_ItemInvert,
  175.     PPROPINFO_STD_HWND,
  176.     PPROPINFO_STD_HELPCONTEXTID,
  177.     PPROPINFO_STD_ALIGN,
  178.     NULL
  179.     };
  180.  
  181.  
  182. //---------------------------------------------------------------------------
  183. // Event list
  184. //---------------------------------------------------------------------------
  185. // Define the consecutive indicies for the events
  186. //---------------------------------------------------------------------------
  187. #define IEVENT_XLIST_CLICK            0
  188.  
  189. PEVENTINFO XList_Events[] =
  190.     {
  191.     PEVENTINFO_STD_CLICK,
  192.     NULL
  193.     };
  194.  
  195.  
  196. //---------------------------------------------------------------------------
  197. // Model struct
  198. //---------------------------------------------------------------------------
  199. // Define the control model (using the event and property structures).
  200. //---------------------------------------------------------------------------
  201. MODEL modelXList =
  202.     {
  203.     VB_VERSION,             // VB version being used
  204.     MODEL_fFocusOk | MODEL_fArrows    // MODEL flags
  205.            | MODEL_fInitMsg,
  206.     (PCTLPROC)XListCtlProc,             // Control procedures
  207.     CS_DBLCLKS | CS_HREDRAW        // Class style
  208.            | CS_VREDRAW,
  209.     WS_VSCROLL | WS_BORDER        // Window style
  210.            | WS_CHILD
  211.            | LBS_NOTIFY
  212.            | LBS_OWNERDRAWVARIABLE
  213.            | LBS_HASSTRINGS,
  214.     sizeof(XLIST),            // Size of XLIST structure
  215.     IDBMP_XLISTUP,            // Palette bitmap ID
  216.     "XList",                // Default control name
  217.     "XListBox",             // Visual Basic class name
  218.     "LISTBOX",                // Parent class name
  219.     XList_Properties,                   // Property information table
  220.     XList_Events,            // Event information table
  221.     -1                    // Property representing value of ctl
  222.     };
  223.  
  224. LPMODEL modelListXlist[] =
  225.     {
  226.     &modelXList,
  227.     NULL
  228.     };
  229.  
  230. MODELINFO modelInfoXList =
  231.     {
  232.     VB_VERSION,                         // VB version being used
  233.     modelListXlist                      // MODEL list
  234.     };
  235.  
  236. #endif  // RC_INVOKED
  237.  
  238. //---------------------------------------------------------------------------
  239.