From: Steve Brokenshire Date: Sun, 26 Jun 2016 12:43:18 +0000 (+0100) Subject: Added events for selecting a calendar event in the XCCalendarDayEntry class X-Git-Tag: release-0.02~107 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=0b8511474e5fec3cbee0c4bd89f764d2a7458281;p=xestiacalendar%2F.git Added events for selecting a calendar event in the XCCalendarDayEntry class --- diff --git a/source/widgets/XCCalendarDayEntry.cpp b/source/widgets/XCCalendarDayEntry.cpp index f5f31b4..4eb9baf 100644 --- a/source/widgets/XCCalendarDayEntry.cpp +++ b/source/widgets/XCCalendarDayEntry.cpp @@ -27,10 +27,7 @@ END_EVENT_TABLE() using namespace std; XCCalendarDayEntry::XCCalendarDayEntry(wxWindow* parent, const wxString& title, const wxPoint& pos, const wxSize& size, const int id) - : wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title) -{ - - Connect(wxID_ANY, XCCALENDARDAYENTRY_DESELECT, wxCommandEventHandler(XCCalendarDayEntry::Deselect)); + : wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title){ DayPanel = parent->GetParent(); EntryID = id; @@ -45,6 +42,11 @@ XCCalendarDayEntry::XCCalendarDayEntry(wxWindow* parent, const wxString& title, AlarmIcon->SetBitmap(AlarmIconBitmap); HighPriorityIcon->SetBitmap(PriorityIconBitmap); + + Connect(wxID_ANY, XCCALENDARDAYENTRY_DESELECT, wxCommandEventHandler(XCCalendarDayEntry::Deselect)); + AlarmIcon->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this); + HighPriorityIcon->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this); + EventText->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this); UpdateInformation(); @@ -144,15 +146,13 @@ void XCCalendarDayEntry::UpdateInformation(){ } -void XCCalendarDayEntry::PaintFrameEvent(wxPaintEvent &PaintEvent) -{ +void XCCalendarDayEntry::PaintFrameEvent(wxPaintEvent &PaintEvent){ Repaint(); } -void XCCalendarDayEntry::ResizeFrameEvent(wxSizeEvent &SizeEvent) -{ +void XCCalendarDayEntry::ResizeFrameEvent(wxSizeEvent &SizeEvent){ // Adjust the Event text so it is displayed properly. @@ -174,8 +174,7 @@ void XCCalendarDayEntry::ResizeFrameEvent(wxSizeEvent &SizeEvent) } -void XCCalendarDayEntry::LeftClick(wxMouseEvent &MouseEvent) -{ +void XCCalendarDayEntry::LeftClick(wxMouseEvent &MouseEvent){ // Change the background of the widget to mark // the entry as selected.