X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b494c48b31885ee0d9cd91e7931ac837e00144a0..8ddd9176a46065ab74d6ced1ed480e5affb4e1e2:/src/common/dlgcmn.cpp diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index f810b795a4..d7be904875 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -56,7 +56,8 @@ WX_DELEGATE_TO_CONTROL_CONTAINER(wxDialogBase) void wxDialogBase::Init() { m_returnCode = 0; - + m_affirmativeId = wxID_OK; + // the dialogs have this flag on by default to prevent the events from the // dialog controls from reaching the parent frame which is usually // undesirable and can lead to unexpected and hard to find bugs @@ -205,7 +206,7 @@ wxStdDialogButtonSizer *wxDialogBase::CreateStdDialogButtonSizer( long flags ) sizer->AddButton(help); } - sizer->Finalise(); + sizer->Realize(); if (flags & wxNO_DEFAULT) { @@ -228,6 +229,11 @@ wxStdDialogButtonSizer *wxDialogBase::CreateStdDialogButtonSizer( long flags ) yes->SetFocus(); } } + + if (flags & wxOK) + SetAffirmativeId(wxID_OK); + else if (flags & wxYES) + SetAffirmativeId(wxID_YES); return sizer; }