Commit Graph

18933 Commits

Author SHA1 Message Date
Vadim Zeitlin
7466681607 Merge branch 'grid-event-delete'
Handle deleting grid rows/columns in event handlers gracefully.

See https://github.com/wxWidgets/wxWidgets/pull/1834
2020-05-06 18:45:16 +02:00
Vadim Zeitlin
6a084e799e Merge branch 'dvc-colsize-vert-scroll'
Fix issues with generic wxDVC last column size when using
wxPersistentDVC.

See https://github.com/wxWidgets/wxWidgets/pull/1832
2020-05-06 18:44:28 +02:00
Vadim Zeitlin
d0fb641498 Merge branch 'cmake-warnings' of https://github.com/MaartenBent/wxWidgets
Enable warnings for CMake builds and fix some warnings that this
exposed.

Also add wxUSE_NATIVE_DATAVIEWCTRL option and change default GTK version
to 3 for CMake too.

See https://github.com/wxWidgets/wxWidgets/pull/1825
2020-05-06 14:34:34 +02:00
Maarten Bent
57c385350d Fix inconsistent use of boolean and HRESULT 2020-05-06 01:52:24 +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
Vadim Zeitlin
e6e6dbe077 Fix problems due to deleting grid cells in the event handlers
Deleting last grid rows or column in a few event handlers could result
in asserts/crashes in wxGrid code if the event handler also called
event.Skip(), as wxGrid still tried to perform the default action using
the deleted cell, when these events happened in the last row or column.

It's not totally clear whether calling event.Skip() after performing an
action modifying the grid should be allowed at all, but, in doubt, at
least avoid crashing if it does happen, by considering the event as
being handled (and even vetoed) if its handler deleted the cell in which
it was generated.

Closes #18731.
2020-05-02 00:53:59 +02:00
Vadim Zeitlin
5cdcfddc61 Refactor event sending code in wxGrid to use even more functions
Move the logic determining the return value of SendEvent() into its own
function instead of repeating it twice.

No real changes, this is a pure refactoring.
2020-05-02 00:49:08 +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
Vadim Zeitlin
aacd26c27b Save specified, not actual, col width in wxPersistentDataViewCtrl
This is more correct as saving the current width of the last column
would prevent the user from shrinking it under the last automatically
set size, i.e. the UI behaviour would change after restarting the
program, which shouldn't be the case.

Doing this required making WXGetManuallySetWidth(), which previously
existed in the generic version only, available in all ports, so do it
and also rename it to WXGetSpecifiedWidth() in the process, as this
seems a somewhat better name (it doesn't have to be manually specified,
i.e. it could also be done by the program itself or even implicitly by
wxPersistentDataViewCtrl).

Don't make this function public, at least for now, because it's not
clear how could it be useful and it might still need to be changed to
behave differently in the other ports.
2020-05-01 03:39:40 +02:00
Vadim Zeitlin
44578b883c Don't set m_manuallySetWidth incorrectly
This fix for disallowing shrinking the last column to nothing instead of
showing horizontal scrollbar when it became smaller than its minimum
size was wrong and is not necessary any more after the correct fix in
the previous commit.

This effectively reverts 0c90ea40c3 (Don't auto-resize wxDataViewCtrl
columns below their initial size, 2019-10-03).

See #18343.
2020-05-01 03:39:41 +02:00
Vadim Zeitlin
d74389f930 Fix WXGetManuallySetWidth() for columns using wxCOL_WIDTH_DEFAULT
Columns without any explicitly specified width still shouldn't be shrunk
down to 0 size by UpdateColumnSizes(), so handle them as if they were
created using wxDVC_DEFAULT_WIDTH instead -- which is what their actual
width is/would be.

This is a better fix than the one in 0c90ea40c3 (Don't auto-resize
wxDataViewCtrl columns below their initial size, 2019-10-03) and that
commit can be reverted now, as will be done soon.

See #18343.
2020-05-01 03:39:21 +02:00
Vadim Zeitlin
6c5f3f8929 Refactor generic wxDataViewColumn to use DoGetEffectiveWidth()
This function will be used for m_manuallySetWidth too, in addition to
m_width, in the next commit.

No changes yet in this one.
2020-05-01 03:25:52 +02:00
Paul Cornett
861cc376d6 Avoid -Wempty-body warning with non-debug build 2020-04-30 09:01:09 -07:00
Maarten Bent
52d830398a Fix -Wsuggest-override warning
Manually checked by adding -Wsuggest-override as compile parameter.
2020-04-27 00:33:03 +02:00
Maarten Bent
abb2eb9ed0 Fix -Wmicrosoft-exception-spec warning 2020-04-27 00:33:01 +02: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
Vadim Zeitlin
d9b1ca54ca Stop deriving native wxGTK wxAnimationCtrl from generic one
This is unnecessary and confusing.
2020-04-06 01:09:36 +02:00
Vadim Zeitlin
3678d67f92 Move wxGenericAnimationCtrl::m_animation to the base class
API of wxAnimationCtrlBase practically forces the derived classes to
have such method, so just add it and make GetAnimation() a simple
non-virtual accessor.
2020-04-06 01:03:39 +02:00
Vadim Zeitlin
b08db49bf6 Make wxAnimationImpl private and get rid of wxAnimationImplType
Simplify and streamline animation classes relationship: wxAnimation is
the only public class representing an animation and it can be created by
both the native wxAnimationCtrl and wxGenericAnimationCtrl using the new
public CreateAnimation() method.

