Commit graph

75030 commits

Author SHA1 Message Date
the-nerbs
ffe520cb6d Update wxMemoryInputStream::Peek to set last read count.
This aligns the memory stream's Peek with other streams' Peek impls by
making it set the last read count to 1 when it successfully peeks a
character, or 0 when it does not. While the formal docs do not link
Peek to LastCount directly, the in-source comments on the declaration
of both wxInputStream::Peek and wxInputStream::LastRead both indicate
that Peek will set the last read count.
2023-08-06 20:46:27 -04:00
Maarten Bent
d847f3b039
Fix position of label window in wxStaticBox after DPI change
Fixes #23740
2023-08-05 21:54:01 +02:00
Vadim Zeitlin
a4dec24c6d Mention behaviour change of wxDC::GetContentScaleFactor()
Complete changes of 5e7b08f9ea (Correct wxDC::GetContentScaleFactor()
documentation, 2023-04-13) to add the information about the version in
which the behaviour of this function changed, as it was already done in
the version of this commit cherry picked to 3.2 branch, i.e. 8094ed5795
(Correct wxDC::GetContentScaleFactor() documentation, 2023-04-13).

Closes #23748.
2023-08-02 04:08:13 +02:00
Vadim Zeitlin
a42d9181d6 Define LOCALE_RETURN_GENITIVE_NAMES for old MinGW support
Some (very) old MinGW versions, such as 5.3.0 used on AppVeyor CI for
3.2 builds, don't provide the definition of this constant, so do it
ourselves.

See #23747.
2023-08-02 04:08:05 +02:00
Vadim Zeitlin
104b178cd7 Merge branch 'enable-stc-test'
Enable wxSTC tests in static builds too after fixing the problems
preventing them from linking there.

See #23744.
2023-08-01 01:35:10 +02:00
PB
350222e411 Correct wxBUILD_TESTS CMake build options in unit tests docs
Provide the correct options for wxBUILD_TESTS in the CMake part
of unit tests documentation.

Closes #23745.
2023-07-31 19:18:18 +02:00
Vadim Zeitlin
ec4777bbbf Rebake after the previous commit
This just separates the automatically-generated changes from the manual
ones in the parent commit.
2023-07-29 18:13:29 +02:00
Vadim Zeitlin
d509d534dd Don't define LIB_LEXILLA and LIB_SCINTILLA when USE_STC==0
This avoids link when building the tests in configure-based CI builds
using --disable-stc.
2023-07-29 18:12:09 +02:00
Vadim Zeitlin
7d362c3fca Enable wxStyledTextCtrl unit test in static builds too
It should link there too now after the previous commits.
2023-07-29 16:01:33 +02:00
Vadim Zeitlin
994bbe51a7 Link with stc directly in the test bakefile
There doesn't seem any reason not to do it, so do the same thing as is
done in the stc sample and which seems to work there.
2023-07-29 16:01:33 +02:00
Vadim Zeitlin
a44fe10e32 Link with Scintilla libs in the MSVS test project
They are required by wxStyledTextCtrl tests.
2023-07-29 16:01:33 +02:00
Vadim Zeitlin
e8fdb66741 Merge branch 'improve-configure'
Modernize configure.

See #23730.
2023-07-28 13:25:52 +02:00
Stefan Csomor
30fbb94053 Send key down events ourselves if macOS didn't do it
Set a flag in insertText and send wxEVT_KEY_DOWN ourselves from
DoHandleKeyEvent() if it wasn't set to ensure that we generate these
events for the keys ignored by the standard insertText, such as
⌘+⎇+Letter combination.

Closes #23671.

See #23699.
2023-07-28 13:24:51 +02:00
Vadim Zeitlin
e38bc95548 Synchronize config.* files in submodules with top-level repository
Use the same versions of config.{guess,sub} in the submodules where they
are used (so not in src/{jpeg,png}) as in wx itself to avoid any
confusion due to using different architecture names in the main
configure and subconfigure (e.g. aarch64-apple and arm-apple for M1).

