]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/dc.cpp
reSWIGed
[wxWidgets.git] / src / os2 / dc.cpp
index 20d3f61a4ca0cd3750e1de978f2406dc8a38a1b1..dfdcab5f4cbc6468e83ee28f1525b522ce83f196 100644 (file)
     #include "wx/log.h"
     #include "wx/icon.h"
     #include "wx/msgdlg.h"
-    #include "wx/module.h"
+#if wxUSE_STATUSBAR
+    #include "wx/statusbr.h"
+#endif
 #endif
 
+#include "wx/module.h"
 #include "wx/dcprint.h"
 
 #include <string.h>
@@ -1038,7 +1041,7 @@ void wxDC::DoDrawRectangle(
         if(m_brush.GetStyle() == wxTRANSPARENT)
             lControl = DRO_OUTLINE;
 
-        ::GpiSetColor(m_hPS, lColor);
+        ::GpiSetColor(m_hPS, lBorderColor);
         ::GpiBox( m_hPS       // handle to a presentation space
                  ,lControl   // draw the box outline ? or ?
                  ,&vPoint[1]  // address of the corner
@@ -1390,7 +1393,7 @@ void wxDC::DoDrawBitmap(
                 //
                 // Need to get a background color for mask blitting
                 //
-                if (IsKindOf(CLASSINFO(wxPaintDC)))
+                if (IsKindOf(CLASSINFO(wxWindowDC)))
                 {
                     wxWindowDC*             pWindowDC = wxDynamicCast(this, wxWindowDC);
 
@@ -1769,14 +1772,25 @@ void wxDC::DrawAnyText(
           m_vRclPaint.yBottom == 0 &&
           m_vRclPaint.xRight == 0 &&
           m_vRclPaint.xLeft == 0))
-        vPtlStart.y = OS2Y(vY,vTextY/1.5); // Full extent is a bit much
+    {
+        //
+        // Position Text a little differently in the Statusbar from other panels
+        //
+        if (m_pCanvas && m_pCanvas->IsKindOf(CLASSINFO(wxStatusBar)))
+            vPtlStart.y = OS2Y(vY,vTextY);
+        else
+            vPtlStart.y = OS2Y(vY,vTextY/1.5); // Full extent is a bit much
+    }
     else
     {
         if (m_vSelectedBitmap != wxNullBitmap)
         {
             m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight();
             m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth();
-            vPtlStart.y = OS2Y(vY,vTextY/1.5);
+            if (m_pCanvas && m_pCanvas->IsKindOf(CLASSINFO(wxStatusBar)))
+                vPtlStart.y = OS2Y(vY,vTextY);
+            else
+                vPtlStart.y = OS2Y(vY,vTextY/1.5);
         }
         else
             vPtlStart.y = vY;
@@ -2634,25 +2648,25 @@ bool wxDC::DoBlit(
             hBufBitmap = ::GpiCreateBitmap(GetHPS(), &vBmpHdr, 0L, NULL, NULL);
         }
 
-        POINTL                          aPoint1[4] = { 0, 0
-                                                      ,vWidth, vHeight
-                                                      ,vXdest, vYdest
-                                                      ,vXdest + vWidth, vYdest + vHeight
+        POINTL                          aPoint1[4] = { {0, 0}
+                                                     ,{vWidth, vHeight}
+                                                     ,{vXdest, vYdest}
+                                                     ,{vXdest + vWidth, vYdest + vHeight}
                                                      };
-        POINTL                          aPoint2[4] = { 0, 0
-                                                      ,vWidth, vHeight
-                                                      ,vXsrc, vYsrc
-                                                      ,vXsrc + vWidth, vYsrc + vHeight
+        POINTL                          aPoint2[4] = { {0, 0}
+                                                     ,{vWidth, vHeight}
+                                                     ,{vXsrc, vYsrc}
+                                                     ,{vXsrc + vWidth, vYsrc + vHeight}
                                                      };
-        POINTL                          aPoint3[4] = { vXdest, vYdest
-                                                      ,vXdest + vWidth, vYdest + vHeight
-                                                      ,vXsrc, vYsrc
-                                                      ,vXsrc + vWidth, vYsrc + vHeight
+        POINTL                          aPoint3[4] = { {vXdest, vYdest}
+                                                     ,{vXdest + vWidth, vYdest + vHeight}
+                                                     ,{vXsrc, vYsrc}
+                                                     ,{vXsrc + vWidth, vYsrc + vHeight}
                                                      };
-        POINTL                          aPoint4[4] = { vXdest, vYdest
-                                                      ,vXdest + vWidth, vYdest + vHeight
-                                                      ,0, 0
-                                                      ,vWidth, vHeight
+        POINTL                          aPoint4[4] = { {vXdest, vYdest}
+                                                     ,{vXdest + vWidth, vYdest + vHeight}
+                                                     ,{0, 0}
+                                                     ,{vWidth, vHeight}
                                                      };
         ::GpiSetBitmap(hPSMask, (HBITMAP) pMask->GetMaskBitmap());
         ::GpiSetBitmap(hPSBuffer, (HBITMAP) hBufBitmap);
@@ -2763,10 +2777,10 @@ bool wxDC::DoBlit(
     }
     else // no mask, just BitBlt() it
     {
-        POINTL                          aPoint[4] = { vXdest, vYdest
-                                                     ,vXdest + vWidth, vYdest + vHeight
-                                                     ,vXsrc, vYsrc
-                                                     ,vXsrc + vWidth, vYsrc + vHeight
+      POINTL                          aPoint[4] = { {vXdest, vYdest}
+                                                  ,{vXdest + vWidth, vYdest + vHeight}
+                                                  ,{vXsrc, vYsrc}
+                                                  ,{vXsrc + vWidth, vYsrc + vHeight}
                                                     };
 
         bSuccess = (::GpiBitBlt( m_hPS
@@ -2873,18 +2887,5 @@ void wxDC::SetLogicalScale(
     m_logicalScaleY = dY;
 }; // end of wxDC::SetLogicalScale
 
-#if WXWIN_COMPATIBILITY
-void wxDC::DoGetTextExtent(const wxString& string, float *x, float *y,
-                         float *descent, float *externalLeading,
-                         wxFont *theFont, bool use16bit) const
-{
-    wxCoord x1, y1, descent1, externalLeading1;
-    GetTextExtent(string, & x1, & y1, & descent1, & externalLeading1, theFont, use16bit);
-    *x = x1; *y = y1;
-    if (descent)
-        *descent = descent1;
-    if (externalLeading)
-        *externalLeading = externalLeading1;
-}
-#endif
+