X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0369cb3677fcca756d0a85d99cb8c9af2425bc9..129b8b1a215fc1fcc1b9f06daa0aeaf22bbce614:/src/msw/menu.cpp diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 9a235b6071..5e24fd40b9 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -77,7 +77,7 @@ typedef struct tagMENUINFO } MENUINFO, FAR *LPMENUINFO; #endif -#if wxUSE_OWNER_DRAWN +#if wxUSE_OWNER_DRAWN #include "wx/dynlib.h" #endif @@ -451,14 +451,14 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) !pItem->GetBackgroundColour().Ok() && !pItem->GetFont().Ok() ) { - // try to use InsertMenuItem() as it's guaranteed to look correct + // try to use InsertMenuItem() as it's guaranteed to look correct // while our owner-drawn code is not -#ifndef __DMC__ +#ifndef __DMC__ // DMC at march 2007 doesn't have HBITMAP hbmpItem tagMENUITEMINFOA /W // MIIM_BITMAP only works under WinME/2000+ WinStruct mii; if ( wxGetWinVersion() >= wxWinVersion_98 ) - { + { mii.fMask = MIIM_STRING | MIIM_DATA | MIIM_BITMAP; if ( pItem->IsCheckable() ) { @@ -468,7 +468,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) } mii.cch = itemText.length(); - mii.dwTypeData = wx_const_cast(wxChar *, itemText.c_str()); + mii.dwTypeData = wx_const_cast(wxChar *, itemText.wx_str()); if (flags & MF_POPUP) { @@ -548,7 +548,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) itemText = wxMenuItem::GetLabelFromText(itemText); #endif - pData = (wxChar*)itemText.c_str(); + pData = (wxChar*)itemText.wx_str(); } // item might have already been inserted by InsertMenuItem() above @@ -798,10 +798,10 @@ bool wxMenu::MSWCommand(WXUINT WXUNUSED(param), WXWORD id) if ( item && item->IsCheckable() ) item->Toggle(); - // get the checked status of the menu item: note that menuState is the - // old state of the menu, so the test for MF_CHECKED must be inverted + // get the status of the menu item: note that it has been just changed + // by Toggle() above so here we already get the new state of the item UINT menuState = ::GetMenuState(GetHmenu(), id, MF_BYCOMMAND); - SendEvent(id, !(menuState & MF_CHECKED)); + SendEvent(id, menuState & MF_CHECKED); } return true;