projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(blind) wxUniv compilation fix: define the method using wxWindow out of line, i.e...
[wxWidgets.git]
/
src
/
univ
/
menu.cpp
diff --git
a/src/univ/menu.cpp
b/src/univ/menu.cpp
index ac1b1a3e9176cd1f370e6d587f82f2298bb46662..b6b0189e85cc2ee828c477762717a48cbc48cab5 100644
(file)
--- a/
src/univ/menu.cpp
+++ b/
src/univ/menu.cpp
@@
-136,7
+136,7
@@
public:
virtual void OnDismiss();
// called when a submenu is dismissed
virtual void OnDismiss();
// called when a submenu is dismissed
- void OnSubmenuDismiss(
) { m_hasOpenSubMenu = false; }
+ void OnSubmenuDismiss(
bool dismissParent);
// get the currently selected item (may be NULL)
wxMenuItem *GetCurrentItem() const
// get the currently selected item (may be NULL)
wxMenuItem *GetCurrentItem() const
@@
-358,7
+358,7
@@
void wxPopupMenuWindow::ChangeCurrent(wxMenuItemList::compatibility_iterator nod
if ( item->IsSubMenu() && item->GetSubMenu()->IsShown() )
{
item->GetSubMenu()->Dismiss();
if ( item->IsSubMenu() && item->GetSubMenu()->IsShown() )
{
item->GetSubMenu()->Dismiss();
- OnSubmenuDismiss();
+ OnSubmenuDismiss(
false
);
}
RefreshItem(item);
}
RefreshItem(item);
@@
-463,7
+463,7
@@
void wxPopupMenuWindow::Dismiss()
wxCHECK_RET( win, _T("opened submenu is not opened?") );
win->Dismiss();
wxCHECK_RET( win, _T("opened submenu is not opened?") );
win->Dismiss();
- OnSubmenuDismiss();
+ OnSubmenuDismiss(
false
);
}
wxPopupTransientWindow::Dismiss();
}
wxPopupTransientWindow::Dismiss();
@@
-476,6
+476,15
@@
void wxPopupMenuWindow::OnDismiss()
HandleDismiss(true);
}
HandleDismiss(true);
}
+void wxPopupMenuWindow::OnSubmenuDismiss(bool dismissParent)
+{
+ m_hasOpenSubMenu = false;
+
+ // we are closing whole menu so remove current highlight
+ if ( dismissParent )
+ ResetCurrent();
+}
+
void wxPopupMenuWindow::HandleDismiss(bool dismissParent)
{
ResetCurrent();
void wxPopupMenuWindow::HandleDismiss(bool dismissParent)
{
ResetCurrent();
@@
-958,7
+967,7
@@
bool wxPopupMenuWindow::ProcessKeyDown(int key)
default:
// look for the menu item starting with this letter
default:
// look for the menu item starting with this letter
- if ( wxIsalnum(key) )
+ if ( wxIsalnum(
(wxChar)
key) )
{
// we want to start from the item after this one because
// if we're already on the item with the given accel we want to
{
// we want to start from the item after this one because
// if we're already on the item with the given accel we want to
@@
-1307,7
+1316,7
@@
void wxMenu::OnDismiss(bool dismissParent)
wxPopupMenuWindow *win = m_menuParent->m_popupMenu;
if ( win )
{
wxPopupMenuWindow *win = m_menuParent->m_popupMenu;
if ( win )
{
- win->OnSubmenuDismiss();
+ win->OnSubmenuDismiss(
true
);
}
else
{
}
else
{
@@
-2284,7
+2293,7
@@
void wxMenuBar::OnKeyDown(wxKeyEvent& event)
int wxMenuBar::FindNextItemForAccel(int idxStart, int key, bool *unique) const
{
int wxMenuBar::FindNextItemForAccel(int idxStart, int key, bool *unique) const
{
- if ( !wxIsalnum(key) )
+ if ( !wxIsalnum(
(wxChar)
key) )
{
// we only support letters/digits as accels
return -1;
{
// we only support letters/digits as accels
return -1;