Commit Graph

71689 Commits

Author SHA1 Message Date
Vadim Zeitlin
c39c119707 Try to force compiler choice to MSVC
Otherwise clang compiler is being chosen, even if MSVC should be
available.
2021-12-09 23:09:18 +01:00
Vadim Zeitlin
17e307ae67 Skip install step under MSW
This wouldn't work anyhow as "sudo" doesn't exist under this platform.
2021-12-09 20:23:44 +01:00
Vadim Zeitlin
25ede89983 Use bash for all build steps for MSW CMake build
Otherwise references to the variables don't work as expected.
2021-12-09 20:22:48 +01:00
Be
4ab869543f Add CMake build with MSVC to GitHub Action CI workflow 2021-12-09 20:09:21 +01:00
Vadim Zeitlin
933ac7afbb Merge branch 'dvc-null-values'
Improve handling of null values in wxDataViewCtrl to be more compatible
with the earlier versions.

See https://github.com/wxWidgets/wxWidgets/pull/2602

See #18934.

Closes #19333.
2021-12-09 20:00:50 +01:00
Maarten Bent
248927a090 CMake: Never add static runtime flags on macOS
This option is disabled in the GUI, but users can still specify it on the
command-line. Never add the linker flags to prevent errors (unsupported option
'-static-libgcc') or warnings (argument unused during compilation:
'-static-libstdc++').

Closes https://github.com/wxWidgets/wxWidgets/pull/2612

Closes #19330.
2021-12-09 19:59:15 +01:00
Richard Gibson
c3d5853faa Fix handling symlinks in wxOSX wxFileSystemWatcher
Set the correct file path for symlink creation/deletion events.

Closes https://github.com/wxWidgets/wxWidgets/pull/2611
2021-12-09 19:57:00 +01:00
Simon Stone
0fc936ca41 Add wxIntegerValidatorctor ctor taking minimum and maximum value
Using this ctor is more convenient than using the default ctor and then
calling SetMin() and SetMax().

Document the new ctor and add tests showing that minimum and maximum
values are actually respected.

Closes https://github.com/wxWidgets/wxWidgets/pull/2610
2021-12-09 19:55:44 +01:00
Marco DeFreitas
a2389fc512 Add wxApp::GTKSuppressDiagnostics()
This allows to avoid GTK messages that are often more annoying and
confusing than useful.

Closes https://github.com/wxWidgets/wxWidgets/pull/2609

Closes #19347.
2021-12-09 19:52:07 +01:00
Scott Talbert
a0eb355e12 Add wxDF_UNICODETEXT to wxDataFormat standard format docs
Closes https://github.com/wxWidgets/wxWidgets/pull/2608
2021-12-09 19:51:07 +01:00
Vadim Zeitlin
9bdce3077c Avoid MSVC bool conversion warning in wxBitmapBundle::IsOk()
This avoids C4800 from MSVC if this warning is enabled (it is disabled
by default in recent versions of the compiler).
2021-12-08 20:27:46 +01:00
Jouk
f9b1d71dab add bmpsvg.cpp for compilation on OpenVMS 2021-12-06 13:31:54 +01:00
Artur Wieczorek
67752c3870 Validate the value in the first and last property of wxPropertyGrid
wxPGProperty value edited in the first or last property of wxPropertyGrid
should be validated while attempting to navigate to the previous/next
property.

Closes #19315.
2021-12-04 12:18:20 +01:00
Vadim Zeitlin
552c9dd4ff Fix wxMSW wxDateTimePickerCtrl build with wxUSE_UNICODE_UTF8
Don't use the ternary operator as t_str() doesn't return a pointer in
this build configuration.

Also remove outdated (and maybe even wrong) comment about MinGW headers,
as it's better to use a temporary variable just to avoid writing the
cast explicitly anyhow.

