SOLVED: adding own icons to events |
Post Reply |
Author | |
Alex H.
Senior Member Joined: 12 February 2004 Status: Offline Points: 266 |
Post Options
Thanks(0)
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 |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
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.
|
|
Alex H.
Senior Member Joined: 12 February 2004 Status: Offline Points: 266 |
Post Options
Thanks(0)
|
Yes it works :-)
Thank you! |
|
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 |