diff options
Diffstat (limited to 'svtools/source/contnr')
-rw-r--r-- | svtools/source/contnr/imivctl1.cxx | 1 | ||||
-rw-r--r-- | svtools/source/contnr/svimpbox.cxx | 13 | ||||
-rw-r--r-- | svtools/source/contnr/svtabbx.cxx | 8 | ||||
-rw-r--r-- | svtools/source/contnr/svtreebx.cxx | 139 |
4 files changed, 159 insertions, 2 deletions
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 56a15574e29b..f83fbac06e2e 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -1120,6 +1120,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, { SelectEntry( pCursor, sal_True, sal_True, sal_False, bPaintSync ); aCurSelectionRect = GetEntryBoundRect( pCursor ); + CallEventListeners( VCLEVENT_LISTBOX_SELECT, pCursor ); } } } diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index 7f8df9b9897e..464ed24aefe8 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -305,6 +305,8 @@ void SvImpLBox::Clear() // #97680# --------- aContextBmpWidthVector.clear(); + CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED, NULL ); + } // ********************************************************************* @@ -652,6 +654,7 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect ) if(!bForceNoSelect && bSimpleTravel && !(nFlags & F_DESEL_ALL) && GetUpdateMode()) { pView->Select( pCursor, sal_True ); + CallEventListeners( VCLEVENT_LISTBOX_TREEFOCUS, pCursor ); } // Mehrfachselektion: Im Cursor-Move selektieren, wenn // nicht im Add-Mode (Ctrl-F8) @@ -661,10 +664,15 @@ void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, sal_Bool bForceNoSelect ) !bForceNoSelect ) { pView->Select( pCursor, sal_True ); + CallEventListeners( VCLEVENT_LISTBOX_TREEFOCUS, pCursor ); } else { ShowCursor( sal_True ); + if (bForceNoSelect && GetUpdateMode()) + { + CallEventListeners( VCLEVENT_LISTBOX_TREEFOCUS, pCursor); + } } if( pAnchor ) @@ -1706,6 +1714,9 @@ void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, sal_Bool bSelect ) void SvImpLBox::RemovingEntry( SvLBoxEntry* pEntry ) { + + CallEventListeners( VCLEVENT_LISTBOX_ITEMREMOVED , pEntry ); + DestroyAnchor(); if( !pView->IsEntryVisible( pEntry ) ) @@ -2340,7 +2351,7 @@ sal_Bool SvImpLBox::KeyInput( const KeyEvent& rKEvt) case KEY_LEFT: { - if ( bIsCellFocusEnabled ) + if ( bIsCellFocusEnabled && pCursor) { if ( nCurTabPos > FIRST_ENTRY_TAB ) { diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx index ada81843f43d..4d9328d1dc9a 100644 --- a/svtools/source/contnr/svtabbx.cxx +++ b/svtools/source/contnr/svtabbx.cxx @@ -1183,6 +1183,10 @@ void SvHeaderTabListBox::FillAccessibleStateSet( ::utl::AccessibleStateSetHelper sal_uInt16 nCurColumn = GetCurrColumn(); if ( IsCellVisible( nCurRow, nCurColumn ) ) _rStateSet.AddState( AccessibleStateType::VISIBLE ); + if ( IsEnabled() ) + { + _rStateSet.AddState( AccessibleStateType::ENABLED ); + } _rStateSet.AddState( AccessibleStateType::TRANSIENT ); break; } @@ -1195,6 +1199,10 @@ void SvHeaderTabListBox::FillAccessibleStateSet( ::utl::AccessibleStateSetHelper _rStateSet.AddState( AccessibleStateType::TRANSIENT ); break; } + if ( IsEnabled() ) + { + _rStateSet.AddState( AccessibleStateType::ENABLED ); + } default: break; } diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx index 329b5ded69ef..d3e49b20e64c 100644 --- a/svtools/source/contnr/svtreebx.cxx +++ b/svtools/source/contnr/svtreebx.cxx @@ -92,6 +92,7 @@ void SvTreeListBox::InitTreeView() nFirstSelTab = 0; nLastSelTab = 0; nFocusWidth = -1; + m_nAllItemAccRoleType = 0; Link* pLink = new Link( LINK(this,SvTreeListBox, DefaultCompare) ); pLBoxImpl->m_pLink = pLink; @@ -525,6 +526,89 @@ void SvTreeListBox::ImpEntryInserted( SvLBoxEntry* pEntry ) SetEntryHeight( (SvLBoxEntry*)pEntry ); } +String SvTreeListBox::GetEntryAltText( SvLBoxEntry* ) const +{ + String tmp; + return tmp; +} + +String SvTreeListBox::GetEntryLongDescription( SvLBoxEntry* ) const +{ + String tmp; + return tmp; +} + +String SvTreeListBox::SearchEntryTextWithHeadTitle( SvLBoxEntry* pEntry ) +{ + DBG_CHKTHIS(SvTreeListBox,0); + DBG_ASSERT( pEntry, "SvTreeListBox::SearchEntryText(): no entry" ); + String sRet; + + sal_uInt16 nCount = pEntry->ItemCount(); + sal_uInt16 nCur = 0; + sal_uInt16 nHeaderCur = 0; + SvLBoxItem* pItem; + while( nCur < nCount ) + { + // MT: SV_ITEM_ID_EXTENDRLBOXSTRING / GetExtendText() was in use in IA2 cws, but only used in sc: ScSolverOptionsString. Needed? + pItem = pEntry->GetItem( nCur ); + if ( (pItem->IsA() == SV_ITEM_ID_LBOXSTRING /* || pItem->IsA() == SV_ITEM_ID_EXTENDRLBOXSTRING */ ) && + static_cast<SvLBoxString*>( pItem )->GetText().Len() > 0 ) + { + + //want to the column header + if( headString.Len() > 0) + { + xub_StrLen nEnd = headString.Search( sal_Unicode( '\t' ) ); + if( nEnd == STRING_NOTFOUND ) + { + if(sRet.Len()>0) + { + sRet += ','; + } + if(headString.Len()>0) + { + sRet += headString ; + sRet += ':' ; + } + } + else + { + String aString=headString.GetToken(nHeaderCur, sal_Unicode( '\t' ) ); + if(sRet.Len()>0) + { + sRet += ','; + } + if( aString.Len() > 0) + { + sRet += aString ; + sRet += ':' ; + } + nHeaderCur++; + } + // if (pItem->IsA() == SV_ITEM_ID_LBOXSTRING) + sRet += static_cast<SvLBoxString*>( pItem )->GetText(); + // else + // sRet += static_cast<SvLBoxString*>( pItem )->GetExtendText(); + } + else + { + // if (pItem->IsA() == SV_ITEM_ID_LBOXSTRING) + sRet += static_cast<SvLBoxString*>( pItem )->GetText(); + // else + // sRet += static_cast<SvLBoxString*>( pItem )->GetExtendText(); + sRet += ','; + } + //end want to the column header + } + nCur++; + } + + if (sRet.Len() > 0) + sRet = sRet.Erase(sRet.Len() - 1); + return sRet; +} + void SvTreeListBox::SetCheckButtonState( SvLBoxEntry* pEntry, SvButtonState eState) @@ -755,10 +839,27 @@ void SvTreeListBox::RequestingChilds( SvLBoxEntry* pParent ) void SvTreeListBox::GetFocus() { DBG_CHKTHIS(SvTreeListBox,0); + + if( !SvLBox::First()) + { + Invalidate(); + } + pImp->GetFocus(); SvLBox::GetFocus(); SvLBoxEntry* pEntry = FirstSelected(); + if ( !pEntry ) + { + pEntry = pImp->GetCurrentEntry(); + } + if (pImp->pCursor) + { + if (pEntry != pImp->pCursor) + { + pEntry = pImp->pCursor; + } + } if ( pEntry ) { pImp->CallEventListeners( VCLEVENT_LISTBOX_TREEFOCUS, pEntry ); @@ -768,6 +869,10 @@ void SvTreeListBox::GetFocus() void SvTreeListBox::LoseFocus() { DBG_CHKTHIS(SvTreeListBox,0); + if( !SvLBox::First()) + { + Invalidate(); + } pImp->LoseFocus(); SvLBox::LoseFocus(); } @@ -1015,7 +1120,7 @@ sal_Bool SvTreeListBox::Select( SvLBoxEntry* pEntry, sal_Bool bSelect ) if( bSelect ) { SelectHdl(); - pImp->CallEventListeners( VCLEVENT_LISTBOX_SELECT, pEntry ); + CallEventListeners( VCLEVENT_LISTBOX_TREESELECT, pEntry); } else DeselectHdl(); @@ -1136,6 +1241,20 @@ void SvTreeListBox::Paint( const Rectangle& rRect ) if( nTreeFlags & TREEFLAG_RECALCTABS ) SetTabs(); pImp->Paint( rRect ); + if( !SvLBox::First() ) + { + if( HasFocus() ) + { + sal_Int32 tempHeight = GetTextHeight(); + Rectangle tempRect( Point(0,0),Size(GetSizePixel().Width(),tempHeight)); + ShowFocus(tempRect); + } + else + { + HideFocus(); + } + } + } void SvTreeListBox::MouseButtonDown( const MouseEvent& rMEvt ) @@ -2450,7 +2569,9 @@ void SvTreeListBox::FillAccessibleEntryStateSet( SvLBoxEntry* pEntry, ::utl::Acc { rStateSet.AddState( AccessibleStateType::EXPANDABLE ); if ( IsExpanded( pEntry ) ) + { rStateSet.AddState( (sal_Int16)AccessibleStateType::EXPANDED ); + } } if ( GetCheckButtonState( pEntry ) == SV_BUTTON_CHECKED ) @@ -2459,6 +2580,22 @@ void SvTreeListBox::FillAccessibleEntryStateSet( SvLBoxEntry* pEntry, ::utl::Acc rStateSet.AddState( AccessibleStateType::VISIBLE ); if ( IsSelected( pEntry ) ) rStateSet.AddState( AccessibleStateType::SELECTED ); + + if ( IsEnabled() ) + { + rStateSet.AddState( AccessibleStateType::ENABLED ); + rStateSet.AddState( AccessibleStateType::FOCUSABLE ); + rStateSet.AddState( AccessibleStateType::SELECTABLE ); + SvViewDataEntry* pViewDataNewCur = 0; + if( pEntry ) + { + pViewDataNewCur= GetViewDataEntry(pEntry); + if(pViewDataNewCur->HasFocus()) + { + rStateSet.AddState( AccessibleStateType::FOCUSED ); + } + } + } } Rectangle SvTreeListBox::GetBoundingRect( SvLBoxEntry* pEntry ) |