From fe2b2391ffd469f3ff98b5cd7f16630fe4cfbfa6 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 19 Apr 2009 07:20:34 +0000 Subject: [PATCH] merging back r60180, r60184, r60212, r60214, r60215, r60234 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_9_0_BRANCH@60241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/event.h | 32 +++++++++++++++----------------- include/wx/msw/wince/chkconf.h | 8 ++++++++ include/wx/string.h | 2 +- src/gtk/combobox.cpp | 2 +- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/include/wx/event.h b/include/wx/event.h index cc363146e4..2d4e8a15fa 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -78,7 +78,7 @@ typedef int wxEventType; #define wxStaticCastEvent(type, val) static_cast(val) #define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \ - wxEventTableEntry(type, winid, idLast, wxNewEventFunctor(type, fn), obj) + wxEventTableEntry(type, winid, idLast, wxNewEventTableFunctor(type, fn), obj) #define DECLARE_EVENT_TABLE_TERMINATOR() \ wxEventTableEntry(wxEVT_NULL, 0, 0, 0, 0) @@ -258,17 +258,23 @@ private: #if wxEVENTS_COMPATIBILITY_2_8 -// Create a functor for the legacy events: handler can be NULL and its default -// value is used by the event table macros - +// Create a functor for the legacy events: used by Connect() inline wxObjectEventFunctor * wxNewEventFunctor(const wxEventType& WXUNUSED(evtType), wxObjectEventFunction method, - wxEvtHandler *handler = NULL) + wxEvtHandler *handler) { return new wxObjectEventFunctor(method, handler); } +// This version is used by DECLARE_EVENT_TABLE_ENTRY() +inline wxObjectEventFunctor * +wxNewEventTableFunctor(const wxEventType& WXUNUSED(evtType), + wxObjectEventFunction method) +{ + return new wxObjectEventFunctor(method, NULL); +} + inline wxObjectEventFunctor wxMakeEventFunctor(const wxEventType& WXUNUSED(evtType), wxObjectEventFunction method, @@ -507,25 +513,17 @@ wxMakeEventFunctor(const EventTag&, method, handler); } -// Special case for the wxNewEventFunctor() calls used inside the event table -// macros: they don't specify the handler so EventHandler can't be deduced +// Create an event functor for the event table via DECLARE_EVENT_TABLE_ENTRY: +// in this case we don't have the handler (as it's always the same as the +// object which generated the event) so we must use Class as its type template inline wxEventFunctorMethod * -wxNewEventFunctor(const EventTag&, void (Class::*method)(EventArg&)) +wxNewEventTableFunctor(const EventTag&, void (Class::*method)(EventArg&)) { return new wxEventFunctorMethod( method, NULL); } -template - -inline wxEventFunctorMethod -wxMakeEventFunctor(const EventTag&, void (Class::*method)(EventArg&)) -{ - return wxEventFunctorMethod( - method, NULL); -} - #endif // !wxEVENTS_COMPATIBILITY_2_8 diff --git a/include/wx/msw/wince/chkconf.h b/include/wx/msw/wince/chkconf.h index 7024f8ad64..e22caac069 100644 --- a/include/wx/msw/wince/chkconf.h +++ b/include/wx/msw/wince/chkconf.h @@ -141,5 +141,13 @@ #define wxUSE_COLOURDLG 0 #endif // __SMARTPHONE__ +// eVC can't compile template Bind() but VC8 can +#if !wxEVENTS_COMPATIBILITY_2_8 +# if !wxCHECK_VISUALC_VERSION(8) +# undef wxEVENTS_COMPATIBILITY_2_8 +# define wxEVENTS_COMPATIBILITY_2_8 1 +# endif +#endif + #endif // _WX_MSW_WINCE_CHKCONF_H_ diff --git a/include/wx/string.h b/include/wx/string.h index a67e8e8fb9..65e29e10ec 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -209,7 +209,7 @@ inline int Stricmp(const char *psz1, const char *psz2) // Lightweight object returned by wxString::c_str() and implicitly convertible // to either const char* or const wchar_t*. -class WXDLLIMPEXP_BASE wxCStrData +class wxCStrData { private: // Ctors; for internal use by wxString and wxCStrData only diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index fb9623a2ba..e5a8a75d6d 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -172,7 +172,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, g_signal_connect_after (m_widget, "changed", G_CALLBACK (gtkcombobox_changed_callback), this); - if ( gtk_check_version(2,10,0) ) + if ( !gtk_check_version(2,10,0) ) { g_signal_connect (m_widget, "notify::popup-shown", G_CALLBACK (gtkcombobox_popupshown_callback), this);