From 7644bfc35e0d53134b1dc98d98278ca1e73051e3 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 19 Jul 2017 22:50:16 +0100 Subject: [PATCH] XCCalendarManipulator: Use frmCalendarSelectMonth instead of XCCalendarMonthSelect on Win32 systems --- source/widgets/XCCalendarManipulator.cpp | 14 ++++++++++++-- source/widgets/XCCalendarManipulator.h | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/source/widgets/XCCalendarManipulator.cpp b/source/widgets/XCCalendarManipulator.cpp index 95d2045..c71692c 100644 --- a/source/widgets/XCCalendarManipulator.cpp +++ b/source/widgets/XCCalendarManipulator.cpp @@ -88,8 +88,12 @@ XCCalendarManipulator::XCCalendarManipulator(wxWindow* parent, const wxString& t // Setup the month selection control. wxDateTime dtNow = wxDateTime::Now(); - + +#if defined(WIN32) + moo = new frmCalendarSelectMonth(this); +#else moo = new XCCalendarMonthSelect(this); +#endif month = ((int)dtNow.GetMonth() + 1); year = dtNow.GetYear(); moo->UpdateDate(month, year); @@ -123,10 +127,16 @@ void XCCalendarManipulator::DateTextClick(wxCommandEvent &event){ // Bring up a popup control to select the month and year. + // TODO: Do something different for Win32. + moo->SetPosition(wxPoint(dateButton->GetScreenRect().GetLeft(), dateButton->GetScreenRect().GetBottom())); moo->UpdateDate(month, year); +#if defined(WIN32) + moo->ShowModal(); +#else moo->Popup(); - +#endif + } void XCCalendarManipulator::ChangeGrid(wxCommandEvent &event){ diff --git a/source/widgets/XCCalendarManipulator.h b/source/widgets/XCCalendarManipulator.h index a06c726..8f46398 100644 --- a/source/widgets/XCCalendarManipulator.h +++ b/source/widgets/XCCalendarManipulator.h @@ -27,7 +27,11 @@ #include #include "events.h" +#if defined(WIN32) +#include "../forms/calendarselectmonth/frmCalendarSelectMonth.h" +#else #include "XCCalendarMonthSelect.h" +#endif #include "XCCalendarList.h" #include "../bitmaps.h" #include "../libraries/CalendarDataStorage/CalendarDataStorage.h" @@ -43,7 +47,11 @@ class XCCalendarManipulator: public wxPanel wxButton *nextButton = nullptr; wxButton *calendarsButton = nullptr; wxButton *dateButton = nullptr; +#if defined(WIN32) + frmCalendarSelectMonth *moo = nullptr; +#else XCCalendarMonthSelect *moo = nullptr; +#endif XCCalendarList *calendarList = nullptr; CalendarDataStorage *dataStorage = nullptr; int month = 0; -- 2.39.2