// Setup the checkbox.
- //chkShowAll = new wxCheckBox();
-
chkShowCalendar = new wxCheckBox(this, wxID_ANY, "", wxPoint(0,0), wxDefaultSize, wxCHK_3STATE, wxDefaultValidator, "");
// Setup the label.
pnlColour = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(16,16), 0, "");
pnlColour->SetBackgroundColour(wxColour(calendarColour.red, calendarColour.green, calendarColour.blue, calendarColour.alpha));
+ // Setup the popup menu.
+
+ calendarMenu = new XCCalendarMenu();
+ calendarMenu->SetWindowPointer(this);
+ calendarMenu->SetPopupPointer((wxPopupTransientWindow*)this->GetParent());
+
// Connect them to the sizer.
szrMain->Add(15, 0, 0, 0, 5);
// Connect the events to the controls.
chkShowCalendar->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxMouseEventHandler(XCCalendarListCalendarCtrl::ShowAllCheckboxClick), NULL, this);
+ chkShowCalendar->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarListCalendarCtrl::PopupMenu), NULL, this);
+ lblCalendarName->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarListCalendarCtrl::PopupMenu), NULL, this);
+ pnlColour->Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarListCalendarCtrl::PopupMenu), NULL, this);
+ Connect(wxEVT_RIGHT_UP, wxMouseEventHandler(XCCalendarListCalendarCtrl::PopupMenu), NULL, this);
chkShowCalendar->SetValue(wxCHK_CHECKED);
}
void XCCalendarListCalendarCtrl::SetCalendarID(int calendarID){
this->calendarID = calendarID;
+ calendarMenu->SetCalendarID(this->calendarID);
+
+}
+
+void XCCalendarListCalendarCtrl::SetAccountPreferencesID(int accountPreferencesID){
+
+ this->accountPreferencesID = accountPreferencesID;
+ calendarMenu->SetAccountPreferencesID(this->accountPreferencesID);
}
}
+}
+
+void XCCalendarListCalendarCtrl::SetCheckBoxValue(wxCheckBoxState newValue){
+
+ if (newValue == wxCHK_CHECKED){
+ showCalendar = true;
+ } else {
+ showCalendar = false;
+ }
+
+ chkShowCalendar->SetValue(newValue);
+
+}
+
+void XCCalendarListCalendarCtrl::PopupMenu( wxMouseEvent &mouseEvent ){
+
+ this->GetParent()->GetParent()->GetParent()->GetParent()->PopupMenu(calendarMenu->MenuPointer(), wxDefaultPosition);
+
}
\ No newline at end of file