Beispiel #1
0
void InfoPane::OnCloseClicked(wxAuiNotebookEvent& event)
{
    if (event.GetSelection() == -1)
        return;
    // toggle the notebook, that sends the event
    Toggle(GetPageIndexByWindow(GetPage(event.GetSelection())));
}
Beispiel #2
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 #3
0
/** @brief OnHeaderRightClick
  *
  * @todo: document this function
  */
void SLChatNotebook::OnHeaderRightClick(wxAuiNotebookEvent &event)
{
    if ( event.GetSelection() == -1 )
        return;

    m_cur_page = static_cast<ChatPanel*>( GetPage( event.GetSelection() ) );
    wxMenu* pop = new wxMenu;
    pop->Append( ID_NEW_TAB, _("New Tab") );
    pop->Append( ID_CLOSE_TAB, _("Close") );
    if ( GetPageCount() > 1)
    {
		pop->Append( ID_CLOSE_TAB_ALL, _("Close all chats"));
		pop->Append( ID_CLOSE_TAB_OTHER, _("Close all other chats"));
    }
    m_ch_menu = new ChatPanelMenu( m_cur_page, true );
	if ( m_cur_page->GetPanelType() == CPT_User ) {
		wxMenu* panel_menu = m_ch_menu->GetMenu(  );
		panel_menu->Remove( panel_menu->FindItem(_( "User" )) );
		pop->AppendSubMenu ( panel_menu, _( "Panel" ) );
		pop->AppendSubMenu ( m_ch_menu->GetUserMenuNoCreate() , _( "User" ));
	}
	else
		pop->AppendSubMenu ( m_ch_menu->GetMenu() , _( "Channel" ));
	Connect( wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( SLChatNotebook::OnMenuItem ), 0, this );
    PopupMenu(pop);
}
Beispiel #4
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 #5
0
//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
void
Notebook::onPageChanged(wxAuiNotebookEvent& _event)
{
    View* pNewView = NULL;
    View* pOldView = NULL;

    // Get the new view, or keep it NULL if there isn't one.
    if (_event.GetSelection() != -1)
    {
        wxWindow* pPage = GetPage(_event.GetSelection());
        Views_type::iterator newPage = m_views.find(pPage);

        if (newPage != m_views.end())
        {
            pNewView = newPage->second;
        }
    }

    // Get the old view, or keep it NULL if there isn't one.
    if (_event.GetOldSelection() != -1 && _event.GetOldSelection() < GetPageCount())
    {
        wxWindow* pOldPage = GetPage(_event.GetOldSelection());
        Views_type::iterator oldPage = m_views.find(pOldPage);
        if (oldPage != m_views.end())
        {
            pOldView = oldPage->second;
        }
    }

    notifyPageChange(pNewView, pOldView);
}
Beispiel #6
0
void MapTabbook::OnNotebookPageChanged(wxAuiNotebookEvent& evt)
{
	gui.UpdateMinimap();

	int32_t oldSelection = evt.GetOldSelection();
	int32_t newSelection = evt.GetSelection();

	MapTab* oldMapTab;
	if(oldSelection != -1) {
		oldMapTab = dynamic_cast<MapTab*>(GetTab(oldSelection));
	} else {
		oldMapTab = nullptr;
	}

	MapTab* newMapTab;
	if(newSelection != -1) {
		newMapTab = dynamic_cast<MapTab*>(GetTab(newSelection));
	} else {
		newMapTab = nullptr;
	}

	// std::cout << oldSelection << " " << newSelection;
	if(!newMapTab) {
		gui.RefreshPalettes(nullptr);
	} else if(!oldMapTab || !oldMapTab->HasSameReference(newMapTab)) {
		gui.RefreshPalettes(newMapTab->GetMap());
		gui.UpdateMenus();
	}
}
Beispiel #7
0
void InfoPane::OnTabContextMenu(wxAuiNotebookEvent& event)
{
    if (event.GetSelection() == -1)
        return;
    // select the notebook that sends the event, because the context menu-entries act on the actual selected tab
    SetSelection(event.GetSelection());
    DoShowContextMenu();
}
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
}
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();
}
Beispiel #10
0
// Ensure we show the data in any tabs that become visible
void frmMain::OnPageChange(wxAuiNotebookEvent &event)
{
	pgObject *data = browser->GetObject(browser->GetSelection());

	if (!data)
		return;

	ShowObjStatistics(data, ((wxAuiNotebook *)event.GetEventObject())->GetPage(event.GetSelection()));
}
Beispiel #11
0
void HtMainFrame::OnNotebookPageClose (wxAuiNotebookEvent &event)
{
   wxAuiNotebook *nb = static_cast<wxAuiNotebook *>(event.GetEventObject());
   HexFrame *frame = static_cast<HexFrame *>(nb->GetPage(event.GetSelection()));

   wxDocManager *docm = wxGetApp().doc_manager.get();

   HexView *vw = frame->GetView();
   docm->CloseDocument(vw->GetDocument());
}
Beispiel #12
0
void tpanelnotebook::dragdrophandler(wxAuiNotebookEvent& event) {
	wxAuiNotebook* note = (wxAuiNotebook *) event.GetEventObject();
	if (note) {
		tpanelparentwin *tppw = static_cast<tpanelparentwin *>(note->GetPage(event.GetSelection()));
		if (tppw) {
			tppw->pimpl()->owner = owner;
		}
	}
	event.Allow();
}
Beispiel #13
0
void HtMainFrame::OnNotebookPageChange (wxAuiNotebookEvent &event)
{


#ifdef WXDEBUG
   wxAuiNotebook *nb = static_cast<wxAuiNotebook *>(event.GetEventObject());
   HexFrame *frame = static_cast<HexFrame *>(nb->GetPage(event.GetSelection()));

   frame->OnAddToDebugPanel();
#endif
}
Beispiel #14
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 #15
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();
}
Beispiel #16
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 #17
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();
}
void ShellManager::OnPageContextMenu(wxAuiNotebookEvent& event)
{
    if (event.GetSelection() == -1)
        return;

    // select the notebook that sends the event
    m_nb->SetSelection(event.GetSelection());
    wxMenu* pop = new wxMenu;
    pop->Append(ID_REMOVE_TERMINATED, _("Close Inactive Tool Pages"));

    m_nb->PopupMenu(pop);
    delete pop;
}
Beispiel #19
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);
}
Beispiel #20
0
 // On tab context menu
 void OnTabContextMenu (wxAuiNotebookEvent & event)
 {
     // ensure tab is visible
     m_docArea->SetSelection(event.GetSelection());
     wxMenu * menu = new wxMenu();
     menu->Append(ID_DecoupleTab, "Decouple", "Decouple this tab");
     m_frame->PopupMenu(menu);
 }
