This prevents wxWebViewChromium from referencing debug-only functions
that are not defined in the release build of libcef_dll_wrapper.
Unfortunately, CEF build doesn't provide any way to detect if the
wrappers were built in debug or in release mode, so just assume the
latter and add --enable-cef-debug configure option to build with a debug
build of CEF wrapper if necessary.
Just include wxWebViewChromium in the webview library if it's enabled
during the build.
There doesn't seem to be any reason to build a separate library for it,
it's not really different from the other disabled by default wxWebView
backend (Edge).
And now that we don't need to link with an extra library, there is also
no need to have a separate webview_chromium sample, so just add a
possibility to run webview sample itself using Chromium backend by
setting WX_WEBVIEW_BACKEND environment variable.
wxWebViewChromium creation is asynchronous and the object can't be
really used until OnAfterCreated() is called, so expose this in the
public API via a new event sent when the object becomes actually usable.
As a side effect, add a convenient wxWebViewEvent ctor taking wxWebView
as argument and calling SetEventObject() itself, instead of forcing all
code creating wxWebViewEvents to do it.
Make browser creation actually work by postponing it until the host
window is realized and so has a valid X11 Window.
Remove unnecessary code manually creating GTK widget and just use the
standard wxGTK wxWindow instead.
Add code for setting the visual compatible with CEF to avoid X11 errors,
see https://github.com/chromiumembedded/cef/issues/3564, with many
thanks to Jiří Janoušek for finding and solving this problem originally.
Adjust the sample to handle wxWebView::Create() failure (not very
gracefully, but still better than just crashing) and to avoid using it
until it is fully created.
Update documentation to mention GTK limitations.
At least when using wxGTK Chromium helper process can't be executed once
GTK is initialized because doing this creates background threads and
Chromium code aborts if there are any threads running.
As we don't want to initialize CEF unconditionally before initializing
GTK in all applications (even those not using CEF), the only solution is
to detect if we need to run a Chromium helper process ourselves before
GTK initialization, i.e. before wxApp creation, which means that it
can't be done via the existing wxModule mechanism because modules are
initialized after creating the global application instance.
So add a way to hijack wxWidgets initialization entirely if some special
command line option (such as Chromium "--type=xxx") is specified and use
it in wxWebViewChromium to call CefExecuteProcess() before initializing
GTK or even wxWidgets itself -- as it won't be needed in a CEF helper
process anyhow.
This has the advantage of returning libraries in their load order, which
is more useful than the unspecified order that was used before.
It also means that this function now has a chance of working under other
systems such as FreeBSD, which also provides dl_iterate_phdr().
Add support for specifying multiple animations to allow automatically
showing a higher resolution version when using high DPI, just as it was
already possible with the bitmaps.
See #23817.
Allow specifying multiple animation versions, for different resolutions,
when setting the animation to use via wxAnimationBundle class which is a
much simpler version of wxBitmapBundle used elsewhere.
This is not implemented for the native GTK version yet.
Update the sample, even though the difference in it is not really
noticeable as the "high DPI" throbber is just a scaled up version of the
existing standard DPI animation produced using gifsicle.
Instead of always scaling the single bitmap passed to it, allow passing
wxBitmapBundle and select the bitmap most appropriate for the current
resolution from it.
Closes#23813.
The note in the method description incorrectly stated that
"...the handlers are deleted in wxFileSystem's destructor so
that you don't have to care about it." However, unless a
handler is removed by calling wxFileSystem::RemoveHandler()
(or undocumented wxFileSystem::CleanUpHandlers()), it is deleted
only when wxWidgets shuts down in wxFileSystemModule::OnExit().
Update the method documentation that it is correct (and similar to
that of wxImage::AddHandler()).
Closes#23789.
Add that anything using task dialog does not support dark mode.
Mention that most common dialogs do not support dark mode.
Mention that calling wxMenu::Break() will turn the menu light.
Closes#23769.
Complete changes of 5e7b08f9ea (Correct wxDC::GetContentScaleFactor()
documentation, 2023-04-13) to add the information about the version in
which the behaviour of this function changed, as it was already done in
the version of this commit cherry picked to 3.2 branch, i.e. 8094ed5795
(Correct wxDC::GetContentScaleFactor() documentation, 2023-04-13).
Closes#23748.
Newer standard library headers should only be included when the compiler
is targetting that standard, otherwise some compilers (like MSVC) will
warn that you are using a newer C++ include on an older version.
Previously it only inherited from wxTextEntryBase in the generic
implementation (used e.g. in wxMSW).
Update the code, documentation and add new unit tests checking that
wxSearchCtrl member functions inherited from wxTextEntry behave
correctly.
Closes#23686.
Closes#23697.
Create hidden radio button in wxGTK when using wxRB_SINGLE, as
this lets us deactivate the shown button by activating the hidden one.
GTK does not allow deactivating radio buttons by calling them with
gtk_toggle_button_set_active( ..., FALSE), so we need to work around
it like this.
Also update the documentation to mention that this works in wxGTK now.
See #17022.
Closes#23652.
Closes#23677.
This function should be used to get the parent for the custom controls
instead of relying on them being reparented under it by the code added
in the last commit.
Change the type of m_contents to be wxWindow and not wxPanel as it
doesn't really matter, but wxPanel is not fully declared in this header
while wxWindow is.
The documentation used to warn that wxXXX_BOX styles were ignored unless
wxCAPTION was also specified, but this was actually wrong, at least for
wxOSX, which instead enabled wxCAPTION too if any of the BOX flags was
given.
And this behaviour seems more useful, as it's not really obvious why the
boxes are not shown otherwise, so make wxMSW behave like this too and
update the documentation.
Fall back to old style file dialogs in this case, as IFileDialog just
doesn't seem to support this COM threading model, as hinted at in
SHBrowseForFolder() documentation.
Also document this limitation.
Closes#23578.
Implement wxUILocale::GetMonthName() and wxUILocale::GetWeekDayName() in
wxMSW, wxGTK, and wxOSX.
Also extend the existing wxDateTime methods to support a 3rd month and
weekday name representation (Name_Shortest) and a usage context
(Context_Formatting and Context_Standalone).
These changes make wxDateTime methods for getting the localized date and
month names use the current UI locale, as set by wxUILocale, instead of
the current C locale set by the standard C library function, which is a
change in behaviour but a desired one and notably fixes the display of
the months in generic calendar control in wxOSX where the current C
locale is not changed when the UI locale is set.
Replaces #23551.
Closes#23191.