Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added the DeselectOthersEvent function to XCCalendarMonthView
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 16 Jul 2016 21:57:41 +0000 (22:57 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 16 Jul 2016 21:57:41 +0000 (22:57 +0100)
source/widgets/XCCalendarMonthView.cpp
source/widgets/XCCalendarMonthView.h

index 9d485ab..aa99d8b 100644 (file)
@@ -27,6 +27,8 @@ END_EVENT_TABLE()
 XCCalendarMonthView::XCCalendarMonthView(const wxString& title, const wxPoint& pos, const wxSize& size, XCCalendarMonthViewGrid *grid)
         : wxFrame(NULL, wxID_ANY, title, pos, size){
        
+       Connect(ID_MONTHVIEWCLEARSELECTION, XCCALENDARMONTH_DESELECTOTHERENTRIES, wxCommandEventHandler(XCCalendarMonthView::DeselectOthersEvent));
+               
        MondayText = new XCCalendarMonthViewDayTitle(this, _("Monday"), wxDefaultPosition, wxDefaultSize);
        TuesdayText = new XCCalendarMonthViewDayTitle(this, _("Tuesday"), wxDefaultPosition, wxDefaultSize);
        WednesdayText = new XCCalendarMonthViewDayTitle(this, _("Wednesday"), wxDefaultPosition, wxDefaultSize);
@@ -129,4 +131,21 @@ void XCCalendarMonthView::ResizeFrameEvent(wxSizeEvent &SizeEvent){
        
        this->Refresh();
        
+}
+
+void XCCalendarMonthView::DeselectOthersEvent(wxCommandEvent &DeselectEvent){
+       
+       for (vector<XCCalendarDay*>::iterator DayIter = CalendarDayList.begin();
+               DayIter != CalendarDayList.end(); DayIter++){
+                       
+               if (DeselectEvent.GetClientData() != (void*)(*DayIter)){
+                       
+                       wxCommandEvent DeselectEvent(XCCALENDARDAY_DESELECTALLENTRIES);
+                       DeselectEvent.SetId(ID_DESELECTALLITEMS);
+                       wxPostEvent((*DayIter), DeselectEvent);
+                       
+               }
+                       
+       }
+       
 }
\ No newline at end of file
index d09f4cd..9799ea8 100644 (file)
@@ -57,6 +57,7 @@ class XCCalendarMonthView: public wxFrame
        
                void PaintFrameEvent(wxPaintEvent &PaintEvent);
                void ResizeFrameEvent(wxSizeEvent &SizeEvent);
+               void DeselectOthersEvent(wxCommandEvent &DeselectEvent);
        
        DECLARE_EVENT_TABLE()
        
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy