Commit graph

76005 commits

Author SHA1 Message Date
Vadim Zeitlin
72c164f28c Make wxStandardPaths::AppendAppInfo() public
This function can be useful to the application code and will be used by
wxFileConfig in the upcoming commits.
2024-01-02 01:57:04 +01:00
Vadim Zeitlin
420983f76a Document that GetUserDataDir() doesn't respect XDG file layout
And recommend using GetUserDir() instead.
2024-01-02 01:47:26 +01:00
Vadim Zeitlin
92b901f971 Remove unnecessary wxUnusedVar() from wxFileConfig code
No real changes, just don't use wxUnusedVar() for a parameter which is
actually used.
2024-01-02 00:50:39 +01:00
Paul Cornett
a65ada2a5e Simplify mm-to-pixel conversion
wxDisplay can already tell us the PPI, just convert it to mm.
2024-01-01 13:52:10 -08:00
Paul Cornett
64d1d27da9 Fix wxMM_METRIC scaling with wxGCDC for non-macOS platforms
Don't override the default mm-to-pixel calculation, it will get the right answer.
2024-01-01 13:46:18 -08:00
Vadim Zeitlin
8bb8eb5108 Increase buffer size in wxXmlDocument::Load()
The 1KB buffer used before was really too small and should have been
increased to at least 4KB, but increase it to 16KB as it should do no
harm neither.
2024-01-01 22:08:28 +01:00
Vadim Zeitlin
20845d85a5 Deprecate "encoding" parameter of wxXmlDocument ctor and Load()
This parameter wasn't used for anything as it specified the encoding of
the data contents in memory and not the encoding of the XML file as
might be believed, so it only created unnecessary confusion.

