• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GetFirstSelectedItemPosition函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetFirstSelectedItemPosition函数的典型用法代码示例。如果您正苦于以下问题:C++ GetFirstSelectedItemPosition函数的具体用法?C++ GetFirstSelectedItemPosition怎么用?C++ GetFirstSelectedItemPosition使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetFirstSelectedItemPosition函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetFirstSelectedItemPosition

void CSitesWnd::OnSitesDelete() 
{
	fs::list <int> vItems;
	POSITION pos = GetFirstSelectedItemPosition ();

	if (pos == NULL)
		return;

	if (IDNO == MessageBox (LS (L_AREYOUSURE), LS (L_CONFIRMATION), MB_YESNO))
	{
		SetFocus ();
		return;
	}

	SetFocus ();

	pos = GetFirstSelectedItemPosition ();

	while (pos)
	{
		int iItem = GetNextSelectedItem (pos);
		vItems.add (iItem);
	}

	if (vItems.size () == 0)
		return;

	for (int i = vItems.size () - 1; i >= 0; i--)
	{
		fsSiteInfo *pSite = (fsSiteInfo*) GetItemData (vItems [i]);
		_SitesMgr.DeleteSite (pSite);
	}
}
开发者ID:andyTsing,项目名称:freedownload,代码行数:33,代码来源:SitesWnd.cpp


示例2: SetRedraw

void CSourceDirListCtrl::RemoveSelectedItems()
{
	SetRedraw(FALSE);
	//Delete all selected items
	POSITION pos = GetFirstSelectedItemPosition();
	
	int nItem = -1;
	while (pos != NULL)
	{
		nItem = GetNextSelectedItem(pos);

		DeleteItem(nItem);
		
		//Delete the previous one item will affect the pos
		pos = GetFirstSelectedItemPosition();
	}

	if(GetItemCount() <= 0)
	{
		SetHeaderCheckedState(0, CL_UNCHECKED);
	}

	SetRedraw(TRUE);
	UpdateWindow();
}
开发者ID:killbug2004,项目名称:cosps,代码行数:25,代码来源:SourceDirListCtrl.cpp


示例3: while

void CServerListCtrl::DeleteSelectedServers()
{
	//SetRedraw(FALSE);
	while (GetFirstSelectedItemPosition() != NULL)
	{
		POSITION pos = GetFirstSelectedItemPosition();
		int iItem = GetNextSelectedItem(pos);
		theApp.serverlist->RemoveServer((CServer*)GetItemData(iItem));
		DeleteItem(iItem);
	}
	ShowServerCount();
	//SetRedraw(TRUE);
	SetFocus();
	AutoSelectItem();
}
开发者ID:LjApps,项目名称:eMule-VeryCD,代码行数:15,代码来源:ServerListCtrl.cpp


示例4: GetFirstSelectedItemPosition

void CFVDownloads_Tasks::CallSelectedDownload(BOOL bPropertiesInsteadOfPass)
{
	POSITION pos = GetFirstSelectedItemPosition ();
	if (pos == NULL)
		return;

	vmsDownloadSmartPtr dld = m_vDlds [GetNextSelectedItem (pos)];

	if (pos == NULL && dld->pMgr->IsDone ())
	{
		OnFvdldLaunch ();
	}
	else if (pos == NULL && dld->pMgr->IsRunning () && _App.DownloadDialog_Use ())
	{
		if (dld->pdlg)
		{
			dld->pdlg->BringWindowToTop ();
			dld->pdlg->SetFocus ();
		}
		else
		{
			dld->AddRef ();
			_pwndDownloads->PostMessage (WM_DW_CREATEDLDDIALOG, 1, (LPARAM)(fsDownload*)dld);
		}
	}
	else
	{
		if (bPropertiesInsteadOfPass)
			ShowSelectedDldsProperties ();
		else
			OnFvdldPasstodlds ();
	}
}
开发者ID:naroya,项目名称:freedownload,代码行数:33,代码来源:FVDownloads_Tasks.cpp


示例5: GetSelectedCount

