Commit Graph

24 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
09be33645a fix errors in EvtHandlerTestCase::BindFunctor() in optimized build: apparently compiler is smart enough to detect that the same object can be used for all temporaries
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60670 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-17 10:56:14 +00:00
Vadim Zeitlin
ca6911c361 allow passing temporary functors to Bind() too (closes #10653)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60477 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-02 15:28:16 +00:00
Vadim Zeitlin
890d70ebea improvements to wxEventFunctor classes; use wxHAS_EVENT_BIND instead of wxEVENTS_COMPATIBILITY_2_8 (see #10653)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60470 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-02 12:52:54 +00:00
Vadim Zeitlin
48c56e04b0 added failing compilation test for the case of missing handler in Bind() call
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-16 21:33:37 +00:00
Vadim Zeitlin
449cb073c0 added a failtest target to Makefile to test for the (expected) compilation failures
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-16 14:47:22 +00:00
Vadim Zeitlin
2057acc2a7 build bot systems don't manage to generate enough ticks in 2 seconds to pass this test
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-26 14:58:22 +00:00
Francesco Montorsi
2026b433b9 this one should really work
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59762 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-23 11:01:33 +00:00
Francesco Montorsi
78f2eafcb6 fix the build fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59760 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-23 10:58:32 +00:00
Francesco Montorsi
f70cea2bdc blind carbon build fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59758 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-23 10:04:56 +00:00
Vadim Zeitlin
031b101f09 moved the check for correct implementation of wxEvent::Clone() to a unit test from wx startup code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59742 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-22 21:31:34 +00:00
Vadim Zeitlin
5293e4b710 replace templae Connect() overloads with separate Bind() method to improve compatibility (see #10000, closes #10477)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59134 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-25 17:43:22 +00:00
Vadim Zeitlin
16be58c140 add semicolons after wxDEFINE_EVENT()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-07 21:04:47 +00:00
Vadim Zeitlin
bb87b19b16 compilation fix for wxEVENTS_COMPATIBILITY_2_8 case
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58694 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-06 21:54:09 +00:00
Vadim Zeitlin
a01ada0599 allow handling events in a function taking the base class of the event class corresponding to the event type and not exactly the event class itself: this is more flexible (while still being safe) and incidentally fixes compatibility issues with existing code using explicit casts to wxObjectEventFunction (see #10477)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58690 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-06 18:33:01 +00:00
Vadim Zeitlin
f3ff831f3b Changes to template Connect() to make it compile with MSVC7 and possible other
not quite up-to-date compilers, to reduce repetitions and to allow using
methods of non-wxEvtHandler-derived classes as event callbacks:

1. Don't rely on compiler ability to deduce template parameter from the type
   of a parameter of a function used as another template parameter, at least
   MSVC7 can't do this and it's probably not the only one.
2. Do rely on compiler support for partial specialization to make
   wxEventFunctorMethod compile for non-wxEvtHandler-derived handlers while
   still keeping the old functionality for the wxEvtHandler-derived ones.
3. Don't make any difference between functions and functors, both are callable
   objects so use them as such, this allows to fold code for both cases.
4. Avoid the use of dynamic_cast<>.
5. Several naming changes:
 a) wxTypedEventType -> wxEventTypeTag (because this is what it is)
 b) Subscribe/Unsubscribe -> DoConnect/Disconnect (to follow the usual
    convention of public Foo calling private DoFoo and to avoid using up
    another name)
 c) Derived -> ObjClass (because it's not clear what does Derived mean)
6. Extend the unit test to cover more cases.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58625 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-02 20:38:56 +00:00
Vadim Zeitlin
9b3ff3c04f test that the connected event handler is really called; some naming changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-01 23:19:45 +00:00
Vadim Zeitlin
b2238cc315 add a unit test for new events (see #10000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58611 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-01 22:12:12 +00:00
Francesco Montorsi
004867dbc5 Change in wxWindow the access specifier of the wxEvtHandler event processing and queuing functions
from public to protected. Adapt wxWidgets code and wxWidgets samples to always use wxWindow::GetEventHandler()
when calling such functions on a wxWindow rather than directly using wxWindow::ProcessEvent, etc.
This enables correct event dispatching to the event handlers which have been pushed (with PushEventHandler) on the 
windows.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-25 11:58:39 +00:00
Vadim Zeitlin
9ebfc96354 compilation fix for VC7 which seems to somehow lose the default value for PopEventHandler() parameter inside scope guard templates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-17 13:01:47 +00:00
Vadim Zeitlin
c21dcf80f0 add wx/app.h for PCH-less compilation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58172 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-17 11:38:32 +00:00
Vadim Zeitlin
a79fe526de add wx/window.h for MSVC compilation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-16 23:01:04 +00:00
Vadim Zeitlin
1649d2886b add a unit test checking that events are really propagated as they're supposed to
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58146 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-16 16:21:50 +00:00
Vadim Zeitlin
438febca6e don't sleep too long to avoid missing the timers; added a simple test for timer events processing in console apps
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56537 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-10-27 22:04:42 +00:00