Commit graph

76071 commits

Author SHA1 Message Date
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
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
Vadim Zeitlin
1b4dfc292a Merge branch 'vlistbox-current-accessors' of https://github.com/wsu-cb/wxWidgets
wxVListBox: add GetCurrent()/SetCurrent() accessors.

See #24204.
2024-01-22 21:41:28 +01:00
Blake Madden
21ae234a37 Add support for hidden panels in ribbon
If a panel window is hidden, then don't include its size when laying out
the ribbon bar. After toggling a panel's visibility, calling Realize()
and Layout() will properly include the panel (if shown) or not show it
and move panels to the right of it over (without a blank gap in the
ribbon bar where the hidden panel would be).

Closes #24237.
2024-01-22 21:39:10 +01:00
taler21
0c3afbe580 Mention __WXGTK3__ in the preprocessor symbols documentation 2024-01-22 11:00:26 +01:00
Vadim Zeitlin
2a74f6a644 Merge branch 'more-std-obj-array'
Make wxObjArray a bit more standard-like.

See #24233.
2024-01-21 01:48:41 +01:00
Lauri Nurmi
99bc43cefe Introduce minimal MSW ARM support
wxMSW could already be compiled for ARM with MSVC, but due to not
defining any ARCH_SUFFIX for ARM, makefile.vc used to place objectsi
and libraries to the same folder as x86 objects and libraries.

A completely different question is what kind of Windows runs on 32-bit
ARM, and whether one can run regular desktop apps on it.

This commit mimics what f69dbaa1 did for ARM64, and adapts it for ARM.

Closes #24222.
2024-01-21 01:48:16 +01:00
Vadim Zeitlin
ed89fc5f3b Make wxImageListBase DLL-exported to fix MSVS warnings
Without a DLL export declaration on this class MSVS complains about
using it as a base class for DLL-exported wxImageList, so do provide
this declaration, even if it's not normally necessary because there are
no member functions of this class in the shared library, just to avoid
the warning.

Closes #24232.
2024-01-21 01:42:54 +01:00
Vadim Zeitlin
6d0b1369aa Also add wxObjArray::swap() for consistency with the other arrays
As with the previous commit, make this kind of arrays a bit more
comfortable to use as long as we can't avoid using them completely.
2024-01-21 00:01:54 +01:00
Vadim Zeitlin
a5f02170c4 Add possibility to iterate over wxObjArray using range-for
While such arrays are deprecated, we still use some of them, e.g. in
wxAUI code, so make using them slightly less painful by allowing
iterating over them naturally.
2024-01-20 23:58:48 +01:00
Vadim Zeitlin
046eb38bf0 Use explicit scope in wxBaseObjectArray implementation
This doesn't change anything yet, but will when this class defines its
own begin() and end() in the next commit.
2024-01-20 23:53:09 +01:00
Vadim Zeitlin
0fa605abb5 Only use CMAKE_BUILD_TYPE to set wxHAVE_CEF_DEBUG if it's defined
If it isn't, as is the case for MSVS for example, we don't need to set
wxHAVE_CEF_DEBUG anyhow, as it's set automatically if _DEBUG is defined
during the build.

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
2024-01-20 02:13:46 +01:00
Vadim Zeitlin
b3c1a6adfd Document CEF_RUNTIME_LIBRARY_FLAG switch for building CEF
This must match the options used when building wx itself.

Also mention CEF_USE_SANDBOX while discussing CEF build options.
2024-01-20 00:58:39 +01:00
Vadim Zeitlin
19aee81c1d Update nanosvg to the latest upstream version
This notably fixes crash with SVGs using 1 stop gradients.

Relax the check in a test added in #24064 as it doesn't quite pass with
the new version -- this is somewhat suspicious but as it wasn't really
clear where did the original tolerance of 3 come from, it doesn't seem
to be a huge problem to increase it to 4 neither.

Closes #24213.
2024-01-19 21:17:43 +01:00
Vadim Zeitlin
f37401dde3 Merge branch 'webview-chromium'
Add Chromium-based wxWebView backend.

See #706.
2024-01-19 03:07:44 +01:00
ali kettab
152ec01122 Fix wxEVT_SET_CURSOR handling under wxQt
Really fix wxSetCursorEvent handling for wxAUI done in commit f608b34
(Send set cursor events whenever there is mouse movement) without
breaking the other controls, i.e. wxSplitterWindow, wxHeaderCtrl and
wxGrid.

Pass the mouse position by const reference to QtSendSetCursorEvent().

Closes #24217.
2024-01-19 02:56:45 +01:00
Randalphwa
38d8980283 Add optional wxXmlParseError to wxXmlDocument::Load()
If a pointer to the structure is passed in to Load(), it will be filled
in if a parsing error occurs.

Closes #24215.
2024-01-19 02:55:54 +01:00
Randalphwa
30b98c81b1 Replace #ifdef with #if in WXWIN_COMPATIBILITY_3_2 check
This matches the rest of the code base, allowing setup.h to have:

    #define WXWIN_COMPATIBILITY_3_2  0

See #24215.
2024-01-19 02:52:51 +01:00
Blake Madden
567f8c47af Add wxRibbonBar::GetPageById()
To find a page by ID currently you have to use a recursive FindWindow
(which would also look at the child Panel windows). This function allows
for finding a page by ID more elegantly.

Closes #24211.
2024-01-19 02:49:47 +01:00
Vadim Zeitlin
ee691af12d Merge branch 'qt-some-cleanups' of https://github.com/AliKet/wxWidgets
Some more wxQt fixes and cleanups.

See #24210.
2024-01-19 02:47:52 +01:00