Commit graph

76239 commits

Author SHA1 Message Date
Maarten Bent
c72f4efc9c Fix crash when closing a wxColourDialog under MSW
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.
2024-02-06 19:07:46 +01:00
Vadim Zeitlin
be5fa77839 Reuse wxButton::GetDefaultSize() instead of duplicating it
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.
2024-02-05 19:05:02 +01:00
Vadim Zeitlin
57b408ed88 Fix wxButton::GetDefaultSize() in high DPI under MSW
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.
2024-02-05 19:04:52 +01:00
Maarten Bent
e41fd2052c
CMake: Mention that CMake 3.5 is the minimum version
Generating project files has been confirmed to work with this version.
2024-02-04 18:11:10 +01:00
Maarten Bent
f0061b3c04
CMake: Only keep unicode definitions on Windows 2024-02-04 18:03:06 +01:00
Maarten Bent
f0d2d0e748
CMake: Prevent possible policy warnings 2024-02-04 18:01:36 +01:00
Vadim Zeitlin
f6a1b1a18a Show loading wxPropertyGrid from XRC in the sample
Demonstrate defining wxPropertyGridManager in XRC.
2024-02-03 22:03:17 +01:00
Vadim Zeitlin
36583f13e1 Merge branch 'fix-vlistbox-out-of-range' of https://github.com/wsu-cb/wxWidgets
Prevent scrolling beyond specified range.

See #24278.
2024-02-03 21:54:40 +01:00
Vadim Zeitlin
42839def49 Merge branch 'fix_webkit_tests'
Fix WebView tests with WebKitGTK 2.43+.

See #24276.
2024-02-03 21:54:05 +01:00
Vadim Zeitlin
e20a994b1f Merge branch 'really-fix-cleanup'
Really fix logging during app cleanup.

See #24272.
2024-02-03 21:53:24 +01:00
Vadim Zeitlin
dba79a2d67 Merge branch 'avoid-impl-string-conv-logstatus'
Avoid implicit string conversions when using wxLog functions.

See #24271.
2024-02-03 21:52:27 +01:00
Vadim Zeitlin
edf94f684c Remove dependency on wxxml and wxxrc from wxpropgrid library
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.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
52c60628fa Don't use wxXmlNode directly in wxPropertyGridXmlHandler
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.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
fe599e4757 Add wxXmlResourceHandler::GetNodeAttribute()
Add another helper function that can be used in XRC handlers without
using wxXmlNode directly.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
921018cfc8 Add wxXmlResourceHandler::GetNodeName()
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.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
9ab62c02fd Make wxXmlResourceHandlerImpl::GetNodeContent() const
There doesn't seem to be any reason not to and it's more consistent with
the other similar functions.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
f943635da8 Reuse wxXmlNode::GetNodeContent() in wxXmlResourceHandlerImpl
Don't duplicate wxXmlNode function logic but just call it instead.

This shouldn't result in any changes.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
9550c37e29 Support inherited attributes in wxPropertyGrid XRC handler
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.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
0ddbf965c9 Get rid of unnecessary "emptyString" when calling GetAttribute()
This is just extra noise, so remove it.

No real changes.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
f513c08876 Add DLL export declaration to wxPropertyGridXmlHandler 2024-02-03 21:46:15 +01:00
Vadim Zeitlin
65715453e7 Add minimal support for wxPropertyGrid to the XRC schema
This is too lax and might also not cover everything but it better than
nothing.
2024-02-03 21:46:15 +01:00
Vadim Zeitlin
8c586b6ff5 Add minimal documentation of wxPropertyGrid XRC format
Not everything is documented yet, mostly because it's not really easy to
find out what "everything" actually is.
2024-02-03 21:46:15 +01:00
Bill Su
95054f3d4a wxVListBox: fix Page Down being unable to reach last item 2024-02-03 00:21:49 -05:00
Vadim Zeitlin
9c33be4f5e Use a helper lambda for naming history menu items
Shorten the code a bit more.

