Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [T-Merge patch] syncing code for views

Project highlights: :. Download .: :. Support .: :. FAQ .: :. Translations .: :. Donate .: :. Report Bug .:

tortoisesvn
Discussion topic

Back to topic list

Re: [T-Merge patch] syncing code for views

Author steveking
Full name Stefan Küng
Date 2011-04-17 02:46:45 PDT
Message On 17.04.2011 09:30, Oto BREZINA wrote:
> On 2011-04-05 20:03, Stefan Küng wrote:
>>
>>> 2. Is there plan to support icons there? let say, same like in main
>>> menu? not worth much but nice :)
>> Good idea.
> I look at code it seems be possible without owner draw to keep string.
> (ref: http://www.codeguru.​com/forum/archive/in​dex.php/t-101074.htm​l)
> However I don't know how to extract one bitmap from toolbar ...
> Do we need set new resource?

To get the icon for a specific command from the toolbar, something like
this might work:

HICON GetIconForCommand() {
CToolbar bar;
bar.Create(m_hWnd);
if (bar.LoadToolBar(IDR​_MAINFRAME))
{
   int offset = bar.CommandToIndex(cmdId);
   CImageList imgList;
   imgList.Attach(SendM​essage(bar.GetSafeHw​nd(), TB_GETIMAGELIST, 0, 0));
   HICON h=imgList.ExtractIcon(offset);
   imgList.Detach();
   return h;
}
return 0;
}

If a handle is returned, use that for the AppendMenuIcon() method.
Otherwise (if 0 is returned) you can use a custom icon.

Stefan

--
        ___
   oo // \\ "De Chelonian Mobile"
  (_,\/ \_/ \ TortoiseSVN
    \ \_/_\_/> The coolest Interface to (Sub)Version Control
    /_/ \_\ http://tortoisesvn.net

« Previous message in topic | 18 of 27 | Next message in topic »

Messages

Show all messages in topic

                     Re: [T-Merge patch] syncing code for views steveking Stefan Küng 2011-04-10 12:35:07 PDT
                         Re: [T-Merge patch] syncing code for views otik Oto BREZINA 2011-04-10 12:44:39 PDT
Page: of 2 « Previous | Next »
Messages per page: