Avoid spurious error in the unit test by calling Now() and UNow() a few
times in a row until they return the same second, as we may be unlucky
enough for this not to be the case when we call them just once.
Restore the checks for the model stamp, reverting the changes of
18594afe76: we still need to ignore the
calls to at least iter_children() and iter_nth_child() model methods
that can be called from inside gtk_tree_view_set_model() when we reset
the model, as running these methods crashes when trying to use the
pointers to already deleted items.
For consistency and robustness, add checks for the model stamp to all
the methods and not just those two, just in case other ones end up being
called later in some way.
Also add a unit test checking that DeleteAllItems() doesn't crash and
does delete all items.
Closes#18533.
Since the performance of drawing lines with various pen styles can be the subject of examination it would be good to have the ability to select pen style with a command line option.
So, a new option "pen-style" is supported since now and with this new option "solid", "dot", "long_dash", "short_dash" styles can be explicitly selected.
gtk_widget_get_preferred_size() return zero size if the GTK widget is
hidden, so show it temporarily in order to find its real preferred size.
Add a unit test checking that the best size of a hidden wxChoice is now
determined correctly.
Closes https://github.com/wxWidgets/wxWidgets/pull/1587
Adjust the length limit before pasting to ensure that all text on
clipboard will be successfully pasted, instead of only pasting the part
of it which fits.
Add a unit test checking that this works.
Closes#4646.
This is its actual behaviour and it's the right thing to do, as it's
consistent with Now() -- even though the documentation wrongly stated
otherwise (since 324ab5e2db).
Also add a unit test checking that UNow() == Now(), except for the
milliseconds.
See #14148.
Closes#18524.
Closes https://github.com/wxWidgets/wxWidgets/pull/1594
Fix regression in wxDC::Clear() and make wxGCDC::Clear() consistent with
it by using white if the background brush hadn't been explicitly set.
See https://github.com/wxWidgets/wxWidgets/pull/1582
Collapsing a branch shouldn't deselect all the items under it in
multi-selection mode: this doesn't seem to be useful or otherwise make
sense and makes the generic version gratuitously incompatible with the
native MSW one.
Closes#10239.
Closes https://github.com/wxWidgets/wxWidgets/pull/1581
Somehow using enum results in wrong comparison being done when using gcc
5.3 (the test run when using this compiler fails because the RHS value
is "true" and not the numeric value of the enum element), so add a cast
to make this work.
This key combination is used for selecting all text, while it's also
relatively common to use it as an accelerator for some menu item.
Resolve the conflict in favour of wxTextCtrl, i.e. let it have this key
when it has focus, while still allowing to use it as an accelerator
otherwise.
Create this frame as child of the main application window to make it
appear near it, instead of in a more or less random location. This
facilitates debugging, but doesn't really change anything otherwise.
Check that adding a window to either the same, or different, sizer the
second time asserts -- but that it can still be moved to another sizer
if it is detached from the first one first.
Also document that SetContainingSizer() should never be called from
outside the library.
See #17166.
Declaring the copy ctor/assignment operator for a local class without
defining them triggers MSVC warning C4822, so don't do this to avoid
unnecessary noise in the build logs (we could disable the warning or
conditionally do this for non-MSVC compilers, but it doesn't seem to be
worth doing this for a class used inside a single function and very
unlikely to be copied accidentally).
No real changes, this is just a refactoring to allow reusing the same
loop waiting until we can get the real window geometry in other tests.
This commit is best viewed with --color-moved.
The initial value was not taken into account before because the best
size computed before it was set, i.e. for the empty control, was always
used, as it was never invalidated.
Do invalidate it now if the control is created with non-empty value, in
order to adjust its best, and initial, size appropriately to its
contents.
Closes#18507.
Closes https://github.com/wxWidgets/wxWidgets/pull/1560
Avoid calling wxGrid::SetCurrentCell(0, 0) when the grid has no columns
or rows, as it doesn't have any cells then and doing this logically
fails the precondition assert in GetColPos().
Also refactor all 6 different snippets calling SetCurrentCell() in
Redimension() into a single function to simplify the code and make it
more maintainable.
Add a unit test verifying that this works as intended.
Closes https://github.com/wxWidgets/wxWidgets/pull/1546
Fix handling Enter in multiline text controls in wxMSW.
And other improvements, notably don't send wxEVT_TEXT_ENTER for controls
without wxTE_PROCESS_ENTER style.
Closes#18491.
See https://github.com/wxWidgets/wxWidgets/pull/1539
Since the changes of 04f7f1fd32 (frozen
rows/columns implementation), RefreshBlock() could call GetColPos() with
an invalid index. This didn't matter most of the time as the function
simply returned the same index as long as the columns were using their
natural order, but resulted in a crash due to an out of bound access to
m_colAt array as soon as they were reordered.
Fix this by avoiding using invalid indices in RefreshBlock() and, more
generally, improving its precondition check and making the assumptions
about the input parameters more clear. Also add a defensive check to
GetColPos() itself.
Finally, add a unit test exercising this code.
Closes https://github.com/wxWidgets/wxWidgets/pull/1536
Restore behaviour until c43e0fa123 and let
Enter presses in multiline text controls perform their default function
in the control instead of closing the dialog.
Make the unit test more discerning to check for this.
wxMSW always sent this event to multiline text controls, even when they
didn't have wxTE_PROCESS_ENTER style, contrary to what was documented.
Avoid sending this event unless wxTE_PROCESS_ENTER is used and add unit
tests checking that multiline text controls don't get it without this
style (but still do get it with it).
For once, using the event table macros is preferable because this
bypasses the (generally helpful, but not here) test done by Bind()
verifying that wxEVT_TEXT_ENTER handler is bound to a window with
wxTE_PROCESS_ENTER style.
Doing it like this will allow to check that controls without this style
really do not receive the corresponding event.