diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-11-02 11:52:56 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-11-02 11:52:56 +0000 |
commit | ab6db4ca190a7411ad5f6a8b7dee712d033b5f97 (patch) | |
tree | 45ca87f90f423fa36caff0c58b926ac35994e2d6 /vcl/source/window | |
parent | b1331fea1fa3ca1a551d3753fa2544d6d0444276 (diff) |
INTEGRATION: CWS os2port02 (1.155.2); FILE MERGED
2007/10/04 19:45:44 ydario 1.155.2.1: Issue number: i82034
Submitted by: ydario
Reviewed by: ydario
Commit of changes for OS/2 CWS source code integration.
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/menu.cxx | 39 |
1 files changed, 34 insertions, 5 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 6a36c3ca7e66..9b0697740f57 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -4,9 +4,9 @@ * * $RCSfile: menu.cxx,v $ * - * $Revision: 1.155 $ + * $Revision: 1.156 $ * - * last change: $Author: vg $ $Date: 2007-09-20 16:24:48 $ + * last change: $Author: hr $ $Date: 2007-11-02 12:52:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -182,6 +182,35 @@ DBG_NAME( Menu ) // document closer #define IID_DOCUMENTCLOSE 1 +#ifdef OS2 + +#include <xwphook.h> + +// return TRUE if hilite should be executed: left mouse button down +// or xwp mouse hook enabled +static BOOL ImplHilite( const MouseEvent& rMEvt ) +{ + static BOOL init = FALSE; + static HOOKCONFIG hc; + + // read XWP settings at program startup + if (init == FALSE) { + BOOL rc; + ULONG cb = sizeof(HOOKCONFIG); + memset(&hc, 0, sizeof(HOOKCONFIG)); + rc = PrfQueryProfileData( HINI_USER, INIAPP_XWPHOOK, INIKEY_HOOK_CONFIG, + &hc, &cb); + init = TRUE; + } + // check mouse left button + if (rMEvt.GetButtons() == MOUSE_LEFT) + return TRUE; + // return xwp flag + return hc.fSlidingMenus; +} + +#endif + static BOOL ImplAccelDisabled() { // display of accelerator strings may be suppressed via configuration @@ -4273,7 +4302,7 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) if ( rMEvt.IsLeaveWindow() ) { #ifdef OS2 - if ( rMEvt.GetButtons() == MOUSE_LEFT ) + if ( ImplHilite(rMEvt) ) { #endif // #102461# do not remove highlight if a popup menu is open at this position @@ -4293,7 +4322,7 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) } else #ifdef OS2 - if ( rMEvt.GetButtons() == MOUSE_LEFT ) + if ( ImplHilite(rMEvt) ) #endif { aSubmenuCloseTimer.Stop(); @@ -5235,7 +5264,7 @@ void MenuBarWindow::MouseMove( const MouseEvent& rMEvt ) USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); if ( ( nEntry != ITEMPOS_INVALID ) #ifdef OS2 - && ( rMEvt.GetButtons() == MOUSE_LEFT ) + && ( ImplHilite(rMEvt) ) #endif && ( nEntry != nHighlightedItem ) ) ChangeHighlightItem( nEntry, FALSE ); |