X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4b02d42e37a2fc25e16644e5276ac3df22cd1690..c12822fec7f87e7734cabbfcf23b99685fc371ce:/src/msw/msgdlg.cpp diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index 04e2e68262..fcc722cb35 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -258,7 +258,7 @@ void wxMessageDialog::ReplaceStaticWithEdit() HWND hwndEdit = ::CreateWindow ( _T("EDIT"), - wxTextBuffer::Translate(text), + wxTextBuffer::Translate(text).wx_str(), WS_CHILD | WS_VSCROLL | WS_VISIBLE | ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL, rc.left, rc.top, @@ -446,9 +446,9 @@ int wxMessageDialog::ShowModal() HWND hWnd = m_parent ? GetHwndOf(m_parent) : NULL; // translate wx style in MSW - unsigned int msStyle = MB_OK; + unsigned int msStyle; const long wxStyle = GetMessageDialogStyle(); - if (wxStyle & wxYES_NO) + if ( wxStyle & wxYES_NO ) { #if !(defined(__SMARTPHONE__) && defined(__WXWINCE__)) if (wxStyle & wxCANCEL) @@ -457,17 +457,26 @@ int wxMessageDialog::ShowModal() #endif // !(__SMARTPHONE__ && __WXWINCE__) msStyle = MB_YESNO; - if (wxStyle & wxNO_DEFAULT) + if ( wxStyle & wxNO_DEFAULT ) msStyle |= MB_DEFBUTTON2; + else if ( wxStyle & wxCANCEL_DEFAULT ) + msStyle |= MB_DEFBUTTON3; } - - if (wxStyle & wxOK) + else // without Yes/No we're going to have an OK button { - if (wxStyle & wxCANCEL) + if ( wxStyle & wxCANCEL ) + { msStyle = MB_OKCANCEL; - else + + if ( wxStyle & wxCANCEL_DEFAULT ) + msStyle |= MB_DEFBUTTON2; + } + else // just "OK" + { msStyle = MB_OK; + } } + if (wxStyle & wxICON_EXCLAMATION) msStyle |= MB_ICONEXCLAMATION; else if (wxStyle & wxICON_HAND)