added wxTextEntry common base class for both wxTextCtrl and wxComboBox; refactor wxGTK code to put common parts of these classes in the base class; fixed some inconsistencies in the text control behaviour between platforms
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
c0d9b217a7
commit
0ec1179b86
38
Makefile.in
38
Makefile.in
@ -2381,6 +2381,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_GUI_HDR = \
|
||||
wx/gtk/stattext.h \
|
||||
wx/gtk/tbargtk.h \
|
||||
wx/gtk/textctrl.h \
|
||||
wx/gtk/textentry.h \
|
||||
wx/gtk/tglbtn.h \
|
||||
wx/gtk/treectrl.h \
|
||||
wx/gtk/treeentry_gtk.h
|
||||
@ -3212,6 +3213,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \
|
||||
wx/statusbr.h \
|
||||
wx/textctrl.h \
|
||||
wx/textdlg.h \
|
||||
wx/textentry.h \
|
||||
wx/toolbar.h \
|
||||
wx/validate.h \
|
||||
wx/valtext.h \
|
||||
@ -3878,6 +3880,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS = \
|
||||
monodll_stockitem.o \
|
||||
monodll_tbarbase.o \
|
||||
monodll_textcmn.o \
|
||||
monodll_textentrycmn.o \
|
||||
monodll_toplvcmn.o \
|
||||
monodll_treebase.o \
|
||||
monodll_valgen.o \
|
||||
@ -4059,6 +4062,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS = \
|
||||
monodll_stockitem.o \
|
||||
monodll_tbarbase.o \
|
||||
monodll_textcmn.o \
|
||||
monodll_textentrycmn.o \
|
||||
monodll_toplvcmn.o \
|
||||
monodll_treebase.o \
|
||||
monodll_valgen.o \
|
||||
@ -4581,6 +4585,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS = \
|
||||
monodll_stattext.o \
|
||||
monodll_tbargtk.o \
|
||||
monodll_textctrl.o \
|
||||
monodll_textentry.o \
|
||||
monodll_tglbtn.o \
|
||||
monodll_treeentry_gtk.o
|
||||
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@__GUI_SRC_OBJECTS = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS)
|
||||
@ -5732,6 +5737,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_1 = \
|
||||
monolib_stockitem.o \
|
||||
monolib_tbarbase.o \
|
||||
monolib_textcmn.o \
|
||||
monolib_textentrycmn.o \
|
||||
monolib_toplvcmn.o \
|
||||
monolib_treebase.o \
|
||||
monolib_valgen.o \
|
||||
@ -5913,6 +5919,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 = \
|
||||
monolib_stockitem.o \
|
||||
monolib_tbarbase.o \
|
||||
monolib_textcmn.o \
|
||||
monolib_textentrycmn.o \
|
||||
monolib_toplvcmn.o \
|
||||
monolib_treebase.o \
|
||||
monolib_valgen.o \
|
||||
@ -6436,6 +6443,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS_1 = \
|
||||
monolib_stattext.o \
|
||||
monolib_tbargtk.o \
|
||||
monolib_textctrl.o \
|
||||
monolib_textentry.o \
|
||||
monolib_tglbtn.o \
|
||||
monolib_treeentry_gtk.o
|
||||
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@__GUI_SRC_OBJECTS_1 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS_1)
|
||||
@ -7861,6 +7869,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_2 = \
|
||||
coredll_stockitem.o \
|
||||
coredll_tbarbase.o \
|
||||
coredll_textcmn.o \
|
||||
coredll_textentrycmn.o \
|
||||
coredll_toplvcmn.o \
|
||||
coredll_treebase.o \
|
||||
coredll_valgen.o \
|
||||
@ -8042,6 +8051,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 = \
|
||||
coredll_stockitem.o \
|
||||
coredll_tbarbase.o \
|
||||
coredll_textcmn.o \
|
||||
coredll_textentrycmn.o \
|
||||
coredll_toplvcmn.o \
|
||||
coredll_treebase.o \
|
||||
coredll_valgen.o \
|
||||
@ -8565,6 +8575,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS_2 = \
|
||||
coredll_stattext.o \
|
||||
coredll_tbargtk.o \
|
||||
coredll_textctrl.o \
|
||||
coredll_textentry.o \
|
||||
coredll_tglbtn.o \
|
||||
coredll_treeentry_gtk.o
|
||||
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@__GUI_SRC_OBJECTS_2 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS_2)
|
||||
@ -9326,6 +9337,7 @@ COND_USE_GUI_1_WXUNIV_0___CORE_SRC_OBJECTS_3 = \
|
||||
corelib_stockitem.o \
|
||||
corelib_tbarbase.o \
|
||||
corelib_textcmn.o \
|
||||
corelib_textentrycmn.o \
|
||||
corelib_toplvcmn.o \
|
||||
corelib_treebase.o \
|
||||
corelib_valgen.o \
|
||||
@ -9507,6 +9519,7 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 = \
|
||||
corelib_stockitem.o \
|
||||
corelib_tbarbase.o \
|
||||
corelib_textcmn.o \
|
||||
corelib_textentrycmn.o \
|
||||
corelib_toplvcmn.o \
|
||||
corelib_treebase.o \
|
||||
corelib_valgen.o \
|
||||
@ -10030,6 +10043,7 @@ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS_3 = \
|
||||
corelib_stattext.o \
|
||||
corelib_tbargtk.o \
|
||||
corelib_textctrl.o \
|
||||
corelib_textentry.o \
|
||||
corelib_tglbtn.o \
|
||||
corelib_treeentry_gtk.o
|
||||
@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@__GUI_SRC_OBJECTS_3 = $(COND_TOOLKIT_GTK_TOOLKIT_VERSION_2___GUI_SRC_OBJECTS_3)
|
||||
@ -13900,6 +13914,9 @@ monodll_gprint.o: $(srcdir)/src/gtk/gnome/gprint.cpp $(MONODLL_ODEP)
|
||||
monodll_gvfs.o: $(srcdir)/src/gtk/gnome/gvfs.cpp $(MONODLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/gnome/gvfs.cpp
|
||||
|
||||
monodll_textentry.o: $(srcdir)/src/gtk/textentry.cpp $(MONODLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/gtk/textentry.cpp
|
||||
|
||||
monodll_treeentry_gtk.o: $(srcdir)/src/gtk/treeentry_gtk.c $(MONODLL_ODEP)
|
||||
$(CCC) -c -o $@ $(MONODLL_CFLAGS) $(srcdir)/src/gtk/treeentry_gtk.c
|
||||
|
||||
@ -17527,6 +17544,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
|
||||
@COND_USE_GUI_1@monodll_textcmn.o: $(srcdir)/src/common/textcmn.cpp $(MONODLL_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/textcmn.cpp
|
||||
|
||||
@COND_USE_GUI_1@monodll_textentrycmn.o: $(srcdir)/src/common/textentrycmn.cpp $(MONODLL_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/textentrycmn.cpp
|
||||
|
||||
@COND_USE_GUI_1@monodll_toplvcmn.o: $(srcdir)/src/common/toplvcmn.cpp $(MONODLL_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/common/toplvcmn.cpp
|
||||
|
||||
@ -18247,6 +18267,9 @@ monolib_gprint.o: $(srcdir)/src/gtk/gnome/gprint.cpp $(MONOLIB_ODEP)
|
||||
monolib_gvfs.o: $(srcdir)/src/gtk/gnome/gvfs.cpp $(MONOLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/gnome/gvfs.cpp
|
||||
|
||||
monolib_textentry.o: $(srcdir)/src/gtk/textentry.cpp $(MONOLIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/gtk/textentry.cpp
|
||||
|
||||
monolib_treeentry_gtk.o: $(srcdir)/src/gtk/treeentry_gtk.c $(MONOLIB_ODEP)
|
||||
$(CCC) -c -o $@ $(MONOLIB_CFLAGS) $(srcdir)/src/gtk/treeentry_gtk.c
|
||||
|
||||
@ -21874,6 +21897,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
|
||||
@COND_USE_GUI_1@monolib_textcmn.o: $(srcdir)/src/common/textcmn.cpp $(MONOLIB_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/textcmn.cpp
|
||||
|
||||
@COND_USE_GUI_1@monolib_textentrycmn.o: $(srcdir)/src/common/textentrycmn.cpp $(MONOLIB_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/textentrycmn.cpp
|
||||
|
||||
@COND_USE_GUI_1@monolib_toplvcmn.o: $(srcdir)/src/common/toplvcmn.cpp $(MONOLIB_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/common/toplvcmn.cpp
|
||||
|
||||
@ -23920,6 +23946,9 @@ coredll_gprint.o: $(srcdir)/src/gtk/gnome/gprint.cpp $(COREDLL_ODEP)
|
||||
coredll_gvfs.o: $(srcdir)/src/gtk/gnome/gvfs.cpp $(COREDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/gnome/gvfs.cpp
|
||||
|
||||
coredll_textentry.o: $(srcdir)/src/gtk/textentry.cpp $(COREDLL_ODEP)
|
||||
$(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/gtk/textentry.cpp
|
||||
|
||||
coredll_treeentry_gtk.o: $(srcdir)/src/gtk/treeentry_gtk.c $(COREDLL_ODEP)
|
||||
$(CCC) -c -o $@ $(COREDLL_CFLAGS) $(srcdir)/src/gtk/treeentry_gtk.c
|
||||
|
||||
@ -26731,6 +26760,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
|
||||
@COND_USE_GUI_1@coredll_textcmn.o: $(srcdir)/src/common/textcmn.cpp $(COREDLL_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/textcmn.cpp
|
||||
|
||||
@COND_USE_GUI_1@coredll_textentrycmn.o: $(srcdir)/src/common/textentrycmn.cpp $(COREDLL_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/textentrycmn.cpp
|
||||
|
||||
@COND_USE_GUI_1@coredll_toplvcmn.o: $(srcdir)/src/common/toplvcmn.cpp $(COREDLL_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/common/toplvcmn.cpp
|
||||
|
||||
@ -26893,6 +26925,9 @@ corelib_gprint.o: $(srcdir)/src/gtk/gnome/gprint.cpp $(CORELIB_ODEP)
|
||||
corelib_gvfs.o: $(srcdir)/src/gtk/gnome/gvfs.cpp $(CORELIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/gnome/gvfs.cpp
|
||||
|
||||
corelib_textentry.o: $(srcdir)/src/gtk/textentry.cpp $(CORELIB_ODEP)
|
||||
$(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/gtk/textentry.cpp
|
||||
|
||||
corelib_treeentry_gtk.o: $(srcdir)/src/gtk/treeentry_gtk.c $(CORELIB_ODEP)
|
||||
$(CCC) -c -o $@ $(CORELIB_CFLAGS) $(srcdir)/src/gtk/treeentry_gtk.c
|
||||
|
||||
@ -29704,6 +29739,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
|
||||
@COND_USE_GUI_1@corelib_textcmn.o: $(srcdir)/src/common/textcmn.cpp $(CORELIB_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/textcmn.cpp
|
||||
|
||||
@COND_USE_GUI_1@corelib_textentrycmn.o: $(srcdir)/src/common/textentrycmn.cpp $(CORELIB_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/textentrycmn.cpp
|
||||
|
||||
@COND_USE_GUI_1@corelib_toplvcmn.o: $(srcdir)/src/common/toplvcmn.cpp $(CORELIB_ODEP)
|
||||
@COND_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/common/toplvcmn.cpp
|
||||
|
||||
|
@ -697,6 +697,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
||||
src/common/stockitem.cpp
|
||||
src/common/tbarbase.cpp
|
||||
src/common/textcmn.cpp
|
||||
src/common/textentrycmn.cpp
|
||||
src/common/toplvcmn.cpp
|
||||
src/common/treebase.cpp
|
||||
src/common/valgen.cpp
|
||||
@ -828,6 +829,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
||||
wx/statusbr.h
|
||||
wx/textctrl.h
|
||||
wx/textdlg.h
|
||||
wx/textentry.h
|
||||
wx/toolbar.h
|
||||
wx/validate.h
|
||||
wx/valtext.h
|
||||
@ -1082,6 +1084,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
||||
src/gtk/stattext.cpp
|
||||
src/gtk/tbargtk.cpp
|
||||
src/gtk/textctrl.cpp
|
||||
src/gtk/textentry.cpp
|
||||
src/gtk/tglbtn.cpp
|
||||
src/gtk/treeentry_gtk.c
|
||||
</set>
|
||||
@ -1135,6 +1138,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
||||
wx/gtk/stattext.h
|
||||
wx/gtk/tbargtk.h
|
||||
wx/gtk/textctrl.h
|
||||
wx/gtk/textentry.h
|
||||
wx/gtk/tglbtn.h
|
||||
wx/gtk/treectrl.h
|
||||
wx/gtk/treeentry_gtk.h
|
||||
|
@ -1690,6 +1690,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \
|
||||
$(OBJS)\monodll_stockitem.obj \
|
||||
$(OBJS)\monodll_tbarbase.obj \
|
||||
$(OBJS)\monodll_textcmn.obj \
|
||||
$(OBJS)\monodll_textentrycmn.obj \
|
||||
$(OBJS)\monodll_toplvcmn.obj \
|
||||
$(OBJS)\monodll_treebase.obj \
|
||||
$(OBJS)\monodll_valgen.obj \
|
||||
@ -1920,6 +1921,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \
|
||||
$(OBJS)\monodll_stockitem.obj \
|
||||
$(OBJS)\monodll_tbarbase.obj \
|
||||
$(OBJS)\monodll_textcmn.obj \
|
||||
$(OBJS)\monodll_textentrycmn.obj \
|
||||
$(OBJS)\monodll_toplvcmn.obj \
|
||||
$(OBJS)\monodll_treebase.obj \
|
||||
$(OBJS)\monodll_valgen.obj \
|
||||
@ -2328,6 +2330,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \
|
||||
$(OBJS)\monolib_stockitem.obj \
|
||||
$(OBJS)\monolib_tbarbase.obj \
|
||||
$(OBJS)\monolib_textcmn.obj \
|
||||
$(OBJS)\monolib_textentrycmn.obj \
|
||||
$(OBJS)\monolib_toplvcmn.obj \
|
||||
$(OBJS)\monolib_treebase.obj \
|
||||
$(OBJS)\monolib_valgen.obj \
|
||||
@ -2558,6 +2561,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \
|
||||
$(OBJS)\monolib_stockitem.obj \
|
||||
$(OBJS)\monolib_tbarbase.obj \
|
||||
$(OBJS)\monolib_textcmn.obj \
|
||||
$(OBJS)\monolib_textentrycmn.obj \
|
||||
$(OBJS)\monolib_toplvcmn.obj \
|
||||
$(OBJS)\monolib_treebase.obj \
|
||||
$(OBJS)\monolib_valgen.obj \
|
||||
@ -2878,6 +2882,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \
|
||||
$(OBJS)\coredll_stockitem.obj \
|
||||
$(OBJS)\coredll_tbarbase.obj \
|
||||
$(OBJS)\coredll_textcmn.obj \
|
||||
$(OBJS)\coredll_textentrycmn.obj \
|
||||
$(OBJS)\coredll_toplvcmn.obj \
|
||||
$(OBJS)\coredll_treebase.obj \
|
||||
$(OBJS)\coredll_valgen.obj \
|
||||
@ -3108,6 +3113,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \
|
||||
$(OBJS)\coredll_stockitem.obj \
|
||||
$(OBJS)\coredll_tbarbase.obj \
|
||||
$(OBJS)\coredll_textcmn.obj \
|
||||
$(OBJS)\coredll_textentrycmn.obj \
|
||||
$(OBJS)\coredll_toplvcmn.obj \
|
||||
$(OBJS)\coredll_treebase.obj \
|
||||
$(OBJS)\coredll_valgen.obj \
|
||||
@ -3339,6 +3345,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \
|
||||
$(OBJS)\corelib_stockitem.obj \
|
||||
$(OBJS)\corelib_tbarbase.obj \
|
||||
$(OBJS)\corelib_textcmn.obj \
|
||||
$(OBJS)\corelib_textentrycmn.obj \
|
||||
$(OBJS)\corelib_toplvcmn.obj \
|
||||
$(OBJS)\corelib_treebase.obj \
|
||||
$(OBJS)\corelib_valgen.obj \
|
||||
@ -3569,6 +3576,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \
|
||||
$(OBJS)\corelib_stockitem.obj \
|
||||
$(OBJS)\corelib_tbarbase.obj \
|
||||
$(OBJS)\corelib_textcmn.obj \
|
||||
$(OBJS)\corelib_textentrycmn.obj \
|
||||
$(OBJS)\corelib_toplvcmn.obj \
|
||||
$(OBJS)\corelib_treebase.obj \
|
||||
$(OBJS)\corelib_valgen.obj \
|
||||
@ -6966,6 +6974,11 @@ $(OBJS)\monodll_textcmn.obj: ..\..\src\common\textcmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\monodll_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\monodll_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(MONODLL_CXXFLAGS) $**
|
||||
@ -9052,6 +9065,11 @@ $(OBJS)\monolib_textcmn.obj: ..\..\src\common\textcmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\monolib_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\monolib_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(MONOLIB_CXXFLAGS) $**
|
||||
@ -11183,6 +11201,11 @@ $(OBJS)\coredll_textcmn.obj: ..\..\src\common\textcmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\coredll_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\coredll_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(COREDLL_CXXFLAGS) $**
|
||||
@ -12486,6 +12509,11 @@ $(OBJS)\corelib_textcmn.obj: ..\..\src\common\textcmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\corelib_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\corelib_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) -q -c -P -o$@ $(CORELIB_CXXFLAGS) $**
|
||||
|
@ -1708,6 +1708,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \
|
||||
$(OBJS)\monodll_stockitem.o \
|
||||
$(OBJS)\monodll_tbarbase.o \
|
||||
$(OBJS)\monodll_textcmn.o \
|
||||
$(OBJS)\monodll_textentrycmn.o \
|
||||
$(OBJS)\monodll_toplvcmn.o \
|
||||
$(OBJS)\monodll_treebase.o \
|
||||
$(OBJS)\monodll_valgen.o \
|
||||
@ -1940,6 +1941,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \
|
||||
$(OBJS)\monodll_stockitem.o \
|
||||
$(OBJS)\monodll_tbarbase.o \
|
||||
$(OBJS)\monodll_textcmn.o \
|
||||
$(OBJS)\monodll_textentrycmn.o \
|
||||
$(OBJS)\monodll_toplvcmn.o \
|
||||
$(OBJS)\monodll_treebase.o \
|
||||
$(OBJS)\monodll_valgen.o \
|
||||
@ -2352,6 +2354,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \
|
||||
$(OBJS)\monolib_stockitem.o \
|
||||
$(OBJS)\monolib_tbarbase.o \
|
||||
$(OBJS)\monolib_textcmn.o \
|
||||
$(OBJS)\monolib_textentrycmn.o \
|
||||
$(OBJS)\monolib_toplvcmn.o \
|
||||
$(OBJS)\monolib_treebase.o \
|
||||
$(OBJS)\monolib_valgen.o \
|
||||
@ -2584,6 +2587,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \
|
||||
$(OBJS)\monolib_stockitem.o \
|
||||
$(OBJS)\monolib_tbarbase.o \
|
||||
$(OBJS)\monolib_textcmn.o \
|
||||
$(OBJS)\monolib_textentrycmn.o \
|
||||
$(OBJS)\monolib_toplvcmn.o \
|
||||
$(OBJS)\monolib_treebase.o \
|
||||
$(OBJS)\monolib_valgen.o \
|
||||
@ -2918,6 +2922,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \
|
||||
$(OBJS)\coredll_stockitem.o \
|
||||
$(OBJS)\coredll_tbarbase.o \
|
||||
$(OBJS)\coredll_textcmn.o \
|
||||
$(OBJS)\coredll_textentrycmn.o \
|
||||
$(OBJS)\coredll_toplvcmn.o \
|
||||
$(OBJS)\coredll_treebase.o \
|
||||
$(OBJS)\coredll_valgen.o \
|
||||
@ -3150,6 +3155,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \
|
||||
$(OBJS)\coredll_stockitem.o \
|
||||
$(OBJS)\coredll_tbarbase.o \
|
||||
$(OBJS)\coredll_textcmn.o \
|
||||
$(OBJS)\coredll_textentrycmn.o \
|
||||
$(OBJS)\coredll_toplvcmn.o \
|
||||
$(OBJS)\coredll_treebase.o \
|
||||
$(OBJS)\coredll_valgen.o \
|
||||
@ -3387,6 +3393,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \
|
||||
$(OBJS)\corelib_stockitem.o \
|
||||
$(OBJS)\corelib_tbarbase.o \
|
||||
$(OBJS)\corelib_textcmn.o \
|
||||
$(OBJS)\corelib_textentrycmn.o \
|
||||
$(OBJS)\corelib_toplvcmn.o \
|
||||
$(OBJS)\corelib_treebase.o \
|
||||
$(OBJS)\corelib_valgen.o \
|
||||
@ -3619,6 +3626,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \
|
||||
$(OBJS)\corelib_stockitem.o \
|
||||
$(OBJS)\corelib_tbarbase.o \
|
||||
$(OBJS)\corelib_textcmn.o \
|
||||
$(OBJS)\corelib_textentrycmn.o \
|
||||
$(OBJS)\corelib_toplvcmn.o \
|
||||
$(OBJS)\corelib_treebase.o \
|
||||
$(OBJS)\corelib_valgen.o \
|
||||
@ -7235,6 +7243,11 @@ $(OBJS)\monodll_textcmn.o: ../../src/common/textcmn.cpp
|
||||
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
endif
|
||||
|
||||
ifeq ($(USE_GUI),1)
|
||||
$(OBJS)\monodll_textentrycmn.o: ../../src/common/textentrycmn.cpp
|
||||
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
endif
|
||||
|
||||
ifeq ($(USE_GUI),1)
|
||||
$(OBJS)\monodll_toplvcmn.o: ../../src/common/toplvcmn.cpp
|
||||
$(CXX) -c -o $@ $(MONODLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
@ -9421,6 +9434,11 @@ $(OBJS)\monolib_textcmn.o: ../../src/common/textcmn.cpp
|
||||
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
endif
|
||||
|
||||
ifeq ($(USE_GUI),1)
|
||||
$(OBJS)\monolib_textentrycmn.o: ../../src/common/textentrycmn.cpp
|
||||
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
endif
|
||||
|
||||
ifeq ($(USE_GUI),1)
|
||||
$(OBJS)\monolib_toplvcmn.o: ../../src/common/toplvcmn.cpp
|
||||
$(CXX) -c -o $@ $(MONOLIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
@ -11652,6 +11670,11 @@ $(OBJS)\coredll_textcmn.o: ../../src/common/textcmn.cpp
|
||||
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
endif
|
||||
|
||||
ifeq ($(USE_GUI),1)
|
||||
$(OBJS)\coredll_textentrycmn.o: ../../src/common/textentrycmn.cpp
|
||||
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
endif
|
||||
|
||||
ifeq ($(USE_GUI),1)
|
||||
$(OBJS)\coredll_toplvcmn.o: ../../src/common/toplvcmn.cpp
|
||||
$(CXX) -c -o $@ $(COREDLL_CXXFLAGS) $(CPPDEPS) $<
|
||||
@ -13055,6 +13078,11 @@ $(OBJS)\corelib_textcmn.o: ../../src/common/textcmn.cpp
|
||||
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
endif
|
||||
|
||||
ifeq ($(USE_GUI),1)
|
||||
$(OBJS)\corelib_textentrycmn.o: ../../src/common/textentrycmn.cpp
|
||||
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
endif
|
||||
|
||||
ifeq ($(USE_GUI),1)
|
||||
$(OBJS)\corelib_toplvcmn.o: ../../src/common/toplvcmn.cpp
|
||||
$(CXX) -c -o $@ $(CORELIB_CXXFLAGS) $(CPPDEPS) $<
|
||||
|
@ -1877,6 +1877,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \
|
||||
$(OBJS)\monodll_stockitem.obj \
|
||||
$(OBJS)\monodll_tbarbase.obj \
|
||||
$(OBJS)\monodll_textcmn.obj \
|
||||
$(OBJS)\monodll_textentrycmn.obj \
|
||||
$(OBJS)\monodll_toplvcmn.obj \
|
||||
$(OBJS)\monodll_treebase.obj \
|
||||
$(OBJS)\monodll_valgen.obj \
|
||||
@ -2107,6 +2108,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = \
|
||||
$(OBJS)\monodll_stockitem.obj \
|
||||
$(OBJS)\monodll_tbarbase.obj \
|
||||
$(OBJS)\monodll_textcmn.obj \
|
||||
$(OBJS)\monodll_textentrycmn.obj \
|
||||
$(OBJS)\monodll_toplvcmn.obj \
|
||||
$(OBJS)\monodll_treebase.obj \
|
||||
$(OBJS)\monodll_valgen.obj \
|
||||
@ -2521,6 +2523,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \
|
||||
$(OBJS)\monolib_stockitem.obj \
|
||||
$(OBJS)\monolib_tbarbase.obj \
|
||||
$(OBJS)\monolib_textcmn.obj \
|
||||
$(OBJS)\monolib_textentrycmn.obj \
|
||||
$(OBJS)\monolib_toplvcmn.obj \
|
||||
$(OBJS)\monolib_treebase.obj \
|
||||
$(OBJS)\monolib_valgen.obj \
|
||||
@ -2751,6 +2754,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = \
|
||||
$(OBJS)\monolib_stockitem.obj \
|
||||
$(OBJS)\monolib_tbarbase.obj \
|
||||
$(OBJS)\monolib_textcmn.obj \
|
||||
$(OBJS)\monolib_textentrycmn.obj \
|
||||
$(OBJS)\monolib_toplvcmn.obj \
|
||||
$(OBJS)\monolib_treebase.obj \
|
||||
$(OBJS)\monolib_valgen.obj \
|
||||
@ -3101,6 +3105,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \
|
||||
$(OBJS)\coredll_stockitem.obj \
|
||||
$(OBJS)\coredll_tbarbase.obj \
|
||||
$(OBJS)\coredll_textcmn.obj \
|
||||
$(OBJS)\coredll_textentrycmn.obj \
|
||||
$(OBJS)\coredll_toplvcmn.obj \
|
||||
$(OBJS)\coredll_treebase.obj \
|
||||
$(OBJS)\coredll_valgen.obj \
|
||||
@ -3331,6 +3336,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = \
|
||||
$(OBJS)\coredll_stockitem.obj \
|
||||
$(OBJS)\coredll_tbarbase.obj \
|
||||
$(OBJS)\coredll_textcmn.obj \
|
||||
$(OBJS)\coredll_textentrycmn.obj \
|
||||
$(OBJS)\coredll_toplvcmn.obj \
|
||||
$(OBJS)\coredll_treebase.obj \
|
||||
$(OBJS)\coredll_valgen.obj \
|
||||
@ -3568,6 +3574,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \
|
||||
$(OBJS)\corelib_stockitem.obj \
|
||||
$(OBJS)\corelib_tbarbase.obj \
|
||||
$(OBJS)\corelib_textcmn.obj \
|
||||
$(OBJS)\corelib_textentrycmn.obj \
|
||||
$(OBJS)\corelib_toplvcmn.obj \
|
||||
$(OBJS)\corelib_treebase.obj \
|
||||
$(OBJS)\corelib_valgen.obj \
|
||||
@ -3798,6 +3805,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = \
|
||||
$(OBJS)\corelib_stockitem.obj \
|
||||
$(OBJS)\corelib_tbarbase.obj \
|
||||
$(OBJS)\corelib_textcmn.obj \
|
||||
$(OBJS)\corelib_textentrycmn.obj \
|
||||
$(OBJS)\corelib_toplvcmn.obj \
|
||||
$(OBJS)\corelib_treebase.obj \
|
||||
$(OBJS)\corelib_valgen.obj \
|
||||
@ -7327,6 +7335,11 @@ $(OBJS)\monodll_textcmn.obj: ..\..\src\common\textcmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\monodll_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\monodll_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONODLL_CXXFLAGS) $**
|
||||
@ -9413,6 +9426,11 @@ $(OBJS)\monolib_textcmn.obj: ..\..\src\common\textcmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\monolib_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\monolib_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(MONOLIB_CXXFLAGS) $**
|
||||
@ -11544,6 +11562,11 @@ $(OBJS)\coredll_textcmn.obj: ..\..\src\common\textcmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\coredll_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\coredll_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(COREDLL_CXXFLAGS) $**
|
||||
@ -12847,6 +12870,11 @@ $(OBJS)\corelib_textcmn.obj: ..\..\src\common\textcmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\corelib_textentrycmn.obj: ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) $**
|
||||
!endif
|
||||
|
||||
!if "$(USE_GUI)" == "1"
|
||||
$(OBJS)\corelib_toplvcmn.obj: ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) /c /nologo /TP /Fo$@ $(CORELIB_CXXFLAGS) $**
|
||||
|
@ -398,6 +398,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = &
|
||||
$(OBJS)\monodll_stockitem.obj &
|
||||
$(OBJS)\monodll_tbarbase.obj &
|
||||
$(OBJS)\monodll_textcmn.obj &
|
||||
$(OBJS)\monodll_textentrycmn.obj &
|
||||
$(OBJS)\monodll_toplvcmn.obj &
|
||||
$(OBJS)\monodll_treebase.obj &
|
||||
$(OBJS)\monodll_valgen.obj &
|
||||
@ -630,6 +631,7 @@ ____CORE_SRC_FILENAMES_OBJECTS = &
|
||||
$(OBJS)\monodll_stockitem.obj &
|
||||
$(OBJS)\monodll_tbarbase.obj &
|
||||
$(OBJS)\monodll_textcmn.obj &
|
||||
$(OBJS)\monodll_textentrycmn.obj &
|
||||
$(OBJS)\monodll_toplvcmn.obj &
|
||||
$(OBJS)\monodll_treebase.obj &
|
||||
$(OBJS)\monodll_valgen.obj &
|
||||
@ -1047,6 +1049,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = &
|
||||
$(OBJS)\monolib_stockitem.obj &
|
||||
$(OBJS)\monolib_tbarbase.obj &
|
||||
$(OBJS)\monolib_textcmn.obj &
|
||||
$(OBJS)\monolib_textentrycmn.obj &
|
||||
$(OBJS)\monolib_toplvcmn.obj &
|
||||
$(OBJS)\monolib_treebase.obj &
|
||||
$(OBJS)\monolib_valgen.obj &
|
||||
@ -1279,6 +1282,7 @@ ____CORE_SRC_FILENAMES_1_OBJECTS = &
|
||||
$(OBJS)\monolib_stockitem.obj &
|
||||
$(OBJS)\monolib_tbarbase.obj &
|
||||
$(OBJS)\monolib_textcmn.obj &
|
||||
$(OBJS)\monolib_textentrycmn.obj &
|
||||
$(OBJS)\monolib_toplvcmn.obj &
|
||||
$(OBJS)\monolib_treebase.obj &
|
||||
$(OBJS)\monolib_valgen.obj &
|
||||
@ -1624,6 +1628,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = &
|
||||
$(OBJS)\coredll_stockitem.obj &
|
||||
$(OBJS)\coredll_tbarbase.obj &
|
||||
$(OBJS)\coredll_textcmn.obj &
|
||||
$(OBJS)\coredll_textentrycmn.obj &
|
||||
$(OBJS)\coredll_toplvcmn.obj &
|
||||
$(OBJS)\coredll_treebase.obj &
|
||||
$(OBJS)\coredll_valgen.obj &
|
||||
@ -1856,6 +1861,7 @@ ____CORE_SRC_FILENAMES_2_OBJECTS = &
|
||||
$(OBJS)\coredll_stockitem.obj &
|
||||
$(OBJS)\coredll_tbarbase.obj &
|
||||
$(OBJS)\coredll_textcmn.obj &
|
||||
$(OBJS)\coredll_textentrycmn.obj &
|
||||
$(OBJS)\coredll_toplvcmn.obj &
|
||||
$(OBJS)\coredll_treebase.obj &
|
||||
$(OBJS)\coredll_valgen.obj &
|
||||
@ -2095,6 +2101,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = &
|
||||
$(OBJS)\corelib_stockitem.obj &
|
||||
$(OBJS)\corelib_tbarbase.obj &
|
||||
$(OBJS)\corelib_textcmn.obj &
|
||||
$(OBJS)\corelib_textentrycmn.obj &
|
||||
$(OBJS)\corelib_toplvcmn.obj &
|
||||
$(OBJS)\corelib_treebase.obj &
|
||||
$(OBJS)\corelib_valgen.obj &
|
||||
@ -2327,6 +2334,7 @@ ____CORE_SRC_FILENAMES_3_OBJECTS = &
|
||||
$(OBJS)\corelib_stockitem.obj &
|
||||
$(OBJS)\corelib_tbarbase.obj &
|
||||
$(OBJS)\corelib_textcmn.obj &
|
||||
$(OBJS)\corelib_textentrycmn.obj &
|
||||
$(OBJS)\corelib_toplvcmn.obj &
|
||||
$(OBJS)\corelib_treebase.obj &
|
||||
$(OBJS)\corelib_valgen.obj &
|
||||
@ -7496,6 +7504,11 @@ $(OBJS)\monodll_textcmn.obj : .AUTODEPEND ..\..\src\common\textcmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
|
||||
!endif
|
||||
|
||||
!ifeq USE_GUI 1
|
||||
$(OBJS)\monodll_textentrycmn.obj : .AUTODEPEND ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
|
||||
!endif
|
||||
|
||||
!ifeq USE_GUI 1
|
||||
$(OBJS)\monodll_toplvcmn.obj : .AUTODEPEND ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(MONODLL_CXXFLAGS) $<
|
||||
@ -9682,6 +9695,11 @@ $(OBJS)\monolib_textcmn.obj : .AUTODEPEND ..\..\src\common\textcmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
|
||||
!endif
|
||||
|
||||
!ifeq USE_GUI 1
|
||||
$(OBJS)\monolib_textentrycmn.obj : .AUTODEPEND ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
|
||||
!endif
|
||||
|
||||
!ifeq USE_GUI 1
|
||||
$(OBJS)\monolib_toplvcmn.obj : .AUTODEPEND ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(MONOLIB_CXXFLAGS) $<
|
||||
@ -11913,6 +11931,11 @@ $(OBJS)\coredll_textcmn.obj : .AUTODEPEND ..\..\src\common\textcmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
|
||||
!endif
|
||||
|
||||
!ifeq USE_GUI 1
|
||||
$(OBJS)\coredll_textentrycmn.obj : .AUTODEPEND ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
|
||||
!endif
|
||||
|
||||
!ifeq USE_GUI 1
|
||||
$(OBJS)\coredll_toplvcmn.obj : .AUTODEPEND ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(COREDLL_CXXFLAGS) $<
|
||||
@ -13316,6 +13339,11 @@ $(OBJS)\corelib_textcmn.obj : .AUTODEPEND ..\..\src\common\textcmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
|
||||
!endif
|
||||
|
||||
!ifeq USE_GUI 1
|
||||
$(OBJS)\corelib_textentrycmn.obj : .AUTODEPEND ..\..\src\common\textentrycmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
|
||||
!endif
|
||||
|
||||
!ifeq USE_GUI 1
|
||||
$(OBJS)\corelib_toplvcmn.obj : .AUTODEPEND ..\..\src\common\toplvcmn.cpp
|
||||
$(CXX) -bt=nt -zq -fo=$^@ $(CORELIB_CXXFLAGS) $<
|
||||
|
@ -822,6 +822,10 @@ SOURCE=..\..\src\common\textcmn.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\common\textentrycmn.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\common\toplvcmn.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@ -9413,6 +9417,10 @@ SOURCE=..\..\include\wx\textdlg.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\wx\textentry.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\wx\tglbtn.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
@ -22,51 +22,33 @@ extern WXDLLEXPORT_DATA(const wxChar) wxComboBoxNameStr[];
|
||||
// wxComboBoxBase: this interface defines the methods wxComboBox must implement
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/textctrl.h"
|
||||
#include "wx/ctrlsub.h"
|
||||
#include "wx/textentry.h"
|
||||
|
||||
class WXDLLEXPORT wxComboBoxBase : public wxItemContainer
|
||||
class WXDLLEXPORT wxComboBoxBase : public wxItemContainer,
|
||||
public wxTextEntry
|
||||
{
|
||||
public:
|
||||
// wxTextCtrl-like methods wxComboBox must implement
|
||||
virtual wxString GetValue() const = 0;
|
||||
virtual void SetValue(const wxString& value) = 0;
|
||||
// override this to disambiguate between two base classes versions
|
||||
virtual void Clear()
|
||||
{
|
||||
wxTextEntry::Clear();
|
||||
wxItemContainer::Clear();
|
||||
}
|
||||
|
||||
virtual void Copy() = 0;
|
||||
virtual void Cut() = 0;
|
||||
virtual void Paste() = 0;
|
||||
virtual void SetInsertionPoint(long pos) = 0;
|
||||
virtual long GetInsertionPoint() const = 0;
|
||||
virtual wxTextPos GetLastPosition() const = 0;
|
||||
virtual void Replace(long from, long to, const wxString& value) = 0;
|
||||
virtual void SetSelection(long from, long to) = 0;
|
||||
virtual void SetEditable(bool editable) = 0;
|
||||
|
||||
virtual void SetInsertionPointEnd()
|
||||
{ SetInsertionPoint(GetLastPosition()); }
|
||||
virtual void Remove(long from, long to)
|
||||
{ Replace(from, to, wxEmptyString); }
|
||||
|
||||
virtual bool IsEditable() const = 0;
|
||||
|
||||
virtual void Undo() = 0;
|
||||
virtual void Redo() = 0;
|
||||
virtual void SelectAll() = 0;
|
||||
|
||||
virtual bool CanCopy() const = 0;
|
||||
virtual bool CanCut() const = 0;
|
||||
virtual bool CanPaste() const = 0;
|
||||
virtual bool CanUndo() const = 0;
|
||||
virtual bool CanRedo() const = 0;
|
||||
// also bring in GetSelection() versions of both base classes in scope
|
||||
//
|
||||
// NB: GetSelection(from, to) could be already implemented in wxTextEntry
|
||||
// but still make it pure virtual because for some platforms it's not
|
||||
// implemented there and also because the derived class has to override
|
||||
// it anyhow to avoid ambiguity with the other GetSelection()
|
||||
virtual int GetSelection() const = 0;
|
||||
virtual void GetSelection(long *from, long *to) const = 0;
|
||||
|
||||
// may return value different from GetSelection() when the combobox
|
||||
// dropdown is shown and the user selected, but not yet accepted, a value
|
||||
// different from the old one in it
|
||||
virtual int GetCurrentSelection() const { return GetSelection(); }
|
||||
|
||||
// redeclare inherited SetSelection() overload here as well to avoid
|
||||
// virtual function hiding
|
||||
virtual void SetSelection(int n) = 0;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -93,5 +75,4 @@ public:
|
||||
|
||||
#endif // wxUSE_COMBOBOX
|
||||
|
||||
#endif
|
||||
// _WX_COMBOBOX_H_BASE_
|
||||
#endif // _WX_COMBOBOX_H_BASE_
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
bool SetStringSelection(const wxString& s);
|
||||
|
||||
// return the selected string or empty string if none
|
||||
wxString GetStringSelection() const;
|
||||
virtual wxString GetStringSelection() const;
|
||||
|
||||
// this is the same as SetSelection( for single-selection controls but
|
||||
// reads better for multi-selection ones
|
||||
|
@ -203,7 +203,9 @@ public:
|
||||
#endif // wxUSE_MENUS
|
||||
|
||||
protected:
|
||||
virtual void DoSetValue(const wxString& value, int flags = 0);
|
||||
virtual void DoSetValue(const wxString& value, int flags);
|
||||
virtual bool DoLoadFile(const wxString& file, int fileType);
|
||||
virtual bool DoSaveFile(const wxString& file, int fileType);
|
||||
|
||||
// override the base class virtuals involved into geometry calculations
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
@ -15,29 +15,32 @@
|
||||
// wxComboBox
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxComboBox : public wxControl, public wxComboBoxBase
|
||||
class WXDLLIMPEXP_CORE wxComboBox : public wxControl,
|
||||
public wxComboBoxBase
|
||||
{
|
||||
public:
|
||||
inline wxComboBox() { m_strings = NULL; }
|
||||
inline wxComboBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
wxComboBox() { m_strings = NULL; }
|
||||
wxComboBox(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
{
|
||||
Create(parent, id, value, pos, size, n, choices, style, validator, name);
|
||||
}
|
||||
inline wxComboBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
|
||||
wxComboBox(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr)
|
||||
{
|
||||
Create(parent, id, value, pos, size, choices, style, validator, name);
|
||||
}
|
||||
@ -45,21 +48,21 @@ public:
|
||||
virtual ~wxComboBox();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = (const wxString *) NULL,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxComboBoxNameStr);
|
||||
|
||||
// From wxItemContainerImmutable:
|
||||
virtual unsigned int GetCount() const;
|
||||
@ -68,40 +71,26 @@ public:
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
wxString GetStringSelection() const; // not a virtual in parent class
|
||||
|
||||
// From wxItemContainer:
|
||||
virtual void DoClear();
|
||||
virtual void DoDeleteOneItem(unsigned int n);
|
||||
// from wxTextEntry: we need to override them to avoid virtual function
|
||||
// hiding
|
||||
virtual void SetSelection(long from, long to)
|
||||
{
|
||||
wxTextEntry::SetSelection(from, to);
|
||||
}
|
||||
|
||||
// From wxBomboBoxBase:
|
||||
virtual wxString GetValue() const;
|
||||
virtual void SetValue(const wxString& value);
|
||||
virtual void Copy();
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
virtual void SetInsertionPoint( long pos );
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
virtual void Replace( long from, long to, const wxString& value );
|
||||
virtual void SetSelection( long from, long to );
|
||||
virtual void SetEditable( bool editable );
|
||||
virtual void SetInsertionPointEnd() { SetInsertionPoint( -1 ); }
|
||||
virtual void Remove(long from, long to) { Replace(from, to, wxEmptyString); }
|
||||
virtual bool IsEditable() const;
|
||||
virtual void Undo();
|
||||
virtual void Redo();
|
||||
virtual void SelectAll();
|
||||
virtual bool CanCopy() const;
|
||||
virtual bool CanCut() const;
|
||||
virtual bool CanPaste() const;
|
||||
virtual bool CanUndo() const;
|
||||
virtual bool CanRedo() const;
|
||||
virtual void GetSelection(long *from, long *to) const
|
||||
{
|
||||
return wxTextEntry::GetSelection(from, to);
|
||||
}
|
||||
|
||||
// implementation
|
||||
bool HasSelection() const;
|
||||
void GetSelection( long* from, long* to ) const;
|
||||
int GetCurrentSelection() const;
|
||||
virtual wxString GetStringSelection() const
|
||||
{
|
||||
return wxItemContainer::GetStringSelection();
|
||||
}
|
||||
|
||||
// From wxComboBoxBase:
|
||||
virtual int GetCurrentSelection() const;
|
||||
|
||||
virtual void SetFocus();
|
||||
|
||||
@ -150,10 +139,23 @@ protected:
|
||||
virtual void DoSetItemClientData(unsigned int n, void* clientData);
|
||||
virtual void* DoGetItemClientData(unsigned int n) const;
|
||||
virtual bool IsSorted() const { return HasFlag(wxCB_SORT); }
|
||||
virtual void DoClear();
|
||||
virtual void DoDeleteOneItem(unsigned int n);
|
||||
|
||||
// From wxControl:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
// From wxTextEntry:
|
||||
virtual const wxWindow *GetEditableWindow() const { return this; }
|
||||
virtual GtkEditable *GetEditable() const;
|
||||
virtual void EnableTextChangedEvents(bool enable)
|
||||
{
|
||||
if ( enable )
|
||||
EnableEvents();
|
||||
else
|
||||
DisableEvents();
|
||||
}
|
||||
|
||||
// Widgets that use the style->base colour for the BG colour should
|
||||
// override this and return true.
|
||||
virtual bool UseGTKStyleBase() const { return true; }
|
||||
|
@ -44,6 +44,7 @@ public:
|
||||
// implement base class pure virtuals
|
||||
// ----------------------------------
|
||||
|
||||
virtual void WriteText(const wxString& text);
|
||||
virtual wxString GetValue() const;
|
||||
virtual bool IsEmpty() const;
|
||||
|
||||
@ -54,30 +55,13 @@ public:
|
||||
virtual bool IsModified() const;
|
||||
virtual bool IsEditable() const;
|
||||
|
||||
// If the return values from and to are the same, there is no selection.
|
||||
virtual void GetSelection(long* from, long* to) const;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
// editing
|
||||
virtual void Clear();
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
|
||||
// sets/clears the dirty flag
|
||||
virtual void MarkDirty();
|
||||
virtual void DiscardEdits();
|
||||
|
||||
virtual void SetMaxLength(unsigned long len);
|
||||
|
||||
// writing text inserts it at the current position, appending always
|
||||
// inserts it at the end
|
||||
virtual void WriteText(const wxString& text);
|
||||
virtual void AppendText(const wxString& text);
|
||||
|
||||
// apply text attribute to the range of text (only works with richedit
|
||||
// controls)
|
||||
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
|
||||
|
||||
// translate between the position (which is just an index in the text ctrl
|
||||
@ -101,16 +85,8 @@ public:
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
|
||||
// Undo/redo
|
||||
virtual void Undo();
|
||||
virtual void Redo();
|
||||
|
||||
virtual bool CanUndo() const;
|
||||
virtual bool CanRedo() const;
|
||||
|
||||
// Insertion point
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual wxTextPos GetLastPosition() const;
|
||||
|
||||
@ -181,10 +157,16 @@ public:
|
||||
bool IsFrozen() const { return m_freezeCount > 0; }
|
||||
|
||||
protected:
|
||||
// overridden wxWindow virtual methods
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoApplyWidgetStyle(GtkRcStyle *style);
|
||||
virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
|
||||
|
||||
// overridden wxTextEntry virtual methods
|
||||
virtual const wxWindow *GetEditableWindow() const { return this; }
|
||||
virtual GtkEditable *GetEditable() const;
|
||||
virtual void EnableTextChangedEvents(bool enable);
|
||||
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
|
69
include/wx/gtk/textentry.h
Normal file
69
include/wx/gtk/textentry.h
Normal file
@ -0,0 +1,69 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/gtk/textentry.h
|
||||
// Purpose: wxGTK-specific wxTextEntry implementation
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-09-24
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_GTK_TEXTENTRY_H_
|
||||
#define _WX_GTK_TEXTENTRY_H_
|
||||
|
||||
typedef struct _GtkEditable GtkEditable;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextEntry: roughly corresponds to GtkEditable
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
|
||||
{
|
||||
public:
|
||||
wxTextEntry() { }
|
||||
|
||||
// implement wxTextEntryBase pure virtual methods
|
||||
virtual void WriteText(const wxString& text);
|
||||
virtual wxString GetValue() const;
|
||||
virtual void Remove(long from, long to);
|
||||
|
||||
virtual void Copy();
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
|
||||
virtual void Undo();
|
||||
virtual void Redo();
|
||||
virtual bool CanUndo() const;
|
||||
virtual bool CanRedo() const;
|
||||
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void GetSelection(long *from, long *to) const;
|
||||
|
||||
// status
|
||||
virtual bool IsEditable() const;
|
||||
virtual void SetEditable(bool editable);
|
||||
|
||||
// set the max number of characters which may be entered in a single line
|
||||
// text control
|
||||
virtual void SetMaxLength(unsigned long len);
|
||||
|
||||
|
||||
// implementation only from now on
|
||||
void SendMaxLenEvent();
|
||||
|
||||
private:
|
||||
// implement this to return the associated window, it will be used for
|
||||
// event generation
|
||||
virtual const wxWindow *GetEditableWindow() const = 0;
|
||||
|
||||
// implement this to return the associated GtkEntry or another widget
|
||||
// implementing GtkEditable
|
||||
virtual GtkEditable *GetEditable() const = 0;
|
||||
};
|
||||
|
||||
#endif // _WX_GTK_TEXTENTRY_H_
|
||||
|
@ -96,8 +96,10 @@ class WXDLLEXPORT wxComboBox : public wxControl, public wxComboBoxBase
|
||||
virtual void SetString(unsigned int n, const wxString& s);
|
||||
|
||||
// Text field functions
|
||||
virtual wxString GetValue() const;
|
||||
virtual void SetValue(const wxString& value);
|
||||
virtual wxString GetValue() const;
|
||||
virtual void WriteText(const wxString& text);
|
||||
virtual void GetSelection(long *from, long *to) const;
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy();
|
||||
|
@ -84,7 +84,8 @@ class WXDLLIMPEXP_FWD_RICHTEXT wxRichTextStyleDefinition;
|
||||
* wxRichTextCtrl class declaration
|
||||
*/
|
||||
|
||||
class WXDLLIMPEXP_RICHTEXT wxRichTextCtrl : public wxTextCtrlBase,
|
||||
class WXDLLIMPEXP_RICHTEXT wxRichTextCtrl : public wxControl,
|
||||
public wxTextCtrlIface,
|
||||
public wxScrollHelper
|
||||
{
|
||||
DECLARE_CLASS( wxRichTextCtrl )
|
||||
|
@ -27,6 +27,9 @@
|
||||
|
||||
////@begin forward declarations
|
||||
class wxSymbolListCtrl;
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTextCtrl;
|
||||
|
||||
////@end forward declarations
|
||||
|
||||
// __UNICODE__ is a symbol used by DialogBlocks-generated code.
|
||||
|
@ -27,7 +27,10 @@
|
||||
// no native version, use the generic one
|
||||
#define wxUSE_NATIVE_SEARCH_CONTROL 0
|
||||
|
||||
#define wxSearchCtrlBaseBaseClass wxTextCtrlBase
|
||||
class WXDLLIMPEXP_CORE wxSearchCtrlBaseBaseClass : public wxControl,
|
||||
public wxTextCtrlIface
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -21,6 +21,7 @@
|
||||
#if wxUSE_TEXTCTRL
|
||||
|
||||
#include "wx/control.h" // the base class
|
||||
#include "wx/textentry.h" // single-line text entry interface
|
||||
#include "wx/dynarray.h" // wxArrayInt
|
||||
#include "wx/gdicmn.h" // wxPoint
|
||||
|
||||
@ -46,9 +47,6 @@ class WXDLLIMPEXP_FWD_CORE wxTextCtrlBase;
|
||||
// wxTextCtrl types
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// wxTextPos is the position in the text
|
||||
typedef long wxTextPos;
|
||||
|
||||
// wxTextCoord is the line or row number (which should have been unsigned but
|
||||
// is long for backwards compatibility)
|
||||
typedef long wxTextCoord;
|
||||
@ -272,69 +270,35 @@ private:
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextCtrl: a single or multiple line text zone where user can enter and
|
||||
// edit text
|
||||
// wxTextAreaBase: multiline text control specific methods
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTextCtrlBase : public wxControl
|
||||
#if wxHAS_TEXT_WINDOW_STREAM
|
||||
, public wxSTD streambuf
|
||||
#endif
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTextAreaBase
|
||||
{
|
||||
public:
|
||||
// creation
|
||||
// --------
|
||||
wxTextAreaBase() { }
|
||||
virtual ~wxTextAreaBase() { }
|
||||
|
||||
wxTextCtrlBase(){}
|
||||
virtual ~wxTextCtrlBase(){}
|
||||
|
||||
// accessors
|
||||
// ---------
|
||||
|
||||
virtual wxString GetValue() const = 0;
|
||||
virtual bool IsEmpty() const { return GetValue().empty(); }
|
||||
|
||||
virtual void SetValue(const wxString& value)
|
||||
{ DoSetValue(value, SetValue_SendEvent); }
|
||||
virtual void ChangeValue(const wxString& value)
|
||||
{ DoSetValue(value); }
|
||||
|
||||
virtual wxString GetRange(long from, long to) const;
|
||||
// lines access
|
||||
// ------------
|
||||
|
||||
virtual int GetLineLength(long lineNo) const = 0;
|
||||
virtual wxString GetLineText(long lineNo) const = 0;
|
||||
virtual int GetNumberOfLines() const = 0;
|
||||
|
||||
|
||||
// file IO
|
||||
// -------
|
||||
|
||||
bool LoadFile(const wxString& file, int fileType = wxTEXT_TYPE_ANY)
|
||||
{ return DoLoadFile(file, fileType); }
|
||||
bool SaveFile(const wxString& file = wxEmptyString,
|
||||
int fileType = wxTEXT_TYPE_ANY);
|
||||
|
||||
// dirty flag handling
|
||||
// -------------------
|
||||
|
||||
virtual bool IsModified() const = 0;
|
||||
virtual bool IsEditable() const = 0;
|
||||
|
||||
// more readable flag testing methods
|
||||
bool IsSingleLine() const { return !HasFlag(wxTE_MULTILINE); }
|
||||
bool IsMultiLine() const { return !IsSingleLine(); }
|
||||
|
||||
// If the return values from and to are the same, there is no selection.
|
||||
virtual void GetSelection(long* from, long* to) const = 0;
|
||||
|
||||
virtual wxString GetStringSelection() const;
|
||||
|
||||
// operations
|
||||
// ----------
|
||||
|
||||
// editing
|
||||
virtual void Clear() = 0;
|
||||
virtual void Replace(long from, long to, const wxString& value) = 0;
|
||||
virtual void Remove(long from, long to) = 0;
|
||||
|
||||
// load/save the control's contents from/to a file
|
||||
bool LoadFile(const wxString& file, int fileType = wxTEXT_TYPE_ANY) { return DoLoadFile(file, fileType); }
|
||||
bool SaveFile(const wxString& file = wxEmptyString, int fileType = wxTEXT_TYPE_ANY);
|
||||
|
||||
// implementation for loading/saving
|
||||
virtual bool DoLoadFile(const wxString& file, int fileType);
|
||||
virtual bool DoSaveFile(const wxString& file, int fileType);
|
||||
|
||||
// sets/clears the dirty flag
|
||||
virtual void MarkDirty() = 0;
|
||||
virtual void DiscardEdits() = 0;
|
||||
void SetModified(bool modified)
|
||||
@ -345,26 +309,21 @@ public:
|
||||
DiscardEdits();
|
||||
}
|
||||
|
||||
// set the max number of characters which may be entered in a single line
|
||||
// text control
|
||||
virtual void SetMaxLength(unsigned long WXUNUSED(len)) { }
|
||||
|
||||
// writing text inserts it at the current position, appending always
|
||||
// inserts it at the end
|
||||
virtual void WriteText(const wxString& text) = 0;
|
||||
virtual void AppendText(const wxString& text) = 0;
|
||||
|
||||
// insert the character which would have resulted from this key event,
|
||||
// return true if anything has been inserted
|
||||
virtual bool EmulateKeyPress(const wxKeyEvent& event);
|
||||
// styles handling
|
||||
// ---------------
|
||||
|
||||
// text control under some platforms supports the text styles: these
|
||||
// methods allow to apply the given text style to the given selection or to
|
||||
// set/get the style which will be used for all appended text
|
||||
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
|
||||
virtual bool GetStyle(long position, wxTextAttr& style);
|
||||
virtual bool SetDefaultStyle(const wxTextAttr& style);
|
||||
virtual const wxTextAttr& GetDefaultStyle() const;
|
||||
virtual bool SetStyle(long start, long end, const wxTextAttr& style) = 0;
|
||||
virtual bool GetStyle(long position, wxTextAttr& style) = 0;
|
||||
virtual bool SetDefaultStyle(const wxTextAttr& style) = 0;
|
||||
virtual const wxTextAttr& GetDefaultStyle() const { return m_defaultStyle; }
|
||||
|
||||
|
||||
// coordinates translation
|
||||
// -----------------------
|
||||
|
||||
// translate between the position (which is just an index in the text ctrl
|
||||
// considering all its contents as a single strings) and (x, y) coordinates
|
||||
@ -383,31 +342,60 @@ public:
|
||||
wxTextCoord *col,
|
||||
wxTextCoord *row) const;
|
||||
|
||||
// Clipboard operations
|
||||
virtual void Copy() = 0;
|
||||
virtual void Cut() = 0;
|
||||
virtual void Paste() = 0;
|
||||
protected:
|
||||
// implementation of loading/saving
|
||||
virtual bool DoLoadFile(const wxString& file, int fileType) = 0;
|
||||
virtual bool DoSaveFile(const wxString& file, int fileType) = 0;
|
||||
|
||||
virtual bool CanCopy() const;
|
||||
virtual bool CanCut() const;
|
||||
virtual bool CanPaste() const;
|
||||
|
||||
// Undo/redo
|
||||
virtual void Undo() = 0;
|
||||
virtual void Redo() = 0;
|
||||
// the name of the last file loaded with LoadFile() which will be used by
|
||||
// SaveFile() by default
|
||||
wxString m_filename;
|
||||
|
||||
virtual bool CanUndo() const = 0;
|
||||
virtual bool CanRedo() const = 0;
|
||||
// the text style which will be used for any new text added to the control
|
||||
wxTextAttr m_defaultStyle;
|
||||
|
||||
// Insertion point
|
||||
virtual void SetInsertionPoint(long pos) = 0;
|
||||
virtual void SetInsertionPointEnd() = 0;
|
||||
virtual long GetInsertionPoint() const = 0;
|
||||
virtual wxTextPos GetLastPosition() const = 0;
|
||||
|
||||
virtual void SetSelection(long from, long to) = 0;
|
||||
virtual void SelectAll();
|
||||
virtual void SetEditable(bool editable) = 0;
|
||||
DECLARE_NO_COPY_CLASS(wxTextAreaBase)
|
||||
};
|
||||
|
||||
// this class defines wxTextCtrl interface, wxTextCtrlBase actually implements
|
||||
// too much things because it derives from wxTextEntry and not wxTextEntryBase
|
||||
// and so any classes which "look like" wxTextCtrl (such as wxRichTextCtrl)
|
||||
// but don't need the (native) implementation bits from wxTextEntry should
|
||||
// actually derive from this one and not wxTextCtrlBase
|
||||
class WXDLLIMPEXP_CORE wxTextCtrlIface : public wxTextAreaBase,
|
||||
public wxTextEntryBase
|
||||
{
|
||||
public:
|
||||
wxTextCtrlIface() { }
|
||||
|
||||
private:
|
||||
DECLARE_NO_COPY_CLASS(wxTextCtrlIface)
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextCtrl: a single or multiple line text zone where user can edit text
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxTextCtrlBase : public wxControl,
|
||||
#if wxHAS_TEXT_WINDOW_STREAM
|
||||
public wxSTD streambuf,
|
||||
#endif
|
||||
public wxTextAreaBase,
|
||||
public wxTextEntry
|
||||
{
|
||||
public:
|
||||
// creation
|
||||
// --------
|
||||
|
||||
wxTextCtrlBase() { }
|
||||
virtual ~wxTextCtrlBase() { }
|
||||
|
||||
|
||||
// more readable flag testing methods
|
||||
bool IsSingleLine() const { return !HasFlag(wxTE_MULTILINE); }
|
||||
bool IsMultiLine() const { return !IsSingleLine(); }
|
||||
|
||||
// stream-like insertion operators: these are always available, whether we
|
||||
// were, or not, compiled with streambuf support
|
||||
@ -418,37 +406,49 @@ public:
|
||||
wxTextCtrl& operator<<(double d);
|
||||
wxTextCtrl& operator<<(const wxChar c);
|
||||
|
||||
// insert the character which would have resulted from this key event,
|
||||
// return true if anything has been inserted
|
||||
virtual bool EmulateKeyPress(const wxKeyEvent& event);
|
||||
|
||||
|
||||
// generate the wxEVT_COMMAND_TEXT_UPDATED event, like SetValue() does
|
||||
void SendTextUpdatedEvent();
|
||||
static void SendTextUpdatedEvent(wxWindow *win);
|
||||
void SendTextUpdatedEvent() { SendTextUpdatedEvent(this); }
|
||||
|
||||
// do the window-specific processing after processing the update event
|
||||
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event);
|
||||
|
||||
virtual bool ShouldInheritColours() const { return false; }
|
||||
|
||||
// work around the problem with having HitTest() both in wxControl and
|
||||
// wxTextAreaBase base classes
|
||||
virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const
|
||||
{
|
||||
return wxTextAreaBase::HitTest(pt, pos);
|
||||
}
|
||||
|
||||
virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
|
||||
wxTextCoord *col,
|
||||
wxTextCoord *row) const
|
||||
{
|
||||
return wxTextAreaBase::HitTest(pt, col, row);
|
||||
}
|
||||
|
||||
// we provide stubs for these functions as not all platforms have styles
|
||||
// support, but we really should leave them pure virtual here
|
||||
virtual bool SetStyle(long start, long end, const wxTextAttr& style);
|
||||
virtual bool GetStyle(long position, wxTextAttr& style);
|
||||
virtual bool SetDefaultStyle(const wxTextAttr& style);
|
||||
|
||||
protected:
|
||||
// override streambuf method
|
||||
#if wxHAS_TEXT_WINDOW_STREAM
|
||||
int overflow(int i);
|
||||
#endif // wxHAS_TEXT_WINDOW_STREAM
|
||||
|
||||
// flags for DoSetValue(): common part of SetValue() and ChangeValue() and
|
||||
// also used to implement WriteText() in wxMSW
|
||||
enum
|
||||
{
|
||||
SetValue_SendEvent = 1,
|
||||
SetValue_SelectionOnly = 2
|
||||
};
|
||||
virtual bool DoLoadFile(const wxString& file, int fileType);
|
||||
virtual bool DoSaveFile(const wxString& file, int fileType);
|
||||
|
||||
virtual void DoSetValue(const wxString& value, int flags = 0) = 0;
|
||||
|
||||
|
||||
// the name of the last file loaded with LoadFile() which will be used by
|
||||
// SaveFile() by default
|
||||
wxString m_filename;
|
||||
|
||||
// the text style which will be used for any new text added to the control
|
||||
wxTextAttr m_defaultStyle;
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxTextCtrlBase)
|
||||
DECLARE_ABSTRACT_CLASS(wxTextCtrlBase)
|
||||
|
191
include/wx/textentry.h
Normal file
191
include/wx/textentry.h
Normal file
@ -0,0 +1,191 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: wx/textentry.h
|
||||
// Purpose: declares wxTextEntry interface defining a simple text entry
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-09-24
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_TEXTENTRY_H_
|
||||
#define _WX_TEXTENTRY_H_
|
||||
|
||||
// wxTextPos is the position in the text (currently it's hardly used anywhere
|
||||
// and should probably be replaced with int anyhow)
|
||||
typedef long wxTextPos;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxTextEntryBase
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLIMPEXP_CORE wxTextEntryBase
|
||||
{
|
||||
public:
|
||||
wxTextEntryBase() { m_eventsBlock = 0; }
|
||||
virtual ~wxTextEntryBase() { }
|
||||
|
||||
|
||||
// accessing the value
|
||||
// -------------------
|
||||
|
||||
// SetValue() generates a text change event, ChangeValue() doesn't
|
||||
virtual void SetValue(const wxString& value)
|
||||
{ DoSetValue(value, SetValue_SendEvent); }
|
||||
virtual void ChangeValue(const wxString& value)
|
||||
{ DoSetValue(value, SetValue_NoEvent); }
|
||||
|
||||
// writing text inserts it at the current position replacing any current
|
||||
// selection, appending always inserts it at the end and doesn't remove any
|
||||
// existing text (but it will reset the selection if there is any)
|
||||
virtual void WriteText(const wxString& text) = 0;
|
||||
virtual void AppendText(const wxString& text);
|
||||
|
||||
virtual wxString GetValue() const = 0;
|
||||
virtual wxString GetRange(long from, long to) const;
|
||||
bool IsEmpty() const { return GetValue().empty(); }
|
||||
|
||||
|
||||
// editing operations
|
||||
// ------------------
|
||||
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to) = 0;
|
||||
virtual void Clear() { SetValue(wxString()); }
|
||||
|
||||
|
||||
// clipboard operations
|
||||
// --------------------
|
||||
|
||||
virtual void Copy() = 0;
|
||||
virtual void Cut() = 0;
|
||||
virtual void Paste() = 0;
|
||||
|
||||
virtual bool CanCopy() const;
|
||||
virtual bool CanCut() const;
|
||||
virtual bool CanPaste() const;
|
||||
|
||||
// undo/redo
|
||||
// ---------
|
||||
|
||||
virtual void Undo() = 0;
|
||||
virtual void Redo() = 0;
|
||||
|
||||
virtual bool CanUndo() const = 0;
|
||||
virtual bool CanRedo() const = 0;
|
||||
|
||||
|
||||
// insertion point
|
||||
// ---------------
|
||||
|
||||
// note that moving insertion point removes any current selection
|
||||
virtual void SetInsertionPoint(long pos) = 0;
|
||||
virtual void SetInsertionPointEnd() { SetInsertionPoint(-1); }
|
||||
virtual long GetInsertionPoint() const = 0;
|
||||
virtual long GetLastPosition() const = 0;
|
||||
|
||||
|
||||
// selection
|
||||
// ---------
|
||||
|
||||
virtual void SetSelection(long from, long to) = 0;
|
||||
virtual void SelectAll() { SetSelection(0, GetLastPosition()); }
|
||||
virtual void GetSelection(long *from, long *to) const = 0;
|
||||
bool HasSelection() const;
|
||||
virtual wxString GetStringSelection() const;
|
||||
|
||||
|
||||
// status
|
||||
// ------
|
||||
virtual bool IsEditable() const = 0;
|
||||
virtual void SetEditable(bool editable) = 0;
|
||||
|
||||
|
||||
// set the max number of characters which may be entered in a single line
|
||||
// text control
|
||||
virtual void SetMaxLength(unsigned long WXUNUSED(len)) { }
|
||||
|
||||
|
||||
protected:
|
||||
// flags for DoSetValue(): common part of SetValue() and ChangeValue() and
|
||||
// also used to implement WriteText() in wxMSW
|
||||
enum
|
||||
{
|
||||
SetValue_NoEvent = 0,
|
||||
SetValue_SendEvent = 1,
|
||||
SetValue_SelectionOnly = 2
|
||||
};
|
||||
|
||||
virtual void DoSetValue(const wxString& value, int flags);
|
||||
|
||||
// class which should be used to temporarily disable text change events
|
||||
//
|
||||
// if suppress argument in ctor is false, nothing is done
|
||||
class EventsSuppressor
|
||||
{
|
||||
public:
|
||||
EventsSuppressor(wxTextEntryBase *text, bool suppress = true)
|
||||
{
|
||||
m_suppress = suppress;
|
||||
if ( m_suppress )
|
||||
{
|
||||
m_text = text;
|
||||
m_text->SuppressTextChangedEvents();
|
||||
}
|
||||
}
|
||||
|
||||
~EventsSuppressor()
|
||||
{
|
||||
if ( m_suppress )
|
||||
m_text->ResumeTextChangedEvents();
|
||||
}
|
||||
|
||||
private:
|
||||
wxTextEntryBase *m_text;
|
||||
bool m_suppress;
|
||||
};
|
||||
|
||||
// return true if the events are currently not suppressed
|
||||
bool EventsAllowed() const { return m_eventsBlock == 0; }
|
||||
|
||||
private:
|
||||
// suppress or resume the text changed events generation: don't use these
|
||||
// functions directly, use EventsSuppressor class above instead
|
||||
void SuppressTextChangedEvents()
|
||||
{
|
||||
if ( !m_eventsBlock++ )
|
||||
EnableTextChangedEvents(false);
|
||||
}
|
||||
|
||||
void ResumeTextChangedEvents()
|
||||
{
|
||||
if ( !--m_eventsBlock )
|
||||
EnableTextChangedEvents(true);
|
||||
}
|
||||
|
||||
|
||||
// this must be overridden in the derived classes if our implementation of
|
||||
// SetValue() or Replace() is used to disable (and enable back) generation
|
||||
// of the text changed events
|
||||
//
|
||||
// initially the generation of the events is enabled
|
||||
virtual void EnableTextChangedEvents(bool WXUNUSED(enable)) { }
|
||||
|
||||
|
||||
friend class EventsSuppressor;
|
||||
|
||||
// if this counter is non-null, events are blocked
|
||||
unsigned m_eventsBlock;
|
||||
};
|
||||
|
||||
#ifdef __WXGTK20__
|
||||
#include "wx/gtk/textentry.h"
|
||||
#else
|
||||
// no platform-specific implementation of wxTextEntry yet
|
||||
class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase
|
||||
{
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // _WX_TEXTENTRY_H_
|
||||
|
@ -93,6 +93,7 @@ public:
|
||||
// wxTextCtrl methods
|
||||
virtual wxString GetValue() const;
|
||||
virtual void SetValue(const wxString& value);
|
||||
virtual void WriteText(const wxString& value);
|
||||
virtual void Copy();
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
@ -103,6 +104,7 @@ public:
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void SetSelection(long from, long to);
|
||||
virtual void GetSelection(long *from, long *to) const;
|
||||
virtual void SetEditable(bool editable);
|
||||
virtual bool IsEditable() const;
|
||||
|
||||
@ -125,6 +127,7 @@ public:
|
||||
virtual int FindString(const wxString& s, bool bCase = false) const;
|
||||
virtual void SetSelection(int n);
|
||||
virtual int GetSelection() const;
|
||||
virtual wxString GetStringSelection() const;
|
||||
|
||||
wxCONTROL_ITEMCONTAINER_CLIENTDATAOBJECT_RECAST
|
||||
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "wx/settings.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/timer.h"
|
||||
#include "wx/textctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/tooltip.h"
|
||||
|
@ -161,14 +161,14 @@ void wxTextAttr::operator= (const wxTextAttr& attr)
|
||||
bool wxTextCtrlBase::SetStyle(long WXUNUSED(start), long WXUNUSED(end),
|
||||
const wxTextAttr& WXUNUSED(style))
|
||||
{
|
||||
// to be implemented in derived TextCtrl classes
|
||||
// to be implemented in derived classes
|
||||
return false;
|
||||
}
|
||||
|
||||
// get the styling at the given position
|
||||
bool wxTextCtrlBase::GetStyle(long WXUNUSED(position), wxTextAttr& WXUNUSED(style))
|
||||
{
|
||||
// to be implemented in derived TextCtrl classes
|
||||
// to be implemented in derived classes
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -186,12 +186,6 @@ bool wxTextCtrlBase::SetDefaultStyle(const wxTextAttr& style)
|
||||
return true;
|
||||
}
|
||||
|
||||
// get default text attributes
|
||||
const wxTextAttr& wxTextCtrlBase::GetDefaultStyle() const
|
||||
{
|
||||
return m_defaultStyle;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// file IO functions
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -221,7 +215,7 @@ bool wxTextCtrlBase::DoLoadFile(const wxString& filename, int WXUNUSED(fileType)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTextCtrlBase::SaveFile(const wxString& filename, int fileType)
|
||||
bool wxTextAreaBase::SaveFile(const wxString& filename, int fileType)
|
||||
{
|
||||
wxString filenameToUse = filename.empty() ? m_filename : filename;
|
||||
if ( filenameToUse.empty() )
|
||||
@ -319,43 +313,14 @@ int wxTextCtrlBase::overflow(int c)
|
||||
|
||||
#endif // wxHAS_TEXT_WINDOW_STREAM
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// clipboard stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxTextCtrlBase::CanCopy() const
|
||||
{
|
||||
// can copy if there's a selection
|
||||
long from, to;
|
||||
GetSelection(&from, &to);
|
||||
return from != to;
|
||||
}
|
||||
|
||||
bool wxTextCtrlBase::CanCut() const
|
||||
{
|
||||
// can cut if there's a selection and if we're not read only
|
||||
return CanCopy() && IsEditable();
|
||||
}
|
||||
|
||||
bool wxTextCtrlBase::CanPaste() const
|
||||
{
|
||||
// can paste if we are not read only
|
||||
return IsEditable();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// emulating key presses
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __WIN32__
|
||||
// the generic version is unused in wxMSW
|
||||
bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& WXUNUSED(event))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#else // !__WIN32__
|
||||
bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
|
||||
{
|
||||
// we have a native implementation for Win32 and so don't need this one
|
||||
#ifndef __WIN32__
|
||||
wxChar ch = 0;
|
||||
int keycode = event.GetKeyCode();
|
||||
switch ( keycode )
|
||||
@ -447,37 +412,9 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif // !__WIN32__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// selection and ranges
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxTextCtrlBase::SelectAll()
|
||||
{
|
||||
SetSelection(0, GetLastPosition());
|
||||
}
|
||||
|
||||
wxString wxTextCtrlBase::GetStringSelection() const
|
||||
{
|
||||
long from, to;
|
||||
GetSelection(&from, &to);
|
||||
|
||||
return GetRange(from, to);
|
||||
}
|
||||
|
||||
wxString wxTextCtrlBase::GetRange(long from, long to) const
|
||||
{
|
||||
wxString sel;
|
||||
if ( from < to )
|
||||
{
|
||||
sel = GetValue().Mid(from, to - from);
|
||||
}
|
||||
|
||||
return sel;
|
||||
return false;
|
||||
}
|
||||
|
||||
// do the window-specific processing after processing the update event
|
||||
@ -501,7 +438,7 @@ void wxTextCtrlBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxTextCtrlHitTestResult
|
||||
wxTextCtrlBase::HitTest(const wxPoint& pt, wxTextCoord *x, wxTextCoord *y) const
|
||||
wxTextAreaBase::HitTest(const wxPoint& pt, wxTextCoord *x, wxTextCoord *y) const
|
||||
{
|
||||
// implement in terms of the other overload as the native ports typically
|
||||
// can get the position and not (x, y) pair directly (although wxUniv
|
||||
@ -518,8 +455,7 @@ wxTextCtrlBase::HitTest(const wxPoint& pt, wxTextCoord *x, wxTextCoord *y) const
|
||||
}
|
||||
|
||||
wxTextCtrlHitTestResult
|
||||
wxTextCtrlBase::HitTest(const wxPoint& WXUNUSED(pt),
|
||||
long * WXUNUSED(pos)) const
|
||||
wxTextAreaBase::HitTest(const wxPoint& WXUNUSED(pt), long * WXUNUSED(pos)) const
|
||||
{
|
||||
// not implemented
|
||||
return wxTE_HT_UNKNOWN;
|
||||
@ -529,18 +465,19 @@ wxTextCtrlBase::HitTest(const wxPoint& WXUNUSED(pt),
|
||||
// events
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxTextCtrlBase::SendTextUpdatedEvent()
|
||||
/* static */
|
||||
void wxTextCtrlBase::SendTextUpdatedEvent(wxWindow *win)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId());
|
||||
wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, win->GetId());
|
||||
|
||||
// do not do this as it could be very inefficient if the text control
|
||||
// contains a lot of text and we're not using ref-counted wxString
|
||||
// implementation -- instead, event.GetString() will query the control for
|
||||
// its current text if needed
|
||||
//event.SetString(GetValue());
|
||||
//event.SetString(win->GetValue());
|
||||
|
||||
event.SetEventObject(this);
|
||||
GetEventHandler()->ProcessEvent(event);
|
||||
event.SetEventObject(win);
|
||||
win->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
||||
#else // !wxUSE_TEXTCTRL
|
||||
|
103
src/common/textentrycmn.cpp
Normal file
103
src/common/textentrycmn.cpp
Normal file
@ -0,0 +1,103 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/common/textentrycmn.cpp
|
||||
// Purpose: wxTextEntryBase implementation
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-09-26
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_TEXTCTRL || wxUSE_COMBOBOX
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/textentry.h"
|
||||
|
||||
// ============================================================================
|
||||
// wxTextEntryBase implementation
|
||||
// ============================================================================
|
||||
|
||||
wxString wxTextEntryBase::GetRange(long from, long to) const
|
||||
{
|
||||
wxString sel;
|
||||
if ( from < to )
|
||||
{
|
||||
sel = GetValue().substr(from, to - from);
|
||||
}
|
||||
|
||||
return sel;
|
||||
}
|
||||
|
||||
void wxTextEntryBase::AppendText(const wxString& text)
|
||||
{
|
||||
SetInsertionPointEnd();
|
||||
WriteText(text);
|
||||
}
|
||||
|
||||
void wxTextEntryBase::DoSetValue(const wxString& value, int flags)
|
||||
{
|
||||
EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent));
|
||||
|
||||
SelectAll();
|
||||
WriteText(value);
|
||||
}
|
||||
|
||||
void wxTextEntryBase::Replace(long from, long to, const wxString& value)
|
||||
{
|
||||
{
|
||||
EventsSuppressor noevents(this);
|
||||
Remove(from, to);
|
||||
}
|
||||
|
||||
WriteText(value);
|
||||
}
|
||||
|
||||
bool wxTextEntryBase::HasSelection() const
|
||||
{
|
||||
long from, to;
|
||||
GetSelection(&from, &to);
|
||||
|
||||
return from < to;
|
||||
}
|
||||
|
||||
wxString wxTextEntryBase::GetStringSelection() const
|
||||
{
|
||||
long from, to;
|
||||
GetSelection(&from, &to);
|
||||
|
||||
return GetRange(from, to);
|
||||
}
|
||||
|
||||
bool wxTextEntryBase::CanCopy() const
|
||||
{
|
||||
return HasSelection();
|
||||
}
|
||||
|
||||
bool wxTextEntryBase::CanCut() const
|
||||
{
|
||||
return CanCopy() && IsEditable();
|
||||
}
|
||||
|
||||
bool wxTextEntryBase::CanPaste() const
|
||||
{
|
||||
return IsEditable();
|
||||
}
|
||||
|
||||
#endif // wxUSE_TEXTCTRL || wxUSE_COMBOBOX
|
@ -33,6 +33,7 @@
|
||||
#include "wx/dcclient.h"
|
||||
#include "wx/settings.h"
|
||||
#include "wx/dialog.h"
|
||||
#include "wx/textctrl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/combo.h"
|
||||
|
@ -134,6 +134,13 @@ public:
|
||||
return m_descriptiveText;
|
||||
}
|
||||
|
||||
|
||||
// provide access to the base class protected methods to wxSearchCtrl which
|
||||
// needs to forward to them
|
||||
using wxTextCtrl::DoSetValue;
|
||||
using wxTextCtrl::DoLoadFile;
|
||||
using wxTextCtrl::DoSaveFile;
|
||||
|
||||
protected:
|
||||
void OnText(wxCommandEvent& eventText)
|
||||
{
|
||||
@ -334,7 +341,8 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
#else
|
||||
style |= wxBORDER_SIMPLE;
|
||||
#endif
|
||||
if ( !wxTextCtrlBase::Create(parent, id, pos, size, style, validator, name) )
|
||||
if ( !wxSearchCtrlBaseBaseClass::Create(parent, id, pos, size,
|
||||
style, validator, name) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -897,9 +905,17 @@ wxTextCtrl& operator<<(const wxChar c);
|
||||
|
||||
void wxSearchCtrl::DoSetValue(const wxString& value, int flags)
|
||||
{
|
||||
m_text->ChangeValue( value );
|
||||
if ( flags & SetValue_SendEvent )
|
||||
SendTextUpdatedEvent();
|
||||
m_text->DoSetValue(value, flags);
|
||||
}
|
||||
|
||||
bool wxSearchCtrl::DoLoadFile(const wxString& file, int fileType)
|
||||
{
|
||||
return m_text->DoLoadFile(file, fileType);
|
||||
}
|
||||
|
||||
bool wxSearchCtrl::DoSaveFile(const wxString& file, int fileType)
|
||||
{
|
||||
return m_text->DoSaveFile(file, fileType);
|
||||
}
|
||||
|
||||
// do the window-specific processing after processing the update event
|
||||
|
@ -352,6 +352,16 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
|
||||
return true;
|
||||
}
|
||||
|
||||
GtkEditable *wxComboBox::GetEditable() const
|
||||
{
|
||||
#ifdef __WXGTK24__
|
||||
if ( !gtk_check_version(2,4,0) )
|
||||
return GTK_EDITABLE( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
return GTK_EDITABLE( GTK_COMBO(m_widget)->entry );
|
||||
}
|
||||
|
||||
wxComboBox::~wxComboBox()
|
||||
{
|
||||
Clear();
|
||||
@ -710,39 +720,6 @@ wxString wxComboBox::GetString(unsigned int n) const
|
||||
return str;
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetStringSelection() const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, wxEmptyString, wxT("invalid combobox") );
|
||||
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
{
|
||||
GtkComboBox* combobox = GTK_COMBO_BOX( m_widget );
|
||||
int sel = gtk_combo_box_get_active( combobox );
|
||||
if (sel == -1)
|
||||
return wxEmptyString;
|
||||
return GetString(sel);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
GtkWidget *list = GTK_COMBO(m_widget)->list;
|
||||
|
||||
GList *selection = GTK_LIST(list)->selection;
|
||||
if (selection)
|
||||
{
|
||||
GtkBin *bin = GTK_BIN( selection->data );
|
||||
GtkLabel *label = GTK_LABEL( bin->child );
|
||||
wxString tmp( wxGTK_CONV_BACK( gtk_label_get_text(label) ) );
|
||||
return tmp;
|
||||
}
|
||||
|
||||
wxFAIL_MSG( wxT("wxComboBox: no selection") );
|
||||
}
|
||||
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
unsigned int wxComboBox::GetCount() const
|
||||
{
|
||||
wxCHECK_MSG( m_widget != NULL, 0, wxT("invalid combobox") );
|
||||
@ -801,271 +778,6 @@ void wxComboBox::SetSelection( int n )
|
||||
EnableEvents();
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetValue() const
|
||||
{
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
wxString tmp( wxGTK_CONV_BACK( gtk_entry_get_text( entry ) ) );
|
||||
|
||||
#if 0
|
||||
for (int i = 0; i < wxStrlen(tmp.c_str()) +1; i++)
|
||||
{
|
||||
wxChar c = tmp[i];
|
||||
printf( "%d ", (int) (c) );
|
||||
}
|
||||
printf( "\n" );
|
||||
#endif
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
void wxComboBox::SetValue( const wxString& value )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
wxString tmp;
|
||||
if (!value.IsNull()) tmp = value;
|
||||
|
||||
DisableEvents();
|
||||
gtk_entry_set_text( entry, wxGTK_CONV( tmp ) );
|
||||
EnableEvents();
|
||||
|
||||
InvalidateBestSize();
|
||||
}
|
||||
|
||||
void wxComboBox::Copy()
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
gtk_editable_copy_clipboard(GTK_EDITABLE(entry));
|
||||
}
|
||||
|
||||
void wxComboBox::Cut()
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
gtk_editable_cut_clipboard(GTK_EDITABLE(entry));
|
||||
}
|
||||
|
||||
void wxComboBox::Paste()
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
gtk_editable_paste_clipboard(GTK_EDITABLE(entry));
|
||||
}
|
||||
|
||||
void wxComboBox::Undo()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::Redo()
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
void wxComboBox::SelectAll()
|
||||
{
|
||||
SetSelection(0, GetLastPosition());
|
||||
}
|
||||
|
||||
bool wxComboBox::CanUndo() const
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxComboBox::CanRedo() const
|
||||
{
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxComboBox::HasSelection() const
|
||||
{
|
||||
long from, to;
|
||||
GetSelection(&from, &to);
|
||||
return from != to;
|
||||
}
|
||||
|
||||
bool wxComboBox::CanCopy() const
|
||||
{
|
||||
// Can copy if there's a selection
|
||||
return HasSelection();
|
||||
}
|
||||
|
||||
bool wxComboBox::CanCut() const
|
||||
{
|
||||
return CanCopy() && IsEditable();
|
||||
}
|
||||
|
||||
bool wxComboBox::CanPaste() const
|
||||
{
|
||||
// TODO: check for text on the clipboard
|
||||
return IsEditable() ;
|
||||
}
|
||||
|
||||
bool wxComboBox::IsEditable() const
|
||||
{
|
||||
return !HasFlag(wxCB_READONLY);
|
||||
}
|
||||
|
||||
|
||||
void wxComboBox::SetInsertionPoint( long pos )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
if ( pos == GetLastPosition() )
|
||||
pos = -1;
|
||||
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
gtk_entry_set_position( entry, (int)pos );
|
||||
}
|
||||
|
||||
long wxComboBox::GetInsertionPoint() const
|
||||
{
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
return (long) gtk_editable_get_position(GTK_EDITABLE(entry));
|
||||
}
|
||||
|
||||
wxTextPos wxComboBox::GetLastPosition() const
|
||||
{
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
int pos = entry->text_length;
|
||||
return (long) pos-1;
|
||||
}
|
||||
|
||||
void wxComboBox::Replace( long from, long to, const wxString& value )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid combobox") );
|
||||
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
|
||||
if (value.IsNull()) return;
|
||||
gint pos = (gint)to;
|
||||
|
||||
// FIXME-UTF8: wouldn't be needed if utf8_str() always returned a buffer
|
||||
#if wxUSE_UNICODE_UTF8
|
||||
const char *utf8 = value.utf8_str();
|
||||
#else
|
||||
wxCharBuffer buffer(value.utf8_str());
|
||||
const char *utf8 = buffer;
|
||||
#endif
|
||||
gtk_editable_insert_text(GTK_EDITABLE(entry), utf8, strlen(utf8), &pos);
|
||||
}
|
||||
|
||||
void wxComboBox::SetSelection( long from, long to )
|
||||
{
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
gtk_editable_select_region( GTK_EDITABLE(entry), (gint)from, (gint)to );
|
||||
}
|
||||
|
||||
void wxComboBox::GetSelection( long* from, long* to ) const
|
||||
{
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
if (IsEditable())
|
||||
{
|
||||
GtkEditable *editable = GTK_EDITABLE(entry);
|
||||
gint start, end;
|
||||
gtk_editable_get_selection_bounds(editable, & start, & end);
|
||||
*from = start;
|
||||
*to = end;
|
||||
}
|
||||
}
|
||||
|
||||
void wxComboBox::SetEditable( bool editable )
|
||||
{
|
||||
GtkEntry *entry = NULL;
|
||||
#ifdef __WXGTK24__
|
||||
if (!gtk_check_version(2,4,0))
|
||||
entry = GTK_ENTRY( GTK_BIN(m_widget)->child );
|
||||
else
|
||||
#endif
|
||||
entry = GTK_ENTRY( GTK_COMBO(m_widget)->entry );
|
||||
|
||||
gtk_entry_set_editable( GTK_ENTRY(entry), editable );
|
||||
}
|
||||
|
||||
void wxComboBox::OnChar( wxKeyEvent &event )
|
||||
{
|
||||
if ( event.GetKeyCode() == WXK_RETURN )
|
||||
@ -1346,4 +1058,4 @@ void wxComboBox::OnUpdateSelectAll(wxUpdateUIEvent& event)
|
||||
event.Enable(GetLastPosition() > 0);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // wxUSE_COMBOBOX
|
||||
|
@ -297,45 +297,6 @@ static void wxGtkTextInsert(GtkWidget *text,
|
||||
wxGtkTextApplyTagsFromAttr(text, text_buffer, attr, &start, &iter);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// "insert_text" for GtkEntry
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
static void
|
||||
gtk_insert_text_callback(GtkEditable *editable,
|
||||
const gchar *new_text,
|
||||
gint new_text_length,
|
||||
gint *position,
|
||||
wxTextCtrl *win)
|
||||
{
|
||||
// we should only be called if we have a max len limit at all
|
||||
GtkEntry *entry = GTK_ENTRY (editable);
|
||||
|
||||
wxCHECK_RET( entry->text_max_length, _T("shouldn't be called") );
|
||||
|
||||
// check that we don't overflow the max length limit
|
||||
//
|
||||
// FIXME: this doesn't work when we paste a string which is going to be
|
||||
// truncated
|
||||
if ( entry->text_length == entry->text_max_length )
|
||||
{
|
||||
// we don't need to run the base class version at all
|
||||
g_signal_stop_emission_by_name (editable, "insert_text");
|
||||
|
||||
// remember that the next changed signal is to be ignored to avoid
|
||||
// generating a dummy wxEVT_COMMAND_TEXT_UPDATED event
|
||||
win->IgnoreNextTextUpdate();
|
||||
|
||||
// and generate the correct one ourselves
|
||||
wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId());
|
||||
event.SetEventObject(win);
|
||||
event.SetString(win->GetValue());
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Implementation of wxTE_AUTO_URL for wxGTK2 by Mart Raudsepp,
|
||||
|
||||
extern "C" {
|
||||
@ -824,7 +785,7 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
au_check_range(&start, &end);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
g_signal_connect (m_text, "copy-clipboard",
|
||||
G_CALLBACK (gtk_copy_clipboard_callback), this);
|
||||
g_signal_connect (m_text, "cut-clipboard",
|
||||
@ -837,6 +798,13 @@ bool wxTextCtrl::Create( wxWindow *parent,
|
||||
return true;
|
||||
}
|
||||
|
||||
GtkEditable *wxTextCtrl::GetEditable() const
|
||||
{
|
||||
wxCHECK_MSG( IsSingleLine(), NULL, "shouldn't be called for multiline" );
|
||||
|
||||
return GTK_EDITABLE(m_text);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// flags handling
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -961,10 +929,9 @@ wxString wxTextCtrl::GetValue() const
|
||||
|
||||
return wxGTK_CONV_BACK(text);
|
||||
}
|
||||
else
|
||||
else // single line
|
||||
{
|
||||
const gchar *text = gtk_entry_get_text( GTK_ENTRY(m_text) );
|
||||
return wxGTK_CONV_BACK(text);
|
||||
return wxTextEntry::GetValue();
|
||||
}
|
||||
}
|
||||
|
||||
@ -991,7 +958,7 @@ bool wxTextCtrl::IsEmpty() const
|
||||
if ( IsMultiLine() )
|
||||
return gtk_text_buffer_get_char_count(m_buffer) == 0;
|
||||
|
||||
return wxTextCtrlBase::IsEmpty();
|
||||
return wxTextEntry::IsEmpty();
|
||||
}
|
||||
|
||||
void wxTextCtrl::DoSetValue( const wxString &value, int flags )
|
||||
@ -1000,6 +967,12 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags )
|
||||
|
||||
m_modified = false;
|
||||
|
||||
if ( !IsMultiLine() )
|
||||
{
|
||||
wxTextEntry::DoSetValue(value, flags);
|
||||
return;
|
||||
}
|
||||
|
||||
wxFontEncoding enc = m_defaultStyle.HasFont()
|
||||
? m_defaultStyle.GetFont().GetEncoding()
|
||||
: wxFONTENCODING_SYSTEM;
|
||||
@ -1017,33 +990,24 @@ void wxTextCtrl::DoSetValue( const wxString &value, int flags )
|
||||
|
||||
if ( !(flags & SetValue_SendEvent) )
|
||||
{
|
||||
g_signal_handlers_block_by_func(GetTextObject(),
|
||||
(gpointer)gtk_text_changed_callback, this);
|
||||
EnableTextChangedEvents(false);
|
||||
}
|
||||
|
||||
if ( IsMultiLine() )
|
||||
gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) );
|
||||
|
||||
if ( !m_defaultStyle.IsDefault() )
|
||||
{
|
||||
gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) );
|
||||
|
||||
if ( !m_defaultStyle.IsDefault() )
|
||||
{
|
||||
GtkTextIter start, end;
|
||||
gtk_text_buffer_get_bounds( m_buffer, &start, &end );
|
||||
wxGtkTextApplyTagsFromAttr(m_widget, m_buffer, m_defaultStyle,
|
||||
&start, &end);
|
||||
}
|
||||
}
|
||||
else // single line
|
||||
{
|
||||
gtk_entry_set_text( GTK_ENTRY(m_text), buffer );
|
||||
GtkTextIter start, end;
|
||||
gtk_text_buffer_get_bounds( m_buffer, &start, &end );
|
||||
wxGtkTextApplyTagsFromAttr(m_widget, m_buffer, m_defaultStyle,
|
||||
&start, &end);
|
||||
}
|
||||
|
||||
if ( !(flags & SetValue_SendEvent) )
|
||||
{
|
||||
g_signal_handlers_unblock_by_func(GetTextObject(),
|
||||
(gpointer)gtk_text_changed_callback, this);
|
||||
EnableTextChangedEvents(true);
|
||||
}
|
||||
|
||||
|
||||
// This was added after discussion on the list
|
||||
SetInsertionPoint(0);
|
||||
}
|
||||
@ -1052,8 +1016,14 @@ void wxTextCtrl::WriteText( const wxString &text )
|
||||
{
|
||||
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
|
||||
|
||||
if ( text.empty() )
|
||||
// we're changing the text programmatically
|
||||
DontMarkDirtyOnNextChange();
|
||||
|
||||
if ( !IsMultiLine() )
|
||||
{
|
||||
wxTextEntry::WriteText(text);
|
||||
return;
|
||||
}
|
||||
|
||||
// check if we have a specific style for the current position
|
||||
wxFontEncoding enc = wxFONTENCODING_SYSTEM;
|
||||
@ -1076,49 +1046,24 @@ void wxTextCtrl::WriteText( const wxString &text )
|
||||
return;
|
||||
}
|
||||
|
||||
// we're changing the text programmatically
|
||||
DontMarkDirtyOnNextChange();
|
||||
// First remove the selection if there is one
|
||||
// TODO: Is there an easier GTK specific way to do this?
|
||||
long from, to;
|
||||
GetSelection(&from, &to);
|
||||
if (from != to)
|
||||
Remove(from, to);
|
||||
|
||||
if ( IsMultiLine() )
|
||||
// Insert the text
|
||||
wxGtkTextInsert( m_text, m_buffer, m_defaultStyle, buffer );
|
||||
|
||||
GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment( GTK_SCROLLED_WINDOW(m_widget) );
|
||||
// Scroll to cursor, but only if scrollbar thumb is at the very bottom
|
||||
// won't work when frozen, text view is not using m_buffer then
|
||||
if (!IsFrozen() && wxIsSameDouble(adj->value, adj->upper - adj->page_size))
|
||||
{
|
||||
// First remove the selection if there is one
|
||||
// TODO: Is there an easier GTK specific way to do this?
|
||||
long from, to;
|
||||
GetSelection(&from, &to);
|
||||
if (from != to)
|
||||
Remove(from, to);
|
||||
|
||||
// Insert the text
|
||||
wxGtkTextInsert( m_text, m_buffer, m_defaultStyle, buffer );
|
||||
|
||||
GtkAdjustment *adj = gtk_scrolled_window_get_vadjustment( GTK_SCROLLED_WINDOW(m_widget) );
|
||||
// Scroll to cursor, but only if scrollbar thumb is at the very bottom
|
||||
// won't work when frozen, text view is not using m_buffer then
|
||||
if (!IsFrozen() && wxIsSameDouble(adj->value, adj->upper - adj->page_size))
|
||||
{
|
||||
gtk_text_view_scroll_to_mark( GTK_TEXT_VIEW(m_text),
|
||||
gtk_text_buffer_get_insert( m_buffer ), 0.0, FALSE, 0.0, 1.0 );
|
||||
}
|
||||
gtk_text_view_scroll_to_mark( GTK_TEXT_VIEW(m_text),
|
||||
gtk_text_buffer_get_insert( m_buffer ), 0.0, FALSE, 0.0, 1.0 );
|
||||
}
|
||||
else // single line
|
||||
{
|
||||
// First remove the selection if there is one
|
||||
gtk_editable_delete_selection( GTK_EDITABLE(m_text) );
|
||||
|
||||
// This moves the cursor pos to behind the inserted text.
|
||||
gint len = gtk_editable_get_position(GTK_EDITABLE(m_text));
|
||||
|
||||
gtk_editable_insert_text( GTK_EDITABLE(m_text), buffer, strlen(buffer), &len );
|
||||
|
||||
// Bring entry's cursor uptodate.
|
||||
gtk_editable_set_position( GTK_EDITABLE(m_text), len );
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextCtrl::AppendText( const wxString &text )
|
||||
{
|
||||
SetInsertionPointEnd();
|
||||
WriteText( text );
|
||||
}
|
||||
|
||||
wxString wxTextCtrl::GetLineText( long lineNo ) const
|
||||
@ -1251,18 +1196,12 @@ void wxTextCtrl::SetInsertionPoint( long pos )
|
||||
else
|
||||
gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(m_text), mark);
|
||||
}
|
||||
else
|
||||
else // single line
|
||||
{
|
||||
// FIXME: Is the editable's cursor really uptodate without double set_position in GTK2?
|
||||
gtk_editable_set_position(GTK_EDITABLE(m_text), int(pos));
|
||||
wxTextEntry::SetInsertionPoint(pos);
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetInsertionPointEnd()
|
||||
{
|
||||
SetInsertionPoint(-1);
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetEditable( bool editable )
|
||||
{
|
||||
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
|
||||
@ -1271,9 +1210,9 @@ void wxTextCtrl::SetEditable( bool editable )
|
||||
{
|
||||
gtk_text_view_set_editable( GTK_TEXT_VIEW(m_text), editable );
|
||||
}
|
||||
else
|
||||
else // single line
|
||||
{
|
||||
gtk_editable_set_editable( GTK_EDITABLE(m_text), editable );
|
||||
wxTextEntry::SetEditable(editable);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1321,9 +1260,23 @@ void wxTextCtrl::DiscardEdits()
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// max text length support
|
||||
// event handling
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxTextCtrl::EnableTextChangedEvents(bool enable)
|
||||
{
|
||||
if ( enable )
|
||||
{
|
||||
g_signal_handlers_unblock_by_func(GetTextObject(),
|
||||
(gpointer)gtk_text_changed_callback, this);
|
||||
}
|
||||
else // disable events
|
||||
{
|
||||
g_signal_handlers_block_by_func(GetTextObject(),
|
||||
(gpointer)gtk_text_changed_callback, this);
|
||||
}
|
||||
}
|
||||
|
||||
bool wxTextCtrl::IgnoreTextUpdate()
|
||||
{
|
||||
if ( m_countUpdatesToIgnore > 0 )
|
||||
@ -1348,34 +1301,6 @@ bool wxTextCtrl::MarkDirtyOnChange()
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetMaxLength(unsigned long len)
|
||||
{
|
||||
if ( !HasFlag(wxTE_MULTILINE) )
|
||||
{
|
||||
gtk_entry_set_max_length(GTK_ENTRY(m_text), len);
|
||||
|
||||
// there is a bug in GTK+ 1.2.x: "changed" signal is emitted even if
|
||||
// we had tried to enter more text than allowed by max text length and
|
||||
// the text wasn't really changed
|
||||
//
|
||||
// to detect this and generate TEXT_MAXLEN event instead of
|
||||
// TEXT_CHANGED one in this case we also catch "insert_text" signal
|
||||
//
|
||||
// when max len is set to 0 we disconnect our handler as it means that
|
||||
// we shouldn't check anything any more
|
||||
if ( len )
|
||||
{
|
||||
g_signal_connect (m_text, "insert_text",
|
||||
G_CALLBACK (gtk_insert_text_callback), this);
|
||||
}
|
||||
else // no checking
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (m_text,
|
||||
(gpointer) gtk_insert_text_callback, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextCtrl::SetSelection( long from, long to )
|
||||
{
|
||||
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
|
||||
@ -1395,9 +1320,9 @@ void wxTextCtrl::SetSelection( long from, long to )
|
||||
gtk_text_buffer_place_cursor( m_buffer, &toi );
|
||||
gtk_text_buffer_move_mark_by_name( m_buffer, "selection_bound", &fromi );
|
||||
}
|
||||
else
|
||||
else // single line
|
||||
{
|
||||
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
|
||||
wxTextEntry::SetSelection(from, to);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1461,7 +1386,7 @@ long wxTextCtrl::GetInsertionPoint() const
|
||||
}
|
||||
else
|
||||
{
|
||||
return (long) gtk_editable_get_position(GTK_EDITABLE(m_text));
|
||||
return wxTextEntry::GetInsertionPoint();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1478,9 +1403,9 @@ wxTextPos wxTextCtrl::GetLastPosition() const
|
||||
|
||||
pos = gtk_text_iter_get_offset( &end );
|
||||
}
|
||||
else
|
||||
else // single line
|
||||
{
|
||||
pos = GTK_ENTRY(m_text)->text_length;
|
||||
pos = wxTextEntry::GetLastPosition();
|
||||
}
|
||||
|
||||
return (long)pos;
|
||||
@ -1499,19 +1424,8 @@ void wxTextCtrl::Remove( long from, long to )
|
||||
gtk_text_buffer_delete( m_buffer, &fromi, &toi );
|
||||
}
|
||||
else // single line
|
||||
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
|
||||
}
|
||||
|
||||
void wxTextCtrl::Replace( long from, long to, const wxString &value )
|
||||
{
|
||||
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
|
||||
|
||||
Remove( from, to );
|
||||
|
||||
if (!value.empty())
|
||||
{
|
||||
SetInsertionPoint( from );
|
||||
WriteText( value );
|
||||
wxTextEntry::Remove(from, to);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1522,7 +1436,7 @@ void wxTextCtrl::Cut()
|
||||
if ( IsMultiLine() )
|
||||
g_signal_emit_by_name (m_text, "cut-clipboard");
|
||||
else
|
||||
gtk_editable_cut_clipboard(GTK_EDITABLE(m_text));
|
||||
wxTextEntry::Cut();
|
||||
}
|
||||
|
||||
void wxTextCtrl::Copy()
|
||||
@ -1532,7 +1446,7 @@ void wxTextCtrl::Copy()
|
||||
if ( IsMultiLine() )
|
||||
g_signal_emit_by_name (m_text, "copy-clipboard");
|
||||
else
|
||||
gtk_editable_copy_clipboard(GTK_EDITABLE(m_text));
|
||||
wxTextEntry::Copy();
|
||||
}
|
||||
|
||||
void wxTextCtrl::Paste()
|
||||
@ -1542,34 +1456,7 @@ void wxTextCtrl::Paste()
|
||||
if ( IsMultiLine() )
|
||||
g_signal_emit_by_name (m_text, "paste-clipboard");
|
||||
else
|
||||
gtk_editable_paste_clipboard(GTK_EDITABLE(m_text));
|
||||
}
|
||||
|
||||
// Undo/redo
|
||||
void wxTextCtrl::Undo()
|
||||
{
|
||||
// TODO
|
||||
wxFAIL_MSG( wxT("wxTextCtrl::Undo not implemented") );
|
||||
}
|
||||
|
||||
void wxTextCtrl::Redo()
|
||||
{
|
||||
// TODO
|
||||
wxFAIL_MSG( wxT("wxTextCtrl::Redo not implemented") );
|
||||
}
|
||||
|
||||
bool wxTextCtrl::CanUndo() const
|
||||
{
|
||||
// TODO
|
||||
//wxFAIL_MSG( wxT("wxTextCtrl::CanUndo not implemented") );
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTextCtrl::CanRedo() const
|
||||
{
|
||||
// TODO
|
||||
//wxFAIL_MSG( wxT("wxTextCtrl::CanRedo not implemented") );
|
||||
return false;
|
||||
wxTextEntry::Paste();
|
||||
}
|
||||
|
||||
// If the return values from and to are the same, there is no
|
||||
@ -1578,39 +1465,33 @@ void wxTextCtrl::GetSelection(long* fromOut, long* toOut) const
|
||||
{
|
||||
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
|
||||
|
||||
gint from = -1;
|
||||
gint to = -1;
|
||||
bool haveSelection = false;
|
||||
if ( !IsMultiLine() )
|
||||
{
|
||||
wxTextEntry::GetSelection(fromOut, toOut);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( IsMultiLine() )
|
||||
{
|
||||
GtkTextIter ifrom, ito;
|
||||
if ( gtk_text_buffer_get_selection_bounds(m_buffer, &ifrom, &ito) )
|
||||
{
|
||||
haveSelection = true;
|
||||
from = gtk_text_iter_get_offset(&ifrom);
|
||||
to = gtk_text_iter_get_offset(&ito);
|
||||
}
|
||||
}
|
||||
else // not multi-line
|
||||
{
|
||||
if ( gtk_editable_get_selection_bounds( GTK_EDITABLE(m_text),
|
||||
&from, &to) )
|
||||
{
|
||||
haveSelection = true;
|
||||
}
|
||||
}
|
||||
gint from, to;
|
||||
|
||||
if (! haveSelection )
|
||||
from = to = GetInsertionPoint();
|
||||
GtkTextIter ifrom, ito;
|
||||
if ( gtk_text_buffer_get_selection_bounds(m_buffer, &ifrom, &ito) )
|
||||
{
|
||||
from = gtk_text_iter_get_offset(&ifrom);
|
||||
to = gtk_text_iter_get_offset(&ito);
|
||||
|
||||
if ( from > to )
|
||||
{
|
||||
// exchange them to be compatible with wxMSW
|
||||
gint tmp = from;
|
||||
from = to;
|
||||
to = tmp;
|
||||
}
|
||||
if ( from > to )
|
||||
{
|
||||
// exchange them to be compatible with wxMSW
|
||||
gint tmp = from;
|
||||
from = to;
|
||||
to = tmp;
|
||||
}
|
||||
}
|
||||
else // no selection
|
||||
{
|
||||
from =
|
||||
to = GetInsertionPoint();
|
||||
}
|
||||
|
||||
if ( fromOut )
|
||||
*fromOut = from;
|
||||
@ -1629,7 +1510,7 @@ bool wxTextCtrl::IsEditable() const
|
||||
}
|
||||
else
|
||||
{
|
||||
return gtk_editable_get_editable(GTK_EDITABLE(m_text));
|
||||
return wxTextEntry::IsEditable();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1638,11 +1519,6 @@ bool wxTextCtrl::IsModified() const
|
||||
return m_modified;
|
||||
}
|
||||
|
||||
void wxTextCtrl::Clear()
|
||||
{
|
||||
SetValue( wxEmptyString );
|
||||
}
|
||||
|
||||
void wxTextCtrl::OnChar( wxKeyEvent &key_event )
|
||||
{
|
||||
wxCHECK_RET( m_text != NULL, wxT("invalid text ctrl") );
|
||||
|
284
src/gtk/textentry.cpp
Normal file
284
src/gtk/textentry.cpp
Normal file
@ -0,0 +1,284 @@
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Name: src/gtk/textentry.cpp
|
||||
// Purpose: wxTextEntry implementation for wxGTK
|
||||
// Author: Vadim Zeitlin
|
||||
// Created: 2007-09-24
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
|
||||
// Licence: wxWindows licence
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// ============================================================================
|
||||
// declarations
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// for compilers that support precompilation, includes "wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#endif //WX_PRECOMP
|
||||
|
||||
#include "wx/textentry.h"
|
||||
|
||||
#include "wx/gtk/private.h"
|
||||
|
||||
// ============================================================================
|
||||
// signal handlers implementation
|
||||
// ============================================================================
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// "insert_text" handler for GtkEntry
|
||||
static void
|
||||
wx_gtk_insert_text_callback(GtkEditable *editable,
|
||||
const gchar *new_text,
|
||||
gint new_text_length,
|
||||
gint *position,
|
||||
wxTextEntry *text)
|
||||
{
|
||||
// we should only be called if we have a max len limit at all
|
||||
GtkEntry *entry = GTK_ENTRY (editable);
|
||||
|
||||
wxCHECK_RET( entry->text_max_length, _T("shouldn't be called") );
|
||||
|
||||
// check that we don't overflow the max length limit
|
||||
//
|
||||
// FIXME: this doesn't work when we paste a string which is going to be
|
||||
// truncated
|
||||
if ( entry->text_length == entry->text_max_length )
|
||||
{
|
||||
// we don't need to run the base class version at all
|
||||
g_signal_stop_emission_by_name (editable, "insert_text");
|
||||
|
||||
text->SendMaxLenEvent();
|
||||
}
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
// ============================================================================
|
||||
// wxTextEntry implementation
|
||||
// ============================================================================
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// text operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxTextEntry::WriteText(const wxString& value)
|
||||
{
|
||||
GtkEditable * const edit = GetEditable();
|
||||
|
||||
// remove the selection if there is one and suppress the text change event
|
||||
// generated by this: we only want to generate one event for this change,
|
||||
// not two
|
||||
{
|
||||
EventsSuppressor noevents(this);
|
||||
gtk_editable_delete_selection(edit);
|
||||
}
|
||||
|
||||
// insert new text at the cursor position
|
||||
gint len = gtk_editable_get_position(edit);
|
||||
gtk_editable_insert_text
|
||||
(
|
||||
edit,
|
||||
wxGTK_CONV_FONT(value, GetEditableWindow()->GetFont()),
|
||||
-1, // text: length: compute it using strlen()
|
||||
&len // will be updated to position after the text end
|
||||
);
|
||||
|
||||
// and move cursor to the end of new text
|
||||
gtk_editable_set_position(edit, len);
|
||||
}
|
||||
|
||||
wxString wxTextEntry::GetValue() const
|
||||
{
|
||||
const wxGtkString value(gtk_editable_get_chars(GetEditable(), 0, -1));
|
||||
|
||||
return wxGTK_CONV_BACK_FONT(value, GetEditableWindow()->GetFont());
|
||||
}
|
||||
|
||||
void wxTextEntry::Remove(long from, long to)
|
||||
{
|
||||
gtk_editable_delete_text(GetEditable(), from, to);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// clipboard operations
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxTextEntry::Copy()
|
||||
{
|
||||
gtk_editable_copy_clipboard(GetEditable());
|
||||
}
|
||||
|
||||
void wxTextEntry::Cut()
|
||||
{
|
||||
gtk_editable_cut_clipboard(GetEditable());
|
||||
}
|
||||
|
||||
void wxTextEntry::Paste()
|
||||
{
|
||||
gtk_editable_paste_clipboard(GetEditable());
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// undo/redo
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxTextEntry::Undo()
|
||||
{
|
||||
// TODO: not implemented
|
||||
}
|
||||
|
||||
void wxTextEntry::Redo()
|
||||
{
|
||||
// TODO: not implemented
|
||||
}
|
||||
|
||||
bool wxTextEntry::CanUndo() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wxTextEntry::CanRedo() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// insertion point
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxTextEntry::SetInsertionPoint(long pos)
|
||||
{
|
||||
gtk_editable_set_position(GetEditable(), pos);
|
||||
}
|
||||
|
||||
long wxTextEntry::GetInsertionPoint() const
|
||||
{
|
||||
return gtk_editable_get_position(GetEditable());
|
||||
}
|
||||
|
||||
long wxTextEntry::GetLastPosition() const
|
||||
{
|
||||
// this can't be implemented for arbitrary GtkEditable so only do it for
|
||||
// GtkEntries
|
||||
GtkEntry * const entry = GTK_ENTRY(GetEditable());
|
||||
|
||||
return entry ? entry->text_length : - 1;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// selection
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxTextEntry::SetSelection(long from, long to)
|
||||
{
|
||||
gtk_editable_select_region(GetEditable(), from, to);
|
||||
}
|
||||
|
||||
void wxTextEntry::GetSelection(long *from, long *to) const
|
||||
{
|
||||
gint start, end;
|
||||
if ( gtk_editable_get_selection_bounds(GetEditable(), &start, &end) )
|
||||
{
|
||||
// the output must always be in order, although in GTK+ it isn't
|
||||
if ( start > end )
|
||||
{
|
||||
gint tmp = start;
|
||||
start = end;
|
||||
end = tmp;
|
||||
}
|
||||
}
|
||||
else // no selection
|
||||
{
|
||||
// for compatibility with MSW return the empty selection at cursor
|
||||
start =
|
||||
end = GetInsertionPoint();
|
||||
}
|
||||
|
||||
if ( from )
|
||||
*from = start;
|
||||
|
||||
if ( to )
|
||||
*to = end;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// editable status
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxTextEntry::IsEditable() const
|
||||
{
|
||||
return gtk_editable_get_editable(GetEditable());
|
||||
}
|
||||
|
||||
void wxTextEntry::SetEditable(bool editable)
|
||||
{
|
||||
gtk_editable_set_editable(GetEditable(), editable);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// max text length
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void wxTextEntry::SetMaxLength(unsigned long len)
|
||||
{
|
||||
GtkEntry * const entry = GTK_ENTRY(GetEditable());
|
||||
if ( !entry )
|
||||
return;
|
||||
|
||||
gtk_entry_set_max_length(entry, len);
|
||||
|
||||
// there is a bug in GTK+ 1.2.x: "changed" signal is emitted even if we had
|
||||
// tried to enter more text than allowed by max text length and the text
|
||||
// wasn't really changed
|
||||
//
|
||||
// to detect this and generate TEXT_MAXLEN event instead of TEXT_CHANGED
|
||||
// one in this case we also catch "insert_text" signal
|
||||
//
|
||||
// when max len is set to 0 we disconnect our handler as it means that we
|
||||
// shouldn't check anything any more
|
||||
if ( len )
|
||||
{
|
||||
g_signal_connect
|
||||
(
|
||||
entry,
|
||||
"insert_text",
|
||||
G_CALLBACK(wx_gtk_insert_text_callback),
|
||||
this
|
||||
);
|
||||
}
|
||||
else // no max length
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func
|
||||
(
|
||||
entry,
|
||||
(gpointer)wx_gtk_insert_text_callback,
|
||||
this
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void wxTextEntry::SendMaxLenEvent()
|
||||
{
|
||||
// remember that the next changed signal is to be ignored to avoid
|
||||
// generating a dummy wxEVT_COMMAND_TEXT_UPDATED event
|
||||
//IgnoreNextTextUpdate();
|
||||
|
||||
wxWindow * const win = const_cast<wxWindow *>(GetEditableWindow());
|
||||
wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId());
|
||||
event.SetEventObject(win);
|
||||
event.SetString(GetValue());
|
||||
win->GetEventHandler()->ProcessEvent(event);
|
||||
}
|
||||
|
@ -417,6 +417,16 @@ void wxComboBox::SetValue(const wxString& value)
|
||||
m_text->SetValue( value );
|
||||
}
|
||||
|
||||
void wxComboBox::WriteText(const wxString& text)
|
||||
{
|
||||
m_text->WriteText(text);
|
||||
}
|
||||
|
||||
void wxComboBox::GetSelection(long *from, long *to) const
|
||||
{
|
||||
m_text->GetSelection(from, to);
|
||||
}
|
||||
|
||||
// Clipboard operations
|
||||
|
||||
void wxComboBox::Copy()
|
||||
|
@ -6323,7 +6323,7 @@ void wxRichTextAction::UpdateAppearance(long caretPosition, bool sendUpdateEvent
|
||||
m_ctrl->Refresh(false);
|
||||
|
||||
if (sendUpdateEvent)
|
||||
m_ctrl->SendTextUpdatedEvent();
|
||||
wxTextCtrl::SendTextUpdatedEvent(m_ctrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,9 +129,9 @@ wxRichTextCtrl::wxRichTextCtrl(wxWindow* parent,
|
||||
bool wxRichTextCtrl::Create( wxWindow* parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style,
|
||||
const wxValidator& validator, const wxString& name)
|
||||
{
|
||||
if (!wxTextCtrlBase::Create(parent, id, pos, size,
|
||||
style|wxFULL_REPAINT_ON_RESIZE,
|
||||
validator, name))
|
||||
if (!wxControl::Create(parent, id, pos, size,
|
||||
style|wxFULL_REPAINT_ON_RESIZE,
|
||||
validator, name))
|
||||
return false;
|
||||
|
||||
if (!GetFont().Ok())
|
||||
@ -252,7 +252,8 @@ void wxRichTextCtrl::Clear()
|
||||
LayoutContent();
|
||||
Refresh(false);
|
||||
}
|
||||
SendTextUpdatedEvent();
|
||||
|
||||
wxTextCtrl::SendTextUpdatedEvent(this);
|
||||
}
|
||||
|
||||
/// Painting
|
||||
@ -1879,7 +1880,7 @@ bool wxRichTextCtrl::DoLoadFile(const wxString& filename, int fileType)
|
||||
PositionCaret();
|
||||
SetupScrollbars(true);
|
||||
Refresh(false);
|
||||
SendTextUpdatedEvent();
|
||||
wxTextCtrl::SendTextUpdatedEvent(this);
|
||||
|
||||
if (success)
|
||||
return true;
|
||||
@ -2078,7 +2079,7 @@ void wxRichTextCtrl::DoSetValue(const wxString& value, int flags)
|
||||
{
|
||||
// still send an event for consistency
|
||||
if (flags & SetValue_SendEvent)
|
||||
SendTextUpdatedEvent();
|
||||
wxTextCtrl::SendTextUpdatedEvent(this);
|
||||
}
|
||||
DiscardEdits();
|
||||
}
|
||||
@ -2095,7 +2096,7 @@ void wxRichTextCtrl::DoWriteText(const wxString& value, int flags)
|
||||
GetBuffer().InsertTextWithUndo(m_caretPosition+1, valueUnix, this, wxRICHTEXT_INSERT_WITH_PREVIOUS_PARAGRAPH_STYLE);
|
||||
|
||||
if ( flags & SetValue_SendEvent )
|
||||
SendTextUpdatedEvent();
|
||||
wxTextCtrl::SendTextUpdatedEvent(this);
|
||||
}
|
||||
|
||||
void wxRichTextCtrl::AppendText(const wxString& text)
|
||||
|
@ -283,6 +283,11 @@ void wxComboBox::SetValue(const wxString& value)
|
||||
wxComboCtrl::SetValue(value);
|
||||
}
|
||||
|
||||
void wxComboBox::WriteText(const wxString& value)
|
||||
{
|
||||
if ( GetTextCtrl() ) GetTextCtrl()->WriteText(value);
|
||||
}
|
||||
|
||||
void wxComboBox::Copy()
|
||||
{
|
||||
if ( GetTextCtrl() ) GetTextCtrl()->Copy();
|
||||
@ -337,6 +342,11 @@ void wxComboBox::SetSelection(long from, long to)
|
||||
if ( GetTextCtrl() ) GetTextCtrl()->SetSelection(from, to);
|
||||
}
|
||||
|
||||
void wxComboBox::GetSelection(long *from, long *to) const
|
||||
{
|
||||
if ( GetTextCtrl() ) GetTextCtrl()->GetSelection(from, to);
|
||||
}
|
||||
|
||||
void wxComboBox::SetEditable(bool editable)
|
||||
{
|
||||
if ( GetTextCtrl() ) GetTextCtrl()->SetEditable(editable);
|
||||
@ -412,6 +422,11 @@ int wxComboBox::GetSelection() const
|
||||
#endif
|
||||
}
|
||||
|
||||
wxString wxComboBox::GetStringSelection() const
|
||||
{
|
||||
return GetLBox()->GetStringSelection();
|
||||
}
|
||||
|
||||
void wxComboBox::SetClientDataType(wxClientDataType clientDataItemsType)
|
||||
{
|
||||
GetLBox()->SetClientDataType(clientDataItemsType);
|
||||
|
@ -790,21 +790,23 @@ wxTextCtrl::~wxTextCtrl()
|
||||
|
||||
void wxTextCtrl::DoSetValue(const wxString& value, int flags)
|
||||
{
|
||||
if ( IsSingleLine() && (value == GetValue()) )
|
||||
if ( value != GetValue() )
|
||||
{
|
||||
// nothing changed
|
||||
return;
|
||||
EventsSuppressor noeventsIf(this, !(flags & SetValue_SendEvent));
|
||||
|
||||
Replace(0, GetLastPosition(), value);
|
||||
|
||||
if ( IsSingleLine() )
|
||||
{
|
||||
SetInsertionPoint(0);
|
||||
}
|
||||
}
|
||||
|
||||
Replace(0, GetLastPosition(), value);
|
||||
|
||||
if ( IsSingleLine() )
|
||||
else // nothing changed
|
||||
{
|
||||
SetInsertionPoint(0);
|
||||
// still send event for consistency
|
||||
if ( flags & SetValue_SendEvent )
|
||||
SendTextUpdatedEvent();
|
||||
}
|
||||
|
||||
if ( flags & SetValue_SendEvent )
|
||||
SendTextUpdatedEvent();
|
||||
}
|
||||
|
||||
const wxArrayString& wxTextCtrl::GetLines() const
|
||||
@ -1264,6 +1266,9 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text)
|
||||
|
||||
// now call it to do the rest (not related to refreshing)
|
||||
ClearSelection();
|
||||
|
||||
if ( EventsAllowed() )
|
||||
SendTextUpdatedEvent();
|
||||
}
|
||||
|
||||
void wxTextCtrl::Remove(wxTextPos from, wxTextPos to)
|
||||
|
Loading…
Reference in New Issue
Block a user