summaryrefslogtreecommitdiff
path: root/vcl/aqua/source/a11y
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-07-25 08:05:02 +0000
committerOliver Bolte <obo@openoffice.org>2008-07-25 08:05:02 +0000
commitc1c1f1517c6ccab8a0b04480a02685baba533db4 (patch)
treed98c3d5f6d22358666818443f499e5ea22036d3b /vcl/aqua/source/a11y
parent1f2e3972aeab08c412cdcc441793c53f560fa63c (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/source/a11y')
-rw-r--r--vcl/aqua/source/a11y/aqua11yfocustracker.cxx40
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