git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37270
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
+#if defined(WINCE_WITHOUT_COMMANDBAR)
+ if (IsAttached())
+#else
+ if (GetHmenu())
+#endif
{
int mswpos = MSWPositionForWxMenu(menuOld,pos);
{
int mswpos = MSWPositionForWxMenu(menuOld,pos);
+ if (IsAttached())
+ Refresh();
// Find out which MSW item before which we'll be inserting before
// wxMenuBarBase::Insert is called and GetMenu(pos) is the new menu.
// If IsAttached() is false this won't be used anyway
// Find out which MSW item before which we'll be inserting before
// wxMenuBarBase::Insert is called and GetMenu(pos) is the new menu.
// If IsAttached() is false this won't be used anyway
- int mswpos = (!IsAttached() || (pos == m_menus.GetCount()))
+ bool isAttached =
+#if defined(WINCE_WITHOUT_COMMANDBAR)
+ IsAttached();
+#else
+ (GetHmenu() != 0);
+#endif
+
+ int mswpos = (!isAttached || (pos == m_menus.GetCount()))
? -1 // append the menu
: MSWPositionForWxMenu(GetMenu(pos),pos);
? -1 // append the menu
: MSWPositionForWxMenu(GetMenu(pos),pos);
m_titles.Insert(title, pos);
m_titles.Insert(title, pos);
-#if defined(WINCE_WITHOUT_COMMANDAR)
+#if defined(WINCE_WITHOUT_COMMANDBAR)
if (!GetToolBar())
return false;
TBBUTTON tbButton;
if (!GetToolBar())
return false;
TBBUTTON tbButton;
+ if (IsAttached())
+ Refresh();
+#if defined(WINCE_WITHOUT_COMMANDBAR)
+ if (IsAttached())
+#else
+ if (GetHmenu())
+#endif
-#if defined(WINCE_WITHOUT_COMMANDAR)
+#if defined(WINCE_WITHOUT_COMMANDBAR)
if (!GetToolBar())
return false;
TBBUTTON tbButton;
if (!GetToolBar())
return false;
TBBUTTON tbButton;
+ if (IsAttached())
+ Refresh();
if ( !menu )
return NULL;
if ( !menu )
return NULL;
+#if defined(WINCE_WITHOUT_COMMANDBAR)
+ if (IsAttached())
+#else
+ if (GetHmenu())
+#endif
-#if defined(WINCE_WITHOUT_COMMANDAR)
+#if defined(WINCE_WITHOUT_COMMANDBAR)
if (GetToolBar())
{
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_DELETEBUTTON, (UINT) pos, (LPARAM) 0))
if (GetToolBar())
{
if (!::SendMessage((HWND) GetToolBar()->GetHWND(), TB_DELETEBUTTON, (UINT) pos, (LPARAM) 0))
+ if (IsAttached())
+ Refresh();
m_titles.RemoveAt(pos);
return menu;
m_titles.RemoveAt(pos);
return menu;