Commit Graph

173 Commits

Author SHA1 Message Date
Vadim Zeitlin
81b62354dc Fix wxTextCtrl contents corruption with long strings in wxMSW.
wxMSW automatically extended wxTextCtrl length limit beyond the tiny standard
32KB when it was exceeded, but part of the text being appended into the
control was lost when doing it.

Fix this by retrying insertion after extending the limit.

Closes #15980.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-20 00:32:34 +00:00
Vadim Zeitlin
58a37d1c5a Don't leave dangling comboboxes in the GUI unit test suite.
Sort() and ReadOnly() tests created a new combobox without deleting the old
one, and so these comboboxes were left on the screen for the duration of all
the subsequent tests, subtly breaking them. E.g. this was responsible for
spurious breakages in the event propagation test case because sometimes the
context menu event showed the combobox context menu (why this didn't happen
always is another question...).

It would be great to find some way to ensure that nothing is left after a test
terminates but I'm not sure about how to do this with cppunit. So for now just
manually delete the extraneous comboboxes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74998 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-14 15:08:02 +00:00
Vadim Zeitlin
6a51bf145f Work around a failure in TreeCtrlTestCase::SelectionChange() unit test.
We were getting an extra event under MSW if the control was initially
unfocused, so do focus it. This is a work around as the extra event shouldn't
occur but I'm too afraid of changing wxMSW code itself so close to 3.0.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-14 15:07:51 +00:00
Vadim Zeitlin
9d7f0c5f7e Avoid spurious errors when getting wxChoice or wxListBox client data in wxMSW.
Even after the changes of r70415, we could still report an error when the
item client data was set to -1 (== CB_ERR) as checking for GetLastError() was
not enough, we need to also ensure that the last error is reset before trying
to get the client data.

Also apply the same fix to wxListBox and add the tests verifying that this
does work correctly.

Closes #13883.

Also fix wxListBox::GetClientData().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74994 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-10-14 15:07:44 +00:00
Vadim Zeitlin
b736d59eb5 Don't generate any events from wxSpinCtrl and wxSpinCtrlDouble methods.
After the changes of r53758 wxMSW didn't generate any wxEVT_TEXT events but
this was still the case for the generic version (and hence for
wxSpinCtrlDouble under MSW too) and wasn't documented.

Fix all versions to avoid sending events for programmatic actions, add unit
tests checking this behaviour and document it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-08-06 17:00:00 +00:00
Vadim Zeitlin
36a0190ebd Add test for absence of events from wxSpinCtrlDouble ctor.
Run the same NoEventsInCtor() test as we already had for wxSpinCtrl for
wxSpinCtrlDouble as well.

Unfortunately currently there is no way to reuse the tests between these two
classes, we should refactor these test cases to use a common
SpinCtrlTestCaseBase<T> base class.

See #15375 which fixed the underlying bug.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-08-06 16:59:54 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.

If nothing else, this will make an eventual transition to Git simpler.

Closes #14487.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
75f9a95448 Use [DOMRange markupString] to get selection source.
This DOMRange method, previously used in GetSelectedText(), seems to provide
exactly what we need so there doesn't seem to be any reason to use JS to get
the selection text, especially as it didn't even work under OS X 10.8 and
returned an empty string in the unit test.

The unit test still needs adjustment to pass because we don't get back exactly
the same HTML as we used originally, but with more relaxed matching it does
pass now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-16 14:10:17 +00:00
Vadim Zeitlin
168d1f65c1 Reconcile HAVE_VARIADIC_MACROS and wxHAS_VARIADIC_MACROS definitions.
The main user-visible effect of this change is that giving configure
--disable-vararg-macros argument now really disables the use of variadic
macros whereas it didn't disable them in wx/cpp.h before.

It is, of course, also less confusing to not have two very similar but
different symbols.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-11 22:40:47 +00:00
Vadim Zeitlin
4f9ccec517 Add wxBookCtrlBase::DoSetSelectionAfterRemoval() and use it in wxSimplebook.
This fixes the wrong handling of the selection in wxSimplebook when the
currently selected page was deleted.

Also extend the unit tests to check for this bug.

