As you probably know the VCL Styles doesn’t support Popup menus, this means if you apply any VCL Style to your VCL Application the popup menus will remain with the Windows native look and feel (exists some workarounds for this like use a TPopupActionBar as described here, but this only works partially, and doesn’t support the child menus of a TMainMenu). Since Sometime ago the VCL Styles Utils project can help you to overcome this limitation adding support for VCL Styled Popup Menus.
Now we just uploaded a major update to the VCL Styles Utils project. This new version fix all the issues reported via mail and the issue page related the PopUp menus like support for the Break property, Checkboxes, Radio Items, Default items and so on.
Sample images
TMainMenu with VCL Styles
TMainMenu with VCL Styles and VCL Styles Utils
Popup Menu with VCL Styles
Popup Menu with VCL Styles and VCL Styles Utils
Right to left Popup Menu with VCL Styles
Right to left Popup Menu with VCL Styles and VCL Styles Utils
System Menu with VCL Styles
System Menu with VCL Styles and VCL Styles Utils
To add support for VCL Styled Popup Menus in your Application only you must add these units to your project Vcl.Styles.Utils.Menus, Vcl.Styles.Utils.SysStyleHook and Vcl.Styles.Utils.SysControls.
You can download sample application from here and the source of the Application is here.
January 17, 2014 at 12:19 am
Windows 8 64 bit/ Downloaded sample app. Start. Select “Metro Black” style. Click “Color Dialog”. Crash. The other style worked
January 17, 2014 at 5:41 am
Thanks for the feedback. You are right the issue only happens with the Metro Black Style. I just fixed the code. Try the sample demo again.
January 17, 2014 at 4:58 am
Thank you for fixing one of my posted problems. I really appreciate it.
January 17, 2014 at 5:42 am
You are welcome.
January 17, 2014 at 4:58 am
Great work, almost perfect…but I’m asking always the same thing :-) .
As QC is totally ignored by Embarcadero for VCL and IDE bugs (it seems that the only thing that matters is FireMonkey), is it possibile to patch in some simple way the VCL bug that make impossible to reflect the changes to Screen.MenuFont.Size to components like TMainMenu, TPopupMenu etc.?. To understand what I mean just append the next two lines of code in the FormCreate of yours test application and wathc the result:
Screen.MenuFont.Name:=’Impact’;
Screen.MenuFont.Size:=24;
I need this, I’ve some applications with traditional TMainMenu running on monitors 1900×1200 and I need to show the menu a little bit bigger then classic 8 size and with the style that I want but I don’t want to oblige my customers to modify the Windows System Fonts. I want to be free to set TMainMenu font in Times New Roman 48! I tried also TMS components, the TActionMenuBar but everything is soffering the same bug. I opend a ticket in QC for XE3 but till now in XE5 they totally ignored this kind of bug.
Davide
January 17, 2014 at 7:44 am
Davide, sometime ago we discuss about this same topic but using the TPlatformVclStylesStyle hook. Unfortunately regarding to the TMainMenu and TPopupMenu the same applies, this must be fixed in the VCL code as well. sorry for that :(
January 17, 2014 at 1:39 pm
Rodrigo, yes you are right but since you’re so good at solving these problems I have always hope that you somehow manage to hack in VCL to solve this specific problem! :-)
Thanks, Davide
January 17, 2014 at 6:31 am
Really a shame! EMBA ist not able to fix their own Style features. Deliver half-baked features and let the customer alone! I am pissed!
January 17, 2014 at 7:24 am
I agree with you. It is really a shame. It is absolutely not acceptable that this kind of problem should be resolved externally with hacks on the vcl. What are they waiting for? It is not acceptable that bugs are fixed only if they are voted in QC. A bug is a bug and should be fixed always. If I waste my time to open a ticket on QC preparing also demo to reproduce, it is because I need absolutely that fix and I aspect that this could be solved at least in the next release of the product. Why I’ve to pay a SA to get XE3, XE4, X5 which are pratically the same product speaking in terms of IDE and VCL develop environment? If you give me the possibility to do a thing, that thing should work; if not and you don’t want to fix it don’t give me the possibility of doing that thing!
I apologize for the outburst!
January 20, 2014 at 3:07 am
+1
Why has EMB not fixed this long ago?? Why do their customers have to create workarounds. I certainly hope this fix makes it into the next update before XE6.
January 17, 2014 at 4:09 pm
1. Can you please provide an example.dpr with all needed files?
2. A include file is missing. don’t remember the name.
January 17, 2014 at 4:17 pm
Hi Peter, How are you downloading the source of the sample application? are you using a subversion client?
Pingback: VCL Styles Utils and Popup Menus – Major ...
January 18, 2014 at 4:32 am
You get me wrong. okay. What files do I need for a complete skinning (innosetup is not needed)? It is not clear to me.
January 18, 2014 at 10:50 am
Peter, for add support for styled PopupMenus and common dialogs you must add all these units to your project Vcl.Styles.Utils.Menus, Vcl.Styles.Utils.Forms, Vcl.Styles.Utils.StdCtrls, Vcl.Styles.Utils.ComCtrls, Vcl.Styles.Utils.SysStyleHook, Vcl.Styles.Utils.ScreenTips, Vcl.Styles.Utils.SysControls.
January 18, 2014 at 11:40 am
Thanks! What about the remaining: Utils, Colortabs, WebBrowser, ……?
January 18, 2014 at 4:12 pm
These units are optional and must be used depending of if you App uses the TWebBrowser or do you want change the TPageControl default style hook and so on. All this is detailed on the wiki pages of the project.
Pingback: Sip from the Firehose : FireMonkey and VCL Styles - articles, blogs, videos, docs and examples
January 31, 2014 at 9:34 pm
I’ve encountered a situation where right clicking on TMemo causes access violation. Reason is PopupWndList in Line 303 of Vcl.Styles.Syscontrols is NIL. Inserting check for NIL fixes the problem
February 3, 2014 at 12:09 pm
Can you please report this using the issue page (http://code.google.com/p/vcl-styles-utils/issues/list) of the project and be sure to use the last revision of the project.
December 1, 2014 at 8:16 am
Alt + Space is not working. Graphics, Menus, SysControls, SysStyleHook, SystemMenu and UxTheme are added to my project. Did I miss something?
Thanks in advance.
December 1, 2014 at 11:36 am
Please report this using the issue page of the project, providing a sample code to reproduce.
July 17, 2015 at 11:01 am
I added the designated units to fix popup menus but menu item shortcuts are still not being displayed.
July 17, 2015 at 11:19 am
I found what’s causing shortcuts to not be displayed. In Vcl.Styles.Utils.Menus.pas in the procedure TSysPopupStyleHook.DrawItem() method line 702:
LTextFormat := [tfLeft, tfVerticalCenter, tfSingleLine, tfExpandTabs, tfHidePrefix];
Change it to:
LTextFormat := [tfLeft, tfVerticalCenter, tfSingleLine, tfExpandTabs]
July 17, 2015 at 11:30 am
Hi, can you please attach a sample project to reproduce the issue. This is the issue page of the project https://github.com/RRUZ/vcl-styles-utils/issues
July 17, 2015 at 1:59 pm
Here ya go.
-Barry