Log On
Embarcadero Home
Watch, Follow, &
Connect with Us
Share This
QualityCentral
Communities
Articles
Blogs
Resources
Downloads
Help
QualityCentral
Delphi-BCB
VCL
Standard Controls
TActionList
TButton
TCheckBox
TComboBox
TEdit
TGroupBox
TLabel
TListBox
TMainMenu
TMemo
TPanel
TPopupMenu
TRadioButton
TRadioGroup
TScrollBar
You are not logged in.
Help
Print
Public Report
Report From:
Delphi-BCB/VCL/Standard Controls/TMainMenu
[ Add a report in this area ]
Report #:
94127
Status:
Closed
Check marks are drawn incorrectly in Vista menus
Project:
Delphi
Build #:
14.0.3593.25826
Version:
14.2
Submitted By:
David Heffernan
Report Type:
Basic functionality failure
Date Reported:
5/23/2011 4:38:27 AM
Severity:
Serious / Highly visible problem
Last Updated:
7/9/2012 11:21:06 PM
Platform:
All platforms
Internal Tracking #:
283717
Resolution:
Cannot Reproduce
(Resolution Comments)
Resolved in Build:
:
None
Duplicate of:
None
Voting and Rating
Overall Rating:
No Ratings Yet
0.00 out of 5
Total Votes:
None
Description
The code for drawing check marks and radio items for Vista menus is incorrect. There are a number of differences in the code from the MSDN reference for owner drawn Vista menus. The most obvious manifestations are that the glyphs are pixellated under font scaling > 100% and that the glyphs are incorrectly horizontally aligned.
Steps to Reproduce:
1. Switch font scaling to a value greater than 100%
2. Display a Delphi menu with check mark or radio item glyphs.
3. Set the Images property of the menu so that the owner-draw Vista menu code path is chosen.
I have attached a ZIP file containing some images showing the problems. I have included images with 150% and 200% font scaling although I would stress that the problems are present at all font scalings other than 100%, including the most common such value of 125%. The problem with pixellated glyphs is clear to see. The other problem that is less clear is the alignment of the check marks. That is why I included the 200% font scaling image. At that font scaling you can clearly see the system-drawn menu right aligning the check marks, but the Delphi owner-drawn version is centred.
The only reference I am aware of for owner draw menus is on MSDN: http://msdn.microsoft.com/en-us/library/bb756947 - I urge you to study the MSDN code more carefully and align the VCL code for Menus.pas with the MSDN code.
The most obvious thing that jumps out at me is that the MSDN code uses different rects for drawing MENU_POPUPCHECKBACKGROUND and MENU_POPUPCHECK, but the VCL code uses the same rect for both calls to DrawThemeBackground. But when I look through the code it seems pretty clear that there are lots of other problems. I really think you need to revisit this code, get it right, and do some real testing with different font scaling settings, RTL etc. I have a couple of other QC reports on this code for what it's worth.
Of course, if you stopped using owner drawn Vista menus then all these problems would go away because the system would paint the menus and it gets them right. In order to do this you would have to supply the custom glyphs (i.e. ImageIndex/TImageList glyphs) as a pre-multipled PARGB32 bitmap in MENUITEMINFO.hbmpItem.
Workarounds
The only possible workaround is to modify the code in Menus.pas and include the corrected unit in your projects.
Attachment
menu_check_marks.zip
Comments
David Heffernan at 7/9/2012 1:11:26 PM
-
Close as "Cannot Reproduce"? That makes no sense.
Please follow the instructions. If you can't reproduce this then you have not followed the instructions.
Tomohiro Takahashi at 7/9/2012 10:35:21 PM
-
Thanks for the notification. I will check the internal status of this report...
Tomohiro Takahashi at 7/9/2012 10:53:27 PM
-
This is a comment from Internal Tracking System.
<<<<<<<<
Both my systems only go to 150%, and I do not see a difference of pixelation between the system rendered menu and the VCL rendered menu.
>>>>>>>>
and, does your issue still occur with Delphi XE2 Update 4(or Trial)?
View Your Reports
Search
Server Response from: ETNACODE01
Developer Tools
Blackfish SQL
C++Builder
Delphi
FireMonkey
Prism
InterBase
JBuilder
J Optimizer
HTML5 Builder
3rdRail & TurboRuby
Database Tools
Change Manager
DBArtisan
DB Optimizer
ER/Studio
Performance Center
Rapid SQL
Technical Articles
Tutorials
White Papers
Press Releases
Newsletters
Add Content (GetPublished)
Audio
Audio & Video
Video
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Tags
Technology Partners
Downloads
Free Trials
Registered User Downloads
Beta Programs
Add Content (GetPublished)
Articles
Blogs
Bugs & Suggestions (QualityCentral)
Discussion Forums
Examples (CodeCentral)
Member Services
About
Connect with Us