]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/menuitem.cpp
Added wxFrameBase::OnMenuOpen, and wxUSE_IDLEMENUUPDATES in platform.h
[wxWidgets.git] / src / msw / menuitem.cpp
index f69a0a01f9fd07c4bb1bd77c76d81166754bd678..b9f3ca853fd7b25f93c8fc0427e9d7ca0625c142 100644 (file)
@@ -6,7 +6,7 @@
 // Created:     11.11.97
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
 // Created:     11.11.97
 // RCS-ID:      $Id$
 // Copyright:   (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// Licence:     wxWindows license
+// Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // ===========================================================================
 ///////////////////////////////////////////////////////////////////////////////
 
 // ===========================================================================
@@ -89,7 +89,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu,
                        wxMenu *pSubMenu)
           : wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu)
 #if wxUSE_OWNER_DRAWN
                        wxMenu *pSubMenu)
           : wxMenuItemBase(pParentMenu, id, text, strHelp, kind, pSubMenu)
 #if wxUSE_OWNER_DRAWN
-            , wxOwnerDrawn(GetLabelFromText(text), kind == wxITEM_CHECK)
+            , wxOwnerDrawn(text, kind == wxITEM_CHECK)
 #endif // owner drawn
 {
     Init();
 #endif // owner drawn
 {
     Init();
@@ -104,7 +104,7 @@ wxMenuItem::wxMenuItem(wxMenu *parentMenu,
           : wxMenuItemBase(parentMenu, id, text, help,
                            isCheckable ? wxITEM_CHECK : wxITEM_NORMAL, subMenu)
 #if wxUSE_OWNER_DRAWN
           : wxMenuItemBase(parentMenu, id, text, help,
                            isCheckable ? wxITEM_CHECK : wxITEM_NORMAL, subMenu)
 #if wxUSE_OWNER_DRAWN
-            , wxOwnerDrawn(GetLabelFromText(text), isCheckable)
+           , wxOwnerDrawn(text, isCheckable, true)
 #endif // owner drawn
 {
     Init();
 #endif // owner drawn
 {
     Init();
@@ -255,7 +255,7 @@ void wxMenuItem::Check(bool check)
                                    start,   // the first radio group item
                                    end,     // the last one
                                    pos,     // the one to check
                                    start,   // the first radio group item
                                    end,     // the last one
                                    pos,     // the one to check
-                                   MF_BYPOSITION | flags) )
+                                   MF_BYPOSITION) )
         {
             wxLogLastError(_T("CheckMenuRadioItem"));
         }
         {
             wxLogLastError(_T("CheckMenuRadioItem"));
         }
@@ -283,7 +283,7 @@ void wxMenuItem::Check(bool check)
     {
         if ( ::CheckMenuItem(hmenu,
                              GetRealId(),
     {
         if ( ::CheckMenuItem(hmenu,
                              GetRealId(),
-                             MF_BYCOMMAND | flags) == -1 )
+                             MF_BYCOMMAND | flags) == (DWORD)-1 )
         {
             wxLogLastError(wxT("CheckMenuItem"));
         }
         {
             wxLogLastError(wxT("CheckMenuItem"));
         }
@@ -300,6 +300,10 @@ void wxMenuItem::SetText(const wxString& text)
 
     wxMenuItemBase::SetText(text);
     OWNER_DRAWN_ONLY( wxOwnerDrawn::SetName(text) );
 
     wxMenuItemBase::SetText(text);
     OWNER_DRAWN_ONLY( wxOwnerDrawn::SetName(text) );
+#if wxUSE_OWNER_DRAWN
+    // tell the owner drawing code to to show the accel string as well
+    SetAccelString(text.AfterFirst(_T('\t')));
+#endif
 
     HMENU hMenu = GetHMenuOf(m_parentMenu);
     wxCHECK_RET( hMenu, wxT("menuitem without menu") );
 
     HMENU hMenu = GetHMenuOf(m_parentMenu);
     wxCHECK_RET( hMenu, wxT("menuitem without menu") );