Commit Graph

140 Commits

Author SHA1 Message Date
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
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
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
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
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
Vadim Zeitlin
a54cf37118 Add wxIntegerValidator and wxFloatingPointValidator classes.
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
2011-01-19 10:48:28 +00:00
Vadim Zeitlin
6686fbad16 Add wxNumberFormatter class helping to deal with thousands separators.
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
2011-01-19 10:47:40 +00:00
Vadim Zeitlin
3625820490 Fixes for parsing invalid HTML without tag ends.
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
2011-01-13 14:49:55 +00:00
Jaakko Salli
997ddb2ced Added OwnerDrawnComboBoxTestCase (currently only has copies of wxComboBox tests)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66410 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-12-20 13:55:40 +00:00
Vadim Zeitlin
944f641cf9 Don't require leading TAB in wxAcceleratorEntry::FromString().
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
2010-12-03 12:39:57 +00:00
Vadim Zeitlin
68ebe2620f Add wx(Simple)HtmlListBox unit test.
For now just test the wxItemContainer methods.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66276 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-27 11:34:34 +00:00
Vadim Zeitlin
681694bca9 Add a unit test checking selection updating in virtual wxListCtrl.
Verify that the selection is updated correctly after the number of items in
the control is decreased.

See #12378.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66141 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-13 15:03:20 +00:00
Vadim Zeitlin
65571ec7bf Add a beginning of wxMenu unit test.
Test wxMenu and wxMenuBar item search and counting functions.

See #12672.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66139 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-13 15:03:02 +00:00
Vadim Zeitlin
0526c8cc07 Add support for id ranges to XRC.
Allow to declare ranges of consecutive IDs in XRC by using the "id[n]" syntax.
Show this functionality in the xrc sample and test it in the new unit test.

Also show and test the "object reference" XRC functionality.

Closes #11431.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66059 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-11-07 14:00:59 +00:00
Vadim Zeitlin
042ddf5def Add a simple test for keyboard events generation.
Check that the events generated by wxUIActionSimulator result in the same
wxKeyEvents being generated under all platforms. This is not the same as
checking the event generation for the actual keys pressed by the user as there
are some small differences between the two but better than nothing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-11 10:18:31 +00:00
Vadim Zeitlin
232fdc630c Merge the new GUI tests from SOC2010_GUI_TEST branch.
Add a lot of tests for many wx GUI classes.

Add tests using the new wxUIActionSimulator class but disable them under OS X
as too many of them currently fail there.

Refactor the test suite to make organizing the existing tests and adding the
new ones easier.

Improve documentation using the information gathered while testing the
classes. Also update the documentation of the testing system itself.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-08-22 22:16:05 +00:00
Francesco Montorsi
81ec0e15af move console sample's interactive tests to two different CppUnit testsuites: InteractiveInputTestCase which requires user input and InteractiveOutputTestCase which outputs stuff to be checked from the user.
Leave in the console sample only a barebone console application (i.e. a real example).

Closes #11960

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64679 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-21 21:03:47 +00:00
Francesco Montorsi
e7747eb2e0 Move dir tests from the console sample to DirTestCase
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-19 12:32:57 +00:00
Jaakko Salli
109e2ca434 Added wxIsPod<>. Use it in wxAny instead of wxIsMovable<>.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-14 15:12:37 +00:00
Francesco Montorsi
69fc85873d moved non-interactive tests for wxDynamicLibrary, wxGet/SetEnv, wxTempFile, wxCopyFile to appropriate CppUnit test suites;
removed wxFile and wxTextFile tests (complete testsuites already exist for them)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-13 14:30:55 +00:00
Francesco Montorsi
49e323a5b5 remove some tests from the console sample:
- wxLog already has a better cppunit test class
- wxLocale test in the console sample didn't work on Windows and wasn't very useful

move some tests from the console sample to CppUnit tests:
- wxPathList => PathListTestCase
- wxModule => ModuleTestCase

remove some tests about removed functions of wxMimeTypesManager

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-06 14:21:27 +00:00
Francesco Montorsi
7b8ccf3321 Move wxRegConfig tests from console sample to a new wxRegConfigTestCase class.
Remove wxRegKey tests from console sample: on newer Windows they only work when run with admin privileges; also we can expect wx[Reg]ConfigTestCase to already check a good number of wxRegKey features.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64466 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-06-02 14:12:07 +00:00
Francesco Montorsi
ec0e093913 move all non-interactive FTP tests from the console sample to a new CppUnit FTPTestCase test.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-29 07:56:08 +00:00
Francesco Montorsi
45cb70531f remove TestTimer() (adds nothing to existing tests) and move wxStopWatch tests to a new CppUnit test.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64326 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-16 15:44:17 +00:00
Francesco Montorsi
1f5496a0f5 move code testing wxThread classes from the console sample to a new CppUnit test
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64283 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 21:48:24 +00:00
Václav Slavík
b796194b15 Regenerated makefiles after removing USE_GDIPLUS.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-04-09 14:14:26 +00:00
Vadim Zeitlin
27297c823a Implement wxMask copy ctor for wxGTK.
Without copy ctor copying masks simply crashed because the same pointer was
deleted twice.

Also added a (completely trivial but better than nothing...) unit test for
wxBitmap to check that copying masks does work now.

