示例#1
0
bool clMultiBook::GetBookByPageIndex(size_t pageIndex, Notebook** book, size_t& bookIndex, size_t& modPageIndex) const
{
    std::vector<Notebook*> books = { m_leftBook, m_rightBook };
    for(size_t i = 0; i < books.size(); ++i) {
        Notebook* b = books[i];
        if(pageIndex < b->GetPageCount()) {
            *book = b;
            bookIndex = i;
            modPageIndex = pageIndex;
            return b;
        }
        pageIndex -= b->GetPageCount();
    }
    return false;
}
示例#2
0
/**
 * Ensure that the CppCheck tab is visible
 */
void CppCheckPlugin::SetTabVisible(bool clearContent)
{
    // Make sure that the Output pane is visible
    wxAuiManager *aui = m_mgr->GetDockingManager();
    if (aui) {
        wxAuiPaneInfo &info = aui->GetPane(wxT("Output View"));
        if (info.IsOk() && !info.IsShown()) {
            info.Show();
            aui->Update();
        }
    }

    // Set the focus to the CppCheck tab
    Notebook *book = m_mgr->GetOutputPaneNotebook();
    if (book->GetPageText((size_t)book->GetSelection()) != wxT("CppCheck")) {
        for (size_t i=0; i<book->GetPageCount(); i++) {
            if (book->GetPageText(i) == wxT("CppCheck")) {
                book->SetSelection(i);
                break;
            }
        }
    }

    // clear the view contents
    if ( clearContent ) {
        m_view->Clear();
        m_fileCount = m_filelist.GetCount();
        m_fileProcessed = 1;
    }
}
示例#3
0
void Cscope::DoCscopeCommand(const wxString &command, const wxString &findWhat, const wxString &endMsg)
{
	// We haven't yet found a valid cscope exe, so look for one
	wxString where;
	if ( !ExeLocator::Locate( GetCscopeExeName(), where ) ) {
		wxString msg; msg << _("I can't find 'cscope' anywhere. Please check if it's installed.") << wxT('\n')
						  << _("Or tell me where it can be found, from the menu: 'Plugins | CScope | Settings'");
		wxMessageBox( msg, _("CScope not found"), wxOK|wxCENTER|wxICON_WARNING );
		return;
	}

	//try to locate the cscope database
	wxArrayString output;

	//set the focus to the cscope tab
	Notebook *book = m_mgr->GetOutputPaneNotebook();

	//make sure that the Output pane is visible
	wxAuiManager *aui = m_mgr->GetDockingManager();
	if (aui) {
		wxAuiPaneInfo &info = aui->GetPane(wxT("Output View"));
		if (info.IsOk() && !info.IsShown()) {
			info.Show();
			aui->Update();
		}
	}

	wxString curSel = book->GetPageText((size_t)book->GetSelection());
	if (curSel != CSCOPE_NAME) {
		for (size_t i=0; i<(size_t)book->GetPageCount(); i++) {
			if (book->GetPageText(i) == CSCOPE_NAME) {
				book->SetSelection(i);
				break;
			}
		}
	}

	//create the search thread and return
	CscopeRequest *req = new CscopeRequest();
	req->SetOwner     (this    );
	req->SetCmd       (command );
	req->SetEndMsg    (endMsg  );
	req->SetFindWhat  (findWhat);
	req->SetWorkingDir(m_mgr->GetSolution()->GetSolutionFileName().GetPath(wxPATH_GET_VOLUME|wxPATH_GET_SEPARATOR));

	CScopeThreadST::Get()->Add( req );
}
示例#4
0
void SvnConsole::EnsureVisible()
{
    // Ensure that the Output View is displayed
    wxAuiPaneInfo& pi = m_plugin->GetManager()->GetDockingManager()->GetPane("Output View");
    if ( pi.IsOk() && !pi.IsShown() ) {
        pi.Show( true );
        m_plugin->GetManager()->GetDockingManager()->Update();
    }
    
    Notebook* book = m_plugin->GetManager()->GetOutputPaneNotebook();
    for(size_t i=0; i<book->GetPageCount(); i++) {
        if(this == book->GetPage(i)) {
            book->SetSelection(i);
            break;
        }
    }
}
示例#5
0
int SymbolViewPlugin::DoFindTabIndex()
{
    std::vector<wxWindow*> windows;
    Notebook *book = m_mgr->GetWorkspacePaneNotebook();
    
#if !CL_USE_NATIVEBOOK

    book->GetEditorsInOrder(windows);
    
#else
    
    for(size_t i=0; i<book->GetPageCount(); i++) {
        windows.push_back( book->GetPage(i) );
    }
    
#endif
    for(size_t i=0; i<windows.size(); i++) {
        if(windows.at(i) == m_view )
            return i;
    }
    return wxNOT_FOUND;
}