#98286# improve accessibility
This commit is contained in:
parent
d239ba65d5
commit
38b30eb32f
4 changed files with 99 additions and 70 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: brwbox3.cxx,v $
|
||||
*
|
||||
* $Revision: 1.2 $
|
||||
* $Revision: 1.3 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2002-04-09 07:24:53 $
|
||||
* last change: $Author: oj $ $Date: 2002-04-17 11:56:23 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -193,7 +193,7 @@ Reference< XAccessible > BrowseBox::CreateAccessibleControl( sal_Int32 nIndex )
|
|||
sal_Bool BrowseBox::ConvertPointToCellAddress(
|
||||
sal_Int32& rnRow, sal_uInt16& rnColumnId, const Point& rPoint )
|
||||
{
|
||||
//! TODO
|
||||
//! TODO has to be checked
|
||||
rnRow = GetRowAtYPosPixel(rPoint.Y());
|
||||
rnColumnId = GetColumnAtXPosPixel(rPoint.X());
|
||||
return rnRow != BROWSER_INVALIDID && rnColumnId != BROWSER_INVALIDID;
|
||||
|
@ -217,7 +217,7 @@ sal_Bool BrowseBox::ConvertPointToColumnHeader( sal_uInt16& _rnColumnId, const P
|
|||
|
||||
sal_Bool BrowseBox::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint )
|
||||
{
|
||||
//! TODO
|
||||
//! TODO has to be checked
|
||||
sal_Int32 nRow = 0;
|
||||
sal_uInt16 nColumn = 0;
|
||||
sal_Bool bRet = ConvertPointToCellAddress(nRow,nColumn,_rPoint);
|
||||
|
@ -233,11 +233,9 @@ sal_Bool BrowseBox::ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point
|
|||
OUString BrowseBox::GetAccessibleName( ::svt::AccessibleBrowseBoxObjType eObjType ) const
|
||||
{
|
||||
OUString aRetText;
|
||||
//! TODO all texts
|
||||
switch( eObjType )
|
||||
{
|
||||
case ::svt::BBTYPE_BROWSEBOX:
|
||||
//! TODO only a test name
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BrowseBox" ) );
|
||||
break;
|
||||
case ::svt::BBTYPE_TABLE:
|
||||
|
@ -249,9 +247,6 @@ OUString BrowseBox::GetAccessibleName( ::svt::AccessibleBrowseBoxObjType eObjTyp
|
|||
case ::svt::BBTYPE_COLUMNHEADERBAR:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "ColumnHeaderBar" ) );
|
||||
break;
|
||||
case ::svt::BBTYPE_CORNERCONTROL:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "CornerControl" ) );
|
||||
break;
|
||||
case ::svt::BBTYPE_TABLECELL:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "TableCell" ) );
|
||||
break;
|
||||
|
@ -274,30 +269,25 @@ OUString BrowseBox::GetAccessibleDescription( ::svt::AccessibleBrowseBoxObjType
|
|||
switch( eObjType )
|
||||
{
|
||||
case ::svt::BBTYPE_BROWSEBOX:
|
||||
//! TODO only a test name
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BrowseBox description" ) );
|
||||
break;
|
||||
//! TODO all texts
|
||||
case ::svt::BBTYPE_TABLE:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BBTYPE_TABLE description" ) );
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLE description" ) );
|
||||
break;
|
||||
case ::svt::BBTYPE_ROWHEADERBAR:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BBTYPE_ROWHEADERBAR description" ) );
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERBAR description" ) );
|
||||
break;
|
||||
case ::svt::BBTYPE_COLUMNHEADERBAR:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BBTYPE_COLUMNHEADERBAR description" ) );
|
||||
break;
|
||||
case ::svt::BBTYPE_CORNERCONTROL:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BBTYPE_CORNERCONTROL description" ) );
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERBAR description" ) );
|
||||
break;
|
||||
case ::svt::BBTYPE_TABLECELL:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BBTYPE_TABLECELL description" ) );
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "TABLECELL description" ) );
|
||||
break;
|
||||
case ::svt::BBTYPE_ROWHEADERCELL:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BBTYPE_ROWHEADERCELL description" ) );
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "ROWHEADERCELL description" ) );
|
||||
break;
|
||||
case ::svt::BBTYPE_COLUMNHEADERCELL:
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "BBTYPE_COLUMNHEADERCELL description" ) );
|
||||
aRetText = OUString( RTL_CONSTASCII_USTRINGPARAM( "COLUMNHEADERCELL description" ) );
|
||||
break;
|
||||
}
|
||||
return aRetText;
|
||||
|
@ -314,7 +304,6 @@ void BrowseBox::FillAccessibleStateSet(
|
|||
::utl::AccessibleStateSetHelper& rStateSet,
|
||||
::svt::AccessibleBrowseBoxObjType eObjType ) const
|
||||
{
|
||||
//! TODO
|
||||
switch( eObjType )
|
||||
{
|
||||
case ::svt::BBTYPE_BROWSEBOX:
|
||||
|
@ -344,12 +333,6 @@ void BrowseBox::FillAccessibleStateSet(
|
|||
if ( GetSelectColumnCount() )
|
||||
rStateSet.AddState( AccessibleStateType::FOCUSED );
|
||||
break;
|
||||
case ::svt::BBTYPE_CORNERCONTROL:
|
||||
rStateSet.AddState( AccessibleStateType::FOCUSABLE );
|
||||
rStateSet.AddState( AccessibleStateType::VISIBLE );
|
||||
if ( IsAllSelected() )
|
||||
rStateSet.AddState( AccessibleStateType::FOCUSED );
|
||||
break;
|
||||
case ::svt::BBTYPE_TABLECELL:
|
||||
{
|
||||
sal_Int32 nCurRow = GetCurRow();
|
||||
|
@ -371,7 +354,6 @@ void BrowseBox::FillAccessibleStateSet(
|
|||
|
||||
void BrowseBox::GrabTableFocus()
|
||||
{
|
||||
//! TODO EditBrowseBox has to grab focus of the edit control of the current cell (ActivateCell)
|
||||
GrabFocus();
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
@ -381,4 +363,13 @@ String BrowseBox::GetCellText(long _nRow, USHORT _nColId) const
|
|||
return String();
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
void BrowseBox::commitTableEvent(sal_Int16 _nEventId,
|
||||
const ::com::sun::star::uno::Any& _rNewValue,
|
||||
const ::com::sun::star::uno::Any& _rOldValue)
|
||||
{
|
||||
if ( m_pImpl->m_pAccessible )
|
||||
m_pImpl->commitTableEvent( _nEventId, _rNewValue, _rOldValue);
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: editbrowsebox.cxx,v $
|
||||
*
|
||||
* $Revision: 1.5 $
|
||||
* $Revision: 1.6 $
|
||||
*
|
||||
* last change: $Author: fs $ $Date: 2002-04-11 15:57:05 $
|
||||
* last change: $Author: oj $ $Date: 2002-04-17 11:56:23 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -104,12 +104,19 @@
|
|||
#ifndef _SV_MULTISEL_HXX
|
||||
#include <tools/multisel.hxx>
|
||||
#endif
|
||||
#ifndef SVTOOLS_EDITBROWSEBOX_IMPL_HXX
|
||||
#include "editbrowseboximpl.hxx"
|
||||
#endif
|
||||
#ifndef _DRAFTS_COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_
|
||||
#include <drafts/com/sun/star/accessibility/AccessibleEventId.hpp>
|
||||
#endif
|
||||
|
||||
// .......................................................................
|
||||
namespace svt
|
||||
{
|
||||
// .......................................................................
|
||||
|
||||
using namespace drafts::com::sun::star::accessibility::AccessibleEventId;
|
||||
//==================================================================
|
||||
|
||||
#define HANDLE_ID 0
|
||||
|
@ -165,6 +172,26 @@ namespace svt
|
|||
|
||||
|
||||
DBG_NAME(EditBrowseBox);
|
||||
void EditBrowseBox::Construct()
|
||||
{
|
||||
m_aImpl = ::std::auto_ptr<EditBrowseBoxImpl>(new EditBrowseBoxImpl());
|
||||
SetCompoundControl(sal_True);
|
||||
SetLineColor(Color(COL_LIGHTGRAY));
|
||||
|
||||
// HACK: the BrowseBox does not invalidate it's children (as it should be)
|
||||
// Thus we reset WB_CLIPCHILDREN, which forces the invalidation of the children
|
||||
WinBits aStyle = GetStyle();
|
||||
if( aStyle & WB_CLIPCHILDREN )
|
||||
{
|
||||
aStyle &= ~WB_CLIPCHILDREN;
|
||||
SetStyle( aStyle );
|
||||
}
|
||||
ImplInitSettings(sal_True, sal_True, sal_True);
|
||||
|
||||
pCheckBoxPaint = new CheckBoxControl(&GetDataWindow());
|
||||
pCheckBoxPaint->SetPaintTransparent( sal_True );
|
||||
pCheckBoxPaint->SetBackground();
|
||||
}
|
||||
//------------------------------------------------------------------------------
|
||||
EditBrowseBox::EditBrowseBox(Window* pParent, const ResId& rId, sal_Int32 nBrowserFlags, BrowserMode _nMode )
|
||||
:BrowseBox( pParent, rId, _nMode )
|
||||
|
@ -182,22 +209,7 @@ namespace svt
|
|||
{
|
||||
DBG_CTOR(EditBrowseBox,NULL);
|
||||
|
||||
SetCompoundControl(sal_True);
|
||||
SetLineColor(Color(COL_LIGHTGRAY));
|
||||
|
||||
// HACK: the BrowseBox does not invalidate it's children (as it should be)
|
||||
// Thus we reset WB_CLIPCHILDREN, which forces the invalidation of the children
|
||||
WinBits aStyle = GetStyle();
|
||||
if( aStyle & WB_CLIPCHILDREN )
|
||||
{
|
||||
aStyle &= ~WB_CLIPCHILDREN;
|
||||
SetStyle( aStyle );
|
||||
}
|
||||
ImplInitSettings(sal_True, sal_True, sal_True);
|
||||
|
||||
pCheckBoxPaint = new CheckBoxControl(&GetDataWindow());
|
||||
pCheckBoxPaint->SetPaintTransparent( sal_True );
|
||||
pCheckBoxPaint->SetBackground();
|
||||
Construct();
|
||||
}
|
||||
|
||||
//==================================================================
|
||||
|
@ -218,22 +230,7 @@ namespace svt
|
|||
{
|
||||
DBG_CTOR(EditBrowseBox,NULL);
|
||||
|
||||
SetCompoundControl(sal_True);
|
||||
SetLineColor(Color(COL_LIGHTGRAY));
|
||||
|
||||
// HACK: the BrowseBox does not invalidate it's children (as it should be)
|
||||
// Thus we reset WB_CLIPCHILDREN, which forces the invalidation of the children
|
||||
WinBits aStyle = GetStyle();
|
||||
if( aStyle & WB_CLIPCHILDREN )
|
||||
{
|
||||
aStyle &= ~WB_CLIPCHILDREN;
|
||||
SetStyle( aStyle );
|
||||
}
|
||||
ImplInitSettings(sal_True, sal_True, sal_True);
|
||||
|
||||
pCheckBoxPaint = new CheckBoxControl(&GetDataWindow());
|
||||
pCheckBoxPaint->SetPaintTransparent( sal_True );
|
||||
pCheckBoxPaint->SetBackground();
|
||||
Construct();
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
@ -1019,6 +1016,11 @@ namespace svt
|
|||
{
|
||||
if (IsEditing())
|
||||
{
|
||||
commitTableEvent(ACCESSIBLE_ACTIVE_DESCENDANT_EVENT,
|
||||
com::sun::star::uno::Any(),
|
||||
com::sun::star::uno::Any());
|
||||
m_aImpl->disposeCell();
|
||||
|
||||
aOldController = aController;
|
||||
aController.Clear();
|
||||
|
||||
|
@ -1454,6 +1456,9 @@ namespace svt
|
|||
/*************************************************************************
|
||||
* history:
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.5 2002/04/11 15:57:05 fs
|
||||
* #98483# allow for row/column selection (event when currently editing)
|
||||
*
|
||||
* Revision 1.4 2001/12/05 14:37:37 oj
|
||||
* #95598# PaintTristate correct for parentupdate
|
||||
*
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: editbrowsebox2.cxx,v $
|
||||
*
|
||||
* $Revision: 1.1 $
|
||||
* $Revision: 1.2 $
|
||||
*
|
||||
* last change: $Author: oj $ $Date: 2002-04-09 07:23:58 $
|
||||
* last change: $Author: oj $ $Date: 2002-04-17 11:56:23 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -64,6 +64,15 @@
|
|||
#ifndef _DRAFTS_COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLE_HPP_
|
||||
#include <drafts/com/sun/star/accessibility/XAccessible.hpp>
|
||||
#endif
|
||||
#ifndef _SVTOOLS_ACCESSIBILEEDITBROWSEBOXTABLECELL_HXX
|
||||
#include "editbrowseboxcell.hxx"
|
||||
#endif
|
||||
#ifndef SVTOOLS_EDITBROWSEBOX_IMPL_HXX
|
||||
#include "editbrowseboximpl.hxx"
|
||||
#endif
|
||||
#ifndef _COMPHELPER_TYPES_HXX_
|
||||
#include <comphelper/types.hxx>
|
||||
#endif
|
||||
|
||||
namespace svt
|
||||
{
|
||||
|
@ -76,10 +85,17 @@ Reference< XAccessible > EditBrowseBox::CreateAccessibleCell( sal_Int32 nRow, sa
|
|||
Reference< XAccessible > xRet;
|
||||
if ( nRow == GetCurRow() && IsEditing() )
|
||||
{
|
||||
//! TODO need extra class which handles the controller as a child
|
||||
CellController* pController = GetController(nRow, nColumnId);
|
||||
if ( pController )
|
||||
xRet = pController->GetWindow().GetAccessible();
|
||||
{
|
||||
Reference< XAccessible > xCont = pController->GetWindow().GetAccessible();
|
||||
Reference< XAccessible > xMy = GetAccessible();
|
||||
if ( xMy.is() && xCont.is() )
|
||||
{
|
||||
m_aImpl->m_xActiveCell = new EditBrowseBoxTableCell(xMy->getAccessibleContext()->getAccessibleChild(::svt::BBINDEX_TABLE),*this,nRow, nColumnId,xCont->getAccessibleContext());
|
||||
xRet = m_aImpl->m_xActiveCell;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
xRet = BrowseBox::CreateAccessibleCell( nRow, nColumnId );
|
||||
|
@ -106,6 +122,22 @@ Reference<XAccessible > EditBrowseBox::CreateAccessibleRowHeader( sal_Int32 _nRo
|
|||
return BrowseBox::CreateAccessibleRowHeader( _nRow );
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
void EditBrowseBoxImpl::disposeCell()
|
||||
{
|
||||
try
|
||||
{
|
||||
::comphelper::disposeComponent(m_xActiveCell);
|
||||
}
|
||||
catch(const Exception&)
|
||||
{
|
||||
}
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
void EditBrowseBox::GrabTableFocus()
|
||||
{
|
||||
if ( aController.Is() )
|
||||
aController->GetWindow().GrabFocus();
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
} // namespace svt
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
#
|
||||
# $RCSfile: makefile.mk,v $
|
||||
#
|
||||
# $Revision: 1.8 $
|
||||
# $Revision: 1.9 $
|
||||
#
|
||||
# last change: $Author: oj $ $Date: 2002-04-09 07:24:53 $
|
||||
# last change: $Author: oj $ $Date: 2002-04-17 11:56:23 $
|
||||
#
|
||||
# The Contents of this file are made available subject to the terms of
|
||||
# either of the following licenses
|
||||
|
@ -81,8 +81,9 @@ BMP_IN=$(PRJ)$/res
|
|||
SRCFILES= editbrowsebox.src
|
||||
|
||||
EXCEPTIONSFILES =\
|
||||
$(SLO)$/editbrowsebox2.obj \
|
||||
$(SLO)$/brwbox1.obj \
|
||||
$(SLO)$/editbrowsebox2.obj \
|
||||
$(SLO)$/editbrowseboxcell.obj \
|
||||
$(SLO)$/brwbox1.obj \
|
||||
$(SLO)$/brwbox3.obj
|
||||
|
||||
SLOFILES= \
|
||||
|
|
Loading…
Reference in a new issue