Commit Graph

72213 Commits

Author SHA1 Message Date
Vadim Zeitlin
31bdfd6523 Make CreateDataObject() return wxDataObjectComposite
This function must return a composite data object and not just any
wxDataObject because its callers cast the returned object to this class,
so make it a bit more type-safe.
2021-12-10 20:06:30 +01:00
Vadim Zeitlin
352923dc8d Make wxDataViewCtrlBase::CreateDataObject() static
This function doesn't need to be virtual as it's not meant to be
overridden in, but just called from the derived classes. In fact, it
doesn't even have to be a member function at all, but leave it in the
class for now to avoid having to create a new header just for it, but
make it static.

Also add a comment explaining what is it for and what it does.
2021-12-10 20:00:15 +01:00
Vadim Zeitlin
cd555f9ff5 Use vector instead of array of wxDataFormats
Also rename EnableDropTarget() to EnableDropTargets(), as calling
EnableDropTarget(wxDF_XXX) would be ambiguous due to the existence of a
non-explicit wxVector ctor taking size_t (which is a mistake on its own,
but is probably not worth changing any more).
2021-12-10 19:57:41 +01:00
Vadim Zeitlin
1499d7d45b Handle wxDF_PNG in wxDataViewCtrlBase::CreateDataObject() too
If nothing else, this avoids warnings about missing enum element in the
switch.
2021-12-10 19:57:41 +01:00
Vadim Zeitlin
a0e32cadd9 Slightly improve wording in EnableDropTarget() documentation
No real changes.
2021-12-10 19:57:39 +01:00
Vadim Zeitlin
a279c7b607 Update the version in which EnableDropTarget() overload was added 2021-12-10 19:56:52 +01:00
valid-ptr
7129d2b11c Accept multiple data formats via drag-and-drop in wxDataViewCtrl
Allow specifying multiple formats to be accepted when dragging data to
wxDataViewCtrl in the generic and Cocoa implementations.

Add wxDataViewCtrlBase::EnableDropTarget() overload taking an array of
wxDataFormats to support this at the API level.

Add new DoEnableDropTarget() used by both EnableDropTarget() overloads
and implement it in the generic and Cocoa ports. GTK implementation
still uses only a single format, as before.

Also refactor the Cocoa implementation: all operations using dragged
data are now handled by wxDropTarget and unnecessary DataViewPboardType
as removed.

Update the dataview sample to show the new functionality.
2021-12-10 19:55:44 +01:00
Vadim Zeitlin
d30986be78 Merge branch 'ci-cmake-msvc'
Add CMake build using MSVC with ninja to GitHub Action CI workflow.

See https://github.com/wxWidgets/wxWidgets/pull/2613
2021-12-10 19:04:11 +01:00
Vadim Zeitlin
ddde0f1eea Reenable cmake install step for Windows builds
Just skip using sudo under this OS, but still run "cmake install" as
this is required for the final test, checking the installation success,
to work.
2021-12-10 18:00:38 +01:00
Vadim Zeitlin
d1b5fd27aa Enable long path normalization test by default
It seems that the default value of NtfsDisable8dot3NameCreation registry
value is 2, and not 0, since a very long time (at least Windows 7), so
the wxPATH_NORM_LONG test was never actually executed.

Change the check guarding it to check if the value of the key is
different from 1 instead of checking that it is 0, as the test can still
succeed on the systems where this is the case.

Of course, it can also fail, if short names are disabled for the current
volume, but let's see if this is a problem in practice before doing
something more complicated to deal with this case.
2021-12-10 17:27:06 +01:00
Vadim Zeitlin
b247a1ee70 Use testdata.conf for the wxPATH_NORM_LONG test
This file already exists in the test directory, as it's used by another
test, so just use it instead of relying on the existing of mkinstalldirs
in the parent directory, which is not guaranteed as CMake build runs the
tests from a different directory, which is not the immediate child of
the top source directory.
2021-12-10 17:27:02 +01:00
Vadim Zeitlin
1e683c1401 Rename testdata.fc to testdata.conf
No real changes, just use a more clear and longer (which will be
important for the next commit) name for a test file.

Remove the non-existing samples/console/testdata.gc from make_dist.mk
(there are other non-existing files still referenced there).
2021-12-10 17:26:49 +01:00
Vadim Zeitlin
65b9b1047f Avoid adjusting columns unnecessary on thaw
Remember if we actually need to do this and avoid doing anything if we
don't, this could be expensive with the controls containing a lot of
data.
2021-12-09 23:30:44 +01:00
Vadim Zeitlin
5545e35f42 Get rid of "bool force" AdjustAutosizedColumns() parameter
It is better and more clear to use a separate functions rather than a
"bool force" parameter.

Also add OnThaw() instead to let wxOSXDataViewModelNotifier itself
decide what it needs to do when the control is thawed.

No real changes.
2021-12-09 23:30:11 +01:00
Vadim Zeitlin
8cc7d6d993 Remove unnecessary test for IsFrozen()
wxOSXDataViewModelNotifier::AdjustAutosizedColumns() does nothing if the
control is frozen, so there is no need to test for it before calling it
and this just made this call inconsistent with all the other ones.
2021-12-09 23:19:33 +01:00
Daniel Kulp
7557b8fa49 Don't adjust column sizes when wxDataViewCtrl is frozen in wxOSX
Only do it after thawing it.
2021-12-09 23:15:40 +01:00
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
6156bb1b84 Merge branch 'wxlistctrl-sort' of https://github.com/MaartenBent/wxWidgets
Add sort indicators support to wxListCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/2598
2021-12-09 21:29:39 +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
Maarten Bent
4cb8539f72 Add missing wxOVERRIDE to MSWWindowProc of wxListCtrl 2021-12-09 18:18:28 +01:00
Maarten Bent
74823b20c0 Remove some virtual keywords from wxListCtrl implementations
This is not needed (it is already declared virtual in the base class), and
almost all other virtual functions in wxListCtrl don't have it.
2021-12-09 18:17:48 +01:00
Maarten Bent
366e3addf7 Demonstrate sort indicators in wxListCtrl sample 2021-12-09 17:32:08 +01:00
Maarten Bent
d8ec0aa001 Support sort indicators in wxListCtrl header 2021-12-09 17:32:05 +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