Commit Graph

71396 Commits

Author SHA1 Message Date
Vadim Zeitlin
ce0f10c377 Get dates directly from table in wxGridCellDateEditor if possible
Unlike wxGridCellDateRenderer, which already did it, the editor class
always got the cell value from the table as a string, even if the table
supported returning the dates directly.

Fix this by using the same code in the editor as in the renderer, which
required a further refactoring in order to make it reusable: the helper
TryParseDate() was replaced with TryGetValueAsDate() and DateParseParams
was added to allow overriding the arguments passed to it in the
overridden wxGridCellDateTimeRenderer::GetDateParseParams().
2020-11-03 17:30:54 +01:00
Vadim Zeitlin
9311dc8ffb Remove redundant wxGridCellDateTimeRenderer::SetParameters() docs
This function is inherited from wxGridCellDateRenderer since the changes
of 659ab78c6d (Add support for editing dates (without time) to wxGrid,
2018-09-06), so there is no need to document it separately.
2020-11-03 03:14:43 +01:00
Vadim Zeitlin
cced297b26 Remove unused wxGridCellDateTimeRenderer::m_dateDef
This has apparently never been really used ever since it was added in
d10f4bf950 (applied tons of wxGrid patches, 2001-05-27).
2020-11-03 03:09:17 +01:00
Vadim Zeitlin
705006615f Add support for date format to wxGridCellDateEditor too
This is needed to allow editing the cells using wxGridCellDateRenderer
with a custom format, otherwise the editor might parse the contents of
the cell differently from what is actually shown.

In particular, this ensures that using "date:%d.%m.%y" (or any other
custom format) as "cell type" works correctly, which wasn't the case
before.
2020-11-03 02:57:22 +01:00
Vadim Zeitlin
56ec476a3a Refactor wxGridCellDateRenderer::Parse() to make it reusable
No real changes, just create TryParseDate() helper in order to allow
reusing it from wxGridCellDateEditor too in the upcoming commit.
2020-11-03 02:50:31 +01:00
Vadim Zeitlin
eda11b8755 Use specified format in wxGridCellDateRenderer if possible
For the tables that store dates as strings, we must use the specified
format for interpreting the table data, as otherwise we could confuse
the user by showing it incorrectly: for example, if "%d.%m.%y" format is
used, "01.03.02" should really mean 2002-03-01, but it was parsed as
0002-01-03 by ParseDate() which had no choice but to guess the order of
data components.
2020-11-03 02:37:02 +01:00
Vadim Zeitlin
bd8c74f368 Fix positioning of bottom-aligned checkboxes in wxGrid
This fixes a bug due to a typo in ab02d36e10 (Account for vertical
alignment in wxGetGridCheckBoxRect() too, 2019-11-22) which used the
vertical component of a wrong object and so didn't actually offset the
checkbox by its size from the bottom of the cell rectangle, as it should
have done.

Closes #18907.
2020-11-02 00:55:47 +01:00
Vadim Zeitlin
2b0dd6dfe3 Don't claim that Enter sends wxEVT_SPINCTRLDOUBLE in wxSpinCtrl
This isn't actually true and doesn't seem to make much sense, so simply
remove the fragment claiming this from the documentation.

Closes #18900.
2020-11-02 00:40:15 +01:00
Vadim Zeitlin
a8efad16f1 Fix size of toolbar realized before being set in wxMSW
Use the best size and not the actual size of the toolbar in
wxFrame::PositionToolBar(), called from SetToolBar(), as for a toolbar
which had been previously realized its size could have been set to the
entire client area size -- as is normal for any non-special child
window, and before being associated with the frame using SetToolBar() a
toolbar is not special too.

Using the current size was probably a workaround for GetBestSize() not
returning correct results in wxMSW and so shouldn't be needed any longer
after the changes of 1a79610361 (Rewrite wxToolBar resizing logic in
wxMSW, 2019-02-24) and now just results in using wrong size for toolbars
not created using CreateToolBar().

Closes #18954.
2020-11-01 23:12:24 +01:00
Vadim Zeitlin
683b71e642 Merge branch 'grid-select-none'
Add wxGrid::wxGridSelectNone selection mode.

Closes https://github.com/wxWidgets/wxWidgets/pull/2100
2020-10-31 17:16:34 +01:00
Vadim Zeitlin
f765c06f1a Show new wxGridSelectNone mode in the grid sample
Allow testing the new selection mode interactively.
2020-10-31 17:13:06 +01:00
Gary Allen
095d1e317c Add wxGridSelectNone selection mode
In this mode the user can't select any cells at all in wxGrid.
2020-10-31 17:01:36 +01:00
Vadim Zeitlin
a64348f3e4 Merge branch 'misc-changes' of https://github.com/MaartenBent/wxWidgets
Update CMake with recent changes, remove more Borland checks.

