diff options
Diffstat (limited to 'vcl/aqua/source/a11y')
-rw-r--r-- | vcl/aqua/source/a11y/aqua11yfocustracker.cxx | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/vcl/aqua/source/a11y/aqua11yfocustracker.cxx b/vcl/aqua/source/a11y/aqua11yfocustracker.cxx index 11979a1107ec..24a56f477dd4 100644 --- a/vcl/aqua/source/a11y/aqua11yfocustracker.cxx +++ b/vcl/aqua/source/a11y/aqua11yfocustracker.cxx @@ -8,7 +8,7 @@ * * $RCSfile: aqua11yfocustracker.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * * This file is part of OpenOffice.org. * @@ -66,6 +66,9 @@ long AquaA11yFocusTracker::WindowEventHandler(AquaA11yFocusTracker *pFocusTracke { switch (pEvent->GetId()) { + case VCLEVENT_WINDOW_PAINT: + pFocusTracker-> toolbox_open_floater( getWindow(pEvent) ); + break; case VCLEVENT_WINDOW_GETFOCUS: pFocusTracker->window_got_focus( getWindow(pEvent) ); break; @@ -135,6 +138,41 @@ void AquaA11yFocusTracker::notify_toolbox_item_focus(ToolBox *pToolBox) //------------------------------------------------------------------------------ +void AquaA11yFocusTracker::toolbox_open_floater(Window *pWindow) +{ + bool bToolboxFound = false; + bool bFloatingWindowFound = false; + Window * pFloatingWindow = NULL; + while ( pWindow != NULL ) { + if ( pWindow->GetType() == WINDOW_TOOLBOX ) { + bToolboxFound = true; + } else if ( pWindow->GetType() == WINDOW_FLOATINGWINDOW ) { + bFloatingWindowFound = true; + pFloatingWindow = pWindow; + } + pWindow = pWindow->GetParent(); + } + if ( bToolboxFound && bFloatingWindowFound ) { + Reference < XAccessible > rxAccessible = pFloatingWindow -> GetAccessible(); + if ( ! rxAccessible.is() ) { + return; + } + Reference < XAccessibleContext > rxContext = rxAccessible -> getAccessibleContext(); + if ( ! rxContext.is() ) { + return; + } + if ( rxContext -> getAccessibleChildCount() > 0 ) { + Reference < XAccessible > rxAccessibleChild = rxContext -> getAccessibleChild( 0 ); + if ( ! rxAccessibleChild.is() ) { + return; + } + setFocusedObject ( rxAccessibleChild ); + } + } +} + +//------------------------------------------------------------------------------ + void AquaA11yFocusTracker::toolbox_highlight_on(Window *pWindow) { // Make sure either the toolbox or its parent toolbox has the focus |