/////////////////////////////////////////////////////////////////////////////
-// Name: frame.cpp
+// Name: src/os2/frame.cpp
// Purpose: wxFrame
// Author: David Webster
// Modified by:
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
- #include "wx/defs.h"
#include "wx/object.h"
#include "wx/dynarray.h"
#include "wx/list.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/event.h"
- #include "wx/setup.h"
#include "wx/frame.h"
#include "wx/menu.h"
#include "wx/app.h"
#include "wx/settings.h"
#include "wx/dcclient.h"
#include "wx/mdi.h"
+ #include "wx/toolbar.h"
+ #include "wx/statusbr.h"
+ #include "wx/menuitem.h"
#endif // WX_PRECOMP
#include "wx/os2/private.h"
-#if wxUSE_STATUSBAR
- #include "wx/statusbr.h"
- #include "wx/generic/statusbr.h"
-#endif // wxUSE_STATUSBAR
-
-#if wxUSE_TOOLBAR
- #include "wx/toolbar.h"
-#endif // wxUSE_TOOLBAR
-
-#include "wx/menuitem.h"
-#include "wx/log.h"
-
// ----------------------------------------------------------------------------
// globals
// ----------------------------------------------------------------------------
-extern wxList WXDLLEXPORT wxPendingDelete;
-
#if wxUSE_MENUS_NATIVE
extern wxMenu *wxCurrentPopupMenu;
#endif
-extern void wxAssociateWinWithHandle( HWND hWnd
- ,wxWindowOS2* pWin
- );
-
// ----------------------------------------------------------------------------
// event tables
// ----------------------------------------------------------------------------
,nHeight
);
- ::WinSetParent( pStatusBar->GetHWND()
- ,m_hFrame
- ,FALSE
- );
- ::WinSetOwner( pStatusBar->GetHWND()
- ,m_hFrame
- );
+ ::WinSetParent( pStatusBar->GetHWND(), m_hFrame, FALSE );
+ ::WinSetOwner( pStatusBar->GetHWND(), m_hFrame);
//
// to show statusbar
//
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
- wxLogError(_T("Error setting parent for StautsBar. Error: %s\n"), sError.c_str());
+ wxLogError(_T("Error setting parent for StatusBar. Error: %s\n"), sError.c_str());
return;
}
}
#endif // wxUSE_STATUSBAR
#if wxUSE_TOOLBAR
-wxToolBar* wxFrame::OnCreateToolBar(
- long lStyle
-, wxWindowID vId
-, const wxString& rsName
-)
+wxToolBar* wxFrame::OnCreateToolBar( long lStyle, wxWindowID vId, const wxString& rsName )
{
wxToolBar* pToolBar = wxFrameBase::OnCreateToolBar( lStyle
,vId
,rsName
);
- ::WinSetParent( pToolBar->GetHWND()
- ,m_hFrame
- ,FALSE
- );
- ::WinSetOwner( pToolBar->GetHWND()
- ,m_hFrame
- );
+ ::WinSetParent( pToolBar->GetHWND(), m_hFrame, FALSE);
+ ::WinSetOwner( pToolBar->GetHWND(), m_hFrame);
return pToolBar;
} // end of WinGuiBase_CFrame::OnCreateToolBar
#endif
::WinQueryWindowRect(HWND_DESKTOP, &vRect);
nWidth = vRect.xRight - vRect.xLeft;
//
- // Rmember OS/2 is backwards!
+ // Remember OS/2 is backwards!
//
nHeight = vRect.yTop - vRect.yBottom;
,&vTHeight
);
- if (pToolBar->GetWindowStyleFlag() & wxTB_HORIZONTAL)
+ if (pToolBar->GetWindowStyleFlag() & wxTB_TOP)
{
vWidth = (wxCoord)(vRect.xRight - vRect.xLeft);
pToolBar->SetSize( vRect.xLeft - vFRect.xLeft
,vTHeight
);
}
+ else if (pToolBar->GetWindowStyleFlag() & wxTB_BOTTOM)
+ {
+ wxCoord vSwidth = 0;
+ wxCoord vSheight = 0;
+
+ if (m_frameStatusBar)
+ m_frameStatusBar->GetSize( &vSwidth
+ ,&vSheight
+ );
+ vWidth = (wxCoord)(vRect.xRight - vRect.xLeft);
+ pToolBar->SetSize( vRect.xLeft - vFRect.xLeft
+ ,vFRect.yTop - vRect.yBottom - vTHeight - vSheight
+ ,vWidth
+ ,vTHeight
+ );
+ }
+ else if (pToolBar->GetWindowStyleFlag() & wxTB_LEFT)
+ {
+ wxCoord vSwidth = 0;
+ wxCoord vSheight = 0;
+
+ if (m_frameStatusBar)
+ m_frameStatusBar->GetSize( &vSwidth
+ ,&vSheight
+ );
+ vHeight = (wxCoord)(vRect.yTop - vRect.yBottom);
+ pToolBar->SetSize( vRect.xLeft - vRect.xLeft
+ ,vPos.y
+ ,vTWidth
+ ,vHeight - vSheight
+ );
+ }
else
{
wxCoord vSwidth = 0;
,&vSheight
);
vHeight = (wxCoord)(vRect.yTop - vRect.yBottom);
- pToolBar->SetSize( vRect.xLeft - vFRect.xLeft
+ pToolBar->SetSize( vRect.xRight - vFRect.xLeft - vTWidth
,vPos.y
,vTWidth
,vHeight - vSheight
::WinQueryWindowRect(GetHwnd(), &vRect3);
-#if !(defined(__WATCOMC__) && __WATCOMC__ < 1240 )
-// Open Watcom 1.3 had incomplete headers
-// that's reported and should be fixed for OW 1.4
-
static const int nIconWidth = 32;
static const int nIconHeight = 32;
int nIconX = (int)((vRect3.xRight - nIconWidth)/2);
int nIconY = (int)((vRect3.yBottom + nIconHeight)/2);
::WinDrawPointer(hPs, nIconX, nIconY, hIcon, DP_NORMAL);
-#endif
}
::WinEndPaint(hPs);
}
}
else
{
- DoGiveHelp(wxEmptyString, false);
+ DoGiveHelp(wxEmptyString, true);
return false;
}
}
{
if(pWnd->m_hWnd && pSWP[i].hwnd == pWnd->m_hWnd)
{
- if (pWnd->m_frameToolBar && pWnd->m_frameToolBar->GetWindowStyleFlag() & wxTB_HORIZONTAL)
+ if (pWnd->m_frameToolBar && pWnd->m_frameToolBar->GetWindowStyleFlag() & wxTB_TOP)
{
pSWP[i].x = vRectl.xLeft;
pSWP[i].y = vRectl.yBottom + nHeight;
pSWP[i].cx = vRectl.xRight - vRectl.xLeft;
pSWP[i].cy = vRectl.yTop - vRectl.yBottom - (nHeight + nHeight2);
}
- else
+ else if (pWnd->m_frameToolBar && pWnd->m_frameToolBar->GetWindowStyleFlag() & wxTB_BOTTOM)
+ {
+ pSWP[i].x = vRectl.xLeft;
+ pSWP[i].y = vRectl.yBottom + nHeight + nHeight2;
+ pSWP[i].cx = vRectl.xRight - vRectl.xLeft;
+ pSWP[i].cy = vRectl.yTop - vRectl.yBottom - (nHeight + nHeight2);
+ }
+ else if (pWnd->m_frameToolBar && pWnd->m_frameToolBar->GetWindowStyleFlag() & wxTB_LEFT)
{
pSWP[i].x = vRectl.xLeft + nWidth;
pSWP[i].y = vRectl.yBottom + nHeight;
pSWP[i].cx = vRectl.xRight - (vRectl.xLeft + nWidth);
pSWP[i].cy = vRectl.yTop - vRectl.yBottom - nHeight;
}
+ else
+ {
+ pSWP[i].x = vRectl.xLeft;
+ pSWP[i].y = vRectl.yBottom + nHeight;
+ pSWP[i].cx = vRectl.xRight - (vRectl.xLeft + nWidth);
+ pSWP[i].cy = vRectl.yTop - vRectl.yBottom - nHeight;
+ }
pSWP[i].fl = SWP_SIZE | SWP_MOVE | SWP_SHOW;
pSWP[i].hwndInsertBehind = HWND_TOP;
}