本文整理汇总了C++中CHeaderCtrl::ModifyStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ CHeaderCtrl::ModifyStyle方法的具体用法?C++ CHeaderCtrl::ModifyStyle怎么用?C++ CHeaderCtrl::ModifyStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHeaderCtrl
的用法示例。
在下文中一共展示了CHeaderCtrl::ModifyStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitListHeader
void CExplorerTestView::InitListHeader()
{
LV_COLUMN lvColumn;
CString strHeader;
CListCtrl& listCtrl = GetListCtrl();
lvColumn.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
for(int i = 0 ; cListHeader[i] != NULL ; i++)
{
strHeader = cListHeader[i];
lvColumn.fmt = (strHeader.Compare("크기") == 0 ? LVCFMT_RIGHT : LVCFMT_LEFT);
lvColumn.cx = nHeaderWidth[i];
lvColumn.pszText = cListHeader[i];
lvColumn.iSubItem = i;
listCtrl.InsertColumn(i, &lvColumn);
}
CHeaderCtrl* pH = (CHeaderCtrl*)GetListCtrl().GetDlgItem(0);
pH->ModifyStyle(0, HDS_HOTTRACK);
}
示例2: OnInitDialog
BOOL CPage_Node_Movement::OnInitDialog()
{
CPropertyPage::OnInitDialog();
int PlanNo = m_pDoc->GetTimingPlanNo("ALLDAY");
for(int p = 1; p <= _max_phase_number; p++)
{
m_bAvailablePhaseVector [p] = false;
m_EffectiveGreenTime [p]= 0;
}
m_CurrentNodeID = m_pDoc->m_SelectedNodeID ;
m_CurrentNodeNumber = m_pDoc->m_NodeNoMap [m_CurrentNodeID]->m_NodeNumber ;
m_CycleLengthInSec = m_pDoc->m_NodeNoMap [m_CurrentNodeID]->m_CycleLengthInSecond ;
// Give better margin to editors
m_ListCtrl.SetCellMargin(1.2);
CGridRowTraitXP* pRowTrait = new CGridRowTraitXP; // Hao: this ponter should be delete.
m_ListCtrl.SetDefaultRowTrait(pRowTrait);
m_Column_names.push_back ("Incoming Node"); //0
m_Column_names.push_back ("Outgoing Node"); //1
m_Column_names.push_back ("Turn Type"); //2
m_Column_names.push_back ("Direction"); //3
m_Column_names.push_back ("Prohibition"); //4
m_Column_names.push_back ("Simu Total Volume"); //5
m_Column_names.push_back ("Simu Hourly Volume"); //6
m_Column_names.push_back ("Simu Delay (sec)"); //7
//if(m_bSigalizedNode == true)
//{
//m_Column_names.push_back ("Green Start Time"); //9
//m_Column_names.push_back ("Green End Time"); //10
//}
CHeaderCtrl* pHeader = m_ListCtrl.GetHeaderCtrl();
if( pHeader!=NULL)
{
pHeader->ModifyStyle(HDS_BUTTONS, 0); // disable the sorting.
}
//Add Columns and set headers
for (size_t i=0;i<m_Column_names.size();i++)
{
CGridColumnTrait* pTrait = NULL;
// pTrait = new CGridColumnTraitEdit();
if(m_Column_names[i].find ("Turn Type")!= string::npos)
{
pTrait = new CGridColumnTraitEdit();
}
if(m_Column_names[i].find ("Direction")!= string::npos)
{
pTrait = new CGridColumnTraitEdit();
}
if(m_Column_names[i].find ("Prohibition")!= string::npos)
{
CGridColumnTraitCombo* pComboTrait = new CGridColumnTraitCombo;
pComboTrait->SetStyle (CBS_DROPDOWNLIST);
pComboTrait->AddItem(0, _T(""));
pComboTrait->AddItem(0, _T("Prohibited"));
pTrait = pComboTrait;
}
m_ListCtrl.InsertColumnTrait((int)i,m_Column_names.at(i).c_str(),LVCFMT_LEFT,-1,-1, pTrait);
if(i<=10)
m_ListCtrl.SetColumnWidth((int)i,100);
else
m_ListCtrl.SetColumnWidth((int)i,100);
}
//Add Rows
DTANode* pNode = m_pDoc->m_NodeNoMap [m_CurrentNodeID];
for (unsigned int i=0;i< pNode->m_MovementDataMap[m_TimingPlanName].m_MovementVector .size();i++)
{
DTANodeMovement movement = pNode->m_MovementDataMap[m_TimingPlanName].m_MovementVector[i];
CString str;
str.Format ("%d", m_pDoc->m_NodeNoMap[movement.in_link_from_node_id]->m_NodeNumber ); // 0: from node
int Index = m_ListCtrl.InsertItem(LVIF_TEXT,i,str , 0, 0, 0, NULL);
int column_index = 1;
//.........这里部分代码省略.........