See #24167.
2024-01-01 22:08:28 +01:00
Vadim Zeitlin
268b2b98e0 Use WaitForEventAt() in Grid::ReorderedColumnsCellClick test too
This test also sporadically fails on AppVeyor.
2024-01-01 22:04:41 +01:00
Vadim Zeitlin
9ee9f4e8dd Remove documentation of wxXmlDocument::GetEncoding()
This function was removed in 4519d8e08a (Remove wxUSE_UNICODE checks as
they're always true now, 2022-10-27).
2024-01-01 21:00:08 +01:00
Vadim Zeitlin
0b049be4b7 Use unique_ptr<> in wxXmlDocument
Replace manual use of raw pointer with std::unique_ptr<>.

No real changes.
2024-01-01 20:54:08 +01:00
Vadim Zeitlin
2a5eac26f4 Remove unnecessary calls to wxDELETE()
Replace them with just calls to delete as it doesn't matter if the
pointer is null or not in all these cases and using just "delete" is
more clear.
2024-01-01 20:54:08 +01:00
Vadim Zeitlin
326876eb60 Initialize wxXmlDocument::m_docNode in its declaration too
Similar to the previous commit.
2024-01-01 20:54:08 +01:00
Vadim Zeitlin
08ef52671f Initialize wxXmlDocument::m_fileType and m_eol in declaration
This is simpler and more clear than calling SetFileType() from all
ctors.

Also m_eol
2024-01-01 20:53:53 +01:00
Vadim Zeitlin
7f6d85d60b Remove trivial CharToString() from wxXML code
Just use wxString::FromUTF8Unchecked() directly.

Note that Expat strings are always (valid) UTF-8 strings.
2024-01-01 20:30:03 +01:00
Vadim Zeitlin
efc943b59d Remove unused wxXmlParsingContext::conv member
This pointer was always null since the changes of 4519d8e08a (Remove
wxUSE_UNICODE checks as they're always true now, 2022-10-27), so remove
it completely.
2024-01-01 20:29:03 +01:00
Vadim Zeitlin
acf113f3f9 Update copyright years to 2024
Just run misc/scripts/inc_year and commit the results.

See #18690.
2023-12-31 18:56:06 +01:00
Vadim Zeitlin
a79759d999 Switch wxMSW 32 bit cross build workflow to Debian Stable
Debian Testing doesn't have 32-bit support any more.
2023-12-31 18:03:22 +01:00
Martin Corino
6ee9056c16 Fix column reordering in wxHeaderCtrlSimple and related problems
Override required functions in wxHeaderCtrlSimple to avoid asserts if
its columns are reordered.

Also bring the code behaviour in agreement with the documentation by
calling UpdateColumn() after calling UpdateColumnVisibility().

Finally, only call UpdateColumnsOrder() if the corresponding event was
not processed as the application should use one xor the other mechanism
for reacting to columns reordering, but not both.

Closes #24108.

Closes #24172.
2023-12-31 17:57:19 +01:00
Vadim Zeitlin
927590fbcd Merge branch 'qt-richtooltip-fixes' of https://github.com/AliKet/wxWidgets
wxRichToolTip fixes for wxQt port.

See #24170.
2023-12-31 17:48:37 +01:00
Vadim Zeitlin
dd76ab3e67 Avoid calling strftime("%F") when using MinGW
This format specifier is not supported by its CRT.
2023-12-31 15:29:19 +01:00
Vadim Zeitlin
d31305beeb Do use POSIX strftime() specifiers under Windows with MSVS
All currently supported versions of MSVS support POSIX "%g", "%G", "%V"
and "%z" format specifiers, so do call strftime() even if they are used
in the format string.

However don't do this when using MinGW, as its CRT still doesn't support
them.
2023-12-31 15:26:44 +01:00
Vadim Zeitlin
7543e49c3c Add support for %F (ISO 8601 date) format specifier to wxDateTime
Recognize it when formatting and parsing dates.

Closes #24173.
2023-12-30 17:01:19 +01:00
Vadim Zeitlin
faec76990e Define wxHAVE_CEF_DEBUG when building CEF wrapper in debug
We need to define NDEBUG when using release build of the wrapper only,
so don't do it if it was built in debug by CMake.
2023-12-30 02:54:54 +01:00
Vadim Zeitlin
adedb499f5 Relax C++ standard requirement when using wxWebviewChromium
Although building CEF itself requires C++17, C++14 is sufficient for
building libcef_dll_wrapper, so allow using it.

Also move the error message a bit more informative.
2023-12-30 02:27:11 +01:00
Vadim Zeitlin
26025e2652 Disable -Wextra when building libcef_dll_wrapper
If it is enabled (e.g. globally because the application using wxWidgets
as a submodule enables it), it would result in a harmless warning about
not calling the base class ctor in base/cef_callback_internal.cpp.
2023-12-29 23:30:14 +01:00
Vadim Zeitlin
00dff6e3bc Stop using $EGREP in configure.ac unnecessarily
We don't have DISABLED_UTILS or DISABLED_DEMOS variables, so it's
useless to exclude them from the makefiles list -- just stop doing it.

This fixes a problem with using EGREP without preceding AC_PROG_EGREP
with autoconf 2.72, as EGREP is not defined any longer with this
version.

See #24168.
2023-12-29 19:03:28 +01:00
Paul Cornett
ce1d317768 Remove GLU dependency
See #23721
2023-12-28 14:49:42 -08:00
Paul Cornett
f1731fd672 Return index of first added image in wxImageList::Add()
This is what MSW does. Broken in c374eefd34 (Fold wxOSX-specific wxImageList into
generic version, 2018-10-30)
See #10013
2023-12-28 12:49:47 -08:00
Paul Cornett
ef326106c0 Improve wxEVT_LEAVE_WINDOW generation while mouse is captured with GTK3
Non-integral coordinates and overlay scrollbars can cause the event to be
generated with coordinates that are still inside the window. Avoid this by
ensuring that integral coordinates are outside the window, and ignoring overlay
scrollbars. Also remove gdk_display_flush(), contrary to the very old comment
it does not seem to be necessary. Fixes wxScrolledWindow auto-scrolling.
2023-12-28 12:39:41 -08:00
Paul Cornett
fc8a780932 Avoid applying "no-window" mouse coordinate conversion to generic wxWindow
For a wxPizza widget in a GtkScrolledWindow, the coordinates are already correct.
2023-12-28 12:32:59 -08:00
Paul Cornett
6cb6cf1fde Use correct comparison for out-of-window mouse coordinate
Coordinates on a window are 0..size-1
2023-12-28 12:26:24 -08:00
Vadim Zeitlin
8a931de85d Avoid spurious -Wmissing-field-initializers in wxWebViewChromium
This warning is given when using -Wextra.
2023-12-28 19:46:33 +01:00
Vadim Zeitlin
a942fb1774 Merge remote-tracking branch 'MaartenBent/chromium' into webview-chromium
Fix CMake support.
2023-12-28 18:57:07 +01:00
AliKet
b284260191
Update interface/wx/nonownedwnd.h
Co-authored-by: VZ <vz-github@zeitlins.org>
2023-12-28 16:35:23 +01:00
ali kettab
7dea9423c5 Fix wxPopupTransientWindow::Dismiss() implementation
Remove installed event handlers before trying to hide the popup,
as this could result in Destroy() being called twice under wxQt.
This happens to wxRichToolTip for example. i.e. Destroy() is called
once from wxPopupFocusHandler::OnKillFocus() after the call to Hide()
then, from wxRichToolTipPopup::OnTimer().
2023-12-27 19:49:10 +01:00
ali kettab
40a6d74aaf Create the wxPopupWindow with a parent under wxQt
The fact that we cannot create a wxPopupWindow with a parent
is no longer valid after the recent changes to the wxQt port.

The wxRichToolTip (an instance of wxPopupWindow) will crash if
created without a parent under this port.
2023-12-27 19:31:50 +01:00
ali kettab
c7fdb41fcd Implement wxNonOwnedWindow::SetShape() taking wxGraphicsPath under wxQt
This is a copy and paste of wxMac's implementation to make wxRichToolTip
work under wxQt.
2023-12-27 19:17:21 +01:00
Vadim Zeitlin
7a306c4a42 Merge branch 'qt-fixes' of https://github.com/AliKet/wxWidgets
Many wxQt improvements and simplifications.

See #24135.
2023-12-27 02:57:14 +01:00
Vadim Zeitlin
378da09c84 Fix typo in "receive" occurring a few times
This is just too annoying to see.
2023-12-27 02:56:20 +01:00
Vadim Zeitlin
5f62f30231 Use WaitForEventAt() in Grid::CellSelect test too
Try making this test more robust as well as it also sporadically fails
on AppVeyor.

Also simplify it a bit, checking for each of the expected events in turn
instead of checking for their total number at the end.
2023-12-27 02:49:53 +01:00
ali kettab
a0b0f524ff Handle wxTextCtrl created with wxTE_DONTWRAP or wxTE_NO_VSCROLL under wxQt 2023-12-26 22:50:59 +01:00
ali kettab
0eaff271ed Fix wxStaticBitmap not using correct bitmap size under wxQt 2023-12-26 22:50:59 +01:00
ali kettab
0fb1a74983 Fix Set{Back,Fore}groundColour() for wxFrame under wxQt
Restrict the effect of these functions to the central widget only.
Otherwise the menubar, toolbar and statusbar would also be affected.
2023-12-26 22:50:59 +01:00
ali kettab
aa562ea2fb Get rid of QtCreateControl() from wxQt code base
If possible, all windows should call wxWindow::Create() on creation now,
because among other things:
- It manages generic and non-generic windows uniformly and transparently
- It ensures an appropriate initial size for the window
- AddChild() and PostCreation() are automatically called
- Scrollbar policies are set in one place.
2023-12-26 22:50:59 +01:00
Vadim Zeitlin
15af320353 Fix updating wxAUI frame buttons on mouse hover
This didn't work under wxOSX or wxGTK/Wayland as it used wxClientDC
which doesn't work in these ports.

Fix this in the usual way, i.e. by just redrawing everything in them.
2023-12-26 19:48:36 +01:00
Vadim Zeitlin
3e32e0fa67 Allow using non-live resize in wxAUI with wxGTK3/X11
In this case we can still use wxClientDC, so let people do it if they
really want to for consistency with wxSplitterWindow and because it
doesn't really cost us anything.
2023-12-26 19:27:50 +01:00
Vadim Zeitlin
fffe7f7170 Make using non-live resize work in wxAUI work in more cases
Use wxClientDC instead of wxScreenDC, which only works in wxMSW, and use
wxINVERT instead of wxXOR, to make DrawResizeHint() actually draw
something in wxGTK3 too.

And not using wxScreenDC might even help with some problems under MSW
too, see #23982.

Note that "rectangle hint" code still uses wxScreenDC, but this hint
kind should probably be just removed as it doesn't seem useful for
anything.
2023-12-26 19:27:50 +01:00
Vadim Zeitlin
1d328aa4e1 Add wxSplitterWindow::AlwaysUsesLiveUpdate()
This is similar to wxAuiManager::AlwaysUsesLiveResize() and does the
same thing, i.e. returns true if live update is always used, whether
wxSP_LIVE_UPDATE is enabled or not.

Use the new function in the sample to disable the menu item in the
environments where it doesn't do anything, as it was confusing to have
it under e.g. Wayland.
2023-12-26 19:27:50 +01:00
Vadim Zeitlin
298fef23ad Use wxClientDC::CanBeUsedForDrawing() in wxSplitterWindow
No real changes, just simplify the code by using the just added
wxClientDC function instead of reproducing its logic here.
2023-12-26 19:27:50 +01:00
Vadim Zeitlin
24fd54ed31 Add wxClientDC::CanBeUsedForDrawing()
This function can be used to check if drawing on wxClientDC actually
works. This has to be a run-time, rather than compile-time, check
because in wxGTK3 this depends on the backend being used: wxClientDC
only doesn't work with Wayland, but does work with X11 (and, less
importantly, Win32) backend(s).

Currently the wxWindow parameter of this function is not used but it
could be useful in the future and it will be simpler to allow not
specifying it (by defaulting it to nullptr) than to add it later, so it
seems better to have it.
2023-12-26 19:27:50 +01:00