+void wxMenuItem::SetText(
+ const wxString& rText
+)
+{
+ //
+ // Don't do anything if label didn't change
+ //
+
+ wxString Text = TextToLabel(rText);
+ if (m_text == Text)
+ return;
+
+ wxMenuItemBase::SetText(Text);
+ OWNER_DRAWN_ONLY(wxOwnerDrawn::SetName(Text));
+
+ HWND hMenu = GetHMenuOf(m_parentMenu);
+
+ wxCHECK_RET(hMenu, wxT("menuitem without menu"));
+
+#if wxUSE_ACCEL
+ m_parentMenu->UpdateAccel(this);
+#endif // wxUSE_ACCEL
+
+ USHORT uId = GetRealId();
+ MENUITEM vItem;
+ USHORT uFlagsOld;
+
+ if (!::WinSendMsg( hMenu
+ ,MM_QUERYITEM
+ ,MPFROM2SHORT(uId, TRUE)
+ ,(MPARAM)&vItem
+ ))
+ {
+ wxLogLastError("GetMenuState");
+ }
+ else
+ {
+ uFlagsOld = vItem.afStyle;
+ if (IsSubMenu())
+ {
+ uFlagsOld |= MIS_SUBMENU;
+ }
+
+ BYTE* pData;
+
+#if wxUSE_OWNER_DRAWN
+ if (IsOwnerDrawn())
+ {
+ uFlagsOld |= MIS_OWNERDRAW;
+ pData = (BYTE*)this;
+ }
+ else
+#endif //owner drawn
+ {
+ uFlagsOld |= MIS_TEXT;
+ pData = (BYTE*)Text.c_str();
+ }
+
+ //
+ // Set the style
+ //
+ if (!::WinSendMsg( hMenu
+ ,MM_SETITEM
+ ,MPFROM2SHORT(uId, TRUE)
+ ,(MPARAM)&vItem
+ ))
+ {
+ wxLogLastError(wxT("ModifyMenu"));
+ }
+
+ //
+ // Set the text
+ //
+ if (::WinSendMsg( hMenu
+ ,MM_SETITEMTEXT
+ ,MPFROMSHORT(uId)
+ ,(MPARAM)pData
+ ))
+ {
+ wxLogLastError(wxT("ModifyMenu"));
+ }
+ }
+} // end of wxMenuItem::SetText
+
+void wxMenuItem::SetCheckable(
+ bool bCheckable
+)
+{
+ wxMenuItemBase::SetCheckable(bCheckable);
+ OWNER_DRAWN_ONLY(wxOwnerDrawn::SetCheckable(bCheckable));
+} // end of wxMenuItem::SetCheckable
+
+// ----------------------------------------------------------------------------
+// wxMenuItemBase
+// ----------------------------------------------------------------------------