Closes #11854.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-28 23:20:49 +00:00
Francesco Montorsi
32ee98eb76 reorder GetLabel(), GetLabelText(), SetLabel() and SetLabelText() function declarations, implementations and relative documentations.
Add wxStaticTextBase::GetLabelWithoutMarkup() and use it in the wxMSW implementation of wxStaticText::SetLabel() to close bug #11446; the function RemoveMarkup() which was previously used in fact could not check for presence/absence of wxST_MARKUP style since it's a static function.

Add wxStaticTextBase::SetLabelText() functions for symmetry with wxControlBase::SetLabelText()

Add test unit for both wxControl::*Label* and wxStaticText::*Label* functions.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-21 21:39:15 +00:00
Vadim Zeitlin
869c7a944b Add (a very simple for now) wxBoxSizer unit test.
Only check that layout for a single sizer item works correctly for now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-18 15:07:10 +00:00
Francesco Montorsi
a37da0fa55 Fix function wxControlBase::DoEllipsizeSingleLine to really make sure that the ellipsized string takes less pixels than maxFinalWidthPx.
Add comments to explain in more details what the function does and in particular the valid ranges of all internal variables; fix in that regard both the code of both wxELLIPSIZE_START, wxELLIPSIZE_MIDDLE and wxELLIPSIZE_END.
Add more asserts to check the valid ranges and turn a couple of time-expensive checks in level-2 asserts.
Add a test unit for the wxControl::Ellipsize function.
Fix minor details in the docs of wxControl::Ellipsize.
Closes #11567.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-03-10 13:57:47 +00:00
Kevin Ollivier
da8b1d4b3b Rebake from clean wx tree.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-01-04 00:45:45 +00:00
Jaakko Salli
7db064f60f Added typeinfo.h which implements wxTypeId, using C++ RTTI if available. wxAny and Unbind<>() code are updated to use it. Added and updated related unit tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-19 19:27:24 +00:00
Kevin Ollivier
f82b7036e8 Rebake after last commit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62682 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-18 19:22:58 +00:00
Kevin Ollivier
a7ebaf0ddd Bakefile 0.2.8 rebake.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 20:56:47 +00:00
Vadim Zeitlin
7880889720 Rebake everything using bakefile 0.2.7.
Also updated aclocal inputs and regenerated configure.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62478 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 16:53:10 +00:00
Vadim Zeitlin
6b8ef0b35d Merge SOC2009_FSWATCHER branch into trunk.
Merges everything from the branch with only some minor changes, mostly renamed
wxUSE_FSWATCHER_{INOTIFY,KQUEUE} to wxHAS_{INOTIFY,KQUEUE}.

Add wxFileSystemWatcher and related classes.

Also introduces wxEventLoopSource.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62474 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-22 11:35:43 +00:00
Kevin Ollivier
d5e7ffcf7a Make sure all Bakefile formats that use CRLF line feeds are set to use CRLF in SVN.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62327 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-08 04:07:02 +00:00
Vadim Zeitlin
b0edecea48 Add wxColour::{Set,Get}RGB[A]().
These methods allow to operate with all 3 or 4 colour channels at once.

Add their implementation, documentation and a unit test for wxColour
exercising them.

Closes #9918.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61976 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-19 16:29:50 +00:00
Jaakko Salli
178c77606f wxAny initial commit (closes #10932)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-19 08:51:11 +00:00
Vadim Zeitlin
227989f3e9 Write correct number of bytes in wxFile::Write(wxString).
This function was broken for conversions using more than one byte per
character (e.g. UTF-16 or UTF-32) and also even for UTF-8 for strings
containing NUL bytes as it used strlen() to determine the number of bytes to
write out instead of using the really needed number.

Fix this by using the wxCharBuffer::length() method which always returns the
correct value.

Also add a wxFile unit test verifying that it can correctly read back a string
written using any of UTF-8, UTF-16 or UTF-32.

Closes #11192.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-12 22:40:42 +00:00
Vadim Zeitlin
d12d9edacb Rebake all the samples, demos and tests makefiles.
This should have been committed together with the changes to the debug flags
handling in build/bakefiles in r61887.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-09-12 13:38:08 +00:00
Vadim Zeitlin
ece5e6a47a added a simple wxLog unit test
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-07 12:19:34 +00:00
Francesco Montorsi
21fe35aff7 add wxImage test units to test loading from both seekable and non-seekable streams
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-06-01 11:46:36 +00:00
Francesco Montorsi
7b4138e284 refactor printf benchmarks to fit the new wxWidgets benchmarking framework; fix tests and benchmarks builds (at least on linux) which were failing because of wrong order of <wx-lib> tags in the bakefiles
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-30 13:54:22 +00:00
Vadim Zeitlin
72a7c55982 added wxStd{In,Out}putStream classes (closes #10637)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60483 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-02 18:29:33 +00:00
Chris Elliott
95ff11c4bb update bakefile to 0.2.6
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-24 10:36:24 +00:00
Vadim Zeitlin
b3710b1030 rebake after the addition of graphics/measuring.cpp
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-16 14:49:28 +00:00
Francesco Montorsi
e3527f7bc5 make sure that wxSystemSettings::GetFont/GetColour return values are always valid
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59820 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-24 23:13:02 +00:00