本文整理汇总了C++中CHeaderCtrl::GetWindowRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CHeaderCtrl::GetWindowRect方法的具体用法?C++ CHeaderCtrl::GetWindowRect怎么用?C++ CHeaderCtrl::GetWindowRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHeaderCtrl
的用法示例。
在下文中一共展示了CHeaderCtrl::GetWindowRect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowAddress
LRESULT CDebugCommandsView::OnSizing(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CRect listRect;
m_CommandList.GetWindowRect(listRect);
CRect headRect;
CHeaderCtrl listHead = m_CommandList.GetHeader();
listHead.GetWindowRect(&headRect);
int rowsHeight = listRect.Height() - headRect.Height();
int nRows = (rowsHeight / m_RowHeight);
if (m_CommandListRows != nRows)
{
m_CommandListRows = nRows;
ShowAddress(m_StartAddress, TRUE);
}
m_RegisterTabs.RedrawCurrentTab();
// Fix cmd list header
listHead.ResizeClient(listRect.Width(), headRect.Height());
return FALSE;
}
示例2: OnPaint
void CEnListCtrl::OnPaint()
{
// if no items or in report mode draw to back buffer then blt
if (GetItemCount() && GetView() != LVS_REPORT)
Default();
else
{
CPaintDC cleanup(this);
CHeaderCtrl* pHeader = GetHeader();
CDC& paintdc = *GetDC();
CDC dc;
dc.CreateCompatibleDC(&paintdc);
CRect rClient;
GetClientRect( &rClient );
CBitmap bitmap;
bitmap.CreateCompatibleBitmap(&paintdc, rClient.right, rClient.bottom);
CBitmap *pOldBitmap = dc.SelectObject(& bitmap);
if (pHeader && m_nCurView == LVS_REPORT && !(GetStyle() & LVS_NOCOLUMNHEADER))
{
CRect rHeader;
pHeader->GetWindowRect(&rHeader);
ScreenToClient(rHeader);
dc.ExcludeClipRect(rHeader);
rClient.top = rHeader.bottom;
}
// fill with back color
COLORREF crBack = GetItemBackColor(0, FALSE, FALSE, FALSE);
dc.FillSolidRect(rClient, crBack);
// default drawing
CListCtrl::DefWindowProc(WM_PAINT, (WPARAM)dc.m_hDC, 0);
// do empty text if nec
if (GetItemCount() == 0)
{
CString sText = GetNoItemsText(); // virtual call
if (!sText.IsEmpty())
{
sText.TrimRight();
sText.TrimLeft();
if (sText[0] != '(')
sText = "(" + sText;
if (sText[sText.GetLength() - 1] != ')')
sText += ")";
dc.SetTextColor(::GetSysColor(COLOR_WINDOWTEXT));
dc.SetBkColor(crBack);
dc.SelectStockObject( ANSI_VAR_FONT );
rClient.top += 10;
dc.DrawText( sText, rClient, DT_CENTER | DT_WORDBREAK | DT_NOPREFIX/* | DT_NOCLIP */);
rClient.top -= 10; // reset
}
}
paintdc.BitBlt(0, rClient.top, rClient.right, rClient.bottom,
&dc, 0, rClient.top, SRCCOPY);
dc.SelectObject(pOldBitmap);
ReleaseDC(&paintdc);
}
// Do not call CListView::OnPaint() for painting messages
}