How to set image ID for CXTPRecentFileListBox item |
Post Reply |
Author | ||
rdhd
Senior Member Joined: 13 August 2007 Location: United States Status: Offline Points: 886 |
Post Options
Thanks(0)
Posted: 20 November 2014 at 6:53pm |
|
We are using the CJ CXTPRibbonBackstagePageRecent class for our recent documents page in the backstage window.
I am adding files to the list and I get icons when the page displays. But that only works if we are showing the user a file name in the window. But we want to show the user a formula for managed documents instead of a fully qualified file name. I can get the images for our files loaded into the image manger being used. But there's one catch, unlike almost every other CJ control that has an image ID in its instance data, I can't find a way to set the image ID. The member is private so I don't have access to it. I'd also like to swap out the tooltip context so I can use one of our own derived tooltip context objects we use elsewhere that provides a tooltip that shows a preview of the file but I can't figure out how to do that either. I can call a CXTPRecentFileListBox::GetTooltipContext method, but I can't find a SetTooltipContext method. How can I set the image for the icon displayed with the file? How can I set a custom CXTPTooltipContext derived object as the tooltip context for the items? |
||
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
|
Hello rdhd, I have added getter and setter for CXTPControlGalleryItem::m_nImage in CXTPRecentFileListBoxItem and derived class CXTPControlGalleryItem. This setter properly save custom image index in original CXTPRecentFileListBoxItem::m_pRecentItem. This bug can be reproduced with setting custom icons and then pin/unpin item -> custom icons will be updated with system icons. Fix will be available soon in beta or release version of 18.0. About TooltipContext you can inherit class CXTPRecentFileListBox to manage TooltipContext.
|
||
olebed
Admin Group Joined: 01 July 2014 Location: Ukraine Status: Offline Points: 841 |
Post Options
Thanks(0)
|
|
Example for using custom icons in C++ (Samples\Ribbon\RibbonSample\MainFrm.h and MainFrm.cpp) change type of CMainFrame::m_pageRecent to CXTPRibbonBackstagePageRecentCustom then add m_pageRecent.InitCustomIcons(); in CMainFrame::CreateBackstage()
Also example for VisualBasic, two variants of editing (used sample project Samples\CommandBars\VB\RibbonSample\pageBackstageRecent.frm):
Please note that in first case used RecentFileList with item's type RecentFileListItem and in second case used RecentFileListBox with item's type CommandBarGalleryItem. Those two item's types have different properties to get access to image and text: RecentFileListItem.PathName RecentFileListItem.IconId CommandBarGalleryItem.Caption CommandBarGalleryItem.ImageIndex Also note that indexes of items in RecentFileList starts from 0 and for RecentFileListBox starts from 1. For i = 1 To RecentFileList.Count ... For i = 0 To RecentFileListBox.Items.Count ... Regards, Oleksandr Lebed |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |