本文整理汇总了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);
}
示例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();
}
}
示例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();
}
示例4: OnPageChanged
void wxAuiMDIClientWindow::OnPageChanged(wxAuiNotebookEvent& evt)
{
PageChanged(evt.GetOldSelection(), evt.GetSelection());
}