From 58fe89a05006c8550ca5edc482ec6c10efde2c04 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sat, 29 May 2021 21:51:06 +0100 Subject: [PATCH] Fix some issues with button alignment and order on OSX. --- common/dialogs/dialog_locked_items_query.cpp | 8 +- .../dialog_locked_items_query_base.cpp | 22 ++--- .../dialog_locked_items_query_base.fbp | 98 ++----------------- .../dialogs/dialog_locked_items_query_base.h | 4 +- 4 files changed, 24 insertions(+), 108 deletions(-) diff --git a/common/dialogs/dialog_locked_items_query.cpp b/common/dialogs/dialog_locked_items_query.cpp index f3a0a9ff36..9d5adf6a9f 100644 --- a/common/dialogs/dialog_locked_items_query.cpp +++ b/common/dialogs/dialog_locked_items_query.cpp @@ -31,8 +31,12 @@ DIALOG_LOCKED_ITEMS_QUERY::DIALOG_LOCKED_ITEMS_QUERY( wxWindow* aParent, int aLo m_messageLine1->SetLabel( wxString::Format( m_messageLine1->GetLabel(), aLockedItemCount ) ); - m_removeBtn->SetDefault(); - m_removeBtn->SetFocus(); + m_sdbSizerOK->SetLabel( _( "Skip Locked Items" ) ); + m_sdbSizerOK->SetToolTip( _( "Remove locked items from the selection and only apply the " + "operation to the unlocked items (if any)." ) ); + m_sdbSizerOK->SetDefault(); + m_sdbSizerOK->SetFocus(); + Layout(); // Now all widgets have the size fixed, call FinishDialogSettings diff --git a/common/dialogs/dialog_locked_items_query_base.cpp b/common/dialogs/dialog_locked_items_query_base.cpp index 985d5e1532..4c3c27643b 100644 --- a/common/dialogs/dialog_locked_items_query_base.cpp +++ b/common/dialogs/dialog_locked_items_query_base.cpp @@ -36,7 +36,7 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent bSizer4->Add( m_messageLine2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - fgSizer4->Add( bSizer4, 1, wxEXPAND, 5 ); + fgSizer4->Add( bSizer4, 1, wxEXPAND|wxRIGHT, 5 ); fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -55,25 +55,19 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent m_overrideBtn = new wxButton( this, wxID_ANY, _("Override Locks"), wxDefaultPosition, wxDefaultSize, 0 ); m_overrideBtn->SetToolTip( _("Override locks and apply the operation on all the items selected.\nAny locked items will remain locked after the operation is complete.") ); - bButtonSizer->Add( m_overrideBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_removeBtn = new wxButton( this, wxID_ANY, _("Skip Locked Items"), wxDefaultPosition, wxDefaultSize, 0 ); - m_removeBtn->SetToolTip( _("Remove locked items from the selection and only apply the operation to the unlocked items (if any).") ); - - bButtonSizer->Add( m_removeBtn, 0, wxALL, 5 ); - - - bButtonSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + bButtonSizer->Add( m_overrideBtn, 0, wxALL, 10 ); m_sdbSizer = new wxStdDialogButtonSizer(); + m_sdbSizerOK = new wxButton( this, wxID_OK ); + m_sdbSizer->AddButton( m_sdbSizerOK ); m_sdbSizerCancel = new wxButton( this, wxID_CANCEL ); m_sdbSizer->AddButton( m_sdbSizerCancel ); m_sdbSizer->Realize(); - bButtonSizer->Add( m_sdbSizer, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bButtonSizer->Add( m_sdbSizer, 1, wxALL, 5 ); - bSizerMain->Add( bButtonSizer, 0, wxEXPAND|wxTOP|wxLEFT, 10 ); + bSizerMain->Add( bButtonSizer, 0, wxEXPAND|wxALL, 5 ); this->SetSizer( bSizerMain ); @@ -83,8 +77,8 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::DIALOG_LOCKED_ITEMS_QUERY_BASE( wxWindow* parent // Connect Events this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) ); m_overrideBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this ); - m_removeBtn->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); m_sdbSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onCancelClick ), NULL, this ); + m_sdbSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); } DIALOG_LOCKED_ITEMS_QUERY_BASE::~DIALOG_LOCKED_ITEMS_QUERY_BASE() @@ -92,7 +86,7 @@ DIALOG_LOCKED_ITEMS_QUERY_BASE::~DIALOG_LOCKED_ITEMS_QUERY_BASE() // Disconnect Events this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::OnInitDlg ) ); m_overrideBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOverrideLocks ), NULL, this ); - m_removeBtn->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); m_sdbSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onCancelClick ), NULL, this ); + m_sdbSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_LOCKED_ITEMS_QUERY_BASE::onOkClick ), NULL, this ); } diff --git a/common/dialogs/dialog_locked_items_query_base.fbp b/common/dialogs/dialog_locked_items_query_base.fbp index e318853022..2c39eb38a5 100644 --- a/common/dialogs/dialog_locked_items_query_base.fbp +++ b/common/dialogs/dialog_locked_items_query_base.fbp @@ -135,7 +135,7 @@ 5 - wxEXPAND + wxEXPAND|wxRIGHT 1 @@ -343,8 +343,8 @@ - 10 - wxEXPAND|wxTOP|wxLEFT + 5 + wxEXPAND|wxALL 0 @@ -352,8 +352,8 @@ wxHORIZONTAL none - 5 - wxALIGN_CENTER_VERTICAL|wxALL + 10 + wxALL 0 1 @@ -426,104 +426,22 @@ 5 - wxEXPAND + wxALL 1 - - 0 - protected - 0 - - - - 5 - wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM - 0 - - 1 - 1 - 1 - 1 - - - - - - - - - 1 - 0 - 1 - - 1 - - 0 - 0 - - Dock - 0 - Left - 1 - - 1 - - - 0 - 0 - wxID_ANY - Skip Locked Items - - 0 - - 0 - - - 0 - - 1 - m_removeBtn - 1 - - - protected - 1 - - - - Resizable - 1 - - - - 0 - Remove locked items from the selection and only apply the operation to the unlocked items (if any). - - wxFILTER_NONE - wxDefaultValidator - - - - - onOkClick - - - - 5 - wxALL|wxALIGN_CENTER_VERTICAL - 0 0 1 0 0 0 - 0 + 1 0 0 m_sdbSizer protected onCancelClick + onOkClick diff --git a/common/dialogs/dialog_locked_items_query_base.h b/common/dialogs/dialog_locked_items_query_base.h index 8f531455cb..8efe844d39 100644 --- a/common/dialogs/dialog_locked_items_query_base.h +++ b/common/dialogs/dialog_locked_items_query_base.h @@ -42,15 +42,15 @@ class DIALOG_LOCKED_ITEMS_QUERY_BASE : public DIALOG_SHIM wxStaticText* m_messageLine2; wxCheckBox* m_doNotShowBtn; wxButton* m_overrideBtn; - wxButton* m_removeBtn; wxStdDialogButtonSizer* m_sdbSizer; + wxButton* m_sdbSizerOK; wxButton* m_sdbSizerCancel; // Virtual event handlers, overide them in your derived class virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); } virtual void onOverrideLocks( wxCommandEvent& event ) { event.Skip(); } - virtual void onOkClick( wxCommandEvent& event ) { event.Skip(); } virtual void onCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void onOkClick( wxCommandEvent& event ) { event.Skip(); } public: