本文整理汇总了C++中GetSelectedCount函数的典型用法代码示例。如果您正苦于以下问题:C++ GetSelectedCount函数的具体用法?C++ GetSelectedCount怎么用?C++ GetSelectedCount使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetSelectedCount函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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 ();
}
示例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);
}
示例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 );
}
}
示例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 );
}
}
}
示例6: IsItemSelected
bool CListCtrlEx::IsItemSelected()
{
if (GetSelectedCount() > 0)
return true;
else
return false;
}
示例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
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例11: GetSelectedItem
Item* BrowseTileListBox::GetSelectedItem()
{
if(GetItemCount() == 0 || GetSelectedCount() == 0)
return nullptr;
return edit_tile->getTopSelectedItem();
}
示例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 );
}
示例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();
}
}
示例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();
}
}
示例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;
}