void CSitesWnd::UpdateMenu(CMenu *pMenu)
{
	int cSelected = GetSelectedCount ();

	if (cSelected == 0)
	{
		pMenu->EnableMenuItem (ID_SITES_DELETE, MF_BYCOMMAND | MF_GRAYED);
		pMenu->EnableMenuItem (ID_SITES_TEMPRORARY, MF_BYCOMMAND | MF_GRAYED);
	}
	else
	{
		POSITION pos = GetFirstSelectedItemPosition ();
		m_bSelectedIsTemp = TRUE;
		while (pos)
		{
			int iItem = GetNextSelectedItem (pos);
			fsSiteInfo *pSite = (fsSiteInfo*) GetItemData (iItem);
			if (pSite->bTemp == FALSE)
			{
				m_bSelectedIsTemp = FALSE;
				break;
			}
		}

		if (m_bSelectedIsTemp)
			pMenu->CheckMenuItem (ID_SITES_TEMPRORARY, MF_BYCOMMAND | MF_CHECKED);
	}

	if (cSelected != 1)
		pMenu->EnableMenuItem (ID_SITES_PROPERTIES, MF_BYCOMMAND | MF_GRAYED);

	pMenu->SetDefaultItem (ID_SITES_PROPERTIES);
}
开发者ID:andyTsing,项目名称:freedownload,代码行数:33,代码来源:SitesWnd.cpp


示例6: GetFirstSelectedItemPosition

void CDownloads_Deleted::OnDeletedDelete()
{
	DLDS_LIST v;
	POSITION pos = GetFirstSelectedItemPosition ();
	while (pos)
	{
		int iItem = GetNextSelectedItem (pos);
		vmsDownloadSmartPtr dld = (fsDownload*) GetItemData (iItem);
		v.push_back (dld);
	}

	if (v.size ())
	{
		if (IDYES == MessageBox (LS (L_AREYOUSURE), LS (L_CONFIRMATION), MB_ICONQUESTION | MB_YESNO))
		{
			if (_pwndDownloads->Get_DWWN () == DWWN_DELETED)
				_pwndDownloads->m_wndDeleted.ShowWindow (SW_HIDE);
			try {
				_DldsMgr.DeleteDeletedDownloads (v);
			}
			catch (...) {}
			if (_pwndDownloads->Get_DWWN () == DWWN_DELETED)
				_pwndDownloads->m_wndDeleted.ShowWindow (SW_SHOW);
		}
	}
}
开发者ID:pedia,项目名称:raidget,代码行数:26,代码来源:downloads_deleted.cpp


示例7: HitTest

int SeriesListCtrl::HitTest()
{
	int ret=-1;
	POSITION pos=GetFirstSelectedItemPosition(); 
	if(pos) ret=GetItemData(GetNextSelectedItem(pos));
	return ret;
}
开发者ID:mar80nik,项目名称:TChart,代码行数:7,代码来源:SeriesListCtrl.cpp


示例8: GetFirstSelectedItemPosition

void FolderListCtrl::OnChar(UINT chr, UINT rep_cnt, UINT flags)
{
	if (chr >= '0' && chr <= '9' || chr >= 'A' && chr <= 'Z' ||
		chr >= 'a' && chr <= 'z' || chr >= 0x100)
	{
		bool begin= search_string_.empty();

		search_string_ += static_cast<TCHAR>(chr);

		POSITION pos= GetFirstSelectedItemPosition();
		int item= GetNextSelectedItem(pos);

		int found= FindItem(search_string_, item);
		if (found < 0 && begin)
			found = FindItem(search_string_, -1);
		if (found >= 0)
		{
			UINT state= LVIS_SELECTED | LVIS_FOCUSED;
			SetItemState(found, state, state);
		}
		else
		{
			//TODO:
			// msg beep here to signal no match...
		}

		timer_ = SetTimer(1, 1000, 0);
	}
	else
		Default();
}
开发者ID:mikekov,项目名称:ExifPro,代码行数:31,代码来源:FolderListCtrl.cpp


示例9: GetFirstSelectedItemPosition

int CFileBrowserListCtrl::GetFirstSelectedItem() const
{
	POSITION	pos = GetFirstSelectedItemPosition();
	if (pos != NULL)
		return(GetNextSelectedItem(pos));
	return(-1);	// no selection
}
开发者ID:victimofleisure,项目名称:Fractice,代码行数:7,代码来源:FileBrowserListCtrl.cpp


