Print Page | Close Window

Add Item to gallery at run-time

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=13756
Printed Date: 03 July 2024 at 4:08am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Add Item to gallery at run-time
Posted By: Bart6
Subject: Add Item to gallery at run-time
Date 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



Replies:
Posted By: Oleg
Date 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


Posted By: Bart6
Date 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?




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net