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

}
Exemplo n.º 2
0
// -------------------------------------------------------------------------------- //
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();
}
Exemplo n.º 3
0
void RadarPanel::close(wxAuiManagerEvent& event) {
  event.Skip();

  wxAuiPaneInfo* pane = event.GetPane();

  if (pane->window == this) {
    m_pi->m_settings.show_radar[m_ri->m_radar] = 0;
    LOG_DIALOG(wxT("BR24radar_pi: RadarPanel::close: show_radar[%d]=%d"), m_ri->m_radar, 0);
    m_pi->NotifyRadarWindowViz();
  } else {
    LOG_DIALOG(wxT("BR24radar_pi: RadarPanel::close: ignore close of window %s in window %s"), pane->name.c_str(),
               m_aui_name.c_str());
  }
}
Exemplo n.º 4
0
void MyFrame::OnPanelClose(wxAuiManagerEvent& evt)
{
    wxAuiPaneInfo *p = evt.GetPane();
    if (p->name == _T("MainToolBar"))
    {
        Menubar->Check(MENU_TOOLBAR, false);
    }
    if (p->name == _T("GraphLog"))
    {
        Menubar->Check(MENU_GRAPH, false);
        pGraphLog->SetState(false);
    }
    if (p->name == _T("Stats"))
    {
        Menubar->Check(MENU_STATS, false);
        pStatsWin->SetState(false);
    }
    if (p->name == _T("Profile"))
    {
        Menubar->Check(MENU_STARPROFILE, false);
        pProfile->SetState(false);
    }
    if (p->name == _T("AOPosition"))
    {
        Menubar->Check(MENU_AO_GRAPH, false);
        pStepGuiderGraph->SetState(false);
    }
    if (p->name == _T("Target"))
    {
        Menubar->Check(MENU_TARGET, false);
        pTarget->SetState(false);
    }
}
Exemplo n.º 5
0
	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
	}
Exemplo n.º 6
0
void AISTargetListDialog::OnPaneClose( wxAuiManagerEvent& event )
{
    if( event.pane->name == _T("AISTargetList") ) {
        g_AisTargetList_perspective = m_pAuiManager->SavePaneInfo( *event.pane );
        //event.Veto();
    }
    event.Skip();
}
Exemplo n.º 7
0
void OutputViewControlBar::OnRender(wxAuiManagerEvent& event)
{
	if ( m_aui && m_aui->GetPane(wxT("Output View")).IsShown() == false ) {
		DoMarkActive( wxEmptyString );
	} else if ( m_aui ) {
		DoMarkActive ( m_book->GetPageText( m_book->GetSelection() ) );
	}
	event.Skip();
}
Exemplo n.º 8
0
void CFrame::OnManagerResize(wxAuiManagerEvent& event)
{
	if (!g_pCodeWindow && m_LogWindow &&
			m_Mgr->GetPane("Pane 1").IsShown() &&
			!m_Mgr->GetPane("Pane 1").IsFloating())
	{
		m_LogWindow->x = m_Mgr->GetPane("Pane 1").rect.GetWidth();
		m_LogWindow->y = m_Mgr->GetPane("Pane 1").rect.GetHeight();
		m_LogWindow->winpos = m_Mgr->GetPane("Pane 1").dock_direction;
	}
	event.Skip();
}
Exemplo n.º 9
0
void Notebook::OnRender(wxAuiManagerEvent &e)
{
	if (m_aui) {
		wxAuiPaneInfo info = m_aui->GetPane( m_paneName );
		if (info.IsOk()) {
			//we got the containing pane of the book, test its orientation
			if (info.dock_direction == wxAUI_DOCK_LEFT && m_style & wxVB_RIGHT) {
				SetOrientation(wxVB_LEFT);
			} else if (info.dock_direction == wxAUI_DOCK_RIGHT && m_style & wxVB_LEFT) {
				SetOrientation(wxVB_RIGHT);
			}
		}
	}
	e.Skip();
}
Exemplo n.º 10
0
////////////////////////////////////////////////////////////////////////////////
//  OnAuiUpdate()
//
//    Update the view menu to reflect AUI changes
void frmDebugger::OnAuiUpdate(wxAuiManagerEvent &event)
{
	if(event.pane->name == wxT("toolBar"))
	{
		m_viewMenu->Check(MENU_ID_VIEW_TOOLBAR, false);
	}
	else if(event.pane->name == wxT("stackPane"))
	{
		m_viewMenu->Check(MENU_ID_VIEW_STACKPANE, false);
	}
	else if(event.pane->name == wxT("outputPane"))
	{
		m_viewMenu->Check(MENU_ID_VIEW_OUTPUTPANE, false);
	}
	event.Skip();
}
Exemplo n.º 11
0
void frmMain::OnAuiUpdate(wxAuiManagerEvent &event)
{
	if(event.pane->name == wxT("objectBrowser"))
	{
		viewMenu->Check(MNU_OBJECTBROWSER, false);
	}
	else if(event.pane->name == wxT("sqlPane"))
	{
		viewMenu->Check(MNU_SQLPANE, false);
	}
	else if(event.pane->name == wxT("toolBar"))
	{
		viewMenu->Check(MNU_TOOLBAR, false);
	}
	event.Skip();
}
Exemplo n.º 12
0
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();
}
Exemplo n.º 13
0
void gecomapi_pi::OnAuiRender( wxAuiManagerEvent& event )
{
      //TODO: Can we prevent the resizing here?
      event.Skip();
}