当前位置: 首页>>代码示例>>C++>>正文


C++ Notebook::GetSelection方法代码示例

本文整理汇总了C++中Notebook::GetSelection方法的典型用法代码示例。如果您正苦于以下问题:C++ Notebook::GetSelection方法的具体用法?C++ Notebook::GetSelection怎么用?C++ Notebook::GetSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Notebook的用法示例。


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

示例1: SetTabVisible

/**
 * 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;
    }
}
开发者ID:HTshandou,项目名称:codelite,代码行数:33,代码来源:cppchecker.cpp

示例2: ToggleOutputPane

void PluginManager::ToggleOutputPane(const wxString& selectedWindow)
{
    if(ManagerST::Get()->IsPaneVisible(wxT("Output View"))) {
        if(!selectedWindow.IsEmpty()) {
            wxString selectedTabName;
            Notebook* book = clMainFrame::Get()->GetOutputPane()->GetNotebook();
            int where = book->GetSelection();
            if(where != wxNOT_FOUND) {
                selectedTabName = book->GetPageText(where);
            }
            if(selectedTabName == selectedWindow) {
                // The requested tab is already selected, just hide the pane
                ManagerST::Get()->HidePane("Output View");
            } else {
                // The output pane is visible, but the selected tab is not the one we wanted
                // Select it
                ManagerST::Get()->ShowOutputPane(selectedWindow);
            }
        } else {
            // The output pane is visible and the selected tab is the one we requested
            // So just hide it
            ManagerST::Get()->HidePane("Output View");
        }
    } else {
        // The output pane is hidden, show it and select the requested tab
        ManagerST::Get()->ShowOutputPane(selectedWindow);
    }
}
开发者ID:lpc1996,项目名称:codelite,代码行数:28,代码来源:pluginmanager.cpp

示例3: OnFocus

void clMultiBook::OnFocus(wxFocusEvent& e)
{
    e.Skip();
    wxWindow* focusedWindow = wxWindow::FindFocus();
    CHECK_PTR_RET(focusedWindow);

    wxWindow* parent = focusedWindow->GetParent();
    while(parent) {
        Notebook* book = dynamic_cast<Notebook*>(parent);
        if(book && IsOurNotebook(book)) {
            // This book is one of ours...
            int index = book->GetSelection();
            if(index != wxNOT_FOUND) {
                int oldSelection = m_selection;
                m_selection = BookIndexToGlobalIndex(book, index);
                if((m_selection != wxNOT_FOUND) && (m_selection != oldSelection)) {
                    // Selection has changed, notify about this
                    wxBookCtrlEvent event(wxEVT_BOOK_PAGE_CHANGED);
                    event.SetEventObject(this);
                    event.SetSelection(m_selection);
                    event.SetOldSelection(oldSelection);
                    GetEventHandler()->ProcessEvent(event);
                }
            }
            break;
        }
        parent = parent->GetParent();
    }
}
开发者ID:lpc1996,项目名称:codelite,代码行数:29,代码来源:clMultiBook.cpp

示例4: OnToggleHoldOpen

void OutputTabWindow::OnToggleHoldOpen(wxCommandEvent& e)
{
    int sel = wxNOT_FOUND;
    Notebook* book = clMainFrame::Get()->GetOutputPane()->GetNotebook();
    if(book && (sel = book->GetSelection()) != wxNOT_FOUND) {
        EditorConfigST::Get()->SetPaneStickiness(book->GetPageText(sel), e.IsChecked());
    }
}
开发者ID:huanghjb,项目名称:codelite,代码行数:8,代码来源:outputtabwindow.cpp

示例5: SetSelection

int clMultiBook::SetSelection(size_t tabIdx)
{
    Notebook* book;
    size_t bookIndex;
    size_t modIndex;
    if(GetBookByPageIndex(tabIdx, &book, bookIndex, modIndex)) {
        // Update the current selection
        bool pageChanged = (m_selection != (int)tabIdx);

        // Grab a pointer of the page we want to make active
        wxWindow* focusedPage = book->GetPage(modIndex);

        // And perform the actual selection change
        int oldSelection = book->GetSelection();
        if(oldSelection != (int)modIndex) {
            m_selection = tabIdx;
            m_history->Pop(focusedPage);
            m_history->Push(focusedPage);
            return book->SetSelection(modIndex);
        } else {
            // There is no point on calling Notebook::SetSelection since it is already selected
            // However, in the term of 'multi book' control, we might need to generate the events ourselves here
            // But only if we actually modified the selection
            if(pageChanged) {
                wxBookCtrlEvent changingEvent(wxEVT_BOOK_PAGE_CHANGING);
                changingEvent.SetEventObject(this);
                changingEvent.SetOldSelection(m_selection);
                changingEvent.SetSelection(tabIdx);
                GetEventHandler()->ProcessEvent(changingEvent);
                if(!changingEvent.IsAllowed()) { return wxNOT_FOUND; } // User vetoed
                
                // Update the history
                m_history->Pop(focusedPage);
                m_history->Push(focusedPage);
                
                // Update the selection before we fire the event again
                // Or we might end up with stackoverflow...
                m_selection = tabIdx;
                wxBookCtrlEvent changedEvent(wxEVT_BOOK_PAGE_CHANGED);
                changedEvent.SetEventObject(this);
                changedEvent.SetOldSelection(m_selection);
                changedEvent.SetSelection(tabIdx);
                GetEventHandler()->ProcessEvent(changedEvent);
            }
        }
    }
    return wxNOT_FOUND;
}
开发者ID:lpc1996,项目名称:codelite,代码行数:48,代码来源:clMultiBook.cpp

示例6: DoCscopeCommand

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 );
}
开发者ID:RVictor,项目名称:EmbeddedLite,代码行数:47,代码来源:cscope.cpp

示例7: OnActiveEditorChanged

void WorkspaceTab::OnActiveEditorChanged(wxCommandEvent& e)
{
    e.Skip();
    if(m_isLinkedToEditor) {
        MainBook* mainbook = clMainFrame::Get()->GetMainBook();
        LEditor* editor = mainbook->GetActiveEditor();
        if(editor && !editor->GetProject().IsEmpty()) {
            m_fileView->ExpandToPath(editor->GetProject(), editor->GetFileName());
        }

        Notebook* book = clMainFrame::Get()->GetWorkspacePane()->GetNotebook();
        if(book) {
            size_t index = book->GetPageIndex("wxCrafter");
            if(index == (size_t)book->GetSelection()) {
                book->SetSelection(0); // The most likely to be wanted
            }
        }
    }
}
开发者ID:05storm26,项目名称:codelite,代码行数:19,代码来源:workspacetab.cpp


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