summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]vcl/inc/vcl/salnativewidgets.hxx19
-rwxr-xr-x[-rw-r--r--]vcl/source/gdi/outdevnative.cxx63
-rwxr-xr-x[-rw-r--r--]vcl/source/window/menu.cxx60
-rwxr-xr-x[-rw-r--r--]vcl/win/inc/saldata.hxx7
-rwxr-xr-x[-rw-r--r--]vcl/win/source/app/salinst.cxx3
-rwxr-xr-xvcl/win/source/gdi/salnativewidgets-luna.cxx143
-rwxr-xr-xvcl/win/source/window/salframe.cxx40
7 files changed, 254 insertions, 81 deletions
diff --git a/vcl/inc/vcl/salnativewidgets.hxx b/vcl/inc/vcl/salnativewidgets.hxx
index 19c34cbc5e34..621cf0e90c5a 100644..100755
--- a/vcl/inc/vcl/salnativewidgets.hxx
+++ b/vcl/inc/vcl/salnativewidgets.hxx
@@ -175,6 +175,7 @@ typedef sal_uInt32 ControlPart;
#define PART_MENU_ITEM 250
#define PART_MENU_ITEM_CHECK_MARK 251
#define PART_MENU_ITEM_RADIO_MARK 252
+#define PART_MENU_SEPARATOR 253
/* #i77549#
HACK: for scrollbars in case of thumb rect, page up and page down rect we
@@ -432,6 +433,24 @@ public:
int maTopDockingAreaHeight;
};
+/* MenupopupValue:
+ *
+ * Value container for menu items; specifies the rectangle for the whole item which
+ * may be useful when drawing parts with a smaller rectangle.
+ */
+class MenupopupValue : public ImplControlValue
+{
+public:
+ MenupopupValue() : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, 0 )
+ {}
+ MenupopupValue( long i_nGutterWidth, const Rectangle& i_rItemRect )
+ : ImplControlValue( CTRL_MENU_POPUP, BUTTONVALUE_DONTKNOW, i_nGutterWidth )
+ , maItemRect( i_rItemRect )
+ {}
+ virtual ~MenupopupValue();
+ Rectangle maItemRect;
+};
+
/* PushButtonValue:
*
* Value container for pushbuttons specifying additional drawing hints
diff --git a/vcl/source/gdi/outdevnative.cxx b/vcl/source/gdi/outdevnative.cxx
index 521f4d7ea62d..b5b745b708fa 100644..100755
--- a/vcl/source/gdi/outdevnative.cxx
+++ b/vcl/source/gdi/outdevnative.cxx
@@ -87,6 +87,10 @@ MenubarValue::~MenubarValue()
{
}
+MenupopupValue::~MenupopupValue()
+{
+}
+
PushButtonValue::~PushButtonValue()
{
}
@@ -200,49 +204,20 @@ static boost::shared_ptr< ImplControlValue > lcl_transformControlValue( const Im
case CTRL_GENERIC:
aResult.reset( new ImplControlValue( rVal ) );
break;
- default:
- OSL_ENSURE( 0, "unknown ImplControlValue type !" );
- break;
- }
- return aResult;
-}
-
-#if 0
-static void lcl_moveControlValue( ControlType nType, const ImplControlValue& aValue, const Point& rDelta )
-{
- switch( aValue.getType() )
- {
- case CTRL_SLIDER:
- {
- SliderValue* pSlVal = static_cast<SliderValue*>(const_cast<ImplControlValue*>(&aValue));
- pSlVal->maThumbRect.Move( rDelta.X(), rDelta.Y() );
- }
- break;
- case CTRL_SCROLLBAR:
- {
- ScrollbarValue* pScVal = static_cast<ScrollbarValue*>(const_cast<ImplControlValue*>(&aValue));
- pScVal->maThumbRect.Move( rDelta.X(), rDelta.Y() );
- pScVal->maButton1Rect.Move( rDelta.X(), rDelta.Y() );
- pScVal->maButton2Rect.Move( rDelta.X(), rDelta.Y() );
- }
- break;
- case CTRL_SPINBOX:
- case CTRL_SPINBUTTONS:
+ case CTRL_MENU_POPUP:
{
- SpinbuttonValue* pSpVal = static_cast<SpinbuttonValue*>(const_cast<ImplControlValue*>(&aValue));
- pSpVal->maUpperRect.Move( rDelta.X(), rDelta.Y() );
- pSpVal->maLowerRect.Move( rDelta.X(), rDelta.Y() );
+ const MenupopupValue* pMVal = static_cast<const MenupopupValue*>(&rVal);
+ MenupopupValue* pNew = new MenupopupValue( *pMVal );
+ pNew->maItemRect = rDev.ImplLogicToDevicePixel( pMVal->maItemRect );
+ aResult.reset( pNew );
}
break;
- case CTRL_TOOLBAR:
- {
- ToolbarValue* pTVal = static_cast<ToolbarValue*>(const_cast<ImplControlValue*>(&aValue));
- pTVal->maGripRect.Move( rDelta.X(), rDelta.Y() );
- }
+ default:
+ OSL_ENSURE( 0, "unknown ImplControlValue type !" );
break;
}
+ return aResult;
}
-#endif
BOOL OutputDevice::DrawNativeControl( ControlType nType,
ControlPart nPart,
@@ -254,20 +229,6 @@ BOOL OutputDevice::DrawNativeControl( ControlType nType,
if( !lcl_enableNativeWidget( *this ) )
return FALSE;
- /*
- if( !IsInPaint() && IsPaintTransparent() )
- {
- // only required if called directly (ie, we're not in Paint() ):
- // force redraw (Paint()) for transparent controls
- // to trigger a repaint of the background
- Region aClipRgn( GetClipRegion() );
- if( !rControlRegion.IsEmpty() )
- aClipRgn.Intersect( rControlRegion );
- Invalidate( aClipRgn, INVALIDATE_UPDATE );
- return TRUE;
- }
- */
-
// make sure the current clip region is initialized correctly
if ( !mpGraphics )
if ( !ImplGetGraphics() )
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 52ad54957dd0..5909ab9f8489 100644..100755
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -96,6 +96,7 @@ DBG_NAME( Menu )
#define EXTRASPACEY 2
#define EXTRAITEMHEIGHT 4
+#define GUTTERBORDER 8
// document closer
#define IID_DOCUMENTCLOSE 1
@@ -2670,14 +2671,36 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
// Separator
if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) )
{
- aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
- aTmpPos.X() = aPos.X() + 2 + nOuterSpace;
- pWin->SetLineColor( rSettings.GetShadowColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
- aTmpPos.Y()++;
- pWin->SetLineColor( rSettings.GetLightColor() );
- pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
- pWin->SetLineColor();
+ bool bNativeOk = false;
+ if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP,
+ PART_MENU_SEPARATOR ) )
+ {
+ ControlState nState = 0;
+ if ( pData->bEnabled )
+ nState |= CTRL_STATE_ENABLED;
+ if ( bHighlighted )
+ nState |= CTRL_STATE_SELECTED;
+ Size aSz( pData->aSz );
+ aSz.Width() = aOutSz.Width() - 2*nOuterSpace;
+ Rectangle aItemRect( aPos, aSz );
+ MenupopupValue aVal( nTextPos-GUTTERBORDER, aItemRect );
+ bNativeOk = pWin->DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_SEPARATOR,
+ aItemRect,
+ nState,
+ aVal,
+ OUString() );
+ }
+ if( ! bNativeOk )
+ {
+ aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2);
+ aTmpPos.X() = aPos.X() + 2 + nOuterSpace;
+ pWin->SetLineColor( rSettings.GetShadowColor() );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
+ aTmpPos.Y()++;
+ pWin->SetLineColor( rSettings.GetLightColor() );
+ pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) );
+ pWin->SetLineColor();
+ }
}
Rectangle aOuterCheckRect( Point( aPos.X()+nCheckPos, aPos.Y() ), Size( pData->aSz.Height(), pData->aSz.Height() ) );
@@ -2722,10 +2745,11 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2;
Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) );
+ MenupopupValue aVal( nTextPos-GUTTERBORDER, Rectangle( aPos, pData->aSz ) );
pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart,
aCheckRect,
nState,
- ImplControlValue(),
+ aVal,
OUString() );
}
else if ( pData->bChecked ) // by default do nothing for unchecked items
@@ -2845,16 +2869,6 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData*
aDecoView.DrawSymbol(
Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ),
SYMBOL_SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle );
-// if ( pData->nBits & MIB_POPUPSELECT )
-// {
-// aTmpPos.Y() += nFontHeight/2 ;
-// pWin->SetLineColor( rSettings.GetShadowColor() );
-// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) );
-// pWin->SetLineColor( rSettings.GetLightColor() );
-// aTmpPos.Y()++;
-// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) );
-// pWin->SetLineColor();
-// }
}
if ( pThisItemOnly && bHighlighted )
@@ -4724,10 +4738,11 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
Push( PUSH_CLIPREGION );
IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) ) );
Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) );
+ MenupopupValue aVal( pMenu->nTextPos-GUTTERBORDER, aItemRect );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
aCtrlRect,
CTRL_STATE_ENABLED,
- ImplControlValue(),
+ aVal,
OUString() );
if( bHighlight &&
IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) )
@@ -4736,7 +4751,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight )
if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM,
aItemRect,
CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ),
- ImplControlValue(),
+ aVal,
OUString() ) )
{
bDrawItemRect = bHighlight;
@@ -5071,10 +5086,11 @@ void MenuFloatingWindow::Paint( const Rectangle& )
long nX = pMenu->pLogo ? pMenu->pLogo->aBitmap.GetSizePixel().Width() : 0;
Size aPxSize( GetOutputSizePixel() );
aPxSize.Width() -= nX;
+ ImplControlValue aVal( pMenu->nTextPos-GUTTERBORDER );
DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL,
Rectangle( Point( nX, 0 ), aPxSize ),
CTRL_STATE_ENABLED,
- ImplControlValue(),
+ aVal,
OUString() );
ImplInitClipRegion();
}
diff --git a/vcl/win/inc/saldata.hxx b/vcl/win/inc/saldata.hxx
index a960d117eed0..a29010fa6d4b 100644..100755
--- a/vcl/win/inc/saldata.hxx
+++ b/vcl/win/inc/saldata.hxx
@@ -33,6 +33,8 @@
#include <vcl/salwtype.hxx>
#include <wincomp.hxx>
+#include "osl/module.h"
+
#include <set> // for hMenu validation
#include <map>
@@ -46,6 +48,8 @@ class Font;
struct HDCCache;
struct TempFontItem;
+typedef HRESULT (WINAPI *DwmIsCompositionEnabled_ptr)(WIN_BOOL*);
+
// --------------------
// - Standard-Defines -
// --------------------
@@ -131,12 +135,15 @@ public:
SalIcon* mpFirstIcon; // icon cache, points to first icon, NULL if none
TempFontItem* mpTempFontItem;
BOOL mbThemeChanged; // true if visual theme was changed: throw away theme handles
+ BOOL mbThemeMenuSupport;
// for GdiPlus GdiplusStartup/GdiplusShutdown
ULONG_PTR gdiplusToken;
std::set< HMENU > mhMenuSet; // keeps track of menu handles created by VCL, used by IsKnownMenuHandle()
std::map< UINT,USHORT > maVKMap; // map some dynamic VK_* entries
+ oslModule maDwmLib;
+ DwmIsCompositionEnabled_ptr mpDwmIsCompositionEnabled;
};
inline void SetSalData( SalData* pData ) { ImplGetSVData()->mpSalData = (void*)pData; }
diff --git a/vcl/win/source/app/salinst.cxx b/vcl/win/source/app/salinst.cxx
index d05f64d147ed..c056bf8281ba 100644..100755
--- a/vcl/win/source/app/salinst.cxx
+++ b/vcl/win/source/app/salinst.cxx
@@ -434,9 +434,12 @@ SalData::SalData()
mpFirstIcon = 0; // icon cache, points to first icon, NULL if none
mpTempFontItem = 0;
mbThemeChanged = FALSE; // true if visual theme was changed: throw away theme handles
+ mbThemeMenuSupport = FALSE;
// init with NULL
gdiplusToken = 0;
+ maDwmLib = 0;
+ mpDwmIsCompositionEnabled = 0;
initKeyCodeMap();
diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx
index 8197fb37cd6d..97e3e1b48c79 100755
--- a/vcl/win/source/gdi/salnativewidgets-luna.cxx
+++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx
@@ -188,6 +188,8 @@ void SalData::deInitNWF( void )
iter++;
}
aThemeMap.clear();
+ if( maDwmLib )
+ osl_unloadModule( maDwmLib );
}
static HTHEME getThemeHandle( HWND hWnd, LPCWSTR name )
@@ -286,6 +288,22 @@ BOOL WinSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart nP
case CTRL_MENUBAR:
if( nPart == PART_ENTIRE_CONTROL )
hTheme = getThemeHandle( mhWnd, L"Rebar");
+ else if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_MENU_ITEM )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
+ break;
+ case CTRL_MENU_POPUP:
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_ENTIRE_CONTROL ||
+ nPart == PART_MENU_ITEM ||
+ nPart == PART_MENU_ITEM_CHECK_MARK ||
+ nPart == PART_MENU_ITEM_RADIO_MARK ||
+ nPart == PART_MENU_SEPARATOR )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
break;
case CTRL_PROGRESS:
if( nPart == PART_ENTIRE_CONTROL )
@@ -867,15 +885,23 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
if( nType == CTRL_MENUBAR )
{
- if( nPart != PART_ENTIRE_CONTROL )
- return FALSE;
-
- if( aValue.getType() == CTRL_MENUBAR )
+ if( nPart == PART_ENTIRE_CONTROL )
{
- const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
- rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well
+ if( aValue.getType() == CTRL_MENUBAR )
+ {
+ const MenubarValue *pValue = static_cast<const MenubarValue*>(&aValue);
+ rc.bottom += pValue->maTopDockingAreaHeight; // extend potential gradient to cover docking area as well
+ }
+ return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
+ }
+ else if( nPart == PART_MENU_ITEM )
+ {
+ if( (nState & CTRL_STATE_ENABLED) )
+ iState = (nState & CTRL_STATE_SELECTED) ? MBI_HOT : MBI_NORMAL;
+ else
+ iState = (nState & CTRL_STATE_SELECTED) ? MBI_DISABLEDHOT : MBI_DISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_BARITEM, iState, rc, aCaption );
}
- return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption);
}
if( nType == CTRL_PROGRESS )
@@ -954,6 +980,69 @@ BOOL ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc,
return ImplDrawTheme( hTheme, hDC, iPart, iState, rc, aCaption );
}
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nType == CTRL_MENU_POPUP )
+ {
+ if( nPart == PART_ENTIRE_CONTROL )
+ {
+ RECT aGutterRC = rc;
+ aGutterRC.left += aValue.getNumericVal();
+ aGutterRC.right = aGutterRC.left+3;
+ return
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPBACKGROUND, 0, rc, aCaption ) &&
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPGUTTER, 0, aGutterRC, aCaption )
+ ;
+ }
+ else if( nPart == PART_MENU_ITEM )
+ {
+ if( (nState & CTRL_STATE_ENABLED) )
+ iState = (nState & CTRL_STATE_SELECTED) ? MPI_HOT : MPI_NORMAL;
+ else
+ iState = (nState & CTRL_STATE_SELECTED) ? MPI_DISABLEDHOT : MPI_DISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPITEM, iState, rc, aCaption );
+ }
+ else if( nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK )
+ {
+ if( (nState & CTRL_STATE_PRESSED) )
+ {
+ RECT aBGRect = rc;
+ if( aValue.getType() == CTRL_MENU_POPUP )
+ {
+ const MenupopupValue& rMVal( static_cast<const MenupopupValue&>(aValue) );
+ aBGRect.left = rMVal.maItemRect.Left();
+ aBGRect.top = rMVal.maItemRect.Top();
+ aBGRect.bottom = rMVal.maItemRect.Bottom()+1; // see below in drawNativeControl
+ aBGRect.right = rMVal.getNumericVal();
+
+ // FIXME: magic
+ aBGRect.left += 1; aBGRect.top += 1; aBGRect.bottom +=1;
+ }
+ iState = (nState & CTRL_STATE_ENABLED) ? MCB_NORMAL : MCB_DISABLED;
+ ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECKBACKGROUND, iState, aBGRect, aCaption );
+ if( nPart == PART_MENU_ITEM_CHECK_MARK )
+ iState = (nState & CTRL_STATE_ENABLED) ? MC_CHECKMARKNORMAL : MC_CHECKMARKDISABLED;
+ else
+ iState = (nState & CTRL_STATE_ENABLED) ? MC_BULLETNORMAL : MC_BULLETDISABLED;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPCHECK, iState, rc, aCaption );
+ }
+ else
+ return true; // unchecked: do nothing
+ }
+ else if( nPart == PART_MENU_SEPARATOR )
+ {
+ rc.left += aValue.getNumericVal(); // adjust for gutter position
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
+ MENU_POPUPSEPARATOR, 0, Rectangle( rc.left, rc.top, rc.right, rc.bottom ) ) );
+ // center the separator inside the passed rectangle
+ long nDY = ((rc.bottom - rc.top + 1) - aRect.GetHeight()) / 2;
+ rc.top += nDY;
+ rc.bottom = rc.top+aRect.GetHeight()-1;
+ return ImplDrawTheme( hTheme, hDC, MENU_POPUPSEPARATOR, 0, rc, aCaption );
+ }
+ }
+ }
+
return false;
}
@@ -1027,6 +1116,11 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
case CTRL_MENUBAR:
if( nPart == PART_ENTIRE_CONTROL )
hTheme = getThemeHandle( mhWnd, L"Rebar");
+ else if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_MENU_ITEM )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
break;
case CTRL_PROGRESS:
if( nPart == PART_ENTIRE_CONTROL )
@@ -1040,6 +1134,16 @@ BOOL WinSalGraphics::drawNativeControl( ControlType nType,
if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA )
hTheme = getThemeHandle( mhWnd, L"Trackbar" );
break;
+ case CTRL_MENU_POPUP:
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nPart == PART_ENTIRE_CONTROL || nPart == PART_MENU_ITEM ||
+ nPart == PART_MENU_ITEM_CHECK_MARK || nPart == PART_MENU_ITEM_RADIO_MARK ||
+ nPart == PART_MENU_SEPARATOR
+ )
+ hTheme = getThemeHandle( mhWnd, L"Menu" );
+ }
+ break;
default:
hTheme = NULL;
break;
@@ -1196,7 +1300,7 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
HTHEME hTheme = getThemeHandle( mhWnd, L"Edit");
if( hTheme )
{
- // get borderr size
+ // get border size
Rectangle aBoxRect( rControlRegion );
Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER,
EBWBS_HOT, aBoxRect ) );
@@ -1225,6 +1329,29 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType,
}
}
+ if( GetSalData()->mbThemeMenuSupport )
+ {
+ if( nType == CTRL_MENU_POPUP )
+ {
+ if( nPart == PART_MENU_ITEM_CHECK_MARK ||
+ nPart == PART_MENU_ITEM_RADIO_MARK )
+ {
+ HTHEME hTheme = getThemeHandle( mhWnd, L"Menu");
+ Rectangle aBoxRect( rControlRegion );
+ Rectangle aRect( ImplGetThemeRect( hTheme, hDC,
+ MENU_POPUPCHECK,
+ MC_CHECKMARKNORMAL,
+ aBoxRect ) );
+ if( aBoxRect.GetWidth() && aBoxRect.GetHeight() )
+ {
+ rNativeContentRegion = aRect;
+ rNativeBoundingRegion = rNativeContentRegion;
+ bRet = TRUE;
+ }
+ }
+ }
+ }
+
if( nType == CTRL_SLIDER && ( (nPart == PART_THUMB_HORZ) || (nPart == PART_THUMB_VERT) ) )
{
HTHEME hTheme = getThemeHandle( mhWnd, L"Trackbar");
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index d6b05c5bb032..df077cc4c4e5 100755
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -2835,6 +2835,29 @@ static long ImplA2I( const BYTE* pStr )
}
// -----------------------------------------------------------------------
+static HRESULT WINAPI backwardCompatibleDwmIsCompositionEnabled( WIN_BOOL* pOut )
+{
+ *pOut = FALSE;
+ return S_OK;
+}
+
+static WIN_BOOL ImplDwmIsCompositionEnabled()
+{
+ SalData* pSalData = GetSalData();
+ if( ! pSalData->mpDwmIsCompositionEnabled )
+ {
+ rtl::OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "Dwmapi.dll" ) );
+ pSalData->maDwmLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+ if( pSalData->maDwmLib )
+ pSalData->mpDwmIsCompositionEnabled = (DwmIsCompositionEnabled_ptr)osl_getAsciiFunctionSymbol( pSalData->maDwmLib, "DwmIsCompositionEnabled" );
+ if( ! pSalData->mpDwmIsCompositionEnabled ) // something failed
+ pSalData->mpDwmIsCompositionEnabled = backwardCompatibleDwmIsCompositionEnabled;
+ }
+ WIN_BOOL aResult = FALSE;
+ HRESULT nError = pSalData->mpDwmIsCompositionEnabled( &aResult );
+ return nError == S_OK && aResult;
+}
+
void WinSalFrame::UpdateSettings( AllSettings& rSettings )
{
@@ -2912,6 +2935,10 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetHighlightTextColor( ImplWinColorToSal( GetSysColor( COLOR_HIGHLIGHTTEXT ) ) );
aStyleSettings.SetMenuHighlightColor( aStyleSettings.GetHighlightColor() );
aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetHighlightTextColor() );
+ ImplSVData* pSVData = ImplGetSVData();
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 0;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = Color( COL_TRANSPARENT );
+ GetSalData()->mbThemeMenuSupport = FALSE;
if ( bCompBorder )
{
aStyleSettings.SetMenuColor( ImplWinColorToSal( GetSysColor( COLOR_MENU ) ) );
@@ -2942,6 +2969,19 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings )
aStyleSettings.SetUseFlatBorders( TRUE );
}
}
+ // check if vista or newer runs
+ // in Aero theme (and similar ?) the menu text color does not change
+ // for selected items; also on WinXP and earlier menus are not themed
+ if( aSalShlData.maVersionInfo.dwMajorVersion >= 6 &&
+ ImplDwmIsCompositionEnabled()
+ )
+ {
+ // in aero menuitem highlight text is drawn in the same color as normal
+ aStyleSettings.SetMenuHighlightTextColor( aStyleSettings.GetMenuTextColor() );
+ pSVData->maNWFData.mnMenuFormatExtraBorder = 2;
+ pSVData->maNWFData.maMenuBarHighlightTextColor = aStyleSettings.GetMenuTextColor();
+ GetSalData()->mbThemeMenuSupport = TRUE;
+ }
}
// Bei hellgrau geben wir die Farbe vor, damit es besser aussieht
if ( aStyleSettings.GetFaceColor() == COL_LIGHTGRAY )