Print Page | Close Window

SOLVED: adding own icons to events

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=11725
Printed Date: 28 April 2024 at 1:29pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SOLVED: adding own icons to events
Posted By: Alex H.
Subject: SOLVED: adding own icons to events
Date Posted: 05 August 2008 at 5:58am
How can i add and display my own icons in events?

This line doesn't work
ptrEvent->GetCustomIcons()->Add((UINT)IDI_MYICON);

Regards



Replies:
Posted By: AndreiM
Date Posted: 06 August 2008 at 2:04pm
At the first you have to add your icons (with IDs) to the image list: CXTPCalendarTheme::GetCustomIconsList()
See example in CAdvancedCalendarOptionsDlg::OnOK() implementation.
 
Then you have 2 ways to show custom icons:
 
  1. Add ID(s) to event object and update event in data provider.
          ptrEvent->GetCustomIcons()->Add((UINT)IDI_MYICON);
          ptrEvent->GetDataProvider()->ChangeEvent(ptrEvent);
          pCalendar->Populate();
 
  2. Set icon ID in XTP_NC_CALENDAR_PREPOPULATE event handler. In this case you don't need ChangeEvent and Populate calls.
          ptrEvent->GetCustomIcons()->AddIfNeed((UINT)IDI_MYICON);
      See example in CCalendarDemoView::OnEvent_PrePopulate.


-------------
Regards,
Andrei Melnik


Posted By: Alex H.
Date Posted: 07 August 2008 at 10:31am
Yes it works :-)

Thank you!



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