From d62c284f03cb03c2853ba0f13e4615eeafc182e0 Mon Sep 17 00:00:00 2001 From: Tim Stahlhut Date: Sun, 21 Oct 2018 21:58:56 -0400 Subject: [PATCH 1/8] Non PCH fix by adding include of "wx/wxcrtvararg.h" PCH: Precompiled Header The problem happens when wxUSE_SPINCTRL=0 --- src/generic/numdlgg.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp index 17c15f8788..0c0262384a 100644 --- a/src/generic/numdlgg.cpp +++ b/src/generic/numdlgg.cpp @@ -35,6 +35,7 @@ #include "wx/textctrl.h" #include "wx/intl.h" #include "wx/sizer.h" + #include "wx/wxcrtvararg.h" #endif #if wxUSE_STATLINE From 71a2fc0706eef9e20bc9e2e769d249f21b35a69e Mon Sep 17 00:00:00 2001 From: Tim Stahlhut Date: Sun, 21 Oct 2018 21:58:56 -0400 Subject: [PATCH 2/8] Forward declare wxQt template class --- include/wx/qt/window.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/wx/qt/window.h b/include/wx/qt/window.h index df402a42d4..3a07aed4c4 100644 --- a/include/wx/qt/window.h +++ b/include/wx/qt/window.h @@ -11,6 +11,9 @@ #include +class QShortcut; +template < class T > class QList; + class QWidget; class QScrollWindow; class QAbstractScrollArea; From caa6e5de2f7104930ec4ef2524779f389dfa8a3b Mon Sep 17 00:00:00 2001 From: Tim Stahlhut Date: Sun, 21 Oct 2018 21:58:56 -0400 Subject: [PATCH 3/8] Add message "wxStyledTextCtrl requires wxUSE_SCROLLBAR" --- include/wx/chkconf.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index 586680b307..82bb132b8a 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -2345,6 +2345,15 @@ # define wxUSE_STC 0 # endif # endif + +# if !wxUSE_SCROLLBAR +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxStyledTextCtrl requires wxUSE_SCROLLBAR" +# else +# undef wxUSE_STC +# define wxUSE_STC 0 +# endif +# endif #endif /* wxUSE_STC */ #if wxUSE_RICHTEXT From f1fa6d5ea25bed5870c7933176f2332205009f12 Mon Sep 17 00:00:00 2001 From: Tim Stahlhut Date: Sun, 21 Oct 2018 21:58:57 -0400 Subject: [PATCH 4/8] Add guard over wxMSWDateControls --- include/wx/msw/private/datecontrols.h | 2 ++ src/msw/datetimectrl.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/wx/msw/private/datecontrols.h b/include/wx/msw/private/datecontrols.h index 9794cfae89..b38723a40a 100644 --- a/include/wx/msw/private/datecontrols.h +++ b/include/wx/msw/private/datecontrols.h @@ -14,6 +14,7 @@ #include "wx/msw/wrapwin.h" +#if wxUSE_DATEPICKCTRL || wxUSE_CALENDARCTRL // namespace for the helper functions related to the date controls namespace wxMSWDateControls { @@ -24,6 +25,7 @@ namespace wxMSWDateControls extern bool CheckInitialization(); } // namespace wxMSWDateControls +#endif // wxUSE_DATEPICKCTRL || wxUSE_CALENDARCTRL #endif // _MSW_PRIVATE_DATECONTROLS_H_ diff --git a/src/msw/datetimectrl.cpp b/src/msw/datetimectrl.cpp index 18eed3d105..cbc65b42a2 100644 --- a/src/msw/datetimectrl.cpp +++ b/src/msw/datetimectrl.cpp @@ -62,8 +62,10 @@ wxDateTimePickerCtrl::MSWCreateDateTimePicker(wxWindow *parent, const wxValidator& validator, const wxString& name) { +#if wxUSE_DATEPICKCTRL || wxUSE_CALENDARCTRL if ( !wxMSWDateControls::CheckInitialization() ) return false; +#endif // wxUSE_DATEPICKCTRL || wxUSE_CALENDARCTRL // initialize the base class if ( !CreateControl(parent, id, pos, size, style, validator, name) ) From 93d71116b7d3805c72e8b4e48f6807f7b9b545a3 Mon Sep 17 00:00:00 2001 From: Tim Stahlhut Date: Sun, 21 Oct 2018 21:58:57 -0400 Subject: [PATCH 5/8] Change guard to wxUSE_TIMEPICKCTRL from wxUSE_DATEPICKCTRL --- src/msw/timectrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/timectrl.cpp b/src/msw/timectrl.cpp index 7469e12c3c..b5cad7fc9b 100644 --- a/src/msw/timectrl.cpp +++ b/src/msw/timectrl.cpp @@ -21,7 +21,7 @@ #pragma hdrstop #endif -#if wxUSE_DATEPICKCTRL +#if wxUSE_TIMEPICKCTRL #ifndef WX_PRECOMP #include "wx/msw/wrapcctl.h" From 09aa25ab4aaca0984419635852a8961c432445e0 Mon Sep 17 00:00:00 2001 From: Tim Stahlhut Date: Sun, 21 Oct 2018 21:58:57 -0400 Subject: [PATCH 6/8] Add wxUSE_SCROLLBAR guards in wxUniversal --- include/wx/univ/scrarrow.h | 2 ++ src/univ/scrarrow.cpp | 2 ++ src/univ/scrolbar.cpp | 4 ++-- src/univ/scrthumb.cpp | 2 ++ src/univ/winuniv.cpp | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/wx/univ/scrarrow.h b/include/wx/univ/scrarrow.h index 6e6997c687..5746c7607a 100644 --- a/include/wx/univ/scrarrow.h +++ b/include/wx/univ/scrarrow.h @@ -11,6 +11,7 @@ #ifndef _WX_UNIV_SCRARROW_H_ #define _WX_UNIV_SCRARROW_H_ +#if wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // wxScrollArrows is not a control but just a class containing the common // functionality of scroll arrows, whether part of scrollbars, spin ctrls or @@ -107,5 +108,6 @@ public: // false to stop it virtual bool OnArrow(wxScrollArrows::Arrow arrow) = 0; }; +#endif // wxUSE_SCROLLBAR #endif // _WX_UNIV_SCRARROW_H_ diff --git a/src/univ/scrarrow.cpp b/src/univ/scrarrow.cpp index a540046aea..f693b8bbff 100644 --- a/src/univ/scrarrow.cpp +++ b/src/univ/scrarrow.cpp @@ -33,6 +33,7 @@ #include "wx/univ/inphand.h" #include "wx/univ/theme.h" +#if wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // wxScrollArrowCaptureData: contains the data used while the arrow is being // pressed by the user @@ -298,3 +299,4 @@ bool wxScrollArrows::HandleMouse(const wxMouseEvent& event) const return true; } +#endif // wxUSE_SCROLLBAR diff --git a/src/univ/scrolbar.cpp b/src/univ/scrolbar.cpp index 61da0cf772..0f63eabd08 100644 --- a/src/univ/scrolbar.cpp +++ b/src/univ/scrolbar.cpp @@ -1153,7 +1153,7 @@ bool wxStdScrollBarInputHandler::HandleMouseMove(wxInputConsumer *consumer, #endif // wxUSE_SCROLLBAR -#if wxUSE_TIMER +#if wxUSE_TIMER && wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // wxScrollTimer @@ -1198,4 +1198,4 @@ void wxScrollTimer::Notify() } } -#endif // wxUSE_TIMER +#endif // wxUSE_TIMER && wxUSE_SCROLLBAR diff --git a/src/univ/scrthumb.cpp b/src/univ/scrthumb.cpp index 604c4044b5..33b7806d31 100644 --- a/src/univ/scrthumb.cpp +++ b/src/univ/scrthumb.cpp @@ -30,6 +30,7 @@ #include "wx/univ/scrtimer.h" #include "wx/univ/scrthumb.h" +#if wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // wxScrollThumbCaptureData: the struct used while dragging the scroll thumb // ---------------------------------------------------------------------------- @@ -290,3 +291,4 @@ int wxScrollThumb::GetThumbPos(const wxMouseEvent& event) const int x = GetMouseCoord(event) - m_captureData->m_ofsMouse; return m_control->PixelToThumbPos(x); } +#endif // wxUSE_SCROLLBAR diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index 553d9cb151..ac4b4bfc92 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -59,6 +59,7 @@ // implementation // ============================================================================ +#if wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- // scrollbars class // ---------------------------------------------------------------------------- @@ -80,6 +81,7 @@ public: virtual bool CanBeOutsideClientArea() const { return true; } }; +#endif // wxUSE_SCROLLBAR // ---------------------------------------------------------------------------- From a34bedd7b54933ebd279f28d2a7908647aec89fe Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 29 Oct 2018 23:12:57 +0100 Subject: [PATCH 7/8] Revert "Add guard over wxMSWDateControls" This reverts commit f1fa6d5ea25bed5870c7933176f2332205009f12 which doesn't seem correct nor necessary. --- include/wx/msw/private/datecontrols.h | 2 -- src/msw/datetimectrl.cpp | 2 -- 2 files changed, 4 deletions(-) diff --git a/include/wx/msw/private/datecontrols.h b/include/wx/msw/private/datecontrols.h index b38723a40a..9794cfae89 100644 --- a/include/wx/msw/private/datecontrols.h +++ b/include/wx/msw/private/datecontrols.h @@ -14,7 +14,6 @@ #include "wx/msw/wrapwin.h" -#if wxUSE_DATEPICKCTRL || wxUSE_CALENDARCTRL // namespace for the helper functions related to the date controls namespace wxMSWDateControls { @@ -25,7 +24,6 @@ namespace wxMSWDateControls extern bool CheckInitialization(); } // namespace wxMSWDateControls -#endif // wxUSE_DATEPICKCTRL || wxUSE_CALENDARCTRL #endif // _MSW_PRIVATE_DATECONTROLS_H_ diff --git a/src/msw/datetimectrl.cpp b/src/msw/datetimectrl.cpp index cbc65b42a2..18eed3d105 100644 --- a/src/msw/datetimectrl.cpp +++ b/src/msw/datetimectrl.cpp @@ -62,10 +62,8 @@ wxDateTimePickerCtrl::MSWCreateDateTimePicker(wxWindow *parent, const wxValidator& validator, const wxString& name) { -#if wxUSE_DATEPICKCTRL || wxUSE_CALENDARCTRL if ( !wxMSWDateControls::CheckInitialization() ) return false; -#endif // wxUSE_DATEPICKCTRL || wxUSE_CALENDARCTRL // initialize the base class if ( !CreateControl(parent, id, pos, size, style, validator, name) ) From 9d717a1204c4c779797a10a2cc9c3c6af341c9b5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 29 Oct 2018 23:14:30 +0100 Subject: [PATCH 8/8] Replace wxUSE_DATEPICKCTRL with wxUSE_TIMEPICKCTRL in #endif too Complete the change of 93d71116b7d3805c72e8b4e48f6807f7b9b545a3 --- src/msw/timectrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/timectrl.cpp b/src/msw/timectrl.cpp index b5cad7fc9b..e02af0d273 100644 --- a/src/msw/timectrl.cpp +++ b/src/msw/timectrl.cpp @@ -61,4 +61,4 @@ bool wxTimePickerCtrl::MSWOnDateTimeChange(const NMDATETIMECHANGE& dtch) wxDateEvent event(this, m_date, wxEVT_TIME_CHANGED); return HandleWindowEvent(event); } -#endif // wxUSE_DATEPICKCTRL +#endif // wxUSE_TIMEPICKCTRL