home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / pal.h_ / pal.bin
Text File  |  1993-04-28  |  7KB  |  193 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. // 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-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       "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            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. // 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),
  76.     0, 0, NULL, 0
  77.     };
  78.  
  79. PROPINFO propinfoPicture =
  80.     {
  81.     "Picture",
  82.     DT_PICTURE | PF_fGetMsg | PF_fSetMsg,
  83.     0, 0, 0, NULL, 0
  84.     };
  85.  
  86. PROPINFO propinfoLength =
  87.     {
  88.     "Length",
  89.     DT_SHORT | PF_fGetMsg | PF_fSetMsg | PF_fNoShow,
  90.     0, 0, 0, NULL, 0
  91.     };
  92.  
  93. PROPINFO propinfoEntry =
  94.     {
  95.     "Entry",
  96.     DT_LONG | PF_fPropArray | PF_fGetMsg | PF_fSetMsg | PF_fNoShow,
  97.     0, 0, 0, NULL, 0
  98.     };
  99.  
  100.  
  101. //---------------------------------------------------------------------------
  102. // Property list
  103. //---------------------------------------------------------------------------
  104. // Define the consecutive indicies for the properties
  105. //---------------------------------------------------------------------------
  106. #define IPROP_PAL_NAME        0x0000
  107. #define IPROP_PAL_INDEX     0x0001
  108. #define IPROP_PAL_BACKCOLOR    0x0002
  109. #define IPROP_PAL_LEFT        0x0003
  110. #define IPROP_PAL_TOP        0x0004
  111. #define IPROP_PAL_WIDTH     0x0005
  112. #define IPROP_PAL_HEIGHT    0x0006
  113. #define IPROP_PAL_PARENT    0x0007
  114. #define IPROP_PAL_TAG        0x0008
  115. #define IPROP_PAL_BORDERSTYLEON 0x0009
  116. #define IPROP_PAL_ALIGN     0x000A
  117. #define IPROP_PAL_HPAL        0x000B
  118. #define IPROP_PAL_PICTURE    0x000C
  119. #define IPROP_PAL_LENGTH    0x000D
  120. #define IPROP_PAL_ENTRY     0x000E
  121. #define IPROP_PAL_HWND        0x000F
  122.  
  123. PPROPINFO proplistPal[] =
  124.     {
  125.     PPROPINFO_STD_NAME,
  126.     PPROPINFO_STD_INDEX,
  127.     PPROPINFO_STD_BACKCOLOR,
  128.     PPROPINFO_STD_LEFT,
  129.     PPROPINFO_STD_TOP,
  130.     PPROPINFO_STD_WIDTH,
  131.     PPROPINFO_STD_HEIGHT,
  132.     PPROPINFO_STD_PARENT,
  133.     PPROPINFO_STD_TAG,
  134.     PPROPINFO_STD_BORDERSTYLEON,
  135.     PPROPINFO_STD_ALIGN,
  136.     &propinfoHPal,
  137.     &propinfoPicture,
  138.     &propinfoLength,
  139.     &propinfoEntry,
  140.     PPROPINFO_STD_HWND,
  141.     NULL
  142.     };
  143.  
  144.  
  145. //---------------------------------------------------------------------------
  146. // Event list (none)
  147. //---------------------------------------------------------------------------
  148. PEVENTINFO eventlistPal[] =
  149.     {
  150.     NULL
  151.     };
  152.  
  153.  
  154. //---------------------------------------------------------------------------
  155. // Model struct
  156. //---------------------------------------------------------------------------
  157. // Define the control model (using the event and property structures).
  158. //---------------------------------------------------------------------------
  159. MODEL modelPal =
  160.     {
  161.     VB_VERSION,             // VB version being used
  162.     0,                    // MODEL flags
  163.     (PCTLPROC)PalCtlProc,        // Control procedure
  164.     CS_VREDRAW | CS_HREDRAW,        // Class style
  165.     WS_BORDER,                // Default Window style
  166.     sizeof(PAL),            // cbCtlExtra for PAL structure
  167.     IDBMP_PAL,                // Palette bitmap ID
  168.     "Pal",                // Default control name
  169.     "Palette",                // Visual Basic class name
  170.     NULL,                // Parent class name
  171.     proplistPal,            // Properties list
  172.     eventlistPal,            // Events list
  173.     IPROP_PAL_PICTURE,            // Default property
  174.     0,                    // Default event
  175.     IPROP_PAL_PICTURE            // Property representing value of ctl
  176.     };
  177.  
  178. LPMODEL modellistPal[] =
  179.     {
  180.     &modelPal,
  181.     NULL
  182.     };
  183.  
  184. MODELINFO modelinfoPal =
  185.     {
  186.     VB_VERSION,             // VB version being used
  187.     modellistPal            // MODEL list
  188.     };
  189.  
  190. #endif  // RC_INVOKED
  191.  
  192. //---------------------------------------------------------------------------
  193.