wxRichMessageDialog with only OK button returns wxID_CANCEL when you click OK.
|Reported by:||snowleopard2||Owned by:|
Create a wxRichMessageDialog with just an OK button (wxOK style), show it, click the OK button. Note that the return code from ShowModal will be wxID_CANCEL and not wxID_OK. Example code:
wxRichMessageDialog msg(wxTheApp->GetTopWindow(), wxT("hi"), wxT("hi"), wxOK|wxICON_INFORMATION); const int dlgResponse = msg.ShowModal();//hitting OK will return wxID_CANCEL (5101)
Interestingly, if you add a Cancel button (add wxCANCEL to the style) and do the same thing then it returns the correct code. So it seems that just having one button causes the wrong code to be returned. This was working OK in earlier daily (2.9+) builds, seems to be new in the latest 3.1 builds.
I'm in Windows 8.1, but this appears to be a generic control, so it may happen elsewhere.