From: Steve Brokenshire Date: Thu, 21 Sep 2017 22:08:46 +0000 (+0100) Subject: macOS: Implemented macOS specific paths and variable name fixes X-Git-Tag: release-0.05~6 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=df012cf9ec9670db199095c4f4408dff556c4d5f;p=xestiacalendar%2F.git macOS: Implemented macOS specific paths and variable name fixes --- diff --git a/source/common/dirs.cpp b/source/common/dirs.cpp index f72a0f4..2559834 100644 --- a/source/common/dirs.cpp +++ b/source/common/dirs.cpp @@ -164,8 +164,8 @@ std::string GetAccountDir(std::string accName, bool serverCert) accountDir.append(accName); accountDir.append("/"); - if (ServerCert == true){ - AccountDir.append("server.crt"); + if (serverCert == true){ + accountDir.append("server.crt"); } #else diff --git a/source/widgets/XCCalendarManipulator.cpp b/source/widgets/XCCalendarManipulator.cpp index 7acf19d..4ca64bc 100644 --- a/source/widgets/XCCalendarManipulator.cpp +++ b/source/widgets/XCCalendarManipulator.cpp @@ -27,7 +27,11 @@ XCCalendarManipulator::XCCalendarManipulator(wxWindow* parent, const wxString& t : wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL, title){ szrMain = new wxBoxSizer( wxVERTICAL ); pnlMain = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(500, 50), wxTAB_TRAVERSAL); +#if defined(__APPLE__) + pnlMain->SetBackgroundColour(wxColour(120,120,120)); +#else pnlMain->SetBackgroundColour(wxColour(40,40,40)); +#endif this->SetSizer(szrMain); szrMain->Add(pnlMain, 0, wxEXPAND, 0); @@ -89,7 +93,7 @@ XCCalendarManipulator::XCCalendarManipulator(wxWindow* parent, const wxString& t wxDateTime dtNow = wxDateTime::Now(); -#if defined(WIN32) +#if defined(WIN32) || defined(__APPLE__) moo = new frmCalendarSelectMonth(this); #else moo = new XCCalendarMonthSelect(this); @@ -140,11 +144,11 @@ void XCCalendarManipulator::DateTextClick(wxCommandEvent &event){ // Bring up a popup control to select the month and year. - // TODO: Do something different for Win32. + // Do something different for Win32 and macOS. moo->SetPosition(wxPoint(dateButton->GetScreenRect().GetLeft(), dateButton->GetScreenRect().GetBottom())); moo->UpdateDate(month, year); -#if defined(WIN32) +#if defined(WIN32) || defined(__APPLE__) moo->ShowModal(); #else moo->Popup(); @@ -241,8 +245,22 @@ void XCCalendarManipulator::ShowCalendarsList(wxCommandEvent &event){ calendarList->SetPosition(wxPoint(calendarsButton->GetScreenRect().GetLeft(), calendarsButton->GetScreenRect().GetBottom())); calendarList->UpdateCalendarList(dataStorage); +#if defined(__APPLE__) + + if (calendarListShow == false) + { + calendarList->Show(); + calendarListShow = true; + } + else + { + calendarList->Hide(); + calendarListShow = false; + } +#else calendarList->Popup(); - +#endif + } void XCCalendarManipulator::UpdateDateButtonText(){ diff --git a/source/widgets/XCCalendarManipulator.h b/source/widgets/XCCalendarManipulator.h index 4e5bb7e..83365e6 100644 --- a/source/widgets/XCCalendarManipulator.h +++ b/source/widgets/XCCalendarManipulator.h @@ -27,7 +27,7 @@ #include #include "events.h" -#if defined(WIN32) +#if defined(WIN32) || defined(__APPLE__) #include "../forms/calendarselectmonth/frmCalendarSelectMonth.h" #else #include "XCCalendarMonthSelect.h" @@ -47,7 +47,7 @@ class XCCalendarManipulator: public wxPanel wxButton *nextButton = nullptr; wxButton *calendarsButton = nullptr; wxButton *dateButton = nullptr; -#if defined(WIN32) +#if defined(WIN32) || defined(__APPLE__) frmCalendarSelectMonth *moo = nullptr; #else XCCalendarMonthSelect *moo = nullptr; @@ -59,6 +59,9 @@ class XCCalendarManipulator: public wxPanel wxBitmap nextIconBitmap; wxBitmap previousIconBitmap; wxBitmap calendarsIconBitmap; +#if defined(__APPLE__) + bool calendarListShow = false; +#endif void UpdateDateButtonText(); protected: @@ -79,4 +82,4 @@ class XCCalendarManipulator: public wxPanel }; -#endif \ No newline at end of file +#endif