X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fwidgets%2FXCCalendarListCalendarCtrl.cpp;h=758fb4b33d6ffb9ce0fb4d7af34ec04f35c56172;hp=bdf1b6a8411253f22d47b39bdc3980a477c04df8;hb=baa27c175ee6111fd4b88a3c53614a9b6be3541e;hpb=e79afea4cd8930a1ebbdda0e3543dd0a89e45b34 diff --git a/source/widgets/XCCalendarListCalendarCtrl.cpp b/source/widgets/XCCalendarListCalendarCtrl.cpp index bdf1b6a..758fb4b 100644 --- a/source/widgets/XCCalendarListCalendarCtrl.cpp +++ b/source/widgets/XCCalendarListCalendarCtrl.cpp @@ -50,6 +50,11 @@ XCCalendarListCalendarCtrl::XCCalendarListCalendarCtrl(wxWindow* parent, string szrMain->Add(lblCalendarName, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5); szrMain->Add(pnlColour, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5); + // Connect the events to the controls. + + chkShowCalendar->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxMouseEventHandler(XCCalendarListCalendarCtrl::ShowAllCheckboxClick), NULL, this); + chkShowCalendar->SetValue(wxCHK_CHECKED); + } XCCalendarListCalendarCtrl::~XCCalendarListCalendarCtrl(){ @@ -57,3 +62,41 @@ XCCalendarListCalendarCtrl::~XCCalendarListCalendarCtrl(){ // Delete the controls. } + +wxCheckBoxState XCCalendarListCalendarCtrl::GetShowCheckboxState(){ + + return chkShowCalendar->Get3StateValue(); + +} + +int XCCalendarListCalendarCtrl::GetCalendarID(){ + + return calendarID; + +} + +void XCCalendarListCalendarCtrl::SetCalendarID(int calendarID){ + + this->calendarID = calendarID; + +} + +void XCCalendarListCalendarCtrl::ShowAllCheckboxClick( wxMouseEvent &mouseEvent ){ + + if (chkShowCalendar->Get3StateValue() == wxCHK_CHECKED){ + + wxCommandEvent event(XCCALENDARCTRL_SHOWCALENDARENTRIES); + event.SetInt(calendarID); + event.SetId(ID_SHOWCALENDARENTRIES); + wxPostEvent(this->GetParent()->GetParent()->GetParent(), event); + + } else { + + wxCommandEvent event(XCCALENDARCTRL_HIDECALENDARENTRIES); + event.SetInt(calendarID); + event.SetId(ID_HIDECALENDARENTRIES); + wxPostEvent(this->GetParent()->GetParent()->GetParent(), event); + + } + +} \ No newline at end of file