本文整理汇总了C++中Notebook类的典型用法代码示例。如果您正苦于以下问题:C++ Notebook类的具体用法?C++ Notebook怎么用?C++ Notebook使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Notebook类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wxASSERT
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);
}
示例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);
}
}
示例3: SetPageBitmap
void clMultiBook::SetPageBitmap(size_t index, const wxBitmap& bmp)
{
Notebook* book;
size_t bookIndex;
size_t modIndex;
if(GetBookByPageIndex(index, &book, bookIndex, modIndex)) { book->SetPageBitmap(modIndex, bmp); }
}
示例4: QObject
TreeNotebookItem::TreeNotebookItem(Notebook& notebook) :
QObject(), QTreeWidgetItem(QTreeWidgetItem::Type), notebook(notebook)
{
this->setText(0, QObject::tr("Notebook")); // TODO: Notebook::getTitle()
for (const QString& sectionName : notebook.getSectionNames())
{
QTreeWidgetItem* sectionItem = new QTreeWidgetItem(SECTION_TREE_TYPE);
sectionItem->setText(0, sectionName);
this->addChild(sectionItem);
for (NotebookPage* page : notebook.getPages(sectionName))
{
Q_ASSERT(page);
this->addPageToSectionItem(*sectionItem, *page);
}
}
connect(&this->notebook, SIGNAL(pageMoved(NotebookPage*,QString,int)),
SLOT(updatePageItem(NotebookPage*,QString,int))
);
connect(&this->notebook, SIGNAL(pageRemoved(QString,NotebookPage*)),
SLOT(removePageItem(QString,NotebookPage*))
);
connect(&this->notebook, SIGNAL(sectionRenamed(QString,QString)),
SLOT(renameSection(QString,QString))
);
}
示例5: GetCurrentPage
wxWindow* clMultiBook::GetCurrentPage() const
{
Notebook* book;
size_t bookIndex;
if(GetActiveBook(&book, bookIndex)) { return book->GetCurrentPage(); }
return nullptr;
}
示例6: DoInitialize
void ZoomNavigator::DoInitialize()
{
znConfigItem data;
if ( m_config->ReadItem( &data ) ) {
m_enabled = data.IsEnabled();
}
// create tab (possibly detached)
Notebook *book = m_mgr->GetWorkspacePaneNotebook();
if( IsZoomPaneDetached() ) {
// Make the window child of the main panel (which is the grand parent of the notebook)
DockablePane *cp = new DockablePane(book->GetParent()->GetParent(), book, ZOOM_PANE_TITLE, wxNullBitmap, wxSize(200, 200));
zoompane = new wxPanel( cp );
cp->SetChildNoReparent(zoompane);
} else {
zoompane = new wxPanel( book );
book->AddPage( zoompane, ZOOM_PANE_TITLE, false);
}
m_text = new ZoomText( zoompane );
m_text->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(ZoomNavigator::OnPreviewClicked), NULL, this);
m_text->Connect(wxEVT_LEFT_DCLICK, wxMouseEventHandler(ZoomNavigator::OnPreviewClicked), NULL, this);
m_text->SetCursor(wxCURSOR_POINT_LEFT);
wxBoxSizer* bs = new wxBoxSizer( wxVERTICAL );
bs->Add( m_text, 1, wxEXPAND, 0 );
wxCheckBox* cbEnablePlugin = new wxCheckBox(zoompane, wxID_ANY, _("Enable plugin"));
cbEnablePlugin->SetValue( data.IsEnabled() );
bs->Add( cbEnablePlugin, 0, wxEXPAND);
cbEnablePlugin->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(ZoomNavigator::OnEnablePlugin), NULL, this);
zoompane->SetSizer( bs );
}
示例7: 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);
}
示例8: CHECK_PTR_RET
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();
}
}
示例9: IPlugin
SymbolViewPlugin::SymbolViewPlugin(IManager* manager)
: IPlugin(manager)
{
m_longName = _("Outline Plugin");
m_shortName = wxT("Outline");
OutlineSettings os;
os.Load();
Notebook* book = m_mgr->GetWorkspacePaneNotebook();
if(IsPaneDetached()) {
// Make the window child of the main panel (which is the grand parent of the notebook)
DockablePane* cp =
new DockablePane(book->GetParent()->GetParent(), book, _("Outline"), false, wxNullBitmap, wxSize(200, 200));
m_view = new OutlineTab(cp, m_mgr);
cp->SetChildNoReparent(m_view);
m_view->m_isEnabled = true; // Enabled when detached
} else {
m_view = new OutlineTab(book, m_mgr);
book->AddPage(m_view, _("Outline"), false);
}
EventNotifier::Get()->Bind(wxEVT_SHOW_WORKSPACE_TAB, &SymbolViewPlugin::OnToggleTab, this);
m_mgr->AddWorkspaceTab(_("Outline"));
m_mgr->GetWorkspacePaneNotebook()->Bind(wxEVT_BOOK_PAGE_CHANGED, &SymbolViewPlugin::OnPageChanged, this);
}
示例10: GetPageText
wxString clMultiBook::GetPageText(size_t page) const
{
Notebook* book;
size_t bookIndex;
size_t modIndex;
if(GetBookByPageIndex(page, &book, bookIndex, modIndex)) { return book->GetPageText(modIndex); }
return wxEmptyString;
}
示例11: SetPageText
bool clMultiBook::SetPageText(size_t page, const wxString& text)
{
Notebook* book;
size_t bookIndex;
size_t modIndex;
if(GetBookByPageIndex(page, &book, bookIndex, modIndex)) { return book->SetPageText(modIndex, text); }
return false;
}
示例12: GetPage
wxWindow* clMultiBook::GetPage(size_t index) const
{
Notebook* book;
size_t modIndex;
size_t bookIndex;
if(!GetBookByPageIndex(index, &book, bookIndex, modIndex)) { return nullptr; }
return book->GetPage(modIndex);
}
示例13: GetPageBitmap
wxBitmap clMultiBook::GetPageBitmap(size_t page) const
{
Notebook* book;
size_t bookIndex;
size_t modIndex;
if(GetBookByPageIndex(page, &book, bookIndex, modIndex)) { return book->GetPageBitmap(modIndex); }
return wxNullBitmap;
}
示例14: 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());
}
}
示例15: ASSERT
Style const &Item::style() const {
ASSERT(d);
Notebook *n = d->book();
if (n)
return n->style();
qDebug() << "Item" << this << "not connected to notebook";
// This appears to happens during item deletion. horrible, but true.
return Style::defaultStyle();
}