home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 21.ddi / PUSH.H_ / PUSH.bin
Encoding:
Text File  |  1993-02-14  |  8.1 KB  |  237 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. // Push.h
  10. //---------------------------------------------------------------------------
  11.  
  12. //---------------------------------------------------------------------------
  13. // Resource Information
  14. //---------------------------------------------------------------------------
  15. // Toolbox bitmap resource IDs.
  16. //---------------------------------------------------------------------------
  17. #define IDBMP_PUSH        8000
  18. #define IDBMP_PUSHDOWN        8001
  19. #define IDBMP_PUSHMONO        8003
  20. #define IDBMP_PUSHEGA        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 Picture Push Custom Control Example\0"
  28. #define VBX_INTERNALNAME       "PUSH\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       "PUSH.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. // PUSH control data and structs
  51. //---------------------------------------------------------------------------
  52. typedef struct tagPUSH
  53.     {
  54.     HPIC hpicUp;
  55.     HPIC hpicDown;
  56.     } PUSH;
  57.  
  58. typedef PUSH FAR * LPPUSH;
  59.  
  60. #define LppushDEREF(hctl)     ((LPPUSH)VBDerefControl(hctl))
  61.  
  62.  
  63. //---------------------------------------------------------------------------
  64. // Control Procedure
  65. //---------------------------------------------------------------------------
  66. LONG FAR PASCAL _export PushCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  67.  
  68.  
  69. //---------------------------------------------------------------------------
  70. // Property info
  71. //---------------------------------------------------------------------------
  72. PROPINFO propinfoPictureUp =
  73.     {
  74.     "PictureUp",
  75.     DT_PICTURE | PF_fGetData | PF_fSetCheck | PF_fSetData | PF_fSaveData,
  76.     OFFSETIN(PUSH,hpicUp), 0
  77.     };
  78.  
  79. PROPINFO propinfoPictureDown =
  80.     {
  81.     "PictureDown",
  82.     DT_PICTURE | PF_fGetData | PF_fSetCheck | PF_fSetData | PF_fSaveData,
  83.     OFFSETIN(PUSH,hpicDown), 0
  84.     };
  85.  
  86.  
  87. //---------------------------------------------------------------------------
  88. // Property list
  89. //---------------------------------------------------------------------------
  90. // Define the consecutive indicies for the properties
  91. //---------------------------------------------------------------------------
  92. #define IPROP_PUSH_NAME       0x0000
  93. #define IPROP_PUSH_INDEX      0x0001
  94. #define IPROP_PUSH_PARENT      0x0002
  95. #define IPROP_PUSH_BACKCOLOR      0x0003
  96. #define IPROP_PUSH_LEFT       0x0004
  97. #define IPROP_PUSH_TOP          0x0005
  98. #define IPROP_PUSH_WIDTH      0x0006
  99. #define IPROP_PUSH_HEIGHT      0x0007
  100. #define IPROP_PUSH_ENABLED      0x0008
  101. #define IPROP_PUSH_VISIBLE      0x0009
  102. #define IPROP_PUSH_MOUSEPOINTER   0x000A
  103. #define IPROP_PUSH_CAPTION      0x000B
  104. #define IPROP_PUSH_FONTNAME      0x000C
  105. #define IPROP_PUSH_FONTSIZE      0x000D
  106. #define IPROP_PUSH_FONTBOLD      0x000E
  107. #define IPROP_PUSH_FONTITALIC      0x000F
  108. #define IPROP_PUSH_FONTSTRIKE      0x0010
  109. #define IPROP_PUSH_FONTUNDER      0x0011
  110. #define IPROP_PUSH_DRAG       0x0012
  111. #define IPROP_PUSH_DRAGICON      0x0013
  112. #define IPROP_PUSH_TABINDEX      0x0014
  113. #define IPROP_PUSH_TABSTOP      0x0015
  114. #define IPROP_PUSH_TAG          0x0016
  115. #define IPROP_PUSH_PICTUREUP      0x0017
  116. #define IPROP_PUSH_PICTUREDOWN      0x0018
  117. #define IPROP_PUSH_HWND       0x0019
  118. #define IPROP_PUSH_HELPCONTEXTID  0x001A
  119.  
  120. PPROPINFO proplistPush[] =
  121.     {
  122.     PPROPINFO_STD_CTLNAME,
  123.     PPROPINFO_STD_INDEX,
  124.     PPROPINFO_STD_PARENT,
  125.     PPROPINFO_STD_BACKCOLOR,
  126.     PPROPINFO_STD_LEFT,
  127.     PPROPINFO_STD_TOP,
  128.     PPROPINFO_STD_WIDTH,
  129.     PPROPINFO_STD_HEIGHT,
  130.     PPROPINFO_STD_ENABLED,
  131.     PPROPINFO_STD_VISIBLE,
  132.     PPROPINFO_STD_MOUSEPOINTER,
  133.     PPROPINFO_STD_CAPTION,
  134.     PPROPINFO_STD_FONTNAME,
  135.     PPROPINFO_STD_FONTSIZE,
  136.     PPROPINFO_STD_FONTBOLD,
  137.     PPROPINFO_STD_FONTITALIC,
  138.     PPROPINFO_STD_FONTSTRIKE,
  139.     PPROPINFO_STD_FONTUNDER,
  140.     PPROPINFO_STD_DRAGMODE,
  141.     PPROPINFO_STD_DRAGICON,
  142.     PPROPINFO_STD_TABINDEX,
  143.     PPROPINFO_STD_TABSTOP,
  144.     PPROPINFO_STD_TAG,
  145.     &propinfoPictureUp,
  146.     &propinfoPictureDown,
  147.     PPROPINFO_STD_HWND,
  148.     PPROPINFO_STD_HELPCONTEXTID,
  149.     NULL
  150.     };
  151.  
  152.  
  153. //---------------------------------------------------------------------------
  154. // Event procedure parameter prototypes
  155. //---------------------------------------------------------------------------
  156. WORD Parms_I2[]   = {ET_I2};            // 1 x I2 parm
  157. WORD Parms_2xI2[] = {ET_I2, ET_I2};        // 2 x I2 parm
  158. WORD Parms_SD[]   = {ET_SD};            // 1 x SD parm
  159.  
  160. EVENTINFO Event_Click =
  161.     {
  162.     "Click",
  163.     1,
  164.     2,
  165.     Parms_SD,
  166.     "ButtonCaption as String"
  167.     };
  168.  
  169.  
  170. //---------------------------------------------------------------------------
  171. // Event list
  172. //---------------------------------------------------------------------------
  173. // Define the consecutive indicies for the events
  174. //---------------------------------------------------------------------------
  175. #define EVENT_PUSH_CLICK    0
  176. #define EVENT_PUSH_DRAGDROP    1
  177. #define EVENT_PUSH_DRAGOVER    2
  178. #define EVENT_PUSH_GOTFOCUS    3
  179. #define EVENT_PUSH_KEYDOWN    4
  180. #define EVENT_PUSH_KEYPRESS    5
  181. #define EVENT_PUSH_KEYUP    6
  182. #define EVENT_PUSH_LOSTFOCUS    7
  183.  
  184. PEVENTINFO eventlistPush[] =
  185.     {
  186.     &Event_Click,
  187.     PEVENTINFO_STD_DRAGDROP,
  188.     PEVENTINFO_STD_DRAGOVER,
  189.     PEVENTINFO_STD_GOTFOCUS,
  190.     PEVENTINFO_STD_KEYDOWN,
  191.     PEVENTINFO_STD_KEYPRESS,
  192.     PEVENTINFO_STD_KEYUP,
  193.     PEVENTINFO_STD_LOSTFOCUS,
  194.     NULL
  195.     };
  196.  
  197.  
  198. //---------------------------------------------------------------------------
  199. // Model struct
  200. //---------------------------------------------------------------------------
  201. // Define the control model (using the event and property structures).
  202. //---------------------------------------------------------------------------
  203. MODEL modelPush =
  204.     {
  205.     VB_VERSION,             // VB version being used
  206.     MODEL_fFocusOk | MODEL_fMnemonic,    // MODEL flags
  207.     (PCTLPROC)PushCtlProc,        // Control procedure
  208.     CS_VREDRAW | CS_HREDRAW,        // Class style
  209.     BS_PUSHBUTTON | BS_OWNERDRAW,    // Default Window style
  210.     sizeof(PUSH),            // cbCtlExtra for PUSH structure
  211.     IDBMP_PUSH,             // Palette bitmap ID
  212.     "Push",                // Default control name
  213.     "PushButton",            // Visual Basic class name
  214.     "Button",                // Parent class name
  215.     proplistPush,            // Properties list
  216.     eventlistPush,            // Events list
  217.     IPROP_PUSH_CAPTION,         // Default property
  218.     EVENT_PUSH_CLICK,            // Default event
  219.     IPROP_PUSH_CAPTION            // Property representing value of ctl
  220.     };
  221.  
  222. LPMODEL modellistPush[] =
  223.     {
  224.     &modelPush,
  225.     NULL
  226.     };
  227.  
  228. MODELINFO modelinfoPush =
  229.     {
  230.     VB_VERSION,             // VB version being used
  231.     modellistPush            // MODEL list
  232.     };
  233.  
  234. #endif // RC_INVOKED
  235.  
  236. //---------------------------------------------------------------------------
  237.