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.
We don't need to take wxString here, when we only ever call this
function ourselves with ASCII strings only.
This should result in slightly shorter generated code too, as the
conversion from C string to wxString now happens only in a single place
inside MaybeStore() instead of being done in all places calling
wxLogSysError() or wxLogStatus().
Just rename wxPropertyGridState to wxPropertyGridPageState and add make
wxPropertyGridXmlHandler a friend of this class to allow it to use its
protected methods.
Also remove some preprocessor checks for non-existent symbols.
This doesn't look great and also doesn't work correctly in high DPI.
Instead of trying to fix it, just hard code the size of the main frame
and also apply FromDIP() to the size of the child frame.