Replace wxAnimationImplType enum with more flexible type info based
check.
2020-04-06 01:00:15 +02:00
Vadim Zeitlin
86d6cb8d1f Don't derive wxAnimationImpl from wxObject
This is just unnecessary and having wxAnimation::m_refData->m_refData is
confusing, both in wxGTK version where it's not used and in the generic
one where it is, but can be replaced by more type-safe m_decoder.
2020-04-06 00:00:10 +02:00
Vadim Zeitlin
b17d3ecb52 Remove unused private BlockContain() function
This was probably left over after wxGridBlockCoords::ContainsBlock()
introduction.
2020-04-05 17:38:08 +02:00
Vadim Zeitlin
1bf48dfe29 Remove wxAnimationCtrlBase from wxRTTI
This is consistent with the other wxFooBase classes which are not part
of it, as they're considered implementation details and not parts of the
API.
2020-04-05 17:01:37 +02:00
Vadim Zeitlin
d0371d75f7 Define wxHAS_NATIVE_ANIMATIONCTRL
This allows to easily test for the native control existence and also
whether wxGenericAnimationCtrl is really different from wxAnimationCtrl.

It also allows to avoid explicit check for wxGTK in common code.
2020-04-05 16:56:58 +02:00
Vadim Zeitlin
6f2a5937f5 Remove some recently added trailing spaces
No changes.
2020-04-05 16:05:48 +02:00
Vadim Zeitlin
cdff0bc1db Use WXDLLIMPEXP_CORE instead of WXDLLIMPEXP_ADV in new code
They're the same thing, and we still keep WXDLLIMPEXP_ADV in the
existing code, but as this line was just moved to a new place, update it
to use the more appropriate DLL export declaration too.

No real changes.
2020-04-05 16:04:50 +02:00
Vadim Zeitlin
1d43ae7dc6 Refactor selection expansion code to use actual wxKeyboardState
Switch from using just "bool expandSelection" in the grid functions
(possibly) extending the current selection to using the full
wxKeyboardState.

This allows to pass it to ExtendOrCreateCurrentBlock() and slightly
simplify the code by using DoMoveCursorFromKeyboard().
2020-04-05 15:56:45 +02:00
Vadim Zeitlin
791a9e68ae Rename and simplify wxGridBlockCoords::ContainsBlock()
Change the return type of this function to a simple and clear bool
instead of 3-valued int requiring a special explanation. This is simpler
and not any less efficient as checking for whether one block contains
another or the other one contains this one are separate operations
anyhow.

Rename the function to a more grammatically correct name.

Also move it inline as it's now trivial enough for this to be worth it.
2020-04-05 01:37:56 +02:00
Vadim Zeitlin
a5952ee087 Rename wxGridBlockCoords::ContainsCell() and move it inline
Make the function name more grammatically correct.

No real changes.
2020-04-04 19:45:19 +02:00
Vadim Zeitlin
0a5a904d8d Simplify wxGridSelectionRange to provide only iterators
This class was a strange hybrid of a container/view/range and iterator,
as it both provided begin()/end() container-like methods and
iterator-like methods for dereferencing/advancing.

Simplify this by removing the latter part and making this class really
just a range, with its own iterator class in order to avoid leaking the
exact type of the iterator used in the API.

Note that while it's now completely trivial, it is still useful as it
isolates the application code from the vector used to store the selected
blocks currently and will allow to change internal representation in the
future without breaking the existing code.
2020-04-04 19:37:23 +02:00
Vadim Zeitlin
0f8e985252 Define wxGridSelectionRange::iterator in terms of vector iterator
This fixes compilation when using std::vector<> implementation for
wxVector (i.e. with wxUSE_STD_CONTAINERS==1).
2020-04-04 19:04:17 +02:00
Ilya Sinitsyn
f8015b13b1 Implement wxGrid selection blocks iterating interface 2020-04-04 18:50:37 +02:00
Ilya Sinitsyn
0920a1646b Make wxGrid row selecting more user friendly 2020-04-04 18:50:37 +02:00
Ilya Sinitsyn
89dd47edee Make wxGrid column selecting more user friendly 2020-04-04 18:50:37 +02:00
Ilya Sinitsyn
e1b9ece9a4 Edit the current wxGrid selection block
Really edit the current selection block instead of storing the temporary
information about the current selection and applying it on releasing Shift
key or LKM.
2020-04-04 18:50:37 +02:00
Ilya Sinitsyn
d4919d3334 Remove wxGridSelection::ToggleCellSelection()
Remove the function because it's not usefull anymore and used only in one
place.
2020-04-04 18:50:36 +02:00
Ilya Sinitsyn
cdf3187fe5 Improve rows, columns and cells deselection in wxGrid
Use DeselectBlock() instead of ToggleCellSelection() to improve execution
speed and make the code more clean.
2020-04-04 18:50:36 +02:00
Ilya Sinitsyn
02509cbc39 Refactor wxGridSelection to store selection as blocks only
Store all types of selection with an array of blocks instead of arrays of
cells, blocks, rows and columns.

