本文整理汇总了C++中GetHeaderCtrl函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHeaderCtrl函数的具体用法?C++ GetHeaderCtrl怎么用?C++ GetHeaderCtrl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetHeaderCtrl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: auto_size
void CListCtrlEx::auto_size()
{
if (!GetSafeHwnd() || !GetHeaderCtrl())
return;
for (int i = 0; i < GetHeaderCtrl()->GetItemCount(); i++)
SetColumnWidth(i, LVSCW_AUTOSIZE_USEHEADER);
}
示例2: PreSubclassWindow
//控件绑定
void CHappyGoDlgT::PreSubclassWindow()
{
if(GetHeaderCtrl())
m_ListHeader.SubclassWindow(GetHeaderCtrl()->GetSafeHwnd());
CListCtrl::PreSubclassWindow();
}
示例3: GetHeaderCtrl
BOOL CReportCtrl::SetHeaderImage(int nColumn, int nImageIndex, BOOL bLeftSide)
{
if(GetHeaderCtrl()->GetImageList() == NULL)
{
CListCtrl :: GetHeaderCtrl()->SetImageList(GetImageList());
}
HDITEM hi;
:: memset(&hi, 0, sizeof(HDITEM));
hi.mask = HDI_FORMAT;
if(!GetHeaderCtrl()->GetItem(nColumn, &hi))
{
return(FALSE);
}
hi.mask |= HDI_IMAGE;
hi.fmt |= HDF_IMAGE;
if(!bLeftSide)
{
hi.fmt |= HDF_BITMAP_ON_RIGHT; // draw the image on right side of text
}
hi.iImage = nImageIndex;
return(CListCtrl :: GetHeaderCtrl()->SetItem(nColumn, &hi));
}
示例4: GetHeaderCtrl
void CReportCtrl::DrawSortArrow(int Col, int Desc)
{
if (Col < 0)
return;
#if _MFC_VER < 0x0700 // if MFC 6
HDITEM hdi;
hdi.mask = HDI_IMAGE | HDI_FORMAT;
GetHeaderCtrl()->GetItem(Col, &hdi);
if (Desc < 0) { // erase
hdi.mask = HDI_FORMAT;
hdi.fmt &= ~HDF_IMAGE;
} else {
hdi.mask = HDI_FORMAT | HDI_IMAGE;
hdi.fmt |= HDF_IMAGE | HDF_BITMAP_ON_RIGHT;
hdi.iImage = Desc;
}
#else // .NET; use sort header format flags instead of image list
HDITEM hdi;
hdi.mask = HDI_FORMAT;
GetHeaderCtrl()->GetItem(Col, &hdi);
hdi.mask = HDI_FORMAT;
if (Desc < 0) // erase
hdi.fmt &= ~(HDF_SORTUP | HDF_SORTDOWN);
else {
if (Desc)
hdi.fmt |= HDF_SORTDOWN;
else
hdi.fmt |= HDF_SORTUP;
}
#endif
GetHeaderCtrl()->SetItem(Col, &hdi);
}
示例5: VERIFY
void CSortingListControl::SortItems()
{
VERIFY(CListCtrl::SortItems(&_CompareFunc, (DWORD_PTR)&m_sorting));
HDITEM hditem;
ZeroMemory(&hditem, sizeof(hditem));
if (m_indicatedColumn != -1)
{
CString text;
hditem.mask= HDI_TEXT;
hditem.pszText= text.GetBuffer(256);
hditem.cchTextMax= 256;
GetHeaderCtrl()->GetItem(m_indicatedColumn, &hditem);
text.ReleaseBuffer();
text= text.Mid(2);
hditem.pszText= (LPTSTR)(LPCTSTR)text;
GetHeaderCtrl()->SetItem(m_indicatedColumn, &hditem);
}
CString text;
hditem.mask= HDI_TEXT;
hditem.pszText= text.GetBuffer(256);
hditem.cchTextMax= 256;
GetHeaderCtrl()->GetItem(m_sorting.column1, &hditem);
text.ReleaseBuffer();
text= (m_sorting.ascending1 ? _T("< ") : _T("> ")) + text;
hditem.pszText= (LPTSTR)(LPCTSTR)text;
GetHeaderCtrl()->SetItem(m_sorting.column1, &hditem);
m_indicatedColumn= m_sorting.column1;
}
示例6: PreSubclassWindow
void CListCtrlEx::PreSubclassWindow()
{
if(GetHeaderCtrl())
{
m_HeaderCtrl.SubclassWindow(GetHeaderCtrl()->m_hWnd);
}
CListCtrl::PreSubclassWindow();
}
示例7: OnShowWindow
void CHappyGoDlgT::OnShowWindow(BOOL bShow, UINT nStatus)
{
CListCtrl::OnShowWindow(bShow, nStatus);
// TODO: 在此处添加消息处理程序代码
if(GetHeaderCtrl())
m_ListHeader.SubclassWindow(GetHeaderCtrl()->m_hWnd);
}
示例8: PreSubclassWindow
void CFishListCtrl::PreSubclassWindow()
{
// TODO: Add your specialized code here and/or call the base class
if(GetHeaderCtrl())
{
m_ctrlHeader.SubclassWindow(GetHeaderCtrl()->m_hWnd);
}
CListCtrl::PreSubclassWindow();
}
示例9: PreSubclassWindow
void CRTListCtrl::PreSubclassWindow()
{
if(GetHeaderCtrl() != NULL)
{
m_HeaderCtrl.SubclassWindow(GetHeaderCtrl()->m_hWnd);
}
m_Container.Create(this);
CListCtrl::PreSubclassWindow();
}
示例10: GetHeaderCtrl
void CListCtrlEx::ReadState(LPCSTR pszName)
{
CHeaderCtrl* pHdr = GetHeaderCtrl ();
int *piWidthes;
Initialize ();
LPBYTE pbW, pbI;
UINT uSizeI, uSizeW;
CString strIndexes = pszName, strWidthes = pszName;
strIndexes += 'I';
strWidthes += 'W';
if (_App.GetProfileBinary (_T ("Settings\\View\\ListViews"), strIndexes, &pbI, &uSizeI) &&
_App.GetProfileBinary (_T ("Settings\\View\\ListViews"), strWidthes, &pbW, &uSizeW) &&
uSizeI == m_cTotalCols * sizeof (int) && uSizeW == m_cTotalCols * sizeof (int))
{
CopyMemory (m_aIndex, pbI, m_cTotalCols * sizeof (int));
piWidthes = (int*) pbW;
int i = m_cTotalCols - 1;
for (i = m_cTotalCols - 1; i >= 0; i--)
if (m_aIndex [i] == -1)
DeleteColumn (i);
int aOrder [LISTEX_MAXCOLUMNS];
int iCorr = 0;
for (i = 0; i < m_cTotalCols; i++)
{
if (m_aIndex [i] != -1)
aOrder [m_aIndex [i]] = i - iCorr;
else
iCorr ++;
}
pHdr->SetOrderArray (GetHeaderCtrl ()->GetItemCount (), (int*) aOrder);
RebuildAIndex ();
for (i = 0; i < m_cTotalCols; i++)
{
if (piWidthes [i] > 0)
SetColumnWidth (aOrder [m_aIndex [i]], piWidthes [i]);
}
delete [] pbW;
delete [] pbI;
}
}
示例11: GetHeaderCtrl
void CFileBrowserListCtrl::DrawSortArrow(int Col, int Dir)
{
HDITEM hdi;
hdi.mask = HDI_IMAGE | HDI_FORMAT;
GetHeaderCtrl()->GetItem(Col, &hdi);
if (Dir < 0) { // erase arrow
hdi.mask = HDI_FORMAT;
hdi.fmt &= ~HDF_IMAGE;
} else {
hdi.mask = HDI_FORMAT | HDI_IMAGE;
hdi.fmt |= HDF_IMAGE | HDF_BITMAP_ON_RIGHT;
hdi.iImage = Dir;
}
GetHeaderCtrl()->SetItem(Col, &hdi);
}
示例12: OnCreate
//建立消息
int CSkinListCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (__super::OnCreate(lpCreateStruct)==-1) return -1;
m_SkinHeadCtrl.SubclassWindow(GetHeaderCtrl()->GetSafeHwnd());
SetExtendedStyle(LIST_STYTE);
return 0;
}
示例13: PreSubclassWindow
//控件绑定
void CSkinListCtrl::PreSubclassWindow()
{
__super::PreSubclassWindow();
m_SkinHeadCtrl.SubclassWindow(GetHeaderCtrl()->GetSafeHwnd());
SetExtendedStyle(LIST_STYTE);
return;
}
示例14: ASSERT
void HHideListCtrl::PreSubclassWindow()
{
ASSERT( GetStyle() & LVS_REPORT );
CListCtrl::PreSubclassWindow();
VERIFY( m_ctlHeader.SubclassWindow( GetHeaderCtrl()->GetSafeHwnd() ) );
}
示例15: SetItemText
void CListCtrlEx::UpdateStatusDownload(int iIndex, int iStatus)
{
CString strStatus;
strStatus.Format(_T("%d%%"), iStatus);
m_ProgressList[iIndex]->SetWindowText(strStatus.GetBuffer());
m_ProgressList[iIndex]->SetMarquee(false, 1);
m_ProgressList[iIndex]->SetPos(iStatus);
m_ProgressList[iIndex]->Invalidate(TRUE);
if(iStatus >= 100)
{
SetItemText(iIndex, 2, strStatus);
}
CHeaderCtrl* pHeader=GetHeaderCtrl();
CRect ColRt;
pHeader->GetItemRect(m_iProgressColumn,&ColRt);
CRect rt;
GetItemRect(iIndex, &rt, LVIR_LABEL);
rt.top += 1;
rt.bottom -= 1;
rt.left += ColRt.left;
int Width = ColRt.Width();
rt.right = rt.left + Width - 4;
rt.left = ColRt.left +1 ;
rt.right = ColRt.right-1;
m_ProgressList[iIndex]->MoveWindow(&rt, TRUE);
}