diff options
author | Steve Yin <steve_y@apache.org> | 2013-11-25 13:15:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-11-25 14:12:36 +0000 |
commit | 79c0027c88fb64ffa7bbefcab2e291852733c223 (patch) | |
tree | 11b5f409b6c01064e37ad6fbb56d6b61edb745b4 /vcl | |
parent | 57917b0c136520b478299f581bcd99ad5610c203 (diff) |
Integrate branch of IAccessible2
Change-Id: I8c2fea0367ebfa53ce5e109ef48fd661cbfb78b3
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/ilstbox.hxx | 14 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 12 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 31 | ||||
-rw-r--r-- | vcl/source/control/ilstbox.cxx | 21 | ||||
-rw-r--r-- | vcl/source/control/lstbox.cxx | 33 | ||||
-rw-r--r-- | vcl/source/control/morebtn.cxx | 5 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/btndlg.cxx | 7 | ||||
-rw-r--r-- | vcl/source/window/dlgctrl.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/menu.cxx | 48 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 3 |
12 files changed, 161 insertions, 29 deletions
diff --git a/vcl/inc/ilstbox.hxx b/vcl/inc/ilstbox.hxx index 315f4ce0f1df..18dfee8bebcb 100644 --- a/vcl/inc/ilstbox.hxx +++ b/vcl/inc/ilstbox.hxx @@ -253,6 +253,8 @@ private: Link maDoubleClickHdl; Link maUserDrawHdl; Link maMRUChangedHdl; + Link maFocusHdl; + Link maListItemSelectHdl; ::vcl::QuickSelectionEngine maQuickSelectionEngine; @@ -266,7 +268,7 @@ protected: virtual void GetFocus(); virtual void LoseFocus(); - sal_Bool SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False ); + sal_Bool SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift = sal_False, sal_Bool bCtrl = sal_False, sal_Bool bSelectPosChange = sal_False ); void ImplPaint( sal_uInt16 nPos, sal_Bool bErase = sal_False, bool bLayout = false ); void ImplDoPaint( const Rectangle& rRect, bool bLayout = false ); void ImplCalcMetrics(); @@ -363,9 +365,13 @@ public: const Link& GetUserDrawHdl() const { return maUserDrawHdl; } void SetMRUChangedHdl( const Link& rLink ) { maMRUChangedHdl = rLink; } const Link& GetMRUChangedHdl() const { return maMRUChangedHdl; } + void SetFocusHdl( const Link& rLink ) { maFocusHdl = rLink ; } + const Link& GetFocusHdl() const { return maFocusHdl; } + void SetListItemSelectHdl( const Link& rLink ) { maListItemSelectHdl = rLink ; } + const Link& GetListItemSelectHdl() const { return maListItemSelectHdl; } bool IsSelectionChanged() const { return mbSelectionChanged; } - sal_uInt16 GetSelectModifier() const { return mnSelectModifier; } + sal_uInt16 GetSelectModifier() const { return mnSelectModifier; } void EnableSort( bool b ) { mbSort = b; } @@ -499,6 +505,10 @@ public: void SetUserDrawHdl( const Link& rLink ) { maLBWindow.SetUserDrawHdl( rLink ); } const Link& GetUserDrawHdl() const { return maLBWindow.GetUserDrawHdl(); } + void SetFocusHdl( const Link& rLink ) { maLBWindow.SetFocusHdl( rLink ); } + const Link& GetFocusHdl() const { return maLBWindow.GetFocusHdl(); } + void SetListItemSelectHdl( const Link& rLink ) { maLBWindow.SetListItemSelectHdl( rLink ); } + const Link& GetListItemSelectHdl() const { return maLBWindow.GetListItemSelectHdl(); } void SetSelectionChangedHdl( const Link& rLnk ) { maLBWindow.GetEntryList()->SetSelectionChangedHdl( rLnk ); } void SetCallSelectionChangedHdl( sal_Bool bCall ) { maLBWindow.GetEntryList()->SetCallSelectionChangedHdl( bCall ); } sal_Bool IsSelectionChanged() const { return maLBWindow.IsSelectionChanged(); } diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index bb304b123532..214bbf53f527 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -205,6 +205,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle ) mpImplLB->SetDoubleClickHdl( LINK( this, ComboBox, ImplDoubleClickHdl ) ); mpImplLB->SetUserDrawHdl( LINK( this, ComboBox, ImplUserDrawHdl ) ); mpImplLB->SetSelectionChangedHdl( LINK( this, ComboBox, ImplSelectionChangedHdl ) ); + mpImplLB->SetListItemSelectHdl( LINK( this, ComboBox, ImplListItemSelectHdl ) ); mpImplLB->Show(); if ( mpFloatWin ) @@ -460,7 +461,11 @@ IMPL_LINK_NOARG(ComboBox, ImplSelectHdl) return 0; } -// ----------------------------------------------------------------------- +IMPL_LINK( ComboBox, ImplListItemSelectHdl, void*, EMPTYARG ) +{ + ImplCallEventListeners( VCLEVENT_LISTBOX_SELECT ); + return 1; +} IMPL_LINK_NOARG(ComboBox, ImplCancelHdl) { @@ -1364,6 +1369,11 @@ sal_uInt16 ComboBox::GetMaxMRUCount() const return mpImplLB->GetMaxMRUCount(); } +sal_uInt16 ComboBox::GetMRUCount() const +{ + return mpImplLB->GetEntryList()->GetMRUCount(); +} + // ----------------------------------------------------------------------- sal_uInt16 ComboBox::GetDisplayLineCount() const diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index 98edce1a5883..904a502ef501 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2491,8 +2491,7 @@ void Edit::Modify() return; // #i13677# notify edit listeners about caret position change - ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); - + ImplCallEventListeners( VCLEVENT_EDIT_CARETCHANGED ); // FIXME: this is currently only on aqua // check for other platforms that need similar handling if( ImplGetSVData()->maNWFData.mbNoFocusRects && @@ -2647,15 +2646,35 @@ void Edit::ImplSetSelection( const Selection& rSelection, sal_Bool bPaint ) if ( aNew != maSelection ) { ImplClearLayoutData(); + Selection aTemp = maSelection; maSelection = aNew; if ( bPaint && ( aOld.Len() || aNew.Len() || IsPaintTransparent() ) ) ImplInvalidateOrRepaint( 0, maText.getLength() ); ImplShowCursor(); - if ( mbIsSubEdit ) - ((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); - else - ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); + + sal_Bool bCaret = sal_False, bSelection = sal_False; + long nB=aNew.Max(), nA=aNew.Min(),oB=aTemp.Max(), oA=aTemp.Min(); + long nGap = nB-nA, oGap = oB-oA; + if (nB != oB) + bCaret = sal_True; + if (nGap != 0 || oGap != 0) + bSelection = sal_True; + if (bCaret) + { + if ( mbIsSubEdit ) + ((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_CARETCHANGED ); + else + ImplCallEventListeners( VCLEVENT_EDIT_CARETCHANGED ); + } + if (bSelection) + { + if ( mbIsSubEdit ) + ((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); + else + ImplCallEventListeners( VCLEVENT_EDIT_SELECTIONCHANGED ); + } + // #103511# notify combobox listeners of deselection if( !maSelection && GetParent() && GetParent()->GetType() == WINDOW_COMBOBOX ) ((Edit*)GetParent())->ImplCallEventListeners( VCLEVENT_COMBOBOX_DESELECT ); diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx index fa9c2773657a..e15898defa45 100644 --- a/vcl/source/control/ilstbox.cxx +++ b/vcl/source/control/ilstbox.cxx @@ -929,7 +929,8 @@ void ImplListBoxWindow::MouseButtonDown( const MouseEvent& rMEvt ) mnCurrentPos = nSelect; mbTrackingSelect = true; - SelectEntries( nSelect, LET_MBDOWN, rMEvt.IsShift(), rMEvt.IsMod1() ); + sal_Bool bCurPosChange = (mnCurrentPos != nSelect); + SelectEntries( nSelect, LET_MBDOWN, rMEvt.IsShift(), rMEvt.IsMod1() ,bCurPosChange); mbTrackingSelect = false; if ( mbGrabFocus ) GrabFocus(); @@ -1000,6 +1001,12 @@ void ImplListBoxWindow::MouseMove( const MouseEvent& rMEvt ) ImplCallSelect(); mbTravelSelect = false; } + // When list box selection change by mouse move, notity + // VCLEVENT_LISTBOX_SELECT vcl event. + else + { + maListItemSelectHdl.Call(NULL); + } } mbTrackingSelect = false; } @@ -1087,7 +1094,7 @@ void ImplListBoxWindow::SelectEntry( sal_uInt16 nPos, sal_Bool bSelect ) // ----------------------------------------------------------------------- -sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift, sal_Bool bCtrl ) +sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLET, sal_Bool bShift, sal_Bool bCtrl, sal_Bool bSelectPosChange /*=FALSE*/ ) { bool bFocusChanged = false; sal_Bool bSelectionChanged = sal_False; @@ -1232,6 +1239,10 @@ sal_Bool ImplListBoxWindow::SelectEntries( sal_uInt16 nSelect, LB_EVENT_TYPE eLE maFocusRect.SetSize( aSz ); if( HasFocus() ) ImplShowFocusRect(); + if (bSelectPosChange) + { + maFocusHdl.Call(reinterpret_cast<void*>(nSelect)); + } } ImplClearLayoutData(); } @@ -1690,8 +1701,9 @@ sal_Bool ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt ) DBG_ASSERT( !mpEntryList->IsEntryPosSelected( nSelect ) || mbMulti, "ImplListBox: Selecting same Entry" ); if( nSelect >= mpEntryList->GetEntryCount() ) nSelect = mpEntryList->GetEntryCount()-1; + sal_Bool bCurPosChange = (mnCurrentPos != nSelect); mnCurrentPos = nSelect; - if ( SelectEntries( nSelect, eLET, bShift, bCtrl ) ) + if(SelectEntries( nSelect, eLET, bShift, bCtrl, bCurPosChange)) { mbTravelSelect = true; mnSelectModifier = rKEvt.GetKeyCode().GetModifier(); @@ -2159,12 +2171,11 @@ Rectangle ImplListBoxWindow::GetBoundingRectangle( sal_uInt16 nItem ) const { const ImplEntryType* pEntry = mpEntryList->GetEntryPtr( nItem ); Size aSz( GetSizePixel().Width(), pEntry ? pEntry->mnHeight : GetEntryHeight() ); - long nY = mpEntryList->GetAddedHeight( nItem, GetTopEntry() ) - mpEntryList->GetAddedHeight( GetTopEntry() ); + long nY = mpEntryList->GetAddedHeight( nItem, GetTopEntry() ) + GetEntryList()->GetMRUCount()*GetEntryHeight(); Rectangle aRect( Point( 0, nY ), aSz ); return aRect; } - // ----------------------------------------------------------------------- void ImplListBoxWindow::StateChanged( StateChangedType nType ) diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx index b1e5df0d195a..fe358ae30b55 100644 --- a/vcl/source/control/lstbox.cxx +++ b/vcl/source/control/lstbox.cxx @@ -162,6 +162,8 @@ 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 ) ); + mpImplLB->SetFocusHdl( LINK( this, ListBox, ImplFocusHdl ) ); + mpImplLB->SetListItemSelectHdl( LINK( this, ListBox, ImplListItemSelectHdl ) ); mpImplLB->SetPosPixel( Point() ); mpImplLB->SetEdgeBlending(GetEdgeBlending()); mpImplLB->Show(); @@ -239,6 +241,18 @@ IMPL_LINK_NOARG(ListBox, ImplSelectHdl) return 1; } +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; +} + IMPL_LINK_NOARG(ListBox, ImplScrollHdl) { @@ -1013,6 +1027,7 @@ void ListBox::SetNoSelection() mpImplWin->SetImage( aImage ); mpImplWin->Invalidate(); } + ImplCallEventListeners(VCLEVENT_LISTBOX_STATEUPDATE); } @@ -1131,7 +1146,20 @@ void ListBox::SelectEntry( const OUString& rStr, sal_Bool bSelect ) void ListBox::SelectEntryPos( sal_uInt16 nPos, sal_Bool bSelect ) { if ( nPos < mpImplLB->GetEntryList()->GetEntryCount() ) + { + sal_uInt16 oldSelectCount = GetSelectEntryCount(), newSelectCount = 0, nCurrentPos = mpImplLB->GetCurrentPos(); mpImplLB->SelectEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount(), bSelect ); + newSelectCount = GetSelectEntryCount(); + if (oldSelectCount == 0 && newSelectCount > 0) + ImplCallEventListeners(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)); + } + } } @@ -1538,6 +1566,11 @@ void ListBox::SetEdgeBlending(bool bNew) } } +sal_uInt16 ListBox::GetMRUCount() const +{ + return mpImplLB->GetEntryList()->GetMRUCount(); +} + // ======================================================================= MultiListBox::MultiListBox( Window* pParent, WinBits nStyle ) : ListBox( WINDOW_MULTILISTBOX ) diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index 0e697769cd7b..c1cc320648e8 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -127,9 +127,6 @@ void MoreButton::Click() mbState = !mbState; ShowState(); - // Call Click handler here, so that we can initialize the Controls - PushButton::Click(); - // Update the windows according to the status if ( mbState ) { @@ -170,6 +167,8 @@ void MoreButton::Click() } } } + // Call Click handler here, so that we can initialize the Controls + PushButton::Click(); } void MoreButton::AddWindow( Window* pWindow ) diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 93ee0cdbabcc..640af54cb4a7 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -702,6 +702,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) } pPage->ActivatePage(); + pPage->Show(); if ( pOldPage && pOldPage->HasChildPathFocus() ) { @@ -712,8 +713,6 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) else GrabFocus(); } - - pPage->Show(); } if ( pOldPage ) diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx index 84694beac4c3..212b5c65df1e 100644 --- a/vcl/source/window/btndlg.cxx +++ b/vcl/source/window/btndlg.cxx @@ -231,11 +231,16 @@ void ButtonDialog::StateChanged( StateChangedType nType ) if ( nType == STATE_CHANGE_INITSHOW ) { ImplPosControls(); + for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it) + { + if ( it->mpPushButton && it->mbOwnButton ) + it->mpPushButton->SetZOrder(0, WINDOW_ZORDER_LAST); + } // Set focus on default button. if ( mnFocusButtonId != BUTTONDIALOG_BUTTON_NOTFOUND ) { - for ( btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it) + for (btn_iterator it = maItemList.begin(); it != maItemList.end(); ++it) { if (it->mnId == mnFocusButtonId ) { diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index 6da32aa6a9da..29f02ea5530e 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -541,7 +541,13 @@ namespace { bool isSuitableDestination(Window *pWindow) { - return (pWindow && isVisibleInLayout(pWindow) && isEnabledInLayout(pWindow) && pWindow->IsInputEnabled()); + return (pWindow && isVisibleInLayout(pWindow) && + isEnabledInLayout(pWindow) && pWindow->IsInputEnabled() && + //Pure window shouldn't get window after controls such as + //buttons. + (pWindow->GetType() != WINDOW_WINDOW && pWindow->GetType() != WINDOW_SYSWINDOW && + pWindow->GetType() != WINDOW_WORKWINDOW && pWindow->GetType() != WINDOW_CONTROL) + ); } bool focusNextInGroup(std::vector<RadioButton*>::iterator aStart, std::vector<RadioButton*> &rGroup) diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 4a3e784f81a0..2a83c97424c0 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1577,6 +1577,36 @@ MenuItemType Menu::GetItemType( sal_uInt16 nPos ) const return MENUITEM_DONTKNOW; } +void Menu::SetHightlightItem( sal_uInt16 nItem ) +{ + nHighlightedItem = nItem; +} + +sal_uInt16 Menu::GetHighlightItem() const +{ + return nHighlightedItem; +} + +OUString Menu::GetItemAccKeyStrFromPos(sal_uInt16 nPos) const +{ + MenuItemData* pData = pItemList->GetDataFromPos( nPos ); + if (pData) + { + return pData->aAccelKey.GetName(); + } + return OUString(); +} + +sal_Bool Menu::IsTemporaryItemFromPos(sal_uInt16 nPos ) const +{ + MenuItemData* pData = pItemList->GetDataFromPos( nPos ); + if (pData) + { + return pData->bIsTemporary; + } + return sal_False; +} + sal_uInt16 Menu::GetCurItemId() const { return nSelectedId; @@ -2981,12 +3011,12 @@ Menu* Menu::ImplGetStartMenu() return pStart; } -void Menu::ImplCallHighlight( sal_uInt16 nHighlightedItem ) +void Menu::ImplCallHighlight(sal_uInt16 nItem) { ImplMenuDelData aDelData( this ); nSelectedId = 0; - MenuItemData* pData = pItemList->GetDataFromPos( nHighlightedItem ); + MenuItemData* pData = pItemList->GetDataFromPos(nItem); if ( pData ) nSelectedId = pData->nId; ImplCallEventListeners( VCLEVENT_MENU_HIGHLIGHT, GetItemPos( GetCurItemId() ) ); @@ -3666,7 +3696,10 @@ sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong OUString aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) ); MenuItemData* pData = pItemList->Insert( 0xFFFF, MENUITEM_STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF, OString() ); - pData->bIsTemporary = true; + size_t nPos; + pData = pItemList->GetData( pData->nId, nPos ); + pData->bIsTemporary = true; + ImplCallEventListeners(VCLEVENT_MENU_SUBMENUCHANGED, nPos); } } else if ( Application::GetSettings().GetStyleSettings().GetAutoMnemonic() && !( nMenuFlags & MENU_FLAG_NOAUTOMNEMONICS ) ) @@ -3978,7 +4011,7 @@ void MenuFloatingWindow::doShutdown() // otherwise the entry will not be read when the menu is opened again if( nHighlightedItem != ITEMPOS_INVALID ) pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem ); - + pMenu->SetHightlightItem(ITEMPOS_INVALID); if( !bKeyInput && pMenu && pMenu->pStartedFrom && !pMenu->pStartedFrom->bIsMenuBar ) { // #102461# remove highlight in parent @@ -4631,6 +4664,7 @@ void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopup } } HighlightItem( nHighlightedItem, sal_True ); + pMenu->SetHightlightItem(nHighlightedItem); pMenu->ImplCallHighlight( nHighlightedItem ); } else @@ -4931,6 +4965,8 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) MenuFloatingWindow* pFloat = ((PopupMenu*)pMenu->pStartedFrom)->ImplGetFloatingWindow(); pFloat->GrabFocus(); pFloat->KillActivePopup(); + sal_uInt16 highlightItem = pFloat->GetHighlightedItem(); + pFloat->ChangeHighlightItem(highlightItem, sal_False); } } } @@ -5534,8 +5570,8 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectEntry, sa HighlightItem( nHighlightedItem, sal_True ); else if ( nRolloveredItem != ITEMPOS_INVALID ) HighlightItem( nRolloveredItem, sal_True ); - - pMenu->ImplCallHighlight( nHighlightedItem ); + pMenu->SetHightlightItem(nHighlightedItem); + pMenu->ImplCallHighlight(nHighlightedItem); if( mbAutoPopup ) ImplCreatePopup( bSelectEntry ); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 7a3e0a45ad52..4d555a387df9 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -5423,7 +5423,10 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus ) mnCurPos = aPos; ImplShowFocus(); - ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHT ); + if( pItem->mpWindow ) + pItem->mpWindow->GrabFocus(); + if( pItem != pOldItem ) + ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHT ); } } else diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 62544c655d9a..4d0de02b184e 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -1691,7 +1691,8 @@ void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState ) ImplCallEventListeners( VCLEVENT_TOOLBOX_BUTTONSTATECHANGED, reinterpret_cast< void* >( nPos ) ); // Notify - ImplCallEventListeners( VCLEVENT_TOOLBOX_CLICK, reinterpret_cast< void* >( nPos ) ); + //Solution:Call accessible listener to notify state_changed event + ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMUPDATED, reinterpret_cast< void* >(nPos) ); } } } |