Statusbar updates.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7334 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -472,6 +472,7 @@ wxStatusBar* wxFrame::OnCreateStatusBar(
|
|||||||
SWP vSwp;
|
SWP vSwp;
|
||||||
ERRORID vError;
|
ERRORID vError;
|
||||||
wxString sError;
|
wxString sError;
|
||||||
|
HWND hWnd;
|
||||||
|
|
||||||
pStatusBar = wxFrameBase::OnCreateStatusBar( nNumber
|
pStatusBar = wxFrameBase::OnCreateStatusBar( nNumber
|
||||||
,lulStyle
|
,lulStyle
|
||||||
@@ -483,25 +484,26 @@ wxStatusBar* wxFrame::OnCreateStatusBar(
|
|||||||
// is the handle to the client window of the frame. We don't want that,
|
// 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.
|
// 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);
|
vError = ::WinGetLastError(vHabmain);
|
||||||
sError = wxPMErrorToStr(vError);
|
sError = wxPMErrorToStr(vError);
|
||||||
wxLogError("Error setting parent for submenu. Error: %s\n", sError);
|
wxLogError("Error setting parent for statusbar. Error: %s\n", sError);
|
||||||
return NULL;
|
// return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Also we need to reset it positioning to enable the SHOW attribute
|
// 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);
|
vError = ::WinGetLastError(vHabmain);
|
||||||
sError = wxPMErrorToStr(vError);
|
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;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (!::WinSetWindowPos( pStatusBar->GetHWND()
|
if (!::WinSetWindowPos( (HWND)pStatusBar->GetHWND()
|
||||||
,HWND_TOP
|
,HWND_TOP
|
||||||
,vSwp.cx
|
,vSwp.cx
|
||||||
,vSwp.cy
|
,vSwp.cy
|
||||||
@@ -512,7 +514,7 @@ wxStatusBar* wxFrame::OnCreateStatusBar(
|
|||||||
{
|
{
|
||||||
vError = ::WinGetLastError(vHabmain);
|
vError = ::WinGetLastError(vHabmain);
|
||||||
sError = wxPMErrorToStr(vError);
|
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 NULL;
|
||||||
}
|
}
|
||||||
return pStatusBar;
|
return pStatusBar;
|
||||||
|
@@ -325,17 +325,20 @@ bool wxMenu::DoInsertOrAppend(
|
|||||||
|
|
||||||
if (nPos == (size_t)-1)
|
if (nPos == (size_t)-1)
|
||||||
{
|
{
|
||||||
rItem.iPosition = MIT_END;
|
rItem.iPosition = MIT_END;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
rItem.iPosition = nPos;
|
rItem.iPosition = nPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
APIRET rc;
|
APIRET rc;
|
||||||
|
|
||||||
rc = (APIRET)::WinSendMsg(GetHmenu(), MM_INSERTITEM,
|
rc = (APIRET)::WinSendMsg( GetHmenu()
|
||||||
(MPARAM)&rItem, (MPARAM)pData);
|
,MM_INSERTITEM
|
||||||
|
,(MPARAM)&rItem
|
||||||
|
,(MPARAM)pData
|
||||||
|
);
|
||||||
if (rc == MIT_MEMERROR || rc == MIT_ERROR)
|
if (rc == MIT_MEMERROR || rc == MIT_ERROR)
|
||||||
{
|
{
|
||||||
vError = ::WinGetLastError(vHabmain);
|
vError = ::WinGetLastError(vHabmain);
|
||||||
|
Reference in New Issue
Block a user