本文整理汇总了C++中wxAuiManagerEvent::Veto方法的典型用法代码示例。如果您正苦于以下问题:C++ wxAuiManagerEvent::Veto方法的具体用法?C++ wxAuiManagerEvent::Veto怎么用?C++ wxAuiManagerEvent::Veto使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxAuiManagerEvent
的用法示例。
在下文中一共展示了wxAuiManagerEvent::Veto方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onAuiPaneClose
void CocaDocumentManager::onAuiPaneClose( wxAuiManagerEvent& event )
{
COCA_DEBUG_INFO( "CocaDocumentManager::OnAuiPaneClose " << event.GetPane() << "; " << event.CanVeto() );
if ( !GetCurrentDocument() ) {
return;
}
wxAuiPaneInfo* info = event.GetPane();
wxList& views = GetCurrentDocument()->GetViews();
wxList::iterator it;
for ( it = views.begin(); it != views.end(); ++it )
{
CocaView* view = coca::staticCast<CocaView*>( *it );
if ( view->getPane() == info->window )
{
if ( view->Close( false ) )
{
delete view;
}
else
{
event.Veto();
}
return;
}
}
event.Skip(); // no related view found, skip event
}
示例2: OnPaneClose
// -------------------------------------------------------------------------------- //
void guAuiManagerPanel::OnPaneClose( wxAuiManagerEvent &event )
{
wxAuiPaneInfo * PaneInfo = event.GetPane();
int PanelIndex = m_PanelNames.Index( PaneInfo->name );
if( PanelIndex != wxNOT_FOUND )
{
guLogMessage( wxT( "OnPaneClose: %s %i" ), m_PanelNames[ PanelIndex ].c_str(), m_PanelCmdIds[ PanelIndex ] );
ShowPanel( m_PanelIds[ PanelIndex ], false );
}
event.Veto();
}
示例3: OnPaneClose
void OnPaneClose(wxAuiManagerEvent& event)
{
// For now just pretend cancel was clicked. This is sufficient to fool
// dialogmanager into closing the window it would seem
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
wxWindow * pWindow = NULL;
if (event.GetPane() && event.GetPane()->IsOk() )
pWindow = event.GetPane()->window;
if (pWindow && !pWindow->IsBeingDeleted())
{
cancelEvent.SetEventObject( pWindow );
pWindow->GetEventHandler()->AddPendingEvent(cancelEvent);
}
event.Veto(); // Stop wxAUI doing anything about it
}
示例4: OnPaneClose
void CFrame::OnPaneClose(wxAuiManagerEvent& event)
{
event.Veto();
wxAuiNotebook * nb = (wxAuiNotebook*)event.pane->window;
if (!nb) return;
if (!g_pCodeWindow)
{
if (nb->GetPage(0)->GetId() == IDM_LOGWINDOW ||
nb->GetPage(0)->GetId() == IDM_LOGCONFIGWINDOW ||
nb->GetPage(0)->GetId() == IDM_CONSOLEWINDOW)
{
// Closing a pane containing the logwindow or a console closes both
SConfig::GetInstance().m_InterfaceConsole = false;
SConfig::GetInstance().m_InterfaceLogWindow = false;
SConfig::GetInstance().m_InterfaceLogConfigWindow = false;
ToggleConsole(false);
ToggleLogWindow(false);
ToggleLogConfigWindow(false);
}
}
else
{
if (GetNotebookCount() == 1)
{
wxMessageBox(_("At least one pane must remain open."),
_("Notice"), wxOK, this);
}
else if (nb->GetPageCount() != 0 && !nb->GetPageText(0).IsSameAs(wxT("<>")))
{
wxMessageBox(_("You can't close panes that have pages in them."),
_("Notice"), wxOK, this);
}
else
{
// Detach and delete the empty notebook
event.pane->DestroyOnClose(true);
m_Mgr->ClosePane(*event.pane);
}
}
m_Mgr->Update();
}