It (hopefully) simplifies the code and allows us to implement editing of
the last selection block much easier.
2020-04-04 18:50:36 +02:00
Ilya Sinitsyn
acd72efbf1 Implement wxGridBlockCoords class
wxGridBlockCoords represents a location of a block of cells in the grid.
2020-04-04 18:50:36 +02:00
Ilya Sinitsyn
673ed29d7b Make wxGridSelection to be non-friend to wxGrid
Improve integrity of the wxGridSelection internal data by removing `friend`
declaration.
2020-04-04 18:50:36 +02:00
Ilya Sinitsyn
79219fdbb2 Remove unused wxGrid member variable 2020-04-04 18:50:36 +02:00
Vadim Zeitlin
43b3a3fc5b Merge branch 'grid-hidpi'
wxGrid improvements for high DPI and DPI changes

See https://github.com/wxWidgets/wxWidgets/pull/1776
2020-04-04 18:46:54 +02:00
Robin Dunn
e258a9d982 Move the animation Impl classes to private headers 2020-04-03 13:22:35 -07:00
Robin Dunn
4545d93924 Move wxAnimationDecoderList-related methods to wxAnimation 2020-04-03 12:49:15 -07:00
Robin Dunn
784f330838 Add assignment operator to wxAnimation 2020-04-02 14:35:30 -07:00
Robin Dunn
8153605cf0 No need for wxRTTI in wxAnimationImpl 2020-04-02 13:48:53 -07:00
Robin Dunn
6f79567f3b Use better names for the Impl accessor methods 2020-04-02 13:21:49 -07:00
Robin Dunn
a7fd4db107 Use wxDECLARE_NO_COPY_CLASS in the Impl classes 2020-04-02 13:14:38 -07:00
Robin Dunn
06bda3e5de Revert change that ended up just moving some lines 2020-04-02 12:59:26 -07:00
Robin Dunn
c532edfe67 Fix class names in the header 2020-04-02 12:51:16 -07:00
Robin Dunn
52d4bad3df
Apply suggestions from code review
Co-Authored-By: VZ <vadim@wxwidgets.org>
2020-04-02 12:35:58 -07:00
Paul Cornett
6240ecf153 Fix virtual call of Destroy() in wxDocChildFrameAny
Allow derived class override to be called.
See #18694
2020-04-02 09:03:35 -07:00
Robin Dunn
fb69a2975f Add missing wxOVERRIDE, and some other cleanup 2020-04-01 14:55:08 -07:00
Robin Dunn
6b6a930e9c Update GTK animation classes for the new pattern 2020-04-01 14:16:15 -07:00
Robin Dunn
f641601ea9 Remove the wxOVERRIDEs too 2020-04-01 13:37:38 -07:00
Vadim Zeitlin
d41d159576 Replace wxGridCellBoolRenderer::ms_sizeCheckMark with a local var
This variable is (now) only used in a single function, so there is no
reason to declare it as a class member.

No real changes.
2020-04-01 22:33:02 +02:00
Robin Dunn
085f08aefe Remove the generic-specific methods from the wxAnimation API 2020-04-01 13:30:49 -07:00
Robin Dunn
606f365ea3 Verify the animation impl type matches the animation ctrl type 2020-04-01 12:39:48 -07:00
Robin Dunn
e464453073 * Switch wxAnimation to be a facade over a wxAnimationImpl class.
* Implement wxAnimationGenericImpl
* Update wxGenericAnimationCtrl as needed
2020-04-01 11:53:19 -07:00
Vadim Zeitlin
5e761ad99f Add minimal DPI change handler to wxGrid
This handler redoes wxGrid layout and refreshes it to at least avoid
ugly display artifacts when moving wxGrid window between displays with
different DPI.
2020-04-01 00:46:39 +02:00
Robin Dunn
85bd16fb06 Trim trailing whitespace 2020-03-31 14:02:39 -07:00
Vadim Zeitlin
59ad458d39 Scale default wxGrid constants by DPI
In particular, this makes default column width better suited for high
DPI displays, as it was too narrow before.

Also mark a couple of obsolete constants as such with a comment.
2020-03-31 14:48:54 +02:00
Vadim Zeitlin
06af121e9c Add wxObjectDataPtr::release()
This makes it possible to use wxObjectDataPtr inside functions returning
raw pointers owned by the caller, such as custom GetAttr() in the grid
sample.
2020-03-31 02:57:01 +02:00
Vadim Zeitlin
15b5a1865c Add a simple wxGrid::AssignTable() wrapper for SetTable()
In many case SetTable() is called with its takeOwnership parameter set
to true, as shown by the grid sample in which all 3 of the calls to
SetTable() set it to true, but calling it in this case is awkward, as
bare "true" in the caller is unreadable and almost invariably requires
an explanatory comment.

