Commit graph

76269 commits

Author SHA1 Message Date
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
Vadim Zeitlin
99eca07ac5 Some minor spelling fixes in wxPropertyGrid documentation
Also fix a couple of things in the actual header for consistency with
the same fixes done in the documentation.

No real changes.
2024-01-30 01:55:14 +01:00
Vadim Zeitlin
3ca2594c3a Rename m_pSampleMultiButtonEditor in propgrid sample too
Similar to the previous commit, just rename a member variable to avoid
using "p" prefix for it which was inconsistent with the other variables
in the same class.
2024-01-30 01:55:14 +01:00
Vadim Zeitlin
5b064c0fde Avoid using Hungarian notation in propgrid sample
Rename m_pPropGridManager to just m_propGridManager for consistency with
the existing m_propGrid.
2024-01-30 01:55:14 +01:00
Vadim Zeitlin
cb852632e2 Remove local copies of m_pPropGridManager in propgrid sample
This made the code more difficult to understand as some functions were
called on m_pPropGridManager and other on pgman which referred to the
same object.

No real changes.
2024-01-30 01:55:14 +01:00
Vadim Zeitlin
cfb321b175 Merge branch 'dylib-rpath'
Set rpath for wx libraries themselves too and not just the samples.

See #24265.
2024-01-30 01:54:24 +01:00
Bill Su
74f88f9131 Add wxRadioButton group support to wxGenericValidator
Enable wxGenericValidator(int*) to work with wxRadioButton groups
when applied to the first element of the group.  The value will be
the index of the selected button within the group.

Closes #24264.
2024-01-30 01:52:59 +01:00
Vadim Zeitlin
ab0865f991 Also set rpath under FreeBSD
They seem to support it since a very long time, so there should be no
problems with doing it there too.
2024-01-29 01:52:14 +01:00
Vadim Zeitlin
0352fe1fbd Don't set LD_LIBRARY_PATH for CI workflows
This shouldn't be necessary any longer, after the fix in the grandparent
commit.
2024-01-29 01:20:52 +01:00
Vadim Zeitlin
3de719d68c Don't set LD_LIBRARY_PATH in Mac CI workflow unnecessarily
This variable is not used under macOS anyhow.
2024-01-29 01:20:12 +01:00
Vadim Zeitlin
63bcac8c21 Use -rpath option when linking all the libraries too
Previously this was used only for linking the samples, which ensured
that they found the libraries directly referenced by them, but this
wasn't enough to find the libraries referenced indirectly, via another
library (e.g. wxxml used by wxxrc internally but not necessarily
referenced by the sample using XRC) because DT_RUNPATH is not used in
this case, as documented in Linux ld.so(8).

Ensure that such libraries are found nevertheless by setting runpath
for all the libraries too.

Note that it would probably be more logical to just get rid of
SAMPLES_RPATH_FLAG and use DYLIB_RPATH_FLAG everywhere, but this would
result in a ton of changes, so keep the old variable for now and just
set it to the same value to avoid this and keep the possibility to
change it to a different value if necessary later.
2024-01-29 01:15:40 +01:00
oneeyeman1
91de9867ee Add wxStandardPaths::GetSharedLibrariesDir()
This function returns the directory with the application's shared
libraries, which is different from the plugins directory under Mac.

Closes #24052.
2024-01-28 18:41:20 +01:00
Maarten Bent
17b0033fc9
CMake: Update script for minimal sample
Update the minimum CMake version, to get rid of deprecation warning.
Remove wxWidgets_USE_FILE, this is not defined in CONFIG mode.
Link with the wxWidgets::wxWidgets target.
Use the manifest from wx.rc instead of the default MSVC manifest.
2024-01-28 18:37:42 +01:00
Maarten Bent
e2302a834e
CMake: Use IN_LIST operator instead of list(FIND ) 2024-01-28 18:37:36 +01:00
Maarten Bent
395a61fc9a
CMake: Use user-provided CMAKE_CXX_STANDARD
wxBUILD_CXX_STANDARD is initialized with CMAKE_CXX_STANDARD. But if the user changes
the value of CMAKE_CXX_STANDARD, it would keep using the old wxBUILD_CXX_STANDARD value.
2024-01-28 18:35:04 +01:00
Maarten Bent
57ed33978d
CMake: Group compiler-default checks into a function 2024-01-28 18:32:02 +01:00
Maarten Bent
8aad6ba37a
CMake: Abort if Chromium is enabled on Windows with unsupported compiler
The user has explicitly enabled chromium, so we shouldn't continue without it.
2024-01-28 18:31:35 +01:00
Maarten Bent
cf04523ece
CMake: Show wxWebview overview in configuration summary
Show a list of all the back-ends that are available, similar to what configure does.
Make sure to disable wxUSE_WEBVIEW_WEBKIT when it is not used.
2024-01-28 18:31:17 +01:00
Maarten Bent
302ad5f7cd
CMake: Check for OpenGL in imported target
The gl target uses OpenGL libraries, so these must be defined.
Previously, the user has to do this before importing the wxWidget target.
2024-01-28 18:30:33 +01:00
Maarten Bent
a63ba1cc04
CMake: Create wxWidgets::wxWidgets imported target
Use the same name as the target from the official FindwxWidgets module,
so it can be used interchangeable.
2024-01-28 18:27:46 +01:00
Maarten Bent
966c39802e
CMake: Throw a more descriptive error when submodule files do not exist
Instead of having a long list of files that cannot be found, create an
error message that mentions that the git submodule should be checked out.
2024-01-28 18:26:25 +01:00