Move quit back to wxIDs. wxWidgets like to muck around with the location on OSX.

This commit is contained in:
Jeff Young 2019-05-26 23:22:03 +01:00
parent 21c216556b
commit 2502bce987
7 changed files with 27 additions and 11 deletions

View File

@ -137,9 +137,9 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AddItem( ACTIONS::print, EE_CONDITIONS::ShowAlways );
fileMenu->AddItem( ACTIONS::plot, EE_CONDITIONS::ShowAlways );
// Quit
fileMenu->AddSeparator();
fileMenu->AddItem( ACTIONS::quit, EE_CONDITIONS::ShowAlways );
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, EE_CONDITIONS::ShowAlways );
//
// Menu Edit:

View File

@ -222,6 +222,7 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU( ID_IMPORT_NON_KICAD_SCH, SCH_EDIT_FRAME::OnImportProject )
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, EDA_DRAW_FRAME::CopyToClipboard )
EVT_MENU( wxID_EXIT, SCH_EDIT_FRAME::OnExit )
EVT_MENU( ID_CONFIG_SAVE, SCH_EDIT_FRAME::Process_Config )
EVT_MENU( ID_CONFIG_READ, SCH_EDIT_FRAME::Process_Config )
@ -1067,6 +1068,12 @@ void SCH_EDIT_FRAME::OnEditComponentSymbolsId( wxCommandEvent& event )
}
void SCH_EDIT_FRAME::OnExit( wxCommandEvent& event )
{
Close( false );
}
void SCH_EDIT_FRAME::Print()
{
InvokeDialogPrintUsingPrinter( this );

View File

@ -3,7 +3,7 @@
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2004-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -751,6 +751,7 @@ private:
// Sets up the tool framework
void setupTools();
void OnExit( wxCommandEvent& event );
void OnAnnotate( wxCommandEvent& event );
void OnErc( wxCommandEvent& event );
void OnCreateNetlist( wxCommandEvent& event );

View File

@ -83,7 +83,8 @@ void PL_EDITOR_FRAME::ReCreateMenuBar()
fileMenu->AddItem( ACTIONS::print, SELECTION_CONDITIONS::ShowAlways );
fileMenu->AppendSeparator();
fileMenu->AddItem( ACTIONS::quit, SELECTION_CONDITIONS::ShowAlways );
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, SELECTION_CONDITIONS::ShowAlways );
//
// Edit Menu:

View File

@ -236,9 +236,9 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
fileMenu->AddSeparator();
fileMenu->AddMenu( submenuArchive, SELECTION_CONDITIONS::ShowAlways );
// Quit
fileMenu->AddSeparator();
fileMenu->AddItem( ACTIONS::quit, SELECTION_CONDITIONS::ShowAlways );
// Don't use ACTIONS::quit; wxWidgets moves this on OSX and expects to find it via wxID_EXIT
fileMenu->AddItem( wxID_EXIT, _( "Quit" ), "", exit_xpm, SELECTION_CONDITIONS::ShowAlways );
//----- Edit menu -----------------------------------------------------------
CONDITIONAL_MENU* editMenu = new CONDITIONAL_MENU( false, selTool );

View File

@ -152,6 +152,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_MENU( ID_MENU_ARCHIVE_MODULES_IN_LIBRARY, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( ID_MENU_CREATE_LIBRARY_AND_ARCHIVE_MODULES, PCB_EDIT_FRAME::Process_Special_Functions )
EVT_MENU( wxID_EXIT, PCB_EDIT_FRAME::OnQuit )
// menu Config
EVT_MENU( ID_PCB_LIB_TABLE_EDIT, PCB_EDIT_FRAME::Process_Config )
EVT_MENU( ID_PCB_3DSHAPELIB_WIZARD, PCB_EDIT_FRAME::Process_Config )
@ -560,6 +562,12 @@ void PCB_EDIT_FRAME::ReFillLayerWidget()
}
void PCB_EDIT_FRAME::OnQuit( wxCommandEvent& event )
{
Close( false );
}
void PCB_EDIT_FRAME::OnCloseWindow( wxCloseEvent& Event )
{
m_canvas->SetAbortRequest( true );

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2010 Jean-Pierre Charras, jp.charras@wanadoo.fr
* Copyright (C) 1992-2018 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 1992-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -17,9 +17,6 @@
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file wxPcbStruct.h
*/
#ifndef WXPCB_STRUCT_H_
#define WXPCB_STRUCT_H_
@ -300,6 +297,8 @@ public:
*/
void LoadFootprints( NETLIST& aNetlist, REPORTER& aReporter );
void OnQuit( wxCommandEvent& event );
/**
* Reload the Python plugins if they are newer than
* the already loaded, and load new plugins if any