Closes #23739.
2023-07-27 17:14:48 +02:00
Vadim Zeitlin
703d815ef8 Make configure message for zlib consistent with the other ones
All the other messages use "system $LIBRARY not found", and just zlib
didn't use "system" for some reason -- add it now so that the messages
are consistent when several of them are given.

This is a purely cosmetic changes.
2023-07-24 18:18:05 +02:00
Vadim Zeitlin
f03ea82be8 Merge branch 'im/stringview' of https://github.com/imciner2/wxWidgets
Add std::string_view constructors to wxString.

Also improve C++17 standard headers detection for MSVS.

See #23711.
2023-07-24 18:16:39 +02:00
Ian McInerney
b8d3b37c9e Add new macro for standard library header inclusion
Newer standard library headers should only be included when the compiler
is targetting that standard, otherwise some compilers (like MSVC) will
warn that you are using a newer C++ include on an older version.
2023-07-24 16:54:14 +01:00
Vadim Zeitlin
414140113c Merge remote-tracking branch 'github/egl-wayland-perf-fix'
Fix wxGLCanvas performance when using Wayland.

See #23554.
2023-07-24 17:41:35 +02:00
Vadim Zeitlin
0436cebd82 Fix recently broken assert for virtual wxGenericListCtrl
The changes of 8c1234ea66 (Improve assert checking line index validity
in wxGenericListCtrl, 2023-07-24) were wrong for virtual list controls
as the lines vector is not used for them, so restrict the assert to the
non-virtual case only.
2023-07-24 15:23:40 +02:00
Vadim Zeitlin
66cb7089f8 Add logging to wxGTK wxTopLevelWindow size-related functions
This can be helpful when debugging size-related problems and doesn't do
any harm as long as the corresponding tracing category is disabled.
2023-07-24 14:04:56 +02:00
Vadim Zeitlin
08c3d09e51 Avoid debug warnings when defocusing menu bar in wxGTK
At least under Wayland, removing focus from the menu consistently
results in "window lost focus even though it didn't have it" debug
messages because wxMenuBar never gets any focus-in signals but does get
focus-out one.

Avoid this by just not connecting handlers for these signals at all, as
we don't need them for wxMenuBar which isn't supposed to generate any
focus events anyhow.

See #23726.
2023-07-24 14:04:36 +02:00
Vadim Zeitlin
484c98ffb2 Avoid double quoting assert message conditions
wxFAIL_COND_MSG_AT() macro was already passed a quoted string, there is
no need to quote it again.
2023-07-24 14:03:34 +02:00
Vadim Zeitlin
d6dd0ebb6e Fix deleting selected item in wxGenericListCtrl
This didn't update the number of selected items, which resulted in other
problems later on, including accessing items with invalid index which
could lead to a crash.

Closes #23729.
2023-07-24 14:03:34 +02:00
Vadim Zeitlin
8c1234ea66 Improve assert checking line index validity in wxGenericListCtrl
Don't just check that the index is not -1, but also that it's valid,
which can catch other problems.

Also replace the ASSERT with CHECK to avoid dereferencing invalid
pointer, it's better to crash when trying to dereference a NULL one.
2023-07-24 14:03:34 +02:00
Vadim Zeitlin
d0ebba6f68 Increase required autoconf version to 2.69
This is pretty ancient by now (released 2012-04-24) and anything older
than it is really unlikely to be used on any development machine.
2023-07-24 00:12:05 +02:00
Vadim Zeitlin
a921f558d9 Remove configure.in to configure.ac
This is the extension expected by all non-ancient autoconf versions.
2023-07-24 00:11:26 +02:00
Maxim Cournoyer
5c3a41139c build/autogen.mk: Register missing bakefiles. 2023-07-24 00:11:26 +02:00
Vadim Zeitlin
9452f6b982 Remove frozen autoconf macros version a.k.a. "auto hacks"
This hasn't been maintained since 2007 and doesn't seem to be really
needed as using and not using them results in the same output currently.
2023-07-24 00:11:26 +02:00
Vadim Zeitlin
00960b40b9 Replace obsolete AC_TRY_XXX macros with AC_XXX_IFELSE
No real changes, just avoid warnings from autoconf 2.71 when
regenerating configure.

