summaryrefslogtreecommitdiff
path: root/vcl/source/control/lstbox.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control/lstbox.cxx')
-rw-r--r--vcl/source/control/lstbox.cxx38
1 files changed, 38 insertions, 0 deletions
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 5b145263d888..1336b2e35f6f 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -170,6 +170,10 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetCancelHdl( LINK( this, ListBox, ImplCancelHdl ) );
mpImplLB->SetDoubleClickHdl( LINK( this, ListBox, ImplDoubleClickHdl ) );
mpImplLB->SetUserDrawHdl( LINK( this, ListBox, ImplUserDrawHdl ) );
+//IAccessibility2 Implementation 2009-----
+ mpImplLB->SetFocusHdl( LINK( this, ListBox, ImplFocusHdl ) );
+ mpImplLB->SetListItemSelectHdl( LINK( this, ListBox, ImplListItemSelectHdl ) );
+//-----IAccessibility2 Implementation 2009
mpImplLB->SetPosPixel( Point() );
mpImplLB->SetEdgeBlending(GetEdgeBlending());
mpImplLB->Show();
@@ -249,6 +253,18 @@ IMPL_LINK( ListBox, ImplSelectHdl, void*, EMPTYARG )
return 1;
}
+//IAccessibility2 Implementation 2009-----
+IMPL_LINK( ListBox, ImplFocusHdl, void *, nPos )
+{
+ ImplCallEventListeners( VCLEVENT_LISTBOX_FOCUS , nPos);
+ return 1;
+}
+IMPL_LINK( ListBox, ImplListItemSelectHdl, void*, EMPTYARG )
+{
+ ImplCallEventListeners( VCLEVENT_LISTBOX_SELECT );
+ return 1;
+}
+//-----IAccessibility2 Implementation 2009
// -----------------------------------------------------------------------
@@ -1060,6 +1076,8 @@ void ListBox::SetNoSelection()
mpImplWin->SetImage( aImage );
mpImplWin->Invalidate();
}
+ // IAccessible2 implementation 2009
+ NotifyVCLEvent( VCLEVENT_LISTBOX_STATEUPDATE);
}
// -----------------------------------------------------------------------
@@ -1204,7 +1222,21 @@ void ListBox::SelectEntry( const XubString& rStr, sal_Bool bSelect )
void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect )
{
if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() )
+ {
+ // IAccessible2 implementation 2009
+ sal_uInt16 oldSelectCount = GetSelectEntryCount(), newSelectCount = 0, nCurrentPos = mpImplLB->GetCurrentPos();
mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect );
+ newSelectCount = GetSelectEntryCount();
+ if (oldSelectCount == 0 && newSelectCount > 0)
+ NotifyVCLEvent( VCLEVENT_LISTBOX_STATEUPDATE);
+ //Only when bSelect == true, send both Selection & Focus events
+ if (nCurrentPos != nPos && bSelect)
+ {
+ ImplCallEventListeners( VCLEVENT_LISTBOX_SELECT, reinterpret_cast<void*>(nPos));
+ if (HasFocus())
+ ImplCallEventListeners( VCLEVENT_LISTBOX_FOCUS, reinterpret_cast<void*>(nPos));
+ }
+ }
}
// -----------------------------------------------------------------------
@@ -1605,6 +1637,12 @@ sal_uInt16 ListBox::GetMaxMRUCount() const
{
return mpImplLB->GetMaxMRUCount();
}
+//IAccessibility2 Implementation 2009-----
+sal_uInt16 ListBox::GetMRUCount() const
+{
+ return mpImplLB->GetEntryList()->GetMRUCount();
+}
+//-----IAccessibility2 Implementation 2009
// -----------------------------------------------------------------------