Commit Graph

70953 Commits

Author SHA1 Message Date
Maarten Bent
7446c64333 Add script to determine proc count in CI 2021-07-24 16:38:28 +02:00
Maarten Bent
8fe396d890 Fix -Wundef warnings in iOS build
Make sure <Availability.h> is always included in macOS/iOS build.
2021-07-21 22:32:28 +02:00
Vadim Zeitlin
8b0decdf9d Merge branch 'univ_listbox_fixtest' of https://github.com/Kvaz1r/wxWidgets
Fix wxListBox in wxUniv to pass HitTest and ClickNotOnItem unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/2432
2021-07-17 20:41:50 +02:00
Vadim Zeitlin
d81d7b1563 Exclude .gitmodules from whitespace code style checks
This file uses TABs and can keep using them.
2021-07-17 20:41:18 +02:00
Kvaz1r
1e680157a9 Send event on toggle deselecting 2021-07-17 20:48:31 +03:00
Vadim Zeitlin
3489a07ad6 Avoid harmless MSVS 2019 variable shadowing warning
Rename a local variable to avoid clashing with the same name in an outer
scope, fixing a warning introduced in f41564a3e2 (Add
wxRegEx::ConvertFromBasic() helper, 2021-06-18).
2021-07-17 18:17:26 +02:00
Vadim Zeitlin
71d1ced5b8 Fix recently broken wxRegEx build in UTF-8 mode
Restore the use of c_str() replaced with wx_str() in 4dd77dabe8 (Check
for WXREGEX_CONVERT_TO_MB when calling regcomp() too, 2021-07-16), as
it's still necessary when wxUSE_UNICODE_UTF8==1.
2021-07-17 17:59:05 +02:00
Vadim Zeitlin
304d5e6c59 Merge branch 'regex-prepare-pcre'
Cleanup and simplify wxRegEx code.

See https://github.com/wxWidgets/wxWidgets/pull/2437
2021-07-17 17:13:38 +02:00
Vadim Zeitlin
fa1f7e74ce Merge branch 'deprecate-filename-normalize'
Deprecate wxFilename::Normalize() without flags and add convenient
GetAbsolutePath() to be used instead.

See https://github.com/wxWidgets/wxWidgets/pull/2428
2021-07-17 17:10:40 +02:00
Vadim Zeitlin
7ebb20fb04 Merge branch 'combo-simplify'
Simplify wxComboCtrl code by always using wxPopupTransientWindow if it's
available instead of various platform-specific workarounds that
shouldn't be needed any longer.

See https://github.com/wxWidgets/wxWidgets/pull/2423
2021-07-17 17:08:29 +02:00
Vadim Zeitlin
11d89a2233 Show "sys" when system liblzma is detected by configure
This is just a cosmetic change to make the lzma line in the summary
shown by configure at the end consistent with the other libraries.
2021-07-17 17:04:21 +02:00
Vadim Zeitlin
4dd77dabe8 Check for WXREGEX_CONVERT_TO_MB when calling regcomp() too
Make code more consistent by using the same approach as in the other
places where conversion is necessary in some builds and define temporary
variables for clarity.

Also use wx_str() when the conversion is not necessary rather than
c_str() as this is more efficient and allows to address an existing
FIXME comment.
2021-07-16 11:23:17 +02:00
Vadim Zeitlin
fb21f556a7 Use wxCharBuffer instead of manual allocations in GetErrorMsg()
Replace new[]/delete[] with a wxCharBuffer object.

Also check for conversion failure when converting the error message to
wide char string.
2021-07-16 11:17:32 +02:00
Vadim Zeitlin
d83368664c Remove unnecessary call to clear() in Replace()
There doesn't seem to be any need to clear the string in
WXREGEX_CONVERT_TO_MB case.
2021-07-16 11:02:48 +02:00
Vadim Zeitlin
838b693b46 Fix wxRegEx::GetMatch() to work in WXREGEX_CONVERT_TO_MB case
Using the offset into the wide string doesn't work for non-ASCII
characters, it must be converted to UTF-8 first.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
3a52523f96 Simplify code in wxRegExImpl::Replace()
Check for WXREGEX_CONVERT_TO_MB once and define textstr variable
pointing to the string data instead of using it several times.

