Return the deepest child of the window and not the first one as this function
needs to return the window that is at the top of Z-order.
Closes#14591.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxCRT_StrtoullBase(), used by wxString::To[U]LongLong(), didn't handle leading
zeroes nor leading 0x correctly: it never auto-detected base 8; didn't ignore
the leading 0 even if base 8 was specified explicitly; didn't recognize "0X"
prefix at all (only "0x").
Fix all these bugs and add test cases for parsing numbers in other bases to
the unit tests.
Closes#14596.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The best size of the window should be at least as large as its min size and
less than its max size. This allows to override the windows own best size
determination with an explicit SetMinSize() or SetMaxSize() call.
See #11497.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Other ports don't send wxEVT_COMMAND_SPINCTRL_UPDATED from SetRange() even if
the value changed because it was adjusted to fit into the new range and this
makes sense as this change is not due to a user action, so don't send this
event under wxMSW neither.
Also add a unit test checking for this behaviour.
Closes#14583.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Comparisons didn't work correctly in the other direction as they were not
reversed as needed. Fix this by adding wxDEFINE_COMPARISON_REV() macro which
defines comparisons in terms of the reverse operations and use it for both
wxUniChar and wxUniCharRef.
Closes#14547.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't include the possible leading sign in the span of digits to be grouped as
this gave nonsensical strings such as "-,123" when adding thousands separators
to "123".
Closes#14526.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Revert r71945 which disabled failing wxRichTextCtrl unit test. It fails again
now and hopefully will be fixed before 2.9.5.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Disable CaretPosition() unit test as it is broken now. This is only temporary
to allow tests to pass in 2.9.4, will be reenabled (and hopefully fixed) later.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This shouldn't happen but did (and apparently still does, sometimes) under MSW
so add a test verifying that no events are generated by the ctor.
See #14428.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71892 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't rely on implicit conversion of wxString to char*/wxChar*, it doesn't
exist in STL build. Add explicit c_str(), wc_str() or t_str() calls.
Closes#14420.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Something is seriously wrong with simulated mouse events and wxGrid under
wxGTK, they seem to simply disappear sometimes. This results in unit tests
suite failure, so disable these tests for the next release as I just don't
understand how to fix them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to easily test if we're running on a buildbot slave and disable
some difficult to debug test failures there.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Wide char output from wxPrintf() didn't appear at all under Linux because
stdout was switched into narrow stream mode by GNU libc due to initial use of
cout in the test.
Use printf() instead of wxPrintf() as we are only printing ASCII strings
anyhow. Of course, this is not a real fix but at least we can see the tests
results like this.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Correct errors in TransformPoint() and TransformDistance().
Change Rotate() to interpret positive angles as rotating clockwise, for
consistency with wxGraphicsContext::Rotate().
Improve the unit test to verify that all the transformations work correctly.
Closes#14334.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Always use value argument for the text control contents and also override the
initial numeric value with it if it's numeric.
This seems to be the only consistent thing to do, so document this behaviour
and add a unit test checking for it.
Closes#13589.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Restrict the tests added in r70987 to run when using UTF-8 strings only, they
test for something that is simply not true (and for a bug that can't happen)
with non-multibyte encodings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It is wrong to use dir.GetName()+"/" to obtain a slash-terminated directory
name as this results in (usually harmless but at best ugly) double slashes at
at the beginning of the string for the root directory. Add GetNameWithSep() to
obtain the correct result in all cases.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71355 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This change doesn't actually change anything for the "normal" ports as it only
affects wxGTK/MSW which is not officially supported yet, so the make/project
files are unchanged by it.
Closes#14249.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There is a problem with the native header control still having the mouse
capture when the grid is destroyed in wxGTK and this resulted in asserts when
destroying the grid, nested asserts due to an exception being thrown from a
dtor and finally abort that prevented the rest of the tests from running.
As I failed to find the real reason for this problem, just forcefully ensure
that we don't have the mouse capture when destroying the grid. This at least
allows the complete test suite to run.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If an assert occurred while handling an exception generated by a previous
assert handler, the information about the original assert was lost even if
though it was more important than the secondary assert. Do preserve and show
the original assert message in this case now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71318 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This resulted in keeping a dangling pointer to the group line in
wxFileConfigGroup and any attempt to use it after this resulted in a crash.
Fix this by explicitly resetting the last line in this case.
Also add a unit test for this scenario.
Closes#14243.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71311 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Some of the tests that were previously ran for single or multi-line controls
only actually apply to both of them, so run them for both kinds of control to
test that both of them work correctly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71307 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Allow running the same tests for both single and multi-line controls easily.
No real changes yet though, the tests are still ran for the controls with the
same styles as before for now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71306 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Not only this avoids code duplication but it also fixes wrong code in
wxFrameBase version as it set the event object incorrectly to the frame itself
instead of setting it to the menu.
Added event object check to the menu events unit test.
Closes#1595.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71114 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Just verify that an event with the expected id was generated. The test will be
extended later to test for other event fields such as its source object,
see #1595.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71113 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This compiler doesn't exist any more and was probably unsupported even in 2.8,
let alone 2.9, so remove all the __MWERKS__ tests to simplify things.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The pointer returned by wxDateTime::ParseXXX() methods could point into a
buffer of a temporary wxString created to wrap a char* or wchar_t* argument so
dereferencing it was illegal.
Fix this by defining separate overloads for char*/wchar_t* arguments returning
pointers into the original string.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The length of the string here is specified in bytes and is not the same as the
string length for non-ASCII UTF-8 strings, so don't cache it as the string
length.
Just invalidate the cached length instead as we simply don't know what the
real length of the string is going to be.
See #14130.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
A length greater than that of the source string could be passed to this ctor.
This worked correctly, i.e. created a string which was a copy of the source
one but cached a wrong length for it.
Avoid this by explicitly checking the length before caching it in
wxString::assign(str, len).
See #14130.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is similar to the previous commit and adds another missed check for the
iterator not being at the end of string.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use ChildWindowFromPointEx(CWP_SKIPINVISIBLE) to ensure that we find the
disabled children (by not using CWP_SKIPDISABLED).
Add a unit test to check for the correct behaviour in all cases and document
it.
Closes#2942.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
- use correct printf format specifiers
- don't perform operations requiring a window until the window has been created
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70764 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775