Commit Graph

1216 Commits

Author SHA1 Message Date
Vadim Zeitlin
b0ec002323 Added wxStopWatch::TimeInMicro() for better precision time measurement.
Also simplify/streamline wxStopWatch implementation and replace confusingly
named m_pause with more clear m_elapsedBeforePause.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69835 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-11-27 19:50:12 +00:00
Vadim Zeitlin
c439998525 Use shorter sleep times in wxStopWatch unit test.
Make wxStopWatchTestCase::Misc() run in 2.5 seconds instead of 7. This not
only makes the test run faster but allows us to test wxMilliSleep() and
precision of wxStopWatch for time periods in fractional seconds.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-11-27 19:50:05 +00:00
Václav Slavík
23f32cd750 Test correctness of wxArray::Index() with bFromEnd=true.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-11-05 15:20:11 +00:00
Vadim Zeitlin
ea10101a15 Link tests with webview library only if it is actually available.
This allows the tests to build again even on the machines without the
prerequisites for building wxWebView.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-30 14:19:59 +00:00
Vadim Zeitlin
dd4eefcb29 Document and test behaviour of wxRegion methods when it is invalid.
Document which wxRegion methods can and can't be used when the region itself
is invalid.

Apply the minor changes to wxGTK (Xor() didn't do the right thing, Offset()
didn't assert) and wxOSX (Offset() crashed) to make their behaviour consistent
with wxMSW.

Add a (trivial, so far, but to be extended later) wxRegion unit test checking
that the methods do indeed behave as documented.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69461 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-10-18 21:56:48 +00:00
Jouk Jansen
e26aff5636 Fixes for OpenVMS on IA64
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-29 13:47:38 +00:00
Steve Lamerton
30e2c04682 Only build the wxWebView tests if there is an available backend.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69081 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-14 07:39:28 +00:00
Steve Lamerton
6edb39127b Correct a typo in the wxWebView tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69078 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-13 19:39:38 +00:00
Steve Lamerton
92b4653a62 Rebake trunk after wxWebView merge and add missing project files for the wxWebView library.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-11 10:12:19 +00:00
Steve Lamerton
b2b31b87fb Merge the new wxWebView classes from the SOC2011_WEBVIEW branch.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69049 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-10 18:09:12 +00:00
Steve Lamerton
1d156af324 Merge in from trunk r68684 - r69046
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@69047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-09-10 15:09:22 +00:00
Dimitri Schoolwerth
ab176b4b50 Added alpha saving support to TIFF image handler.
Added support for saving alpha with RGB, greyscale, and black and white images.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-29 01:13:06 +00:00
Vadim Zeitlin
211d331379 No changes, just fix the file name in the header comment of wxDVC test.
s/tree/dataview/

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-27 14:11:31 +00:00
Vadim Zeitlin
524cb04066 Add new wxTreeListCtrl class.
This is a facade for wxDataViewCtrl allowing to easily work with multi-column
trees, possibly with an optional checkbox in the first column. Its API is very
similar to wxTreeListCtrl and it provides a simple migration path from the
latter.

Add the class itself, documentation for it and minimal unit tests.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-27 14:11:03 +00:00
Dimitri Schoolwerth
4ca8531f61 Added wxBITMAP_TYPE_TIFF and wxBITMAP_TYPE_TIFF_RESOURCE.
Having wxBITMAP_TYPE_TIFF and wxBITMAP_TYPE_TIFF_RESOURCE is more consistent with already using the complete short name of an image format elsewhere (e.g. wxBITMAP_TYPE_JPEG, not wxBTMAP_TYPE_JPG, and wxTIFFHandler as opposed to wxTIFHandler). Renamed all existing occurrences and kept the old enum values for backwards compatibility.

Also renamed occurrences of wxBITMAP_TYPE_RESOURCE to the already existing wxBITMAP_TYPE_BMP_RESOURCE.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68859 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-23 04:55:46 +00:00
Václav Slavík
c08598f6cd Fix typo.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68847 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-22 14:14:55 +00:00
Vadim Zeitlin
fa93d732e2 Harmonize wxDataViewCtrl::GetSelection() behaviour in all ports.
wxDataViewCtrl::GetSelection() now always returns invalid item if more than
a single item is selected in a multi-selection control.

Also add HasSelection() and GetSelectedItemsCount() to allow checking if any
items are selected.

Updated the documentation, all ports and added a test for all these functions.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68844 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-22 12:41:19 +00:00
Vadim Zeitlin
c3ad4d4a45 No changes, just use CPPUNIT_ASSERT_EQUAL() instead of CPPUNIT_ASSERT().
CPPUNIT_ASSERT_EQUAL() gives more informative error messages in case of
failure which is important when running tests unattended on build slaves.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-22 12:41:12 +00:00
Steve Lamerton
98d689e403 Rebake
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68831 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-22 09:16:48 +00:00
Vadim Zeitlin
36a96421b3 Replace wxComboBox::IsEmpty() with Is{List,Text}Empty().
IsEmpty() didn't exist in all ports (notably not wxMSW) and its meaning was
unclear anyhow, so remove it even from the ports where it did exist and add
clear Is{List,Text}Empty() replacements instead.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68808 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-21 12:06:16 +00:00
Dimitri Schoolwerth
409fe759e1 Fixed failing test in ImageTestCase for builds made with makefiles.
The recently added BMP images in tests/image/ were not being copied. Added them to test.bkl and regenerated makefiles.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68791 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-19 16:10:07 +00:00
Steve Lamerton
e7aef23e7b Rename wxUSE_WEB to wxUSE_WEBVIEW to reflect that actually it specifically toggles the wxWebView class and associated features.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68788 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-19 09:15:06 +00:00
Dimitri Schoolwerth
fc695138b4 Added option to TIFF handler for specifying the photometric interpretation.
Added option wxIMAGE_OPTION_TIFF_PHOTOMETRIC for reading and writing TIFF images. This is mostly for being able to distinguish between PHOTOMETRIC_MINISBLACK (chocolate flavour) and PHOTOMETRIC_MINISWHITE (vanilla) as currently the flavour used was fixed. It applies to greyscale as well as black and white images. Added unit tests to verify the written photometric value.

Also see #13194.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68785 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-19 03:47:40 +00:00
Dimitri Schoolwerth
8e28cc4701 Added support for saving greyscale TIFF images.
When saving with a samples per pixel value of 1 the TIFF handler still treated the image as RGB, resulting in corrupted images. Handle the greyscale case and added a unit test for it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68784 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-19 02:35:48 +00:00
Dimitri Schoolwerth
0e11090ef6 Fixed crash when saving as a monochrome TIFF image with incomplete options set.
When setting only wxIMAGE_OPTION_TIFF_BITSPERSAMPLE to 1 the used samples per pixel (wxIMAGE_OPTION_TIFF_SAMPLESPERPIXEL) would still be set to 3. This is invalid and confuses libtiff, resulting in a crash ("possible heap corruption" during _TIFFfree using WinXP+MSVC8). Set the used samples per pixel to 1 explicitly in cases where only bits per sample is set to 1. Added a unit test to check for this problem (and verify the bits per sample from the saved image is indeed 1).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68782 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-19 02:00:25 +00:00
Dimitri Schoolwerth
7ffc9affb4 Fixed saving TIFF images to wxMemoryOutputStream.
Libtiff attempts to seek past the end of a stream and the behaviour for this can vary per stream implementation. Fixed failure to seek by filling the gap between the end of stream and new seek position with zeroes. Enabled a unit test which so far was disabled due to wxMemoryOutputStream failing to save a TIFF because of the seeking problem.

Also closes #4089.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68772 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-18 13:15:43 +00:00
Dimitri Schoolwerth
d06c3098ab Improved BMP decoding.
The BMP decoder did not handle images that are not stored upside down but straight up (in which case the height is negative). Also with RLE4 or RLE8 compressed images the 'end of scanline' RLE marker was not handled correctly. Fixed the issues and added a unit test for them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68766 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-17 21:01:09 +00:00
Steve Lamerton
a032168d8c Complete rebake with web libraries to allow easier testing.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-10 18:32:52 +00:00
Steve Lamerton
94e0018723 Merge in from trunk r64802 - r68625
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68626 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-10 18:10:42 +00:00
Václav Slavík
cbef7338c1 Add some basic tests for wxDataViewCtrl selection handling.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68623 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-10 15:24:25 +00:00
Vadim Zeitlin
567e5e47ee Improve wxTextCtrl::GetNumberOfLines() unit test and documentation.
First, enable execution of the Lines() wxTextCtrl unit test case under wxOSX
as it passes since the fix in the previous commit.

Do add a test for GetNumberOfLines() that currently doesn't work in the same
way under all platforms -- but with this test we at least can be sure how does
it work exactly where.

Also mention the current discrepancy in this function behaviour in the
documentation.

See #12366.

Fix Lines() wxTextCtrl unit test to pass under wxGTK too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-30 21:54:15 +00:00
Vadim Zeitlin
6ce832135e Add wxTextCtrl::PositionToCoords() functions for wxMSW and wxGTK.
The new method allows to find the coordinates in pixels of the given character
in a text control.

Closes #13221.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68450 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-29 15:11:54 +00:00
Steve Lamerton
906c935a80 Merge in from trunk r67662 to r64801
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-25 16:54:53 +00:00
Vadim Zeitlin
1a63798c5a Fix parsing of negated long options in wxCmdLineParser.
Negated long options were not recognized in wxCmdLineParser::Parse(), do check
for them now.

Also extend the unit test to check for negated options.

Closes #13335.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68316 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-21 13:49:55 +00:00
Steve Lamerton
c9ccc09c64 Add RunScript and implement on all backends. Document and add a very simple unit test.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68275 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-15 12:38:47 +00:00
Steve Lamerton
41933aa5a0 Add ClearSelection for msw ie and gtk webkit, with a stub for osx webkit. Document and add to unit tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-15 09:36:08 +00:00
Steve Lamerton
0609769d3b Fix all the unit tests for gtk, they now all pass on msw with the ie backend and gtk with the webkit backend.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-14 19:31:21 +00:00
Steve Lamerton
18cf6bb5b4 Add unit tests for zoom functions
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-14 14:02:14 +00:00
Steve Lamerton
d563e28f82 Yield after control creation to allow it to load the initial page.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68269 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-14 13:33:20 +00:00
Steve Lamerton
526292e713 Update web units tests so that they compile after api change.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68268 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-14 13:19:53 +00:00
Steve Lamerton
a9c153392c Update selection unit test to test GetSelectedHTML.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-12 08:41:11 +00:00
Steve Lamerton
c9355a3df6 Add support for retrieving the currently selected text. Implement on all backends, document and unit test.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-10 18:11:43 +00:00
Steve Lamerton
c7cbe308f6 Add the ability to enable / disable and check for the editable property of a rendering engine. Implement for all three backends and extend the sample, document and unit test.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68193 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-08 19:34:56 +00:00
Steve Lamerton
3ce14be7b9 Factor out url loading logic into a separate function to reduce repetition.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68191 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-08 14:46:51 +00:00
Steve Lamerton
1a693ec8d9 Add tests for the back and forward history lists.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-08 14:35:49 +00:00
Steve Lamerton
f152b4b93f Add unit tests for history clearing and enabling / disabling.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68189 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-08 14:21:46 +00:00
Steve Lamerton
d07fd8b021 Add tests for url and history support
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68188 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-08 13:11:17 +00:00
Steve Lamerton
6a2ef29f66 Add tests for the page title
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68187 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-08 10:51:15 +00:00
Steve Lamerton
2dad08eca5 Add scaffolding for wxWebView unit tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68185 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-07-08 08:19:25 +00:00
Vadim Zeitlin
5f899cbe91 Fix bug when setting an out of range date in wxMSW wxDatePickerCtrl.
The internally stored date value was getting out of sync with the real date in
the control itself when SetValue() was called with a date out of the currently
set range. This resulted in an assert failure and other unpleasantness later.

Fix the bug and add a unit test checking for it (and also with some other
basic wxDatePickerCtrl checks).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67990 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-06-19 22:46:45 +00:00
Vadim Zeitlin
a5f226861c Extract wxDateTime-related cppunit helpers in a separate header file.
No real changes, just refactor the code to allow using CPPUNIT_ASSERT_EQUAL
with wxDateTime in other tests in the future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67989 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-06-19 22:46:42 +00:00
Vadim Zeitlin
bf0f3b269f Add a trivial benchmark for wxDateTime::ParseDate().
Add a test to check the performance of this method.

See #13242.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67775 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-23 11:06:48 +00:00
Vadim Zeitlin
715efa4e25 Allow passing wxLongLong values directly to wx pseudo-vararg functions.
Allow passing wxLongLong objects when a "%lld" format specifier (or
equivalent) is used just as we already do for wxString objects when "%s" is
used. This is more convenient and makes wxLongLong closes to the native type.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-17 22:12:39 +00:00
Vadim Zeitlin
352a7d6c46 Ensure that we never return negative client size.
wxMSW could return negative client size for tiny windows with borders, this
was unexpected and shouldn't happen so explicitly ensure it does not.

Also add a unit test to check that this problem doesn't exist in other ports.

Closes #13184.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-16 14:07:40 +00:00
Vadim Zeitlin
d3eec3b672 Attempt to work around Mac g++ 4.0 bug in fswatcher unit test.
Don't define the class overriding a virtual base class method inside the test
function as g++ 4.0 under OS X 10.5 fails to compile this for some mysterious
reason.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-10 08:54:20 +00:00
Vadim Zeitlin
89511b4268 Rewrote wxMSW radio menu items code to support not only appending them.
Previously the radio menu items could only be appended to a menu in wxMSW,
inserting them (either in an existing radio group or to start a new one) not
only didn't work but could even result in crashes because invalid iterators in
the menu items list could be used.

Fix this by storing the ranges of all radio groups in wxMenu itself instead of
storing the information about the radio group an item belongs to in the item
itself and by updating this data whenever a new radio item is inserted. Also
get rid of the notion of "current radio group" in wxMenu which doesn't really
make any sense.

Finally add a unit test checking that inserting radio items works as expected.

Closes #13200.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-10 08:50:38 +00:00
Vadim Zeitlin
6a9455d3f0 Fix compilation of wxFileSystemWatcher unit test in non-PCH build.
Add #include of wx/timer.h needed when not using PCH.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67695 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-04 00:01:58 +00:00
Vadim Zeitlin
51fb867819 Fix wxFileSystemWatcher::Remove() in wxMSW.
Removing the path watched by wxFileSystemWatcher didn't do anything in wxMSW
implementation so we still continued getting events for the changes to this
path even after calling Remove().

Fix this by really implementing Remove() properly. Also add a unit test
checking that we don't get any events after calling Remove().

See #12847.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67691 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-03 23:31:29 +00:00
Vadim Zeitlin
17e23c0cb9 No changes, just slightly simplify wxFileSystemWatcher unit test.
CheckResult() method of the test event handler doesn't need to return
anything, it uses CPPUNIT_ASSERTs and related macros inside it to check that
everything is expected.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-03 23:31:24 +00:00
Dimitri Schoolwerth
a1b806b982 Replaced Ok() occurrences with IsOk() throughout trunk.
Additionally renamed wxOSX' private wxNativePrinterDC::Ok() function to IsOk().

Didn't deprecate the various Ok() functions: given the amount of changes already introduced in 3.0 a trivial one like this seems more suitable for after 3.0.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67681 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-03 16:29:04 +00:00
Dimitri Schoolwerth
1b54c33f81 Rebaked test GUI projects with toplevel.cpp included.
Added toplevel.cpp to GUI test projects and removed the test suite from the unnamed registry so that by default its tests don't run (some regarding ShowWithoutActivating are failing). This way at least the source file has more of a chance to be in a compilable state (compilation was broken). toplevel.cpp has never been included in a project since its addition in r62508 ("[...] until the mainloop issues are resolved [...]").

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-05-01 14:58:58 +00:00
Dimitri Schoolwerth
e3778b4d9c No code changes, fixed some typos.
Changed several occurrences of "it's" where "its" is meant, as well as a few other minor typos.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-30 10:57:04 +00:00
Vadim Zeitlin
dff485d079 Disable numeric_limits<wxLongLong> test for VC6.
VC6 doesn't specialize numeric_limits<> for its __int64 so it's not
specialized for wxLongLong neither when using this compiler.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-27 18:44:11 +00:00
Vadim Zeitlin
48611b8fc2 Get rid of useless temporaries in wxAffineMatrix2D unit test.
See #13092.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67632 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-27 18:44:07 +00:00
Vadim Zeitlin
09fa09bf2b Add wxUSE_DC_TRANSFORM_MATRIX checks to the unit test.
Allow the unit test to compile even when wxUSE_DC_TRANSFORM_MATRIX is 0.

See #13092.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-27 18:43:58 +00:00
Vadim Zeitlin
ab797d5d34 Add a unit test for wxAffineMatrix2D class and its support in wxDC.
Verify that applying a world transformation to wxDC really does result in the
expected transformation.

See #13092.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67617 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-26 22:57:20 +00:00
Vadim Zeitlin
a25b5bbfc9 Make it easier to compare wxImages in the unit tests.
Instead of forcing the tests to manually use memcmp(), specialize
CppUnit::assertion_traits<> for wxImage. This allows to simply use
CPPUNIT_ASSERT_EQUAL() and related macros with wxImage objects.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-26 22:57:16 +00:00
Vadim Zeitlin
3dd4d0ec9e Specialize std::numeric_limits<> for wxLongLong and wxULongLong.
numeric_limits<> should be specialized for number-like types to allow using
them in a similar way to the built-in types.

Closes #13162.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-26 22:56:50 +00:00
Vadim Zeitlin
2ab92d62cf Add a simple unit test for wxParseCommonDialogsFilter().
Verify that this function (which is used for parsing the wildcard strings used
with file-related dialogs) works as expected and also asserts when given
invalid input.

See #4489.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67585 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-23 14:53:38 +00:00
Vadim Zeitlin
6f24b81707 Fix wxXmlDocument::SetRoot() broken by recent changes.
Support for wxXML_PI_NODE introduced in r67346 broke SetRoot() and, because of
this, saving XML documents.

Correct this and add a unit test for this method.

Closes #13135.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-17 00:09:45 +00:00
Vadim Zeitlin
0287ae5c75 Re-define push_back() in wxSortedArrayString to behave correctly.
Adding items to wxSortedArrayString should always keep them sorted but while
Add() did this, push_back() didn't breaking the class invariant.

Redefine push_back() in _WX_DEFINE_SORTED_TYPEARRAY_2 macro to fix this and
add a unit test checking that wxSortedArrayString::push_back() does work now.

Closes #13134.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-10 15:36:07 +00:00
Vadim Zeitlin
02c9435466 Fix vararg function in wxXml unit test broken by recent changes.
The changes in r67345 changed CheckXml() vararg function to take a reference
as the first argument but this doesn't work with va_start(), so revert to
using a pointer here.

This fixes the current unit test failures in the XML tests.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-06 16:37:24 +00:00
Vadim Zeitlin
cee25be77b Correctly restore the old locale in wxXLocale functions.
In non-wxHAS_XLOCALE_SUPPORT case we didn't restore the original locale
correctly in wxStrtoxxx_l() functions as the return value of wxSetlocale() was
incorrectly assumed to be the old locale instead of the new one.

Fix this and also replace the macros used by the old code with a small helper
class, this simplifies the code and is less ugly.

Finally add a unit test which failed before these changes when the program ran
in any non-C locale but passes now.

Closes #13117.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-06 14:37:32 +00:00
Vadim Zeitlin
fd1c361c33 Fix incorrect use of setlocale() in wxLocale::IsAvailable().
The return value of setlocale() was used incorrectly in this code: it
represents the newly set locale and not the previously active one so we didn't
actually restore the original locale before.

Fix the code and check that we do actually restore the locale in a new unit
test for it.

See #13117.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-06 14:37:27 +00:00
Vadim Zeitlin
e042c3b582 Don't do anything in WX_ASSERT_FAILS_WITH_ASSERT when wxDEBUG_LEVEL==0.
We can't test for assert failure when using a build of wxWidgets in which
asserts don't exist at all.

Closes #13119.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-05 22:29:58 +00:00
Vadim Zeitlin
cda937864f Fix VarArgTestCase compilation when type traits are unavailable.
When type traits are unavailable we can't check whether a type can be passed
to a vararg function but we still need to pass a copyable object to
wxString::Format() for the code to compile, even if we just want to check that
it will fail with the assert at run-time.

Closes #13118.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-05 22:29:55 +00:00
Dimitri Schoolwerth
3fdcd5d5ab Changed licence references to "wxWindows licence".
Use "wxWindows licence" and not "wxWidgets licence" and also use British spelling for licence. Updated new occurrences in recently added files and a couple of previously (r64940) missed ones.

See #12165.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-04 09:21:52 +00:00
Dimitri Schoolwerth
a5a0ba3dbd Fixed failing image test.
ImageTestCase::DibPadding was always failing due to differences in pixel data between the decoded GIF and encoded ICO image. Instead of comparing image content just check if the saving of the ICO succeeds (prior to r67296 it would crash).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-03 22:41:58 +00:00
Dimitri Schoolwerth
d13b34d3f2 No code changes, fixed various typos.
Applied patch by snowleopard2 fixing typos in interface/. Extended the fixes throughout trunk.

Closes #13076.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-03 20:31:32 +00:00
Vadim Zeitlin
f0e52da8dc Fix alpha handling in CSS syntax in wxColour in non-"C" locale.
Use locale-independent functions to parse and generate the floating point
alpha representation in CSS syntax for colours to make it work in locales
which don't use period as decimal separator.

Closes #13077.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-31 09:28:41 +00:00
Vadim Zeitlin
cee8636e94 Add support for elements preceding the document node in wxXML.
This is mainly useful for parsing and generating processing instructions but
can be used for any kind of elements, e.g. also comments, occurring before the
document node in XML documents.

Closes #11593.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67346 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-30 14:16:19 +00:00
Vadim Zeitlin
e8afaabf01 Fix memory leaks in wxXml unit test.
Ensure that the root wxXmlNode is deleted by storing it in a wxScopedPtr
instead of a raw pointer.

See #11593.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67345 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-30 14:16:13 +00:00
Dimitri Schoolwerth
2a6545a5a7 Fixed buffer overflow when saving certain images in the Windows icon format.
When an image did not have a width with a multiple of 4 the calculations for the number of padding bytes (to get a scan line DWORD aligned) would be wrong. This caused a buffer overrun when saving the 1 bits per pixel mask.

Fixes #12937.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67296 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-23 15:20:25 +00:00
Dimitri Schoolwerth
4c51a665c6 Fixed various typos.
Applied patch by snowleopard2 fixing a bunch of typos such as misspellings and double words in the documentation. Combined the patch with some local queued typos waiting to be committed as well as adding new typo fixes inspired by the patch.

Function names with American spelling were not changed nor was third-party code touched. The only code changes involve some changes in strings that are translated ("Can not" -> "Cannot").

Closes #13063 (again).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-22 14:17:38 +00:00
Vadim Zeitlin
fd3a4cb92d Added precision parameter to wxString::From[C]Double().
Optionally support fixed precision in wxString::FromDouble() and FromCDouble()
methods. This is mostly useful for the latter to be able to format numbers in
portable way (using dot as decimal separator) without loss of precision but
also do it for the former for consistency.

Closes #12973.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67181 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-13 13:53:54 +00:00
Dimitri Schoolwerth
8529b0b909 Improved palette handling with saving PNG files.
Instead of converting alpha to a mask an attempt is made to write a palettised PNG file with an ARGB palette using a maximum of 256 transparency values where formerly just up to one was supported. GIF images with 256 colours and transparency can now also be saved as a palettised PNG instead of true colour, making the image a lot smaller.

Applied (modified) patch by troelsk. Closes #12850.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-01 21:29:17 +00:00
Vadim Zeitlin
d44bc7333a Use single quotes in wxMarkupText unit test to work around VC6 bug.
VC6 seems to have a strange bug with escaped quotes used in strings passed to
macros and failed to compile the original code with nonsensical error messages.

Use single quotes to try to work around this issue. They are also somewhat
more readable as they don't need to be escaped inside C strings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67077 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-27 18:36:55 +00:00
Vadim Zeitlin
3da9cffc79 Replace wxST_MARKUP style with wxControl::SetLabelMarkup().
This is an incompatible change which removes the wxStaticText-specific
wxST_MARKUP style and adds wxControl::SetLabelMarkup() replacing it.

It doesn't actually change anything yet but it simplifies wxStaticText code a
lot by getting rid of many markup-related functions in it which had to behave
differently depending on whether wxST_MARKUP was used or not and also paves
way for adding markup support for the other controls in the future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67055 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-27 12:47:26 +00:00
Vadim Zeitlin
5eb051a73b Add wxMarkupParser::Strip().
This helper function strips all markup tags from the string (and also decodes
the XML entities in it).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67049 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-27 12:46:48 +00:00
Vadim Zeitlin
9bb9964e26 Add a class for parsing simple markup.
This code is not used anywhere yet, this commit only adds the parser for the
markup and the related classes as well as the corresponding unit test.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67048 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-27 12:46:42 +00:00
Vadim Zeitlin
7067a74dd9 Disable NumValidatorTestCase::Interactive() for build bot slaves.
This test consistently fails on the MSW build slave machines (see e.g.
http://buildbot.tt-solutions.com/wx/builders/XPSP2 VC9 wxMSW trunk release/builds/2084/steps/test/logs/stdio)
for unknown reason so disable it for them. Notice that it does pass when ran
locally so it looks like another instance of a problem with wxUIActionSimulator
on these machines rather than the problem with the class itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67046 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-27 12:45:30 +00:00
Václav Slavík
9a49372428 More wxControl::Ellipsize() tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66875 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-09 19:52:50 +00:00
Vadim Zeitlin
b083f3e8c1 Tweak offset in the RichTextCtrlTestCase::UrlEvent() to make it pass.
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
2011-02-08 17:24:50 +00:00
Vadim Zeitlin
fb76ad8f55 Use wxLocale instead of setlocale() to change the locale in the tests.
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
2011-02-08 17:24:45 +00:00
Vadim Zeitlin
e4c903b2ea Fix wxWrapSizer minimal size calculation.
Add a unit test checking that wxWrapSizer::CalcMin() returns the expected
results.

Closes #12464.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66862 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-02-08 13:36:13 +00:00
Vadim Zeitlin
57c7447463 Link console programs with PNG library in monolithic build.
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
2011-02-05 20:25:09 +00:00
Vadim Zeitlin
00eef16d51 Rebake everything using bakefile 0.2.9.
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
2011-02-03 15:02:45 +00:00
Dimitri Schoolwerth
15f345aad3 Added support for reading comments from a GIF image.
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
2011-02-02 11:19:30 +00:00
Dimitri Schoolwerth
fdfedfc077 Fixed heap corruption when reading a corrupted RLE TGA image.
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
2011-01-25 11:23:42 +00:00
Vadim Zeitlin
c9ed413ab4 Explicitly set "C" locale for the tests using decimal point.
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
2011-01-20 15:06:17 +00:00