diff options
author | Stef Walter <stef@thewalter.net> | 2003-09-17 19:07:23 +0000 |
---|---|---|
committer | Stef Walter <stef@thewalter.net> | 2003-09-17 19:07:23 +0000 |
commit | 3f95d417d9e623ac0c74df8ef11d7a01846392dd (patch) | |
tree | 45ec73f2dc07eafd7f41a6f62a8cdfbaa279469f /Common/PropPageHolder.h |
Diffstat (limited to 'Common/PropPageHolder.h')
-rw-r--r-- | Common/PropPageHolder.h | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/Common/PropPageHolder.h b/Common/PropPageHolder.h new file mode 100644 index 0000000..4fec7ee --- /dev/null +++ b/Common/PropPageHolder.h @@ -0,0 +1,89 @@ +////////////////////////////////////////////////////////////////// +// +// PropPageHolder.h : header file +// +// CPropPageHolder manages the components IPropertyPage Interface +// +// It also exposes a IPropertyPageSite Interface for the +// Component (not used for much though) +// +////////////////////////////////////////////////////////////////// + +#if !defined(AFX_PROPPAGEHOLDER_H__F0EC0A29_18D4_11D2_B2D4_0020182B97FC__INCLUDED_) +#define AFX_PROPPAGEHOLDER_H__F0EC0A29_18D4_11D2_B2D4_0020182B97FC__INCLUDED_ + +#if _MSC_VER >= 1000 +#pragma once +#endif // _MSC_VER >= 1000 + +///////////////////////////////////////////////////////////////////////////// +// CPropPageHolder command target + +class ATL_NO_VTABLE CPropPageHolder : + public CComObjectRootEx<CComSingleThreadModel>, + public IPropertyPageSite +{ + +// Attributes +public: + CPropPageHolder(); +// CPropPageHolder(IPropertyPage* pPage, IUnknown* pSite); + virtual ~CPropPageHolder(); + +// Operations +public: + HRESULT Close(); + + bool IsActivated(); // Is Proppage Created? + HRESULT Apply(); // Save Changes to Data Object + bool IsInitialized(); // Is Initialized? + + // Checks to see if it has a IPropPage + HRESULT Initialize(IPropertyPage* pUnk, IUnknown* pSite); + + // Activates and Shows the Page + // For best results start with WS_VISIBLE = false in + // dialog template (no flicker) + HRESULT Create(HWND hwndParent, const RECT& rect, bool bModalParent = true); + + // DeActivates Page and Releases IPropPage + HRESULT Destroy(); + + // Window Functions + HRESULT Show(UINT nCmdShow); + HRESULT Move(const RECT& rect); + +// Implementation +protected: + HRESULT LoadInfo(); + + // Is Created or not? + bool m_bActivated; + + IPropertyPage* m_pPropPage; + PROPPAGEINFO m_PageInfo; + IUnknown* m_pSite; // This is a pointer to the Page Container Site + // Returned from IPropertyPageSite::GetPageContainer + +public: + DWORD GetHelpContext(); + string GetHelpFile(); + string GetTitle(); + +DECLARE_PROTECT_FINAL_CONSTRUCT() + +BEGIN_COM_MAP(CPropPageHolder) + COM_INTERFACE_ENTRY(IPropertyPageSite) +END_COM_MAP() + + // IPropertyBag + STDMETHOD(OnStatusChange)(DWORD dwFlags); + STDMETHOD(GetLocaleID)(LCID* pLocaleID); + STDMETHOD(GetPageContainer)(IUnknown** ppUnk); + STDMETHOD(TranslateAccelerator)(LPMSG pMsg); + +}; + +///////////////////////////////////////////////////////////////////////////// + +#endif // !defined(AFX_PROPPAGEHOLDER_H__F0EC0A29_18D4_11D2_B2D4_0020182B97FC__INCLUDED_) |