By default, wxMSW overlay uses a constant alpha for the window's opacity which
can be changed by the added wxOverlay::SetOpacity() function. For some applications,
that's all they need. But for others, per-pixel alpha blending is a requirement.
This capability can be enabled by calling SetOpacity(-1) before initializing the
overlay. But the drawing must be done via a graphics context because the standard DC
under MSW does not support alpha drawing.
Also request that the overlay window be positioned below any floating windows
on the target (if any).
This used to be possible in 3.0 but was disallowed back in 29bf859fae
(Check if new index is in range before selecting new value in
wxPGProperty::SetChoiceSelection., 2014-11-29). However there doesn't
seem to be any real harm in still allowing to do this, so handle -1 as a
special case here.
Closes#24279.
Closes#24281.
Calling Hostname() when constructing wxIPV4address from an already
resolved IP address is unnecessary and can be slow, so don't do it and
just use the string representation of the IP address as "m_origHostname"
instead.
Closes#23109.
Closes#24269.
The only real change in this commit is the use of wxRound() instead of
truncating cast to int when rescaling icons.
The rest consists of just some cleanup:
- Initialize (mostly) pointer member variables in their declaration.
- Remove wxT() from strings.
- Replace checks for __WXMAC__ with checks for __WXOSX__.
- Replace macros with lambda functions.
- Add "explicit"
- Replace wxString::IsEmpty() with empty().
- Use wxNOT_FOUND instead of -1.
- Use static_cast<> instead of C-style casts.
Closes#24261.
The encoder may chose not to emit a CLEAR code when the alphabet is full
according to the specification, but wxGIFDecoder assumed it always did,
preventing it from reading some valid GIF files (in practice, most often
animated ones).
This commit is best viewed ignoring whitespace-only changes.
Closes#22799.
Closes#24234.
Check that ms_pfnSetThreadDpiAwarenessContext function pointer was
initialized before using it.
This fixes a regression introduced in 9befda5c26 (Only use
AutoSystemDpiAware when displays have different DPI, 2023-12-10).
See #24121, #24196.
Closes#24288.
Just reuse the existing function in IncreaseToStdSizeAndCache() helper
instead of using a separate and, until the parent commit, different, way
of computing the default button size here.
This will hopefully avoid introducing any discrepancies between the size
returned by GetDefaultSize() and the size actually used for the buttons
by default in the future.
See #24283.
Using button size in dialog units doesn't work well in high DPI, as it
gives sizes wildly different from those actually used by Windows itself
for the buttons (e.g. for those in Explorer dialogs still using Win32
API), so switch to using DIPs, just as it was done for determining the
initial size of the buttons when actually creating them in c6d2f6d9fe
(Really fix the standard button size in high DPI under MSW, 2019-10-19)
See #18528.
Closes#24283.
It shouldn't, and now doesn't, use these libraries directly and
shouldn't depend on them to avoid introducing unnecessary requirements
for the applications which use it without XRC.
Use wxXmlResourceHandler functions such as GetNodeContent(),
GetNodeName() and GetNodeAttribute() instead, which are defined in the
core library and so don't create a dependency on wxxrc.
This allows to get the name of the node which is needed for XRC handlers
using specific elements instead of using the object elements with
specific name attribute.
Allow specifying recurse="1" to inherit the attribute, as this is much
nicer than having to specify it for all the children.
Also add support for this to wxPropertyGridPopulator, which is used by
the XRC handler.
It seems that WebKitGTK is now failing to navigate to about: URLs unless
they are about:blank or about:srcdoc, so use about:srcdoc as the
alternate URL to fix the WebView tests.
Ref: 3c3163e71f
This resulted in immediate program termination, at least with wxGTK, if
an event handler called when dispatching pending events during idle time
threw an exception (which, in particular, covers all the exceptions
inside lambdas passed to CallAfter()).
Just catch and handle them as usual, i.e. as we do with the event
handlers called immediately in response to a user action.
Both recent changes trying to order resetting wxTheApp and flushing the
logs failed: 055c4cbed5 (Fix crash on shutdown if wxConfig couldn't be
saved, 2024-01-04) did because it reset wxTheApp too late and wxLogGui
was created when it was already unsafe to use, while b628237245 (Fix
crash due to using wxLog during shutdown in a better way, 2024-01-26)
failed because it reset wxTheApp too early, resulting in it being null
during execution of window destructors which could expect wxTheApp to
still be available.
And while 6636a2ac9e (Fix recent regression with destroying
wxDataViewCtrl on app exit, 2024-01-30) fixed one of the problems due to
the latter change, there are no guarantees that there are no more such
problems, especially in user-defined destructors in the application
code.
So instead of resetting wxTheApp before or after calling CleanUp(), now
do it in the middle of wxAppBase::CleanUp(): just after destroying all
the windows (and so executing any user-defined destructors) but before
the application object becomes truly unusable.
Note that this relies on the previous commit, as before it the
application became unusable even before wxAppBase::CleanUp() execution
started in some ports (notably wxGTK).
See #24252.
Some ports called wxAppBase::CleanUp() before performing port-specific
cleanup, while some did it afterwards. The former seems preferable, as
some actions performed in wxAppBase (such as showing log dialogs) may
not work any more after the port-specific cleanup is done, while there
should be no dependencies in the other direction.
So standardize on calling wxAppBase version first in all ports, which
also makes them more consistent with each other.
As mentioned in the commit message of b628237245 (Fix crash due to using
wxLog during shutdown in a better way, 2024-01-26), this change could
affect existing code using wxTheApp and it did affect wxDataViewCtrl and
not in a good way: destroying it during application shutdown started to
crash now that wxTheApp is null when it happens.
Fix this by skipping the idle time notification when shutting down, it's
not useful anyhow by then.