Commit Graph

18832 Commits

Author SHA1 Message Date
PB
13b15fecc0 Simplify code dealing with toolbar position in associated frame 2020-06-13 14:57:30 +02:00
Lauri Nurmi
42af101836 Remove obsolete Darwin-specific code in dynlib.*/dlunix.cpp
We don't have our own dlxxx() implementations under Darwin since 76c5594
(Remove our own dlxxx() functions emulation for OS X <= 10.3.,
2013-10-17).

wxHAVE_DYNLIB_ERROR is reduced to being the same HAVE_DLERROR, so use
the latter one instead.

Closes https://github.com/wxWidgets/wxWidgets/pull/1826
2020-05-02 19:30:28 +02:00
Kvaz1r
63e1697dda Add wxGridBlocks::iterator::operator->()
An iterator should have this operator defined too, and not just
operator*() as it used to.
2020-05-02 18:50:03 +02:00
Vadim Zeitlin
e6ab2391c4 Merge branch 'dvc-virtual-has-value'
Allow overriding wxDataViewModel::HasValue() to specify which cells
should, and should not, show anything.

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

Closes #18724.
2020-05-02 18:22:27 +02:00
Artur Sochirca
d1553c63ed Improve support for TABs in wxListBox under MSW
Always set the LB_USETABSTOPS style flag to achieve behaviour more
compatible with other platforms and expand TABs to align them at tab
stops positioned at every 8 characters.

Also add MSW-specific MSWSetTabStops() method allowing to customize tab
stops.

Update the documentation and the sample to demonstrate using TABs.

Closes https://github.com/wxWidgets/wxWidgets/pull/1789
2020-05-02 18:07:50 +02:00
Artur Wieczorek
8a9e5e5ac7 Implement method to set items of wxPGChoiceEditor
In addition to the current methods to add/delete one item to the control
we would need a method to replace all existing control items with new ones
at once.
2020-05-01 17:57:46 +02:00
Paul Cornett
861cc376d6 Avoid -Wempty-body warning with non-debug build 2020-04-30 09:01:09 -07:00
Stefan Csomor
7c61841d27 adding implementation for GetMatchingPair on macOS, streamlining wxDataObject
When adding the GetMatchinPair implementation, some clean-ups were done, for further details please see #1821
2020-04-26 17:50:33 +02:00
Paul Cornett
b256db8f0f Restore previous behavior of wxString::operator<<(float) 2020-04-22 07:46:06 -07:00
Paul Cornett
c5faf9cfac Avoid passing float argument for "%f" printf specifier
"%f" takes a double. Eliminates some -Wdouble-promotion warnings.
2020-04-21 11:59:36 -07:00
Vadim Zeitlin
62372d4337 Merge branch 'webview_edge3' of https://github.com/TcT2k/wxWidgets
Update wxWebViewEdge for SDK 0.9.488.

It now requires Edge 84.0.488.0 or newer (currently Canary).

See https://github.com/wxWidgets/wxWidgets/pull/1814
2020-04-21 18:30:53 +02:00
Paul Cornett
896512c732 Change fractional point size from float to double
There doesn't seem to be any compelling reason to use float. Using double
is simpler, and avoids otherwise unnecessary float<->double conversions.
2020-04-21 09:00:04 -07:00
Vadim Zeitlin
84e90d93d8 Add back wx/windowid.h include, just not as the first one
Unfortunately the fix of the previous commit broke the build because of
the existence of non-GUI functions using GUI-only wxWindowID class.

This will need to be fixed in a better way later, but for now add the
required header back.

See https://github.com/wxWidgets/wxWidgets/pull/1815
2020-04-21 16:10:14 +02:00
Vadim Zeitlin
71c2e1cc3c Remove wrong wx/windowid.h include, should never be done directly
This #include was mistakenly added by e8b8b0288f (Make wxNewId() and
others return/take wxWindowID rather than int, 2019-12-18) and broke
compilation of the code including wx/utils.h as the first header,
because wx/windowid.h can't be included directly and must be only
included from wx/defs.h.