Closes #15188.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-23 16:39:39 +00:00
Vadim Zeitlin
6f71e06242 No real changes, just simplify wxBookCtrlBase unit test a little.
Add Realize() virtual function that can be overridden in ToolbookTestCase
instead of using explicit wxDynamicCasts.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-23 16:39:15 +00:00
Vadim Zeitlin
10e6908dd3 Add a minimal unit test for wxSimplebook.
This is just a test running the common wxBookCtrlBase tests for wxSimplebook.

See #15188.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-23 16:38:51 +00:00
Stefan Csomor
18c8b0ee1d reusing existing API
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74235 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-13 14:06:02 +00:00
Vadim Zeitlin
2e1e56d0ce Check wxListCtrl::GetItemRect() origin in the unit tests.
Verify that the top item is _not_ at (0, 0) when the header is present in the
control, as the control client coordinates should not take the header into
account.

This test passes when using wxGenericListCtrl since r74197, add it to ensure
that it doesn't get broken again later.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-13 13:57:51 +00:00
Stefan Csomor
3ac6cf59fa using Destroy, as otherwise the remnants get into the way for some other tests
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-13 00:11:18 +00:00
Stefan Csomor
e1004654ab adding exceptions for OSX
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74193 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-13 00:08:27 +00:00
Stefan Csomor
64fd19dbac osx needs a refocus
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74190 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-12 21:30:38 +00:00
Stefan Csomor
809f6ef394 now working on cocoa as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-12 05:46:54 +00:00
Stefan Csomor
79c29706e3 disable tests depending on a focusable slider control
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-11 22:33:00 +00:00
Stefan Csomor
e72e0814b6 draghino explicitly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74171 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-11 22:27:48 +00:00
Stefan Csomor
689c6ca6ef moving click point sightly more inside, #ifndef tests failing with the generic implementation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74168 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-11 22:21:30 +00:00
Stefan Csomor
9150fa99d4 fixing typo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-06-11 22:19:21 +00:00
Vadim Zeitlin
0a6ec346d5 Reset row and columns count in wxRichTextTable::ClearTable().
No real changes, just update the internal variables in ClearTable() to avoid
inconsistent internal state, even if this doesn't seem to result in any
problems for now.

Closes #15190.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-26 13:14:48 +00:00
Vadim Zeitlin
7cda2aab67 Fix typo in a closing "#endif" comment in the test.
Closes #15203.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-15 13:05:36 +00:00
Vadim Zeitlin
0ad0b6395c Disable the rest of Editable() test for wxBitmapComboBox.
See r73957, this test keeps failing when running on a build slave, even though
it passes when ran locally.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-12 20:34:43 +00:00
Vadim Zeitlin
862c0963cb Revert "Show the name of the actually tested class in text entry unit tests."
Revert r73959, the name of the control can be seen from the name of the
failing test case actually, so there is no need to include it in the message.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73962 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-10 19:21:38 +00:00
Vadim Zeitlin
16ddd52f06 Show the name of the actually tested class in text entry unit tests.
This test is used for several different classes, show the name of the class
being tested when the assert in Editable() test fails.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73959 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-10 13:22:11 +00:00
Vadim Zeitlin
5cbb4a59ce Disable a sporadically failing check in wxBitmapComboBox unit test.
This check keeps failing in buildbot builds even though it always passes in
local ones (and sometimes in buildbot ones too). Disable it to allow the
entire test suite to pass.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73957 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-09 23:22:09 +00:00
Vadim Zeitlin
656634564b Fix wxRichTextCtrl test compilation.
Work around broken pre-C++98 for loop scoping rules in VC6.

See #15184.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73951 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-08 22:00:11 +00:00
Julian Smart
31be840031 Applied patches for #15184 (wxRichTextAction fix for when the command identifier is wxRICHTEXT_CHANGE_OBJECT) and #15185 (Make adding/deleting wxRichTextTable rows and columns undoable)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-05-06 13:39:01 +00:00
Vadim Zeitlin
0cd8ce0de1 Trying to blindly fix WebTestCase unit test failure.
Navigate to about:blank initially, not "about:".

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73879 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-29 23:00:57 +00:00
Vadim Zeitlin
bd7c46cfc6 Fix compilation-breaking typo in the previous commit.
s/LoadUrl/LoadURL/

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-25 12:54:50 +00:00
Vadim Zeitlin
4776f0c8c5 Fix wxWebView test setup failure under OS X.
Call LoadUrl() after associating our custom event handler with the browser
object as otherwise the wxEVT_WEBVIEW_LOADED event could be generated before
we were set up to catch it, resulting in the assertion failure inside
ENSURE_LOADED.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73852 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-25 12:53:51 +00:00
Vadim Zeitlin
ce7fe42e84 Provide shorter synonyms for wxEVT_XXX constants.
Use the same short names as are used by the event table macros for the event
type constants themselves. This makes them much more comfortable to use, e.g.
Bind(wxEVT_BUTTON) compared to Bind(wxEVT_COMMAND_BUTTON_CLICKED).