Note that double brackets must be used around any code using brackets to
preserve them during the expansion.
2023-07-24 00:11:23 +02:00
Vadim Zeitlin
04f7e0664b Replace AM_PATH_GTK_N_0() macros with use of PKG_CHECK_MODULES()
There is no reason not to use pkg-config nowadays and this allows to get
rid of some third-party m4 files, which is always nice, and avoids
warnings about GTK 3 and 4 macros being obsolete when regenerating
configure with autoconf 2.71.
2023-07-24 00:00:18 +02:00
Vadim Zeitlin
45ab9f5646 Replace obsolete AC_PROG_CC_C99 with just AC_PROG_CC
No real changes, the macros are identical, but AC_PROG_CC_C99 warns
about it being obsolete.
2023-07-24 00:00:03 +02:00
Vadim Zeitlin
e34b5c5adc Remove unused m4 files and regenerate aclocal.m4
Some of autoconf macros are not used any longer, so get rid of them.
2023-07-23 23:59:57 +02:00
Vadim Zeitlin
57c71a4547 Only include Scintilla libraries in wx-config --libs if needed
Don't always output -lscintilla and -llexilla in wx-config --libs, as
they are not needed unless linking with wxstc library is requested but
204bc3c887 (Fix linking of wxscintilla in static monolithic build,
2017-12-06) added them unconditionally.

Improve this by putting them in a separate WXCONFIG_STC_LIBS instead of
WXCONFIG_LIBS used for all libraries (even wxbase, which is wrong on its
own).

Also see #23643.
2023-07-23 02:35:53 +02:00
Vadim Zeitlin
97546a6f0c Really fix wxProcessDialog size when the message length changes
Ensure that we only increase the dialog width but never decrease it to
prevent the dialog from jumping annoyingly to different size with each
label change.

The previous attempt to do this in 4101849b4d (Grow
wxGenericProgressDialog automatically if needed, 2017-10-27) didn't work
because it seemingly didn't take into account the fact that wxStaticText
width changes when its label changes and so calling SetLabel() could
make it smaller, meaning that the next update would call Fit() again.

So fix this by preventing the control from changing its size by using
wxST_NO_AUTORESIZE and then only resizing it manually if it really needs
more space.

See #10624, #23727.
2023-07-22 22:58:55 +02:00
Vadim Zeitlin
22a3a2fa66 Link to "getting the sources" from wxGTK build instructions
This should help people who check out the repository without submodules.

It's a bit circular, as the target of the link links back to this page
itself, but doing anything else would require much deeper reorganization
that can't be done now.

Closes #23683.
2023-07-21 20:57:12 +02:00
Vadim Zeitlin
94cd26ed0a Improve RUNTIME_LIBS build option documentation
State upfront that it only works with MSVC and also don't mention
msvcrt.dll not used any more since a couple of decades.

See #23715.
2023-07-21 20:40:43 +02:00
Scott Talbert
8b83e45f0e Check building samples out of tree in a CI job
Fixes: #23722

Closes #23723.
2023-07-21 20:38:37 +02:00
Vadim Zeitlin
b6ea233845 Fix missing "net" library in webrequest makefile.unx
"base" library must always come last in the samples bakefiles as the
list of wx libraries to link with is generated when processing it, so
putting the "net" library after it had no effect.

See #23723.
2023-07-21 20:37:00 +02:00
Aulddays
a3b0a839d6 Fix wxXRC LoadBitmapFromFS() when wxUSE_FILESYSTEM==0
Use correct parameter name "path" instead of "name".

