X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/455f7c8205e5dc29d99026b158ae0a394dccc839..fb8d7eb7a880f1f2e32d8830f9c5e12b2536e05f:/src/motif/menu.cpp diff --git a/src/motif/menu.cpp b/src/motif/menu.cpp index 6eae7b96dd..02ada167a3 100644 --- a/src/motif/menu.cpp +++ b/src/motif/menu.cpp @@ -52,9 +52,6 @@ // other standard headers #include -IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler) -IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler) - // ============================================================================ // implementation // ============================================================================ @@ -72,7 +69,7 @@ void wxMenu::Init() m_popupShell = (WXWidget) NULL; m_buttonWidget = (WXWidget) NULL; m_menuId = 0; - m_topLevelMenu = (wxMenu*) NULL; + m_topLevelMenu = NULL; m_ownedByMenuBar = false; if ( !m_title.empty() ) @@ -364,8 +361,8 @@ bool wxMenuBar::CreateMenuBar(wxFrame* parent) Widget tearOff = XmGetTearOffControl(GetWidget(menu)); wxDoChangeForegroundColour((Widget) tearOff, m_foregroundColour); wxDoChangeBackgroundColour((Widget) tearOff, m_backgroundColour, true); -#endif } +#endif } PostCreation(); @@ -383,7 +380,7 @@ bool wxMenuBar::DestroyMenuBar() { if (!m_mainWidget) { - SetMenuBarFrame((wxFrame*) NULL); + SetMenuBarFrame(NULL); return false; } @@ -400,7 +397,7 @@ bool wxMenuBar::DestroyMenuBar() XtDestroyWidget((Widget) m_mainWidget); m_mainWidget = (WXWidget) 0; - SetMenuBarFrame((wxFrame*) NULL); + SetMenuBarFrame(NULL); return true; } @@ -446,7 +443,7 @@ void wxMenu::DestroyWidgetAndDetach() WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, WXWidget parent, wxMenu * topMenu, - size_t WXUNUSED(index), + size_t menuIndex, const wxString& title, bool pullDown) { @@ -457,7 +454,7 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, XtSetArg (args[0], XmNnumColumns, m_numColumns); XtSetArg (args[1], XmNpacking, (m_numColumns > 1) ? XmPACK_COLUMN : XmPACK_TIGHT); - if ( !m_font.Ok() ) + if ( !m_font.IsOk() ) { if ( menuBar ) m_font = menuBar->GetFont(); @@ -493,7 +490,7 @@ WXWidget wxMenu::CreateMenu (wxMenuBar * menuBar, XmNlabelString, label_str(), XmNsubMenuId, menu, (String)wxFont::GetFontTag(), m_font.GetFontTypeC(dpy), - XmNpositionIndex, index, + XmNpositionIndex, menuIndex, NULL); if (mnem != 0) @@ -529,7 +526,7 @@ void wxMenu::DestroyMenu (bool full) node = node->GetNext() ) { wxMenuItem *item = node->GetData(); - item->SetMenuBar((wxMenuBar*) NULL); + item->SetMenuBar(NULL); item->DestroyItem(full); } @@ -555,7 +552,7 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const if (id == m_menuId) { if (it) - *it = (wxMenuItem*) NULL; + *it = NULL; return m_buttonWidget; } @@ -582,14 +579,14 @@ WXWidget wxMenu::FindMenuItem (int id, wxMenuItem ** it) const } if (it) - *it = (wxMenuItem*) NULL; + *it = NULL; return (WXWidget) NULL; } void wxMenu::SetBackgroundColour(const wxColour& col) { m_backgroundColour = col; - if (!col.Ok()) + if (!col.IsOk()) return; if (m_menuWidget) wxDoChangeBackgroundColour(m_menuWidget, (wxColour&) col); @@ -614,7 +611,7 @@ void wxMenu::SetBackgroundColour(const wxColour& col) void wxMenu::SetForegroundColour(const wxColour& col) { m_foregroundColour = col; - if (!col.Ok()) + if (!col.IsOk()) return; if (m_menuWidget) wxDoChangeForegroundColour(m_menuWidget, (wxColour&) col); @@ -640,7 +637,7 @@ void wxMenu::ChangeFont(bool keepOriginalSize) { // Lesstif 0.87 hangs here, but 0.93 does not; MBN: sometimes it does #if !wxCHECK_LESSTIF() // || wxCHECK_LESSTIF_VERSION( 0, 93 ) - if (!m_font.Ok() || !m_menuWidget) + if (!m_font.IsOk() || !m_menuWidget) return; Display* dpy = XtDisplay((Widget) m_menuWidget); @@ -660,7 +657,7 @@ void wxMenu::ChangeFont(bool keepOriginalSize) node = node->GetNext() ) { wxMenuItem* item = node->GetData(); - if (m_menuWidget && item->GetButtonWidget() && m_font.Ok()) + if (m_menuWidget && item->GetButtonWidget() && m_font.IsOk()) { XtVaSetValues ((Widget) item->GetButtonWidget(), wxFont::GetFontTag(), m_font.GetFontTypeC(dpy), @@ -684,7 +681,7 @@ bool wxMenuBar::SetBackgroundColour(const wxColour& col) { if (!wxWindowBase::SetBackgroundColour(col)) return false; - if (!col.Ok()) + if (!col.IsOk()) return false; if (m_mainWidget) wxDoChangeBackgroundColour(m_mainWidget, (wxColour&) col); @@ -700,7 +697,7 @@ bool wxMenuBar::SetForegroundColour(const wxColour& col) { if (!wxWindowBase::SetForegroundColour(col)) return false; - if (!col.Ok()) + if (!col.IsOk()) return false; if (m_mainWidget) wxDoChangeForegroundColour(m_mainWidget, (wxColour&) col);