⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tabpage.hpp

📁 j2me is based on j2mepolish, client & server for mobile application.
💻 HPP
字号:

//         Copyright E骾n O'Callaghan 2006 - 2008.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//          http://www.boost.org/LICENSE_1_0.txt)

#ifndef TABPAGE_HPP_INCLUDED
#define TABPAGE_HPP_INCLUDED

#include "StdAfx.hpp"

#include "UxthemeWrapper.hpp"

namespace WTLx
{

template <class T>
class ATL_NO_VTABLE TabPageImpl : 
	public ATL::CDialogImpl< T >,
	public WTL::CMessageFilter
{
public:
    BEGIN_MSG_MAP_EX(TabPageImpl)
		MSG_WM_CTLCOLORDLG(OnCltColorDlg)
		MSG_WM_CTLCOLORBTN(OnCltColor)
		MSG_WM_CTLCOLORSTATIC(OnCltColor)

        DEFAULT_REFLECTION_HANDLER()
    END_MSG_MAP()

protected:
	LRESULT OnEraseBkgnd(HDC dc)
	{
		return 1;
		
		CRect rect;
		GetClientRect(rect);
		
		if(uxtheme().pIsAppThemed && hal::uxtheme().pIsAppThemed())
		{
			if (uxtheme().pDrawThemeParentBackground)
			{
				uxtheme().pDrawThemeParentBackground(*this, dc, rect);
			}
		}
		
		return 1;
	}
	

	LRESULT OnCltColorDlg(HDC hDC, HWND hWnd)
	{
		SetMsgHandled(false);

		if (uxtheme().pIsAppThemed)
			if(uxtheme().pIsAppThemed())
			{
				WTL::CRect rect;
				GetClientRect(rect);
				if (uxtheme().pDrawThemeParentBackground)
				{
					uxtheme().pDrawThemeParentBackground(hWnd, hDC, rect);
					SetMsgHandled(true);
				}
			}

		return (LRESULT)::GetStockObject(HOLLOW_BRUSH);
	}

	LRESULT OnCltColor(HDC hDC, HWND hWnd)
	{
		SetMsgHandled(false);

		if (uxtheme().pIsAppThemed)
			if(uxtheme().pIsAppThemed())
			{
				WTL::CRect rect;
				::GetClientRect(hWnd, &rect);
				::SetBkMode(hDC, TRANSPARENT);
				if (uxtheme().pDrawThemeParentBackground)
				{
					uxtheme().pDrawThemeParentBackground(hWnd, hDC, rect);
					SetMsgHandled(true);
				}
			}

		return (LRESULT)::GetStockObject(HOLLOW_BRUSH);
	}
};

}

#endif // TABPAGE_HPP_INCLUDED

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -