home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / tool / various / skelet / skeleton.hpp < prev    next >
Text File  |  1994-08-15  |  7KB  |  235 lines

  1.  
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Filename:     skeleton.hpp
  5. //
  6. // Description:  Skeleton Visual Basic Custom Control.
  7. //
  8. //               Resource information, property and event lists, the control
  9. //               structure, error lists, and miscellaneous and control
  10. //               specific defines, etc.
  11. //
  12. // Date Created: <Date>
  13. //
  14. // Author:       <Your Name>
  15. //
  16. // Copyright (c) <Your Company Name> 1994
  17. //
  18. //               Portions of this product are based on original
  19. //                  source code from Anton Software Limited.
  20. //
  21. //////////////////////////////////////////////////////////////////////////////
  22.  
  23. #ifndef SKELETON_HPP
  24. #define SKELETON_HPP
  25.  
  26. //////////////////////////////////////////////////////////////////////////////
  27. //
  28. // Version information (for version information DLL)
  29. //
  30. //////////////////////////////////////////////////////////////////////////////
  31.  
  32. // TO DO: enter your company name below. The acknowledgement to Anton
  33. //        Software Limited MUST NOT be removed. On completion of the first
  34. //        version, enter the date in the comments entry.
  35.  
  36. #define VBX_ACKNOWLEDGEMENT  "Portions of this product are based on "    \
  37.                              "original source code from Anton Software " \
  38.                              "Limited\0"
  39. #define VBX_COMMENTS         "v1.0 <date>\0"
  40. #define VBX_COMPANYNAME      "Your Company Name\0"
  41. #define VBX_FILEDESCRIPTION  "Skeleton Custom Control for Microsoft " \
  42.                              "Visual Basic (v2 and above)\0"
  43. #define VBX_INTERNALNAME     "Skeleton\0"
  44. #define VBX_LEGALCOPYRIGHT   "Copyright ⌐ Your Company Name 1994\0"
  45. #define VBX_LEGALTRADEMARKS  "Skeleton is a trademark of Your Company Name\0"
  46. #define VBX_ORIGINALFILENAME "SKELETON.VBX\0"
  47. #define VBX_PRODUCTNAME      "Skeleton VBX Custom Control\0"
  48. #define VBX_VERSION          1,00,0,00
  49. #define VBX_VERSION_STR      "1.00.000\0"
  50.  
  51. //////////////////////////////////////////////////////////////////////////////
  52. //
  53. // Resource information
  54. //
  55. //////////////////////////////////////////////////////////////////////////////
  56.  
  57. #include "resource.h"   // App Studio created
  58.  
  59. #ifndef RC_INVOKED
  60.  
  61. //////////////////////////////////////////////////////////////////////////////
  62. //
  63. // Miscellaneous
  64. //
  65. //////////////////////////////////////////////////////////////////////////////
  66.  
  67. // Macro for referencing the member of a structure.
  68. #define OFFSETIN(struc, field) ((USHORT)&(((struc *)0)->field))
  69.  
  70. // VB's boolean values.
  71. #define VB_TRUE  -1
  72. #define VB_FALSE  0
  73.  
  74. // Macro for outputing debug strings if in debug mode.
  75. #ifdef _DEBUG
  76.     #define OUTPUT_DEBUG_STRING(debug_string) OutputDebugString(debug_string)
  77. #else
  78.     #define OUTPUT_DEBUG_STRING(debug_string)
  79. #endif
  80.  
  81. // TO DO: place your control's error numbers and error strings (if any) in
  82. //        this section.
  83.  
  84. //////////////////////////////////////////////////////////////////////////////
  85. //
  86. // Property list index values
  87. //
  88. //////////////////////////////////////////////////////////////////////////////
  89.  
  90. enum Properties
  91. {
  92.     // TO DO: choose the standard properties you want your control to have,
  93.     //        and delete the unwanted properties from the list below. (You
  94.     //        will have to make a similar change in the skeldat.cpp file.)
  95.  
  96.     // Standard properties.
  97.     IPROP_NAME,
  98.     IPROP_INDEX,
  99.     IPROP_ALIGN,
  100.     IPROP_BACKCOLOR,
  101.     IPROP_BORDERSTYLEON,
  102.     IPROP_CLIPCONTROLS,
  103.     IPROP_DATACHANGED,
  104.     IPROP_DATAFIELD,
  105.     IPROP_DATASOURCE,
  106.     IPROP_DRAGICON,
  107.     IPROP_DRAGMODE,
  108.     IPROP_ENABLED,
  109.     IPROP_FONTBOLD,
  110.     IPROP_FONTITALIC,
  111.     IPROP_FONTNAME,
  112.     IPROP_FONTSIZE,
  113.     IPROP_FONTSTRIKE,
  114.     IPROP_FONTUNDER,
  115.     IPROP_FORECOLOR,
  116.     IPROP_HEIGHT,
  117.     IPROP_HELPCONTEXTID,
  118.     IPROP_HWND,
  119.     IPROP_LEFT,
  120.     IPROP_LINKITEM,
  121.     IPROP_LINKMODE,
  122.     IPROP_LINKTIMEOUT,
  123.     IPROP_LINKTOPIC,
  124.     IPROP_MOUSEPOINTER,
  125.     IPROP_PARENT,
  126.     IPROP_TABINDEX,
  127.     IPROP_TABSTOP,
  128.     IPROP_TAG,
  129.     IPROP_TEXT,
  130.     IPROP_TOP,
  131.     IPROP_VISIBLE,
  132.     IPROP_WIDTH,
  133.  
  134.     // TO DO: choose the custom properties you want your control to have. Use
  135.     //        MyProp1 and MyProp2 as templates for these new properties.
  136.  
  137.     // Custom properties.
  138.     IPROP_ABOUT,
  139.     IPROP_MYPROP1,
  140.     IPROP_MYPROP2
  141.  
  142. }; // enum Properties
  143.  
  144. //////////////////////////////////////////////////////////////////////////////
  145. //
  146. // Event list index values
  147. //
  148. //////////////////////////////////////////////////////////////////////////////
  149.  
  150. enum Events
  151. {
  152.     // TO DO: choose the standard events you want your control to have, and
  153.     //        delete the unwanted events from the list below. (You will have
  154.     //        to make a similar change in the skeldat.cpp file.)
  155.  
  156.     // Standard events.
  157.     IEVENT_CLICK,
  158.     IEVENT_DBLCLICK,
  159.     IEVENT_DRAGDROP,
  160.     IEVENT_DRAGOVER,
  161.     IEVENT_GOTFOCUS,
  162.     IEVENT_KEYDOWN,
  163.     IEVENT_KEYPRESS,
  164.     IEVENT_KEYUP,
  165.     IEVENT_LOSTFOCUS,
  166.     IEVENT_MOUSEDOWN,
  167.     IEVENT_MOUSEMOVE,
  168.     IEVENT_MOUSEUP,
  169.     IEVENT_LINKERROR,
  170.     IEVENT_LINKOPEN,
  171.     IEVENT_LINKCLOSE,
  172.     IEVENT_LINKNOTIFY,
  173.     IEVENT_LINKCHANGE,
  174.  
  175.     // TO DO: choose the custom events you want your control to have. Use
  176.     //        MyEvent as a template for these new events.
  177.  
  178.     // Custom events.
  179.     IEVENT_MYEVENT
  180.  
  181. }; // enum Events
  182.  
  183. //////////////////////////////////////////////////////////////////////////////
  184. //
  185. // Event parameter lists
  186. //
  187. //////////////////////////////////////////////////////////////////////////////
  188.  
  189. // TO DO: Use MYEVENT_PARAMS as a template for the event parameter structures
  190. //        of your custom events.
  191.  
  192. // "MyEvent" event parameter structure (must be in reverse order).
  193. typedef struct
  194. {
  195.     SHORT FAR *param2;      // pointer to Param2 parameter
  196.     LONG  FAR *param1;      // pointer to Param1 parameter
  197.     LPVOID     lpvIndex;    // Index parameter (for control arrays only)
  198. }
  199. MYEVENT_PARAMS;
  200.  
  201. //////////////////////////////////////////////////////////////////////////////
  202. //
  203. // Skeleton control structure and far pointer
  204. //
  205. //////////////////////////////////////////////////////////////////////////////
  206.  
  207. // Control structure.
  208. typedef struct
  209. {
  210.     // TO DO: add fields below for your custom properties.
  211.  
  212.     // Properties.
  213.     ENUM  enumAbout;            // About property (ENUM)
  214.     HSZ   hszMyProp1;           // value of MyProp1 property (HSZ)
  215.     ENUM  enumMyProp2;          // value of MyProp2 property (ENUM)
  216.  
  217.     // TO DO: add fields below for your non-property control specific data.
  218.  
  219.     // Other instance specific data.
  220.     BOOL fCreated;              // whether the control has been created
  221.     BOOL fInitialised;          // whether the control has been initialised
  222.     BOOL fLoaded;               // whether the control has been loaded
  223. }
  224. SKELETON;
  225.  
  226. // Far pointer to a SKELETON control structure.
  227. typedef SKELETON FAR *LPSKELETON;
  228.  
  229. // Macro for accessing SKELETON control structure elements.
  230. #define LP_SKELETON_DEREF(hctl) ((LPSKELETON)VBDerefControl(hctl))
  231.  
  232. #endif // RC_INVOKED
  233. #endif // SKELETON_HPP
  234.  
  235.