|
// Version: 9.3
#if !defined(AFX_OXSKINNEDVIEW_H__6BAD3A54_4046_453C_A79B_4A9BB99FF063__INCLUDED_)
#define AFX_OXSKINNEDVIEW_H__6BAD3A54_4046_453C_A79B_4A9BB99FF063__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// v9.3 - update 05 - removed
//#include "StdAfx.h"
// OXSkinnedView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// COXSkinnedView window
template<class BASE_CLASS>
class COXSkinnedView : public BASE_CLASS
{
// Construction
public:
COXSkinnedView()
{
m_pFrameSkin = NULL;
};
COXSkinnedView(UINT nIDTemplate) : BASE_CLASS(nIDTemplate)
{
m_pFrameSkin = NULL;
};
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
protected:
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
// Implementation
public:
virtual ~COXSkinnedView() { };
private:
COXFrameSkin* m_pFrameSkin;
COXFrameSkin* GetFrameSkin();
};
/////////////////////////////////////////////////////////////////////////////
// COXSkinnedView
template<class BASE_CLASS>
COXFrameSkin* COXSkinnedView<BASE_CLASS>::GetFrameSkin()
{
// Check if the app is derived from COXSkinnedApp
COXSkinnedApp* pSkinnedApp = DYNAMIC_DOWNCAST(COXSkinnedApp, AfxGetApp());
if (pSkinnedApp != NULL && pSkinnedApp->GetCurrentSkin() != NULL)
return pSkinnedApp->GetCurrentSkin()->GetFrameSkin();
else
{
// Create a classic skin for this class if not created already
if (m_pFrameSkin == NULL)
m_pFrameSkin = new COXFrameSkinClassic();
return m_pFrameSkin;
}
};
template<class BASE_CLASS>
LRESULT COXSkinnedView<BASE_CLASS>::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
#if defined (_WINDLL)
#if defined (_AFXDLL)
AFX_MANAGE_STATE(AfxGetAppModuleState());
#else
AFX_MANAGE_STATE(AfxGetStaticModuleState());
#endif
#endif
// TODO: Add your specialized code here and/or call the base class
ASSERT_VALID(this);
switch(message)
{
case WM_NCPAINT:
{
LRESULT lResult = BASE_CLASS::WindowProc(message, wParam, lParam);
GetFrameSkin()->DrawViewBorder(this);
return lResult;
}
case WM_NCCALCSIZE:
{
LRESULT lResult = BASE_CLASS::WindowProc(message, wParam, lParam);
if (wParam == 0)
return FALSE;
GetFrameSkin()->OnNcCalcSizeView(lParam, this);
return lResult;
}
default:
{
break;
}
}
return BASE_CLASS::WindowProc(message, wParam, lParam);
}
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OXSKINNEDVIEW_H__6BAD3A54_4046_453C_A79B_4A9BB99FF063__INCLUDED_)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.
Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.