Beispiel #1
0
void MapTabbook::OnNotebookPageClose(wxAuiNotebookEvent& evt)
{
	EditorTab* editorTab = GetTab(evt.GetInt());

	MapTab* mapTab = dynamic_cast<MapTab*>(editorTab);
	if(mapTab && mapTab->IsUniqueReference() && mapTab->GetMap()) {
		if(mapTab->GetEditor()->IsLive()) {
			if(mapTab->GetMap()->hasChanged()) {
				SetFocusedTab(evt.GetInt());
				if(gui.root->DoQuerySave(false)) {
					gui.RefreshPalettes(nullptr, false);
					gui.UpdateMenus();
				} else {
					evt.Veto();
				}
			} else {
				gui.RefreshPalettes(nullptr, false);
				gui.UpdateMenus();
			}
		}
		return;
	}

	LiveLogTab* lt = dynamic_cast<LiveLogTab*>(editorTab);
	if(lt && lt->IsConnected()) {
		evt.Veto();
	}
}
Beispiel #2
0
	void OnCanvasClosing(wxAuiNotebookEvent& evt)
	{
		wm.wup.lock();

		wxWindow* pPage=GetPage(evt.GetSelection());
		EW_ASSERT(pPage!=NULL);

		MvcView* pView=MvcView::GetViewByCanvas(pPage);
		if(!pView)
		{
			return;
		}

		ICmdParam cmd(-1);
		if(!pView->OnClose(wm))
		{
			evt.Veto();
			wm.wup.unlock();
			return;
		}

		if(pPage==m_pCurrentCanvas)
		{
			m_pCurrentCanvas.reset(NULL);
			SetActiveView(NULL);
		}

		wm.book.DetachView(pView);

	}
Beispiel #3
0
void CFrame::OnNotebookPageClose(wxAuiNotebookEvent& event)
{
	// Override event
	event.Veto();

	wxAuiNotebook* Ctrl = (wxAuiNotebook*)event.GetEventObject();

	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOG_WINDOW)
		ToggleLogWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOG_CONFIG_WINDOW)
		ToggleLogConfigWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_REGISTER_WINDOW)
		g_pCodeWindow->ToggleRegisterWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_WATCH_WINDOW)
		g_pCodeWindow->ToggleWatchWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_BREAKPOINT_WINDOW)
		g_pCodeWindow->ToggleBreakPointWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_JIT_WINDOW)
		g_pCodeWindow->ToggleJitWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_MEMORY_WINDOW)
		g_pCodeWindow->ToggleMemoryWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_SOUND_WINDOW)
		g_pCodeWindow->ToggleSoundWindow(false);
	if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_VIDEO_WINDOW)
		g_pCodeWindow->ToggleVideoWindow(false);
}
void CContextControl::OnTabClosing(wxAuiNotebookEvent& event)
{
	// Need to defer event, wxAUI would write to free'd memory
	// if we'd actually delete tab and potenially the notebook with it
	QueueEvent(new wxCommandEvent(fzEVT_TAB_CLOSING_DEFERRED, event.GetSelection()));

	event.Veto();
}
void ShellManager::OnPageClosing(wxAuiNotebookEvent& event)
{
    ShellCtrlBase* sh = GetPage(event.GetSelection());
    //    LOGSTREAM << wxString::Format(_T("OnPageClosing(): ed=%p, title=%s\n"), eb, eb ? eb->GetTitle().c_str() : _T(""));
    if (!QueryClose(sh))
        event.Veto();
//    event.Skip(); // allow others to process it too
}
Beispiel #6
0
	void OnCanvasChanging(wxAuiNotebookEvent& evt)
	{
		wm.wup.lock();
		if(!SetCurrentCanvas(NULL))
		{
			evt.Veto();
			wm.wup.unlock();
		}
	}
Beispiel #7
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();
}
Beispiel #8
0
void EditorFrame::onNotebookPageClose(wxAuiNotebookEvent& event)
{
	Document* document = getDocumentFromPage( event.GetSelection() );
	if( !document ) return;

	documentManager->removeDocument(document);

	// We veto the default wxWidgets closed event because we
	// already delete the notebook page when a document is removed.

	event.Veto();
}
Beispiel #9
0
void wxAuiMDIClientWindow::OnPageClose(wxAuiNotebookEvent& evt)
{
    wxAuiMDIChildFrame* wnd;
    wnd = static_cast<wxAuiMDIChildFrame*>(GetPage(evt.GetSelection()));

    wnd->Close();

    // regardless of the result of wnd->Close(), we've
    // already taken care of the close operations, so
    // suppress further processing
    evt.Veto();
}
Beispiel #10
0
void MainFrame::OneditorsNotebookPageClose(wxAuiNotebookEvent& event)
{
    if ( dynamic_cast<StartHerePage*>(editorsNotebook->GetPage(event.GetSelection())) != NULL )
        startPage = NULL;
    else if ( CodeEditor * editor = dynamic_cast<CodeEditor*>(editorsNotebook->GetPage(event.GetSelection())) )
    {
        if ( !editor->QueryClose() )
            event.Veto();
    }
    else if ( EditorScene * editor = dynamic_cast<EditorScene*>(editorsNotebook->GetPage(event.GetSelection())) )
    {
        if ( !editor->CanBeClosed() )
        {
            event.Veto();
            infoBar->ShowMessage(_("Please close the preview before closing the editor."));
        }

        //Save the event to log file
        LogFileManager::Get()->WriteToLogFile("Closed layout "+editor->GetLayout().GetName());
    }
}
void frmDatabaseDesigner::OnDeleteDiagramTab(wxAuiNotebookEvent &event)
{
	deletedTab = event.GetSelection();
	wxAuiNotebook *ctrl = (wxAuiNotebook *)event.GetEventObject();
	hdDrawingView *view = (hdDrawingView *) ctrl->GetPage(event.GetSelection());

	int res = wxMessageBox(wxT("Are you sure you want to delete diagram \"") + view->getDrawing()->getName() + _("\" from model?"),
	                       wxT("Delete diagram?"),
	                       wxYES_NO | wxNO_DEFAULT,
	                       this);
	if (res != wxYES)
	{
		event.Veto();
	}
	else
	{
		setModelChanged(true);
	}

	UpdateToolbar();
}
Beispiel #12
0
void MainWindow::OnCloseNotebook(wxAuiNotebookEvent& event)
{
	wxAuiNotebook* m_note = (wxAuiNotebook *) event.GetEventObject();
	if(m_note->GetSelection()== 0)event.Veto();
}
Beispiel #13
0
//should work accroding to docs/sample, but doesn't (not even in sample)
void SLChatNotebook::OnAllowNotebookDnD(wxAuiNotebookEvent& evt)
{
    evt.Veto();
}