Kaydet (Commit) 74221eb2 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

sidebar: Allow creation of SidebarToolBoxes via .ui.

Change-Id: If8789fd423a609a18514e5a798df5b5992dac34f
üst 5414cab2
...@@ -52,6 +52,12 @@ public: ...@@ -52,6 +52,12 @@ public:
Window* pParentWindow); Window* pParentWindow);
virtual ~SidebarToolBox (void); 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); void SetBorderWindow (const Window* pBorderWindow);
virtual void Paint (const Rectangle& rRect); virtual void Paint (const Rectangle& rRect);
......
...@@ -340,7 +340,7 @@ public: ...@@ -340,7 +340,7 @@ public:
void InsertItem( const ResId& rResId, void InsertItem( const ResId& rResId,
sal_uInt16 nPos = TOOLBOX_APPEND ); sal_uInt16 nPos = TOOLBOX_APPEND );
/// Insert a command (like '.uno:Save'). /// 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, const com::sun::star::uno::Reference<com::sun::star::frame::XFrame>& rFrame,
ToolBoxItemBits nBits = 0, ToolBoxItemBits nBits = 0,
sal_uInt16 nPos = TOOLBOX_APPEND ); sal_uInt16 nPos = TOOLBOX_APPEND );
......
...@@ -87,14 +87,17 @@ SidebarToolBox::SidebarToolBox (Window* pParentWindow) ...@@ -87,14 +87,17 @@ SidebarToolBox::SidebarToolBox (Window* pParentWindow)
{ {
SetBackground(Wallpaper()); SetBackground(Wallpaper());
SetPaintTransparent(true); SetPaintTransparent(true);
SetToolboxButtonSize( TOOLBOX_BUTTONSIZE_SMALL );
#ifdef DEBUG #ifdef DEBUG
SetText(A2S("SidebarToolBox")); SetText(A2S("SidebarToolBox"));
#endif #endif
} }
extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSidebarToolBox(Window *pParent)
{
return new SidebarToolBox(pParent);
}
SidebarToolBox::~SidebarToolBox (void) SidebarToolBox::~SidebarToolBox (void)
{ {
...@@ -120,8 +123,15 @@ 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) void SidebarToolBox::SetBorderWindow (const Window* pBorderWindow)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment