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>
This commit is contained in:
Szymon Kłos 2016-07-20 16:08:38 +02:00 committed by Samuel Mehrbrodt
parent b5c05876f7
commit b949604b91
16 changed files with 290 additions and 13 deletions

View File

@ -807,8 +807,8 @@
<glade-widget-class title="Show Text" name="cuilo-SvxShowText" <glade-widget-class title="Show Text" name="cuilo-SvxShowText"
generic-name="ShowText" parent="GtkDrawingArea" generic-name="ShowText" parent="GtkDrawingArea"
icon-name="widget-gtk-drawingarea"/> icon-name="widget-gtk-drawingarea"/>
<glade-widget-class title="Notebookbar with context" name="vcllo-ContextTabControl" <glade-widget-class title="Notebook switching tabs depending on context" name="vcllo-NotebookbarTabControl"
generic-name="ContextTabControl" parent="GtkNotebook" generic-name="NotebookbarTabControl" parent="GtkNotebook"
icon-name="widget-gtk-notebook"/> icon-name="widget-gtk-notebook"/>
<glade-widget-class title="Slide Transition Pane" name="sdlo-SlideTransitionBox" <glade-widget-class title="Slide Transition Pane" name="sdlo-SlideTransitionBox"
generic-name="ShowText" parent="GtkToolButton" generic-name="ShowText" parent="GtkToolButton"

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B

View File

@ -11,6 +11,8 @@
#define INCLUDED_SFX2_NOTEBOOKBAR_SFXNOTEBOOKBAR_HXX #define INCLUDED_SFX2_NOTEBOOKBAR_SFXNOTEBOOKBAR_HXX
#include <sfx2/dllapi.h> #include <sfx2/dllapi.h>
#include <com/sun/star/frame/XLayoutManager.hpp>
#include <vcl/notebookbar.hxx>
class SfxBindings; class SfxBindings;
@ -22,6 +24,7 @@ class SFX2_DLLPUBLIC SfxNotebookBar
{ {
public: public:
static void CloseMethod(SfxBindings& rBindings); static void CloseMethod(SfxBindings& rBindings);
static void CloseMethod(SystemWindow* pSysWindow);
/// Function to be called from the sdi's ExecMethod. /// Function to be called from the sdi's ExecMethod.
static void ExecMethod(SfxBindings& rBindings); static void ExecMethod(SfxBindings& rBindings);
@ -33,6 +36,15 @@ public:
const OUString& rUIFile); const OUString& rUIFile);
static void RemoveListeners(SystemWindow* pSysWindow); 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 } // namespace sfx2

View File

@ -17,7 +17,7 @@
#include <com/sun/star/ui/XContextChangeEventListener.hpp> #include <com/sun/star/ui/XContextChangeEventListener.hpp>
/// This implements Widget Layout-based notebook-like menu bar. /// 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; friend class NotebookBarContextChangeEventListener;
public: public:
@ -28,6 +28,8 @@ public:
virtual Size GetOptimalSize() const SAL_OVERRIDE; virtual Size GetOptimalSize() const SAL_OVERRIDE;
virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) 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; virtual void StateChanged(StateChangedType nType) override;
const css::uno::Reference<css::ui::XContextChangeEventListener>& getContextChangeEventListener() const { return m_pEventListener; } const css::uno::Reference<css::ui::XContextChangeEventListener>& getContextChangeEventListener() const { return m_pEventListener; }

View File

