home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 21.ddi / CIRC3.H_ / CIRC3.bin
Encoding:
Text File  |  1993-02-14  |  9.4 KB  |  273 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. // Circ3.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. //---------------------------------------------------------------------------
  24. // Constants used by dialog boxes
  25. //---------------------------------------------------------------------------
  26. #define DI_OK          1
  27. #define DI_CANCEL     2
  28. #define DI_REDOPT     105
  29. #define DI_GREENOPT   106
  30. #define DI_BLUEOPT    107
  31.  
  32.  
  33. //---------------------------------------------------------------------------
  34. // Change these for each new VBX file
  35. //---------------------------------------------------------------------------
  36. #define VBX_COMPANYNAME        "Microsoft Corporation\0"
  37. #define VBX_FILEDESCRIPTION       "Visual Basic Circle Custom Control Example\0"
  38. #define VBX_INTERNALNAME       "CIRC3\0"
  39. #define VBX_LEGALCOPYRIGHT       "Copyright \251 Microsoft Corp. 1991-92\0"
  40. #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"
  41. #define VBX_ORIGINALFILENAME       "CIRC3.VBX\0"
  42. #define VBX_PRODUCTNAME        "Microsoft\256 Visual Basic\231 for Windows\231\0"
  43.  
  44.  
  45. //---------------------------------------------------------------------------
  46. // Update these fields for each build.
  47. //---------------------------------------------------------------------------
  48. #define VBX_VERSION            2,00,6,01
  49. #define VBX_VERSION_STR        "2.00.601\0"
  50.  
  51.  
  52. #ifndef RC_INVOKED
  53. //---------------------------------------------------------------------------
  54. // Macro for referencing member of structure
  55. //---------------------------------------------------------------------------
  56. #define OFFSETIN(struc, field)        ((USHORT)&(((struc *)0)->field))
  57.  
  58.  
  59. //---------------------------------------------------------------------------
  60. // Control and Window Procedures
  61. //---------------------------------------------------------------------------
  62. LONG FAR PASCAL _export CircleCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  63. LONG FAR PASCAL _export FlashPopupWndProc(HWND hwnd, USHORT msg, USHORT wp, LONG lp);
  64.  
  65.  
  66. //---------------------------------------------------------------------------
  67. // Global Variables and Constants
  68. //---------------------------------------------------------------------------
  69. extern    HANDLE hmodDLL;     // From ccinit.c
  70. #define CLASS_FLASHPOPUP    "FCPopup"
  71.  
  72.  
  73. //---------------------------------------------------------------------------
  74. // CIRCLE control data and structs
  75. //---------------------------------------------------------------------------
  76. typedef struct tagCIRC
  77.     {
  78.     RECT    rectDrawInto;
  79.     ENUM    CircleShape;    // Changed from SHORT to demonstrate ENUM prop
  80.     LONG    FlashColor;
  81.     HFONT   hfont;
  82.     HSZ     hszCaption;
  83.     } CIRC;
  84.  
  85. typedef CIRC FAR * LPCIRC;
  86.  
  87. #define LpcircDEREF(hctl)     ((LPCIRC)VBDerefControl(hctl))
  88.  
  89.  
  90. //---------------------------------------------------------------------------
  91. // Private messages
  92. //---------------------------------------------------------------------------
  93. #define CM_OPENFLASHDLG     WM_USER
  94.  
  95.  
  96. //---------------------------------------------------------------------------
  97. // Property info
  98. //---------------------------------------------------------------------------
  99. // List of enumeration for CircleShape ENUM property
  100. #define SHAPE_CIRCLE    0
  101. #define SHAPE_OVAL    1
  102. #define SHAPE_MAX    1
  103.  
  104. PROPINFO Property_CircleShape =
  105.     {
  106.     "CircleShape",
  107.     // Changed from SHORT to demonstrate an ENUM property
  108.     DT_ENUM | PF_fGetData | PF_fSetMsg | PF_fSaveData,
  109.     OFFSETIN(CIRC, CircleShape), 0,
  110.     SHAPE_CIRCLE,
  111.     "0 - Circle\0" "1 - Oval\0", SHAPE_MAX
  112.     };
  113.  
  114. PROPINFO Property_FlashColor =
  115.     {
  116.     "FlashColor",
  117.     DT_COLOR | PF_fGetData | PF_fSetData | PF_fSaveData | PF_fEditable,
  118.     OFFSETIN(CIRC, FlashColor)
  119.     };
  120.  
  121.  
  122. //---------------------------------------------------------------------------
  123. // Property list
  124. //---------------------------------------------------------------------------
  125. // Define the consecutive indicies for the properties
  126. //---------------------------------------------------------------------------
  127. #define IPROP_CIRCLE_CTLNAME          0
  128. #define IPROP_CIRCLE_INDEX                1
  129. #define IPROP_CIRCLE_BACKCOLOR            2
  130. #define IPROP_CIRCLE_LEFT                 3
  131. #define IPROP_CIRCLE_TOP                  4
  132. #define IPROP_CIRCLE_WIDTH                5
  133. #define IPROP_CIRCLE_HEIGHT               6
  134. #define IPROP_CIRCLE_VISIBLE              7
  135. #define IPROP_CIRCLE_PARENT               8
  136. #define IPROP_CIRCLE_DRAGMODE             9
  137. #define IPROP_CIRCLE_DRAGICON            10
  138. #define IPROP_CIRCLE_TAG                 11
  139. #define IPROP_CIRCLE_CIRCLESHAPE         12
  140. #define IPROP_CIRCLE_FLASHCOLOR          13
  141. #define IPROP_CIRCLE_CAPTION             14
  142. #define IPROP_CIRCLE_FONTNAME            15
  143. #define IPROP_CIRCLE_FONTBOLD            16
  144. #define IPROP_CIRCLE_FONTITALIC          17
  145. #define IPROP_CIRCLE_FONTSTRIKE          18
  146. #define IPROP_CIRCLE_FONTUNDER           19
  147. #define IPROP_CIRCLE_FONTSIZE            20
  148. #define IPROP_CIRCLE_BORDERSTYLE     21
  149. #define IPROP_CIRCLE_TABINDEX         22
  150. #define IPROP_CIRCLE_TABSTOP         23
  151. #define IPROP_CIRCLE_ENABLED         24
  152. #define IPROP_CIRCLE_MOUSEPOINTER     25
  153. #define IPROP_CIRCLE_HWND         26
  154. #define IPROP_CIRCLE_HELPCONTEXTID     27
  155.  
  156. PPROPINFO Circle_Properties[] =
  157.     {
  158.     PPROPINFO_STD_CTLNAME,
  159.     PPROPINFO_STD_INDEX,
  160.     PPROPINFO_STD_BACKCOLOR,
  161.     PPROPINFO_STD_LEFT,
  162.     PPROPINFO_STD_TOP,
  163.     PPROPINFO_STD_WIDTH,
  164.     PPROPINFO_STD_HEIGHT,
  165.     PPROPINFO_STD_VISIBLE,
  166.     PPROPINFO_STD_PARENT,
  167.     PPROPINFO_STD_DRAGMODE,
  168.     PPROPINFO_STD_DRAGICON,
  169.     PPROPINFO_STD_TAG,
  170.     &Property_CircleShape,
  171.     &Property_FlashColor,
  172.     PPROPINFO_STD_CAPTION,
  173.     PPROPINFO_STD_FONTNAME,
  174.     PPROPINFO_STD_FONTBOLD,
  175.     PPROPINFO_STD_FONTITALIC,
  176.     PPROPINFO_STD_FONTSTRIKE,
  177.     PPROPINFO_STD_FONTUNDER,
  178.     PPROPINFO_STD_FONTSIZE,
  179.     PPROPINFO_STD_BORDERSTYLEOFF,
  180.     PPROPINFO_STD_TABINDEX,
  181.     PPROPINFO_STD_TABSTOP,
  182.     PPROPINFO_STD_ENABLED,
  183.     PPROPINFO_STD_MOUSEPOINTER,
  184.     PPROPINFO_STD_HWND,
  185.     PPROPINFO_STD_HELPCONTEXTID,
  186.     NULL
  187.     };
  188.  
  189.  
  190. //---------------------------------------------------------------------------
  191. // Event info
  192. //---------------------------------------------------------------------------
  193. WORD Paramtypes_ClickIn[] = {ET_R4, ET_R4, ET_SD};
  194.  
  195. EVENTINFO Event_ClickIn =
  196.     {
  197.     "ClickIn",
  198.     3,
  199.     6,
  200.     Paramtypes_ClickIn,
  201.     "X As Single,Y As Single,Caption As String"
  202.     };
  203.  
  204. EVENTINFO Event_ClickOut =
  205.     {
  206.     "ClickOut",
  207.     0,
  208.     0,
  209.     NULL,
  210.     NULL
  211.     };
  212.  
  213.  
  214. //---------------------------------------------------------------------------
  215. // Event list
  216. //---------------------------------------------------------------------------
  217. // Define the consecutive indicies for the events
  218. //---------------------------------------------------------------------------
  219. #define IEVENT_CIRCLE_CLICKIN          0
  220. #define IEVENT_CIRCLE_CLICKOUT          1
  221. #define IEVENT_CIRCLE_DRAGDROP          2
  222. #define IEVENT_CIRCLE_DRAGOVER          3
  223.  
  224. PEVENTINFO Circle_Events[] =
  225.     {
  226.     &Event_ClickIn,
  227.     &Event_ClickOut,
  228.     PEVENTINFO_STD_DRAGDROP,
  229.     PEVENTINFO_STD_DRAGOVER,
  230.     NULL
  231.     };
  232.  
  233.  
  234. //---------------------------------------------------------------------------
  235. // Model struct
  236. //---------------------------------------------------------------------------
  237. // Define the control model (using the event and property structures).
  238. //---------------------------------------------------------------------------
  239. MODEL modelCircle =
  240.     {
  241.     VB_VERSION,             // VB version being used
  242.     MODEL_fFocusOk,            // MODEL flags
  243.     (PCTLPROC)CircleCtlProc,        // Control procedure
  244.     CS_VREDRAW | CS_HREDRAW,        // Class style
  245.     0L,                 // Default Windows style
  246.     sizeof(CIRC),            // Size of CIRC structure
  247.     IDBMP_CIRCLE,            // Palette bitmap ID
  248.     "Circle",                // Default control name
  249.     "CIRC3",                // Visual Basic class name
  250.     NULL,                // Parent class name
  251.     Circle_Properties,            // Property information table
  252.     Circle_Events,            // Event information table
  253.     IPROP_CIRCLE_CIRCLESHAPE,        // Default property
  254.     IEVENT_CIRCLE_CLICKIN,        // Default event
  255.     IPROP_CIRCLE_CIRCLESHAPE        // Property representing value of ctl
  256.     };
  257.  
  258. LPMODEL modellistCircle[] =
  259.     {
  260.     &modelCircle,
  261.     NULL
  262.     };
  263.  
  264. MODELINFO modelinfoCircle =
  265.     {
  266.     VB_VERSION,             // VB version being used
  267.     modellistCircle            // MODEL list
  268.     };
  269.  
  270. #endif    // RC_INVOKED
  271.  
  272. //---------------------------------------------------------------------------
  273.