X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/bf95a04f16759468ee7af83a7a78019399c648bb..45212047969548b7d4a848e3a9c6cfdcb0484104:/src/msw/menu.cpp diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index e8c4c22ce1..ca6ab1b99c 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -649,6 +649,10 @@ void wxMenuBar::Refresh() WXHMENU wxMenuBar::Create() { + // Note: this totally doesn't work on Smartphone, + // since you have to use resources. + // We'll have to find another way to add a menu + // by changing/adding menu items to an existing menu. #ifdef __WXWINCE__ if ( m_hMenu != 0 ) return m_hMenu; @@ -673,9 +677,11 @@ WXHMENU wxMenuBar::Create() tbButton.dwData = (DWORD)hPopupMenu; wxString label = wxStripMenuCodes(GetLabelTop(i)); tbButton.iString = (int) label.c_str(); + + int position = i; tbButton.idCommand = NewControlId(); - if (!::SendMessage(hCommandBar, TB_INSERTBUTTON, i, (LPARAM)&tbButton)) + if (!::SendMessage(hCommandBar, TB_INSERTBUTTON, position, (LPARAM)&tbButton)) { wxLogLastError(wxT("TB_INSERTBUTTON")); }