Commit graph

76239 commits

Author SHA1 Message Date
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
Maarten Bent
590e033344
CMake: Keep UNICODE defines
So these defines are exported and used by libraries importing wxWidgets.
And also Visual Studio will show the actual character set that is being used.
2024-01-28 18:24:29 +01:00
Maarten Bent
db7f144c1b
CMake: Use simplified system name in configuration summary
There is no need to show the full system name, which included for example the Windows build number.
2024-01-28 18:23:04 +01:00
Maarten Bent
de6a117fda
CMake: Silence the CEF configuration summary
And any other warnings that libcef_dll_wrapper might show, like missing doxygen package.
For debug purposes, add an option CEF_SHOW_RESULTS to keep showing it.
2024-01-28 18:22:09 +01:00
Maarten Bent
c39d2243a0
CMake: Use CEF_RUNTIME_LIBRARY_FLAG
Instead of manually modifying the build flags.
Because libcef_dll_wrapper uses a cached variable, we have to force a cache change.
2024-01-28 18:20:32 +01:00
Maarten Bent
cd7e6308cd
CMake: Generalize determining platform name
It is the same as CMAKE_VS_PLATFORM_NAME. Except for win32, which uses an empty name.
2024-01-28 18:19:20 +01:00
Vadim Zeitlin
f82ccc1a19 Merge branch 'image_crash' of https://github.com/Randalphwa/wxWidgets
Don't crash in wxImage::InitAlpha() if it's called on an empty image
and avoid calling it in this case.

See #24260.
2024-01-28 18:18:14 +01:00
Scott Talbert
fc35ad92bb Remove unnecessary empty destructors
These cause a problem for GCC 14 which detects that there are no
corresponding copy constructors and assignment operators and gives
-Wdeprecated-copy-dtor due to their presence, e.g.

/home/fedora/swt2c/wxWidgets/bld/bk-deps g++ -c -o test_allheaders_allheaders.o  -I/home/fedora/swt2c/wxWidgets/bld/lib/wx/include/gtk3-unicode-3.3 -I../../include -D_FILE_OFFSET_BITS=64 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/webp -I/usr/include/blkid -I/usr/include/at-spi-2.0 -I/usr/include/gio-unix-2.0 -I/usr/include/libmount -I/usr/include/pixman-1 -I/usr/include/libxml2 -I/usr/include/fribidi -I/usr/include/sysprof-6 -pthread -I/usr/include/libpng16 -DWITH_GZFILEOP  -D__WXGTK__      -I../../tests -DWXUSINGDLL -I../../tests/../samples -I../../3rdparty/catch/single_include -pthread -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -O2 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libmount -I/usr/include/libxml2 -I/usr/include/sysprof-6 -I/usr/include/libpng16 -DWITH_GZFILEOP -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/webp -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/cloudproviders -I/usr/include/at-spi-2.0 -I/usr/include/gio-unix-2.0  -fvisibility=hidden -fvisibility-inlines-hidden -fPIC -DPIC   ../../tests/allheaders.cpp
In file included from ../../include/wx/evtloop.h:13,
                 from ../../tests/testprec.h:5,
                 from ../../tests/allheaders.cpp:369:
../../include/wx/event.h: In copy constructor ‘wxSetCursorEvent::wxSetCursorEvent(const wxSetCursorEvent&)’:
../../include/wx/event.h:1943:11: error: implicitly-declared ‘wxCursor::wxCursor(const wxCursor&)’ is deprecated [-Werror=deprecated-copy-dtor]
 1943 |           m_cursor(event.m_cursor)
      |           ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../include/wx/cursor.h:51,
                 from ../../include/wx/event.h:21:
../../include/wx/gtk/cursor.h:37:13: note: because ‘wxCursor’ has user-provided ‘virtual wxCursor::~wxCursor()’
   37 |     virtual ~wxCursor();
      |             ^
../../include/wx/event.h: In member function ‘void wxSetCursorEvent::SetCursor(const wxCursor&)’:
../../include/wx/event.h:1949:57: error: implicitly-declared ‘wxCursor& wxCursor::operator=(const wxCursor&)’ is deprecated [-Werror=deprecated-copy-dtor]
 1949 |     void SetCursor(const wxCursor& cursor) { m_cursor = cursor; }
      |                                                         ^~~~~~
../../include/wx/gtk/cursor.h:37:13: note: because ‘wxCursor’ has user-provided ‘virtual wxCursor::~wxCursor()’
   37 |     virtual ~wxCursor();
      |             ^

Fixes #24248.

Closes #24255.
2024-01-28 18:16:07 +01:00
Vadim Zeitlin
50e35c71eb Fix using Alt under MSW when wxGrid has focus
Stop consuming all wxEVT_KEY_UP events in wxGrid as this broke the
standard keyboard handling: pressing and releasing "Alt" didn't give
focus to the menu bar when wxGrid had it.

This also seems completely unnecessary.

Closes #24246.

See #24247.
2024-01-28 18:09:10 +01:00
Blake-Madden
d495c50637 Replace 16-bit code in MSW wxGetUserName() with use of netapi32
Uses NetAPIXXX functions now instead of GetProfileString().

Also update the documentation.

Closes #24242.
2024-01-28 18:05:38 +01:00
taler21
28ced1bc33 Make checks on character entry in numeric validators less relaxed
Restrict the input to not allow values that are greater than the
positive maximum or less than the negative minimum.
In many cases it is not necessary to allow invalid characters to be
entered. For example, if the specified range is 0 to 100.

See #24220.
2024-01-28 18:02:13 +01:00
Vadim Zeitlin
3dad98e06d Merge branch 'tab-key-category'
Exclude Ctrl+I from "TAB" key category and Ctrl+H from the "cut" one.

