]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/ownerdrw.cpp
Fixed incorrect ratio initialization
[wxWidgets.git] / src / os2 / ownerdrw.cpp
index 3bc612cae4ed1130153ece28fee0406cbfbfb556..6ce8bbf2bd0a5d6e593c03a6627b9c6187ff1937 100644 (file)
@@ -111,7 +111,7 @@ bool wxOwnerDrawn::OnMeasureItem(
     // Add space at the end of the menu for the submenu expansion arrow
     // this will also allow offsetting the accel string from the right edge
     //
     // Add space at the end of the menu for the submenu expansion arrow
     // this will also allow offsetting the accel string from the right edge
     //
-    *pWidth += GetDefaultMarginWidth() * 1.5;
+    *pWidth = (size_t)(*pWidth + GetDefaultMarginWidth() * 1.5);
 
     //
     // JACS: items still look too tightly packed, so adding 5 pixels.
 
     //
     // JACS: items still look too tightly packed, so adding 5 pixels.
@@ -246,7 +246,7 @@ bool wxOwnerDrawn::OnDrawItem(
         // Fall back to default colors if none explicitly specified
         //
         vRef = ::WinQuerySysColor( HWND_DESKTOP
         // Fall back to default colors if none explicitly specified
         //
         vRef = ::WinQuerySysColor( HWND_DESKTOP
-                                  ,SYSCLR_MENU  // we are using gray for all our window backgrounds in wxWindows
+                                  ,SYSCLR_MENU  // we are using gray for all our window backgrounds in wxWidgets
                                   ,0L
                                  );
         vColBack.Set( GetRValue(vRef)
                                   ,0L
                                  );
         vColBack.Set( GetRValue(vRef)
@@ -303,7 +303,7 @@ bool wxOwnerDrawn::OnDrawItem(
     wxString                        sTgt = "\t";
     wxString                        sFullString = m_strName; // need to save the original text
     wxString                        sAccel;
     wxString                        sTgt = "\t";
     wxString                        sFullString = m_strName; // need to save the original text
     wxString                        sAccel;
-    size_t                          nIndex;
+    int                             nIndex;
     size_t                          nWidth;
     size_t                          nCharWidth;
     size_t                          nHeight;
     size_t                          nWidth;
     size_t                          nCharWidth;
     size_t                          nHeight;
@@ -336,7 +336,7 @@ bool wxOwnerDrawn::OnDrawItem(
                           ,(long *)&nWidth
                           ,(long *)&nHeight
                          );
                           ,(long *)&nWidth
                           ,(long *)&nHeight
                          );
-        sTmp = sFullString[nIndex + 1];
+        sTmp = sFullString[(size_t)(nIndex + 1)];
         rDC.GetTextExtent( sTmp
                           ,(long *)&nCharWidth
                           ,(long *)&nHeight
         rDC.GetTextExtent( sTmp
                           ,(long *)&nCharWidth
                           ,(long *)&nHeight
@@ -464,11 +464,6 @@ bool wxOwnerDrawn::OnDrawItem(
 
             if (eStatus & wxODSelected)
             {
 
             if (eStatus & wxODSelected)
             {
-                RECT                vRectBmp = { rRect.x
-                                                ,rRect.y
-                                                ,rRect.x + GetMarginWidth() - 1
-                                                ,rRect.y + m_nHeight - 1
-                                               };
                 POINTL              vPnt1 = {rRect.x + 1, rRect.y + 3}; // Leave a little background border
                 POINTL              vPnt2 = {rRect.x + GetMarginWidth(), rRect.y + m_nHeight - 3};
 
                 POINTL              vPnt1 = {rRect.x + 1, rRect.y + 3}; // Leave a little background border
                 POINTL              vPnt2 = {rRect.x + GetMarginWidth(), rRect.y + m_nHeight - 3};