diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-01-28 13:16:55 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-01-28 13:16:55 +0000 |
commit | 5c49ea07e7d0c2bb01693db5c28fba7e1c000cda (patch) | |
tree | fa5c3dc0158a77ac7559757840897be65d831f31 /vcl/source | |
parent | b0fa8dd1db4a60bcb346cc317f3fb07481a3daca (diff) |
INTEGRATION: CWS tbe32 (1.155.56); FILE MERGED
2007/12/03 09:08:57 tbe 1.155.56.3: RESYNC: (1.156-1.157); FILE MERGED
2007/11/30 14:52:12 tbe 1.155.56.2: RESYNC: (1.155-1.156); FILE MERGED
2007/11/23 11:53:17 pl 1.155.56.1: #i34062# emit new events VCLEVENT_MENU_SHOW and VCLEVENT_MENU_HIDE
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/menu.cxx | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index a47fa08ef82f..d29029a903f5 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -4,9 +4,9 @@ * * $RCSfile: menu.cxx,v $ * - * $Revision: 1.158 $ + * $Revision: 1.159 $ * - * last change: $Author: ihi $ $Date: 2008-01-14 16:22:40 $ + * last change: $Author: vg $ $Date: 2008-01-28 14:16:55 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -564,6 +564,7 @@ private: DECL_LINK( HighlightChanged, Timer* ); DECL_LINK( SubmenuClose, Timer* ); DECL_LINK( AutoScroll, Timer* ); + DECL_LINK( ShowHideListener, VclWindowEvent* ); void StateChanged( StateChangedType nType ); void DataChanged( const DataChangedEvent& rDCEvt ); @@ -786,6 +787,7 @@ private: DECL_LINK( FloatHdl, PushButton* ); DECL_LINK( HideHdl, PushButton* ); DECL_LINK( ToolboxEventHdl, VclWindowEvent* ); + DECL_LINK( ShowHideListener, VclWindowEvent* ); void StateChanged( StateChangedType nType ); void DataChanged( const DataChangedEvent& rDCEvt ); @@ -3812,6 +3814,8 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nSt aSubmenuCloseTimer.SetTimeout( GetSettings().GetMouseSettings().GetMenuDelay() ); aSubmenuCloseTimer.SetTimeoutHdl( LINK( this, MenuFloatingWindow, SubmenuClose ) ); aScrollTimer.SetTimeoutHdl( LINK( this, MenuFloatingWindow, AutoScroll ) ); + + AddEventListener( LINK( this, MenuFloatingWindow, ShowHideListener ) ); } void MenuFloatingWindow::doShutdown() @@ -3855,6 +3859,7 @@ void MenuFloatingWindow::doShutdown() GetParent()->Invalidate( aInvRect ); } pMenu = NULL; + RemoveEventListener( LINK( this, MenuFloatingWindow, ShowHideListener ) ); } } @@ -4118,6 +4123,18 @@ IMPL_LINK( MenuFloatingWindow, SubmenuClose, Timer*, EMPTYARG ) return 0; } +IMPL_LINK( MenuFloatingWindow, ShowHideListener, VclWindowEvent*, pEvent ) +{ + if( ! pMenu ) + return 0; + + if( pEvent->GetId() == VCLEVENT_WINDOW_SHOW ) + pMenu->ImplCallEventListeners( VCLEVENT_MENU_SHOW, ITEMPOS_INVALID ); + else if( pEvent->GetId() == VCLEVENT_WINDOW_HIDE ) + pMenu->ImplCallEventListeners( VCLEVENT_MENU_HIDE, ITEMPOS_INVALID ); + return 0; +} + void MenuFloatingWindow::EnableScrollMenu( BOOL b ) { bScrollMenu = b; @@ -5043,11 +5060,14 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) : } ImplInitStyleSettings(); + + AddEventListener( LINK( this, MenuBarWindow, ShowHideListener ) ); } MenuBarWindow::~MenuBarWindow() { aCloser.RemoveEventListener( LINK( this, MenuBarWindow, ToolboxEventHdl ) ); + RemoveEventListener( LINK( this, MenuBarWindow, ShowHideListener ) ); } void MenuBarWindow::SetMenu( MenuBar* pMen ) @@ -5132,6 +5152,18 @@ IMPL_LINK( MenuBarWindow, ToolboxEventHdl, VclWindowEvent*, pEvent ) return 0; } +IMPL_LINK( MenuBarWindow, ShowHideListener, VclWindowEvent*, pEvent ) +{ + if( ! pMenu ) + return 0; + + if( pEvent->GetId() == VCLEVENT_WINDOW_SHOW ) + pMenu->ImplCallEventListeners( VCLEVENT_MENU_SHOW, ITEMPOS_INVALID ); + else if( pEvent->GetId() == VCLEVENT_WINDOW_HIDE ) + pMenu->ImplCallEventListeners( VCLEVENT_MENU_HIDE, ITEMPOS_INVALID ); + return 0; +} + IMPL_LINK( MenuBarWindow, FloatHdl, PushButton*, EMPTYARG ) { return pMenu ? ((MenuBar*)pMenu)->GetFloatButtonClickHdl().Call( pMenu ) : 0; |