Beispiel #1
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 #2
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 #3
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);
	}
}
void MainChatTab::OnTabsChanged( wxAuiNotebookEvent& event )
{
	wxLogDebugFunc( _T( "" ) );

	int oldsel = event.GetOldSelection();
	if ( oldsel < 0 ) return;
	int newsel = event.GetSelection();
	if ( newsel < 0 ) return;

	// change icon to default the icon to show that no new events happened
	size_t ImageIndex = ( ( ChatPanel* )m_chat_tabs->GetPage( newsel ) )->GetIconIndex();
	if ( ImageIndex == 4 || ImageIndex == 6 || ImageIndex == 8 )
	{
		GetActiveChatPanel()->SetIconIndex( 2 );
		m_chat_tabs->SetPageBitmap( newsel, wxBitmap( channel_xpm ) );
	}
	else if ( ImageIndex == 5 || ImageIndex == 7 || ImageIndex == 9 )
	{
		GetActiveChatPanel()->SetIconIndex( 3 );
		m_chat_tabs->SetPageBitmap( newsel, wxBitmap( userchat_xpm ) );
	}
	else if ( ImageIndex == 10 )
	{
		GetActiveChatPanel()->SetIconIndex( 1 );
		m_chat_tabs->SetPageBitmap( newsel, wxBitmap( server_xpm ) );
	}

	wxWindow* newpage = m_chat_tabs->GetPage( newsel );
	if ( newpage == 0 ) { // Not sure what to do here
		wxLogError( _T( "Newpage NULL." ) );
		return;
	}

	GetActiveChatPanel()->FocusInputBox();

}
Beispiel #5
0
void wxAuiMDIClientWindow::OnPageChanged(wxAuiNotebookEvent& evt)
{
    PageChanged(evt.GetOldSelection(), evt.GetSelection());
}