summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2013-06-01 23:09:26 +0200
committerJan Holesovsky <kendy@suse.cz>2013-06-02 04:54:54 +0200
commit74221eb249f8c4aaf15c2e1f23651f3fde954767 (patch)
tree5a26848722823972b5c04c7f92e3b6faa4171705
parent5414cab2219c46be6bd8e51feaf92a6fec41f318 (diff)
sidebar: Allow creation of SidebarToolBoxes via .ui.
Change-Id: If8789fd423a609a18514e5a798df5b5992dac34f
-rw-r--r--include/sfx2/sidebar/SidebarToolBox.hxx6
-rw-r--r--include/vcl/toolbox.hxx2
-rw-r--r--sfx2/source/sidebar/SidebarToolBox.cxx16
3 files changed, 20 insertions, 4 deletions
diff --git a/include/sfx2/sidebar/SidebarToolBox.hxx b/include/sfx2/sidebar/SidebarToolBox.hxx
index b22bbc8e13fe..c5bbc144349b 100644
--- a/include/sfx2/sidebar/SidebarToolBox.hxx
+++ b/include/sfx2/sidebar/SidebarToolBox.hxx
@@ -52,6 +52,12 @@ public:
Window* pParentWindow);
virtual ~SidebarToolBox (void);
+ using ToolBox::InsertItem;
+ virtual void InsertItem(const OUString& rCommand,
+ const com::sun::star::uno::Reference<com::sun::star::frame::XFrame>& rFrame,
+ ToolBoxItemBits nBits = 0,
+ sal_uInt16 nPos = TOOLBOX_APPEND);
+
void SetBorderWindow (const Window* pBorderWindow);
virtual void Paint (const Rectangle& rRect);
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 501eeedb6ac1..702f81920329 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -340,7 +340,7 @@ public:
void InsertItem( const ResId& rResId,
sal_uInt16 nPos = TOOLBOX_APPEND );
/// Insert a command (like '.uno:Save').
- void InsertItem( const OUString& rCommand,
+ virtual void InsertItem( const OUString& rCommand,
const com::sun::star::uno::Reference<com::sun::star::frame::XFrame>& rFrame,
ToolBoxItemBits nBits = 0,
sal_uInt16 nPos = TOOLBOX_APPEND );
diff --git a/sfx2/source/sidebar/SidebarToolBox.cxx b/sfx2/source/sidebar/SidebarToolBox.cxx
index 291b82f1db08..5039a1a675b0 100644
--- a/sfx2/source/sidebar/SidebarToolBox.cxx
+++ b/sfx2/source/sidebar/SidebarToolBox.cxx
@@ -87,14 +87,17 @@ SidebarToolBox::SidebarToolBox (Window* pParentWindow)
{
SetBackground(Wallpaper());
SetPaintTransparent(true);
+ SetToolboxButtonSize( TOOLBOX_BUTTONSIZE_SMALL );
#ifdef DEBUG
SetText(A2S("SidebarToolBox"));
#endif
}
-
-
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSidebarToolBox(Window *pParent)
+{
+ return new SidebarToolBox(pParent);
+}
SidebarToolBox::~SidebarToolBox (void)
{
@@ -120,8 +123,15 @@ SidebarToolBox::~SidebarToolBox (void)
}
}
+void SidebarToolBox::InsertItem(const OUString& rCommand,
+ const com::sun::star::uno::Reference<com::sun::star::frame::XFrame>& rFrame,
+ ToolBoxItemBits nBits, sal_uInt16 nPos)
+{
+ ToolBox::InsertItem(rCommand, rFrame, nBits, nPos);
-
+ CreateController(GetItemId(rCommand), rFrame, 0);
+ RegisterHandlers();
+}
void SidebarToolBox::SetBorderWindow (const Window* pBorderWindow)
{