void MainBook::OnClosePage(NotebookEvent& e) { clWindowUpdateLocker locker( this ); int where = e.GetSelection(); if(where == wxNOT_FOUND) { return; } wxWindow *page = m_book->GetPage((size_t)where); if(page) ClosePage(page); }
void DbViewerPanel::OnPageChanged(NotebookEvent& event) { if( !m_SuppressUpdate ) { ErdPanel* pPanel = wxDynamicCast(m_mgr->GetPage( event.GetSelection() ), ErdPanel); if (pPanel) m_pThumbnail->SetCanvas( pPanel->GetCanvas() ); else m_pThumbnail->SetCanvas(NULL); } else m_SuppressUpdate = false; event.Skip(); }
void MainBook::OnPageClosing(NotebookEvent &e) { e.Skip(); LEditor *editor = dynamic_cast<LEditor*>(m_book->GetPage(e.GetSelection())); if (editor) { if (AskUserToSave(editor)) { SendCmdEvent(wxEVT_EDITOR_CLOSING, (IEditor*)editor); } else { e.Veto(); } } else { // Unknow type, ask the plugins - maybe they know about this type wxNotifyEvent closeEvent(wxEVT_NOTIFY_PAGE_CLOSING); closeEvent.SetClientData( m_book->GetPage(e.GetSelection()) ); EventNotifier::Get()->ProcessEvent(closeEvent); if( !closeEvent.IsAllowed() ) { e.Veto(); } } }
void MainBook::OnPageChanged(NotebookEvent& e) { int newSel = e.GetSelection(); if (newSel != wxNOT_FOUND && m_reloadingDoRaise) { wxWindow *win = m_book->GetPage((size_t)newSel); if(win) { SelectPage(win); //LEditor *editor = dynamic_cast<LEditor*>(win); //if(editor) { // ManagerST::Get()->UpdatePreprocessorFile(editor); //} } } e.Skip(); }