@ -132,10 +132,10 @@ public:
sal_uInt16 GetPageId( const TabPage& rPage ) const; sal_uInt16 GetPageId( const TabPage& rPage ) const;
sal_uInt16 GetPageId( const OString& rName ) const; sal_uInt16 GetPageId( const OString& rName ) const;
void SetCurPageId( sal_uInt16 nPageId ); virtual void SetCurPageId( sal_uInt16 nPageId );
sal_uInt16 GetCurPageId() const; sal_uInt16 GetCurPageId() const;
void SelectTabPage( sal_uInt16 nPageId ); virtual void SelectTabPage( sal_uInt16 nPageId );
void SetTabPage( sal_uInt16 nPageId, TabPage* pPage ); void SetTabPage( sal_uInt16 nPageId, TabPage* pPage );
TabPage* GetTabPage( sal_uInt16 nPageId ) const; TabPage* GetTabPage( sal_uInt16 nPageId ) const;
@ -194,14 +194,19 @@ public:
virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
}; };
class NotebookBar;
class VCL_DLLPUBLIC NotebookbarTabControl : public TabControl class VCL_DLLPUBLIC NotebookbarTabControl : public TabControl
{ {
public: public:
NotebookbarTabControl( vcl::Window* pParent, WinBits nStyle = WB_STDTABCONTROL ); NotebookbarTabControl( vcl::Window* pParent, WinBits nStyle = WB_STDTABCONTROL );
void SetContext( vcl::EnumContext::Context eContext ); void SetContext( vcl::EnumContext::Context eContext );
void SetIconClickHdl( Link<NotebookBar*, void> aHdl );
virtual sal_uInt16 GetPageId( const Point& rPos ) const override; virtual sal_uInt16 GetPageId( const Point& rPos ) const override;
virtual void SelectTabPage( sal_uInt16 nPageId ) override;
virtual void SetCurPageId( sal_uInt16 nPageId ) override;
protected: protected:
virtual bool ImplPlaceTabs( long nWidth ) override; virtual bool ImplPlaceTabs( long nWidth ) override;
@ -209,6 +214,7 @@ protected:
private: private:
vcl::EnumContext::Context eLastContext; vcl::EnumContext::Context eLastContext;
Link<NotebookBar*,void> m_aIconClickHdl;
}; };
#endif // INCLUDED_VCL_TABCTRL_HXX #endif // INCLUDED_VCL_TABCTRL_HXX

View File

@ -235,6 +235,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/explorer/nochaos \ sfx2/source/explorer/nochaos \
sfx2/source/inet/inettbc \ sfx2/source/inet/inettbc \
sfx2/source/notebookbar/DropdownBox \ sfx2/source/notebookbar/DropdownBox \
sfx2/source/notebookbar/NotebookBarPopupMenu \
sfx2/source/notebookbar/PriorityHBox \ sfx2/source/notebookbar/PriorityHBox \
sfx2/source/notebookbar/SfxNotebookBar \ sfx2/source/notebookbar/SfxNotebookBar \
sfx2/source/notify/eventsupplier \ sfx2/source/notify/eventsupplier \

View File

@ -603,9 +603,7 @@ void SAL_CALL BackingComp::dispose()
VclPtr< WorkWindow > pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow).get()); VclPtr< WorkWindow > pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow).get());
// hide NotebookBar // hide NotebookBar
SystemWindow* pSysWindow = static_cast<SystemWindow*>(pParent); sfx2::SfxNotebookBar::CloseMethod(static_cast<SystemWindow*>(pParent));
if (pSysWindow && pSysWindow->GetNotebookBar())
pSysWindow->GetNotebookBar()->Hide();
} }
// stop listening at the window // stop listening at the window

View File

@ -121,4 +121,53 @@ String STR_FONT_TABPAGE
Text [ en-US ] = "Font" ; 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -47,6 +47,8 @@
#define SFX_IMG_PROPERTY_REMOVE (RID_SFX_SFXLOCAL_START + 0) #define SFX_IMG_PROPERTY_REMOVE (RID_SFX_SFXLOCAL_START + 0)
#define SFX_IMG_CLOSE_DOC (RID_SFX_SFXLOCAL_START + 2) #define SFX_IMG_CLOSE_DOC (RID_SFX_SFXLOCAL_START + 2)
#define RID_MENU_NOTEBOOKBAR (RID_SFX_SFXLOCAL_START + 10)
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -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: */

View File

@ -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: */

View File

