示例#1
0
/// Apply the styles when a different tab is selected, so the previews are
/// up to date
void wxRichTextFormattingDialog::OnTabChanged(wxBookCtrlEvent& event)
{
    if (m_ignoreUpdates)
        return;

    if (GetBookCtrl() != event.GetEventObject())
    {
        event.Skip();
        return;
    }

    int oldPageId = event.GetOldSelection();
    if (oldPageId != -1)
    {
        wxWindow* page = GetBookCtrl()->GetPage(oldPageId);
        if (page)
            page->TransferDataFromWindow();
    }

    int pageId = event.GetSelection();
    if (pageId != -1)
    {
        wxWindow* page = GetBookCtrl()->GetPage(pageId);
        if (page)
            page->TransferDataToWindow();
    }
}
示例#2
0
void wxNotebook::OnSelChange(wxBookCtrlEvent& event)
{
    // is it our tab control?
    if ( event.GetEventObject() == this )
        ChangePage(event.GetOldSelection(), event.GetSelection());

    // we want to give others a chance to process this message as well
    event.Skip();
}
示例#3
0
void MainFrame::OnPageChanging(wxBookCtrlEvent& event)
{
    event.Skip();
    wxString message;
    message << "Page changing event. Selection=" << event.GetSelection();
    m_log->AppendText(message + "\n");
    // if(wxMessageBox("Allow?", "You can veto", wxYES_NO | wxCENTER | wxICON_QUESTION) != wxYES) {
    //    event.Veto();
    //}
}
示例#4
0
void wxNotebook::OnSelChange (
  wxBookCtrlEvent&                  rEvent
)
{
    //
    // Is it our tab control?
    //
    if (rEvent.GetEventObject() == this)
    {
        int   nPageCount = GetPageCount();
        int   nSel;
        ULONG ulOS2Sel = (ULONG)rEvent.GetOldSelection();
        bool  bFound = false;

        for (nSel = 0; nSel < nPageCount; nSel++)
        {
            if (ulOS2Sel == (ULONG)m_alPageId[nSel])
            {
                bFound = true;
                break;
            }
        }

        if (!bFound)
            return;

        m_pages[nSel]->Show(false);

        ulOS2Sel = (ULONG)rEvent.GetSelection();

        bFound = false;

        for (nSel = 0; nSel < nPageCount; nSel++)
        {
            if (ulOS2Sel == (ULONG)m_alPageId[nSel])
            {
                bFound = true;
                break;
            }
        }

        if (!bFound)
            return;

        wxNotebookPage*         pPage = m_pages[nSel];

        pPage->Show(true);
        m_nSelection = nSel;
    }

    //
    // We want to give others a chance to process this message as well
    //
    rEvent.Skip();
} // end of wxNotebook::OnSelChange
示例#5
0
void FindResultsTab::OnPageClosing(wxBookCtrlEvent& e)
{
    e.Skip();
    if(m_searchInProgress) {
        ::wxMessageBox(_("Can not close the search tab while a search is in progress"),
                       "CodeLite",
                       wxICON_WARNING | wxOK | wxCENTER);
        e.Veto();
        return;
    }
}
示例#6
0
void DebuggerPane::OnPageChanged(wxBookCtrlEvent& event)
{
    if(m_initDone && DebuggerMgr::Get().GetActiveDebugger() && DebuggerMgr::Get().GetActiveDebugger()->IsRunning()) {
        if(event.GetEventObject() == m_book) {
            ManagerST::Get()->CallAfter(&Manager::UpdateDebuggerPane);
        } else {
            event.Skip();
        }
    } else {
        event.Skip();
    }
}
示例#7
0
void DbViewerPanel::OnPageChanged(wxBookCtrlEvent& 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();
}
示例#8
0
void MainFrame::OnPageChanged(wxBookCtrlEvent& event)
{
    event.Skip();
    wxString message;
    message << "Page changed event. Old=" << event.GetOldSelection() << ". New: =" << event.GetSelection();
    m_log->AppendText(message + "\n");
    wxWindow* curpage = m_book->GetCurrentPage();
    int sel = m_book->FindPage(curpage);
    if(sel != event.GetSelection()) {
        wxMessageBox("FATAL ERROR: current page does not match the selection!!",
                     "Notebook Demo",
                     wxICON_ERROR | wxOK | wxCENTER);
    }
}
示例#9
0
void DbViewerPanel::OnPageClosing(wxBookCtrlEvent& event)
{
    m_SuppressUpdate = true;
    m_pThumbnail->SetCanvas(NULL);

    event.Skip();
}
示例#10
0
void LibraryPanel::OnPageChanging(wxBookCtrlEvent& event)
{
	ee::LibraryPanel::OnPageChanging(event);

	Layer* curr = static_cast<LibraryPage*>(GetCurrPage())->GetLayer();
	curr->SetEditable(false);
	static_cast<LibraryPage*>(m_pages[event.GetSelection()])->UpdateStatusFromLayer();
}
示例#11
0
void MainFrame::OnPageClosing(wxBookCtrlEvent& event)
{
    m_log->AppendText(wxString() << "Page: " << event.GetSelection() << " is being closed"
                      << "\n");
    // if(wxMessageBox("Allow?", "You can veto", wxYES_NO | wxCENTER | wxICON_QUESTION) != wxYES) {
    //    event.Veto();
    //}
}
示例#12
0
void FindResultsTab::OnClosePage(wxBookCtrlEvent& e)
{
    int where = e.GetSelection();
    if(where == wxNOT_FOUND) {
        return;
    }
    m_book->DeletePage((size_t)where);
}
示例#13
0
void MainBook::OnClosePage(wxBookCtrlEvent& 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);
}
示例#14
0
void CSearchDlg::OnSearchClosing(wxBookCtrlEvent& evt)
{
	// Abort global search if it was last tab that was closed.
	if ( evt.GetSelection() == ((int)m_notebook->GetPageCount() - 1 ) ) {
		OnBnClickedStop(nullEvent);
	}

	CSearchListCtrl *ctrl = dynamic_cast<CSearchListCtrl*>(m_notebook->GetPage(evt.GetSelection()));
	wxASSERT(ctrl);
	// Zero to avoid results added while destructing.
	ctrl->ShowResults(0);
	theApp->searchlist->RemoveResults(ctrl->GetSearchId());

	// Do cleanups if this was the last tab
	if ( m_notebook->GetPageCount() == 1 ) {
		FindWindow(IDC_SDOWNLOAD)->Enable(FALSE);
		FindWindow(IDC_CLEAR_RESULTS)->Enable(FALSE);
	}
}
示例#15
0
void MainBook::OnTabLabelContextMenu(wxBookCtrlEvent& e)
{
    e.Skip();
    wxWindow* tabCtrl = static_cast<wxWindow*>(e.GetEventObject());
    if((e.GetSelection() == m_book->GetSelection()) && (tabCtrl->GetParent() == m_book)) {
        // we only show context menu for the active tab
        e.Skip(false);
        wxMenu* contextMenu = wxXmlResource::Get()->LoadMenu(wxT("editor_tab_right_click"));

        // Notify the plugins about the tab label context menu
        clContextMenuEvent event(wxEVT_CONTEXT_MENU_TAB_LABEL);
        event.SetMenu(contextMenu);
        EventNotifier::Get()->ProcessEvent(event);

        contextMenu = event.GetMenu();
        tabCtrl->PopupMenu(contextMenu);
        wxDELETE(contextMenu);
    }
}
示例#16
0
void LibraryPanel::OnPageChanged(wxBookCtrlEvent& event)
{
	ee::LibraryPanel::OnPageChanged(event);

	Layer* curr = static_cast<LibraryPage*>(GetCurrPage())->GetLayer();
	ee::ChangeLayerMgrSJ::Instance()->Change(curr->GetLayerMgr());
	curr->SetEditable(true);
	static_cast<LibraryPage*>(m_pages[event.GetSelection()])->UpdateStatusFromLayer();

	Refresh();
}
示例#17
0
void MainBook::OnPageChanged(wxBookCtrlEvent& e)
{
    e.Skip();
    int newSel = e.GetSelection();
    if(newSel != wxNOT_FOUND && m_reloadingDoRaise) {
        wxWindow* win = m_book->GetPage((size_t)newSel);
        if(win) {
            SelectPage(win);
        }
    }

    // Cancel any tooltip
    LEditor::Vec_t editors;
    GetAllEditors(editors, MainBook::kGetAll_IncludeDetached);
    for(size_t i = 0; i < editors.size(); ++i) {
        // Cancel any calltip when switching from the editor
        editors.at(i)->DoCancelCalltip();
    }
    DoUpdateNotebookTheme();
}
示例#18
0
void MainBook::OnPageChanging(wxBookCtrlEvent& e)
{
    LEditor* editor = GetActiveEditor();
    if(editor) {
        editor->CallTipCancel();
    }
#if HAS_LIBCLANG
    ClangCodeCompletion::Instance()->CancelCodeComplete();
#endif
    e.Skip();
}
示例#19
0
void FrontEnd::OnListbook(wxBookCtrlEvent &event)
{
    wxBookCtrlBase* book = GetCurrentBook();
    const int idx = event.GetSelection();
    if(idx != wxNOT_FOUND && book)
    {
        if(book->GetPageText(idx) == "All Songs")
        {
            m_listSongAll->ClearAll();

            Songs songs;
            SearchSong("select * from songs", songs);

            for(SongsIter iter = songs.begin();
                iter != songs.end();
                iter++)
            {
                m_listSongAll->InsertItem(0, iter->name);
            }
        }
        else if(book->GetPageText(idx) == "Songs Queued")
        {
            m_listSongQueued->ClearAll();

            Songs songs;
            SearchSong("select * from songs where state = 1", songs);

            for(SongsIter iter = songs.begin();
                iter != songs.end();
                iter++)
            {
                m_listSongQueued->InsertItem(0, iter->name);
            }
        }
        else if(book->GetPageText(idx) == "Songs Played")
        {
            m_listSongPlayed->ClearAll();

            Songs songs;
            SearchSong("select * from songs where state = 2", songs);

            for(SongsIter iter = songs.begin();
                iter != songs.end();
                iter++)
            {
                m_listSongPlayed->InsertItem(0, iter->name);
            }
        }
        else if(book->GetPageText(idx) == "Singer Pinyin")
        {
            m_listSingerAll->ClearAll();
        }
    }
}
示例#20
0
void FindResultsTab::OnPageClosed(wxBookCtrlEvent& e)
{
    // this function can't be called unless m_book != NULL
    int sel = e.GetSelection();
    if(sel != wxNOT_FOUND) {
        ListMatchInfos::iterator itMatchInfo = m_matchInfo.begin();
        for(int i = 0; i < e.GetSelection(); ++i) {
            ++itMatchInfo;
        }
        m_matchInfo.erase(itMatchInfo);

    } else if(m_book->GetPageCount()) {
        m_matchInfo.clear();
    }

    // Create a page if there is no more
    if(m_book->GetPageCount() == 0) {
        m_sci = NULL;
    } else {
        m_sci = dynamic_cast<wxStyledTextCtrl*>(m_book->GetCurrentPage());
    }
}
示例#21
0
void MainBook::OnPageClosing(wxBookCtrlEvent& 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 {

        // Unknown 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();
        }
    }
}
示例#22
0
void MyFrame::OnPageChanged(wxBookCtrlEvent& event)
{
    int page = event.GetSelection();
    if (page >= 0)
    {
        wxNotebookPage* notebookPage = notebook->GetPage(size_t(page));
        if (tcEditorMainPage* editorPage = dynamic_cast<tcEditorMainPage*>(notebookPage))
        {
            editorPage->UpdatePage();
        }
    }
    else
    {
        wxASSERT(false); // should not happen
    }

}
示例#23
0
/**
* Apply edits to page that's changing
*/
void MyFrame::OnPageChanging(wxBookCtrlEvent& event)
{
    int page = event.GetSelection();
    if (page >= 0)
    {
        wxNotebookPage* notebookPage = notebook->GetPage(size_t(page));
        if (tcBaseViewer* viewer = dynamic_cast<tcBaseViewer*>(notebookPage))
        {
            viewer->Save();
        }
    }
    else
    {
        wxASSERT(false); // should not happen
    }

}
示例#24
0
文件: App.cpp 项目: skopein/Skopein
void App::OnNotebook(wxBookCtrlEvent& event)
{
	mPage = (PAGES)event.GetSelection();
	switch(mPage)
	{
		case PAGE_OSZI:
		{
			mOsziPage->OnPage();
		break;
		}
		case PAGE_FFT:
		{
			mFFTPage->OnPage();
		break;
		}
	}
}
示例#25
0
void MainBook::OnPageClosed(wxBookCtrlEvent& e)
{
    e.Skip();
    SelectPage(m_book->GetCurrentPage());
    m_quickFindBar->SetEditor(GetActiveEditor());

    // any editors left open?
    LEditor* editor = NULL;
    for(size_t i = 0; i < m_book->GetPageCount() && editor == NULL; i++) {
        editor = dynamic_cast<LEditor*>(m_book->GetPage(i));
    }

    if(m_book->GetPageCount() == 0) {
        SendCmdEvent(wxEVT_ALL_EDITORS_CLOSED);
        ShowQuickBar(false);
    }
    DoUpdateNotebookTheme();
}
示例#26
0
void SymbolViewPlugin::OnPageChanged(wxBookCtrlEvent& e)
{
    e.Skip();
    if(m_view->IsShown()) {
        m_view->m_isEnabled = true;
        m_view->EditorChanged();
    } else if(IsPaneDetached()) {
        m_view->m_isEnabled = true;
        m_view->EditorChanged();
    } else {
        m_view->m_isEnabled = false;
        int sel = m_mgr->GetWorkspacePaneNotebook()->GetSelection();
        if(sel != wxNOT_FOUND) {
            wxString seletionText = m_mgr->GetWorkspacePaneNotebook()->GetPageText(sel);
            m_view->m_isEnabled = (seletionText == _("Outline"));
            if(m_view->m_isEnabled) { m_view->EditorChanged(); }
        } else {
            // the page is detached
            m_view->m_isEnabled = true; // just mark as active
        }
    }
}
示例#27
0
void CMuleNotebook::OnDeletePage(wxBookCtrlEvent& evt)
{
	int page = evt.GetSelection();
	DeletePage(page);
}
示例#28
0
void wxListbook::MakeChangedEvent(wxBookCtrlEvent &event)
{
    event.SetEventType(wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED);
}
示例#29
0
void MapDialog::OnNotebookChanged(wxBookCtrlEvent& evt)
{
	m_SelectedPage = evt.GetSelection();
}
示例#30
0
void MainBook::OnTabDClicked(wxBookCtrlEvent& e)
{
    e.Skip();
    ManagerST::Get()->TogglePanes();
}