sfx2/Library_sfx.mk | 2 ++ sfx2/source/sidebar/DeckTitleBar.cxx | 11 +++++++++++ sfx2/source/sidebar/DeckTitleBar.hxx | 1 + sfx2/source/sidebar/PanelTitleBar.cxx | 21 +++++++++++++-------- sfx2/source/sidebar/PanelTitleBar.hxx | 2 ++ sfx2/source/sidebar/TitleBar.cxx | 32 ++++++++++++++++++++------------ sfx2/source/sidebar/TitleBar.hxx | 5 +++-- 7 files changed, 52 insertions(+), 22 deletions(-)
New commits: commit 6055c2b50b36a0fc1b26c18b030827e3e08a51fc Author: Andre Fischer <[email protected]> Date: Fri May 31 09:03:08 2013 +0000 122271: Setting FOCUSABLE flag at accessibility object sidebar title bars so that bridges create focus events and title bars become visible to AT devices. diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 5341571..38625ca 100755 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -218,6 +218,8 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ 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 \ diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx b/sfx2/source/sidebar/DeckTitleBar.cxx index 8e0c450..bd9e86c 100644 --- a/sfx2/source/sidebar/DeckTitleBar.cxx +++ b/sfx2/source/sidebar/DeckTitleBar.cxx @@ -139,6 +139,17 @@ void DeckTitleBar::HandleToolBoxItemClick (const sal_uInt16 nItemIndex) +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( diff --git a/sfx2/source/sidebar/DeckTitleBar.hxx b/sfx2/source/sidebar/DeckTitleBar.hxx index dfc5e9c..f75aad9 100644 --- a/sfx2/source/sidebar/DeckTitleBar.hxx +++ b/sfx2/source/sidebar/DeckTitleBar.hxx @@ -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; diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx index 4917412..a8d1048 100644 --- a/sfx2/source/sidebar/PanelTitleBar.cxx +++ b/sfx2/source/sidebar/PanelTitleBar.cxx @@ -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::HandleToolBoxItemClick (const sal_uInt16 nItemIndex) +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()) diff --git a/sfx2/source/sidebar/PanelTitleBar.hxx b/sfx2/source/sidebar/PanelTitleBar.hxx index 517d759..426f087 100644 --- a/sfx2/source/sidebar/PanelTitleBar.hxx +++ b/sfx2/source/sidebar/PanelTitleBar.hxx @@ -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; }; diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx index d04dd4f..c2e01bf 100644 --- a/sfx2/source/sidebar/TitleBar.cxx +++ b/sfx2/source/sidebar/TitleBar.cxx @@ -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& rUpdateArea) PaintDecoration(aTitleBarBox); const Rectangle aTitleBox (GetTitleArea(aTitleBarBox)); PaintTitle(aTitleBox); - if (HasFocus()) - PaintFocus(aTitleBox); + PaintFocus(aTitleBox); } @@ -156,6 +160,15 @@ void TitleBar::HandleToolBoxItemClick (const sal_uInt16 nItemIndex) +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 Rectangle& rTitleBox) 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 Rectangle& rFocusBox) 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(); } diff --git a/sfx2/source/sidebar/TitleBar.hxx b/sfx2/source/sidebar/TitleBar.hxx index 5167749..6a8c84e 100644 --- a/sfx2/source/sidebar/TitleBar.hxx +++ b/sfx2/source/sidebar/TitleBar.hxx @@ -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); _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
