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

  1. //---------------------------------------------------------------------------
  2. //        Copyright (C) 1991-92, 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. // Pix.h
  10. //---------------------------------------------------------------------------
  11.  
  12. //---------------------------------------------------------------------------
  13. // Resource Information
  14. //---------------------------------------------------------------------------
  15. // Toolbox bitmap resource IDs numbers.
  16. //---------------------------------------------------------------------------
  17. #define IDBMP_PIX           8000
  18. #define IDBMP_PIXDOWN           8001
  19. #define IDBMP_PIXMONO           8003
  20. #define IDBMP_PIXEGA           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 Pix Custom Control Example\0"
  28. #define VBX_INTERNALNAME       "PIX\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       "PIX.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. // Pix control data and structs
  51. //---------------------------------------------------------------------------
  52. #define ARRMAX          10
  53.  
  54. typedef struct tagPIX
  55.     {
  56.     HSZ   List[ARRMAX];
  57.     HPIC  hpicPict;
  58.     HLSTR hlstrMyTag;
  59.     HLSTR hlstrMyTagMsg;
  60.     } PIX;
  61.  
  62. typedef PIX FAR * PPIX;
  63.  
  64.  
  65. //---------------------------------------------------------------------------
  66. // Control Procedure
  67. //---------------------------------------------------------------------------
  68. LONG FAR PASCAL _export PixCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  69.  
  70.  
  71. //---------------------------------------------------------------------------
  72. // Property info
  73. //---------------------------------------------------------------------------
  74. PROPINFO Property_Arr =
  75.     {
  76.     "List",
  77.     DT_HSZ | PF_fPropArray| PF_fGetMsg | PF_fSetMsg  | PF_fNoShow,
  78.     OFFSETIN(PIX, List)
  79.     };
  80.  
  81. PROPINFO Property_Pict =
  82.     {
  83.     "Picture",
  84.     DT_PICTURE | PF_fGetData | PF_fSetCheck | PF_fSetData | PF_fSaveData | PF_fSetMsg,
  85.     OFFSETIN(PIX, hpicPict)
  86.     };
  87.  
  88. PROPINFO Property_MyTag =
  89.     {
  90.     "MyTag",
  91.     //-----------------------------------------------------------------
  92.     // **** You must never use PF_fGetData alone when dealing with ****
  93.     // **** DT_HLSTR properties!  See VBM_GETPROPERTY, case       ****
  94.     // **** IPROP_PIX_MYTAG for more information.           ****
  95.     //-----------------------------------------------------------------
  96.     DT_HLSTR | PF_fGetData | PF_fGetMsg | PF_fSetData | PF_fSaveData | PF_fDefVal,
  97.     OFFSETIN(PIX, hlstrMyTag),
  98.     NULL
  99.     };
  100.  
  101. PROPINFO Property_MyTagMsg =
  102.     {
  103.     "MyTagMsg",
  104.     DT_HLSTR | PF_fGetMsg | PF_fSetMsg | PF_fSaveData | PF_fDefVal,
  105.     OFFSETIN(PIX, hlstrMyTagMsg),
  106.     NULL
  107.     };
  108.  
  109.  
  110. //---------------------------------------------------------------------------
  111. // Property list
  112. //---------------------------------------------------------------------------
  113. // Define the consecutive indicies for the properties
  114. //---------------------------------------------------------------------------
  115. #define IPROP_PIX_CTLNAME              0
  116. #define IPROP_PIX_INDEX                1
  117. #define IPROP_PIX_BACKCOLOR            2
  118. #define IPROP_PIX_LEFT                 3
  119. #define IPROP_PIX_TOP                  4
  120. #define IPROP_PIX_WIDTH                5
  121. #define IPROP_PIX_HEIGHT               6
  122. #define IPROP_PIX_VISIBLE              7
  123. #define IPROP_PIX_PARENT               8
  124. #define IPROP_PIX_DRAGMODE             9
  125. #define IPROP_PIX_DRAGICON            10
  126. #define IPROP_PIX_TAG                 11
  127. #define IPROP_PIX_LIST                12
  128. #define IPROP_PIX_PICT                13
  129. #define IPROP_PIX_MYTAG           14
  130. #define IPROP_PIX_LINKMODE            15
  131. #define IPROP_PIX_LINKTOPIC           16
  132. #define IPROP_PIX_LINKITEM            17
  133. #define IPROP_PIX_LINKTIEMOUT         18
  134. #define IPROP_PIX_MYTAGMSG          19
  135.  
  136. PPROPINFO Pix_Properties[] =
  137.     {
  138.     PPROPINFO_STD_CTLNAME,
  139.     PPROPINFO_STD_INDEX,
  140.     PPROPINFO_STD_BACKCOLOR,
  141.     PPROPINFO_STD_LEFT,
  142.     PPROPINFO_STD_TOP,
  143.     PPROPINFO_STD_WIDTH,
  144.     PPROPINFO_STD_HEIGHT,
  145.     PPROPINFO_STD_VISIBLE,
  146.     PPROPINFO_STD_PARENT,
  147.     PPROPINFO_STD_DRAGMODE,
  148.     PPROPINFO_STD_DRAGICON,
  149.     PPROPINFO_STD_TAG,
  150.     &Property_Arr,
  151.     &Property_Pict,
  152.     &Property_MyTag,
  153.     PPROPINFO_STD_LINKTOPIC,
  154.     PPROPINFO_STD_LINKITEM,
  155.     PPROPINFO_STD_LINKTIMEOUT,
  156.     PPROPINFO_STD_LINKMODE,     // Linkmode must be the last link property specified!
  157.     &Property_MyTagMsg,
  158.     NULL
  159.     };
  160.  
  161.  
  162. //---------------------------------------------------------------------------
  163. // Event list
  164. //---------------------------------------------------------------------------
  165. // Define the consecutive indicies for the events
  166. //---------------------------------------------------------------------------
  167. #define IEVENT_PIX_CLICK               0
  168. #define IEVENT_PIX_DRAGDROP            1
  169. #define IEVENT_PIX_DRAGOVER            2
  170. #define IEVENT_PIX_LINKERROR           3
  171. #define IEVENT_PIX_LINKCLOSE           4
  172. #define IEVENT_PIX_LINKOPEN            5
  173. #define IEVENT_PIX_LINKCHANGE          6
  174.  
  175. PEVENTINFO Pix_Events[] =
  176.     {
  177.     PEVENTINFO_STD_CLICK,
  178.     PEVENTINFO_STD_DRAGDROP,
  179.     PEVENTINFO_STD_DRAGOVER,
  180.     PEVENTINFO_STD_LINKERROR,
  181.     PEVENTINFO_STD_LINKCLOSE,
  182.     PEVENTINFO_STD_LINKOPEN,
  183.     PEVENTINFO_STD_LINKCHANGE,
  184.     NULL
  185.     };
  186.  
  187.  
  188. //---------------------------------------------------------------------------
  189. // Model struct
  190. //---------------------------------------------------------------------------
  191. // Define the control model (using the event and property structures).
  192. //---------------------------------------------------------------------------
  193. MODEL modelPix =
  194.     {
  195.     VB_VERSION,             // VB version being used
  196.     MODEL_fGraphical |            // MODEL flags
  197.       MODEL_fLoadMsg,            // Needed for DDE!
  198.     (PCTLPROC)PixCtlProc,        // Control procedures
  199.     0,                    // Class style
  200.     0,                    // Default Windows style
  201.     sizeof(PIX),            // Size of PIX structure
  202.     IDBMP_PIX,                // Palette bitmap ID
  203.     "Pix",                // Default control name
  204.     "Pix",                // Visual Basic class name
  205.     NULL,                // Parent class name
  206.     Pix_Properties,            // Property information table
  207.     Pix_Events,             // Event information table
  208.     IPROP_PIX_PICT,            // Default property
  209.     IEVENT_PIX_CLICK,            // Default event
  210.     IPROP_PIX_PICT            // Property representing value of ctl
  211.     };
  212.  
  213. LPMODEL modellistPix[] =
  214.     {
  215.     &modelPix,
  216.     NULL
  217.     };
  218.  
  219. MODELINFO modelinfoPix =
  220.     {
  221.     VB100_VERSION,            // VB version being used
  222.     modellistPix            // MODEL list
  223.     };
  224.  
  225. #endif  // RC_INVOKED
  226.  
  227. //---------------------------------------------------------------------------
  228.