add wxCANCEL_DEFAULT support

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2008-09-12 00:06:42 +00:00
parent 72513c369e
commit 24689293df

View File

@ -208,10 +208,16 @@ void wxMessageDialog::GTKCreateMsgDialog()
}
}
gtk_dialog_set_default_response(dlg,
m_dialogStyle & wxNO_DEFAULT
? GTK_RESPONSE_NO
: GTK_RESPONSE_YES);
// it'd probably be harmless to call gtk_dialog_set_default_response()
// twice but why do it if we're going to change the default below
// anyhow
if ( !(m_dialogStyle & wxCANCEL_DEFAULT) )
{
gtk_dialog_set_default_response(dlg,
m_dialogStyle & wxNO_DEFAULT
? GTK_RESPONSE_NO
: GTK_RESPONSE_YES);
}
}
else if ( addButtons ) // Ok or Ok/Cancel dialog
{
@ -222,6 +228,11 @@ void wxMessageDialog::GTKCreateMsgDialog()
GTK_RESPONSE_CANCEL);
}
}
if ( m_dialogStyle & wxCANCEL_DEFAULT )
{
gtk_dialog_set_default_response(dlg, GTK_RESPONSE_CANCEL);
}
}
int wxMessageDialog::ShowModal()