您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ GetSelectedItemCount函数代码示例

51自学网 2021-06-01 21:14:49
  C++
这篇教程C++ GetSelectedItemCount函数代码示例写得很实用,希望能帮到您。

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

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

示例1: if

const GameListItem * CGameListCtrl::GetSelectedISO(){	if (m_ISOFiles.size() == 0)	{		return nullptr;	}	else if (GetSelectedItemCount() == 0)	{		return nullptr;	}	else	{		long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);		if (item == wxNOT_FOUND)		{			return nullptr;		}		else		{			// Here is a little workaround for multiselections:			// when > 1 item is selected, return info on the first one			// and deselect it so the next time GetSelectedISO() is called,			// the next item's info is returned			if (GetSelectedItemCount() > 1)				SetItemState(item, 0, wxLIST_STATE_SELECTED);			return m_ISOFiles[GetItemData(item)];		}	}}
开发者ID:Chemlo,项目名称:dolphin,代码行数:30,


示例2: WXUNUSED

void CGameListCtrl::OnDeleteGCM(wxCommandEvent& WXUNUSED (event)){	if (GetSelectedItemCount() == 1)	{		const GameListItem *iso = GetSelectedISO();		if (!iso)			return;		if (wxMessageBox(_("Are you sure you want to delete this file?  It will be gone forever!"),					wxMessageBoxCaptionStr, wxYES_NO | wxICON_EXCLAMATION) == wxYES)		{			File::Delete(iso->GetFileName());			Update();		}	}	else	{		if (wxMessageBox(_("Are you sure you want to delete these files?/nThey will be gone forever!"),					wxMessageBoxCaptionStr, wxYES_NO | wxICON_EXCLAMATION) == wxYES)		{			int selected = GetSelectedItemCount();			for (int i = 0; i < selected; i++)			{				const GameListItem *iso = GetSelectedISO();				File::Delete(iso->GetFileName());			}			Update();		}	}}
开发者ID:Everscent,项目名称:dolphin-emu,代码行数:30,


示例3: OnRemoveAll

void CQueueViewFailed::OnRemoveAll(wxCommandEvent& event){#ifndef __WXMSW__	// GetNextItem is O(n) if nothing is selected, GetSelectedItemCount() is O(1)	if (GetSelectedItemCount())#endif	{		// First, clear all selections		int item;		while ((item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED)) != -1)			SetItemState(item, 0, wxLIST_STATE_SELECTED);	}	CEditHandler* pEditHandler = CEditHandler::Get();	if (pEditHandler)		pEditHandler->RemoveAll(CEditHandler::upload_and_remove_failed);	for (std::vector<CServerItem*>::iterator iter = m_serverList.begin(); iter != m_serverList.end(); iter++)		delete *iter;	m_serverList.clear();	m_itemCount = 0;	SaveSetItemCount(0);	m_fileCount = 0;	m_folderScanCount = 0;	DisplayNumberQueuedFiles();	RefreshListOnly();	if (!m_itemCount && m_pQueue->GetQueueView()->GetItemCount())		m_pQueue->SetSelection(0);}
开发者ID:idgaf,项目名称:FileZilla3,代码行数:33,


示例4: GetSelectedItemCount

void CQueueViewBase::UpdateSelections_ItemRangeAdded(int added, int count){#ifndef __WXMSW__	// GetNextItem is O(n) if nothing is selected, GetSelectedItemCount() is O(1)	const int selection_count = GetSelectedItemCount();	if (!selection_count)		return;#endif	std::list<int> itemsToSelect;	// Go through all selected items	int item = GetNextItem(added - 1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);	while (item != -1)	{		// Select new items preceding to current one		while (!itemsToSelect.empty() && itemsToSelect.front() < item)		{			SetItemState(itemsToSelect.front(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);			itemsToSelect.pop_front();		}		if (itemsToSelect.empty())			SetItemState(item, 0, wxLIST_STATE_SELECTED);		else if (itemsToSelect.front() == item)			itemsToSelect.pop_front();		itemsToSelect.push_back(item + count);		item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);	}	for (std::list<int>::const_iterator iter = itemsToSelect.begin(); iter != itemsToSelect.end(); iter++)		SetItemState(*iter, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);}
开发者ID:ErichKrause,项目名称:filezilla,代码行数:34,


示例5: OnRightClick

void CContactListCtrl::OnRightClick(wxListEvent& e){  wxMenu menu;  if (GetSelectedItemCount() == 1) {    // Single selection    CContact& rContact = m_liEntries[e.GetIndex()];    const TPhoneList& rPhones = rContact.getConstPhones();    if (rPhones.size()) {      wxMenu *submenu = new wxMenu();      TPhoneList::const_iterator it = rPhones.begin();      for (int i = 0; it != rPhones.end() && (i < MAX_PHONES); ++it, ++i) {        submenu->Append(ID_CTX_MAKE_CALL + i,            wxString::Format(wxT("%s (%s)"), it->getNumber(),                CPhone::getNumberTypeName(it->getType())));      }      if (rPhones.size() > MAX_PHONES) {        submenu->Append(ID_CTX_SELECT_CALL, _("More..."));      }      menu.Append(ID_CTX_SELECT_CALL, _("Call..."));      menu.AppendSubMenu(submenu, _("Quick Call"));      menu.AppendSeparator();    }    menu.Append(CMD_ADD_ADDRESS, _("Add..."));    menu.Append(CMD_EDIT_ADDRESS, _("Edit..."));    menu.AppendSeparator();    menu.Append(CMD_DEL_ADDRESS, _("Delete"));  }  else {    // Multiple selection    menu.Append(CMD_ADD_ADDRESS, _("Add..."));    menu.AppendSeparator();    menu.Append(CMD_DEL_ADDRESS, _("Delete"));  }  PopupMenu(&menu);}
开发者ID:Sonderstorch,项目名称:c-mon,代码行数:35,


示例6: GetWindowStyle

void wxExListView::BuildPopupMenu(wxExMenu& menu){  menu.AppendSeparator();  menu.AppendEdit(true);    const long style = GetWindowStyle();  if (    GetItemCount() > 0 &&     GetSelectedItemCount() == 0 &&    style & wxLC_REPORT)  {    menu.AppendSeparator();    wxMenu* menuSort = new wxMenu;    for (#ifdef wxExUSE_CPP0X	      auto it = m_Columns.begin();#else      std::vector<wxExColumn>::iterator it = m_Columns.begin();#endif	        it != m_Columns.end();      ++it)    {      menuSort->Append(ID_COL_FIRST + it->GetColumn(), it->GetText());    }    menu.AppendSubMenu(menuSort, _("Sort On"));  }
开发者ID:hugofvw,项目名称:wxExtension,代码行数:30,


示例7: GetSelectedItemCount

BOOL ColourGallery::DoDeleteSelection(void){	DWORD TotalItems = GetSelectedItemCount();	IndexedColour **KillList = new IndexedColourPtr[TotalItems+1];	if (KillList == NULL)		return(FALSE);		DWORD KillIndex = 0;	SequenceItem *Ptr = FindFirstSelected();	while (Ptr != NULL)	{		KillList[KillIndex++] = (IndexedColour *) FindRealItem(Ptr);		Ptr = FindNextSelected(Ptr);	}		KillList[KillIndex] = NULL;		// NULL terminate the list	// Delete (hide, with undo actually) the given colours	ColourManager::HideColours(ColourManager::GetColourList(), KillList, TRUE);	// HideColours has made a copy of this list for itself, so we are responsible	// for deleting our original list	delete [] KillList;	return(TRUE);}
开发者ID:vata,项目名称:xarino,代码行数:28,


示例8: ClearSelection

void CMuleListCtrl::ClearSelection() {	if (GetSelectedItemCount()) {		long index = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);		while (index != -1) {			SetItemState(index, 0, wxLIST_STATE_SELECTED);			index = GetNextItem(index, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);		}	}}
开发者ID:windreamer,项目名称:amule-dlp,代码行数:10,


示例9: WXUNUSED

void CGameListCtrl::OnDeleteISO(wxCommandEvent& WXUNUSED (event)){	const wxString message = GetSelectedItemCount() == 1 ?			_("Are you sure you want to delete this file? It will be gone forever!") :			_("Are you sure you want to delete these files? They will be gone forever!");	if (wxMessageBox(message, _("Warning"), wxYES_NO | wxICON_EXCLAMATION) == wxYES)	{		for (const GameListItem* iso : GetAllSelectedISOs())			File::Delete(iso->GetFileName());		Update();	}}
开发者ID:LordNed,项目名称:dolphin,代码行数:13,


示例10: while

std::vector<int> OrderListCtrl::GetSelectedItems(){	int current = -1;	std::vector<int> items;		while (static_cast<int>(items.size()) < GetSelectedItemCount())	{		current = GetNextItem(current, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);		items.push_back(current);	}	return items;}
开发者ID:tmich,项目名称:AeronPrint,代码行数:13,


示例11: GetSelectedItemCount

void wxGxContentView::OnDeselected(wxListEvent& event){	//event.Skip();    if(GetSelectedItemCount() == 0)    {        m_pSelection->Select(m_nParentGxObjectID, false, NOTFIRESELID);    }    else    {    	LPITEMDATA pItemData = (LPITEMDATA)event.GetData();	    if(pItemData != NULL)        {            m_pSelection->Unselect(pItemData->nObjectID, NOTFIRESELID);        }    }	if(GetSelectedItemCount() == 0)    {		m_pSelection->SetInitiator(TREECTRLID);        if (m_pGxApp)            m_pGxApp->UpdateNewMenu(m_pSelection);	}    wxGISStatusBar* pStatusBar = m_pApp->GetStatusBar();    if(pStatusBar)    {        if(GetSelectedItemCount() > 1)        {            pStatusBar->SetMessage(wxString::Format(_("%d objects selected"), GetSelectedItemCount()));        }        else        {            pStatusBar->SetMessage(wxEmptyString);        }    }}
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:37,


示例12: GetNextItem

void CUnitPane::OnRClick(wxListEvent& event){    wxMenu       menu;    long         idx   = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);    CUnit      * pUnit = GetUnit(idx);    int          x=0,y;    int          width, height;    int nItems = GetSelectedItemCount();    wxDisplaySize(&width, &height);    y = event.GetPoint().y;    ClientToScreen(&x, &y);    if (height-y < 150)        y = height-150;    ScreenToClient(&x, &y);    if (nItems>1)    {        // multiple units        menu.Append(menu_Popup_IssueOrders     , wxT("Issue orders"));        menu.Append(menu_Popup_UnitFlags       , wxT("Set custom flags")    );        menu.Append(menu_Popup_AddToTracking   , wxT("Add to a tracking group"));        PopupMenu( &menu, event.GetPoint().x, y);    }    else        if (pUnit)        {            // single unit            if (pUnit->IsOurs)            {                menu.Append(menu_Popup_ShareSilv     , wxT("Share SILV")        );                menu.Append(menu_Popup_Teach         , wxT("Teach")             );                menu.Append(menu_Popup_Split         , wxT("Split")             );                menu.Append(menu_Popup_DiscardJunk   , wxT("Discard junk items"));                menu.Append(menu_Popup_GiveEverything, wxT("Give everything")   );                menu.Append(menu_Popup_DetectSpies   , wxT("Detect spies")      );            }            menu.Append(menu_Popup_UnitFlags       , wxT("Set custom flags")    );            menu.Append(menu_Popup_AddToTracking   , wxT("Add to a tracking group"));            PopupMenu( &menu, event.GetPoint().x, y);        }}
开发者ID:ennorehling,项目名称:alh,代码行数:49,


示例13: HitTest

void CGameListCtrl::OnLeftClick(wxMouseEvent& event){	// Focus the clicked item.	int flags;	long item = HitTest(event.GetPosition(), flags);	if ((item != wxNOT_FOUND) && (GetSelectedItemCount() == 0) &&			(!event.ControlDown()) && (!event.ShiftDown()))	{		SetItemState(item, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED );		SetItemState(item, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED);		wxGetApp().GetCFrame()->UpdateGUI();	}	event.Skip();}
开发者ID:Everscent,项目名称:dolphin-emu,代码行数:15,


示例14: GetSelectedItemCount

void wxGISToolExecuteView::OnDeselected(wxListEvent& event){    if(GetSelectedItemCount() == 0)        m_pSelection->Select(m_nParentGxObjectId, false, NOTFIRESELID);    wxGxObject* pObject = m_pCatalog->GetRegisterObject(event.GetData());    if(!pObject)        return;    m_pSelection->Unselect(pObject->GetId(), NOTFIRESELID);    wxGISStatusBar* pStatusBar = m_pApp->GetStatusBar();    if(pStatusBar)    {        if(GetSelectedItemCount() > 1)        {            pStatusBar->SetMessage(wxString::Format(_("%d objects selected"), GetSelectedItemCount()));        }        else        {            pStatusBar->SetMessage(wxEmptyString);        }    }}
开发者ID:GimpoByte,项目名称:nextgismanager,代码行数:24,


示例15: WXUNUSED

void CUnitPane::OnPopupMenuUnitFlags (wxCommandEvent& WXUNUSED(event)){    long         idx;    CUnit      * pUnit;    unsigned int flags = 0;    BOOL         ManyUnits = (GetSelectedItemCount() > 1);    if (!ManyUnits)    {        idx   = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);        pUnit = GetUnit(idx);        if (pUnit)            flags = pUnit->Flags;    }    CUnitFlagsDlg dlg(this, ManyUnits?eManyUnits:eThisUnit, flags & UNIT_CUSTOM_FLAG_MASK);    int rc = dlg.ShowModal();    idx   = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);    while (idx>=0)    {        pUnit = GetUnit(idx);        switch (rc)        {        case wxID_OK:            pUnit->Flags    &= ~UNIT_CUSTOM_FLAG_MASK;            pUnit->FlagsOrg &= ~UNIT_CUSTOM_FLAG_MASK;            pUnit->Flags    |= (dlg.m_UnitFlags & UNIT_CUSTOM_FLAG_MASK);            pUnit->FlagsOrg |= (dlg.m_UnitFlags & UNIT_CUSTOM_FLAG_MASK);            pUnit->FlagsLast = ~pUnit->Flags;            break;        case ID_BTN_SET_ALL_UNIT:            pUnit->Flags    |= (dlg.m_UnitFlags & UNIT_CUSTOM_FLAG_MASK);            pUnit->FlagsOrg |= (dlg.m_UnitFlags & UNIT_CUSTOM_FLAG_MASK);            pUnit->FlagsLast = ~pUnit->Flags;            break;        case ID_BTN_RMV_ALL_UNIT:            pUnit->Flags    &= ~(dlg.m_UnitFlags & UNIT_CUSTOM_FLAG_MASK);            pUnit->FlagsOrg &= ~(dlg.m_UnitFlags & UNIT_CUSTOM_FLAG_MASK);            pUnit->FlagsLast = ~pUnit->Flags;            break;        }        idx   = GetNextItem(idx, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);    }//    Update(m_pCurLand);    SetData(sel_by_no, -1, FALSE);}
开发者ID:ennorehling,项目名称:alh,代码行数:48,


示例16: BuildPopupMenu

void wxExListViewFile::BuildPopupMenu(wxExMenu& menu){  const long style = menu.GetStyle() |    (GetFileName().GetStat().IsReadOnly() ? wxExMenu::MENU_IS_READ_ONLY: 0);  menu.SetStyle(style);  wxExListViewWithFrame::BuildPopupMenu(menu);      if ( GetSelectedItemCount() == 0 &&      !GetFileName().GetStat().IsReadOnly())  {    menu.AppendSeparator();    menu.Append(wxID_ADD);  }}
开发者ID:hugofvw,项目名称:wxExtension,代码行数:16,


示例17: _

void exclusion_listctrl::popup_menu( wxMouseEvent& event ){    wxMenu      a_menu;    a_menu.Append( PU_ADD_EXCLUSION, _( "Add a new exclusion...") );    a_menu.Append( PU_EDIT_EXCLUSION, _( "Edit selected exclusion..." ) );    a_menu.Append( PU_DELETE_EXCLUSION, _( "Delete selected exclusion" ) );        // If no listctrl rows selected, then disable the menu items that require selection    if ( GetSelectedItemCount() == 0 )     {        a_menu.Enable( PU_EDIT_EXCLUSION, FALSE );        a_menu.Enable( PU_DELETE_EXCLUSION, FALSE );    }    // Show the popup menu (wxWindow::PopupMenu ), at the x,y position of the click event     PopupMenu( &a_menu, event.GetPosition() );}
开发者ID:TimofonicJunkRoom,项目名称:plucker,代码行数:18,


示例18: if

const GameListItem* CGameListCtrl::GetSelectedISO() const{	if (m_ISOFiles.size() == 0)	{		return nullptr;	}	else if (GetSelectedItemCount() == 0)	{		return nullptr;	}	else	{		long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);		if (item == wxNOT_FOUND)			return nullptr;		return m_ISOFiles[GetItemData(item)];	}}
开发者ID:LordNed,项目名称:dolphin,代码行数:18,


示例19: list

CMuleListCtrl::ItemDataList CMuleListCtrl::GetSelectedItems() const{	// Create the initial vector with as many items as are selected	ItemDataList list( GetSelectedItemCount() );		// Current item being located	unsigned int current = 0;		long pos = GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );	while ( pos != -1 ) {		wxASSERT( current < list.size() );			list[ current++ ] = GetItemData( pos );		pos = GetNextItem( pos, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );	}		return list;}
开发者ID:windreamer,项目名称:amule-dlp,代码行数:19,


示例20: GetSelectedItemCount

void CQueueViewFailed::OnContextMenu(wxContextMenuEvent& event){	wxMenu* pMenu = wxXmlResource::Get()->LoadMenu(_T("ID_MENU_QUEUE_FAILED"));	if (!pMenu)		return;#ifndef __WXMSW__	// GetNextItem is O(n) if nothing is selected, GetSelectedItemCount() is O(1)	const bool has_selection = GetSelectedItemCount() != 0;#else	const bool has_selection = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED) != -1;#endif	pMenu->Enable(XRCID("ID_REMOVE"), has_selection);	pMenu->Enable(XRCID("ID_REQUEUE"), has_selection);	PopupMenu(pMenu);	delete pMenu;}
开发者ID:idgaf,项目名称:FileZilla3,代码行数:19,


示例21: WXUNUSED

void CFriendListCtrl::OnRemoveFriend(wxCommandEvent& WXUNUSED(event)){	wxString question;	if (GetSelectedItemCount() == 1) {		question = _("Are you sure that you wish to delete the selected friend?");	} else {		question = _("Are you sure that you wish to delete the selected friends?");	}	if ( wxMessageBox( question, _("Cancel"), wxICON_QUESTION | wxYES_NO, this) == wxYES ) {		long index = GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );		while( index != -1 ) {			CFriend* cur_friend = (CFriend*)GetItemData(index);			theApp->friendlist->RemoveFriend(cur_friend);			// -1 because we changed the list and removed that item.			index = GetNextItem( -1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED );		}	}}
开发者ID:geekt,项目名称:amule,代码行数:20,


示例22: DelAddress

void CContactListCtrl::DelAddress(){  int      count;  wxString strMessage;  if ((count = GetSelectedItemCount()) == 1) {    strMessage = _("Are you sure to delete the selected contact?");  } else {    strMessage = wxString::Format(        _("Are you sure to delete the selected %d contacts?"), count);  }  if (wxMessageBox(strMessage, wxMessageBoxCaptionStr, wxICON_QUESTION|wxYES_NO) == wxYES)  {    long item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);    while (item != -1) {      if (m_pAddressbook) m_pAddressbook->deleteEntry(m_liEntries[item]);      item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);    }    Update();  }}
开发者ID:Sonderstorch,项目名称:c-mon,代码行数:20,


示例23: GetSelectedItemCount

void DataListCtrl::OnAddToView(wxCommandEvent& event){   int menu_index = event.GetId() - Menu_View_start;   int num = GetSelectedItemCount();   if (num > 0)   {      long item = -1;      for ( ;; )      {         item = GetNextItem(item,               wxLIST_NEXT_ALL,               wxLIST_STATE_SELECTED);         if ( item == -1 )            break;         AddToView(menu_index, item);      }   }}
开发者ID:takashi310,项目名称:VVD_Viewer,代码行数:20,


示例24: _

void MyResizableListCtrl::ContextSensitiveMenu( wxMouseEvent& event ){    // Make an instance of a menu.    wxMenu      a_menu;    a_menu.Append( PU_ADD_RECORD, _( "Add a new record...") );    a_menu.Append( PU_EDIT_RECORD, _( "Edit selected record..." ) );    a_menu.Append( PU_DELETE_RECORD, _( "Delete selected record" ) );    // If no listctrl rows selected, then disable the menu items that    // require selection    if ( GetSelectedItemCount() == 0 ) {        a_menu.Enable( PU_EDIT_RECORD, false );        a_menu.Enable( PU_DELETE_RECORD, false );    }    // Show the popup menu (wxWindow::PopupMenu ), at the x,y position    // of the click event    PopupMenu( &a_menu, event.GetPosition() );}
开发者ID:gitrider,项目名称:wxsj2,代码行数:20,


示例25: _

void main_listctrl::popup_menu( wxMouseEvent& event ){    wxMenu      a_menu;    a_menu.Append( PU_ADD_CHANNEL, _( "Add a new channel..." ) );    #if ( setupUSE_WIZARDS )        a_menu.Append( PU_ADD_CHANNEL_WIZARD, _( "Add a new channel using wizard..." ) );#endif            a_menu.Append( PU_CONFIGURE_CHANNEL, _( "Configure selected channel..." ) );    a_menu.Append( PU_DELETE_CHANNELS, _( "Delete selected channels" ) );    a_menu.AppendSeparator();    a_menu.Append( PU_UPDATE_SELECTED_CHANNELS, _( "Update selected channels" ) );    a_menu.Append( PU_UPDATE_DUE_CHANNELS, _( "Update all due channels" ) );    a_menu.Append( PU_UPDATE_ALL_CHANNELS, _( "Update all channels" ) );        // If no listctrl rows selected, then disable the menu items that require selection    if ( GetSelectedItemCount() == 0 )     {        a_menu.Enable( PU_CONFIGURE_CHANNEL, FALSE );        a_menu.Enable( PU_DELETE_CHANNELS, FALSE );        a_menu.Enable( PU_UPDATE_SELECTED_CHANNELS, FALSE );    }    #if ( setupUSE_DRAG_AND_DROP )        a_menu.AppendSeparator();       a_menu.Append( PU_PASTE_URL_AS_NEW_CHANNEL, _( "Paste URL as new channel" ) );    a_menu.Append( PU_PASTE_FULLNAMES_AS_NEW_SEPARATE_CHANNELS, _( "Paste files as separate new channels" ) );    // Enable/ disable this menu item, and the main frame menuitems if the thing on the     // clipboard has a text format. DF_TEXT, DF_FILENAME stands for Data Format Text,    //  Data Format Filename.    bool text_enabled       = wxTheClipboard->IsSupported( wxDF_TEXT ) ;    bool filename_enabled   = wxTheClipboard->IsSupported( wxDF_FILENAME );    a_menu.Enable( PU_PASTE_URL_AS_NEW_CHANNEL, text_enabled );    a_menu.Enable( PU_PASTE_FULLNAMES_AS_NEW_SEPARATE_CHANNELS, filename_enabled );        #endif  // setupUSE_DRAG_AND_DROP    // Show the popup menu (wxWindow::PopupMenu ), at the x,y position of the click event     PopupMenu( &a_menu, event.GetPosition() );}
开发者ID:TimofonicJunkRoom,项目名称:plucker,代码行数:41,


示例26: wxASSERT

void CQueueViewBase::UpdateSelections_ItemRangeAdded(int added, int count){    wxASSERT(GetItemCount() == m_itemCount);#ifndef __WXMSW__    // GetNextItem is O(n) if nothing is selected, GetSelectedItemCount() is O(1)    const int selection_count = GetSelectedItemCount();    if (!selection_count) {        return;    }#endif    std::deque<int> itemsToSelect;    // Go through all selected items    int item = GetNextItem(added - 1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);    while (item != -1) {        // Select new items preceding to current one        while (!itemsToSelect.empty() && itemsToSelect.front() < item) {            SetItemState(itemsToSelect.front(), wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);            itemsToSelect.pop_front();        }        if (itemsToSelect.front() == item) {            itemsToSelect.pop_front();        }        else {            SetItemState(item, 0, wxLIST_STATE_SELECTED);        }        if (item + count < GetItemCount()) {            // On generic list controls, new items may be selected by default after            // increasing the item count: Internally it sometimes keeps track            // of only unselected items.            itemsToSelect.push_back(item + count);        }        item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);    }    for (auto const& sel : itemsToSelect) {        SetItemState(sel, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);    }}
开发者ID:comutt,项目名称:FileZilla3,代码行数:41,


示例27: GetNextItem

std::list<wxString> CLocalListView::RememberSelectedItems(wxString& focused){	std::list<wxString> selectedNames;	// Remember which items were selected#ifndef __WXMSW__	// GetNextItem is O(n) if nothing is selected, GetSelectedItemCount() is O(1)	if (GetSelectedItemCount())#endif	{		int item = -1;		for (;;)		{			item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);			if (item == -1)				break;			const CLocalFileData &data = m_fileData[m_indexMapping[item]];			if (data.flags != fill)			{				if (data.dir)					selectedNames.push_back(_T("d") + data.name);				else					selectedNames.push_back(_T("-") + data.name);			}			SetSelection(item, false);		}	}	int item = GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_FOCUSED);	if (item != -1)	{		const CLocalFileData &data = m_fileData[m_indexMapping[item]];		if (data.flags != fill)			focused = data.name;		SetItemState(item, 0, wxLIST_STATE_FOCUSED);	}	return selectedNames;}
开发者ID:bartojak,项目名称:osp-filezilla,代码行数:39,


示例28: GetSelectedItemCount

void CQueueViewBase::UpdateSelections_ItemRangeRemoved(int removed, int count){#ifndef __WXMSW__    // GetNextItem is O(n) if nothing is selected, GetSelectedItemCount() is O(1)    const int selection_count = GetSelectedItemCount();    if (!selection_count)        return;#endif    SetItemState(removed, 0, wxLIST_STATE_SELECTED);    std::deque<int> itemsToUnselect;    int item = GetNextItem(removed - 1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);    while (item != -1) {        // Unselect new items preceding to current one        while (!itemsToUnselect.empty() && itemsToUnselect.front() < item - count) {            SetItemState(itemsToUnselect.front(), 0, wxLIST_STATE_SELECTED);            itemsToUnselect.pop_front();        }        if (itemsToUnselect.empty())            SetItemState(item - count, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);        else if (itemsToUnselect.front() == item - count)            itemsToUnselect.pop_front();        else            SetItemState(item - count, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);        itemsToUnselect.push_back(item);        item = GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);    }    for (auto const& unsel : itemsToUnselect) {        SetItemState(unsel, 0, wxLIST_STATE_SELECTED);    }}
开发者ID:comutt,项目名称:FileZilla3,代码行数:37,



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


C++ GetSelection函数代码示例
C++ GetSelectedItem函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。