本文整理汇总了C++中wxAuiNotebookEvent::GetSelection方法的典型用法代码示例。如果您正苦于以下问题:C++ wxAuiNotebookEvent::GetSelection方法的具体用法?C++ wxAuiNotebookEvent::GetSelection怎么用?C++ wxAuiNotebookEvent::GetSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxAuiNotebookEvent
的用法示例。
在下文中一共展示了wxAuiNotebookEvent::GetSelection方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCloseClicked
void InfoPane::OnCloseClicked(wxAuiNotebookEvent& event)
{
if (event.GetSelection() == -1)
return;
// toggle the notebook, that sends the event
Toggle(GetPageIndexByWindow(GetPage(event.GetSelection())));
}
示例2: OnHeaderRightClick
/** @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);
}
示例3: 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);
}
示例4: OnTabContextMenu
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();
}
示例5: OnNotebookPageClose
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);
}
示例6: OnPageContextMenu
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;
}
示例7: 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();
}
}
示例8: OnCanvasClosing
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);
}
示例9: OnPageClosing
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
}
示例10: OnTabClosing
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();
}
示例11: OnTabContextMenu
// 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);
}
示例12: OnPageClosed
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;
}
}
}
示例13: OnPageChange
// 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()));
}
示例14: OnNotebookPageClose
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());
}
示例15: OnCanvasChanged
void OnCanvasChanged(wxAuiNotebookEvent& evt)
{
int sel=evt.GetSelection();
wxWindow* page=GetPage(sel);
SetCurrentCanvas(page);
wm.wup.gp_add("CmdProc");
wm.wup.unlock();
}