Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmMain: Implemented code to hide/show calendar entries
[xestiacalendar/.git] / source / widgets / XCCalendarListCalendarCtrl.cpp
index bdf1b6a..758fb4b 100644 (file)
@@ -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
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