Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added events for selecting a calendar event in the XCCalendarDayEntry class
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 26 Jun 2016 12:43:18 +0000 (13:43 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 26 Jun 2016 12:43:18 +0000 (13:43 +0100)
source/widgets/XCCalendarDayEntry.cpp

index f5f31b4..4eb9baf 100644 (file)
@@ -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.
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