Improve the API by adding AssignTable(), which is the same to SetTable()
as the existing AssignImageList() to SetImageLabel(), which always takes
ownership of the table pointer.
2020-03-31 02:43:08 +02:00
Robin Dunn
1608fde659 Add a Create method to the shim class 2020-03-30 15:20:19 -07:00
Robin Dunn
868154ee90 native wxAnimationCtrl derives from the generic class 2020-03-30 15:01:21 -07:00
Robin Dunn
a7f9d5e3c5 * Switch back to using an wxAnimationBase class
* Change the [GS]etAnimation methods to be non-virtual so they can use generic/native types of animation obj
2020-03-30 14:53:11 -07:00
Robin Dunn
08ac4dbad6 Name the base animation class wxGenericAnimation with a wxAnimation shim class 2020-03-27 15:53:03 -07:00
Maarten Bent
f1a017539a Generate an error when the CPU parameter is not specified and cannot be determined
See #18640
2020-03-27 23:11:00 +01:00
Robin Dunn
488084c2f5 Name the base animation class wxGenericAnimation with a wxAnimation shim class 2020-03-27 14:33:11 -07:00
Robin Dunn
fae15d39a6 * Rename the generic version as wxGenericAnimationCtrl
* Add a simple shim class for the generic wxAnimationCtrl
* Use the generic wxAnimation as the base class (this will probably change...)
2020-03-25 16:29:34 -07:00
Robin Dunn
1fa74df7f4 Remove --disable-nativeanimation and wxUSE_NATIVE_ANIMATIONCTRL 2020-03-25 14:03:28 -07:00
Vadim Zeitlin
360867d37b Remove extra accidentally added blank line in auto-generated file
Just commit the result after running build/update-setup-h.
2020-03-25 12:20:18 +01:00
Robin Dunn
201af608f7 Update description of wxUSE_NATIVE_ANIMATIONCTRL 2020-03-24 19:43:13 -07:00
Robin Dunn
eeedc14a58 DoCanRead is protected in the base class, make it the same in derived classes. 2020-03-24 16:25:00 -07:00
Robin Dunn
398b178431 Compile native or generic animation classes based on wxUSE flags 2020-03-24 14:49:03 -07:00
Robin Dunn
d72ef11e87 Add --disable-nativeanimation configure option, and wxUSE_NATIVE_ANIMATIONCTRL 2020-03-24 13:19:34 -07:00
Vadim Zeitlin
eaaad6471d Merge branch 'aui-delete-tool'
Provide work around for surprising behaviour of
wxAuiToolBar::DeleteTool().

Closes https://github.com/wxWidgets/wxWidgets/pull/1758
2020-03-15 17:10:41 +01:00
Vadim Zeitlin
700eaff131 Add wxAuiToolBar::DestroyTool() and DestroyToolByIndex()
These new functions destroy the associated window too, unlike the
existing DeleteTool() and DeleteByIndex().

Closes #16552.
2020-03-15 17:09:51 +01:00
Vadim Zeitlin
5a9938aa67 Merge branch 'log-dangling-else-warns'
Fix dangling else warnings in wxLog macros.

See https://github.com/wxWidgets/wxWidgets/pull/1755
2020-03-15 17:05:23 +01:00
Vadim Zeitlin
8b2237cd2d Make row/column drag-resizing in wxGrid "live"
Update the column width immediately, as it's being dragged, instead of
drawing a temporary line showing the new column boundary using wxINVERT.

This results in better user experience, as it the effect of changing the
column width can be immediately seen (especially important for non-left
aligned columns or columns using ellipsizition) and, equally if not more
importantly, fixes wxGrid drag-resize not showing any visible UI at all
with wxGTK3 and wxOSX where wxINVERT is not implemented.
2020-03-11 22:00:01 +01:00
Vadim Zeitlin
3d1de5c31b Make interface between wxGridHeaderCtrl and wxGrid more explicit
Rename the functions used from wxGridHeaderCtrl event handlers to start
with DoHeader prefix to make it clear that they're (only) used by it in
an attempt to make things more clear and more uniform.

No real changes.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
5986584fc0 Fix position in dummy wxMouseEvent used by wxGridHeaderCtrl
This probably doesn't matter much, but use the correct mouse position in
this event, expressed in wxGrid coordinate system instead of using
screen coordinates.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
52b7267aac Add wxGrid::m_dragMoveCol field separate from m_dragRowOrCol
Don't reuse the same m_dragRowOrCol variable for both the index of the
row or column being drag-resized and for the index of the column being
drag-moved. Reusing it was confusing and made it more difficult what the
code was doing and what invariants were preserved in it, and just wasn't
worth saving a few bytes per wxGrid object.

No real changes.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
05c5891bf6 Slightly simplify wxGrid refresh logic
Use new ShouldRefresh() helper instead of testing for !GetBatchCount()
before calling Refresh().

