home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_code1 / generic / gener.h < prev    next >
Text File  |  1993-04-23  |  5KB  |  153 lines

  1. //---------------------------------------------------------------------------
  2. //        Copyright (C) 1993, 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. // gener.h
  10. //---------------------------------------------------------------------------
  11.  
  12. //---------------------------------------------------------------------------
  13. // Resource Information
  14. //---------------------------------------------------------------------------
  15. // Toolbox bitmap resource IDs numbers.
  16. //---------------------------------------------------------------------------
  17. #define IDBMP_GENERIC_UP    8000
  18. #define IDBMP_GENERIC_DOWN  8001
  19. #define IDBMP_GENERIC_MONO  8003
  20. #define IDBMP_GENERIC_EGA   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 Pix Custom Control Example\0"
  27. #define VBX_INTERNALNAME       "PIX\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       "PIX.VBX\0"
  31. #define VBX_PRODUCTNAME        "Microsoft\256 Visual Basic\231 for Windows\231\0"
  32.  
  33.  
  34. //---------------------------------------------------------------------------
  35. // Update these fields for each build.
  36. //---------------------------------------------------------------------------
  37. #define VBX_VERSION            3,00,0,00
  38. #define VBX_VERSION_STR        "3.00.000\0"
  39.  
  40. #define OFFSETIN(struc, field)    ((USHORT)&( ((struc *)0)->field ))
  41.  
  42. typedef struct tagGENERIC {
  43.     BOOL    bBooleanValue;
  44.     USHORT    usIntegerValue;
  45.     ULONG    ulLongValue;
  46.     ENUM    usEnumValue;
  47.     HSZ        hszStringValue;
  48.     USHORT    usAction;
  49. } GENERIC, FAR *PGENERIC;
  50.  
  51. LONG FAR PASCAL _export GenericCtlProc(HCTL, HWND, USHORT, USHORT, LONG);
  52.  
  53. PROPINFO Property_BooleanValue =
  54. {
  55.     "BooleanValue",
  56.     DT_BOOL | PF_fGetData | PF_fSetData | PF_fSaveData, 
  57.     OFFSETIN(GENERIC, bBooleanValue),
  58.     0, 0, NULL, 0
  59. };
  60.  
  61. PROPINFO Property_IntegerValue =
  62. {
  63.     "IntegerValue",
  64.     DT_SHORT | PF_fGetData | PF_fSetData | PF_fSaveData, 
  65.     OFFSETIN(GENERIC, usIntegerValue),
  66.     0, 0, NULL, 0
  67. };
  68.  
  69. PROPINFO Property_LongValue =
  70. {
  71.     "LongValue",
  72.     DT_LONG | PF_fGetData | PF_fSetData | PF_fSaveData, 
  73.     OFFSETIN(GENERIC, ulLongValue),
  74.     0, 0, NULL, 0
  75. };
  76.  
  77. #define ENUM_VALUES1    "0 - Dasher\0" "1 - Dancer\0" "2 - Prancer\0" "3 - Vixen\0"
  78. #define ENUM_VALUES2    "4 - Comet\0" "5 - Cupid\0" "6 - Donner\0" "7 - Blitzen\0"
  79.  
  80. PROPINFO Property_EnumValue =
  81. {
  82.     "EnumValue",
  83.     DT_ENUM | PF_fGetData | PF_fSetData | PF_fSaveData, 
  84.     OFFSETIN(GENERIC, usEnumValue),
  85.     0,
  86.     0,
  87.     ENUM_VALUES1 ENUM_VALUES2,
  88.     8
  89. };
  90.  
  91. PROPINFO Property_StringValue =
  92. {
  93.     "StringValue",
  94.     DT_HSZ | PF_fGetData | PF_fSetData | PF_fSaveData,
  95.     OFFSETIN(GENERIC, hszStringValue),
  96.     0, 0, NULL, 0
  97. };
  98.  
  99. PROPINFO Property_Action =
  100. {
  101.     "Action",
  102.     DT_SHORT | PF_fGetData | PF_fSetMsg | PF_fNoShow,
  103.     OFFSETIN(GENERIC, usAction),
  104.     0, 0, NULL, 0
  105. };
  106.  
  107. #define IPROP_GENERIC_CTLNAME         0
  108. #define IPROP_GENERIC_TAG            1
  109. #define IPROP_GENERIC_LEFT           2
  110. #define IPROP_GENERIC_TOP            3
  111. #define IPROP_GENERIC_BOOLEANVALUE   4
  112. #define IPROP_GENERIC_INTEGERVALUE   5
  113. #define IPROP_GENERIC_LONGVALUE      6
  114. #define IPROP_GENERIC_ENUMVALUE      7
  115. #define IPROP_GENERIC_STRINGVALUE    8
  116. #define IPROP_GENERIC_ACTION         9
  117.  
  118. PPROPINFO Generic_Properties[] =
  119. {
  120.     PPROPINFO_STD_CTLNAME,
  121.     PPROPINFO_STD_TAG,
  122.     PPROPINFO_STD_LEFT,
  123.     PPROPINFO_STD_TOP,
  124.     &Property_BooleanValue,
  125.     &Property_IntegerValue,
  126.     &Property_LongValue,
  127.     &Property_EnumValue,
  128.     &Property_StringValue,
  129.     &Property_Action,
  130.     NULL
  131. };
  132.  
  133. #define MODEL_FLAGS        MODEL_fInitMsg | MODEL_fLoadMsg
  134.  
  135. MODEL modelGeneric =
  136. {
  137.     VB_VERSION,                 // VB version being used
  138.     MODEL_FLAGS,                // MODEL flags
  139.     (PCTLPROC)GenericCtlProc,    // Control procedures
  140.     CS_VREDRAW | CS_HREDRAW,    // Class style
  141.     WS_CHILD | WS_BORDER,        // Default Windows style
  142.     sizeof(GENERIC),            // Size of PIX structure
  143.     IDBMP_GENERIC_UP,           // Palette bitmap ID
  144.     "Generic",                    // Default control name
  145.     "Generic",                    // Visual Basic class name
  146.     NULL,                        // Parent class name
  147.     Generic_Properties,            // Property information table
  148.     NULL                        // Event information table
  149. };
  150.  
  151.  
  152. #define    GEN_STRLEN        1
  153.