本文整理汇总了C++中Notebook::GetPageIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ Notebook::GetPageIndex方法的具体用法?C++ Notebook::GetPageIndex怎么用?C++ Notebook::GetPageIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notebook
的用法示例。
在下文中一共展示了Notebook::GetPageIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxASSERT
void
CMakePlugin::UnPlug()
{
wxASSERT(m_mgr);
Notebook* notebook = m_mgr->GetWorkspacePaneNotebook();
wxASSERT(notebook);
size_t pos = notebook->GetPageIndex("CMake Help");
if (pos != Notebook::npos) {
CMakeHelpTab* helpTab = dynamic_cast<CMakeHelpTab*>( notebook->GetPage(pos) );
if ( helpTab ) {
helpTab->Stop();
}
notebook->RemovePage(pos);
}
// Unbind events
wxTheApp->Unbind(wxEVT_COMMAND_MENU_SELECTED, &CMakePlugin::OnSettings, this, XRCID("cmake_settings"));
EventNotifier::Get()->Unbind(wxEVT_CMD_PROJ_SETTINGS_SAVED, wxCommandEventHandler(CMakePlugin::OnSaveConfig), this);
EventNotifier::Get()->Unbind(wxEVT_GET_PROJECT_BUILD_CMD, clBuildEventHandler(CMakePlugin::OnGetBuildCommand), this);
EventNotifier::Get()->Unbind(wxEVT_GET_PROJECT_CLEAN_CMD, clBuildEventHandler(CMakePlugin::OnGetCleanCommand), this);
EventNotifier::Get()->Unbind(wxEVT_GET_IS_PLUGIN_MAKEFILE, clBuildEventHandler(CMakePlugin::OnGetIsPluginMakefile), this);
EventNotifier::Get()->Unbind(wxEVT_PLUGIN_EXPORT_MAKEFILE, clBuildEventHandler(CMakePlugin::OnExportMakefile), this);
EventNotifier::Get()->Unbind(wxEVT_WORKSPACE_LOADED, wxCommandEventHandler(CMakePlugin::OnWorkspaceLoaded), this);
}
示例2: UnPlug
void CMakePlugin::UnPlug()
{
wxASSERT(m_mgr);
Notebook* notebook = m_mgr->GetWorkspacePaneNotebook();
wxASSERT(notebook);
int pos = notebook->GetPageIndex("CMake Help");
if(pos != wxNOT_FOUND) {
CMakeHelpTab* helpTab = dynamic_cast<CMakeHelpTab*>(notebook->GetPage(pos));
if(helpTab) {
helpTab->Stop();
}
notebook->RemovePage(pos);
}
// Unbind events
wxTheApp->Unbind(wxEVT_COMMAND_MENU_SELECTED, &CMakePlugin::OnSettings, this, XRCID("cmake_settings"));
EventNotifier::Get()->Unbind(wxEVT_SHOW_WORKSPACE_TAB, &CMakePlugin::OnToggleHelpTab, this);
EventNotifier::Get()->Unbind(wxEVT_CONTEXT_MENU_PROJECT, &CMakePlugin::OnProjectContextMenu, this);
EventNotifier::Get()->Unbind(wxEVT_CONTEXT_MENU_WORKSPACE, &CMakePlugin::OnWorkspaceContextMenu, this);
EventNotifier::Get()->Unbind(wxEVT_PROJ_FILE_ADDED, &CMakePlugin::OnFileAdded, this);
EventNotifier::Get()->Unbind(wxEVT_PROJ_FILE_REMOVED, &CMakePlugin::OnFileRemoved, this);
Unbind(wxEVT_ASYNC_PROCESS_OUTPUT, &CMakePlugin::OnCMakeOutput, this);
Unbind(wxEVT_ASYNC_PROCESS_TERMINATED, &CMakePlugin::OnCMakeTerminated, this);
}
示例3: OnModified
void Edit::OnModified(wxStyledTextEvent& WXUNUSED(event))
{
if (m_modified) {
return;
}
Notebook* notebook = static_cast<Notebook*>(GetParent());
const int page_index = notebook->GetPageIndex(this);
if (page_index > -1) {
wxString page_text = notebook->GetPageText(page_index);
page_text += wxT('*');
notebook->SetPageText(page_index, page_text);
m_modified = true;
}
}
示例4: 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
}
}
}
}
示例5: SaveFile
bool Edit::SaveFile(const wxString &filename) {
// return if no change
if (!Modified()) return true;
if (m_modified) {
Notebook* notebook = static_cast<Notebook*>(GetParent());
const int page_index = notebook->GetPageIndex(this);
if (page_index > -1) {
wxString page_text = notebook->GetPageText(page_index);
if (page_text.EndsWith(wxT('*'))) {
page_text.RemoveLast();
notebook->SetPageText(page_index, page_text);
}
m_modified = false;
}
}
return wxStyledTextCtrl::SaveFile(filename);
}