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,
// use the top level window as parent if none specified
if ( !m_parent )
- m_parent = FindSuitableParent();
+ m_parent = GetParentForModalDialog();
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)
#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)