home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 21.ddi / PAL.H_ / PAL.bin
Encoding:
Text File  |  1993-02-14  |  6.4 KB  |  189 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. // Pal.h
  10. //---------------------------------------------------------------------------
  11.  
  12. //---------------------------------------------------------------------------
  13. // Resource Information
  14. //---------------------------------------------------------------------------
  15. // Toolbox bitmap resource IDs numbers must be consecutive from N to N+5
  16. //---------------------------------------------------------------------------
  17. #define IDBMP_PAL        8000
  18. #define IDBMP_PALDOWN        8001
  19. #define IDBMP_PALMONO        8003
  20. #define IDBMP_PALEGA        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 Palette Custom Control Example\0"
  28. #define VBX_INTERNALNAME       "PAL\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       "PAL.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. // PAL control data and structs
  51. //---------------------------------------------------------------------------
  52. typedef struct tagPAL
  53.     {
  54.     HPALETTE hpal;      // The palette currently displayed
  55.     } PAL;
  56.  
  57. typedef PAL FAR *PPAL;
  58.  
  59. #define PALDEREF(hctl) ((PPAL)VBDerefControl(hctl))
  60.  
  61.  
  62. //---------------------------------------------------------------------------
  63. // Control Procedure
  64. //---------------------------------------------------------------------------
  65. LONG _export FAR PASCAL PalCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  66.  
  67.  
  68. //---------------------------------------------------------------------------
  69. // Property info
  70. //---------------------------------------------------------------------------
  71. PROPINFO propinfoHPal =
  72.     {
  73.     "hPal",
  74.     DT_SHORT | PF_fGetData | PF_fNoRuntimeW | PF_fNoShow,
  75.     OFFSETIN(PAL,hpal),0
  76.     };
  77.  
  78. PROPINFO propinfoPicture =
  79.     {
  80.     "Picture",
  81.     DT_PICTURE | PF_fGetMsg | PF_fSetMsg
  82.     };
  83.  
  84. PROPINFO propinfoLength =
  85.     {
  86.     "Length",
  87.     DT_SHORT | PF_fGetMsg | PF_fSetMsg | PF_fNoShow
  88.     };
  89.  
  90. PROPINFO propinfoEntry =
  91.     {
  92.     "Entry",
  93.     DT_LONG | PF_fPropArray | PF_fGetMsg | PF_fSetMsg | PF_fNoShow
  94.     };
  95.  
  96.  
  97. //---------------------------------------------------------------------------
  98. // Property list
  99. //---------------------------------------------------------------------------
  100. // Define the consecutive indicies for the properties
  101. //---------------------------------------------------------------------------
  102. #define IPROP_PAL_NAME        0x0000
  103. #define IPROP_PAL_INDEX     0x0001
  104. #define IPROP_PAL_BACKCOLOR    0x0002
  105. #define IPROP_PAL_LEFT        0x0003
  106. #define IPROP_PAL_TOP        0x0004
  107. #define IPROP_PAL_WIDTH     0x0005
  108. #define IPROP_PAL_HEIGHT    0x0006
  109. #define IPROP_PAL_PARENT    0x0007
  110. #define IPROP_PAL_TAG        0x0008
  111. #define IPROP_PAL_BORDERSTYLEON 0x0009
  112. #define IPROP_PAL_ALIGN     0x000A
  113. #define IPROP_PAL_HPAL        0x000B
  114. #define IPROP_PAL_PICTURE    0x000C
  115. #define IPROP_PAL_LENGTH    0x000D
  116. #define IPROP_PAL_ENTRY     0x000E
  117. #define IPROP_PAL_HWND        0x000F
  118.  
  119. PPROPINFO proplistPal[] =
  120.     {
  121.     PPROPINFO_STD_NAME,
  122.     PPROPINFO_STD_INDEX,
  123.     PPROPINFO_STD_BACKCOLOR,
  124.     PPROPINFO_STD_LEFT,
  125.     PPROPINFO_STD_TOP,
  126.     PPROPINFO_STD_WIDTH,
  127.     PPROPINFO_STD_HEIGHT,
  128.     PPROPINFO_STD_PARENT,
  129.     PPROPINFO_STD_TAG,
  130.     PPROPINFO_STD_BORDERSTYLEON,
  131.     PPROPINFO_STD_ALIGN,
  132.     &propinfoHPal,
  133.     &propinfoPicture,
  134.     &propinfoLength,
  135.     &propinfoEntry,
  136.     PPROPINFO_STD_HWND,
  137.     NULL
  138.     };
  139.  
  140.  
  141. //---------------------------------------------------------------------------
  142. // Event list (none)
  143. //---------------------------------------------------------------------------
  144. PEVENTINFO eventlistPal[] =
  145.     {
  146.     NULL
  147.     };
  148.  
  149.  
  150. //---------------------------------------------------------------------------
  151. // Model struct
  152. //---------------------------------------------------------------------------
  153. // Define the control model (using the event and property structures).
  154. //---------------------------------------------------------------------------
  155. MODEL modelPal =
  156.     {
  157.     VB_VERSION,             // VB version being used
  158.     0,                    // MODEL flags
  159.     (PCTLPROC)PalCtlProc,        // Control procedure
  160.     CS_VREDRAW | CS_HREDRAW,        // Class style
  161.     WS_BORDER,                // Default Window style
  162.     sizeof(PAL),            // cbCtlExtra for PAL structure
  163.     IDBMP_PAL,                // Palette bitmap ID
  164.     "Pal",                // Default control name
  165.     "Palette",                // Visual Basic class name
  166.     NULL,                // Parent class name
  167.     proplistPal,            // Properties list
  168.     eventlistPal,            // Events list
  169.     IPROP_PAL_PICTURE,            // Default property
  170.     0,                    // Default event
  171.     IPROP_PAL_PICTURE            // Property representing value of ctl
  172.     };
  173.  
  174. LPMODEL modellistPal[] =
  175.     {
  176.     &modelPal,
  177.     NULL
  178.     };
  179.  
  180. MODELINFO modelinfoPal =
  181.     {
  182.     VB_VERSION,             // VB version being used
  183.     modellistPal            // MODEL list
  184.     };
  185.  
  186. #endif  // RC_INVOKED
  187.  
  188. //---------------------------------------------------------------------------
  189.