From cc938e7a6740e33279fa894c5dceefd8ca5c52ef Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 11 Nov 2021 00:32:50 +0000 Subject: [PATCH] Fix a few issues in the PCM dialog tune-up. --- kicad/pcm/dialogs/dialog_pcm.cpp | 11 +++++++++- kicad/pcm/dialogs/dialog_pcm.h | 1 + kicad/pcm/dialogs/dialog_pcm_base.cpp | 2 +- kicad/pcm/dialogs/dialog_pcm_base.fbp | 2 +- .../pcm/dialogs/panel_packages_view_base.cpp | 12 +++++------ .../pcm/dialogs/panel_packages_view_base.fbp | 20 +++++++++---------- kicad/pcm/dialogs/panel_packages_view_base.h | 2 +- 7 files changed, 30 insertions(+), 20 deletions(-) diff --git a/kicad/pcm/dialogs/dialog_pcm.cpp b/kicad/pcm/dialogs/dialog_pcm.cpp index c85e574e86..aaa701072f 100644 --- a/kicad/pcm/dialogs/dialog_pcm.cpp +++ b/kicad/pcm/dialogs/dialog_pcm.cpp @@ -32,7 +32,6 @@ #include "pgm_base.h" #include "settings/settings_manager.h" #include "thread" -#include "widgets/wx_progress_reporters.h" #include "widgets/wx_grid.h" #include @@ -136,6 +135,8 @@ DIALOG_PCM::DIALOG_PCM( wxWindow* parent ) : DIALOG_PCM_BASE( parent ) SetDefaultItem( m_sdbSizer1OK ); + Bind( wxEVT_CLOSE_WINDOW, &DIALOG_PCM::OnCloseWindow, this ); + SETTINGS_MANAGER& mgr = Pgm().GetSettingsManager(); KICAD_SETTINGS* app_settings = mgr.GetAppSettings(); @@ -174,6 +175,14 @@ void DIALOG_PCM::OnCloseClicked( wxCommandEvent& event ) } +void DIALOG_PCM::OnCloseWindow( wxCloseEvent& aEvent ) +{ + wxCommandEvent dummy; + + OnCloseClicked( dummy ); +} + + void DIALOG_PCM::OnManageRepositoriesClicked( wxCommandEvent& event ) { DIALOG_MANAGE_REPOSITORIES* dialog = new DIALOG_MANAGE_REPOSITORIES( this, m_pcm ); diff --git a/kicad/pcm/dialogs/dialog_pcm.h b/kicad/pcm/dialogs/dialog_pcm.h index d5d79efc03..6ed799f34f 100644 --- a/kicad/pcm/dialogs/dialog_pcm.h +++ b/kicad/pcm/dialogs/dialog_pcm.h @@ -41,6 +41,7 @@ public: ///< Closes the window, asks user confirmation if there are pending actions void OnCloseClicked( wxCommandEvent& event ) override; + void OnCloseWindow( wxCloseEvent& aEvent ); ///< Opens repository management dialog, saves changes to PCM void OnManageRepositoriesClicked( wxCommandEvent& event ) override; diff --git a/kicad/pcm/dialogs/dialog_pcm_base.cpp b/kicad/pcm/dialogs/dialog_pcm_base.cpp index 7f18679793..4ad0ccb5e0 100644 --- a/kicad/pcm/dialogs/dialog_pcm_base.cpp +++ b/kicad/pcm/dialogs/dialog_pcm_base.cpp @@ -42,7 +42,7 @@ DIALOG_PCM_BASE::DIALOG_PCM_BASE( wxWindow* parent, wxWindowID id, const wxStrin m_contentNotebook = new wxNotebook( m_panelRepository, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer4->Add( m_contentNotebook, 1, wxEXPAND | wxALL, 5 ); + bSizer4->Add( m_contentNotebook, 1, wxEXPAND|wxBOTTOM, 5 ); m_panelRepository->SetSizer( bSizer4 ); diff --git a/kicad/pcm/dialogs/dialog_pcm_base.fbp b/kicad/pcm/dialogs/dialog_pcm_base.fbp index 65f610fbd2..4b2625181b 100644 --- a/kicad/pcm/dialogs/dialog_pcm_base.fbp +++ b/kicad/pcm/dialogs/dialog_pcm_base.fbp @@ -335,7 +335,7 @@ 5 - wxEXPAND | wxALL + wxEXPAND|wxBOTTOM 1 1 diff --git a/kicad/pcm/dialogs/panel_packages_view_base.cpp b/kicad/pcm/dialogs/panel_packages_view_base.cpp index 6eb3853dab..acf759a521 100644 --- a/kicad/pcm/dialogs/panel_packages_view_base.cpp +++ b/kicad/pcm/dialogs/panel_packages_view_base.cpp @@ -14,10 +14,10 @@ PANEL_PACKAGES_VIEW_BASE::PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID wxBoxSizer* bSizer1; bSizer1 = new wxBoxSizer( wxVERTICAL ); - m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH ); + m_splitter1 = new wxSplitterWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSP_3DSASH|wxSP_LIVE_UPDATE ); m_splitter1->SetSashGravity( 0.5 ); m_splitter1->Connect( wxEVT_IDLE, wxIdleEventHandler( PANEL_PACKAGES_VIEW_BASE::m_splitter1OnIdle ), NULL, this ); - m_splitter1->SetMinimumPaneSize( 300 ); + m_splitter1->SetMinimumPaneSize( 380 ); m_panelList = new wxPanel( m_splitter1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bPanelListSizer; @@ -98,22 +98,22 @@ PANEL_PACKAGES_VIEW_BASE::PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID bSizerVersionButtons = new wxBoxSizer( wxHORIZONTAL ); m_showAllVersions = new wxCheckBox( m_scrolledWindow5, wxID_ANY, _("Show all versions"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerVersionButtons->Add( m_showAllVersions, 0, wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); + bSizerVersionButtons->Add( m_showAllVersions, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); bSizerVersionButtons->Add( 0, 0, 1, wxEXPAND, 5 ); m_buttonDownload = new wxButton( m_scrolledWindow5, wxID_ANY, _("Download"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerVersionButtons->Add( m_buttonDownload, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizerVersionButtons->Add( m_buttonDownload, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_buttonInstall = new wxButton( m_scrolledWindow5, wxID_ANY, _("Install"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerVersionButtons->Add( m_buttonInstall, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); + bSizerVersionButtons->Add( m_buttonInstall, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_sizerVersions->Add( bSizerVersionButtons, 0, wxEXPAND|wxRIGHT, 15 ); - bSizerScrolledWindow->Add( m_sizerVersions, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bSizerScrolledWindow->Add( m_sizerVersions, 0, wxEXPAND|wxRIGHT|wxLEFT, 3 ); m_scrolledWindow5->SetSizer( bSizerScrolledWindow ); diff --git a/kicad/pcm/dialogs/panel_packages_view_base.fbp b/kicad/pcm/dialogs/panel_packages_view_base.fbp index 7cf21b2a3f..a454e2e3ae 100644 --- a/kicad/pcm/dialogs/panel_packages_view_base.fbp +++ b/kicad/pcm/dialogs/panel_packages_view_base.fbp @@ -43,7 +43,7 @@ PANEL_PACKAGES_VIEW_BASE - 700,400 + 840,400 ; ; forward_declare @@ -89,7 +89,7 @@ 0 - 300 + 380 0 @@ -108,7 +108,7 @@ 1 wxSPLIT_VERTICAL - wxSP_3DSASH + wxSP_3DSASH|wxSP_LIVE_UPDATE ; ; forward_declare 0 @@ -339,7 +339,7 @@ 0 - + -1,-1 1 m_panelDetails 1 @@ -358,7 +358,7 @@ wxTAB_TRAVERSAL - + -1,-1 bPanelDetailsSizer wxVERTICAL none @@ -399,7 +399,7 @@ 0 - + -1,-1 1 m_scrolledWindow5 1 @@ -487,7 +487,7 @@ - 5 + 3 wxEXPAND|wxRIGHT|wxLEFT 0 @@ -595,7 +595,7 @@ none 5 - wxALIGN_CENTER_VERTICAL|wxTOP + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM 0 1 @@ -670,7 +670,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT + wxALIGN_CENTER_VERTICAL|wxALL 0 1 @@ -743,7 +743,7 @@ 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT + wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT 0 1 diff --git a/kicad/pcm/dialogs/panel_packages_view_base.h b/kicad/pcm/dialogs/panel_packages_view_base.h index 0f4244b62a..1683e3a38f 100644 --- a/kicad/pcm/dialogs/panel_packages_view_base.h +++ b/kicad/pcm/dialogs/panel_packages_view_base.h @@ -62,7 +62,7 @@ class PANEL_PACKAGES_VIEW_BASE : public wxPanel public: - PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 700,400 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); + PANEL_PACKAGES_VIEW_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 840,400 ), long style = wxTAB_TRAVERSAL, const wxString& name = wxEmptyString ); ~PANEL_PACKAGES_VIEW_BASE(); void m_splitter1OnIdle( wxIdleEvent& )