Also check for GetBatchCount() inside CalcDimensions() itself, which
means that it can now be called unconditionally.

No real changes.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
586d0e6ee6 Make wxGrid::GetBatchCount() const
There is really no reason for this simple accessor not to be const.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
c2b0edefbd Also remove unused wxGrid wxEVT_ERASE_BACKGROUND handler
It is never used anyhow, as wxGrid is entirely covered by its children
windows.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
e671386d1a Use wxBG_STYLE_PAINT for wxGridWindow
This is more explicit, efficient and simpler than defining an empty
wxEVT_ERASE_BACKGROUND handler, which is not needed any longer.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
a5807b8fcf Remove unnecessary wxGrid::OnPaint()
This method was explicitly defined to do nothing, so just remove it.

No real changes.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
b08b697665 Merge branch 'grid-tests-refactor'
Refactor wxGrid tests to make it easier to run individual ones.

See https://github.com/wxWidgets/wxWidgets/pull/1759
2020-03-11 21:56:29 +01:00
Vadim Zeitlin
9203f685ee Check the expected WebView2 interface is defined
This results in a single intelligible error instead of a hundred of less
clear ones in case our code is compiled against an out of date SDK
version.

There doesn't seem to be any way to check the version directly, so just
check that the interface which hadn't been defined in the previous
version is defined now to check for it indirectly.
2020-03-11 19:26:39 +01:00
Vadim Zeitlin
8802657490 Add wxGrid::IsUsingNativeHeader()
It is convenient to have this function if only in order to be able to
call GetGridColHeader() safely, i.e. without triggering an assert if
native header is not being used.
2020-03-11 18:41:16 +01:00
Vadim Zeitlin
71ed744c76 Simplify wxLogXXX() macros implementation at some cost of brevity
Avoid using plenty of intermediate macros, which made the code quite
difficult to understand and just wxDO_IF() helper directly instead.

This makes individual macros definitions slightly longer, but allows to
get rid of several helper macros, so the total number of lines is
actually smaller but, more importantly, the new code is much easier to
parse for a human reader.
2020-03-10 02:42:08 +01:00
Vadim Zeitlin
8c378b44e2 Add wxDO_IF() helper macro
This will be used for wxLogXXX() macros reimplementation in the next
commit.
2020-03-10 02:42:08 +01:00
Lauri Nurmi
32ead5a0ff Fix dangling else warnings at all wx(V)LogXXX calls
Earlier this was fixed for some but not all variants of wx(V)LogXXX.

See #11829.
2020-03-10 02:42:08 +01:00
Lauri Nurmi
bf6dae2151 Remove outdated and wrong comment about making functions const
The comment suggested Get{First,Next,Prev,Last}Line() should be changed
to const functions once compilers understand the 'mutable' keyword.

Hopefully now, after 19 years, compilers do understand the 'mutable'
keyword, but regardless of that the functions should not be const, as
they very clearly modify the state of the object that is observable
through the public interface.

Closes https://github.com/wxWidgets/wxWidgets/pull/1750
2020-03-06 01:08:19 +01:00
Tobias Taschner
613687ecb5 Updated wxWebViewEdge for SDK 0.9.430
This first beta release of the WebView2 SDK has many identifiers
renamed and webview interfaces split to Host and WebView.

Closes https://github.com/wxWidgets/wxWidgets/pull/1743
2020-02-29 15:40:45 +01:00
Vadim Zeitlin
ebc0f056c0 Make wxTemp[F]File classes non default ctor explicit
There should really be no reason to ever implicitly convert a string to
a file.
2020-02-21 14:56:06 +01:00
Dummy
3e0780e811 Add wxTempFFile, similar to wxTempFile but using buffered I/O
Also add wxTempFFileOutputStream.

