本文整理匯總了C++中DeleteAllItems函數的典型用法代碼示例。如果您正苦於以下問題:C++ DeleteAllItems函數的具體用法?C++ DeleteAllItems怎麽用?C++ DeleteAllItems使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DeleteAllItems函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: DeleteAllItems
void CSharedDirsTreeCtrl::InitalizeStandardItems(){
// add standard items
DeleteAllItems();
delete m_pRootDirectoryItem;
delete m_pRootUnsharedDirectries;
FetchSharedDirsList();
m_pRootDirectoryItem = new CDirectoryItem(CString(""), TVI_ROOT);
CDirectoryItem* pAll = new CDirectoryItem(CString(""), 0, SDI_ALL);
pAll->m_htItem = InsertItem(TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE, GetResString(IDS_ALLSHAREDFILES), 0, 0, 0, 0, (LPARAM)pAll, TVI_ROOT, TVI_LAST);
m_pRootDirectoryItem->liSubDirectories.AddTail(pAll);
CDirectoryItem* pIncoming = new CDirectoryItem(CString(""), TVI_ROOT, SDI_INCOMING);
pIncoming->m_htItem = InsertItem(TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE, GetResString(IDS_INCOMING_FILES), 2, 2, 0, 0, (LPARAM)pIncoming, TVI_ROOT, TVI_LAST);
m_pRootDirectoryItem->liSubDirectories.AddTail(pIncoming);
CDirectoryItem* pTemp = new CDirectoryItem(CString(""), TVI_ROOT, SDI_TEMP);
pTemp->m_htItem = InsertItem(TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE, GetResString(IDS_INCOMPLETE_FILES), 1, 1, 0, 0, (LPARAM)pTemp, TVI_ROOT, TVI_LAST);
m_pRootDirectoryItem->liSubDirectories.AddTail(pTemp);
CDirectoryItem* pDir = new CDirectoryItem(CString(""), TVI_ROOT, SDI_DIRECTORY);
pDir->m_htItem = InsertItem(TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE, GetResString(IDS_SHARED_DIRECTORIES), 5, 5, TVIS_EXPANDED, TVIS_EXPANDED, (LPARAM)pDir, TVI_ROOT, TVI_LAST);
m_pRootDirectoryItem->liSubDirectories.AddTail(pDir);
m_pRootUnsharedDirectries = new CDirectoryItem(CString(""), TVI_ROOT, SDI_FILESYSTEMPARENT);
m_pRootUnsharedDirectries->m_htItem = InsertItem(TVIF_TEXT | TVIF_PARAM | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_CHILDREN, GetResString(IDS_ALLDIRECTORIES), 4, 4, 0, 0, (LPARAM)m_pRootUnsharedDirectries, TVI_ROOT, TVI_LAST);
}
示例2: DeleteAllItems
void CXTabCtrl::DeleteAllTabs()
{
m_arrayStatusTab.RemoveAll();
DeleteAllItems();
}
示例3: DeleteAllItems
// the heading text is in the format of "text,width,format;text,width,format;..."
BOOL CReportCtrl::SetColumnHeader(const CString& strHeadings)
{
DeleteAllItems();
DeleteAllColumns();
EndEdit(TRUE);
BOOL bInserted = FALSE;
CStringArray aLong, aShort;
_StringSplit(strHeadings, aLong, _T(';'));
for (int i = 0; i < aLong.GetSize(); i++)
{
_StringSplit(aLong[i], aShort, _T(','));
if (aShort.GetSize() > 0)
{
const int WIDTH = aShort.GetSize() > 1 ? _ttoi(aShort[1]) : 100;
int nFormat = aShort.GetSize() > 2 ? _ttoi(aShort[2]) : 0;
if (nFormat == 1)
nFormat = LVCFMT_CENTER;
else if (nFormat == 2)
nFormat = LVCFMT_RIGHT;
else
nFormat = LVCFMT_LEFT;
bInserted |= (InsertColumn(GetColumnCount(), aShort[0], nFormat, WIDTH) >= 0);
}
}
return bInserted;
}
示例4: DeleteAllItems
int StocksListCtrl::initVirtualListControl(int id, int col, bool asc)
{
stock_panel_->updateHeader();
/* Clear all the records */
DeleteAllItems();
wxListItem item;
item.SetMask(wxLIST_MASK_IMAGE);
item.SetImage(asc ? 3 : 2);
SetColumn(col, item);
m_stocks = Model_Stock::instance().find(Model_Stock::HELDAT(stock_panel_->accountID_));
sortTable();
int cnt = 0, selected_item = -1;
for (const auto& stock: m_stocks)
{
if (id == stock.STOCKID)
{
selected_item = cnt;
break;
}
++cnt;
}
SetItemCount(m_stocks.size());
return selected_item;
}
示例5: SetExtendedStyle
void CGitProgressList::Init()
{
SetExtendedStyle (LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER);
DeleteAllItems();
int c = ((CHeaderCtrl*)(GetDlgItem(0)))->GetItemCount()-1;
while (c>=0)
DeleteColumn(c--);
CString temp;
temp.LoadString(IDS_PROGRS_ACTION);
InsertColumn(0, temp);
temp.LoadString(IDS_PROGRS_PATH);
InsertColumn(1, temp);
m_pThread = AfxBeginThread(ProgressThreadEntry, this, THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);
if (m_pThread==NULL)
{
ReportError(CString(MAKEINTRESOURCE(IDS_ERR_THREADSTARTFAILED)));
}
else
{
m_pThread->m_bAutoDelete = FALSE;
m_pThread->ResumeThread();
}
// Call this early so that the column headings aren't hidden before any
// text gets added.
ResizeColumns();
SetTimer(VISIBLETIMER, 300, NULL);
}
示例6: sourceFile
void PHPOutlineTree::BuildTree(const wxFileName& filename)
{
m_filename = filename;
PHPSourceFile sourceFile(filename, NULL);
sourceFile.SetParseFunctionBody(false);
sourceFile.Parse();
wxWindowUpdateLocker locker(this);
DeleteAllItems();
wxTreeItemId root = AddRoot(wxT("Root"));
wxImageList* images = new wxImageList(clGetScaledSize(16), clGetScaledSize(16), true);
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/globals"))); // 0
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_private"))); // 1
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_protected"))); // 2
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_public"))); // 3
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_private"))); // 4
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_protected"))); // 5
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_public"))); // 6
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/namespace"))); // 7
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/class"))); // 8
images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/enumerator"))); // 9
AssignImageList(images);
// Build the tree view
BuildTree(root, sourceFile.Namespace());
if(HasChildren(GetRootItem())) {
ExpandAll();
}
}
示例7: DeleteAllItems
// feedId = 0 => all feeds; otherwise feedId = RssFeeds.rowid
void CRssView::SetFeed(int feedId)
{
if(feedId != m_feedId)
DeleteAllItems();
m_feedId = feedId;
Refresh();
}
示例8: DeleteAllItems
void FilterListCtrl::UpdateList()
{
DeleteAllItems();
CString clsid_str;
CString guid_search_str(search_str);
guid_search_str.Replace(_T("0X"), _T(""));
const TCHAR delimiters[] = _T(" \t-,{}()=/;UL"); // remove commonly used C++ GUID delimiters and match by remaining hex digits
for (int n=0; n<sizeof(delimiters)/sizeof(delimiters[0]); n++)
guid_search_str.Remove(delimiters[n]);
for (int i=0; i<filters.GetCount(); i++) {
DSUtil::FilterTemplate &filter = filters[i];
if (CString(filter.name).MakeUpper().Find(search_str) < 0) {
CLSIDToString(filter.clsid, clsid_str);
clsid_str.Remove(_T('-')); // remove hex separators generated by CLSIDToString
if (clsid_str.Find(guid_search_str) < 0) {
continue;
}
}
const int item = InsertItem(LVIF_PARAM | LVIF_TEXT, 0, filter.name, 0, 0, 0, (LPARAM)&filter);
SetItemData(item, (DWORD_PTR)&filter);
}
}
示例9: bmImage
void CViewTree::OnInitialUpdate()
{
//set the image lists
m_imlNormal.Create(16, 15, ILC_COLOR32 | ILC_MASK, 1, 0);
CBitmap bmImage(IDB_CLASSVIEW);
m_imlNormal.Add( &bmImage, RGB(255, 0, 0) );
SetImageList(&m_imlNormal, LVSIL_NORMAL);
// Adjust style to show lines and [+] button
DWORD dwStyle = (DWORD)GetWindowLongPtr(GWL_STYLE);
dwStyle |= TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT;
SetWindowLongPtr(GWL_STYLE, dwStyle);
DeleteAllItems();
// Add some tree-view items
HTREEITEM htiRoot = AddItem(NULL, _T("TreeView"), 0);
HTREEITEM htiCTreeViewApp = AddItem(htiRoot, _T("CTreeViewApp"), 1);
AddItem(htiCTreeViewApp, _T("CTreeViewApp()"), 3);
AddItem(htiCTreeViewApp, _T("GetMainFrame()"), 3);
AddItem(htiCTreeViewApp, _T("InitInstance()"), 3);
HTREEITEM htiMainFrame = AddItem(htiRoot, _T("CMainFrame"), 1);
AddItem(htiMainFrame, _T("CMainFrame()"), 3);
AddItem(htiMainFrame, _T("OnCommand()"), 4);
AddItem(htiMainFrame, _T("OnInitialUpdate()"), 4);
AddItem(htiMainFrame, _T("WndProc()"), 4);
HTREEITEM htiView = AddItem(htiRoot, _T("CView"), 1);
AddItem(htiView, _T("CView()"), 3);
AddItem(htiView, _T("OnInitialUpdate()"), 4);
AddItem(htiView, _T("WndProc()"), 4);
// Expand some tree-view items
Expand(htiRoot, TVE_EXPAND);
Expand(htiCTreeViewApp, TVE_EXPAND);
}
示例10: ShowWindow
void CIrcNickListCtrl::RefreshNickList( CString sChannel )
{
//Hide nickList to speed things up..
ShowWindow(SW_HIDE);
DeleteAllItems();
Channel* refresh = m_pParent->m_tabctrlChannelSelect.FindChannelByName( sChannel );
if( !refresh )
{
//This is not a channel??? shouldn't happen..
UpdateNickCount();
ShowWindow(SW_SHOW);
return;
}
POSITION pos1, pos2;
Nick* pCurrNick = NULL;
int iItemr = -1;
for (pos1 = refresh->m_ptrlistNicks.GetHeadPosition();( pos2 = pos1 ) != NULL;)
{
//Add all nicks to list..
refresh->m_ptrlistNicks.GetNext(pos1);
pCurrNick = (Nick*)refresh->m_ptrlistNicks.GetAt(pos2);
iItemr = GetItemCount();
iItemr = InsertItem(LVIF_PARAM,iItemr,0,0,0,0,(LPARAM)pCurrNick);
SetItemText(iItemr,0,(LPCTSTR)pCurrNick->m_sNick);
SetItemText(iItemr,1,(LPCTSTR)pCurrNick->m_sModes);
}
UpdateNickCount();
ShowWindow(SW_SHOW);
}
示例11: DeleteAllItems
DBTreeCtrl::~DBTreeCtrl()
{
if (!IsEmpty())
{
DeleteAllItems();
}
}
示例12: delete
void CKeyframeList::ResetList()
{
for(int i= 0; i < GetItemCount(); i++){
delete (KeyFrame*) GetItemData(i);
}
DeleteAllItems();
}
示例13: SetRedraw
void CFeedIcoItemListCtrl::FilterItemsBySearchKey(CString* pSearchKey)
{
if (!IsWindowVisible())
return;
if (pSearchKey == NULL || pSearchKey->IsEmpty())
{
if (m_stringMatcher.IsOriginal())
return;
}
const StringMatcher::ListItemsNeedShow& listItemsNeedShow = m_stringMatcher.GetMatchResult(pSearchKey);
SetRedraw(FALSE);
RemoveAllGroups();//刪除分組
RemoveAllGroupData();//刪除m_mapGroups
DeleteAllItems();//刪除items
for (StringMatcher::ListItemsNeedShow::const_iterator ix = listItemsNeedShow.begin(); ix != listItemsNeedShow.end(); ++ix)
{
CRssFeed* listKey = (CRssFeed*)*ix;
CString strCaption = GetExtentString( listKey->GetDisplayName() );
int nRet = InsertItem(GetItemCount(), strCaption);
this->SetItemData(nRet, LPARAM(listKey));
}
GroupAllFeedsByType(0);
SetRedraw(TRUE);
}
示例14: Freeze
void ProcList::showList(int highlight)
{
int c = 0;
Freeze();
DeleteAllItems();
for (std::vector<Database::Item>::const_iterator i = list.items.begin(); i != list.items.end(); i++)
{
const Database::Symbol *sym = i->symbol;
double inclusive = i->inclusive;
double exclusive = i->exclusive;
float inclusivepercent = i->inclusive * 100.0f / list.totalcount;
float exclusivepercent = i->exclusive * 100.0f / list.totalcount;
InsertItem(c, sym->procname.c_str(), -1);
if(sym->isCollapseFunction || sym->isCollapseModule) {
SetItemTextColour(c,wxColor(0,128,0));
}
setColumnValue(c, COL_EXCLUSIVE, wxString::Format("%0.2fs",exclusive));
setColumnValue(c, COL_INCLUSIVE, wxString::Format("%0.2fs",inclusive));
setColumnValue(c, COL_EXCLUSIVEPCT, wxString::Format("%0.2f%%",exclusivepercent));
setColumnValue(c, COL_INCLUSIVEPCT, wxString::Format("%0.2f%%",inclusivepercent));
setColumnValue(c, COL_SAMPLES, wxString::Format("%0.2fs",exclusive));
setColumnValue(c, COL_CALLSPCT, wxString::Format("%0.2f%%",exclusivepercent));
setColumnValue(c, COL_MODULE, sym->module.c_str());
setColumnValue(c, COL_SOURCEFILE, sym->sourcefile.c_str());
setColumnValue(c, COL_SOURCELINE, ::toString(sym->sourceline).c_str());
c++;
}
this->SetItemState(highlight, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED, wxLIST_STATE_FOCUSED|wxLIST_STATE_SELECTED);
Thaw();
EnsureVisible(highlight);
}
示例15: DeleteAllItems
void CSitesWnd::OnForceUpdate()
{
DeleteAllItems ();
int cSites = _SitesMgr.GetSiteCount ();
for (int i = 0; i < cSites; i++)
AddSiteToList (_SitesMgr.GetSite (i));
}