Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/VCL/Styles    [ Add a report in this area ]  
Report #:  124944   Status: Closed
TMainMenu does not display properly using VCL styling
Project:  Delphi Build #:  20.0.15596.9843
Version:    20.0 Submitted By:   Tan MH
Report Type:  Crash / Data loss / Total failure Date Reported:  5/20/2014 8:11:26 PM
Severity:    Critical / Show Stopper Last Updated: 9/3/2014 5:17:13 AM
Platform:    All versions Internal Tracking #:   51231
Resolution: Fixed (Resolution Comments) Resolved in Build: : XE7
Duplicate of:  None
Voting and Rating
Overall Rating: (4 Total Ratings)
4.50 out of 5
Total Votes: 11
Description
The menu items will not display properly if you enable custom styles from the project option/Application/Appearance.

For example if you have 3 sub menu items but with the first menu item visible property set to false, the application will show the 1st and 2nd menu instead of 2nd and 3rd menu.
Steps to Reproduce:
1. Create a new VCL form appliaction
2. Drop a TMainMenu to Form1
3. Add 1 menu item
4. Under this menu, add another 3 sub menu items
5. Set the 1st sub menu item visible property to false.
6. From the project option,Application,Appearance, select any default styles other than windows.
7. Run the application.
Workarounds
None
Attachment
Test.zip
Comments

Tomohiro Takahashi at 5/21/2014 6:34:42 PM -
Could you please attach sample project(incuding some screenshot) to reproduce/confirm your issue?

Tan MH at 5/21/2014 8:15:29 PM -
Hi,

I have attached a project but it seems failed to upload.

I have upload to my skydrive
https://onedrive.live.com/redir?resid=B54DF5346EC25B41!2163&authkey=!AOBQ4lCF0Lw8yjQ&ithint=folder%2c.jpg

Fyi, I am using C++ Builder XE6 trial version
My PC OS is windows 8.1 pro


Regards,

P.S. I am replying this comment second time, the first time seems never get through

Tomohiro Takahashi at 5/22/2014 12:17:21 AM -
Please try to use Windows Native QC client(QualityCentral.exe) to attach a SMALL zip file to your existing report.
The standalone client is included in C++Builder.

Tan MH at 5/22/2014 4:32:47 AM -
I have attached  a zip file to the report

Askhat Kairov at 5/22/2014 9:45:29 PM -
With TPopupMenu same situation.
In Delphi XE3/XE4 everything works correctly.

Jaroslav Benes at 6/2/2014 5:24:00 AM -
I have similar problem in styled application in XE6. When I use in main menu with submenu or popup menu image list with break line (trough actions too), images drown incorrectly (sometime into break lines) or is missing. I donÂ’t know how it turns of.

The same wrong behaviour was in original code styling from Mr. Ruz, but he repair it in last version of own styling framework for XE2-XE5.

Jaroslav Benes at 6/2/2014 5:28:00 AM -
I think that problem can be in Vcl.SysStyles.pas, there is some common code with Rus's code in Vcl.Styles.Utils.Menus.pas.

Gunter OTTE at 6/20/2014 4:03:24 AM -
Unfortunately, not fixed in XE6 Update 1 :-(

Gary Ayton at 6/27/2014 10:12:59 AM -
Agree, have just converted my app to XE6 Update 1 and if any menuitem has visible = false, the menu becomes deranged if a VCL style is active. Menuitems appear to move to another position and become associated with a different menuitem's actions. Workaround: make sure no menuitem has visible = false!

Andreas Arvidsson at 6/22/2014 3:41:51 AM -
Same problem in C++Builder XE6, working in XE5, also "Separators" in popup menus does a linewrap when Styles are enabled and you have set Visible=false to an item on the popup menu.

Lee Mc Cauley at 7/10/2014 6:31:46 AM -
This is a huge issue for me. I have 2 major applications that I incorporated Styles into when they were introduced.

Has anyone found a solution to this?

There is no workaround for me.  I cannot set all menu items visible to true. My applications are major applications that have multiple versions.

The only workaround is to not use styles or not use Delphi XE6.

Thank you,
Lee

Lee Mc Cauley at 7/10/2014 4:15:52 PM -
I found a workaround!

This is a very interesting read:

https://code.google.com/p/vcl-styles-utils/

To get the source in XE6 click file|Open from version control

In URL of Repository:

http://vcl-styles-utils.googlecode.com/svn/trunk

Save it where you want.

Follow the instructions on the website on how to use it.

Here is the key that will allow use styles and set menu items visible to false.  Go here to his blog:

http://theroadtodelphi.wordpress.com/2014/04/21/vcl-styles-utils-embarcadero-agreement-and-delphi-xe6/

Make sure you follow his directions to comment out the following:

{$DEFINE UseVCLStyleUtilsMenu}
{$IF CompilerVersion >= 27} // Use the XE6 menu syshooks by default
Comment out this line!!!!
  {.$UNDEF UseVCLStyleUtilsMenu} // comment this line if you want to use the VCL Styles Utils Menus Hooks instead
{$IFEND}

I can now use styles and set menu items visible to false.

Lee

Jaroslav Benes at 7/11/2014 12:29:11 AM -
Yes, it is OK, this really works.

Tan MH at 7/14/2014 6:11:32 AM -
Yes! It works.
Hopefully this will be included in XE6 update 2

Mike Versteeg at 9/25/2014 4:23:55 AM -
Nope, and neither in XE7. No idea why this was marked fixed.

Tomohiro Takahashi at 9/26/2014 4:27:52 PM -
Mike-san
Please put new QC report about your issue for XE7.

Server Response from: ETNACODE01