Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - [Solved]Question of selection.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[Solved]Question of selection.

 Post Reply Post Reply
Author
Message
u8702656 View Drop Down
Groupie
Groupie


Joined: 03 September 2009
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote u8702656 Quote  Post ReplyReply Direct Link To This Post 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 ?
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 16 September 2009 at 12:43pm
Try use Shift + Click or Ctrl + Click
Back to Top
u8702656 View Drop Down
Groupie
Groupie


Joined: 03 September 2009
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote u8702656 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 17 September 2009 at 8:59am

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

Back to Top
u8702656 View Drop Down
Groupie
Groupie


Joined: 03 September 2009
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote u8702656 Quote  Post ReplyReply Direct Link To This Post 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.
 
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.