Make OK button default in wxGTK wxMessageDialog by default

Under wxGTK the default button in wxMessageDialog with style wxOK was set to
"Cancel", whether the wxOK_DEFAULT style was specified or not.

Now it is set to "OK", as expected, and wxCANCEL_DEFAULT needs to be
explicitly specified to focus the "Cancel" one.

Closes https://github.com/wxWidgets/wxWidgets/pull/267
This commit is contained in:
Micha Ahrweiler
2016-04-07 11:03:45 +02:00
committed by Vadim Zeitlin
parent 7255a8fb7f
commit a374801465

View File

@@ -214,6 +214,8 @@ void wxMessageDialog::GTKCreateMsgDialog()
defaultButton = GTK_RESPONSE_NO; defaultButton = GTK_RESPONSE_NO;
else if ( m_dialogStyle & wxYES_NO ) else if ( m_dialogStyle & wxYES_NO )
defaultButton = GTK_RESPONSE_YES; defaultButton = GTK_RESPONSE_YES;
else if ( m_dialogStyle & wxOK )
defaultButton = GTK_RESPONSE_OK;
else // No need to change the default value, whatever it is. else // No need to change the default value, whatever it is.
defaultButton = GTK_RESPONSE_NONE; defaultButton = GTK_RESPONSE_NONE;