Closes #18673.
2020-02-21 14:52:40 +01:00
Paul Cornett
05d19797a5 Revert to using our own drag-move code for wxGTK wxMiniFrame with non-Wayland backends
At least one WM (KDE's KWin) does not generate X11 configure events when dragging
a window using gtk_window_begin_move_drag(). We need the configure events so we
can generate wxMoveEvent, which AUI needs in order to re-attach a floating pane.
This is functionally a revert of b8789b9d6f for backends other than Wayland.
See #18372 #18669
2020-02-19 20:26:08 -08:00
Vadim Zeitlin
a4906f1222 Change wxGetTopLevelParent() to take wxWindowBase
This makes it more convenient to use when building wxUniv, when
wxWindow$TOOLKIT objects are wxWindowBase but not actually wxWindow.

No real changes.
2020-02-17 19:49:23 +01:00
Artur Wieczorek
5bc020e844 Implement getters for members of wxPGWindowList
There is no reason to expose wxPGWindowList member variables. They should
be set in ctors and retrieved with getters.
2020-02-12 17:09:25 +01:00
Kvaz1r
6697b576b2 Close AUI MDI children when the parent frame is closed
This ensures that the parent frame doesn't close if any of the children
can't be closed and also that all children are closed before the parent
if they do agree to close.

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

Closes #15170.
2020-02-11 22:41:26 +01:00
Vadim Zeitlin
789858a4d9 Merge branch 'secret-service-check'
Check if secret service can be used under Unix.

See https://github.com/wxWidgets/wxWidgets/pull/1733
2020-02-11 22:36:03 +01:00
Vadim Zeitlin
b18169a0e4 Merge branch 'paint-debug'
Detect invalid use of wxPaintDC/wxPaintEvent better.

See https://github.com/wxWidgets/wxWidgets/pull/1732
2020-02-11 22:35:33 +01:00
Vadim Zeitlin
697d494caa Merge branch 'grid-attr-smart-ptr'
Use smart pointers in wxGrid code.

See https://github.com/wxWidgets/wxWidgets/pull/1731
2020-02-11 22:35:03 +01:00
Vadim Zeitlin
1d4aaba963 Merge branch 'ribbon-imagelist'
Use image list in wxRibbonBar.

See https://github.com/wxWidgets/wxWidgets/pull/1730
2020-02-11 22:34:13 +01:00
Vadim Zeitlin
a37e15ff1f Merge branch 'webview-js-escape'
Fix JS strings escaping in wxWebView.

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

Closes #18602.
2020-02-11 22:32:51 +01:00
Vadim Zeitlin
8fcf46f65c Forbid creation of wxPaintEvent objects from user code
This doesn't work anyhow, so it's better to prevent the code doing this
from compiling instead of getting run-time asserts or worse.

Also simplify construction of these events inside wxWidgets by passing
the window itself to the ctor instead of passing just its ID and calling
SetEventObject() separately later.

For consistency, do the same thing for wxNcPaintEvent too.
2020-02-10 23:03:01 +01:00
Vadim Zeitlin
5a454d373b Optionally return error message from wxSecretStore::IsOk()
This allows to give at least some explanation about why the secrets
can't be stored to the user, e.g. they could search for a message such
as

The name org.freedesktop.secrets was not provided by any .service files

to find out that gnome-keyring package needs to be installed on their
system.

Note that this change means that under Unix an attempt to connect to the
secret service is now made when wxSecretStore is constructed and not
just when it's used for the first time, as before.
2020-02-10 18:23:59 +01:00
Vadim Zeitlin
452c8dcfa3 Check that wxPaintDC is created correctly in code using wxMSW
Creating wxPaintDC for a window outside of any wxEVT_PAINT handler
already resulted in assert failures and crash due to using the empty
wxDidCreatePaintDC stack, but the assert message was not really clear,
so improve it by stating explicitly that wxPaintDC can only be created
from wxEVT_PAINT handlers.

Also check that wxPaintDC is being created for the correct window: this
wasn't detected at all before, but could still result in a lot of grief,
so check for this too.

Finally, create a new private header with the paint data stack variable
declaration instead of using "extern" to declare it manually in wxDC
code.
2020-02-10 13:39:08 +01:00
Vadim Zeitlin
f6158bc343 Remove wxHAS_PAINT_DEBUG and code guarded by it
This doesn't seem to actually be doing anything useful, as it only
checks that wxPaintDCImpl is not created without creating wxPaintDC
which is impossible to do accidentally anyhow.

This will be replaced by a more useful check in the next commit.
2020-02-10 13:14:08 +01:00
Artur Wieczorek
c7c3f337c2 Check index value with CHECK_MSG to avoid crashes 2020-02-09 20:39:06 +01:00
Artur Wieczorek
9dbd3b4946 Use ctor with default argument instead of providing specialized ctor
We can use 2-parameter ctor with default NULL value for second parameter
instead of providing a special 1-paramater ctor.
2020-02-09 20:31:58 +01:00
Artur Wieczorek
f2f9cbe619 Get rid of unused wxPGWindowList ctor
There is no use case for wxPGWindowList initialiazed with NULL data.
2020-02-09 20:19:52 +01:00
Vadim Zeitlin
2e64ba6d6e Also add wxGridCellEditorPtr and wxGridCellRendererPtr
This is similar to the previous commit and replaces manual calls to
DecRef() on the renderers/editors with the use of smart pointers for
them too.
2020-02-08 15:14:24 +01:00
Vadim Zeitlin
5f34b1749e Use wxGridCellAttrPtr instead of manual DecRef() calls
Provide GetAttrPtr() and GetCellAttrPtr() convenience functions that can
be used instead of the original Ptr-less versions to avoid the need to
manually call DecRef() on the returned wxGridCellAttr pointers.

No real changes, just simplify the code and make it safer.
2020-02-08 14:55:36 +01:00
Ilya Sinitsyn
a40acbb28e Add CanOverflow function to wxGridCellAttr
Add function to determine whether the cell will draw the overflowed text
to neighbour cells. Note that only left aligned cells currently can overflow.
2020-02-07 19:34:50 +01:00
Vadim Zeitlin
10c49631a3 Store any number of image lists in wxRibbonBar, not just two
The same wxRibbonBar can use multiple button bars with different icon
sizes, so 2 image lists are not enough. But OTOH there is no need to
distinguish between small and large images neither, so 2 may be also 1
too many.

Instead, use however many image lists we need, depending on the size.
For now, just store them in a vector and use linear search in it,
instead of using a map or, maybe, sorted vector, as we suppose there are
never going to be more than a couple of elements in this vector anyhow.
2020-02-07 19:21:33 +01:00
Vadim Zeitlin
5a30886696 Move bitmap-related functions to wxRibbonButtonBarButtonBase
Improve encapsulation by making the function setting the members of a
class a member of the same class, instead of doing it outside of it.
2020-02-07 18:11:47 +01:00
Vadim Zeitlin
557843c504 Remove wxRibbonButtonBar::m_ownerRibbonBar
There is already a function returning the containing ribbon bar, so just
use it instead.
2020-02-07 17:47:15 +01:00
Vadim Zeitlin
884c3a2dc2 Use wxImageList in wxRibbonBar unconditionally
There shouldn't be any reason not to do it other than possible bugs in
wxImageList itself, that should be fixed there.
2020-02-07 17:44:08 +01:00
Vadim Zeitlin
714fefb3e5 Use DLL export macro in wxImageList forward declaration
Do it if only for consistency.
2020-02-07 17:30:28 +01:00
wxBen
23ebbb139d Optionally support using wxImageList in wxRibbonBar
This allows to avoid consuming too many bitmap resources.

Closes #18657.
2020-02-07 17:25:34 +01:00
Kvaz1r
5663157674 Fix link between flags and buttons in wxAuiManager
Don't store the buttons used by a pane separately, but take them
directly from the flags, as this ensures that updating the pane flags,
e.g. by calling CloseButton(false), really removes the corresponding
button.

This also makes wxAuiPaneButton helper completely unnecessary, so just
remove it to simplify the code.

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

Closes #18223.
2020-02-05 16:02:51 +01:00
Vadim Zeitlin
b7547dbd27 Don't use Hungarian notation for variables
Rename a variable to remove the ugly "sz" prefix.

Also don't use "s_" prefix for non-static variables.
2020-02-05 15:37:27 +01:00
nns52k
24c56a413b Fix string escaping in JS code in wxWebView
For example, a newline was escaped to be a backslash followed by a
newline, but it actually shall be a backslash followed by a character
'n'. It seemed okay with most of codes until in the case that C++ style
comments, i.e. single line comments, in the JavaScript codes. If the
newline characters are not escaped correctly, the JavaScript interpreter
will ignore everything that goes after the single line comments because
the interpreter obviously cannot find the newline where it's supposed to
stop treating codes as comments.
2020-02-05 15:35:17 +01:00
Vadim Zeitlin
4526765f8f Remove extra semicolons to avoid gcc -Wpedantic warnings
Another fix after 00cdab77c5
2020-02-05 15:20:26 +01:00
Vadim Zeitlin
3f49942051 Fully qualify std::nullptr_t
Fix a stupid mistake from 00cdab77c5
2020-02-05 15:19:33 +01:00
Vadim Zeitlin
00cdab77c5 Define wxStrtox() overloads taking nullptr
Instead of specializing wxStrtoxCharType and then testing whether endptr
is null, just define separate, and simpler, overloads of wxStrtox()
functions taking nullptr_t -- we can avoid the unnecessary test
completely in this case, as nullptr is, by definition, always null
anyhow.

Also add a test of using wxStrtol() with nullptr too.

This should fix the build with older gcc and MSVS versions.
2020-02-05 03:54:25 +01:00
Vadim Zeitlin
25e256a0f5 Merge branch 'osx_icns_imagehandler' of https://github.com/TcT2k/wxWidgets
Add handler for ICNS files (wxBITMAP_TYPE_ICON).

Also remove some old unused Carbon files.

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

Closes #18647.
2020-02-04 02:26:42 +01:00
Vadim Zeitlin
0cb0367fce Merge branch 'd2d-gradient' of https://github.com/MaartenBent/wxWidgets
Fix reference count in D2D renderer gradient brushes.

See https://github.com/wxWidgets/wxWidgets/pull/1724
2020-02-04 02:16:19 +01:00
Vadim Zeitlin
e171757160 Merge branch 'grid-selecting'
Fix several problems related to selecting cells from keyboard in wxGrid.

Closes https://github.com/wxWidgets/wxWidgets/pull/1719
2020-02-04 02:13:20 +01:00
Paul Cornett
1a9da25c33 STL build fix for MSVS after 948ddc6e0f 2020-02-03 09:33:09 -08:00
Paul Cornett
f4299c3c01 Eliminate a couple more -Wcast-qual warnings 2020-02-03 09:02:14 -08:00
Paul Cornett
0ca45d1a59 Remove redundant checks for NULL before calling delete 2020-02-02 23:51:39 -08:00
Paul Cornett
05183b7099 Eliminate -Wzero-as-null-pointer-constant warnings in the headers 2020-02-02 23:40:01 -08:00
Paul Cornett
948ddc6e0f Eliminate -Wcast-qual warnings with GCC and Clang
Use const_cast, mutable, and various other changes to avoid -Wcast-qual
2020-02-02 22:50:32 -08:00
Maarten Bent
8e2f674c0b Remove trailing whitespace 2020-02-02 14:50:57 +01:00
Vadim Zeitlin
6724f8c052 Work around MSVS 2012 bug with handling of nullptr
Avoid error C2180 given by this compiler for if statements with
controlling expression of type nullptr_t.
2020-02-02 01:12:28 +01:00
Ilya Sinitsyn
d455c5b99e Fix making the wrong wxGrid cell visible when selecting
We should make visible the cell of the corner of the current selected block.

Also fix names of the wxGrid::UpdateBlockBeingSelected parameters because
actually passed сщщквы are of any opposite selection block corners.
2020-02-01 01:53:59 +01:00
Vadim Zeitlin
55efc9e607 Allow using wxStrtox() functions with nullptr with MSVS too
Add a unit test checking that it compiles (and works).

This extends the changes of 63b1f00eb8 to
cover MSVS as well.
2020-01-31 17:13:06 +01:00
Vadim Zeitlin
7969f3f81c Define wxHAS_NULLPTR_T if nullptr is supported
This is necessary because MSVS versions as old as 2010 support it, even
if they don't have full C++11 support and so don't define __cplusplus
appropriately.

Extract the existing check for nullptr from wx/strvararg.h to wx/defs.h
in order to allow reusing it.
2020-01-31 17:11:50 +01:00
Paul Cornett
63b1f00eb8 Allow wxStrto... functions to accept nullptr 2020-01-27 11:33:05 -08:00
Paul Cornett
26f58bdf78 Fix base class call of virtual SetFont() in wxGenericListCtrl
Hard-coding 'wxWindow' improperly bypasses an override in wxControl on GTK3
2020-01-27 11:27:39 -08:00
Tobias Taschner
c9c2d1fba4
Remove unused carbon files
These files where no longer referenced by any build system
and where probably left overs from before carbon was removed.
2020-01-23 21:13:11 +01:00
Vadim Zeitlin
767c07c040 Merge branch 'webview-edge'
Add support for (optionally) using Edge-based wxWebView.

See https://github.com/wxWidgets/wxWidgets/pull/1700
2020-01-22 03:38:00 +01:00
Vadim Zeitlin
68d7cb5082 Merge branch 'msw-fix-radiobtn-and-initial-focus'
Fix problems with focus due to the pending focus mechanism used by
wxRadioButton in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/1713
2020-01-20 20:51:59 +01:00
Václav Slavík
7a5618df77 Silence Xcode 11 warnings about shadowing read() 2020-01-20 19:19:40 +01:00
Vadim Zeitlin
ec07635801 Don't recurse upwards when updating pending focus in wxMSW
This is unnecessary, we only need to update the pending focus in the
immediate parent window to prevent a wrong radio button from being
focused (and hence selected) when it regains focus, there is no good
reason at all to interfere with the focus in the grandparent (and
higher) windows.

Doing this was not only useless, but actually harmful, as it overrode
explicit calls to SetFocus() in the user code, so just stop doing it.
This also allows to avoid having 2 functions related to this and keep
just a single virtual WXSetPendingFocus() one.

Closes #18653.
2020-01-20 13:16:41 +01:00
Tobias Taschner
caf9285609
Improved JSON string parsing 2020-01-19 21:32:11 +01:00
Vadim Zeitlin
b9038a1e8c Merge branch 'msw-headerctrl' of https://github.com/MaartenBent/wxWidgets
Fix applying style of MSW wxHeaderCtrl and add tests for doing it to the
widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1710
2020-01-19 17:49:40 +01:00
Maarten Bent
fd9df06d35 Fix applying header style of wxMSWHeaderCtrl
Call SetWindowStyleFlag when creating the control. Apply wxHD_BITMAP_ON_RIGHT
style. Get rid of the helper function.
2020-01-19 14:55:39 +01:00
Vadim Zeitlin
b02fbafb96 Don't update wxDataViewColumn after it was resized interactively
Previously, the column was updated, i.e. wxHeaderCtrl::UpdateColumn()
was called, after the column width was changed interactively by the
user. This was unnecessary and actually harmful as it resulted in
recursion and display corruption.

Stop doing this by adding yet another width-related function to the
generic wxDataViewColumn called WXOnResize(), which just updates the
main window display, but doesn't update the header at all, and calling
it instead of SetWidth(), which does both, when the column is resized.

Closes #18245.
2020-01-19 03:28:13 +01:00
Tobias Taschner
26c82d43d1
Decode strings returned by ExecuteScript()
ExecuteScript returns strings as fully
quoted JSON strings so they have to be decoded
to a binary string.
2020-01-17 21:11:26 +01:00
Maarten Bent
ce968d0ecb
Enable building without wxUSE_WEBVIEW_IE 2020-01-17 09:37:12 +01:00