diff options
Diffstat (limited to 'src/ui/TreePropSheet/PropPageFrame.cpp')
-rw-r--r-- | src/ui/TreePropSheet/PropPageFrame.cpp | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/src/ui/TreePropSheet/PropPageFrame.cpp b/src/ui/TreePropSheet/PropPageFrame.cpp index aff9d0eec..30f9f048b 100644 --- a/src/ui/TreePropSheet/PropPageFrame.cpp +++ b/src/ui/TreePropSheet/PropPageFrame.cpp @@ -29,10 +29,10 @@ namespace TreePropSheet //-------------------------------------------------------------------
CPropPageFrame::CPropPageFrame()
- : m_bShowCaption(FALSE),
- m_nCaptionHeight(0),
- m_hCaptionIcon(NULL),
- m_dwMsgFormat(DT_CENTER | DT_VCENTER | DT_NOPREFIX | DT_SINGLELINE)
+: m_bShowCaption(FALSE),
+ m_nCaptionHeight(0),
+ m_hCaptionIcon(NULL),
+ m_dwMsgFormat(DT_CENTER|DT_VCENTER|DT_NOPREFIX|DT_SINGLELINE)
{
}
@@ -48,69 +48,69 @@ CPropPageFrame::~CPropPageFrame() void CPropPageFrame::ShowCaption(BOOL bEnable)
{
- m_bShowCaption = bEnable;
- SafeUpdateWindow(CalcCaptionArea());
+ m_bShowCaption = bEnable;
+ SafeUpdateWindow(CalcCaptionArea());
}
BOOL CPropPageFrame::GetShowCaption() const
{
- return m_bShowCaption;
+ return m_bShowCaption;
}
void CPropPageFrame::SetCaption(LPCTSTR lpszCaption, HICON hIcon /*= NULL*/)
{
- m_strCaption = lpszCaption;
- m_hCaptionIcon = hIcon;
- SafeUpdateWindow(CalcCaptionArea());
+ m_strCaption = lpszCaption;
+ m_hCaptionIcon = hIcon;
+ SafeUpdateWindow(CalcCaptionArea());
}
CString CPropPageFrame::GetCaption(HICON *pIcon /* = NULL */) const
{
- if(pIcon)
- *pIcon = m_hCaptionIcon;
- return m_strCaption;
+ if (pIcon)
+ *pIcon = m_hCaptionIcon;
+ return m_strCaption;
}
void CPropPageFrame::SetCaptionHeight(int nCaptionHeight)
{
- m_nCaptionHeight = nCaptionHeight;
- SafeUpdateWindow(CalcCaptionArea());
+ m_nCaptionHeight = nCaptionHeight;
+ SafeUpdateWindow(CalcCaptionArea());
}
int CPropPageFrame::GetCaptionHeight() const
{
- return m_nCaptionHeight;
+ return m_nCaptionHeight;
}
void CPropPageFrame::SetMsgText(LPCTSTR lpszMsg)
{
- m_strMsg = lpszMsg;
- SafeUpdateWindow(CalcMsgArea());
+ m_strMsg = lpszMsg;
+ SafeUpdateWindow(CalcMsgArea());
}
CString CPropPageFrame::GetMsgText() const
{
- return m_strMsg;
+ return m_strMsg;
}
void CPropPageFrame::SetMsgFormat(DWORD dwFormat)
{
- m_dwMsgFormat = dwFormat;
- SafeUpdateWindow(CalcMsgArea());
+ m_dwMsgFormat = dwFormat;
+ SafeUpdateWindow(CalcMsgArea());
}
DWORD CPropPageFrame::GetMsgFormat() const
{
- return m_dwMsgFormat;
+ return m_dwMsgFormat;
}
@@ -119,55 +119,55 @@ DWORD CPropPageFrame::GetMsgFormat() const void CPropPageFrame::Draw(CDC *pDc)
{
- if(GetShowCaption())
- DrawCaption(pDc, CalcCaptionArea(), m_strCaption, m_hCaptionIcon);
- DrawMsg(pDc, CalcMsgArea(), m_strMsg, m_dwMsgFormat);
+ if (GetShowCaption())
+ DrawCaption(pDc, CalcCaptionArea(), m_strCaption, m_hCaptionIcon);
+ DrawMsg(pDc, CalcMsgArea(), m_strMsg, m_dwMsgFormat);
}
CRect CPropPageFrame::CalcMsgArea()
{
- ASSERT(IsWindow(GetWnd()->GetSafeHwnd()));
+ ASSERT(IsWindow(GetWnd()->GetSafeHwnd()));
- CRect rectMsg;
- GetWnd()->GetClientRect(rectMsg);
- if(GetShowCaption())
- rectMsg.top += GetCaptionHeight();
+ CRect rectMsg;
+ GetWnd()->GetClientRect(rectMsg);
+ if (GetShowCaption())
+ rectMsg.top+= GetCaptionHeight();
- return rectMsg;
+ return rectMsg;
}
-void CPropPageFrame::DrawMsg(CDC *pDc, CRect rect, LPCTSTR lpszMsg, DWORD dwFormat)
+void CPropPageFrame::DrawMsg(CDC *pDc, CRect rect, LPCTSTR lpszMsg, DWORD dwFormat)
{
- CFont *pPrevFont = dynamic_cast<CFont*>(pDc->SelectStockObject(DEFAULT_GUI_FONT));
- int nPrevBkMode = pDc->SetBkMode(TRANSPARENT);
+ CFont *pPrevFont = dynamic_cast<CFont*>(pDc->SelectStockObject(DEFAULT_GUI_FONT));
+ int nPrevBkMode = pDc->SetBkMode(TRANSPARENT);
- pDc->DrawText(GetMsgText(), rect, GetMsgFormat());
+ pDc->DrawText(GetMsgText(), rect, GetMsgFormat());
- pDc->SetBkMode(nPrevBkMode);
- pDc->SelectObject(pPrevFont);
+ pDc->SetBkMode(nPrevBkMode);
+ pDc->SelectObject(pPrevFont);
}
CRect CPropPageFrame::CalcCaptionArea()
{
- ASSERT(IsWindow(GetWnd()->GetSafeHwnd()));
+ ASSERT(IsWindow(GetWnd()->GetSafeHwnd()));
- CRect rectCaption;
- GetWnd()->GetClientRect(rectCaption);
- if(!GetShowCaption())
- rectCaption.bottom = rectCaption.top;
- else
- rectCaption.bottom = rectCaption.top + GetCaptionHeight();
+ CRect rectCaption;
+ GetWnd()->GetClientRect(rectCaption);
+ if (!GetShowCaption())
+ rectCaption.bottom = rectCaption.top;
+ else
+ rectCaption.bottom = rectCaption.top+GetCaptionHeight();
- return rectCaption;
+ return rectCaption;
}
-void CPropPageFrame::DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICON hIcon)
+void CPropPageFrame::DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICON hIcon)
{
- // should be implemented by specialized classes
+ // should be implemented by specialized classes
}
@@ -176,10 +176,10 @@ void CPropPageFrame::DrawCaption(CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICO void CPropPageFrame::SafeUpdateWindow(LPCRECT lpRect /* = NULL */)
{
- if(!IsWindow(GetWnd()->GetSafeHwnd()))
- return;
+ if (!IsWindow(GetWnd()->GetSafeHwnd()))
+ return;
- GetWnd()->InvalidateRect(lpRect, TRUE);
+ GetWnd()->InvalidateRect(lpRect, TRUE);
}
|