+
+void wxMenu::ChangeFont(bool keepOriginalSize)
+{
+ // lesstif 0.87 hangs when setting XmNfontList
+#ifndef LESSTIF_VERSION
+ if (!m_font.Ok() || !m_menuWidget)
+ return;
+
+ XmFontList fontList = (XmFontList) m_font.GetFontList(1.0, XtDisplay((Widget) m_menuWidget));
+
+ XtVaSetValues ((Widget) m_menuWidget,
+ XmNfontList, fontList,
+ NULL);
+ if (m_buttonWidget)
+ {
+ XtVaSetValues ((Widget) m_buttonWidget,
+ XmNfontList, fontList,
+ NULL);
+ }
+
+ for ( wxMenuItemList::Node *node = GetMenuItems().GetFirst();
+ node;
+ node = node->GetNext() )
+ {
+ wxMenuItem* item = node->GetData();
+ if (m_menuWidget && item->GetButtonWidget() && m_font.Ok())
+ {
+ XtVaSetValues ((Widget) item->GetButtonWidget(),
+ XmNfontList, fontList,
+ NULL);
+ }
+ if (item->GetSubMenu())
+ item->GetSubMenu()->ChangeFont(keepOriginalSize);
+ }
+#endif
+}
+
+void wxMenu::SetFont(const wxFont& font)
+{
+ m_font = font;
+ ChangeFont();
+}
+
+bool wxMenuBar::SetBackgroundColour(const wxColour& col)
+{
+ m_backgroundColour = col;
+ if (m_mainWidget)
+ wxDoChangeBackgroundColour(m_mainWidget, (wxColour&) col);
+
+ size_t menuCount = GetMenuCount();
+ for (size_t i = 0; i < menuCount; i++)
+ m_menus[i]->SetBackgroundColour((wxColour&) col);
+
+ return TRUE;
+}
+
+bool wxMenuBar::SetForegroundColour(const wxColour& col)
+{
+ m_foregroundColour = col;
+ if (m_mainWidget)
+ wxDoChangeForegroundColour(m_mainWidget, (wxColour&) col);
+
+ size_t menuCount = GetMenuCount();
+ for (size_t i = 0; i < menuCount; i++)
+ m_menus[i]->SetForegroundColour((wxColour&) col);
+
+ return TRUE;
+}
+
+void wxMenuBar::ChangeFont(bool WXUNUSED(keepOriginalSize))
+{
+ // Nothing to do for menubar, fonts are kept in wxMenus
+}
+
+bool wxMenuBar::SetFont(const wxFont& font)
+{
+ m_font = font;
+ ChangeFont();
+
+ size_t menuCount = GetMenuCount();
+ for (size_t i = 0; i < menuCount; i++)
+ m_menus[i]->SetFont(font);
+
+ return TRUE;
+}
+