From: Steve Brokenshire Date: Wed, 19 Jul 2017 21:50:16 +0000 (+0100) Subject: XCCalendarManipulator: Use frmCalendarSelectMonth instead of XCCalendarMonthSelect... X-Git-Tag: release-0.04~7 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=7644bfc35e0d53134b1dc98d98278ca1e73051e3;p=xestiacalendar%2F.git XCCalendarManipulator: Use frmCalendarSelectMonth instead of XCCalendarMonthSelect on Win32 systems --- 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;