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
The built-in of /bin/sh doesn't handle "-n" option that we use (at least not
under OS X 10.6), so we were getting "-n APPL????" in the generated files.
Fix this by using /bin/echo which does support this option.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70744 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This allows to correctly return when the two files with different names
actually refer to the same file system object.
Closes#910.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Until 2.7 glibc wrongly used periods instead of slashes as separators for the
French date format and the test accounted for this, breaking it with recent
glibc versions in which this bug was fixed.
Fix this by limiting the workaround to the old glibc versions only.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This function checks for existence of anything with the given name, not
necessarily just a file or a directory.
Extend the unit test to verify that it returns true for /dev/null on Unix
systems.
Closes#953.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Merge FileExists() and DirExists() together in a single
wxFileSystemObjectExists() helper in preparation for adding a function
checking for the existence of any kind of file system object.
There should be no changes for MSW/Unix but OS/2 file detection was changed
slightly to always use DosQueryPathInfo() instead of using it only for the
directories and stat() for files. Not sure if this is the right thing to do
there but it seems like the code should work.
Also add a simple unit test for these functions.
See #953.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Define _CRT_SECURE_NO_DEPRECATE, _CRT_NON_CONFORMING_SWPRINTFS and
_SCL_SECURE_NO_WARNINGS when using makefiles to build the library too for
consistency with the project files.
These defines are only needed for VC8 and later but should do no harm for the
previous versions.
See #11009.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Rebake all the projects after the changes of r70182, even if they're only
really needed for the library itself, the other project files should
correspond to the bakefiles contents too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Handle positional parameter specifications in wxFormatConverter to ensure that
e.g. "%N$s" are correctly transformed to "%N$S" if needed. This fixes the use
of positional parameters under OS X.
Closes#10965.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The affine transform was previously multiplied by the translation matrix on
the right but this was incompatible with both the MSW version of the same
method and all the other methods of the generic version.
So multiply the transform by the translation on the left, as everywhere else.
Closes#13875.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The charset of the message catalog files changed to UTF-8 in r70411 but the
unit test still expected ISO-8859-1. Update the unit test too to make it pass
again.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
As wxCharTypeBuffer ctor taking the length NUL-terminates the buffer, it may
be expected that extend() does the same but it did not. Do add the NUL at the
end for consistency, even though it's not really needed for the existing code
using extend() in wxWidgets itself.
Closes#13885.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
MS and Apple guidelines mention ellipses should generally be used when a command needs additional information from the user before the operation can execute. This is not the case for showing an about dialog so the ellipses have been removed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Changing the localisation files to be in UTF-8 allows them to be committed by the pre-commit hook script.
Also regenerated relevant .mo files.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70411 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This method was only available in wxUniv before and just always returned true
in the other ports. Implement it for wxMSW and wxGTK too now and document it.
Also add a unit test.
Closes#795.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70350 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Due to a typo the size was expressed in 1/10th of a point and not in points.
Fix this and add a unit test checking that GetStyle() returns the same font as
was set by SetStyle().
Closes#2120.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70341 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
"%z" specifier can now be used when printing the dates out to specify the time
zone and is also recognized when parsing dates.
Closes#1215.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775