Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Command Bars
  New Posts New Posts RSS Feed - Add Item to gallery at run-time
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Add Item to gallery at run-time

 Post Reply Post Reply
Author
Message
Bart6 View Drop Down
Groupie
Groupie
Avatar

Joined: 22 March 2009
Location: Belgium
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bart6 Quote  Post ReplyReply Direct Link To This Post Topic: Add Item to gallery at run-time
    Posted: 22 March 2009 at 8:17am
Hello,
 
I would like to add an item to a gallery at run-time. Via an event I get a pointer to a thumbnail structure. The structure contain size and memory pointer to 32 bit RGBA uncompressed image.
 
Q: What is the best way to add my thumbnail to the gallery? (of type CXTPControlGalleryItems)
 
(Using XTP 13.0.0 on XP SP3 32bit and VS2008)
Thank you
Bart
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2009 at 1:57am
Hi,
 
Add Item to gellery items and update imagemanager:
 
m_pItemsColumns->GetImageManager()->SetIcons(&bmp....);
m_pItemsColumns->AddItem(_T("One"), index, index);
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Bart6 View Drop Down
Groupie
Groupie
Avatar

Joined: 22 March 2009
Location: Belgium
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bart6 Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2009 at 9:37am
Thanks Oleg.
 
Here is how I added a new item to the existing gallery:
 

CXTPImageManagerIconHandle hIcon(hBitmap);

UINT index = m_pItemsMaterials->GetImageManager()->AddCustomIcon(hIcon);

m_pItemsMaterials->AddItem( TEXT("Hello World"), index);

Would you agree this is the best method?

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.