home *** CD-ROM | disk | FTP | other *** search
/ On Hand / On_Hand_From_Softbank_1994_Release_2_Disc_2_1994.iso / 00202 / s / disk1 / circ2.h_ / circ2.bin
Text File  |  1993-04-28  |  7KB  |  201 lines

  1. //---------------------------------------------------------------------------
  2. //        Copyright (C) 1991-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. // Circ2.h
  10. //---------------------------------------------------------------------------
  11.  
  12. //---------------------------------------------------------------------------
  13. // Resource Information
  14. //---------------------------------------------------------------------------
  15. // Toolbox bitmap resource IDs numbers.
  16. //---------------------------------------------------------------------------
  17. #define IDBMP_CIRCLE        8000
  18. #define IDBMP_CIRCLEDOWN    8001
  19. #define IDBMP_CIRCLEMONO    8003
  20. #define IDBMP_CIRCLEEGA     8006
  21.  
  22. //---------------------------------------------------------------------------
  23. // Change these for each new VBX file
  24. //---------------------------------------------------------------------------
  25. #define VBX_COMPANYNAME        "Microsoft Corporation\0"
  26. #define VBX_FILEDESCRIPTION       "Visual Basic Circle Custom Control Example\0"
  27. #define VBX_INTERNALNAME       "CIRC2\0"
  28. #define VBX_LEGALCOPYRIGHT       "Copyright \251 Microsoft Corp. 1991-93\0"
  29. #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"
  30. #define VBX_ORIGINALFILENAME       "CIRC2.VBX\0"
  31. #define VBX_PRODUCTNAME        "Microsoft\256 Visual Basic\231 for Windows\231\0"
  32.  
  33. //---------------------------------------------------------------------------
  34. // Update these fields for each build.
  35. //---------------------------------------------------------------------------
  36. #define VBX_VERSION            3,00,0,00
  37. #define VBX_VERSION_STR        "3.00.000\0"
  38.  
  39. #ifndef RC_INVOKED
  40. //---------------------------------------------------------------------------
  41. // Macro for referencing member of structure
  42. //---------------------------------------------------------------------------
  43. #define OFFSETIN(struc,field)      ((USHORT)&(((struc *)0)->field))
  44.  
  45.  
  46. //---------------------------------------------------------------------------
  47. // Control Procedure
  48. //---------------------------------------------------------------------------
  49. LONG FAR PASCAL _export CircleCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  50.  
  51.  
  52. //---------------------------------------------------------------------------
  53. // CIRC control data and structs
  54. //---------------------------------------------------------------------------
  55. typedef struct tagCIRC
  56.     {
  57.     RECT  rectDrawInto;
  58.     SHORT CircleShape;
  59.     LONG  FlashColor;
  60.     } CIRC;
  61.  
  62. typedef CIRC FAR * LPCIRC;
  63.  
  64. #define LpcircDEREF(hctl)    ((LPCIRC)VBDerefControl(hctl))
  65.  
  66.  
  67. //---------------------------------------------------------------------------
  68. // Property info
  69. //---------------------------------------------------------------------------
  70. PROPINFO Property_CircleShape =
  71.     {
  72.     "CircleShape",
  73.     DT_SHORT | PF_fGetData | PF_fSetMsg | PF_fSaveData,
  74.     OFFSETIN(CIRC, CircleShape),
  75.     0, 0, NULL, 0
  76.     };
  77.  
  78. PROPINFO Property_FlashColor =
  79.     {
  80.     "FlashColor",
  81.     DT_COLOR | PF_fGetData | PF_fSetData | PF_fSaveData,
  82.     OFFSETIN(CIRC, FlashColor),
  83.     0, 0, NULL, 0
  84.     };
  85.  
  86.  
  87. //---------------------------------------------------------------------------
  88. // Property list
  89. //---------------------------------------------------------------------------
  90. // Define the consecutive indicies for the properties
  91. //---------------------------------------------------------------------------
  92. #define IPROP_CIRCLE_CTLNAME              0
  93. #define IPROP_CIRCLE_INDEX                1
  94. #define IPROP_CIRCLE_BACKCOLOR            2
  95. #define IPROP_CIRCLE_LEFT                 3
  96. #define IPROP_CIRCLE_TOP                  4
  97. #define IPROP_CIRCLE_WIDTH                5
  98. #define IPROP_CIRCLE_HEIGHT               6
  99. #define IPROP_CIRCLE_VISIBLE              7
  100. #define IPROP_CIRCLE_PARENT               8
  101. #define IPROP_CIRCLE_DRAGMODE             9
  102. #define IPROP_CIRCLE_DRAGICON            10
  103. #define IPROP_CIRCLE_TAG                 11
  104. #define IPROP_CIRCLE_SHAPE         12
  105. #define IPROP_CIRCLE_FLASHCOLOR      13
  106. #define IPROP_CIRCLE_HWND         14
  107.  
  108. PPROPINFO Circle_Properties[] =
  109.     {
  110.     PPROPINFO_STD_CTLNAME,
  111.     PPROPINFO_STD_INDEX,
  112.     PPROPINFO_STD_BACKCOLOR,
  113.     PPROPINFO_STD_LEFT,
  114.     PPROPINFO_STD_TOP,
  115.     PPROPINFO_STD_WIDTH,
  116.     PPROPINFO_STD_HEIGHT,
  117.     PPROPINFO_STD_VISIBLE,
  118.     PPROPINFO_STD_PARENT,
  119.     PPROPINFO_STD_DRAGMODE,
  120.     PPROPINFO_STD_DRAGICON,
  121.     PPROPINFO_STD_TAG,
  122.     &Property_CircleShape,
  123.     &Property_FlashColor,
  124.     PPROPINFO_STD_HWND,
  125.     NULL
  126.     };
  127.  
  128.  
  129. //---------------------------------------------------------------------------
  130. // Event info
  131. //---------------------------------------------------------------------------
  132. WORD Paramtypes_ClickIn[] = {ET_R4, ET_R4};
  133.  
  134. EVENTINFO Event_ClickIn =
  135.     {
  136.     "ClickIn",
  137.     2,
  138.     4,
  139.     Paramtypes_ClickIn,
  140.     "X As Single,Y As Single"
  141.     };
  142.  
  143. EVENTINFO Event_ClickOut =
  144.     {
  145.     "ClickOut",
  146.     0,
  147.     0,
  148.     NULL,
  149.     NULL
  150.     };
  151.  
  152.  
  153. //---------------------------------------------------------------------------
  154. // Event list
  155. //---------------------------------------------------------------------------
  156. // Define the consecutive indicies for the events
  157. //---------------------------------------------------------------------------
  158. #define IEVENT_CIRCLE_CLICKIN          0
  159. #define IEVENT_CIRCLE_CLICKOUT          1
  160. #define IEVENT_CIRCLE_DRAGDROP          2
  161. #define IEVENT_CIRCLE_DRAGOVER          3
  162.  
  163.  
  164. PEVENTINFO Circle_Events[] =
  165.     {
  166.     &Event_ClickIn,
  167.     &Event_ClickOut,
  168.     PEVENTINFO_STD_DRAGDROP,
  169.     PEVENTINFO_STD_DRAGOVER,
  170.     NULL
  171.     };
  172.  
  173.  
  174. //---------------------------------------------------------------------------
  175. // Model struct
  176. //---------------------------------------------------------------------------
  177. // Define the control model (using the event and property structures).
  178. //---------------------------------------------------------------------------
  179. MODEL modelCircle =
  180.     {
  181.     VB_VERSION,             // VB version being used
  182.     0,                    // MODEL flags
  183.     (PCTLPROC)CircleCtlProc,        // Control procedure
  184.     CS_VREDRAW | CS_HREDRAW,        // Class style
  185.     0L,                 // Default Windows style
  186.     sizeof(CIRC),            // Size of CIRC structure
  187.     IDBMP_CIRCLE,            // Palette bitmap ID
  188.     "Circle",                // Default control name
  189.     "CIRC2",                // Visual Basic class name
  190.     NULL,                // Parent class name
  191.     Circle_Properties,            // Property information table
  192.     Circle_Events,            // Event information table
  193.     IPROP_CIRCLE_SHAPE,         // Default property
  194.     IEVENT_CIRCLE_CLICKIN,        // Default event
  195.     IPROP_CIRCLE_SHAPE            // Property representing value of ctl
  196.     };
  197.  
  198. #endif    // RC_INVOKED
  199.  
  200. //---------------------------------------------------------------------------
  201.