本文整理汇总了C++中CHeaderCtrl::DeleteItem方法的典型用法代码示例。如果您正苦于以下问题:C++ CHeaderCtrl::DeleteItem方法的具体用法?C++ CHeaderCtrl::DeleteItem怎么用?C++ CHeaderCtrl::DeleteItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHeaderCtrl
的用法示例。
在下文中一共展示了CHeaderCtrl::DeleteItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: p
void CManilla2DConfigTabsDlg::UpdateListControlFromNewWidgetVector()
{
m_bPopulatingListControl = true;
int selectedIndex = GetSelectedItemIndex();
m_mainListControl.DeleteAllItems();
CHeaderCtrl* pListHeaderCtrl = m_mainListControl.GetHeaderCtrl();
if(pListHeaderCtrl != NULL)
{
int headerItemCount = pListHeaderCtrl->GetItemCount();
if(headerItemCount != 1)
{
// remove all items
for(int i=headerItemCount; i > 0; i--)
{
pListHeaderCtrl->DeleteItem(i);
}
CRect lcRect;
m_mainListControl.GetClientRect(&lcRect);
m_mainListControl.InsertColumn(0, _T("Item Name"), LVCFMT_LEFT, lcRect.Width());
}
}
for(size_t i=0; i<m_newWidgetVector.size(); i++)
{
LPCTSTR p(m_newWidgetVector[i].name);
m_mainListControl.InsertItem(i, p);
m_mainListControl.SetCheck(i, m_newWidgetVector[i].enabled);
}
if((selectedIndex >= 0) && (selectedIndex < m_mainListControl.GetItemCount()))
{
m_mainListControl.SetItemState(selectedIndex, LVIS_SELECTED, LVIS_SELECTED);
}
OnNMClickMainListControl(NULL, NULL);
m_mainListControl.SetFocus();
m_bPopulatingListControl = false;
}
示例2: OnClickList
void CBlockProperties::OnClickList(NMHDR* pNMHDR, LRESULT* pResult)
{
float distance;
char nodeName[NODES_ABBRNAME_LENGTH + 1];
long deadheadTime;
int rcode2;
int pos;
POSITION position = pListCtrlLIST->GetFirstSelectedItemPosition();
//
// Determine the selection(s)
//
if(position == NULL)
{
return;
}
//
// Display the trip
//
LVCOLUMN LVC;
int nItem = pListCtrlLIST->GetNextSelectedItem(position);
int nI = pListCtrlLIST->GetItemData(nItem);
//
// Get the trip
//
TRIPSKey0.recordID = m_pRELIEFPOINTS[nI].TRIPSrecordID;
btrieve(B_GETEQUAL, TMS_TRIPS, &TRIPS, &TRIPSKey0, 0);
//
// Show the route, service, direction, and pattern
//
char routeNumberAndName[ROUTES_NUMBER_LENGTH + 3 + ROUTES_NAME_LENGTH + 1];
char serviceName[SERVICES_NAME_LENGTH + 1];
char directionName[DIRECTIONS_LONGNAME_LENGTH + 1];
char patternName[PATTERNNAMES_NAME_LENGTH + 1];
ROUTESKey0.recordID = TRIPS.ROUTESrecordID;
btrieve(B_GETEQUAL, TMS_ROUTES, &ROUTES, &ROUTESKey0, 0);
strncpy(routeNumberAndName, ROUTES.number, ROUTES_NUMBER_LENGTH);
trim(routeNumberAndName, ROUTES_NUMBER_LENGTH);
strcat(routeNumberAndName, " - ");
strncpy(tempString, ROUTES.name, ROUTES_NAME_LENGTH);
trim(tempString, ROUTES_NAME_LENGTH);
strcat(routeNumberAndName, tempString);
SERVICESKey0.recordID = TRIPS.SERVICESrecordID;
btrieve(B_GETEQUAL, TMS_SERVICES, &SERVICES, &SERVICESKey0, 0);
strncpy(serviceName, SERVICES.name, SERVICES_NAME_LENGTH);
trim(serviceName, SERVICES_NAME_LENGTH);
DIRECTIONSKey0.recordID = ROUTES.DIRECTIONSrecordID[TRIPS.directionIndex];
btrieve(B_GETEQUAL, TMS_DIRECTIONS, &DIRECTIONS, &DIRECTIONSKey0, 0);
strncpy(directionName, DIRECTIONS.longName, DIRECTIONS_LONGNAME_LENGTH);
trim(directionName, DIRECTIONS_LONGNAME_LENGTH);
PATTERNNAMESKey0.recordID = TRIPS.PATTERNNAMESrecordID;
btrieve(B_GETEQUAL, TMS_PATTERNNAMES, &PATTERNNAMES, &PATTERNNAMESKey0, 0);
strncpy(patternName, PATTERNNAMES.name, PATTERNNAMES_NAME_LENGTH);
trim(patternName, PATTERNNAMES_NAME_LENGTH);
sprintf(tempString, "Trip info: %s %s %s on pattern %s",
serviceName, directionName, routeNumberAndName, patternName);
pStaticTRIPINFO->SetWindowText(tempString);
//
// Clear out the previous ListCtrl
//
pListCtrlTRIPDATA->DeleteAllItems();
CHeaderCtrl* pCtrl = pListCtrlTRIPDATA->GetHeaderCtrl();
if(pCtrl != NULL)
{
int nCount = pCtrl->GetItemCount();
for(nI = 0; nI < nCount; nI++)
{
pCtrl->DeleteItem(0);
}
}
//
// Set up the list control
//
GenerateTripDef GTResults;
GetConnectionTimeDef GCTData;
int numNodes = GenerateTrip(TRIPS.ROUTESrecordID, TRIPS.SERVICESrecordID,
TRIPS.directionIndex, TRIPS.PATTERNNAMESrecordID,
TRIPS.timeAtMLP, GENERATETRIP_FLAG_DISPLAYERRORS, >Results);
pos = 0;
//
// Is this a pullout?
//
long POTime = NO_TIME;
if(TRIPS.standard.POGNODESrecordID != NO_RECORD)
{
GCTData.fromPATTERNNAMESrecordID = TRIPS.PATTERNNAMESrecordID;
GCTData.toPATTERNNAMESrecordID = TRIPS.PATTERNNAMESrecordID;
GCTData.fromROUTESrecordID = TRIPS.ROUTESrecordID;
GCTData.fromSERVICESrecordID = TRIPS.SERVICESrecordID;
//.........这里部分代码省略.........