)
{
wxStatusBar* pStatusBar = NULL;
+ SWP vSwp;
+ ERRORID vError;
+ wxString sError;
+ HWND hWnd;
pStatusBar = wxFrameBase::OnCreateStatusBar( nNumber
,lulStyle
,vId
,rName
);
+ //
+ // The default parent set for the Statusbar is m_hWnd which, of course,
+ // 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.
+ //
+ hWnd = pStatusBar->GetHWND();
+ if (!::WinSetParent(hWnd, m_hFrame, FALSE))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ 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((HWND)pStatusBar->GetHWND(), &vSwp))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error querying frame for statusbar position. Error: %s\n", sError);
+ return NULL;
+ }
+ if (!::WinSetWindowPos( (HWND)pStatusBar->GetHWND()
+ ,HWND_TOP
+ ,vSwp.cx
+ ,vSwp.cy
+ ,vSwp.x
+ ,vSwp.y
+ ,SWP_SIZE | SWP_MOVE | SWP_SHOW | SWP_ZORDER
+ ))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error setting statusbar position. Error: %s\n", sError);
+ return NULL;
+ }
return pStatusBar;
} // end of wxFrame::OnCreateStatusBar
void wxFrame::PositionStatusBar()
{
+ SWP vSwp;
+ ERRORID vError;
+ wxString sError;
+
//
// Native status bar positions itself
//
,nWidth
,nStatbarHeight
);
+ if (!::WinQueryWindowPos(m_frameStatusBar->GetHWND(), &vSwp))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error setting parent for submenu. Error: %s\n", sError);
+ return;
+ }
+ if (!::WinSetWindowPos( m_frameStatusBar->GetHWND()
+ ,HWND_TOP
+ ,nStatbarWidth
+ ,nStatbarHeight
+ ,vSwp.x
+ ,vSwp.y
+ ,SWP_SIZE | SWP_MOVE | SWP_SHOW | SWP_ZORDER
+ ))
+ {
+ vError = ::WinGetLastError(vHabmain);
+ sError = wxPMErrorToStr(vError);
+ wxLogError("Error setting parent for submenu. Error: %s\n", sError);
+ return;
+ }
}
} // end of wxFrame::PositionStatusBar
#endif // wxUSE_STATUSBAR
HWND hTitlebar = NULLHANDLE;
HWND hHScroll = NULLHANDLE;
HWND hVScroll = NULLHANDLE;
- SWP vSwp;
- SWP vSwpClient;
- SWP vSwpTitlebar;
- SWP vSwpVScroll;
- SWP vSwpHScroll;
+ SWP vSwp[10];
+ RECTL vRect[10];
USHORT uCtlCount;
m_hDefaultIcon = (WXHICON) (wxSTD_FRAME_ICON ? wxSTD_FRAME_ICON : wxDEFAULT_FRAME_ICON);
if (ulStyle == wxDEFAULT_FRAME_STYLE)
ulCreateFlags = FCF_SIZEBORDER | FCF_TITLEBAR | FCF_SYSMENU |
- FCF_MINMAX | FCF_VERTSCROLL | FCF_HORZSCROLL | FCF_TASKLIST;
+ FCF_MINMAX | FCF_TASKLIST;
else
{
if ((ulStyle & wxCAPTION) == wxCAPTION)
else
ulCreateFlags = FCF_NOMOVEWITHOWNER;
+ if ((ulStyle & wxVSCROLL) == wxVSCROLL)
+ ulCreateFlags |= FCF_VERTSCROLL;
+ if ((ulStyle & wxHSCROLL) == wxHSCROLL)
+ ulCreateFlags |= FCF_HORZSCROLL;
if (ulStyle & wxMINIMIZE_BOX)
ulCreateFlags |= FCF_MINBUTTON;
if (ulStyle & wxMAXIMIZE_BOX)
//
// Create the frame window
//
- if ((m_hFrame = ::WinCreateWindow( hParent // Frame is parent
- ,WC_FRAME // standard frame class
- ,(PSZ)zTitle // Window title
- ,0 // No styles
- ,0, 0, 0, 0 // Window position
- ,NULLHANDLE // Owner
- ,HWND_TOP // Sibling
- ,(ULONG)nId // ID
- ,(PVOID)&flFrameCtlData // Creation data
- ,NULL // Window Pres Params
+ if ((m_hFrame = ::WinCreateWindow( hParent // Frame is parent
+ ,WC_FRAME // standard frame class
+ ,(PSZ)zTitle // Window title
+ ,0 // No styles
+ ,0, 0, 0, 0 // Window position
+ ,NULLHANDLE // Owner
+ ,HWND_TOP // Sibling
+ ,(ULONG)nId // ID
+ ,(PVOID)&vFrameCtlData // Creation data
+ ,NULL // Window Pres Params
)) == 0L)
{
return FALSE;
if (!wxWindow::OS2Create( m_hFrame
,wxFrameClassName
- ,NULL
+ ,NULL
,0L
,0L
,0L
,nY
,nWidth
,nHeight
- ,SWP_SIZE | SWP_MOVE | SWP_ACTIVATE
+ ,SWP_SIZE | SWP_MOVE | SWP_ACTIVATE | SWP_ZORDER
))
return FALSE;
- uCtlCount = ::WinSendMsg(m_hFrame, WM_FORMATFRAME, (MPARAM)pSwp, (MPARAM)pRect);
+ uCtlCount = SHORT1FROMMP(::WinSendMsg(m_hFrame, WM_FORMATFRAME, (MPARAM)vSwp, (MPARAM)vRect));
for (int i = 0; i < uCtlCount; i++)
{
- if (pSwp[i].hwnd == m_hFrame)
- memcpy(m_vSwp, pSwp[i], sizeof(SWP));
- else if (pSwp[i].hwnd == m_hVScroll)
- memcpy(m_vSwpVScroll, pSwp[i], sizeof(SWP));
- else if (pSwp[i].hwnd == m_hHScroll)
- memcpy(m_vSwpVScroll, pSwp[i], sizeof(SWP));
- else if (pSwp[i].hwnd == m_hTitleBar)
- memcpy(m_vSwpTitleBar, pSwp[i], sizeof(SWP));
+ if (vSwp[i].hwnd == m_hFrame)
+ memcpy(&m_vSwp, &vSwp[i], sizeof(SWP));
+ else if (vSwp[i].hwnd == m_hVScroll)
+ memcpy(&m_vSwpVScroll, &vSwp[i], sizeof(SWP));
+ else if (vSwp[i].hwnd == m_hHScroll)
+ memcpy(&m_vSwpVScroll, &vSwp[i], sizeof(SWP));
+ else if (vSwp[i].hwnd == m_hTitleBar)
+ memcpy(&m_vSwpTitleBar, &vSwp[i], sizeof(SWP));
}
//
,SV_CXSIZEBORDER/2
,(SV_CYSIZEBORDER/2) + m_vSwpHScroll.cy/2
,m_vSwp.cx - ((SV_CXSIZEBORDER + 1) + m_vSwpVScroll.cx)
- ,m_vSwp.cy - ((SV_CYSIZEBORDER + 1) + m_vSwpTitlebar.cy + m_vSwpHScroll.cy/2)
+ ,m_vSwp.cy - ((SV_CYSIZEBORDER + 1) + m_vSwpTitleBar.cy + m_vSwpHScroll.cy/2)
,SWP_SIZE | SWP_MOVE
);
WXMSG* pMsg
)
{
- if (wxWindow::OS2TranslateMessage(pMsg))
- return TRUE;
//
// try the menu bar accels
//
return FALSE;
const wxAcceleratorTable& rAcceleratorTable = pMenuBar->GetAccelTable();
- return rAcceleratorTable.Translate(this, pMsg);
+ return rAcceleratorTable.Translate(m_hFrame, pMsg);
} // end of wxFrame::OS2TranslateMessage
// ---------------------------------------------------------------------------
}
else
{
+ HPS hPS;
+ RECTL vRect;
+
+ hPS = WinBeginPaint(GetHwnd(), 0L, &vRect);
+ WinFillRect(hPS, &vRect, SYSCLR_WINDOW);
+ WinEndPaint(hPS);
+
return wxWindow::HandlePaint();
}
}
// Return TRUE to request PM to paint the window background
// in SYSCLR_WINDOW.
//
- bProcessed = TRUE;
+ bProcessed = TRUE;
mRc = (MRESULT)(TRUE);
break;