X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04ef50df3a0fa3c343800c554e609f98fc7575cc..2cc78389312dce6285d0d6b6e891d24372252ada:/src/msw/dialog.cpp diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 5b2aaf7a99..bc03783404 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -170,12 +170,30 @@ bool wxDialog::Create(wxWindow *parent, dlg = wxT("wxCaptionDialog"); else dlg = wxT("wxNoCaptionDialog"); + +#ifdef __WXMICROWIN__ + extern const wxChar *wxFrameClassName; + + int msflags = WS_OVERLAPPED|WS_POPUP; + if (style & wxCAPTION) + msflags |= WS_CAPTION; + if (style & wxCLIP_CHILDREN) + msflags |= WS_CLIPCHILDREN; + if ((style & wxTHICK_FRAME) == 0) + msflags |= WS_BORDER; + MSWCreate(m_windowId, parent, wxFrameClassName, this, NULL, + x, y, width, height, + msflags, + NULL, + extendedStyle); + +#else MSWCreate(m_windowId, parent, NULL, this, NULL, x, y, width, height, 0, // style is not used if we have dlg template dlg, extendedStyle); - +#endif HWND hwnd = (HWND)GetHWND(); if ( !hwnd ) @@ -185,8 +203,10 @@ bool wxDialog::Create(wxWindow *parent, return FALSE; } +#ifndef __WXMICROWIN__ SubclassWin(GetHWND()); - +#endif + SetWindowText(hwnd, title); return TRUE; @@ -194,6 +214,7 @@ bool wxDialog::Create(wxWindow *parent, bool wxDialog::EnableCloseButton(bool enable) { +#ifndef __WXMICROWIN__ // get system (a.k.a. window) menu HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE /* get it */); if ( !hmenu ) @@ -208,7 +229,7 @@ bool wxDialog::EnableCloseButton(bool enable) if ( !::EnableMenuItem(hmenu, SC_CLOSE, MF_BYCOMMAND | (enable ? MF_ENABLED : MF_GRAYED)) ) { - wxLogLastError(_T("DeleteMenu(SC_CLOSE)")); + wxLogLastError(_T("EnableMenuItem(SC_CLOSE)")); return FALSE; } @@ -218,7 +239,8 @@ bool wxDialog::EnableCloseButton(bool enable) { wxLogLastError(_T("DrawMenuBar")); } - +#endif + return TRUE; }