|  | 
| [Solved]Question of selection. | 
| Post Reply   | 
| Author | |
| u8702656   Groupie   Joined: 03 September 2009 Status: Offline Points: 13 |  Post Options  Thanks(0)  Quote  Reply  Topic: [Solved]Question of selection. Posted: 15 September 2009 at 5:38am | 
| I used xtpCalendarWorkWeekView style. Could you tell me how to get to use the mouse to choose all Events in the select area ? | |
|  | |
| mdoubson   Senior Member     Joined: 17 November 2008 Status: Offline Points: 1705 |  Post Options  Thanks(0)  Quote  Reply  Posted: 16 September 2009 at 12:43pm | 
| 
   Try use Shift + Click or Ctrl + Click
    | |
|  | |
| u8702656   Groupie   Joined: 03 September 2009 Status: Offline Points: 13 |  Post Options  Thanks(0)  Quote  Reply  Posted: 16 September 2009 at 11:01pm | 
| 
   You misunderstand my meaning. 
 For example :       There are three Events on Monday,as I Lbuttondown the first Cell of Monday and been choosing the last one all the time.       How should I get these three Events? I have found a solution -> Use CXTPCalendarData.      CXTPCalendarData* pCalendarData;      COleDateTime dNow = COleDateTime::GetCurrentTime(); pCalendarData = m_ctrlCalendar.GetDataProvider(); //CXTPCalendarControl m_ctrlCalendar      CXTPCalendarEventsPtr MouseSelEvents = pCalendarData->RetrieveDayEvents(dNow);      for(int i=EventsCount-1;i>=0;i--) { CXTPCalendarEvent *SelEvent = MouseSelEvents->GetAt(i);           .................       } Please tell me if there are better methods. | |
|  | |
| mdoubson   Senior Member     Joined: 17 November 2008 Status: Offline Points: 1705 |  Post Options  Thanks(0)  Quote  Reply  Posted: 17 September 2009 at 8:59am | 
| What is "selected area"? Specific day? Like dtNow in your code? | |
|  | |
| u8702656   Groupie   Joined: 03 September 2009 Status: Offline Points: 13 |  Post Options  Thanks(0)  Quote  Reply  Posted: 17 September 2009 at 10:04pm | 
| My "selected area" is..... Perhaps the following code can explain more clearly. COleDateTime pBegin;  COleDateTime pEnd; int pnGroupIndex;  COleDateTimeSpan pspSelectionResolution; m_ctrlCalendar.GetActiveView()->GetSelection(&pBegin,&pEnd,NULL,&pnGroupIndex,&pspSelectionResolution); I get Event of one day, Compare each time started and end time of event with pBegin and pEnd. And I will know which Event chosen is.  | |
|  | |
| mdoubson   Senior Member     Joined: 17 November 2008 Status: Offline Points: 1705 |  Post Options  Thanks(0)  Quote  Reply  Posted: 18 September 2009 at 8:46am | 
| 
   Right - you can use GetSelection to fill provided COleDateTime objects with the values of the selection beginning, ending, and selection unit length.
But before you (user) need to MAKE this selection with mouse or SetSelection(...) call
    | |
|  | |
| 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 |