The old long names are still kept for backwards compatibility and shouldn't be
removed as it doesn't really cost anything to continue providing them, but all
new event types should only use the short versions.

Closes #10661.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73850 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-25 10:11:03 +00:00
Vadim Zeitlin
d929eddf3a Fix showing back hidden columns and rows in wxGrid.
While we don't support auto-sizing of the hidden columns and rows, we need to
still show them back when SetColSize() or SetRowSize() is called with -1
(a.k.a. wxGRID_AUTOSIZE) argument.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73848 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-24 09:01:57 +00:00
Steve Lamerton
236cff7334 Rename all WEB_VIEW* style identifiers to WEBVIEW*.
This makes wxWebView consistent with the rest of the toolkit. 

Closes #15013

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-02-01 09:38:53 +00:00
Vadim Zeitlin
ae72623b64 Add wxCheckListBox::GetCheckedItems() helper.
This method is similar to wxListBox::GetSelections() and allows to retrieve
all checked items at once.

Closes #14969.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73422 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-21 11:18:55 +00:00
Steve Lamerton
39a18da1a8 Pass wxWANTS_CHARS to the wxRichTextCtrl constructor in the unit tests.
Fixes test failures caused by the return key being used for dialog navigation.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 19:28:20 +00:00
Vadim Zeitlin
09ca8913fa Fix wxSearchCtrl::HasFocus() in the generic version.
Override GetMainWindowOfCompositeControl() in the windows composing the
generic wxSearchCtrl to ensure that HasFocus() correctly returns true for the
entire control when any of them has focus.

Add a trivial unit test to check that this really works and facilitate adding
more tests for this class later.

Closes #14970.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 02:09:44 +00:00
Vadim Zeitlin
fe218f1e4b Fix setting initial wxSpinCtrl value outside 0..100 range in wxMSW.
Set the range before setting the initial value when creating wxSpinCtrl, as
otherwise the value was wrongly limited to the default 0..100 range instead of
the one really specified.

Closes #14894.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-01-20 02:09:14 +00:00
Václav Slavík
a96de8a36a Tests for wxTEST_DIALOG and wx/testing.h.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72838 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-11-01 16:45:14 +00:00
Vadim Zeitlin
532324df23 Don't generate events from wxSpinCtrl::SetRange() in wxMSW.
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
2012-08-15 23:34:10 +00:00
Julian Smart
04b2b47a4e Fixed wxRichTextCtrl caret test case
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-13 16:38:15 +00:00
Vadim Zeitlin
85668a34b3 Revert "Temporarily disable the failing wxRichTextCtrl case."
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
2012-07-11 12:16:41 +00:00
Vadim Zeitlin
300fed484c Temporarily disable the failing wxRichTextCtrl case.
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
2012-07-02 15:08:09 +00:00
Vadim Zeitlin
a523d3c643 Add a unit test verifying that wxSpinCtrl ctor doesn't generate any events.
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
2012-06-30 16:33:36 +00:00
Vadim Zeitlin
784130d290 Disable wxUIActionSimulator wxGrid tests using mouse under wxGTK.
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
2012-06-01 16:21:08 +00:00
Vadim Zeitlin
f1287154cd Add IsAutomaticTest() function to the unit tests.
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
2012-06-01 16:21:06 +00:00
Vadim Zeitlin
6e36db5eca Correct the initial value setting in wxMSW wxSpinCtrl.
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
2012-05-09 14:24:20 +00:00
Vadim Zeitlin
7c7bd972fa Add a hack to prevent the test suite from aborting after Grid test case.
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
2012-04-29 23:22:10 +00:00