]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/frame.cpp
move wxIsDragResultOk out of line to avoid problems with DLL-exported inline function...
[wxWidgets.git] / src / os2 / frame.cpp
index c909d19d1638ce2503b65cdf3a0f3855ebddabbe..f7ab688deb7bbbfba3c572497ab5e5725e88f452 100644 (file)
     #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"
-
 // ----------------------------------------------------------------------------
 // globals
 // ----------------------------------------------------------------------------
@@ -703,7 +695,7 @@ void wxFrame::PositionToolBar()
                       ,&vTHeight
                      );
 
-    if (pToolBar->GetWindowStyleFlag() & wxTB_HORIZONTAL)
+    if (pToolBar->GetWindowStyleFlag() & wxTB_TOP)
     {
         vWidth = (wxCoord)(vRect.xRight - vRect.xLeft);
         pToolBar->SetSize( vRect.xLeft - vFRect.xLeft
@@ -712,6 +704,38 @@ void wxFrame::PositionToolBar()
                           ,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;
@@ -722,7 +746,7 @@ void wxFrame::PositionToolBar()
                                       ,&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
@@ -1100,20 +1124,34 @@ MRESULT EXPENTRY wxFrameMainWndProc( HWND   hWnd,
                 {
                     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;
                     }