From 5eabe5bbbff99a9d043aedf7237ae9b4ae6210a8 Mon Sep 17 00:00:00 2001 From: David Webster Date: Tue, 2 May 2000 03:51:51 +0000 Subject: [PATCH] Statusbar updates. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/os2/frame.cpp | 16 +++++++++------- src/os2/menu.cpp | 11 +++++++---- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 420c18349b..5c2bd32aa8 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -472,6 +472,7 @@ wxStatusBar* wxFrame::OnCreateStatusBar( SWP vSwp; ERRORID vError; wxString sError; + HWND hWnd; pStatusBar = wxFrameBase::OnCreateStatusBar( nNumber ,lulStyle @@ -483,25 +484,26 @@ wxStatusBar* wxFrame::OnCreateStatusBar( // is the handle to the client window of the frame. We don't want that, // so we have to set the parent to actually be the Frame. // - ::WinSetParent(pStatusBar->GetHWND(), m_hFrame, FALSE); + hWnd = pStatusBar->GetHWND(); + if (!::WinSetParent(hWnd, m_hFrame, FALSE)) { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError("Error setting parent for submenu. Error: %s\n", sError); - return NULL; + wxLogError("Error setting parent for statusbar. Error: %s\n", sError); +// return NULL; } // // Also we need to reset it positioning to enable the SHOW attribute // - if (!::WinQueryWindowPos(pStatusBar->GetHWND(), &vSwp)) + if (!::WinQueryWindowPos((HWND)pStatusBar->GetHWND(), &vSwp)) { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError("Error setting parent for submenu. Error: %s\n", sError); + wxLogError("Error querying frame for statusbar position. Error: %s\n", sError); return NULL; } - if (!::WinSetWindowPos( pStatusBar->GetHWND() + if (!::WinSetWindowPos( (HWND)pStatusBar->GetHWND() ,HWND_TOP ,vSwp.cx ,vSwp.cy @@ -512,7 +514,7 @@ wxStatusBar* wxFrame::OnCreateStatusBar( { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError("Error setting parent for submenu. Error: %s\n", sError); + wxLogError("Error setting statusbar position. Error: %s\n", sError); return NULL; } return pStatusBar; diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index 656fc38c29..b0f6028fff 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -325,17 +325,20 @@ bool wxMenu::DoInsertOrAppend( if (nPos == (size_t)-1) { - rItem.iPosition = MIT_END; + rItem.iPosition = MIT_END; } else { - rItem.iPosition = nPos; + rItem.iPosition = nPos; } APIRET rc; - rc = (APIRET)::WinSendMsg(GetHmenu(), MM_INSERTITEM, - (MPARAM)&rItem, (MPARAM)pData); + rc = (APIRET)::WinSendMsg( GetHmenu() + ,MM_INSERTITEM + ,(MPARAM)&rItem + ,(MPARAM)pData + ); if (rc == MIT_MEMERROR || rc == MIT_ERROR) { vError = ::WinGetLastError(vHabmain);