Closes #23724.
2023-07-21 20:25:34 +02:00
Ian McInerney
3dfb2a5ac1 Add std::string_view constructors to wxString 2023-07-20 19:59:01 +01:00
Vadim Zeitlin
44e857c012 Explicitly disable some level 4 warnings in Windows SDK headers
Some level 4 warnings are somehow not disabled by switching to level 1,
so disable them explicitly.

Closes #23716.
2023-07-20 15:29:06 +02:00
Scott Talbert
aef7df6c9f Read Linux distribution info from os-release file
The Linux distribution community has somewhat deprecated the lsb_release
utility and has standardized on a new file, os-release, that can be
simply parsed to get the same information.  Attempt to read this file in
/etc/os-release, then /usr/lib/os-release, and finally, fall back to
using the lsb_release utility if neither of those files are found.

See: https://www.freedesktop.org/software/systemd/man/os-release.html
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2184391

Closes #23712.
2023-07-20 15:24:35 +02:00
Vadim Zeitlin
ed7f5a671c Fix wxDateTimePickerCtrl arrows redrawing with WS_EX_COMPOSITED
This is similar to 79567c83f4 (Fix wxSpinButton redrawing when using
WS_EX_COMPOSITED, 2023-07-08) and does the same thing for the spin part
of the date time picker control.

See #23656.

Closes #18231.

Closes #23705.
2023-07-20 15:20:51 +02:00
Vadim Zeitlin
340320d63c Fix using system libtiff installed in non-standard location
Add the required CFLAGS (such as the path to libtiff headers if they are
not in one of the system directories) to CXXFLAGS, not CFLAGS, as we're
using libtiff from C++ code.

This fixes a problem introduced in b9fe8ca10c (Try to use pkg-config for
detecting libtiff in configure, 2018-12-12).

Closes #23702.

Closes #23703.
2023-07-20 15:19:03 +02:00
Vadim Zeitlin
0a1b92fd31 Merge branch 'fix-samples-out-of-tree-build'
Fix building some samples in out of tree build.

See #23701.

Closes #23700.
2023-07-20 15:16:09 +02:00
Vadim Zeitlin
626f781840 Link penguin OpenGL sample with GLU too when building out of tree
This sample is the only one to use a GLU function too.

It would probably be better to drop GLU dependency entirely, but until
this is done (see #23721), do link with it.

This commit is best viewed ignoring whitespace-only changes.
2023-07-20 15:14:10 +02:00
Martin Corino
4d76a87015 Make wxSearchCtrl inherit from wxTextEntry in all ports
Previously it only inherited from wxTextEntryBase in the generic
implementation (used e.g. in wxMSW).

Update the code, documentation and add new unit tests checking that
wxSearchCtrl member functions inherited from wxTextEntry behave
correctly.

Closes #23686.

Closes #23697.
2023-07-20 14:46:41 +02:00
Stefan Csomor
52a11a3a9d Remove obsolete wxOSX_USE_EXPERIMENTAL_FONTDIALOG build setting
Always turn native font dialog on and remove the never used old version.

Closes #23695.
2023-07-20 14:42:39 +02:00
Vadim Zeitlin
829fe8154b Allow "feature" attribute in XRC schema
This is just a hack because we handle "feature" as part of "platform"
when it's not really related to it, but as it has to be treated in the
same way, it's the simplest way to allow it.

This should also have been done in 3fdebc96cd (Add support for XRC
"feature" attribute, 2023-01-29) but was forgotten there.
2023-07-19 01:58:40 +02:00
Vadim Zeitlin
0ab31edc17 Use flags required for using GTK in widgets sample
As we use GTK directly in this sample, we need to use the appropriate
compiler and link flags, so add them depending on the port in the
makefile.
2023-07-11 13:40:23 +02:00