Fix this by just removing it, including any other header is enough to
pull this one in anyhow, via wx/defs.h.

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

Closes https://github.com/wxWidgets/wxWidgets/pull/1815
2020-04-21 15:20:17 +02:00
Tobias Taschner
7d1c40ecf5
Updated wxWebViewEdge for SDK to 0.9.488
Requires Edge 84.0.488.0 or newer

Another SDK release before 1.0 includes some
breaking changes regarding naming
2020-04-20 23:00:10 +02:00
Vadim Zeitlin
1949b4e358 Remove useless wxMenu::Break() override in wxOSX
There is no real need to override a method not doing anything by default
just to do nothing in it explicitly.
2020-04-18 00:44:20 +02:00
Vadim Zeitlin
e5d03323f9 Rename wxGridBlockCoords::ContainsCell/Block() to just Contains()
These methods do the same thing, so it seems better to use the same name
for them.

This is not really a backwards-incompatible change, as these methods
were just added in the parent commit, so nobody is using them yet.
2020-04-15 18:37:06 +02:00
Vadim Zeitlin
a5a7641616 Merge branch 'grid-selection-refactoring'
Completely overhauled selection handling in wxGrid.

Make various ways of extending selection (using Shift-arrow keys,
Ctrl-Shift-arrows, Shift-click etc) work as expected from the user point
of view instead of producing various bizarre results. Also improve
row/column header click selection as well as Ctrl/Shift-Space handling.

Internally, store selection as just a vector of blocks, independently of
the selection mode, and provide a simple API for iterating over it which
remains usable even with selections containing millions of cells (as
long as they're still composed of only a few blocks, which is the case
in practice).

Add more tests and add display of the current selection to the sample.

See https://github.com/wxWidgets/wxWidgets/pull/1772
2020-04-15 18:10:08 +02:00
Jorge Moraleda
c2e4bc422c Make HasValue virtual in wxDataViewModel and have implementations use it. This addresses issue https://trac.wxwidgets.org/ticket/18724 2020-04-14 17:48:47 -07:00
Vadim Zeitlin
fe7de63730 Merge branch 'default-keyword' of git://github.com/MaartenBent/wxWidgets
Remove wxMEMBER_DEFAULT and just "= default" instead.

See https://github.com/wxWidgets/wxWidgets/pull/1794
2020-04-15 02:17:06 +02:00
Vadim Zeitlin
5d90688723 Fix extending selection starting from unselected current cell
Unselected current cell should always be considered as the current
selection block to extend, as it doesn't make sense to extend any other
block (perhaps selected on another side of the grid) when pressing
Shift-arrow.

This scenario could be achieved by selecting a block and Ctrl-clicking a
cell (either inside or outside the selection) twice and then extending
it using Shift-arrow keys. Previously, this behaved in a strange way,
combining the corner of the selected block with the target of the
movement, whereas now this just starts selecting a new block from the
current cell as expected.
2020-04-14 18:51:23 +02:00
Vadim Zeitlin
ddaa5b5e02 Make wxGridSelection::IsInSelection() const
There is really no reason for it not to be.
2020-04-14 18:50:06 +02:00
Maarten Bent
9039340da9 Revert default-member changes, only keep and use wxHAS_MEMBER_DEFAULT 2020-04-13 19:44:04 +02:00
Maarten Bent
1448b210b8 Use macros to define default copy constructor and assignment operator 2020-04-13 17:46:32 +02:00
PB
56915f30ae Fix broken non-Unicode MSW build
Add a missing parenthesis in a non-Unicode StartDoc() definition which
was forgotten in 948ddc6e0f (Eliminate -Wcast-qual warnings with GCC and
Clang, 2020-02-02).

Closes https://github.com/wxWidgets/wxWidgets/pull/1795
2020-04-13 16:41:33 +02:00
Vadim Zeitlin
b8c3c60316 Allow extending selection using Shift-Page Up/Down keys
Also make Page Up/Down themselves work consistently with the other
cursor movement keys and clear current selection if they move the
cursor.

