Author: af Date: Fri May 31 09:03:08 2013 New Revision: 1488132 URL: http://svn.apache.org/r1488132 Log: 122271: Setting FOCUSABLE flag at accessibility object sidebar title bars so that bridges create focus events and title bars become visible to AT devices.
Modified: openoffice/trunk/main/sfx2/Library_sfx.mk openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.cxx openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.hxx openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.cxx openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.hxx openoffice/trunk/main/sfx2/source/sidebar/TitleBar.cxx openoffice/trunk/main/sfx2/source/sidebar/TitleBar.hxx Modified: openoffice/trunk/main/sfx2/Library_sfx.mk URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/Library_sfx.mk?rev=1488132&r1=1488131&r2=1488132&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/Library_sfx.mk (original) +++ openoffice/trunk/main/sfx2/Library_sfx.mk Fri May 31 09:03:08 2013 @@ -218,6 +218,8 @@ $(eval $(call gb_Library_add_exception_o sfx2/source/sidebar/SidebarController \ sfx2/source/sidebar/SidebarPanelBase \ sfx2/source/sidebar/SidebarToolBox \ + sfx2/source/sidebar/Accessible \ + sfx2/source/sidebar/AccessibleTitleBar \ sfx2/source/sidebar/AsynchronousCall \ sfx2/source/sidebar/CommandInfoProvider \ sfx2/source/sidebar/Context \ Modified: openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.cxx?rev=1488132&r1=1488131&r2=1488132&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.cxx Fri May 31 09:03:08 2013 @@ -139,6 +139,17 @@ void DeckTitleBar::HandleToolBoxItemClic +cssu::Reference<css::accessibility::XAccessible> DeckTitleBar::CreateAccessible (void) +{ + const ::rtl::OUString sAccessibleName(msTitle); + SetAccessibleName(sAccessibleName); + SetAccessibleDescription(sAccessibleName); + return TitleBar::CreateAccessible(); +} + + + + void DeckTitleBar::DataChanged (const DataChangedEvent& rEvent) { maToolBox.SetItemImage( Modified: openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.hxx?rev=1488132&r1=1488131&r2=1488132&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.hxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/DeckTitleBar.hxx Fri May 31 09:03:08 2013 @@ -49,6 +49,7 @@ protected: virtual sidebar::Paint GetBackgroundPaint (void); virtual Color GetTextColor (void); virtual void HandleToolBoxItemClick (const sal_uInt16 nItemIndex); + virtual cssu::Reference<css::accessibility::XAccessible> CreateAccessible (void); private: const sal_uInt16 mnCloserItemIndex; Modified: openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.cxx?rev=1488132&r1=1488131&r2=1488132&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.cxx Fri May 31 09:03:08 2013 @@ -35,7 +35,6 @@ #include <vcl/image.hxx> #include <toolkit/helper/vclunohelper.hxx> - using namespace css; using namespace cssu; @@ -55,16 +54,11 @@ PanelTitleBar::PanelTitleBar ( mpPanel(pPanel), mnMenuItemIndex(1), mxFrame(), - msMoreOptionsCommand() + msMoreOptionsCommand(), + msAccessibleNamePrefix(String(SfxResId(SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX))) { OSL_ASSERT(mpPanel != NULL); - const ::rtl::OUString sAccessibleName( - String(SfxResId(SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX)) - + rsTitle); - SetAccessibleName(sAccessibleName); - SetAccessibleDescription(sAccessibleName); - #ifdef DEBUG SetText(A2S("PanelTitleBar")); #endif @@ -195,6 +189,17 @@ void PanelTitleBar::HandleToolBoxItemCli +Reference<accessibility::XAccessible> PanelTitleBar::CreateAccessible (void) +{ + const ::rtl::OUString sAccessibleName(msAccessibleNamePrefix + msTitle); + SetAccessibleName(sAccessibleName); + SetAccessibleDescription(sAccessibleName); + return TitleBar::CreateAccessible(); +} + + + + void PanelTitleBar::MouseButtonDown (const MouseEvent& rMouseEvent) { if (rMouseEvent.IsLeft()) Modified: openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.hxx?rev=1488132&r1=1488131&r2=1488132&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.hxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/PanelTitleBar.hxx Fri May 31 09:03:08 2013 @@ -56,6 +56,7 @@ protected: virtual sidebar::Paint GetBackgroundPaint (void); virtual Color GetTextColor (void); virtual void HandleToolBoxItemClick (const sal_uInt16 nItemIndex); + virtual cssu::Reference<css::accessibility::XAccessible> CreateAccessible (void); private: bool mbIsLeftButtonDown; @@ -63,6 +64,7 @@ private: const sal_uInt16 mnMenuItemIndex; cssu::Reference<css::frame::XFrame> mxFrame; ::rtl::OUString msMoreOptionsCommand; + ::rtl::OUString msAccessibleNamePrefix; }; Modified: openoffice/trunk/main/sfx2/source/sidebar/TitleBar.cxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/TitleBar.cxx?rev=1488132&r1=1488131&r2=1488132&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/TitleBar.cxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/TitleBar.cxx Fri May 31 09:03:08 2013 @@ -23,11 +23,16 @@ #include "TitleBar.hxx" #include "Paint.hxx" +#include "Accessible.hxx" +#include "AccessibleTitleBar.hxx" #include <tools/svborder.hxx> #include <vcl/gradient.hxx> #include <vcl/lineinfo.hxx> +#include <com/sun/star/accessibility/AccessibleRole.hpp> + + ToolbarValue::~ToolbarValue (void) {} namespace @@ -96,8 +101,7 @@ void TitleBar::Paint (const Rectangle& r PaintDecoration(aTitleBarBox); const Rectangle aTitleBox (GetTitleArea(aTitleBarBox)); PaintTitle(aTitleBox); - if (HasFocus()) - PaintFocus(aTitleBox); + PaintFocus(aTitleBox); } @@ -156,6 +160,15 @@ void TitleBar::HandleToolBoxItemClick (c +cssu::Reference<css::accessibility::XAccessible> TitleBar::CreateAccessible (void) +{ + SetAccessibleRole(css::accessibility::AccessibleRole::PANEL); + return AccessibleTitleBar::Create(*this); +} + + + + void TitleBar::PaintTitle (const Rectangle& rTitleBox) { Push(PUSH_FONT | PUSH_TEXTCOLOR); @@ -193,7 +206,7 @@ void TitleBar::PaintTitle (const Rectang void TitleBar::PaintFocus (const Rectangle& rFocusBox) { - Push(PUSH_FONT | PUSH_TEXTCOLOR | PUSH_LINECOLOR | PUSH_FILLCOLOR); + Push(PUSH_FONT | PUSH_TEXTCOLOR); Font aFont(GetFont()); aFont.SetWeight(WEIGHT_BOLD); @@ -210,15 +223,10 @@ void TitleBar::PaintFocus (const Rectang aTextBox.Right() + 2, aTextBox.Bottom() + 2); - LineInfo aDottedStyle (LINE_DASH); - aDottedStyle.SetDashCount(0); - aDottedStyle.SetDotCount(1); - aDottedStyle.SetDotLen(1); - aDottedStyle.SetDistance(1); - - SetFillColor(); - SetLineColor(COL_BLACK); - DrawPolyLine(Polygon(aLargerTextBox), aDottedStyle); + if (HasFocus()) + Window::ShowFocus(aLargerTextBox); + else + Window::HideFocus(); Pop(); } Modified: openoffice/trunk/main/sfx2/source/sidebar/TitleBar.hxx URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sfx2/source/sidebar/TitleBar.hxx?rev=1488132&r1=1488131&r2=1488132&view=diff ============================================================================== --- openoffice/trunk/main/sfx2/source/sidebar/TitleBar.hxx (original) +++ openoffice/trunk/main/sfx2/source/sidebar/TitleBar.hxx Fri May 31 09:03:08 2013 @@ -24,7 +24,7 @@ #include "Paint.hxx" -#include <vcl/window.hxx> +#include <vcl/fixed.hxx> #include "sfx2/sidebar/SidebarToolBox.hxx" @@ -57,6 +57,7 @@ public: protected: SidebarToolBox maToolBox; + ::rtl::OUString msTitle; virtual Rectangle GetTitleArea (const Rectangle& rTitleBarBox) = 0; virtual void PaintDecoration (const Rectangle& rTitleBarBox) = 0; @@ -64,9 +65,9 @@ protected: virtual sidebar::Paint GetBackgroundPaint (void) = 0; virtual Color GetTextColor (void) = 0; virtual void HandleToolBoxItemClick (const sal_uInt16 nItemIndex); + virtual cssu::Reference<css::accessibility::XAccessible> CreateAccessible (void); private: - ::rtl::OUString msTitle; Image maIcon; void PaintTitle (const Rectangle& rTitleBox);