本文整理汇总了C++中InsertItem函数的典型用法代码示例。如果您正苦于以下问题:C++ InsertItem函数的具体用法?C++ InsertItem怎么用?C++ InsertItem使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InsertItem函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ASSERT
//-------------------------------------------------------------------//
// AddDialogTab() //
//-------------------------------------------------------------------//
// Make sure these dlgs are fully created before calling Init().
// Also, make sure that you used this tab ctrl as the parent of
// the dialogs!
//-------------------------------------------------------------------//
void ChildDlgTabCtrl::AddDialogTab(
CDialog* pNewDlg,
LPCTSTR szName
) {
// Did you make the tab ctrl the parent?
// Otherwise, sizing will be all screwed up.
ASSERT( pNewDlg->GetParent() == this );
// The majority of our flicker elimination comes from setting
// WS_CLIPCHILDREN for the dialog. MAKE SURE THIS IS SET!
// See MSJ May '97 C++ Q&A for more info - thanks again, Paul!
ASSERT( pNewDlg->GetStyle() & WS_CLIPCHILDREN );
InsertItem( TabDlgs.size(), szName );
TabDlgs.push_back( pNewDlg );
}
开发者ID:moodboom,项目名称:Reusable,代码行数:23,代码来源:ChildDlgTabCtrl.cpp
示例2: InsertItem
//向列表框中添加行
BOOL CMyListCtrl::AddItem(int nItem,int nSubItem,LPCTSTR strItem,int nImageIndex)
{
LV_ITEM lvItem;
lvItem.mask = LVIF_TEXT;
lvItem.iItem = nItem;
lvItem.iSubItem = nSubItem;
lvItem.pszText = (LPTSTR) strItem;
// lvItem.Height=20;
if(nImageIndex != -1){
lvItem.mask |= LVIF_IMAGE;
lvItem.iImage |= LVIF_IMAGE;
}
if(nSubItem == 0)
return InsertItem(&lvItem);
return SetItem(&lvItem);
}
开发者ID:uesoft,项目名称:AutoPHS,代码行数:17,代码来源:mylistctrl.cpp
示例3: ZeroMemory
HTREEITEM CViewTree::AddItem(HTREEITEM hParent, LPCTSTR szText, int iImage)
{
TVITEM tvi;
ZeroMemory(&tvi, sizeof(TVITEM));
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvi.iImage = iImage;
tvi.iSelectedImage = iImage;
tvi.pszText = (LPTSTR)szText;
TVINSERTSTRUCT tvis;
ZeroMemory(&tvis, sizeof(TVINSERTSTRUCT));
tvis.hParent = hParent;
tvis.item = tvi;
return InsertItem(tvis);
}
开发者ID:quinsmpang,项目名称:Tools,代码行数:16,代码来源:MDIChildTreeView.cpp
示例4: GetSelectedItem
void MenuEditor::AddItem(const wxString& label, const wxString& shortcut,
const wxString& id, const wxString& name, const wxString &help, const wxString &kind)
{
int sel = GetSelectedItem();
int identation = 0;
if (sel >= 0) identation = GetItemIdentation(sel);
wxString labelAux = label;
labelAux.Trim(true);
labelAux.Trim(false);
if (sel < 0) sel = m_menuList->GetItemCount() - 1;
labelAux = wxString(wxChar(' '), identation * IDENTATION) + labelAux;
long index = InsertItem(sel + 1, labelAux, shortcut, id, name, help, kind);
m_menuList->SetItemState(index, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
}
开发者ID:TcT2k,项目名称:wxFormBuilder,代码行数:16,代码来源:menueditor.cpp
示例5: GetItemCount
void CSharedFilesCtrl::DoShowFile(CKnownFile* file, bool batch)
{
wxUIntPtr ptr = reinterpret_cast<wxUIntPtr>(file);
if ((!batch) && (FindItem(-1, ptr) > -1)) {
return;
}
const long insertPos = (batch ? GetItemCount() : GetInsertPos(ptr));
long newitem = InsertItem(insertPos, wxEmptyString);
SetItemPtrData( newitem, ptr );
if (!batch) {
ShowFilesCount();
}
}
开发者ID:Artoria2e5,项目名称:amule-dlp,代码行数:16,代码来源:SharedFilesCtrl.cpp
示例6: GetItemCount
int CTDLFindResultsListCtrl::AddResult(const SEARCHRESULT& result, LPCTSTR szTask, LPCTSTR/*szPath*/,
const CFilteredToDoCtrl* pTDC)
{
int nPos = GetItemCount();
// add result
int nIndex = InsertItem(nPos, szTask);
SetItemText(nIndex, 1, Misc::FormatArray(result.aMatched));
UpdateWindow();
// map identifying data
FTDRESULT* pRes = new FTDRESULT(result.dwID, pTDC, result.HasFlag(RF_DONE));
SetItemData(nIndex, (DWORD)pRes);
return nIndex;
}
开发者ID:noindom99,项目名称:repositorium,代码行数:16,代码来源:TDLFindResultsListCtrl.cpp
示例7: SelectItem
void CMIDIMappingDialog::OnBnClickedButtonAdd()
//---------------------------------------------
{
if(m_rSndFile.GetModSpecifications().MIDIMappingDirectivesMax <= m_rMIDIMapper.GetCount())
{
Reporting::Information("Maximum amount of MIDI Mapping directives reached.");
} else
{
const size_t i = m_rMIDIMapper.AddDirective(m_Setting);
if(m_rSndFile.GetpModDoc())
m_rSndFile.GetpModDoc()->SetModified();
SelectItem(InsertItem(m_Setting, i));
OnSelectionChanged();
}
}
开发者ID:Sappharad,项目名称:modizer,代码行数:16,代码来源:MIDIMappingDialog.cpp
示例8: insertMax
struct node* insertMax( struct node* node, int studentId, struct item* item ) {
int i = node->numChildren;
node->keys[i] = studentId; // node's greatest key is studentId
if ( node->isLeafNode == YES ) {
node->courseList[i] = InsertItem( node->courseList[i], item );
node->numChildren = node->numChildren + 1;
} else {
if ( node->children[i-1]->numChildren == 4 ) { // if slotting in studentId made 4 children
node = split( node, i );
i++;
}
node = insertMax( node->children[i-1], studentId, item );
}
return node;
} // insertMax
开发者ID:kimcoop,项目名称:1550-project1,代码行数:16,代码来源:myrecs.c
示例9: ProcessConnOp
void CUsersListCtrl::ProcessConnOp(int op, const t_connectiondata &connectionData)
{
if (op==USERCONTROL_CONNOP_ADD)
{
CString str;
if (connectionData.user=="")
str.Format("(not logged in) (%06d)",connectionData.userid);
else
str.Format("%s (%06d)",connectionData.user,connectionData.userid);
int index=InsertItem(GetItemCount(),str);
t_connectiondata *pData = new t_connectiondata;
*pData = connectionData;
SetItemData(index, (DWORD)pData);
}
else if (op==USERCONTROL_CONNOP_MODIFY)
{
for (int i=0;i<GetItemCount();i++)
{
t_connectiondata *pData=(t_connectiondata *)GetItemData(i);
if (pData->userid==connectionData.userid)
{
*pData = connectionData;
CString str;
if (connectionData.user=="")
str.Format("(not logged in) (%06d)",connectionData.userid);
else
str.Format("%s (%06d)",connectionData.user,connectionData.userid);
SetItemText(i,0,str);
break;
}
}
}
else if (op==USERCONTROL_CONNOP_REMOVE)
{
for (int i=0;i<GetItemCount();i++)
{
t_connectiondata *pData=(t_connectiondata *)GetItemData(i);
if (pData->userid==connectionData.userid)
{
delete pData;
DeleteItem(i);
break;
}
}
}
}
开发者ID:Avoidnf8,项目名称:xbmc-fork,代码行数:47,代码来源:UsersListCtrl.cpp
示例10: sprintf
/**
*
* \param lpszFilePath
* \param lpszFilter
* \return
*/
BOOL CImageListBox::Load(LPCTSTR lpszFilePath, LPCTSTR lpszFilter)
{
char szPath[MAX_PATH];
sprintf(szPath, "%s\\%s", lpszFilePath, lpszFilter);
SetRedraw( FALSE );
WIN32_FIND_DATA wDt;
HANDLE hFile = ::FindFirstFile(szPath, &wDt);
if (hFile != INVALID_HANDLE_VALUE)
{
BOOL bFind = TRUE;
while( bFind )
{
if (!(wDt.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
{
CString s(wDt.cFileName);
if (!s.IsEmpty())
{
CImage image;
sprintf(szPath, "%s\\%s", lpszFilePath, wDt.cFileName);
image.Load(szPath);
CBitmap* pBitmap = CBitmap::FromHandle((HBITMAP)image);
if (pBitmap)
{
// 添加位图
int image = m_ImageList.Add(pBitmap, RGB(0, 0, 0));
int nItem = image ? image - 1 : 0;
// 插入项目
InsertItem(nItem, s.GetBuffer(), image);
}
}
}
bFind = ::FindNextFile(hFile, &wDt);
}
::FindClose(hFile);
}
SetRedraw(TRUE);
Invalidate();
return TRUE;
}
开发者ID:lonyzone,项目名称:oathx-ogrex-editor,代码行数:53,代码来源:ImageListBox.cpp
示例11: GetHeaderCtrl
int KGListCtrl::InsertDepend(LPKGLISTITEM pParentItem, LPKGLISTITEM pInsertItem)
{
int nResult = false;
int nRetCode = false;
LPKGLISTITEM pPreItem = m_listDataTree.FindLastVisualChild(pParentItem);
int nInsertPos = 0;
int nColsNumber = GetHeaderCtrl()->GetItemCount();
KG_PROCESS_ERROR(pInsertItem);
nRetCode = m_listDataTree.AddDepend(pParentItem, pInsertItem);
KG_PROCESS_ERROR(nRetCode);
nRetCode = !m_listDataTree.IsVisual(pInsertItem);
KG_PROCESS_SUCCESS(nRetCode);
if (pPreItem)
{
nInsertPos = FindItemPos(pPreItem) + 1;
}
else
{
if (pParentItem)
{
nInsertPos = FindItemPos(pParentItem) + 1;
}
else
{
nInsertPos = 0;
}
}
if (nColsNumber > pInsertItem->arryItemText.GetCount())
{
nColsNumber = (int)pInsertItem->arryItemText.GetCount();
}
InsertItem(nInsertPos, NULL);
SetItemData(nInsertPos, (DWORD_PTR)pInsertItem);
RetrievesItemData(pInsertItem);
Exit1:
nResult = true;
Exit0:
return nResult;
}
开发者ID:viticm,项目名称:pap2,代码行数:46,代码来源:KGListCtrl.cpp
示例12: DeleteAllItems
// Restores the entire list if the filter is empty
void wxAdvancedListCtrl::RestoreList()
{
if (BackupItems.empty())
return;
DeleteAllItems();
for (size_t x = 0; x < BackupItems.size(); ++x)
{
InsertItem(x, wxT(""));
for (size_t y = 0; y < BackupItems[x].size(); ++y)
{
SetItem(BackupItems[x][y]);
}
}
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:18,代码来源:lst_custom.cpp
示例13: ListView_GetItemCount
void GUI_manager::add_IMG(const char* full_path_file_name) {
int item = ListView_GetItemCount(IMG_list);
vector<internal_file> TRE_file_list;
char tmp[1024];
char local_file_name[1024];
char t_file_type[255];
char drive[5];
char dir[1024];
GetWindowText(region_name,tmp,1000);
_splitpath(full_path_file_name,drive,dir,local_file_name,t_file_type);
if( !strcmp(strupr( t_file_type ),".TXT" ) ) {
FILE* list = fopen(full_path_file_name,"r");
char file_name[1025];
strcpy(tmp,"map");
if( list ) {
while( fgets(file_name,1024,list) != NULL ) {
//remove 'non asci' chars!
while( file_name[strlen(file_name)-1] < 32 && strlen(file_name))
file_name[strlen(file_name)-1] = 0;
if( strlen(file_name) ) {
if( file_name[0] == ':' ) {
strcpy(tmp,&file_name[1]);
} else {
uploader->add_img_file(file_name,&TRE_file_list,"",0,0,tmp,uploader->get_product_id(tmp));
}
}
}
fclose(list);
}
} else {
uploader->add_img_file(full_path_file_name,&TRE_file_list,"",0,0,tmp,uploader->get_product_id(tmp));
}
for( vector<internal_file>::iterator f = TRE_file_list.begin(); f < TRE_file_list.end(); f++ ) {
InsertItem(IMG_list, item , LPARAM("%s"),(*f).region_name.c_str());
SetSubItemText (IMG_list, item, 1, "%s", (*f).TRE_map_name.c_str());
SetSubItemText (IMG_list, item, 2, "%s", (*f).file_name.c_str());
SetSubItemText (IMG_list, item, 3, "%s", (*f).get_internal_short_name());
}
AutoSizeColumns(IMG_list);
show_size();
}
开发者ID:casaretto,项目名称:cgpsmapper,代码行数:46,代码来源:gui_sendmap.cpp
示例14: GetItemCount
long ListCtrlImproved::AppendRow()
{
long item;
GetItemCount() ? item = GetItemCount() : item = 0;
wxListItem info;
// Set the item display name
info.SetColumn(0);
info.SetId(item);
if(GetItemCount() % 2 && HasFlag(wxLC_COLOUR_BACKGROUND))
info.SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
item = InsertItem(info);
return item;
}
开发者ID:292388900,项目名称:codelite,代码行数:17,代码来源:listctrl_improved.cpp
示例15: InsertHeader
void LstOdaSrvDetails::InsertHeader(const wxString &Name,
const wxColor *NameColor,
const wxColor *NameBGColor)
{
wxListItem ListItem;
ListItem.SetMask(wxLIST_MASK_TEXT);
// Name Column
ListItem.SetText(Name);
ListItem.SetColumn(srvdetails_field_name);
ListItem.SetId(InsertItem(GetItemCount(), ListItem.GetText()));
ListItem.SetBackgroundColour(*NameBGColor);
ListItem.SetTextColour(*NameColor);
SetItem(ListItem);
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:17,代码来源:lst_srvdetails.cpp
示例16: InsertItem
BOOL CFusionTabControls::CreateTabs()
{
int tab;
for (tab = 0; tab < NumTabs; ++tab)
{
TC_ITEM item;
item.mask = TCIF_TEXT;
item.pszText = Tabs[tab].Text;
InsertItem (Tabs[tab].WhichTab, &item);
}
m_CurrentTab = GetCurSel();
return TRUE;
}
开发者ID:RealityFactory,项目名称:Genesis3D-Tools,代码行数:17,代码来源:FusionTabControls.cpp
示例17: DEX_GetDataSourceShortName
BOOL CObjectClassStatistics::EnumDataSources (HPROJECT hPr, BOOL, UINT_PTR *pData)
{
// Namen der Datenquelle besorgen
char cbBuffer[_MAX_PATH];
DEX_GetDataSourceShortName(hPr, cbBuffer);
// Icon der Datenquelle besorgen
DWORD dwBmp = IMG_DATASOURCE;
{
__Interface<ITRiASConnection> Conn;
if (DEX_GetDataSourcePtr(hPr, *Conn.ppv())) {
__Interface<ITRiASDatabase> DBase;
if (SUCCEEDED(Conn -> get_Database (DBase.ppi()))) {
USES_CONVERSION;
CComBSTR bstrProgID; // ProgID des TRiAS-DataBase-TargetObjektes
if (SUCCEEDED(DBase -> get_Type (&bstrProgID))) {
__Interface<ITRiASDataServerRegEntries> Entries(CLSID_TRiASDataServerRegEntries);
__Interface<ITRiASDataServerRegEntry> Entry;
if (SUCCEEDED(Entries -> FindFromServerProgID (bstrProgID, Entry.ppi())))
Entry -> get_ToolboxBitmap32 ((LONG *)&dwBmp);
}
}
}
}
// Item in Baum einhängen und mit dummy [+] versehen
_ASSERTE(0 <= dwBmp && dwBmp < _countof(g_cbBmps));
HTREEITEM hRoot = *reinterpret_cast<HTREEITEM *>(pData);
HTREEITEM hItem = InsertItem(cbBuffer, g_cbBmps[dwBmp], g_cbBmps[dwBmp], hRoot, TVI_LAST);
TV_ITEM tvi;
tvi.mask = TVIF_HANDLE|TVIF_CHILDREN|TVIF_PARAM;
tvi.hItem = hItem;
tvi.cChildren = 1;
tvi.lParam = reinterpret_cast<LPARAM>(new CDataSourceItemCallback(hPr, hItem));
SetItem(&tvi);
return TRUE;
}
开发者ID:hkaiser,项目名称:TRiAS,代码行数:46,代码来源:ObjectClassStatistics.cpp
示例18: SetScrollDir
void CTuotuoTabCtrl::DragItemEnd_Dest()
{
// 如果是在自己的frame里面拖动,我们不在这个函数里面处理
if (m_bDraggingSource)
return;
// 这里做个判断,以防止梁志威的快手
if (m_nDragToPos > m_TabItems.size())
m_nDragToPos = m_TabItems.size();
SetScrollDir(0);
CTabItem *pItem = m_pDraggingItem;
m_pDraggingItem = NULL;
InsertItem(m_nDragToPos, pItem);
m_nDragToPos = -2;
EnsureVisible(pItem);
}
开发者ID:Williamzuckerberg,项目名称:chtmoneyhub,代码行数:17,代码来源:TabCtrl_Drag.cpp
示例19: InsertItem
void CFriendListCtrl::AddFriend(const CFriend* pFriend)
{
// ==> Run eMule as NT Service [leuk_he/Stulle] - Stulle
if (theApp.IsRunningAsService(SVC_LIST_OPT))
return;
// <== Run eMule as NT Service [leuk_he/Stulle] - Stulle
//Xman CodeFix
if (!theApp.emuledlg->IsRunning())
return;
//Xman end
int iItem = InsertItem(LVIF_TEXT | LVIF_PARAM, GetItemCount(), pFriend->m_strName, 0, 0, 0, (LPARAM)pFriend);
if (iItem >= 0)
UpdateFriend(iItem, pFriend);
theApp.emuledlg->chatwnd->UpdateFriendlistCount(theApp.friendlist->GetCount());
}
开发者ID:rusingineer,项目名称:eMule-scarangel,代码行数:17,代码来源:FriendListCtrl.cpp
示例20: GetItemCount
void CQueueListCtrl::AddClient(/*const*/ CUpDownClient* client, bool resetclient)
{
if (resetclient && client) {
client->SetWaitStartTime();
client->SetAskedCount(1);
}
if (!theApp.emuledlg->IsRunning())
return;
if (thePrefs.IsQueueListDisabled())
return;
int iItemCount = GetItemCount();
int iItem = InsertItem(LVIF_TEXT|LVIF_PARAM,iItemCount,LPSTR_TEXTCALLBACK,0,0,0,(LPARAM)client);
Update(iItem);
theApp.emuledlg->transferwnd->UpdateListCount(CTransferWnd::wnd2OnQueue, iItemCount+1);
}
开发者ID:BackupTheBerlios,项目名称:nextemf,代码行数:17,代码来源:QueueListCtrl.cpp
注:本文中的InsertItem函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论