Closes #19338.
2021-12-03 15:49:30 +01:00
novak
cb3f8f3a5c Fix printing framework compilation with wxUSE_VALIDATORS=0
Include wx/textctrl.h, required here because wxTextCtrl is used as the
base class of wxPrintPageTextCtrl, explicitly instead of relying on it
being implicitly included by something else, as it happens in the
default build but not when validators are disabled.

Closes #19337.
2021-12-03 15:46:43 +01:00
novak
c498d6d090 Fix wxBusyInfo compilation when wxUSE_MARKUP=0
Just use SetLabelText() instead of SetLabelMarkup() in this case, as
it's already done elsewhere.

Closes #19336.
2021-12-03 15:44:52 +01:00
Vadim Zeitlin
8311951f03 Don't use wxVector<T>::clear() when T is an incomplete type
At least the OpenVMS compiler doesn't like it and we can easily avoid
doing this by simply moving ClearExtraAccels() definition to the source
file.
2021-12-03 15:37:11 +01:00
Vadim Zeitlin
149db36bc8 Fix memset_s() compilation errors under macOS with some SDKs
Define __STDC_WANT_LIB_EXT1__ as early as possible to ensure that it's
defined before string.h is included by some other header without it.

Closes #19334.
2021-12-03 15:23:26 +01:00
Vadim Zeitlin
30fceb1d92 Merge branch 'define-use-svg-in-features.h'
Move wxUSE_SVG definition to wx/defs.h and work around OpenVMS
compilation problems.

See https://github.com/wxWidgets/wxWidgets/pull/2606
2021-12-03 15:20:51 +01:00
Vadim Zeitlin
35e97d9d50 Use wxDPIChangedEvent::ScaleX() for a horizontal coordinate
This doesn't really change anything as the scaling factor is always the
same in both directions currently, but is more consistent with the other
places where Scale[XY]() are used.

This slightly amends the changes of 3787f55a6b (Add
wxDPIChangedEvent::Scale() and use it in this event handlers,
2021-07-11).
2021-12-03 15:20:31 +01:00
Vadim Zeitlin
9e050fb1c5 Include NanoSVG headers before including (almost) any wx headers
OpenVMS C++ compiler can't compile NanoSVG headers after including
wx/unichar.h, so include them as soon as possible, i.e. right after
wx/wxprec.h but before anything else.

This commit is best viewed with --color-moved git option.
2021-12-02 15:31:04 +01:00
Vadim Zeitlin
882a339a48 Move wxHAS_SVG definition to wx/features.h
This is more consistent with the other wxHAS_XXXs and makes it possible
to only include wx/bmpbndl.h in bmpsvg.cpp if SVG support is indeed
available.
2021-12-02 15:25:06 +01:00
Vadim Zeitlin
aef263888b Merge latest Catch v1.x branch into our version
There should be no more changes on this branch, and the ones so far are
not very important, but still update to its final version just for
consistency.
2021-12-02 15:11:04 +01:00
Tobias Taschner
bbca67df67 Implement wxFSVolume for macOS
Implement with NSFileManager and NSURL to provide basic functionality
like on MSW. Icons are not implemented for macOS.
2021-12-01 23:35:19 +01:00
David Connet
83886bf18f Update install notes with instructions for building using Xcode
Notable document the special incantation needed by Xcode to use the
inherited environment variables.

Closes https://github.com/wxWidgets/wxWidgets/pull/2603
2021-12-01 23:28:38 +01:00
Vadim Zeitlin
419a97a791 Merge branch 'svg-file'
Add wxBitmapBundle::FromSVGFile() helper.

See https://github.com/wxWidgets/wxWidgets/pull/2600
2021-12-01 23:27:33 +01:00
Scott Talbert
82735e8612 Use wxSpinCtrl best size in wxGenericCalendarCtrl::DoGetBestSize
This fixes the wxGenericCalendarCtrl on wxGTK3 where the SpinCtrl is
much wider than on other platforms and should also ensure that the
control is always big enough in all locales under Mac.

Closes https://github.com/wxWidgets/wxWidgets/pull/2604

