diff options
author | Jan Holesovsky <kendy@suse.cz> | 2013-04-10 10:37:48 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-04-10 10:39:54 +0200 |
commit | 5d67919a5810cf05d6fe53dc14f2b1f073c56719 (patch) | |
tree | 3fbb79de1d0a547e5d720df47903e52e264e1b84 /vcl | |
parent | 99d851b3e2b9f41a6616813cbf7a681aa842615e (diff) |
Kill the ToolBar class, move the needed bits directly to ToolBox.
Change-Id: I6aaa396931ce613be64026b53372dc24c6189724
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/toolbox.hxx | 9 | ||||
-rw-r--r-- | vcl/source/window/toolbox.cxx | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx index 6106bb1bf0ba..3b1f69e36477 100644 --- a/vcl/inc/vcl/toolbox.hxx +++ b/vcl/inc/vcl/toolbox.hxx @@ -207,6 +207,9 @@ private: Link maDeactivateHdl; Link maHighlightHdl; Link maSelectHdl; + Link maCommandHandler; + Link maStateChangedHandler; + Link maDataChangedHandler; public: using Window::ImplInit; @@ -509,6 +512,12 @@ public: const Link& GetHighlightHdl() const { return maHighlightHdl; } void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; } const Link& GetSelectHdl() const { return maSelectHdl; } + void SetCommandHdl( const Link& aLink ) { maCommandHandler = aLink; } + const Link& GetCommandHdl() const { return maCommandHandler; } + void SetStateChangedHdl( const Link& aLink ) { maStateChangedHandler = aLink; } + const Link& GetStateChangedHdl() const { return maStateChangedHandler; } + void SetDataChangedHdl( const Link& aLink ) { maDataChangedHandler = aLink; } + const Link& GetDataChangedHdl() { return maDataChangedHandler; } // support for custom menu (eg for configuration) // note: this menu will also be used to display currently diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 809c8cd375ad..73b4d2132b24 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -4414,6 +4414,9 @@ long ToolBox::Notify( NotifyEvent& rNEvt ) void ToolBox::Command( const CommandEvent& rCEvt ) { + if ( maCommandHandler.IsSet() ) + maCommandHandler.Call( (void *)( &rCEvt )); + // depict StartDrag on MouseButton/Left/Alt if ( (rCEvt.GetCommand() == COMMAND_STARTDRAG) && rCEvt.IsMouseEvent() && mbCustomize && !mbDragging && !mbDrag && !mbSelection && @@ -4506,6 +4509,9 @@ void ToolBox::StateChanged( StateChangedType nType ) ImplInitSettings( sal_False, sal_False, sal_True ); // font, foreground, background Invalidate(); } + + if ( maStateChangedHandler.IsSet() ) + maStateChangedHandler.Call( &nType ); } // ----------------------------------------------------------------------- @@ -4525,6 +4531,9 @@ void ToolBox::DataChanged( const DataChangedEvent& rDCEvt ) ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } + + if ( maDataChangedHandler.IsSet() ) + maDataChangedHandler.Call( (void*)&rDCEvt ); } // ----------------------------------------------------------------------- |