当前位置: 首页>>代码示例>>C++>>正文


C++ wxAuiNotebookEvent::GetOldSelection方法代码示例

本文整理汇总了C++中wxAuiNotebookEvent::GetOldSelection方法的典型用法代码示例。如果您正苦于以下问题:C++ wxAuiNotebookEvent::GetOldSelection方法的具体用法?C++ wxAuiNotebookEvent::GetOldSelection怎么用?C++ wxAuiNotebookEvent::GetOldSelection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在wxAuiNotebookEvent的用法示例。


在下文中一共展示了wxAuiNotebookEvent::GetOldSelection方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetPage

//-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
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);
}
开发者ID:SgtFlame,项目名称:indiezen,代码行数:32,代码来源:Notebook.cpp

示例2: OnNotebookPageChanged

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();
	}
}
开发者ID:OMARTINEZ210,项目名称:rme,代码行数:29,代码来源:editor_tabs.cpp

示例3: OnTabsChanged

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();

}
开发者ID:N2maniac,项目名称:springlobby-join-fork,代码行数:36,代码来源:mainchattab.cpp

示例4: OnPageChanged

void wxAuiMDIClientWindow::OnPageChanged(wxAuiNotebookEvent& evt)
{
    PageChanged(evt.GetOldSelection(), evt.GetSelection());
}
开发者ID:erwincoumans,项目名称:wxWidgets,代码行数:4,代码来源:tabmdi.cpp


注:本文中的wxAuiNotebookEvent::GetOldSelection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。