Print Page | Close Window

[Solved]Question of selection.

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=15174
Printed Date: 26 June 2024 at 11:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [Solved]Question of selection.
Posted By: u8702656
Subject: [Solved]Question of selection.
Date 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 ?
 



Replies:
Posted By: mdoubson
Date Posted: 16 September 2009 at 12:43pm
Try use Shift + Click or Ctrl + Click

-------------
Mark Doubson, Ph.D.


Posted By: u8702656
Date 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.


Posted By: mdoubson
Date Posted: 17 September 2009 at 8:59am

What is "selected area"? Specific day? Like dtNow in your code?



-------------
Mark Doubson, Ph.D.


Posted By: u8702656
Date 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.
 


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


-------------
Mark Doubson, Ph.D.



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