See #24258.
2024-01-28 17:32:54 +01:00
Vadim Zeitlin
5bb2cb43d1 Restore wxAuiToolBar::RealizeHelper(bool) for compatibility
This function was replaced with a more useful function taking
wxOrientation and returning wxSize in bbba3b7cb9 (Make
wxAuiToolBar::RealizeHelper() return value actually useful, 2023-12-25)
but there is some existing code using the old RealizeHelper() from its
overridden Realize(), so restore it for compatibility, even if it's
quite useless now.

See #24023, #24164, #24244.
2024-01-28 17:32:32 +01:00
Vadim Zeitlin
cc9f9af400 Flush wxLogGui before showing a modal dialog
This ensures that any messages passed to wxLogError() or other functions
are shown before wxMessageBox() that could be referring to them instead
of it happening while the message box is shown (most ports, including
wxGTK) or only after it is dismissed (wxMSW).

See #24231.

Closes #24228.
2024-01-28 17:31:38 +01:00
Vadim Zeitlin
b628237245 Fix crash due to using wxLog during shutdown in a better way
This commit reverts 055c4cbed5 (Fix crash on shutdown if wxConfig
couldn't be saved, 2024-01-04) and implements an alternative solution
mentioned in that commit log message by setting wxTheApp to null pointer
before calling CleanUp().

This ensures that wxLog creates wxLogOutputBest if necessary instead of
recreating wxLogGui which can't be safely used once the cleanup starts:
under MSW the dialog used by it can't be shown once the GUI objects are
destroyed, so logging from CleanUp() still resulted in crashes under
this platform, even after the previous fix.

This change might affect some existing code using wxTheApp during
shutdown but it seems like the only really safe thing to do.

See #24252.
2024-01-28 17:30:52 +01:00
Randalphwa
0255d8dded Switch to wxCHECK_RET instead of silent return 2024-01-27 15:01:17 -08:00
Randalphwa
aa29faed81 GetImageListBitmaps() -- don't modify if invalid
If the bitmap is empty or invalid, there is no reason to attempt to add a mask,
alpha channel, etc.
2024-01-27 11:53:33 -08:00
Randalphwa
994bc961e7 InitAlpha() --avoid crash if empty/invalid 2024-01-27 11:53:33 -08:00
Vadim Zeitlin
dc55e4fe11 Suppress ASAN report about memory leaks in g_quark_init()
This is a one off allocation which won't be fixed by glib maintainers
(see https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2135 and
https://discourse.gnome.org/t/feature-request-enable-compilation-without-memory-leaks/6960
etc).
2024-01-27 19:06:56 +01:00
Vadim Zeitlin
460c35ff0e Return false from wxKeyEvent::IsKeyInCategory(WXK_TAB) for Ctrl+I
Although TAB and Ctrl+I generate the same key code in the events passed
to wxEVT_CHAR handlers, it seems more reasonable to only consider the
former to be in "TAB category", but not the latter.

See #10268.

Closes #24254.
2024-01-27 17:56:21 +01:00
Vadim Zeitlin
6053381b34 Make keyboard sample window bigger on high DPI screens
Add missing FromDIP() when using hard-coded size.
2024-01-27 17:56:21 +01:00
Vadim Zeitlin
29caef7a5a Show pressed key category in the "keyboard" sample
Make it simple to check what does IsKeyInCategory() return for the
various keys.
2024-01-27 17:05:10 +01:00
Vadim Zeitlin
ac3cea5bcd Update FreeBSD 13 image name for Cirrus CI
13.0 doesn't seem to be available any longer, so switch to 13.2.
2024-01-24 17:46:21 +01:00
Vadim Zeitlin
5e1890c068 Merge branch 'cef-docs'
CEF-related documentation and build improvements.

See #24230.
2024-01-24 17:44:01 +01:00
Vadim Zeitlin
f265775527 Use C++17 for MSVS wxWebView project
webview_chromium.cpp requires using C++17 as it includes CEF headers
that require it (e.g. they use std::in_place) and we need to use the
same options all files in this project as they share the same PCH, so
just use C++17 for all of them -- it should do no harm.
2024-01-24 00:14:03 +01:00
Vadim Zeitlin
f05177db2a Improve CMake error message if C++17 is not used with CEF
The previous error didn't make sense if CMAKE_CXX_STANDARD wasn't set,
so use a slightly different message in this case.

Also improve the comment explaining why we need C++17 in the first
place.

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
2024-01-24 00:08:04 +01:00
Vadim Zeitlin
fca0c75b2e Don't give an error if compiler supports C++17 by default
Previously CMake would give an error if CMAKE_CXX_STANDARD wasn't
explicitly set to C++17 or greater when using CEF, but this is not
really needed if the compiler supports C++17 without any non-default
options, so check for this too.
2024-01-23 03:45:59 +01:00
Vadim Zeitlin
5480296dd0 Use C++17 when using CEF and not C++14
CEF uses std::in_place_t which is not available in C++14.
2024-01-23 03:29:23 +01:00
Vadim Zeitlin
8463b13c14 Don't use -Wno-extra with MSVS when building wxWebviewChromium
Only set it for the other compilers.

This fixes a problem introduced in 26025e2652 (Disable -Wextra when
building libcef_dll_wrapper, 2023-12-29).
2024-01-23 03:29:04 +01:00
Blake-Madden
509f853757 Add holiday authority overview
Closes #24240.
2024-01-23 03:23:41 +01:00
ali kettab
9e61385878 Add wxRendererNative implementation for wxQt
Closes #24223.
2024-01-23 03:22:06 +01:00