// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "univmenuitem.h"
#pragma implementation "univmenu.h"
#endif
{
public:
wxPopupMenuWindow(wxWindow *parent, wxMenu *menu);
-
+
~wxPopupMenuWindow();
// override the base class version to select the first item initially
// 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);
else
{
// return FALSE;
-
+
return wxEvtHandler::ProcessEvent(event);
}
}
#if wxUSE_STL
SetCurrent(wxMenuItemList::compatibility_iterator());
#else
- SetCurrent(NULL);
+ SetCurrent((wxwxMenuItemListNode *)NULL);
#endif
}
: m_menu->GetMenuItems().GetLast();
}
-wxMenuItemList::compatibility_iterator
+wxMenuItemList::compatibility_iterator
wxPopupMenuWindow::GetPrevNode(wxMenuItemList::compatibility_iterator node) const
{
if ( node )
: m_menu->GetMenuItems().GetFirst();
}
-wxMenuItemList::compatibility_iterator
+wxMenuItemList::compatibility_iterator
wxPopupMenuWindow::GetNextNode(wxMenuItemList::compatibility_iterator node) const
{
if ( node )
// close all menus
DismissAndNotify();
-
+
menu->ClickItem(item);
}
wxPopupMenuWindow *win = menu->m_popupMenu;
wxCHECK_MSG( win, FALSE, _T("parent menu not shown?") );
-
+
pos = ClientToScreen(pos);
if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) )
{
bool wxMenu::DoAppend(wxMenuItem *item)
{
+ #if 0
+ // not used at all
bool check = FALSE;
+ #endif
if ( item->GetKind() == wxITEM_RADIO )
{
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
{
// We are a submenu of a menu of a menubar
if (menu->GetMenuBar())
return menu->GetMenuBar();
-
+
win = menu->GetInvokingWindow();
if ( win )
break;
// 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;
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);
}
{
m_popupMenu->SelectFirst();
}
-
+
// the geometry might have changed since the last time we were shown, so
// always resize
m_popupMenu->SetClientSize(GetGeometryInfo().GetSize());
// not applicabled
isChecked = -1;
}
-
+
return SendEvent(item->GetId(), isChecked);
}
m_menuShown = NULL;
m_shouldShowMenu = FALSE;
-
- m_windowStyle |= wxNO_FULL_REPAINT_ON_RESIZE;
}
void wxMenuBar::Attach(wxFrame *frame)
#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
void wxWindow::DismissPopupMenu()
{
wxCHECK_RET( ms_evtLoopPopup, _T("no popup menu shown") );
-
+
ms_evtLoopPopup->Exit();
}