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

Re: Native menu rendering with icons patch (W2k, XP, Vista)

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: 2007-05-31 22:02:13 CEST

Adam Strzelecki wrote:
> Hello TortoiseSVN developers!
>
> I'd like to share a method of rendering icons at menus that I did once
> for TortoiseCVS. Actually right now you're using MFT_OWNERDRAW to render
> a menu and MIIM_CHECKMARKS for the case ownerdraw is off.
>
> The 2nd method was some time ago default & only method for TortoiseCVS,
> and it was producing quite ugly icons, and now it is default one for
> TortoiseSVN on Vista to keep the original menu style.
>
> Actually since Windows 2000 MIIM_CHECKMARKS or OWNERDRAW menus is not
> the only way of having nice menu icons. Actually Windows API offeres you
> setting a menu item bitmap callback (hbmpItem = HBMMENU_CALLBACK), where
> you can draw the icon yourself, but let Windows to draw everything else,
> keeping the original menu style (Vista too). Now TSVN because of full
> ownerdraw is NOT respecting visual style of menu neither on XP nor Vista.
>
> Anyway I'm attaching the patch for TortoiseSVN.
>
> Theoretically you could get rid of old ownerdraw code at all, where you
> pain all the texts, because it is useless on Win2k or never systems, and
> on old Win9x (is it supported) anyway you can use MIIM_CHECKMARKS.
> HBMMENU_CALLBACK code is much lighter as it doesn't need to do much on
> WM_ITEMMEASURE -> just as some space for icon, neither on WM_ITEMDRAW,
> just drawing icon with DrawIconEx.

Thanks for the patch! I've modified the whole context-menu stuff and
removed the ownerdraw completely.
But on Vista, the HBMENU_CALLBACK isn't a good idea:
http://svn.haxx.se/tsvn/archive-2007-02/0235.shtml
So I had to (besides removing the ownerdraw stuff) tweak your patch to
still keep using the checkmark-bitmaps - otherwise the vista context
menu falls back to the old UI.

Committed the changes in revision 9611.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Thu May 31 22:02:23 2007

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.