示例#1
0
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);
}
示例#2
0
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();
}
示例#3
0
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();
        }
    }
}
示例#4
0
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();
}