I dont like to ask too many questions in relation to the appearance of components, but these days appearance in Applications seems just as important.
Anyway, please see the below images:
Both are using the TActionManager and TActionMainMenuBar to create my main menu. The menu in the left of the image is using the Platform Default Style, the menu on the right is using the XP style defined by my TActionManager.
Notice how when the left menu is highlighted, the glyph remains the same which is perfect.
Now look at the XP style menu on the right, the glyph draws a drop shadow, pops out slightly and you can see the transparency makes the glyph appear slightly odd.
I want to enable the XP style for my UI, but the way the glyphs are painted I do not like. I also want to change my TToolbar to a TActionToolBar and apply the same XP style, but this will render the glyphs the same too.
How can I make the XP style menu defined in the TActionManager, not render the glyphs like this?
Thanks.
EDIT
This is now the result, having applied some of the techniques from the answers below:
Craig.
Here is some sample code that overrides the XP STYLE, creating a derived class that you can tweak as you like. First step here is to substitute your own derived menu item class, and change its DrawGlyph code, as David told you. I figured you could maybe use some sample code.
This is just a quick demo. It doesn't draw a box around checked items with glyphs, so this custom style is not compatible with Checked items, unless they have no glyphs. You would have to figure out how you want to draw the checked-glyph items (Where I wrote the DrawGlyphFrame would be a good place to add something to draw a checked-state rectangle around a glyph if the Action.Checked property is set).
This is done by design in the VCL code. The pertinent code is
TXPStyleMenuItem.DrawGlyph()
in XPActnCtrls.pas.The easiest way to change the behaviour is to register your own version of the XP action bar style based on
TXPStyleActionBars
. There are plenty of hooks that would allow you to overrideTXPStyleMenuItem.DrawGlyph()
.