示例10: GetFirstSelectedItemPosition

void CHostList::OnCommander()
{
	POSITION pos = GetFirstSelectedItemPosition();
	int index = GetNextSelectedItem(pos);

	if (pos < 0)
		return;

	CLIENT_INFO* info;
	info = (CLIENT_INFO*)GetItemData(index);

	CCmdDlg *dlg = NULL;

	if (m_FuncMap[info->clientid].cmd == NULL)
	{
		dlg = new CCmdDlg();
		dlg->InitModule(info->clientid);
		dlg->Create(IDD_DIALOG_CMD);

		m_FuncMap[info->clientid].cmd = dlg;
	}
	else
	{
		dlg = m_FuncMap[info->clientid].cmd;
	}

	dlg->ShowWindow(TRUE);
}
开发者ID:a3587556,项目名称:trochilus,代码行数:28,代码来源:HostList.cpp


示例11: GetFirstSelectedItemPosition

int CListCtrlEx::GetSelectedItem()
{
   // check new item and set its icon as the app icon
   POSITION p = GetFirstSelectedItemPosition();
   int nSelected = GetNextSelectedItem(p);
   return nSelected;
}
开发者ID:identity0815,项目名称:os45,代码行数:7,代码来源:ListCtrlEx.cpp


示例12: OnDeleteSeries

void SeriesListCtrl::OnDeleteSeries()
{
	POSITION pos=GetFirstSelectedItemPosition(); bool upd=false; void *x;
	if(pos)
	{
		CArray<int,const int&> ToDel; int i; CString temp; 
		while(pos) ToDel.Add(GetItemData(GetNextSelectedItem(pos)));
		qsort(ToDel.GetData(),ToDel.GetSize(),sizeof(int),compfunc);

		for(i=0;i<ToDel.GetSize();i++)
		{
			int n=ToDel[i];			
			temp.Format("Series %s contains %d points. Remove it?",Items[n].Name,Items[n].Size);
			if(AfxMessageBox(temp,MB_YESNO)==IDNO) ToDel[i]=-1;		
		}
		
		if((x=Series->GainAcsess(WRITE))!=0)
		{
			upd=true;
			SeriesProtector Protector(x); TSeriesArray& Series(Protector);
			{
				for(i=0;i<ToDel.GetSize();i++)
					if(ToDel[i]>=0) Series.DeleteItem(ToDel[i]);
			}
		}
		if(upd) UpdateSeriesList();
	}		
}
开发者ID:mar80nik,项目名称:TChart,代码行数:28,代码来源:SeriesListCtrl.cpp


示例13: GetFirstSelectedItemPosition

void KGListCtrl::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
{
	int nResult  = false;
	int nRetCode = false;

	POSITION pos = GetFirstSelectedItemPosition();
	int nItem    = GetNextSelectedItem(pos);	
	POINT  point;
	CPoint HitPoint;

	KG_PROCESS_ERROR(nItem != -1);
	::GetCursorPos(&point);
	::ScreenToClient(this->m_hWnd, &point);
	HitPoint.x = point.x;
	HitPoint.y = point.y;
	DWORD dwData = MAKELONG(point.x, point.y);
	if (nChar == 'C' && (GetAsyncKeyState(VK_CONTROL) & 0x8000))
	{
	}
	else if (nChar == 'V' && (GetAsyncKeyState(VK_CONTROL) & 0x8000))
	{
	}
	else if (nChar == VK_RETURN)
	{
		//OnLButtonDblClk(nFlags, HitPoint);
		//GetParent()->SendMessage(WM_LBUTTONDBLCLK, MK_LBUTTON, dwData);
	}
	else if (nChar == VK_DELETE)
	{
	}

	nResult = true;
Exit0:
	return;
}
开发者ID:viticm,项目名称:pap2,代码行数:35,代码来源:KGListCtrl.cpp


示例14: GetSelectionMark

