diff options
author | Kurt Zenker <kz@openoffice.org> | 2003-11-18 13:57:32 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2003-11-18 13:57:32 +0000 |
commit | b0bb7690895d26bd30fea4d8951d4098259e37c0 (patch) | |
tree | ca92d229cb96189b0cca017b6a6e4f9d3b2e6e03 /vcl | |
parent | 97813120bfec614ef6631b2b7f5dc923207807a9 (diff) |
INTEGRATION: CWS vclsysmenu (1.79.34); FILE MERGED
2003/10/01 15:13:12 ssa 1.79.34.2: RESYNC: (1.79-1.80); FILE MERGED
2003/10/01 14:41:07 ssa 1.79.34.1: #i20547# native menues
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/winproc.cxx | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index 3cd25c5d0434..11bca20b2f61 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: winproc.cxx,v $ * - * $Revision: 1.80 $ + * $Revision: 1.81 $ * - * last change: $Author: hr $ $Date: 2003-06-30 14:30:48 $ + * last change: $Author: kz $ $Date: 2003-11-18 14:57:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -145,6 +145,9 @@ #ifndef _SV_SALGDI_HXX #include <salgdi.hxx> #endif +#ifndef _SV_MENU_HXX +#include <menu.hxx> +#endif #undef private #include <dndlcon.hxx> @@ -2016,6 +2019,46 @@ long ImplHandleSalMouseActivate( Window* pWindow, SalMouseActivateEvent* pEvent // ----------------------------------------------------------------------- +static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, USHORT nEvent ) +{ + // Find SystemWindow and its Menubar and let it dispatch the command + long nRet = 0; + Window *pWin = pWindow->mpFirstChild; + while ( pWin ) + { + if ( pWin->mbSysWin ) + break; + pWin = pWin->mpNext; + } + if( pWin ) + { + MenuBar *pMenuBar = ((SystemWindow*) pWin)->GetMenuBar(); + if( pMenuBar ) + { + switch( nEvent ) + { + case SALEVENT_MENUACTIVATE: + nRet = pMenuBar->HandleMenuActivateEvent( (Menu*) pEvent->mpMenu ) ? 1 : 0; + break; + case SALEVENT_MENUDEACTIVATE: + nRet = pMenuBar->HandleMenuDeActivateEvent( (Menu*) pEvent->mpMenu ) ? 1 : 0; + break; + case SALEVENT_MENUHIGHLIGHT: + nRet = pMenuBar->HandleMenuHighlightEvent( (Menu*) pEvent->mpMenu, pEvent->mnId ) ? 1 : 0; + break; + case SALEVENT_MENUCOMMAND: + nRet = pMenuBar->HandleMenuCommandEvent( (Menu*) pEvent->mpMenu, pEvent->mnId ) ? 1 : 0; + break; + default: + break; + } + } + } + return nRet; +} + +// ----------------------------------------------------------------------- + static void ImplHandleSalKeyMod( Window* pWindow, SalKeyModEvent* pEvent ) { ImplSVData* pSVData = ImplGetSVData(); @@ -2173,6 +2216,13 @@ long ImplWindowFrameProc( void* pInst, SalFrame* pFrame, ImplHandleSalKeyMod( (Window*)pInst, (SalKeyModEvent*)pEvent ); break; + case SALEVENT_MENUACTIVATE: + case SALEVENT_MENUDEACTIVATE: + case SALEVENT_MENUHIGHLIGHT: + case SALEVENT_MENUCOMMAND: + nRet = ImplHandleMenuEvent( (Window*)pInst, (SalMenuEvent*)pEvent, nEvent ); + break; + case SALEVENT_WHEELMOUSE: { ImplSVData* pSVData = ImplGetSVData(); |