wx/validate.h \
wx/valtext.h \
wx/window.h \
+ wx/windowid.h \
wx/wupdlock.h \
wx/accel.h \
wx/access.h \
monodll_validate.o \
monodll_valtext.o \
monodll_wincmn.o \
+ monodll_windowid.o \
monodll_xpmdecod.o \
monodll_busyinfo.o \
monodll_buttonbar.o \
monodll_validate.o \
monodll_valtext.o \
monodll_wincmn.o \
+ monodll_windowid.o \
monodll_xpmdecod.o \
monodll_busyinfo.o \
monodll_buttonbar.o \
monolib_validate.o \
monolib_valtext.o \
monolib_wincmn.o \
+ monolib_windowid.o \
monolib_xpmdecod.o \
monolib_busyinfo.o \
monolib_buttonbar.o \
monolib_validate.o \
monolib_valtext.o \
monolib_wincmn.o \
+ monolib_windowid.o \
monolib_xpmdecod.o \
monolib_busyinfo.o \
monolib_buttonbar.o \
coredll_validate.o \
coredll_valtext.o \
coredll_wincmn.o \
+ coredll_windowid.o \
coredll_xpmdecod.o \
coredll_busyinfo.o \
coredll_buttonbar.o \
coredll_validate.o \
coredll_valtext.o \
coredll_wincmn.o \
+ coredll_windowid.o \
coredll_xpmdecod.o \
coredll_busyinfo.o \
coredll_buttonbar.o \
corelib_validate.o \
corelib_valtext.o \
corelib_wincmn.o \
+ corelib_windowid.o \
corelib_xpmdecod.o \
corelib_busyinfo.o \
corelib_buttonbar.o \
corelib_validate.o \
corelib_valtext.o \
corelib_wincmn.o \
+ corelib_windowid.o \
corelib_xpmdecod.o \
corelib_busyinfo.o \
corelib_buttonbar.o \
@COND_USE_GUI_1@monodll_wincmn.o: $(srcdir)/src/common/wincmn.cpp $(MONODLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/wincmn.cpp
+@COND_USE_GUI_1@monodll_windowid.o: $(srcdir)/src/common/windowid.cpp $(MONODLL_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/windowid.cpp
+
@COND_USE_GUI_1@monodll_xpmdecod.o: $(srcdir)/src/common/xpmdecod.cpp $(MONODLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/xpmdecod.cpp
@COND_USE_GUI_1@monolib_wincmn.o: $(srcdir)/src/common/wincmn.cpp $(MONOLIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/wincmn.cpp
+@COND_USE_GUI_1@monolib_windowid.o: $(srcdir)/src/common/windowid.cpp $(MONOLIB_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/windowid.cpp
+
@COND_USE_GUI_1@monolib_xpmdecod.o: $(srcdir)/src/common/xpmdecod.cpp $(MONOLIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/xpmdecod.cpp
@COND_USE_GUI_1@coredll_wincmn.o: $(srcdir)/src/common/wincmn.cpp $(COREDLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/wincmn.cpp
+@COND_USE_GUI_1@coredll_windowid.o: $(srcdir)/src/common/windowid.cpp $(COREDLL_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/windowid.cpp
+
@COND_USE_GUI_1@coredll_xpmdecod.o: $(srcdir)/src/common/xpmdecod.cpp $(COREDLL_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/xpmdecod.cpp
@COND_USE_GUI_1@corelib_wincmn.o: $(srcdir)/src/common/wincmn.cpp $(CORELIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/wincmn.cpp
+@COND_USE_GUI_1@corelib_windowid.o: $(srcdir)/src/common/windowid.cpp $(CORELIB_ODEP)
+@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/windowid.cpp
+
@COND_USE_GUI_1@corelib_xpmdecod.o: $(srcdir)/src/common/xpmdecod.cpp $(CORELIB_ODEP)
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/xpmdecod.cpp
src/common/validate.cpp
src/common/valtext.cpp
src/common/wincmn.cpp
+ src/common/windowid.cpp
src/common/xpmdecod.cpp
src/generic/busyinfo.cpp
src/generic/buttonbar.cpp
wx/validate.h
wx/valtext.h
wx/window.h
+ wx/windowid.h
wx/wupdlock.h
wx/accel.h
$(OBJS)\monodll_validate.obj \
$(OBJS)\monodll_valtext.obj \
$(OBJS)\monodll_wincmn.obj \
+ $(OBJS)\monodll_windowid.obj \
$(OBJS)\monodll_xpmdecod.obj \
$(OBJS)\monodll_busyinfo.obj \
$(OBJS)\monodll_buttonbar.obj \
$(OBJS)\monodll_validate.obj \
$(OBJS)\monodll_valtext.obj \
$(OBJS)\monodll_wincmn.obj \
+ $(OBJS)\monodll_windowid.obj \
$(OBJS)\monodll_xpmdecod.obj \
$(OBJS)\monodll_busyinfo.obj \
$(OBJS)\monodll_buttonbar.obj \
$(OBJS)\monolib_validate.obj \
$(OBJS)\monolib_valtext.obj \
$(OBJS)\monolib_wincmn.obj \
+ $(OBJS)\monolib_windowid.obj \
$(OBJS)\monolib_xpmdecod.obj \
$(OBJS)\monolib_busyinfo.obj \
$(OBJS)\monolib_buttonbar.obj \
$(OBJS)\monolib_validate.obj \
$(OBJS)\monolib_valtext.obj \
$(OBJS)\monolib_wincmn.obj \
+ $(OBJS)\monolib_windowid.obj \
$(OBJS)\monolib_xpmdecod.obj \
$(OBJS)\monolib_busyinfo.obj \
$(OBJS)\monolib_buttonbar.obj \
$(OBJS)\coredll_validate.obj \
$(OBJS)\coredll_valtext.obj \
$(OBJS)\coredll_wincmn.obj \
+ $(OBJS)\coredll_windowid.obj \
$(OBJS)\coredll_xpmdecod.obj \
$(OBJS)\coredll_busyinfo.obj \
$(OBJS)\coredll_buttonbar.obj \
$(OBJS)\coredll_validate.obj \
$(OBJS)\coredll_valtext.obj \
$(OBJS)\coredll_wincmn.obj \
+ $(OBJS)\coredll_windowid.obj \
$(OBJS)\coredll_xpmdecod.obj \
$(OBJS)\coredll_busyinfo.obj \
$(OBJS)\coredll_buttonbar.obj \
$(OBJS)\corelib_validate.obj \
$(OBJS)\corelib_valtext.obj \
$(OBJS)\corelib_wincmn.obj \
+ $(OBJS)\corelib_windowid.obj \
$(OBJS)\corelib_xpmdecod.obj \
$(OBJS)\corelib_busyinfo.obj \
$(OBJS)\corelib_buttonbar.obj \
$(OBJS)\corelib_validate.obj \
$(OBJS)\corelib_valtext.obj \
$(OBJS)\corelib_wincmn.obj \
+ $(OBJS)\corelib_windowid.obj \
$(OBJS)\corelib_xpmdecod.obj \
$(OBJS)\corelib_busyinfo.obj \
$(OBJS)\corelib_buttonbar.obj \
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\monodll_windowid.obj: ..\..\src\common\windowid.cpp
+ $(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\monodll_xpmdecod.obj: ..\..\src\common\xpmdecod.cpp
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\monolib_windowid.obj: ..\..\src\common\windowid.cpp
+ $(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\monolib_xpmdecod.obj: ..\..\src\common\xpmdecod.cpp
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\coredll_windowid.obj: ..\..\src\common\windowid.cpp
+ $(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\coredll_xpmdecod.obj: ..\..\src\common\xpmdecod.cpp
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) $**
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\corelib_windowid.obj: ..\..\src\common\windowid.cpp
+ $(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\corelib_xpmdecod.obj: ..\..\src\common\xpmdecod.cpp
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) $**
$(OBJS)\monodll_validate.o \
$(OBJS)\monodll_valtext.o \
$(OBJS)\monodll_wincmn.o \
+ $(OBJS)\monodll_windowid.o \
$(OBJS)\monodll_xpmdecod.o \
$(OBJS)\monodll_busyinfo.o \
$(OBJS)\monodll_buttonbar.o \
$(OBJS)\monodll_validate.o \
$(OBJS)\monodll_valtext.o \
$(OBJS)\monodll_wincmn.o \
+ $(OBJS)\monodll_windowid.o \
$(OBJS)\monodll_xpmdecod.o \
$(OBJS)\monodll_busyinfo.o \
$(OBJS)\monodll_buttonbar.o \
$(OBJS)\monolib_validate.o \
$(OBJS)\monolib_valtext.o \
$(OBJS)\monolib_wincmn.o \
+ $(OBJS)\monolib_windowid.o \
$(OBJS)\monolib_xpmdecod.o \
$(OBJS)\monolib_busyinfo.o \
$(OBJS)\monolib_buttonbar.o \
$(OBJS)\monolib_validate.o \
$(OBJS)\monolib_valtext.o \
$(OBJS)\monolib_wincmn.o \
+ $(OBJS)\monolib_windowid.o \
$(OBJS)\monolib_xpmdecod.o \
$(OBJS)\monolib_busyinfo.o \
$(OBJS)\monolib_buttonbar.o \
$(OBJS)\coredll_validate.o \
$(OBJS)\coredll_valtext.o \
$(OBJS)\coredll_wincmn.o \
+ $(OBJS)\coredll_windowid.o \
$(OBJS)\coredll_xpmdecod.o \
$(OBJS)\coredll_busyinfo.o \
$(OBJS)\coredll_buttonbar.o \
$(OBJS)\coredll_validate.o \
$(OBJS)\coredll_valtext.o \
$(OBJS)\coredll_wincmn.o \
+ $(OBJS)\coredll_windowid.o \
$(OBJS)\coredll_xpmdecod.o \
$(OBJS)\coredll_busyinfo.o \
$(OBJS)\coredll_buttonbar.o \
$(OBJS)\corelib_validate.o \
$(OBJS)\corelib_valtext.o \
$(OBJS)\corelib_wincmn.o \
+ $(OBJS)\corelib_windowid.o \
$(OBJS)\corelib_xpmdecod.o \
$(OBJS)\corelib_busyinfo.o \
$(OBJS)\corelib_buttonbar.o \
$(OBJS)\corelib_validate.o \
$(OBJS)\corelib_valtext.o \
$(OBJS)\corelib_wincmn.o \
+ $(OBJS)\corelib_windowid.o \
$(OBJS)\corelib_xpmdecod.o \
$(OBJS)\corelib_busyinfo.o \
$(OBJS)\corelib_buttonbar.o \
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
endif
+ifeq ($(USE_GUI),1)
+$(OBJS)\monodll_windowid.o: ../../src/common/windowid.cpp
+ $(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
ifeq ($(USE_GUI),1)
$(OBJS)\monodll_xpmdecod.o: ../../src/common/xpmdecod.cpp
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
endif
+ifeq ($(USE_GUI),1)
+$(OBJS)\monolib_windowid.o: ../../src/common/windowid.cpp
+ $(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
ifeq ($(USE_GUI),1)
$(OBJS)\monolib_xpmdecod.o: ../../src/common/xpmdecod.cpp
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
endif
+ifeq ($(USE_GUI),1)
+$(OBJS)\coredll_windowid.o: ../../src/common/windowid.cpp
+ $(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
+endif
+
ifeq ($(USE_GUI),1)
$(OBJS)\coredll_xpmdecod.o: ../../src/common/xpmdecod.cpp
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
endif
+ifeq ($(USE_GUI),1)
+$(OBJS)\corelib_windowid.o: ../../src/common/windowid.cpp
+ $(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
+endif
+
ifeq ($(USE_GUI),1)
$(OBJS)\corelib_xpmdecod.o: ../../src/common/xpmdecod.cpp
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
$(OBJS)\monodll_validate.obj \
$(OBJS)\monodll_valtext.obj \
$(OBJS)\monodll_wincmn.obj \
+ $(OBJS)\monodll_windowid.obj \
$(OBJS)\monodll_xpmdecod.obj \
$(OBJS)\monodll_busyinfo.obj \
$(OBJS)\monodll_buttonbar.obj \
$(OBJS)\monodll_validate.obj \
$(OBJS)\monodll_valtext.obj \
$(OBJS)\monodll_wincmn.obj \
+ $(OBJS)\monodll_windowid.obj \
$(OBJS)\monodll_xpmdecod.obj \
$(OBJS)\monodll_busyinfo.obj \
$(OBJS)\monodll_buttonbar.obj \
$(OBJS)\monolib_validate.obj \
$(OBJS)\monolib_valtext.obj \
$(OBJS)\monolib_wincmn.obj \
+ $(OBJS)\monolib_windowid.obj \
$(OBJS)\monolib_xpmdecod.obj \
$(OBJS)\monolib_busyinfo.obj \
$(OBJS)\monolib_buttonbar.obj \
$(OBJS)\monolib_validate.obj \
$(OBJS)\monolib_valtext.obj \
$(OBJS)\monolib_wincmn.obj \
+ $(OBJS)\monolib_windowid.obj \
$(OBJS)\monolib_xpmdecod.obj \
$(OBJS)\monolib_busyinfo.obj \
$(OBJS)\monolib_buttonbar.obj \
$(OBJS)\coredll_validate.obj \
$(OBJS)\coredll_valtext.obj \
$(OBJS)\coredll_wincmn.obj \
+ $(OBJS)\coredll_windowid.obj \
$(OBJS)\coredll_xpmdecod.obj \
$(OBJS)\coredll_busyinfo.obj \
$(OBJS)\coredll_buttonbar.obj \
$(OBJS)\coredll_validate.obj \
$(OBJS)\coredll_valtext.obj \
$(OBJS)\coredll_wincmn.obj \
+ $(OBJS)\coredll_windowid.obj \
$(OBJS)\coredll_xpmdecod.obj \
$(OBJS)\coredll_busyinfo.obj \
$(OBJS)\coredll_buttonbar.obj \
$(OBJS)\corelib_validate.obj \
$(OBJS)\corelib_valtext.obj \
$(OBJS)\corelib_wincmn.obj \
+ $(OBJS)\corelib_windowid.obj \
$(OBJS)\corelib_xpmdecod.obj \
$(OBJS)\corelib_busyinfo.obj \
$(OBJS)\corelib_buttonbar.obj \
$(OBJS)\corelib_validate.obj \
$(OBJS)\corelib_valtext.obj \
$(OBJS)\corelib_wincmn.obj \
+ $(OBJS)\corelib_windowid.obj \
$(OBJS)\corelib_xpmdecod.obj \
$(OBJS)\corelib_busyinfo.obj \
$(OBJS)\corelib_buttonbar.obj \
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\monodll_windowid.obj: ..\..\src\common\windowid.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\monodll_xpmdecod.obj: ..\..\src\common\xpmdecod.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\monolib_windowid.obj: ..\..\src\common\windowid.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\monolib_xpmdecod.obj: ..\..\src\common\xpmdecod.cpp
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\coredll_windowid.obj: ..\..\src\common\windowid.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\coredll_xpmdecod.obj: ..\..\src\common\xpmdecod.cpp
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) $**
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) $**
!endif
+!if "$(USE_GUI)" == "1"
+$(OBJS)\corelib_windowid.obj: ..\..\src\common\windowid.cpp
+ $(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) $**
+!endif
+
!if "$(USE_GUI)" == "1"
$(OBJS)\corelib_xpmdecod.obj: ..\..\src\common\xpmdecod.cpp
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) $**
$(OBJS)\monodll_validate.obj &
$(OBJS)\monodll_valtext.obj &
$(OBJS)\monodll_wincmn.obj &
+ $(OBJS)\monodll_windowid.obj &
$(OBJS)\monodll_xpmdecod.obj &
$(OBJS)\monodll_busyinfo.obj &
$(OBJS)\monodll_buttonbar.obj &
$(OBJS)\monodll_validate.obj &
$(OBJS)\monodll_valtext.obj &
$(OBJS)\monodll_wincmn.obj &
+ $(OBJS)\monodll_windowid.obj &
$(OBJS)\monodll_xpmdecod.obj &
$(OBJS)\monodll_busyinfo.obj &
$(OBJS)\monodll_buttonbar.obj &
$(OBJS)\monolib_validate.obj &
$(OBJS)\monolib_valtext.obj &
$(OBJS)\monolib_wincmn.obj &
+ $(OBJS)\monolib_windowid.obj &
$(OBJS)\monolib_xpmdecod.obj &
$(OBJS)\monolib_busyinfo.obj &
$(OBJS)\monolib_buttonbar.obj &
$(OBJS)\monolib_validate.obj &
$(OBJS)\monolib_valtext.obj &
$(OBJS)\monolib_wincmn.obj &
+ $(OBJS)\monolib_windowid.obj &
$(OBJS)\monolib_xpmdecod.obj &
$(OBJS)\monolib_busyinfo.obj &
$(OBJS)\monolib_buttonbar.obj &
$(OBJS)\coredll_validate.obj &
$(OBJS)\coredll_valtext.obj &
$(OBJS)\coredll_wincmn.obj &
+ $(OBJS)\coredll_windowid.obj &
$(OBJS)\coredll_xpmdecod.obj &
$(OBJS)\coredll_busyinfo.obj &
$(OBJS)\coredll_buttonbar.obj &
$(OBJS)\coredll_validate.obj &
$(OBJS)\coredll_valtext.obj &
$(OBJS)\coredll_wincmn.obj &
+ $(OBJS)\coredll_windowid.obj &
$(OBJS)\coredll_xpmdecod.obj &
$(OBJS)\coredll_busyinfo.obj &
$(OBJS)\coredll_buttonbar.obj &
$(OBJS)\corelib_validate.obj &
$(OBJS)\corelib_valtext.obj &
$(OBJS)\corelib_wincmn.obj &
+ $(OBJS)\corelib_windowid.obj &
$(OBJS)\corelib_xpmdecod.obj &
$(OBJS)\corelib_busyinfo.obj &
$(OBJS)\corelib_buttonbar.obj &
$(OBJS)\corelib_validate.obj &
$(OBJS)\corelib_valtext.obj &
$(OBJS)\corelib_wincmn.obj &
+ $(OBJS)\corelib_windowid.obj &
$(OBJS)\corelib_xpmdecod.obj &
$(OBJS)\corelib_busyinfo.obj &
$(OBJS)\corelib_buttonbar.obj &
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
!endif
+!ifeq USE_GUI 1
+$(OBJS)\monodll_windowid.obj : .AUTODEPEND ..\..\src\common\windowid.cpp
+ $(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
+!endif
+
!ifeq USE_GUI 1
$(OBJS)\monodll_xpmdecod.obj : .AUTODEPEND ..\..\src\common\xpmdecod.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
!endif
+!ifeq USE_GUI 1
+$(OBJS)\monolib_windowid.obj : .AUTODEPEND ..\..\src\common\windowid.cpp
+ $(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
+!endif
+
!ifeq USE_GUI 1
$(OBJS)\monolib_xpmdecod.obj : .AUTODEPEND ..\..\src\common\xpmdecod.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
!endif
+!ifeq USE_GUI 1
+$(OBJS)\coredll_windowid.obj : .AUTODEPEND ..\..\src\common\windowid.cpp
+ $(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
+!endif
+
!ifeq USE_GUI 1
$(OBJS)\coredll_xpmdecod.obj : .AUTODEPEND ..\..\src\common\xpmdecod.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
!endif
+!ifeq USE_GUI 1
+$(OBJS)\corelib_windowid.obj : .AUTODEPEND ..\..\src\common\windowid.cpp
+ $(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
+!endif
+
!ifeq USE_GUI 1
$(OBJS)\corelib_xpmdecod.obj : .AUTODEPEND ..\..\src\common\xpmdecod.cpp
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
# End Source File\r
# Begin Source File\r
\r
+SOURCE=..\..\src\common\windowid.cpp\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=..\..\src\common\xpmdecod.cpp\r
# End Source File\r
# End Group\r
# End Source File\r
# Begin Source File\r
\r
+SOURCE=..\..\include\wx\windowid.h\r
+# End Source File\r
+# Begin Source File\r
+\r
SOURCE=..\..\include\wx\wizard.h\r
# End Source File\r
# Begin Source File\r
typedef short int WXTYPE;
-/* special care should be taken with this type under Windows where the real */
-/* window id is unsigned, so we must always do the cast before comparing them */
-/* (or else they would be always different!). Using wxGetWindowId() which does */
-/* the cast itself is recommended. Note that this type can't be unsigned */
-/* because wxID_ANY == -1 is a valid (and largely used) value for window id. */
-typedef int wxWindowID;
/* ---------------------------------------------------------------------------- */
/* other feature tests */
These ids delimit the range used by automatically-generated ids
(i.e. those used when wxID_ANY is specified during construction).
*/
+#if defined(__WXMSW__) || wxUSE_AUTOID_MANAGEMENT
+ /*
+ On MSW the range is always restricted no matter if id management
+ is used or not because the native window ids are limited to short
+ range. On other platforms the range is only restricted if id
+ management is used so the reference count buffer won't be so big.
+ */
wxID_AUTO_LOWEST = -32000,
wxID_AUTO_HIGHEST = -2000,
+#else
+ wxID_AUTO_LOWEST = -1000000,
+ wxID_AUTO_HIGHEST = -2000,
+#endif
/* no id matches this one when compared to it */
wxID_NONE = -3,
wxID_HIGHEST = 5999
};
+/* ---------------------------------------------------------------------------- */
+/* wxWindowID type (after wxID_XYZ enum, platform detection, and dlimpexp.h) */
+/* ---------------------------------------------------------------------------- */
+
+/* special care should be taken with this type under Windows where the real */
+/* window id is unsigned, so we must always do the cast before comparing them */
+/* (or else they would be always different!). Using wxGetWindowId() which does */
+/* the cast itself is recommended. Note that this type can't be unsigned */
+/* because wxID_ANY == -1 is a valid (and largely used) value for window id. */
+#ifdef __cplusplus
+ #include "wx/windowid.h"
+#endif
+
/* ---------------------------------------------------------------------------- */
/* other constants */
/* ---------------------------------------------------------------------------- */
// wxValidator class and related methods
#define wxUSE_VALIDATORS 1
+// Use reference counted ID management: this means that wxWidgets will track
+// the automatically allocated ids (those used when you use wxID_ANY when
+// creating a window, menu or toolbar item &c) instead of just supposing that
+// the program never runs out of them. This is mostly useful only under wxMSW
+// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
+// long-running programs can run into problems with ids reuse without this. On
+// the other platforms, where the ids have the full int range, this shouldn't
+// be necessary.
+#define wxUSE_AUTOID_MANAGEMENT defined(__WXMSW__)
+
// ----------------------------------------------------------------------------
// common dialogs
// ----------------------------------------------------------------------------
}
protected:
- int m_id; // numeric id of the item >= 0 or wxID_ANY or wxID_SEPARATOR
+ wxWindowIDRef m_id; // numeric id of the item >= 0 or wxID_ANY or wxID_SEPARATOR
wxMenu *m_parentMenu, // the menu we belong to
*m_subMenu; // our sub menu or NULL
wxString m_text, // label of the item
// wxValidator class and related methods
#define wxUSE_VALIDATORS 1
+// Use reference counted ID management: this means that wxWidgets will track
+// the automatically allocated ids (those used when you use wxID_ANY when
+// creating a window, menu or toolbar item &c) instead of just supposing that
+// the program never runs out of them. This is mostly useful only under wxMSW
+// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
+// long-running programs can run into problems with ids reuse without this. On
+// the other platforms, where the ids have the full int range, this shouldn't
+// be necessary.
+#define wxUSE_AUTOID_MANAGEMENT defined(__WXMSW__)
+
// ----------------------------------------------------------------------------
// common dialogs
// ----------------------------------------------------------------------------
// the buttons we contain
wxSubwindows *m_radioButtons;
+ wxWindowIDRef *m_radioButtonIds;
// array of widths and heights of the buttons, may be wxDefaultCoord if the
// corresponding quantity should be computed
// wxValidator class and related methods
#define wxUSE_VALIDATORS 1
+// Use reference counted ID management: this means that wxWidgets will track
+// the automatically allocated ids (those used when you use wxID_ANY when
+// creating a window, menu or toolbar item &c) instead of just supposing that
+// the program never runs out of them. This is mostly useful only under wxMSW
+// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
+// long-running programs can run into problems with ids reuse without this. On
+// the other platforms, where the ids have the full int range, this shouldn't
+// be necessary.
+#define wxUSE_AUTOID_MANAGEMENT defined(__WXMSW__)
+
// ----------------------------------------------------------------------------
// common dialogs
// ----------------------------------------------------------------------------
virtual wxSize DoGetBestSize() const;
// the labels windows, if any
- wxSubwindows *m_labels;
+ wxSubwindows *m_labels;
+ wxWindowIDRef *m_labelIds;
int m_rangeMin;
int m_rangeMax;
// wxValidator class and related methods
#define wxUSE_VALIDATORS 1
+// Use reference counted ID management: this means that wxWidgets will track
+// the automatically allocated ids (those used when you use wxID_ANY when
+// creating a window, menu or toolbar item &c) instead of just supposing that
+// the program never runs out of them. This is mostly useful only under wxMSW
+// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
+// long-running programs can run into problems with ids reuse without this. On
+// the other platforms, where the ids have the full int range, this shouldn't
+// be necessary.
+#define wxUSE_AUTOID_MANAGEMENT defined(__WXMSW__)
+
// ----------------------------------------------------------------------------
// common dialogs
// ----------------------------------------------------------------------------
// wxValidator class and related methods
#define wxUSE_VALIDATORS 1
+// Use reference counted ID management: this means that wxWidgets will track
+// the automatically allocated ids (those used when you use wxID_ANY when
+// creating a window, menu or toolbar item &c) instead of just supposing that
+// the program never runs out of them. This is mostly useful only under wxMSW
+// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
+// long-running programs can run into problems with ids reuse without this. On
+// the other platforms, where the ids have the full int range, this shouldn't
+// be necessary.
+#define wxUSE_AUTOID_MANAGEMENT defined(__WXMSW__)
+
// ----------------------------------------------------------------------------
// common dialogs
// ----------------------------------------------------------------------------
// wxValidator class and related methods
#define wxUSE_VALIDATORS 1
+// Use reference counted ID management: this means that wxWidgets will track
+// the automatically allocated ids (those used when you use wxID_ANY when
+// creating a window, menu or toolbar item &c) instead of just supposing that
+// the program never runs out of them. This is mostly useful only under wxMSW
+// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
+// long-running programs can run into problems with ids reuse without this. On
+// the other platforms, where the ids have the full int range, this shouldn't
+// be necessary.
+#define wxUSE_AUTOID_MANAGEMENT defined(__WXMSW__)
+
// ----------------------------------------------------------------------------
// common dialogs
// ----------------------------------------------------------------------------
// wxValidator class and related methods
#define wxUSE_VALIDATORS 1
+// Use reference counted ID management: this means that wxWidgets will track
+// the automatically allocated ids (those used when you use wxID_ANY when
+// creating a window, menu or toolbar item &c) instead of just supposing that
+// the program never runs out of them. This is mostly useful only under wxMSW
+// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
+// long-running programs can run into problems with ids reuse without this. On
+// the other platforms, where the ids have the full int range, this shouldn't
+// be necessary.
+#define wxUSE_AUTOID_MANAGEMENT defined(__WXMSW__)
+
// ----------------------------------------------------------------------------
// common dialogs
// ----------------------------------------------------------------------------
// tool parameters
int m_toolStyle; // see enum wxToolBarToolStyle
- int m_id; // the tool id, wxID_SEPARATOR for separator
+ wxWindowIDRef m_id; // the tool id, wxID_SEPARATOR for separator
wxItemKind m_kind; // for normal buttons may be wxITEM_NORMAL/CHECK/RADIO
// as controls have their own client data, no need to waste memory
void SetId( wxWindowID winid ) { m_windowId = winid; }
wxWindowID GetId() const { return m_windowId; }
- // returns true if this id value belong to the range reserved for the
- // auto-generated (by NewControlId()) ids (they're always negative)
- static bool IsAutoGeneratedId(wxWindowID id);
-
// generate a unique id (or count of them consecutively), returns a
- // valid id in IsAutoGeneratedId() range or wxID_NONE if failed
- static wxWindowID NewControlId(int count = 1);
+ // valid id in the auto-id range or wxID_NONE if failed. If using
+ // autoid management, it will mark the id as reserved until it is
+ // used (by assigning it to a wxWindowIDRef) or unreserved.
+ static wxWindowID NewControlId(int count = 1)
+ {
+ return wxIdManager::ReserveId(count);
+ }
- // mark an id previously returned by NewControlId() as being unused any
- // more so that it can be reused again for another control later
- static void ReleaseControlId(wxWindowID id);
+ // If an ID generated from NewControlId is not assigned to a wxWindowIDRef,
+ // it must be unreserved
+ static void UnreserveControlId(wxWindowID id, int count = 1)
+ {
+ wxIdManager::UnreserveId(id, count);
+ }
// moving/resizing
// the window id - a number which uniquely identifies a window among
// its siblings unless it is wxID_ANY
- wxWindowID m_windowId;
+ wxWindowIDRef m_windowId;
// the parent window of this window (or NULL) and the list of the children
// of this window
// Layout() window automatically when its size changes?
bool m_autoLayout:1;
- // true if we had automatically allocated the id value for this window
- // (i.e. wxID_ANY had been passed to the ctor)
- bool m_freeId:1;
-
// window state
bool m_isShown:1;
bool m_isEnabled:1;
#if WXWIN_COMPATIBILITY_2_6
// deprecated (doesn't start with 'wx' prefix), use wxWindow::NewControlId()
- wxDEPRECATED( int NewControlId() );
- inline int NewControlId() { return wxWindowBase::NewControlId(); }
+ wxDEPRECATED( wxWindowID NewControlId() );
+ inline wxWindowID NewControlId() { return wxWindowBase::NewControlId(); }
#endif // WXWIN_COMPATIBILITY_2_6
#if wxUSE_ACCESSIBILITY
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: wx/windowid.h
+// Purpose: wxWindowID class - a class for managing window ids
+// Author: Brian Vanderburg II
+// Created: 2007-09-21
+// RCS-ID: $Id$
+// Copyright: (c) 2007 Brian Vanderburg II
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_WINDOWID_H_
+#define _WX_WINDOWID_H_
+
+// NB: do not include defs.h as we are included from it
+
+typedef int wxWindowID;
+
+// ----------------------------------------------------------------------------
+// wxWindowIDRef: reference counted id value
+// ----------------------------------------------------------------------------
+
+// A wxWindowIDRef object wraps an id value and marks it as (un)used as
+// necessary. All ids returned from wxWindow::NewControlId() should be assigned
+// to an instance of this class to ensure that the id is marked as being in
+// use.
+//
+// This class is always defined but it is trivial if wxUSE_AUTOID_MANAGEMENT is
+// off.
+class WXDLLIMPEXP_CORE wxWindowIDRef
+{
+public:
+ // default ctor
+ wxWindowIDRef()
+ {
+ m_id = wxID_NONE;
+ }
+
+ // ctor taking id values
+ wxWindowIDRef(int id)
+ {
+ Init(id);
+ }
+
+ wxWindowIDRef(long id)
+ {
+ Init(id);
+ }
+
+ wxWindowIDRef(const wxWindowIDRef& id)
+ {
+ Init(id.m_id);
+ }
+
+ // dtor
+ ~wxWindowIDRef()
+ {
+ Assign(wxID_NONE);
+ }
+
+ // assignment
+ wxWindowIDRef& operator=(int id)
+ {
+ Assign(id);
+ return *this;
+ }
+
+ wxWindowIDRef& operator=(long id)
+ {
+ Assign(id);
+ return *this;
+ }
+
+ wxWindowIDRef& operator=(const wxWindowIDRef& id)
+ {
+ Assign(id.m_id);
+ return *this;
+ }
+
+ // access to the stored id value
+ wxWindowID GetValue() const
+ {
+ return m_id;
+ }
+
+ operator wxWindowID() const
+ {
+ return m_id;
+ }
+
+private:
+#if wxUSE_AUTOID_MANAGEMENT
+ // common part of all ctors: call Assign() for our new id
+ void Init(wxWindowID id)
+ {
+ // m_id must be initialized before calling Assign()
+ m_id = wxID_NONE;
+ Assign(id);
+ }
+
+ // increase reference count of id, decrease the one of m_id
+ void Assign(wxWindowID id);
+#else // !wxUSE_AUTOID_MANAGEMENT
+ // trivial stubs for the functions above
+ void Init(wxWindowID id)
+ {
+ m_id = id;
+ }
+
+ void Assign(wxWindowID id)
+ {
+ m_id = id;
+ }
+#endif // wxUSE_AUTOID_MANAGEMENT/!wxUSE_AUTOID_MANAGEMENT
+
+
+ wxWindowID m_id;
+};
+
+// comparison operators
+inline bool operator==(const wxWindowIDRef& lhs, const wxWindowIDRef& rhs)
+{
+ return lhs.GetValue() == rhs.GetValue();
+}
+
+inline bool operator==(const wxWindowIDRef& lhs, int rhs)
+{
+ return lhs.GetValue() == rhs;
+}
+
+inline bool operator==(const wxWindowIDRef& lhs, long rhs)
+{
+ return lhs.GetValue() == rhs;
+}
+
+inline bool operator==(int lhs, const wxWindowIDRef& rhs)
+{
+ return rhs == lhs;
+}
+
+inline bool operator==(long lhs, const wxWindowIDRef& rhs)
+{
+ return rhs == lhs;
+}
+
+inline bool operator!=(const wxWindowIDRef& lhs, const wxWindowIDRef& rhs)
+{
+ return !(lhs == rhs);
+}
+
+inline bool operator!=(const wxWindowIDRef& lhs, int rhs)
+{
+ return !(lhs == rhs);
+}
+
+inline bool operator!=(const wxWindowIDRef& lhs, long rhs)
+{
+ return !(lhs == rhs);
+}
+
+inline bool operator!=(int lhs, const wxWindowIDRef& rhs)
+{
+ return !(lhs == rhs);
+}
+
+inline bool operator!=(long lhs, const wxWindowIDRef& rhs)
+{
+ return !(lhs == rhs);
+}
+
+// ----------------------------------------------------------------------------
+// wxIdManager
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxIdManager
+{
+public:
+ // This returns an id value and not an wxWindowIDRef. The returned value
+ // should be assigned a.s.a.p to a wxWindowIDRef. The IDs are marked as
+ // reserved so that another call to ReserveId before assigning the id to a
+ // wxWindowIDRef will not use the same ID
+ static wxWindowID ReserveId(int count = 1);
+
+ // This will release an unused reserved ID. This should only be called
+ // if the ID returned by ReserveId was NOT assigned to a wxWindowIDRef
+ // for some purpose, maybe an early return from a function
+ static void UnreserveId(wxWindowID id, int count = 1);
+};
+
+#endif // _WX_WINDOWID_H_
#define wxUSE_VALIDATORS 0
+#define wxUSE_AUTOID_MANAGEMENT defined(__WXMSW__)
+
#define wxUSE_COMMON_DIALOGS 0
m_windowSizer = (wxSizer *) NULL;
m_containingSizer = (wxSizer *) NULL;
m_autoLayout = false;
- m_freeId = false;
#if wxUSE_DRAG_AND_DROP
m_dropTarget = (wxDropTarget *)NULL;
if ( id == wxID_ANY )
{
m_windowId = NewControlId();
-
- // remember to call ReleaseControlId() when this window is destroyed
- m_freeId = true;
}
else // valid id specified
{
{
wxASSERT_MSG( GetCapture() != this, wxT("attempt to destroy window with mouse capture") );
- // mark the id as unused if we allocated it for this control
- if ( m_freeId )
- ReleaseControlId(m_windowId);
-
// FIXME if these 2 cases result from programming errors in the user code
// we should probably assert here instead of silently fixing them
return x;
}
-// ----------------------------------------------------------------------------
-// Window (and menu items) identifiers management
-// ----------------------------------------------------------------------------
-
-namespace
-{
-
-// this array contains, in packed form, the "in use" flags for the entire
-// auto-generated ids range: N-th element of the array contains the flags for
-// ids in [wxID_AUTO_LOWEST + 8*N, wxID_AUTO_LOWEST + 8*N + 7] range
-//
-// initially no ids are in use and we allocate them consecutively, but after we
-// exhaust the entire range, we wrap around and reuse the ids freed in the
-// meanwhile
-wxByte gs_autoIdsInUse[(wxID_AUTO_HIGHEST - wxID_AUTO_LOWEST + 1)/8 + 1] = { 0 };
-
-// this is an optimization used until we wrap around wxID_AUTO_HIGHEST: if this
-// value is < wxID_AUTO_HIGHEST we know that we haven't wrapped yet and so can
-// allocate the ids simply by incrementing it
-static wxWindowID gs_nextControlId = wxID_AUTO_LOWEST;
-
-void MarkAutoIdUsed(wxWindowID id)
-{
- id -= wxID_AUTO_LOWEST;
-
- const int theByte = id / 8;
- const int theBit = id % 8;
-
- gs_autoIdsInUse[theByte] |= 1 << theBit;
-}
-
-void FreeAutoId(wxWindowID id)
-{
- id -= wxID_AUTO_LOWEST;
-
- const int theByte = id / 8;
- const int theBit = id % 8;
-
- gs_autoIdsInUse[theByte] &= ~(1 << theBit);
-}
-
-bool IsAutoIdInUse(wxWindowID id)
-{
- id -= wxID_AUTO_LOWEST;
-
- const int theByte = id / 8;
- const int theBit = id % 8;
-
- return (gs_autoIdsInUse[theByte] & (1 << theBit)) != 0;
-}
-
-} // anonymous namespace
-
-
-/* static */
-bool wxWindowBase::IsAutoGeneratedId(wxWindowID id)
-{
- if ( id < wxID_AUTO_LOWEST || id > wxID_AUTO_HIGHEST )
- return false;
-
- // we shouldn't have any stray ids in this range
- wxASSERT_MSG( IsAutoIdInUse(id), "unused automatically generated id?" );
-
- return true;
-}
-
-wxWindowID wxWindowBase::NewControlId(int count)
-{
- wxASSERT_MSG( count > 0, "can't allocate less than 1 id" );
-
- if ( gs_nextControlId + count - 1 <= wxID_AUTO_HIGHEST )
- {
- // we haven't wrapped yet, so we can just grab the next count ids
- wxWindowID id = gs_nextControlId;
-
- while ( count-- )
- MarkAutoIdUsed(gs_nextControlId++);
-
- return id;
- }
- else // we've already wrapped or are now going to
- {
- // brute-force search for the id values
-
- // number of consecutive free ids found so far
- int found = 0;
-
- for ( wxWindowID id = wxID_AUTO_LOWEST; id <= wxID_AUTO_HIGHEST; id++ )
- {
- if ( !IsAutoIdInUse(id) )
- {
- // found another consecutive available id
- found++;
- if ( found == count )
- {
- // mark all count consecutive free ids we found as being in
- // use now and rewind back to the start of available range
- // in the process
- while ( count-- )
- MarkAutoIdUsed(id--);
-
- return id;
- }
- }
- else // this id is in use
- {
- // reset the number of consecutive free values found
- found = 0;
- }
- }
- }
-
- // if we get here, there are not enough consecutive free ids
- return wxID_NONE;
-}
-
-void wxWindowBase::ReleaseControlId(wxWindowID id)
-{
- wxCHECK_RET( IsAutoGeneratedId(id), "can't release non auto-generated id" );
- FreeAutoId(id);
-}
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: src/common/windowid.cpp
+// Purpose: wxWindowID class - a class for managing window ids
+// Author: Brian Vanderburg II
+// Created: 2007-09-21
+// RCS-ID: $Id$
+// Copyright: (c) 2007 Brian Vanderburg II
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+// ----------------------------------------------------------------------------
+// Needed headers
+// ----------------------------------------------------------------------------
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+ #include "wx/log.h"
+ #include "wx/intl.h"
+#endif //WX_PRECOMP
+
+// Not needed, included in defs.h
+// #include "wx/windowid.h"
+
+#define wxTRACE_WINDOWID _T("windowid")
+
+namespace
+{
+
+#if wxUSE_AUTOID_MANAGEMENT
+
+
+// initially no ids are in use and we allocate them consecutively, but after we
+// exhaust the entire range, we wrap around and reuse the ids freed in the
+// meanwhile
+static const wxUint8 ID_FREE = 0;
+static const wxUint8 ID_STARTCOUNT = 1;
+static const wxUint8 ID_MAXCOUNT = 254;
+static const wxUint8 ID_RESERVED = 255;
+
+wxUint8 gs_autoIdsRefCount[wxID_AUTO_HIGHEST - wxID_AUTO_LOWEST + 1] = { 0 };
+
+// this is an optimization used until we wrap around wxID_AUTO_HIGHEST: if this
+// value is < wxID_AUTO_HIGHEST we know that we haven't wrapped yet and so can
+// allocate the ids simply by incrementing it
+wxWindowID gs_nextAutoId = wxID_AUTO_LOWEST;
+
+// Reserve an ID
+void ReserveIdRefCount(wxWindowID id)
+{
+ wxCHECK_RET(id >= wxID_AUTO_LOWEST && id <= wxID_AUTO_HIGHEST,
+ wxT("invalid id range"));
+
+ id -= wxID_AUTO_LOWEST;
+
+ wxCHECK_RET(gs_autoIdsRefCount[id] == ID_FREE,
+ wxT("id already in use or already reserved"));
+ gs_autoIdsRefCount[id] = ID_RESERVED;
+}
+
+// Unreserve and id
+void UnreserveIdRefCount(wxWindowID id)
+{
+ wxCHECK_RET(id >= wxID_AUTO_LOWEST && id <= wxID_AUTO_HIGHEST,
+ wxT("invalid id range"));
+
+ id -= wxID_AUTO_LOWEST;
+
+ wxCHECK_RET(gs_autoIdsRefCount[id] == ID_RESERVED,
+ wxT("id already in use or not reserved"));
+ gs_autoIdsRefCount[id] = ID_FREE;
+}
+
+// Get the usage count of an id
+int GetIdRefCount(wxWindowID id)
+{
+ wxCHECK_MSG(id >= wxID_AUTO_LOWEST && id <= wxID_AUTO_HIGHEST, 0,
+ wxT("invalid id range"));
+
+ id -= wxID_AUTO_LOWEST;
+ return gs_autoIdsRefCount[id];
+}
+
+// Increase the count for an id
+void IncIdRefCount(wxWindowID id)
+{
+ wxCHECK_RET(id >= wxID_AUTO_LOWEST && id <= wxID_AUTO_HIGHEST,
+ wxT("invalid id range"));
+
+ id -= wxID_AUTO_LOWEST;
+
+ wxCHECK_RET(gs_autoIdsRefCount[id] != ID_MAXCOUNT, wxT("id count at max"));
+ wxCHECK_RET(gs_autoIdsRefCount[id] != ID_FREE, wxT("id should first be reserved"));
+
+ if(gs_autoIdsRefCount[id] == ID_RESERVED)
+ gs_autoIdsRefCount[id] = ID_STARTCOUNT;
+ else
+ gs_autoIdsRefCount[id]++;
+
+ wxLogTrace(wxTRACE_WINDOWID, wxT("Increasing ref count of ID %d to %d"),
+ id + wxID_AUTO_LOWEST, gs_autoIdsRefCount[id]);
+}
+
+// Decrease the count for an id
+void DecIdRefCount(wxWindowID id)
+{
+ wxCHECK_RET(id >= wxID_AUTO_LOWEST && id <= wxID_AUTO_HIGHEST,
+ wxT("invalid id range"));
+
+ id -= wxID_AUTO_LOWEST;
+
+ wxCHECK_RET(gs_autoIdsRefCount[id] != ID_FREE, wxT("id count already 0"));
+
+ // DecIdRefCount is only called on an ID that has been IncIdRefCount'ed'
+ // so it should never be reserved, but test anyway
+ if(gs_autoIdsRefCount[id] == ID_RESERVED)
+ {
+ wxASSERT_MSG(false, wxT("reserve id being decreased"));
+ gs_autoIdsRefCount[id] = ID_FREE;
+ }
+ else
+ gs_autoIdsRefCount[id]--;
+
+ wxLogTrace(wxTRACE_WINDOWID, wxT("Decreasing ref count of ID %d to %d"),
+ id + wxID_AUTO_LOWEST, gs_autoIdsRefCount[id]);
+}
+
+#else // wxUSE_AUTOID_MANAGEMENT
+
+static wxWindowID gs_nextAutoId = wxID_AUTO_HIGHEST;
+
+#endif
+
+} // anonymous namespace
+
+
+#if wxUSE_AUTOID_MANAGEMENT
+
+void wxWindowIDRef::Assign(wxWindowID id)
+{
+ if ( id != m_id )
+ {
+ // decrease count if it is in the managed range
+ if ( m_id >= wxID_AUTO_LOWEST && m_id <= wxID_AUTO_HIGHEST )
+ DecIdRefCount(m_id);
+
+ m_id = id;
+
+ // increase count if it is in the managed range
+ if ( m_id >= wxID_AUTO_LOWEST && m_id <= wxID_AUTO_HIGHEST )
+ IncIdRefCount(m_id);
+ }
+}
+
+#endif // wxUSE_AUTOID_MANAGEMENT
+
+
+
+wxWindowID wxIdManager::ReserveId(int count)
+{
+ wxASSERT_MSG(count > 0, wxT("can't allocate less than 1 id"));
+
+
+#if wxUSE_AUTOID_MANAGEMENT
+ if ( gs_nextAutoId + count - 1 <= wxID_AUTO_HIGHEST )
+ {
+ wxWindowID id = gs_nextAutoId;
+
+ while(count--)
+ {
+ ReserveIdRefCount(gs_nextAutoId++);
+ }
+
+ return id;
+ }
+ else
+ {
+ int found = 0;
+
+ for(wxWindowID id = wxID_AUTO_LOWEST; id <= wxID_AUTO_HIGHEST; id++)
+ {
+ if(GetIdRefCount(id) == 0)
+ {
+ found++;
+ if(found == count)
+ {
+ // Imagine this: 100 free IDs left. Then NewId(50) takes 50
+ // so 50 left. Then, the 25 before that last 50 are freed, but
+ // gs_nextAutoId does not decrement and stays where it is at
+ // with 50 free. Then NewId(75) gets called, and since there
+ // are only 50 left according to gs_nextAutoId, it does a
+ // search and finds the 75 at the end. Then NewId(10) gets
+ // called, and accorind to gs_nextAutoId, their are still
+ // 50 at the end so it returns them without testing the ref
+ // To fix this, the next ID is also updated here as needed
+ if(id >= gs_nextAutoId)
+ gs_nextAutoId = id + 1;
+
+ while(count--)
+ ReserveIdRefCount(id--);
+
+ return id;
+ }
+ }
+ else
+ {
+ found = 0;
+ }
+ }
+ }
+
+ ::wxLogError(_("Out of window IDs. Recommend shutting down application."));
+ return wxID_NONE;
+#else // !wxUSE_AUTOID_MANAGEMENT
+ // Make sure enough in the range
+ wxWindowID id;
+
+ id = gs_nextAutoId - count + 1;
+
+ if ( id >= wxID_AUTO_LOWEST && id <= wxID_AUTO_HIGHEST )
+ {
+ // There is enough, but it may be time to wrap
+ if(id == wxID_AUTO_LOWEST)
+ gs_nextAutoId = wxID_AUTO_HIGHEST;
+ else
+ gs_nextAutoId = id - 1;
+
+ return id;
+ }
+ else
+ {
+ // There is not enough at the low end of the range or
+ // count was big enough to wrap around to the positive
+ // Surely 'count' is not so big to take up much of the range
+ gs_nextAutoId = wxID_AUTO_HIGHEST - count;
+ return gs_nextAutoId + 1;
+ }
+#endif // wxUSE_AUTOID_MANAGEMENT/!wxUSE_AUTOID_MANAGEMENT
+}
+
+void wxIdManager::UnreserveId(wxWindowID id, int count)
+{
+ wxASSERT_MSG(count > 0, wxT("can't unreserve less than 1 id"));
+
+#if wxUSE_AUTOID_MANAGEMENT
+ while (count--)
+ UnreserveIdRefCount(id++);
+#else
+ wxUnusedVar(id);
+ wxUnusedVar(count);
+#endif
+}
+
// NB: generate the IDs at runtime to avoid conflict with XRCID values,
// they could cause XRCCTRL() failures in XRC-based dialogs
-const int wxID_ELB_DELETE = wxWindow::NewControlId();
-const int wxID_ELB_EDIT = wxWindow::NewControlId();
-const int wxID_ELB_NEW = wxWindow::NewControlId();
-const int wxID_ELB_UP = wxWindow::NewControlId();
-const int wxID_ELB_DOWN = wxWindow::NewControlId();
-const int wxID_ELB_LISTCTRL = wxWindow::NewControlId();
+const wxWindowIDRef wxID_ELB_DELETE = wxWindow::NewControlId();
+const wxWindowIDRef wxID_ELB_EDIT = wxWindow::NewControlId();
+const wxWindowIDRef wxID_ELB_NEW = wxWindow::NewControlId();
+const wxWindowIDRef wxID_ELB_UP = wxWindow::NewControlId();
+const wxWindowIDRef wxID_ELB_DOWN = wxWindow::NewControlId();
+const wxWindowIDRef wxID_ELB_LISTCTRL = wxWindow::NewControlId();
BEGIN_EVENT_TABLE(wxEditableListBox, wxPanel)
EVT_LIST_ITEM_SELECTED(wxID_ELB_LISTCTRL, wxEditableListBox::OnItemSelected)
msStyle,
0, 0, 0, 0,
GetWinHwnd(parent),
- (HMENU)m_windowId,
+ (HMENU)m_windowId.GetValue(),
wxGetInstance(),
NULL
);
if ( id != wxID_ANY )
m_windowId = id;
else
- m_windowId = (int)NewControlId();
+ m_windowId = NewControlId();
if ( parent )
{
{
m_selectedButton = wxNOT_FOUND;
m_radioButtons = NULL;
+ m_radioButtonIds = NULL;
m_radioWidth = NULL;
m_radioHeight = NULL;
}
#endif // wxUSE_VALIDATORS/!wxUSE_VALIDATORS
m_radioButtons = new wxSubwindows(n);
+ m_radioButtonIds = new wxWindowIDRef[n + 1];
m_radioWidth = new int[n];
m_radioHeight = new int[n];
if ( i == 0 )
styleBtn |= WS_GROUP;
- long newId = NewControlId();
+ m_radioButtonIds[i] = NewControlId();
HWND hwndBtn = ::CreateWindow(_T("BUTTON"),
choices[i].wx_str(),
styleBtn,
0, 0, 0, 0, // will be set in SetSize()
GetHwndOf(parent),
- (HMENU)newId,
+ (HMENU)(wxWindowID)m_radioButtonIds[i],
wxGetInstance(),
NULL);
SubclassRadioButton((WXHWND)hwndBtn);
- m_subControls.Add(newId);
+ m_subControls.Add(m_radioButtonIds[i]);
}
// Create a dummy radio control to end the group.
+ m_radioButtonIds[n] = NewControlId();
+
(void)::CreateWindow(_T("BUTTON"),
wxEmptyString,
WS_GROUP | BS_AUTORADIOBUTTON | WS_CHILD,
0, 0, 0, 0, GetHwndOf(parent),
- (HMENU)NewControlId(), wxGetInstance(), NULL);
+ (HMENU)(wxWindowID)m_radioButtonIds[n], wxGetInstance(), NULL);
m_radioButtons->SetFont(GetFont());
m_isBeingDeleted = true;
delete m_radioButtons;
+ delete[] m_radioButtonIds;
delete[] m_radioWidth;
delete[] m_radioHeight;
}
void wxSlider::Init()
{
m_labels = NULL;
+ m_labelIds = NULL;
m_pageSize = 1;
m_lineSize = 1;
if ( m_windowStyle & wxSL_LABELS )
{
m_labels = new wxSubwindows(SliderLabel_Last);
+ m_labelIds = new wxWindowIDRef[SliderLabel_Last];
HWND hwndParent = GetHwndOf(parent);
for ( size_t n = 0; n < SliderLabel_Last; n++ )
{
+ m_labelIds[n] = NewControlId();
+
(*m_labels)[n] = ::CreateWindow
(
wxT("STATIC"),
WS_CHILD | WS_VISIBLE | SS_CENTER,
0, 0, 0, 0,
hwndParent,
- (HMENU)NewControlId(),
+ (HMENU)(wxWindowID)m_labelIds[n],
wxGetInstance(),
NULL
);
wxSlider::~wxSlider()
{
delete m_labels;
+ delete[] m_labelIds;
}
// ----------------------------------------------------------------------------
wstyle,
0, 0, 0, 0,
GetHwndOf(parent),
- (HMENU)m_windowId,
+ (HMENU)m_windowId.GetValue(),
wxGetInstance(),
NULL
);
struct XRCID_record
{
- int id;
+ /* Hold the id so that once an id is allocated for a name, it
+ does not get created again by NewControlId at least
+ until we are done with it */
+ wxWindowIDRef id;
char *key;
XRCID_record *next;
};
{
CleanXRCID_Record(rec->next);
- // if we had generated the value of this id automatically, release it
- // now that we don't need it any longer
- if ( wxWindow::IsAutoGeneratedId(rec->id) )
- wxWindow::ReleaseControlId(rec->id);
-
free(rec->key);
delete rec;
}
wx/zipstrm.h
wx/zstream.h
wx/private/fdiodispatcher.h
-wx/private/gsocketiohandler.h
wx/private/selectdispatcher.h
wx/unix/app.h
wx/unix/apptbase.h
wx/unix/apptrait.h
wx/unix/chkconf.h
-wx/unix/execute.h
wx/unix/evtloop.h
-wx/unix/mimetype.h
wx/unix/pipe.h
+wx/unix/stdpaths.h
+wx/unix/execute.h
+wx/unix/mimetype.h
wx/unix/private.h
+wx/private/gsocketiohandler.h
wx/unix/stackwalk.h
-wx/unix/stdpaths.h
wx/fs_inet.h
wx/gsocket.h
wx/protocol/file.h
wx/zipstrm.h
wx/zstream.h
wx/private/fdiodispatcher.h
-wx/private/gsocketiohandler.h
wx/private/selectdispatcher.h
wx/unix/app.h
wx/unix/apptbase.h
wx/unix/apptrait.h
wx/unix/chkconf.h
-wx/unix/execute.h
wx/unix/evtloop.h
-wx/unix/mimetype.h
wx/unix/pipe.h
+wx/unix/stdpaths.h
+wx/unix/execute.h
+wx/unix/mimetype.h
wx/unix/private.h
+wx/private/gsocketiohandler.h
wx/unix/stackwalk.h
-wx/unix/stdpaths.h
wx/fs_inet.h
wx/gsocket.h
wx/protocol/file.h
wx/zipstrm.h
wx/zstream.h
wx/private/fdiodispatcher.h
-wx/private/gsocketiohandler.h
wx/private/selectdispatcher.h
wx/unix/app.h
wx/unix/apptbase.h
wx/unix/apptrait.h
wx/unix/chkconf.h
-wx/unix/execute.h
wx/unix/evtloop.h
-wx/unix/mimetype.h
wx/unix/pipe.h
+wx/unix/stdpaths.h
+wx/unix/execute.h
+wx/unix/mimetype.h
wx/unix/private.h
+wx/private/gsocketiohandler.h
wx/unix/stackwalk.h
-wx/unix/stdpaths.h
wx/fs_inet.h
wx/gsocket.h
wx/protocol/file.h