X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fwidgets%2FXCCalendarListAccountCtrl.cpp;h=dbd105e454f03bdf2d5acda44b4784348356a2f7;hp=5674da72d5626b44c306f5c1cb937b70ec65e29f;hb=902d948e5e45ad483c8e235690dda8f2bf596ad5;hpb=baa27c175ee6111fd4b88a3c53614a9b6be3541e diff --git a/source/widgets/XCCalendarListAccountCtrl.cpp b/source/widgets/XCCalendarListAccountCtrl.cpp index 5674da7..dbd105e 100644 --- a/source/widgets/XCCalendarListAccountCtrl.cpp +++ b/source/widgets/XCCalendarListAccountCtrl.cpp @@ -37,7 +37,7 @@ XCCalendarListAccountCtrl::XCCalendarListAccountCtrl(wxWindow* parent, string ac // Setup the label. - lblAccountName = new wxStaticText(this, wxID_ANY, wxString(accountName), wxDefaultPosition, wxDefaultSize, 0, ""); + lblAccountName = new wxStaticText(this, wxID_ANY, wxString(accountName.c_str(), wxConvUTF8), wxDefaultPosition, wxDefaultSize, 0, ""); // Setup the font. @@ -61,6 +61,12 @@ XCCalendarListAccountCtrl::~XCCalendarListAccountCtrl(){ // Delete the calendar controls. + // Unbind the controls. + + chkShowAll->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxMouseEventHandler(XCCalendarListAccountCtrl::ShowAllCheckboxClick), NULL, this); + + // Delete the calendar list controls. + for (std::vector::iterator calendarIter = calendarControlList.begin(); calendarIter != calendarControlList.end(); calendarIter++){ @@ -73,6 +79,14 @@ XCCalendarListAccountCtrl::~XCCalendarListAccountCtrl(){ calendarControlList.clear(); // Clear the widget controls. + + delete chkShowAll; + chkShowAll = nullptr; + + delete lblAccountName; + lblAccountName = nullptr; + + this->SetSizer(nullptr, true); } @@ -126,6 +140,12 @@ void XCCalendarListAccountCtrl::SetAccountID(int accountID){ } +void XCCalendarListAccountCtrl::SetAccountPreferencesID(int accountID){ + + this->accountPreferencesID = accountPreferencesID; + +} + vector XCCalendarListAccountCtrl::GetHiddenCalendarList(){ vector calendarList; @@ -143,4 +163,16 @@ vector XCCalendarListAccountCtrl::GetHiddenCalendarList(){ return calendarList; +} + +void XCCalendarListAccountCtrl::SetCheckBoxValue(wxCheckBoxState newValue){ + + if (newValue == wxCHK_CHECKED){ + showAccounts = true; + } else { + showAccounts = false; + } + + chkShowAll->SetValue(newValue); + } \ No newline at end of file