]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/dc.cpp
rtti api mods added
[wxWidgets.git] / src / os2 / dc.cpp
index e8b4b76ba3690c123490d7ca68c0dac068c04127..b3532167a849955e8831bec9e636ec81b4d98cfe 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
@@ -1147,8 +1150,8 @@ void wxDC::DoDrawRoundedRectangle(
         ::GpiBox( m_hPS
                  ,lControl
                  ,&vPoint[1]
-                 ,0L
-                 ,0L
+                 ,(LONG)dRadius
+                 ,(LONG)dRadius
                 );
         lControl = DRO_FILL;
         ::GpiSetColor( m_hPS
@@ -1162,8 +1165,8 @@ void wxDC::DoDrawRoundedRectangle(
         ::GpiBox( m_hPS
                  ,lControl
                  ,&vPoint[1]
-                 ,0L
-                 ,0L
+                 ,(LONG)dRadius
+                 ,(LONG)dRadius
                 );
     }
 
@@ -1314,31 +1317,14 @@ void wxDC::DoDrawBitmap(
 
         vY = OS2Y(vY,rBmp.GetHeight());
 
-        //
-        // Flip the picture as OS/2 is upside-down
-        //
-        if (rBmp.Flip())
-        {
-            vPoint[0].x = vX;
-            vPoint[0].y = vY + rBmp.GetHeight();
-            vPoint[1].x = vX + rBmp.GetWidth();
-            vPoint[1].y = vY;
-            vPoint[2].x = 0;
-            vPoint[2].y = 0;
-            vPoint[3].x = rBmp.GetWidth();
-            vPoint[3].y = rBmp.GetHeight();
-        }
-        else
-        {
-            vPoint[0].x = vX;
-            vPoint[0].y = vY;
-            vPoint[1].x = vX + rBmp.GetWidth();
-            vPoint[1].y = vY + rBmp.GetHeight();
-            vPoint[2].x = 0;
-            vPoint[2].y = 0;
-            vPoint[3].x = rBmp.GetWidth();
-            vPoint[3].y = rBmp.GetHeight();
-        }
+        vPoint[0].x = vX;
+        vPoint[0].y = vY + rBmp.GetHeight();
+        vPoint[1].x = vX + rBmp.GetWidth();
+        vPoint[1].y = vY;
+        vPoint[2].x = 0;
+        vPoint[2].y = 0;
+        vPoint[3].x = rBmp.GetWidth();
+        vPoint[3].y = rBmp.GetHeight();
         if (bUseMask)
         {
             wxMask*                     pMask = rBmp.GetMask();
@@ -1407,11 +1393,11 @@ void wxDC::DoDrawBitmap(
                 //
                 // Need to get a background color for mask blitting
                 //
-                if (IsKindOf(CLASSINFO(wxPaintDC)))
+                if (IsKindOf(CLASSINFO(wxWindowDC)))
                 {
-                    wxPaintDC*              pPaintDC = wxDynamicCast(this, wxPaintDC);
+                    wxWindowDC*             pWindowDC = wxDynamicCast(this, wxWindowDC);
 
-                    lColor = pPaintDC->m_pCanvas->GetBackgroundColour().GetPixel();
+                    lColor = pWindowDC->m_pCanvas->GetBackgroundColour().GetPixel();
                 }
                 else if (GetBrush() != wxNullBrush)
                     lColor = GetBrush().GetColour().GetPixel();
@@ -1786,14 +1772,25 @@ void wxDC::DrawAnyText(
           m_vRclPaint.yBottom == 0 &&
           m_vRclPaint.xRight == 0 &&
           m_vRclPaint.xLeft == 0))
-        vPtlStart.y = OS2Y(vY,vTextY);
+    {
+        //
+        // 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);
+            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;
@@ -2890,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
+