don't skip first/last node when pressing down/up arrow after opening the menu with the mouse

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2002-02-04 15:40:34 +00:00
parent 107e4338b4
commit 86171954ec

View File

@ -352,14 +352,9 @@ void wxPopupMenuWindow::ChangeCurrent(wxMenuItemList::Node *node)
wxMenuItemList::Node *wxPopupMenuWindow::GetPrevNode() const
{
wxMenuItemList::Node *node = m_nodeCurrent;
if ( !node )
{
// start from the end if no current item
node = m_menu->GetMenuItems().GetLast();
}
return GetPrevNode(node);
// return the last node if there had been no previously selected one
return m_nodeCurrent ? GetPrevNode(m_nodeCurrent)
: m_menu->GetMenuItems().GetLast();
}
wxMenuItemList::Node *
@ -380,14 +375,9 @@ wxPopupMenuWindow::GetPrevNode(wxMenuItemList::Node *node) const
wxMenuItemList::Node *wxPopupMenuWindow::GetNextNode() const
{
wxMenuItemList::Node *node = m_nodeCurrent;
if ( !node )
{
// start from the beginning if no current item
node = m_menu->GetMenuItems().GetFirst();
}
return GetNextNode(node);
// return the first node if there had been no previously selected one
return m_nodeCurrent ? GetNextNode(m_nodeCurrent)
: m_menu->GetMenuItems().GetFirst();
}
wxMenuItemList::Node *