Index: vcl/inc/menu.hxx =================================================================== RCS file: /cvs/gsl/vcl/inc/menu.hxx,v retrieving revision 1.32 diff -u -r1.32 menu.hxx --- vcl/inc/menu.hxx 30 Aug 2004 16:34:28 -0000 1.32 +++ vcl/inc/menu.hxx 18 Oct 2004 20:16:06 -0000 @@ -148,6 +148,9 @@ // overrides default hiding of disabled entries in popup menus #define MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES 0x0004 +// forces images & toggle visibility for toolbar config popup +#define MENU_FLAG_SHOWCHECKIMAGES 0x0008 + // -------- // - Menu - // -------- Index: sfx2/source/toolbox/tbxchild.cxx =================================================================== RCS file: /cvs/framework/sfx2/source/toolbox/tbxchild.cxx,v retrieving revision 1.38 diff -u -r1.38 tbxchild.cxx --- sfx2/source/toolbox/tbxchild.cxx 8 Sep 2004 15:45:40 -0000 1.38 +++ sfx2/source/toolbox/tbxchild.cxx 18 Oct 2004 20:19:06 -0000 @@ -939,6 +939,9 @@ SfxUInt16Item aConfigItem ( SID_CONFIGITEMID, pMgr->GetType() ); SfxUInt16Item *pItem = &aConfigItem; + pItemMenu->SetMenuFlags (pItemMenu->GetMenuFlags () | + MENU_FLAG_SHOWCHECKIMAGES); + Point aPoint( rCEvt.GetMousePosPixel() ); USHORT nId = aPop.Execute( aPoint, this, (const SfxPoolItem*)pItem, 0L ); Index: vcl/source/window/menu.cxx =================================================================== RCS file: /cvs/gsl/vcl/source/window/menu.cxx,v retrieving revision 1.110 diff -u -r1.110 menu.cxx --- vcl/source/window/menu.cxx 9 Sep 2004 16:21:48 -0000 1.110 +++ vcl/source/window/menu.cxx 18 Oct 2004 20:26:13 -0000 @@ -1976,8 +1976,7 @@ Size aSz; Size aMaxImgSz; - long nMaxTextWidth = 0; - long nMaxAccWidth = 0; + long nMaxWidth = 0; long nMinMenuItemHeight = nFontHeight; const StyleSettings& rSettings = pWin->GetSettings().GetStyleSettings(); @@ -2008,6 +2007,7 @@ if ( ImplIsVisible( n ) ) { + long nWidth = 0; // Separator if ( !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) ) @@ -2032,8 +2032,6 @@ if ( (pData->eType == MENUITEM_STRING) || (pData->eType == MENUITEM_STRINGIMAGE) ) { long nTextWidth = pWin->GetCtrlTextWidth( pData->aText ); - if ( nTextWidth > nMaxTextWidth ) - nMaxTextWidth = nTextWidth; long nTextHeight = pWin->GetTextHeight(); // if ( nTextHeight > pData->aSz.Height() ) @@ -2049,6 +2047,7 @@ } else pData->aSz.Height() = Max( Max( nTextHeight, pData->aSz.Height() ), nMinMenuItemHeight ); + nWidth += nTextWidth; } // Accel @@ -2057,15 +2056,14 @@ String aName = pData->aAccelKey.GetName(); long nAccWidth = pWin->GetTextWidth( aName ); nAccWidth += nExtra; - if ( nAccWidth > nMaxAccWidth ) - nMaxAccWidth = nAccWidth; + nWidth += nAccWidth; } // SubMenu? if ( !bIsMenuBar && pData->pSubMenu ) { - if ( nFontHeight > nMaxAccWidth ) - nMaxAccWidth = nFontHeight; + if ( nFontHeight > nWidth ) + nWidth += nFontHeight; pData->aSz.Height() = Max( Max( nFontHeight, pData->aSz.Height() ), nMinMenuItemHeight ); } @@ -2074,20 +2072,26 @@ if ( !bIsMenuBar ) aSz.Height() += (long)pData->aSz.Height(); + + if ( nWidth > nMaxWidth ) + nMaxWidth = nWidth; } } if ( !bIsMenuBar ) { + int nCheckWidth = 0; + if ((nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES) || aMaxImgSz.Width() <= 0) + nCheckWidth = nFontHeight/2 + nExtra; USHORT gfxExtra = (USHORT) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text - nCheckPos = (USHORT)nExtra; - nImagePos = (USHORT)(nCheckPos + nFontHeight/2 + gfxExtra ); - nTextPos = (USHORT)(nImagePos+aMaxImgSz.Width()); + nCheckPos = nExtra; + nImagePos = nCheckPos + nCheckWidth; + nTextPos = nImagePos + aMaxImgSz.Width(); if ( aMaxImgSz.Width() ) nTextPos += gfxExtra; - aSz.Width() = nTextPos + nMaxTextWidth + nExtra + nMaxAccWidth; - aSz.Width() += 10*nExtra; // etwas mehr... + aSz.Width() = nTextPos + nMaxWidth + nExtra; + aSz.Width() += 4*nExtra; // a _little_ more ... } else { @@ -2166,10 +2170,15 @@ // Image: if ( !bLayout && !bIsMenuBar && ( ( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ) ) ) { + // Don't render an image for a check thing + if ((nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES) || + (!(pData->nBits & (MIB_RADIOCHECK | MIB_CHECKABLE | MIB_AUTOCHECK)) && !pData->bChecked)) + { aTmpPos.Y() = aPos.Y(); aTmpPos.X() = aPos.X() + nImagePos; aTmpPos.Y() += (pData->aSz.Height()-pData->aImage.GetSizePixel().Height())/2; pWin->DrawImage( aTmpPos, pData->aImage, nImageStyle ); + } } // Text: @@ -4207,6 +4216,7 @@ ImplDrawScroller( TRUE ); ImplDrawScroller( FALSE ); } + SetFillColor (GetSettings ().GetStyleSettings ().GetMenuColor ()); pMenu->ImplPaint( this, nScrollerHeight, ImplGetStartY() ); if ( nHighlightedItem != ITEMPOS_INVALID ) HighlightItem( nHighlightedItem, TRUE ); @@ -4823,7 +4833,7 @@ ImplGetFrame()->DrawMenuBar(); return; } - + SetFillColor (GetSettings ().GetStyleSettings ().GetMenuColor ()); pMenu->ImplPaint( this, 0 ); if ( nHighlightedItem != ITEMPOS_INVALID ) HighlightItem( nHighlightedItem, TRUE );