summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2011-09-30 00:00:29 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2011-10-05 18:51:26 -0500
commitc4fcd6bbe67dedcfc563d9574b412cc437f13a60 (patch)
tree728017a305d8ca6f53846aa255ec26c15e293221
parent3fbbcc21a3e3e34d3e44da8845b8fab1644535a6 (diff)
accfixes2: Some changes for improving menu item accessibility
-rw-r--r--vcl/inc/vcl/menu.hxx1
-rw-r--r--vcl/source/window/menu.cxx18
2 files changed, 18 insertions, 1 deletions
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index 413779412b24..6d227caabf02 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -371,6 +371,7 @@ public:
void HighlightItem( sal_uInt16 nItemPos );
void DeHighlight() { HighlightItem( 0xFFFF ); } // MENUITEMPOS_INVALID
+ bool IsTemporaryItem( sal_uInt16 nPos) const;
};
// -----------
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 8e64814db8ac..ce23651053a6 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -3281,6 +3281,19 @@ void Menu::HighlightItem( sal_uInt16 nItemPos )
}
}
+bool Menu::IsTemporaryItem( sal_uInt16 nPos ) const
+{
+ // IA2 CWS. MT: Does it need a better name?
+ // Or does is mean the temporary items should be handled differently here when asked for item enabled/visible state?
+ // See accessibility\source\standard\accessiblemenuitemcomponent.cxx how it's used.
+
+ MenuItemData* pData = pItemList->GetDataFromPos( nPos );
+
+ return pData ? pData->bIsTemporary : false;
+}
+
+
+
// -----------
// - MenuBar -
// -----------
@@ -3709,7 +3722,8 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong
String aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) );
MenuItemData* pData = pItemList->Insert(
0xFFFF, MENUITEM_STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF );
- pData->bIsTemporary = sal_True;
+ pData->bIsTemporary = sal_True;
+ ImplCallEventListeners(VCLEVENT_MENU_SUBMENUCHANGED, GetItemPos(pData->nId) );
}
}
else if ( Application::GetSettings().GetStyleSettings().GetAutoMnemonic() && !( nMenuFlags & MENU_FLAG_NOAUTOMNEMONICS ) )
@@ -4953,6 +4967,8 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent )
MenuFloatingWindow* pFloat = ((PopupMenu*)pMenu->pStartedFrom)->ImplGetFloatingWindow();
pFloat->GrabFocus();
pFloat->KillActivePopup();
+ // IA2 CWS. Probably needed for notifications?
+ pFloat->ChangeHighlightItem( pFloat->GetHighlightedItem(), false);
}
}
}