home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 21.ddi / CIRC2.H_ / CIRC2.bin
Encoding:
Text File  |  1993-02-14  |  6.0 KB  |  187 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. // 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. #ifndef RC_INVOKED
  24. //---------------------------------------------------------------------------
  25. // Macro for referencing member of structure
  26. //---------------------------------------------------------------------------
  27. #define OFFSETIN(struc,field)      ((USHORT)&(((struc *)0)->field))
  28.  
  29.  
  30. //---------------------------------------------------------------------------
  31. // Control Procedure
  32. //---------------------------------------------------------------------------
  33. LONG FAR PASCAL _export CircleCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  34.  
  35.  
  36. //---------------------------------------------------------------------------
  37. // CIRC control data and structs
  38. //---------------------------------------------------------------------------
  39. typedef struct tagCIRC
  40.     {
  41.     RECT  rectDrawInto;
  42.     SHORT CircleShape;
  43.     LONG  FlashColor;
  44.     } CIRC;
  45.  
  46. typedef CIRC FAR * LPCIRC;
  47.  
  48. #define LpcircDEREF(hctl)    ((LPCIRC)VBDerefControl(hctl))
  49.  
  50.  
  51. //---------------------------------------------------------------------------
  52. // Property info
  53. //---------------------------------------------------------------------------
  54. PROPINFO Property_CircleShape =
  55.     {
  56.     "CircleShape",
  57.     DT_SHORT | PF_fGetData | PF_fSetMsg | PF_fSaveData,
  58.     OFFSETIN(CIRC, CircleShape), 0,
  59.     0,
  60.     NULL, 0
  61.     };
  62.  
  63. PROPINFO Property_FlashColor =
  64.     {
  65.     "FlashColor",
  66.     DT_COLOR | PF_fGetData | PF_fSetData | PF_fSaveData,
  67.     OFFSETIN(CIRC, FlashColor), 0,
  68.     0,
  69.     NULL, 0
  70.     };
  71.  
  72.  
  73. //---------------------------------------------------------------------------
  74. // Property list
  75. //---------------------------------------------------------------------------
  76. // Define the consecutive indicies for the properties
  77. //---------------------------------------------------------------------------
  78. #define IPROP_CIRCLE_CTLNAME              0
  79. #define IPROP_CIRCLE_INDEX                1
  80. #define IPROP_CIRCLE_BACKCOLOR            2
  81. #define IPROP_CIRCLE_LEFT                 3
  82. #define IPROP_CIRCLE_TOP                  4
  83. #define IPROP_CIRCLE_WIDTH                5
  84. #define IPROP_CIRCLE_HEIGHT               6
  85. #define IPROP_CIRCLE_VISIBLE              7
  86. #define IPROP_CIRCLE_PARENT               8
  87. #define IPROP_CIRCLE_DRAGMODE             9
  88. #define IPROP_CIRCLE_DRAGICON            10
  89. #define IPROP_CIRCLE_TAG                 11
  90. #define IPROP_CIRCLE_SHAPE         12
  91. #define IPROP_CIRCLE_FLASHCOLOR      13
  92. #define IPROP_CIRCLE_HWND         14
  93.  
  94. PPROPINFO Circle_Properties[] =
  95.     {
  96.     PPROPINFO_STD_CTLNAME,
  97.     PPROPINFO_STD_INDEX,
  98.     PPROPINFO_STD_BACKCOLOR,
  99.     PPROPINFO_STD_LEFT,
  100.     PPROPINFO_STD_TOP,
  101.     PPROPINFO_STD_WIDTH,
  102.     PPROPINFO_STD_HEIGHT,
  103.     PPROPINFO_STD_VISIBLE,
  104.     PPROPINFO_STD_PARENT,
  105.     PPROPINFO_STD_DRAGMODE,
  106.     PPROPINFO_STD_DRAGICON,
  107.     PPROPINFO_STD_TAG,
  108.     &Property_CircleShape,
  109.     &Property_FlashColor,
  110.     PPROPINFO_STD_HWND,
  111.     NULL
  112.     };
  113.  
  114.  
  115. //---------------------------------------------------------------------------
  116. // Event info
  117. //---------------------------------------------------------------------------
  118. WORD Paramtypes_ClickIn[] = {ET_R4, ET_R4};
  119.  
  120. EVENTINFO Event_ClickIn =
  121.     {
  122.     "ClickIn",
  123.     2,
  124.     4,
  125.     Paramtypes_ClickIn,
  126.     "X As Single,Y As Single"
  127.     };
  128.  
  129. EVENTINFO Event_ClickOut =
  130.     {
  131.     "ClickOut",
  132.     0,
  133.     0,
  134.     NULL,
  135.     NULL
  136.     };
  137.  
  138.  
  139. //---------------------------------------------------------------------------
  140. // Event list
  141. //---------------------------------------------------------------------------
  142. // Define the consecutive indicies for the events
  143. //---------------------------------------------------------------------------
  144. #define IEVENT_CIRCLE_CLICKIN          0
  145. #define IEVENT_CIRCLE_CLICKOUT          1
  146. #define IEVENT_CIRCLE_DRAGDROP          2
  147. #define IEVENT_CIRCLE_DRAGOVER          3
  148.  
  149.  
  150. PEVENTINFO Circle_Events[] =
  151.     {
  152.     &Event_ClickIn,
  153.     &Event_ClickOut,
  154.     PEVENTINFO_STD_DRAGDROP,
  155.     PEVENTINFO_STD_DRAGOVER,
  156.     NULL
  157.     };
  158.  
  159.  
  160. //---------------------------------------------------------------------------
  161. // Model struct
  162. //---------------------------------------------------------------------------
  163. // Define the control model (using the event and property structures).
  164. //---------------------------------------------------------------------------
  165. MODEL modelCircle =
  166.     {
  167.     VB_VERSION,             // VB version being used
  168.     0,                    // MODEL flags
  169.     (PCTLPROC)CircleCtlProc,        // Control procedure
  170.     CS_VREDRAW | CS_HREDRAW,        // Class style
  171.     0L,                 // Default Windows style
  172.     sizeof(CIRC),            // Size of CIRC structure
  173.     IDBMP_CIRCLE,            // Palette bitmap ID
  174.     "Circle",                // Default control name
  175.     "CIRC2",                // Visual Basic class name
  176.     NULL,                // Parent class name
  177.     Circle_Properties,            // Property information table
  178.     Circle_Events,            // Event information table
  179.     IPROP_CIRCLE_SHAPE,         // Default property
  180.     IEVENT_CIRCLE_CLICKIN,        // Default event
  181.     IPROP_CIRCLE_SHAPE            // Property representing value of ctl
  182.     };
  183.  
  184. #endif    // RC_INVOKED
  185.  
  186. //---------------------------------------------------------------------------
  187.