本文整理汇总了C++中GetSelectedCount函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSelectedCount函数的具体用法?C++ GetSelectedCount怎么用?C++ GetSelectedCount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSelectedCount函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: KillTimer
void CQListCtrl::OnSelectionChange(NMHDR* pNMHDR, LRESULT* pResult)
{
NMLISTVIEW *pnmv = (NMLISTVIEW *) pNMHDR;
if((pnmv->uNewState == 3) ||
(pnmv->uNewState == 1))
{
if(g_Opt.m_bAllwaysShowDescription)
{
KillTimer(TIMER_SHOW_PROPERTIES);
SetTimer(TIMER_SHOW_PROPERTIES, 300, NULL);
}
if(GetSelectedCount() > 0 )
theApp.SetStatus(NULL, FALSE);
}
if(GetSelectedCount() == this->GetItemCount())
{
if(m_allSelected == false)
{
Log(StrF(_T("List box Select All")));
GetParent()->SendMessage(NM_ALL_SELECTED, 0, 0);
m_allSelected = true;
}
}
else if(m_allSelected == true)
{
Log(StrF(_T("List box REMOVED Select All")));
m_allSelected = false;
}
}
开发者ID:erdincay,项目名称:ditto-clipboard,代码行数:32,代码来源:QListCtrl.cpp
示例2: ApplyLanguageToMenu
void CDownloads_History::OnRClick()
{
CMenu menu;
menu.LoadMenu (IDM_HISTORYITEMS);
ApplyLanguageToMenu (&menu);
CMenu *pPopup = menu.GetSubMenu (0);
if (GetSelectedCount () != 1)
{
pPopup->EnableMenuItem (ID_LAUNCH, MF_BYCOMMAND | MF_GRAYED);
pPopup->EnableMenuItem (ID_OPENFOLDER, MF_BYCOMMAND | MF_GRAYED);
pPopup->EnableMenuItem (ID_URLTOCLIPBOARD, MF_BYCOMMAND | MF_GRAYED);
}
if (GetSelectedCount () == 0)
pPopup->EnableMenuItem (ID_HSTITEM_DELETE, MF_BYCOMMAND | MF_GRAYED);
m_odmenu.Attach (&menu, FALSE);
CPoint pt (0,0);
GetCursorPos (&pt);
pPopup->TrackPopupMenu (TPM_RIGHTBUTTON | TPM_TOPALIGN | TPM_LEFTALIGN, pt.x, pt.y, this);
m_odmenu.Detach ();
menu.DestroyMenu ();
}
开发者ID:pedia,项目名称:raidget,代码行数:26,代码来源:downloads_history.cpp
示例3: _T
void CSourceDirListCtrl::OnContextMenu(CWnd* pWnd, CPoint point)
{
CMenu srcDirMenu;
srcDirMenu.CreatePopupMenu();
srcDirMenu.AppendMenu(MF_STRING, IDM_SOURCE_DIR_REMOVE, _T("Remove"));
srcDirMenu.AppendMenu(MF_STRING, IDM_SOURCE_DIR_REMOVE_ALL, _T("Remove All"));
srcDirMenu.AppendMenu(MF_SEPARATOR);
srcDirMenu.AppendMenu(MF_STRING, IDM_SOURCE_DIR_SELECT_ALL, _T("Select All\tCtrl+A"));
srcDirMenu.AppendMenu(MF_SEPARATOR);
srcDirMenu.AppendMenu(MF_STRING, IDM_SOURCE_DIR_CHECK, _T("Check"));
srcDirMenu.AppendMenu(MF_STRING, IDM_SOURCE_DIR_UNCHECK, _T("Uncheck"));
srcDirMenu.AppendMenu(MF_SEPARATOR);
srcDirMenu.AppendMenu(MF_STRING, IDM_SOURCE_DIR_OPEN_DIR, _T("Open Folder"));
//Set menu enable status
int nCount = GetSelectedCount();
if(nCount <= 0)
{
srcDirMenu.EnableMenuItem(IDM_SOURCE_DIR_REMOVE, MF_BYCOMMAND | MF_GRAYED);
srcDirMenu.EnableMenuItem(IDM_SOURCE_DIR_CHECK, MF_BYCOMMAND | MF_GRAYED);
srcDirMenu.EnableMenuItem(IDM_SOURCE_DIR_UNCHECK, MF_BYCOMMAND | MF_GRAYED);
}
if(nCount != 1)
{
srcDirMenu.EnableMenuItem(IDM_SOURCE_DIR_OPEN_DIR, MF_BYCOMMAND | MF_GRAYED);
}
srcDirMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON, point.x, point.y, this);
}
开发者ID:killbug2004,项目名称:cosps,代码行数:29,代码来源:SourceDirListCtrl.cpp
示例4: GetSelectedCount
void CLibraryFileView::OnLibraryRefreshMetadata()
{
const DWORD nTotal = GetSelectedCount();
if ( nTotal == 1 )
{
CQuickLock pLock( Library.m_pSection );
LibraryBuilder.RefreshMetadata( GetSelectedFile()->GetPath() );
return;
}
CProgressDialog dlgProgress( LoadString( ID_LIBRARY_REFRESH_METADATA ) + _T("...") );
CQuickLock pLock( Library.m_pSection );
DWORD nCompleted = 0;
POSITION posSel = StartSelectedFileLoop();
while ( CLibraryFile* pFile = GetNextSelectedFile( posSel ) )
{
CString strPath = pFile->GetPath();
dlgProgress.Progress( strPath, nCompleted++, nTotal );
LibraryBuilder.RefreshMetadata( strPath );
}
}
开发者ID:lemonxiao0,项目名称:peerproject,代码行数:26,代码来源:CtrlLibraryFileView.cpp
示例5: GetSelectedCount
// -------------------------------------------------------------------------------- //
void guPLSoListBox::CreateContextMenu( wxMenu * Menu ) const
{
wxMenuItem * MenuItem;
int SelCount = GetSelectedCount();
if( SelCount )
{
guSoListBox::CreateContextMenu( Menu );
int InsertPosition = 12;
if( !m_DisableSorting && ( m_TracksOrder == wxNOT_FOUND ) )
{
MenuItem = new wxMenuItem( Menu, ID_TRACKS_RANDOMIZE,
wxString( _( "Randomize Playlist" ) ) + guAccelGetCommandKeyCodeString( ID_PLAYER_PLAYLIST_RANDOMPLAY ),
_( "Randomize the songs in the playlist" ) );
Menu->Insert( 9, MenuItem );
InsertPosition = 13;
}
if( ( m_PLTypes.Count() == 1 ) && ( m_PLTypes[ 0 ] == guPLAYLIST_TYPE_STATIC ) )
{
MenuItem = new wxMenuItem( Menu, ID_TRACKS_DELETE, _( "Remove from Playlist" ), _( "Delete the current selected tracks" ) );
MenuItem->SetBitmap( guImage( guIMAGE_INDEX_tiny_del ) );
Menu->Insert( InsertPosition, MenuItem );
}
}
}
开发者ID:anonbeat,项目名称:guayadeque,代码行数:29,代码来源:PLSoListBox.cpp
示例6: IsItemSelected
bool CListCtrlEx::IsItemSelected()
{
if (GetSelectedCount() > 0)
return true;
else
return false;
}
开发者ID:identity0815,项目名称:os45,代码行数:7,代码来源:ListCtrlEx.cpp
示例7: OnLButtonDown
void CDrivesList::OnLButtonDown(UINT /*nFlags*/, CPoint /*point*/)
{
if (GetFocus() == this || GetSelectedCount() == 0)
{
// We simulate Ctrl-Key-Down here, so that the dialog
// can be driven with one hand (mouse) only.
const MSG *msg= GetCurrentMessage();
DefWindowProc(msg->message, msg->wParam | MK_CONTROL, msg->lParam);
}
else
{
SetFocus();
// Send a LVN_ITEMCHANGED to the parent, so that it can
// update the radio button.
NMLISTVIEW lv;
ZeroMemory(&lv, sizeof(lv));
lv.hdr.hwndFrom= m_hWnd;
lv.hdr.idFrom= GetDlgCtrlID();
lv.hdr.code= LVN_ITEMCHANGED;
GetParent()->SendMessage(WM_NOTIFY, GetDlgCtrlID(), (LPARAM)&lv);
// no further action
}
}
开发者ID:coapp-packages,项目名称:windirstat,代码行数:25,代码来源:SelectDrivesDlg.cpp
示例8: UpdateMenu
void CTorrents_Tasks::UpdateMenu(CMenu *pPopup)
{
if (GetSelectedCount () == 0)
{
pPopup->EnableMenuItem (ID_BTDLD_START, MF_BYCOMMAND | MF_GRAYED);
pPopup->EnableMenuItem (ID_BTDLD_STOP, MF_BYCOMMAND | MF_GRAYED);
pPopup->EnableMenuItem (ID_BTDLD_AUTOSTART, MF_BYCOMMAND | MF_GRAYED);
pPopup->EnableMenuItem (ID_BTDLD_DELETE, MF_BYCOMMAND | MF_GRAYED);
pPopup->EnableMenuItem (ID_BTDLD_LAUNCH, MF_BYCOMMAND | MF_GRAYED);
pPopup->EnableMenuItem (ID_BTDLD_OPENFOLDER, MF_BYCOMMAND | MF_GRAYED);
pPopup->EnableMenuItem (ID_BTDLD_PASSTODLDS, MF_BYCOMMAND | MF_GRAYED);
pPopup->EnableMenuItem (ID_BTDLD_PROPERTIES, MF_BYCOMMAND | MF_GRAYED);
}
else
{
DLDS_LIST v;
GetSelectedDownloads (v);
BOOL bRunning, bStopped, bCompleted, bAuto, bNotAuto;
vmsDownloadsListHelper::GetStat (v, &bRunning, &bStopped, &bCompleted, &bAuto, &bNotAuto);
if (bRunning == FALSE && bAuto == FALSE)
pPopup->EnableMenuItem (ID_BTDLD_STOP, MF_BYCOMMAND | MF_GRAYED);
if (bStopped == FALSE)
pPopup->EnableMenuItem (ID_BTDLD_START, MF_BYCOMMAND | MF_GRAYED);
if (v [0]->pMgr->IsDone () == FALSE)
pPopup->EnableMenuItem (ID_BTDLD_LAUNCH, MF_BYCOMMAND | MF_GRAYED);
if (bNotAuto == FALSE)
pPopup->CheckMenuItem (ID_BTDLD_AUTOSTART, MF_CHECKED | MF_BYCOMMAND);
}
}
开发者ID:naroya,项目名称:fdm,代码行数:34,代码来源:Torrents_Tasks.cpp
示例9: 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
示例10: GetSelectedCount
void CHistTracksListCtrl::InitMainMenu(BCMenu& menu)
{
int a = GetSelectedCount();
menu.EnableMenuItem(ACMD_OpenFolder, a == 1 ? MF_ENABLED : MF_GRAYED);
menu.EnableMenuItem(ACMD_History, a == 1 ? MF_ENABLED : MF_GRAYED);
}
开发者ID:KurzedMetal,项目名称:Jaangle,代码行数:7,代码来源:HistTracksListCtrl.cpp
示例11: GetSelectedItem
Item* BrowseTileListBox::GetSelectedItem()
{
if(GetItemCount() == 0 || GetSelectedCount() == 0)
return nullptr;
return edit_tile->getTopSelectedItem();
}
开发者ID:TheSumm,项目名称:rme,代码行数:7,代码来源:browse_tile_window.cpp
示例12: OnLibraryCreateTorrent
void CLibraryFileView::OnLibraryCreateTorrent()
{
if ( GetSelectedCount() == 1 && Settings.BitTorrent.DefaultTracker.GetLength() > 10 )
{
CSingleLock pLock( &Library.m_pSection, TRUE );
if ( CLibraryFile* pFile = GetSelectedFile() )
{
CString strPath = pFile->GetPath();
pLock.Unlock();
if ( ! strPath.IsEmpty() )
{
CString strCommandLine = _T(" -sourcefile \"") + strPath + _T("\" -destination \"") +
Settings.Downloads.TorrentPath + _T("\" -tracker \"") + Settings.BitTorrent.DefaultTracker + _T("\"");
ShellExecute( GetSafeHwnd(), _T("open"), Settings.BitTorrent.TorrentCreatorPath, strCommandLine, NULL, SW_SHOWNORMAL );
return;
}
}
}
ShellExecute( GetSafeHwnd(), _T("open"), Settings.BitTorrent.TorrentCreatorPath, NULL, NULL, SW_SHOWNORMAL );
}
开发者ID:lemonxiao0,项目名称:peerproject,代码行数:25,代码来源:CtrlLibraryFileView.cpp
示例13: pLock
void CLibraryFileView::OnLibraryURL()
{
CSingleLock pLock( &Library.m_pSection, TRUE );
if ( GetSelectedCount() == 1 )
{
CLibraryFile* pFile = GetSelectedFile();
if ( ! pFile ) return;
CURLCopyDlg dlg;
dlg.Add( pFile );
pLock.Unlock();
dlg.DoModal();
}
else
{
CURLExportDlg dlg;
POSITION posSel = StartSelectedFileLoop();
while ( CLibraryFile* pFile = GetNextSelectedFile( posSel ) )
{
dlg.Add( pFile );
}
pLock.Unlock();
dlg.DoModal();
}
}
开发者ID:lemonxiao0,项目名称:peerproject,代码行数:32,代码来源:CtrlLibraryFileView.cpp
示例14: if
void CTDCTaskListCtrl::OnListSelectionChange(NMLISTVIEW* /*pNMLV*/)
{
// only called for the list that currently has the focus
// notify parent of selection change
// Unless:
// 1. The up/down cursor key is still pressed
// OR
// 2. The mouse button is down, over an item,
// the selection is empty, and the CTRL
// key is not pressed. ie. the user is in
// the middle of selecting a new item
if (Misc::IsCursorKeyPressed(MKC_UPDOWN))
{
// don't notify
}
else if (Misc::IsKeyPressed(VK_LBUTTON) &&
HitTestTask(GetMessagePos()) &&
!Misc::IsKeyPressed(VK_CONTROL) &&
!GetSelectedCount())
{
// don't notify
}
else if (!IsBoundSelecting() || (m_lcColumns.GetSelectedCount() <= 2))
{
NotifyParentSelChange();
}
}
开发者ID:Fox-Heracles,项目名称:TodoList,代码行数:28,代码来源:TDCTaskListCtrl.cpp
示例15: OnUpdateMusicBrainzLookup
void CLibraryFileView::OnUpdateMusicBrainzLookup(CCmdUI* pCmdUI)
{
if ( m_bGhostFolder || GetSelectedCount() != 1 || m_bRequestingService )
{
pCmdUI->Enable( FALSE );
return;
}
CSingleLock pLock( &Library.m_pSection );
if ( ! pLock.Lock( 200 ) ) return;
CLibraryFile* pFile = GetSelectedFile();
if ( ! pFile->IsSchemaURI( CSchema::uriAudio ) || pFile->m_pMetadata == NULL )
{
pCmdUI->Enable( FALSE );
return;
}
CMetaList* pMetaList = new CMetaList();
pMetaList->Setup( pFile->m_pSchema, FALSE );
pMetaList->Combine( pFile->m_pMetadata );
pLock.Unlock();
pCmdUI->Enable( pMetaList->IsMusicBrainz() );
delete pMetaList;
}
开发者ID:lemonxiao0,项目名称:peerproject,代码行数:28,代码来源:CtrlLibraryFileView.cpp
示例16: OnUpdateLibraryShared
void CLibraryFileView::OnUpdateLibraryShared(CCmdUI* pCmdUI)
{
if ( GetSelectedCount() < 1 )
{
pCmdUI->Enable( FALSE );
pCmdUI->SetCheck( FALSE );
return;
}
TRISTATE bShared = TRI_UNKNOWN;
CSingleLock pLock( &Library.m_pSection );
if ( pLock.Lock( 100 ) )
{
POSITION posSel = StartSelectedFileLoop();
while ( CLibraryFile* pFile = GetNextSelectedFile( posSel ) )
{
if ( bShared == TRI_UNKNOWN )
{
bShared = pFile->IsShared() ? TRI_TRUE : TRI_FALSE;
}
else if ( ( bShared == TRI_TRUE ) != pFile->IsShared() )
{
pCmdUI->Enable( FALSE );
return;
}
}
pLock.Unlock();
}
pCmdUI->Enable( TRUE );
pCmdUI->SetCheck( bShared == TRI_TRUE );
}
开发者ID:lemonxiao0,项目名称:peerproject,代码行数:33,代码来源:CtrlLibraryFileView.cpp
示例17: GetSelectedCount
void CFeedIcoItemListCtrl::UpdateMenuState(CTitleMenu & menuRSS)
{
if( !CGlobalVariable::IsRunning() )
{
return;
}
//设置菜单状态
int iSelectedItems = GetSelectedCount();
if(iSelectedItems && iSelectedItems == 1)
{
int nIndex = GetCurrSelectIndex();
if ( nIndex >= 0 )
{
if ( CRssFeed* pFeed = GetFeed(nIndex) )
{
//删除不用的menu项
menuRSS.DeleteMenu(MP_OPEN,MF_STRING);
menuRSS.DeleteMenu(MP_RESUME,MF_STRING);
//下载所有||暂停
if (pFeed->ExistDownloadingItem())
{
menuRSS.EnableMenuItem(MP_PAUSE, MF_ENABLED);
}
if (pFeed->ExistUnloadItem())
{
menuRSS.EnableMenuItem(MP_DOWNLOAD_ALL, MF_ENABLED);
}
menuRSS.EnableMenuItem(MP_CANCEL, MF_ENABLED);
menuRSS.EnableMenuItem(MP_REFRESH, MF_ENABLED);
menuRSS.EnableMenuItem(MP_OPTIONS, MF_ENABLED);
menuRSS.EnableMenuItem(MP_OPENFOLDER, MF_ENABLED);
}
}
}
else//空白处右键
{
menuRSS.DeleteMenu(MP_OPEN,MF_STRING);
menuRSS.DeleteMenu(MP_OPENFOLDER,MF_STRING);
menuRSS.DeleteMenu(MP_DOWNLOAD_ALL,MF_STRING);
menuRSS.DeleteMenu(MP_RESUME,MF_STRING);
menuRSS.DeleteMenu(MP_PAUSE,MF_STRING);
menuRSS.DeleteMenu(MP_CANCEL,MF_STRING);
menuRSS.DeleteMenu(MP_OPTIONS,MF_STRING);
//menuRSS.DeleteMenu(MF_SEPARATOR,MF_STRING);
if ( this->GetItemCount() > 0 )
{
menuRSS.EnableMenuItem(MP_REFRESH, MF_ENABLED);
}
else
{
menuRSS.DeleteMenu(MP_REFRESH,MF_STRING);
}
}
}
开发者ID:techpub,项目名称:archive-code,代码行数:59,代码来源:FeedIcoItemListCtrl.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 CFVDownloads_Tasks::UpdateActiveDownload(int adjSelected)
{
try
{
POSITION pos = GetFirstSelectedItemPosition ();
vmsDownloadSmartPtr dld;
if (pos && GetSelectedCount () == 1)
{
int iItem = GetNextSelectedItem (pos);
iItem += adjSelected;
if (iItem < 0)
iItem = 0;
else if (iItem >= GetItemCount ())
iItem = GetItemCount () - 1;
dld = m_vDlds [iItem];
}
else
{
int iItem = GetSelectionMark ();
if (iItem == -1)
dld = NULL;
else
{
iItem += adjSelected;
if (iItem < 0)
iItem = 0;
else if (iItem >= GetItemCount ())
iItem = GetItemCount () - 1;
dld = m_vDlds [iItem];
}
}
if (dld != m_pActiveDownload)
{
m_pActiveDownload = dld;
_pwndFVDownloads->SetActiveDownload (m_pActiveDownload);
}
}
catch (const std::exception& ex)
{
ASSERT (FALSE);
vmsLogger::WriteLog("CFVDownloads_Tasks::UpdateActiveDownload " + std::string(ex.what()));
}
catch (...)
{
ASSERT (FALSE);
vmsLogger::WriteLog("CFVDownloads_Tasks::UpdateActiveDownload unknown exception");
}
}
开发者ID:naroya,项目名称:freedownload,代码行数:58,代码来源:FVDownloads_Tasks.cpp
示例20: SetCapture
BOOL CDragVirtualListCtrl::OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult)
{
// NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
m_Dragging = TRUE;
SetCapture();
int ResID = GetSelectedCount() > 1 ? IDC_DRAG_MULTI : IDC_DRAG_SINGLE;
SetCursor(AfxGetApp()->LoadCursor(ResID));
*pResult = 0;
return(FALSE); // let parent handle notification too
}
开发者ID:victimofleisure,项目名称:FFRend,代码行数:10,代码来源:DragVirtualListCtrl.cpp
注:本文中的GetSelectedCount函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论