BEGIN_EVENT_TABLE(XCCalendarDayEntry, wxPanel)
EVT_PAINT(XCCalendarDayEntry::PaintFrameEvent)
EVT_SIZE(XCCalendarDayEntry::ResizeFrameEvent)
-EVT_LEFT_DOWN(XCCalendarDayEntry::LeftClick)
+EVT_LEFT_UP(XCCalendarDayEntry::LeftClick)
+EVT_RIGHT_UP(XCCalendarDayEntry::RightClick)
END_EVENT_TABLE()
using namespace std;
: wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title){
DayPanel = parent->GetParent();
- entryID = id;
+ eventID = id;
this->SetMinSize(wxSize(65, 30));
HighPriorityIcon->SetBitmap(PriorityIconBitmap);
Connect(ID_ENTRYDESELECT, XCCALENDARDAYENTRY_DESELECT, wxCommandEventHandler(XCCalendarDayEntry::Deselect));
+
AlarmIcon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
HighPriorityIcon->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
EventText->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
EventTime->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
DayPanel->Connect(wxEVT_LEFT_UP, wxMouseEventHandler(XCCalendarDayEntry::LeftClick), NULL, this);
+ AlarmIcon->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+ HighPriorityIcon->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+ EventText->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+ EventTime->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+ DayPanel->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarDayEntry::RightClick), NULL, this);
+
UpdateInformation();
}
this->SetBackgroundColour(wxColor(255,215,0));
wxCommandEvent DeselectOthersEvent(XCCALENDARDAY_DESELECTOTHERENTRIES);
- DeselectOthersEvent.SetInt(entryID);
+ DeselectOthersEvent.SetInt(eventID);
DeselectOthersEvent.SetId(ID_DESELECTOTHERENTRIES);
wxPostEvent(DayPanel, DeselectOthersEvent);
}
+void XCCalendarDayEntry::RightClick(wxMouseEvent &MouseEvent){
+
+ // Sent an event to the month view control.
+
+ EventProperties *eventData = new EventProperties;
+ eventData->calendarID = calendarID;
+ eventData->eventID = eventID;
+
+ wxCommandEvent eventMenu(XCCALENDARMONTH_DISPLAYEVENTMENU);
+ eventMenu.SetClientData(eventData);
+ eventMenu.SetId(ID_DISPLAYEVENTMENU);
+ wxPostEvent(this->GetParent()->GetParent(), eventMenu);
+
+}
+
void XCCalendarDayEntry::Deselect(wxCommandEvent &DeselectEvent){
this->SetBackgroundColour(wxNullColour);
int XCCalendarDayEntry::GetID(){
- return entryID;
+ return eventID;
}
}
+int XCCalendarDayEntry::GetEventID(){
+
+ return eventID;
+
+}
+
int XCCalendarDayEntry::GetAccountID(){
return accountID;
}
-void XCCalendarDayEntry::SetEntryIDs(int accountID, int calendarID, int entryID){
+void XCCalendarDayEntry::SetEntryIDs(int accountID, int calendarID, int eventID){
this->accountID = accountID;
this->calendarID = calendarID;
- this->entryID = entryID;
+ this->eventID = eventID;
}
}
+void XCCalendarDayEntry::SetEventName(string eventName){
+
+ EventText->SetLabel((wxString)eventName);
+
+}
+
wxSizerItem* XCCalendarDayEntry::GetAfterSpacer(){
return afterSpacer;