See https://github.com/wxWidgets/wxWidgets/pull/2098
2020-10-31 16:30:29 +01:00
Vadim Zeitlin
312a760029 Merge branch 'dvc-fix-item-added'
Fix adding items to generic wxDVC again.

See https://github.com/wxWidgets/wxWidgets/pull/2095
2020-10-31 16:29:02 +01:00
Paul Cornett
50c7b4278f Ignore invalid file notification events
See #18953
2020-10-30 10:12:55 -07:00
Paul Cornett
d59b68c9eb Add some additional values to wxImage::RGBtoHSV test 2020-10-30 09:36:37 -07:00
Stefan Brüns
c3873ea313 Use proper rounding when casting RGB values to int
When doing an RGB->HSV->RGB roundtrip, the original value should be
restored (HSV, being double, has sufficient precision).

For e.g. `RGBValue(1,2,3)`, the equivalent resulting code for blue is
`trunc(int * 255.0 / 255.0)` (cast from double to int truncates).
At least with x87 FP math and its immediate 80bit extended precision
the resulting value is ~trunc(2.9999..), i.e. 2, similar problems may
exist on other architectures with other values.

Using proper rounding avoids the error magnification.

Closes https://github.com/wxWidgets/wxWidgets/pull/2078
2020-10-30 09:32:32 -07:00
Paul Cornett
a3f14b2fc2 Remove redundant code
Should have been done in
533bedbf30 (fix aui crash related to SF bug 1531361, 2006-10-31)
2020-10-29 06:13:29 -07:00
Paul Cornett
0cae4399bd Make awk script compatible with default Solaris /usr/bin/awk
See #18950
2020-10-25 23:31:47 -07:00
Igor Ivanov
90bfddef2d wxWidgetCocoaImpl::SetDropTarget fix. (#2102) 2020-10-25 11:19:22 +01:00
Paul Cornett
0a70d3241d Fix Solaris compiler errors "Cannot cast from void* to integer of smaller size" 2020-10-23 19:42:24 -07:00
Paul Cornett
ba4df6d996 Build fixes for GTK < 2.14 2020-10-23 09:35:37 -07:00
Paul Cornett
21d5f3f4a1 Avoid crash if wxMessageBox() is called before GTK is initialized
See https://github.com/wxWidgets/wxWidgets/pull/2099
2020-10-23 09:20:08 -07:00
Robin Dunn
15f1f7a9e5 Merge pull request #2088 from wxWidgets/fix-image-bitmap-mask
Use the original image to check for a mask
2020-10-22 14:03:49 -07:00
Maarten Bent
6a579ce34d Include windows.h in native dialog sample resource file
Get rid of compiler specific include.
2020-10-21 01:01:26 +02:00
Maarten Bent
c2819c8d38 Update indentation in native dialog sample 2020-10-21 00:57:42 +02:00
Maarten Bent
a942dc8a76 Remove hard-coded size and position in native dialog sample 2020-10-21 00:54:28 +02:00
Maarten Bent
1a2d81354e Don't call SetupColours when loading a native dialog
It makes everything grey.
2020-10-21 00:52:20 +02:00
Maarten Bent
badf0eb64e CMake: add image test files 2020-10-20 21:11:17 +02:00
Maarten Bent
b1653024d6 CMake: remove HAVE_VARIADIC_MACROS check 2020-10-20 20:39:05 +02:00
Maarten Bent
1d6a6b934f Remove a borland check 2020-10-20 20:38:30 +02:00
Maarten Bent
2e56f1a8d3 Remove more BCC-specific hdrstop pragma 2020-10-20 20:38:01 +02:00
Vadim Zeitlin
a3ea09d3e3 Revert "Increase LSAN verbosity in Travis CI builds"
This reverts commit 7ec39330d2 because
enabling verbose ASAN output results in too much output for Travis to
handle (and, to be fair, for it to be useful).
2020-10-20 18:41:40 +02:00
Vadim Zeitlin
7ec39330d2 Increase LSAN verbosity in Travis CI builds
Its own error message recommends using these options if it fails (as it
did in one of the builds with an irreproducible crash), so try doing it.
2020-10-20 15:57:09 +02:00
Bill Su
7e9afad53a Add real support for monochrome bitmaps to wxMSW
In order to be able to use monochrome bitmaps as wxMask, improve support
for them in various ways:

1. Implement loading and saving of monochrome BMP files.
2. Add wxMonoPixelData for direct access to monochrome bitmap pixels.
3. Implement conversion from wxImage to monochrome wxBitmap.

Closes https://github.com/wxWidgets/wxWidgets/pull/2032
2020-10-20 15:52:55 +02:00
Vadim Zeitlin
c0e3bdaab9 Merge branch 'remove-outdated-gcc-checks'
Remove vestiges of support for gcc < 4 and related checks.

See https://github.com/wxWidgets/wxWidgets/pull/2096
2020-10-20 15:49:20 +02:00
Tobias Taschner
038782a684 Update WebView Edge min required version to 1.0.622.22
While technically it still builds with older versions,
version 1.0.622.22 ist the first non preview release which should
make the included webview loader DLL the most compatible for the
forseable future.
2020-10-20 15:12:09 +02:00
Vadim Zeitlin
da3aef753e Remove variadic macros test from configure
This is useless, all still supported compilers except ancient MSVS
versions (for which configure is not used anyhow) support variadic
macros, so don't waste time testing for them.

Note that the checks for HAVE_VARIADIC_MACROS in the sources are still
left because it is still possible to explicitly disable variadic macros
support using --disable-vararg_macros for strict C++98 compatibility.
2020-10-20 01:59:00 +02:00
Vadim Zeitlin
426a0ed527 Remove HAVE_W32API_H definition and checks
All still supported versions of MinGW/Cygwin provide w32api.h file, so
there is no need to test for it.

This allows to simplify the code, but also remove the definition of
HAVE_W32API_H from bake- and makefiles and this, in turn, allows to get
rid of extra flags in MinGW format entirely, as we don't support gcc
2.95 for which they were originally needed neither.
2020-10-20 01:47:47 +02:00
Vadim Zeitlin
4abb816f70 Merge branch 'fix-and-run-tests-with-asan'
Fix issues found by address/leak sanitizers in the unit tests and add
Travis CI build running tests built with ASAN to ensure they don't
reappear in the future.

See https://github.com/wxWidgets/wxWidgets/pull/2086
2020-10-19 21:16:27 +02:00
Vadim Zeitlin
fec33079ed Relax French date/time locale unit test to ignore trailing "%Z"
The version of glibc used under Ubuntu 20.04 doesn't have "%Z" in the
French date-time locale, which broke the test there.

Instead of adding even more tests for glibc version, just ignore "%Z" if
it's present, we don't really care about it, we just want to check that
wxLocale::GetInfo() returns something recognizably different from C and
English locale here.
2020-10-19 21:14:27 +02:00
PB
6fbacb20d8 Remove checks for wxNEEDS_CHARPP
wxNEEDS_CHARPP was needed only for now unsupported GCC versions.
2020-10-19 20:07:16 +02:00
PB
a7df23d43c Remove checks for outdated GCC versions
wxWidgets now supports only GCC 4 and newer, so there is no reason
to keep code specific for older GCC versions.
2020-10-19 19:38:53 +02:00
Vadim Zeitlin
a2923a6fad Select GTK version explicitly when configuring Travis CI builds
Don't rely on just a single GTK version being installed on the system,
as we do now, but select the version we want explicitly, just to avoid
bad surprises in the future (even if it doesn't change anything for
now).
2020-10-19 16:51:36 +02:00
Vadim Zeitlin
7859163e66 Require specifying wxGTK_VERSION for wxGTK builds on Travis CI
This avoids accidentally using a wrong GTK version, as it happened for
e.g. ARM64 build.
2020-10-19 16:50:56 +02:00
Vadim Zeitlin
5e7e07dcd1 Specify wxGTK_VERSION explicitly for all Travis CI builds
It default to 2 currently, which is rather surprising, so prepare for
requiring specifying it explicitly by adding wxGTK_VERSION to all wxGTK
builds environments.
2020-10-19 16:45:57 +02:00
Vadim Zeitlin
3d282aa380 Remove useless --disable-optimise option from ANSI Travis build
This is already added unconditionally in build/tools/travis-ci.sh
anyhow, so there is no need to specify it here.
2020-10-19 14:03:33 +02:00
Ilya Sinitsyn
0310347dc4 Add wxGTK build with ASAN to Travis CI
Compile and link with `-fsanitize=address` options to find memory related
errors.
2020-10-19 14:03:24 +02:00
Ilya Sinitsyn
fe7230e19c Suppress spurious accessibility bus errors in Travis CI builds
These errors don't matter, so just avoid them in the build logs by
setting NO_AT_BRIDGE environment variable.
2020-10-19 13:54:19 +02:00
Ilya Sinitsyn
b95a79d74e Fix global read overrun error in MBConvTestCase
Use null-terminated copy of the input buffer to create the formatted
message instead of "multiBuffer" itself, which isn't.
2020-10-19 13:54:19 +02:00