]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/ownerdrw.cpp
send wxEVT_SCROLL_CHANGED when using mouse wheel as well
[wxWidgets.git] / src / msw / ownerdrw.cpp
index e0a59c64ef110e0867d424582877418d897b419f..3938ec17c141c327e057db95d6c7bd0083582f7c 100644 (file)
 
 #if wxUSE_OWNER_DRAWN
 
+#ifndef SPI_GETKEYBOARDCUES
+#define SPI_GETKEYBOARDCUES 0x100A
+#endif
+
 class wxMSWSystemMenuFontModule : public wxModule
 {
 public:
@@ -81,7 +85,7 @@ private:
     DECLARE_DYNAMIC_CLASS(wxMSWSystemMenuFontModule)
 };
 
-// these static variables are by the wxMSWSystemMenuFontModule object
+// these static variables are from the wxMSWSystemMenuFontModule object
 // and reflect the system settings returned by the Win32 API's
 // SystemParametersInfo() call.
 
@@ -155,8 +159,8 @@ bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
   wxString str = wxStripMenuCodes(m_strName);
 
   // if we have a valid accel string, then pad out
-  // the menu string so the menu and accel string are not
-  // placed ontop of eachother.
+  // the menu string so that the menu and accel string are not
+  // placed on top of each other.
   if ( !m_strAccel.empty() )
    {
        str.Pad(str.Length()%8);
@@ -275,7 +279,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
   int xText = rc.x + margin + 1;
 
 
-  // using native API because it reckognizes '&'
+  // using native API because it recognizes '&'
   int nPrevMode = SetBkMode(hdc, TRANSPARENT);
   HBRUSH hbr = CreateSolidBrush(colBack),
          hPrevBrush = (HBRUSH)SelectObject(hdc, hbr);
@@ -308,7 +312,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
   xText += 3; // separate text from the highlight rectangle
 
   SIZE sizeRect;
-  GetTextExtentPoint32(hdc,strMenuText.c_str(), strMenuText.Length(),&sizeRect);
+  ::GetTextExtentPoint32(hdc, strMenuText.c_str(), strMenuText.Length(), &sizeRect);
   ::DrawState(hdc, NULL, NULL,
               (LPARAM)strMenuText.c_str(), strMenuText.length(),
               xText, rc.y + (int) ((rc.GetHeight()-sizeRect.cy)/2.0), // centre text vertically
@@ -318,7 +322,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
               (((st & wxODHidePrefix) && !wxMSWSystemMenuFontModule::ms_showCues) ? 512 : 0)); // 512 == DSS_HIDEPREFIX
 
   // ::SetTextAlign(hdc, TA_RIGHT) doesn't work with DSS_DISABLED or DSS_MONO
-  // as last parameter in DrawState() (at least with Windows98). So we have
+  // as the last parameter in DrawState() (at least with Windows98). So we have
   // to take care of right alignment ourselves.
   if ( !m_strAccel.empty() )
   {
@@ -390,7 +394,7 @@ bool wxOwnerDrawn::OnDrawItem(wxDC& dc,
       int nBmpWidth = bmp.GetWidth(),
           nBmpHeight = bmp.GetHeight();
 
-      // there should be enough place!
+      // there should be enough space!
       wxASSERT((nBmpWidth <= rc.GetWidth()) && (nBmpHeight <= rc.GetHeight()));
 
       int heightDiff = m_nHeight - nBmpHeight;