No real changes.
2024-02-02 18:01:24 +01:00
Vadim Zeitlin
44bc26f087 Use range-for loops for iterating over wxWebViewHistoryItems
No real changes, just simplify the code a bit.
2024-02-02 17:59:01 +01:00
Bill Su
66dfd0ae89 prevent scrolling beyond specified range
Fix #24277
2024-02-02 00:41:10 -05:00
Scott Talbert
3ef1aee986 Fix WebView sample when there are blank title pages in history
Otherwise, the wxMenu code asserts due to an empty item.
2024-02-01 20:56:36 -05:00
Scott Talbert
1622a5c9c2 Fix WebView tests with WebKitGTK 2.43+
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
2024-02-01 20:56:32 -05:00
Vadim Zeitlin
a01c870dbb Don't let exceptions escape from events handled during idle time
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.
2024-01-31 04:08:26 +01:00
Vadim Zeitlin
509fcb0214 Avoid resetting wxTheApp too early while still avoiding crashes
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.
2024-01-30 21:10:41 +01:00
Vadim Zeitlin
a7aea0febf Do common wxApp cleanup before port-specific part in all ports
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.
2024-01-30 21:07:29 +01:00
Vadim Zeitlin
c965c87290 wxX11: don't call CleanUp() from wxApp::Exit()
This is not done in any other ports and shouldn't be necessary in this
one neither, CleanUp() will be called from wxEntryCleanup() later
anyhow.
2024-01-30 20:36:41 +01:00
Vadim Zeitlin
6636a2ac9e Fix recent regression with destroying wxDataViewCtrl on app exit
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.
2024-01-30 20:15:02 +01:00
Vadim Zeitlin
fb8d7b7de0 Take C string in wxLogger::MaybeStore() to simplify
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().
2024-01-30 18:47:06 +01:00
Vadim Zeitlin
10f235b43c Avoid implicit wxString conversions in wxLog{Status,SysError}()
They don't compile when wxNO_IMPLICIT_WXSTRING_ENCODING is defined.

Closes #24267.
2024-01-30 18:45:13 +01:00
Vadim Zeitlin
29c64c0c1e Parse "virtualwidth" as dimension, not a simple number
This allows to scale it properly depending on DPI and also to express it
in dialog units.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
336a36e618 Initialize wxPropertyGridXmlHandler members in declaration
Ensure that m_pg is initialized to nullptr too.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
7a392a6623 Use more clear assert message for unreachable code 2024-01-30 01:55:56 +01:00
Vadim Zeitlin
9fe386277b Use nullptr instead of NULL
No real changes.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
e9b799270b More minor code simplifications
Remove unnecessary variable and macro.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
208640870b Don't use wxPropertyGridPageState::DoSetSplitterPosition()
It is deprecated, so call DoSetSplitter() directly instead.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
b0e3cf83c9 Remove unnecessary wxXML_GetAttribute() macro
Just use wxXmlNode::GetAttribute() directly.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
8175e6990d Remove obsolete comments and preprocessor directives
No real changes, just some more cleanup.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
97762f854d Use forward declarations in wx/xrc/xh_propgrid.h
Only include the headers where they're really needed.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
d8d1fe2920 Use consistent name for the header guard
No real changes.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
cb36cb5e53 Add wxUSE_PROPGRID checks around wxPropertyGridXmlHandler
This is needed now that it's part of wx where it won't be always
compiled in.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
a5b9e6d3e7 Minimal changes to make wxPropertyGridXmlHandler compile again
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.
2024-01-30 01:55:56 +01:00
Vadim Zeitlin
8694a1b2f1 Add wxPropertyGrid XRC handler files to the library 2024-01-30 01:55:56 +01:00
Vadim Zeitlin
194acf347f Add original wxPropertyGridXmlHandler code
This code was included in wxPropertyGrid standalone library before it
had been included in wxWidgets itself.

It doesn't compile yet, but will soon.
2024-01-30 01:55:14 +01:00
Vadim Zeitlin
a228377b7d Don't make propgrid sample so big on startup
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.
2024-01-30 01:55:14 +01:00