Even though DoMoveCursorByPage() is simpler than DoMoveCursorByBlock(),
still factor out AdvanceByPage() for consistency with AdvanceByBlock()
and because it still makes the code more clear.
2020-04-13 01:23:25 +02:00
Vadim Zeitlin
bc3c6fea70 Fix Shift-Ctrl-arrows handling
Extending the selection with Ctrl-arrows is different from all the other
cases, as we need to combine both the selection anchor and the current
cell coordinates when doing it.

This means that we can't reuse the same PrepareForSelectionExpansion()
helper for this case, so this function is not useful finally and this
commit removes it entirely. It also replaces GetCurrentBlockCornerRow()
and GetCurrentBlockCornerCol() functions with GetExtensionAnchor() which
combines both of them.

Finally, it adds wxGridDirectionOperations::TryToAdvance() helper to
avoid repeating the IsAtBoundary() check which was previously part of
PrepareForSelectionExpansion() in multiple places.

And because the "extending" and normal parts of DoMoveCursorByBlock()
are so different now, it also factors out AdvanceByBlock() helper which
can be used to keep these parts well separate from each other instead of
intermixing them together.

With all these preparatory changes, it's finally possible to implement
the "extending selection by block" logic relatively easily, with the
bulk of this branch actually taken by comments explaining why do we have
to do what we do.

Add unit tests verifying that the functions used by Shift-Ctrl-arrow
work as expected.
2020-04-13 00:49:22 +02:00
Vadim Zeitlin
287c1b1d11 Merge branch 'noexcept-event-tables'
Allow using noexcept handlers in event tables.

See https://github.com/wxWidgets/wxWidgets/pull/1788
2020-04-12 16:41:55 +02:00
Vadim Zeitlin
413fdfbfa4 Merge branch 'cmake-c++11-stl' of git://github.com/MaartenBent/wxWidgets
CMake: Improve STL checks, improve C++17/20 support.

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

Closes #18718.
2020-04-12 16:37:57 +02:00
Vadim Zeitlin
ed077e17cf Restore wxAnimation::GetFrame() constness
This got lost, almost surely accidentally, in 706c8e8ad6 (Merge branch
'disable-native-animation', 2020-04-07), so just restore it now.

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

Closes #18725.
2020-04-12 16:36:34 +02:00
Vadim Zeitlin
b98f439686 Also rename wxGridSelection::ExtendOrCreateCurrentBlock()
This function finally doesn't ever create a new block, except for the
trivial case when there is no current block, so rename it to a simpler
and more clear name.

No real changes.
2020-04-12 02:43:42 +02:00
Vadim Zeitlin
30eaa28de5 Rename wxGrid::GetSelectionRange() to GetSelectedBlocks()
This seems to be more consistent with the existing functions and doesn't
create ambiguity with a grid range.

Also rename wxGridSelectionRange to just wxGridBlocks as, in principle,
this class could be used for iterating over any blocks, not just the
selected ones.

No changes in functionality, this is just a renaming.
2020-04-12 02:38:37 +02:00
Vadim Zeitlin
32bb5e9157 Fix Shift-click/arrow behaviour for column/row selection
Extend the current block to the entire line when the corresponding
header is Shift-clicked and, importantly, keep the full-line selection
when using Shift-arrows later to make the selection behave in the
expected way.
2020-04-12 02:38:37 +02:00
Vadim Zeitlin
c90bed6f8e Stop passing invalid coordinates to ExtendOrCreateCurrentBlock()
This made the logic of this function unnecessarily more complicated.
Instead, just fall back to the current cell coordinates in the only
place where this could happen before.

Doing this still preserves the correct behaviour of Shift-arrow
selection when entire rows/columns are selected and the current cell is
not the leftmost/topmost cell (due to scrolling), but the code is
simpler.

Remove the now always true condition check and assert that it's indeed
always true.