No real changes.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
10dce93921 Remove handling of conversion errors that can't happen any more
Since we always convert to UTF-8, there can be no conversion errors and
we don't need to worry about them.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
78546007af Get rid of WXREGEX_IF_NEED_LEN() in wxRegEx code
Define wx_regexec() wrapper so that we can just drop the length if it's
not supported in one place, instead of having to use this ugly macro in
several places.

No real changes.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
8b812a92ae Always convert to UTF-8 if conversion is necessary
When using system regex functions in Unicode build, convert to UTF-8 and
not the current locale encoding, as this should work just as well if the
conversion doesn't fail and even better if it would fail when converting
to the current locale encoding because conversion to UTF-8 never does.
2021-07-16 00:06:31 +02:00
Vadim Zeitlin
f41564a3e2 Add wxRegEx::ConvertFromBasic() helper
This will be used to implement support for BREs using PCRE which doesn't
support them directly in the upcoming commits.
2021-07-15 22:45:29 +02:00
Vadim Zeitlin
020b5f7383 Add simple wxRegEx benchmark
Allow testing speed of some simple regex operations to compare the speed
of the currently used regex library with some other alternatives.
2021-07-15 21:44:28 +02:00
Vadim Zeitlin
8be998861d Use CHECK rather than REQUIRE in individual regex tests
Don't prevent the remaining CheckMatch() tests from running if one of
them fails by using CHECK() rather than REQUIRE().

This is a bit awkward and we probably ought to use sections here
instead, but this change is more minimal.

This commit is best viewed ignoring whitespace-only changes.
2021-07-15 21:44:28 +02:00
Vadim Zeitlin
381cd322ec Always skip the rest of regex tests checking for compile failure
It's useless to continue with testing the given regex if compiling it
has unexpectedly succeeded, all the rest of the tests will fail anyhow.

Also explain that REQUIRE() can't be used here, which is why we need to
use CHECK() and then check the same condition again before returning to
avoid the temptation to "simplify" things.
2021-07-15 21:44:28 +02:00
Vadim Zeitlin
862c051e9e Remove unnecessary calls to c_str() for wxLogError() arguments
Just pass strings to wxLogError() directly.

No real changes.
2021-07-15 21:44:28 +02:00
Vadim Zeitlin
94576538d3 Merge branch 'msw-install-docs'
Minor updates to wxMSW install docs.

See https://github.com/wxWidgets/wxWidgets/pull/2433
2021-07-15 21:42:12 +02:00
Vadim Zeitlin
3ec24bd981 Exclude cotire.cmake from white space checks
This is a third-party file using TABs for indentation.
2021-07-15 21:40:58 +02:00
JackBoosY
2f6dd5e80c Cmake: fix the generator expression with CUDA using file(GENERATE)
Closes https://github.com/wxWidgets/wxWidgets/pull/2404
2021-07-15 21:40:38 +02:00
Vadim Zeitlin
ed600d8304 Merge branch 'remove-travis' (except for the last commit)
Remove Travis-related scripts, checks and README badge.

See https://github.com/wxWidgets/wxWidgets/pull/2435
2021-07-15 21:36:01 +02:00
Vadim Zeitlin
63b4c5ee67 Remove checks for buildbot in the test suite
buildbot is not used since a long time, so don't bother checking for it
in IsAutomaticTest().

This commit is best viewed ignoring whitespace-only changes.
2021-07-15 19:59:11 +02:00
Vadim Zeitlin
278771e7d8 Remove mention of .travis.yml in Git attributes file
This file doesn't exist any longer.
2021-07-15 19:59:11 +02:00
Vadim Zeitlin
9aae8fc81f Remove checks for LXC containers used under Travis CI only
As we don't use Travis CI any longer, we don't need these checks
neither.
2021-07-15 19:55:01 +02:00
Vadim Zeitlin
a370de4caf Remove checks for TRAVIS environments variable from the tests
We don't use Travis CI any more, so this is now unnecessary.
2021-07-15 19:54:29 +02:00
JackBoosY
c284c88db1 CMake: fix wx-config --libs output for generators and abs paths
Don't prepend "-l" if a dependency is not a library name.

Closes https://github.com/wxWidgets/wxWidgets/pull/2402
2021-07-15 19:46:30 +02:00
Andrius Balsevičius
3c65bdedf1 Update Lithuanian translations
Also remove some incorrect "fuzzy" translations.
2021-07-15 19:39:08 +02:00
PB
346a31d545 Remove TravisCI mentions from build scripts
Travis CI is not used anymore, remove its mentions from the build scripts.
2021-07-15 13:53:12 +02:00
Vadim Zeitlin
d3eafa4d18 Fix compilation of wxFormBuilder-generated code using wxTE_XXX
Move definitions of wxTE_XXX flags that can be used with the controls
other than wxTextCtrl to wx/defs.h, as wxFormBuilder generates code
using them without including wx/textctrl.h, so that this code doesn't
compile.