Closes #11444.
2021-12-01 23:23:34 +01:00
Vadim Zeitlin
26efd904ec Improve wxDataViewModel::GetValue() documentation
Document that this function can leave the provided wxVariant null and
not return anything, but that if it does return some value, it must be
of the appropriate type.
2021-12-01 01:48:53 +00:00
Vadim Zeitlin
0c944ff5be Test returning invalid value from GetValue() in dataview sample
Add an item with unspecified year and update the custom model GetValue()
to not return anything in this case to check, and confirm, that all
implementations handle this properly by simply not showing anything in
the cell in this case.
2021-12-01 01:43:52 +00:00
Vadim Zeitlin
74e1c444fa Don't show bogus value when there are none in wxGTK wxDVC neither
This is similar to the previous change to the generic version and simply
applies the same logic to the cells for which GetValue() returns null
value as for those for which HasValue() returns false.
2021-12-01 01:43:52 +00:00
Vadim Zeitlin
55420130b5 Don't use items without values in generic wxDVC
In particular, don't draw them, as this would reuse the value of the
previously drawn item, which would be wrong -- just leave them blank if
PrepareForItem() returned false, which happens if GetValue() returned a
null value or a value of a wrong type.
2021-12-01 01:43:52 +00:00
Vadim Zeitlin
9cb360a0aa Don't call SetValue() with null value in wxOSX wxDVC
We can't guarantee that GetValue() returns a valid value, even if
HasValue() returned true, so avoid calling SetValue() if it returned an
invalid one, as this risks triggering an assert failure and because this
function is typically called when repainting the control, there is a
good chance that we're going to reenter it while showing the assert
dialog box, resulting in an abort, which is not the best way to handle
GetValue() not returning a valid value -- especially when the generic
version doesn't do this, so the problem risks only appearing when
porting to Mac.
2021-12-01 02:22:06 +01:00
Vadim Zeitlin
1ef8d1d48f Avoid warning about not supporting setAccessoryViewDisclosed:
We call it inside the check ensuring that it is supported, so suppress
this warning (introduced in the recent e765756555 (OSX file dialog
extensions (#2592), 2021-11-26)) by casting the receiver to the generic
type, just as it's already done elsewhere in wxOSX code.
2021-12-01 00:05:35 +01:00
Vadim Zeitlin
95b7a2f183 Return false from PrepareForItem() if there is no value
This corresponds to the behaviour described in the comment and is more
useful than always returning true.
2021-11-30 23:03:28 +00:00
Vadim Zeitlin
26c6273a70 Fix crash when setting wxGTK wxNotebook image after creation
The bug was introduced in 9d86ba11e2 (Add support for wxBitmapBundle to
wxGTK wxNotebook, 2021-11-07) after which wxGtkNotebookPage::m_image
remained uninitialized if the page didn't have an image initially, so
fix it by simply initializing this pointer to NULL in this case.

It would arguably be better if wxGtkNotebookPage initialized all its
members in the ctor, but for now just fix the critical bug.

Closes #19332.
2021-11-30 18:13:21 +01:00
Paul Cornett
1c752e24f1 doc typo 2021-11-29 08:54:41 -08:00
Paul Cornett
982a030705 Remove some incorrect ifdefs from wxGenericTreeCtrl
It's clear from the change history (relevant commits listed below) that these
are leftovers from code that is long gone.

ccdbdc8936 (Added native selection rectangle drawing., 2006-11-11)
05d9753817 (Just use the already existing wxRenderer::DrawItemSelectionRect(), 2006-11-14)
a4609ab847 (Implement wxRendererMac::DrawItemSelectionRect and move the generic wxTreeCtrl to using it to draw selected items., 2006-11-19)
2021-11-29 08:53:23 -08:00
Vadim Zeitlin
a65e5f4c1d Explain better how to add data files to a sample
Also don't duplicate this information in both how-to-add-new-sample.md
and how-to-add-files-to-build-system.md, just reference the former in
the latter instead.

Also fix some Markdown markup.
2021-11-29 13:58:52 +01:00
Vadim Zeitlin
1a0eeed0a8 Ignore commit only removing white space for git blame purposes
That commit didn't really change anything, so it's annoying to have the
changes be attributed to it.
2021-11-29 13:58:52 +01:00
Vadim Zeitlin
2435ceb2bb Add a possibility to show SVG images to the image sample too
This is useful at least for demonstrating wx SVG support.
2021-11-29 12:55:22 +00:00
Vadim Zeitlin
8adfaa37f7 Add wxBitmapBundle::FromSVGFile() helper
This is just a trivial wrapper for wxBitmapBundle::FromSVG(), but it can
still be convenient to have.
2021-11-29 12:55:22 +00:00
Vadim Zeitlin
5efcaf4e59 Fix copying testdata.fc file to the tests build directory
This file was listed in test.bkl but wasn't actually copied because the
value of <files> was overwritten by another <files> just below ever
since the changes of 21fe35aff7 (add wxImage test units to test loading
from both seekable and non-seekable streams, 2009-06-01).

Fix this by splitting this wx-data into 2 different ones, to avoid this
conflict.
2021-11-28 22:16:12 +01:00
Vadim Zeitlin
d14e035580 Fix uses of wxDEPRECATED in WXWIN_COMPATIBILITY_2_8-only code
wxDEPRECATED must be used for the entire declaration to really work,
but this wasn't the case for a few functions (and one typedef) guarded
by WXWIN_COMPATIBILITY_2_8, resulting in gcc -Wattributes warning about
the attribute being ignored and the declaration not being really marked
as deprecated.

Fix this by applying the deprecation macro to the entire declaration,
which works well for gcc and should hopefully work for MSVC too.
2021-11-28 21:42:06 +01:00
Artur Wieczorek
9febbe2b30 Explicitly cast AutoHRGN to HRGN to unify types in the statement
This seems to be required by MinGW compiler.
2021-11-28 19:32:02 +01:00
Paul Cornett
03706e9fef Fix build with WXWIN_COMPATIBILITY_2_8==1
Use wxBitmapBundle to avoid wxToolBar::AddTool() ambiguity
2021-11-28 08:48:50 -08:00
Paul Cornett
9a40669aad Fix build with WXWIN_COMPATIBILITY_2_8==1
Reverts what seems to be an unintentional change from
5ae30d2fbe (Use wxBitmapBundle() instead of wxNullBitmap as default value, 2021-11-12)
2021-11-28 08:44:13 -08:00
Artur Wieczorek
fc6bfbc0bf Add tests of clipping regions with wxDC with RTL layout enabled 2021-11-28 17:05:34 +01:00
Artur Wieczorek
288b208a0a Fix setting clipping region for wxDC with RTL enabled (wxMSW)
It turns out that region being added to DC with enabled RTL layout needs
to be defined using mirrored device x-coordinates.
So if we have DC with RTL layout we need to create a temporary mirrored
region and pass it to the DC instead of the original one.

Closes #19325.
2021-11-28 17:04:26 +01:00
Paul Cornett
b04c1ace47 Avoid integer overflow when computing image data size in wxImage::Create()
See #19326

Co-Authored-By: David Costanzo <david_costanzo@yahoo.com>
2021-11-27 17:14:28 -08:00
utelle
deef116a09 Update language database and move support for it to wxUILocale
Update the language database from the canonical sources:

- It now includes most locales supported by Windows 10.
- It now also has the following attributes for each entry:
 - BCP 47-like locale tag.
 - Reference to canonical name for generic language entries.
 - Language name in this language itself.
- Also add data file with list of language script identifiers and
  aliases based on ISO 15924.
- And update genlang.py to handle all the new attributes and data.

Also move database-related methods of wxLocale to wxUILocale and
just redirect wxLocale methods to the new wxUILocale ones (they are
still preserved for compatibility).

Closes https://github.com/wxWidgets/wxWidgets/pull/2594
2021-11-27 17:44:20 +01:00