From 29a99be398541dd5a592b7532d30c2d54b188378 Mon Sep 17 00:00:00 2001 From: David Webster Date: Mon, 28 Feb 2000 23:47:35 +0000 Subject: [PATCH] no message git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6340 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/os2/setup.h | 2 ++ include/wx/os2/setup0.h | 2 ++ src/os2/frame.cpp | 28 +++++++++++++++------------- src/os2/window.cpp | 4 ++++ 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/include/wx/os2/setup.h b/include/wx/os2/setup.h index 8132d6b0d0..8ac9024a09 100644 --- a/include/wx/os2/setup.h +++ b/include/wx/os2/setup.h @@ -26,6 +26,8 @@ // General features // ---------------------------------------------------------------------------- +#define wxUSE_FILESYSTEM 1 // better have this is you want to compile wxHTML + #define wxUSE_PCX 1 // Utilize PCX images #define wxUSE_PNM 1 // Utilize PNM images diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index 8132d6b0d0..8ac9024a09 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -26,6 +26,8 @@ // General features // ---------------------------------------------------------------------------- +#define wxUSE_FILESYSTEM 1 // better have this is you want to compile wxHTML + #define wxUSE_PCX 1 // Utilize PCX images #define wxUSE_PNM 1 // Utilize PNM images diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 4c15e005b4..d697f9ca5d 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -527,23 +527,25 @@ void wxFrame::SetMenuBar( return; } - wxCHECK_RET(!pMenuBar->GetFrame(), wxT("this menubar is already attached")); + m_frameMenuBar = NULL; - if (m_frameMenuBar) - delete m_frameMenuBar; - - m_hMenu = pMenuBar->Create(); - m_ulMenubarId = pMenuBar->GetMenubarId(); - if (m_ulMenubarId != FID_MENU) + // Can set a menubar several times. + // TODO: how to prevent a memory leak if you have a currently-unattached + // menubar? wxWindows assumes that the frame will delete the menu (otherwise + // there are problems for MDI). + if (pMenuBar->GetHMenu()) { - ::WinSetWindowUShort( m_hMenu - ,QWS_ID - ,(unsigned short)m_ulMenubarId - ); + m_hMenu = pMenuBar->GetHMenu(); } + else + { + pMenuBar->Detach(); - if (!m_hMenu) - return; + m_hMenu = pMenuBar->Create(); + + if (!m_hMenu) + return; + } InternalSetMenuBar(); diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 01e0e83c30..c4b8665f2b 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -84,6 +84,10 @@ #define GET_Y_LPARAM(mp) ((unsigned short)(unsigned long)(mp >> 16)) #endif // GET_X_LPARAM +#ifndef CW_USEDEFAULT +# define CW_USEDEFAULT ((int)0x80000000) +#endif + // --------------------------------------------------------------------------- // global variables // --------------------------------------------------------------------------- -- 2.45.2