void EditorManager::OnPageClosed(wxAuiNotebookEvent& event)
{
	int index = event.GetSelection();

	Editor* editor = NULL;
	EditorIndexMap::iterator it;
	for(it = mEditorIndexMap.begin(); it != mEditorIndexMap.end(); ++it)
	{
		if(it->second == index)
		{
			editor = it->first;
			editor->deactivate();
			mEditorIndexMap.erase(it);
			break;
		}
	}

	if(editor != NULL)
	{
		if(editor == mActiveEditor)
			mActiveEditor = NULL;

		EditorList::iterator lit;
		for(lit = mEditors.begin(); lit != mEditors.end(); ++lit)
		{
			if((*lit) == editor)
			{
				mEditors.erase(lit);
				break;
			}
		}	
	}

	fireEvent(EditorClosed, EditorEventArgs(editor));

	// Is this handled by OnPageChanged?
	int selIndex = event.GetSelection();
	for(it = mEditorIndexMap.begin(); it != mEditorIndexMap.end(); ++it)
	{
		if(it->second == index)
		{
			setActiveEditor(it->first);
			break;
		}
	}
}
Beispiel #22
0
	void OnCanvasChanging(wxAuiNotebookEvent& evt)
	{
		wm.wup.lock();
		if(!SetCurrentCanvas(NULL))
		{
			evt.Veto();
			wm.wup.unlock();
		}
	}
Beispiel #23
0
void EditorFrame::onNotebookPageChanged(wxAuiNotebookEvent& event)
{
	Document* oldDocument = getDocumentFromPage( event.GetOldSelection() );
	Document* newDocument = getDocumentFromPage( event.GetSelection() );

	if(oldDocument)
	{
		oldDocument->onDocumentUnselect();
		eventManager->onDocumentUnselect(*oldDocument);
		documentManager->currentDocument = nullptr;
	}

	if(newDocument)
	{
		documentManager->currentDocument = newDocument;
		newDocument->onDocumentSelect();
		eventManager->onDocumentSelect(*newDocument);
	}
}
Beispiel #24
0
	void OnCanvasChanged(wxAuiNotebookEvent& evt)
	{

		int sel=evt.GetSelection();
		wxWindow* page=GetPage(sel);
		SetCurrentCanvas(page);

		wm.wup.gp_add("CmdProc");
		wm.wup.unlock();
	}
// when last tab is closed, close the frame
void MetadataItemPropertiesFrame::OnNotebookPageChanged(
    wxAuiNotebookEvent& event)
{
    int sel = event.GetSelection();
    if (sel == wxNOT_FOUND)
        return;
    if (databaseNameM.empty())
        SetTitle(notebookM->GetPageText(sel));
    else
        SetTitle(databaseNameM + " - " + notebookM->GetPageText(sel));
}
void MainChatTab::OnTabClose( wxAuiNotebookEvent& event )
{
	int selection = event.GetSelection();
	ChatPanel* panel = ( ChatPanel* )m_chat_tabs->GetPage( selection );
	if ( panel )
	{
		panel->Part();
		if( panel->IsServerPanel() )
            m_server_chat = 0;
	}

}
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 #28
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());
    }
}
Beispiel #29
0
void tpanelnotebook::tabrightclickhandler(wxAuiNotebookEvent& event) {
	tpanelparentwin *tppw = static_cast<tpanelparentwin *>(GetPage(event.GetSelection()));
	if (tppw) {
		wxMenu menu;
		menu.SetTitle(wxstrstd(tppw->pimpl()->tp->dispname));
		menu.Append(TPPWID_SPLIT, wxT("Split"));
		menu.Append(TPPWID_DETACH, wxT("Detach"));
		menu.Append(TPPWID_DUP, wxT("Duplicate"));
		menu.Append(TPPWID_DETACHDUP, wxT("Detached Duplicate"));
		menu.Append(TPPWID_CLOSE, wxT("Close"));
		GenericPopupWrapper(tppw, &menu);
	}
}
Beispiel #30
0
void MainWindow::OnTabsChanged(wxAuiNotebookEvent& event)
{
	int newsel = event.GetSelection();

	if (newsel == 0 || newsel == 1) {
		if (!ui().IsConnected() && ui().IsMainWindowCreated())
			ui().Connect();
	}

	ChatPanel* panel = ui().GetActiveChatPanel(); //set input focus to edit field on tab change
	if (panel != NULL) {
		panel->SetFocus();
	}
}