Commit graph

73671 commits

Author SHA1 Message Date
Paul Cornett
6d4eadefe6 Update config.{guess,sub} scripts to latest versions 2022-12-02 08:43:11 -08:00
Artur Wieczorek
c3eb9cbaa5 Try to ensure that testing window is shown
wxClientDC tests are reliable only if testing window is visible.
2022-12-01 19:29:52 +01:00
Artur Wieczorek
ab2a578475 Check if getting clipping box succeeded
This is additional check to help diagnose possible issues
with clippping.
2022-11-30 21:05:21 +01:00
Paul Cornett
471c642979 Simplify configure check for Cairo
Instead of checking for Cairo and then checking for
a function in Cairo 1.2, just check for Cairo 1.2.
2022-11-30 09:22:23 -08:00
Blake-Madden
fc9e188116 Handle 'T' separator in wxDateTime::ParseDateTime()
ParseDateTime() currently fails if there is a 'T' separator in front of
time component. FormatISOCombined() uses this separator as the default,
so wxDateTime can't parse its own formatted results by default.

This commit fixes that issue by allowing an optional 'T' between the
date and time parts.

Closes #22999.
2022-11-30 02:23:37 +01:00
Vadim Zeitlin
b76e2b728a Fix example of using wxLoadUserResource() in the docs
Pass wide string to this function as this is what it takes.
2022-11-30 02:23:37 +01:00
Vadim Zeitlin
d6ddfe87e1 Disable build system pkg-config when cross-compiling to non-Linux
This restores a modified form of the original commit 893ebbab0c (Disable
use of build system pkg-config files when cross-compiling, 2020-12-13),
thus mostly reverting 6dbf59f34f (Revert "Disable use of build system
pkg-config files when cross-compiling", 2022-10-25) and now disables the
use of build system pkg-config files only when cross-compiling for
non-Linux hosts.

This seems like the best behaviour by default because it avoids
unexpected problems when cross-compiling for MSW or iOS where build
system .pc files should never be used, but still uses these files, if
they are available, when cross-compiling for other Linux systems.

This is Linux-specific currently but should probably be extended to
other Unix systems too. In any case, the default behaviour can always be
overridden by setting PKG_CONFIG_LIBDIR manually.

See #22886.
2022-11-30 02:18:38 +01:00
Artur Wieczorek
48d226bb84 Adjust scrolled contents only for wxPaintDC (drawing sample)
Adjust scrolled contents for screen drawing directly in EVT_PAINT
handler instead of doing so conditionally for generic wxDC.
This also helps demonstrating if wxPaintDC transformations
are transferred properly to wxGCDC.
2022-11-29 18:41:08 +01:00
Artur Wieczorek
1baecca49a Add tests to check clipping for wxGCDC
Tests to check clipping when origin of the parent wxDC is shifted
and has negative coordinates.
2022-11-29 18:39:42 +01:00
Paul Cornett
7d070a7e83 Remove HAVE_ROUND, it is not used anymore 2022-11-28 09:11:01 -08:00
Vadim Zeitlin
58f5a885ec Merge branch 'qt-notebk-fixes' of https://github.com/AliKet/wxWidgets
wxQt notebook fixes.

See #22997.
2022-11-27 00:32:41 +01:00
Vadim Zeitlin
6e89fe332a Merge branch 'generic-print-dialog-fixes'
Fix asserts in generic print dialog code.

See #22995.

Closes #22993.
2022-11-27 00:31:04 +01:00
ali kettab
01029cc438 Added support for wxNotebook tab position missing in wxQt 2022-11-26 23:29:14 +01:00
Vadim Zeitlin
efac76ec8e Rewrite wxGenericPrintSetupDialog sizer-related code
Use sensible variable names instead of auto-generated itemNN and
wxSizerFlags-based API.

This makes the code simpler to read and modify and also avoids tons of
asserts due to using meaningless sizer styles.
2022-11-26 23:29:13 +01:00
Vadim Zeitlin
0c97749035 Use simpler wxStaticBoxSizer ctor in wxGenericPrintDialog
No real changes, just let wxStaticBoxSizer create wxStaticBox on its own
instead of creating it explicitly just to give it to the sizer.

This makes the code shorter and simpler.
2022-11-26 23:29:13 +01:00
Vadim Zeitlin
f076655b38 Stop dispatching events from wxGenericPrintSetupDialog ctor
Block while waiting for "lpstat -v" to execute: it shouldn't take a long
time to run it and dispatching events from inside this dialog ctor was
really unexpected.
2022-11-26 23:29:13 +01:00
Vadim Zeitlin
6832a58695 Fix inserting items into wxListCtrl in wxGenericPrintSetupDialog
Set the ID before calling InsertItem(), otherwise it just fails
(inserting an item without ID used to work in the generic version but
never worked in the MSW one and was changed back in 2.9 to not work in
the generic version neither for consistency).
2022-11-26 23:29:13 +01:00
Vadim Zeitlin
02f7a5361d Fix wxImageList creation in wxGenericPrintSetupDialog
Size must be provided when creating wxImageList, otherwise calling Add()
on it fails later.
2022-11-26 23:29:13 +01:00
Vadim Zeitlin
5c6bce627b Check wxImageList validity in all of its methods
Some of wxImageList methods asserted when called on an invalid image
list while others just failed silently.

Assert in all of them now for consistency and to help detecting problems
in the code using invalid wxImageList objects.

Extend the documentation and the tests.
2022-11-26 23:29:13 +01:00
ali kettab
25b15e3235 Override OnImagesChanged() to show images set with SetImages() in wxNotebook for wxQt 2022-11-26 23:04:43 +01:00
Vadim Zeitlin
280dbce37e Restore configure tests disabled by GTK1 support removal
The changes of fb4f0b590c (Remove wxGTK1 port and GPE support,
2022-10-16) accidentally disabled several checks that were supposed to
be done when using wxGTK, notably for GTK print library.

This was due to WXGTK2 not being defined any longer and is fixed now by
replacing the tests for it with tests for wxUSE_GTK (as WXGTK2 used to
mean "any GTK version other than 1", and not "GTK version 2").

Closes #22994.
2022-11-26 20:24:15 +01:00
Vadim Zeitlin
7ad48bd045 Merge branch 'qt-slider-fixes' of https://github.com/AliKet/wxWidgets
wxQt slider fixes.

See #22989.
2022-11-26 17:09:03 +01:00
Vadim Zeitlin
018d0388b9 Merge branch 'master' of https://github.com/crazbot/wxWidgets
Fix wxOSX compilation with Xcode 7.3 and macOS 11 SDK.

See #22992.

Closes #22988.
2022-11-26 17:03:08 +01:00
ali kettab
7b245ccefc Ensure that a wxRadioButton in a group is always selected in wxQt
This is not done by default by Qt, but wxWidgets expects to always have
exactly one selected radio button in each radio button group.

Fixing this allows the related unit test to pass for wxQt now.

Closes #22991.
2022-11-26 17:00:45 +01:00
Vadim Zeitlin
d458af3ca7 Merge branch 'qt-menu-fixes' of https://github.com/AliKet/wxWidgets
Make accelerators and radio items work in wxQt menus.

See #22985.
2022-11-26 16:57:00 +01:00
Vadim Zeitlin
5b5ac7cae0 Improve implementation of WX_ASSERT_FAILS_WITH_ASSERT_MESSAGE
Use SUCCEED() in it so passing tests are actually counted (before
running a test using this macro resulted in misleading output saying
that 0 asserts passed) and also use FAIL_CHECK(), instead of FAIL(), to
which CPPUNIT_FAIL() expanded before, to allow the rest of the test to
run even if this check fails, as missing assertions shouldn't be fatal.

Also remove a very old and outdated comment mentioning CppUnit.

Closes #22984.
2022-11-26 16:55:09 +01:00
Vadim Zeitlin
d0af75e88d Merge branch 'use-template-for-vararg-funcs'
Use variadic templates for implementing the vararg functions.

See #22981.
2022-11-26 16:53:41 +01:00
Vadim Zeitlin
5660b0cc2d Merge branch 'prune-old-files'
Remove files that are no longer useful.

See #22980.
2022-11-26 16:52:46 +01:00
Vadim Zeitlin
42ea375816 Point to docs/contributing from docs/tech
Give people following some ancient links to the tech notes in this
directory a chance to find something still relevant.
2022-11-26 16:52:04 +01:00
Vadim Zeitlin
be0ab9f434 Add mailmap entry for Ulrich Telle
Some of Ulrich's commits didn't use the correct name.
2022-11-26 16:47:01 +01:00
zy
a248a96ba7 fix use of undeclared identifier NSEventMaskLeftMouseDown 2022-11-25 19:55:22 +08:00
ali kettab
39f0e5b433 Fix compatibility with the other ports for wxSlider in wxQt 2022-11-25 08:56:28 +01:00
ali kettab
a1df8042c6 Add missing wxSlider events emission for wxQt
Also, Qt supports showing/hiding slider ticks and changing its line size
2022-11-25 08:56:28 +01:00
whale
30834f7b4d fix use of undeclared identifier NSURLVolumeLocalizedNameKey 2022-11-25 11:09:56 +08:00
Artur Wieczorek
f67077a66d Add tests to check clipping for wxGraphicsContext
More tests to check clipping when origin of the parent wxDC is shifted
and has negative coordinates.

See #22990.
2022-11-24 22:45:45 +01:00
Artur Wieczorek
dcc41a9c88 Fix creating wxCairoContext from CGContext (wxOSX)
Cairo surface works properly if origin of the clipping region of CGContext
is (0,0) so if it's not the case we need to apply a transformation to move
it to (0,0).
This shift needs to be applied as an offset added to the device coordinates
when drawing to surface.

Closes #22990.
2022-11-24 22:33:45 +01:00
Artur Wieczorek
4311bfeea7 Fix creating wxCairoContext from HDC (wxMSW)
HDC with negative x- or y-coordinate of the origin of the clipping region
is not supported by Cairo - either due to the Cairo bug
(prior to Cairo 1.15.12 - bug 96482) or by design (Cairo >= 1.15.12 -
4d07b57c16).
For such HDC we need to shift clipping region origin so that its coordinates
become >=0 and then pass this transformed HDC to Cairo surface.
To compensate this shift its value needs to be applied as an offset
added to the device coordinates when drawing to the surface.

See #22990.
2022-11-24 22:25:08 +01:00
ali kettab
2bf44c4f72 No real changes, just keep DoSetTickFreq() protected 2022-11-24 17:38:40 +01:00
ali kettab
f4088afbea Set wxSlider value on creation 2022-11-24 17:32:07 +01:00
ali kettab
4dfa2c66b4 Remove commented out code from wxSlider implementation 2022-11-24 17:28:19 +01:00
ali kettab
c4940c0838 Update wxMenuItem::SetItemLabel() documentation 2022-11-24 15:24:59 +01:00
ali kettab
a605ee3197 Don't pass hyphenated shortcuts to Qt
Although there is no official Qt documentation about supporting hyphenated
shortcuts or not, using them doesn't currently work (at least under Linux).

So make sure that we always pass a non hyphenated shortcut to Qt to work
correctly, and to display consistent shortcuts if there is a mix of standard
shortcuts and user supplied ones.
2022-11-24 14:15:02 +01:00
ali kettab
2345cc5650 Add extra accelerators support to wxQt 2022-11-24 14:15:02 +01:00
ali kettab
c717ed51a7 Enable radio check test for wxQt 2022-11-24 14:15:02 +01:00
ali kettab
bcf1bec4ed Add wxQtActionGroup class
The purpose of wxQtActionGroup is to synchronize QActions in the group
with their wx wrappers and make the menu test pass.
2022-11-24 14:15:02 +01:00
Vadim Zeitlin
227698840e Correct format specifier in wxFileName::Rmdir() debug message
The type of the argument is int, not long, so "l" shouldn't be used.
2022-11-23 19:56:46 +01:00
Vadim Zeitlin
21549149f0 Check that missing format string arguments are detected
We now assert if not enough arguments are given to a vararg function, as
we can actually do it when checking it all at once, unlike before when
we only checked for the matching format specifier for each argument, so
add a test verifying that this works as expected.
2022-11-23 19:21:36 +01:00
Vadim Zeitlin
ac4767c47f Add comment clarifying wx/strvararg.h status
This header contains a lot of stuff which is better left unchanged, as
updating application code using it would be quite non-trivial if we
removed it, but at least mention that it's unused and should be ignored.
2022-11-23 19:21:36 +01:00
Vadim Zeitlin
4bcf6f814a Stop using WX_DEFINE_VARARG_FUNC() macros for CRT vararg wrappers
Use variadic templates for them too, this is slightly more verbose, but
much more clear and simpler to read, debug etc.

We can now also easily combine the wxS[n]printf() overloads for char and
wchar_t buffers into a single template function.
2022-11-23 19:21:36 +01:00
ali kettab
3dc2bb7b98 Handle toggle() signal too in wxQtAction
Check the item in toggle() signal and send the event in triggered() signal
which emitted after.

We need this separation because triggered() is not emitted when setChecked()
or toggle() is called. The wxQtActionGroup (will be added in the next commit)
uses one of them to synchronize QActions with their wx wrappers and the menu
test will eventually pass.
2022-11-23 08:28:50 +01:00