This was already addressed in 2970f22a89 (Include <wx/textctrl.h> from
<wx/combobox.h> for compatibility., 2012-03-25) for wxComboBox, but it
also happened for wxSpinCtrl, so fix it once and for all by always
defining these styles.

This partially reverts the changes done in c57e33394c ([...] moved
wxTextCtrl-specific stuff from defs.h/event.h to textctrl.h, 2001-07-29)
as it turns out, 20 years later, that this wasn't such a great idea.

See #14132.

Closes #19225.
2021-07-14 21:40:45 +01:00
James Pan
31d04f0396 Update Traditional Chinese translations 2021-07-14 22:39:27 +02:00
PB
91f6bee71b Remove TravisCI build scripts
Travis CI is not used anymore, remove its scripts.
2021-07-14 22:34:27 +02:00
PB
89242efa78 Remove TravisCI badge from readme
Travis CI is not used anymore, so remove its build status badge
from the main readme.
2021-07-14 09:00:59 +02:00
Stefan Ziegler
0ac8a75e97 Initialize wxPrintData to the appropriate defaults in wxMSW
Initialize DEVMODE to the per-user default printer settings or, failing
that, to the global default settings.

Closes https://github.com/wxWidgets/wxWidgets/pull/2422
2021-07-13 23:50:22 +01:00
Vadim Zeitlin
3b8c023744 Use GlobalPtr instead of manual Global{Alloc,Free}() calls
No real changes, just use RAII wrapper instead of doing manual memory
management in wxMSW printing code.

We still use a raw pointer for m_devMode, but changing this would be
more involved, so leave it be for now.
2021-07-13 23:49:34 +01:00
Vadim Zeitlin
3b5a0914dc Add GlobalPtr::Release() to wxMSW private header
Add a unique_ptr<>-like function to this RAII HGLOBAL wrapper.

This is not used yet, but will be in the upcoming commit.
2021-07-13 23:39:03 +01:00
Vadim Zeitlin
fbedac8fa6 Merge branch 'dpi-scale'
Add wxDPIChangedEvent::Scale() and use it in our own code.

See https://github.com/wxWidgets/wxWidgets/pull/2429
2021-07-13 23:06:34 +01:00
Vadim Zeitlin
b9a2469ace Use wxRescaleCoord() in wxMSW DPI update code too
Use the same scaling function as elsewhere instead of using
ceil/floor().

Provide wxRescaleCoordWithFrom specialization for int to allow using it
with just single coordinates too.
2021-07-13 23:05:17 +01:00
Vadim Zeitlin
035c29e6a2 Make wxRescaleCoord() safer by requiring explicitly using From/To
This should help with accidentally exchanging the order of parameters
and makes the code using this function more readable.

No real changes.
2021-07-13 23:05:17 +01:00
Vadim Zeitlin
7843c99d5b Make wxRescaleCoord() private functions
They're probably not that useful in application code, which should just
use wxDPIChangedEvent::Scale() instead, so move them to a private
header instead of making them part of the public API.
2021-07-13 23:05:16 +01:00
Vadim Zeitlin
3787f55a6b Add wxDPIChangedEvent::Scale() and use it in this event handlers
This is more concise and less error-prone than multiplying/dividing DPI
values manually.

No real changes except, maybe, in wxSlider code where the rounding was
done differently before for some reason.
2021-07-13 23:05:16 +01:00
Vadim Zeitlin
453468f2f9 Add wxRescaleCoord() helper and use it
No real changes, just make the code a bit shorter and more clear by
using a dedicated function rather than wxMulDivInt32() directly.
2021-07-13 23:05:16 +01:00
Vadim Zeitlin
7c6f290995 Document wxMulDivInt32() and add a test for it
This function exists since always and is probably already used outside
wx, so make it officially public and add at least a trivial unit test
for it.
2021-07-13 23:05:16 +01:00
Vadim Zeitlin
760f327c24 Update MinGW build instructions
Don't mention Cygwin any more, except as a build environment.

Do mention MSYS2 and WSL.
2021-07-13 14:59:07 +02:00