From cd4266792ace62e923ca678ec926765e51a977d0 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 29 Jan 2018 14:56:39 -0500 Subject: [PATCH] Comment how AddStandardButtons sets default; remove redundant call --- src/ShuttleGui.h | 7 ++++++- src/prefs/PrefsDialog.cpp | 1 - 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index be9693d5a..9c71b564d 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -429,7 +429,12 @@ public: ShuttleGui & Prop( int iProp ){ ShuttleGuiBase::Prop(iProp); return *this;}; // Has to be here too, to return a ShuttleGui and not a ShuttleGuiBase. GuiWaveTrack * AddGuiWaveTrack( const wxString & Name); AttachableScrollBar * AddAttachableScrollBar( long style = wxSB_HORIZONTAL ); - void AddStandardButtons( long buttons = eOkButton | eCancelButton, wxButton *extra = NULL ); + + // The first of these buttons, if any, that is included will be default: + // Apply, Yes, OK + void AddStandardButtons( + long buttons = eOkButton | eCancelButton, wxButton *extra = NULL ); + wxSizerItem * AddSpace( int width, int height ); wxSizerItem * AddSpace( int size ) { return AddSpace( size, size ); }; diff --git a/src/prefs/PrefsDialog.cpp b/src/prefs/PrefsDialog.cpp index c1b7efaa5..abb860689 100644 --- a/src/prefs/PrefsDialog.cpp +++ b/src/prefs/PrefsDialog.cpp @@ -617,7 +617,6 @@ PrefsDialog::PrefsDialog S.EndVerticalLay(); S.AddStandardButtons(eOkButton | eCancelButton | ePreviewButton | eHelpButton); - static_cast(wxWindow::FindWindowById(wxID_OK, this))->SetDefault(); if (mUniquePage && !mUniquePage->ShowsPreviewButton()) { wxWindow *const previewButton =