summaryrefslogtreecommitdiff
path: root/accessibility/source/extended/accessibleiconchoicectrl.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'accessibility/source/extended/accessibleiconchoicectrl.cxx')
-rw-r--r--accessibility/source/extended/accessibleiconchoicectrl.cxx31
1 files changed, 29 insertions, 2 deletions
diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 014413cf2234..2598c92db75f 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -79,11 +79,36 @@ namespace accessibility
// modified selection. The active descendant event is
// send after that so that the receiving AT has time to
// read the text or name of the active child.
- NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+// NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+
+ if ( getCtrl() && getCtrl()->HasFocus() )
+ {
+ SvxIconChoiceCtrlEntry* pEntry = static_cast< SvxIconChoiceCtrlEntry* >( rVclWindowEvent.GetData() );
+ if ( pEntry )
+ {
+ sal_uLong nPos = getCtrl()->GetEntryListPos( pEntry );
+ Reference< XAccessible > xChild = new AccessibleIconChoiceCtrlEntry( *getCtrl(), nPos, this );
+ uno::Any aOldValue, aNewValue;
+ aNewValue <<= xChild;
+ NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
+
+ NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, aOldValue, aNewValue );
+
+ }
+ }
+ break;
+ }
+ case VCLEVENT_WINDOW_GETFOCUS :
+ {
SvtIconChoiceCtrl* pCtrl = getCtrl();
if ( pCtrl && pCtrl->HasFocus() )
{
SvxIconChoiceCtrlEntry* pEntry = static_cast< SvxIconChoiceCtrlEntry* >( rVclWindowEvent.GetData() );
+ if ( pEntry == NULL )
+ {
+ sal_uLong nPos=0;
+ pEntry = getCtrl()->GetSelectedEntry ( nPos );
+ }
if ( pEntry )
{
sal_uLong nPos = pCtrl->GetEntryListPos( pEntry );
@@ -91,6 +116,7 @@ namespace accessibility
uno::Any aOldValue, aNewValue;
aNewValue <<= xChild;
NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
+ NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, aOldValue, aNewValue );
}
}
break;
@@ -190,7 +216,8 @@ namespace accessibility
// -----------------------------------------------------------------------------
sal_Int16 SAL_CALL AccessibleIconChoiceCtrl::getAccessibleRole( ) throw (RuntimeException)
{
- return AccessibleRole::TREE;
+ //return AccessibleRole::TREE;
+ return AccessibleRole::LIST;
}
// -----------------------------------------------------------------------------
::rtl::OUString SAL_CALL AccessibleIconChoiceCtrl::getAccessibleDescription( ) throw (RuntimeException)