summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-01 17:52:57 +0200
committerFrank Schoenheit [fs] <frank.schoenheit@sun.com>2010-04-01 17:52:57 +0200
commit9dac5ad99ce21f25f4199c71c86471999fd02ceb (patch)
treeb59671e9762a1b8d9b2e5764c00f915b13377d12 /svtools
parent5e1eeb99fdf3a5c303af4750df20ab4a0488daca (diff)
slidecopy: the A11Y API for the PanelTabBar now also includes the scroll buttons
Diffstat (limited to 'svtools')
-rw-r--r--svtools/inc/svtools/toolpanel/paneltabbar.hxx13
-rwxr-xr-xsvtools/source/toolpanel/makefile.mk4
-rwxr-xr-xsvtools/source/toolpanel/paneltabbar.cxx16
-rw-r--r--svtools/source/toolpanel/toolpanel.src39
-rwxr-xr-xsvtools/source/toolpanel/toolpaneldeck.cxx10
-rw-r--r--svtools/util/makefile.mk1
6 files changed, 74 insertions, 9 deletions
diff --git a/svtools/inc/svtools/toolpanel/paneltabbar.hxx b/svtools/inc/svtools/toolpanel/paneltabbar.hxx
index 3eb9e7a5624d..668935d8a739 100644
--- a/svtools/inc/svtools/toolpanel/paneltabbar.hxx
+++ b/svtools/inc/svtools/toolpanel/paneltabbar.hxx
@@ -36,6 +36,8 @@
#include <memory>
#include <boost/optional.hpp>
+class PushButton;
+
//........................................................................
namespace svt
{
@@ -62,17 +64,18 @@ namespace svt
TabItemContent GetTabItemContent() const;
void SetTabItemContent( const TabItemContent& i_eItemContent );
- bool IsVertical() const;
-
- IToolPanelDeck& GetPanelDeck() const;
-
- // operations
::boost::optional< size_t > GetFocusedPanelItem() const;
void FocusPanelItem( const size_t i_nItemPos );
Rectangle GetItemScreenRect( const size_t i_nItemPos ) const;
+ bool IsVertical() const;
+ IToolPanelDeck& GetPanelDeck() const;
+ PushButton& GetScrollButton( const bool i_bForward );
// Window overridables
virtual Size GetOptimalSize( WindowSizeType i_eType ) const;
+
+ protected:
+ // Window overridables
virtual void Paint( const Rectangle& i_rRect );
virtual void Resize();
virtual void MouseMove( const MouseEvent& i_rMouseEvent );
diff --git a/svtools/source/toolpanel/makefile.mk b/svtools/source/toolpanel/makefile.mk
index 408d8eeb87b2..9d293b56d231 100755
--- a/svtools/source/toolpanel/makefile.mk
+++ b/svtools/source/toolpanel/makefile.mk
@@ -43,6 +43,10 @@ ENABLE_EXCEPTIONS=TRUE
# --- Files --------------------------------------------------------
+SRS1NAME=$(TARGET)
+SRC1FILES=\
+ toolpanel.src
+
SLOFILES=\
$(SLO)$/dummypanel.obj \
$(SLO)$/paneldecklisteners.obj \
diff --git a/svtools/source/toolpanel/paneltabbar.cxx b/svtools/source/toolpanel/paneltabbar.cxx
index 9fe193d9ac4f..95e6caa311e4 100755
--- a/svtools/source/toolpanel/paneltabbar.cxx
+++ b/svtools/source/toolpanel/paneltabbar.cxx
@@ -27,8 +27,9 @@
#include "precompiled_svtools.hxx"
#include "svtools/toolpanel/paneltabbar.hxx"
-
#include "svtools/toolpanel/toolpaneldeck.hxx"
+#include "svtools/svtdata.hxx"
+
#include "tabitemdescriptor.hxx"
#include "paneltabbarpeer.hxx"
#include "tabbargeometry.hxx"
@@ -37,6 +38,7 @@
#include <vcl/help.hxx>
#include <vcl/virdev.hxx>
#include <tools/diagnose_ex.h>
+#include <svl/svtools.hrc>
#include <boost/optional.hpp>
#include <vector>
@@ -526,10 +528,14 @@ namespace svt
m_aScrollBack.SetSymbol( IsVertical() ? SYMBOL_ARROW_UP : SYMBOL_ARROW_LEFT );
m_aScrollBack.Show();
m_aScrollBack.SetClickHdl( LINK( this, PanelTabBar_Impl, OnScroll ) );
+ m_aScrollBack.SetAccessibleDescription( String( SvtResId( STR_SVT_ACC_BEGIN + 0 ) ) );
+ m_aScrollBack.SetAccessibleName( m_aScrollBack.GetAccessibleDescription() );
m_aScrollForward.SetSymbol( IsVertical() ? SYMBOL_ARROW_DOWN : SYMBOL_ARROW_RIGHT );
m_aScrollForward.Show();
m_aScrollForward.SetClickHdl( LINK( this, PanelTabBar_Impl, OnScroll ) );
+ m_aScrollForward.SetAccessibleDescription( String( SvtResId( STR_SVT_ACC_BEGIN + 1 ) ) );
+ m_aScrollForward.SetAccessibleName( m_aScrollForward.GetAccessibleDescription() );
}
//------------------------------------------------------------------------------------------------------------------
@@ -1301,6 +1307,12 @@ namespace svt
}
//------------------------------------------------------------------------------------------------------------------
+ PushButton& PanelTabBar::GetScrollButton( const bool i_bForward )
+ {
+ return i_bForward ? m_pImpl->m_aScrollForward : m_pImpl->m_aScrollBack;
+ }
+
+ //------------------------------------------------------------------------------------------------------------------
::boost::optional< size_t > PanelTabBar::GetFocusedPanelItem() const
{
return m_pImpl->m_aFocusedItem;
@@ -1315,7 +1327,7 @@ namespace svt
GrabFocus();
m_pImpl->FocusItem( i_nItemPos );
- OSL_POSTCOND( !!m_pImpl->m_aFocusedItem, "PanelTabBar::FocusPanelItem: have the focus, but not focused item?" );
+ OSL_POSTCOND( !!m_pImpl->m_aFocusedItem, "PanelTabBar::FocusPanelItem: have the focus, but no focused item?" );
if ( !!m_pImpl->m_aFocusedItem )
m_pImpl->InvalidateItem( *m_pImpl->m_aFocusedItem );
m_pImpl->m_aFocusedItem.reset( i_nItemPos );
diff --git a/svtools/source/toolpanel/toolpanel.src b/svtools/source/toolpanel/toolpanel.src
new file mode 100644
index 000000000000..4861fbfd14ac
--- /dev/null
+++ b/svtools/source/toolpanel/toolpanel.src
@@ -0,0 +1,39 @@
+/*************************************************************************
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include <svl/svtools.hrc>
+
+// the following string ID is a hack, until MBA's promised patch appears, which splits svl/svtools.hrc
+// into two files, one for svl, one or svtools
+String STR_SVT_ACC_BEGIN + 0
+{
+ Text [ en-US ] = "Tab Panel Scroll Button, backward";
+};
+
+String STR_SVT_ACC_BEGIN + 1
+{
+ Text [ en-US ] = "Tab Panel Scroll Button, forward";
+};
diff --git a/svtools/source/toolpanel/toolpaneldeck.cxx b/svtools/source/toolpanel/toolpaneldeck.cxx
index c8d441ecdaf7..4b28699f1134 100755
--- a/svtools/source/toolpanel/toolpaneldeck.cxx
+++ b/svtools/source/toolpanel/toolpaneldeck.cxx
@@ -91,8 +91,6 @@ namespace svt
~ToolPanelDeck_Impl()
{
- m_aPanels.RemoveListener( *this );
- m_aListeners.Dying();
}
PDeckLayouter GetLayouter() const { return m_pLayouter; }
@@ -100,6 +98,13 @@ namespace svt
Window& GetPanelWindowAnchor() { return m_aPanelAnchor; }
+ /// notifies our listeners that we're going to die. Only to be called from with our anti-impl's destructor
+ void NotifyDying()
+ {
+ m_aPanels.RemoveListener( *this );
+ m_aListeners.Dying();
+ }
+
// IToolPanelDeck equivalents
size_t GetPanelCount() const;
PToolPanel GetPanel( const size_t i_nPos ) const;
@@ -359,6 +364,7 @@ namespace svt
//--------------------------------------------------------------------
ToolPanelDeck::~ToolPanelDeck()
{
+ m_pImpl->NotifyDying();
GetLayouter()->Destroy();
Hide();
diff --git a/svtools/util/makefile.mk b/svtools/util/makefile.mk
index e632db6d4f33..00ad1776e886 100644
--- a/svtools/util/makefile.mk
+++ b/svtools/util/makefile.mk
@@ -89,6 +89,7 @@ RESLIB1SRSFILES= \
$(SRS)$/plugapp.srs \
$(SRS)$/svcontnr.srs \
$(SRS)$/browse.srs \
+ $(SRS)$/toolpanel.srs \
$(SRS)$/javaerror.srs
RESLIB3NAME= $(RESTARGETPATCH)