Esempio n. 1
0
void CFrame::OnTab(wxAuiNotebookEvent& event)
{
	event.Skip();
	if (!g_pCodeWindow) return;

	// Create the popup menu
	wxMenu MenuPopup;

	wxMenuItem* Item = new wxMenuItem(&MenuPopup, wxID_ANY, _("Select floating windows"));
	MenuPopup.Append(Item);
	Item->Enable(false);
	MenuPopup.Append(new wxMenuItem(&MenuPopup));

	for (int i = IDM_LOG_WINDOW; i <= IDM_CODE_WINDOW; i++)
	{
		wxWindow *Win = FindWindowById(i);
		if (Win && Win->IsEnabled())
		{
			Item = new wxMenuItem(&MenuPopup, i + IDM_FLOAT_LOG_WINDOW - IDM_LOG_WINDOW,
					Win->GetName(), "", wxITEM_CHECK);
			MenuPopup.Append(Item);
			Item->Check(!!FindWindowById(i + IDM_LOG_WINDOW_PARENT - IDM_LOG_WINDOW));
		}
	}

	// Line up our menu with the cursor
	wxPoint Pt = ::wxGetMousePosition();
	Pt = ScreenToClient(Pt);

	// Show
	PopupMenu(&MenuPopup, Pt);
}
Esempio n. 2
0
void frmMain::OnAuiNotebookPageClose(wxAuiNotebookEvent &event)
{
	// Prevent the user closing the four main tabs.
	if (event.GetSelection() < 4)
	{
		wxMessageBox(_("This tab cannot be closed."), _("Close tab"), wxICON_INFORMATION | wxOK);
		event.Veto();
		return;
	}

	event.Skip();
}
Esempio n. 3
0
/*---------------------------------------------------------------------------*/
void wxTableBook::OnTablebookPageChanging( wxAuiNotebookEvent& event )
{
    if (m_InitData)
    {   // Vérifier si c'est l'onglet Data qui doit être affiché
        if ("Data" == m_Book->GetPageText(event.GetSelection()))
        {   // Si oui lancer la sélection des données de la table
            m_InitData = false;
            RefreshData();
        }
    }
    event.Skip();
}
Esempio n. 4
0
void CFrame::OnNotebookPageChanged(wxAuiNotebookEvent& event)
{
	event.Skip();
	if (!g_pCodeWindow) return;

	// Remove the blank page if any
	AddRemoveBlankPage();

	// Update the notebook affiliation
	for (int i = IDM_LOGWINDOW; i <= IDM_CODEWINDOW; i++)
	{
		if(GetNotebookAffiliation(i) >= 0)
			g_pCodeWindow->iNbAffiliation[i - IDM_LOGWINDOW] = GetNotebookAffiliation(i);
	}
}
Esempio n. 5
0
void MainFrame::NotebookPageClosing(wxAuiNotebookEvent& event)
{
    auto it = m_workspaceList.begin();
    while(it != m_workspaceList.end()) {
        if(*it == m_auiNotebook->GetCurrentPage()) {
            if((*it)->GetOpenGLContext() == m_sharedGLContext) m_sharedGLContext = NULL;
            m_workspaceList.erase(it);
            break;
        }
        it++;
    }
    if(!m_sharedGLContext && m_workspaceList.size() != 0) {
        m_sharedGLContext = m_workspaceList[0]->GetOpenGLContext();
    }
    event.Skip();
}
Esempio n. 6
0
/* MainWindow::onTabChanged
 * Called when the current tab is changed
 *******************************************************************/
void MainWindow::onTabChanged(wxAuiNotebookEvent& e) {
	// Get current page
	wxWindow* page = notebook_tabs->GetPage(notebook_tabs->GetSelection());

	// If start page is selected, refresh it
	if (page->GetName() == "startpage") {
		createStartPage();
		SetStatusText("", 1);
		SetStatusText("", 2);
	}

	// Archive tab, update undo history panel
	else if (page->GetName() == "archive")
		panel_undo_history->setManager(((ArchivePanel*)page)->getUndoManager());

	// Continue
	e.Skip();
}
Esempio n. 7
0
void CFrame::OnAllowNotebookDnD(wxAuiNotebookEvent& event)
{
	event.Skip();
	event.Allow();
}