diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2016-07-20 16:08:38 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-07-22 08:59:59 +0000 |
commit | b949604b91f77dee3b2737ea09e1ac3ade4eed1c (patch) | |
tree | 84b3f65668c933f8fc5e5ce3541df5aa0919c7ef | |
parent | b5c05876f73c31270bc374e4f481ef1d09a42e5f (diff) |
GSoC notebookbar: file menu
+ added icon to the notebookbar, after click the file menu will appear
Change-Id: I30e1ed7e2c4a194e150c7196652904fd4e5c9e8e
Reviewed-on: https://gerrit.libreoffice.org/27347
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | extras/source/glade/libreoffice-catalog.xml.in | 4 | ||||
-rw-r--r-- | icon-themes/galaxy/res/notebookbar.png | bin | 0 -> 264 bytes | |||
-rw-r--r-- | include/sfx2/notebookbar/SfxNotebookBar.hxx | 12 | ||||
-rw-r--r-- | include/vcl/notebookbar.hxx | 4 | ||||
-rw-r--r-- | include/vcl/tabctrl.hxx | 10 | ||||
-rw-r--r-- | sfx2/Library_sfx.mk | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/backingcomp.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/dialog.src | 49 | ||||
-rw-r--r-- | sfx2/source/inc/sfxlocal.hrc | 2 | ||||
-rw-r--r-- | sfx2/source/notebookbar/NotebookBarPopupMenu.cxx | 82 | ||||
-rw-r--r-- | sfx2/source/notebookbar/NotebookBarPopupMenu.hxx | 23 | ||||
-rw-r--r-- | sfx2/source/notebookbar/SfxNotebookBar.cxx | 61 | ||||
-rw-r--r-- | vcl/inc/svids.hrc | 1 | ||||
-rw-r--r-- | vcl/source/control/notebookbar.cxx | 8 | ||||
-rw-r--r-- | vcl/source/control/tabctrl.cxx | 37 | ||||
-rw-r--r-- | vcl/source/src/images.src | 5 |
16 files changed, 290 insertions, 13 deletions
diff --git a/extras/source/glade/libreoffice-catalog.xml.in b/extras/source/glade/libreoffice-catalog.xml.in index 10b3d02b7313..bf49a28dc66c 100644 --- a/extras/source/glade/libreoffice-catalog.xml.in +++ b/extras/source/glade/libreoffice-catalog.xml.in @@ -807,8 +807,8 @@ <glade-widget-class title="Show Text" name="cuilo-SvxShowText" generic-name="ShowText" parent="GtkDrawingArea" icon-name="widget-gtk-drawingarea"/> - <glade-widget-class title="Notebookbar with context" name="vcllo-ContextTabControl" - generic-name="ContextTabControl" parent="GtkNotebook" + <glade-widget-class title="Notebook switching tabs depending on context" name="vcllo-NotebookbarTabControl" + generic-name="NotebookbarTabControl" parent="GtkNotebook" icon-name="widget-gtk-notebook"/> <glade-widget-class title="Slide Transition Pane" name="sdlo-SlideTransitionBox" generic-name="ShowText" parent="GtkToolButton" diff --git a/icon-themes/galaxy/res/notebookbar.png b/icon-themes/galaxy/res/notebookbar.png Binary files differnew file mode 100644 index 000000000000..94abb952996b --- /dev/null +++ b/icon-themes/galaxy/res/notebookbar.png diff --git a/include/sfx2/notebookbar/SfxNotebookBar.hxx b/include/sfx2/notebookbar/SfxNotebookBar.hxx index d76b35e6a16b..d3387a2e5338 100644 --- a/include/sfx2/notebookbar/SfxNotebookBar.hxx +++ b/include/sfx2/notebookbar/SfxNotebookBar.hxx @@ -11,6 +11,8 @@ #define INCLUDED_SFX2_NOTEBOOKBAR_SFXNOTEBOOKBAR_HXX #include <sfx2/dllapi.h> +#include <com/sun/star/frame/XLayoutManager.hpp> +#include <vcl/notebookbar.hxx> class SfxBindings; @@ -22,6 +24,7 @@ class SFX2_DLLPUBLIC SfxNotebookBar { public: static void CloseMethod(SfxBindings& rBindings); + static void CloseMethod(SystemWindow* pSysWindow); /// Function to be called from the sdi's ExecMethod. static void ExecMethod(SfxBindings& rBindings); @@ -33,6 +36,15 @@ public: const OUString& rUIFile); static void RemoveListeners(SystemWindow* pSysWindow); + + static void ShowMenubar(bool bShow); + +private: + static bool m_bLock; + static css::uno::Reference<css::frame::XLayoutManager> m_xLayoutManager; + static css::uno::Reference<css::frame::XFrame> m_xFrame; + + DECL_STATIC_LINK_TYPED(SfxNotebookBar, ToggleMenubar, NotebookBar*, void); }; } // namespace sfx2 diff --git a/include/vcl/notebookbar.hxx b/include/vcl/notebookbar.hxx index 05c91a89a232..51f32aab6d45 100644 --- a/include/vcl/notebookbar.hxx +++ b/include/vcl/notebookbar.hxx @@ -17,7 +17,7 @@ #include <com/sun/star/ui/XContextChangeEventListener.hpp> /// This implements Widget Layout-based notebook-like menu bar. -class NotebookBar : public Control, public VclBuilderContainer +class VCL_DLLPUBLIC NotebookBar : public Control, public VclBuilderContainer { friend class NotebookBarContextChangeEventListener; public: @@ -28,6 +28,8 @@ public: virtual Size GetOptimalSize() const SAL_OVERRIDE; virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) SAL_OVERRIDE; + void SetIconClickHdl(Link<NotebookBar*, void> aHdl); + virtual void StateChanged(StateChangedType nType) override; const css::uno::Reference<css::ui::XContextChangeEventListener>& getContextChangeEventListener() const { return m_pEventListener; } diff --git a/include/vcl/tabctrl.hxx b/include/vcl/tabctrl.hxx index a708161c8c83..14974e7609b3 100644 --- a/include/vcl/tabctrl.hxx +++ b/include/vcl/tabctrl.hxx @@ -132,10 +132,10 @@ public: sal_uInt16 GetPageId( const TabPage& rPage ) const; sal_uInt16 GetPageId( const OString& rName ) const; - void SetCurPageId( sal_uInt16 nPageId ); + virtual void SetCurPageId( sal_uInt16 nPageId ); sal_uInt16 GetCurPageId() const; - void SelectTabPage( sal_uInt16 nPageId ); + virtual void SelectTabPage( sal_uInt16 nPageId ); void SetTabPage( sal_uInt16 nPageId, TabPage* pPage ); TabPage* GetTabPage( sal_uInt16 nPageId ) const; @@ -194,14 +194,19 @@ public: virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; }; +class NotebookBar; + class VCL_DLLPUBLIC NotebookbarTabControl : public TabControl { public: NotebookbarTabControl( vcl::Window* pParent, WinBits nStyle = WB_STDTABCONTROL ); void SetContext( vcl::EnumContext::Context eContext ); + void SetIconClickHdl( Link<NotebookBar*, void> aHdl ); virtual sal_uInt16 GetPageId( const Point& rPos ) const override; + virtual void SelectTabPage( sal_uInt16 nPageId ) override; + virtual void SetCurPageId( sal_uInt16 nPageId ) override; protected: virtual bool ImplPlaceTabs( long nWidth ) override; @@ -209,6 +214,7 @@ protected: private: vcl::EnumContext::Context eLastContext; + Link<NotebookBar*,void> m_aIconClickHdl; }; #endif // INCLUDED_VCL_TABCTRL_HXX diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk index 1a28afd63dee..5ee2773ebbf4 100644 --- a/sfx2/Library_sfx.mk +++ b/sfx2/Library_sfx.mk @@ -235,6 +235,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\ sfx2/source/explorer/nochaos \ sfx2/source/inet/inettbc \ sfx2/source/notebookbar/DropdownBox \ + sfx2/source/notebookbar/NotebookBarPopupMenu \ sfx2/source/notebookbar/PriorityHBox \ sfx2/source/notebookbar/SfxNotebookBar \ sfx2/source/notify/eventsupplier \ diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index 937501b4efa4..8767519e1b3f 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -603,9 +603,7 @@ void SAL_CALL BackingComp::dispose() VclPtr< WorkWindow > pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow).get()); // hide NotebookBar - SystemWindow* pSysWindow = static_cast<SystemWindow*>(pParent); - if (pSysWindow && pSysWindow->GetNotebookBar()) - pSysWindow->GetNotebookBar()->Hide(); + sfx2::SfxNotebookBar::CloseMethod(static_cast<SystemWindow*>(pParent)); } // stop listening at the window diff --git a/sfx2/source/dialog/dialog.src b/sfx2/source/dialog/dialog.src index a3ed837987c8..c66f4475858a 100644 --- a/sfx2/source/dialog/dialog.src +++ b/sfx2/source/dialog/dialog.src @@ -121,4 +121,53 @@ String STR_FONT_TABPAGE Text [ en-US ] = "Font" ; }; +Menu RID_MENU_NOTEBOOKBAR +{ + ItemList = + { + MenuItem + { + Identifier = SID_OPENDOC; + Command = ".uno:Open"; + Text [ en-US ] = "Open..." ; + }; + MenuItem + { + Identifier = SID_SAVEDOC; + Command = ".uno:Save"; + Text [ en-US ] = "Save" ; + }; + MenuItem + { + Identifier = SID_UNDO; + Command = ".uno:Undo"; + Text [ en-US ] = "Undo" ; + }; + MenuItem + { + Identifier = SID_REDO; + Command = ".uno:Redo"; + Text [ en-US ] = "Redo" ; + }; + MenuItem + { + Identifier = SID_PRINTDOC; + Command = ".uno:Print"; + Text [ en-US ] = "Print" ; + }; + MenuItem + { + Identifier = SID_OPTIONS; + Command = ".uno:OptionsTreeDialog"; + Text [ en-US ] = "Options" ; + }; + MenuItem + { + Identifier = SID_CLOSEDOC; + Command = ".uno:CloseDoc"; + Text [ en-US ] = "Close" ; + }; + }; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/inc/sfxlocal.hrc b/sfx2/source/inc/sfxlocal.hrc index 33eb9410e4ce..65360c9175f3 100644 --- a/sfx2/source/inc/sfxlocal.hrc +++ b/sfx2/source/inc/sfxlocal.hrc @@ -47,6 +47,8 @@ #define SFX_IMG_PROPERTY_REMOVE (RID_SFX_SFXLOCAL_START + 0) #define SFX_IMG_CLOSE_DOC (RID_SFX_SFXLOCAL_START + 2) +#define RID_MENU_NOTEBOOKBAR (RID_SFX_SFXLOCAL_START + 10) + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/notebookbar/NotebookBarPopupMenu.cxx b/sfx2/source/notebookbar/NotebookBarPopupMenu.cxx new file mode 100644 index 000000000000..d0cd103613da --- /dev/null +++ b/sfx2/source/notebookbar/NotebookBarPopupMenu.cxx @@ -0,0 +1,82 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <sfx2/dispatch.hxx> +#include <vcl/notebookbar.hxx> +#include <vcl/menu.hxx> +#include <comphelper/processfactory.hxx> +#include <com/sun/star/util/URLTransformer.hpp> +#include <sfxlocal.hrc> +#include <sfx2/sfxresid.hxx> +#include "NotebookBarPopupMenu.hxx" + +using namespace sfx2; +using namespace css::uno; +using namespace css::ui; + +NotebookBarPopupMenu::NotebookBarPopupMenu(ResId aRes) + : PopupMenu(aRes) +{ + if (SfxViewFrame::Current()) + { + for (int i = 0; i < GetItemCount(); ++i) + { + const SfxPoolItem* pItem; + SfxItemState eState = SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(GetItemId(i), pItem); + if (eState == SfxItemState::DISABLED) + this->EnableItem(GetItemId(i), false); + else + this->EnableItem(GetItemId(i)); + } + } + else + { + HideItem(SID_UNDO); + HideItem(SID_REDO); + HideItem(SID_PRINTDOC); + HideItem(SID_SAVEDOC); + } + EnableItem(SID_OPTIONS); +} + +void NotebookBarPopupMenu::Execute(NotebookBar* pNotebookbar, + css::uno::Reference<css::frame::XFrame>& xFrame) +{ + if (pNotebookbar) + { + sal_uInt16 nSelected = PopupMenu::Execute(pNotebookbar, Point(0, 40)); + + if (nSelected) + { + OUString aCommandURL = GetItemCommand(nSelected); + css::util::URL aUrl; + aUrl.Complete = aCommandURL; + + Reference<css::util::XURLTransformer> xURLTransformer( + css::util::URLTransformer::create(comphelper::getProcessComponentContext())); + if (xURLTransformer.is()) + xURLTransformer->parseStrict(aUrl); + + css::uno::Reference<css::frame::XDispatch> xDispatch; + css::uno::Reference<css::frame::XDispatchProvider> xDispatchProvider(xFrame, UNO_QUERY); + + if (xDispatchProvider.is()) + { + xDispatch = xDispatchProvider->queryDispatch(aUrl, OUString(), 0); + } + if (xDispatch.is()) + { + Sequence<com::sun::star::beans::PropertyValue> aArgs; + xDispatch->dispatch(aUrl, aArgs); + } + } + } +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/notebookbar/NotebookBarPopupMenu.hxx b/sfx2/source/notebookbar/NotebookBarPopupMenu.hxx new file mode 100644 index 000000000000..2fca13512849 --- /dev/null +++ b/sfx2/source/notebookbar/NotebookBarPopupMenu.hxx @@ -0,0 +1,23 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include <vcl/notebookbar.hxx> +#include <vcl/menu.hxx> +#include <sfxlocal.hrc> +#include <sfx2/sfxresid.hxx> + +class NotebookBarPopupMenu : public PopupMenu +{ +public: + NotebookBarPopupMenu(ResId aRes); + void Execute(NotebookBar* pNotebookbar, + css::uno::Reference<css::frame::XFrame>& xFrame); +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index 2ae984d2fb5e..dc20c7528bbb 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -13,20 +13,40 @@ #include <unotools/viewoptions.hxx> #include <vcl/notebookbar.hxx> #include <vcl/syswin.hxx> +#include <vcl/menu.hxx> #include <sfx2/viewfrm.hxx> #include <comphelper/processfactory.hxx> #include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp> #include <com/sun/star/ui/XContextChangeEventMultiplexer.hpp> +#include <com/sun/star/util/URLTransformer.hpp> +#include <com/sun/star/frame/XLayoutManager.hpp> +#include "NotebookBarPopupMenu.hxx" using namespace sfx2; using namespace css::uno; using namespace css::ui; +#define MENUBAR_STR "private:resource/menubar/menubar" + +bool SfxNotebookBar::m_bLock = false; +Reference<css::frame::XLayoutManager> SfxNotebookBar::m_xLayoutManager; +css::uno::Reference<css::frame::XFrame> SfxNotebookBar::m_xFrame; + void SfxNotebookBar::CloseMethod(SfxBindings& rBindings) { SfxFrame& rFrame = rBindings.GetDispatcher_Impl()->GetFrame()->GetFrame(); if (rFrame.GetSystemWindow()->GetNotebookBar()) rFrame.GetSystemWindow()->CloseNotebookBar(); + m_xLayoutManager.clear(); + m_xFrame.clear(); +} + +void SfxNotebookBar::CloseMethod(SystemWindow* pSysWindow) +{ + if (pSysWindow && pSysWindow->GetNotebookBar()) + pSysWindow->CloseNotebookBar(); + m_xLayoutManager.clear(); + m_xFrame.clear(); } void SfxNotebookBar::ExecMethod(SfxBindings& rBindings) @@ -51,6 +71,19 @@ void SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, { assert(pSysWindow); + m_xFrame = xFrame; + + if (!m_xLayoutManager.is()) + { + Reference<css::beans::XPropertySet> xPropSet(xFrame, UNO_QUERY); + + if (xPropSet.is()) + { + Any aValue = xPropSet->getPropertyValue("LayoutManager"); + aValue >>= m_xLayoutManager; + } + } + SvtViewOptions aViewOpt(E_WINDOW, "notebookbar"); if (aViewOpt.IsVisible()) @@ -61,6 +94,7 @@ void SfxNotebookBar::StateMethod(SystemWindow* pSysWindow, pSysWindow->SetNotebookBar(rUIFile, xFrame); pSysWindow->GetNotebookBar()->Show(); + pSysWindow->GetNotebookBar()->SetIconClickHdl(LINK(nullptr, SfxNotebookBar, ToggleMenubar)); SfxViewFrame* pView = SfxViewFrame::Current(); @@ -95,4 +129,31 @@ void SfxNotebookBar::RemoveListeners(SystemWindow* pSysWindow) } } +IMPL_STATIC_LINK_TYPED(SfxNotebookBar, ToggleMenubar, NotebookBar*, pNotebookbar, void) +{ + if (pNotebookbar) + { + VclPtr<NotebookBarPopupMenu> pMenu = VclPtr<NotebookBarPopupMenu>::Create(SfxResId(RID_MENU_NOTEBOOKBAR)); + pMenu->Execute(pNotebookbar, m_xFrame); + pMenu->Clear(); + } +} + +void SfxNotebookBar::ShowMenubar(bool bShow) +{ + if (!m_bLock && m_xLayoutManager.is()) + { + m_bLock = true; + m_xLayoutManager->lock(); + + if (m_xLayoutManager->getElement(MENUBAR_STR).is() && !bShow) + m_xLayoutManager->destroyElement(MENUBAR_STR); + else if(!m_xLayoutManager->getElement(MENUBAR_STR).is() && bShow) + m_xLayoutManager->createElement(MENUBAR_STR); + + m_xLayoutManager->unlock(); + m_bLock = false; + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index 7c81ecc6f43f..efb34907e320 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -43,6 +43,7 @@ #define SV_RESID_BITMAP_CLOSEDOC 1052 #define SV_RESID_BITMAP_INDEX 1053 #define SV_RESID_BITMAP_REFRESH 1054 +#define SV_RESID_BITMAP_NOTEBOOKBAR 1055 #define SV_DISCLOSURE_PLUS 1060 #define SV_DISCLOSURE_MINUS 1061 diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 413cb57c6a79..a47cb038315f 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -90,6 +90,11 @@ void NotebookBar::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, P VclContainer::setLayoutAllocation(*pChild, Point(0, 0), Size(nWidth, nHeight)); } +void NotebookBar::SetIconClickHdl(Link<NotebookBar*, void> aHdl) +{ + m_pTabControl->SetIconClickHdl(aHdl); +} + void NotebookBar::StateChanged(StateChangedType nType) { if (nType == StateChangedType::Visible) @@ -104,7 +109,8 @@ void NotebookBar::StateChanged(StateChangedType nType) void SAL_CALL NotebookBarContextChangeEventListener::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent) throw (css::uno::RuntimeException, std::exception) { - mpParent->m_pTabControl->SetContext(vcl::EnumContext::GetContextEnum(rEvent.ContextName)); + if (mpParent && mpParent->m_pTabControl) + mpParent->m_pTabControl->SetContext(vcl::EnumContext::GetContextEnum(rEvent.ContextName)); } diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index d532a5efddd2..93b3b2037f5d 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -33,6 +33,7 @@ #include <vcl/settings.hxx> #include <vcl/uitest/uiobject.hxx> #include <vcl/builderfactory.hxx> +#include <svids.hrc> #include "controldata.hxx" #include "svdata.hxx" @@ -2206,6 +2207,15 @@ NotebookbarTabControl::NotebookbarTabControl(vcl::Window* pParent, WinBits nStyl : TabControl(pParent, nStyle) , eLastContext( vcl::EnumContext::Context::Context_Any ) { + LanguageTag aLocale( Application::GetSettings().GetUILanguageTag()); + ResMgr* pResMgr = ResMgr::SearchCreateResMgr( "vcl", aLocale ); + + Bitmap aBitmap; + if( pResMgr ) + aBitmap = Bitmap( ResId( SV_RESID_BITMAP_NOTEBOOKBAR, *pResMgr ) ); + + InsertPage(1, ""); + SetPageImage(1, Image(aBitmap)); } void NotebookbarTabControl::SetContext( vcl::EnumContext::Context eContext ) @@ -2217,30 +2227,49 @@ void NotebookbarTabControl::SetContext( vcl::EnumContext::Context eContext ) TabPage* pPage = static_cast<TabPage*>(GetChild(nChild)); if (pPage->HasContext(eContext) || pPage->HasContext(vcl::EnumContext::Context::Context_Any)) - EnablePage(nChild + 1); + EnablePage(nChild + 2); else - EnablePage(nChild + 1, false); + EnablePage(nChild + 2, false); if (pPage->HasContext(eContext) && eContext != vcl::EnumContext::Context::Context_Any) - SetCurPageId(nChild + 1); + SetCurPageId(nChild + 2); } eLastContext = eContext; } } +void NotebookbarTabControl::SetIconClickHdl( Link<NotebookBar*, void> aHdl ) +{ + m_aIconClickHdl = aHdl; +} + sal_uInt16 NotebookbarTabControl::GetPageId( const Point& rPos ) const { for( size_t i = 0; i < mpTabCtrlData->maItemList.size(); ++i ) { if ( const_cast<NotebookbarTabControl*>(this)->ImplGetTabRect( static_cast<sal_uInt16>(i) ).IsInside( rPos ) ) - if ( mpTabCtrlData->maItemList[ i ].mbEnabled ) + if ( mpTabCtrlData->maItemList[ i ].mbEnabled ) return mpTabCtrlData->maItemList[ i ].mnId; } return 0; } +void NotebookbarTabControl::SelectTabPage( sal_uInt16 nPageId ) +{ + if ( nPageId == 1 ) + m_aIconClickHdl.Call( static_cast<NotebookBar*>(GetParent()) ); + else + TabControl::SelectTabPage( nPageId ); +} + +void NotebookbarTabControl::SetCurPageId( sal_uInt16 nPageId ) +{ + if ( nPageId != 1 ) + TabControl::SetCurPageId( nPageId ); +} + bool NotebookbarTabControl::ImplPlaceTabs( long nWidth ) { if ( nWidth <= 0 ) diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src index 88d35c14824f..77cfb392831a 100644 --- a/vcl/source/src/images.src +++ b/vcl/source/src/images.src @@ -284,4 +284,9 @@ Bitmap SV_DISCLOSURE_MINUS File = "minus.png"; }; +Bitmap SV_RESID_BITMAP_NOTEBOOKBAR +{ + File = "notebookbar.png"; +}; + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |