Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
widgets: Widget controls updated
[xestiacalendar/.git] / source / widgets / XCCalendarDayEntry.cpp
index d2d9483..7ec8de0 100644 (file)
@@ -21,7 +21,8 @@
 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;
@@ -30,7 +31,7 @@ XCCalendarDayEntry::XCCalendarDayEntry(wxWindow* parent, const wxString& title,
         : wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title){
        
        DayPanel = parent->GetParent();
-       entryID = id;
+       eventID = id;
        
        this->SetMinSize(wxSize(65, 30));
        
@@ -55,12 +56,19 @@ XCCalendarDayEntry::XCCalendarDayEntry(wxWindow* parent, const wxString& title,
        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();
        
 }
@@ -200,12 +208,27 @@ void XCCalendarDayEntry::LeftClick(wxMouseEvent &MouseEvent){
        
        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);
@@ -258,7 +281,7 @@ bool XCCalendarDayEntry::GetDisplayHighPriority(){
 
 int XCCalendarDayEntry::GetID(){
        
-       return entryID;
+       return eventID;
        
 }
 
@@ -268,6 +291,12 @@ int XCCalendarDayEntry::GetCalendarID(){
        
 }
 
+int XCCalendarDayEntry::GetEventID(){
+       
+       return eventID;
+       
+}
+
 int XCCalendarDayEntry::GetAccountID(){
        
        return accountID;
@@ -310,11 +339,11 @@ string XCCalendarDayEntry::BuildEventTime(int timeHour, int timeMinute){
        
 }
 
-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;
        
 }
 
@@ -324,6 +353,12 @@ void XCCalendarDayEntry::SetAfterSpacer(wxSizerItem *afterSpacer){
        
 }
 
+void XCCalendarDayEntry::SetEventName(string eventName){
+       
+       EventText->SetLabel((wxString)eventName);
+       
+}
+
 wxSizerItem* XCCalendarDayEntry::GetAfterSpacer(){
        
        return afterSpacer;
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