Note that the changes to gridsel.cpp in this commit are best viewed
ignoring whitespace changes.
2020-04-12 02:38:37 +02:00
Vadim Zeitlin
415bab551c Add wxGridSelection::SelectAll() and use it in wxGrid
The difference between calling SelectAll() and SelectBlock() with a
block covering the entire grid is that the former discards any
previously selected blocks, which become clearly redundant.

As a consequence, clicking on the grid corner 10 times in a row still
results in a selection with a single block, not 10 (identical) blocks.
2020-04-12 02:38:37 +02:00
Vadim Zeitlin
7d56146998 Add a comment for ClearSelection()
No real changes, just mention that this function does more than just
clearing the selection.
2020-04-12 02:38:37 +02:00
Artur Wieczorek
c4f5fd3581 Move duplicated code to rescale the bitmap to the shared function 2020-04-10 20:45:34 +02:00
Maarten Bent
b20daa9fb0 Fix using deleted function in TempStringRef
Use the constructor directly instead of via a make function.
2020-04-10 00:51:17 +02:00
Maarten Bent
52ef7157e7 Define wxMEMBER_DEFAULT similarly to the existing wxOVERRIDE
Also define wxHAS_MEMBER_DEFAULT allowing to check if '= default' is supported
(compilers that define c++11 and VS2015 and later).
2020-04-10 00:51:14 +02:00
Vadim Zeitlin
c3810da549 Allow using noexcept methods with event tables macros
Explicitly remove noexcept before static-casting the member function
pointer to the base class pointer type to avoid compilation error with
C++17.

Add a test checking that this does work now.

Closes #18721.
2020-04-09 22:36:30 +02:00
Vadim Zeitlin
f4f70102ea Define wxNOEXCEPT similarly to the existing wxOVERRIDE
Also define wxHAS_NOEXCEPT allowing to check if noexcept is supported.

This is not used in the library yet, but probably should be.
2020-04-09 22:36:30 +02:00
Maarten Bent
89185875a9 Enable wxMEMBER_DELETE for MSVC
It is available since Visual Studio 2015.
2020-04-08 22:13:53 +02:00
Stefan Csomor
80fd70e8f1 make NSString conversions available for all osx platforms 2020-04-07 12:04:01 +02:00
Paul Cornett
902a2f0885 Remove wxAnimation copy ctor and copy-assignment operator implementations
The compiler-generated defaults will do the same thing
2020-04-06 20:26:49 -07:00
Vadim Zeitlin
706c8e8ad6 Merge branch 'disable-native-animation'
Allow the generic animation classes to be used on all platforms.

See https://github.com/wxWidgets/wxWidgets/pull/1768
2020-04-07 00:40:45 +02:00
Vadim Zeitlin
f2ed3a5376 Add static wxAnimationCtrl::CreateCompatibleAnimation()
This may be more convenient to use than CreateAnimation() if there is no
wxAnimationCtrl object at hand.
2020-04-06 23:33:07 +02:00
Stefan Csomor
eaec76ee97 moving wxOSXCreateURLFromFileSystemPath to common OSX 2020-04-06 16:08:47 +02:00
Vadim Zeitlin
69a05b0340 Use the same selection expansion logic for Shift-Ctrl-cursor
Expanding the selection from keyboard with Ctrl pressed should move in
the same way Ctrl-cursor does, but use the same selection anchor as
Shift-cursor does instead of always using the current cell.

This makes the expansion work much more intuitively in the grid, e.g.
pressing Shift-Ctrl-Down in

    1 2
    3 4

grid when 1 and 2 are selected now selects all the cells instead of
selecting 1 and 3 as it did before.
2020-04-06 02:39:21 +02:00
Vadim Zeitlin
fe6d07d2d1 Some minor comments wording changes in wxGridSelection
Try to better explain the behaviour of the methods of this class.
2020-04-06 02:26:02 +02:00
Vadim Zeitlin
a5b5573ee1 Restore lost check for __WXUNIVERSAL__ in wx/animate.h
Don't use native version when building wxUniv.
2020-04-06 01:28:01 +02:00