]> git.saurik.com Git - wxWidgets.git/commitdiff
Add a public wxModalDialogHook class for intercepting modal dialogs.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 20 May 2013 13:15:41 +0000 (13:15 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 20 May 2013 13:15:41 +0000 (13:15 +0000)
Extract wxModalDialogHook from wx/testing.h into its own wx/modalhook.h,
extend it to allow to be notified not only about showing modal dialogs but
also about dismissing them and document it and show its use in the dialogs
sample.

Also replace all the WX_TESTING_SHOW_MODAL_HOOK macros occurrences with
WX_HOOK_MODAL_DIALOG.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74037 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

64 files changed:
Makefile.in
build/bakefiles/files.bkl
build/msw/makefile.bcc
build/msw/makefile.gcc
build/msw/makefile.vc
build/msw/makefile.wat
build/msw/wx_core.dsp
build/msw/wx_vc7_core.vcproj
build/msw/wx_vc8_core.vcproj
build/msw/wx_vc9_core.vcproj
docs/changes.txt
include/wx/modalhook.h [new file with mode: 0644]
include/wx/testing.h
interface/wx/modalhook.h [new file with mode: 0644]
samples/dialogs/dialogs.cpp
samples/dialogs/dialogs.h
src/cocoa/dialog.mm
src/cocoa/dirdlg.mm
src/cocoa/filedlg.mm
src/cocoa/msgdlg.mm
src/common/dlgcmn.cpp
src/common/modalhook.cpp [new file with mode: 0644]
src/generic/filedlgg.cpp
src/generic/msgdlgg.cpp
src/gtk/colordlg.cpp
src/gtk/dialog.cpp
src/gtk/filedlg.cpp
src/gtk/gnome/gprint.cpp
src/gtk/msgdlg.cpp
src/gtk/print.cpp
src/gtk1/dialog.cpp
src/gtk1/filedlg.cpp
src/motif/dialog.cpp
src/motif/filedlg.cpp
src/motif/msgdlg.cpp
src/msw/colordlg.cpp
src/msw/dialog.cpp
src/msw/dirdlg.cpp
src/msw/filedlg.cpp
src/msw/fontdlg.cpp
src/msw/msgdlg.cpp
src/msw/printdlg.cpp
src/msw/richmsgdlg.cpp
src/msw/wince/filedlgwce.cpp
src/os2/dialog.cpp
src/os2/dirdlg.cpp
src/os2/filedlg.cpp
src/os2/fontdlg.cpp
src/os2/msgdlg.cpp
src/osx/carbon/colordlg.cpp
src/osx/carbon/colordlgosx.mm
src/osx/carbon/dirdlg.cpp
src/osx/carbon/filedlg.cpp
src/osx/carbon/fontdlg.cpp
src/osx/carbon/fontdlgosx.mm
src/osx/carbon/msgdlg.cpp
src/osx/carbon/printdlg.cpp
src/osx/cocoa/dirdlg.mm
src/osx/cocoa/filedlg.mm
src/osx/cocoa/msgdlg.mm
src/osx/cocoa/printdlg.mm
src/osx/dialog_osx.cpp
src/osx/iphone/msgdlg.mm
src/univ/dialog.cpp

index b8b4700992b668a8f3e531a73accc415fc9329e1..0e81d7b435434b5c9e1957c329f0e3085527a8b7 100644 (file)
@@ -4111,6 +4111,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS =  \
        wx/listbox.h \
        wx/mdi.h \
        wx/menu.h \
+       wx/modalhook.h \
        wx/mousemanager.h \
        wx/msgdlg.h \
        wx/nativewin.h \
@@ -4807,6 +4808,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS =  \
        monodll_markupparser.o \
        monodll_matrix.o \
        monodll_menucmn.o \
+       monodll_modalhook.o \
        monodll_mousemanager.o \
        monodll_nbkbase.o \
        monodll_overlaycmn.o \
@@ -5028,6 +5030,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS =  \
        monodll_markupparser.o \
        monodll_matrix.o \
        monodll_menucmn.o \
+       monodll_modalhook.o \
        monodll_mousemanager.o \
        monodll_nbkbase.o \
        monodll_overlaycmn.o \
@@ -7051,6 +7054,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_1 =  \
        monolib_markupparser.o \
        monolib_matrix.o \
        monolib_menucmn.o \
+       monolib_modalhook.o \
        monolib_mousemanager.o \
        monolib_nbkbase.o \
        monolib_overlaycmn.o \
@@ -7272,6 +7276,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 =  \
        monolib_markupparser.o \
        monolib_matrix.o \
        monolib_menucmn.o \
+       monolib_modalhook.o \
        monolib_mousemanager.o \
        monolib_nbkbase.o \
        monolib_overlaycmn.o \
@@ -9467,6 +9472,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_2 =  \
        coredll_markupparser.o \
        coredll_matrix.o \
        coredll_menucmn.o \
+       coredll_modalhook.o \
        coredll_mousemanager.o \
        coredll_nbkbase.o \
        coredll_overlaycmn.o \
@@ -9688,6 +9694,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 =  \
        coredll_markupparser.o \
        coredll_matrix.o \
        coredll_menucmn.o \
+       coredll_modalhook.o \
        coredll_mousemanager.o \
        coredll_nbkbase.o \
        coredll_overlaycmn.o \
@@ -11143,6 +11150,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_3 =  \
        corelib_markupparser.o \
        corelib_matrix.o \
        corelib_menucmn.o \
+       corelib_modalhook.o \
        corelib_mousemanager.o \
        corelib_nbkbase.o \
        corelib_overlaycmn.o \
@@ -11364,6 +11372,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 =  \
        corelib_markupparser.o \
        corelib_matrix.o \
        corelib_menucmn.o \
+       corelib_modalhook.o \
        corelib_mousemanager.o \
        corelib_nbkbase.o \
        corelib_overlaycmn.o \
@@ -21946,6 +21955,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_USE_GUI_1@monodll_menucmn.o: $(srcdir)/src/common/menucmn.cpp $(MONODLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/menucmn.cpp
 
+@COND_USE_GUI_1@monodll_modalhook.o: $(srcdir)/src/common/modalhook.cpp $(MONODLL_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/modalhook.cpp
+
 @COND_USE_GUI_1@monodll_mousemanager.o: $(srcdir)/src/common/mousemanager.cpp $(MONODLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/mousemanager.cpp
 
@@ -27802,6 +27814,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_USE_GUI_1@monolib_menucmn.o: $(srcdir)/src/common/menucmn.cpp $(MONOLIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/menucmn.cpp
 
+@COND_USE_GUI_1@monolib_modalhook.o: $(srcdir)/src/common/modalhook.cpp $(MONOLIB_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/modalhook.cpp
+
 @COND_USE_GUI_1@monolib_mousemanager.o: $(srcdir)/src/common/mousemanager.cpp $(MONOLIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/mousemanager.cpp
 
@@ -33814,6 +33829,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_USE_GUI_1@coredll_menucmn.o: $(srcdir)/src/common/menucmn.cpp $(COREDLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/menucmn.cpp
 
+@COND_USE_GUI_1@coredll_modalhook.o: $(srcdir)/src/common/modalhook.cpp $(COREDLL_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/modalhook.cpp
+
 @COND_USE_GUI_1@coredll_mousemanager.o: $(srcdir)/src/common/mousemanager.cpp $(COREDLL_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/mousemanager.cpp
 
@@ -38191,6 +38209,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_USE_GUI_1@corelib_menucmn.o: $(srcdir)/src/common/menucmn.cpp $(CORELIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/menucmn.cpp
 
+@COND_USE_GUI_1@corelib_modalhook.o: $(srcdir)/src/common/modalhook.cpp $(CORELIB_ODEP)
+@COND_USE_GUI_1@       $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/modalhook.cpp
+
 @COND_USE_GUI_1@corelib_mousemanager.o: $(srcdir)/src/common/mousemanager.cpp $(CORELIB_ODEP)
 @COND_USE_GUI_1@       $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/mousemanager.cpp
 
index 9a9f452a88b81ee6d8766b6e6c2c1d1589976d27..befd8fe351c8a524d791a173a82d54fb20984b68 100644 (file)
@@ -709,6 +709,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     src/common/markupparser.cpp
     src/common/matrix.cpp
     src/common/menucmn.cpp
+    src/common/modalhook.cpp
     src/common/mousemanager.cpp
     src/common/nbkbase.cpp
     src/common/overlaycmn.cpp
@@ -867,6 +868,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     wx/listbox.h
     wx/mdi.h
     wx/menu.h
+    wx/modalhook.h
     wx/mousemanager.h
     wx/msgdlg.h
     wx/nativewin.h
index b635a8f90fae9a7f21ef46d1a222b715ea7d58c0..ebc9778991a23aa0a6236b38b695f9406f978fe5 100644 (file)
@@ -1920,6 +1920,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_markupparser.obj \\r
        $(OBJS)\monodll_matrix.obj \\r
        $(OBJS)\monodll_menucmn.obj \\r
+       $(OBJS)\monodll_modalhook.obj \
        $(OBJS)\monodll_mousemanager.obj \\r
        $(OBJS)\monodll_nbkbase.obj \\r
        $(OBJS)\monodll_overlaycmn.obj \\r
@@ -2141,6 +2142,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_markupparser.obj \\r
        $(OBJS)\monodll_matrix.obj \\r
        $(OBJS)\monodll_menucmn.obj \\r
+       $(OBJS)\monodll_modalhook.obj \
        $(OBJS)\monodll_mousemanager.obj \\r
        $(OBJS)\monodll_nbkbase.obj \\r
        $(OBJS)\monodll_overlaycmn.obj \\r
@@ -3310,6 +3312,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_markupparser.obj \\r
        $(OBJS)\monolib_matrix.obj \\r
        $(OBJS)\monolib_menucmn.obj \\r
+       $(OBJS)\monolib_modalhook.obj \
        $(OBJS)\monolib_mousemanager.obj \\r
        $(OBJS)\monolib_nbkbase.obj \\r
        $(OBJS)\monolib_overlaycmn.obj \\r
@@ -3531,6 +3534,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_markupparser.obj \\r
        $(OBJS)\monolib_matrix.obj \\r
        $(OBJS)\monolib_menucmn.obj \\r
+       $(OBJS)\monolib_modalhook.obj \
        $(OBJS)\monolib_mousemanager.obj \\r
        $(OBJS)\monolib_nbkbase.obj \\r
        $(OBJS)\monolib_overlaycmn.obj \\r
@@ -4605,6 +4609,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_markupparser.obj \\r
        $(OBJS)\coredll_matrix.obj \\r
        $(OBJS)\coredll_menucmn.obj \\r
+       $(OBJS)\coredll_modalhook.obj \
        $(OBJS)\coredll_mousemanager.obj \\r
        $(OBJS)\coredll_nbkbase.obj \\r
        $(OBJS)\coredll_overlaycmn.obj \\r
@@ -4826,6 +4831,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_markupparser.obj \\r
        $(OBJS)\coredll_matrix.obj \\r
        $(OBJS)\coredll_menucmn.obj \\r
+       $(OBJS)\coredll_modalhook.obj \
        $(OBJS)\coredll_mousemanager.obj \\r
        $(OBJS)\coredll_nbkbase.obj \\r
        $(OBJS)\coredll_overlaycmn.obj \\r
@@ -5650,6 +5656,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_markupparser.obj \\r
        $(OBJS)\corelib_matrix.obj \\r
        $(OBJS)\corelib_menucmn.obj \\r
+       $(OBJS)\corelib_modalhook.obj \
        $(OBJS)\corelib_mousemanager.obj \\r
        $(OBJS)\corelib_nbkbase.obj \\r
        $(OBJS)\corelib_overlaycmn.obj \\r
@@ -5871,6 +5878,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_markupparser.obj \\r
        $(OBJS)\corelib_matrix.obj \\r
        $(OBJS)\corelib_menucmn.obj \\r
+       $(OBJS)\corelib_modalhook.obj \
        $(OBJS)\corelib_mousemanager.obj \\r
        $(OBJS)\corelib_nbkbase.obj \\r
        $(OBJS)\corelib_overlaycmn.obj \\r
@@ -15107,6 +15115,11 @@ $(OBJS)\monodll_menucmn.obj: ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_modalhook.obj: ..\..\src\common\modalhook.cpp
+       $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\modalhook.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_mousemanager.obj: ..\..\src\common\mousemanager.cpp\r
        $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) ..\..\src\common\mousemanager.cpp\r
 !endif\r
@@ -20632,6 +20645,11 @@ $(OBJS)\monolib_menucmn.obj: ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_modalhook.obj: ..\..\src\common\modalhook.cpp
+       $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\modalhook.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_mousemanager.obj: ..\..\src\common\mousemanager.cpp\r
        $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\mousemanager.cpp\r
 !endif\r
@@ -26154,6 +26172,11 @@ $(OBJS)\coredll_menucmn.obj: ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_modalhook.obj: ..\..\src\common\modalhook.cpp
+       $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\modalhook.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_mousemanager.obj: ..\..\src\common\mousemanager.cpp\r
        $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) ..\..\src\common\mousemanager.cpp\r
 !endif\r
@@ -30243,6 +30266,11 @@ $(OBJS)\corelib_menucmn.obj: ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_modalhook.obj: ..\..\src\common\modalhook.cpp
+       $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\modalhook.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_mousemanager.obj: ..\..\src\common\mousemanager.cpp\r
        $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) ..\..\src\common\mousemanager.cpp\r
 !endif\r
index b8678b7f03f92d7ce5fecb413354f09273edbfe4..d59d6f49d7e3347219163c577fd11a50201dceca 100644 (file)
@@ -1944,6 +1944,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_markupparser.o \\r
        $(OBJS)\monodll_matrix.o \\r
        $(OBJS)\monodll_menucmn.o \\r
+       $(OBJS)\monodll_modalhook.o \
        $(OBJS)\monodll_mousemanager.o \\r
        $(OBJS)\monodll_nbkbase.o \\r
        $(OBJS)\monodll_overlaycmn.o \\r
@@ -2167,6 +2168,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_markupparser.o \\r
        $(OBJS)\monodll_matrix.o \\r
        $(OBJS)\monodll_menucmn.o \\r
+       $(OBJS)\monodll_modalhook.o \
        $(OBJS)\monodll_mousemanager.o \\r
        $(OBJS)\monodll_nbkbase.o \\r
        $(OBJS)\monodll_overlaycmn.o \\r
@@ -3354,6 +3356,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_markupparser.o \\r
        $(OBJS)\monolib_matrix.o \\r
        $(OBJS)\monolib_menucmn.o \\r
+       $(OBJS)\monolib_modalhook.o \
        $(OBJS)\monolib_mousemanager.o \\r
        $(OBJS)\monolib_nbkbase.o \\r
        $(OBJS)\monolib_overlaycmn.o \\r
@@ -3577,6 +3580,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_markupparser.o \\r
        $(OBJS)\monolib_matrix.o \\r
        $(OBJS)\monolib_menucmn.o \\r
+       $(OBJS)\monolib_modalhook.o \
        $(OBJS)\monolib_mousemanager.o \\r
        $(OBJS)\monolib_nbkbase.o \\r
        $(OBJS)\monolib_overlaycmn.o \\r
@@ -4679,6 +4683,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_markupparser.o \\r
        $(OBJS)\coredll_matrix.o \\r
        $(OBJS)\coredll_menucmn.o \\r
+       $(OBJS)\coredll_modalhook.o \
        $(OBJS)\coredll_mousemanager.o \\r
        $(OBJS)\coredll_nbkbase.o \\r
        $(OBJS)\coredll_overlaycmn.o \\r
@@ -4902,6 +4907,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_markupparser.o \\r
        $(OBJS)\coredll_matrix.o \\r
        $(OBJS)\coredll_menucmn.o \\r
+       $(OBJS)\coredll_modalhook.o \
        $(OBJS)\coredll_mousemanager.o \\r
        $(OBJS)\coredll_nbkbase.o \\r
        $(OBJS)\coredll_overlaycmn.o \\r
@@ -5738,6 +5744,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_markupparser.o \\r
        $(OBJS)\corelib_matrix.o \\r
        $(OBJS)\corelib_menucmn.o \\r
+       $(OBJS)\corelib_modalhook.o \
        $(OBJS)\corelib_mousemanager.o \\r
        $(OBJS)\corelib_nbkbase.o \\r
        $(OBJS)\corelib_overlaycmn.o \\r
@@ -5961,6 +5968,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_markupparser.o \\r
        $(OBJS)\corelib_matrix.o \\r
        $(OBJS)\corelib_menucmn.o \\r
+       $(OBJS)\corelib_modalhook.o \
        $(OBJS)\corelib_mousemanager.o \\r
        $(OBJS)\corelib_nbkbase.o \\r
        $(OBJS)\corelib_overlaycmn.o \\r
@@ -16617,6 +16625,11 @@ $(OBJS)\monodll_menucmn.o: ../../src/common/menucmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\monodll_modalhook.o: ../../src/common/modalhook.cpp
+       $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monodll_mousemanager.o: ../../src/common/mousemanager.cpp\r
        $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -23586,6 +23599,11 @@ $(OBJS)\monolib_menucmn.o: ../../src/common/menucmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\monolib_modalhook.o: ../../src/common/modalhook.cpp
+       $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\monolib_mousemanager.o: ../../src/common/mousemanager.cpp\r
        $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -30552,6 +30570,11 @@ $(OBJS)\coredll_menucmn.o: ../../src/common/menucmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\coredll_modalhook.o: ../../src/common/modalhook.cpp
+       $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\coredll_mousemanager.o: ../../src/common/mousemanager.cpp\r
        $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
@@ -35859,6 +35882,11 @@ $(OBJS)\corelib_menucmn.o: ../../src/common/menucmn.cpp
 endif\r
 \r
 ifeq ($(USE_GUI),1)\r
+$(OBJS)\corelib_modalhook.o: ../../src/common/modalhook.cpp
+       $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
+ifeq ($(USE_GUI),1)
 $(OBJS)\corelib_mousemanager.o: ../../src/common/mousemanager.cpp\r
        $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<\r
 endif\r
index 10a0982f74c944531a8330dbca9057bec6fa4fb9..9208afb5cee7d19d6db5c7ab84e51d86cb8e66cc 100644 (file)
@@ -2248,6 +2248,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_markupparser.obj \\r
        $(OBJS)\monodll_matrix.obj \\r
        $(OBJS)\monodll_menucmn.obj \\r
+       $(OBJS)\monodll_modalhook.obj \
        $(OBJS)\monodll_mousemanager.obj \\r
        $(OBJS)\monodll_nbkbase.obj \\r
        $(OBJS)\monodll_overlaycmn.obj \\r
@@ -2469,6 +2470,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  \
        $(OBJS)\monodll_markupparser.obj \\r
        $(OBJS)\monodll_matrix.obj \\r
        $(OBJS)\monodll_menucmn.obj \\r
+       $(OBJS)\monodll_modalhook.obj \
        $(OBJS)\monodll_mousemanager.obj \\r
        $(OBJS)\monodll_nbkbase.obj \\r
        $(OBJS)\monodll_overlaycmn.obj \\r
@@ -3644,6 +3646,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_markupparser.obj \\r
        $(OBJS)\monolib_matrix.obj \\r
        $(OBJS)\monolib_menucmn.obj \\r
+       $(OBJS)\monolib_modalhook.obj \
        $(OBJS)\monolib_mousemanager.obj \\r
        $(OBJS)\monolib_nbkbase.obj \\r
        $(OBJS)\monolib_overlaycmn.obj \\r
@@ -3865,6 +3868,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  \
        $(OBJS)\monolib_markupparser.obj \\r
        $(OBJS)\monolib_matrix.obj \\r
        $(OBJS)\monolib_menucmn.obj \\r
+       $(OBJS)\monolib_modalhook.obj \
        $(OBJS)\monolib_mousemanager.obj \\r
        $(OBJS)\monolib_nbkbase.obj \\r
        $(OBJS)\monolib_overlaycmn.obj \\r
@@ -5005,6 +5009,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_markupparser.obj \\r
        $(OBJS)\coredll_matrix.obj \\r
        $(OBJS)\coredll_menucmn.obj \\r
+       $(OBJS)\coredll_modalhook.obj \
        $(OBJS)\coredll_mousemanager.obj \\r
        $(OBJS)\coredll_nbkbase.obj \\r
        $(OBJS)\coredll_overlaycmn.obj \\r
@@ -5226,6 +5231,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  \
        $(OBJS)\coredll_markupparser.obj \\r
        $(OBJS)\coredll_matrix.obj \\r
        $(OBJS)\coredll_menucmn.obj \\r
+       $(OBJS)\coredll_modalhook.obj \
        $(OBJS)\coredll_mousemanager.obj \\r
        $(OBJS)\coredll_nbkbase.obj \\r
        $(OBJS)\coredll_overlaycmn.obj \\r
@@ -6056,6 +6062,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_markupparser.obj \\r
        $(OBJS)\corelib_matrix.obj \\r
        $(OBJS)\corelib_menucmn.obj \\r
+       $(OBJS)\corelib_modalhook.obj \
        $(OBJS)\corelib_mousemanager.obj \\r
        $(OBJS)\corelib_nbkbase.obj \\r
        $(OBJS)\corelib_overlaycmn.obj \\r
@@ -6277,6 +6284,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  \
        $(OBJS)\corelib_markupparser.obj \\r
        $(OBJS)\corelib_matrix.obj \\r
        $(OBJS)\corelib_menucmn.obj \\r
+       $(OBJS)\corelib_modalhook.obj \
        $(OBJS)\corelib_mousemanager.obj \\r
        $(OBJS)\corelib_nbkbase.obj \\r
        $(OBJS)\corelib_overlaycmn.obj \\r
@@ -15827,6 +15835,11 @@ $(OBJS)\monodll_menucmn.obj: ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monodll_modalhook.obj: ..\..\src\common\modalhook.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\modalhook.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monodll_mousemanager.obj: ..\..\src\common\mousemanager.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) ..\..\src\common\mousemanager.cpp\r
 !endif\r
@@ -21352,6 +21365,11 @@ $(OBJS)\monolib_menucmn.obj: ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\monolib_modalhook.obj: ..\..\src\common\modalhook.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\modalhook.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\monolib_mousemanager.obj: ..\..\src\common\mousemanager.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) ..\..\src\common\mousemanager.cpp\r
 !endif\r
@@ -26874,6 +26892,11 @@ $(OBJS)\coredll_menucmn.obj: ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\coredll_modalhook.obj: ..\..\src\common\modalhook.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\modalhook.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\coredll_mousemanager.obj: ..\..\src\common\mousemanager.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) ..\..\src\common\mousemanager.cpp\r
 !endif\r
@@ -30963,6 +30986,11 @@ $(OBJS)\corelib_menucmn.obj: ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !if "$(USE_GUI)" == "1"\r
+$(OBJS)\corelib_modalhook.obj: ..\..\src\common\modalhook.cpp
+       $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\modalhook.cpp
+!endif
+
+!if "$(USE_GUI)" == "1"
 $(OBJS)\corelib_mousemanager.obj: ..\..\src\common\mousemanager.cpp\r
        $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) ..\..\src\common\mousemanager.cpp\r
 !endif\r
index 9646c5006268f05da98e25fa79f8c95619da14aa..c43f2ac8e437f42caba89608e813aa46400cc9af 100644 (file)
@@ -382,6 +382,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
        $(OBJS)\monodll_markupparser.obj &\r
        $(OBJS)\monodll_matrix.obj &\r
        $(OBJS)\monodll_menucmn.obj &\r
+       $(OBJS)\monodll_modalhook.obj &
        $(OBJS)\monodll_mousemanager.obj &\r
        $(OBJS)\monodll_nbkbase.obj &\r
        $(OBJS)\monodll_overlaycmn.obj &\r
@@ -605,6 +606,7 @@ ____CORE_SRC_FILENAMES_OBJECTS =  &
        $(OBJS)\monodll_markupparser.obj &\r
        $(OBJS)\monodll_matrix.obj &\r
        $(OBJS)\monodll_menucmn.obj &\r
+       $(OBJS)\monodll_modalhook.obj &
        $(OBJS)\monodll_mousemanager.obj &\r
        $(OBJS)\monodll_nbkbase.obj &\r
        $(OBJS)\monodll_overlaycmn.obj &\r
@@ -1808,6 +1810,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
        $(OBJS)\monolib_markupparser.obj &\r
        $(OBJS)\monolib_matrix.obj &\r
        $(OBJS)\monolib_menucmn.obj &\r
+       $(OBJS)\monolib_modalhook.obj &
        $(OBJS)\monolib_mousemanager.obj &\r
        $(OBJS)\monolib_nbkbase.obj &\r
        $(OBJS)\monolib_overlaycmn.obj &\r
@@ -2031,6 +2034,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS =  &
        $(OBJS)\monolib_markupparser.obj &\r
        $(OBJS)\monolib_matrix.obj &\r
        $(OBJS)\monolib_menucmn.obj &\r
+       $(OBJS)\monolib_modalhook.obj &
        $(OBJS)\monolib_mousemanager.obj &\r
        $(OBJS)\monolib_nbkbase.obj &\r
        $(OBJS)\monolib_overlaycmn.obj &\r
@@ -3159,6 +3163,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
        $(OBJS)\coredll_markupparser.obj &\r
        $(OBJS)\coredll_matrix.obj &\r
        $(OBJS)\coredll_menucmn.obj &\r
+       $(OBJS)\coredll_modalhook.obj &
        $(OBJS)\coredll_mousemanager.obj &\r
        $(OBJS)\coredll_nbkbase.obj &\r
        $(OBJS)\coredll_overlaycmn.obj &\r
@@ -3382,6 +3387,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS =  &
        $(OBJS)\coredll_markupparser.obj &\r
        $(OBJS)\coredll_matrix.obj &\r
        $(OBJS)\coredll_menucmn.obj &\r
+       $(OBJS)\coredll_modalhook.obj &
        $(OBJS)\coredll_mousemanager.obj &\r
        $(OBJS)\coredll_nbkbase.obj &\r
        $(OBJS)\coredll_overlaycmn.obj &\r
@@ -4223,6 +4229,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
        $(OBJS)\corelib_markupparser.obj &\r
        $(OBJS)\corelib_matrix.obj &\r
        $(OBJS)\corelib_menucmn.obj &\r
+       $(OBJS)\corelib_modalhook.obj &
        $(OBJS)\corelib_mousemanager.obj &\r
        $(OBJS)\corelib_nbkbase.obj &\r
        $(OBJS)\corelib_overlaycmn.obj &\r
@@ -4446,6 +4453,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS =  &
        $(OBJS)\corelib_markupparser.obj &\r
        $(OBJS)\corelib_matrix.obj &\r
        $(OBJS)\corelib_menucmn.obj &\r
+       $(OBJS)\corelib_modalhook.obj &
        $(OBJS)\corelib_mousemanager.obj &\r
        $(OBJS)\corelib_nbkbase.obj &\r
        $(OBJS)\corelib_overlaycmn.obj &\r
@@ -16966,6 +16974,11 @@ $(OBJS)\monodll_menucmn.obj :  .AUTODEPEND ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\monodll_modalhook.obj :  .AUTODEPEND ..\..\src\common\modalhook.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monodll_mousemanager.obj :  .AUTODEPEND ..\..\src\common\mousemanager.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<\r
 !endif\r
@@ -23935,6 +23948,11 @@ $(OBJS)\monolib_menucmn.obj :  .AUTODEPEND ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\monolib_modalhook.obj :  .AUTODEPEND ..\..\src\common\modalhook.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\monolib_mousemanager.obj :  .AUTODEPEND ..\..\src\common\mousemanager.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<\r
 !endif\r
@@ -30901,6 +30919,11 @@ $(OBJS)\coredll_menucmn.obj :  .AUTODEPEND ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\coredll_modalhook.obj :  .AUTODEPEND ..\..\src\common\modalhook.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\coredll_mousemanager.obj :  .AUTODEPEND ..\..\src\common\mousemanager.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<\r
 !endif\r
@@ -36208,6 +36231,11 @@ $(OBJS)\corelib_menucmn.obj :  .AUTODEPEND ..\..\src\common\menucmn.cpp
 !endif\r
 \r
 !ifeq USE_GUI 1\r
+$(OBJS)\corelib_modalhook.obj :  .AUTODEPEND ..\..\src\common\modalhook.cpp
+       $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
+!endif
+
+!ifeq USE_GUI 1
 $(OBJS)\corelib_mousemanager.obj :  .AUTODEPEND ..\..\src\common\mousemanager.cpp\r
        $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<\r
 !endif\r
index 32220f5cf9a3cfc159573c5d8dac3d21acda962e..4b89803d8f049a3e1af1ca461a721a6fd4cd240c 100644 (file)
@@ -8,21 +8,21 @@
 CFG=core - Win32 Debug
 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
 !MESSAGE use the Export Makefile command and run
-!MESSAGE 
+!MESSAGE
 !MESSAGE NMAKE /f "wx_core.mak".
-!MESSAGE 
+!MESSAGE
 !MESSAGE You can specify a configuration when running NMAKE
 !MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE 
+!MESSAGE
 !MESSAGE NMAKE /f "wx_core.mak" CFG="core - Win32 Debug"
-!MESSAGE 
+!MESSAGE
 !MESSAGE Possible choices for configuration are:
-!MESSAGE 
+!MESSAGE
 !MESSAGE "core - Win32 DLL Release" (based on "Win32 (x86) Dynamic-Link Library")
 !MESSAGE "core - Win32 DLL Debug" (based on "Win32 (x86) Dynamic-Link Library")
 !MESSAGE "core - Win32 Release" (based on "Win32 (x86) Static Library")
 !MESSAGE "core - Win32 Debug" (based on "Win32 (x86) Static Library")
-!MESSAGE 
+!MESSAGE
 
 # Begin Project
 # PROP AllowPerConfigDependencies 0
@@ -478,6 +478,10 @@ SOURCE=..\..\src\common\menucmn.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\src\common\modalhook.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\src\common\mousemanager.cpp
 # End Source File
 # Begin Source File
@@ -1362,25 +1366,25 @@ SOURCE=..\..\include\wx\univ\setup.h
 
 !IF  "$(CFG)" == "core - Win32 DLL Release"
 
-# Begin Custom Build - 
+# Begin Custom Build -
 
 # End Custom Build
 
 !ELSEIF  "$(CFG)" == "core - Win32 DLL Debug"
 
-# Begin Custom Build - 
+# Begin Custom Build -
 
 # End Custom Build
 
 !ELSEIF  "$(CFG)" == "core - Win32 Release"
 
-# Begin Custom Build - 
+# Begin Custom Build -
 
 # End Custom Build
 
 !ELSEIF  "$(CFG)" == "core - Win32 Debug"
 
-# Begin Custom Build - 
+# Begin Custom Build -
 
 # End Custom Build
 
@@ -2800,6 +2804,10 @@ SOURCE=..\..\include\wx\minifram.h
 # End Source File
 # Begin Source File
 
+SOURCE=..\..\include\wx\modalhook.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\include\wx\mousemanager.h
 # End Source File
 # Begin Source File
@@ -3605,4 +3613,3 @@ SOURCE=..\..\src\xrc\xmlreshandler.cpp
 # End Group
 # End Target
 # End Project
-
index 7d826c803458abf2f1093a2f6ce41ca4d5a35237..b8c6091d380e3ccd64370ac88a56601fbe1e7d62 100644 (file)
                        <File\r
                                RelativePath="..\..\src\common\menucmn.cpp">\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\common\modalhook.cpp">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\common\mousemanager.cpp">\r
                        </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\minifram.h">\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\modalhook.h">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\mousemanager.h">\r
                        </File>\r
index b81afc8128337e19ccc796099e884e7dfd603ccc..3ec17d668a6af79710a459787f4927c7e7b6e614 100644 (file)
                                RelativePath="..\..\src\common\menucmn.cpp"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\common\modalhook.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\common\mousemanager.cpp"\r
                                >\r
                                RelativePath="..\..\include\wx\minifram.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\modalhook.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\mousemanager.h"\r
                                >\r
index 13aebbf49052178e550c6e9773dee041bd930772..128f72bc8dbeb6a22d2c53c659f47ef1365b5bc9 100644 (file)
                                RelativePath="..\..\src\common\menucmn.cpp"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\src\common\modalhook.cpp"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\src\common\mousemanager.cpp"\r
                                >\r
                                RelativePath="..\..\include\wx\minifram.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\modalhook.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\mousemanager.h"\r
                                >\r
index 8b4fcddbaafd1197ce88989d4166ee8162894228..adc9b79eb56c4eb5ca2f2327e21269eff5127886 100644 (file)
@@ -601,6 +601,7 @@ All (GUI):
 - Add support for wxRibbonBar and related controls to XRC (Armel Asselin).
 - Add wxBITMAP_PNG() macro similar to wxBITMAP() but for PNG files.
 - Add new wxSimplebook class.
+- Implement possibility to hook all modal dialog calls.
 - Support hexadecimal numbers in wxSpinCtrl.
 - Respect window max size in wxBoxSizer (Nathan Ridge).
 - Add support for searching in wxWebView for MSW and GTK (Allonii).
diff --git a/include/wx/modalhook.h b/include/wx/modalhook.h
new file mode 100644 (file)
index 0000000..bb7b37b
--- /dev/null
@@ -0,0 +1,105 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/modalhook.h
+// Purpose:     Allows to hook into showing modal dialogs.
+// Author:      Vadim Zeitlin
+// Created:     2013-05-19
+// RCS-ID:      $Id$
+// Copyright:   (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_MODALHOOK_H_
+#define _WX_MODALHOOK_H_
+
+#include "wx/vector.h"
+
+class WXDLLIMPEXP_FWD_CORE wxDialog;
+
+// ----------------------------------------------------------------------------
+// Class allowing to be notified about any modal dialog calls.
+// ----------------------------------------------------------------------------
+
+// To be notified about entering and exiting modal dialogs and possibly to
+// replace them with something else (e.g. just return a predefined value for
+// testing), define an object of this class, override its Enter() and
+// possibly Exit() methods and call Register() on it.
+class WXDLLIMPEXP_CORE wxModalDialogHook
+{
+public:
+    // Default ctor doesn't do anything, call Register() to activate the hook.
+    wxModalDialogHook() { }
+
+    // Dtor unregisters the hook if it had been registered.
+    virtual ~wxModalDialogHook() { DoUnregister(); }
+
+    // Register this hook as being active, i.e. its Enter() and Exit() methods
+    // will be called.
+    //
+    // Notice that the order of registration matters: the last hook registered
+    // is called first, and if its Enter() returns something != wxID_NONE, the
+    // subsequent hooks are skipped.
+    void Register();
+
+    // Unregister this hook. Notice that is done automatically from the dtor.
+    void Unregister();
+
+    // Called from wxWidgets code before showing any modal dialogs and calls
+    // Enter() for every registered hook.
+    static int CallEnter(wxDialog* dialog);
+
+    // Called from wxWidgets code after dismissing the dialog and calls Exit()
+    // for every registered hook.
+    static void CallExit(wxDialog* dialog);
+
+protected:
+    // Called by wxWidgets before showing any modal dialogs, override this to
+    // be notified about this and return anything but wxID_NONE to skip showing
+    // the modal dialog entirely and just return the specified result.
+    virtual int Enter(wxDialog* dialog) = 0;
+
+    // Called by wxWidgets after dismissing the modal dialog. Notice that it
+    // won't be called if Enter() hadn't been.
+    virtual void Exit(wxDialog* WXUNUSED(dialog)) { }
+
+private:
+    // Unregister the given hook, return true if it was done or false if the
+    // hook wasn't found.
+    bool DoUnregister();
+
+    // All the hooks in reverse registration order (i.e. in call order).
+    typedef wxVector<wxModalDialogHook*> Hooks;
+    static Hooks ms_hooks;
+
+    wxDECLARE_NO_COPY_CLASS(wxModalDialogHook);
+};
+
+// Helper object used by WX_MODAL_DIALOG_HOOK below to ensure that CallExit()
+// is called on scope exit.
+class wxModalDialogHookExitGuard
+{
+public:
+    wxEXPLICIT wxModalDialogHookExitGuard(wxDialog* dialog)
+        : m_dialog(dialog)
+    {
+    }
+
+    ~wxModalDialogHookExitGuard()
+    {
+        wxModalDialogHook::CallExit(m_dialog);
+    }
+
+private:
+    wxDialog* const m_dialog;
+
+    wxDECLARE_NO_COPY_CLASS(wxModalDialogHookExitGuard);
+};
+
+// This macro needs to be used at the top of every implementation of
+// ShowModal() in order for wxModalDialogHook to work.
+#define WX_HOOK_MODAL_DIALOG()                                                \
+    const int modalDialogHookRC = wxModalDialogHook::CallEnter(this);         \
+    if ( modalDialogHookRC != wxID_NONE )                                     \
+        return modalDialogHookRC;                                             \
+    wxModalDialogHookExitGuard modalDialogHookExit(this)
+
+#endif // _WX_MODALHOOK_H_
index fce2c508ba73e70b3da5aea203590602e31e5c72..dc1bd5ec33e050159c3eff441ec82cc153235748 100644 (file)
 
 #include "wx/debug.h"
 #include "wx/string.h"
+#include "wx/modalhook.h"
 
-class WXDLLIMPEXP_FWD_CORE wxDialog;
 class WXDLLIMPEXP_FWD_CORE wxMessageDialogBase;
 class WXDLLIMPEXP_FWD_CORE wxFileDialogBase;
 
-// ----------------------------------------------------------------------------
-// implementation helpers
-// ----------------------------------------------------------------------------
-
-// Helper hook class used to redirect ShowModal() to testing code.
-// Instead of showing a dialog modally, hook code is called to simulate what
-// the user would do and return appropriate ID from ShowModal().
-class WXDLLIMPEXP_CORE wxModalDialogHook
-{
-public:
-    wxModalDialogHook() {}
-    virtual ~wxModalDialogHook() {}
-
-    /// Returns currently active hook object or NULL.
-    static wxModalDialogHook *Get() { return ms_instance; }
-
-    /// Set the hook and returns the previously set one.
-    static wxModalDialogHook *Set(wxModalDialogHook *hook)
-    {
-        wxModalDialogHook *old = ms_instance;
-        ms_instance = hook;
-        return old;
-    }
-
-    /// Entry point that is called from ShowModal().
-    virtual int Invoke(wxDialog *dlg) = 0;
-
-private:
-    static wxModalDialogHook *ms_instance;
-
-    wxDECLARE_NO_COPY_CLASS(wxModalDialogHook);
-};
-
-// This macro needs to be used at the top of every implementation of
-// ShowModal() in order for the above modal dialogs testing code to work.
-#define WX_TESTING_SHOW_MODAL_HOOK()                                        \
-    if ( wxModalDialogHook::Get() )                                         \
-    {                                                                       \
-        int rc = wxModalDialogHook::Get()->Invoke(this);                    \
-        if ( rc != wxID_NONE )                                              \
-            return rc;                                                      \
-    }                                                                       \
-    struct wxDummyTestingStruct /* just to force a semicolon */
-
-
 // ----------------------------------------------------------------------------
 // testing API
 // ----------------------------------------------------------------------------
@@ -233,15 +188,42 @@ class wxTestingModalHook : public wxModalDialogHook
 public:
     wxTestingModalHook()
     {
-        m_prevHook = wxModalDialogHook::Set(this);
+        Register();
     }
 
-    virtual ~wxTestingModalHook()
+    // Called to verify that all expectations were met. This cannot be done in
+    // the destructor, because ReportFailure() may throw (either because it's
+    // overriden or because wx's assertions handling is, globally). And
+    // throwing from the destructor would introduce all sort of problems,
+    // including messing up the order of errors in some cases.
+    void CheckUnmetExpectations()
     {
-        wxModalDialogHook::Set(m_prevHook);
+        while ( !m_expectations.empty() )
+        {
+            const wxModalExpectation *expect = m_expectations.front();
+            m_expectations.pop();
+            if ( expect->IsOptional() )
+                continue;
+
+            ReportFailure
+            (
+                wxString::Format
+                (
+                    "Expected %s dialog was not shown.",
+                    expect->GetDescription()
+                )
+            );
+            break;
+        }
+    }
+
+    void AddExpectation(const wxModalExpectation& e)
+    {
+        m_expectations.push(&e);
     }
 
-    virtual int Invoke(wxDialog *dlg)
+protected:
+    virtual int Enter(wxDialog *dlg)
     {
         while ( !m_expectations.empty() )
         {
@@ -281,37 +263,6 @@ public:
         return wxID_NONE;
     }
 
-    // Called to verify that all expectations were met. This cannot be done in
-    // the destructor, because ReportFailure() may throw (either because it's
-    // overriden or because wx's assertions handling is, globally). And
-    // throwing from the destructor would introduce all sort of problems,
-    // including messing up the order of errors in some cases.
-    void CheckUnmetExpectations()
-    {
-        while ( !m_expectations.empty() )
-        {
-            const wxModalExpectation *expect = m_expectations.front();
-            m_expectations.pop();
-            if ( expect->IsOptional() )
-                continue;
-
-            ReportFailure
-            (
-                wxString::Format
-                (
-                    "Expected %s dialog was not shown.",
-                    expect->GetDescription()
-                )
-            );
-            break;
-        }
-    }
-
-    void AddExpectation(const wxModalExpectation& e)
-    {
-        m_expectations.push(&e);
-    }
-
 protected:
     virtual void ReportFailure(const wxString& msg)
     {
@@ -319,7 +270,6 @@ protected:
     }
 
 private:
-    wxModalDialogHook *m_prevHook;
     std::queue<const wxModalExpectation*> m_expectations;
 
     wxDECLARE_NO_COPY_CLASS(wxTestingModalHook);
diff --git a/interface/wx/modalhook.h b/interface/wx/modalhook.h
new file mode 100644 (file)
index 0000000..16df4bc
--- /dev/null
@@ -0,0 +1,149 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/modalhook.h
+// Purpose:     Public interface of wxModalDialogHook class.
+// Author:      Vadim Zeitlin
+// Copyright:   (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+    Allows to intercept all modal dialog calls.
+
+    This class can be used to hook into normal modal dialog handling for some
+    special needs. One of the most common use cases is for testing: as
+    automatic tests can't continue if a modal dialog is shown while they run,
+    this class can be used to avoid showing the modal dialogs during unattended
+    execution. wxModalDialogHook can also be used for disabling some background
+    operation while a modal dialog is shown.
+
+    To install a modal dialog hook, you need to derive your own class from this
+    one and implement its pure virtual Enter() method. Then simply create an
+    object of your class and call Register() on it to start receiving calls to
+    your overridden Enter() (and possibly Exit()) methods:
+    @code
+        class MyModalDialogHook : public wxModalDialogHook
+        {
+        protected:
+            virtual int Enter(wxDialog* dialog)
+            {
+                // Just for demonstration purposes, intercept all uses of
+                // wxFileDialog. Notice that this doesn't provide any real
+                // sandboxing, of course, the program can still read and write
+                // files by not using wxFileDialog to ask the user for their
+                // names.
+                if ( wxDynamicCast(dialog, wxFileDialog) )
+                {
+                    wxLogError("Access to file system disallowed.");
+
+                    // Skip showing the file dialog entirely.
+                    return wxID_CANCEL;
+                }
+
+                m_lastEnter = wxDateTime::Now();
+
+                // Allow the dialog to be shown as usual.
+                return wxID_NONE;
+            }
+
+            virtual void Exit(wxDialog* dialog)
+            {
+                // Again, just for demonstration purposes, show how long did
+                // the user take to dismiss the dialog. Notice that we
+                // shouldn't use wxLogMessage() here as this would result in
+                // another modal dialog call and hence infinite recursion. In
+                // general, the hooks should be as unintrusive as possible.
+                wxLogDebug("%s dialog took %s to be dismissed",
+                           dialog->GetClassInfo()->GetClassName(),
+                           (wxDateTime::Now() - m_lastEnter).Format());
+            }
+        };
+
+        class MyApp : public wxApp
+        {
+        public:
+            virtual bool OnInit()
+            {
+                ...
+                m_myHook.Register();
+                ...
+            }
+
+        private:
+            MyModalDialogHook m_myHook;
+        };
+    @endcode
+
+    @since 2.9.5
+ */
+class wxModalDialogHook
+{
+public:
+    /**
+        Default and trivial constructor.
+
+        The constructor doesn't do anything, call Register() to make this hook
+        active.
+     */
+    wxModalDialogHook();
+
+    /**
+        Destructor unregisters the hook if it's currently active.
+     */
+    virtual ~wxModalDialogHook();
+
+    /**
+        Register this hook as being active.
+
+        After registering the hook, its Enter() and Exit() methods will be
+        called whenever a modal dialog is shown.
+
+        Notice that the order of registration matters: the last hook registered
+        is called first, and if its Enter() returns a value different from
+        ::wxID_NONE, the subsequent hooks are skipped.
+
+        It is an error to register the same hook twice.
+     */
+    void Register();
+
+    /**
+        Unregister this hook.
+
+        Notice that is done automatically from the destructor, so usually
+        calling this method explicitly is unnecessary.
+
+        The hook must be currently registered.
+     */
+    void Unregister();
+
+protected:
+    /**
+        Called by wxWidgets before showing any modal dialogs.
+
+        Override this to be notified whenever a modal dialog is about to be
+        shown.
+
+        If the return value of this method is ::wxID_NONE, the dialog is shown
+        as usual and Exit() will be called when it is dismissed. If the return
+        value is anything else, the dialog is not shown at all and its
+        wxDialog::ShowModal() simply returns with the given result. In this
+        case, Exit() won't be called neither.
+
+        @param dialog The dialog about to be shown, never @NULL.
+        @return wxID_NONE to continue with showing the dialog or anything else
+            to skip showing the dialog and just return this value from its
+            ShowModal().
+     */
+    virtual int Enter(wxDialog* dialog) = 0;
+
+    /**
+        Called by wxWidgets after dismissing the modal dialog.
+
+        Notice that it won't be called if Enter() hadn't been called because
+        another modal hook, registered after this one, intercepted the dialog
+        or if our Enter() was called but returned a value different from
+        ::wxID_NONE.
+
+        @param dialog The dialog that was shown and dismissed, never @NULL.
+     */
+    virtual void Exit(wxDialog* dialog);
+};
index 679838a4dd63ebdc109c716dcebf3e7b190bee14..11a4bc4388bb1c2b686a0249c59a4902bf2ec5fa 100644 (file)
@@ -32,6 +32,7 @@
 #include "wx/minifram.h"
 #include "wx/sysopt.h"
 #include "wx/notifmsg.h"
+#include "wx/modalhook.h"
 
 #if wxUSE_RICHMSGDLG
     #include "wx/richmsgdlg.h"
@@ -249,6 +250,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
 
     EVT_MENU(DIALOGS_STANDARD_BUTTON_SIZER_DIALOG,  MyFrame::OnStandardButtonsSizerDialog)
     EVT_MENU(DIALOGS_TEST_DEFAULT_ACTION,           MyFrame::OnTestDefaultActionDialog)
+    EVT_MENU(DIALOGS_MODAL_HOOK,                    MyFrame::OnModalHook)
 
     EVT_MENU(DIALOGS_REQUEST,                       MyFrame::OnRequestUserAttention)
 #if wxUSE_NOTIFICATION_MESSAGE
@@ -538,6 +540,7 @@ bool MyApp::OnInit()
 
     menuDlg->Append(DIALOGS_STANDARD_BUTTON_SIZER_DIALOG, wxT("&Standard Buttons Sizer Dialog"));
     menuDlg->Append(DIALOGS_TEST_DEFAULT_ACTION, wxT("&Test dialog default action"));
+    menuDlg->AppendCheckItem(DIALOGS_MODAL_HOOK, "Enable modal dialog hook");
 
     menuDlg->AppendSeparator();
     menuDlg->Append(wxID_EXIT, wxT("E&xit\tAlt-X"));
@@ -2105,6 +2108,32 @@ void MyFrame::OnTestDefaultActionDialog(wxCommandEvent& WXUNUSED(event))
     dialog.ShowModal();
 }
 
+void MyFrame::OnModalHook(wxCommandEvent& event)
+{
+    class TestModalHook : public wxModalDialogHook
+    {
+    protected:
+        virtual int Enter(wxDialog* dialog)
+        {
+            wxLogStatus("Showing %s modal dialog",
+                        dialog->GetClassInfo()->GetClassName());
+            return wxID_NONE;
+        }
+
+        virtual void Exit(wxDialog* dialog)
+        {
+            wxLogStatus("Leaving %s modal dialog",
+                        dialog->GetClassInfo()->GetClassName());
+        }
+    };
+
+    static TestModalHook s_hook;
+    if ( event.IsChecked() )
+        s_hook.Register();
+    else
+        s_hook.Unregister();
+}
+
 void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event) )
 {
     Close(true);
index f92379f33f652359aedafefc118833cf994ab5d7..3d866d9a40133e28364b97f009096173e662600b 100644 (file)
@@ -475,6 +475,7 @@ public:
     void OnStandardButtonsSizerDialog(wxCommandEvent& event);
 
     void OnTestDefaultActionDialog(wxCommandEvent& event);
+    void OnModalHook(wxCommandEvent& event);
 
     void OnExit(wxCommandEvent& event);
 
@@ -588,7 +589,8 @@ enum
     DIALOGS_PROPERTY_SHEET_TOOLBOOK,
     DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK,
     DIALOGS_STANDARD_BUTTON_SIZER_DIALOG,
-    DIALOGS_TEST_DEFAULT_ACTION
+    DIALOGS_TEST_DEFAULT_ACTION,
+    DIALOGS_MODAL_HOOK
 };
 
 #endif
index fbc8bbe18d48749a162aa3a47b0247f45929e530..72a380243cfde788d03dbb7978a05cb9cc4f8542 100644 (file)
@@ -19,7 +19,7 @@
     #include "wx/settings.h"
 #endif //WX_PRECOMP
 
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 #include "wx/cocoa/autorelease.h"
 #include "wx/cocoa/string.h"
 
@@ -128,7 +128,7 @@ bool wxDialog::Show(bool show)
 // is stopped (via EndModal()) it returns the exit code.
 int wxDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxCHECK_MSG(!IsModal(),GetReturnCode(),wxT("wxDialog::ShowModal called within its own modal loop"));
 
index bc4613aa22e2503433cd9733772a6de2ab300edd..2f2ce30012084ad87bda26c4663926c7dd8ca649 100644 (file)
@@ -31,7 +31,7 @@
 #endif
 
 #include "wx/filename.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include "wx/cocoa/autorelease.h"
 #include "wx/cocoa/string.h"
@@ -105,7 +105,7 @@ wxDirDialog::~wxDirDialog()
 
 int wxDirDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxAutoNSAutoreleasePool thePool;
 
index 613f75bfeab2b521314ac61297a1ad60d902bee6..e953896a7b79d264ac34eb2a5f344b6dcfe11cde 100644 (file)
@@ -33,7 +33,7 @@
 
 #include "wx/cocoa/autorelease.h"
 #include "wx/cocoa/string.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #import <AppKit/NSOpenPanel.h>
 #import <AppKit/NSSavePanel.h>
@@ -197,7 +197,7 @@ void wxFileDialog::SetPath(const wxString& path)
 
 int wxFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxAutoNSAutoreleasePool thePool;
 
index 0d6072a226f83235d412ba51577a3c029c6e5825..b14a70ba6100a2cb90a607b9b8ab9d23967b19bf 100644 (file)
@@ -31,7 +31,7 @@
 
 #include "wx/cocoa/autorelease.h"
 #include "wx/cocoa/string.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #import <AppKit/NSAlert.h>
 // ============================================================================
@@ -73,7 +73,7 @@ void wxCocoaMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& va
 
 int wxCocoaMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxAutoNSAutoreleasePool thePool;
 
index 1bc4d72667c24978a9f6913924f4a1fe34263bca..4c52be1cee32e0e0174b8b31488772bccd0733bb 100644 (file)
@@ -43,7 +43,7 @@
 #include "wx/bookctrl.h"
 #include "wx/scrolwin.h"
 #include "wx/textwrapper.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #if wxUSE_DISPLAY
 #include "wx/display.h"
@@ -51,8 +51,6 @@
 
 extern WXDLLEXPORT_DATA(const char) wxDialogNameStr[] = "dialog";
 
-wxModalDialogHook *wxModalDialogHook::ms_instance = NULL;
-
 // ----------------------------------------------------------------------------
 // XTI
 // ----------------------------------------------------------------------------
diff --git a/src/common/modalhook.cpp b/src/common/modalhook.cpp
new file mode 100644 (file)
index 0000000..0bba449
--- /dev/null
@@ -0,0 +1,120 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        src/common/modalhook.cpp
+// Purpose:     wxModalDialogHook implementation
+// Author:      Vadim Zeitlin
+// Created:     2013-05-19
+// RCS-ID:      $Id$
+// Copyright:   (c) 2013 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// for compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/modalhook.h"
+
+#ifndef WX_PRECOMP
+#endif // WX_PRECOMP
+
+wxModalDialogHook::Hooks wxModalDialogHook::ms_hooks;
+
+// ============================================================================
+// wxModalDialogHook implementation
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// Hooks management
+// ----------------------------------------------------------------------------
+
+void wxModalDialogHook::Register()
+{
+#if wxDEBUG_LEVEL
+    for ( Hooks::const_iterator it = ms_hooks.begin();
+          it != ms_hooks.end();
+          ++it)
+    {
+        if ( *it == this )
+        {
+            wxFAIL_MSG( wxS("Registering already registered hook?") );
+            return;
+        }
+    }
+#endif // wxDEBUG_LEVEL
+
+    ms_hooks.insert(ms_hooks.begin(), this);
+}
+
+void wxModalDialogHook::Unregister()
+{
+    if ( !DoUnregister() )
+    {
+        wxFAIL_MSG( wxS("Unregistering not registered hook?") );
+    }
+}
+
+bool wxModalDialogHook::DoUnregister()
+{
+    for ( Hooks::iterator it = ms_hooks.begin();
+          it != ms_hooks.end();
+          ++it )
+    {
+        if ( *it == this )
+        {
+            ms_hooks.erase(it);
+            return true;
+        }
+    }
+
+    return false;
+}
+
+// ----------------------------------------------------------------------------
+// Invoking hooks methods
+// ----------------------------------------------------------------------------
+
+/* static */
+int wxModalDialogHook::CallEnter(wxDialog* dialog)
+{
+    // Make a copy of the hooks list to avoid problems if it's modified while
+    // we're iterating over it: this is unlikely to happen in our case, but
+    // quite possible in CallExit() as the hooks may remove themselves after
+    // the call to their Exit(), so do it here for symmetry as well.
+    const Hooks hooks = ms_hooks;
+
+    for ( Hooks::const_iterator it = hooks.begin(); it != hooks.end(); ++it )
+    {
+        const int rc = (*it)->Enter(dialog);
+        if ( rc != wxID_NONE )
+        {
+            // Skip calling all the rest of the hooks if one of them preempts
+            // showing the dialog completely.
+            return rc;
+        }
+    }
+
+    return wxID_NONE;
+}
+
+/* static */
+void wxModalDialogHook::CallExit(wxDialog* dialog)
+{
+    // See comment in CallEnter() for the reasons for making a copy here.
+    const Hooks hooks = ms_hooks;
+
+    for ( Hooks::const_iterator it = hooks.begin(); it != hooks.end(); ++it )
+    {
+        (*it)->Exit(dialog);
+    }
+}
index cd2e4da73f007f841464b3948d193e034bac5fc4..96ad05137f5069e41ddcc6624b5b7f066517185d 100644 (file)
@@ -49,7 +49,7 @@
 #include "wx/filectrl.h"
 #include "wx/generic/filedlgg.h"
 #include "wx/debug.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #if wxUSE_TOOLTIPS
     #include "wx/tooltip.h"
@@ -309,7 +309,7 @@ wxBitmapButton* wxGenericFileDialog::AddBitmapButton( wxWindowID winId,
 
 int wxGenericFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     if (CreateExtraControl())
     {
index 8a16ab3d9cd20cc83b31a339673c97893e928879..4050fcaee88200639f5220fa5b8fd3be961632de 100644 (file)
@@ -39,7 +39,7 @@
 #include "wx/msgdlg.h"
 #include "wx/artprov.h"
 #include "wx/textwrapper.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #if wxUSE_STATLINE
     #include "wx/statline.h"
@@ -267,7 +267,7 @@ void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
 
 int wxGenericMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     if ( !m_created )
     {
index b3a806d5b25d0a5d85e070e8c9c2102a664642fe..ff47456e797ba1fa72a12a6169b43128197a0498 100644 (file)
@@ -19,7 +19,7 @@
 #if wxUSE_COLOURDLG
 
 #include "wx/colordlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef WX_PRECOMP
     #include "wx/intl.h"
@@ -84,7 +84,7 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
 
 int wxColourDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     ColourDataToDialog();
 
index a79ee902e29a864fbb219f9d427e172f3ccec146..5d397cfe2f70a7b528e15b650009663a07a65569 100644 (file)
@@ -19,7 +19,7 @@
 #include "wx/evtloop.h"
 
 #include "wx/scopedptr.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include <gtk/gtk.h>
 #include "wx/gtk/private/gtk2-compat.h"
@@ -133,7 +133,7 @@ realize_hook(GSignalInvocationHint*, unsigned, const GValue* param_values, void*
 
 int wxDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" );
 
index aa00e8c42198d4f150beb36503f0280e362377e9..ce8c9db6cf89a998b0ead54ff3f8541570ee9334 100644 (file)
@@ -29,7 +29,7 @@
 #include "wx/filename.h" // wxFilename
 #include "wx/tokenzr.h" // wxStringTokenizer
 #include "wx/filefn.h" // ::wxGetCwd
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 extern "C"
 {
@@ -320,7 +320,7 @@ void wxFileDialog::GTKOnCancel()
 
 int wxFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     CreateExtraControl();
 
index 767c3c2f48a098a5986c3658e4db3de3523a1fd8..e4fe6daf814e59da944fd5f48c5d1e3b09f1f13d 100644 (file)
@@ -34,7 +34,7 @@
 #include "wx/dynlib.h"
 #include "wx/paper.h"
 #include "wx/dcprint.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include <libgnomeprint/gnome-print.h>
 #include <libgnomeprint/gnome-print-pango.h>
@@ -592,7 +592,7 @@ wxGnomePrintDialog::~wxGnomePrintDialog()
 
 int wxGnomePrintDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     int response = gtk_dialog_run (GTK_DIALOG (m_widget));
 
@@ -739,7 +739,7 @@ wxPageSetupDialogData& wxGnomePageSetupDialog::GetPageSetupDialogData()
 
 int wxGnomePageSetupDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxGnomePrintNativeData *native =
       (wxGnomePrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
index 2c561dfca3caf56f7131b14856e965b4a4ce4c2d..6d1104ae6272f90466f67d11b19d9885180b5001 100644 (file)
@@ -24,7 +24,7 @@
     #include "wx/intl.h"
 #endif
 
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include <gtk/gtk.h>
 #include "wx/gtk/private.h"
@@ -276,7 +276,7 @@ void wxMessageDialog::GTKCreateMsgDialog()
 
 int wxMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     // break the mouse capture as it would interfere with modal dialog (see
     // wxDialog::ShowModal)
index 6076ef552fadeef910f45033c3c0750e51e2ddc1..9b7e7a2ca0d409785a1ec14186336d5b1768dbbd 100644 (file)
@@ -34,7 +34,7 @@
 #include "wx/dynlib.h"
 #include "wx/paper.h"
 #include "wx/scopeguard.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include <gtk/gtk.h>
 
@@ -624,7 +624,7 @@ wxGtkPrintDialog::~wxGtkPrintDialog()
 // This is called even if we actually don't want the dialog to appear.
 int wxGtkPrintDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     // We need to restore the settings given in the constructor.
     wxPrintData data = m_printDialogData.GetPrintData();
@@ -750,7 +750,7 @@ wxGtkPageSetupDialog::~wxGtkPageSetupDialog()
 
 int wxGtkPageSetupDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     // Get the config.
     m_pageDialogData.GetPrintData().ConvertToNative();
index 041d74275b4d7ac7c8e250f6434dfb133b9c800a..c760fe0de2699bfc316d3d2d5bf6fa0e6a93c2d7 100644 (file)
@@ -19,7 +19,7 @@
 #endif // WX_PRECOMP
 
 #include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
@@ -183,7 +183,7 @@ void wxDialog::SetModal( bool WXUNUSED(flag) )
 
 int wxDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     if (IsModal())
     {
index 59f8824386cee798d7be064e48b154a8f236a7fa..efebaebf2a3dd693737a82b6c6a535560f45495b 100644 (file)
@@ -13,7 +13,7 @@
 #if wxUSE_FILEDLG
 
 #include "wx/filedlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 
 //-----------------------------------------------------------------------------
@@ -50,7 +50,7 @@ void wxFileDialog::OnFakeOk( wxCommandEvent &event )
 
 int wxFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     return wxGenericFileDialog::ShowModal();
 }
index a63aca7d3fc7c0248eef870ce51f429fde9baa50..25515e450a33a84784b60ef7c2a63adaf0297cc8 100644 (file)
@@ -21,7 +21,7 @@
 #endif
 
 #include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
@@ -289,7 +289,7 @@ bool wxDialog::Show( bool show )
 // Shows a dialog modally, returning a return code
 int wxDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     Show(true);
 
index f1f2970e52f25d60dc5212d9cb5147721c9389c5..5cee8fdb59e1651a8963095ebca50f0a1be3f91e 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "wx/tokenzr.h"
 #include "wx/stockitem.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
@@ -152,7 +152,7 @@ static void wxChangeListBoxColours(wxWindow* WXUNUSED(win), Widget widget)
 
 int wxFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxBeginBusyCursor();
 
index 091d430d9d6406a6c5aaf92e038e70ac93a02e71..c4b5576dd8d9b7c5aaceb5f09d2c33bc54a527ca 100644 (file)
@@ -40,7 +40,7 @@
     #include "wx/settings.h"
 #endif
 
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 #include "wx/motif/private.h"
 
 // ----------------------------------------------------------------------------
@@ -106,7 +106,7 @@ extern "C"
 
 int wxMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     const long style = GetMessageDialogStyle();
 
index 688ca17380e51d4ab41f777b304324e109434d99..8be79f3bc8a4ca8738995b0eb2abd88098bd7197 100644 (file)
@@ -27,7 +27,7 @@
 #if wxUSE_COLOURDLG && !(defined(__SMARTPHONE__) && defined(__WXWINCE__))
 
 #include "wx/colordlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef WX_PRECOMP
     #include "wx/msw/wrapcdlg.h"
@@ -115,7 +115,7 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
 
 int wxColourDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     // initialize the struct used by Windows
     CHOOSECOLOR chooseColorStruct;
index ccab43d45ef18a72bbe17c21dfdf82344670d5d5..b8b73d252549f2f0ce0e499fa542adf4ae5c6628 100644 (file)
@@ -25,7 +25,7 @@
 #endif
 
 #include "wx/dialog.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef WX_PRECOMP
     #include "wx/msw/wrapcdlg.h"
@@ -198,7 +198,7 @@ bool wxDialog::Show(bool show)
 // show dialog modally
 int wxDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxASSERT_MSG( !IsModal(), wxT("ShowModal() can't be called twice") );
 
index 1760eb8d91aecd1f65bb903c16a86da3d57554bf..314299db912b45d3f74dc70814b8738b098ec3f8 100644 (file)
@@ -30,7 +30,7 @@
     (defined(__HANDHELDPC__) && (_WIN32_WCE >= 500)))
 
 #include "wx/dirdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef WX_PRECOMP
     #include "wx/utils.h"
@@ -221,7 +221,7 @@ void wxDirDialog::SetPath(const wxString& path)
 
 int wxDirDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxWindow* const parent = GetParent();
     WXHWND hWndParent = parent ? GetHwndOf(parent) : NULL;
index 27dfd888e5c4f4da3e17ee7bc5a3c78eca3f2da8..e1f5287021a7872ad554ca22bcb637c9088e40ab 100644 (file)
@@ -47,7 +47,7 @@
 #include "wx/filename.h"
 #include "wx/scopeguard.h"
 #include "wx/tokenzr.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 // ----------------------------------------------------------------------------
 // constants
@@ -450,7 +450,7 @@ void wxFileDialog::MSWOnInitDialogHook(WXHWND hwnd)
 
 int wxFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     HWND hWnd = 0;
     if (m_parent) hWnd = (HWND) m_parent->GetHWND();
index 848dd4f5143e08b4040e36148b393d18c7273e63..f800b51c11389e6a3060d7ccd6d2ba8946dbee7d 100644 (file)
@@ -27,7 +27,7 @@
 #if wxUSE_FONTDLG
 
 #include "wx/fontdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef WX_PRECOMP
     #include "wx/msw/wrapcdlg.h"
@@ -56,7 +56,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
 
 int wxFontDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     // It should be OK to always use GDI simulations
     DWORD flags = CF_SCREENFONTS /* | CF_NOSIMULATIONS */ ;
index e9b25735a90bfd0bbbf7d7f36682288ba23de459..56c2885867525d4ac649994019090f356b73fcc0 100644 (file)
@@ -42,7 +42,7 @@
 #include "wx/msw/private/button.h"
 #include "wx/msw/private/metrics.h"
 #include "wx/msw/private/msgdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #if wxUSE_MSGBOX_HOOK
     #include "wx/fontutil.h"
@@ -592,7 +592,7 @@ int wxMessageDialog::ShowMessageBox()
 
 int wxMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
 #ifdef wxHAS_MSW_TASKDIALOG
     if ( HasNativeTaskDialog() )
index a3da80615abd003186b9a0612d844e9c0040a028..e91ddf2e3121f438db22b7964a5db5dc2b1b8125 100644 (file)
@@ -39,7 +39,7 @@
 #include "wx/msw/printdlg.h"
 #include "wx/msw/dcprint.h"
 #include "wx/paper.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include <stdlib.h>
 
@@ -739,7 +739,7 @@ wxWindowsPrintDialog::~wxWindowsPrintDialog()
 
 int wxWindowsPrintDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     ConvertToNative( m_printDialogData );
 
@@ -960,7 +960,7 @@ wxWindowsPageSetupDialog::~wxWindowsPageSetupDialog()
 
 int wxWindowsPageSetupDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     ConvertToNative( m_pageSetupData );
 
index 67a827e21b151560b0d9a9b5015700536a906512..58bb7cf68d297e93db2b33ff7eef817023f039c8 100644 (file)
@@ -18,7 +18,7 @@
 #if wxUSE_RICHMSGDLG
 
 #include "wx/richmsgdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef WX_PRECOMP
     #include "wx/msw/private.h"
@@ -34,7 +34,7 @@
 
 int wxRichMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
 #ifdef wxHAS_MSW_TASKDIALOG
     using namespace wxMSWMessageDialog;
index 5a7ff8a7a94bb279951ee7707f4ac04e8ec5d6bd..66abfd16296a58039d159b7e9b67a9006a8ee3bc 100644 (file)
@@ -47,7 +47,7 @@
 #include <string.h>
 
 #include "wx/filename.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 // ============================================================================
 // implementation
@@ -113,7 +113,7 @@ void wxFileDialog::SetPath(const wxString& path)
 
 int wxFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxWindow* parentWindow = GetParent();
     if (!parentWindow)
index 7b1b0d0ce13d33d996a47f900589a8a17cca25aa..c6520d969894bf14f62756ff89a037d1cb66dee8 100644 (file)
@@ -26,7 +26,7 @@
 #include "wx/os2/private.h"
 #include "wx/evtloop.h"
 #include "wx/scopedptr.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #define wxDIALOG_DEFAULT_X 300
 #define wxDIALOG_DEFAULT_Y 300
@@ -220,7 +220,7 @@ bool wxDialog::Show( bool bShow )
 //
 int wxDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxASSERT_MSG( !IsModal(), wxT("wxDialog::ShowModal() reentered?") );
 
index 5ae4e61dd64b6868f0e6ced58d4450b87c1d27c4..eef18aa52576fb4f7b19eee659ba3681cf0e7f4d 100644 (file)
@@ -13,7 +13,7 @@
 #include "wx/wxprec.h"
 
 #include "wx/dirdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef WX_PRECOMP
     #include <stdio.h>
@@ -43,7 +43,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
 
 int wxDirDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     // TODO
     return wxID_CANCEL;
index 65c8c59df48831e0f560cde2197a29264df22bd0..d6d93809f35e4148b51507211404e7aa7fef7773 100644 (file)
@@ -39,7 +39,7 @@
 #include <string.h>
 
 #include "wx/tokenzr.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #define wxMAXPATH                    1024
 #define wxMAXFILE                    1024
@@ -105,7 +105,7 @@ void wxFileDialog::GetPaths (
 
 int wxFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxString                        sTheFilter;
     wxString                        sFilterBuffer;
index fe9cc27b1559d07a885d21ecc1b285d2708de717..a94cc912471a147be968e2aeba47dc0c9659efa1 100644 (file)
@@ -23,7 +23,7 @@
 #endif
 
 #include "wx/fontutil.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #define INCL_PM
 #include <os2.h>
@@ -37,7 +37,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxFontDialog, wxDialog)
 
 int wxFontDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     FONTDLG      vFontDlg;
     char         zCurrentFont[FACESIZE];
index 81dc82639f44554b22047a6465c9b4edead0dd10..0fb64437af16fc44ca3e5943a99cc772bd25fd97 100644 (file)
@@ -22,7 +22,7 @@
     #include "wx/math.h"
 #endif
 
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 #include "wx/os2/private.h"
 
 #include <stdlib.h>
@@ -35,7 +35,7 @@ IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
 
 int wxMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     HWND                            hWnd = 0;
     ULONG                           ulStyle = MB_OK;
index 18c4af745a7811cf84ec6e7f80b56465c67c4523..c5a7b1c47f899f397b11946fba3e06b64eb1d50e 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "wx/colordlg.h"
 #include "wx/fontdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 
 #if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
@@ -48,7 +48,7 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
 
 int wxColourDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     RGBColor currentColor ;
 
index 4f12861d3d571d0f2b934bede481e7a80494e62f..278f9ec9cdca6a1df9b7acb9cf1ecfd42d1d8269 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "wx/colordlg.h"
 #include "wx/fontdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 // ============================================================================
 // implementation
@@ -124,7 +124,7 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data)
 }
 int wxColourDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     //Start the pool.  Required for carbon interaction
     //(For those curious, the only thing that happens
index 4f98aa02da956540ea16cb6fb5a7b05a53d65a04..9ff1c075e7058beb7064f4c7cc6ff45f68ecee99 100644 (file)
@@ -21,7 +21,7 @@
 #endif // WX_PRECOMP
 
 #include "wx/filename.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include "wx/osx/private.h"
 
@@ -73,7 +73,7 @@ wxDirDialog::wxDirDialog(wxWindow *parent,
 
 int wxDirDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     NavDialogRef dialog = NULL;
     NavDialogCreationOptions options;
index d04dfb192362bcf1f70e58e5dfe1d870e44c62c9..b0a4e7b51b444608790d6c4c781fe442c02fa9e4 100644 (file)
@@ -26,7 +26,7 @@
 #include "wx/filename.h"
 
 #include "wx/osx/private.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef __DARWIN__
     #include <Navigation.h>
@@ -477,7 +477,7 @@ void wxFileDialog::SetupExtraControls(WXWindow nativeWindow)
 
 int wxFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     m_paths.Empty();
     m_fileNames.Empty();
index 2aa22e63ecad7bcaf4c86be5d989775adfaa9637..b1ae442c7803e31fda66013ad5e8a1eb3dee69e6 100644 (file)
@@ -42,7 +42,7 @@
 
 #include "wx/fontdlg.h"
 #include "wx/fontutil.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #if wxOSX_USE_EXPERIMENTAL_FONTDIALOG
 
@@ -230,7 +230,7 @@ bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data)
 
 int wxFontDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
 #if wxOSX_USE_CARBON
 
index b1389b39bce11d8afd6c9c8610e6f0161874a126..0ac8bd7d55b8cab2b823a4f8f2738e836c351813 100644 (file)
@@ -28,7 +28,7 @@
 #endif
 
 #include "wx/fontutil.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 // ============================================================================
 // implementation
@@ -435,7 +435,7 @@ bool wxFontDialog::Create(wxWindow *parent)
 
 int wxFontDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     //Start the pool.  Required for carbon interaction
     //(For those curious, the only thing that happens
index 808fbcc3857a10bead04885d545ed1a872207bc5..6ce68371d1143797a85e6fb84bf9aff3fafcdde5 100644 (file)
@@ -19,7 +19,7 @@
 #endif
 
 #include "wx/thread.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 #include "wx/osx/uma.h"
 
 
@@ -37,7 +37,7 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent,
 
 int wxMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     int resultbutton = wxID_CANCEL;
 
index 2a9c234ec75bb3e5c8f6cfb8530c0802d996eebf..0729a4770a5887bc1f37e499547b17d8e2d07302 100644 (file)
 #include "wx/osx/private/print.h"
 #include "wx/osx/private.h"
 #include "wx/statline.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 int wxMacPrintDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     m_printDialogData.GetPrintData().ConvertToNative();
     ((wxOSXPrintData*)m_printDialogData.GetPrintData().GetNativeData())->TransferFrom( &m_printDialogData );
@@ -77,7 +77,7 @@ int wxMacPrintDialog::ShowModal()
 
 int wxMacPageSetupDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     m_pageSetupData.GetPrintData().ConvertToNative();
     wxOSXPrintData* nativeData = (wxOSXPrintData*)m_pageSetupData.GetPrintData().GetNativeData();
index ad757e2adcc60f35b617821bac84d9c71908e671..02f92f94f834021452b8ae1fef664c9c9fce5ede 100644 (file)
@@ -32,7 +32,7 @@
 
 #include "wx/filename.h"
 #include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include "wx/osx/private.h"
 
@@ -95,7 +95,7 @@ void wxDirDialog::ShowWindowModal()
 
 int wxDirDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxCFEventLoopPauseIdleEvents pause;
 
index 1d162848eaf383cde3db1854ca87625741d39269..49e8680f065997e7d61af46796728bff36b6af15 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "wx/osx/private.h"
 #include "wx/sysopt.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #include <mach-o/dyld.h>
 
@@ -501,7 +501,7 @@ void wxFileDialog::SetupExtraControls(WXWindow nativeWindow)
 
 int wxFileDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxCFEventLoopPauseIdleEvents pause;
 
index 8218fc7e872dad4920a334ec3e4efbbdb03c710c..40ed938450cc39086eef58770f64eb8d3a2283f8 100644 (file)
@@ -21,7 +21,7 @@
 #include "wx/control.h"
 #include "wx/thread.h"
 #include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 #include "wx/osx/private.h"
 
 
@@ -63,7 +63,7 @@ wxMessageDialog::~wxMessageDialog()
 
 int wxMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     wxCFEventLoopPauseIdleEvents pause;
     
index ef9268b37720e23f41a34bc004fc95c496991772..f453778334d0457fcb987c6ba886b396d8cb5394 100644 (file)
@@ -14,7 +14,7 @@
 #if wxUSE_PRINTING_ARCHITECTURE
 
 #include "wx/printdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef WX_PRECOMP
     #include "wx/object.h"
@@ -60,7 +60,7 @@ void wxOSXCocoaPrintData::UpdateToPMState()
 
 int wxMacPrintDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     m_printDialogData.GetPrintData().ConvertToNative();
 
@@ -85,7 +85,7 @@ int wxMacPrintDialog::ShowModal()
 
 int wxMacPageSetupDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     m_pageSetupData.GetPrintData().ConvertToNative();
     ((wxOSXCocoaPrintData*)m_pageSetupData.GetPrintData().GetNativeData())->TransferFrom( &m_pageSetupData );
index 8bb543ff756dce463b92d38b16a911e36adbeec4..cb127f323b817f660d9d931039af2a7853fe3476 100644 (file)
@@ -13,7 +13,7 @@
 
 #include "wx/dialog.h"
 #include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 #ifndef WX_PRECOMP
     #include "wx/app.h"
@@ -138,7 +138,7 @@ bool wxDialog::Show(bool show)
 // Replacement for Show(true) for modal dialogs - returns return code
 int wxDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     m_modality = wxDIALOG_MODALITY_APP_MODAL;
 
index 9d11768149a16fde2ef2ab4dc81cabf59b0c47d1..c6b4021a88b8fb0786310b9c1f896d20dffee604 100644 (file)
@@ -20,7 +20,7 @@
 
 #include "wx/thread.h"
 #include "wx/osx/private.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 
 IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
@@ -37,7 +37,7 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent,
 
 int wxMessageDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     int resultbutton = wxID_CANCEL;
 
index bb1c941125678efc356f97f04e752fa39cbaa03c..4c9609f09787152be352ea8e27ec93ced13fcc2e 100644 (file)
@@ -29,7 +29,7 @@
 #endif
 
 #include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
 
 //-----------------------------------------------------------------------------
 // wxDialog
@@ -166,7 +166,7 @@ bool wxDialog::IsModal() const
 
 int wxDialog::ShowModal()
 {
-    WX_TESTING_SHOW_MODAL_HOOK();
+    WX_HOOK_MODAL_DIALOG();
 
     if ( IsModal() )
     {