diff --git a/include/wx/defs.h b/include/wx/defs.h index 3322d7c5cf..f49ab60f29 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -1937,17 +1937,9 @@ enum wxStandardID /* wxWindowID type */ /* ---------------------------------------------------------------------------- */ -/* - * wxWindowID used to be just a typedef defined here, now it's a class, but we - * still continue to define it here for compatibility, so that the code using - * it continues to compile even if it includes just wx/defs.h. - * - * Notice that wx/windowid.h can only be included after wxID_XYZ definitions - * (as it uses them). - */ -#if defined(__cplusplus) && wxUSE_GUI - #include "wx/windowid.h" -#endif +/* Note that this is defined even in non-GUI code as the same type is also used + for e.g. timer IDs. */ +typedef int wxWindowID; /* ---------------------------------------------------------------------------- */ /* other constants */ diff --git a/include/wx/menuitem.h b/include/wx/menuitem.h index 29f63eec7d..8c1d2c68e2 100644 --- a/include/wx/menuitem.h +++ b/include/wx/menuitem.h @@ -21,6 +21,8 @@ #include "wx/object.h" // base class +#include "wx/windowid.h" + // ---------------------------------------------------------------------------- // forward declarations // ---------------------------------------------------------------------------- diff --git a/include/wx/utils.h b/include/wx/utils.h index dbb87cd0aa..4588479e98 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -20,7 +20,6 @@ #include "wx/filefn.h" #include "wx/hashmap.h" #include "wx/versioninfo.h" -#include "wx/windowid.h" #include "wx/meta/implicitconversion.h" #if wxUSE_GUI diff --git a/include/wx/window.h b/include/wx/window.h index 814e9487ad..e574fe9df2 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -27,6 +27,7 @@ #include "wx/intl.h" #include "wx/validate.h" // for wxDefaultValidator (always include it) +#include "wx/windowid.h" #if wxUSE_PALETTE #include "wx/palette.h" diff --git a/include/wx/windowid.h b/include/wx/windowid.h index 0c174b5f0c..a6618b6188 100644 --- a/include/wx/windowid.h +++ b/include/wx/windowid.h @@ -10,9 +10,7 @@ #ifndef _WX_WINDOWID_H_ #define _WX_WINDOWID_H_ -// NB: do not include defs.h as we are included from it - -typedef int wxWindowID; +#include "wx/defs.h" // ---------------------------------------------------------------------------- // wxWindowIDRef: reference counted id value diff --git a/src/common/windowid.cpp b/src/common/windowid.cpp index 20a0efbe20..547ff7fc46 100644 --- a/src/common/windowid.cpp +++ b/src/common/windowid.cpp @@ -22,9 +22,7 @@ #endif //WX_PRECOMP #include "wx/hashmap.h" - -// Not needed, included in defs.h -// #include "wx/windowid.h" +#include "wx/windowid.h" namespace {