CRect CPropPageFrameDefault::CalcCaptionArea() { CRect rect; GetClientRect(rect); if (g_ThemeLib.IsAvailable() && g_ThemeLib.IsThemeActive()) { HTHEME hTheme = g_ThemeLib.OpenThemeData(m_hWnd, L"Tab"); if (hTheme) { CRect rectContent; CDC *pDc = GetDC(); g_ThemeLib.GetThemeBackgroundContentRect(hTheme, pDc->m_hDC, TABP_PANE, 0, rect, rectContent); ReleaseDC(pDc); g_ThemeLib.CloseThemeData(hTheme); if (GetShowCaption()) rectContent.bottom = rect.top+GetCaptionHeight(); else rectContent.bottom = rectContent.top; rect = rectContent; } } else { if (GetShowCaption()) rect.bottom = rect.top+GetCaptionHeight(); else rect.bottom = rect.top; } return rect; }
CRect CPropPageFrameDefault::CalcMsgArea() { CRect rect; GetClientRect(rect); if (g_xpStyle.IsThemeActive() && g_xpStyle.IsAppThemed()) { HTHEME hTheme = g_xpStyle.OpenThemeData(m_hWnd, L"Tab"); if (hTheme) { CRect rectContent; CDC *pDc = GetDC(); g_xpStyle.GetThemeBackgroundContentRect(hTheme, pDc->m_hDC, TABP_PANE, 0, rect, rectContent); ReleaseDC(pDc); g_xpStyle.CloseThemeData(hTheme); if (GetShowCaption()) rectContent.top = rect.top+GetCaptionHeight()+1; rect = rectContent; } } else if (GetShowCaption()) rect.top+= GetCaptionHeight()+1; return rect; }
CRect CPropPageFrame::CalcMsgArea() { ASSERT(IsWindow(GetWnd()->GetSafeHwnd())); CRect rectMsg; GetWnd()->GetClientRect(rectMsg); if (GetShowCaption()) rectMsg.top+= GetCaptionHeight(); return rectMsg; }
CRect CPropPageFrame::CalcCaptionArea() { ASSERT(IsWindow(GetWnd()->GetSafeHwnd())); CRect rectCaption; GetWnd()->GetClientRect(rectCaption); if (!GetShowCaption()) rectCaption.bottom = rectCaption.top; else rectCaption.bottom = rectCaption.top+GetCaptionHeight(); return rectCaption; }
void CPropPageFrame::Draw(CDC *pDc) { if (GetShowCaption()) DrawCaption(pDc, CalcCaptionArea(), m_strCaption, m_hCaptionIcon); DrawMsg(pDc, CalcMsgArea(), m_strMsg, m_dwMsgFormat); }