Commit Graph

68155 Commits

Author SHA1 Message Date
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
Artur Wieczorek
1dc0c777ae Return value of the proper type
Returned value should be the same type like the memeber variable.
2020-04-05 22:06:00 +02:00
Artur Wieczorek
810c1be640 Use GdiPlus::Status enum to represent status of GDI+ operation 2020-04-05 21:55:46 +02:00
Artur Wieczorek
f0e458e25c Get font family of private GDI+ font from the cache
When font family of a private font is retrieved with call to
Gdiplus::Font::GetFamily() then later on there is thrown access violation
exception when array of cached private font families (filled in by
Gdiplus::PrivateFontCollection::GetFamilies()) is deleted in
wxGDIPlusRenderer::Unload(). Call to Font::GetFamily() is done in
wxGDIPlusContext::GetTextExtent() so this issue can be seen once text
extent is retrieved for a private font.
Because it looks that calling to Font::GetFamily() for a private font is
messing up something in the array of cached private font families so
we should avoid calling this method and directly fetch corresponding font
family from the cache instead.
Reference to the cached font family would be stored in
the wxGDIPlusDataFont and it could be fetched from there directly instead
of making a call to Font::GetFamily().

Closes #18704.
2020-04-05 21:14:24 +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
fc3669b551 Add possibility to use generic version to the animation sample
Add menu item to switch to the generic version when using the sample on
a platform where a native version is available (i.e. wxGTK) in order to
allow testing it there easily.
2020-04-05 16:56:58 +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
16c7f4f74d Restore blank line present in master to minimize diff
No real changes.
2020-04-05 16:04:26 +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
ddc87d66e8 Increase the size of the windows in the grid sample
Make larger part of the grid visible initially and also show more lines
in the log window.

No real changes, this is purely cosmetic.
2020-04-05 15:51:35 +02:00
Vadim Zeitlin
d031ef154a Simplify wxGrid::SetSelectionMode() selection updating logic
Don't try to extend the existing selected blocks to rows/columns, this
contradicts the documented behaviour which is to discard the selected
blocks that become invalid in the new mode.

Do handle switching to wxGridSelectRowsOrColumns mode, as there doesn't
seem to be any reason not to.

Update the tests to check for the expected selection update behaviour.
2020-04-05 02:11:04 +02:00
Vadim Zeitlin
13978a6626 Remove outdated comment from wxGridSelection code
Don't mention variable which doesn't exist any more.
2020-04-05 01:52:35 +02:00
Vadim Zeitlin
0ab23a0072 Add a comment about wxGridSelection::IsInSelection() complexity
No real changes.
2020-04-05 01:42:40 +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
7231a6a855 Make temporary variable in GetSelectionRange() const
We don't need to modify the selection blocks here.

No real changes.
2020-04-04 19:04:33 +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
a469d36783 Fix the test where wxGrid scrolling when selecting cells 2020-04-04 18:50:37 +02:00
Ilya Sinitsyn
bfca68c74a Move the wxGrid cursor to the corner of the last selection
Move the wxGrid cursor to the corner of the last selection when splitting
the selection block on click with Ctrl.
2020-04-04 18:50:37 +02:00
Ilya Sinitsyn
f8015b13b1 Implement wxGrid selection blocks iterating interface 2020-04-04 18:50:37 +02:00
Ilya Sinitsyn
8ebdf101b8 Make wxGrid cells selecting by mouse more user friendly 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
72e7bde306 Refactor wxGrid::MakeCellVisible() to scroll in only one direction
Allow -1 for a row or a column single parameter.
2020-04-04 18:50:37 +02:00
Ilya Sinitsyn
206bad9ba0 Remove wxEVT_GRID_RANGE_SELECT handling by wxGrid::SendEvent()
VZ: [...] this is not used by wxGrid itself and SendEvent() is not part
of the public API, so we never made any promises about being able to call
it with wxEVT_GRID_RANGE_SELECT.
2020-04-04 18:50:37 +02:00
Ilya Sinitsyn
779d3f7f17 Clear the selection in wxGrid::SetTable
The selection in m_selection was not considered at all so it was worked not
correctly any way.
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
f1c3dfdca6 Do not merge wxGrid selection blocks
Remove blocks merging because it complicates the behavior at the user point
of view and the code.
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
d1c8bba2b6 Fix SelectEmptyGrid wxGrid unit test
Use CATCH nested sections correctly.
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
Vadim Zeitlin
28a9f50bc7 Merge branch 'grid-align-overflow'
Fix overflow in wxGrid cells with non-default alignment.

See https://github.com/wxWidgets/wxWidgets/pull/1775
2020-04-04 18:46:18 +02:00
Artur Wieczorek
372a609e82 Use ellipsis character instead of "..." approximation
This way editor button label will be shorter.
2020-04-04 18:07:46 +02:00
Artur Wieczorek
c7b789d351 Increase wxPropertyGrid line height under wxGTK3
Line height calculation based on the font size is not right for wxGTK3
because native buttons (used as in-line editor buttons) don't scale down
well and they are not displayed properly within the line.
Minimal button size when the label is displayed properly is 35 so this
has to be minimal line height under wxGTK3.

Closes #18715.
2020-04-04 18:02:40 +02:00
Artur Wieczorek
a3cbcc2c6c Fix positioning the buttons in wxPGMultiButton
For the sake of consistency with editor buttons created with
wxPropertyGrid::GenerateEditorButton(), the borders around the buttons
should be taken into account while positioning the buttons
in wxPGMultiButton.
2020-04-04 17:41:46 +02:00
Vadim Zeitlin
c90bb2596a Upgrade libjpeg to the latest 9d version
This library version includes some optimizations as well as security
fixes.
2020-04-04 00:46:40 +02:00
Robin Dunn
ce8085808c Documentation updates 2020-04-03 14:10:35 -07:00
Robin Dunn
ba5cc4b49a gtk animation ctrl needs to see the generic impl too 2020-04-03 13:37:01 -07:00
Robin Dunn
e258a9d982 Move the animation Impl classes to private headers 2020-04-03 13:22:35 -07:00