本文整理汇总了C++中CHeaderCtrl::SetOrderArray方法的典型用法代码示例。如果您正苦于以下问题:C++ CHeaderCtrl::SetOrderArray方法的具体用法?C++ CHeaderCtrl::SetOrderArray怎么用?C++ CHeaderCtrl::SetOrderArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHeaderCtrl
的用法示例。
在下文中一共展示了CHeaderCtrl::SetOrderArray方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitDialog
BOOL CTabPageProgram::OnInitDialog()
{
CDialog::OnInitDialog();
ADD_LOG();
m_lt_ShowProgram.SetExtendedStyle(LVS_EX_SUBITEMIMAGES |
LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT | LVS_EX_CHECKBOXES);
m_lt_ShowProgram.ModifyStyle(0, LVS_REPORT, 0);
m_lt_ShowProgram.InsertColumn(0, _T("自动恢复"), LVCFMT_CENTER, 100);
m_lt_ShowProgram.InsertColumn(1, _T("编号"), LVCFMT_CENTER, 50);
m_lt_ShowProgram.InsertColumn(2, _T("进程标识符"), LVCFMT_CENTER, 100);
m_lt_ShowProgram.InsertColumn(3, _T("进程名称"), LVCFMT_CENTER, 80);
m_lt_ShowProgram.InsertColumn(4, _T("数量"), LVCFMT_CENTER, 50);
m_lt_ShowProgram.InsertColumn(5, _T("等待时间"), LVCFMT_CENTER, 100);
m_lt_ShowProgram.InsertColumn(6, _T(" "), LVCFMT_CENTER, 40);
m_lt_ShowProgram.InsertColumn(7, _T("事件名称"), LVCFMT_CENTER, 100);
CHeaderCtrl* pHeaderCtrl = m_lt_ShowProgram.GetHeaderCtrl();
INT nCount = pHeaderCtrl->GetItemCount();
LPINT pOder = (LPINT)malloc(nCount*sizeof(int));
pHeaderCtrl->GetOrderArray(pOder, nCount);
int nTemp = 0;
nTemp = pOder[0], pOder[0] = pOder[nCount - 2], pOder[nCount - 2] = nTemp;
pHeaderCtrl->SetOrderArray(nCount, pOder);
free(pOder);
UpdateList();
return TRUE;
}
示例2: ReadState
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;
}
}
示例3: SwapColumns
/*
* 交换列表框中的两列位置
*/
void CYuanListShowImg::SwapColumns(int c1, int c2)
{
CHeaderCtrl *pmyHeaderCtrl = m_plcShow->GetHeaderCtrl();
int nCount = pmyHeaderCtrl->GetItemCount();
LPINT pnOrder = (LPINT) malloc(nCount*sizeof(int));
ASSERT(pnOrder != NULL);
pmyHeaderCtrl->GetOrderArray(pnOrder, nCount);
int nTemp;
nTemp = pnOrder[c1];
pnOrder[c1] = pnOrder[c2];
pnOrder[c2] = nTemp;
pmyHeaderCtrl->SetOrderArray(nCount, pnOrder);
free(pnOrder);
}