![]() |
Event Background Color Problem. |
Post Reply
|
| Author | |
prashant
Senior Member
Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
Quote Reply
Topic: Event Background Color Problem.Posted: 23 April 2008 at 4:33am |
|
Problem: Whats wrong in following piece of code? I am sending color as a parameter COLORREF m_clrColor and expecting to see Event background in the color sent by function caller. One more thing, this function is getting called n number of times from another function. I can see events in various colors but not in the color sent be caller function. Thanks in advance :) Sample Code: // Code for setting Legend color. MyFunction(Param 1, param 2....,COLORREF m_clrColor) { static int iCount = 0; CXTPCalendarData * calendarData = GetCalendarCtrl().GetDataProvider(); if ( calendarData ) { // We are going to make a copy of our local list of event labels CXTPCalendarEventLabels * copyCalendarEventLabels = new CXTPCalendarEventLabels(); copyCalendarEventLabels->InitDefaultValues(); if ( copyCalendarEventLabels ) { // Go through our local copy of the labels, // and make a copy { // Copy label CXTPCalendarEventLabel * copyEventLabel = new CXTPCalendarEventLabel( iCount, m_clrColor, "Prashant"); if ( copyEventLabel ) { // Add the event lable copy to the event label list. copyCalendarEventLabels->InsertAt( iCount, copyEventLabel ); } else { ASSERT( FALSE ); } // Update the data provider with the event label copy calendarData->SetLabelList( copyCalendarEventLabels ); } } } ptrEvent->SetLabelID(iCount); iCount++; if (!pCalendarData->AddEvent(ptrEvent)) { ASSERT(FALSE); return; } GetCalendarCtrl().Populate(); } |
|
![]() |
|
prashant
Senior Member
Joined: 19 February 2007 Location: India Status: Offline Points: 165 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 April 2008 at 3:20am |
|
DONT USE STATIC NUMBER :)
|
|
![]() |
|
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 |