void CGitProgressList::OnLvnBegindragSvnprogress(NMHDR* , LRESULT *pResult)
{
	//LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
#if 0
	int selIndex = GetSelectionMark();
	if (selIndex < 0)
		return;

	CDropFiles dropFiles; // class for creating DROPFILES struct

	int index;
	POSITION pos = GetFirstSelectedItemPosition();
	while ( (index = GetNextSelectedItem(pos)) >= 0 )
	{
		NotificationData * data = m_arData[index];

		if ( data->kind==svn_node_file || data->kind==svn_node_dir )
		{
			CString sPath = GetPathFromColumnText(data->sPathColumnText);

			dropFiles.AddFile( sPath );
		}
	}

	if (!dropFiles.IsEmpty())
	{
		dropFiles.CreateStructure();
	}
#endif
	*pResult = 0;
}
开发者ID:545546460,项目名称:TortoiseGit,代码行数:31,代码来源:GitProgressList.cpp


示例15: GetFirstSelectedItemPosition

void CDownloads_History::OnHstitemDelete()
{
	POSITION pos = GetFirstSelectedItemPosition ();
	fs::list <fsDLHistoryRecord*> v;

	while (pos)
	{
		int i = GetNextSelectedItem (pos);
		v.add ((fsDLHistoryRecord*) GetItemData (i));
	}

	if (IDCANCEL == MessageBox (LS (L_ISOKTODELETE), LS (L_CONFIRMATION),
			MB_ICONQUESTION | MB_OKCANCEL))
	{
		SetFocus ();
		return;
	}

	ShowWindow (SW_HIDE);

	try {

	for (int i = 0; i < v.size (); i++)
		_DldsMgr.m_histmgr.DeleteRecord (v [i]);

	}catch (...) {}

	ShowWindow (SW_SHOW);
	SetFocus ();
}
开发者ID:pedia,项目名称:raidget,代码行数:30,代码来源:downloads_history.cpp


示例16: GetFirstSelectedItemPosition

//
//	[protected handler] ODBCGridCtrl::OnUpdateDelete
//
void 
ODBCGridCtrl::OnUpdateDelete(CCmdUI* pCmdUI)
	{
	POSITION	pos		= GetFirstSelectedItemPosition();
	int			nIndex  = pos ? GetNextSelectedItem(pos) : -1;

	pCmdUI->Enable( (nIndex > -1) ? TRUE : FALSE );
	}
开发者ID:zqrtalent,项目名称:MercuryUI,代码行数:11,代码来源:ODBCGridCtrl.cpp


示例17: GetFirstSelectedItemPosition

void CQListCtrl::RemoveAllSelection()
{
	POSITION pos = GetFirstSelectedItemPosition();
	while (pos)
	{
		SetSelection(GetNextSelectedItem(pos), FALSE);
	}
}
开发者ID:erdincay,项目名称:ditto-clipboard,代码行数:8,代码来源:QListCtrl.cpp


示例18: GetSelectedCount

void CFileBrowserListCtrl::GetSelection(CDWordArray& SelIdx) const
{
	int	selcnt = GetSelectedCount();
	SelIdx.SetSize(selcnt);
	POSITION	pos = GetFirstSelectedItemPosition();
	for (int i = 0; i < selcnt; i++)
		SelIdx[i] = GetNextSelectedItem(pos);
}
开发者ID:victimofleisure,项目名称:Fractice,代码行数:8,代码来源:FileBrowserListCtrl.cpp


示例19: GetFirstSelectedItemPosition

void CMyListCtrl::OnLButtonDblClk(UINT nFlags, CPoint point)
{
    POSITION pos = GetFirstSelectedItemPosition();
    if (pos)
    {
        SendText(GetNextSelectedItem(pos));
    }
    CListCtrl::OnLButtonDblClk(nFlags, point);
}
开发者ID:cdesjardins,项目名称:DCom,代码行数:9,代码来源:FileClipBoardDlg.cpp


示例20: GetFirstSelectedItemPosition

// 取得当前选择的index
int CFeedIcoItemListCtrl::GetCurrSelectIndex()
{
	POSITION pos = GetFirstSelectedItemPosition();
	if ( pos != NULL )
	{
		return  GetNextSelectedItem(pos);
	}
	return -1;
}
开发者ID:techpub,项目名称:archive-code,代码行数:10,代码来源:FeedIcoItemListCtrl.cpp



注:本文中的GetFirstSelectedItemPosition函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetFirstViewPosition函数代码示例发布时间:2022-05-30
下一篇:
C++ GetFirstNode函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap