Remove WXDLLEXPORT from the internal classes used only inside the
implementation.
Also remove forward declarations of classes not used in the header from
it.
Additionally implement wxWebViewEdge::GetUserAgent() via SDK.
This functionality is available with the slightly newer
WebView2 SDK required by previous changes.
See #23225.
This function replaces the existing GetSystemLocale() as it can
represent the locales that don't have any corresponding wxLanguage
values and for which GetSystemLocale() has no choice but to return
wxLANGUAGE_UNKNOWN.
Including that header breaks any use of placement new, such as the one
in wx/any.h, so we need to explicitly undefine (and then redefine it
back) "new" to make it compile in case wx/msw/msvcrt.h is included
first.
This is slightly more efficient as it avoids allocating an object which
is possibly not ever going to be used on startup of any application
linking with the propgrid library (at the price of slower access to this
object, but this should never be done in performance-critical parts of
the code, hopefully) and avoids a problem with losing the previously
registered editors when re-initializing wx modules, as wxPython does.
Closes#23165.
See #23187.
This is consistent with the native GTK and macOS dialogs and it makes
sense to try be more consistent with them, as the generic version is
used as a fallback under Mac.
Also use a smaller font for the copyright as is customary.
This resulted in its base class wxNavigationEnabled<wxBookCtrlBase>
being instantiated both in the application itself (when using it
directly) and inside the wx DLLs (when using another class using the
same base class, but defined in the DLL, such as wxAuiNotebook) and gave
linking errors.
Work around this by explicitly defining wxCompositeBookCtrlBase,
corresponding to this base class, ourselves and export it from the DLL
so that it's the single instance which is always used.
Closes#22805.
This is a generalization of the existing "platform" attribute and allows
to only include some XRC elements if and only if an arbitrary "feature"
is enabled by the application before loading the XRC document.
This avoids some spurious -Wmaybe_unitialized warning when using
`std::optional<wxString>` with gcc and is also generally better practice
as it ensures that the fields are always initialized correctly.
Closes#23167.
This allows to avoid including <memory> from the public header as user
code shouldn't pay for including the headers used only in wxXmlResource
implementation.
No real changes.
They were not used anyhow and could conflict with the other packages
defining them.
We also don't need to update the version in this file now.
See #23162.
This architecture doesn't exist and is not supported since a very long
time, so stop testing for it and defining __ALPHA__ which was never used
anyhow.
It may still be supported for wxGTK, but we don't need to do anything
special for it, so we don't need to define __POWERPC__, which was never
used anyhow, neither.
Avoid the warning and actually behave correctly when
WXWIN_COMPATIBILITY_3_2==0 by replacing the wrong "#ifdef" added in
c216744f78 (Deprecate MSW-specific wxRadioBox::Set{Label,Button}Font(),
2022-12-24) with the correct "#if".
Closes#23161.
This could be a noticeable optimization as it should be much more
efficient to store many lines in a single block of memory instead of
using pointers to them and it also simplifies the code as we don't need
to delete the pointers any more.
Don't manage the pointer lifetime manually but use a smart pointer for
it: this is simpler and allows to make this class default-movable.
Also make it non-copyable as it never actually was (copying it would
have resulted in a double free of the owned pointer).
This simplifies the code and avoids unnecessary heap allocations as we
can store the objects in the vectors directly instead of storing
pointers to them.
This class contains (sometimes) owned pointers and so can't be copied
but it can be moved, so make it moveable.
No real changes, this is done in preparation for storing objects of this
type in a std::vector.
Get rid of Init() function and just initialize all the members in their
declarations, as this is less verbose, more clear and more robust.
Note that we also initialize m_rect now, which was left uninitialized by
Init() before, as it's simpler and more reliable to always do even if we
happen to overwrite it in the ctor.
This not only simplifies the code but also makes it more efficient by
avoiding unnecessary heap allocations, as we can now just store the
objects themselves in the vector instead of storing pointers to them.
No real changes, this is just a code cleanup/modernization.
This macro was documented (in its comment) and even used with a
semicolon after it, but it didn't require one and using one after it
resulted in a warning with gcc in pedantic mode.
Change the macro definition to use wxSTATEMENT_MACRO_BEGIN/END to
require (and, trivially, also allow to be used without warnings) a
semicolon after it now.
This was broken by 0f6c54cdb6 (Define __WXFUNCTION__ as __func__ and
don't use it any more, 2022-11-11) which mistakenly removed the
inclusion of wx/cpp.h from here under the belief that it was only needed
for __WXFUNCTION__, as its comment indicated.
But this isn't really the case, so restore the removed #include and just
update its comment.
Update some comments and prefer using #if/#else when testing for
wxUSE_UNICODE_UTF8 and wxUSE_UNICODE_WCHAR rather than #if/#elif as
exactly one of them is always defined now. Similarly, test for
wxUSE_UNICODE_WCHAR directly instead of testing !wxUSE_UNICODE_UTF8 and
vice versa.
It could be nice to actually test for just a single one of these symbols
everywhere, but this would require a lot of noisy changes, so for now
keep the code as is.
No real changes, just simplify.