diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-11-06 13:06:51 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2009-11-06 13:06:51 +0100 |
commit | 66d894d69932280f11d77eeaf3e366e9d9b43d7e (patch) | |
tree | e6eaace4b329a944ce4e60156a68a03b2cdbd4c4 /forms/source/solar | |
parent | dbec2d8a2455110a3d8ec8c8294aad54b095bf6d (diff) |
#i106671# use proper UNO API to not only retrieve images for our slots, but also the command descriptions, which are to be used as quick help text
Diffstat (limited to 'forms/source/solar')
-rw-r--r-- | forms/source/solar/component/navbarcontrol.cxx | 6 | ||||
-rw-r--r-- | forms/source/solar/component/navbarcontrol.hxx | 3 | ||||
-rw-r--r-- | forms/source/solar/control/navtoolbar.cxx | 13 | ||||
-rw-r--r-- | forms/source/solar/inc/navtoolbar.hxx | 12 |
4 files changed, 28 insertions, 6 deletions
diff --git a/forms/source/solar/component/navbarcontrol.cxx b/forms/source/solar/component/navbarcontrol.cxx index 96fff6363..e4d93d8c6 100644 --- a/forms/source/solar/component/navbarcontrol.cxx +++ b/forms/source/solar/component/navbarcontrol.cxx @@ -37,6 +37,8 @@ #include "FormComponent.hxx" #include "componenttools.hxx" #include "navtoolbar.hxx" +#include "commandimageprovider.hxx" +#include "commanddescriptionprovider.hxx" /** === begin UNO includes === **/ #include <com/sun/star/awt/XView.hpp> @@ -283,10 +285,12 @@ namespace frm pPeer->acquire(); // by definition, the returned object is aquired once // the VCL control for the peer + Reference< XModel > xContextDocument( getXModel( _rxModel ) ); NavigationToolBar* pNavBar = new NavigationToolBar( _pParentWindow, lcl_getWinBits_nothrow( _rxModel ), - createDocumentCommandImageProvider( _rxORB, getXModel( _rxModel ) ) + createDocumentCommandImageProvider( _rxORB, xContextDocument ), + createDocumentCommandDescriptionProvider( _rxORB, xContextDocument ) ); // some knittings diff --git a/forms/source/solar/component/navbarcontrol.hxx b/forms/source/solar/component/navbarcontrol.hxx index 7a74078dd..cda9b2571 100644 --- a/forms/source/solar/component/navbarcontrol.hxx +++ b/forms/source/solar/component/navbarcontrol.hxx @@ -32,10 +32,11 @@ #define FORMS_NAVBARCONTROL_HXX #include "formnavigation.hxx" -#include "commandimageprovider.hxx" +/** === begin UNO includes === **/ #include <com/sun/star/frame/XDispatchProviderInterception.hpp> #include <com/sun/star/frame/XStatusListener.hpp> +/** === end UNO includes === **/ #include <toolkit/controls/unocontrol.hxx> #include <toolkit/awt/vclxwindow.hxx> diff --git a/forms/source/solar/control/navtoolbar.cxx b/forms/source/solar/control/navtoolbar.cxx index d220f473f..e79e0272a 100644 --- a/forms/source/solar/control/navtoolbar.cxx +++ b/forms/source/solar/control/navtoolbar.cxx @@ -36,6 +36,7 @@ #include "featuredispatcher.hxx" #include "frm_resource.hrc" #include "commandimageprovider.hxx" +#include "commanddescriptionprovider.hxx" #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/form/runtime/FormFeature.hpp> @@ -157,10 +158,12 @@ namespace frm //===================================================================== DBG_NAME( NavigationToolBar ) //--------------------------------------------------------------------- - NavigationToolBar::NavigationToolBar( Window* _pParent, WinBits _nStyle, const ::boost::shared_ptr< const ICommandImageProvider >& _pImageProvider ) + NavigationToolBar::NavigationToolBar( Window* _pParent, WinBits _nStyle, const PCommandImageProvider& _pImageProvider, + const PCommandDescriptionProvider& _pDescriptionProvider ) :Window( _pParent, _nStyle ) ,m_pDispatcher( NULL ) ,m_pImageProvider( _pImageProvider ) + ,m_pDescriptionProvider( _pDescriptionProvider ) ,m_eImageSize( eSmall ) ,m_pToolbar( NULL ) { @@ -310,8 +313,14 @@ namespace frm // insert the entry m_pToolbar->InsertItem( pSupportedFeatures->nId, String(), pSupportedFeatures->bRepeat ? TIB_REPEAT : 0 ); m_pToolbar->SetQuickHelpText( pSupportedFeatures->nId, String() ); // TODO + if ( !isArtificialItem( pSupportedFeatures->nId ) ) - m_pToolbar->SetItemCommand( pSupportedFeatures->nId, lcl_getCommandURL( pSupportedFeatures->nId ) ); + { + ::rtl::OUString sCommandURL( lcl_getCommandURL( pSupportedFeatures->nId ) ); + m_pToolbar->SetItemCommand( pSupportedFeatures->nId, sCommandURL ); + if ( m_pDescriptionProvider ) + m_pToolbar->SetQuickHelpText( pSupportedFeatures->nId, m_pDescriptionProvider->getCommandDescription( sCommandURL ) ); + } if ( pSupportedFeatures->bItemWindow ) { diff --git a/forms/source/solar/inc/navtoolbar.hxx b/forms/source/solar/inc/navtoolbar.hxx index 894f4838e..6e1caea56 100644 --- a/forms/source/solar/inc/navtoolbar.hxx +++ b/forms/source/solar/inc/navtoolbar.hxx @@ -43,6 +43,7 @@ namespace frm class IFeatureDispatcher; class ICommandImageProvider; + class ICommandDescriptionProvider; class ImplNavToolBar; @@ -68,14 +69,21 @@ namespace frm private: const IFeatureDispatcher* m_pDispatcher; - ::boost::shared_ptr< const ICommandImageProvider > + const ::boost::shared_ptr< const ICommandImageProvider > m_pImageProvider; + const ::boost::shared_ptr< const ICommandDescriptionProvider > + m_pDescriptionProvider; ImageSize m_eImageSize; ImplNavToolBar* m_pToolbar; ::std::vector< Window* > m_aChildWins; public: - NavigationToolBar( Window* _pParent, WinBits _nStyle, const ::boost::shared_ptr< const ICommandImageProvider >& _pImageProvider ); + NavigationToolBar( + Window* _pParent, + WinBits _nStyle, + const ::boost::shared_ptr< const ICommandImageProvider >& _pImageProvider, + const ::boost::shared_ptr< const ICommandDescriptionProvider >& _pDescriptionProvider + ); ~NavigationToolBar( ); /** sets the dispatcher which is to be used for the features |