diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-07-25 08:05:02 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-07-25 08:05:02 +0000 |
commit | c1c1f1517c6ccab8a0b04480a02685baba533db4 (patch) | |
tree | d98c3d5f6d22358666818443f499e5ea22036d3b /vcl/aqua | |
parent | 1f2e3972aeab08c412cdcc441793c53f560fa63c (diff) |
INTEGRATION: CWS aqua11y02 (1.2.30); FILE MERGED
2008/06/09 09:48:38 fne 1.2.30.1: #i87816# when toolbox open floating window, set focus to content of that window for VO
Diffstat (limited to 'vcl/aqua')
-rw-r--r-- | vcl/aqua/inc/aqua11yfocustracker.hxx | 5 | ||||
-rw-r--r-- | vcl/aqua/source/a11y/aqua11yfocustracker.cxx | 40 |
2 files changed, 43 insertions, 2 deletions
diff --git a/vcl/aqua/inc/aqua11yfocustracker.hxx b/vcl/aqua/inc/aqua11yfocustracker.hxx index 3fd368551879..289abf60622d 100644 --- a/vcl/aqua/inc/aqua11yfocustracker.hxx +++ b/vcl/aqua/inc/aqua11yfocustracker.hxx @@ -8,7 +8,7 @@ * * $RCSfile: aqua11yfocustracker.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * * This file is part of OpenOffice.org. * @@ -86,6 +86,9 @@ protected: // toolbox items are widgets in gtk+ and Cocoa virtual void notify_toolbox_item_focus(ToolBox *pToolBox); + // toolbox item opened a floating window (e.g. color chooser) + virtual void toolbox_open_floater(Window *pWindow); + // callback function for Application::addEventListener static long WindowEventHandler(AquaA11yFocusTracker *pFocusTracker, ::VclSimpleEvent const *pEvent); 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 |