Commit Graph

357 Commits

Author SHA1 Message Date
Vadim Zeitlin
4f742042b8 Make WXK_NUMPAD_TAB member of WXK_CATEGORY_TAB.
See #10268.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-23 21:39:32 +00:00
Vadim Zeitlin
7a34307e24 Added wxKeyEvent::IsKeyInCategory() method.
This allows to test whether a given key belongs to the category of e.g. arrow
keys or navigation keys in a more concise and more readable manner.

Closes #10268.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61736 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-23 00:32:17 +00:00
Vadim Zeitlin
c0f02dab27 Fix typo in wxNewEventFunctor() comment.
Closes #11117.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-08-21 18:46:32 +00:00
Vadim Zeitlin
9a83f86094 Globally replace _T() with wxT().
Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-23 20:30:22 +00:00
Vadim Zeitlin
54a9471afb check for wxHAS_EVENT_BIND instead of its converse; updated/coorected some comments
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-05-03 07:43:28 +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
ab826fd86f don't duplicate wxMouseState in wxMouseEvent but reuse its methods and variables (somehow this was never done when wxMouseState was introduced)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-29 21:42:30 +00:00
Vadim Zeitlin
ac26ed15ac really fix compilation with wxEVENTS_COMPATIBILITY_2_8 after r60212
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-17 00:35:58 +00:00
Vadim Zeitlin
e1614128e1 compilation fix for wxEVENTS_COMPATIBILITY_2_8 build after r60212
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-16 22:41:52 +00:00
Vadim Zeitlin
0fe243db0c remove wxNewEventFunctor() overload which allowed calls to "Bind(evt, &WrongClass::method)" to compile
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-16 21:23:28 +00:00
Vadim Zeitlin
ff3fd98a08 remove semicolon from wxDECLARE_EVENT; having it there was inconsistent with other wxXXX_EVENT macros and generally unexpected
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-04-14 12:47:46 +00:00
Vadim Zeitlin
4c802fdc48 no real changes, jus renames some parameters (see #10594)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-29 12:38:53 +00:00
Vadim Zeitlin
657a8a3598 first round of debug/release merge: introduce wxDEBUG_LEVEL, for now defined as 1 if __WXDEBUG__ is defined, i.e. no real changes; don't use __WXDEBUG__ in the headers to keep debug and release builds ABI-compatible; add functions to customize or disable asserts handling
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59711 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-21 23:36:37 +00:00
Vadim Zeitlin
8933fbc62e add combobox drop down/close up events (closes #10587)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59603 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-18 10:42:58 +00:00
Vadim Zeitlin
03ae811e42 no changes, just correct some comments and variable names (see #10594)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-18 09:30:08 +00:00
Francesco Montorsi
6547c6bad7 include all events categories in wxEVT_CATEGORY_ALL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59536 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-14 19:20:03 +00:00
Francesco Montorsi
cae9e7b169 add wxAppConsoleBase::DeletePendingEvents and wxEvtHandler::DeletePendingEvents.
Fix wxAppConsoleBase::Suspend/ResumeProcessingOfPendingEvents: locking the mutex does not prevent wxAppConsoleBase::ProcessPendingEvents from running if the mutex was locked from the main thread!

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-08 12:58:24 +00:00
Vadim Zeitlin
231728361c add ugly macros to abstract the difference between Bind() and Connect() -- this is still less ugly than having #ifs everywhere
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-02 12:10:40 +00:00
Vadim Zeitlin
2d8c0c2ce4 move functions using deprecated methods out of line to avoid deprecation warnings from MSVC when building any code including wx/event.h
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-27 10:21:38 +00:00
Vadim Zeitlin
8cc208e39f deprecate the old TryValidator/Parent() and replace them with the new and documented TryBefore/After()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59164 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-26 16:16:31 +00:00
Vadim Zeitlin
a405cd89a2 compilation fix after the previous commit
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59139 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-25 21:12:47 +00:00
Vadim Zeitlin
c84d128369 fix for DLL build: wxEvtHandlerArray should be in wxBase as it's used by wxEventLoopBase, not in wxCore
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59138 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-25 21:04:45 +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
Francesco Montorsi
1e8af825e1 implement wxThreadEvent safe copy ctor
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-20 12:02:09 +00:00
Paul Cornett
e8f9c7d1b0 fix for IBM and HP compilers, which don't allow ->* operator with undefined class
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59014 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-19 05:33:38 +00:00
Paul Cornett
c4021a7920 use bool expression rather than implicit conversion
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59001 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-18 18:02:53 +00:00
Paul Cornett
f8f7cff436 remove unused wxKeyEvent member m_scanCode
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58999 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-18 17:15:40 +00:00
Francesco Montorsi
dde19c2180 second part of #10320: move wxApp event handling functions to wxEventLoopBase (in particular move Yield() functions); add backward compatible redirections to wxApp; update docs; remove global lists wxPendingEvents and wxPendingEventsLocker
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58911 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-15 14:25:08 +00:00
Vadim Zeitlin
c0c133e13b add wx-prefixed and semicolon-requiring versions of DECLARE_NO_{COPY,ASSIGN}_CLASS macros
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58757 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-08 11:45:59 +00:00
Vadim Zeitlin
9b11752c4f require semicolon after wxDECLARE/DEFINE_EVENT() (closes #10456)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-07 18:59:25 +00:00
Vadim Zeitlin
579e055907 fix typo in last commit
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-07 15:29:52 +00:00
Vadim Zeitlin
1afe8c8307 rename wxDECLARE_LOCAL_EVENT to just wxDECLARE_EVENT
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58713 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-07 15:29:29 +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
Francesco Montorsi
74d60f66ee add a wxEventType argument to wxThreadEvent for coherency with other event classes; rewrite its Clone() function
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58661 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-04 19:44:55 +00:00
Francesco Montorsi
1e247d6992 use WXDLLIMPEXP_CORE, not WXDLLIMPEXP_BASE for wxThreadEvent
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58660 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-04 19:25:09 +00:00
Francesco Montorsi
f6a3e0bad5 fix the new wxThreadEvent class adopting the new type-safe conventions for event classes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58655 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-04 17:49:22 +00:00
Francesco Montorsi
d48b06bd90 check in the 'selective yield' patch (see ticket #10320):
- implements YieldFor() with event filtering for wxMSW and wxGTK,
  adds TODO markers in other ports;
- replaces wxYield() in GTK's clipboard code with a wxTheApp->YieldFor() call, thus fixing possible reentrancies 
(and modifies clipboard sample to test synchronous IsSupported calls)
- replaces wxYieldIfNeeded() calls in wxProgressDialog with wxTheApp->YieldFor() calls, so that it processes only 
UI/user-input events, thus fixing the race condition visible in the "thread" sample
- documents the new functions


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58654 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-04 17:42:28 +00:00
Vadim Zeitlin
abb7d8a351 work around VC6 ICE in DLL build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-02 21:44:36 +00:00
Vadim Zeitlin
361ba943f9 use explicit this-> with non-dependent names (compilation fix for standard-conforming compilers such as g++ 4)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58627 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-02 21:09:08 +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
f57254320e don't always disable new events code; leave it enabled for MSVC8+
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58620 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-02 11:39:48 +00:00
Vadim Zeitlin
412fcdc105 remove WXDLLIMPEXP_BASE from template classes to fix linking of code using new events in DLL build using MSVC9
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58613 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-01 23:05:55 +00:00
Vadim Zeitlin
111d41b2fa no real changes, just add some comments
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-02-01 22:10:52 +00:00
Vadim Zeitlin
dca9410337 fix wxEVT_SPIN_XXX definitions in a nicer (compatible with new events) way
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58313 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-23 00:30:41 +00:00
Francesco Montorsi
7f853dd046 fix wxWindow::PushEventHandler and related wxWindow functions for the stack management; currently they don't work well when passing event handlers which are part of an event handler chain (see wx-dev thread 'wxWindow event handler stack'); implement wxEvtHandler Unlink() and IsUnlinked() functions and document them; revise docs of all involved functions of both wxEvtHandler and wxWindow, adding images for better explanations
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-22 11:53:09 +00:00
Julian Smart
48def411aa Applied Peter Most's EVT_SPIN crash fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58200 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-18 19:30:23 +00:00
Vadim Zeitlin
29de6f400c ensure that ProcessEvent() is called for all the event handlers, not just the first one in event handlers list
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58144 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-16 16:07:16 +00:00
Vadim Zeitlin
cf516c2bb2 disable new event code unconditionally for now
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58089 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-14 08:47:23 +00:00
Vadim Zeitlin
4b42c189d5 fix wxDEFINE_EVENT_REFERENCE in wxEVENTS_COMPATIBILITY_2_8 case
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58052 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-12 17:10:23 +00:00