@ -13,20 +13,40 @@
#include <unotools/viewoptions.hxx> #include <unotools/viewoptions.hxx>
#include <vcl/notebookbar.hxx> #include <vcl/notebookbar.hxx>
#include <vcl/syswin.hxx> #include <vcl/syswin.hxx>
#include <vcl/menu.hxx>
#include <sfx2/viewfrm.hxx> #include <sfx2/viewfrm.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp> #include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp>
#include <com/sun/star/ui/XContextChangeEventMultiplexer.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 sfx2;
using namespace css::uno; using namespace css::uno;
using namespace css::ui; 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) void SfxNotebookBar::CloseMethod(SfxBindings& rBindings)
{ {
SfxFrame& rFrame = rBindings.GetDispatcher_Impl()->GetFrame()->GetFrame(); SfxFrame& rFrame = rBindings.GetDispatcher_Impl()->GetFrame()->GetFrame();
if (rFrame.GetSystemWindow()->GetNotebookBar()) if (rFrame.GetSystemWindow()->GetNotebookBar())
rFrame.GetSystemWindow()->CloseNotebookBar(); 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) void SfxNotebookBar::ExecMethod(SfxBindings& rBindings)
@ -51,6 +71,19 @@ void SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
{ {
assert(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"); SvtViewOptions aViewOpt(E_WINDOW, "notebookbar");
if (aViewOpt.IsVisible()) if (aViewOpt.IsVisible())
@ -61,6 +94,7 @@ void SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
pSysWindow->SetNotebookBar(rUIFile, xFrame); pSysWindow->SetNotebookBar(rUIFile, xFrame);
pSysWindow->GetNotebookBar()->Show(); pSysWindow->GetNotebookBar()->Show();
pSysWindow->GetNotebookBar()->SetIconClickHdl(LINK(nullptr, SfxNotebookBar, ToggleMenubar));
SfxViewFrame* pView = SfxViewFrame::Current(); 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -43,6 +43,7 @@
#define SV_RESID_BITMAP_CLOSEDOC 1052 #define SV_RESID_BITMAP_CLOSEDOC 1052
#define SV_RESID_BITMAP_INDEX 1053 #define SV_RESID_BITMAP_INDEX 1053
#define SV_RESID_BITMAP_REFRESH 1054 #define SV_RESID_BITMAP_REFRESH 1054
#define SV_RESID_BITMAP_NOTEBOOKBAR 1055
#define SV_DISCLOSURE_PLUS 1060 #define SV_DISCLOSURE_PLUS 1060
#define SV_DISCLOSURE_MINUS 1061 #define SV_DISCLOSURE_MINUS 1061

View File

@ -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)); 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) void NotebookBar::StateChanged(StateChangedType nType)
{ {
if (nType == StateChangedType::Visible) if (nType == StateChangedType::Visible)
@ -104,7 +109,8 @@ void NotebookBar::StateChanged(StateChangedType nType)
void SAL_CALL NotebookBarContextChangeEventListener::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent) void SAL_CALL NotebookBarContextChangeEventListener::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent)
throw (css::uno::RuntimeException, std::exception) 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));
} }

View File

@ -33,6 +33,7 @@
#include <vcl/settings.hxx> #include <vcl/settings.hxx>
#include <vcl/uitest/uiobject.hxx> #include <vcl/uitest/uiobject.hxx>
#include <vcl/builderfactory.hxx> #include <vcl/builderfactory.hxx>
#include <svids.hrc>
#include "controldata.hxx" #include "controldata.hxx"
#include "svdata.hxx" #include "svdata.hxx"
@ -2206,6 +2207,15 @@ NotebookbarTabControl::NotebookbarTabControl(vcl::Window* pParent, WinBits nStyl
: TabControl(pParent, nStyle) : TabControl(pParent, nStyle)
, eLastContext( vcl::EnumContext::Context::Context_Any ) , 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 ) 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)); TabPage* pPage = static_cast<TabPage*>(GetChild(nChild));
if (pPage->HasContext(eContext) || pPage->HasContext(vcl::EnumContext::Context::Context_Any)) if (pPage->HasContext(eContext) || pPage->HasContext(vcl::EnumContext::Context::Context_Any))
EnablePage(nChild + 1); EnablePage(nChild + 2);
else else
EnablePage(nChild + 1, false); EnablePage(nChild + 2, false);
if (pPage->HasContext(eContext) && eContext != vcl::EnumContext::Context::Context_Any) if (pPage->HasContext(eContext) && eContext != vcl::EnumContext::Context::Context_Any)
SetCurPageId(nChild + 1); SetCurPageId(nChild + 2);
} }
eLastContext = eContext; eLastContext = eContext;
} }
} }
void NotebookbarTabControl::SetIconClickHdl( Link<NotebookBar*, void> aHdl )
{
m_aIconClickHdl = aHdl;
}
sal_uInt16 NotebookbarTabControl::GetPageId( const Point& rPos ) const sal_uInt16 NotebookbarTabControl::GetPageId( const Point& rPos ) const
{ {
for( size_t i = 0; i < mpTabCtrlData->maItemList.size(); ++i ) for( size_t i = 0; i < mpTabCtrlData->maItemList.size(); ++i )
{ {
if ( const_cast<NotebookbarTabControl*>(this)->ImplGetTabRect( static_cast<sal_uInt16>(i) ).IsInside( rPos ) ) 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 mpTabCtrlData->maItemList[ i ].mnId;
} }
return 0; 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 ) bool NotebookbarTabControl::ImplPlaceTabs( long nWidth )
{ {
if ( nWidth <= 0 ) if ( nWidth <= 0 )

View File

@ -284,4 +284,9 @@ Bitmap SV_DISCLOSURE_MINUS
File = "minus.png"; File = "minus.png";
}; };
Bitmap SV_RESID_BITMAP_NOTEBOOKBAR
{
File = "notebookbar.png";
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */