Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B
patch vs. compile-error wxPGFlags in trunk svn13676 with wxWidgets trunk
Miguel Gimenez:
Looks like wx3.3.1 is going out today, we can use wxCHECK_VERSION(3, 3, 1) if it includes the new wxPGFlags
EDIT: Do reinterpret_cast <FlagType>() or (FlagType) work?
blauzahn:
I can try reinterpret_cast in the evening.
As for wxCHECK_VERSION: I usually try to minimize the use of macros and conditional compiling.
stahta01:
Hand edited untested patch
--- Code: ------ trunk_20250716_vanilla/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp 2025-07-16 20:46:08.000000000 +0200
+++ trunk/src/plugins/contrib/wxSmith/wxwidgets/properties/wxscolourproperty.cpp 2025-07-16 21:39:08.141146237 +0200
@@ -205,7 +205,11 @@
else
cpv.Init( type, *wxWHITE );
+#if wxCHECK_VERSION(3, 1, 1)
+ m_flags |= static_cast<wxPGFlags>(wxPG_PROP_STATIC_CHOICES); // Colour selection cannot be changed.
+#else
m_flags |= wxPG_PROP_STATIC_CHOICES; // Colour selection cannot be changed.
+#endif // wxCHECK_VERSION
m_value << cpv;
OnSetValue();
}
@@ -583,7 +583,11 @@
int index = paintdata.m_choiceItem;
value = wxsColourValues[index];
}
+#if wxCHECK_VERSION(3, 1, 1)
+ else if ( !(m_flags & static_cast<wxPGFlags>(wxPG_PROP_UNSPECIFIED)) )
+#else
else if ( !(m_flags & (wxPGPropertyFlags)wxPG_PROP_UNSPECIFIED) )
+#endif // wxCHECK_VERSION
{
value = GetVal().m_type;
}
--- End code ---
Miguel Gimenez:
In the new wx3.3.1 wxPGPropertyFlags still exists, as long as compatibility with 3.2 is enabled.
While Vadz recommends setting it to 0, the default (at least on MSW) is 1 and IMHO it should be this way for a while.
gd_on:
I have compiled wxwidgets 3.3.1 with #define WXWIN_COMPATIBILITY_3_2 1, as it is still by default in wxWidgets' setup.h
Nevertheless, when buliding last svn C::B on Windows 11, I obtain compile errors in wxscolourproperty and the patch proposed by stahta01 solve these errors. Apparently, this setting to 3.2 compatibility is not sufficent.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version