Minot fix: Honor Ctrl+Q hotkey in pl_editor and pcb_calculator

This commit is contained in:
jean-pierre charras 2023-06-28 08:56:40 +02:00
parent c2f2247ae3
commit 8712dac1a2
4 changed files with 44 additions and 2 deletions

View File

@ -137,6 +137,12 @@ void IMAGE_SIZE::SetUnit( EDA_UNITS aUnit )
}
BEGIN_EVENT_TABLE( BITMAP2CMP_FRAME, EDA_BASE_FRAME )
EVT_MENU( wxID_CLOSE, BITMAP2CMP_FRAME::OnExit )
EVT_MENU( wxID_EXIT, BITMAP2CMP_FRAME::OnExit )
END_EVENT_TABLE()
BITMAP2CMP_FRAME::BITMAP2CMP_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
KIWAY_PLAYER( aKiway, aParent, FRAME_BM2CMP, _( "Image Converter" ), wxDefaultPosition,
wxDefaultSize, wxDEFAULT_FRAME_STYLE, wxT( "bitmap2cmp" ), unityScale ),
@ -200,6 +206,13 @@ BITMAP2CMP_FRAME::~BITMAP2CMP_FRAME()
}
void BITMAP2CMP_FRAME::OnExit( wxCommandEvent& aEvent )
{
// Just generate a wxCloseEvent
Close( false );
}
wxWindow* BITMAP2CMP_FRAME::GetToolCanvas() const
{
return m_panel->GetCurrentPage();

View File

@ -1,7 +1,7 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2019-2022 Kicad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2023 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
@ -40,7 +40,6 @@ public:
// overload KIWAY_PLAYER virtual
bool OpenProjectFiles( const std::vector<wxString>& aFilenames, int aCtl = 0 ) override;
void OnExit( wxCommandEvent& event );
void OnLoadFile();
/**
@ -72,9 +71,16 @@ public:
wxWindow* GetToolCanvas() const override;
/**
* Event handler for the wxID_EXIT and wxID_CLOSE events.
*/
void OnExit( wxCommandEvent& aEvent );
protected:
void doReCreateMenuBar() override;
DECLARE_EVENT_TABLE();
private:
BITMAP2CMP_PANEL* m_panel;
wxStatusBar* m_statusBar;

View File

@ -53,6 +53,12 @@
#include "widgets/wx_menubar.h"
BEGIN_EVENT_TABLE( PCB_CALCULATOR_FRAME, EDA_BASE_FRAME )
EVT_MENU( wxID_CLOSE, PCB_CALCULATOR_FRAME::OnExit )
EVT_MENU( wxID_EXIT, PCB_CALCULATOR_FRAME::OnExit )
END_EVENT_TABLE()
PCB_CALCULATOR_FRAME::PCB_CALCULATOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
KIWAY_PLAYER( aKiway, aParent, FRAME_CALC, _( "Calculator Tools" ), wxDefaultPosition,
wxDefaultSize,
@ -138,6 +144,16 @@ PCB_CALCULATOR_FRAME::~PCB_CALCULATOR_FRAME()
}
void PCB_CALCULATOR_FRAME::OnExit( wxCommandEvent& aEvent )
{
if( aEvent.GetId() == wxID_EXIT )
Kiway().OnKiCadExit();
if( aEvent.GetId() == wxID_CLOSE || Kiface().IsSingle() )
Close( false );
}
void PCB_CALCULATOR_FRAME::loadPages()
{
m_treebook->AddPage( nullptr, _( "General system design" ) );

View File

@ -69,9 +69,16 @@ public:
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
/**
* Event handler for the wxID_EXIT and wxID_CLOSE events.
*/
void OnExit( wxCommandEvent& aEvent );
protected:
void doReCreateMenuBar() override;
DECLARE_EVENT_TABLE();
private:
// Event handlers
void OnClosePcbCalc( wxCloseEvent& event );