add more flexible and safer template Connect() overloads (#10000)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-01-12 14:26:13 +00:00
parent 8946ede10c
commit 3c77890141
136 changed files with 2503 additions and 1233 deletions

View File

@@ -401,4 +401,12 @@
# define wxUSE_POSTSCRIPT 1
#endif
/* VC6 can't handle the templates for the 'type safe events': */
#if !wxEVENTS_COMPATIBILITY_2_8
# ifdef __VISUALC6__
# undef wxEVENTS_COMPATIBILITY_2_8
# define wxEVENTS_COMPATIBILITY_2_8 1
# endif
#endif
#endif /* _WX_MSW_CHKCONF_H_ */

View File

@@ -209,12 +209,15 @@ public:
{ return m_dispid; }
};
#define wxACTIVEX_ID 14001
DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_MEDIA, wxEVT_ACTIVEX, wxACTIVEX_ID)
// #define wxACTIVEX_ID 14001
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_ACTIVEX, wxActiveXEvent )
typedef void (wxEvtHandler::*wxActiveXEventFunction)(wxActiveXEvent&);
#define EVT_ACTIVEX(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_ACTIVEX, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxActiveXEventFunction) & fn, (wxObject *) NULL ),
#define wxActiveXEventHandler(func) \
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActiveXEventFunction, &func)
wxEVENT_HANDLER_CAST( wxActiveXEventFunction, func )
#define EVT_ACTIVEX(id, fn) DECLARE_EVENT_TABLE_ENTRY(wxEVT_ACTIVEX, id, -1, wxActiveXEventHandler( fn ), (wxObject *) NULL ),
#endif // wxUSE_ACTIVEX

View File

@@ -47,6 +47,17 @@
// Recommended setting: 0 (please update your code)
#define WXWIN_COMPATIBILITY_2_8 1
// Use the 2.8-compatible events and Connect(): this is set to 0 by default as
// the new events bring significant benefits in compile-time safety and
// flexibility but can be disabled to somewhat reduce the compilation time and,
// especially, to still allow building if the compiler template support is too
// bad to compile the new code.
//
// Default is 0 for all compilers except VC6 currently.
//
// Recommended setting: 0 (please upgrade your compiler instead of changing it)
#define wxEVENTS_COMPATIBILITY_2_8 0
// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when
// default system font is used for wxWindow::GetCharWidth/Height() instead of
// the current font.

View File

@@ -47,6 +47,17 @@
// Recommended setting: 0 (please update your code)
#define WXWIN_COMPATIBILITY_2_8 1
// Use the 2.8-compatible events and Connect(): this is set to 0 by default as
// the new events bring significant benefits in compile-time safety and
// flexibility but can be disabled to somewhat reduce the compilation time and,
// especially, to still allow building if the compiler template support is too
// bad to compile the new code.
//
// Default is 0 for all compilers except VC6 currently.
//
// Recommended setting: 0 (please upgrade your compiler instead of changing it)
#define wxEVENTS_COMPATIBILITY_2_8 0
// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when
// default system font is used for wxWindow::GetCharWidth/Height() instead of
// the current font.