The mouse was not positioned over the URL in this test so clicking it didn't
work. Tweak the offset to make it pass but it would be better to have some
more fool-proof way of finding the real position of the text in the control.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Numeric validator tests rely on wxLocale::GetInfo() returning the decimal
point and calling setlocale() is not enough to ensure this under MSW, we must
use wxLocale for this currently.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
PNG images are used by the main wxWidgets library itself now and so linking
with the monolithic wx library introduces dependencies on PNG as well, even
for the console applications. Link them with linpng to avoid linker errors.
Closes#12889.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Update configure and bakefile.m4 for the new version too.
Also add the missing makefiles and projects for the XTI sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66836 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Applied (modified) patch by troelsk. Changed comments (which are allowed per frame in an animated GIF) to be read using wxIMAGE_OPTION_GIF_COMMENT with wxImage.GetOption. Added unit tests for reading and writing GIF comments.
Closes#12843.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There were no boundary checks in place to verify an indicated repeat of pixels would still be inside the image's data. Added these checks and a unit test making sure these kind of TGAs now fail to load.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Ensure that the tests expecting the results with a point as decimal separator
really are done in C locale.
This should help the tests pass in (French) locale used by the MSW build bot
slaves.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Setting the locale in the ctor of the test object doesn't work because the
locale is changed by the other tests that run before this one, use the
initialization method provided by cppunit to change the locale instead, this
is somewhat wasteful but at least it does work, unlike the old version.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Applied (modified) patch by troelsk. Also added a basic unit test for checking the frames of a saved animated GIF (a previous unit test already handles content of a GIF with a single frame).
Closes#8583.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66716 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add validators for integer and floating point numbers.
Add an example of their use to the validate sample as well as a new unit test
and documentation for them.
Use the new classes instead of wxTextValidator in wxGrid code.
Closes#12166.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
It seems to make sense to allow using it for formatting and parsing long long
values as well as it can be done trivially using almost the same code as for
long.
It would be nice to support long double in a similar way but we don't wrap
C99 strtold() right now so it wouldn't be as simple, leave it for later.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxNumberFormatter formats and parses numbers with thousands separators.
Add the class itself as well as documentation and the unit test for it.
See #12166.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66710 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The code in wxHtmlParser supposed in many places that a '<' character must be
always followed by a '>' one and could create (and sometimes dereference)
invalid iterators if this wasn't the case resulting in asserts from MSVC debug
CRT and possibly crashes.
Fix this by ensuring that only valid iterators are used and add a trivial unit
test for wxHtmlParser which checks that it can parse invalid HTML without
crashing.
Closes#12869.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66678 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Recently modified client data test added calls to SetClient{Object,Data}(-1)
and MSVC complained about them, suppress these warnings.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66676 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The test for index validity should be done by the base class public methods
themselves so that the protected methods in the derived classes don't need to
do it because this allows to have the check in one place only and not in every
port-specific derived class and also because a protected method can reasonably
expect to be called with already validated parameters.
This makes it unnecessary to perform the same check in many derived classes
and fixes the problem with those that forgot to check for item validity at all
before (like wxGTK wxChoice).
Also add a unit test checking for the correct behaviour. Unfortunately we
don't have any way to test for the precise assert being triggered so the test
passed for wxGTK wxChoice even before in debug builds because the expected
assert was raised by wxArray::Item() but the code crashed in release build --
whereas now it doesn't any more.
Closes#12858.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66664 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
When explicitly requesting saving as a palettised image but then later on that turns out to not be possible (or desired) the image would be marked as PNG_COLOR_TYPE_GRAY or PNG_COLOR_TYPE_GRAY_ALPHA. Simply set the colour type to RGB if this occurs also updated the unit test to catch this case.
This is similar to the fix in r66590 but that one was related to wxUSE_PALETTE == 0 cases.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Supports saving 24-bit and 32-bit (RGB with alpha).
Updated image unit test to verify the alpha channel of saved TGA images. Also removed a condition skipping a test which only was in place for TGA (formerly its saving handler would do nothing yet say saving was succesful).
See also #7661.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66485 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Compare the alpha data of saved images (where applicable, currently for PNG only) to a generated alpha channel. Refactored most of ImageTestCase.CompareSavedImage into (static) function CompareImage to easily compare with a 24-bit image and then a 32-bit one.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Compare the data of loaded images in different formats against a reference image (one for 8-bit images, another for 24-bit). Do the same for images saved using SaveFile. Excluded some formats because they are either lossy or don't pass the test right now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add unit tests checking that the behaviour really corresponds to the
documentation too.
And also mention that it's not a good idea to have strings differing by case
only in wxComboBox anyhow.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66442 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Changes of r66379 broke the unit test as wxAcceleratorEntry::Create() now
requires the TAB to be present in the string passed to it (again).
Update the test to make it pass.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The logical value of wxSlider was changed when its range was changed in wxMSW
if the slider had wxSL_INVERSE style because the logical value was actually
computed using the range and the actual physical control value and we forgot
to update the latter when changing the range.
Do update it now in SetRange() to fix this.
Also add unit tests checking for this and, more generally, for other
operations with inversed sliders.
Closes#12765.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
FromString() should parse string returned by ToString() successfully but this
wasn't the case because the accelerator parsing functions always insisted on
having a TAB in the string.
Fix this, document the string format and add a unit test checking for the
correct behaviour.
Closes#12745.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Check that Insert() returns the index of the last inserted item.
Also document this behaviour for mulit-item renames explicitly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Even though this behaviour is somewhat counterintuitive, the documentation
mentions that this is what should happen and wxGTK and wxOSX already behave
like this so bring wxMSW in line.
wxListBox::DeselectAll() should probably just call SetSelection(wxNOT_FOUND)
when the item to leave selected is not specified too now.
Closes#12705.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
GetFamily() returns wxFONTFAMILY_DEFAULT and not wxFONTFAMILY_UNKNOWN since
r65670.
Correct the test to handle wxFONTFAMILY_DEFAULT as allowed value.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66221 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This change is not needed any longer after r66219 which fixed the real
underlying problem, i.e. that attempting to load an invalid XRC file resulted
in failures when loading all subsequent XRC files.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The path being normalized could have come from user and there doesn't seem to
be any point in complaining about too many ".."s in it when we can handle them
correctly instead.
So simply ignore the extra ".."s for the absolute paths and keep them
unchanged for the relative ones instead of returning an error.
See #10960.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxMenu::GetTitle() returned a string in GTK+ format (i.e. using underscores
instead of ampersands) instead of the expected wx one.
This is, of course, the right thing to do and it also fixes
wxMenuBar::FindMenuItem() as a side effect.
Closes#12672.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66175 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
A virtual list control must override wxListCtrl::OnGetItemText() method and
wxMSW native implementation asserts if this is not the case (the generic one
should arguably do it as well).
Avoid the asserts by providing a dummy implementation of OnGetItemText() in
the unit test.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fixing the implicit focus grabbing by wxTreeCtrl::SelectItem() in r65905 broke
its unit test case as the simulated key event was not delivered to wxTreeCtrl
itself any more.
Fix this by simply setting the focus to the tree explicitly before sending it
any key strokes.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66170 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Parsing an incomplete date with nothing but whitespace and/or date delimiter
characters at the end crashed as we happily went beyond the end of string.
Fix this by not using a loop which didn't check for the iterator validity.
Closes#12685.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66166 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxOSX rearranges the standard menu items such as wxID_EXIT and wxID_ABOUT and,
for the former, changes its text to "Quit", so don't use them in the menu unit
test which expects to find the items in the menus to which they were added and
exactly with the labels used when adding them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66144 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Disable unit tests involving operations (such as conversions between UTF and
anything but plain ASCII) not available in ANSI build.
This fixes the test suite for non-Unicode build under Unix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66103 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
In ANSI build wxString::mb_str() returns a pointer to the internal wxString
data directly instead of a buffer with a proper length, so it provides access
to the part of the string before the first embedded NUL only.
Use To8BitData() which always returns the buffer of the correct size in all
builds.
The open question remains whether mb_str() should be changed to return a (non
owned) buffer and not just a pointer in ANSI build. This would make
manipulating strings with embedded NULs safer but mb_str() would be less
efficient and less compatible.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66102 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The test used a wide character constant and so didn't work in ANSI build. Use
an ASCII string there now while still keeping the original version in Unicode
build.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxCairoRenderer::CreateMeasuringContext() is only implemented for wxGTK so the
test fails under other ports when using Cairo. Disable it for wxX11 for now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66095 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Leaving invalid XRC entries in wxXmlResource internal list of loaded resources
resulted in failures in the XRC unit test which executed after this one.
It seems that loading an invalid resource shouldn't prevent the other ones
from loading correctly later and this probably should be corrected at
wxXmlResource level but for now work around this problem in the test itself.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66070 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775