本文整理汇总了C++中CState::GetComparisonManager方法的典型用法代码示例。如果您正苦于以下问题:C++ CState::GetComparisonManager方法的具体用法?C++ CState::GetComparisonManager怎么用?C++ CState::GetComparisonManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CState
的用法示例。
在下文中一共展示了CState::GetComparisonManager方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateToolbarState
void CToolBar::UpdateToolbarState()
{
CState* pState = CContextManager::Get()->GetCurrentContext();
if (!pState)
return;
const CServer* pServer = pState->GetServer();
const bool idle = pState->IsRemoteIdle();
EnableTool(XRCID("ID_TOOLBAR_DISCONNECT"), pServer && idle);
EnableTool(XRCID("ID_TOOLBAR_CANCEL"), pServer && !idle);
EnableTool(XRCID("ID_TOOLBAR_COMPARISON"), pServer != 0);
EnableTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pServer != 0);
EnableTool(XRCID("ID_TOOLBAR_FIND"), pServer && idle);
ToggleTool(XRCID("ID_TOOLBAR_COMPARISON"), pState->GetComparisonManager()->IsComparing());
ToggleTool(XRCID("ID_TOOLBAR_SYNCHRONIZED_BROWSING"), pState->GetSyncBrowse());
bool canReconnect;
if (pServer || !idle)
canReconnect = false;
else {
CServer tmp;
canReconnect = !pState->GetLastServer().GetHost().empty();
}
EnableTool(XRCID("ID_TOOLBAR_RECONNECT"), canReconnect);
}
示例2: CloseTab
bool CContextControl::CloseTab(int tab)
{
if (!m_tabs)
return false;
if (tab < 0)
return false;
size_t i = 0;
for (i = 0; i < m_context_controls.size(); i++)
{
if (m_context_controls[i].tab_index == tab)
break;
}
if (i == m_context_controls.size())
return false;
CState* pState = m_context_controls[i].pState;
if (!pState->m_pCommandQueue->Idle())
{
if (wxMessageBoxEx(_("Cannot close tab while busy.\nCancel current operation and close tab?"), _T("FileZilla"), wxYES_NO | wxICON_QUESTION) != wxYES)
return false;
}
#ifndef __WXMAC__
// Some reparenting is being done when closing tabs. Reparenting of frozen windows isn't working
// on OS X.
wxWindowUpdateLocker lock(this);
#endif
pState->m_pCommandQueue->Cancel();
pState->GetRecursiveOperationHandler()->StopRecursiveOperation();
pState->GetComparisonManager()->SetListings(0, 0);
if (m_tabs->GetPageCount() == 2)
{
// Get rid again of tab bar
m_tabs->Disconnect(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEventHandler(CContextControl::OnTabChanged), 0, this);
int keep = tab ? 0 : 1;
m_tabs->RemovePage(keep);
size_t j;
for (j = 0; j < m_context_controls.size(); j++)
{
if (m_context_controls[j].tab_index != keep)
continue;
break;
}
m_context_controls[j].pViewSplitter->Reparent(this);
ReplaceWindow(m_tabs, m_context_controls[j].pViewSplitter);
m_context_controls[j].pViewSplitter->Show();
m_context_controls[j].tab_index = 0;
wxAuiNotebookEx *tabs = m_tabs;
m_tabs = 0;
m_context_controls[i].tab_index = -1;
m_context_controls[i].site_bookmarks.reset();
CContextManager::Get()->SetCurrentContext(m_context_controls[j].pState);
tabs->Destroy();
}
else
{
if (pState == CContextManager::Get()->GetCurrentContext())
{
int newsel = tab + 1;
if (newsel >= (int)m_tabs->GetPageCount())
newsel = m_tabs->GetPageCount() - 2;
for (size_t j = 0; j < m_context_controls.size(); j++)
{
if (m_context_controls[j].tab_index != newsel)
continue;
m_tabs->SetSelection(newsel);
CContextManager::Get()->SetCurrentContext(m_context_controls[j].pState);
}
}
for (size_t j = 0; j < m_context_controls.size(); j++)
{
if (m_context_controls[j].tab_index > tab)
m_context_controls[j].tab_index--;
}
m_context_controls[i].tab_index = -1;
m_context_controls[i].site_bookmarks.reset();
m_tabs->DeletePage(tab);
}
pState->Disconnect();
return true;
}