Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

128 lines
4.6 KiB

  1. ////////////////////////////////////////////////////////////////////////////////////////////////////
  2. // CPropertySheetPage is a small wrapper around the PROPSHEETPAGE structure.
  3. // The class mostly does parameter validation.
  4. //
  5. // This is an example of how it can be used...
  6. //
  7. //
  8. // CPropertySheetPage MyPropertySheetPage(
  9. // MAKEINTRESOURCE( IDD_PROPPAGE_DEFAULT ),
  10. // ( DLGPROC ) MyDlgProc,
  11. // PSP_HASHELP
  12. // );
  13. //
  14. //
  15. // The casting operators are defined to cast a CPropertySheetPage to a LPPROPSHEETPAGE, which is
  16. // useful for assigning to the elements in a PROPSHEETHEADER
  17. //
  18. //
  19. // PROPSHEETHEADER Psh;
  20. // LPPROPSHEETPAGE pPageAry;
  21. // extern PROPSHEETPAGE OtherPage;
  22. //
  23. // pPageAry = new PROPSHEETPAGE[ 2 ]
  24. //
  25. //
  26. // pPageAry[ 0 ] = MyPropertySheetPage;
  27. // pPageAry[ 0 ] = OtherPage;
  28. //
  29. // Psh . ppsp = pPageAry;
  30. //
  31. //
  32. //
  33. //
  34. // NOTE: this is the signature for the callback function, if specified:
  35. //
  36. // UINT (CALLBACK FAR * LPFNPSPCALLBACKA)(HWND hwnd, UINT uMsg, struct _PROPSHEETPAGEA FAR *ppsp);
  37. //
  38. //
  39. ////////////////////////////////////////////////////////////////////////////////////////////////////
  40. #ifndef __PropPg_h__
  41. #define __PropPg_h__
  42. ////////////////////////////////////////////////////////////////////////////////////////////////////
  43. // comment this out if you don't want data validation ( class essentially does nothing )
  44. //
  45. #define CPropertySheetPage_ValidateParameters
  46. ////////////////////////////////////////////////////////////////////////////////////////////////////
  47. class CPropertySheetPage : public PROPSHEETPAGE {
  48. public: // Construction / destruction
  49. CPropertySheetPage( void ); // So We can make an Array of these things
  50. CPropertySheetPage( const CPropertySheetPage& r );
  51. // pssTemplate can specify either the resource identifier of the template
  52. // or the address of a string that specifies the name of the template
  53. CPropertySheetPage( LPCTSTR pszTemplate, DLGPROC pfnDlgProc,
  54. DWORD dwFlags = 0, LPARAM lParam = 0L
  55. );
  56. CPropertySheetPage( LPCDLGTEMPLATE pResource, DLGPROC pfnDlgProc,
  57. DWORD dwFlags = 0, LPARAM lParam = 0L
  58. );
  59. // psTemplate can specify either the resource identifier of the template
  60. // or the address of a string that specifies the name of the template
  61. CPropertySheetPage( LPCTSTR pszTemplate, DLGPROC pfnDlgProc,
  62. HICON hIcon, LPCTSTR pszTitle = NULL, DWORD dwFlags = 0,
  63. LPARAM lParam = NULL, LPFNPSPCALLBACK pfnCallBack = NULL,
  64. UINT FAR * pcRefParent = NULL
  65. );
  66. CPropertySheetPage( LPCDLGTEMPLATE pResource, DLGPROC pfnDlgProc,
  67. HICON hIcon, LPCTSTR pszTitle = NULL, DWORD dwFlags = 0,
  68. LPARAM lParam = NULL, LPFNPSPCALLBACK pfnCallBack = NULL,
  69. UINT FAR * pcRefParent = NULL
  70. );
  71. // pszTemplate can specify either the resource identifier of the template
  72. // or the address of a string that specifies the name of the template
  73. CPropertySheetPage( LPCTSTR pszTemplate, DLGPROC pfnDlgProc,
  74. LPCTSTR pszIcon, LPCTSTR pszTitle = NULL, DWORD dwFlags = 0,
  75. LPARAM lParam = NULL, LPFNPSPCALLBACK pfnCallBack = NULL,
  76. UINT FAR * pcRefParent = NULL
  77. );
  78. CPropertySheetPage( LPCDLGTEMPLATE pResource, DLGPROC pfnDlgProc,
  79. LPCTSTR pszIcon, LPCTSTR pszTitle = NULL, DWORD dwFlags = 0,
  80. LPARAM lParam = NULL, LPFNPSPCALLBACK pfnCallBack = NULL,
  81. UINT FAR * pcRefParent = NULL
  82. );
  83. CPropertySheetPage( LPCPROPSHEETPAGE pPageVector );
  84. CPropertySheetPage& operator=( const CPropertySheetPage& r );
  85. ~CPropertySheetPage( void );
  86. // conversion operator
  87. operator LPPROPSHEETPAGE() { return this; }
  88. operator LPCPROPSHEETPAGE() { return this; }
  89. private: // Helper Fns
  90. void _InitData( void );
  91. BOOL _IsRightToLeftLocale( void ) const;
  92. // Set with optional validation, defined in the cpp file
  93. BOOL _Set_hInstance( HINSTANCE hInst );
  94. BOOL _Set_pszTemplate( LPCTSTR pszTemplate );
  95. BOOL _Set_pResource( LPCDLGTEMPLATE pResource );
  96. BOOL _Set_hIcon( HICON hIcon );
  97. BOOL _Set_pszIcon( LPCTSTR pszIcon );
  98. BOOL _Set_pszTitle( LPCTSTR pszTitle );
  99. BOOL _Set_pfnDlgProc( DLGPROC pfnDlgProc );
  100. BOOL _Set_pfnCallback( LPFNPSPCALLBACK pfnCallBack );
  101. BOOL _Set_lParam( LPARAM lParam );
  102. BOOL _Set_pcRefParent( UINT FAR * pcRefParent );
  103. BOOL _Validate( void ) const;
  104. };
  105. #endif // __PropPg_h__