[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Context menu icon patch

From: Nathan Moinvaziri <nathan_at_nathanm.com>
Date: Sun, 23 Aug 2009 20:12:15 -0700

Hello TortoiseSVN dev,

I have found a bug and am submitting a patch. The details are below:

There is a bug in the way that the context menu icons are set in Tortoise. The problem manifests itself in Windows 7 and most likely in Windows Vista. It happens when the system has the Classic theme enabled and there are multiple context menus.

Here is a screenshot of the problem:

[cid:image001.png_at_01CA242D.876127A0] [cid:image002.png_at_01CA242D.876127A0]

As you can see there are two columns for icons. This is why the icons are pushed up against the text in the screenshots above.

What happens is that legacy context menus set the icons via MENUITEMINFO's hbmpChecked and hbmpUnchecked property. TortoiseSVN sets it via the new method which uses hbmpItem. So Windows creates one column for a checkbox and another column for the icon in this case. The funny thing is that in the Windows Aero theme, it doesn't have this problem. How the problem is resolved is by setting the style of the menu to MNS_CHECKORBMP via SetMenuInfo. It is my conclusion at the Aero theme actually does this automatically, which is why the problem doesn't exhibit itself in Aero.

Here are screenshots after the patch:

[cid:image003.png_at_01CA242E.02297F50] [cid:image004.png_at_01CA242E.02297F50]

Attached is the patch, menufix.patch which resolves the problem. I look forward to your feedback.

Nathan Moinvaziri


To unsubscribe from this discussion, e-mail: [dev-unsubscribe_at_tortoisesvn.tigris.org].

Received on 2009-08-24 06:55:06 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.