From 3c7789014106c9269b0f4ecc1a3071b14f351d3f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 12 Jan 2009 14:26:13 +0000 Subject: [PATCH] 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 --- Makefile.in | 105 ++- build/bakefiles/files.bkl | 2 + build/msw/makefile.bcc | 56 ++ build/msw/makefile.gcc | 56 ++ build/msw/makefile.vc | 56 ++ build/msw/makefile.wat | 56 ++ build/msw/wx_core.dsp | 8 + build/msw/wx_vc7_core.vcproj | 6 + build/msw/wx_vc8_core.vcproj | 8 + build/msw/wx_vc9_core.vcproj | 8 + configure | 7 +- configure.in | 7 + docs/changes.txt | 3 + include/wx/app.h | 10 + include/wx/aui/auibar.h | 14 +- include/wx/aui/auibook.h | 52 +- include/wx/aui/framemanager.h | 14 +- include/wx/bookctrl.h | 2 +- include/wx/calctrl.h | 16 +- include/wx/choicebk.h | 4 +- include/wx/clipbrd.h | 4 +- include/wx/clrpicker.h | 4 +- include/wx/collpane.h | 6 +- include/wx/dataview.h | 30 +- include/wx/dateevt.h | 4 +- include/wx/dialup.h | 8 +- include/wx/event.h | 1153 ++++++++++++++++++++++------ include/wx/fdrepdlg.h | 12 +- include/wx/filectrl.h | 10 +- include/wx/filepicker.h | 111 +-- include/wx/fontpicker.h | 4 +- include/wx/generic/calctrlg.h | 5 +- include/wx/generic/filepickerg.h | 4 +- include/wx/generic/grid.h | 48 +- include/wx/generic/laywin.h | 16 +- include/wx/generic/sashwin.h | 6 +- include/wx/generic/splitter.h | 2 +- include/wx/headerctrl.h | 29 +- include/wx/html/htmlwin.h | 11 +- include/wx/html/webkit.h | 24 +- include/wx/hyperlink.h | 6 +- include/wx/listbase.h | 44 +- include/wx/listbook.h | 4 +- include/wx/mediactrl.h | 14 +- include/wx/motif/setup0.h | 11 + include/wx/msw/chkconf.h | 8 + include/wx/msw/ole/activex.h | 11 +- include/wx/msw/setup0.h | 11 + include/wx/msw/wince/setup.h | 11 + include/wx/notebook.h | 4 +- include/wx/os2/setup0.h | 11 + include/wx/osx/setup0.h | 11 + include/wx/palmos/setup0.h | 11 + include/wx/power.h | 11 +- include/wx/process.h | 6 +- include/wx/propgrid/propgrid.h | 42 +- include/wx/richtext/richtextctrl.h | 76 +- include/wx/setup_inc.h | 11 + include/wx/socket.h | 5 +- include/wx/spinbutt.h | 13 +- include/wx/spinctrl.h | 8 +- include/wx/splitter.h | 10 +- include/wx/srchctrl.h | 4 +- include/wx/stc/stc.h | 115 +-- include/wx/taskbar.h | 20 +- include/wx/textctrl.h | 12 +- include/wx/tglbtn.h | 2 +- include/wx/timer.h | 6 +- include/wx/toolbook.h | 4 +- include/wx/treebase.h | 44 +- include/wx/treebook.h | 8 +- include/wx/univ/setup0.h | 11 + include/wx/wizard.h | 12 +- samples/calendar/calendar.cpp | 2 +- setup.h.in | 2 + src/aui/auibar.cpp | 10 +- src/aui/auibook.cpp | 78 +- src/aui/framemanager.cpp | 12 +- src/common/appbase.cpp | 14 + src/common/calctrlcmn.cpp | 16 +- src/common/clipcmn.cpp | 2 +- src/common/clrpickercmn.cpp | 2 +- src/common/datavcmn.cpp | 34 +- src/common/event.cpp | 328 ++++---- src/common/fddlgcmn.cpp | 10 +- src/common/filectrlcmn.cpp | 6 +- src/common/filepickercmn.cpp | 8 +- src/common/fontpickercmn.cpp | 2 +- src/common/headerctrlcmn.cpp | 26 +- src/common/hyperlnkcmn.cpp | 2 +- src/common/listctrlcmn.cpp | 40 +- src/common/mediactrlcmn.cpp | 12 +- src/common/nbkbase.cpp | 4 +- src/common/powercmn.cpp | 8 +- src/common/process.cpp | 2 +- src/common/socket.cpp | 3 + src/common/spinbuttcmn.cpp | 31 + src/common/spinctrlcmn.cpp | 31 + src/common/srchcmn.cpp | 4 +- src/common/taskbarcmn.cpp | 18 +- src/common/textcmn.cpp | 10 +- src/common/timercmn.cpp | 2 + src/common/treebase.cpp | 42 +- src/generic/calctrlg.cpp | 11 +- src/generic/choicbkg.cpp | 4 +- src/generic/collpaneg.cpp | 2 +- src/generic/grid.cpp | 40 +- src/generic/laywin.cpp | 4 +- src/generic/listbkg.cpp | 4 +- src/generic/sashwin.cpp | 2 +- src/generic/splitter.cpp | 8 +- src/generic/toolbkg.cpp | 4 +- src/generic/treebkg.cpp | 8 +- src/generic/wizard.cpp | 10 +- src/gtk/collpane.cpp | 2 +- src/gtk/tglbtn.cpp | 2 +- src/gtk1/tglbtn.cpp | 2 +- src/html/htmlctrl/webkit/webkit.mm | 6 +- src/html/htmlwin.cpp | 6 +- src/motif/checkbox.cpp | 2 +- src/msw/dialup.cpp | 4 +- src/msw/ole/activex.cpp | 2 +- src/msw/tglbtn.cpp | 2 +- src/os2/tglbtn.cpp | 2 +- src/osx/tglbtn_osx.cpp | 2 +- src/palmos/tglbtn.cpp | 2 +- src/propgrid/propgrid.cpp | 18 +- src/richtext/richtextctrl.cpp | 36 +- src/stc/ScintillaWX.cpp | 6 +- src/stc/stc.cpp | 56 +- src/stc/stc.cpp.in | 56 +- src/stc/stc.h.in | 115 +-- src/univ/tglbtn.cpp | 2 +- src/unix/dialup.cpp | 4 +- src/unix/sound_sdl.cpp | 8 +- tests/controls/textentrytest.cpp | 9 +- 136 files changed, 2515 insertions(+), 1245 deletions(-) create mode 100644 src/common/spinbuttcmn.cpp create mode 100644 src/common/spinctrlcmn.cpp diff --git a/Makefile.in b/Makefile.in index d76fea5668..b905cc49aa 100644 --- a/Makefile.in +++ b/Makefile.in @@ -27,7 +27,6 @@ STRIP = @STRIP@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_DIR = @INSTALL_DIR@ -ICC_PCH_USE_SWITCH = @ICC_PCH_USE_SWITCH@ BK_DEPS = @BK_DEPS@ BK_MAKE_PCH = @BK_MAKE_PCH@ srcdir = @srcdir@ @@ -3913,7 +3912,7 @@ COND_WINDOWS_IMPLIB_1___monodll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__monodll___importlib = $(COND_WINDOWS_IMPLIB_1___monodll___importlib) @COND_GCC_PCH_1@__monodll_PCH_INC = -I./.pch/wxprec_monodll -@COND_ICC_PCH_1@__monodll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__monodll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_monodll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_monodll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_monodll/wx/wxprec.h.gch @@ -4243,6 +4242,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS = \ monodll_rgncmn.o \ monodll_settcmn.o \ monodll_sizer.o \ + monodll_spinbuttcmn.o \ + monodll_spinctrlcmn.o \ monodll_srchcmn.o \ monodll_statbar.o \ monodll_stattextcmn.o \ @@ -4433,6 +4434,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS = \ monodll_rgncmn.o \ monodll_settcmn.o \ monodll_sizer.o \ + monodll_spinbuttcmn.o \ + monodll_spinctrlcmn.o \ monodll_srchcmn.o \ monodll_statbar.o \ monodll_stattextcmn.o \ @@ -5755,7 +5758,7 @@ COND_MONOLITHIC_1_SHARED_0___monolib___depname = \ @COND_MONOLITHIC_1_SHARED_0@__uninstall_monolib___depname \ @COND_MONOLITHIC_1_SHARED_0@ = uninstall_monolib @COND_GCC_PCH_1@__monolib_PCH_INC = -I./.pch/wxprec_monolib -@COND_ICC_PCH_1@__monolib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__monolib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_monolib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_monolib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_monolib/wx/wxprec.h.gch @@ -6055,6 +6058,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_1 = \ monolib_rgncmn.o \ monolib_settcmn.o \ monolib_sizer.o \ + monolib_spinbuttcmn.o \ + monolib_spinctrlcmn.o \ monolib_srchcmn.o \ monolib_statbar.o \ monolib_stattextcmn.o \ @@ -6245,6 +6250,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 = \ monolib_rgncmn.o \ monolib_settcmn.o \ monolib_sizer.o \ + monolib_spinbuttcmn.o \ + monolib_spinctrlcmn.o \ monolib_srchcmn.o \ monolib_statbar.o \ monolib_stattextcmn.o \ @@ -7573,7 +7580,7 @@ COND_WINDOWS_IMPLIB_1___basedll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__basedll___importlib = $(COND_WINDOWS_IMPLIB_1___basedll___importlib) @COND_GCC_PCH_1@__basedll_PCH_INC = -I./.pch/wxprec_basedll -@COND_ICC_PCH_1@__basedll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__basedll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_basedll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_basedll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_basedll/wx/wxprec.h.gch @@ -7696,7 +7703,7 @@ COND_MONOLITHIC_0_SHARED_0___baselib___depname = \ @COND_MONOLITHIC_0_SHARED_0@__uninstall_baselib___depname \ @COND_MONOLITHIC_0_SHARED_0@ = uninstall_baselib @COND_GCC_PCH_1@__baselib_PCH_INC = -I./.pch/wxprec_baselib -@COND_ICC_PCH_1@__baselib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__baselib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_baselib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_baselib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_baselib/wx/wxprec.h.gch @@ -7798,7 +7805,7 @@ COND_WINDOWS_IMPLIB_1___netdll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_net-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__netdll___importlib = $(COND_WINDOWS_IMPLIB_1___netdll___importlib) @COND_GCC_PCH_1@__netdll_PCH_INC = -I./.pch/wxprec_netdll -@COND_ICC_PCH_1@__netdll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__netdll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_netdll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_netdll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_netdll/wx/wxprec.h.gch @@ -7849,7 +7856,7 @@ COND_MONOLITHIC_0_SHARED_0___netlib___depname = \ @COND_MONOLITHIC_0_SHARED_0@__install_netlib___depname = install_netlib @COND_MONOLITHIC_0_SHARED_0@__uninstall_netlib___depname = uninstall_netlib @COND_GCC_PCH_1@__netlib_PCH_INC = -I./.pch/wxprec_netlib -@COND_ICC_PCH_1@__netlib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__netlib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_netlib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_netlib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_netlib/wx/wxprec.h.gch @@ -7882,7 +7889,7 @@ COND_WINDOWS_IMPLIB_1___coredll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__coredll___importlib = $(COND_WINDOWS_IMPLIB_1___coredll___importlib) @COND_GCC_PCH_1@__coredll_PCH_INC = -I./.pch/wxprec_coredll -@COND_ICC_PCH_1@__coredll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__coredll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_coredll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_coredll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_coredll/wx/wxprec.h.gch @@ -8014,6 +8021,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_2 = \ coredll_rgncmn.o \ coredll_settcmn.o \ coredll_sizer.o \ + coredll_spinbuttcmn.o \ + coredll_spinctrlcmn.o \ coredll_srchcmn.o \ coredll_statbar.o \ coredll_stattextcmn.o \ @@ -8204,6 +8213,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 = \ coredll_rgncmn.o \ coredll_settcmn.o \ coredll_sizer.o \ + coredll_spinbuttcmn.o \ + coredll_spinctrlcmn.o \ coredll_srchcmn.o \ coredll_statbar.o \ coredll_stattextcmn.o \ @@ -9418,7 +9429,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_GUI_1___corelib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1@__uninstall_corelib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1@ = uninstall_corelib @COND_GCC_PCH_1@__corelib_PCH_INC = -I./.pch/wxprec_corelib -@COND_ICC_PCH_1@__corelib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__corelib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_corelib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_corelib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_corelib/wx/wxprec.h.gch @@ -9519,6 +9530,8 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_3 = \ corelib_rgncmn.o \ corelib_settcmn.o \ corelib_sizer.o \ + corelib_spinbuttcmn.o \ + corelib_spinctrlcmn.o \ corelib_srchcmn.o \ corelib_statbar.o \ corelib_stattextcmn.o \ @@ -9709,6 +9722,8 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 = \ corelib_rgncmn.o \ corelib_settcmn.o \ corelib_sizer.o \ + corelib_spinbuttcmn.o \ + corelib_spinctrlcmn.o \ corelib_srchcmn.o \ corelib_statbar.o \ corelib_stattextcmn.o \ @@ -10934,7 +10949,7 @@ COND_WINDOWS_IMPLIB_1___advdll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__advdll___importlib = $(COND_WINDOWS_IMPLIB_1___advdll___importlib) @COND_GCC_PCH_1@__advdll_PCH_INC = -I./.pch/wxprec_advdll -@COND_ICC_PCH_1@__advdll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__advdll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_advdll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_advdll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_advdll/wx/wxprec.h.gch @@ -11057,7 +11072,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_GUI_1___advlib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1@__uninstall_advlib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1@ = uninstall_advlib @COND_GCC_PCH_1@__advlib_PCH_INC = -I./.pch/wxprec_advlib -@COND_ICC_PCH_1@__advlib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__advlib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_advlib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_advlib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_advlib/wx/wxprec.h.gch @@ -11160,7 +11175,7 @@ COND_WINDOWS_IMPLIB_1___mediadll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_media-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__mediadll___importlib = $(COND_WINDOWS_IMPLIB_1___mediadll___importlib) @COND_GCC_PCH_1@__mediadll_PCH_INC = -I./.pch/wxprec_mediadll -@COND_ICC_PCH_1@__mediadll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__mediadll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_mediadll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_mediadll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_mediadll/wx/wxprec.h.gch @@ -11227,7 +11242,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_MEDIA_1___medialib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_MEDIA_1@__uninstall_medialib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_MEDIA_1@ = uninstall_medialib @COND_GCC_PCH_1@__medialib_PCH_INC = -I./.pch/wxprec_medialib -@COND_ICC_PCH_1@__medialib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__medialib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_medialib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_medialib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_medialib/wx/wxprec.h.gch @@ -11274,7 +11289,7 @@ COND_WINDOWS_IMPLIB_1___htmldll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__htmldll___importlib = $(COND_WINDOWS_IMPLIB_1___htmldll___importlib) @COND_GCC_PCH_1@__htmldll_PCH_INC = -I./.pch/wxprec_htmldll -@COND_ICC_PCH_1@__htmldll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__htmldll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_htmldll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_htmldll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_htmldll/wx/wxprec.h.gch @@ -11320,7 +11335,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_HTML_1___htmllib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_HTML_1@__uninstall_htmllib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_HTML_1@ = uninstall_htmllib @COND_GCC_PCH_1@__htmllib_PCH_INC = -I./.pch/wxprec_htmllib -@COND_ICC_PCH_1@__htmllib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__htmllib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_htmllib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_htmllib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_htmllib/wx/wxprec.h.gch @@ -11346,7 +11361,7 @@ COND_WINDOWS_IMPLIB_1___qadll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_qa-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__qadll___importlib = $(COND_WINDOWS_IMPLIB_1___qadll___importlib) @COND_GCC_PCH_1@__qadll_PCH_INC = -I./.pch/wxprec_qadll -@COND_ICC_PCH_1@__qadll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__qadll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_qadll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_qadll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_qadll/wx/wxprec.h.gch @@ -11389,7 +11404,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_QA_1___qalib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_QA_1@__uninstall_qalib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_QA_1@ = uninstall_qalib @COND_GCC_PCH_1@__qalib_PCH_INC = -I./.pch/wxprec_qalib -@COND_ICC_PCH_1@__qalib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__qalib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_qalib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_qalib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_qalib/wx/wxprec.h.gch @@ -11410,7 +11425,7 @@ COND_WINDOWS_IMPLIB_1___xmldll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_base$(WXBASEPORT)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_xml-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__xmldll___importlib = $(COND_WINDOWS_IMPLIB_1___xmldll___importlib) @COND_GCC_PCH_1@__xmldll_PCH_INC = -I./.pch/wxprec_xmldll -@COND_ICC_PCH_1@__xmldll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__xmldll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_xmldll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_xmldll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_xmldll/wx/wxprec.h.gch @@ -11451,7 +11466,7 @@ COND_MONOLITHIC_0_SHARED_0___xmllib___depname = \ @COND_MONOLITHIC_0_SHARED_0@__install_xmllib___depname = install_xmllib @COND_MONOLITHIC_0_SHARED_0@__uninstall_xmllib___depname = uninstall_xmllib @COND_GCC_PCH_1@__xmllib_PCH_INC = -I./.pch/wxprec_xmllib -@COND_ICC_PCH_1@__xmllib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__xmllib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_xmllib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_xmllib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_xmllib/wx/wxprec.h.gch @@ -11474,7 +11489,7 @@ COND_WINDOWS_IMPLIB_1___xrcdll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_xrc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__xrcdll___importlib = $(COND_WINDOWS_IMPLIB_1___xrcdll___importlib) @COND_GCC_PCH_1@__xrcdll_PCH_INC = -I./.pch/wxprec_xrcdll -@COND_ICC_PCH_1@__xrcdll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__xrcdll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_xrcdll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_xrcdll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_xrcdll/wx/wxprec.h.gch @@ -11517,7 +11532,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_XRC_1___xrclib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_XRC_1@__uninstall_xrclib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_XRC_1@ = uninstall_xrclib @COND_GCC_PCH_1@__xrclib_PCH_INC = -I./.pch/wxprec_xrclib -@COND_ICC_PCH_1@__xrclib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__xrclib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_xrclib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_xrclib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_xrclib/wx/wxprec.h.gch @@ -11540,7 +11555,7 @@ COND_WINDOWS_IMPLIB_1___auidll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_aui-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__auidll___importlib = $(COND_WINDOWS_IMPLIB_1___auidll___importlib) @COND_GCC_PCH_1@__auidll_PCH_INC = -I./.pch/wxprec_auidll -@COND_ICC_PCH_1@__auidll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__auidll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_auidll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_auidll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_auidll/wx/wxprec.h.gch @@ -11583,7 +11598,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_AUI_1___auilib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_AUI_1@__uninstall_auilib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_AUI_1@ = uninstall_auilib @COND_GCC_PCH_1@__auilib_PCH_INC = -I./.pch/wxprec_auilib -@COND_ICC_PCH_1@__auilib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__auilib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_auilib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_auilib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_auilib/wx/wxprec.h.gch @@ -11606,8 +11621,7 @@ COND_WINDOWS_IMPLIB_1___propgriddll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_propgrid-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__propgriddll___importlib = $(COND_WINDOWS_IMPLIB_1___propgriddll___importlib) @COND_GCC_PCH_1@__propgriddll_PCH_INC = -I./.pch/wxprec_propgriddll -@COND_ICC_PCH_1@__propgriddll_PCH_INC = \ -@COND_ICC_PCH_1@ $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__propgriddll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_propgriddll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_propgriddll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_propgriddll/wx/wxprec.h.gch @@ -11651,8 +11665,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_PROPGRID_1___propgridlib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_PROPGRID_1@__uninstall_propgridlib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_PROPGRID_1@ = uninstall_propgridlib @COND_GCC_PCH_1@__propgridlib_PCH_INC = -I./.pch/wxprec_propgridlib -@COND_ICC_PCH_1@__propgridlib_PCH_INC = \ -@COND_ICC_PCH_1@ $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__propgridlib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_propgridlib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_propgridlib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_propgridlib/wx/wxprec.h.gch @@ -11675,8 +11688,7 @@ COND_WINDOWS_IMPLIB_1___richtextdll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_richtext-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__richtextdll___importlib = $(COND_WINDOWS_IMPLIB_1___richtextdll___importlib) @COND_GCC_PCH_1@__richtextdll_PCH_INC = -I./.pch/wxprec_richtextdll -@COND_ICC_PCH_1@__richtextdll_PCH_INC = \ -@COND_ICC_PCH_1@ $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__richtextdll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_richtextdll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_richtextdll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_richtextdll/wx/wxprec.h.gch @@ -11720,8 +11732,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_RICHTEXT_1___richtextlib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_RICHTEXT_1@__uninstall_richtextlib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_RICHTEXT_1@ = uninstall_richtextlib @COND_GCC_PCH_1@__richtextlib_PCH_INC = -I./.pch/wxprec_richtextlib -@COND_ICC_PCH_1@__richtextlib_PCH_INC = \ -@COND_ICC_PCH_1@ $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__richtextlib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_richtextlib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_richtextlib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_richtextlib/wx/wxprec.h.gch @@ -11744,7 +11755,7 @@ COND_WINDOWS_IMPLIB_1___stcdll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_stc-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__stcdll___importlib = $(COND_WINDOWS_IMPLIB_1___stcdll___importlib) @COND_GCC_PCH_1@__stcdll_PCH_INC = -I./.pch/wxprec_stcdll -@COND_ICC_PCH_1@__stcdll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__stcdll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_stcdll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_stcdll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_stcdll/wx/wxprec.h.gch @@ -11787,7 +11798,7 @@ COND_MONOLITHIC_0_SHARED_0_USE_STC_1___stclib___depname = \ @COND_MONOLITHIC_0_SHARED_0_USE_STC_1@__uninstall_stclib___depname \ @COND_MONOLITHIC_0_SHARED_0_USE_STC_1@ = uninstall_stclib @COND_GCC_PCH_1@__stclib_PCH_INC = -I./.pch/wxprec_stclib -@COND_ICC_PCH_1@__stclib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__stclib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_stclib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_stclib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_stclib/wx/wxprec.h.gch @@ -11810,7 +11821,7 @@ COND_WINDOWS_IMPLIB_1___gldll___importlib = \ -Wl,--out-implib=$(LIBDIRNAME)/$(LIBPREFIX)wx_$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_gl-$(WX_RELEASE)$(HOST_SUFFIX).$(DLLIMP_SUFFIX) @COND_WINDOWS_IMPLIB_1@__gldll___importlib = $(COND_WINDOWS_IMPLIB_1___gldll___importlib) @COND_GCC_PCH_1@__gldll_PCH_INC = -I./.pch/wxprec_gldll -@COND_ICC_PCH_1@__gldll_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__gldll_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_gldll/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_gldll_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_gldll/wx/wxprec.h.gch @@ -11879,7 +11890,7 @@ COND_SHARED_0_USE_GUI_1_USE_OPENGL_1___gllib___depname = \ @COND_SHARED_0_USE_GUI_1_USE_OPENGL_1@__uninstall_gllib___depname \ @COND_SHARED_0_USE_GUI_1_USE_OPENGL_1@ = uninstall_gllib @COND_GCC_PCH_1@__gllib_PCH_INC = -I./.pch/wxprec_gllib -@COND_ICC_PCH_1@__gllib_PCH_INC = $(ICC_PCH_USE_SWITCH) \ +@COND_ICC_PCH_1@__gllib_PCH_INC = -use_pch \ @COND_ICC_PCH_1@ ./.pch/wxprec_gllib/wx/wxprec.h.gch @COND_USE_PCH_1@_____pch_wxprec_gllib_wx_wxprec_h_gch___depname \ @COND_USE_PCH_1@ = ./.pch/wxprec_gllib/wx/wxprec.h.gch @@ -18293,6 +18304,12 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@monodll_sizer.o: $(srcdir)/src/common/sizer.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/sizer.cpp +@COND_USE_GUI_1@monodll_spinbuttcmn.o: $(srcdir)/src/common/spinbuttcmn.cpp $(MONODLL_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/spinbuttcmn.cpp + +@COND_USE_GUI_1@monodll_spinctrlcmn.o: $(srcdir)/src/common/spinctrlcmn.cpp $(MONODLL_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/spinctrlcmn.cpp + @COND_USE_GUI_1@monodll_srchcmn.o: $(srcdir)/src/common/srchcmn.cpp $(MONODLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/srchcmn.cpp @@ -22952,6 +22969,12 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@monolib_sizer.o: $(srcdir)/src/common/sizer.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/sizer.cpp +@COND_USE_GUI_1@monolib_spinbuttcmn.o: $(srcdir)/src/common/spinbuttcmn.cpp $(MONOLIB_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/spinbuttcmn.cpp + +@COND_USE_GUI_1@monolib_spinctrlcmn.o: $(srcdir)/src/common/spinctrlcmn.cpp $(MONOLIB_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/spinctrlcmn.cpp + @COND_USE_GUI_1@monolib_srchcmn.o: $(srcdir)/src/common/srchcmn.cpp $(MONOLIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/srchcmn.cpp @@ -27797,6 +27820,12 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP) @COND_USE_GUI_1@coredll_sizer.o: $(srcdir)/src/common/sizer.cpp $(COREDLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/sizer.cpp +@COND_USE_GUI_1@coredll_spinbuttcmn.o: $(srcdir)/src/common/spinbuttcmn.cpp $(COREDLL_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/spinbuttcmn.cpp + +@COND_USE_GUI_1@coredll_spinctrlcmn.o: $(srcdir)/src/common/spinctrlcmn.cpp $(COREDLL_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/spinctrlcmn.cpp + @COND_USE_GUI_1@coredll_srchcmn.o: $(srcdir)/src/common/srchcmn.cpp $(COREDLL_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/srchcmn.cpp @@ -31283,6 +31312,12 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP) @COND_USE_GUI_1@corelib_sizer.o: $(srcdir)/src/common/sizer.cpp $(CORELIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/sizer.cpp +@COND_USE_GUI_1@corelib_spinbuttcmn.o: $(srcdir)/src/common/spinbuttcmn.cpp $(CORELIB_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/spinbuttcmn.cpp + +@COND_USE_GUI_1@corelib_spinctrlcmn.o: $(srcdir)/src/common/spinctrlcmn.cpp $(CORELIB_ODEP) +@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/spinctrlcmn.cpp + @COND_USE_GUI_1@corelib_srchcmn.o: $(srcdir)/src/common/srchcmn.cpp $(CORELIB_ODEP) @COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/srchcmn.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 16d818d852..31b14f0985 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -688,6 +688,8 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/common/rgncmn.cpp src/common/settcmn.cpp src/common/sizer.cpp + src/common/spinbuttcmn.cpp + src/common/spinctrlcmn.cpp src/common/srchcmn.cpp src/common/statbar.cpp src/common/stattextcmn.cpp diff --git a/build/msw/makefile.bcc b/build/msw/makefile.bcc index ec5ee4426e..8f0c2c2e65 100644 --- a/build/msw/makefile.bcc +++ b/build/msw/makefile.bcc @@ -1713,6 +1713,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_rgncmn.obj \ $(OBJS)\monodll_settcmn.obj \ $(OBJS)\monodll_sizer.obj \ + $(OBJS)\monodll_spinbuttcmn.obj \ + $(OBJS)\monodll_spinctrlcmn.obj \ $(OBJS)\monodll_srchcmn.obj \ $(OBJS)\monodll_statbar.obj \ $(OBJS)\monodll_stattextcmn.obj \ @@ -1950,6 +1952,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_rgncmn.obj \ $(OBJS)\monodll_settcmn.obj \ $(OBJS)\monodll_sizer.obj \ + $(OBJS)\monodll_spinbuttcmn.obj \ + $(OBJS)\monodll_spinctrlcmn.obj \ $(OBJS)\monodll_srchcmn.obj \ $(OBJS)\monodll_statbar.obj \ $(OBJS)\monodll_stattextcmn.obj \ @@ -2390,6 +2394,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_rgncmn.obj \ $(OBJS)\monolib_settcmn.obj \ $(OBJS)\monolib_sizer.obj \ + $(OBJS)\monolib_spinbuttcmn.obj \ + $(OBJS)\monolib_spinctrlcmn.obj \ $(OBJS)\monolib_srchcmn.obj \ $(OBJS)\monolib_statbar.obj \ $(OBJS)\monolib_stattextcmn.obj \ @@ -2627,6 +2633,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_rgncmn.obj \ $(OBJS)\monolib_settcmn.obj \ $(OBJS)\monolib_sizer.obj \ + $(OBJS)\monolib_spinbuttcmn.obj \ + $(OBJS)\monolib_spinctrlcmn.obj \ $(OBJS)\monolib_srchcmn.obj \ $(OBJS)\monolib_statbar.obj \ $(OBJS)\monolib_stattextcmn.obj \ @@ -2972,6 +2980,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_rgncmn.obj \ $(OBJS)\coredll_settcmn.obj \ $(OBJS)\coredll_sizer.obj \ + $(OBJS)\coredll_spinbuttcmn.obj \ + $(OBJS)\coredll_spinctrlcmn.obj \ $(OBJS)\coredll_srchcmn.obj \ $(OBJS)\coredll_statbar.obj \ $(OBJS)\coredll_stattextcmn.obj \ @@ -3209,6 +3219,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_rgncmn.obj \ $(OBJS)\coredll_settcmn.obj \ $(OBJS)\coredll_sizer.obj \ + $(OBJS)\coredll_spinbuttcmn.obj \ + $(OBJS)\coredll_spinctrlcmn.obj \ $(OBJS)\coredll_srchcmn.obj \ $(OBJS)\coredll_statbar.obj \ $(OBJS)\coredll_stattextcmn.obj \ @@ -3451,6 +3463,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_rgncmn.obj \ $(OBJS)\corelib_settcmn.obj \ $(OBJS)\corelib_sizer.obj \ + $(OBJS)\corelib_spinbuttcmn.obj \ + $(OBJS)\corelib_spinctrlcmn.obj \ $(OBJS)\corelib_srchcmn.obj \ $(OBJS)\corelib_statbar.obj \ $(OBJS)\corelib_stattextcmn.obj \ @@ -3688,6 +3702,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_rgncmn.obj \ $(OBJS)\corelib_settcmn.obj \ $(OBJS)\corelib_sizer.obj \ + $(OBJS)\corelib_spinbuttcmn.obj \ + $(OBJS)\corelib_spinctrlcmn.obj \ $(OBJS)\corelib_srchcmn.obj \ $(OBJS)\corelib_statbar.obj \ $(OBJS)\corelib_stattextcmn.obj \ @@ -7181,6 +7197,16 @@ $(OBJS)\monodll_sizer.obj: ..\..\src\common\sizer.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\sizer.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_spinbuttcmn.obj: ..\..\src\common\spinbuttcmn.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\spinbuttcmn.cpp +!endif + +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_spinctrlcmn.obj: ..\..\src\common\spinctrlcmn.cpp + $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\spinctrlcmn.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\monodll_srchcmn.obj: ..\..\src\common\srchcmn.cpp $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\srchcmn.cpp @@ -9391,6 +9417,16 @@ $(OBJS)\monolib_sizer.obj: ..\..\src\common\sizer.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\sizer.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_spinbuttcmn.obj: ..\..\src\common\spinbuttcmn.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\spinbuttcmn.cpp +!endif + +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_spinctrlcmn.obj: ..\..\src\common\spinctrlcmn.cpp + $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\spinctrlcmn.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\monolib_srchcmn.obj: ..\..\src\common\srchcmn.cpp $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\srchcmn.cpp @@ -11622,6 +11658,16 @@ $(OBJS)\coredll_sizer.obj: ..\..\src\common\sizer.cpp $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\sizer.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\coredll_spinbuttcmn.obj: ..\..\src\common\spinbuttcmn.cpp + $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\spinbuttcmn.cpp +!endif + +!if "$(USE_GUI)" == "1" +$(OBJS)\coredll_spinctrlcmn.obj: ..\..\src\common\spinctrlcmn.cpp + $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\spinctrlcmn.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\coredll_srchcmn.obj: ..\..\src\common\srchcmn.cpp $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\srchcmn.cpp @@ -12983,6 +13029,16 @@ $(OBJS)\corelib_sizer.obj: ..\..\src\common\sizer.cpp $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\sizer.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\corelib_spinbuttcmn.obj: ..\..\src\common\spinbuttcmn.cpp + $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\spinbuttcmn.cpp +!endif + +!if "$(USE_GUI)" == "1" +$(OBJS)\corelib_spinctrlcmn.obj: ..\..\src\common\spinctrlcmn.cpp + $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\spinctrlcmn.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\corelib_srchcmn.obj: ..\..\src\common\srchcmn.cpp $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\srchcmn.cpp diff --git a/build/msw/makefile.gcc b/build/msw/makefile.gcc index bae6ceddd0..c33154f014 100644 --- a/build/msw/makefile.gcc +++ b/build/msw/makefile.gcc @@ -1731,6 +1731,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_rgncmn.o \ $(OBJS)\monodll_settcmn.o \ $(OBJS)\monodll_sizer.o \ + $(OBJS)\monodll_spinbuttcmn.o \ + $(OBJS)\monodll_spinctrlcmn.o \ $(OBJS)\monodll_srchcmn.o \ $(OBJS)\monodll_statbar.o \ $(OBJS)\monodll_stattextcmn.o \ @@ -1970,6 +1972,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_rgncmn.o \ $(OBJS)\monodll_settcmn.o \ $(OBJS)\monodll_sizer.o \ + $(OBJS)\monodll_spinbuttcmn.o \ + $(OBJS)\monodll_spinctrlcmn.o \ $(OBJS)\monodll_srchcmn.o \ $(OBJS)\monodll_statbar.o \ $(OBJS)\monodll_stattextcmn.o \ @@ -2414,6 +2418,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_rgncmn.o \ $(OBJS)\monolib_settcmn.o \ $(OBJS)\monolib_sizer.o \ + $(OBJS)\monolib_spinbuttcmn.o \ + $(OBJS)\monolib_spinctrlcmn.o \ $(OBJS)\monolib_srchcmn.o \ $(OBJS)\monolib_statbar.o \ $(OBJS)\monolib_stattextcmn.o \ @@ -2653,6 +2659,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_rgncmn.o \ $(OBJS)\monolib_settcmn.o \ $(OBJS)\monolib_sizer.o \ + $(OBJS)\monolib_spinbuttcmn.o \ + $(OBJS)\monolib_spinctrlcmn.o \ $(OBJS)\monolib_srchcmn.o \ $(OBJS)\monolib_statbar.o \ $(OBJS)\monolib_stattextcmn.o \ @@ -3012,6 +3020,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_rgncmn.o \ $(OBJS)\coredll_settcmn.o \ $(OBJS)\coredll_sizer.o \ + $(OBJS)\coredll_spinbuttcmn.o \ + $(OBJS)\coredll_spinctrlcmn.o \ $(OBJS)\coredll_srchcmn.o \ $(OBJS)\coredll_statbar.o \ $(OBJS)\coredll_stattextcmn.o \ @@ -3251,6 +3261,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_rgncmn.o \ $(OBJS)\coredll_settcmn.o \ $(OBJS)\coredll_sizer.o \ + $(OBJS)\coredll_spinbuttcmn.o \ + $(OBJS)\coredll_spinctrlcmn.o \ $(OBJS)\coredll_srchcmn.o \ $(OBJS)\coredll_statbar.o \ $(OBJS)\coredll_stattextcmn.o \ @@ -3499,6 +3511,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_rgncmn.o \ $(OBJS)\corelib_settcmn.o \ $(OBJS)\corelib_sizer.o \ + $(OBJS)\corelib_spinbuttcmn.o \ + $(OBJS)\corelib_spinctrlcmn.o \ $(OBJS)\corelib_srchcmn.o \ $(OBJS)\corelib_statbar.o \ $(OBJS)\corelib_stattextcmn.o \ @@ -3738,6 +3752,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_rgncmn.o \ $(OBJS)\corelib_settcmn.o \ $(OBJS)\corelib_sizer.o \ + $(OBJS)\corelib_spinbuttcmn.o \ + $(OBJS)\corelib_spinctrlcmn.o \ $(OBJS)\corelib_srchcmn.o \ $(OBJS)\corelib_statbar.o \ $(OBJS)\corelib_stattextcmn.o \ @@ -7445,6 +7461,16 @@ $(OBJS)\monodll_sizer.o: ../../src/common/sizer.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\monodll_spinbuttcmn.o: ../../src/common/spinbuttcmn.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +endif + +ifeq ($(USE_GUI),1) +$(OBJS)\monodll_spinctrlcmn.o: ../../src/common/spinctrlcmn.cpp + $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< +endif + ifeq ($(USE_GUI),1) $(OBJS)\monodll_srchcmn.o: ../../src/common/srchcmn.cpp $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $< @@ -9769,6 +9795,16 @@ $(OBJS)\monolib_sizer.o: ../../src/common/sizer.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\monolib_spinbuttcmn.o: ../../src/common/spinbuttcmn.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +endif + +ifeq ($(USE_GUI),1) +$(OBJS)\monolib_spinctrlcmn.o: ../../src/common/spinctrlcmn.cpp + $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< +endif + ifeq ($(USE_GUI),1) $(OBJS)\monolib_srchcmn.o: ../../src/common/srchcmn.cpp $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $< @@ -12114,6 +12150,16 @@ $(OBJS)\coredll_sizer.o: ../../src/common/sizer.cpp $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\coredll_spinbuttcmn.o: ../../src/common/spinbuttcmn.cpp + $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< +endif + +ifeq ($(USE_GUI),1) +$(OBJS)\coredll_spinctrlcmn.o: ../../src/common/spinctrlcmn.cpp + $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< +endif + ifeq ($(USE_GUI),1) $(OBJS)\coredll_srchcmn.o: ../../src/common/srchcmn.cpp $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $< @@ -13587,6 +13633,16 @@ $(OBJS)\corelib_sizer.o: ../../src/common/sizer.cpp $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< endif +ifeq ($(USE_GUI),1) +$(OBJS)\corelib_spinbuttcmn.o: ../../src/common/spinbuttcmn.cpp + $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< +endif + +ifeq ($(USE_GUI),1) +$(OBJS)\corelib_spinctrlcmn.o: ../../src/common/spinctrlcmn.cpp + $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< +endif + ifeq ($(USE_GUI),1) $(OBJS)\corelib_srchcmn.o: ../../src/common/srchcmn.cpp $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $< diff --git a/build/msw/makefile.vc b/build/msw/makefile.vc index b418aa0ea3..839e68588b 100644 --- a/build/msw/makefile.vc +++ b/build/msw/makefile.vc @@ -1893,6 +1893,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_rgncmn.obj \ $(OBJS)\monodll_settcmn.obj \ $(OBJS)\monodll_sizer.obj \ + $(OBJS)\monodll_spinbuttcmn.obj \ + $(OBJS)\monodll_spinctrlcmn.obj \ $(OBJS)\monodll_srchcmn.obj \ $(OBJS)\monodll_statbar.obj \ $(OBJS)\monodll_stattextcmn.obj \ @@ -2130,6 +2132,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = \ $(OBJS)\monodll_rgncmn.obj \ $(OBJS)\monodll_settcmn.obj \ $(OBJS)\monodll_sizer.obj \ + $(OBJS)\monodll_spinbuttcmn.obj \ + $(OBJS)\monodll_spinctrlcmn.obj \ $(OBJS)\monodll_srchcmn.obj \ $(OBJS)\monodll_statbar.obj \ $(OBJS)\monodll_stattextcmn.obj \ @@ -2576,6 +2580,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_rgncmn.obj \ $(OBJS)\monolib_settcmn.obj \ $(OBJS)\monolib_sizer.obj \ + $(OBJS)\monolib_spinbuttcmn.obj \ + $(OBJS)\monolib_spinctrlcmn.obj \ $(OBJS)\monolib_srchcmn.obj \ $(OBJS)\monolib_statbar.obj \ $(OBJS)\monolib_stattextcmn.obj \ @@ -2813,6 +2819,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \ $(OBJS)\monolib_rgncmn.obj \ $(OBJS)\monolib_settcmn.obj \ $(OBJS)\monolib_sizer.obj \ + $(OBJS)\monolib_spinbuttcmn.obj \ + $(OBJS)\monolib_spinctrlcmn.obj \ $(OBJS)\monolib_srchcmn.obj \ $(OBJS)\monolib_statbar.obj \ $(OBJS)\monolib_stattextcmn.obj \ @@ -3188,6 +3196,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_rgncmn.obj \ $(OBJS)\coredll_settcmn.obj \ $(OBJS)\coredll_sizer.obj \ + $(OBJS)\coredll_spinbuttcmn.obj \ + $(OBJS)\coredll_spinctrlcmn.obj \ $(OBJS)\coredll_srchcmn.obj \ $(OBJS)\coredll_statbar.obj \ $(OBJS)\coredll_stattextcmn.obj \ @@ -3425,6 +3435,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \ $(OBJS)\coredll_rgncmn.obj \ $(OBJS)\coredll_settcmn.obj \ $(OBJS)\coredll_sizer.obj \ + $(OBJS)\coredll_spinbuttcmn.obj \ + $(OBJS)\coredll_spinctrlcmn.obj \ $(OBJS)\coredll_srchcmn.obj \ $(OBJS)\coredll_statbar.obj \ $(OBJS)\coredll_stattextcmn.obj \ @@ -3673,6 +3685,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_rgncmn.obj \ $(OBJS)\corelib_settcmn.obj \ $(OBJS)\corelib_sizer.obj \ + $(OBJS)\corelib_spinbuttcmn.obj \ + $(OBJS)\corelib_spinctrlcmn.obj \ $(OBJS)\corelib_srchcmn.obj \ $(OBJS)\corelib_statbar.obj \ $(OBJS)\corelib_stattextcmn.obj \ @@ -3910,6 +3924,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \ $(OBJS)\corelib_rgncmn.obj \ $(OBJS)\corelib_settcmn.obj \ $(OBJS)\corelib_sizer.obj \ + $(OBJS)\corelib_spinbuttcmn.obj \ + $(OBJS)\corelib_spinctrlcmn.obj \ $(OBJS)\corelib_srchcmn.obj \ $(OBJS)\corelib_statbar.obj \ $(OBJS)\corelib_stattextcmn.obj \ @@ -7527,6 +7543,16 @@ $(OBJS)\monodll_sizer.obj: ..\..\src\common\sizer.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\sizer.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_spinbuttcmn.obj: ..\..\src\common\spinbuttcmn.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\spinbuttcmn.cpp +!endif + +!if "$(USE_GUI)" == "1" +$(OBJS)\monodll_spinctrlcmn.obj: ..\..\src\common\spinctrlcmn.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\spinctrlcmn.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\monodll_srchcmn.obj: ..\..\src\common\srchcmn.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\srchcmn.cpp @@ -9737,6 +9763,16 @@ $(OBJS)\monolib_sizer.obj: ..\..\src\common\sizer.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\sizer.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_spinbuttcmn.obj: ..\..\src\common\spinbuttcmn.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\spinbuttcmn.cpp +!endif + +!if "$(USE_GUI)" == "1" +$(OBJS)\monolib_spinctrlcmn.obj: ..\..\src\common\spinctrlcmn.cpp + $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\spinctrlcmn.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\monolib_srchcmn.obj: ..\..\src\common\srchcmn.cpp $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\srchcmn.cpp @@ -11968,6 +12004,16 @@ $(OBJS)\coredll_sizer.obj: ..\..\src\common\sizer.cpp $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\sizer.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\coredll_spinbuttcmn.obj: ..\..\src\common\spinbuttcmn.cpp + $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\spinbuttcmn.cpp +!endif + +!if "$(USE_GUI)" == "1" +$(OBJS)\coredll_spinctrlcmn.obj: ..\..\src\common\spinctrlcmn.cpp + $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\spinctrlcmn.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\coredll_srchcmn.obj: ..\..\src\common\srchcmn.cpp $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\srchcmn.cpp @@ -13329,6 +13375,16 @@ $(OBJS)\corelib_sizer.obj: ..\..\src\common\sizer.cpp $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\sizer.cpp !endif +!if "$(USE_GUI)" == "1" +$(OBJS)\corelib_spinbuttcmn.obj: ..\..\src\common\spinbuttcmn.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\spinbuttcmn.cpp +!endif + +!if "$(USE_GUI)" == "1" +$(OBJS)\corelib_spinctrlcmn.obj: ..\..\src\common\spinctrlcmn.cpp + $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\spinctrlcmn.cpp +!endif + !if "$(USE_GUI)" == "1" $(OBJS)\corelib_srchcmn.obj: ..\..\src\common\srchcmn.cpp $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\srchcmn.cpp diff --git a/build/msw/makefile.wat b/build/msw/makefile.wat index f2e49e12ab..184d36e402 100644 --- a/build/msw/makefile.wat +++ b/build/msw/makefile.wat @@ -408,6 +408,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = & $(OBJS)\monodll_rgncmn.obj & $(OBJS)\monodll_settcmn.obj & $(OBJS)\monodll_sizer.obj & + $(OBJS)\monodll_spinbuttcmn.obj & + $(OBJS)\monodll_spinctrlcmn.obj & $(OBJS)\monodll_srchcmn.obj & $(OBJS)\monodll_statbar.obj & $(OBJS)\monodll_stattextcmn.obj & @@ -647,6 +649,8 @@ ____CORE_SRC_FILENAMES_OBJECTS = & $(OBJS)\monodll_rgncmn.obj & $(OBJS)\monodll_settcmn.obj & $(OBJS)\monodll_sizer.obj & + $(OBJS)\monodll_spinbuttcmn.obj & + $(OBJS)\monodll_spinctrlcmn.obj & $(OBJS)\monodll_srchcmn.obj & $(OBJS)\monodll_statbar.obj & $(OBJS)\monodll_stattextcmn.obj & @@ -1096,6 +1100,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = & $(OBJS)\monolib_rgncmn.obj & $(OBJS)\monolib_settcmn.obj & $(OBJS)\monolib_sizer.obj & + $(OBJS)\monolib_spinbuttcmn.obj & + $(OBJS)\monolib_spinctrlcmn.obj & $(OBJS)\monolib_srchcmn.obj & $(OBJS)\monolib_statbar.obj & $(OBJS)\monolib_stattextcmn.obj & @@ -1335,6 +1341,8 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = & $(OBJS)\monolib_rgncmn.obj & $(OBJS)\monolib_settcmn.obj & $(OBJS)\monolib_sizer.obj & + $(OBJS)\monolib_spinbuttcmn.obj & + $(OBJS)\monolib_spinctrlcmn.obj & $(OBJS)\monolib_srchcmn.obj & $(OBJS)\monolib_statbar.obj & $(OBJS)\monolib_stattextcmn.obj & @@ -1705,6 +1713,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = & $(OBJS)\coredll_rgncmn.obj & $(OBJS)\coredll_settcmn.obj & $(OBJS)\coredll_sizer.obj & + $(OBJS)\coredll_spinbuttcmn.obj & + $(OBJS)\coredll_spinctrlcmn.obj & $(OBJS)\coredll_srchcmn.obj & $(OBJS)\coredll_statbar.obj & $(OBJS)\coredll_stattextcmn.obj & @@ -1944,6 +1954,8 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = & $(OBJS)\coredll_rgncmn.obj & $(OBJS)\coredll_settcmn.obj & $(OBJS)\coredll_sizer.obj & + $(OBJS)\coredll_spinbuttcmn.obj & + $(OBJS)\coredll_spinctrlcmn.obj & $(OBJS)\coredll_srchcmn.obj & $(OBJS)\coredll_statbar.obj & $(OBJS)\coredll_stattextcmn.obj & @@ -2194,6 +2206,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = & $(OBJS)\corelib_rgncmn.obj & $(OBJS)\corelib_settcmn.obj & $(OBJS)\corelib_sizer.obj & + $(OBJS)\corelib_spinbuttcmn.obj & + $(OBJS)\corelib_spinctrlcmn.obj & $(OBJS)\corelib_srchcmn.obj & $(OBJS)\corelib_statbar.obj & $(OBJS)\corelib_stattextcmn.obj & @@ -2433,6 +2447,8 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = & $(OBJS)\corelib_rgncmn.obj & $(OBJS)\corelib_settcmn.obj & $(OBJS)\corelib_sizer.obj & + $(OBJS)\corelib_spinbuttcmn.obj & + $(OBJS)\corelib_spinctrlcmn.obj & $(OBJS)\corelib_srchcmn.obj & $(OBJS)\corelib_statbar.obj & $(OBJS)\corelib_stattextcmn.obj & @@ -7690,6 +7706,16 @@ $(OBJS)\monodll_sizer.obj : .AUTODEPEND ..\..\src\common\sizer.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< !endif +!ifeq USE_GUI 1 +$(OBJS)\monodll_spinbuttcmn.obj : .AUTODEPEND ..\..\src\common\spinbuttcmn.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< +!endif + +!ifeq USE_GUI 1 +$(OBJS)\monodll_spinctrlcmn.obj : .AUTODEPEND ..\..\src\common\spinctrlcmn.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< +!endif + !ifeq USE_GUI 1 $(OBJS)\monodll_srchcmn.obj : .AUTODEPEND ..\..\src\common\srchcmn.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $< @@ -10014,6 +10040,16 @@ $(OBJS)\monolib_sizer.obj : .AUTODEPEND ..\..\src\common\sizer.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< !endif +!ifeq USE_GUI 1 +$(OBJS)\monolib_spinbuttcmn.obj : .AUTODEPEND ..\..\src\common\spinbuttcmn.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< +!endif + +!ifeq USE_GUI 1 +$(OBJS)\monolib_spinctrlcmn.obj : .AUTODEPEND ..\..\src\common\spinctrlcmn.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< +!endif + !ifeq USE_GUI 1 $(OBJS)\monolib_srchcmn.obj : .AUTODEPEND ..\..\src\common\srchcmn.cpp $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $< @@ -12359,6 +12395,16 @@ $(OBJS)\coredll_sizer.obj : .AUTODEPEND ..\..\src\common\sizer.cpp $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $< !endif +!ifeq USE_GUI 1 +$(OBJS)\coredll_spinbuttcmn.obj : .AUTODEPEND ..\..\src\common\spinbuttcmn.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $< +!endif + +!ifeq USE_GUI 1 +$(OBJS)\coredll_spinctrlcmn.obj : .AUTODEPEND ..\..\src\common\spinctrlcmn.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $< +!endif + !ifeq USE_GUI 1 $(OBJS)\coredll_srchcmn.obj : .AUTODEPEND ..\..\src\common\srchcmn.cpp $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $< @@ -13832,6 +13878,16 @@ $(OBJS)\corelib_sizer.obj : .AUTODEPEND ..\..\src\common\sizer.cpp $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $< !endif +!ifeq USE_GUI 1 +$(OBJS)\corelib_spinbuttcmn.obj : .AUTODEPEND ..\..\src\common\spinbuttcmn.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $< +!endif + +!ifeq USE_GUI 1 +$(OBJS)\corelib_spinctrlcmn.obj : .AUTODEPEND ..\..\src\common\spinctrlcmn.cpp + $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $< +!endif + !ifeq USE_GUI 1 $(OBJS)\corelib_srchcmn.obj : .AUTODEPEND ..\..\src\common\srchcmn.cpp $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $< diff --git a/build/msw/wx_core.dsp b/build/msw/wx_core.dsp index 0da28e1fb1..dcc79c860d 100644 --- a/build/msw/wx_core.dsp +++ b/build/msw/wx_core.dsp @@ -602,6 +602,14 @@ SOURCE=..\..\src\common\sizer.cpp # End Source File # Begin Source File +SOURCE=..\..\src\common\spinbuttcmn.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\src\common\spinctrlcmn.cpp +# End Source File +# Begin Source File + SOURCE=..\..\src\common\srchcmn.cpp # End Source File # Begin Source File diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj index d91089b015..7f04f486ac 100644 --- a/build/msw/wx_vc7_core.vcproj +++ b/build/msw/wx_vc7_core.vcproj @@ -831,6 +831,12 @@ + + + + diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj index d75a09dbc2..4b7a9d6f2f 100644 --- a/build/msw/wx_vc8_core.vcproj +++ b/build/msw/wx_vc8_core.vcproj @@ -1146,6 +1146,14 @@ RelativePath="..\..\src\common\sizer.cpp" > + + + + diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj index 19f9418152..d5aed85d66 100644 --- a/build/msw/wx_vc9_core.vcproj +++ b/build/msw/wx_vc9_core.vcproj @@ -1142,6 +1142,14 @@ RelativePath="..\..\src\common\sizer.cpp" > + + + + diff --git a/configure b/configure index fcefb14a05..c9d2107535 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 58007 2009-01-11 00:46:55Z VZ . +# From configure.in Id: configure.in 58009 2009-01-11 00:57:08Z VZ . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0. # @@ -5435,6 +5435,11 @@ fi echo "${ECHO_T}$result" >&6; } +cat >>confdefs.h <<\_ACEOF +#define wxEVENTS_COMPATIBILITY_2_8 0 +_ACEOF + + enablestring=disable defaultval= diff --git a/configure.in b/configure.in index 6d8db5e0d3..5ffa04ee88 100644 --- a/configure.in +++ b/configure.in @@ -663,6 +663,13 @@ WX_ARG_ENABLE_PARAM(universal_binary, [[ --enable-universal_binary create Mac WX_ARG_ENABLE(compat26, [ --enable-compat26 enable wxWidgets 2.6 compatibility], WXWIN_COMPATIBILITY_2_6) WX_ARG_DISABLE(compat28, [ --disable-compat28 disable wxWidgets 2.8 compatibility], WXWIN_COMPATIBILITY_2_8) +dnl currently we don't provide a switch for disabling it as it shouldn't be +dnl necessary to do it unless the compiler doesn't support the new events and +dnl this should be tested for by configure itself (but also isn't done yet +dnl because there are no known examples of such compilers among the currently +dnl supported ones) +AC_DEFINE(wxEVENTS_COMPATIBILITY_2_8, 0) + WX_ARG_DISABLE(rpath, [ --disable-rpath disable use of rpath for uninstalled builds], wxUSE_RPATH) WX_ARG_ENABLE(objc_uniquifying,[ --enable-objc_uniquifying enable Objective-C class name uniquifying], wxUSE_OBJC_UNIQUIFYING) diff --git a/docs/changes.txt b/docs/changes.txt index 39cc386957..db956a1b46 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -265,6 +265,9 @@ Major new features in this release - Event loops, timers and sockets can now be used in wxBase, without GUI. +- Events can now be connected to any functor, not necessarily a method of + wxEvtHandler-derived class. The compile-time safety was also improved. + - Documentation for wxWidgets has been converted from LaTex to C++ headers with Doxygen comments and significantly improved in the process (screenshots of various controls were added, more identifiers are now linked to their diff --git a/include/wx/app.h b/include/wx/app.h index f2a254bac0..d4ff103779 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -221,6 +221,16 @@ public: virtual int FilterEvent(wxEvent& event); #if wxUSE_EXCEPTIONS + // execute the functor to handle the given event + // + // this is a generalization of HandleEvent() below and the base class + // implementation of CallEventHandler() still calls HandleEvent() for + // compatibility for functors which are just wxEventFunctions (i.e. methods + // of wxEvtHandler) + virtual void CallEventHandler(wxEvtHandler *handler, + wxEventFunctor& functor, + wxEvent& event) const; + // call the specified handler on the given object with the given event // // this method only exists to allow catching the exceptions thrown by any diff --git a/include/wx/aui/auibar.h b/include/wx/aui/auibar.h index 13d6015cdf..4c4bd21641 100644 --- a/include/wx/aui/auibar.h +++ b/include/wx/aui/auibar.h @@ -634,18 +634,16 @@ protected: #ifndef SWIG -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, 0) - DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, 0) -END_DECLARE_EVENT_TYPES() +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, wxAuiToolBarEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, wxAuiToolBarEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, wxAuiToolBarEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, wxAuiToolBarEvent ) typedef void (wxEvtHandler::*wxAuiToolBarEventFunction)(wxAuiToolBarEvent&); #define wxAuiToolBarEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiToolBarEventFunction, &func) + wxEVENT_HANDLER_CAST(wxAuiToolBarEventFunction, func) #define EVT_AUITOOLBAR_TOOL_DROPDOWN(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, winid, wxAuiToolBarEventHandler(fn)) diff --git a/include/wx/aui/auibook.h b/include/wx/aui/auibook.h index 4971c62ea1..daca6b4349 100644 --- a/include/wx/aui/auibook.h +++ b/include/wx/aui/auibook.h @@ -607,16 +607,16 @@ protected: void OnChildFocusNotebook(wxChildFocusEvent& evt); void OnRender(wxAuiManagerEvent& evt); void OnSize(wxSizeEvent& evt); - void OnTabClicked(wxCommandEvent& evt); - void OnTabBeginDrag(wxCommandEvent& evt); - void OnTabDragMotion(wxCommandEvent& evt); - void OnTabEndDrag(wxCommandEvent& evt); - void OnTabButton(wxCommandEvent& evt); - void OnTabMiddleDown(wxCommandEvent& evt); - void OnTabMiddleUp(wxCommandEvent& evt); - void OnTabRightDown(wxCommandEvent& evt); - void OnTabRightUp(wxCommandEvent& evt); - void OnTabBgDClick(wxCommandEvent& evt); + void OnTabClicked(wxAuiNotebookEvent& evt); + void OnTabBeginDrag(wxAuiNotebookEvent& evt); + void OnTabDragMotion(wxAuiNotebookEvent& evt); + void OnTabEndDrag(wxAuiNotebookEvent& evt); + void OnTabButton(wxAuiNotebookEvent& evt); + void OnTabMiddleDown(wxAuiNotebookEvent& evt); + void OnTabMiddleUp(wxAuiNotebookEvent& evt); + void OnTabRightDown(wxAuiNotebookEvent& evt); + void OnTabRightUp(wxAuiNotebookEvent& evt); + void OnTabBgDClick(wxAuiNotebookEvent& evt); void OnNavigationKeyNotebook(wxNavigationKeyEvent& event); // set selection to the given window (which must be non-NULL and be one of @@ -660,26 +660,26 @@ protected: #ifndef SWIG -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_BUTTON; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_END_DRAG; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BUTTON, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, wxAuiNotebookEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_AUI, wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, wxAuiNotebookEvent) typedef void (wxEvtHandler::*wxAuiNotebookEventFunction)(wxAuiNotebookEvent&); #define wxAuiNotebookEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiNotebookEventFunction, &func) + wxEVENT_HANDLER_CAST(wxAuiNotebookEventFunction, func) #define EVT_AUINOTEBOOK_PAGE_CLOSE(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, winid, wxAuiNotebookEventHandler(fn)) diff --git a/include/wx/aui/framemanager.h b/include/wx/aui/framemanager.h index 42028d8846..056feb56b6 100644 --- a/include/wx/aui/framemanager.h +++ b/include/wx/aui/framemanager.h @@ -805,17 +805,17 @@ public: #ifndef SWIG -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_AUI_PANE_BUTTON; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_AUI_PANE_CLOSE; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_AUI_PANE_MAXIMIZE; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_AUI_PANE_RESTORE; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_AUI_RENDER; -extern WXDLLIMPEXP_AUI const wxEventType wxEVT_AUI_FIND_MANAGER; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_BUTTON, wxAuiManagerEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_CLOSE, wxAuiManagerEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_MAXIMIZE, wxAuiManagerEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_PANE_RESTORE, wxAuiManagerEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_RENDER, wxAuiManagerEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_AUI, wxEVT_AUI_FIND_MANAGER, wxAuiManagerEvent ) typedef void (wxEvtHandler::*wxAuiManagerEventFunction)(wxAuiManagerEvent&); #define wxAuiManagerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxAuiManagerEventFunction, &func) + wxEVENT_HANDLER_CAST(wxAuiManagerEventFunction, func) #define EVT_AUI_PANE_BUTTON(func) \ wx__DECLARE_EVT0(wxEVT_AUI_PANE_BUTTON, wxAuiManagerEventHandler(func)) diff --git a/include/wx/bookctrl.h b/include/wx/bookctrl.h index 005ef42c3c..9085595d68 100644 --- a/include/wx/bookctrl.h +++ b/include/wx/bookctrl.h @@ -382,7 +382,7 @@ private: typedef void (wxEvtHandler::*wxBookCtrlEventFunction)(wxBookCtrlEvent&); #define wxBookCtrlEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxBookCtrlEventFunction, &func) + wxEVENT_HANDLER_CAST(wxBookCtrlEventFunction, func) // obsolete name, defined for compatibility only #define wxBookCtrlBaseEvent wxBookCtrlEvent diff --git a/include/wx/calctrl.h b/include/wx/calctrl.h index 549f85f253..64cea8b888 100644 --- a/include/wx/calctrl.h +++ b/include/wx/calctrl.h @@ -360,20 +360,20 @@ protected: // calendar event types and macros for handling them // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_CALENDAR_SEL_CHANGED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_CALENDAR_PAGE_CHANGED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_CALENDAR_DOUBLECLICKED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_CALENDAR_WEEKDAY_CLICKED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALENDAR_PAGE_CHANGED, wxCalendarEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALENDAR_DOUBLECLICKED, wxCalendarEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALENDAR_WEEKDAY_CLICKED, wxCalendarEvent ) // deprecated events -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_CALENDAR_DAY_CHANGED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_CALENDAR_MONTH_CHANGED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_CALENDAR_YEAR_CHANGED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALENDAR_DAY_CHANGED, wxCalendarEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALENDAR_MONTH_CHANGED, wxCalendarEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALENDAR_YEAR_CHANGED, wxCalendarEvent ) typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&); #define wxCalendarEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCalendarEventFunction, &func) + wxEVENT_HANDLER_CAST(wxCalendarEventFunction, func) #define wx__DECLARE_CALEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_CALENDAR_ ## evt, id, wxCalendarEventHandler(fn)) diff --git a/include/wx/choicebk.h b/include/wx/choicebk.h index d85f1f5c4c..8519a6bf2e 100644 --- a/include/wx/choicebk.h +++ b/include/wx/choicebk.h @@ -21,8 +21,8 @@ class WXDLLIMPEXP_FWD_CORE wxChoice; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, wxBookCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, wxBookCtrlEvent ) // wxChoicebook flags #define wxCHB_DEFAULT wxBK_DEFAULT diff --git a/include/wx/clipbrd.h b/include/wx/clipbrd.h index b00b6bdd4a..76371170c3 100644 --- a/include/wx/clipbrd.h +++ b/include/wx/clipbrd.h @@ -120,12 +120,12 @@ private: DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxClipboardEvent) }; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CLIPBOARD_CHANGED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CLIPBOARD_CHANGED, wxClipboardEvent ) typedef void (wxEvtHandler::*wxClipboardEventFunction)(wxClipboardEvent&); #define wxClipboardEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxClipboardEventFunction, &func) + wxEVENT_HANDLER_CAST(wxClipboardEventFunction, func) #define EVT_CLIPBOARD_CHANGED(func) wx__DECLARE_EVT0(wxEVT_CLIPBOARD_CHANGED, wxClipboardEventHandler(func)) diff --git a/include/wx/clrpicker.h b/include/wx/clrpicker.h index 59edfe8436..d18307dbba 100644 --- a/include/wx/clrpicker.h +++ b/include/wx/clrpicker.h @@ -160,7 +160,7 @@ private: // wxColourPickerEvent: used by wxColourPickerCtrl only // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_COLOURPICKER_CHANGED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_COLOURPICKER_CHANGED, wxColourPickerEvent ) class WXDLLIMPEXP_CORE wxColourPickerEvent : public wxCommandEvent { @@ -193,7 +193,7 @@ private: typedef void (wxEvtHandler::*wxColourPickerEventFunction)(wxColourPickerEvent&); #define wxColourPickerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxColourPickerEventFunction, &func) + wxEVENT_HANDLER_CAST(wxColourPickerEventFunction, func) #define EVT_COLOURPICKER_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_COLOURPICKER_CHANGED, id, wxColourPickerEventHandler(fn)) diff --git a/include/wx/collpane.h b/include/wx/collpane.h index e2278e4ee8..7ab04a13cb 100644 --- a/include/wx/collpane.h +++ b/include/wx/collpane.h @@ -51,7 +51,9 @@ public: // event types and macros // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_COLLPANE_CHANGED; +class WXDLLIMPEXP_FWD_CORE wxCollapsiblePaneEvent; + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_COLLPANE_CHANGED, wxCollapsiblePaneEvent ) class WXDLLIMPEXP_CORE wxCollapsiblePaneEvent : public wxCommandEvent { @@ -84,7 +86,7 @@ private: typedef void (wxEvtHandler::*wxCollapsiblePaneEventFunction)(wxCollapsiblePaneEvent&); #define wxCollapsiblePaneEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCollapsiblePaneEventFunction, &func) + wxEVENT_HANDLER_CAST(wxCollapsiblePaneEventFunction, func) #define EVT_COLLAPSIBLEPANE_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_COLLPANE_CHANGED, id, wxCollapsiblePaneEventHandler(fn)) diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 4c09225ef0..fee4defdf7 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -796,28 +796,28 @@ private: DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewEvent) }; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEvent ) -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEvent ) -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEvent ) -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, wxDataViewEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED, wxDataViewEvent ) typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&); #define wxDataViewEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDataViewEventFunction, &func) + wxEVENT_HANDLER_CAST(wxDataViewEventFunction, func) #define wx__DECLARE_DATAVIEWEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_DATAVIEW_ ## evt, id, wxDataViewEventHandler(fn)) diff --git a/include/wx/dateevt.h b/include/wx/dateevt.h index 2175fb2568..ec225fad75 100644 --- a/include/wx/dateevt.h +++ b/include/wx/dateevt.h @@ -47,12 +47,12 @@ private: // event types and macros for handling them // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_DATE_CHANGED; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_ADV, wxEVT_DATE_CHANGED, wxDateEvent) typedef void (wxEvtHandler::*wxDateEventFunction)(wxDateEvent&); #define wxDateEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDateEventFunction, &func) + wxEVENT_HANDLER_CAST(wxDateEventFunction, func) #define EVT_DATE_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_DATE_CHANGED, id, wxDateEventHandler(fn)) diff --git a/include/wx/dialup.h b/include/wx/dialup.h index 73819e1df8..85587ae57c 100644 --- a/include/wx/dialup.h +++ b/include/wx/dialup.h @@ -152,8 +152,10 @@ public: // wxDialUpManager events // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DIALUP_CONNECTED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DIALUP_DISCONNECTED; +class WXDLLIMPEXP_FWD_CORE wxDialUpEvent; + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIALUP_CONNECTED, wxDialUpEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIALUP_DISCONNECTED, wxDialUpEvent ) // the event class for the dialup events class WXDLLIMPEXP_CORE wxDialUpEvent : public wxEvent @@ -185,7 +187,7 @@ private: typedef void (wxEvtHandler::*wxDialUpEventFunction)(wxDialUpEvent&); #define wxDialUpEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDialUpEventFunction, &func) + wxEVENT_HANDLER_CAST(wxDialUpEventFunction, func) // macros to catch dialup events #define EVT_DIALUP_CONNECTED(func) \ diff --git a/include/wx/event.h b/include/wx/event.h index a1676933ff..8b51764f1c 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -32,6 +32,7 @@ // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxList; +class WXDLLIMPEXP_FWD_BASE wxEvent; #if wxUSE_GUI class WXDLLIMPEXP_FWD_CORE wxDC; class WXDLLIMPEXP_FWD_CORE wxMenu; @@ -72,7 +73,10 @@ typedef int wxEventType; #define wxStaticCastEvent(type, val) static_cast(val) #define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \ - wxEventTableEntry(type, winid, idLast, fn, obj) + wxEventTableEntry(type, winid, idLast, wxNewEventFunctor(type, fn), obj) + +#define DECLARE_EVENT_TABLE_TERMINATOR() \ + wxEventTableEntry(wxEVT_NULL, 0, 0, 0, 0) // obsolete event declaration/definition macros, we don't need them any longer // but we keep them for compatibility as it doesn't cost us anything anyhow @@ -90,6 +94,387 @@ typedef int wxEventType; // generate a new unique event type extern WXDLLIMPEXP_BASE wxEventType wxNewEventType(); +// macros to create an event type depending on whether type safe events are +// enabled. + +#if wxEVENTS_COMPATIBILITY_2_8 + #define wxDEFINE_EVENT( name, type ) \ + const wxEventType name( wxNewEventType() ); + + #define wxDECLARE_EXPORTED_EVENT( expdecl, name, type ) \ + extern const expdecl wxEventType name; + + #define wxDEFINE_EVENT_REFERENCE( name, type, value ) \ + const wxEventType &name( value ); + + #define wxDECLARE_EXPORTED_EVENT_REFERENCE( expdecl, name, type ) \ + extern const expdecl wxEventType &name; + + #define wxDECLARE_LOCAL_EVENT( name, type ) \ + wxDECLARE_EXPORTED_EVENT( wxEMPTY_PARAMETER_VALUE, name, type ) + + #define wxEVENT_HANDLER_CAST( functype, func ) \ + ( wxObjectEventFunction )( wxEventFunction )wxStaticCastEvent( functype, &func ) +#else + #define wxDEFINE_EVENT( name, type ) \ + const wxTypedEventType< type > name( wxNewEventType() ); + + #define wxDECLARE_EXPORTED_EVENT( expdecl, name, type ) \ + extern const expdecl wxTypedEventType< type > name; + + #define wxDEFINE_EVENT_REFERENCE( name, type, value ) \ + const wxTypedEventTypeReference< type > name( value ); + + #define wxDECLARE_EXPORTED_EVENT_REFERENCE( expdecl, name, type ) \ + extern const expdecl wxTypedEventTypeReference< type > name; + + #define wxDECLARE_LOCAL_EVENT( name, type ) \ + wxDECLARE_EXPORTED_EVENT( wxEMPTY_PARAMETER_VALUE, name, type ) + + #define wxEVENT_HANDLER_CAST( functype, func ) \ + ( &func ) +#endif + +// template which associates the correct event object with the event type + +#if !wxEVENTS_COMPATIBILITY_2_8 + +template +class WXDLLIMPEXP_BASE wxTypedEventType +{ +public: + typedef Event CorrespondingEvent; + + wxTypedEventType(wxEventType type) { m_type = type; } + + // used for static event tables + operator const wxEventType&() const { return m_type; } + +private: + wxEventType m_type; +}; + +// Due to a bug in older wx versions wxSpinEvents were being sent with type of +// wxEVT_SCROLL_LINEUP, wxEVT_SCROLL_LINEDOWN and wxEVT_SCROLL_THUMBTRACK. But +// with the type-safe events in place, these event types are associated with +// wxScrollEvent. To allow handling of spin events, new event types have been +// defined in spinbutt.h/spinnbuttcmn.cpp. To maintain backward compatibility +// the spin event types are being initialized with the scroll event types. But +// this presents as with the same static initialization order problem we also +// have for the static event tables. So we use the same solution and the +// template definition below holds a reference to a wxEventType. +template +class WXDLLIMPEXP_BASE wxTypedEventTypeReference +{ +public: + typedef Event CorrespondingEvent; + + wxTypedEventTypeReference(const wxEventType& type) : m_type(type) { } + + // used for static event tables + operator const wxEventType&() const { return m_type; } + +private: + const wxEventType &m_type; +}; + +#endif // !wxEVENTS_COMPATIBILITY_2_8 + +// These are needed for the functor definitions +typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&); + +// We had some trouble (specifically with eVC for ARM WinCE build) with using +// wxEventFunction in the past so we had introduced wxObjectEventFunction which +// used to be a typedef for a member of wxObject and not wxEvtHandler to work +// around this but as eVC is not really supported any longer we now only keep +// this for backwards compatibility and, despite its name, this is a typedef +// for wxEvtHandler member now -- but if we have the same problem with another +// compiler we can restore its old definition for it. +typedef wxEventFunction wxObjectEventFunction; + + +// the functors which will be stored in the static/dynamic tables +class WXDLLIMPEXP_BASE wxEventFunctor +{ +public: + virtual ~wxEventFunctor(); + + virtual void operator()(wxEvtHandler *, wxEvent &) = 0; + + virtual bool operator==(const wxEventFunctor& other) const = 0; + + virtual wxEvtHandler *GetHandler() const { return NULL; } + + virtual wxObjectEventFunction GetMethod() const { return NULL; } +}; + +// A plain method functor +class WXDLLIMPEXP_BASE wxObjectEventFunctor : public wxEventFunctor +{ +public: + wxObjectEventFunctor(wxObjectEventFunction method, wxEvtHandler *handler) + { + m_handler = handler; + m_method = method; + } + + virtual void operator()(wxEvtHandler *handler, wxEvent& event) + { + wxEvtHandler * const realHandler = m_handler ? m_handler : handler; + + (realHandler->*m_method)(event); + } + + virtual bool operator==(const wxEventFunctor& other) const + { + wxEvtHandler * const handler = other.GetHandler(); + const wxObjectEventFunction method = other.GetMethod(); + + return (m_handler == handler || !handler) && + (m_method == method || !method); + } + + virtual wxEvtHandler *GetHandler() const { return m_handler; } + virtual wxObjectEventFunction GetMethod() const { return m_method; } + +private: + wxEvtHandler *m_handler; + wxObjectEventFunction m_method; +}; + +#if !wxEVENTS_COMPATIBILITY_2_8 + +template +class WXDLLIMPEXP_BASE wxEventFunctorFunction : public wxEventFunctor +{ +public: + wxEventFunctorFunction(void (*handler)(typename EventType::CorrespondingEvent &)) + { + m_handler = handler; + } + + virtual void operator()(wxEvtHandler *WXUNUSED(handler), wxEvent& event) + { + // Protect against wrong event i.e. wxMouseEvent evt(wxEVT_PAINT): + wxASSERT( dynamic_cast< typename EventType::CorrespondingEvent * >( &event ) != NULL ); + + // Will throw a std::bad_cast exception in release build: + ( *m_handler )( dynamic_cast< typename EventType::CorrespondingEvent & >( event )); + } + + virtual bool operator == ( const wxEventFunctor &right ) const + { + wxEventFunctorFunction const &other = dynamic_cast< wxEventFunctorFunction const & >( right ); + + return m_handler == other.m_handler || other.m_handler == NULL; + } + +private: + void ( *m_handler )( typename EventType::CorrespondingEvent & ); +}; + + +template +class WXDLLIMPEXP_BASE wxEventFunctorMethod : public wxEventFunctor +{ +public: + wxEventFunctorMethod( void ( Class::*method )( typename EventType::CorrespondingEvent & ), + Derived *handler ) + { + m_handler = handler; + m_method = method; + } + + virtual void operator () ( wxEvtHandler *handler, wxEvent &event ) + { + // Compile-time type check 1: This requires Derived to derive from or + // be of the same type as Class + Class *realHandler = m_handler; + + if( m_handler == NULL ) + { + // Verify that the handler does indeed derive from the class + // containing the handler method + wxASSERT( dynamic_cast< Class * >( handler) != NULL ); + + realHandler = dynamic_cast< Class * >( handler ); + } + + // Protect against wrong event i.e. wxMouseEvent evt(wxEVT_PAINT): + wxASSERT( dynamic_cast< typename EventType::CorrespondingEvent * >( &event ) != NULL ); + + // Will throw a std::bad_cast exception in release build: + ( realHandler->*m_method )( dynamic_cast< typename EventType::CorrespondingEvent & >( event )); + } + + virtual bool operator == ( const wxEventFunctor &right ) const + { + wxEventFunctorMethod const &other = dynamic_cast< wxEventFunctorMethod const & >( right ); + + return (( m_handler == other.m_handler || other.m_handler == NULL ) && + ( m_method == other.m_method || other.m_method == NULL )); + } + + virtual wxEvtHandler *GetHandler() const + { + // This makes sure Derived derives from wxEvtHandler (it is still + // possible and even ok if Class does not derive from wxEvtHandler. In + // this case Derived would end up using multiple inheritance: class + // Derived : public wxEvtHandler, public Class { } where Class contains + // the method to call, but wxEvtHandler contains the wxTrackable and + // code for weak ref support + return m_handler; + } + + virtual wxObjectEventFunction GetMethod() const + { + return reinterpret_cast(m_method); + } + +private: + Derived *m_handler; + void (Class::*m_method)(typename EventType::CorrespondingEvent&); +}; + + +template +class WXDLLIMPEXP_BASE wxEventFunctorAdapter : public wxEventFunctor +{ +public: + wxEventFunctorAdapter( Functor &functor ) + { + m_functor = functor; + } + + virtual void operator () ( wxEvtHandler *WXUNUSED( handler ), wxEvent &event ) + { + // Protect against wrong event i.e. wxMouseEvent evt(wxEVT_PAINT): + wxASSERT( dynamic_cast< typename EventType::CorrespondingEvent * >( &event ) != NULL ); + + // Will throw a std::bad_cast exception in release build: + m_functor( dynamic_cast< typename EventType::CorrespondingEvent & >( event )); + } + + virtual bool operator == ( const wxEventFunctor &right ) const + { + wxEventFunctorAdapter const &other = dynamic_cast< wxEventFunctorAdapter const & >( right ); + + return m_functor == other.m_functor; + } + +private: + Functor m_functor; +}; + +#endif // wxEVENTS_COMPATIBILITY_2_8 + +// Create a functor for the legacy events: + +inline wxObjectEventFunctor * +wxNewEventFunctor(wxEventType WXUNUSED(evtType), + wxObjectEventFunction method, + wxEvtHandler *handler = NULL) +{ + return new wxObjectEventFunctor(method, handler); +} + +inline wxObjectEventFunctor +wxConstructEventFunctor(wxEventType WXUNUSED(evtType), + wxObjectEventFunction method, + wxEvtHandler *handler = NULL) +{ + return wxObjectEventFunctor(method, handler); +} + +#if !wxEVENTS_COMPATIBILITY_2_8 + +// +// Create functors for the templatized events (needed in wxEvtHandler::Connect): +// + +// Create a functor for functions: + +template +inline wxEventFunctorFunction * +wxNewEventFunctor(const EventType &, + void (*function)(typename EventType::CorrespondingEvent&)) +{ + return new wxEventFunctorFunction(function); +} + +// Create a functor for methods: + +template +inline wxEventFunctorMethod * +wxNewEventFunctor(const EventType &, + void (Class::*method)(typename EventType::CorrespondingEvent&)) +{ + return new wxEventFunctorMethod(method, NULL); +} + +template +inline wxEventFunctorMethod * +wxNewEventFunctor(const EventType &, + void (Class::*method)(typename EventType::CorrespondingEvent &), + Derived *handler ) +{ + return new wxEventFunctorMethod(method, handler); +} + +// Create a functor for arbitrary functors (like boost::function): +template +inline wxEventFunctorAdapter * +wxNewEventFunctor(const EventType &, + Functor& functor ) +{ + return new wxEventFunctorAdapter(functor); +} + +// +// Construct functors for the templatized events (needed in wxEvtHandler::Disconnect): +// + +// Construct a functor for functions: + +template +inline wxEventFunctorFunction +wxConstructEventFunctor(const EventType &, + void (*function)(typename EventType::CorrespondingEvent&)) +{ + return wxEventFunctorFunction(function); +} + +// Construct a functor for methods: + +template +inline wxEventFunctorMethod +wxConstructEventFunctor(const EventType &, + void (Class::*method)(typename EventType::CorrespondingEvent&)) +{ + return wxEventFunctorMethod(method, NULL); +} + +template +inline wxEventFunctorMethod +wxConstructEventFunctor(const EventType &, + void (Class::*method)(typename EventType::CorrespondingEvent&), + Derived *handler) +{ + return wxEventFunctorMethod(method, handler); +} + +// Construct a functor for arbitrary functors (like boost:function): + +template +inline wxEventFunctorAdapter +wxConstructEventFunctor(const EventType &, + Functor& functor) +{ + return wxEventFunctorAdapter(functor); +} + +#endif // !wxEVENTS_COMPATIBILITY_2_8 + // many, but not all, standard event types // some generic events @@ -97,166 +482,180 @@ extern WXDLLIMPEXP_BASE const wxEventType wxEVT_NULL; extern WXDLLIMPEXP_BASE const wxEventType wxEVT_FIRST; extern WXDLLIMPEXP_BASE const wxEventType wxEVT_USER_FIRST; + // Need events declared to do this +class WXDLLIMPEXP_FWD_CORE wxCommandEvent; +class WXDLLIMPEXP_FWD_CORE wxMouseEvent; +class WXDLLIMPEXP_FWD_CORE wxFocusEvent; +class WXDLLIMPEXP_FWD_CORE wxChildFocusEvent; +class WXDLLIMPEXP_FWD_CORE wxKeyEvent; +class WXDLLIMPEXP_FWD_CORE wxNavigationKeyEvent; +class WXDLLIMPEXP_FWD_CORE wxSetCursorEvent; +class WXDLLIMPEXP_FWD_CORE wxScrollEvent; +class WXDLLIMPEXP_FWD_CORE wxScrollWinEvent; +class WXDLLIMPEXP_FWD_CORE wxSizeEvent; +class WXDLLIMPEXP_FWD_CORE wxMoveEvent; +class WXDLLIMPEXP_FWD_CORE wxCloseEvent; +class WXDLLIMPEXP_FWD_CORE wxActivateEvent; +class WXDLLIMPEXP_FWD_CORE wxWindowCreateEvent; +class WXDLLIMPEXP_FWD_CORE wxWindowDestroyEvent; +class WXDLLIMPEXP_FWD_CORE wxShowEvent; +class WXDLLIMPEXP_FWD_CORE wxIconizeEvent; +class WXDLLIMPEXP_FWD_CORE wxMaximizeEvent; +class WXDLLIMPEXP_FWD_CORE wxMouseCaptureChangedEvent; +class WXDLLIMPEXP_FWD_CORE wxMouseCaptureLostEvent; +class WXDLLIMPEXP_FWD_CORE wxPaintEvent; +class WXDLLIMPEXP_FWD_CORE wxEraseEvent; +class WXDLLIMPEXP_FWD_CORE wxNcPaintEvent; +class WXDLLIMPEXP_FWD_CORE wxMenuEvent; +class WXDLLIMPEXP_FWD_CORE wxContextMenuEvent; +class WXDLLIMPEXP_FWD_CORE wxSysColourChangedEvent; +class WXDLLIMPEXP_FWD_CORE wxDisplayChangedEvent; +class WXDLLIMPEXP_FWD_CORE wxQueryNewPaletteEvent; +class WXDLLIMPEXP_FWD_CORE wxPaletteChangedEvent; +class WXDLLIMPEXP_FWD_CORE wxJoystickEvent; +class WXDLLIMPEXP_FWD_CORE wxDropFilesEvent; +class WXDLLIMPEXP_FWD_CORE wxInitDialogEvent; +class WXDLLIMPEXP_FWD_CORE wxIdleEvent; +class WXDLLIMPEXP_FWD_CORE wxUpdateUIEvent; +class WXDLLIMPEXP_FWD_CORE wxClipboardTextEvent; +class WXDLLIMPEXP_FWD_CORE wxHelpEvent; + + // Command events -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_BUTTON_CLICKED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHECKBOX_CLICKED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHOICE_SELECTED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOX_SELECTED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOX_DOUBLECLICKED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_CHECKLISTBOX_TOGGLED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_MENU_SELECTED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SLIDER_UPDATED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_RADIOBOX_SELECTED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_RADIOBUTTON_SELECTED; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SLIDER_UPDATED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEvent) // wxEVT_COMMAND_SCROLLBAR_UPDATED is deprecated, use wxEVT_SCROLL... events -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SCROLLBAR_UPDATED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_VLBOX_SELECTED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_COMBOBOX_SELECTED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOL_RCLICKED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOL_ENTER; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SPINCTRL_UPDATED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED; - - // Sockets and timers send events, too -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_SOCKET; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_TIMER; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SCROLLBAR_UPDATED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_VLBOX_SELECTED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOL_RCLICKED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOL_ENTER, wxCommandEvent) // Mouse event types -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_LEFT_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_LEFT_UP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MIDDLE_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MIDDLE_UP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_RIGHT_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_RIGHT_UP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOTION; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ENTER_WINDOW; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_LEAVE_WINDOW; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_LEFT_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MIDDLE_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_RIGHT_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SET_FOCUS; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_KILL_FOCUS; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CHILD_FOCUS; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOUSEWHEEL; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX1_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX1_UP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX1_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX2_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX2_UP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_AUX2_DCLICK; - - // Non-client mouse events -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_LEFT_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_LEFT_UP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_MIDDLE_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_MIDDLE_UP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_RIGHT_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_RIGHT_UP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_MOTION; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_ENTER_WINDOW; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_LEAVE_WINDOW; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_LEFT_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_MIDDLE_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_RIGHT_DCLICK; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEFT_DOWN, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEFT_UP, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MIDDLE_DOWN, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MIDDLE_UP, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RIGHT_DOWN, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RIGHT_UP, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOTION, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ENTER_WINDOW, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEAVE_WINDOW, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEFT_DCLICK, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MIDDLE_DCLICK, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RIGHT_DCLICK, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SET_FOCUS, wxFocusEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_KILL_FOCUS, wxFocusEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHILD_FOCUS, wxChildFocusEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOUSEWHEEL, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_DOWN, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_UP, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_DCLICK, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DOWN, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_UP, wxMouseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DCLICK, wxMouseEvent) // Character input event type -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CHAR; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CHAR_HOOK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NAVIGATION_KEY; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_KEY_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_KEY_UP; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHAR, wxKeyEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHAR_HOOK, wxKeyEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_NAVIGATION_KEY, wxNavigationKeyEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_KEY_DOWN, wxKeyEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_KEY_UP, wxKeyEvent) #if wxUSE_HOTKEY -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_HOTKEY; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_HOTKEY, wxKeyEvent) #endif // Set cursor event -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SET_CURSOR; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SET_CURSOR, wxSetCursorEvent) // wxScrollBar and wxSlider event identifiers -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_TOP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_BOTTOM; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_LINEUP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_LINEDOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_PAGEUP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_PAGEDOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_THUMBTRACK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_THUMBRELEASE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLL_CHANGED; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_TOP, wxScrollEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_BOTTOM, wxScrollEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_LINEUP, wxScrollEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_LINEDOWN, wxScrollEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_PAGEUP, wxScrollEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_PAGEDOWN, wxScrollEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_THUMBTRACK, wxScrollEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_THUMBRELEASE, wxScrollEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_CHANGED, wxScrollEvent) // Scroll events from wxWindow -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_TOP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_BOTTOM; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_LINEUP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_LINEDOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_PAGEUP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_PAGEDOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_THUMBTRACK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SCROLLWIN_THUMBRELEASE; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_TOP, wxScrollWinEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_BOTTOM, wxScrollWinEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_LINEUP, wxScrollWinEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_LINEDOWN, wxScrollWinEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_PAGEUP, wxScrollWinEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_PAGEDOWN, wxScrollWinEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_THUMBTRACK, wxScrollWinEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_THUMBRELEASE, wxScrollWinEvent) // System events -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SIZE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOVE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CLOSE_WINDOW; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_END_SESSION; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_QUERY_END_SESSION; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ACTIVATE_APP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ACTIVATE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CREATE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DESTROY; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SHOW; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ICONIZE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MAXIMIZE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOUSE_CAPTURE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOUSE_CAPTURE_LOST; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_PAINT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_ERASE_BACKGROUND; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_NC_PAINT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_PAINT_ICON; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MENU_OPEN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MENU_CLOSE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MENU_HIGHLIGHT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_CONTEXT_MENU; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SYS_COLOUR_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DISPLAY_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SETTING_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_QUERY_NEW_PALETTE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_PALETTE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_JOY_BUTTON_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_JOY_BUTTON_UP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_JOY_MOVE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_JOY_ZMOVE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DROP_FILES; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DRAW_ITEM; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MEASURE_ITEM; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMPARE_ITEM; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_INIT_DIALOG; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_IDLE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_UPDATE_UI; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_SIZING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOVING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOVE_START; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_MOVE_END; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_HIBERNATE; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SIZE, wxSizeEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOVE, wxMoveEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CLOSE_WINDOW, wxCloseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_END_SESSION, wxCloseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_QUERY_END_SESSION, wxCloseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ACTIVATE_APP, wxActivateEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ACTIVATE, wxActivateEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CREATE, wxWindowCreateEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_DESTROY, wxWindowDestroyEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SHOW, wxShowEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ICONIZE, wxIconizeEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MAXIMIZE, wxMaximizeEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOUSE_CAPTURE_CHANGED, wxMouseCaptureChangedEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_PAINT, wxPaintEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ERASE_BACKGROUND, wxEraseEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_NC_PAINT, wxNcPaintEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MENU_OPEN, wxMenuEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MENU_CLOSE, wxMenuEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MENU_HIGHLIGHT, wxMenuEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CONTEXT_MENU, wxContextMenuEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SYS_COLOUR_CHANGED, wxSysColourChangedEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_DISPLAY_CHANGED, wxDisplayChangedEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_QUERY_NEW_PALETTE, wxQueryNewPaletteEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_PALETTE_CHANGED, wxPaletteChangedEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_JOY_BUTTON_DOWN, wxJoystickEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_JOY_BUTTON_UP, wxJoystickEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_JOY_MOVE, wxJoystickEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_JOY_ZMOVE, wxJoystickEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_DROP_FILES, wxDropFilesEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_INIT_DIALOG, wxInitDialogEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_BASE, wxEVT_IDLE, wxIdleEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_UPDATE_UI, wxUpdateUIEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SIZING, wxSizeEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOVING, wxMoveEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOVE_START, wxMoveEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOVE_END, wxMoveEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_HIBERNATE, wxActivateEvent) // Clipboard events -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_COPY; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_CUT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_PASTE; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_COPY, wxClipboardTextEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_CUT, wxClipboardTextEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_PASTE, wxClipboardTextEvent) // Generic command events // Note: a click is a higher-level event than button down/up -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LEFT_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LEFT_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_RIGHT_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_RIGHT_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SET_FOCUS; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_KILL_FOCUS; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_ENTER; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_LEFT_CLICK, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_LEFT_DCLICK, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_RIGHT_CLICK, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_RIGHT_DCLICK, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SET_FOCUS, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_KILL_FOCUS, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_ENTER, wxCommandEvent) // Help events -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_HELP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DETAILED_HELP; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_HELP, wxHelpEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_DETAILED_HELP, wxHelpEvent) // these 2 events are the same #define wxEVT_COMMAND_TOOL_CLICKED wxEVT_COMMAND_MENU_SELECTED @@ -269,7 +668,7 @@ extern WXDLLIMPEXP_CORE const wxEventType wxEVT_DETAILED_HELP; // wx/textctrl.h in all ports [yet], so declare it here as well // // still, any new code using it should include wx/textctrl.h explicitly -extern const wxEventType WXDLLIMPEXP_CORE wxEVT_COMMAND_TEXT_UPDATED; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEvent) // the predefined constants for the number of times we propagate event // upwards window child-parent chain @@ -2074,57 +2473,59 @@ private: // event handler and related classes // ============================================================================ -typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&); - -// We had some trouble (specifically with eVC for ARM WinCE build) with using -// wxEventFunction in the past so we had introduced wxObjectEventFunction which -// used to be a typedef for a member of wxObject and not wxEvtHandler to work -// around this but as eVC is not really supported any longer we now only keep -// this for backwards compatibility and, despite its name, this is a typedef -// for wxEvtHandler member now -- but if we have the same problem with another -// compiler we can restore its old definition for it. -typedef wxEventFunction wxObjectEventFunction; // struct containing the members common to static and dynamic event tables // entries struct WXDLLIMPEXP_BASE wxEventTableEntryBase { -private: - wxEventTableEntryBase& operator=(const wxEventTableEntryBase& event); - -public: wxEventTableEntryBase(int winid, int idLast, - wxObjectEventFunction fn, wxObject *data) + wxEventFunctor* fn, wxObject *data) : m_id(winid), m_lastId(idLast), m_fn(fn), m_callbackUserData(data) { } - wxEventTableEntryBase(const wxEventTableEntryBase& event) - : m_id(event.m_id), - m_lastId(event.m_lastId), - m_fn(event.m_fn), - m_callbackUserData(event.m_callbackUserData) - { } + wxEventTableEntryBase( const wxEventTableEntryBase &entry ) + : m_id( entry.m_id ), + m_lastId( entry.m_lastId ), + m_fn( entry.m_fn ), + m_callbackUserData( entry.m_callbackUserData ) + { + // This is a 'hack' to ensure that only one instance tries to delete + // the functor pointer. It is safe as long as the only place where the + // copy constructor is being called is when the static event tables are + // being initialized (a temporary instance is created and then this + // constructor is called). + + const_cast< wxEventTableEntryBase & >( entry ).m_fn = NULL; + } + + ~wxEventTableEntryBase() + { + wxDELETE( m_fn ); + } // the range of ids for this entry: if m_lastId == wxID_ANY, the range // consists only of m_id, otherwise it is m_id..m_lastId inclusive int m_id, m_lastId; - // function to call: not wxEventFunction, because of dependency problems - wxObjectEventFunction m_fn; + // function/method/functor to call + wxEventFunctor* m_fn; - // arbitrary user data asosciated with the callback + // arbitrary user data associated with the callback wxObject* m_callbackUserData; + +private: + wxEventTableEntryBase &operator = ( const wxEventTableEntryBase & ); }; // an entry from a static event table struct WXDLLIMPEXP_BASE wxEventTableEntry : public wxEventTableEntryBase { wxEventTableEntry(const int& evType, int winid, int idLast, - wxObjectEventFunction fn, wxObject *data) + wxEventFunctor* fn, wxObject *data) : wxEventTableEntryBase(winid, idLast, fn, data), m_eventType(evType) { } @@ -2138,17 +2539,16 @@ struct WXDLLIMPEXP_BASE wxEventTableEntry : public wxEventTableEntryBase const int& m_eventType; private: - wxEventTableEntry& operator=(const wxEventTableEntry&); + wxEventTableEntry &operator = ( const wxEventTableEntry & ); }; // an entry used in dynamic event table managed by wxEvtHandler::Connect() struct WXDLLIMPEXP_BASE wxDynamicEventTableEntry : public wxEventTableEntryBase { wxDynamicEventTableEntry(int evType, int winid, int idLast, - wxObjectEventFunction fn, wxObject *data, wxEvtHandler* eventSink) + wxEventFunctor* fn, wxObject *data) : wxEventTableEntryBase(winid, idLast, fn, data), - m_eventType(evType), - m_eventSink(eventSink) + m_eventType(evType) { } // not a reference here as we can't keep a reference to a temporary int @@ -2156,12 +2556,8 @@ struct WXDLLIMPEXP_BASE wxDynamicEventTableEntry : public wxEventTableEntryBase // do we need it int m_eventType; - // Pointer to object whose function is fn - so we don't assume the - // EventFunction is always a member of the EventHandler receiving the - // message - wxEvtHandler* m_eventSink; - - DECLARE_NO_COPY_CLASS(wxDynamicEventTableEntry) +private: + wxDynamicEventTableEntry &operator = ( const wxDynamicEventTableEntry & ); }; // ---------------------------------------------------------------------------- @@ -2300,7 +2696,12 @@ public: wxEventType eventType, wxObjectEventFunction func, wxObject *userData = (wxObject *) NULL, - wxEvtHandler *eventSink = (wxEvtHandler *) NULL); + wxEvtHandler *eventSink = (wxEvtHandler *) NULL) + { + wxObjectEventFunctor *functor = wxNewEventFunctor( eventType, func, eventSink ); + + Subscribe( winid, lastId, eventType, functor, userData ); + } // Convenience function: take just one id void Connect(int winid, @@ -2322,7 +2723,12 @@ public: wxEventType eventType, wxObjectEventFunction func = NULL, wxObject *userData = (wxObject *) NULL, - wxEvtHandler *eventSink = (wxEvtHandler *) NULL); + wxEvtHandler *eventSink = (wxEvtHandler *) NULL) + { + wxObjectEventFunctor functor = wxConstructEventFunctor( eventType, func, eventSink ); + + return Unsubscribe( winid, lastId, eventType, functor, userData ); + } bool Disconnect(int winid = wxID_ANY, wxEventType eventType = wxEVT_NULL, @@ -2337,6 +2743,309 @@ public: wxEvtHandler *eventSink = (wxEvtHandler *) NULL) { return Disconnect(wxID_ANY, eventType, func, userData, eventSink); } + +#if !wxEVENTS_COMPATIBILITY_2_8 + // + // Connect a function to an event: + // + template + void Connect(int winid, + int lastId, + const EventType &eventType, + void (*func)(typename EventType::CorrespondingEvent&), + wxObject* userData = NULL) + { + wxEventFunctorFunction< EventType > *functor = wxNewEventFunctor( eventType, func ); + + Subscribe( winid, lastId, eventType, functor, userData ); + } + + template + void Connect( int winid, + const EventType &eventType, + void ( *func )( typename EventType::CorrespondingEvent & ), + wxObject* userData = NULL ) + { Connect( winid, wxID_ANY, eventType, func, userData ); } + + template + void Connect( const EventType &eventType, + void ( *func )( typename EventType::CorrespondingEvent & ), + wxObject* userData = NULL ) + { Connect( wxID_ANY, wxID_ANY, eventType, func, userData ); } + + // + // Connect a method to an event: + // + + template + void Connect( int winid, + int lastId, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL ) + { + wxEventFunctorMethod< EventType, Class, Class > *functor = + wxNewEventFunctor( eventType, func, static_cast< Class * const >( this )); + + Subscribe( winid, lastId, eventType, functor, userData ); + } + + template + void Connect( int winid, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL ) + { Connect( winid, wxID_ANY, eventType, func, userData ); } + + template + void Connect( const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL ) + { Connect( wxID_ANY, wxID_ANY, eventType, func, userData ); } + + template + void Connect( int winid, + int lastId, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { + wxEventFunctorMethod< EventType, Class, Derived > *functor = + wxNewEventFunctor( eventType, func, eventSink ); + + Subscribe( winid, lastId, eventType, functor, userData ); + } + + template + void Connect( int winid, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { Connect( winid, wxID_ANY, eventType, func, userData, eventSink ); } + + template + void Connect( const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { Connect( wxID_ANY, wxID_ANY, eventType, func, userData, eventSink ); } + + template + static void Connect( Sender *sender, + int winid, + int lastId, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { + wxEventFunctorMethod< EventType, Class, Derived > *functor = + wxNewEventFunctor( eventType, func, eventSink ); + + sender->Subscribe( winid, lastId, eventType, functor, userData ); + } + + template + static void Connect( Sender *sender, + int winid, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { Connect( sender, winid, wxID_ANY, eventType, func, userData, eventSink ); } + + template + static void Connect( Sender *sender, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { Connect( sender, wxID_ANY, wxID_ANY, eventType, func, userData, eventSink ); } + + // + // Connect an arbitrary functor to an event: + // + + template + void Connect( int winid, + int lastId, + const EventType &eventType, + Functor &functor, + wxObject* userData = NULL) + { + wxEventFunctorAdapter< EventType, Functor > *adapter = + wxNewEventFunctor( eventType, functor ); + + Subscribe( winid, lastId, eventType, adapter, userData ); + } + template + void Connect( int winid, + const EventType &eventType, + Functor &functor, + wxObject* userData = NULL) + { Connect( winid, wxID_ANY, eventType, functor, userData ); } + + template + void Connect( const EventType &eventType, + Functor &functor, + wxObject* userData = NULL) + { Connect( wxID_ANY, wxID_ANY, eventType, functor, userData ); } + + // + // Disconnect a function from an event: + // + + template + bool Disconnect( int winid, + int lastId, + const EventType &eventType, + void ( *func )( typename EventType::CorrespondingEvent & ), + wxObject* userData = NULL ) + { + wxEventFunctorFunction< EventType > functor = wxConstructEventFunctor( eventType, func ); + + return Unsubscribe( winid, lastId, eventType, functor, userData ); + } + + template + bool Disconnect( int winid, + const EventType &eventType, + void ( *func )( typename EventType::CorrespondingEvent & ), + wxObject* userData = NULL ) + { return Disconnect( winid, wxID_ANY, eventType, func, userData ); } + + template + bool Disconnect( const EventType &eventType, + void ( *func )( typename EventType::CorrespondingEvent & ), + wxObject* userData = NULL ) + { return Disconnect( wxID_ANY, wxID_ANY, eventType, func, userData ); } + + // + // Disconnect a method from an event: + // + + template + bool Disconnect( int winid, + int lastId, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL ) + { + wxEventFunctorMethod< EventType, Class, Class > functor = + wxConstructEventFunctor( eventType, func, static_cast< Class * const >( this )); + + return Unsubscribe( winid, lastId, eventType, functor, userData ); + } + + template + bool Disconnect( int winid, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL ) + { return Disconnect( winid, wxID_ANY, eventType, func, userData ); } + + template + bool Disconnect( const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL ) + { return Disconnect( wxID_ANY, wxID_ANY, eventType, func, userData ); } + + template + bool Disconnect( int winid, + int lastId, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { + wxEventFunctorMethod< EventType, Class, Derived > functor = + wxConstructEventFunctor( eventType, func, eventSink ); + + return Unsubscribe( winid, lastId, eventType, functor, userData ); + } + + template + bool Disconnect( int winid, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { return Disconnect( winid, wxID_ANY, eventType, func, userData, eventSink ); } + + template + bool Disconnect( const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { return Disconnect( wxID_ANY, wxID_ANY, eventType, func, userData, eventSink ); } + + template + static bool Disconnect( Sender *sender, + int winid, + int lastId, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { + wxEventFunctorMethod< EventType, Class, Derived > functor = + wxConstructEventFunctor( eventType, func, eventSink ); + + return sender->Unsubscribe( winid, lastId, eventType, functor, userData ); + } + + template + static bool Disconnect( Sender *sender, + int winid, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { return Disconnect( sender, winid, wxID_ANY, eventType, func, userData, eventSink ); } + + template + static bool Disconnect( Sender *sender, + const EventType &eventType, + void ( Class::*func )( typename EventType::CorrespondingEvent & ), + wxObject *userData = NULL, + Derived *eventSink = NULL ) + { return Disconnect( sender, wxID_ANY, wxID_ANY, eventType, func, userData, eventSink ); } + + // + // Disconnect an arbitrary functor from an event: + // + + template + bool Disconnect( int winid, + int lastId, + const EventType &eventType, + Functor &functor, + wxObject* userData = NULL) + { + wxEventFunctorAdapter< EventType, Functor > adapter = + wxConstructEventFunctor( eventType, functor ); + + return Unsubscribe( winid, lastId, eventType, adapter, userData ); + } + + template + bool Disconnect( int winid, + const EventType &eventType, + Functor &functor, + wxObject* userData = NULL) + { return Disconnect( winid, wxID_ANY, eventType, functor, userData ); } + + template + bool Disconnect( const EventType &eventType, + Functor &functor, + wxObject* userData = NULL) + { return Disconnect( wxID_ANY, wxID_ANY, eventType, functor, userData ); } + +#endif // !wxEVENTS_COMPATIBILITY_2_8 + + wxList* GetDynamicEventTable() const { return m_dynamicEvents ; } // User data can be associated with each wxEvtHandler @@ -2381,6 +3090,18 @@ public: private: + void Subscribe(int winid, + int lastId, + wxEventType eventType, + wxEventFunctor *func, + wxObject* userData); + + bool Unsubscribe(int winid, + int lastId, + wxEventType eventType, + const wxEventFunctor &func, + wxObject *userData); + static const wxEventTableEntry sm_eventTableEntries[]; protected: @@ -2526,9 +3247,9 @@ typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&); typedef void (wxEvtHandler::*wxIdleEventFunction)(wxIdleEvent&); #define wxEventHandler(func) \ - (wxObjectEventFunction)wxStaticCastEvent(wxEventFunction, &func) + wxEVENT_HANDLER_CAST(wxEventFunction, func) #define wxIdleEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIdleEventFunction, &func) + wxEVENT_HANDLER_CAST(wxIdleEventFunction, func) #if wxUSE_GUI @@ -2595,78 +3316,78 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent& #define wxCommandEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCommandEventFunction, &func) + wxEVENT_HANDLER_CAST(wxCommandEventFunction, func) #define wxScrollEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollEventFunction, &func) + wxEVENT_HANDLER_CAST(wxScrollEventFunction, func) #define wxScrollWinEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxScrollWinEventFunction, &func) + wxEVENT_HANDLER_CAST(wxScrollWinEventFunction, func) #define wxSizeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSizeEventFunction, &func) + wxEVENT_HANDLER_CAST(wxSizeEventFunction, func) #define wxMoveEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMoveEventFunction, &func) + wxEVENT_HANDLER_CAST(wxMoveEventFunction, func) #define wxPaintEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaintEventFunction, &func) + wxEVENT_HANDLER_CAST(wxPaintEventFunction, func) #define wxNcPaintEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNcPaintEventFunction, &func) + wxEVENT_HANDLER_CAST(wxNcPaintEventFunction, func) #define wxEraseEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxEraseEventFunction, &func) + wxEVENT_HANDLER_CAST(wxEraseEventFunction, func) #define wxMouseEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseEventFunction, &func) + wxEVENT_HANDLER_CAST(wxMouseEventFunction, func) #define wxCharEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCharEventFunction, &func) + wxEVENT_HANDLER_CAST(wxCharEventFunction, func) #define wxKeyEventHandler(func) wxCharEventHandler(func) #define wxFocusEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFocusEventFunction, &func) + wxEVENT_HANDLER_CAST(wxFocusEventFunction, func) #define wxChildFocusEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxChildFocusEventFunction, &func) + wxEVENT_HANDLER_CAST(wxChildFocusEventFunction, func) #define wxActivateEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxActivateEventFunction, &func) + wxEVENT_HANDLER_CAST(wxActivateEventFunction, func) #define wxMenuEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMenuEventFunction, &func) + wxEVENT_HANDLER_CAST(wxMenuEventFunction, func) #define wxJoystickEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxJoystickEventFunction, &func) + wxEVENT_HANDLER_CAST(wxJoystickEventFunction, func) #define wxDropFilesEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDropFilesEventFunction, &func) + wxEVENT_HANDLER_CAST(wxDropFilesEventFunction, func) #define wxInitDialogEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxInitDialogEventFunction, &func) + wxEVENT_HANDLER_CAST(wxInitDialogEventFunction, func) #define wxSysColourChangedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSysColourChangedEventFunction, &func) + wxEVENT_HANDLER_CAST(wxSysColourChangedEventFunction, func) #define wxDisplayChangedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxDisplayChangedEventFunction, &func) + wxEVENT_HANDLER_CAST(wxDisplayChangedEventFunction, func) #define wxUpdateUIEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxUpdateUIEventFunction, &func) + wxEVENT_HANDLER_CAST(wxUpdateUIEventFunction, func) #define wxCloseEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxCloseEventFunction, &func) + wxEVENT_HANDLER_CAST(wxCloseEventFunction, func) #define wxShowEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxShowEventFunction, &func) + wxEVENT_HANDLER_CAST(wxShowEventFunction, func) #define wxIconizeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxIconizeEventFunction, &func) + wxEVENT_HANDLER_CAST(wxIconizeEventFunction, func) #define wxMaximizeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMaximizeEventFunction, &func) + wxEVENT_HANDLER_CAST(wxMaximizeEventFunction, func) #define wxNavigationKeyEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNavigationKeyEventFunction, &func) + wxEVENT_HANDLER_CAST(wxNavigationKeyEventFunction, func) #define wxPaletteChangedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxPaletteChangedEventFunction, &func) + wxEVENT_HANDLER_CAST(wxPaletteChangedEventFunction, func) #define wxQueryNewPaletteEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxQueryNewPaletteEventFunction, &func) + wxEVENT_HANDLER_CAST(wxQueryNewPaletteEventFunction, func) #define wxWindowCreateEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowCreateEventFunction, &func) + wxEVENT_HANDLER_CAST(wxWindowCreateEventFunction, func) #define wxWindowDestroyEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWindowDestroyEventFunction, &func) + wxEVENT_HANDLER_CAST(wxWindowDestroyEventFunction, func) #define wxSetCursorEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSetCursorEventFunction, &func) + wxEVENT_HANDLER_CAST(wxSetCursorEventFunction, func) #define wxNotifyEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxNotifyEventFunction, &func) + wxEVENT_HANDLER_CAST(wxNotifyEventFunction, func) #define wxHelpEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHelpEventFunction, &func) + wxEVENT_HANDLER_CAST(wxHelpEventFunction, func) #define wxContextMenuEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxContextMenuEventFunction, &func) + wxEVENT_HANDLER_CAST(wxContextMenuEventFunction, func) #define wxMouseCaptureChangedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseCaptureChangedEventFunction, &func) + wxEVENT_HANDLER_CAST(wxMouseCaptureChangedEventFunction, func) #define wxMouseCaptureLostEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMouseCaptureLostEventFunction, &func) + wxEVENT_HANDLER_CAST(wxMouseCaptureLostEventFunction, func) #define wxClipboardTextEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxClipboardTextEventFunction, &func) + wxEVENT_HANDLER_CAST(wxClipboardTextEventFunction, func) #endif // wxUSE_GUI @@ -2801,7 +3522,7 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent& template \ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ -#define END_EVENT_TABLE() DECLARE_EVENT_TABLE_ENTRY( wxEVT_NULL, 0, 0, 0, 0 ) }; +#define END_EVENT_TABLE() DECLARE_EVENT_TABLE_TERMINATOR() }; /* * Event table macros @@ -2831,11 +3552,13 @@ typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent& // EVT_COMMAND #define EVT_COMMAND(winid, event, func) \ wx__DECLARE_EVT1(event, winid, wxCommandEventHandler(func)) + #define EVT_COMMAND_RANGE(id1, id2, event, func) \ wx__DECLARE_EVT2(event, id1, id2, wxCommandEventHandler(func)) #define EVT_NOTIFY(event, winid, func) \ wx__DECLARE_EVT1(event, winid, wxNotifyEventHandler(func)) + #define EVT_NOTIFY_RANGE(event, id1, id2, func) \ wx__DECLARE_EVT2(event, id1, id2, wxNotifyEventHandler(func)) diff --git a/include/wx/fdrepdlg.h b/include/wx/fdrepdlg.h index 169cba32e6..93fb43c697 100644 --- a/include/wx/fdrepdlg.h +++ b/include/wx/fdrepdlg.h @@ -165,16 +165,16 @@ private: DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFindDialogEvent) }; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_FIND; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_FIND_NEXT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_FIND_REPLACE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_FIND_REPLACE_ALL; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_FIND_CLOSE; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FIND, wxFindDialogEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FIND_NEXT, wxFindDialogEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FIND_REPLACE, wxFindDialogEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FIND_REPLACE_ALL, wxFindDialogEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FIND_CLOSE, wxFindDialogEvent ) typedef void (wxEvtHandler::*wxFindDialogEventFunction)(wxFindDialogEvent&); #define wxFindDialogEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFindDialogEventFunction, &func) + wxEVENT_HANDLER_CAST(wxFindDialogEventFunction, func) #define EVT_FIND(id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FIND, id, wxFindDialogEventHandler(fn)) diff --git a/include/wx/filectrl.h b/include/wx/filectrl.h index 3bf068e8a8..1192a31e7b 100644 --- a/include/wx/filectrl.h +++ b/include/wx/filectrl.h @@ -31,10 +31,6 @@ enum #define wxFC_DEFAULT_STYLE wxFC_OPEN extern WXDLLIMPEXP_DATA_CORE(const char) wxFileCtrlNameStr[]; // in filectrlcmn.cpp -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_FILECTRL_SELECTIONCHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_FILECTRL_FILEACTIVATED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_FILECTRL_FOLDERCHANGED; - class WXDLLIMPEXP_CORE wxFileCtrlBase { public: @@ -119,8 +115,12 @@ protected: typedef void ( wxEvtHandler::*wxFileCtrlEventFunction )( wxFileCtrlEvent& ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILECTRL_SELECTIONCHANGED, wxFileCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILECTRL_FILEACTIVATED, wxFileCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILECTRL_FOLDERCHANGED, wxFileCtrlEvent ) + #define wxFileCtrlEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFileCtrlEventFunction, &func) + wxEVENT_HANDLER_CAST( wxFileCtrlEventFunction, func ) #define EVT_FILECTRL_FILEACTIVATED(id, fn) \ wx__DECLARE_EVT1(wxEVT_FILECTRL_FILEACTIVATED, id, wxFileCtrlEventHandler(fn)) diff --git a/include/wx/filepicker.h b/include/wx/filepicker.h index d06d94af1e..b4450c93d6 100644 --- a/include/wx/filepicker.h +++ b/include/wx/filepicker.h @@ -32,6 +32,49 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxDirPickerWidgetNameStr[]; extern WXDLLIMPEXP_DATA_CORE(const char) wxDirPickerCtrlNameStr[]; extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr[]; +// ---------------------------------------------------------------------------- +// wxFileDirPickerEvent: used by wxFilePickerCtrl and wxDirPickerCtrl only +// ---------------------------------------------------------------------------- + +class WXDLLIMPEXP_CORE wxFileDirPickerEvent : public wxCommandEvent +{ +public: + wxFileDirPickerEvent() {} + wxFileDirPickerEvent(wxEventType type, wxObject *generator, int id, const wxString &path) + : wxCommandEvent(type, id), + m_path(path) + { + SetEventObject(generator); + } + + wxString GetPath() const { return m_path; } + void SetPath(const wxString &p) { m_path = p; } + + // default copy ctor, assignment operator and dtor are ok + virtual wxEvent *Clone() const { return new wxFileDirPickerEvent(*this); } + +private: + wxString m_path; + + DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFileDirPickerEvent) +}; + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEvent ); + +// ---------------------------------------------------------------------------- +// event types and macros +// ---------------------------------------------------------------------------- + +typedef void (wxEvtHandler::*wxFileDirPickerEventFunction)(wxFileDirPickerEvent&); + +#define wxFileDirPickerEventHandler(func) \ + wxEVENT_HANDLER_CAST(wxFileDirPickerEventFunction, func) + +#define EVT_FILEPICKER_CHANGED(id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_FILEPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn)) +#define EVT_DIRPICKER_CHANGED(id, fn) \ + wx__DECLARE_EVT1(wxEVT_COMMAND_DIRPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn)) // ---------------------------------------------------------------------------- // wxFileDirPickerWidgetBase: a generic abstract interface which must be @@ -139,6 +182,8 @@ public: // internal functions // Returns the event type sent by this picker virtual wxEventType GetEventType() const = 0; + virtual void DoConnect( wxControl *sender, wxFileDirPickerCtrlBase *eventSink ) = 0; + // Returns the filtered value currently placed in the text control (if present). virtual wxString GetTextCtrlValue() const = 0; @@ -236,6 +281,14 @@ public: // overrides wxEventType GetEventType() const { return wxEVT_COMMAND_FILEPICKER_CHANGED; } + virtual void DoConnect( wxControl *sender, wxFileDirPickerCtrlBase *eventSink ) + { + sender->Connect( wxEVT_COMMAND_FILEPICKER_CHANGED, + wxFileDirPickerEventHandler( wxFileDirPickerCtrlBase::OnFileDirChange ), + NULL, eventSink ); + } + + protected: virtual wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent, @@ -332,6 +385,14 @@ public: // overrides wxEventType GetEventType() const { return wxEVT_COMMAND_DIRPICKER_CHANGED; } + virtual void DoConnect( wxControl *sender, wxFileDirPickerCtrlBase *eventSink ) + { + sender->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, + wxFileDirPickerEventHandler( wxFileDirPickerCtrlBase::OnFileDirChange ), + NULL, eventSink ); + } + + protected: virtual wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent, @@ -356,55 +417,5 @@ private: #endif // wxUSE_DIRPICKERCTRL - -#if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - -// ---------------------------------------------------------------------------- -// wxFileDirPickerEvent: used by wxFilePickerCtrl and wxDirPickerCtrl only -// ---------------------------------------------------------------------------- - -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_FILEPICKER_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_DIRPICKER_CHANGED; - -class WXDLLIMPEXP_CORE wxFileDirPickerEvent : public wxCommandEvent -{ -public: - wxFileDirPickerEvent() {} - wxFileDirPickerEvent(wxEventType type, wxObject *generator, int id, const wxString &path) - : wxCommandEvent(type, id), - m_path(path) - { - SetEventObject(generator); - } - - wxString GetPath() const { return m_path; } - void SetPath(const wxString &p) { m_path = p; } - - // default copy ctor, assignment operator and dtor are ok - virtual wxEvent *Clone() const { return new wxFileDirPickerEvent(*this); } - -private: - wxString m_path; - - DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFileDirPickerEvent) -}; - -// ---------------------------------------------------------------------------- -// event types and macros -// ---------------------------------------------------------------------------- - -typedef void (wxEvtHandler::*wxFileDirPickerEventFunction)(wxFileDirPickerEvent&); - -#define wxFileDirPickerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFileDirPickerEventFunction, &func) - -#define EVT_FILEPICKER_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_FILEPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn)) -#define EVT_DIRPICKER_CHANGED(id, fn) \ - wx__DECLARE_EVT1(wxEVT_COMMAND_DIRPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn)) - - -#endif // wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL - #endif // _WX_FILEDIRPICKER_H_BASE_ diff --git a/include/wx/fontpicker.h b/include/wx/fontpicker.h index 36cbacedec..0c5e01e420 100644 --- a/include/wx/fontpicker.h +++ b/include/wx/fontpicker.h @@ -180,7 +180,7 @@ private: // wxFontPickerEvent: used by wxFontPickerCtrl only // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_FONTPICKER_CHANGED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEvent ) class WXDLLIMPEXP_CORE wxFontPickerEvent : public wxCommandEvent { @@ -212,7 +212,7 @@ private: typedef void (wxEvtHandler::*wxFontPickerEventFunction)(wxFontPickerEvent&); #define wxFontPickerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxFontPickerEventFunction, &func) + wxEVENT_HANDLER_CAST(wxFontPickerEventFunction, func) #define EVT_FONTPICKER_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_FONTPICKER_CHANGED, id, wxFontPickerEventHandler(fn)) diff --git a/include/wx/generic/calctrlg.h b/include/wx/generic/calctrlg.h index 7cdc50d2b4..fb85631c50 100644 --- a/include/wx/generic/calctrlg.h +++ b/include/wx/generic/calctrlg.h @@ -18,6 +18,7 @@ class WXDLLIMPEXP_FWD_CORE wxComboBox; class WXDLLIMPEXP_FWD_CORE wxStaticText; class WXDLLIMPEXP_FWD_CORE wxSpinCtrl; +class WXDLLIMPEXP_FWD_CORE wxSpinEvent; // ---------------------------------------------------------------------------- // wxGenericCalendarCtrl @@ -181,7 +182,9 @@ private: void OnDClick(wxMouseEvent& event); void OnChar(wxKeyEvent& event); void OnMonthChange(wxCommandEvent& event); - void OnYearChange(wxCommandEvent& event); + + void HandleYearChange(wxCommandEvent& event); + void OnYearChange(wxSpinEvent& event); void OnYearTextChange(wxCommandEvent& event); // (re)calc m_widthCol and m_heightRow diff --git a/include/wx/generic/filepickerg.h b/include/wx/generic/filepickerg.h index 6206ba0ebb..efec446e98 100644 --- a/include/wx/generic/filepickerg.h +++ b/include/wx/generic/filepickerg.h @@ -17,8 +17,8 @@ #include "wx/dirdlg.h" -extern WXDLLIMPEXP_DATA_CORE(const wxEventType) wxEVT_COMMAND_DIRPICKER_CHANGED; -extern WXDLLIMPEXP_DATA_CORE(const wxEventType) wxEVT_COMMAND_FILEPICKER_CHANGED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEvent ) //----------------------------------------------------------------------------- diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index a6e5a5b1bf..a83b0d857e 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -2304,26 +2304,26 @@ private: }; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_LEFT_CLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_RIGHT_CLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_LEFT_DCLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_RIGHT_DCLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_LABEL_LEFT_CLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_LABEL_RIGHT_CLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_LABEL_LEFT_DCLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_LABEL_RIGHT_DCLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_ROW_SIZE; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_COL_SIZE; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_RANGE_SELECT; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_CHANGING; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_CHANGED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_SELECT_CELL; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_EDITOR_SHOWN; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_EDITOR_HIDDEN; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_EDITOR_CREATED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_CELL_BEGIN_DRAG; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_COL_MOVE; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_GRID_COL_SORT; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_CLICK, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_RIGHT_DCLICK, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_LABEL_RIGHT_DCLICK, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_ROW_SIZE, wxGridSizeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_SIZE, wxGridSizeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_CHANGING, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_CHANGED, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_SELECT_CELL, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_SHOWN, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_HIDDEN, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_EDITOR_CREATED, wxGridEditorCreatedEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_CELL_BEGIN_DRAG, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_MOVE, wxGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_GRID_COL_SORT, wxGridEvent ) typedef void (wxEvtHandler::*wxGridEventFunction)(wxGridEvent&); typedef void (wxEvtHandler::*wxGridSizeEventFunction)(wxGridSizeEvent&); @@ -2331,16 +2331,16 @@ typedef void (wxEvtHandler::*wxGridRangeSelectEventFunction)(wxGridRangeSelectEv typedef void (wxEvtHandler::*wxGridEditorCreatedEventFunction)(wxGridEditorCreatedEvent&); #define wxGridEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridEventFunction, &func) + wxEVENT_HANDLER_CAST(wxGridEventFunction, func) #define wxGridSizeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridSizeEventFunction, &func) + wxEVENT_HANDLER_CAST(wxGridSizeEventFunction, func) #define wxGridRangeSelectEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridRangeSelectEventFunction, &func) + wxEVENT_HANDLER_CAST(wxGridRangeSelectEventFunction, func) #define wxGridEditorCreatedEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxGridEditorCreatedEventFunction, &func) + wxEVENT_HANDLER_CAST(wxGridEditorCreatedEventFunction, func) #define wx__DECLARE_GRIDEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_GRID_ ## evt, id, wxGridEventHandler(fn)) diff --git a/include/wx/generic/laywin.h b/include/wx/generic/laywin.h index 0539989a5f..f1dea1d292 100644 --- a/include/wx/generic/laywin.h +++ b/include/wx/generic/laywin.h @@ -21,8 +21,11 @@ #include "wx/event.h" -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_QUERY_LAYOUT_INFO; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_CALCULATE_LAYOUT; +class WXDLLIMPEXP_FWD_ADV wxQueryLayoutInfoEvent; +class WXDLLIMPEXP_FWD_ADV wxCalculateLayoutEvent; + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_QUERY_LAYOUT_INFO, wxQueryLayoutInfoEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_CALCULATE_LAYOUT, wxCalculateLayoutEvent ) enum wxLayoutOrientation { @@ -100,8 +103,11 @@ private: typedef void (wxEvtHandler::*wxQueryLayoutInfoEventFunction)(wxQueryLayoutInfoEvent&); +#define wxQueryLayoutInfoEventHandler( func ) \ + wxEVENT_HANDLER_CAST( wxQueryLayoutInfoEventFunction, func ) + #define EVT_QUERY_LAYOUT_INFO(func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_LAYOUT_INFO, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxQueryLayoutInfoEventFunction, & func ), NULL ), + DECLARE_EVENT_TABLE_ENTRY( wxEVT_QUERY_LAYOUT_INFO, wxID_ANY, wxID_ANY, wxQueryLayoutInfoEventHandler( func ), NULL ), /* * This event is used to take a bite out of the available client area. @@ -137,8 +143,10 @@ private: typedef void (wxEvtHandler::*wxCalculateLayoutEventFunction)(wxCalculateLayoutEvent&); +#define wxCalculateLayoutEventHandler( func ) wxEVENT_HANDLER_CAST(wxCalculateLayoutEventFunction, func) + #define EVT_CALCULATE_LAYOUT(func) \ - DECLARE_EVENT_TABLE_ENTRY( wxEVT_CALCULATE_LAYOUT, wxID_ANY, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxCalculateLayoutEventFunction, & func ), NULL ), + DECLARE_EVENT_TABLE_ENTRY( wxEVT_CALCULATE_LAYOUT, wxID_ANY, wxID_ANY, wxCalculateLayoutEventHandler( func ), NULL ), #if wxUSE_SASH diff --git a/include/wx/generic/sashwin.h b/include/wx/generic/sashwin.h index 1044a603bf..784a4dcf76 100644 --- a/include/wx/generic/sashwin.h +++ b/include/wx/generic/sashwin.h @@ -203,7 +203,9 @@ private: DECLARE_NO_COPY_CLASS(wxSashWindow) }; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_SASH_DRAGGED; +class WXDLLIMPEXP_FWD_ADV wxSashEvent; + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_SASH_DRAGGED, wxSashEvent ) enum wxSashDragStatus { @@ -253,7 +255,7 @@ private: typedef void (wxEvtHandler::*wxSashEventFunction)(wxSashEvent&); #define wxSashEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSashEventFunction, &func) + wxEVENT_HANDLER_CAST(wxSashEventFunction, func) #define EVT_SASH_DRAGGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_SASH_DRAGGED, id, wxSashEventHandler(fn)) diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index 98a39231ca..a86febee95 100644 --- a/include/wx/generic/splitter.h +++ b/include/wx/generic/splitter.h @@ -390,7 +390,7 @@ private: typedef void (wxEvtHandler::*wxSplitterEventFunction)(wxSplitterEvent&); #define wxSplitterEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSplitterEventFunction, &func) + wxEVENT_HANDLER_CAST(wxSplitterEventFunction, func) #define wx__DECLARE_SPLITTEREVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_SPLITTER_ ## evt, id, wxSplitterEventHandler(fn)) diff --git a/include/wx/headerctrl.h b/include/wx/headerctrl.h index 8c6b7c143b..8195f32684 100644 --- a/include/wx/headerctrl.h +++ b/include/wx/headerctrl.h @@ -416,30 +416,29 @@ private: }; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_RIGHT_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_MIDDLE_CLICK; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_CLICK, wxHeaderCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_RIGHT_CLICK, wxHeaderCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_MIDDLE_CLICK, wxHeaderCtrlEvent ) -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_RIGHT_DCLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_MIDDLE_DCLICK; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_DCLICK, wxHeaderCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_RIGHT_DCLICK, wxHeaderCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_MIDDLE_DCLICK, wxHeaderCtrlEvent ) -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK, wxHeaderCtrlEvent ) -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_BEGIN_RESIZE; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_RESIZING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_END_RESIZE; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_BEGIN_RESIZE, wxHeaderCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_RESIZING, wxHeaderCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_END_RESIZE, wxHeaderCtrlEvent ) -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_BEGIN_REORDER; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_END_REORDER; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_BEGIN_REORDER, wxHeaderCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_END_REORDER, wxHeaderCtrlEvent ) -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED, wxHeaderCtrlEvent ) typedef void (wxEvtHandler::*wxHeaderCtrlEventFunction)(wxHeaderCtrlEvent&); #define wxHeaderCtrlEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent( \ - wxHeaderCtrlEventFunction, &func) + wxEVENT_HANDLER_CAST(wxHeaderCtrlEventFunction, func) #define wx__DECLARE_HEADER_EVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_HEADER_ ## evt, id, wxHeaderCtrlEventHandler(fn)) diff --git a/include/wx/html/htmlwin.h b/include/wx/html/htmlwin.h index 54b520de15..bf2599a0ee 100644 --- a/include/wx/html/htmlwin.h +++ b/include/wx/html/htmlwin.h @@ -551,10 +551,11 @@ private: DECLARE_NO_COPY_CLASS(wxHtmlWindow) }; +class WXDLLIMPEXP_FWD_HTML wxHtmlCellEvent; -extern WXDLLIMPEXP_HTML const wxEventType wxEVT_COMMAND_HTML_CELL_CLICKED; -extern WXDLLIMPEXP_HTML const wxEventType wxEVT_COMMAND_HTML_CELL_HOVER; -extern WXDLLIMPEXP_HTML const wxEventType wxEVT_COMMAND_HTML_LINK_CLICKED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_HTML, wxEVT_COMMAND_HTML_CELL_CLICKED, wxHtmlCellEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_HTML, wxEVT_COMMAND_HTML_CELL_HOVER, wxHtmlCellEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_HTML, wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEvent ) /*! @@ -628,9 +629,9 @@ typedef void (wxEvtHandler::*wxHtmlCellEventFunction)(wxHtmlCellEvent&); typedef void (wxEvtHandler::*wxHtmlLinkEventFunction)(wxHtmlLinkEvent&); #define wxHtmlCellEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHtmlCellEventFunction, &func) + wxEVENT_HANDLER_CAST(wxHtmlCellEventFunction, func) #define wxHtmlLinkEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHtmlLinkEventFunction, &func) + wxEVENT_HANDLER_CAST(wxHtmlLinkEventFunction, func) #define EVT_HTML_CELL_CLICKED(id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_HTML_CELL_CLICKED, id, wxHtmlCellEventHandler(fn)) diff --git a/include/wx/html/webkit.h b/include/wx/html/webkit.h index cff0e53ebe..42f0442873 100644 --- a/include/wx/html/webkit.h +++ b/include/wx/html/webkit.h @@ -194,32 +194,38 @@ typedef void (wxEvtHandler::*wxWebKitStateChangedEventFunction)(wxWebKitStateCha typedef void (wxEvtHandler::*wxWebKitBeforeLoadEventFunction)(wxWebKitBeforeLoadEvent&); typedef void (wxEvtHandler::*wxWebKitNewWindowEventFunction)(wxWebKitNewWindowEvent&); -extern const wxEventType wxEVT_WEBKIT_BEFORE_LOAD; -extern const wxEventType wxEVT_WEBKIT_STATE_CHANGED; -extern const wxEventType wxEVT_WEBKIT_NEW_WINDOW; +#define wxWebKitStateChangedEventHandler( func ) \ + wxEVENT_HANDLER_CAST( wxWebKitStateChangedEventFunction, func ) + +#define wxWebKitBeforeLoadEventHandler( func ) \ + wxEVENT_HANDLER_CAST( wxWebKitBeforeLoadEventFunction, func ) + +#define wxWebKitNewWindowEventHandler( func ) \ + wxEVENT_HANDLER_CAST( wxWebKitNewWindowEventFunction, func ) + +wxDECLARE_EVENT( wxEVT_WEBKIT_STATE_CHANGED, wxWebKitStateChangedEvent ) +wxDECLARE_EVENT( wxEVT_WEBKIT_BEFORE_LOAD, wxWebKitBeforeLoadEvent ) +wxDECLARE_EVENT( wxEVT_WEBKIT_NEW_WINDOW, wxWebKitNewWindowEvent ) #define EVT_WEBKIT_STATE_CHANGED(func) \ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_STATE_CHANGED, \ wxID_ANY, \ wxID_ANY, \ - (wxObjectEventFunction) \ - (wxWebKitStateChangedEventFunction) & func, \ + wxWebKitStateChangedEventHandler( func ), \ (wxObject *) NULL ), #define EVT_WEBKIT_BEFORE_LOAD(func) \ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_BEFORE_LOAD, \ wxID_ANY, \ wxID_ANY, \ - (wxObjectEventFunction) \ - (wxWebKitBeforeLoadEventFunction) & func, \ + wxWebKitBeforeLoadEventHandler( func ), \ (wxObject *) NULL ), #define EVT_WEBKIT_NEW_WINDOW(func) \ DECLARE_EVENT_TABLE_ENTRY( wxEVT_WEBKIT_NEW_WINDOW, \ wxID_ANY, \ wxID_ANY, \ - (wxObjectEventFunction) \ - (wxWebKitNewWindowEventFunction) & func, \ + wxWebKitNewWindowEventFunction( func ), \ (wxObject *) NULL ), #endif // wxUSE_WEBKIT diff --git a/include/wx/hyperlink.h b/include/wx/hyperlink.h index 1d1a74d91e..73048cc3a2 100644 --- a/include/wx/hyperlink.h +++ b/include/wx/hyperlink.h @@ -88,7 +88,9 @@ inline void wxHyperlinkCtrlBase::CheckParams(const wxString&, const wxString&, l // wxHyperlinkEvent // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_COMMAND_HYPERLINK; +class WXDLLIMPEXP_FWD_ADV wxHyperlinkEvent; + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_COMMAND_HYPERLINK, wxHyperlinkEvent ) // // An event fired when the user clicks on the label in a hyperlink control. @@ -129,7 +131,7 @@ private: typedef void (wxEvtHandler::*wxHyperlinkEventFunction)(wxHyperlinkEvent&); #define wxHyperlinkEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxHyperlinkEventFunction, &func) + wxEVENT_HANDLER_CAST(wxHyperlinkEventFunction, func) #define EVT_HYPERLINK(id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_HYPERLINK, id, wxHyperlinkEventHandler(fn)) diff --git a/include/wx/listbase.h b/include/wx/listbase.h index d8738e86ec..296bd2b325 100644 --- a/include/wx/listbase.h +++ b/include/wx/listbase.h @@ -440,32 +440,32 @@ private: // wxListCtrl event macros // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_BEGIN_DRAG; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_BEGIN_RDRAG; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_END_LABEL_EDIT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_DELETE_ITEM; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS; - -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_ITEM_SELECTED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_ITEM_DESELECTED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_KEY_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_INSERT_ITEM; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_COL_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_ITEM_ACTIVATED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_CACHE_HINT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_COL_RIGHT_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_COL_BEGIN_DRAG; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_COL_DRAGGING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_COL_END_DRAG; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LIST_ITEM_FOCUSED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_BEGIN_DRAG, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_BEGIN_RDRAG, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_END_LABEL_EDIT, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_DELETE_ITEM, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, wxListEvent ) + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_KEY_DOWN, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_INSERT_ITEM, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_COL_CLICK, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_CACHE_HINT, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_COL_DRAGGING, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_COL_END_DRAG, wxListEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LIST_ITEM_FOCUSED, wxListEvent ) typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); #define wxListEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxListEventFunction, &func) + wxEVENT_HANDLER_CAST(wxListEventFunction, func) #define wx__DECLARE_LISTEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_LIST_ ## evt, id, wxListEventHandler(fn)) diff --git a/include/wx/listbook.h b/include/wx/listbook.h index a8abcce052..5e05d3be50 100644 --- a/include/wx/listbook.h +++ b/include/wx/listbook.h @@ -21,8 +21,8 @@ class WXDLLIMPEXP_FWD_CORE wxListView; class WXDLLIMPEXP_FWD_CORE wxListEvent; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, wxBookCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, wxBookCtrlEvent ) // wxListbook flags #define wxLB_DEFAULT wxBK_DEFAULT diff --git a/include/wx/mediactrl.h b/include/wx/mediactrl.h index 984a260879..49612964b0 100644 --- a/include/wx/mediactrl.h +++ b/include/wx/mediactrl.h @@ -327,25 +327,25 @@ public: //Our events -extern WXDLLIMPEXP_MEDIA const wxEventType wxEVT_MEDIA_FINISHED; -extern WXDLLIMPEXP_MEDIA const wxEventType wxEVT_MEDIA_STOP; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_FINISHED, wxMediaEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STOP, wxMediaEvent ) //Function type(s) our events need typedef void (wxEvtHandler::*wxMediaEventFunction)(wxMediaEvent&); #define wxMediaEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxMediaEventFunction, &func) + wxEVENT_HANDLER_CAST(wxMediaEventFunction, func) //Macro for usage with message maps #define EVT_MEDIA_FINISHED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_FINISHED, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), #define EVT_MEDIA_STOP(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STOP, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), -extern WXDLLIMPEXP_MEDIA const wxEventType wxEVT_MEDIA_LOADED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_LOADED, wxMediaEvent ) #define EVT_MEDIA_LOADED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_LOADED, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), -extern WXDLLIMPEXP_MEDIA const wxEventType wxEVT_MEDIA_STATECHANGED; -extern WXDLLIMPEXP_MEDIA const wxEventType wxEVT_MEDIA_PLAY; -extern WXDLLIMPEXP_MEDIA const wxEventType wxEVT_MEDIA_PAUSE; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STATECHANGED, wxMediaEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PLAY, wxMediaEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PAUSE, wxMediaEvent ) #define EVT_MEDIA_STATECHANGED(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STATECHANGED, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), #define EVT_MEDIA_PLAY(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PLAY, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), #define EVT_MEDIA_PAUSE(winid, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PAUSE, winid, wxID_ANY, wxMediaEventHandler(fn), (wxObject *) NULL ), diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index 451b18c538..80255f9b66 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -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. diff --git a/include/wx/msw/chkconf.h b/include/wx/msw/chkconf.h index 930edc47a4..b1c8c9125c 100644 --- a/include/wx/msw/chkconf.h +++ b/include/wx/msw/chkconf.h @@ -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_ */ diff --git a/include/wx/msw/ole/activex.h b/include/wx/msw/ole/activex.h index 99ef645571..dbdcf0741a 100644 --- a/include/wx/msw/ole/activex.h +++ b/include/wx/msw/ole/activex.h @@ -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 diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index a3471b7dc3..365441afa6 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -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. diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index 300eecc4e9..181134e720 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -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. diff --git a/include/wx/notebook.h b/include/wx/notebook.h index ddc7ef40ed..e49cb145ae 100644 --- a/include/wx/notebook.h +++ b/include/wx/notebook.h @@ -118,8 +118,8 @@ protected: typedef wxBookCtrlEventFunction wxNotebookEventFunction; #define wxNotebookEventHandler(func) wxBookCtrlEventHandler(func) -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxBookCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, wxBookCtrlEvent ) #define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn)) diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index 04b27f059d..80c530c8dd 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -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. diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index ccf753d9fd..573e6639cf 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -48,6 +48,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. diff --git a/include/wx/palmos/setup0.h b/include/wx/palmos/setup0.h index 04917f436f..bb985e534d 100644 --- a/include/wx/palmos/setup0.h +++ b/include/wx/palmos/setup0.h @@ -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. diff --git a/include/wx/power.h b/include/wx/power.h index ccd04343ac..3f968b0c99 100644 --- a/include/wx/power.h +++ b/include/wx/power.h @@ -73,16 +73,15 @@ private: DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPowerEvent) }; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_POWER_SUSPENDING; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_POWER_SUSPENDED; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_POWER_SUSPEND_CANCEL; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_POWER_RESUME; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPENDING, wxPowerEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPENDED, wxPowerEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPEND_CANCEL, wxPowerEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_RESUME, wxPowerEvent ) typedef void (wxEvtHandler::*wxPowerEventFunction)(wxPowerEvent&); #define wxPowerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction) \ - wxStaticCastEvent(wxPowerEventFunction, &func) + wxEVENT_HANDLER_CAST(wxPowerEventFunction, func) #define EVT_POWER_SUSPENDING(func) \ wx__DECLARE_EVT0(wxEVT_POWER_SUSPENDING, wxPowerEventHandler(func)) diff --git a/include/wx/process.h b/include/wx/process.h index d49f9f9242..36e7519bd8 100644 --- a/include/wx/process.h +++ b/include/wx/process.h @@ -130,7 +130,9 @@ protected: // wxProcess events // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_END_PROCESS; +class WXDLLIMPEXP_FWD_BASE wxProcessEvent; + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_END_PROCESS, wxProcessEvent ) class WXDLLIMPEXP_BASE wxProcessEvent : public wxEvent { @@ -162,7 +164,7 @@ public: typedef void (wxEvtHandler::*wxProcessEventFunction)(wxProcessEvent&); #define wxProcessEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxProcessEventFunction, &func) + wxEVENT_HANDLER_CAST(wxProcessEventFunction, func) #define EVT_END_PROCESS(id, func) \ wx__DECLARE_EVT1(wxEVT_END_PROCESS, id, wxProcessEventHandler(func)) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 9341c69db7..9fbb5adaac 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1898,15 +1898,15 @@ inline bool wxPGProperty::SetMaxLength( int maxLen ) #ifndef SWIG -extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_SELECTED; -extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_CHANGING; -extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_CHANGED; -extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_HIGHLIGHTED; -extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_RIGHT_CLICK; -extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_PAGE_CHANGED; -extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_ITEM_COLLAPSED; -extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_ITEM_EXPANDED; -extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_DOUBLE_CLICK; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_SELECTED, wxPropertyGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_CHANGING, wxPropertyGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_CHANGED, wxPropertyGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_HIGHLIGHTED, wxPropertyGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_RIGHT_CLICK, wxPropertyGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_PAGE_CHANGED, wxPropertyGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_ITEM_COLLAPSED, wxPropertyGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_ITEM_EXPANDED, wxPropertyGridEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_PROPGRID, wxEVT_PG_DOUBLE_CLICK, wxPropertyGridEvent ) #else enum { @@ -1930,18 +1930,18 @@ extern WXDLLIMPEXP_PROPGRID const wxEventType wxEVT_PG_DOUBLE_CLICK; #ifndef SWIG typedef void (wxEvtHandler::*wxPropertyGridEventFunction)(wxPropertyGridEvent&); -#define EVT_PG_SELECTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_PG_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_PG_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_PG_HIGHLIGHTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_HIGHLIGHTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_PG_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_PG_DOUBLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_DOUBLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_PG_PAGE_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_PAGE_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_PG_ITEM_COLLAPSED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_COLLAPSED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_PG_ITEM_EXPANDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_EXPANDED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxPropertyGridEventFunction, & fn ), (wxObject *) NULL ), - -#define wxPropertyGridEventHandler(A) \ - ((wxObjectEventFunction)(wxEventFunction)(wxPropertyGridEventFunction)&A) +#define EVT_PG_SELECTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_SELECTED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), (wxObject *) NULL ), +#define EVT_PG_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_CHANGING, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), (wxObject *) NULL ), +#define EVT_PG_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_CHANGED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), (wxObject *) NULL ), +#define EVT_PG_HIGHLIGHTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_HIGHLIGHTED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), (wxObject *) NULL ), +#define EVT_PG_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_RIGHT_CLICK, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), (wxObject *) NULL ), +#define EVT_PG_DOUBLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_DOUBLE_CLICK, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), (wxObject *) NULL ), +#define EVT_PG_PAGE_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_PAGE_CHANGED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), (wxObject *) NULL ), +#define EVT_PG_ITEM_COLLAPSED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_COLLAPSED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), (wxObject *) NULL ), +#define EVT_PG_ITEM_EXPANDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_PG_ITEM_EXPANDED, id, -1, wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ), (wxObject *) NULL ), + +#define wxPropertyGridEventHandler(fn) \ + wxEVENT_HANDLER_CAST( wxPropertyGridEventFunction, fn ) #endif diff --git a/include/wx/richtext/richtextctrl.h b/include/wx/richtext/richtextctrl.h index 287415adf1..b098cc8c8b 100644 --- a/include/wx/richtext/richtextctrl.h +++ b/include/wx/richtext/richtextctrl.h @@ -893,48 +893,48 @@ private: /*! * wxRichTextCtrl events */ -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_LEFT_CLICK; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_RETURN; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_CHARACTER; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_DELETE; - -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED; - -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED; -extern WXDLLIMPEXP_RICHTEXT const wxEventType wxEVT_COMMAND_RICHTEXT_BUFFER_RESET; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_RETURN, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_CHARACTER, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_DELETE, wxRichTextEvent ) + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED, wxRichTextEvent ) + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED, wxRichTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_RICHTEXT, wxEVT_COMMAND_RICHTEXT_BUFFER_RESET, wxRichTextEvent ) typedef void (wxEvtHandler::*wxRichTextEventFunction)(wxRichTextEvent&); #define wxRichTextEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxRichTextEventFunction, &func) - -#define EVT_RICHTEXT_LEFT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_LEFT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_RETURN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_RETURN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_CHARACTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CHARACTER, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_DELETE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_DELETE, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), - -#define EVT_RICHTEXT_STYLESHEET_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_STYLESHEET_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_STYLESHEET_REPLACING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_STYLESHEET_REPLACED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), - -#define EVT_RICHTEXT_CONTENT_INSERTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_CONTENT_DELETED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_STYLE_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_SELECTION_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), -#define EVT_RICHTEXT_BUFFER_RESET(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_BUFFER_RESET, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxRichTextEventFunction, & fn ), NULL ), + wxEVENT_HANDLER_CAST(wxRichTextEventFunction, func) + +#define EVT_RICHTEXT_LEFT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_LEFT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_RETURN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_RETURN, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_CHARACTER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CHARACTER, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_DELETE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_DELETE, id, -1, wxRichTextEventHandler( fn ), NULL ), + +#define EVT_RICHTEXT_STYLESHEET_CHANGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_STYLESHEET_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_STYLESHEET_REPLACING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_STYLESHEET_REPLACED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED, id, -1, wxRichTextEventHandler( fn ), NULL ), + +#define EVT_RICHTEXT_CONTENT_INSERTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_CONTENT_DELETED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_STYLE_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_SELECTION_CHANGED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED, id, -1, wxRichTextEventHandler( fn ), NULL ), +#define EVT_RICHTEXT_BUFFER_RESET(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_RICHTEXT_BUFFER_RESET, id, -1, wxRichTextEventHandler( fn ), NULL ), #endif // wxUSE_RICHTEXT diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index 4f21e8a492..640362e5dc 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -43,6 +43,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. diff --git a/include/wx/socket.h b/include/wx/socket.h index efc5652531..c3d655173d 100644 --- a/include/wx/socket.h +++ b/include/wx/socket.h @@ -93,6 +93,9 @@ enum wxSocketType }; +// event +class WXDLLIMPEXP_FWD_NET wxSocketEvent; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_SOCKET, wxSocketEvent) // -------------------------------------------------------------------------- // wxSocketBase @@ -391,7 +394,7 @@ public: typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&); #define wxSocketEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSocketEventFunction, &func) + wxEVENT_HANDLER_CAST(wxSocketEventFunction, func) #define EVT_SOCKET(id, func) \ wx__DECLARE_EVT1(wxEVT_SOCKET, id, wxSocketEventHandler(func)) diff --git a/include/wx/spinbutt.h b/include/wx/spinbutt.h index feec6b791c..a068833a98 100644 --- a/include/wx/spinbutt.h +++ b/include/wx/spinbutt.h @@ -25,6 +25,11 @@ #define wxSPIN_BUTTON_NAME _T("wxSpinButton") +class WXDLLIMPEXP_FWD_CORE wxSpinEvent; +wxDECLARE_EXPORTED_EVENT_REFERENCE( WXDLLIMPEXP_CORE, wxEVT_SPIN_UP, wxSpinEvent ) +wxDECLARE_EXPORTED_EVENT_REFERENCE( WXDLLIMPEXP_CORE, wxEVT_SPIN_DOWN, wxSpinEvent ) +wxDECLARE_EXPORTED_EVENT_REFERENCE( WXDLLIMPEXP_CORE, wxEVT_SPIN, wxSpinEvent ) + // ---------------------------------------------------------------------------- // The wxSpinButton is like a small scrollbar than is often placed next // to a text control. @@ -120,15 +125,15 @@ private: typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&); #define wxSpinEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSpinEventFunction, &func) + wxEVENT_HANDLER_CAST(wxSpinEventFunction, func) // macros for handling spin events #define EVT_SPIN_UP(winid, func) \ - wx__DECLARE_EVT1(wxEVT_SCROLL_LINEUP, winid, wxSpinEventHandler(func)) + wx__DECLARE_EVT1(wxEVT_SPIN_UP, winid, wxSpinEventHandler(func)) #define EVT_SPIN_DOWN(winid, func) \ - wx__DECLARE_EVT1(wxEVT_SCROLL_LINEDOWN, winid, wxSpinEventHandler(func)) + wx__DECLARE_EVT1(wxEVT_SPIN_DOWN, winid, wxSpinEventHandler(func)) #define EVT_SPIN(winid, func) \ - wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBTRACK, winid, wxSpinEventHandler(func)) + wx__DECLARE_EVT1(wxEVT_SPIN, winid, wxSpinEventHandler(func)) #endif // wxUSE_SPINBTN diff --git a/include/wx/spinctrl.h b/include/wx/spinctrl.h index 76c4a3f552..6e8bd54bca 100644 --- a/include/wx/spinctrl.h +++ b/include/wx/spinctrl.h @@ -18,6 +18,12 @@ #include "wx/spinbutt.h" // should make wxSpinEvent visible to the app +// Events +class WXDLLIMPEXP_FWD_CORE wxSpinDoubleEvent; + +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED, wxSpinDoubleEvent) + // ---------------------------------------------------------------------------- // A spin ctrl is a text control with a spin button which is usually used to // prompt the user for a numeric input. @@ -89,7 +95,7 @@ private: typedef void (wxEvtHandler::*wxSpinDoubleEventFunction)(wxSpinDoubleEvent&); #define wxSpinDoubleEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxSpinDoubleEventFunction, &func) + wxEVENT_HANDLER_CAST(wxSpinDoubleEventFunction, func) // macros for handling spinctrl events diff --git a/include/wx/splitter.h b/include/wx/splitter.h index 0dc1c2a9ba..2956b8b21d 100644 --- a/include/wx/splitter.h +++ b/include/wx/splitter.h @@ -35,10 +35,12 @@ #define wxSP_FULLSASH 0 #endif // WXWIN_COMPATIBILITY_2_6 -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SPLITTER_DOUBLECLICKED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SPLITTER_UNSPLIT; +class WXDLLIMPEXP_FWD_CORE wxSplitterEvent; + +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, wxSplitterEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, wxSplitterEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, wxSplitterEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_SPLITTER_UNSPLIT, wxSplitterEvent ) #include "wx/generic/splitter.h" diff --git a/include/wx/srchctrl.h b/include/wx/srchctrl.h index 17e18884dc..d158540b70 100644 --- a/include/wx/srchctrl.h +++ b/include/wx/srchctrl.h @@ -38,8 +38,8 @@ extern WXDLLIMPEXP_DATA_CORE(const char) wxSearchCtrlNameStr[]; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN; +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, wxCommandEvent) // ---------------------------------------------------------------------------- // a search ctrl is a text control with a search button and a cancel button diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index 700e59f999..1fa34981d4 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -3957,34 +3957,34 @@ private: #ifndef SWIG -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_CHANGE; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_STYLENEEDED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_CHARADDED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_SAVEPOINTREACHED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_SAVEPOINTLEFT; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_ROMODIFYATTEMPT; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_KEY; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DOUBLECLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_UPDATEUI; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_MODIFIED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_MACRORECORD; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_MARGINCLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_NEEDSHOWN; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_PAINTED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_USERLISTSELECTION; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_URIDROPPED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DWELLSTART; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DWELLEND; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_START_DRAG; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DRAG_OVER; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DO_DROP; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_ZOOM; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_HOTSPOT_CLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_HOTSPOT_DCLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_CALLTIP_CLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_AUTOCOMP_SELECTION; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_INDICATOR_CLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_INDICATOR_RELEASE; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHANGE, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_STYLENEEDED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_KEY, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MACRORECORD, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DRAG_OVER, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DO_DROP, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ZOOM, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_CLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_SELECTION, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_CLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_RELEASE, wxStyledTextEvent ) #else enum { wxEVT_STC_CHANGE, @@ -4023,34 +4023,37 @@ extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_INDICATOR_RELEASE; #ifndef SWIG typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); -#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_CALLTIP_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_INDICATOR_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_INDICATOR_RELEASE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define wxStyledTextEventHandler( func ) \ + wxEVENT_HANDLER_CAST( wxStyledTextEventFunction, func ) + +#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_CALLTIP_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_INDICATOR_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_INDICATOR_RELEASE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #endif diff --git a/include/wx/taskbar.h b/include/wx/taskbar.h index a7f523cced..beb0a3a2d2 100644 --- a/include/wx/taskbar.h +++ b/include/wx/taskbar.h @@ -94,18 +94,18 @@ private: typedef void (wxEvtHandler::*wxTaskBarIconEventFunction)(wxTaskBarIconEvent&); -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_TASKBAR_MOVE; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_TASKBAR_LEFT_DOWN; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_TASKBAR_LEFT_UP; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_TASKBAR_RIGHT_DOWN; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_TASKBAR_RIGHT_UP; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_TASKBAR_LEFT_DCLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_TASKBAR_RIGHT_DCLICK; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_TASKBAR_BALLOON_TIMEOUT; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_TASKBAR_BALLOON_CLICK; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_TASKBAR_MOVE, wxTaskBarIconEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_TASKBAR_LEFT_UP, wxTaskBarIconEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_TASKBAR_RIGHT_DOWN, wxTaskBarIconEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_TASKBAR_RIGHT_UP, wxTaskBarIconEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_TASKBAR_LEFT_DCLICK, wxTaskBarIconEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_TASKBAR_RIGHT_DCLICK, wxTaskBarIconEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_TASKBAR_BALLOON_TIMEOUT, wxTaskBarIconEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_TASKBAR_BALLOON_CLICK, wxTaskBarIconEvent ) #define wxTaskBarIconEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTaskBarIconEventFunction, &func) + wxEVENT_HANDLER_CAST(wxTaskBarIconEventFunction, func) #define wx__DECLARE_TASKBAREVT(evt, fn) \ wx__DECLARE_EVT0(wxEVT_TASKBAR_ ## evt, wxTaskBarIconEventHandler(fn)) diff --git a/include/wx/textctrl.h b/include/wx/textctrl.h index 74b3944339..a3ad96f2d8 100644 --- a/include/wx/textctrl.h +++ b/include/wx/textctrl.h @@ -719,10 +719,12 @@ protected: // wxTextCtrl events // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_UPDATED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_ENTER; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_URL; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TEXT_MAXLEN; +class WXDLLIMPEXP_FWD_CORE wxTextUrlEvent; + +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_UPDATED, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_ENTER, wxCommandEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_URL, wxTextUrlEvent) +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_TEXT_MAXLEN, wxCommandEvent) class WXDLLIMPEXP_CORE wxTextUrlEvent : public wxCommandEvent { @@ -769,7 +771,7 @@ typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&); #define wxTextEventHandler(func) wxCommandEventHandler(func) #define wxTextUrlEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTextUrlEventFunction, &func) + wxEVENT_HANDLER_CAST(wxTextUrlEventFunction, func) #define wx__DECLARE_TEXTEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_TEXT_ ## evt, id, wxTextEventHandler(fn)) diff --git a/include/wx/tglbtn.h b/include/wx/tglbtn.h index ccb80dce96..ed697b522b 100644 --- a/include/wx/tglbtn.h +++ b/include/wx/tglbtn.h @@ -20,7 +20,7 @@ #include "wx/event.h" #include "wx/control.h" // base class -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOGGLEBUTTON_CLICKED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) // ---------------------------------------------------------------------------- // wxToggleButtonBase diff --git a/include/wx/timer.h b/include/wx/timer.h index a8501510db..87ac6b9e06 100644 --- a/include/wx/timer.h +++ b/include/wx/timer.h @@ -33,6 +33,10 @@ #define wxTIMER_ONE_SHOT true class WXDLLIMPEXP_FWD_BASE wxTimerImpl; +class WXDLLIMPEXP_FWD_BASE wxTimerEvent; + +// timer event type +wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_BASE, wxEVT_TIMER, wxTimerEvent) // the interface of wxTimer class class WXDLLIMPEXP_BASE wxTimer : public wxEvtHandler @@ -178,7 +182,7 @@ private: typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&); #define wxTimerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTimerEventFunction, &func) + wxEVENT_HANDLER_CAST(wxTimerEventFunction, func) #define EVT_TIMER(timerid, func) \ wx__DECLARE_EVT1(wxEVT_TIMER, timerid, wxTimerEventHandler(func)) diff --git a/include/wx/toolbook.h b/include/wx/toolbook.h index 63391c858b..10cb59175e 100644 --- a/include/wx/toolbook.h +++ b/include/wx/toolbook.h @@ -21,8 +21,8 @@ class WXDLLIMPEXP_FWD_CORE wxToolBarBase; class WXDLLIMPEXP_FWD_CORE wxCommandEvent; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, wxBookCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, wxBookCtrlEvent ) // Use wxButtonToolBar diff --git a/include/wx/treebase.h b/include/wx/treebase.h index d66739600e..8ad716a730 100644 --- a/include/wx/treebase.h +++ b/include/wx/treebase.h @@ -340,30 +340,30 @@ typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&); // tree control events and macros for handling them // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_BEGIN_DRAG; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_BEGIN_RDRAG; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_END_LABEL_EDIT; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_DELETE_ITEM; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_GET_INFO; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_SET_INFO; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_ITEM_EXPANDING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_ITEM_COLLAPSING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_SEL_CHANGING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_KEY_DOWN; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_ITEM_ACTIVATED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_END_DRAG; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREE_ITEM_MENU; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_BEGIN_DRAG, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_BEGIN_RDRAG, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_END_LABEL_EDIT, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_DELETE_ITEM, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_GET_INFO, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_SET_INFO, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_ITEM_EXPANDED, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_ITEM_EXPANDING, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_ITEM_COLLAPSED, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_ITEM_COLLAPSING, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_SEL_CHANGING, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_KEY_DOWN, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_END_DRAG, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP, wxTreeEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEvent ) #define wxTreeEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxTreeEventFunction, &func) + wxEVENT_HANDLER_CAST(wxTreeEventFunction, func) #define wx__DECLARE_TREEEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_TREE_ ## evt, id, wxTreeEventHandler(fn)) diff --git a/include/wx/treebook.h b/include/wx/treebook.h index 704c87f234..46875c1bb1 100644 --- a/include/wx/treebook.h +++ b/include/wx/treebook.h @@ -239,10 +239,10 @@ typedef wxBookCtrlEventFunction wxTreebookEventFunction; #define wxTreebookEventHandler(func) wxBookCtrlEventHandler(func) -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED; -extern WXDLLIMPEXP_CORE const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, wxBookCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, wxBookCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED, wxBookCtrlEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED, wxBookCtrlEvent ) #define EVT_TREEBOOK_PAGE_CHANGED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn)) diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 3e8f5754a2..25878fae7e 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -46,6 +46,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. diff --git a/include/wx/wizard.h b/include/wx/wizard.h index 1368e5e785..3b65fab1d6 100644 --- a/include/wx/wizard.h +++ b/include/wx/wizard.h @@ -285,16 +285,16 @@ private: // macros for handling wxWizardEvents // ---------------------------------------------------------------------------- -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_WIZARD_PAGE_CHANGED; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_WIZARD_PAGE_CHANGING; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_WIZARD_CANCEL; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_WIZARD_HELP; -extern WXDLLIMPEXP_ADV const wxEventType wxEVT_WIZARD_FINISHED; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_PAGE_CHANGING, wxWizardEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_CANCEL, wxWizardEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_HELP, wxWizardEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_FINISHED, wxWizardEvent ) typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); #define wxWizardEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(wxWizardEventFunction, &func) + wxEVENT_HANDLER_CAST(wxWizardEventFunction, func) #define wx__DECLARE_WIZARDEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_WIZARD_ ## evt, id, wxWizardEventHandler(fn)) diff --git a/samples/calendar/calendar.cpp b/samples/calendar/calendar.cpp index ffa07b257c..f9c5c4e708 100644 --- a/samples/calendar/calendar.cpp +++ b/samples/calendar/calendar.cpp @@ -705,7 +705,7 @@ wxCalendarCtrlBase *MyPanel::DoCreateCalendar(const wxDateTime& dt, long style) calendar->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MyFrame::OnCalRClick), NULL, - wxGetTopLevelParent(this)); + ( MyFrame * )wxGetTopLevelParent(this)); return calendar; } diff --git a/setup.h.in b/setup.h.in index 0ee1a1b882..ddc48e735a 100644 --- a/setup.h.in +++ b/setup.h.in @@ -152,6 +152,8 @@ #define WXWIN_COMPATIBILITY_2_8 0 +#define wxEVENTS_COMPATIBILITY_2_8 0 + #define wxDIALOG_UNIT_COMPATIBILITY 0 diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 03789c7a4c..aba3001507 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -46,11 +46,11 @@ WX_DEFINE_OBJARRAY(wxAuiToolBarItemArray) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG) +wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_TOOL_DROPDOWN, wxAuiToolBarEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_OVERFLOW_CLICK, wxAuiToolBarEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_RIGHT_CLICK, wxAuiToolBarEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_MIDDLE_CLICK, wxAuiToolBarEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_AUITOOLBAR_BEGIN_DRAG, wxAuiToolBarEvent ) IMPLEMENT_CLASS(wxAuiToolBar, wxControl) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index dc5ce84949..607722c115 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -43,21 +43,21 @@ WX_DEFINE_OBJARRAY(wxAuiNotebookPageArray) WX_DEFINE_OBJARRAY(wxAuiTabContainerButtonArray) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_BUTTON) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN) +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSE, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CLOSED, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGED, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_BUTTON, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_ALLOW_DND, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_DRAG_DONE, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, wxAuiNotebookEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, wxAuiNotebookEvent); IMPLEMENT_CLASS(wxAuiNotebook, wxControl) IMPLEMENT_CLASS(wxAuiTabCtrl, wxControl) @@ -2777,37 +2777,40 @@ const int wxAuiBaseTabCtrlId = 5380; // -- wxAuiNotebook class implementation -- +#define EVT_AUI_RANGE(id1, id2, event, func) \ + wx__DECLARE_EVT2(event, id1, id2, wxAuiNotebookEventHandler(func)) + BEGIN_EVENT_TABLE(wxAuiNotebook, wxControl) EVT_SIZE(wxAuiNotebook::OnSize) EVT_CHILD_FOCUS(wxAuiNotebook::OnChildFocusNotebook) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_PAGE_CHANGING, wxAuiNotebook::OnTabClicked) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_BEGIN_DRAG, wxAuiNotebook::OnTabBeginDrag) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_END_DRAG, wxAuiNotebook::OnTabEndDrag) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_DRAG_MOTION, wxAuiNotebook::OnTabDragMotion) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_BUTTON, wxAuiNotebook::OnTabButton) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_DOWN, wxAuiNotebook::OnTabMiddleDown) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_TAB_MIDDLE_UP, wxAuiNotebook::OnTabMiddleUp) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_DOWN, wxAuiNotebook::OnTabRightDown) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_TAB_RIGHT_UP, wxAuiNotebook::OnTabRightUp) - EVT_COMMAND_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, + EVT_AUI_RANGE(wxAuiBaseTabCtrlId, wxAuiBaseTabCtrlId+500, wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, wxAuiNotebook::OnTabBgDClick) EVT_NAVIGATION_KEY(wxAuiNotebook::OnNavigationKeyNotebook) @@ -3665,10 +3668,8 @@ void wxAuiNotebook::OnSize(wxSizeEvent& evt) evt.Skip(); } -void wxAuiNotebook::OnTabClicked(wxCommandEvent& command_evt) +void wxAuiNotebook::OnTabClicked(wxAuiNotebookEvent& evt) { - wxAuiNotebookEvent& evt = (wxAuiNotebookEvent&)command_evt; - wxAuiTabCtrl* ctrl = (wxAuiTabCtrl*)evt.GetEventObject(); wxASSERT(ctrl != NULL); @@ -3678,7 +3679,7 @@ void wxAuiNotebook::OnTabClicked(wxCommandEvent& command_evt) SetSelectionToWindow(wnd); } -void wxAuiNotebook::OnTabBgDClick(wxCommandEvent& WXUNUSED(evt)) +void wxAuiNotebook::OnTabBgDClick(wxAuiNotebookEvent& WXUNUSED(evt)) { // notify owner that the tabbar background has been double-clicked wxAuiNotebookEvent e(wxEVT_COMMAND_AUINOTEBOOK_BG_DCLICK, m_windowId); @@ -3686,12 +3687,12 @@ void wxAuiNotebook::OnTabBgDClick(wxCommandEvent& WXUNUSED(evt)) GetEventHandler()->ProcessEvent(e); } -void wxAuiNotebook::OnTabBeginDrag(wxCommandEvent&) +void wxAuiNotebook::OnTabBeginDrag(wxAuiNotebookEvent&) { m_last_drag_x = 0; } -void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt) +void wxAuiNotebook::OnTabDragMotion(wxAuiNotebookEvent& evt) { wxPoint screen_pt = ::wxGetMousePosition(); wxPoint client_pt = ScreenToClient(screen_pt); @@ -3822,10 +3823,8 @@ void wxAuiNotebook::OnTabDragMotion(wxCommandEvent& evt) -void wxAuiNotebook::OnTabEndDrag(wxCommandEvent& command_evt) +void wxAuiNotebook::OnTabEndDrag(wxAuiNotebookEvent& evt) { - wxAuiNotebookEvent& evt = (wxAuiNotebookEvent&)command_evt; - m_mgr.HideHint(); @@ -4249,9 +4248,8 @@ void wxAuiNotebook::OnNavigationKeyNotebook(wxNavigationKeyEvent& event) } } -void wxAuiNotebook::OnTabButton(wxCommandEvent& command_evt) +void wxAuiNotebook::OnTabButton(wxAuiNotebookEvent& evt) { - wxAuiNotebookEvent& evt = (wxAuiNotebookEvent&)command_evt; wxAuiTabCtrl* tabs = (wxAuiTabCtrl*)evt.GetEventObject(); int button_id = evt.GetInt(); @@ -4307,7 +4305,7 @@ void wxAuiNotebook::OnTabButton(wxCommandEvent& command_evt) } -void wxAuiNotebook::OnTabMiddleDown(wxCommandEvent& evt) +void wxAuiNotebook::OnTabMiddleDown(wxAuiNotebookEvent& evt) { // patch event through to owner wxAuiTabCtrl* tabs = (wxAuiTabCtrl*)evt.GetEventObject(); @@ -4319,7 +4317,7 @@ void wxAuiNotebook::OnTabMiddleDown(wxCommandEvent& evt) GetEventHandler()->ProcessEvent(e); } -void wxAuiNotebook::OnTabMiddleUp(wxCommandEvent& evt) +void wxAuiNotebook::OnTabMiddleUp(wxAuiNotebookEvent& evt) { // if the wxAUI_NB_MIDDLE_CLICK_CLOSE is specified, middle // click should act like a tab close action. However, first @@ -4346,7 +4344,7 @@ void wxAuiNotebook::OnTabMiddleUp(wxCommandEvent& evt) OnTabButton(evt); } -void wxAuiNotebook::OnTabRightDown(wxCommandEvent& evt) +void wxAuiNotebook::OnTabRightDown(wxAuiNotebookEvent& evt) { // patch event through to owner wxAuiTabCtrl* tabs = (wxAuiTabCtrl*)evt.GetEventObject(); @@ -4358,7 +4356,7 @@ void wxAuiNotebook::OnTabRightDown(wxCommandEvent& evt) GetEventHandler()->ProcessEvent(e); } -void wxAuiNotebook::OnTabRightUp(wxCommandEvent& evt) +void wxAuiNotebook::OnTabRightUp(wxAuiNotebookEvent& evt) { // patch event through to owner wxAuiTabCtrl* tabs = (wxAuiTabCtrl*)evt.GetEventObject(); diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index dc539a2078..4616efe633 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -54,12 +54,12 @@ WX_DEFINE_OBJARRAY(wxAuiPaneInfoArray) wxAuiPaneInfo wxAuiNullPaneInfo; wxAuiDockInfo wxAuiNullDockInfo; -DEFINE_EVENT_TYPE(wxEVT_AUI_PANE_BUTTON) -DEFINE_EVENT_TYPE(wxEVT_AUI_PANE_CLOSE) -DEFINE_EVENT_TYPE(wxEVT_AUI_PANE_MAXIMIZE) -DEFINE_EVENT_TYPE(wxEVT_AUI_PANE_RESTORE) -DEFINE_EVENT_TYPE(wxEVT_AUI_RENDER) -DEFINE_EVENT_TYPE(wxEVT_AUI_FIND_MANAGER) +wxDEFINE_EVENT( wxEVT_AUI_PANE_BUTTON, wxAuiManagerEvent ) +wxDEFINE_EVENT( wxEVT_AUI_PANE_CLOSE, wxAuiManagerEvent ) +wxDEFINE_EVENT( wxEVT_AUI_PANE_MAXIMIZE, wxAuiManagerEvent ) +wxDEFINE_EVENT( wxEVT_AUI_PANE_RESTORE, wxAuiManagerEvent ) +wxDEFINE_EVENT( wxEVT_AUI_RENDER, wxAuiManagerEvent ) +wxDEFINE_EVENT( wxEVT_AUI_FIND_MANAGER, wxAuiManagerEvent ) #ifdef __WXMAC__ // a few defines to avoid nameclashes diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index b2a0fd718f..a358cf0dde 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -416,6 +416,20 @@ wxAppConsoleBase::HandleEvent(wxEvtHandler *handler, (handler->*func)(event); } +void wxAppConsoleBase::CallEventHandler(wxEvtHandler *handler, + wxEventFunctor& functor, + wxEvent& event) const +{ + // If the functor holds a method then, for backward compatibility, call + // HandleEvent(): + wxEventFunction eventFunction = functor.GetMethod(); + + if ( eventFunction ) + HandleEvent(handler, eventFunction, event); + else + functor(handler, event); +} + void wxAppConsoleBase::OnUnhandledException() { #ifdef __WXDEBUG__ diff --git a/src/common/calctrlcmn.cpp b/src/common/calctrlcmn.cpp index dc0c442680..9130d781c8 100644 --- a/src/common/calctrlcmn.cpp +++ b/src/common/calctrlcmn.cpp @@ -20,7 +20,7 @@ #include "wx/dateevt.h" IMPLEMENT_DYNAMIC_CLASS(wxDateEvent, wxCommandEvent) -DEFINE_EVENT_TYPE(wxEVT_DATE_CHANGED) +wxDEFINE_EVENT(wxEVT_DATE_CHANGED, wxDateEvent); #endif // wxUSE_CALENDARCTRL || wxUSE_DATEPICKCTRL @@ -34,15 +34,15 @@ DEFINE_EVENT_TYPE(wxEVT_DATE_CHANGED) // ---------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxCalendarEvent, wxDateEvent) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_SEL_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_DOUBLECLICKED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_WEEKDAY_CLICKED) +wxDEFINE_EVENT( wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEvent ) +wxDEFINE_EVENT( wxEVT_CALENDAR_PAGE_CHANGED, wxCalendarEvent ) +wxDEFINE_EVENT( wxEVT_CALENDAR_DOUBLECLICKED, wxCalendarEvent ) +wxDEFINE_EVENT( wxEVT_CALENDAR_WEEKDAY_CLICKED, wxCalendarEvent ) // deprecated events -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_DAY_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_MONTH_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_CALENDAR_YEAR_CHANGED) +wxDEFINE_EVENT( wxEVT_CALENDAR_DAY_CHANGED, wxCalendarEvent ) +wxDEFINE_EVENT( wxEVT_CALENDAR_MONTH_CHANGED, wxCalendarEvent ) +wxDEFINE_EVENT( wxEVT_CALENDAR_YEAR_CHANGED, wxCalendarEvent ) wxCalendarDateAttr wxCalendarDateAttr::m_mark(wxCAL_BORDER_SQUARE); diff --git a/src/common/clipcmn.cpp b/src/common/clipcmn.cpp index 31aa8bb2e8..d89b5628eb 100644 --- a/src/common/clipcmn.cpp +++ b/src/common/clipcmn.cpp @@ -39,7 +39,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxClipboardEvent,wxEvent) -DEFINE_EVENT_TYPE(wxEVT_CLIPBOARD_CHANGED) +wxDEFINE_EVENT( wxEVT_CLIPBOARD_CHANGED, wxClipboardEvent ) // notice that ctors are defined here and not inline to avoid having to include // wx/dataobj.h from wx/clipbrd.h diff --git a/src/common/clrpickercmn.cpp b/src/common/clrpickercmn.cpp index 5cbd6a7058..ef7740e1c4 100644 --- a/src/common/clrpickercmn.cpp +++ b/src/common/clrpickercmn.cpp @@ -39,7 +39,7 @@ const char wxColourPickerWidgetNameStr[] = "colourpickerwidget"; // implementation // ============================================================================ -DEFINE_EVENT_TYPE(wxEVT_COMMAND_COLOURPICKER_CHANGED) +wxDEFINE_EVENT(wxEVT_COMMAND_COLOURPICKER_CHANGED, wxColourPickerEvent) IMPLEMENT_DYNAMIC_CLASS(wxColourPickerCtrl, wxPickerBase) IMPLEMENT_DYNAMIC_CLASS(wxColourPickerEvent, wxEvent) diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index 949ffa233f..79f5b89c45 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -1213,23 +1213,23 @@ wxDataViewCtrlBase::InsertColumn( unsigned int WXUNUSED(pos), wxDataViewColumn * IMPLEMENT_DYNAMIC_CLASS(wxDataViewEvent,wxNotifyEvent) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED, wxDataViewEvent ) + +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEvent ) + +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEvent ) + +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED, wxDataViewEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED, wxDataViewEvent ) // ------------------------------------- diff --git a/src/common/event.cpp b/src/common/event.cpp index 3a32fb3719..9eb05a0bbf 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -115,7 +115,7 @@ wxEventHashTable &wxEvtHandler::GetEventHashTable() const wxEventHashTable wxEvtHandler::sm_eventHashTable(wxEvtHandler::sm_eventTable); const wxEventTableEntry wxEvtHandler::sm_eventTableEntries[] = - { DECLARE_EVENT_TABLE_ENTRY(wxEVT_NULL, 0, 0, (wxObjectEventFunction)NULL, NULL) }; + { DECLARE_EVENT_TABLE_TERMINATOR() }; // wxUSE_MEMORY_TRACING considers memory freed from the static objects dtors @@ -159,167 +159,146 @@ const wxEventType wxEVT_FIRST = 10000; const wxEventType wxEVT_USER_FIRST = wxEVT_FIRST + 2000; DEFINE_EVENT_TYPE(wxEVT_NULL) -DEFINE_EVENT_TYPE(wxEVT_IDLE) -DEFINE_EVENT_TYPE(wxEVT_SOCKET) -DEFINE_EVENT_TYPE(wxEVT_TIMER) +wxDEFINE_EVENT( wxEVT_IDLE, wxIdleEvent ) #endif // wxUSE_BASE #if wxUSE_GUI -DEFINE_EVENT_TYPE(wxEVT_COMMAND_BUTTON_CLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHECKBOX_CLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHOICE_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LISTBOX_DOUBLECLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_MENU_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SLIDER_UPDATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RADIOBOX_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RADIOBUTTON_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SCROLLBAR_UPDATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_VLBOX_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_COMBOBOX_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOOL_RCLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOOL_ENTER) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPINCTRL_UPDATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_MENU_SELECTED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_SLIDER_UPDATED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_SCROLLBAR_UPDATED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_VLBOX_SELECTED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TOOL_RCLICKED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TOOL_ENTER, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_SPINCTRL_UPDATED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED, wxCommandEvent ) // Mouse event types -DEFINE_EVENT_TYPE(wxEVT_LEFT_DOWN) -DEFINE_EVENT_TYPE(wxEVT_LEFT_UP) -DEFINE_EVENT_TYPE(wxEVT_MIDDLE_DOWN) -DEFINE_EVENT_TYPE(wxEVT_MIDDLE_UP) -DEFINE_EVENT_TYPE(wxEVT_RIGHT_DOWN) -DEFINE_EVENT_TYPE(wxEVT_RIGHT_UP) -DEFINE_EVENT_TYPE(wxEVT_MOTION) -DEFINE_EVENT_TYPE(wxEVT_ENTER_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_LEAVE_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_MIDDLE_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_RIGHT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_SET_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_KILL_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_CHILD_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_MOUSEWHEEL) -DEFINE_EVENT_TYPE(wxEVT_AUX1_DOWN) -DEFINE_EVENT_TYPE(wxEVT_AUX1_UP) -DEFINE_EVENT_TYPE(wxEVT_AUX1_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_AUX2_DOWN) -DEFINE_EVENT_TYPE(wxEVT_AUX2_UP) -DEFINE_EVENT_TYPE(wxEVT_AUX2_DCLICK) - -// Non-client mouse events -DEFINE_EVENT_TYPE(wxEVT_NC_LEFT_DOWN) -DEFINE_EVENT_TYPE(wxEVT_NC_LEFT_UP) -DEFINE_EVENT_TYPE(wxEVT_NC_MIDDLE_DOWN) -DEFINE_EVENT_TYPE(wxEVT_NC_MIDDLE_UP) -DEFINE_EVENT_TYPE(wxEVT_NC_RIGHT_DOWN) -DEFINE_EVENT_TYPE(wxEVT_NC_RIGHT_UP) -DEFINE_EVENT_TYPE(wxEVT_NC_MOTION) -DEFINE_EVENT_TYPE(wxEVT_NC_ENTER_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_NC_LEAVE_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_NC_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_NC_MIDDLE_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_NC_RIGHT_DCLICK) +wxDEFINE_EVENT( wxEVT_LEFT_DOWN, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_LEFT_UP, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_MIDDLE_DOWN, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_MIDDLE_UP, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_RIGHT_DOWN, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_RIGHT_UP, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_MOTION, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_ENTER_WINDOW, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_LEAVE_WINDOW, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_LEFT_DCLICK, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_MIDDLE_DCLICK, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_RIGHT_DCLICK, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_SET_FOCUS, wxFocusEvent ) +wxDEFINE_EVENT( wxEVT_KILL_FOCUS, wxFocusEvent ) +wxDEFINE_EVENT( wxEVT_CHILD_FOCUS, wxChildFocusEvent ) +wxDEFINE_EVENT( wxEVT_MOUSEWHEEL, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_AUX1_DOWN, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_AUX1_UP, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_AUX1_DCLICK, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_AUX2_DOWN, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_AUX2_UP, wxMouseEvent ) +wxDEFINE_EVENT( wxEVT_AUX2_DCLICK, wxMouseEvent ) // Character input event type -DEFINE_EVENT_TYPE(wxEVT_CHAR) -DEFINE_EVENT_TYPE(wxEVT_CHAR_HOOK) -DEFINE_EVENT_TYPE(wxEVT_NAVIGATION_KEY) -DEFINE_EVENT_TYPE(wxEVT_KEY_DOWN) -DEFINE_EVENT_TYPE(wxEVT_KEY_UP) +wxDEFINE_EVENT( wxEVT_CHAR, wxKeyEvent ) +wxDEFINE_EVENT( wxEVT_CHAR_HOOK, wxKeyEvent ) +wxDEFINE_EVENT( wxEVT_NAVIGATION_KEY, wxNavigationKeyEvent ) +wxDEFINE_EVENT( wxEVT_KEY_DOWN, wxKeyEvent ) +wxDEFINE_EVENT( wxEVT_KEY_UP, wxKeyEvent ) #if wxUSE_HOTKEY -DEFINE_EVENT_TYPE(wxEVT_HOTKEY) +wxDEFINE_EVENT( wxEVT_HOTKEY, wxKeyEvent ) #endif // Set cursor event -DEFINE_EVENT_TYPE(wxEVT_SET_CURSOR) +wxDEFINE_EVENT( wxEVT_SET_CURSOR, wxSetCursorEvent ) // wxScrollbar and wxSlider event identifiers -DEFINE_EVENT_TYPE(wxEVT_SCROLL_TOP) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_BOTTOM) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_LINEUP) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_LINEDOWN) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_PAGEUP) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_PAGEDOWN) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_THUMBTRACK) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_THUMBRELEASE) -DEFINE_EVENT_TYPE(wxEVT_SCROLL_CHANGED) +wxDEFINE_EVENT( wxEVT_SCROLL_TOP, wxScrollEvent ) +wxDEFINE_EVENT( wxEVT_SCROLL_BOTTOM, wxScrollEvent ) +wxDEFINE_EVENT( wxEVT_SCROLL_LINEUP, wxScrollEvent ) +wxDEFINE_EVENT( wxEVT_SCROLL_LINEDOWN, wxScrollEvent ) +wxDEFINE_EVENT( wxEVT_SCROLL_PAGEUP, wxScrollEvent ) +wxDEFINE_EVENT( wxEVT_SCROLL_PAGEDOWN, wxScrollEvent ) +wxDEFINE_EVENT( wxEVT_SCROLL_THUMBTRACK, wxScrollEvent ) +wxDEFINE_EVENT( wxEVT_SCROLL_THUMBRELEASE, wxScrollEvent ) +wxDEFINE_EVENT( wxEVT_SCROLL_CHANGED, wxScrollEvent ) // Scroll events from wxWindow -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_TOP) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_BOTTOM) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_LINEUP) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_LINEDOWN) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_PAGEUP) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_PAGEDOWN) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_THUMBTRACK) -DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_THUMBRELEASE) +wxDEFINE_EVENT( wxEVT_SCROLLWIN_TOP, wxScrollWinEvent ) +wxDEFINE_EVENT( wxEVT_SCROLLWIN_BOTTOM, wxScrollWinEvent ) +wxDEFINE_EVENT( wxEVT_SCROLLWIN_LINEUP, wxScrollWinEvent ) +wxDEFINE_EVENT( wxEVT_SCROLLWIN_LINEDOWN, wxScrollWinEvent ) +wxDEFINE_EVENT( wxEVT_SCROLLWIN_PAGEUP, wxScrollWinEvent ) +wxDEFINE_EVENT( wxEVT_SCROLLWIN_PAGEDOWN, wxScrollWinEvent ) +wxDEFINE_EVENT( wxEVT_SCROLLWIN_THUMBTRACK, wxScrollWinEvent ) +wxDEFINE_EVENT( wxEVT_SCROLLWIN_THUMBRELEASE, wxScrollWinEvent ) // System events -DEFINE_EVENT_TYPE(wxEVT_SIZE) -DEFINE_EVENT_TYPE(wxEVT_SIZING) -DEFINE_EVENT_TYPE(wxEVT_MOVE) -DEFINE_EVENT_TYPE(wxEVT_MOVING) -DEFINE_EVENT_TYPE(wxEVT_MOVE_START) -DEFINE_EVENT_TYPE(wxEVT_MOVE_END) -DEFINE_EVENT_TYPE(wxEVT_CLOSE_WINDOW) -DEFINE_EVENT_TYPE(wxEVT_END_SESSION) -DEFINE_EVENT_TYPE(wxEVT_QUERY_END_SESSION) -DEFINE_EVENT_TYPE(wxEVT_HIBERNATE) -DEFINE_EVENT_TYPE(wxEVT_ACTIVATE_APP) -DEFINE_EVENT_TYPE(wxEVT_ACTIVATE) -DEFINE_EVENT_TYPE(wxEVT_CREATE) -DEFINE_EVENT_TYPE(wxEVT_DESTROY) -DEFINE_EVENT_TYPE(wxEVT_SHOW) -DEFINE_EVENT_TYPE(wxEVT_ICONIZE) -DEFINE_EVENT_TYPE(wxEVT_MAXIMIZE) -DEFINE_EVENT_TYPE(wxEVT_MOUSE_CAPTURE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_MOUSE_CAPTURE_LOST) -DEFINE_EVENT_TYPE(wxEVT_PAINT) -DEFINE_EVENT_TYPE(wxEVT_ERASE_BACKGROUND) -DEFINE_EVENT_TYPE(wxEVT_NC_PAINT) -DEFINE_EVENT_TYPE(wxEVT_PAINT_ICON) -DEFINE_EVENT_TYPE(wxEVT_MENU_OPEN) -DEFINE_EVENT_TYPE(wxEVT_MENU_CLOSE) -DEFINE_EVENT_TYPE(wxEVT_MENU_HIGHLIGHT) -DEFINE_EVENT_TYPE(wxEVT_CONTEXT_MENU) -DEFINE_EVENT_TYPE(wxEVT_SYS_COLOUR_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_DISPLAY_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_SETTING_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_QUERY_NEW_PALETTE) -DEFINE_EVENT_TYPE(wxEVT_PALETTE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_JOY_BUTTON_DOWN) -DEFINE_EVENT_TYPE(wxEVT_JOY_BUTTON_UP) -DEFINE_EVENT_TYPE(wxEVT_JOY_MOVE) -DEFINE_EVENT_TYPE(wxEVT_JOY_ZMOVE) -DEFINE_EVENT_TYPE(wxEVT_DROP_FILES) -DEFINE_EVENT_TYPE(wxEVT_DRAW_ITEM) -DEFINE_EVENT_TYPE(wxEVT_MEASURE_ITEM) -DEFINE_EVENT_TYPE(wxEVT_COMPARE_ITEM) -DEFINE_EVENT_TYPE(wxEVT_INIT_DIALOG) -DEFINE_EVENT_TYPE(wxEVT_UPDATE_UI) +wxDEFINE_EVENT( wxEVT_SIZE, wxSizeEvent ) +wxDEFINE_EVENT( wxEVT_SIZING, wxSizeEvent ) +wxDEFINE_EVENT( wxEVT_MOVE, wxMoveEvent ) +wxDEFINE_EVENT( wxEVT_MOVING, wxMoveEvent ) +wxDEFINE_EVENT( wxEVT_MOVE_START, wxMoveEvent ) +wxDEFINE_EVENT( wxEVT_MOVE_END, wxMoveEvent ) +wxDEFINE_EVENT( wxEVT_CLOSE_WINDOW, wxCloseEvent ) +wxDEFINE_EVENT( wxEVT_END_SESSION, wxCloseEvent ) +wxDEFINE_EVENT( wxEVT_QUERY_END_SESSION, wxCloseEvent ) +wxDEFINE_EVENT( wxEVT_HIBERNATE, wxActivateEvent ) +wxDEFINE_EVENT( wxEVT_ACTIVATE_APP, wxActivateEvent ) +wxDEFINE_EVENT( wxEVT_ACTIVATE, wxActivateEvent ) +wxDEFINE_EVENT( wxEVT_CREATE, wxWindowCreateEvent ) +wxDEFINE_EVENT( wxEVT_DESTROY, wxWindowDestroyEvent ) +wxDEFINE_EVENT( wxEVT_SHOW, wxShowEvent ) +wxDEFINE_EVENT( wxEVT_ICONIZE, wxIconizeEvent ) +wxDEFINE_EVENT( wxEVT_MAXIMIZE, wxMaximizeEvent ) +wxDEFINE_EVENT( wxEVT_MOUSE_CAPTURE_CHANGED, wxMouseCaptureChangedEvent ) +wxDEFINE_EVENT( wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEvent ) +wxDEFINE_EVENT( wxEVT_PAINT, wxPaintEvent ) +wxDEFINE_EVENT( wxEVT_ERASE_BACKGROUND, wxEraseEvent ) +wxDEFINE_EVENT( wxEVT_NC_PAINT, wxNcPaintEvent ) +wxDEFINE_EVENT( wxEVT_MENU_OPEN, wxMenuEvent ) +wxDEFINE_EVENT( wxEVT_MENU_CLOSE, wxMenuEvent ) +wxDEFINE_EVENT( wxEVT_MENU_HIGHLIGHT, wxMenuEvent ) +wxDEFINE_EVENT( wxEVT_CONTEXT_MENU, wxContextMenuEvent ) +wxDEFINE_EVENT( wxEVT_SYS_COLOUR_CHANGED, wxSysColourChangedEvent ) +wxDEFINE_EVENT( wxEVT_DISPLAY_CHANGED, wxDisplayChangedEvent ) +wxDEFINE_EVENT( wxEVT_QUERY_NEW_PALETTE, wxQueryNewPaletteEvent ) +wxDEFINE_EVENT( wxEVT_PALETTE_CHANGED, wxPaletteChangedEvent ) +wxDEFINE_EVENT( wxEVT_JOY_BUTTON_DOWN, wxJoystickEvent ) +wxDEFINE_EVENT( wxEVT_JOY_BUTTON_UP, wxJoystickEvent ) +wxDEFINE_EVENT( wxEVT_JOY_MOVE, wxJoystickEvent ) +wxDEFINE_EVENT( wxEVT_JOY_ZMOVE, wxJoystickEvent ) +wxDEFINE_EVENT( wxEVT_DROP_FILES, wxDropFilesEvent ) +wxDEFINE_EVENT( wxEVT_INIT_DIALOG, wxInitDialogEvent ) +wxDEFINE_EVENT( wxEVT_UPDATE_UI, wxUpdateUIEvent ) // Clipboard events -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_COPY) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_CUT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_PASTE) +wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_COPY, wxClipboardTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_CUT, wxClipboardTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_PASTE, wxClipboardTextEvent ) // Generic command events // Note: a click is a higher-level event than button down/up -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LEFT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RIGHT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SET_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_KILL_FOCUS) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_ENTER) +wxDEFINE_EVENT( wxEVT_COMMAND_LEFT_CLICK, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LEFT_DCLICK, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RIGHT_CLICK, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RIGHT_DCLICK, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_SET_FOCUS, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_KILL_FOCUS, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_ENTER, wxCommandEvent ) // Help events -DEFINE_EVENT_TYPE(wxEVT_HELP) -DEFINE_EVENT_TYPE(wxEVT_DETAILED_HELP) +wxDEFINE_EVENT( wxEVT_HELP, wxHelpEvent ) +wxDEFINE_EVENT( wxEVT_DETAILED_HELP, wxHelpEvent ) #endif // wxUSE_GUI @@ -342,6 +321,13 @@ int wxNewEventType() return s_lastUsedEventType++; } +// ---------------------------------------------------------------------------- +// wxEventFunctor +// ---------------------------------------------------------------------------- + +wxEventFunctor::~wxEventFunctor() +{ +} // ---------------------------------------------------------------------------- // wxEvent @@ -359,11 +345,11 @@ int wxNewEventType() wxEvent::wxEvent(int theId, wxEventType commandType ) { m_eventType = commandType; - m_eventObject = (wxObject *) NULL; + m_eventObject = NULL; m_timeStamp = 0; m_id = theId; m_skipped = false; - m_callbackUserData = (wxObject *) NULL; + m_callbackUserData = NULL; m_isCommandEvent = false; m_propagationLevel = wxEVENT_PROPAGATE_NONE; } @@ -414,8 +400,8 @@ wxEvent& wxEvent::operator=(const wxEvent& src) wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId) : wxEvent(theId, commandType) { - m_clientData = (char *) NULL; - m_clientObject = (wxClientData *) NULL; + m_clientData = NULL; + m_clientObject = NULL; m_extraLong = 0; m_commandInt = 0; m_isCommandEvent = true; @@ -1035,11 +1021,11 @@ void wxEventHashTable::GrowEventTypeTable() wxEvtHandler::wxEvtHandler() { - m_nextHandler = (wxEvtHandler *) NULL; - m_previousHandler = (wxEvtHandler *) NULL; + m_nextHandler = NULL; + m_previousHandler = NULL; m_enabled = true; - m_dynamicEvents = (wxList *) NULL; - m_pendingEvents = (wxList *) NULL; + m_dynamicEvents = NULL; + m_pendingEvents = NULL; // no client data (yet) m_clientData = NULL; @@ -1065,8 +1051,8 @@ wxEvtHandler::~wxEvtHandler() wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)*it; // Remove ourselves from sink destructor notifications - // (this has usually been been done, in wxTrackable destructor) - wxEvtHandler *eventSink = entry->m_eventSink; + // (this has usually been done, in wxTrackable destructor) + wxEvtHandler *eventSink = entry->m_fn->GetHandler(); if ( eventSink ) { wxEventConnectionRef * const @@ -1078,8 +1064,7 @@ wxEvtHandler::~wxEvtHandler() } } - if (entry->m_callbackUserData) - delete entry->m_callbackUserData; + delete entry->m_callbackUserData; delete entry; } delete m_dynamicEvents; @@ -1238,13 +1223,12 @@ wxEvtHandler::ProcessEventIfMatches(const wxEventTableEntryBase& entry, // call the handler via wxApp method which allows the user to catch // any exceptions which may be thrown by any handler in the program // in one place - wxTheApp->HandleEvent(handler, (wxEventFunction)entry.m_fn, event); + wxTheApp->CallEventHandler(handler, *entry.m_fn, event); } else #endif // wxUSE_EXCEPTIONS { - // no need for an extra virtual function call - (handler->*((wxEventFunction) (entry.m_fn)))(event); + (*entry.m_fn)(handler, event); } if (!event.GetSkipped()) @@ -1382,14 +1366,13 @@ bool wxEvtHandler::SearchEventTable(wxEventTable& table, wxEvent& event) return false; } -void wxEvtHandler::Connect( int id, int lastId, +void wxEvtHandler::Subscribe( int id, int lastId, wxEventType eventType, - wxObjectEventFunction func, - wxObject *userData, - wxEvtHandler* eventSink ) + wxEventFunctor *func, + wxObject *userData ) { wxDynamicEventTableEntry *entry = - new wxDynamicEventTableEntry(eventType, id, lastId, func, userData, eventSink); + new wxDynamicEventTableEntry(eventType, id, lastId, func, userData); if (!m_dynamicEvents) m_dynamicEvents = new wxList; @@ -1398,6 +1381,7 @@ void wxEvtHandler::Connect( int id, int lastId, m_dynamicEvents->Insert( (wxObject*) entry ); // Make sure we get to know when a sink is destroyed + wxEvtHandler *eventSink = func->GetHandler(); if ( eventSink && eventSink != this ) { wxEventConnectionRef *evtConnRef = FindRefInTrackerList(eventSink); @@ -1408,15 +1392,18 @@ void wxEvtHandler::Connect( int id, int lastId, } } -bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, - wxObjectEventFunction func, - wxObject *userData, - wxEvtHandler* eventSink ) +bool +wxEvtHandler::Unsubscribe(int id, + int lastId, + wxEventType eventType, + const wxEventFunctor& func, + wxObject *userData) { if (!m_dynamicEvents) return false; // Remove connection from tracker node (wxEventConnectionRef) + wxEvtHandler *eventSink = func.GetHandler(); if ( eventSink && eventSink != this ) { wxEventConnectionRef *evtConnRef = FindRefInTrackerList(eventSink); @@ -1432,12 +1419,10 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, if ((entry->m_id == id) && ((entry->m_lastId == lastId) || (lastId == wxID_ANY)) && ((entry->m_eventType == eventType) || (eventType == wxEVT_NULL)) && - ((entry->m_fn == func) || (func == (wxObjectEventFunction)NULL)) && - ((entry->m_eventSink == eventSink) || (eventSink == (wxEvtHandler*)NULL)) && - ((entry->m_callbackUserData == userData) || (userData == (wxObject*)NULL))) + (*entry->m_fn == func) && + ((entry->m_callbackUserData == userData) || !userData)) { - if (entry->m_callbackUserData) - delete entry->m_callbackUserData; + delete entry->m_callbackUserData; m_dynamicEvents->Erase( node ); delete entry; return true; @@ -1463,8 +1448,7 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) if ((event.GetEventType() == entry->m_eventType) && (entry->m_fn != 0)) { - wxEvtHandler *handler = entry->m_eventSink ? entry->m_eventSink - : this; + wxEvtHandler *handler = entry->m_fn->GetHandler() ? entry->m_fn->GetHandler() : this; if ( ProcessEventIfMatches(*entry, handler, event) ) return true; } @@ -1543,10 +1527,9 @@ void wxEvtHandler::OnSinkDestroyed( wxEvtHandler *sink ) wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)node->GetData(); node_nxt = node->GetNext(); - if ( entry->m_eventSink==sink ) + if ( entry->m_fn->GetHandler() == sink ) { - if (entry->m_callbackUserData) - delete entry->m_callbackUserData; + delete entry->m_callbackUserData; m_dynamicEvents->Erase( node ); delete entry; } @@ -1575,8 +1558,8 @@ wxWindow* wxFindFocusDescendant(wxWindow* ancestor) else win = win->GetParent(); } - if (win == (wxWindow*) NULL) - focusWin = (wxWindow*) NULL; + if (win == NULL) + focusWin = NULL; return focusWin; } @@ -1616,3 +1599,4 @@ bool wxEventBlocker::ProcessEvent(wxEvent& event) } #endif // wxUSE_GUI + diff --git a/src/common/fddlgcmn.cpp b/src/common/fddlgcmn.cpp index 8783c725d9..4125cbd881 100644 --- a/src/common/fddlgcmn.cpp +++ b/src/common/fddlgcmn.cpp @@ -37,11 +37,11 @@ IMPLEMENT_DYNAMIC_CLASS(wxFindDialogEvent, wxCommandEvent) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND_NEXT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND_REPLACE) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND_REPLACE_ALL) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FIND_CLOSE) +wxDEFINE_EVENT( wxEVT_COMMAND_FIND, wxFindDialogEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_FIND_NEXT, wxFindDialogEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_FIND_REPLACE, wxFindDialogEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_FIND_REPLACE_ALL, wxFindDialogEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_FIND_CLOSE, wxFindDialogEvent ) // ============================================================================ // implementations diff --git a/src/common/filectrlcmn.cpp b/src/common/filectrlcmn.cpp index 76ef8187f4..13d48ccd92 100644 --- a/src/common/filectrlcmn.cpp +++ b/src/common/filectrlcmn.cpp @@ -25,9 +25,9 @@ const char wxFileCtrlNameStr[] = "wxfilectrl"; -DEFINE_EVENT_TYPE( wxEVT_FILECTRL_SELECTIONCHANGED ) -DEFINE_EVENT_TYPE( wxEVT_FILECTRL_FILEACTIVATED ) -DEFINE_EVENT_TYPE( wxEVT_FILECTRL_FOLDERCHANGED ) +wxDEFINE_EVENT( wxEVT_FILECTRL_SELECTIONCHANGED, wxFileCtrlEvent ) +wxDEFINE_EVENT( wxEVT_FILECTRL_FILEACTIVATED, wxFileCtrlEvent ) +wxDEFINE_EVENT( wxEVT_FILECTRL_FOLDERCHANGED, wxFileCtrlEvent ) IMPLEMENT_DYNAMIC_CLASS( wxFileCtrlEvent, wxCommandEvent ) diff --git a/src/common/filepickercmn.cpp b/src/common/filepickercmn.cpp index 4e4de6dc5d..3226cb46f0 100644 --- a/src/common/filepickercmn.cpp +++ b/src/common/filepickercmn.cpp @@ -44,8 +44,8 @@ const char wxDirPickerWidgetNameStr[] = "dirpickerwidget"; const char wxFilePickerWidgetLabel[] = wxTRANSLATE("Browse"); const char wxDirPickerWidgetLabel[] = wxTRANSLATE("Browse"); -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FILEPICKER_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_DIRPICKER_CHANGED) +wxDEFINE_EVENT( wxEVT_COMMAND_FILEPICKER_CHANGED, wxFileDirPickerEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEvent ) IMPLEMENT_DYNAMIC_CLASS(wxFileDirPickerEvent, wxCommandEvent) // ---------------------------------------------------------------------------- @@ -91,9 +91,7 @@ bool wxFileDirPickerCtrlBase::CreateBase(wxWindow *parent, // complete sizer creation wxPickerBase::PostCreation(); - m_picker->Connect(GetEventType(), - wxFileDirPickerEventHandler(wxFileDirPickerCtrlBase::OnFileDirChange), - NULL, this); + DoConnect( m_picker, this ); // default's wxPickerBase textctrl limit is too small for this control: // make it bigger diff --git a/src/common/fontpickercmn.cpp b/src/common/fontpickercmn.cpp index cc1dd50bbe..40f5e8befc 100644 --- a/src/common/fontpickercmn.cpp +++ b/src/common/fontpickercmn.cpp @@ -42,7 +42,7 @@ const char wxFontPickerCtrlNameStr[] = "fontpicker"; const char wxFontPickerWidgetNameStr[] = "fontpickerwidget"; -DEFINE_EVENT_TYPE(wxEVT_COMMAND_FONTPICKER_CHANGED) +wxDEFINE_EVENT(wxEVT_COMMAND_FONTPICKER_CHANGED, wxFontPickerEvent) IMPLEMENT_DYNAMIC_CLASS(wxFontPickerCtrl, wxPickerBase) IMPLEMENT_DYNAMIC_CLASS(wxFontPickerEvent, wxCommandEvent) diff --git a/src/common/headerctrlcmn.cpp b/src/common/headerctrlcmn.cpp index 47c6bb55f3..1299bb9a37 100644 --- a/src/common/headerctrlcmn.cpp +++ b/src/common/headerctrlcmn.cpp @@ -469,23 +469,23 @@ wxHeaderCtrlSimple::UpdateColumnWidthToFit(unsigned int idx, int widthTitle) IMPLEMENT_DYNAMIC_CLASS(wxHeaderCtrlEvent, wxNotifyEvent) -const wxEventType wxEVT_COMMAND_HEADER_CLICK = wxNewEventType(); -const wxEventType wxEVT_COMMAND_HEADER_RIGHT_CLICK = wxNewEventType(); -const wxEventType wxEVT_COMMAND_HEADER_MIDDLE_CLICK = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_CLICK, wxHeaderCtrlEvent); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_RIGHT_CLICK, wxHeaderCtrlEvent); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_MIDDLE_CLICK, wxHeaderCtrlEvent); -const wxEventType wxEVT_COMMAND_HEADER_DCLICK = wxNewEventType(); -const wxEventType wxEVT_COMMAND_HEADER_RIGHT_DCLICK = wxNewEventType(); -const wxEventType wxEVT_COMMAND_HEADER_MIDDLE_DCLICK = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_DCLICK, wxHeaderCtrlEvent); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_RIGHT_DCLICK, wxHeaderCtrlEvent); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_MIDDLE_DCLICK, wxHeaderCtrlEvent); -const wxEventType wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK, wxHeaderCtrlEvent); -const wxEventType wxEVT_COMMAND_HEADER_BEGIN_RESIZE = wxNewEventType(); -const wxEventType wxEVT_COMMAND_HEADER_RESIZING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_HEADER_END_RESIZE = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_BEGIN_RESIZE, wxHeaderCtrlEvent); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_RESIZING, wxHeaderCtrlEvent); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_END_RESIZE, wxHeaderCtrlEvent); -const wxEventType wxEVT_COMMAND_HEADER_BEGIN_REORDER = wxNewEventType(); -const wxEventType wxEVT_COMMAND_HEADER_END_REORDER = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_BEGIN_REORDER, wxHeaderCtrlEvent); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_END_REORDER, wxHeaderCtrlEvent); -const wxEventType wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED, wxHeaderCtrlEvent); #endif // wxUSE_HEADERCTRL diff --git a/src/common/hyperlnkcmn.cpp b/src/common/hyperlnkcmn.cpp index e7f27a4069..8c623073fe 100644 --- a/src/common/hyperlnkcmn.cpp +++ b/src/common/hyperlnkcmn.cpp @@ -43,7 +43,7 @@ // ============================================================================ IMPLEMENT_DYNAMIC_CLASS(wxHyperlinkEvent, wxCommandEvent) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_HYPERLINK) +wxDEFINE_EVENT( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEvent ) const char wxHyperlinkCtrlNameStr[] = "hyperlink"; diff --git a/src/common/listctrlcmn.cpp b/src/common/listctrlcmn.cpp index 22b5661be6..10beaebf89 100644 --- a/src/common/listctrlcmn.cpp +++ b/src/common/listctrlcmn.cpp @@ -26,25 +26,25 @@ const char wxListCtrlNameStr[] = "listCtrl"; // ListCtrl events -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_RDRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_END_LABEL_EDIT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ITEM) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_SELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_DESELECTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_KEY_DOWN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_INSERT_ITEM) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_DRAGGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_COL_END_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_ACTIVATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_ITEM_FOCUSED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_LIST_CACHE_HINT) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_BEGIN_DRAG, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_BEGIN_RDRAG, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_END_LABEL_EDIT, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_DELETE_ITEM, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_KEY_DOWN, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_INSERT_ITEM, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_CLICK, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_DRAGGING, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_COL_END_DRAG, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_ITEM_FOCUSED, wxListEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LIST_CACHE_HINT, wxListEvent ) #endif // wxUSE_LISTCTRL diff --git a/src/common/mediactrlcmn.cpp b/src/common/mediactrlcmn.cpp index b95b00b9a4..79e6799352 100644 --- a/src/common/mediactrlcmn.cpp +++ b/src/common/mediactrlcmn.cpp @@ -45,14 +45,14 @@ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ IMPLEMENT_CLASS(wxMediaCtrl, wxControl) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_STATECHANGED) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_PLAY) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_PAUSE) +wxDEFINE_EVENT( wxEVT_MEDIA_STATECHANGED, wxMediaEvent ) +wxDEFINE_EVENT( wxEVT_MEDIA_PLAY, wxMediaEvent ) +wxDEFINE_EVENT( wxEVT_MEDIA_PAUSE, wxMediaEvent ) IMPLEMENT_CLASS(wxMediaBackend, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxMediaEvent, wxEvent) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_FINISHED) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_LOADED) -DEFINE_EVENT_TYPE(wxEVT_MEDIA_STOP) +wxDEFINE_EVENT( wxEVT_MEDIA_FINISHED, wxMediaEvent ) +wxDEFINE_EVENT( wxEVT_MEDIA_LOADED, wxMediaEvent ) +wxDEFINE_EVENT( wxEVT_MEDIA_STOP, wxMediaEvent ) //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // diff --git a/src/common/nbkbase.cpp b/src/common/nbkbase.cpp index 1671877483..dd6608e733 100644 --- a/src/common/nbkbase.cpp +++ b/src/common/nbkbase.cpp @@ -35,8 +35,8 @@ // implementation // ============================================================================ -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) +wxDEFINE_EVENT( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxBookCtrlEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, wxBookCtrlEvent ) // ---------------------------------------------------------------------------- // geometry diff --git a/src/common/powercmn.cpp b/src/common/powercmn.cpp index 578dbb2309..c15ebebc93 100644 --- a/src/common/powercmn.cpp +++ b/src/common/powercmn.cpp @@ -34,10 +34,10 @@ // ============================================================================ #ifdef wxHAS_POWER_EVENTS - DEFINE_EVENT_TYPE(wxEVT_POWER_SUSPENDING) - DEFINE_EVENT_TYPE(wxEVT_POWER_SUSPENDED) - DEFINE_EVENT_TYPE(wxEVT_POWER_SUSPEND_CANCEL) - DEFINE_EVENT_TYPE(wxEVT_POWER_RESUME) + wxDEFINE_EVENT( wxEVT_POWER_SUSPENDING, wxPowerEvent ) + wxDEFINE_EVENT( wxEVT_POWER_SUSPENDED, wxPowerEvent ) + wxDEFINE_EVENT( wxEVT_POWER_SUSPEND_CANCEL, wxPowerEvent ) + wxDEFINE_EVENT( wxEVT_POWER_RESUME, wxPowerEvent ) IMPLEMENT_DYNAMIC_CLASS(wxPowerEvent, wxEvent) #endif diff --git a/src/common/process.cpp b/src/common/process.cpp index 36764bf2f5..bdeccf9923 100644 --- a/src/common/process.cpp +++ b/src/common/process.cpp @@ -30,7 +30,7 @@ // event tables and such // ---------------------------------------------------------------------------- -DEFINE_EVENT_TYPE(wxEVT_END_PROCESS) +wxDEFINE_EVENT( wxEVT_END_PROCESS, wxProcessEvent ) IMPLEMENT_DYNAMIC_CLASS(wxProcess, wxEvtHandler) IMPLEMENT_DYNAMIC_CLASS(wxProcessEvent, wxEvent) diff --git a/src/common/socket.cpp b/src/common/socket.cpp index dc64603aa5..3d5338425b 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -78,6 +78,9 @@ WX_CHECK_BUILD_OPTIONS("wxNet") // macros and constants // -------------------------------------------------------------------------- +// event +wxDEFINE_EVENT(wxEVT_SOCKET, wxSocketEvent); + // discard buffer #define MAX_DISCARD_SIZE (10 * 1024) diff --git a/src/common/spinbuttcmn.cpp b/src/common/spinbuttcmn.cpp new file mode 100644 index 0000000000..05f15d7d56 --- /dev/null +++ b/src/common/spinbuttcmn.cpp @@ -0,0 +1,31 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/spinbuttcmn.cpp +// Purpose: define wxSpinButton event types +// Author: Peter Most +// Created: 01.11.08 +// RCS-ID: $Id:$ +// Copyright: (c) 2008-2009 wxWidgets team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/spinbutt.h" + +wxDEFINE_EVENT_REFERENCE( wxEVT_SPIN_UP, wxSpinEvent, wxEVT_SCROLL_LINEUP ) +wxDEFINE_EVENT_REFERENCE( wxEVT_SPIN_DOWN, wxSpinEvent, wxEVT_SCROLL_LINEDOWN ) +wxDEFINE_EVENT_REFERENCE( wxEVT_SPIN, wxSpinEvent, wxEVT_SCROLL_THUMBTRACK ) + diff --git a/src/common/spinctrlcmn.cpp b/src/common/spinctrlcmn.cpp new file mode 100644 index 0000000000..68b7e2e10b --- /dev/null +++ b/src/common/spinctrlcmn.cpp @@ -0,0 +1,31 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: src/common/spinctrlcmn.cpp +// Purpose: define wxSpinCtrl event types +// Author: Peter Most +// Created: 01.11.08 +// RCS-ID: $Id:$ +// Copyright: (c) 2008-2009 wxWidgets team +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +// For compilers that support precompilation, includes "wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + +#include "wx/spinbutt.h" +#include "wx/spinctrl.h" + +wxDEFINE_EVENT(wxEVT_COMMAND_SPINCTRL_UPDATED, wxSpinEvent) +wxDEFINE_EVENT(wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED, wxSpinDoubleEvent) + diff --git a/src/common/srchcmn.cpp b/src/common/srchcmn.cpp index 3f5aba1c86..cff6badf99 100644 --- a/src/common/srchcmn.cpp +++ b/src/common/srchcmn.cpp @@ -35,8 +35,8 @@ const char wxSearchCtrlNameStr[] = "searchCtrl"; -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN) +wxDEFINE_EVENT(wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN, wxCommandEvent); +wxDEFINE_EVENT(wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN, wxCommandEvent); #endif // wxUSE_SEARCHCTRL diff --git a/src/common/taskbarcmn.cpp b/src/common/taskbarcmn.cpp index 5373d527c7..ec8bd7feca 100644 --- a/src/common/taskbarcmn.cpp +++ b/src/common/taskbarcmn.cpp @@ -31,15 +31,15 @@ WX_CHECK_BUILD_OPTIONS("wxAdvanced") #include "wx/taskbar.h" -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_MOVE ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_DOWN ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_UP ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_DOWN ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_UP ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_LEFT_DCLICK ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_RIGHT_DCLICK ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_BALLOON_TIMEOUT ) -DEFINE_EVENT_TYPE( wxEVT_TASKBAR_BALLOON_CLICK ) +wxDEFINE_EVENT( wxEVT_TASKBAR_MOVE, wxTaskBarIconEvent ) +wxDEFINE_EVENT( wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEvent ) +wxDEFINE_EVENT( wxEVT_TASKBAR_LEFT_UP, wxTaskBarIconEvent ) +wxDEFINE_EVENT( wxEVT_TASKBAR_RIGHT_DOWN, wxTaskBarIconEvent ) +wxDEFINE_EVENT( wxEVT_TASKBAR_RIGHT_UP, wxTaskBarIconEvent ) +wxDEFINE_EVENT( wxEVT_TASKBAR_LEFT_DCLICK, wxTaskBarIconEvent ) +wxDEFINE_EVENT( wxEVT_TASKBAR_RIGHT_DCLICK, wxTaskBarIconEvent ) +wxDEFINE_EVENT( wxEVT_TASKBAR_BALLOON_TIMEOUT, wxTaskBarIconEvent ) +wxDEFINE_EVENT( wxEVT_TASKBAR_BALLOON_CLICK, wxTaskBarIconEvent ) BEGIN_EVENT_TABLE(wxTaskBarIconBase, wxEvtHandler) diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index 53dd431459..1df66feccb 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -49,10 +49,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxTextUrlEvent, wxCommandEvent) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_ENTER) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_URL) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_MAXLEN) +wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_ENTER, wxCommandEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_URL, wxTextUrlEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_MAXLEN, wxCommandEvent ) IMPLEMENT_ABSTRACT_CLASS(wxTextCtrlBase, wxControl) @@ -994,6 +994,6 @@ bool wxTextCtrlBase::SendTextUpdatedEvent(wxWindow *win) // define this one even if !wxUSE_TEXTCTRL because it is also used by other // controls (wxComboBox and wxSpinCtrl) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TEXT_UPDATED) +wxDEFINE_EVENT( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEvent ) #endif // wxUSE_TEXTCTRL/!wxUSE_TEXTCTRL diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index bb89232709..defa3b9dd4 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -41,6 +41,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxTimerEvent, wxEvent) +wxDEFINE_EVENT(wxEVT_TIMER, wxTimerEvent); + // ============================================================================ // wxTimerBase implementation // ============================================================================ diff --git a/src/common/treebase.cpp b/src/common/treebase.cpp index bea5d72e35..0bab501d0e 100644 --- a/src/common/treebase.cpp +++ b/src/common/treebase.cpp @@ -33,27 +33,27 @@ // events // ---------------------------------------------------------------------------- -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_RDRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_LABEL_EDIT) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_DELETE_ITEM) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_GET_INFO) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SET_INFO) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_EXPANDING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_COLLAPSING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_SEL_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_KEY_DOWN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_ACTIVATED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_END_DRAG) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TREE_ITEM_MENU) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_BEGIN_DRAG, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_BEGIN_RDRAG, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_END_LABEL_EDIT, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_DELETE_ITEM, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_GET_INFO, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_SET_INFO, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_ITEM_EXPANDED, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_ITEM_EXPANDING, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_ITEM_COLLAPSED, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_ITEM_COLLAPSING, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_SEL_CHANGED, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_SEL_CHANGING, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_KEY_DOWN, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_END_DRAG, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP, wxTreeEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREE_ITEM_MENU, wxTreeEvent ) // ---------------------------------------------------------------------------- // Tree event diff --git a/src/generic/calctrlg.cpp b/src/generic/calctrlg.cpp index ec7a53158e..40b9f06cd3 100644 --- a/src/generic/calctrlg.cpp +++ b/src/generic/calctrlg.cpp @@ -347,7 +347,7 @@ void wxGenericCalendarCtrl::CreateYearSpinCtrl() NULL, this); m_spinYear->Connect(m_spinYear->GetId(), wxEVT_COMMAND_SPINCTRL_UPDATED, - wxCommandEventHandler(wxGenericCalendarCtrl::OnYearChange), + wxSpinEventHandler(wxGenericCalendarCtrl::OnYearChange), NULL, this); } @@ -1607,7 +1607,7 @@ void wxGenericCalendarCtrl::OnMonthChange(wxCommandEvent& event) SetDateAndNotify(target); } -void wxGenericCalendarCtrl::OnYearChange(wxCommandEvent& event) +void wxGenericCalendarCtrl::HandleYearChange(wxCommandEvent& event) { int year = (int)event.GetInt(); if ( year == INT_MIN ) @@ -1637,10 +1637,15 @@ void wxGenericCalendarCtrl::OnYearChange(wxCommandEvent& event) } } +void wxGenericCalendarCtrl::OnYearChange(wxSpinEvent& event) +{ + HandleYearChange( event ); +} + void wxGenericCalendarCtrl::OnYearTextChange(wxCommandEvent& event) { SetUserChangedYear(); - OnYearChange(event); + HandleYearChange(event); } // Responds to colour changes, and passes event on to children. diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index aa24856ec2..9ba0e545e4 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -49,8 +49,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxChoicebook, wxBookCtrlBase) -const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, wxBookCtrlEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, wxBookCtrlEvent ) BEGIN_EVENT_TABLE(wxChoicebook, wxBookCtrlBase) EVT_CHOICE(wxID_ANY, wxChoicebook::OnChoiceSelected) diff --git a/src/generic/collpaneg.cpp b/src/generic/collpaneg.cpp index 0afc81416e..5a971e99a9 100644 --- a/src/generic/collpaneg.cpp +++ b/src/generic/collpaneg.cpp @@ -45,7 +45,7 @@ const char wxCollapsiblePaneNameStr[] = "collapsiblePane"; // wxGenericCollapsiblePane //----------------------------------------------------------------------------- -DEFINE_EVENT_TYPE(wxEVT_COMMAND_COLLPANE_CHANGED) +wxDEFINE_EVENT( wxEVT_COMMAND_COLLPANE_CHANGED, wxCollapsiblePaneEvent ) IMPLEMENT_DYNAMIC_CLASS(wxGenericCollapsiblePane, wxControl) IMPLEMENT_DYNAMIC_CLASS(wxCollapsiblePaneEvent, wxCommandEvent) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index aff01b06a9..418b9c901a 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -115,26 +115,26 @@ WX_DEFINE_OBJARRAY(wxGridCellWithAttrArray) // events // ---------------------------------------------------------------------------- -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_LEFT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_RIGHT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_BEGIN_DRAG) -DEFINE_EVENT_TYPE(wxEVT_GRID_LABEL_LEFT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_LABEL_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_LABEL_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_LABEL_RIGHT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_GRID_ROW_SIZE) -DEFINE_EVENT_TYPE(wxEVT_GRID_COL_SIZE) -DEFINE_EVENT_TYPE(wxEVT_GRID_COL_MOVE) -DEFINE_EVENT_TYPE(wxEVT_GRID_COL_SORT) -DEFINE_EVENT_TYPE(wxEVT_GRID_RANGE_SELECT) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_GRID_CELL_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_GRID_SELECT_CELL) -DEFINE_EVENT_TYPE(wxEVT_GRID_EDITOR_SHOWN) -DEFINE_EVENT_TYPE(wxEVT_GRID_EDITOR_HIDDEN) -DEFINE_EVENT_TYPE(wxEVT_GRID_EDITOR_CREATED) +wxDEFINE_EVENT( wxEVT_GRID_CELL_LEFT_CLICK, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_CELL_RIGHT_DCLICK, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_CELL_BEGIN_DRAG, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_LABEL_LEFT_DCLICK, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_LABEL_RIGHT_DCLICK, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_ROW_SIZE, wxGridSizeEvent ) +wxDEFINE_EVENT( wxEVT_GRID_COL_SIZE, wxGridSizeEvent ) +wxDEFINE_EVENT( wxEVT_GRID_COL_MOVE, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_COL_SORT, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_RANGE_SELECT, wxGridRangeSelectEvent ) +wxDEFINE_EVENT( wxEVT_GRID_CELL_CHANGING, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_CELL_CHANGED, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_SELECT_CELL, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_EDITOR_SHOWN, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_EDITOR_HIDDEN, wxGridEvent ) +wxDEFINE_EVENT( wxEVT_GRID_EDITOR_CREATED, wxGridEditorCreatedEvent ) // ============================================================================ // implementation diff --git a/src/generic/laywin.cpp b/src/generic/laywin.cpp index 524f4bf45a..9976702459 100644 --- a/src/generic/laywin.cpp +++ b/src/generic/laywin.cpp @@ -29,8 +29,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxQueryLayoutInfoEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxCalculateLayoutEvent, wxEvent) -DEFINE_EVENT_TYPE(wxEVT_QUERY_LAYOUT_INFO) -DEFINE_EVENT_TYPE(wxEVT_CALCULATE_LAYOUT) +wxDEFINE_EVENT( wxEVT_QUERY_LAYOUT_INFO, wxQueryLayoutInfoEvent ) +wxDEFINE_EVENT( wxEVT_CALCULATE_LAYOUT, wxCalculateLayoutEvent ) #if wxUSE_SASH IMPLEMENT_CLASS(wxSashLayoutWindow, wxSashWindow) diff --git a/src/generic/listbkg.cpp b/src/generic/listbkg.cpp index d7cf2df1db..0b90b6526f 100644 --- a/src/generic/listbkg.cpp +++ b/src/generic/listbkg.cpp @@ -55,8 +55,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxListbook, wxBookCtrlBase) -const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, wxBookCtrlEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, wxBookCtrlEvent ) BEGIN_EVENT_TABLE(wxListbook, wxBookCtrlBase) EVT_SIZE(wxListbook::OnSize) diff --git a/src/generic/sashwin.cpp b/src/generic/sashwin.cpp index f1524dc61a..547eefecf4 100644 --- a/src/generic/sashwin.cpp +++ b/src/generic/sashwin.cpp @@ -35,7 +35,7 @@ #include "wx/laywin.h" -DEFINE_EVENT_TYPE(wxEVT_SASH_DRAGGED) +wxDEFINE_EVENT( wxEVT_SASH_DRAGGED, wxSashEvent ) IMPLEMENT_DYNAMIC_CLASS(wxSashWindow, wxWindow) IMPLEMENT_DYNAMIC_CLASS(wxSashEvent, wxCommandEvent) diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index b6beb9736b..f22f3c243e 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -39,10 +39,10 @@ #include -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_DOUBLECLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_SPLITTER_UNSPLIT) +wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED, wxSplitterEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING, wxSplitterEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_DOUBLECLICKED, wxSplitterEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_SPLITTER_UNSPLIT, wxSplitterEvent ) IMPLEMENT_DYNAMIC_CLASS(wxSplitterWindow, wxWindow) diff --git a/src/generic/toolbkg.cpp b/src/generic/toolbkg.cpp index 969960b988..c371989713 100644 --- a/src/generic/toolbkg.cpp +++ b/src/generic/toolbkg.cpp @@ -45,8 +45,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolbook, wxBookCtrlBase) -const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, wxBookCtrlEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, wxBookCtrlEvent ) BEGIN_EVENT_TABLE(wxToolbook, wxBookCtrlBase) EVT_SIZE(wxToolbook::OnSize) diff --git a/src/generic/treebkg.cpp b/src/generic/treebkg.cpp index 4984fa306c..acb9952927 100644 --- a/src/generic/treebkg.cpp +++ b/src/generic/treebkg.cpp @@ -47,10 +47,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxTreebook, wxBookCtrlBase) -const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING = wxNewEventType(); -const wxEventType wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED = wxNewEventType(); -const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED = wxNewEventType(); -const wxEventType wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED = wxNewEventType(); +wxDEFINE_EVENT( wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, wxBookCtrlEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, wxBookCtrlEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED, wxBookCtrlEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED, wxBookCtrlEvent ) BEGIN_EVENT_TABLE(wxTreebook, wxBookCtrlBase) EVT_TREE_SEL_CHANGED (wxID_ANY, wxTreebook::OnTreeSelectionChange) diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 03b398e03f..e42f6c65e9 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -81,11 +81,11 @@ private: // event tables and such // ---------------------------------------------------------------------------- -DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_WIZARD_CANCEL) -DEFINE_EVENT_TYPE(wxEVT_WIZARD_FINISHED) -DEFINE_EVENT_TYPE(wxEVT_WIZARD_HELP) +wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGED, wxWizardEvent ) +wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGING, wxWizardEvent ) +wxDEFINE_EVENT( wxEVT_WIZARD_CANCEL, wxWizardEvent ) +wxDEFINE_EVENT( wxEVT_WIZARD_FINISHED, wxWizardEvent ) +wxDEFINE_EVENT( wxEVT_WIZARD_HELP, wxWizardEvent ) BEGIN_EVENT_TABLE(wxWizard, wxDialog) EVT_BUTTON(wxID_CANCEL, wxWizard::OnCancel) diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index 324dc3856d..fcbc02edfc 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -31,7 +31,7 @@ const char wxCollapsiblePaneNameStr[] = "collapsiblePane"; -DEFINE_EVENT_TYPE(wxEVT_COMMAND_COLLPANE_CHANGED) +wxDEFINE_EVENT( wxEVT_COMMAND_COLLPANE_CHANGED, wxCollapsiblePaneEvent ) IMPLEMENT_DYNAMIC_CLASS(wxCollapsiblePaneEvent, wxCommandEvent) diff --git a/src/gtk/tglbtn.cpp b/src/gtk/tglbtn.cpp index 26f1061997..63fd5414cc 100644 --- a/src/gtk/tglbtn.cpp +++ b/src/gtk/tglbtn.cpp @@ -39,7 +39,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog } } -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) // ------------------------------------------------------------------------ // wxBitmapToggleButton diff --git a/src/gtk1/tglbtn.cpp b/src/gtk1/tglbtn.cpp index a4f9d6da9e..a3cd62115b 100644 --- a/src/gtk1/tglbtn.cpp +++ b/src/gtk1/tglbtn.cpp @@ -47,7 +47,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog } } -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) // ------------------------------------------------------------------------ // wxToggleBitmapButton diff --git a/src/html/htmlctrl/webkit/webkit.mm b/src/html/htmlctrl/webkit/webkit.mm index 8926f450e4..b953a9eabb 100644 --- a/src/html/htmlctrl/webkit/webkit.mm +++ b/src/html/htmlctrl/webkit/webkit.mm @@ -288,7 +288,7 @@ DEFINE_ONE_SHOT_HANDLER_GETTER( wxWebKitCtrlEventHandler ) IMPLEMENT_DYNAMIC_CLASS( wxWebKitStateChangedEvent, wxCommandEvent ) -DEFINE_EVENT_TYPE( wxEVT_WEBKIT_STATE_CHANGED ) +wxDEFINE_EVENT( wxEVT_WEBKIT_STATE_CHANGED, wxWebKitStateChangedEvent ) wxWebKitStateChangedEvent::wxWebKitStateChangedEvent( wxWindow* win ) { @@ -302,7 +302,7 @@ wxWebKitStateChangedEvent::wxWebKitStateChangedEvent( wxWindow* win ) IMPLEMENT_DYNAMIC_CLASS( wxWebKitBeforeLoadEvent, wxCommandEvent ) -DEFINE_EVENT_TYPE( wxEVT_WEBKIT_BEFORE_LOAD ) +wxDEFINE_EVENT( wxEVT_WEBKIT_BEFORE_LOAD, wxWebKitBeforeLoadEvent ) wxWebKitBeforeLoadEvent::wxWebKitBeforeLoadEvent( wxWindow* win ) { @@ -318,7 +318,7 @@ wxWebKitBeforeLoadEvent::wxWebKitBeforeLoadEvent( wxWindow* win ) IMPLEMENT_DYNAMIC_CLASS( wxWebKitNewWindowEvent, wxCommandEvent ) -DEFINE_EVENT_TYPE( wxEVT_WEBKIT_NEW_WINDOW ) +wxDEFINE_EVENT( wxEVT_WEBKIT_NEW_WINDOW, wxWebKitNewWindowEvent ) wxWebKitNewWindowEvent::wxWebKitNewWindowEvent( wxWindow* win ) { diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 042e4fbbf2..929c7bb270 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -39,9 +39,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxHtmlLinkEvent, wxCommandEvent) IMPLEMENT_DYNAMIC_CLASS(wxHtmlCellEvent, wxCommandEvent) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_HTML_CELL_CLICKED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_HTML_CELL_HOVER) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_HTML_LINK_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_HTML_CELL_CLICKED, wxHtmlCellEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_HTML_CELL_HOVER, wxHtmlCellEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEvent ) #if wxUSE_CLIPBOARD diff --git a/src/motif/checkbox.cpp b/src/motif/checkbox.cpp index e6fc7d7314..f2132d5122 100644 --- a/src/motif/checkbox.cpp +++ b/src/motif/checkbox.cpp @@ -218,7 +218,7 @@ wxCheckBoxState wxCheckBox::DoGet3StateValue() const #if wxUSE_TOGGLEBTN -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl) bool wxToggleButton::Create( wxWindow* parent, wxWindowID id, diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index afab3e9a9d..5232c49ce5 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -41,8 +41,8 @@ #include "wx/dynlib.h" -DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED) -DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED) +wxDEFINE_EVENT( wxEVT_DIALUP_CONNECTED, wxDialUpEvent ) +wxDEFINE_EVENT( wxEVT_DIALUP_DISCONNECTED, wxDialUpEvent ) // Doesn't yet compile under VC++ 4, BC++, Watcom C++, // Wine: no wininet.h diff --git a/src/msw/ole/activex.cpp b/src/msw/ole/activex.cpp index 4a4a7c6e84..eb05f85bb6 100644 --- a/src/msw/ole/activex.cpp +++ b/src/msw/ole/activex.cpp @@ -43,7 +43,7 @@ WX_DECLARE_AUTOOLE(wxAutoITypeInfo, ITypeInfo) WX_DECLARE_AUTOOLE(wxAutoIConnectionPoint, IConnectionPoint) WX_DECLARE_AUTOOLE(wxAutoIConnectionPointContainer, IConnectionPointContainer) -DEFINE_EVENT_TYPE(wxEVT_ACTIVEX) +wxDEFINE_EVENT( wxEVT_ACTIVEX, wxActiveXEvent ) // Ole class helpers (sort of MFC-like) from wxActiveX #define DECLARE_OLE_UNKNOWN(cls)\ diff --git a/src/msw/tglbtn.cpp b/src/msw/tglbtn.cpp index f9e024d494..dfe73630ee 100644 --- a/src/msw/tglbtn.cpp +++ b/src/msw/tglbtn.cpp @@ -48,7 +48,7 @@ // macros // ---------------------------------------------------------------------------- -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) // ============================================================================ // implementation diff --git a/src/os2/tglbtn.cpp b/src/os2/tglbtn.cpp index 6269009481..d852a0dff3 100644 --- a/src/os2/tglbtn.cpp +++ b/src/os2/tglbtn.cpp @@ -43,7 +43,7 @@ // ---------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) #define BUTTON_HEIGHT_FROM_CHAR_HEIGHT(cy) (11*EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy)/10) diff --git a/src/osx/tglbtn_osx.cpp b/src/osx/tglbtn_osx.cpp index 162739fe44..4aff7506b6 100644 --- a/src/osx/tglbtn_osx.cpp +++ b/src/osx/tglbtn_osx.cpp @@ -31,7 +31,7 @@ // ---------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) // ============================================================================ // implementation diff --git a/src/palmos/tglbtn.cpp b/src/palmos/tglbtn.cpp index 3f75361d7e..c6b0f29282 100644 --- a/src/palmos/tglbtn.cpp +++ b/src/palmos/tglbtn.cpp @@ -44,7 +44,7 @@ // ---------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxControl) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) // ============================================================================ // implementation diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index b68131499e..bf16d22fdf 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -5485,15 +5485,15 @@ void wxPGChoices::Free() IMPLEMENT_DYNAMIC_CLASS(wxPropertyGridEvent, wxCommandEvent) -DEFINE_EVENT_TYPE( wxEVT_PG_SELECTED ) -DEFINE_EVENT_TYPE( wxEVT_PG_CHANGING ) -DEFINE_EVENT_TYPE( wxEVT_PG_CHANGED ) -DEFINE_EVENT_TYPE( wxEVT_PG_HIGHLIGHTED ) -DEFINE_EVENT_TYPE( wxEVT_PG_RIGHT_CLICK ) -DEFINE_EVENT_TYPE( wxEVT_PG_PAGE_CHANGED ) -DEFINE_EVENT_TYPE( wxEVT_PG_ITEM_EXPANDED ) -DEFINE_EVENT_TYPE( wxEVT_PG_ITEM_COLLAPSED ) -DEFINE_EVENT_TYPE( wxEVT_PG_DOUBLE_CLICK ) +wxDEFINE_EVENT( wxEVT_PG_SELECTED, wxPropertyGridEvent ) +wxDEFINE_EVENT( wxEVT_PG_CHANGING, wxPropertyGridEvent ) +wxDEFINE_EVENT( wxEVT_PG_CHANGED, wxPropertyGridEvent ) +wxDEFINE_EVENT( wxEVT_PG_HIGHLIGHTED, wxPropertyGridEvent ) +wxDEFINE_EVENT( wxEVT_PG_RIGHT_CLICK, wxPropertyGridEvent ) +wxDEFINE_EVENT( wxEVT_PG_PAGE_CHANGED, wxPropertyGridEvent ) +wxDEFINE_EVENT( wxEVT_PG_ITEM_EXPANDED, wxPropertyGridEvent ) +wxDEFINE_EVENT( wxEVT_PG_ITEM_COLLAPSED, wxPropertyGridEvent ) +wxDEFINE_EVENT( wxEVT_PG_DOUBLE_CLICK, wxPropertyGridEvent ) // ----------------------------------------------------------------------- diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index d9cc795957..c8282f29a1 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -38,24 +38,24 @@ #include "wx/app.h" WX_CHECK_BUILD_OPTIONS("wxRichTextCtrl") -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_LEFT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_RETURN) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_CHARACTER) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_DELETE) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED) - -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED) -DEFINE_EVENT_TYPE(wxEVT_COMMAND_RICHTEXT_BUFFER_RESET) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_LEFT_DCLICK, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_RETURN, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_CHARACTER, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_DELETE, wxRichTextEvent ) + +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED, wxRichTextEvent ) + +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_CONTENT_INSERTED, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_CONTENT_DELETED, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_STYLE_CHANGED, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_SELECTION_CHANGED, wxRichTextEvent ) +wxDEFINE_EVENT( wxEVT_COMMAND_RICHTEXT_BUFFER_RESET, wxRichTextEvent ) #if wxRICHTEXT_USE_OWN_CARET diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 0ac6b14415..3777731ae6 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -315,11 +315,9 @@ bool ScintillaWX::SetIdle(bool on) { if (idler.state != on) { // connect or disconnect the EVT_IDLE handler if (on) - stc->Connect(wxID_ANY, wxEVT_IDLE, - (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle); + stc->Connect(wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(wxStyledTextCtrl::OnIdle)); else - stc->Disconnect(wxID_ANY, wxEVT_IDLE, - (wxObjectEventFunction) (wxEventFunction) (wxIdleEventFunction) &wxStyledTextCtrl::OnIdle); + stc->Disconnect(wxID_ANY, wxEVT_IDLE, wxIdleEventHandler(wxStyledTextCtrl::OnIdle)); idler.state = on; } return idler.state; diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index 5188b94c77..5c179adc5b 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -96,34 +96,34 @@ static wxColour wxColourFromSpec(const wxString& spec) { //---------------------------------------------------------------------- -DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE ) -DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED ) -DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED ) -DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTREACHED ) -DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTLEFT ) -DEFINE_EVENT_TYPE( wxEVT_STC_ROMODIFYATTEMPT ) -DEFINE_EVENT_TYPE( wxEVT_STC_KEY ) -DEFINE_EVENT_TYPE( wxEVT_STC_DOUBLECLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_UPDATEUI ) -DEFINE_EVENT_TYPE( wxEVT_STC_MODIFIED ) -DEFINE_EVENT_TYPE( wxEVT_STC_MACRORECORD ) -DEFINE_EVENT_TYPE( wxEVT_STC_MARGINCLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_NEEDSHOWN ) -DEFINE_EVENT_TYPE( wxEVT_STC_PAINTED ) -DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION ) -DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED ) -DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART ) -DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND ) -DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG ) -DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER ) -DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP ) -DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM ) -DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_CLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_DCLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_CALLTIP_CLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_AUTOCOMP_SELECTION ) -DEFINE_EVENT_TYPE( wxEVT_STC_INDICATOR_CLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_INDICATOR_RELEASE ) +wxDEFINE_EVENT( wxEVT_STC_CHANGE, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_STYLENEEDED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_CHARADDED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_SAVEPOINTREACHED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_SAVEPOINTLEFT, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_ROMODIFYATTEMPT, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_KEY, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DOUBLECLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_UPDATEUI, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_MODIFIED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_MACRORECORD, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_MARGINCLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_NEEDSHOWN, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_PAINTED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_USERLISTSELECTION, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_URIDROPPED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DWELLSTART, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DWELLEND, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_START_DRAG, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DRAG_OVER, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DO_DROP, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_ZOOM, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_HOTSPOT_CLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_HOTSPOT_DCLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_CALLTIP_CLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_AUTOCOMP_SELECTION, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_INDICATOR_CLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_INDICATOR_RELEASE, wxStyledTextEvent ) diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 3ce6e5c982..1c0541fe51 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -96,34 +96,34 @@ static wxColour wxColourFromSpec(const wxString& spec) { //---------------------------------------------------------------------- -DEFINE_EVENT_TYPE( wxEVT_STC_CHANGE ) -DEFINE_EVENT_TYPE( wxEVT_STC_STYLENEEDED ) -DEFINE_EVENT_TYPE( wxEVT_STC_CHARADDED ) -DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTREACHED ) -DEFINE_EVENT_TYPE( wxEVT_STC_SAVEPOINTLEFT ) -DEFINE_EVENT_TYPE( wxEVT_STC_ROMODIFYATTEMPT ) -DEFINE_EVENT_TYPE( wxEVT_STC_KEY ) -DEFINE_EVENT_TYPE( wxEVT_STC_DOUBLECLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_UPDATEUI ) -DEFINE_EVENT_TYPE( wxEVT_STC_MODIFIED ) -DEFINE_EVENT_TYPE( wxEVT_STC_MACRORECORD ) -DEFINE_EVENT_TYPE( wxEVT_STC_MARGINCLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_NEEDSHOWN ) -DEFINE_EVENT_TYPE( wxEVT_STC_PAINTED ) -DEFINE_EVENT_TYPE( wxEVT_STC_USERLISTSELECTION ) -DEFINE_EVENT_TYPE( wxEVT_STC_URIDROPPED ) -DEFINE_EVENT_TYPE( wxEVT_STC_DWELLSTART ) -DEFINE_EVENT_TYPE( wxEVT_STC_DWELLEND ) -DEFINE_EVENT_TYPE( wxEVT_STC_START_DRAG ) -DEFINE_EVENT_TYPE( wxEVT_STC_DRAG_OVER ) -DEFINE_EVENT_TYPE( wxEVT_STC_DO_DROP ) -DEFINE_EVENT_TYPE( wxEVT_STC_ZOOM ) -DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_CLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_HOTSPOT_DCLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_CALLTIP_CLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_AUTOCOMP_SELECTION ) -DEFINE_EVENT_TYPE( wxEVT_STC_INDICATOR_CLICK ) -DEFINE_EVENT_TYPE( wxEVT_STC_INDICATOR_RELEASE ) +wxDEFINE_EVENT( wxEVT_STC_CHANGE, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_STYLENEEDED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_CHARADDED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_SAVEPOINTREACHED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_SAVEPOINTLEFT, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_ROMODIFYATTEMPT, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_KEY, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DOUBLECLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_UPDATEUI, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_MODIFIED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_MACRORECORD, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_MARGINCLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_NEEDSHOWN, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_PAINTED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_USERLISTSELECTION, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_URIDROPPED, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DWELLSTART, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DWELLEND, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_START_DRAG, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DRAG_OVER, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_DO_DROP, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_ZOOM, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_HOTSPOT_CLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_HOTSPOT_DCLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_CALLTIP_CLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_AUTOCOMP_SELECTION, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_INDICATOR_CLICK, wxStyledTextEvent ) +wxDEFINE_EVENT( wxEVT_STC_INDICATOR_RELEASE, wxStyledTextEvent ) diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index 85a64a7a19..97ee68357a 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -593,34 +593,34 @@ private: #ifndef SWIG -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_CHANGE; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_STYLENEEDED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_CHARADDED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_SAVEPOINTREACHED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_SAVEPOINTLEFT; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_ROMODIFYATTEMPT; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_KEY; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DOUBLECLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_UPDATEUI; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_MODIFIED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_MACRORECORD; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_MARGINCLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_NEEDSHOWN; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_PAINTED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_USERLISTSELECTION; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_URIDROPPED; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DWELLSTART; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DWELLEND; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_START_DRAG; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DRAG_OVER; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_DO_DROP; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_ZOOM; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_HOTSPOT_CLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_HOTSPOT_DCLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_CALLTIP_CLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_AUTOCOMP_SELECTION; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_INDICATOR_CLICK; -extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_INDICATOR_RELEASE; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHANGE, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_STYLENEEDED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CHARADDED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTREACHED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_SAVEPOINTLEFT, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ROMODIFYATTEMPT, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_KEY, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DOUBLECLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_UPDATEUI, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MODIFIED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MACRORECORD, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_MARGINCLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_NEEDSHOWN, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_PAINTED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_USERLISTSELECTION, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_URIDROPPED, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLSTART, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DWELLEND, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_START_DRAG, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DRAG_OVER, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_DO_DROP, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_ZOOM, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_CLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_HOTSPOT_DCLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_CALLTIP_CLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_AUTOCOMP_SELECTION, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_CLICK, wxStyledTextEvent ) +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_STC, wxEVT_STC_INDICATOR_RELEASE, wxStyledTextEvent ) #else enum { wxEVT_STC_CHANGE, @@ -659,34 +659,37 @@ extern WXDLLIMPEXP_STC const wxEventType wxEVT_STC_INDICATOR_RELEASE; #ifndef SWIG typedef void (wxEvtHandler::*wxStyledTextEventFunction)(wxStyledTextEvent&); -#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_CALLTIP_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_INDICATOR_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), -#define EVT_STC_INDICATOR_RELEASE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxStyledTextEventFunction, & fn ), (wxObject *) NULL ), +#define wxStyledTextEventHandler( func ) \ + wxEVENT_HANDLER_CAST( wxStyledTextEventFunction, func ) + +#define EVT_STC_CHANGE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHANGE, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_STYLENEEDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_STYLENEEDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_CHARADDED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CHARADDED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTREACHED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTREACHED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_SAVEPOINTLEFT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_SAVEPOINTLEFT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_ROMODIFYATTEMPT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ROMODIFYATTEMPT, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_KEY(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_KEY, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DOUBLECLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DOUBLECLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_UPDATEUI(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_UPDATEUI, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_MODIFIED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MODIFIED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_MACRORECORD(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MACRORECORD, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_MARGINCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_MARGINCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_NEEDSHOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_NEEDSHOWN, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_PAINTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_PAINTED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_USERLISTSELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_USERLISTSELECTION, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_URIDROPPED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_URIDROPPED, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLSTART(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLSTART, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DWELLEND(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DWELLEND, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_START_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_START_DRAG, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DRAG_OVER(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DRAG_OVER, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_DO_DROP(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_DO_DROP, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_ZOOM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_ZOOM, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_CLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_HOTSPOT_DCLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_HOTSPOT_DCLICK, id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_CALLTIP_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_CALLTIP_CLICK id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_AUTOCOMP_SELECTION(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_AUTOCOMP_SELECTION id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_INDICATOR_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_CLICK id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), +#define EVT_STC_INDICATOR_RELEASE(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_STC_INDICATOR_RELEASE id, wxID_ANY, wxStyledTextEventHandler( fn ), (wxObject *) NULL ), #endif diff --git a/src/univ/tglbtn.cpp b/src/univ/tglbtn.cpp index b8649b010a..ff04717a74 100644 --- a/src/univ/tglbtn.cpp +++ b/src/univ/tglbtn.cpp @@ -19,7 +19,7 @@ #include "wx/tglbtn.h" -DEFINE_EVENT_TYPE(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED) +wxDEFINE_EVENT( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEvent ) IMPLEMENT_DYNAMIC_CLASS(wxToggleButton, wxButton) diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index 5de4670063..a46b3b9bf8 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -43,8 +43,8 @@ #include #include -DEFINE_EVENT_TYPE(wxEVT_DIALUP_CONNECTED) -DEFINE_EVENT_TYPE(wxEVT_DIALUP_DISCONNECTED) +wxDEFINE_EVENT( wxEVT_DIALUP_CONNECTED, wxDialUpEvent ) +wxDEFINE_EVENT( wxEVT_DIALUP_DISCONNECTED, wxDialUpEvent ) // ---------------------------------------------------------------------------- // A class which groups functions dealing with connecting to the network from a diff --git a/src/unix/sound_sdl.cpp b/src/unix/sound_sdl.cpp index 972ebd11e4..512f1d987d 100644 --- a/src/unix/sound_sdl.cpp +++ b/src/unix/sound_sdl.cpp @@ -46,19 +46,17 @@ public: typedef void (wxEvtHandler::*wxSoundBackendSDLNotificationFunction) (wxSoundBackendSDLNotification&); -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_LOCAL_EVENT_TYPE(wxEVT_SOUND_BACKEND_SDL_NOTIFICATION, -1) -END_DECLARE_EVENT_TYPES() +wxDECLARE_LOCAL_EVENT( wxEVT_SOUND_BACKEND_SDL_NOTIFICATION, wxSoundBackendSDLNotification ) #define EVT_SOUND_BACKEND_SDL_NOTIFICATON(func) \ DECLARE_EVENT_TABLE_ENTRY(wxEVT_SOUND_BACKEND_SDL_NOTIFICATION, \ -1, \ -1, \ - (wxObjectEventFunction) wxStaticCastEvent( wxSoundBackendSDLNotificationFunction, & func ), \ + wxEVENT_HANDLER_CAST( wxSoundBackendSDLNotificationFunction, func ), \ (wxObject *) NULL ), IMPLEMENT_DYNAMIC_CLASS(wxSoundBackendSDLNotification, wxEvtHandler) -DEFINE_EVENT_TYPE(wxEVT_SOUND_BACKEND_SDL_NOTIFICATION) +wxDEFINE_EVENT( wxEVT_SOUND_BACKEND_SDL_NOTIFICATION, wxSoundBackendSDLNotification ) wxSoundBackendSDLNotification::wxSoundBackendSDLNotification() { diff --git a/tests/controls/textentrytest.cpp b/tests/controls/textentrytest.cpp index 9b5bf74f06..70cc1f77ba 100644 --- a/tests/controls/textentrytest.cpp +++ b/tests/controls/textentrytest.cpp @@ -36,7 +36,7 @@ void TextEntryTestCase::SetValue() CPPUNIT_ASSERT_EQUAL( "bye", entry->GetValue() ); } -void TextEntryTestCase::TextChangeEvents() +namespace { class TextTestEventHandler : public wxEvtHandler { @@ -55,7 +55,12 @@ void TextEntryTestCase::TextChangeEvents() private: int m_events; - } handler; + }; +} + +void TextEntryTestCase::TextChangeEvents() +{ + TextTestEventHandler handler; GetTestWindow()->Connect ( -- 2.45.2