wx/listbox.h \
wx/mdi.h \
wx/menu.h \
+ wx/modalhook.h \
wx/mousemanager.h \
wx/msgdlg.h \
wx/nativewin.h \
monodll_markupparser.o \
monodll_matrix.o \
monodll_menucmn.o \
+ monodll_modalhook.o \
monodll_mousemanager.o \
monodll_nbkbase.o \
monodll_overlaycmn.o \
monodll_markupparser.o \
monodll_matrix.o \
monodll_menucmn.o \
+ monodll_modalhook.o \
monodll_mousemanager.o \
monodll_nbkbase.o \
monodll_overlaycmn.o \
monolib_markupparser.o \
monolib_matrix.o \
monolib_menucmn.o \
+ monolib_modalhook.o \
monolib_mousemanager.o \
monolib_nbkbase.o \
monolib_overlaycmn.o \
monolib_markupparser.o \
monolib_matrix.o \
monolib_menucmn.o \
+ monolib_modalhook.o \
monolib_mousemanager.o \
monolib_nbkbase.o \
monolib_overlaycmn.o \
coredll_markupparser.o \
coredll_matrix.o \
coredll_menucmn.o \
+ coredll_modalhook.o \
coredll_mousemanager.o \
coredll_nbkbase.o \
coredll_overlaycmn.o \
coredll_markupparser.o \
coredll_matrix.o \
coredll_menucmn.o \
+ coredll_modalhook.o \
coredll_mousemanager.o \
coredll_nbkbase.o \
coredll_overlaycmn.o \
corelib_markupparser.o \
corelib_matrix.o \
corelib_menucmn.o \
+ corelib_modalhook.o \
corelib_mousemanager.o \
corelib_nbkbase.o \
corelib_overlaycmn.o \
corelib_markupparser.o \
corelib_matrix.o \
corelib_menucmn.o \
+ corelib_modalhook.o \
corelib_mousemanager.o \
corelib_nbkbase.o \
corelib_overlaycmn.o \
@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
@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
@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
@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
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
wx/listbox.h
wx/mdi.h
wx/menu.h
+ wx/modalhook.h
wx/mousemanager.h
wx/msgdlg.h
wx/nativewin.h
$(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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
!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
!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
!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
!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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
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
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
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
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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
!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
!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
!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
!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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
$(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
!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
!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
!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
!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
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
# 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
!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
# 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
# End Group
# End Target
# End Project
-
<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
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
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
- 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).
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// 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_
#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
// ----------------------------------------------------------------------------
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() )
{
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)
{
}
private:
- wxModalDialogHook *m_prevHook;
std::queue<const wxModalExpectation*> m_expectations;
wxDECLARE_NO_COPY_CLASS(wxTestingModalHook);
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// 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);
+};
#include "wx/minifram.h"
#include "wx/sysopt.h"
#include "wx/notifmsg.h"
+#include "wx/modalhook.h"
#if wxUSE_RICHMSGDLG
#include "wx/richmsgdlg.h"
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
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"));
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);
void OnStandardButtonsSizerDialog(wxCommandEvent& event);
void OnTestDefaultActionDialog(wxCommandEvent& event);
+ void OnModalHook(wxCommandEvent& event);
void OnExit(wxCommandEvent& event);
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
#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"
// 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"));
#endif
#include "wx/filename.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/string.h"
int wxDirDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxAutoNSAutoreleasePool thePool;
#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>
int wxFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxAutoNSAutoreleasePool thePool;
#include "wx/cocoa/autorelease.h"
#include "wx/cocoa/string.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#import <AppKit/NSAlert.h>
// ============================================================================
int wxCocoaMessageDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxAutoNSAutoreleasePool thePool;
#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"
extern WXDLLEXPORT_DATA(const char) wxDialogNameStr[] = "dialog";
-wxModalDialogHook *wxModalDialogHook::ms_instance = NULL;
-
// ----------------------------------------------------------------------------
// XTI
// ----------------------------------------------------------------------------
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// 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);
+ }
+}
#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"
int wxGenericFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
if (CreateExtraControl())
{
#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"
int wxGenericMessageDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
if ( !m_created )
{
#if wxUSE_COLOURDLG
#include "wx/colordlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifndef WX_PRECOMP
#include "wx/intl.h"
int wxColourDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
ColourDataToDialog();
#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"
int wxDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" );
#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"
{
int wxFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
CreateExtraControl();
#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>
int wxGnomePrintDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
int response = gtk_dialog_run (GTK_DIALOG (m_widget));
int wxGnomePageSetupDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxGnomePrintNativeData *native =
(wxGnomePrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();
#include "wx/intl.h"
#endif
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include <gtk/gtk.h>
#include "wx/gtk/private.h"
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)
#include "wx/dynlib.h"
#include "wx/paper.h"
#include "wx/scopeguard.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include <gtk/gtk.h>
// 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();
int wxGtkPageSetupDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
// Get the config.
m_pageDialogData.GetPrintData().ConvertToNative();
#endif // WX_PRECOMP
#include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include <gdk/gdk.h>
#include <gtk/gtk.h>
int wxDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
if (IsModal())
{
#if wxUSE_FILEDLG
#include "wx/filedlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
//-----------------------------------------------------------------------------
int wxFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
return wxGenericFileDialog::ShowModal();
}
#endif
#include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifdef __VMS__
#pragma message disable nosimpint
// Shows a dialog modally, returning a return code
int wxDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
Show(true);
#include "wx/tokenzr.h"
#include "wx/stockitem.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifdef __VMS__
#pragma message disable nosimpint
int wxFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxBeginBusyCursor();
#include "wx/settings.h"
#endif
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include "wx/motif/private.h"
// ----------------------------------------------------------------------------
int wxMessageDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
const long style = GetMessageDialogStyle();
#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"
int wxColourDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
// initialize the struct used by Windows
CHOOSECOLOR chooseColorStruct;
#endif
#include "wx/dialog.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifndef WX_PRECOMP
#include "wx/msw/wrapcdlg.h"
// 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") );
(defined(__HANDHELDPC__) && (_WIN32_WCE >= 500)))
#include "wx/dirdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifndef WX_PRECOMP
#include "wx/utils.h"
int wxDirDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxWindow* const parent = GetParent();
WXHWND hWndParent = parent ? GetHwndOf(parent) : NULL;
#include "wx/filename.h"
#include "wx/scopeguard.h"
#include "wx/tokenzr.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
// ----------------------------------------------------------------------------
// constants
int wxFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
HWND hWnd = 0;
if (m_parent) hWnd = (HWND) m_parent->GetHWND();
#if wxUSE_FONTDLG
#include "wx/fontdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifndef WX_PRECOMP
#include "wx/msw/wrapcdlg.h"
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 */ ;
#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"
int wxMessageDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
#ifdef wxHAS_MSW_TASKDIALOG
if ( HasNativeTaskDialog() )
#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>
int wxWindowsPrintDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
ConvertToNative( m_printDialogData );
int wxWindowsPageSetupDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
ConvertToNative( m_pageSetupData );
#if wxUSE_RICHMSGDLG
#include "wx/richmsgdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifndef WX_PRECOMP
#include "wx/msw/private.h"
int wxRichMessageDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
#ifdef wxHAS_MSW_TASKDIALOG
using namespace wxMSWMessageDialog;
#include <string.h>
#include "wx/filename.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
// ============================================================================
// implementation
int wxFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxWindow* parentWindow = GetParent();
if (!parentWindow)
#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
//
int wxDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxASSERT_MSG( !IsModal(), wxT("wxDialog::ShowModal() reentered?") );
#include "wx/wxprec.h"
#include "wx/dirdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifndef WX_PRECOMP
#include <stdio.h>
int wxDirDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
// TODO
return wxID_CANCEL;
#include <string.h>
#include "wx/tokenzr.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#define wxMAXPATH 1024
#define wxMAXFILE 1024
int wxFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxString sTheFilter;
wxString sFilterBuffer;
#endif
#include "wx/fontutil.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#define INCL_PM
#include <os2.h>
int wxFontDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
FONTDLG vFontDlg;
char zCurrentFont[FACESIZE];
#include "wx/math.h"
#endif
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include "wx/os2/private.h"
#include <stdlib.h>
int wxMessageDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
HWND hWnd = 0;
ULONG ulStyle = MB_OK;
#include "wx/colordlg.h"
#include "wx/fontdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#if !USE_NATIVE_FONT_DIALOG_FOR_MACOSX
int wxColourDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
RGBColor currentColor ;
#include "wx/colordlg.h"
#include "wx/fontdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
// ============================================================================
// implementation
}
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
#endif // WX_PRECOMP
#include "wx/filename.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include "wx/osx/private.h"
int wxDirDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
NavDialogRef dialog = NULL;
NavDialogCreationOptions options;
#include "wx/filename.h"
#include "wx/osx/private.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifndef __DARWIN__
#include <Navigation.h>
int wxFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
m_paths.Empty();
m_fileNames.Empty();
#include "wx/fontdlg.h"
#include "wx/fontutil.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#if wxOSX_USE_EXPERIMENTAL_FONTDIALOG
int wxFontDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
#if wxOSX_USE_CARBON
#endif
#include "wx/fontutil.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
// ============================================================================
// implementation
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
#endif
#include "wx/thread.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include "wx/osx/uma.h"
int wxMessageDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
int resultbutton = wxID_CANCEL;
#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 );
int wxMacPageSetupDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
m_pageSetupData.GetPrintData().ConvertToNative();
wxOSXPrintData* nativeData = (wxOSXPrintData*)m_pageSetupData.GetPrintData().GetNativeData();
#include "wx/filename.h"
#include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include "wx/osx/private.h"
int wxDirDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxCFEventLoopPauseIdleEvents pause;
#include "wx/osx/private.h"
#include "wx/sysopt.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#include <mach-o/dyld.h>
int wxFileDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxCFEventLoopPauseIdleEvents pause;
#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"
int wxMessageDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
wxCFEventLoopPauseIdleEvents pause;
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/printdlg.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifndef WX_PRECOMP
#include "wx/object.h"
int wxMacPrintDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
m_printDialogData.GetPrintData().ConvertToNative();
int wxMacPageSetupDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
m_pageSetupData.GetPrintData().ConvertToNative();
((wxOSXCocoaPrintData*)m_pageSetupData.GetPrintData().GetNativeData())->TransferFrom( &m_pageSetupData );
#include "wx/dialog.h"
#include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
#ifndef WX_PRECOMP
#include "wx/app.h"
// 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;
#include "wx/thread.h"
#include "wx/osx/private.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
IMPLEMENT_CLASS(wxMessageDialog, wxDialog)
int wxMessageDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
int resultbutton = wxID_CANCEL;
#endif
#include "wx/evtloop.h"
-#include "wx/testing.h"
+#include "wx/modalhook.h"
//-----------------------------------------------------------------------------
// wxDialog
int wxDialog::ShowModal()
{
- WX_TESTING_SHOW_MODAL_HOOK();
+ WX_HOOK_MODAL_DIALOG();
if ( IsModal() )
{