X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..19da49fcd0dd496f1a25f8dda9237420b4ca18db:/src/univ/menu.cpp diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index ae3880336b..f760357497 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -123,7 +123,7 @@ class wxPopupMenuWindow : public wxPopupTransientWindow { public: wxPopupMenuWindow(wxWindow *parent, wxMenu *menu); - + ~wxPopupMenuWindow(); // override the base class version to select the first item initially @@ -184,6 +184,7 @@ protected: // set the current node and item withotu refreshing anything void SetCurrent(wxMenuItemList::compatibility_iterator node); + virtual bool SetCurrent(bool doit = true){return wxPopupTransientWindow::SetCurrent(doit);}; // change the current item refreshing the old and new items void ChangeCurrent(wxMenuItemList::compatibility_iterator node); @@ -258,7 +259,7 @@ public: else { // return FALSE; - + return wxEvtHandler::ProcessEvent(event); } } @@ -331,7 +332,7 @@ void wxPopupMenuWindow::ResetCurrent() #if wxUSE_STL SetCurrent(wxMenuItemList::compatibility_iterator()); #else - SetCurrent(NULL); + SetCurrent((wxwxMenuItemListNode *)NULL); #endif } @@ -375,7 +376,7 @@ wxMenuItemList::compatibility_iterator wxPopupMenuWindow::GetPrevNode() const : m_menu->GetMenuItems().GetLast(); } -wxMenuItemList::compatibility_iterator +wxMenuItemList::compatibility_iterator wxPopupMenuWindow::GetPrevNode(wxMenuItemList::compatibility_iterator node) const { if ( node ) @@ -398,7 +399,7 @@ wxMenuItemList::compatibility_iterator wxPopupMenuWindow::GetNextNode() const : m_menu->GetMenuItems().GetFirst(); } -wxMenuItemList::compatibility_iterator +wxMenuItemList::compatibility_iterator wxPopupMenuWindow::GetNextNode(wxMenuItemList::compatibility_iterator node) const { if ( node ) @@ -619,7 +620,7 @@ void wxPopupMenuWindow::ClickItem(wxMenuItem *item) // close all menus DismissAndNotify(); - + menu->ClickItem(item); } @@ -684,7 +685,7 @@ bool wxPopupMenuWindow::ProcessLeftDown(wxMouseEvent& event) wxPopupMenuWindow *win = menu->m_popupMenu; wxCHECK_MSG( win, FALSE, _T("parent menu not shown?") ); - + pos = ClientToScreen(pos); if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) ) { @@ -1111,7 +1112,10 @@ void wxMenu::EndRadioGroup() bool wxMenu::DoAppend(wxMenuItem *item) { + #if 0 + // not used at all bool check = FALSE; + #endif if ( item->GetKind() == wxITEM_RADIO ) { @@ -1127,7 +1131,10 @@ bool wxMenu::DoAppend(wxMenuItem *item) item->SetRadioGroupEnd(m_startRadioGroup); // ensure that we have a checked item in the radio group + #if 0 + // not used at all check = TRUE; + #endif } else // extend the current radio group { @@ -1238,7 +1245,7 @@ wxWindow *wxMenu::GetRootWindow() const // We are a submenu of a menu of a menubar if (menu->GetMenuBar()) return menu->GetMenuBar(); - + win = menu->GetInvokingWindow(); if ( win ) break; @@ -1249,7 +1256,7 @@ wxWindow *wxMenu::GetRootWindow() const // we're probably going to crash in the caller anyhow, but try to detect // this error as soon as possible wxASSERT_MSG( win, _T("menu without any associated window?") ); - + // also remember it in this menu so that we don't have to search for it the // next time wxConstCast(this, wxMenu)->m_invokingWindow = win; @@ -1326,7 +1333,7 @@ void wxMenu::OnDismiss(bool dismissParent) wxCHECK_RET( m_invokingWindow, _T("what kind of menu is this?") ); m_invokingWindow->DismissPopupMenu(); - + // Why reset it here? We need it for sending the event to... // SetInvokingWindow(NULL); } @@ -1346,7 +1353,7 @@ void wxMenu::Popup(const wxPoint& pos, const wxSize& size, bool selectFirst) { m_popupMenu->SelectFirst(); } - + // the geometry might have changed since the last time we were shown, so // always resize m_popupMenu->SetClientSize(GetGeometryInfo().GetSize()); @@ -1398,7 +1405,7 @@ bool wxMenu::ClickItem(wxMenuItem *item) // not applicabled isChecked = -1; } - + return SendEvent(item->GetId(), isChecked); } @@ -1657,8 +1664,6 @@ void wxMenuBar::Init() m_menuShown = NULL; m_shouldShowMenu = FALSE; - - m_windowStyle |= wxNO_FULL_REPAINT_ON_RESIZE; } void wxMenuBar::Attach(wxFrame *frame) @@ -2493,9 +2498,9 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) #endif // 0 menu->SetInvokingWindow(this); - + // wxLogDebug( "Name of invoking window %s", menu->GetInvokingWindow()->GetName().c_str() ); - + menu->Popup(ClientToScreen(wxPoint(x, y)), wxSize(0, 0)); // this is not very useful if the menu was popped up because of the mouse @@ -2530,7 +2535,7 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) void wxWindow::DismissPopupMenu() { wxCHECK_RET( ms_evtLoopPopup, _T("no popup menu shown") ); - + ms_evtLoopPopup->Exit(); }