From e90c1d2a19361551eb07778280f22be3e759cf64 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 4 Oct 1999 20:15:38 +0000 Subject: [PATCH] many changes; major ones: 1. start of !wxUSE_GUI support 2. _T() macro renamed to T() 3. wxConvertWX2MB and MB2WX macro added git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3828 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 55 ++- configure.in | 356 +++++++++++------ distrib/msw/tmake/filelist.txt | 57 +-- docs/html/roadmap.htm | 1 + include/wx/app.h | 99 +++-- include/wx/arrimpl.cpp | 11 +- include/wx/buffer.h | 31 +- include/wx/debug.h | 21 +- include/wx/defs.h | 49 +-- include/wx/dialup.h | 8 +- include/wx/dynarray.h | 13 +- include/wx/event.h | 100 ++--- include/wx/ffile.h | 2 +- include/wx/fileconf.h | 6 +- include/wx/filefn.h | 12 +- include/wx/fontenum.h | 2 +- include/wx/generic/filedlgg.h | 2 +- include/wx/generic/progdlgg.h | 2 +- include/wx/gtk/frame.h | 2 +- include/wx/gtk/mdi.h | 8 +- include/wx/gtk1/frame.h | 2 +- include/wx/gtk1/mdi.h | 8 +- include/wx/intl.h | 2 +- include/wx/ipcbase.h | 4 +- include/wx/log.h | 10 +- include/wx/motif/clipbrd.h | 4 +- include/wx/motif/dnd.h | 2 +- include/wx/msw/curicop.h | 2 +- include/wx/msw/dde.h | 4 +- include/wx/msw/private.h | 8 +- include/wx/object.h | 10 +- include/wx/proplist.h | 2 +- include/wx/sckipc.h | 6 +- include/wx/strconv.h | 164 ++++---- include/wx/string.h | 157 ++++---- include/wx/utils.h | 9 +- include/wx/variant.h | 24 +- include/wx/wizard.h | 2 +- include/wx/wx.h | 23 +- include/wx/wxchar.h | 92 +++-- include/wx/wxexpr.h | 4 +- samples/nettest/nettest.cpp | 5 +- setup.h.in | 21 +- src/common/choiccmn.cpp | 12 +- src/common/cmndata.cpp | 64 ++-- src/common/config.cpp | 10 +- src/common/ctrlcmn.cpp | 2 +- src/common/date.cpp | 42 +- src/common/db.cpp | 6 +- src/common/dlgcmn.cpp | 4 +- src/common/docmdi.cpp | 2 +- src/common/docview.cpp | 64 ++-- src/common/dynarray.cpp | 6 +- src/common/dynlib.cpp | 2 +- src/common/event.cpp | 131 ++++--- src/common/ffile.cpp | 18 +- src/common/file.cpp | 19 +- src/common/fileconf.cpp | 128 +++---- src/common/filefn.cpp | 394 ++++++++++--------- src/common/filesys.cpp | 48 +-- src/common/fontcmn.cpp | 36 +- src/common/fs_inet.cpp | 6 +- src/common/ftp.cpp | 60 +-- src/common/gdicmn.cpp | 152 ++++---- src/common/http.cpp | 36 +- src/common/imagbmp.cpp | 16 +- src/common/image.cpp | 102 ++--- src/common/imaggif.cpp | 8 +- src/common/imagpcx.cpp | 12 +- src/common/imagpnm.cpp | 24 +- src/common/init.cpp | 80 ++++ src/common/intl.cpp | 35 +- src/common/list.cpp | 26 +- src/common/log.cpp | 62 ++- src/common/memory.cpp | 94 ++--- src/common/mimetype.cpp | 220 +++++------ src/common/object.cpp | 2 +- src/common/objstrm.cpp | 8 +- src/common/prntbase.cpp | 2 +- src/common/resourc2.cpp | 54 +-- src/common/resource.cpp | 680 ++++++++++++++++----------------- src/common/sckaddr.cpp | 4 +- src/common/sckfile.cpp | 2 +- src/common/sckipc.cpp | 2 +- src/common/sizer.cpp | 2 +- src/common/socket.cpp | 4 +- src/common/strconv.cpp | 46 +-- src/common/string.cpp | 132 +++---- src/common/textcmn.cpp | 10 +- src/common/textfile.cpp | 10 +- src/common/time.cpp | 6 +- src/common/txtstrm.cpp | 76 ++-- src/common/url.cpp | 50 +-- src/common/utilscmn.cpp | 188 +++++---- src/common/variant.cpp | 206 +++++----- src/common/wincmn.cpp | 40 +- src/common/wxchar.cpp | 26 +- src/common/wxexpr.cpp | 32 +- src/common/zipstrm.cpp | 24 +- src/common/zstream.cpp | 2 +- src/generic/choicdgg.cpp | 4 +- src/generic/colrdlgg.cpp | 106 ++--- src/generic/dcpsg.cpp | 82 ++-- src/generic/dirdlgg.cpp | 166 ++++---- src/generic/filedlgg.cpp | 108 +++--- src/generic/fontdlgg.cpp | 156 ++++---- src/generic/helpext.cpp | 10 +- src/generic/helphtml.cpp | 8 +- src/generic/imaglist.cpp | 10 +- src/generic/listctrl.cpp | 8 +- src/generic/logg.cpp | 20 +- src/generic/numdlgg.cpp | 4 +- src/generic/prntdlgg.cpp | 2 +- src/generic/progdlgg.cpp | 14 +- src/generic/prop.cpp | 42 +- src/generic/propform.cpp | 26 +- src/generic/proplist.cpp | 30 +- src/generic/splitter.cpp | 10 +- src/generic/statline.cpp | 2 +- src/generic/tipdlg.cpp | 2 +- src/generic/treectrl.cpp | 70 ++-- src/generic/wizard.cpp | 8 +- src/gtk/accel.cpp | 19 +- src/gtk/app.cpp | 26 +- src/gtk/bitmap.cpp | 34 +- src/gtk/bmpbuttn.cpp | 16 +- src/gtk/brush.cpp | 6 +- src/gtk/button.cpp | 4 +- src/gtk/checkbox.cpp | 8 +- src/gtk/checklst.cpp | 16 +- src/gtk/choice.cpp | 40 +- src/gtk/clipbrd.cpp | 24 +- src/gtk/colour.cpp | 14 +- src/gtk/combobox.cpp | 56 +-- src/gtk/control.cpp | 6 +- src/gtk/cursor.cpp | 4 +- src/gtk/data.cpp | 75 ++-- src/gtk/dataobj.cpp | 14 +- src/gtk/dcclient.cpp | 68 ++-- src/gtk/dialog.cpp | 18 +- src/gtk/dnd.cpp | 12 +- src/gtk/filedlg.cpp | 22 +- src/gtk/font.cpp | 38 +- src/gtk/fontdlg.cpp | 6 +- src/gtk/frame.cpp | 52 +-- src/gtk/gauge.cpp | 2 +- src/gtk/listbox.cpp | 64 ++-- src/gtk/mdi.cpp | 6 +- src/gtk/menu.cpp | 138 +++---- src/gtk/notebook.cpp | 42 +- src/gtk/palette.cpp | 6 +- src/gtk/pen.cpp | 10 +- src/gtk/radiobox.cpp | 52 +-- src/gtk/radiobut.cpp | 8 +- src/gtk/scrolbar.cpp | 2 +- src/gtk/settings.cpp | 2 +- src/gtk/slider.cpp | 2 +- src/gtk/spinbutt.cpp | 14 +- src/gtk/statbmp.cpp | 4 +- src/gtk/statbox.cpp | 2 +- src/gtk/statline.cpp | 2 +- src/gtk/stattext.cpp | 2 +- src/gtk/tbargtk.cpp | 36 +- src/gtk/textctrl.cpp | 62 +-- src/gtk/utilsres.cpp | 28 +- src/gtk/window.cpp | 128 +++---- src/gtk1/accel.cpp | 19 +- src/gtk1/app.cpp | 26 +- src/gtk1/bitmap.cpp | 34 +- src/gtk1/bmpbuttn.cpp | 16 +- src/gtk1/brush.cpp | 6 +- src/gtk1/button.cpp | 4 +- src/gtk1/checkbox.cpp | 8 +- src/gtk1/checklst.cpp | 16 +- src/gtk1/choice.cpp | 40 +- src/gtk1/clipbrd.cpp | 24 +- src/gtk1/colour.cpp | 14 +- src/gtk1/combobox.cpp | 56 +-- src/gtk1/control.cpp | 6 +- src/gtk1/cursor.cpp | 4 +- src/gtk1/data.cpp | 75 ++-- src/gtk1/dataobj.cpp | 14 +- src/gtk1/dcclient.cpp | 68 ++-- src/gtk1/dialog.cpp | 18 +- src/gtk1/dnd.cpp | 12 +- src/gtk1/filedlg.cpp | 22 +- src/gtk1/font.cpp | 38 +- src/gtk1/fontdlg.cpp | 6 +- src/gtk1/frame.cpp | 52 +-- src/gtk1/gauge.cpp | 2 +- src/gtk1/listbox.cpp | 64 ++-- src/gtk1/mdi.cpp | 6 +- src/gtk1/menu.cpp | 138 +++---- src/gtk1/notebook.cpp | 42 +- src/gtk1/palette.cpp | 6 +- src/gtk1/pen.cpp | 10 +- src/gtk1/radiobox.cpp | 52 +-- src/gtk1/radiobut.cpp | 8 +- src/gtk1/scrolbar.cpp | 2 +- src/gtk1/settings.cpp | 2 +- src/gtk1/slider.cpp | 2 +- src/gtk1/spinbutt.cpp | 14 +- src/gtk1/statbmp.cpp | 4 +- src/gtk1/statbox.cpp | 2 +- src/gtk1/statline.cpp | 2 +- src/gtk1/stattext.cpp | 2 +- src/gtk1/tbargtk.cpp | 36 +- src/gtk1/textctrl.cpp | 62 +-- src/gtk1/utilsres.cpp | 28 +- src/gtk1/window.cpp | 128 +++---- src/html/helpdata.cpp | 2 +- src/html/htmlcell.cpp | 4 +- src/html/htmlfilt.cpp | 2 +- src/html/m_fonts.cpp | 4 +- src/html/m_image.cpp | 4 +- src/html/m_layout.cpp | 4 +- src/html/m_tables.cpp | 2 +- src/motif/clipbrd.cpp | 14 +- src/motif/dataobj.cpp | 14 +- src/motif/dcclient.cpp | 2 +- src/motif/font.cpp | 4 +- src/motif/fontenum.cpp | 14 +- src/motif/utils.cpp | 6 +- src/motif/window.cpp | 2 +- src/msw/app.cpp | 52 +-- src/msw/bitmap.cpp | 12 +- src/msw/bmpbuttn.cpp | 4 +- src/msw/button.cpp | 2 +- src/msw/caret.cpp | 10 +- src/msw/checkbox.cpp | 10 +- src/msw/checklst.cpp | 8 +- src/msw/choice.cpp | 10 +- src/msw/clipbrd.cpp | 12 +- src/msw/combobox.cpp | 4 +- src/msw/control.cpp | 2 +- src/msw/curico.cpp | 4 +- src/msw/cursor.cpp | 26 +- src/msw/data.cpp | 79 ++-- src/msw/dc.cpp | 8 +- src/msw/dcclient.cpp | 6 +- src/msw/dcmemory.cpp | 4 +- src/msw/dcprint.cpp | 18 +- src/msw/dde.cpp | 42 +- src/msw/dialog.cpp | 6 +- src/msw/dialup.cpp | 24 +- src/msw/dib.cpp | 6 +- src/msw/dibutils.cpp | 2 +- src/msw/dragimag.cpp | 14 +- src/msw/filedlg.cpp | 50 +-- src/msw/font.cpp | 18 +- src/msw/frame.cpp | 10 +- src/msw/gaugemsw.cpp | 8 +- src/msw/helpwin.cpp | 22 +- src/msw/listbox.cpp | 42 +- src/msw/listctrl.cpp | 8 +- src/msw/mdi.cpp | 18 +- src/msw/menu.cpp | 76 ++-- src/msw/menuitem.cpp | 6 +- src/msw/metafile.cpp | 8 +- src/msw/minifram.cpp | 16 +- src/msw/nativdlg.cpp | 24 +- src/msw/notebook.cpp | 16 +- src/msw/ole/automtn.cpp | 34 +- src/msw/ole/dataobj.cpp | 44 +-- src/msw/ole/dropsrc.cpp | 6 +- src/msw/ole/droptgt.cpp | 8 +- src/msw/ole/uuid.cpp | 2 +- src/msw/ownerdrw.cpp | 2 +- src/msw/penwin.cpp | 2 +- src/msw/printwin.cpp | 2 +- src/msw/radiobox.cpp | 18 +- src/msw/radiobut.cpp | 4 +- src/msw/regconf.cpp | 14 +- src/msw/registry.cpp | 30 +- src/msw/scrolbar.cpp | 2 +- src/msw/slider95.cpp | 18 +- src/msw/slidrmsw.cpp | 18 +- src/msw/spinbutt.cpp | 2 +- src/msw/statbmp.cpp | 8 +- src/msw/statbox.cpp | 2 +- src/msw/statbr95.cpp | 10 +- src/msw/statline.cpp | 6 +- src/msw/stattext.cpp | 8 +- src/msw/tabctrl.cpp | 6 +- src/msw/taskbar.cpp | 8 +- src/msw/tbar95.cpp | 12 +- src/msw/textctrl.cpp | 12 +- src/msw/thread.cpp | 18 +- src/msw/timer.cpp | 4 +- src/msw/treectrl.cpp | 28 +- src/msw/utils.cpp | 110 +++--- src/msw/utilsexc.cpp | 8 +- src/msw/wave.cpp | 6 +- src/msw/window.cpp | 154 ++++---- src/msw/xpmhand.cpp | 4 +- src/unix/dialup.cpp | 34 +- src/unix/threadpsx.cpp | 30 +- src/unix/utilsunx.cpp | 221 ++++++----- 298 files changed, 5170 insertions(+), 4689 deletions(-) create mode 100644 src/common/init.cpp diff --git a/Makefile.in b/Makefile.in index 8905b1469a..886fc4de86 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1821,14 +1821,53 @@ JPEGOBJS = \ jquant2.o \ jdmerge.o - -OBJECTS = $(@GUIOBJS@) $(@COMMONOBJS@) $(@GENERICOBJS@) $(@UNIXOBJS@) $(HTMLOBJS) \ - $(JPEGOBJS) $(PNGOBJS) $(ZLIBOBJS) - -DEPFILES = $(@GUIDEPS@) $(@COMMONDEPS@) $(@GENERICDEPS@) $(UNIXDEPS) $(HTMLDEPS) - -HEADERS = $(@GUIHEADERS@) $(HTML_HEADERS) $(UNIX_HEADERS) $(PROTOCOL_HEADERS) \ - $(GENERIC_HEADERS) $(WX_HEADERS) +BASE_OBJS = \ + dynarray.o \ + event.o \ + hash.o \ + intl.o \ + init.o \ + file.o \ + filefn.o \ + list.o \ + log.o \ + object.o \ + string.o \ + utilscmn.o \ + utilsunx.o + +BASE_DEPS = \ + dynarray.d \ + event.d \ + hash.d \ + intl.d \ + init.d \ + file.d \ + filefn.d \ + list.d \ + log.d \ + object.d \ + string.d \ + utilscmn.d \ + utilsunx.d + +BASE_HEADERS = + +GUIOBJS = @GUIOBJS@ +GUIDEPS = @GUIDEPS@ +GUIHEADERS = @GUIHEADERS@ +COMMONOBJS = @COMMONOBJS@ +COMMONDEPS = @COMMONDEPS@ +GENERICOBJS = @GENERICOBJS@ +GENERICDEPS = @GENERICDEPS@ +UNIXOBJS = @UNIXOBJS@ +UNIXDEPS = @UNIXDEPS@ + +OBJECTS = @ALL_OBJECTS@ + +DEPFILES = @ALL_DEPFILES@ + +HEADERS = @ALL_HEADERS@ all: @WX_CREATE_LINKS@ diff --git a/configure.in b/configure.in index 50f0a62a21..aaa380472d 100644 --- a/configure.in +++ b/configure.in @@ -64,8 +64,8 @@ main () if (gtk_minor_version == 1) return FALSE; return !((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))); + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))); } ],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" @@ -744,7 +744,7 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_UNICODE=no DEFAULT_wxUSE_WCSRTOMBS=no - + DEFAULT_wxUSE_GIF=no DEFAULT_wxUSE_PCX=no DEFAULT_wxUSE_PNM=no @@ -855,7 +855,7 @@ else DEFAULT_wxUSE_UNICODE=no DEFAULT_wxUSE_WCSRTOMBS=no - + DEFAULT_wxUSE_GIF=yes DEFAULT_wxUSE_PCX=yes DEFAULT_wxUSE_PNM=yes @@ -880,6 +880,85 @@ for toolkit in `echo $ALL_TOOLKITS`; do fi done +dnl --------------------------------------------------------------------------- +dnl --disable-gui will build only non-GUI part of wxWindows: check for this +dnl first to disable many other switches if it's given +dnl +dnl NB: this is still in testing stage, don't use if you don't know what you're +dnl doing +dnl --------------------------------------------------------------------------- + +WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI) + +dnl disable everything GUI related then +if test "$wxUSE_GUI" = "no"; then + DEFAULT_wxUSE_ZLIB=no + DEFAULT_wxUSE_LIBPNG=no + DEFAULT_wxUSE_LIBJPEG=no + DEFAULT_wxUSE_SOCKETS=no + DEFAULT_wxUSE_JOYSTICK=no + DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no + DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no + DEFAULT_wxUSE_POSTSCRIPT=no + DEFAULT_wxUSE_X_RESOURCES=no + DEFAULT_wxUSE_CLIPBOARD=no + DEFAULT_wxUSE_TOOLTIPS=no + DEFAULT_wxUSE_DRAG_AND_DROP=no + DEFAULT_wxUSE_SPLINES=no + DEFAULT_wxUSE_MDI_ARCHITECTURE=no + DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no + DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no + DEFAULT_wxUSE_PROLOGIO=no + DEFAULT_wxUSE_RESOURCES=no + DEFAULT_wxUSE_CONSTRAINTS=no + DEFAULT_wxUSE_IPC=no + DEFAULT_wxUSE_HELP=no + DEFAULT_wxUSE_WXTREE=no + DEFAULT_wxUSE_METAFILE=no + DEFAULT_wxUSE_COMMONDLGS=no + DEFAULT_wxUSE_DIRDLG=no + DEFAULT_wxUSE_TEXTDLG=no + DEFAULT_wxUSE_STARTUP_TIPS=no + DEFAULT_wxUSE_PROGRESSDLG=no + DEFAULT_wxUSE_MINIFRAME=no + DEFAULT_wxUSE_HTML=no + DEFAULT_wxUSE_FS_INET=no + DEFAULT_wxUSE_FS_ZIP=no + DEFAULT_wxUSE_BUSYINFO=no + DEFAULT_wxUSE_ZIPSTREAM=no + DEFAULT_wxUSE_VALIDATORS=yes + DEFAULT_wxUSE_ACCEL=no + DEFAULT_wxUSE_CARET=no + DEFAULT_wxUSE_BMPBUTTON=no + DEFAULT_wxUSE_CHECKBOX=no + DEFAULT_wxUSE_CHECKLST=no + DEFAULT_wxUSE_CHOICE=yes + DEFAULT_wxUSE_COMBOBOX=no + DEFAULT_wxUSE_GAUGE=no + DEFAULT_wxUSE_GRID=no + DEFAULT_wxUSE_IMAGLIST=no + DEFAULT_wxUSE_LISTBOX=no + DEFAULT_wxUSE_LISTCTRL=no + DEFAULT_wxUSE_NOTEBOOK=no + DEFAULT_wxUSE_RADIOBOX=no + DEFAULT_wxUSE_RADIOBTN=no + DEFAULT_wxUSE_SASH=no + DEFAULT_wxUSE_SCROLLBAR=no + DEFAULT_wxUSE_SLIDER=no + DEFAULT_wxUSE_SPINBTN=no + DEFAULT_wxUSE_SPLITTER=no + DEFAULT_wxUSE_STATBMP=no + DEFAULT_wxUSE_STATBOX=no + DEFAULT_wxUSE_STATLINE=no + DEFAULT_wxUSE_STATUSBAR=yes + DEFAULT_wxUSE_TABDIALOG=no + DEFAULT_wxUSE_TOOLBAR=no + DEFAULT_wxUSE_TREECTRL=no + DEFAULT_wxUSE_GIF=no + DEFAULT_wxUSE_PCX=no + DEFAULT_wxUSE_PNM=no +fi + AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(wine, [ --with-wine use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1]) @@ -929,15 +1008,6 @@ WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without exce WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE) WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS) -dnl --------------------------------------------------------------------------- -dnl --disable-gui will build only non-GUI part of wxWindows -dnl -dnl NB: this is still in testing stage, don't use if you don't know what you're -dnl doing -dnl --------------------------------------------------------------------------- - -WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI) - dnl --------------------------------------------------------------------------- dnl (small) optional non GUI classes dnl --------------------------------------------------------------------------- @@ -1139,6 +1209,8 @@ dnl we have a default one AC_MSG_CHECKING(for toolkit) +if test "$wxUSE_GUI" = "yes"; then + if test "$TOOLKIT_GIVEN" = 1; then dnl convert "yes" to 1 and "no" to 0 for toolkit in `echo $ALL_TOOLKITS`; do @@ -1187,6 +1259,11 @@ for toolkit in `echo $ALL_TOOLKITS`; do fi done +dnl from "if wxUSE_GUI" +else + AC_MSG_RESULT(base only) +fi + dnl --------------------------------------------------------------------------- dnl Checks for programs dnl --------------------------------------------------------------------------- @@ -1390,6 +1467,8 @@ dnl ---------------------------------------------------------------- dnl search for toolkit (widget sets) dnl ---------------------------------------------------------------- +if test "$wxUSE_GUI" = "yes"; then + TOOLKIT= TOOLKIT_INCLUDE= @@ -1409,14 +1488,14 @@ PROGRAM_EXT= if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then if test "$cross_compiling" = "yes" ; then - AC_MSG_WARN(Cross compiling --- skipping windows.h check) + AC_MSG_WARN(Cross compiling --- skipping windows.h check) else - AC_MSG_CHECKING(for Windows headers) - WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h) - if test "$ac_find_includes" != "" ; then + AC_MSG_CHECKING(for Windows headers) + WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h) + if test "$ac_find_includes" != "" ; then AC_MSG_RESULT(found $ac_find_includes) TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -I$ac_find_includes" - else + else AC_MSG_RESULT(no) AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h) fi @@ -1429,10 +1508,10 @@ if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then TOOLKIT=MSW - GUIOBJS=MSW_GUIOBJS - GUIHEADERS=MSW_HEADERS - COMMONOBJS=MSW_COMMONOBJS - GENERICOBJS=MSW_GENERICOBJS + GUIOBJS="\$(MSW_GUIOBJS)" + GUIHEADERS="\$(MSW_HEADERS)" + COMMONOBJS="\$(MSW_COMMONOBJS)" + GENERICOBJS="\$(MSW_GENERICOBJS)" UNIXOBJS= GUIDIST=MSW_DIST PROGRAM_EXT=.exe @@ -1450,14 +1529,14 @@ if test "$wxUSE_GTK" = 1; then GUI_TK_LIBRARY="$GTK_LIBS" TOOLKIT=GTK - GUIHEADERS=GTK_HEADERS - GUIOBJS=GTK_GUIOBJS - COMMONOBJS=GTK_COMMONOBJS - GENERICOBJS=GTK_GENERICOBJS - GUIDEPS=GTK_GUIDEPS - COMMONDEPS=GTK_COMMONDEPS - GENERICDEPS=GTK_GENERICDEPS - UNIXOBJS=UNIXOBJS + GUIOBJS="\$(GTK_GUIOBJS)" + GUIHEADERS="\$(GTK_HEADERS)" + COMMONOBJS="\$(GTK_COMMONOBJS)" + GENERICOBJS="\$(GTK_GENERICOBJS)" + GUIDEPS="\$(GTK_GUIDEPS)" + COMMONDEPS="\$(GTK_COMMONDEPS)" + GENERICDEPS="\$(GTK_GENERICDEPS)" + UNIXOBJS="\$(UNIX_OBJS)" GUIDIST=GTK_DIST fi @@ -1501,14 +1580,14 @@ if test "$wxUSE_WINE" = 1; then WXWINE=1 TOOLKIT=MSW - GUIHEADERS=MSW_HEADERS - GUIOBJS=MSW_GUIOBJS - COMMONOBJS=MSW_COMMONOBJS - GENERICOBJS=MSW_GENERICOBJS - GUIDEPS=MSW_GUIDEPS - COMMONDEPS=MSW_COMMONDEPS - GENERICDEPS=MSW_GENERICDEPS - UNIXOBJS=UNIXOBJS + GUIHEADERS="\$(MSW_HEADERS)" + GUIOBJS="\$(MSW_GUIOBJS)" + COMMONOBJS="\$(MSW_COMMONOBJS)" + GENERICOBJS="\$(MSW_GENERICOBJS)" + GUIDEPS="\$(MSW_GUIDEPS)" + COMMONDEPS="\$(MSW_COMMONDEPS)" + GENERICDEPS="\$(MSW_GENERICDEPS)" + UNIXOBJS="\$(UNIX_OBJS)" GUIDIST=MSW_DIST fi @@ -1576,14 +1655,14 @@ if test "$wxUSE_MOTIF" = 1; then GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK" TOOLKIT=MOTIF - GUIHEADERS=MOTIF_HEADERS - GUIOBJS=MOTIF_GUIOBJS - COMMONOBJS=MOTIF_COMMONOBJS - GENERICOBJS=MOTIF_GENERICOBJS - GUIDEPS=MOTIF_GUIDEPS - COMMONDEPS=MOTIF_COMMONDEPS - GENERICDEPS=MOTIF_GENERICDEPS - UNIXOBJS=UNIXOBJS + GUIHEADERS="\$(MOTIF_HEADERS)" + GUIOBJS="\$(MOTIF_GUIOBJS)" + COMMONOBJS="\$(MOTIF_COMMONOBJS)" + GENERICOBJS="\$(MOTIF_GENERICOBJS)" + GUIDEPS="\$(MOTIF_GUIDEPS)" + COMMONDEPS="\$(MOTIF_COMMONDEPS)" + GENERICDEPS="\$(MOTIF_GENERICDEPS)" + UNIXOBJS="\$(UNIX_OBJS)" GUIDIST=MOTIF_DIST fi @@ -1603,19 +1682,35 @@ TOOLKIT_DEF="-D__WX${TOOLKIT}__" dnl the name of the (libtool) library WX_LIBRARY="wx_${TOOLKIT_DIR}" + dnl the sources, their dependenices and the headers + ALL_OBJECTS="\$(GUIOBJS) \$(COMMONOBJS) \$(GENERICOBJS) \$(UNIXOBJS) \$(HTMLOBJS) \$(JPEGOBJS) \$(PNGOBJS) \$(ZLIBOBJS)" + ALL_DEPFILES="\$(GUIDEPS) \$(COMMONDEPS) \$(GENERICDEPS) \$(UNIXDEPS) \$(HTMLDEPS)" + ALL_HEADERS="\$(GUIHEADERS) \$(HTML_HEADERS) \$(UNIX_HEADERS) \$(PROTOCOL_HEADERS) \$(GENERIC_HEADERS) \$(WX_HEADERS)" +else + dnl leave all TOOLKIT_XXX vars empty + + dnl the sources, their dependenices and the headers + ALL_OBJECTS="\$(BASE_OBJS)" + ALL_DEPFILES="\${BASE_DEPS}" + ALL_HEADERS="\${BASE_HEADERS}" + + dnl building wxBase only + WX_LIBRARY="wxbase" +fi + dnl the name of the (libtool) library -WX_LIBRARY_NAME="libwx_${TOOLKIT_DIR}.la" +WX_LIBRARY_NAME="lib${WX_LIBRARY}.la" dnl the name of the static library -WX_LIBRARY_NAME_STATIC="libwx_${TOOLKIT_DIR}.a" +WX_LIBRARY_NAME_STATIC="lib${WX_LIBRARY}.a" dnl the name of the shared library -WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}" +WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}-${WX_RELEASE}.so.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}" dnl the name of the links to the shared library -WX_LIBRARY_LINK1="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}" -WX_LIBRARY_LINK2="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so" -WX_LIBRARY_LINK3="libwx_${TOOLKIT_DIR}.so" +WX_LIBRARY_LINK1="lib${WX_LIBRARY}-${WX_RELEASE}.so.${WX_CURRENT}" +WX_LIBRARY_LINK2="lib${WX_LIBRARY}-${WX_RELEASE}.so" +WX_LIBRARY_LINK3="lib${WX_LIBRARY}.so" dnl shared library settings SHARED_LD= @@ -1725,8 +1820,11 @@ dnl defines HAVE_WCSTR_H AC_CHECK_HEADERS(wcstr.h) dnl defines HAVE_FNMATCH_H AC_CHECK_HEADERS(fnmatch.h) -dnl defines HAVE_X11_XKBLIB_H -AC_CHECK_HEADERS(X11/XKBlib.h) + +if test "$wxUSE_GUI" = "yes"; then + dnl defines HAVE_X11_XKBLIB_H + AC_CHECK_HEADERS(X11/XKBlib.h) +fi dnl --------------------------------------------------------------------------- dnl Checks for typedefs @@ -1863,6 +1961,9 @@ AC_CHECK_FUNCS(nanosleep, AC_DEFINE(HAVE_NANOSLEEP), [ dnl check for uname (POSIX) and gethostname (BSD) AC_CHECK_FUNCS(uname gethostname, break) +dnl check for MT-safe version of strtok +AC_CHECK_FUNCS(strtok_r) + dnl check for inet_addr, inet_aton, ... AC_CHECK_FUNCS(inet_addr) AC_CHECK_FUNCS(inet_aton) @@ -2051,10 +2152,10 @@ fi DEP_INFO_FLAGS= if test "$GCC" = yes ; then if test "$wxUSE_NO_RTTI" = "yes" ; then - WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti" + WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti" fi if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then - WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-exceptions" + WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-exceptions" fi if test "$wxUSE_PERMISSIVE" = "yes" ; then CFLAGS="${CFLAGS} -fpermissive" @@ -2312,9 +2413,9 @@ if test "$wxUSE_DYNLIB_CLASS" = "yes"; then AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support") wxUSE_ODBC=no wxUSE_DYNLIB_CLASS=no - else - AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.") - fi + else + AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.") + fi fi fi @@ -2429,13 +2530,13 @@ if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then if test "$wxUSE_GTK" = 1; then if test "$WXGTK12" != 1; then AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2]) - wxUSE_DRAG_AND_DROP=no + wxUSE_DRAG_AND_DROP=no fi fi if test "$wxUSE_MOTIF" = 1; then AC_MSG_WARN([Drag and drop is not yet supported under Motif]) - wxUSE_DRAG_AND_DROP=no + wxUSE_DRAG_AND_DROP=no fi if test "$wxUSE_DRAG_AND_DROP" = "yes"; then @@ -2556,7 +2657,7 @@ if test "$wxUSE_STATLINE" = "yes"; then if test "$wxUSE_WINE" = 1 ; then AC_MSG_WARN([wxStaticLine is not supported under WINE]) else - AC_DEFINE(wxUSE_STATLINE) + AC_DEFINE(wxUSE_STATLINE) fi fi @@ -2672,16 +2773,13 @@ dnl --------------------------------------------------------------------------- dnl Output the makefiles and such from the results found above dnl --------------------------------------------------------------------------- -dnl if we add wxUSE_GUI in the future, it might be handy to separate the libs -dnl into GUI and non-GUI parts GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $LIBPNG_LINK $ZLIB_LINK $TOOLKIT_LINK" dnl all additional libraries (except wxWindows itself) we link with -EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $GUILIBS" - -dnl all the libraries needed to link wxWindows programs (when the library is not -dnl yet installed) -LIBS="\${top_builddir}/src/${TOOLKIT_DIR}/${WX_LIBRARY_NAME} $EXTRA_LIBS" +EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK" +if test "$wxUSE_GUI" = "yes"; then + EXTRA_LIBS="$EXTRA_LIBS $GUILIBS" +fi dnl all the libraries needed to link wxWindows programs when using the dnl makefile system without libtool @@ -2694,8 +2792,8 @@ dnl C/C++ compiler options used to compile wxWindows if test "$GXX" = yes ; then dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror" CXXWARNINGS="-Wall" - dnl there is one weird warning in docview.h:71 which prevents me from doing - dnl this... + dnl FIXME: there is one weird warning in docview.h:71 which prevents me from + dnl doing this... (VZ) dnl CXXWARNINGS="-Wall -Werror" fi EXTRA_CFLAGS="$WXDEBUG $PROFILE $OPTIMISE $INCLUDES" @@ -2712,6 +2810,8 @@ if test "$wxUSE_GUI" = "yes"; then dnl mfc, nativdlg, oleauto, ownerdrw, proplist SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS bombs controls dialogs drawing dynamic \ forty fractal image wxpoem" +else + SAMPLES_SUBDIRS="" fi dnl for convenience, sort the samples in alphabetical order @@ -2760,6 +2860,10 @@ AC_SUBST(GUIDEPS) AC_SUBST(COMMONDEPS) AC_SUBST(GENERICDEPS) AC_SUBST(UNIXOBJS) +AC_SUBST(UNIXDEPS) +AC_SUBST(ALL_OBJECTS) +AC_SUBST(ALL_DEPFILES) +AC_SUBST(ALL_HEADERS) AC_SUBST(GUIDIST) dnl additional subdirectories where we will build @@ -2797,9 +2901,9 @@ dnl (the original file name may be overriden by appending another name after a dnl colon) AC_OUTPUT([ wx-config - src/make.env - src/makeprog.env - src/makelib.env + src/make.env + src/makeprog.env + src/makelib.env Makefile samples/Makefile samples/bombs/Makefile @@ -2807,63 +2911,63 @@ AC_OUTPUT([ samples/checklst/Makefile samples/config/Makefile samples/controls/Makefile - samples/dialogs/Makefile - samples/docview/Makefile - samples/docvwmdi/Makefile - samples/dnd/Makefile - samples/drawing/Makefile - samples/dynamic/Makefile - samples/image/Makefile - samples/internat/Makefile - samples/layout/Makefile - samples/listctrl/Makefile - samples/mdi/Makefile - samples/minifram/Makefile - samples/minimal/Makefile - samples/notebook/Makefile + samples/dialogs/Makefile + samples/docview/Makefile + samples/docvwmdi/Makefile + samples/dnd/Makefile + samples/drawing/Makefile + samples/dynamic/Makefile + samples/image/Makefile + samples/internat/Makefile + samples/layout/Makefile + samples/listctrl/Makefile + samples/mdi/Makefile + samples/minifram/Makefile + samples/minimal/Makefile + samples/notebook/Makefile samples/printing/Makefile samples/proplist/Makefile - samples/sashtest/Makefile - samples/scroll/Makefile - samples/splitter/Makefile - samples/text/Makefile - samples/thread/Makefile - samples/toolbar/Makefile - samples/treectrl/Makefile - samples/typetest/Makefile - samples/validate/Makefile - samples/wxpoem/Makefile - samples/wxsocket/Makefile - samples/wizard/Makefile - samples/html/Makefile - samples/html/about/Makefile - samples/html/help/Makefile - samples/html/printing/Makefile - samples/html/test/Makefile - samples/html/zip/Makefile - samples/html/virtual/Makefile - samples/html/widget/Makefile - utils/Makefile - utils/wxMMedia2/Makefile - utils/wxMMedia2/lib/Makefile - utils/wxMMedia2/sample/Makefile - utils/glcanvas/Makefile - utils/glcanvas/${GL_TOOLKIT_DIR}/Makefile - utils/ogl/Makefile - utils/ogl/src/Makefile + samples/sashtest/Makefile + samples/scroll/Makefile + samples/splitter/Makefile + samples/text/Makefile + samples/thread/Makefile + samples/toolbar/Makefile + samples/treectrl/Makefile + samples/typetest/Makefile + samples/validate/Makefile + samples/wxpoem/Makefile + samples/wxsocket/Makefile + samples/wizard/Makefile + samples/html/Makefile + samples/html/about/Makefile + samples/html/help/Makefile + samples/html/printing/Makefile + samples/html/test/Makefile + samples/html/zip/Makefile + samples/html/virtual/Makefile + samples/html/widget/Makefile + utils/Makefile + utils/wxMMedia2/Makefile + utils/wxMMedia2/lib/Makefile + utils/wxMMedia2/sample/Makefile + utils/glcanvas/Makefile + utils/glcanvas/${GL_TOOLKIT_DIR}/Makefile + utils/ogl/Makefile + utils/ogl/src/Makefile ], [ chmod +x wx-config - if test ! -d include; then - mkdir include - fi - if test ! -d include/wx; then - mkdir include/wx - fi - if test ! -d include/wx/${TOOLKIT_DIR}; then - mkdir include/wx/${TOOLKIT_DIR} - fi - cp -f setup.h include/wx/${TOOLKIT_DIR}/setup.h + if test ! -d include; then + mkdir include + fi + if test ! -d include/wx; then + mkdir include/wx + fi + if test ! -d include/wx/${TOOLKIT_DIR}; then + mkdir include/wx/${TOOLKIT_DIR} + fi + cp -f setup.h include/wx/${TOOLKIT_DIR}/setup.h ], [ LN_S="${ac_cv_prog_LN_S}" diff --git a/distrib/msw/tmake/filelist.txt b/distrib/msw/tmake/filelist.txt index faf662f04f..7cece77f45 100644 --- a/distrib/msw/tmake/filelist.txt +++ b/distrib/msw/tmake/filelist.txt @@ -28,6 +28,7 @@ # compiler, &c) # # Known flags: +# B makes part of the base library too # 16 a generic file implementing Win32 control for Win16 # 32 only can be compiled under Win32 # PS PostScript related file, normally not compiled under Windows @@ -37,6 +38,7 @@ # S Socket file (currently doesn't compile under Win16 nor with GNU) # R Not required for the GTK port # X Not required for the Motif port +# # WX Base header # GTK GTK header # MSW MSW header @@ -90,9 +92,9 @@ wizard.cpp G choiccmn.cpp C R cmndata.cpp C -config.cpp C +config.cpp C B ctrlcmn.cpp C R -date.cpp C +date.cpp C B datstrm.cpp C db.cpp C dbtable.cpp C @@ -100,15 +102,15 @@ dcbase.cpp C dlgcmn.cpp C docmdi.cpp C docview.cpp C -dynarray.cpp C -dynlib.cpp C +dynarray.cpp C B +dynlib.cpp C B event.cpp C -extended.c C -ffile.cpp C -file.cpp C -fileconf.cpp C -filefn.cpp C -filesys.cpp C +extended.c C B +ffile.cpp C B +file.cpp C B +fileconf.cpp C B +filefn.cpp C B +filesys.cpp C B fontcmn.cpp C framecmn.cpp C fs_inet.cpp C @@ -116,7 +118,7 @@ fs_zip.cpp C ftp.cpp C S gdicmn.cpp C gifdecod.cpp C -hash.cpp C +hash.cpp C B helpbase.cpp C http.cpp C S imagbmp.cpp C @@ -127,21 +129,21 @@ imagjpeg.cpp C 32 imagpcx.cpp C 32 imagpng.cpp C 32 imagpnm.cpp C 32 -intl.cpp C +intl.cpp C B ipcbase.cpp C layout.cpp C -list.cpp C -log.cpp C +list.cpp C B +log.cpp C B memory.cpp C -mimetype.cpp C 32 -module.cpp C +mimetype.cpp C 32,B +module.cpp C B mstream.cpp C -object.cpp C +object.cpp C B objstrm.cpp C odbc.cpp C R paper.cpp C prntbase.cpp C -process.cpp C 32 +process.cpp C 32,B protocol.cpp C S resource.cpp C sckaddr.cpp C S @@ -152,26 +154,26 @@ serbase.cpp C sizer.cpp C socket.cpp C S stream.cpp C -strconv.cpp C -string.cpp C +strconv.cpp C B +string.cpp C B tbarbase.cpp C tbarsmpl.cpp C textcmn.cpp C -textfile.cpp C -time.cpp C -timercmn.cpp C -tokenzr.cpp C +textfile.cpp C B +time.cpp C B +timercmn.cpp C B +tokenzr.cpp C B txtstrm.cpp C unzip.c C url.cpp C S -utilscmn.cpp C +utilscmn.cpp C B valgen.cpp C validate.cpp C valtext.cpp C -variant.cpp C +variant.cpp C B wfstream.cpp C wincmn.cpp C -wxchar.cpp C +wxchar.cpp C B wxexpr.cpp C zipstrm.cpp C zstream.cpp C @@ -272,6 +274,7 @@ window.cpp M xpmhand.cpp M gsocket.c M S +dialup.cpp U threadpsx.cpp U utilsunx.cpp U gsocket.c U diff --git a/docs/html/roadmap.htm b/docs/html/roadmap.htm index 9004218405..0bda1ab4bd 100644 --- a/docs/html/roadmap.htm +++ b/docs/html/roadmap.htm @@ -116,6 +116,7 @@ combined base/GUI library for GUI applications only.
  • Release date: c. July 2nd, 2000
  • Unicode compilation working in wxGTK and wxMSW.
  • wxDateTime class. +
  • Regular expressions support.

    diff --git a/include/wx/app.h b/include/wx/app.h index 7deb0a45a7..ea63c80601 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -37,7 +37,9 @@ #include "wx/event.h" // for the base class -#include "wx/window.h" // for wxTopLevelWindows +#if wxUSE_GUI + #include "wx/window.h" // for wxTopLevelWindows +#endif // wxUSE_GUI #if wxUSE_LOG #include "wx/log.h" @@ -64,22 +66,33 @@ public: // prevents the program from continuing - it's a good place to create // the top level program window and return TRUE. // - // Override: always. + // Override: always in GUI application, rarely in console ones. +#if wxUSE_GUI virtual bool OnInit() { return FALSE; }; +#else // !GUI + virtual bool OnInit() { return TRUE; }; +#endif // wxUSE_GUI +#if wxUSE_GUI // a platform-dependent version of OnInit(): the code here is likely to // depend on the toolkit. default version does nothing. // // Override: rarely. virtual bool OnInitGui() { return TRUE; } +#endif // wxUSE_GUI // called to start program execution - the default version just enters // the main GUI loop in which events are received and processed until // the last window is not deleted (if GetExitOnFrameDelete) or - // ExitMainLoop() is called. + // ExitMainLoop() is called. In console mode programs, the execution + // of the program really starts here // - // Override: rarely. + // Override: rarely in GUI applications, always in console ones. +#if wxUSE_GUI virtual int OnRun() { return MainLoop(); }; +#else // !GUI + virtual int OnRun() = 0; +#endif // wxUSE_GUI // called after the main loop termination. This is a good place for // cleaning up (it may be too late in dtor) and is also useful if you @@ -102,6 +115,7 @@ public: // the worker functions - usually not used directly by the user code // ----------------------------------------------------------------- +#if wxUSE_GUI // execute the main GUI loop, the function returns when the loop ends virtual int MainLoop() = 0; @@ -118,6 +132,7 @@ public: // process the first event in the event queue (blocks until an event // apperas if there are none currently) virtual void Dispatch() = 0; +#endif // wxUSE_GUI // application info: name, description, vendor // ------------------------------------------- @@ -144,6 +159,7 @@ public: const wxString& GetVendorName() const { return m_vendorName; } void SetVendorName(const wxString& name) { m_vendorName = name; } +#if wxUSE_GUI // top level window functions // -------------------------- @@ -171,6 +187,8 @@ public: void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; } bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; } +#endif // wxUSE_GUI + // miscellaneous customization functions // ------------------------------------- @@ -179,10 +197,15 @@ public: // user-defined class (default implementation creates a wxLogGui // object) - this log object is used by default by all wxLogXXX() // functions. - virtual wxLog *CreateLogTarget() { return new wxLogGui; } + virtual wxLog *CreateLogTarget() +#if wxUSE_GUI + { return new wxLogGui; } +#else // !GUI + { return new wxLogStderr; } +#endif // wxUSE_GUI #endif // wxUSE_LOG - +#if wxUSE_GUI // get the standard icon used by wxWin dialogs - this allows the user // to customize the standard dialogs. The 'which' parameter is one of // wxICON_XXX values @@ -198,6 +221,7 @@ public: // printing. virtual void SetPrintMode(int WXUNUSED(mode)) { } int GetPrintMode() const { return wxPRINT_POSTSCRIPT; } +#endif // wxUSE_GUI // implementation only from now on // ------------------------------- @@ -228,29 +252,35 @@ protected: // TRUE if the application wants to get debug output bool m_wantDebugOutput; +#if wxUSE_GUI // the main top level window - may be NULL wxWindow *m_topWindow; +#endif // wxUSE_GUI }; // ---------------------------------------------------------------------------- // now include the declaration of the real class // ---------------------------------------------------------------------------- -#if defined(__WXMSW__) - #include "wx/msw/app.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/app.h" -#elif defined(__WXQT__) - #include "wx/qt/app.h" -#elif defined(__WXGTK__) - #include "wx/gtk/app.h" -#elif defined(__WXMAC__) - #include "wx/mac/app.h" -#elif defined(__WXPM__) - #include "wx/os2/app.h" -#elif defined(__WXSTUBS__) - #include "wx/stubs/app.h" -#endif +#if wxUSE_GUI + #if defined(__WXMSW__) + #include "wx/msw/app.h" + #elif defined(__WXMOTIF__) + #include "wx/motif/app.h" + #elif defined(__WXQT__) + #include "wx/qt/app.h" + #elif defined(__WXGTK__) + #include "wx/gtk/app.h" + #elif defined(__WXMAC__) + #include "wx/mac/app.h" + #elif defined(__WXPM__) + #include "wx/os2/app.h" + #elif defined(__WXSTUBS__) + #include "wx/stubs/app.h" + #endif +#else // !GUI + typedef wxAppBase wxApp; +#endif // GUI/!GUI // ---------------------------------------------------------------------------- // the global data @@ -266,11 +296,34 @@ WXDLLEXPORT_DATA(extern wxApp*) wxTheApp; // global functions // ---------------------------------------------------------------------------- +// event loop related functions only work in GUI programs +// ------------------------------------------------------ + +#if wxUSE_GUI + // Force an exit from main loop -void WXDLLEXPORT wxExit(); +extern void WXDLLEXPORT wxExit(); // Yield to other apps/messages -bool WXDLLEXPORT wxYield(); +extern bool WXDLLEXPORT wxYield(); + +#endif // wxUSE_GUI + +// console applications may avoid using DECLARE_APP and IMPLEMENT_APP macros +// and call these functions instead at the program startup and termination +// ------------------------------------------------------------------------- + +#if wxUSE_NOGUI + +// initialize the library (may be called as many times as needed, but each +// call to wxInitialize() must be matched by wxUninitialize()) +extern bool WXDLLEXPORT wxInitialize(); + +// clean up - the library can't be used any more after the last call to +// wxUninitialize() +extern void WXDLLEXPORT wxUninitialize(); + +#endif // wxUSE_NOGUI // ---------------------------------------------------------------------------- // macros for dynamic creation of the application object diff --git a/include/wx/arrimpl.cpp b/include/wx/arrimpl.cpp index e7bca61b23..22a1239098 100644 --- a/include/wx/arrimpl.cpp +++ b/include/wx/arrimpl.cpp @@ -2,7 +2,7 @@ // Name: listimpl.cpp // Purpose: helper file for implementation of dynamic lists // Author: Vadim Zeitlin -// Modified by: +// Modified by: // Created: 16.10.97 // RCS-ID: $Id$ // Copyright: (c) 1997 Vadim Zeitlin @@ -20,6 +20,9 @@ * 4) WX_DEFINE_OBJARRAY * *****************************************************************************/ +// needed to resolve the conflict between global T and macro parameter T +#define _WX_ERROR_REMOVE2(x) T("bad index in " #x "::Remove()") + // macro implements remaining (not inline) methods of template list // (it's private to this file) #undef _DEFINE_OBJARRAY @@ -58,7 +61,7 @@ void name::Empty() \ \ void name::Remove(size_t uiIndex) \ { \ - wxCHECK_RET( uiIndex < Count(), _T("bad index in " #name "::Remove()") ); \ + wxCHECK_RET( uiIndex < Count(), _WX_ERROR_REMOVE2(name) ); \ \ delete (T*)wxBaseArray::Item(uiIndex); \ \ @@ -99,8 +102,8 @@ int name::Index(const T& Item, bool bFromEnd) const \ } \ } \ \ - return wxNOT_FOUND; \ -} + return wxNOT_FOUND; \ +} // redefine the macro so that now it will generate the class implementation // old value would provoke a compile-time error if this file is not included diff --git a/include/wx/buffer.h b/include/wx/buffer.h index afc0776994..feb1c3c33f 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -15,6 +15,7 @@ #define _WX_BUFFER_H #include "wx/wxchar.h" + #include // strdup // ---------------------------------------------------------------------------- @@ -27,14 +28,14 @@ class wxCharBuffer public: wxCharBuffer(const char *str) { - wxASSERT_MSG( str, _T("NULL string in wxCharBuffer") ); + wxASSERT_MSG( str, T("NULL string in wxCharBuffer") ); m_str = str ? strdup(str) : (char *)NULL; } wxCharBuffer(size_t len) { m_str = (char *)malloc(len+1); - m_str[len] = '\0'; + m_str[len] = '\0'; } // no need to check for NULL, free() does it ~wxCharBuffer() { free(m_str); } @@ -66,7 +67,7 @@ class wxWCharBuffer public: wxWCharBuffer(const wchar_t *wcs) { - wxASSERT_MSG( wcs, _T("NULL string in wxWCharBuffer") ); + wxASSERT_MSG( wcs, T("NULL string in wxWCharBuffer") ); if (wcs) { size_t siz = (wcslen(wcs)+1)*sizeof(wchar_t); @@ -78,7 +79,7 @@ public: wxWCharBuffer(size_t len) { m_wcs = (wchar_t *)malloc((len+1)*sizeof(wchar_t)); - m_wcs[len] = L'\0'; + m_wcs[len] = L'\0'; } // no need to check for NULL, free() does it @@ -100,23 +101,23 @@ public: operator const wchar_t *() const { return m_wcs; } wchar_t operator[](size_t n) const { return m_wcs[n]; } - + private: wchar_t *m_wcs; }; #endif #if wxUSE_UNICODE -#define wxMB2WXbuf wxWCharBuffer -#define wxWX2MBbuf wxCharBuffer -#define wxWC2WXbuf wxChar* -#define wxWX2WCbuf wxChar* -#else -#define wxMB2WXbuf wxChar* -#define wxWX2MBbuf wxChar* -#define wxWC2WXbuf wxCharBuffer -#define wxWX2WCbuf wxWCharBuffer -#endif + #define wxMB2WXbuf wxWCharBuffer + #define wxWX2MBbuf wxCharBuffer + #define wxWC2WXbuf wxChar* + #define wxWX2WCbuf wxChar* +#else // ANSI + #define wxMB2WXbuf wxChar* + #define wxWX2MBbuf wxChar* + #define wxWC2WXbuf wxCharBuffer + #define wxWX2WCbuf wxWCharBuffer +#endif // Unicode/ANSI // ---------------------------------------------------------------------------- // template class for any kind of data diff --git a/include/wx/debug.h b/include/wx/debug.h index 99d01d268a..c7a69752d3 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: debug.h +// Name: wx/debug.h // Purpose: Misc debug functions and macros // Author: Vadim Zeitlin // Modified by: // Created: 29/01/98 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DEBUG_H_ @@ -16,24 +16,19 @@ #include "wx/wxchar.h" -#ifndef __TFILE__ -#define __XFILE__(x) _T(x) -#define __TFILE__ __XFILE__(__FILE__) -#endif - // ---------------------------------------------------------------------------- -/** - @name Debugging macros +/** + @name Debugging macros All debugging macros rely on ASSERT() which in turn calls user-defined OnAssert() function. To keep things simple, it's called even when the expression is TRUE (i.e. everything is ok) and by default does nothing: just returns the same value back. But if you redefine it to do something more sexy - (popping up a message box in your favourite GUI, sending you e-mail or + (popping up a message box in your favourite GUI, sending you e-mail or whatever) it will affect all ASSERTs, FAILs and CHECKs in your code.

    - Warning: if you don't like advices on programming style, don't read + Warning: if you don't like advices on programming style, don't read further! ;-)

    @@ -94,13 +89,13 @@ // NB: these macros work also in release mode! -/** +/** These macros must be used only in invalid situation: for example, an invalid parameter (NULL pointer) is passed to a function. Instead of dereferencing it and causing core dump the function might try using CHECK( p != NULL ) or CHECK( p != NULL, return LogError("p is NULL!!") ) - @name Macros which remain even in 'release' mode + @name Macros which remain even in 'release' mode */ //@{ /// check that expression is true, "return" if not (also FAILs in debug mode) diff --git a/include/wx/defs.h b/include/wx/defs.h index 4d44264966..d17af9918c 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -115,13 +115,11 @@ # pragma suppress 571 // Virtual function hiding #endif // __SALFORDC__ -#ifdef __VISUALC__ -#ifndef WIN32 -// VC1.5 does not have LPTSTR type -#define LPTSTR LPSTR -#define LPCTSTR LPCSTR -#endif -#endif +#if defined(__VISUALC__) && !defined(WIN32) + // VC1.5 does not have LPTSTR type + #define LPTSTR LPSTR + #define LPCTSTR LPCSTR +#endif // VC++ 1.5 // Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files, // so define it ourselves @@ -190,8 +188,9 @@ // Make sure the environment is set correctly #if defined(__WXMSW__) && defined(__X__) #error "Target can't be both X and Windows" -#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXPM__) && \ - !defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__) +#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \ + !defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \ + !defined(__WXQT__) && !defined(__WXSTUBS__) && wxUSE_GUI #error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXPM__|__WXSTUBS__]" #endif @@ -215,6 +214,17 @@ #include "wx/version.h" +// ---------------------------------------------------------------------------- +// compatibility defines +// ---------------------------------------------------------------------------- + +// possibility to build non GUI apps is new, so don't burden ourselves with +// compatibility code +#if !wxUSE_GUI + #undef WXWIN_COMPATIBILITY_2 + #define WXWIN_COMPATIBILITY_2 0 +#endif // !GUI + // ============================================================================ // non portable C++ features // ============================================================================ @@ -223,21 +233,14 @@ // check for native bool type and TRUE/FALSE constants // ---------------------------------------------------------------------------- -#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXPM__) || defined(__WXSTUBS__) - // Bool is now obsolete, use bool instead - // typedef int Bool; +// define boolean constants if not done yet +#ifndef TRUE + #define TRUE 1 +#endif - #ifndef TRUE - #define TRUE 1 - #define FALSE 0 - #define Bool_DEFINED - #endif -#elif defined(__WXMSW__) - #ifndef TRUE - #define TRUE 1 - #define FALSE 0 - #endif -#endif // TRUE/FALSE +#ifndef FALSE + #define FALSE 0 +#endif // Add more tests here for Windows compilers that already define bool // (under Unix, configure tests for this) diff --git a/include/wx/dialup.h b/include/wx/dialup.h index 8ff4498910..94509be84a 100644 --- a/include/wx/dialup.h +++ b/include/wx/dialup.h @@ -24,7 +24,7 @@ extern const wxChar *wxEmptyString; -#define WXDIALUP_MANAGER_DEFAULT_BEACONHOST _T("www.yahoo.com") +#define WXDIALUP_MANAGER_DEFAULT_BEACONHOST T("www.yahoo.com") // ---------------------------------------------------------------------------- // A class which groups functions dealing with connecting to the network from a @@ -78,7 +78,7 @@ public: bool async = TRUE) = 0; // returns TRUE if (async) dialing is in progress - virtual bool IsDialling() const = 0; + virtual bool IsDialing() const = 0; // cancel dialing the number initiated with Dial(async = TRUE) // NB: this won't result in DISCONNECTED event being sent @@ -129,8 +129,8 @@ public: // Sets the commands to start up the network and to hang up again. Used by // the Unix implementations only. virtual void - SetConnectCommand(const wxString& commandDial = _T("/usr/bin/pon"), - const wxString& commandHangup = _T("/usr/bin/poff")) = 0; + SetConnectCommand(const wxString& commandDial = T("/usr/bin/pon"), + const wxString& commandHangup = T("/usr/bin/poff")) = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index 9f8f7a3ad0..b5466516d2 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -151,6 +151,11 @@ private: // template classes // ============================================================================ +// resolves the name conflict between the T() macor and T typedef: we can't +// use T() inside WX_DEFINE_ARRAY! +#define _WX_ERROR_SIZEOF T("illegal use of DEFINE_ARRAY") +#define _WX_ERROR_REMOVE T("removing inexisting element in wxArray::Remove") + // ---------------------------------------------------------------------------- // This macro generates a new array class. It is intended for storage of simple // types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long) @@ -170,7 +175,7 @@ public: \ size_t type = sizeof(T); \ size_t sizelong = sizeof(long); \ if ( type > sizelong ) \ - { wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \ + { wxFAIL_MSG( _WX_ERROR_SIZEOF ); } \ } \ \ name& operator=(const name& src) \ @@ -197,7 +202,7 @@ public: \ void Remove(T Item) \ { int iIndex = Index(Item); \ wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ - _T("removing inexisting element in wxArray::Remove") ); \ + _WX_ERROR_REMOVE); \ wxBaseArray::Remove((size_t)iIndex); } \ \ void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \ @@ -232,7 +237,7 @@ public: \ { size_t type = sizeof(T); \ size_t sizelong = sizeof(long); \ if ( type > sizelong ) \ - { wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \ + { wxFAIL_MSG( _WX_ERROR_SIZEOF ); } \ m_fnCompare = fn; \ } \ \ @@ -259,7 +264,7 @@ public: \ void Remove(T Item) \ { int iIndex = Index(Item); \ wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \ - _T("removing inexisting element in wxArray::Remove") ); \ + _WX_ERROR_REMOVE ); \ wxBaseArray::Remove((size_t)iIndex); } \ \ private: \ diff --git a/include/wx/event.h b/include/wx/event.h index 71c3bcfb61..c1c6517ea3 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -18,16 +18,30 @@ #include "wx/defs.h" #include "wx/object.h" -#include "wx/gdicmn.h" + +#if wxUSE_GUI + #include "wx/gdicmn.h" +#endif #if wxUSE_THREADS #include "wx/thread.h" #endif -/* - * Event types - * - */ +// ---------------------------------------------------------------------------- +// forward declarations +// ---------------------------------------------------------------------------- + +class WXDLLEXPORT wxList; + +#if wxUSE_GUI + class WXDLLEXPORT wxClientData; + class WXDLLEXPORT wxDC; + class WXDLLEXPORT wxMenu; +#endif // wxUSE_GUI + +// ---------------------------------------------------------------------------- +// Event types +// ---------------------------------------------------------------------------- typedef int wxEventType; @@ -336,6 +350,8 @@ public: bool m_isCommandEvent; }; +#if wxUSE_GUI + // Item or menu event class /* wxEVT_COMMAND_BUTTON_CLICKED @@ -354,8 +370,6 @@ public: wxEVT_COMMAND_COMBOBOX_SELECTED */ -class WXDLLEXPORT wxClientData; - class WXDLLEXPORT wxCommandEvent : public wxEvent { DECLARE_DYNAMIC_CLASS(wxCommandEvent) @@ -523,7 +537,6 @@ public: wxEVT_NC_RIGHT_DCLICK, */ -class WXDLLEXPORT wxDC; class WXDLLEXPORT wxMouseEvent : public wxEvent { DECLARE_DYNAMIC_CLASS(wxMouseEvent) @@ -764,7 +777,6 @@ public: wxEVT_ERASE_BACKGROUND */ -class WXDLLEXPORT wxDC; class WXDLLEXPORT wxEraseEvent : public wxEvent { DECLARE_DYNAMIC_CLASS(wxEraseEvent) @@ -884,7 +896,7 @@ public: { // GetVeto() will return FALSE anyhow... wxCHECK_RET( m_canVeto, - _T("call to Veto() ignored (can't veto this event)") ); + T("call to Veto() ignored (can't veto this event)") ); m_veto = veto; } @@ -1069,36 +1081,11 @@ public: void CopyObject(wxObject& obj) const; }; -// Idle event -/* - wxEVT_IDLE - */ - -class WXDLLEXPORT wxIdleEvent : public wxEvent -{ - DECLARE_DYNAMIC_CLASS(wxIdleEvent) - -public: - wxIdleEvent() - { m_eventType = wxEVT_IDLE; m_requestMore = FALSE; } - - void RequestMore(bool needMore = TRUE) { m_requestMore = needMore; } - bool MoreRequested() const { return m_requestMore; } - - void CopyObject(wxObject& obj) const; - -protected: - bool m_requestMore; -}; - // Update UI event /* wxEVT_UPDATE_UI */ -class WXDLLEXPORT wxMenu; -class WXDLLEXPORT wxWindow; - class WXDLLEXPORT wxUpdateUIEvent : public wxCommandEvent { DECLARE_DYNAMIC_CLASS(wxUpdateUIEvent) @@ -1256,6 +1243,30 @@ public: wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } }; +#endif // wxUSE_GUI + +// Idle event +/* + wxEVT_IDLE + */ + +class WXDLLEXPORT wxIdleEvent : public wxEvent +{ + DECLARE_DYNAMIC_CLASS(wxIdleEvent) + +public: + wxIdleEvent() + { m_eventType = wxEVT_IDLE; m_requestMore = FALSE; } + + void RequestMore(bool needMore = TRUE) { m_requestMore = needMore; } + bool MoreRequested() const { return m_requestMore; } + + void CopyObject(wxObject& obj) const; + +protected: + bool m_requestMore; +}; + /* TODO wxEVT_POWER, wxEVT_MOUSE_CAPTURE_CHANGED, @@ -1267,11 +1278,6 @@ public: wxEVT_COMPARE_ITEM */ -class WXDLLEXPORT wxWindow; -class WXDLLEXPORT wxControl; - -// struct WXDLLEXPORT wxEventTableEntry; - typedef void (wxObject::*wxObjectEventFunction)(wxEvent&); struct WXDLLEXPORT wxEventTableEntry @@ -1312,7 +1318,7 @@ public: virtual void OnCommand(wxWindow& WXUNUSED(win), wxCommandEvent& WXUNUSED(event)) { - wxFAIL_MSG(_T("shouldn't be called any more")); + wxFAIL_MSG(T("shouldn't be called any more")); } // Called if child control has no callback function @@ -1373,6 +1379,7 @@ protected: }; typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&); +#if wxUSE_GUI typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&); typedef void (wxEvtHandler::*wxScrollEventFunction)(wxScrollEvent&); typedef void (wxEvtHandler::*wxScrollWinEventFunction)(wxScrollWinEvent&); @@ -1398,6 +1405,7 @@ typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxShowEvent&); typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&); typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&); typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&); +#endif // wxUSE_GUI // N.B. In GNU-WIN32, you *have* to take the address of a member function // (use &) or the compiler crashes... @@ -1603,13 +1611,17 @@ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ #define EVT_UPDATE_UI(id, func) \ { wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\ -/* - * Helper functions - */ +// ---------------------------------------------------------------------------- +// Helper functions +// ---------------------------------------------------------------------------- + +#if wxUSE_GUI // Find a window with the focus, that is also a descendant of the given window. // This is used to determine the window to initially send commands to. wxWindow* wxFindFocusDescendant(wxWindow* ancestor); +#endif // wxUSE_GUI + #endif // _WX_EVENTH__ diff --git a/include/wx/ffile.h b/include/wx/ffile.h index 6a3f6fdb9e..640becf4c5 100644 --- a/include/wx/ffile.h +++ b/include/wx/ffile.h @@ -51,7 +51,7 @@ public: bool Close(); // assign an existing file descriptor and get it back from wxFFile object - void Attach(FILE *fp, const wxString& name = _T("")) + void Attach(FILE *fp, const wxString& name = T("")) { Close(); m_fp = fp; m_name = name; } void Detach() { m_fp = NULL; } FILE *fp() const { return m_fp; } diff --git a/include/wx/fileconf.h b/include/wx/fileconf.h index f6c4718919..041763ec98 100644 --- a/include/wx/fileconf.h +++ b/include/wx/fileconf.h @@ -141,9 +141,9 @@ public: // New constructor: one size fits all. Specify wxCONFIG_USE_LOCAL_FILE or // wxCONFIG_USE_GLOBAL_FILE to say which files should be used. wxFileConfig(const wxString& appName, - const wxString& vendorName = _T(""), - const wxString& localFilename = _T(""), - const wxString& globalFilename = _T(""), + const wxString& vendorName = T(""), + const wxString& localFilename = T(""), + const wxString& globalFilename = T(""), long style = wxCONFIG_USE_LOCAL_FILE); // dtor will save unsaved data diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 152bfaea4b..b0565fdbbf 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -159,15 +159,15 @@ WXDLLEXPORT bool wxMkdir(const wxString& dir, int perm = 0777); WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0); // separators in file names -#define wxFILE_SEP_EXT _T('.') -#define wxFILE_SEP_DSK _T(':') -#define wxFILE_SEP_PATH_DOS _T('\\') -#define wxFILE_SEP_PATH_UNIX _T('/') +#define wxFILE_SEP_EXT T('.') +#define wxFILE_SEP_DSK T(':') +#define wxFILE_SEP_PATH_DOS T('\\') +#define wxFILE_SEP_PATH_UNIX T('/') // separator in the path list (as in PATH environment variable) // NB: these are strings and not characters on purpose! -#define wxPATH_SEP_DOS _T(";") -#define wxPATH_SEP_UNIX _T(":") +#define wxPATH_SEP_DOS T(";") +#define wxPATH_SEP_UNIX T(":") // platform independent versions #ifdef __UNIX__ diff --git a/include/wx/fontenum.h b/include/wx/fontenum.h index 8ee785ffc6..02f94a8930 100644 --- a/include/wx/fontenum.h +++ b/include/wx/fontenum.h @@ -32,7 +32,7 @@ public: // enumerate the different encodings either for given font family or for // all font families - will result in OnFontEncoding() being called for // each available (family, encoding) couple - virtual bool EnumerateEncodings(const wxString& family = _T("")); + virtual bool EnumerateEncodings(const wxString& family = T("")); // callbacks which are called after one of EnumerateXXX() functions from // above is invoked - all of them may return FALSE to stop enumeration or diff --git a/include/wx/generic/filedlgg.h b/include/wx/generic/filedlgg.h index df25b6ddfa..f58d703f33 100644 --- a/include/wx/generic/filedlgg.h +++ b/include/wx/generic/filedlgg.h @@ -100,7 +100,7 @@ public: const wxSize &size = wxDefaultSize, long style = wxLC_LIST, const wxValidator &validator = wxDefaultValidator, - const wxString &name = _T("filelist") ); + const wxString &name = T("filelist") ); void ChangeToListMode(); void ChangeToReportMode(); void ChangeToIconMode(); diff --git a/include/wx/generic/progdlgg.h b/include/wx/generic/progdlgg.h index 7ea2672c35..0b806f6b0d 100644 --- a/include/wx/generic/progdlgg.h +++ b/include/wx/generic/progdlgg.h @@ -54,7 +54,7 @@ public: @param newmsg if used, new message to display @returns true if ABORT button has not been pressed */ - bool Update(int value = -1, const wxString& newmsg = _T("")); + bool Update(int value = -1, const wxString& newmsg = T("")); /* Can be called to continue after the cancel button has been pressed, but the program decided to continue the operation (e.g., user didn't diff --git a/include/wx/gtk/frame.h b/include/wx/gtk/frame.h index 4470508567..19563836cf 100644 --- a/include/wx/gtk/frame.h +++ b/include/wx/gtk/frame.h @@ -64,7 +64,7 @@ public: #if wxUSE_STATUSBAR virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0, - const wxString& name = _T("statusBar")); + const wxString& name = T("statusBar")); virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id, const wxString& name ); virtual wxStatusBar *GetStatusBar() const; diff --git a/include/wx/gtk/mdi.h b/include/wx/gtk/mdi.h index 0613d4c81e..0de3e863bc 100644 --- a/include/wx/gtk/mdi.h +++ b/include/wx/gtk/mdi.h @@ -121,8 +121,12 @@ class wxMDIChildFrame: public wxFrame #if wxUSE_STATUSBAR // no status bars - virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1, - wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; } + virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, + long WXUNUSED(style) = 1, + wxWindowID WXUNUSED(id) = 1, + const wxString& WXUNUSED(name) = wxEmptyString) + { return (wxStatusBar*)NULL; } + virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} diff --git a/include/wx/gtk1/frame.h b/include/wx/gtk1/frame.h index 4470508567..19563836cf 100644 --- a/include/wx/gtk1/frame.h +++ b/include/wx/gtk1/frame.h @@ -64,7 +64,7 @@ public: #if wxUSE_STATUSBAR virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0, - const wxString& name = _T("statusBar")); + const wxString& name = T("statusBar")); virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id, const wxString& name ); virtual wxStatusBar *GetStatusBar() const; diff --git a/include/wx/gtk1/mdi.h b/include/wx/gtk1/mdi.h index 0613d4c81e..0de3e863bc 100644 --- a/include/wx/gtk1/mdi.h +++ b/include/wx/gtk1/mdi.h @@ -121,8 +121,12 @@ class wxMDIChildFrame: public wxFrame #if wxUSE_STATUSBAR // no status bars - virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1, - wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; } + virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1, + long WXUNUSED(style) = 1, + wxWindowID WXUNUSED(id) = 1, + const wxString& WXUNUSED(name) = wxEmptyString) + { return (wxStatusBar*)NULL; } + virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {} virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} diff --git a/include/wx/intl.h b/include/wx/intl.h index 2a8ccef47b..89206af323 100644 --- a/include/wx/intl.h +++ b/include/wx/intl.h @@ -32,7 +32,7 @@ // gettext() style macro (notice that xgettext should be invoked with "-k_" // option to extract the strings inside _() from the sources) #ifndef WXINTL_NO_GETTEXT_MACRO - #define _(str) wxGetTranslation(_T(str)) + #define _(str) wxGetTranslation(T(str)) #endif // ---------------------------------------------------------------------------- diff --git a/include/wx/ipcbase.h b/include/wx/ipcbase.h index 168eeefdf0..354bce5f7e 100644 --- a/include/wx/ipcbase.h +++ b/include/wx/ipcbase.h @@ -53,8 +53,8 @@ class WXDLLEXPORT wxConnectionBase: public wxObject inline ~wxConnectionBase(void) {} // Calls that CLIENT can make - virtual bool Execute(wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT ) = 0; - virtual bool Execute(const wxString& str) { return Execute(WXSTRINGCAST str, -1, wxIPC_TEXT); } + virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT ) = 0; + virtual bool Execute(const wxString& str) { return Execute(str, -1, wxIPC_TEXT); } virtual char *Request(const wxString& item, int *size = (int *) NULL, wxIPCFormat format = wxIPC_TEXT) = 0; virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0; virtual bool StartAdvise(const wxString& item) = 0; diff --git a/include/wx/log.h b/include/wx/log.h index 31f283dfdb..842f1ad487 100644 --- a/include/wx/log.h +++ b/include/wx/log.h @@ -245,7 +245,7 @@ protected: // GUI part (andnot just the base one) of the library, they're implemented in // src/generic/logg.cpp *and not src/common/log.cpp unlike all the rest) -#ifndef wxUSE_NOGUI +#if wxUSE_GUI // log everything to a text window (GUI only of course) class WXDLLEXPORT wxLogTextCtrl : public wxLog @@ -338,7 +338,7 @@ private: wxLogFrame *m_pLogFrame; // the log frame }; -#endif // wxUSE_NOGUI +#endif // wxUSE_GUI // ---------------------------------------------------------------------------- // /dev/null log target: suppress logging until this object goes out of scope @@ -464,7 +464,7 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode); // ---------------------------------------------------------------------------- #ifndef __TFILE__ - #define __XFILE__(x) _T(x) + #define __XFILE__(x) Tx) #define __TFILE__ __XFILE__(__FILE__) #endif @@ -473,12 +473,12 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode); // will take us immediately to the place of the failed API #ifdef __VISUALC__ #define wxLogApiError(api, rc) \ - wxLogDebug(_T("%s(%d): '%s' failed with error 0x%08lx (%s)."), \ + wxLogDebug(T("%s(%d): '%s' failed with error 0x%08lx (%s)."), \ __TFILE__, __LINE__, api, \ rc, wxSysErrorMsg(rc)) #else // !VC++ #define wxLogApiError(api, rc) \ - wxLogDebug(_T("In file %s at line %d: '%s' failed with " \ + wxLogDebug(T("In file %s at line %d: '%s' failed with " \ "error 0x%08lx (%s)."), \ __TFILE__, __LINE__, api, \ rc, wxSysErrorMsg(rc)) diff --git a/include/wx/motif/clipbrd.h b/include/wx/motif/clipbrd.h index 781a9a0b94..212a16fe53 100644 --- a/include/wx/motif/clipbrd.h +++ b/include/wx/motif/clipbrd.h @@ -110,7 +110,7 @@ class WXDLLEXPORT wxClipboardClient : public wxObject public: /* This list should be filled in with strings indicating the formats - this client can provide. Almost all clients will provide "TEXT". + this client can provide. Almost all clients will provide "TEXT(". Format names should be 4 characters long, so things will work out on the Macintosh */ wxStringList formats; @@ -147,7 +147,7 @@ class WXDLLEXPORT wxClipboard : public wxObject /* Set the clipboard string; does not require a client. */ void SetClipboardString(char *, long time); - /* Get data from the clipboard in the format "TEXT". */ + /* Get data from the clipboard in the format "TEXT(". */ char *GetClipboardString(long time); /* Get data from the clipboard */ diff --git a/include/wx/motif/dnd.h b/include/wx/motif/dnd.h index fab08d7476..2cb1947fa5 100644 --- a/include/wx/motif/dnd.h +++ b/include/wx/motif/dnd.h @@ -92,7 +92,7 @@ public: // the string ID identifies the format of clipboard or DnD data. a word // processor would e.g. add a wxTextDataObject and a wxPrivateDataObject - // to the clipboard - the latter with the Id "WXWORD_FORMAT". + // to the clipboard - the latter with the Id "WXWORD_FORMAT(". void SetId( const wxString& id ) { m_id = id; } diff --git a/include/wx/msw/curicop.h b/include/wx/msw/curicop.h index 8b1d002c3b..5023b7cff9 100644 --- a/include/wx/msw/curicop.h +++ b/include/wx/msw/curicop.h @@ -3,7 +3,7 @@ // Header signatures for various resources #define BFT_ICON 0x4349 /* 'IC' */ #define BFT_BITMAP 0x4d42 /* 'BM' */ -#define BFT_CURSOR 0x5450 /* 'PT' */ +#define BFT_CURSOR 0x5450 /* 'PT(' */ // This WIDTHBYTES macro determines the number of BYTES per scan line. #define WIDTHBYTES( i) ((i + 31) / 32 * 4) diff --git a/include/wx/msw/dde.h b/include/wx/msw/dde.h index ac926b679f..f04f5cc58a 100644 --- a/include/wx/msw/dde.h +++ b/include/wx/msw/dde.h @@ -54,8 +54,8 @@ public: ~wxDDEConnection(void); // Calls that CLIENT can make - virtual bool Execute(wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); - virtual bool Execute(const wxString& str) { return Execute(WXSTRINGCAST str, -1, wxIPC_TEXT); } + virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); + virtual bool Execute(const wxString& str) { return Execute(str, -1, wxIPC_TEXT); } virtual char *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT); virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); virtual bool StartAdvise(const wxString& item); diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index b4914567c0..74adabd04a 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -139,17 +139,17 @@ WXDLLEXPORT_DATA(extern HFONT) wxSTATUS_LINE_FONT; * for this combination of CTl3D/FAFA settings */ -#define STATIC_CLASS _T("STATIC") +#define STATIC_CLASS T("STATIC") #define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE) -#define CHECK_CLASS _T("BUTTON") +#define CHECK_CLASS T("BUTTON") #define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD) #define CHECK_IS_FAFA FALSE -#define RADIO_CLASS _T("BUTTON") +#define RADIO_CLASS T("BUTTON") #define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE) #define RADIO_SIZE 20 #define RADIO_IS_FAFA FALSE #define PURE_WINDOWS -#define GROUP_CLASS _T("BUTTON") +#define GROUP_CLASS T("BUTTON") #define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE) /* diff --git a/include/wx/object.h b/include/wx/object.h index 1835449082..6dc59bf649 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -117,13 +117,13 @@ WXDLLEXPORT wxObject* wxCreateStoredObject( wxInputStream& stream ); #define IMPLEMENT_DYNAMIC_CLASS(name, basename) \ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ { return new name; }\ - wxClassInfo name::sm_class##name((wxChar *) _T(#name), (wxChar *) _T(#basename), (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name); + wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename), (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name); // Multiple inheritance with two base classes #define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ { return new name; }\ - wxClassInfo name::sm_class##name((wxChar *) _T(#name), (wxChar *) _T(#basename1), (wxChar *) _T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name); + wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename1), (wxChar *) T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name); ////// ////// for abstract classes @@ -131,13 +131,13 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ // Single inheritance with one base class #define IMPLEMENT_ABSTRACT_CLASS(name, basename) \ - wxClassInfo name::sm_class##name((wxChar *) _T(#name), (wxChar *) _T(#basename), \ + wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename), \ (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) NULL); // Multiple inheritance with two base classes #define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \ - wxClassInfo name::sm_class##name((wxChar *) _T(#name), (wxChar *) _T(#basename1), \ - (wxChar *) _T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) NULL); + wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename1), \ + (wxChar *) T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) NULL); #define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS #define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2 diff --git a/include/wx/proplist.h b/include/wx/proplist.h index 98ac6d0e9c..2a7bc18e83 100644 --- a/include/wx/proplist.h +++ b/include/wx/proplist.h @@ -552,7 +552,7 @@ class WXDLLEXPORT wxListOfStringsListValidator: public wxPropertyListValidator // Called when the property is double clicked. bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); - bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = _T("String List Editor")); + bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = T("String List Editor")); // Called when the edit (...) button is pressed. void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); diff --git a/include/wx/sckipc.h b/include/wx/sckipc.h index 586b0d06ef..08879516f0 100644 --- a/include/wx/sckipc.h +++ b/include/wx/sckipc.h @@ -63,9 +63,9 @@ protected: friend class wxTCPServer; friend class wxTCPClient; friend void Client_OnRequest(wxSocketBase&, - wxSocketNotify, char *); + wxSocketNotify, char *); friend void Server_OnRequest(wxSocketServer&, - wxSocketNotify, char *); + wxSocketNotify, char *); public: wxTCPConnection(char *buffer, int size); @@ -73,7 +73,7 @@ public: virtual ~wxTCPConnection(); // Calls that CLIENT can make - bool Execute(wxChar *data, int size = -1, + bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT); char *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT); diff --git a/include/wx/strconv.h b/include/wx/strconv.h index 3ff2d7a8db..97239009c4 100644 --- a/include/wx/strconv.h +++ b/include/wx/strconv.h @@ -24,159 +24,175 @@ #if wxUSE_WCHAR_T -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // wxMBConv (base class for conversions, using libc conversion itself) -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- class WXDLLEXPORT wxMBConv { public: + // the actual conversion takes place here + virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; + virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; + + // No longer inline since BC++ complains. + const wxWCharBuffer cMB2WC(const char *psz) const; + const wxCharBuffer cWC2MB(const wchar_t *psz) const; - // the actual conversion takes place here - virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; - virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; - - // No longer inline since BC++ complains. - const wxWCharBuffer cMB2WC(const char *psz) const; - const wxCharBuffer cWC2MB(const wchar_t *psz) const; #if wxUSE_UNICODE - const wxWCharBuffer cMB2WX(const char *psz) const { return cMB2WC(psz); } - const wxCharBuffer cWX2MB(const wchar_t *psz) const { return cWC2MB(psz); } - const wchar_t* cWC2WX(const wchar_t *psz) const { return psz; } - const wchar_t* cMB2WC(const wchar_t *psz) const { return psz; } -#else - const char* cMB2WX(const char *psz) const { return psz; } - const char* cWX2MB(const char *psz) const { return psz; } - const wxCharBuffer cWC2WX(const wchar_t *psz) const { return cWC2MB(psz); } - const wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); } -#endif + const wxWCharBuffer cMB2WX(const char *psz) const { return cMB2WC(psz); } + const wxCharBuffer cWX2MB(const wchar_t *psz) const { return cWC2MB(psz); } + const wchar_t* cWC2WX(const wchar_t *psz) const { return psz; } + const wchar_t* cMB2WC(const wchar_t *psz) const { return psz; } +#else // ANSI + const char* cMB2WX(const char *psz) const { return psz; } + const char* cWX2MB(const char *psz) const { return psz; } + const wxCharBuffer cWC2WX(const wchar_t *psz) const { return cWC2MB(psz); } + const wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); } +#endif // Unicode/ANSI }; WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc; -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // wxMBConvFile (for conversion to filenames) -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMBConvFile: public wxMBConv +class WXDLLEXPORT wxMBConvFile : public wxMBConv { public: - virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; - virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; + virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; + virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; }; WXDLLEXPORT_DATA(extern wxMBConvFile) wxConvFile; -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // wxMBConvUTF7 (for conversion using UTF7 encoding) -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMBConvUTF7: public wxMBConv +class WXDLLEXPORT wxMBConvUTF7 : public wxMBConv { public: - virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; - virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; + virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; + virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; }; WXDLLEXPORT_DATA(extern wxMBConvUTF7) wxConvUTF7; -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // wxMBConvUTF8 (for conversion using UTF8 encoding) -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMBConvUTF8: public wxMBConv +class WXDLLEXPORT wxMBConvUTF8 : public wxMBConv { public: - virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; - virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; + virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; + virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; }; WXDLLEXPORT_DATA(extern wxMBConvUTF8) wxConvUTF8; #ifdef __WXGTK12__ -//--------------------------------------------------------------------------- + +// ---------------------------------------------------------------------------- // wxMBConvUTF8 (for conversion using GDK's internal converions) -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMBConvGdk: public wxMBConv +class WXDLLEXPORT wxMBConvGdk : public wxMBConv { public: - virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; - virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; + virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; + virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; }; WXDLLEXPORT_DATA(extern wxMBConvGdk) wxConvGdk; -#endif -//--------------------------------------------------------------------------- -// wxCSConv (for conversion based on laodable char sets) -//--------------------------------------------------------------------------- +#endif // wxGTK 1.2 -class wxCharacterSet; +// ---------------------------------------------------------------------------- +// wxCSConv (for conversion based on loadable char sets) +// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxCSConv: public wxMBConv +class WXDLLEXPORT wxCharacterSet; + +class WXDLLEXPORT wxCSConv : public wxMBConv { -private: - wxChar *m_name; - wxCharacterSet *m_cset; - bool m_deferred; - void SetName(const wxChar *charset); - public: - wxCSConv(const wxChar *charset); - virtual ~wxCSConv(); - void LoadNow(); - virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; - virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; + wxCSConv(const wxChar *charset); + virtual ~wxCSConv(); + + void LoadNow(); + + virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const; + virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const; + +private: + void SetName(const wxChar *charset); + + wxChar *m_name; + wxCharacterSet *m_cset; + bool m_deferred; }; WXDLLEXPORT_DATA(extern wxCSConv) wxConvLocal; -#define wxConv_local wxConvLocal - WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent; -#define wxConv_current wxConvCurrent -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // filename conversion macros -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // filenames are multibyte on Unix and probably widechar on Windows? #if defined(__UNIX__) || defined(__BORLANDC__) -#define wxMBFILES 1 + #define wxMBFILES 1 #else -#define wxMBFILES 0 + #define wxMBFILES 0 #endif #if wxMBFILES -#define wxFNCONV(name) wxConvFile.cWX2MB(name) -#define FNSTRINGCAST MBSTRINGCAST + #define wxFNCONV(name) wxConvFile.cWX2MB(name) + #define wxFNSTRINGCAST wxMBSTRINGCAST #else -#define wxFNCONV(name) name -#define FNSTRINGCAST WXSTRINGCAST + #define wxFNCONV(name) name + #define wxFNSTRINGCAST WXSTRINGCAST #endif #else // !wxUSE_WCHAR_T -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- // stand-ins in absence of wchar_t -//--------------------------------------------------------------------------- +// ---------------------------------------------------------------------------- -class WXDLLEXPORT wxMBConv +class WXDLLEXPORT wxMBConv { public: - const char* cMB2WX(const char *psz) const { return psz; } - const char* cWX2MB(const char *psz) const { return psz; } + const char* cMB2WX(const char *psz) const { return psz; } + const char* cWX2MB(const char *psz) const { return psz; } }; + WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc, wxConvFile; WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent; #define wxFNCONV(name) name -#define FNSTRINGCAST WXSTRINGCAST +#define wxFNSTRINGCAST WXSTRINGCAST #endif // wxUSE_WCHAR_T -#endif +// ---------------------------------------------------------------------------- +// macros for the most common conversions +// ---------------------------------------------------------------------------- + +#if wxUSE_UNICODE + #define wxConvertWX2MB(s) wxConvCurrent->cWX2MB(s) + #define wxConvertMB2WX(s) wxConvCurrent->cMB2WX(s) +#else // ANSI + // no conversions to do + #define wxConvertWX2MB(s) (s) + #define wxConvertMB2WX(s) (s) +#endif // Unicode/ANSI + +#endif // _WX_WXSTRCONVH__ diff --git a/include/wx/string.h b/include/wx/string.h index 993e8a9283..535b48f81c 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -9,13 +9,35 @@ // Licence: wxWindows license /////////////////////////////////////////////////////////////////////////////// +/* + Efficient string class [more or less] compatible with MFC CString, + wxWindows version 1 wxString and std::string and some handy functions + missing from string.h. +*/ + #ifndef _WX_WXSTRINGH__ #define _WX_WXSTRINGH__ #ifdef __GNUG__ -#pragma interface "string.h" + #pragma interface "string.h" +#endif + +// ---------------------------------------------------------------------------- +// conditinal compilation +// ---------------------------------------------------------------------------- + +// compile the std::string compatibility functions if defined +#define wxSTD_STRING_COMPATIBILITY + +// define to derive wxString from wxObject (deprecated!) +#ifdef WXSTRING_IS_WXOBJECT + #undef WXSTRING_IS_WXOBJECT #endif +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + #ifdef __WXMAC__ #include #endif @@ -34,57 +56,53 @@ #include // for strcasecmp() #endif // AIX -#ifndef WX_PRECOMP - #include "wx/defs.h" +#include "wx/defs.h" // everybody should include this +#include "wx/debug.h" // for wxASSERT() +#include "wx/wxchar.h" // for wxChar +#include "wx/buffer.h" // for wxCharBuffer +#include "wx/strconv.h" // for wxConvertXXX() macros and wxMBConv classes +#ifndef WX_PRECOMP #ifdef WXSTRING_IS_WXOBJECT - #include "wx/object.h" + #include "wx/object.h" // base class #endif #endif // !PCH -#include "wx/debug.h" -#include "wx/wxchar.h" -#include "wx/buffer.h" - -/* - Efficient string class [more or less] compatible with MFC CString, - wxWindows version 1 wxString and std::string and some handy functions - missing from string.h. -*/ - // --------------------------------------------------------------------------- // macros // --------------------------------------------------------------------------- -// compile the std::string compatibility functions if defined -#define wxSTD_STRING_COMPATIBILITY - -// define to derive wxString from wxObject -#ifdef WXSTRING_IS_WXOBJECT -#undef WXSTRING_IS_WXOBJECT -#endif - -// maximum possible length for a string means "take all string" everywhere -// (as sizeof(StringData) is unknown here we substract 100) -const unsigned int wxSTRING_MAXLEN = UINT_MAX - 100; - // 'naughty' cast #define WXSTRINGCAST (wxChar *)(const wxChar *) -#define WXCSTRINGCAST (wxChar *)(const wxChar *) -#define MBSTRINGCAST (char *)(const char *) -#define WCSTRINGCAST (wchar_t *)(const wchar_t *) +#define wxCSTRINGCAST (wxChar *)(const wxChar *) +#define wxMBSTRINGCAST (char *)(const char *) +#define wxWCSTRINGCAST (wchar_t *)(const wchar_t *) // implementation only #define ASSERT_VALID_INDEX(i) wxASSERT( (unsigned)(i) <= Len() ) -// include conversion classes -#include "wx/strconv.h" +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + +// maximum possible length for a string means "take all string" everywhere +// (as sizeof(StringData) is unknown here, we substract 100) +const unsigned int wxSTRING_MAXLEN = UINT_MAX - 100; + +// ---------------------------------------------------------------------------- +// global data +// ---------------------------------------------------------------------------- + +// global pointer to empty string +WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; // --------------------------------------------------------------------------- -// Global functions complementing standard C string library replacements for +// global functions complementing standard C string library replacements for // strlen() and portable strcasecmp() //--------------------------------------------------------------------------- -// USE wx* FUNCTIONS IN wx/wxchar.h INSTEAD - THIS IS ONLY FOR BINARY COMPATIBILITY + +// Use wxXXX() functions from wxchar.h instead! These functions are for +// backwards compatibility only. // checks whether the passed in pointer is NULL and if the string is empty inline bool WXDLLEXPORT IsEmpty(const char *p) { return (!p || !*p); } @@ -138,23 +156,15 @@ inline int WXDLLEXPORT Stricmp(const char *psz1, const char *psz2) #endif // OS/compiler } -// ---------------------------------------------------------------------------- -// global data -// ---------------------------------------------------------------------------- - -WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString; - -// global pointer to empty string -WXDLLEXPORT_DATA(extern const wxChar*) g_szNul; - // return an empty wxString class WXDLLEXPORT wxString; // not yet defined -inline const wxString& wxGetEmptyString() { return *(wxString *)&g_szNul; } +inline const wxString& wxGetEmptyString() { return *(wxString *)&wxEmptyString; } // --------------------------------------------------------------------------- // string data prepended with some housekeeping info (used by wxString class), // is never used directly (but had to be put here to allow inlining) // --------------------------------------------------------------------------- + struct WXDLLEXPORT wxStringData { int nRefs; // reference count @@ -225,7 +235,7 @@ private: // string (re)initialization functions // initializes the string to the empty value (must be called only from // ctors, use Reinit() otherwise) - void Init() { m_pchData = (wxChar *)g_szNul; } + void Init() { m_pchData = (wxChar *)wxEmptyString; } // initializaes the string with (a part of) C-string void InitWith(const wxChar *psz, size_t nPos = 0, size_t nLen = wxSTRING_MAXLEN); // as Init, but also frees old data @@ -278,6 +288,7 @@ public: // (default value of wxSTRING_MAXLEN means take all the string) wxString(const wxChar *psz, size_t nLength = wxSTRING_MAXLEN) { InitWith(psz, 0, nLength); } + #if wxUSE_UNICODE // from multibyte string // (NB: nLength is right now number of Unicode characters, not @@ -286,21 +297,24 @@ public: // from wxWCharBuffer (i.e. return from wxGetString) wxString(const wxWCharBuffer& psz) { InitWith(psz, 0, wxSTRING_MAXLEN); } -#else +#else // ANSI // from C string (for compilers using unsigned char) wxString(const unsigned char* psz, size_t nLength = wxSTRING_MAXLEN) { InitWith((const char*)psz, 0, nLength); } // from multibyte string wxString(const char *psz, wxMBConv& WXUNUSED(conv), size_t nLength = wxSTRING_MAXLEN) { InitWith(psz, 0, nLength); } + #if wxUSE_WCHAR_T // from wide (Unicode) string wxString(const wchar_t *pwz); -#endif +#endif // !wxUSE_WCHAR_T + // from wxCharBuffer wxString(const wxCharBuffer& psz) { InitWith(psz, 0, wxSTRING_MAXLEN); } -#endif +#endif // Unicode/ANSI + // dtor is not virtual, this class must not be inherited from! ~wxString() { GetStringData()->Unlock(); } @@ -378,25 +392,36 @@ public: const wxChar* c_str() const { return m_pchData; } // (and this with [wx]Printf()!) const wxChar* wx_str() const { return m_pchData; } - // + // identical to c_str() const wxChar* GetData() const { return m_pchData; } + + // conversions with (possible) format convertions: have to return a + // buffer with temporary data #if wxUSE_UNICODE const wxCharBuffer mb_str(wxMBConv& conv = wxConvLibc) const { return conv.cWC2MB(m_pchData); } + const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); } + const wxChar* wc_str(wxMBConv& WXUNUSED(conv) = wxConvLibc) const { return m_pchData; } + #if wxMBFILES const wxCharBuffer fn_str() const { return mb_str(wxConvFile); } -#else +#else // !wxMBFILES const wxChar* fn_str() const { return m_pchData; } -#endif -#else - const wxChar* mb_str(wxMBConv& WXUNUSED(conv) = wxConvLibc ) const { return m_pchData; } +#endif // wxMBFILES/!wxMBFILES +#else // ANSI +#if wxUSE_MULTIBYTE + const wxChar* mb_str(wxMBConv& WXUNUSED(conv) = wxConvLibc) const + { return m_pchData; } + const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); } +#else // !mmultibyte + const wxChar* mb_str() const { return m_pchData; } + const wxWX2MBbuf mbc_str() const { return mb_str(); } +#endif // multibyte/!multibyte #if wxUSE_WCHAR_T const wxWCharBuffer wc_str(wxMBConv& conv) const { return conv.cMB2WC(m_pchData); } -#endif +#endif // wxUSE_WCHAR_T const wxChar* fn_str() const { return m_pchData; } -#endif - // for convenience - const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); } +#endif // Unicode/ANSI // overloaded assignment // from another wxString @@ -408,7 +433,7 @@ public: #if wxUSE_UNICODE // from wxWCharBuffer wxString& operator=(const wxWCharBuffer& psz) { return operator=((const wchar_t *)psz); } -#else +#else // ANSI // from another kind of C string wxString& operator=(const unsigned char* psz); #if wxUSE_WCHAR_T @@ -417,7 +442,7 @@ public: #endif // from wxCharBuffer wxString& operator=(const wxCharBuffer& psz) { return operator=((const char *)psz); } -#endif +#endif // Unicode/ANSI // string concatenation // in place concatenation @@ -548,7 +573,7 @@ public: // remove spaces from left or from right (default) side wxString& Trim(bool bFromRight = TRUE); // add nCount copies chPad in the beginning or at the end (default) - wxString& Pad(size_t nCount, wxChar chPad = _T(' '), bool bFromRight = TRUE); + wxString& Pad(size_t nCount, wxChar chPad = T(' '), bool bFromRight = TRUE); // truncate string to given length wxString& Truncate(size_t uiLen); @@ -660,7 +685,7 @@ public: // return the maximum size of the string size_t max_size() const { return wxSTRING_MAXLEN; } // resize the string, filling the space with c if c != 0 - void resize(size_t nSize, wxChar ch = _T('\0')); + void resize(size_t nSize, wxChar ch = T('\0')); // delete the contents of the string void clear() { Empty(); } // returns true if the string is empty @@ -835,6 +860,7 @@ public: // so the original string may be safely deleted. When a string is retrieved // from the array (operator[] or Item() method), a reference is returned. // ---------------------------------------------------------------------------- + class WXDLLEXPORT wxArrayString { public: @@ -979,20 +1005,23 @@ wxString WXDLLEXPORT operator+(const wxString& string, const wxChar *psz); wxString WXDLLEXPORT operator+(const wxChar *psz, const wxString& string); #if wxUSE_UNICODE inline wxString WXDLLEXPORT operator+(const wxString& string, const wxWCharBuffer& buf) -{ return string + (const wchar_t *)buf; } + { return string + (const wchar_t *)buf; } inline wxString WXDLLEXPORT operator+(const wxWCharBuffer& buf, const wxString& string) -{ return (const wchar_t *)buf + string; } + { return (const wchar_t *)buf + string; } #else inline wxString WXDLLEXPORT operator+(const wxString& string, const wxCharBuffer& buf) -{ return string + (const char *)buf; } + { return string + (const char *)buf; } inline wxString WXDLLEXPORT operator+(const wxCharBuffer& buf, const wxString& string) -{ return (const char *)buf + string; } + { return (const char *)buf + string; } #endif // --------------------------------------------------------------------------- // Implementation only from here until the end of file // --------------------------------------------------------------------------- +// don't pollute the library user's name space +#undef ASSERT_VALID_INDEX + #if defined(wxSTD_STRING_COMPATIBILITY) && wxUSE_STD_IOSTREAM #include "wx/ioswrap.h" diff --git a/include/wx/utils.h b/include/wx/utils.h index 03503f6fdf..9e964e7a3d 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -74,7 +74,7 @@ WXDLLEXPORT bool StringMatch(wxChar *one, wxChar *two, bool subString = TRUE, bo // ---------------------------------------------------------------------------- // Sound the bell -WXDLLEXPORT void wxBell(void) ; +WXDLLEXPORT void wxBell(); // Get OS version WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ; @@ -82,6 +82,7 @@ WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int * // Return a string with the current date/time WXDLLEXPORT wxString wxNow(); +#if wxUSE_GUI // Don't synthesize KeyUp events holding down a key and producing // KeyDown events with autorepeat. On by default and always on // in wxMSW. @@ -106,6 +107,8 @@ WXDLLEXPORT void wxRegisterId(long id); // Return the current ID WXDLLEXPORT long wxGetCurrentId(); +#endif // wxUSE_GUI + // ---------------------------------------------------------------------------- // Various conversions // ---------------------------------------------------------------------------- @@ -215,6 +218,8 @@ WXDLLEXPORT const wxMB2WXbuf wxGetUserHome(const wxString& user = wxEmptyString) WXDLLEXPORT wxChar* wxGetUserHome(const wxString& user = wxEmptyString); #endif +#if wxUSE_GUI // GUI only things from now on + // ---------------------------------------------------------------------------- // Strip out any menu codes // ---------------------------------------------------------------------------- @@ -388,5 +393,7 @@ extern wxNativeFont wxLoadQueryNearestFont(int pointSize, #endif // X || GTK +#endif // wxUSE_GUI + #endif // _WX_UTILSH__ diff --git a/include/wx/variant.h b/include/wx/variant.h index ac685e092c..ff5797ec1a 100644 --- a/include/wx/variant.h +++ b/include/wx/variant.h @@ -81,22 +81,22 @@ public: // Construction & destruction wxVariant(); - wxVariant(double val, const wxString& name = g_szNul); - wxVariant(long val, const wxString& name = g_szNul); + wxVariant(double val, const wxString& name = wxEmptyString); + wxVariant(long val, const wxString& name = wxEmptyString); #ifdef HAVE_BOOL - wxVariant(bool val, const wxString& name = g_szNul); + wxVariant(bool val, const wxString& name = wxEmptyString); #endif - wxVariant(char val, const wxString& name = g_szNul); - wxVariant(const wxString& val, const wxString& name = g_szNul); - wxVariant(const wxChar* val, const wxString& name = g_szNul); // Necessary or VC++ assumes bool! - wxVariant(const wxStringList& val, const wxString& name = g_szNul); - wxVariant(const wxList& val, const wxString& name = g_szNul); // List of variants + wxVariant(char val, const wxString& name = wxEmptyString); + wxVariant(const wxString& val, const wxString& name = wxEmptyString); + wxVariant(const wxChar* val, const wxString& name = wxEmptyString); // Necessary or VC++ assumes bool! + wxVariant(const wxStringList& val, const wxString& name = wxEmptyString); + wxVariant(const wxList& val, const wxString& name = wxEmptyString); // List of variants #if wxUSE_TIMEDATE - wxVariant(const wxTime& val, const wxString& name = g_szNul); // Time - wxVariant(const wxDate& val, const wxString& name = g_szNul); // Date + wxVariant(const wxTime& val, const wxString& name = wxEmptyString); // Time + wxVariant(const wxDate& val, const wxString& name = wxEmptyString); // Date #endif - wxVariant(void* ptr, const wxString& name = g_szNul); // void* (general purpose) - wxVariant(wxVariantData* data, const wxString& name = g_szNul); // User-defined data + wxVariant(void* ptr, const wxString& name = wxEmptyString); // void* (general purpose) + wxVariant(wxVariantData* data, const wxString& name = wxEmptyString); // User-defined data wxVariant(const wxVariant& variant); ~wxVariant(); diff --git a/include/wx/wizard.h b/include/wx/wizard.h index 10f124d7dc..c67c89de87 100644 --- a/include/wx/wizard.h +++ b/include/wx/wizard.h @@ -81,7 +81,7 @@ public: static void Chain(wxWizardPageSimple *first, wxWizardPageSimple *second) { wxCHECK_RET( first && second, - _T("NULL passed to wxWizardPageSimple::Chain") ); + T("NULL passed to wxWizardPageSimple::Chain") ); first->SetNext(second); second->SetPrev(first); diff --git a/include/wx/wx.h b/include/wx/wx.h index fd1bddc0a1..ad7eeeaaca 100644 --- a/include/wx/wx.h +++ b/include/wx/wx.h @@ -6,16 +6,26 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WXH__ #define _WX_WXH__ -#include "wx/setup.h" // Which features to include - user editable #include "wx/defs.h" +#include "wx/object.h" +#include "wx/dynarray.h" +#include "wx/list.h" +#include "wx/hash.h" #include "wx/string.h" +#include "wx/intl.h" #include "wx/log.h" +#include "wx/event.h" +#include "wx/app.h" +#include "wx/utils.h" + +#if wxUSE_GUI + #include "wx/window.h" #include "wx/panel.h" #include "wx/frame.h" @@ -26,8 +36,6 @@ #include "wx/dcscreen.h" #include "wx/button.h" #include "wx/menu.h" -#include "wx/app.h" -#include "wx/event.h" #include "wx/list.h" #include "wx/pen.h" #include "wx/brush.h" @@ -36,7 +44,6 @@ #include "wx/cursor.h" #include "wx/dialog.h" #include "wx/timer.h" -#include "wx/utils.h" #include "wx/settings.h" #include "wx/msgdlg.h" #include "wx/cmndata.h" @@ -67,10 +74,6 @@ #include "wx/filedlg.h" #include "wx/dirdlg.h" -#if wxUSE_INTL - #include "wx/intl.h" -#endif // wxUSE_INTL - #if wxUSE_VALIDATORS #include "wx/valtext.h" #endif // wxUSE_VALIDATORS @@ -80,5 +83,7 @@ #include "wx/serbase.h" #endif // wxUSE_SERIAL +#endif // wxUSE_GUI + #endif // _WX_WXH__ diff --git a/include/wx/wxchar.h b/include/wx/wxchar.h index f764e67eb7..83273ef07a 100644 --- a/include/wx/wxchar.h +++ b/include/wx/wxchar.h @@ -230,7 +230,7 @@ typedef __WCHAR_TYPE__ wxChar; typedef signed __WCHAR_TYPE__ wxSChar; typedef unsigned __WCHAR_TYPE__ wxUChar; -# define _T(x) L##x +# define T(x) L##x // ctype.h functions (wctype.h) # define wxIsalnum iswalnum @@ -289,50 +289,54 @@ typedef unsigned __WCHAR_TYPE__ wxUChar; # include # include -# if 0 // temporary - preserve binary compatibilty -typedef char wxChar; -typedef signed char wxSChar; -typedef unsigned char wxUChar; -# else -# define wxChar char -# define wxSChar signed char -# define wxUChar unsigned char -# endif - -# ifdef __FreeBSD__ -# undef _T -# endif -# define _T(x) x +# if 0 // temporary - preserve binary compatibilty + typedef char wxChar; + typedef signed char wxSChar; + typedef unsigned char wxUChar; +# else +# define wxChar char +# define wxSChar signed char +# define wxUChar unsigned char +# endif + +# ifdef __FreeBSD__ +# undef T +# endif +# define T(x) x // ctype.h functions -# define wxIsalnum isalnum -# define wxIsalpha isalpha -# define wxIsctrl isctrl -# define wxIsdigit isdigit -# define wxIsgraph isgraph -# define wxIslower islower -# define wxIsprint isprint -# define wxIspunct ispunct -# define wxIsspace isspace -# define wxIsupper isupper -# define wxIsxdigit isxdigit -# define wxTolower tolower -# define wxToupper toupper - - // locale.h functons -# define wxSetlocale setlocale - - // string.h functions - // #define wxStricmp strcasecmp - // wxStricmp is defined below!! - - // #define wxStrtok strtok_r // this needs a configure check +# define wxIsalnum isalnum +# define wxIsalpha isalpha +# define wxIsctrl isctrl +# define wxIsdigit isdigit +# define wxIsgraph isgraph +# define wxIslower islower +# define wxIsprint isprint +# define wxIspunct ispunct +# define wxIsspace isspace +# define wxIsupper isupper +# define wxIsxdigit isxdigit +# define wxTolower tolower +# define wxToupper toupper + + // locale.h functons +# define wxSetlocale setlocale + + // string.h functions + // #define wxStricmp strcasecmp + // wxStricmp is defined below!! + + #ifdef HAVE_STRTOK_R + #define wxStrtok(str, sep, last) strtok_r(str, sep, last) + #else + #define wxStrtok(str, sep, last) strtok(str, sep) + #endif // leave the rest to defaults below -# define wxNEED_WX_STRING_H -# define wxNEED_WX_STDIO_H -# define wxNEED_WX_STDLIB_H -# define wxNEED_WX_TIME_H +# define wxNEED_WX_STRING_H +# define wxNEED_WX_STDIO_H +# define wxNEED_WX_STDLIB_H +# define wxNEED_WX_TIME_H # endif//Unicode #endif//TCHAR-aware compilers @@ -557,6 +561,12 @@ WXDLLEXPORT int wxSystem(const wxChar *psz); WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const struct tm *tm); #endif +// a Unicode-friendly __FILE__ analog +#ifndef __TFILE__ + #define __XFILE__(x) T(x) + #define __TFILE__ __XFILE__(__FILE__) +#endif + #endif //_WX_WXCHAR_H_ diff --git a/include/wx/wxexpr.h b/include/wx/wxexpr.h index adaaa4c7f5..6450d8aba8 100644 --- a/include/wx/wxexpr.h +++ b/include/wx/wxexpr.h @@ -112,7 +112,7 @@ class WXDLLEXPORT wxExpr return value.word; else if (type == wxExprString) return wxString(value.string); - else return wxString(_T("")); + else return wxString(T("")); } inline wxString StringValue(void) const { @@ -120,7 +120,7 @@ class WXDLLEXPORT wxExpr return wxString(value.string); else if (type == wxExprWord) return wxString(value.word); - else return wxString(_T("")); + else return wxString(T("")); } // Get nth arg of clause (starting from 1) diff --git a/samples/nettest/nettest.cpp b/samples/nettest/nettest.cpp index 81b1307b3a..b459649847 100644 --- a/samples/nettest/nettest.cpp +++ b/samples/nettest/nettest.cpp @@ -35,7 +35,7 @@ #include "wx/wx.h" #endif -#include "wx/net.h" +#include "wx/dialup.h" // ---------------------------------------------------------------------------- // private classes @@ -208,9 +208,6 @@ void MyApp::OnConnected(wxDialUpEvent& event) MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, -1, title, pos, size) { - // set the frame icon - SetIcon(wxICON(mondrian)); - // create a menu bar wxMenu *menuFile = new wxMenu; diff --git a/setup.h.in b/setup.h.in index f72174165e..6251dc39eb 100644 --- a/setup.h.in +++ b/setup.h.in @@ -131,11 +131,11 @@ /* * Use GUI */ -#define wxUSE_GUI 1 +#define wxUSE_GUI 0 /* - * Defined if !wxUSE_GUI + * Don't use GUI (defined to 1 when compiling/using base only) */ -#undef wxUSE_NOGUI +#define wxUSE_NOGUI 0 /* * Use constraints mechanism @@ -367,10 +367,20 @@ #define wxUSE_POSTSCRIPT 0 /* - * Compile wxString with wide character (Unicode) support? + * Compile wxString with some Unicode support? + */ +#define wxUSE_WCHAR_T 0 + +/* + * Compile wxString in wide character (Unicode) mode? */ #define wxUSE_UNICODE 0 +/* + * Compile wxString with (limited) multibyte char support? + */ +#define wxUSE_MULTIBYTE 0 + /* * Work around a bug in GNU libc 5.x wcstombs() implementation. * @@ -644,6 +654,9 @@ /* Define if you have the shl_load function. */ #undef HAVE_SHL_LOAD +/* Define if you have strtok_r function. */ +#undef HAVE_STRTOK_R + /* Define if you have the uname function. */ #undef HAVE_UNAME diff --git a/src/common/choiccmn.cpp b/src/common/choiccmn.cpp index ceeb467b8e..e37017f0ee 100644 --- a/src/common/choiccmn.cpp +++ b/src/common/choiccmn.cpp @@ -55,7 +55,7 @@ wxString wxChoiceBase::GetStringSelection() const { int sel = GetSelection(); wxString str; - wxCHECK_MSG( sel != wxNOT_FOUND, str, _T("no selection, hence no string") ); + wxCHECK_MSG( sel != wxNOT_FOUND, str, T("no selection, hence no string") ); str = GetString(sel); return str; @@ -65,7 +65,7 @@ bool wxChoiceBase::SetStringSelection(const wxString& sel) { int selIndex = FindString(sel); wxCHECK_MSG( selIndex != wxNOT_FOUND, FALSE, - _T("can't set selection to string not in the control") ); + T("can't set selection to string not in the control") ); SetSelection(selIndex); @@ -79,7 +79,7 @@ bool wxChoiceBase::SetStringSelection(const wxString& sel) void wxChoiceBase::SetClientObject(int n, wxClientData *data) { wxASSERT_MSG( m_clientDataItemsType != ClientData_Void, - _T("can't have both object and void client data") ); + T("can't have both object and void client data") ); wxClientData *clientDataOld = DoGetClientObject(n); if ( clientDataOld ) @@ -92,7 +92,7 @@ void wxChoiceBase::SetClientObject(int n, wxClientData *data) wxClientData *wxChoiceBase::GetClientObject(int n) const { wxASSERT_MSG( m_clientDataItemsType == ClientData_Object, - _T("this window doesn't have object client data") ); + T("this window doesn't have object client data") ); return DoGetClientObject(n); } @@ -100,7 +100,7 @@ wxClientData *wxChoiceBase::GetClientObject(int n) const void wxChoiceBase::SetClientData(int n, void *data) { wxASSERT_MSG( m_clientDataItemsType != ClientData_Object, - _T("can't have both object and void client data") ); + T("can't have both object and void client data") ); DoSetClientData(n, data); m_clientDataItemsType = ClientData_Void; @@ -109,7 +109,7 @@ void wxChoiceBase::SetClientData(int n, void *data) void *wxChoiceBase::GetClientData(int n) const { wxASSERT_MSG( m_clientDataItemsType == ClientData_Void, - _T("this window doesn't have void client data") ); + T("this window doesn't have void client data") ); return DoGetClientData(n); } diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 387b2c7f93..57e6007089 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -231,31 +231,31 @@ wxPrintData::~wxPrintData() static wxString wxGetPrintDlgError() { DWORD err = CommDlgExtendedError(); - wxString msg = _T("Unknown"); + wxString msg = T("Unknown"); switch (err) { - case CDERR_FINDRESFAILURE: msg = _T("CDERR_FINDRESFAILURE"); break; - case CDERR_INITIALIZATION: msg = _T("CDERR_INITIALIZATION"); break; - case CDERR_LOADRESFAILURE: msg = _T("CDERR_LOADRESFAILURE"); break; - case CDERR_LOADSTRFAILURE: msg = _T("CDERR_LOADSTRFAILURE"); break; - case CDERR_LOCKRESFAILURE: msg = _T("CDERR_LOCKRESFAILURE"); break; - case CDERR_MEMALLOCFAILURE: msg = _T("CDERR_MEMALLOCFAILURE"); break; - case CDERR_MEMLOCKFAILURE: msg = _T("CDERR_MEMLOCKFAILURE"); break; - case CDERR_NOHINSTANCE: msg = _T("CDERR_NOHINSTANCE"); break; - case CDERR_NOHOOK: msg = _T("CDERR_NOHOOK"); break; - case CDERR_NOTEMPLATE: msg = _T("CDERR_NOTEMPLATE"); break; - case CDERR_STRUCTSIZE: msg = _T("CDERR_STRUCTSIZE"); break; - case PDERR_RETDEFFAILURE: msg = _T("PDERR_RETDEFFAILURE"); break; - case PDERR_PRINTERNOTFOUND: msg = _T("PDERR_PRINTERNOTFOUND"); break; - case PDERR_PARSEFAILURE: msg = _T("PDERR_PARSEFAILURE"); break; - case PDERR_NODEVICES: msg = _T("PDERR_NODEVICES"); break; - case PDERR_NODEFAULTPRN: msg = _T("PDERR_NODEFAULTPRN"); break; - case PDERR_LOADDRVFAILURE: msg = _T("PDERR_LOADDRVFAILURE"); break; - case PDERR_INITFAILURE: msg = _T("PDERR_INITFAILURE"); break; - case PDERR_GETDEVMODEFAIL: msg = _T("PDERR_GETDEVMODEFAIL"); break; - case PDERR_DNDMMISMATCH: msg = _T("PDERR_DNDMMISMATCH"); break; - case PDERR_DEFAULTDIFFERENT: msg = _T("PDERR_DEFAULTDIFFERENT"); break; - case PDERR_CREATEICFAILURE: msg = _T("PDERR_CREATEICFAILURE"); break; + case CDERR_FINDRESFAILURE: msg = T("CDERR_FINDRESFAILURE"); break; + case CDERR_INITIALIZATION: msg = T("CDERR_INITIALIZATION"); break; + case CDERR_LOADRESFAILURE: msg = T("CDERR_LOADRESFAILURE"); break; + case CDERR_LOADSTRFAILURE: msg = T("CDERR_LOADSTRFAILURE"); break; + case CDERR_LOCKRESFAILURE: msg = T("CDERR_LOCKRESFAILURE"); break; + case CDERR_MEMALLOCFAILURE: msg = T("CDERR_MEMALLOCFAILURE"); break; + case CDERR_MEMLOCKFAILURE: msg = T("CDERR_MEMLOCKFAILURE"); break; + case CDERR_NOHINSTANCE: msg = T("CDERR_NOHINSTANCE"); break; + case CDERR_NOHOOK: msg = T("CDERR_NOHOOK"); break; + case CDERR_NOTEMPLATE: msg = T("CDERR_NOTEMPLATE"); break; + case CDERR_STRUCTSIZE: msg = T("CDERR_STRUCTSIZE"); break; + case PDERR_RETDEFFAILURE: msg = T("PDERR_RETDEFFAILURE"); break; + case PDERR_PRINTERNOTFOUND: msg = T("PDERR_PRINTERNOTFOUND"); break; + case PDERR_PARSEFAILURE: msg = T("PDERR_PARSEFAILURE"); break; + case PDERR_NODEVICES: msg = T("PDERR_NODEVICES"); break; + case PDERR_NODEFAULTPRN: msg = T("PDERR_NODEFAULTPRN"); break; + case PDERR_LOADDRVFAILURE: msg = T("PDERR_LOADDRVFAILURE"); break; + case PDERR_INITFAILURE: msg = T("PDERR_INITFAILURE"); break; + case PDERR_GETDEVMODEFAIL: msg = T("PDERR_GETDEVMODEFAIL"); break; + case PDERR_DNDMMISMATCH: msg = T("PDERR_DNDMMISMATCH"); break; + case PDERR_DEFAULTDIFFERENT: msg = T("PDERR_DEFAULTDIFFERENT("); break; + case PDERR_CREATEICFAILURE: msg = T("PDERR_CREATEICFAILURE"); break; default: break; } return msg; @@ -299,7 +299,7 @@ void wxPrintData::ConvertToNative() pd->hDevNames = NULL; #if defined(__WXDEBUG__) && defined(__WIN32__) - wxString str(_T("Printing error: ")); + wxString str(T("Printing error: ")); str += wxGetPrintDlgError(); wxLogDebug(str); #endif @@ -343,7 +343,7 @@ void wxPrintData::ConvertToNative() //// Printer name - if (m_printerName != _T("")) + if (m_printerName != T("")) { // TODO: make this Unicode compatible int len = wxMin(31, m_printerName.Len()); @@ -516,7 +516,7 @@ void wxPrintData::ConvertFromNative() else { // Shouldn't really get here - wxFAIL_MSG(_T("Couldn't find paper size in paper database.")); + wxFAIL_MSG(T("Couldn't find paper size in paper database.")); m_paperId = wxPAPER_NONE; m_paperSize.x = 0; @@ -526,7 +526,7 @@ void wxPrintData::ConvertFromNative() else { // Shouldn't really get here - wxFAIL_MSG(_T("Paper database wasn't initialized in wxPrintData::ConvertFromNative.")); + wxFAIL_MSG(T("Paper database wasn't initialized in wxPrintData::ConvertFromNative.")); m_paperId = wxPAPER_NONE; m_paperSize.x = 0; @@ -542,7 +542,7 @@ void wxPrintData::ConvertFromNative() else { // Shouldn't really get here - wxFAIL_MSG(_T("Couldn't find paper size from DEVMODE.")); + wxFAIL_MSG(T("Couldn't find paper size from DEVMODE.")); m_paperSize.x = 0; m_paperSize.y = 0; @@ -761,7 +761,7 @@ void wxPrintDialogData::ConvertToNative() m_printData.SetNativeData((void*) NULL); - wxASSERT_MSG( (pd->hDevMode), _T("hDevMode must be non-NULL in ConvertToNative!")); + wxASSERT_MSG( (pd->hDevMode), T("hDevMode must be non-NULL in ConvertToNative!")); pd->hDC = (HDC) NULL; pd->nFromPage = (UINT)m_printFromPage; @@ -1023,7 +1023,7 @@ void wxPageSetupDialogData::ConvertToNative() m_printData.SetNativeData((void*) NULL); - wxASSERT_MSG( (pd->hDevMode), _T("hDevMode must be non-NULL in ConvertToNative!")); + wxASSERT_MSG( (pd->hDevMode), T("hDevMode must be non-NULL in ConvertToNative!")); // pd->hDevMode = GlobalAlloc(GMEM_MOVEABLE, sizeof(DEVMODE)); @@ -1163,7 +1163,7 @@ void wxPageSetupDialogData::SetPaperSize(wxPaperSize id) void wxPageSetupDialogData::CalculateIdFromPaperSize() { wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL), - _T("wxThePrintPaperDatabase should not be NULL. " + T("wxThePrintPaperDatabase should not be NULL. " "Do not create global print dialog data objects.") ); wxSize sz = GetPaperSize(); @@ -1179,7 +1179,7 @@ void wxPageSetupDialogData::CalculateIdFromPaperSize() void wxPageSetupDialogData::CalculatePaperSizeFromId() { wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL), - _T("wxThePrintPaperDatabase should not be NULL. " + T("wxThePrintPaperDatabase should not be NULL. " "Do not create global print dialog data objects.") ); wxSize sz = wxThePrintPaperDatabase->GetSize(m_printData.GetPaperId()); diff --git a/src/common/config.cpp b/src/common/config.cpp index fc96bb57f6..cacf6c982c 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -186,7 +186,7 @@ bool wxConfigBase::Read(const wxString& key, int *pi, int defVal) const bool wxConfigBase::Write(const wxString& key, double val) { wxString str; - str.Printf(_T("%f"), val); + str.Printf(T("%f"), val); return Write(key, str); } @@ -371,11 +371,11 @@ void wxSplitPath(wxArrayString& aParts, const wxChar *sz) wxString strCurrent; const wxChar *pc = sz; for ( ;; ) { - if ( *pc == _T('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) { - if ( strCurrent == _T(".") ) { + if ( *pc == T('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) { + if ( strCurrent == T(".") ) { // ignore } - else if ( strCurrent == _T("..") ) { + else if ( strCurrent == T("..") ) { // go up one level if ( aParts.IsEmpty() ) wxLogWarning(_("'%s' has extra '..', ignored."), sz); @@ -391,7 +391,7 @@ void wxSplitPath(wxArrayString& aParts, const wxChar *sz) //else: // could log an error here, but we prefer to ignore extra '/' - if ( *pc == _T('\0') ) + if ( *pc == T('\0') ) return; } else diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 99145cb029..9cfd4bb2f9 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -48,7 +48,7 @@ bool wxControlBase::CreateControl(wxWindowBase *parent, // even if it's possible to create controls without parents in some port, // it should surely be discouraged because it doesn't work at all under // Windows - wxCHECK_MSG( parent, FALSE, _T("all controls must have parents") ); + wxCHECK_MSG( parent, FALSE, T("all controls must have parents") ); if ( !CreateBase(parent, id, pos, size, style, validator, name) ) return FALSE; diff --git a/src/common/date.cpp b/src/common/date.cpp index 809730cd69..57392ab994 100644 --- a/src/common/date.cpp +++ b/src/common/date.cpp @@ -43,13 +43,13 @@ #define ABBR_LENGTH 3 static const wxChar *dayname[] = { - _T("Sunday"), _T("Monday"), _T("Tuesday"), _T("Wednesday"), - _T("Thursday"), _T("Friday"), _T("Saturday") + T("Sunday"), T("Monday"), T("Tuesday"), T("Wednesday"), + T("Thursday"), T("Friday"), T("Saturday") }; static const wxChar *mname[] = { - _T("January"), _T("February"), _T("March"), _T("April"), _T("May"), _T("June"), - _T("July"), _T("August"), _T("September"), _T("October"), _T("November"), _T("December") + T("January"), T("February"), T("March"), T("April"), T("May"), T("June"), + T("July"), T("August"), T("September"), T("October"), T("November"), T("December") }; static int GauDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; @@ -88,7 +88,7 @@ wxDate::wxDate (const wxString& dat) { DisplayFormat=wxMDY; DisplayOptions='\0'; - if (wxStrcmp(dat, _T("TODAY")) == 0 || wxStrcmp(dat, _T("today")) == 0) + if (wxStrcmp(dat, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0) { // Sets the current date Set(); @@ -96,12 +96,12 @@ wxDate::wxDate (const wxString& dat) else { wxChar buf[100]; - wxStrcpy(buf, WXSTRINGCAST dat); + wxStrcpy(buf, dat); - wxChar *save_ptr, *token = wxStrtok(buf,_T("/-"),&save_ptr); + wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr); month = wxAtoi(token); - day = wxAtoi(wxStrtok((wxChar *) NULL,_T("/-"),&save_ptr)); - year = wxAtoi(wxStrtok((wxChar *) NULL,_T(" "),&save_ptr)); + day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr)); + year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&save_ptr)); } mdy_to_julian (); @@ -131,7 +131,7 @@ void wxDate::operator = (const wxString& dat) { DisplayFormat=wxMDY; DisplayOptions='\0'; - if (wxStrcmp(dat, _T("TODAY")) == 0 || wxStrcmp(dat, _T("today")) == 0) + if (wxStrcmp(dat, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0) { // Sets the current date Set(); @@ -139,12 +139,12 @@ void wxDate::operator = (const wxString& dat) else { wxChar buf[100]; - wxStrcpy(buf, WXSTRINGCAST dat); + wxStrcpy(buf, dat); - wxChar *save_ptr, *token = wxStrtok(buf,_T("/-"),&save_ptr); + wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr); month = wxAtoi(token); - day = wxAtoi(wxStrtok((wxChar *) NULL,_T("/-"),&save_ptr)); - year = wxAtoi(wxStrtok((wxChar *) NULL,_T(" "),&save_ptr)); + day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr)); + year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&save_ptr)); } mdy_to_julian (); @@ -379,11 +379,11 @@ wxString wxDate::FormatDate (int type) const } wxStrncpy( buf, wxGetTranslation(dayname[day_of_week-1]), (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9); - wxStrcat( buf, _T(", ")); + wxStrcat( buf, T(", ")); wxStrncat( buf, wxGetTranslation(mname[month-1]), (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9); - wxStrcat( buf, _T(" ")); - wxSprintf( buf+wxStrlen(buf), _T("%d, %d"), day, abs(year) ); + wxStrcat( buf, T(" ")); + wxSprintf( buf+wxStrlen(buf), T("%d, %d"), day, abs(year) ); if (year < 0) wxStrcat(buf,_(" B.C.")); return wxString(buf); @@ -395,10 +395,10 @@ wxString wxDate::FormatDate (int type) const wxStrcpy(buf, _("invalid date")); return wxString(buf); } - wxSprintf(buf,_T("%d "), day); + wxSprintf(buf,T("%d "), day); wxStrncat(buf, wxGetTranslation(mname[month-1]), (DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9); - wxSprintf( buf+wxStrlen(buf), _T(" %d"), abs(year) ); + wxSprintf( buf+wxStrlen(buf), T(" %d"), abs(year) ); if (year < 0) wxStrcat(buf, _(" B.C.")); return wxString(buf); @@ -408,13 +408,13 @@ wxString wxDate::FormatDate (int type) const if (day==0 || month==0 || year==0) wxStrcpy(buf, _("invalid date")); else - wxSprintf( buf+wxStrlen(buf), _T("%1d/%1d/%02d"), month, day, + wxSprintf( buf+wxStrlen(buf), T("%1d/%1d/%02d"), month, day, (DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899) ? (abs(year) - (abs(year) / 100 * 100)) : (abs(year)) ); return wxString(buf); } - return wxString(_T("")); + return wxString(T("")); } void wxDate::SetFormat( int format ) diff --git a/src/common/db.cpp b/src/common/db.cpp index 5df993b4bf..bdac571002 100644 --- a/src/common/db.cpp +++ b/src/common/db.cpp @@ -193,7 +193,7 @@ bool wxDB::Open(char *Dsn, char *Uid, char *AuthStr) // ===================================================================== // Results from a Microsoft Access 7.0 db, using a driver from Microsoft // - // SQL_VARCHAR type name = 'TEXT', Precision = 255 + // SQL_VARCHAR type name = 'TEXT(', Precision = 255 // SQL_TIMESTAMP type name = 'DATETIME' // SQL_DECIMAL SQL_NO_DATA_FOUND // SQL_NUMERIC type name = 'CURRENCY', Precision = 19 @@ -979,14 +979,14 @@ bool wxDB::Grant(int privileges, char *tableName, char *userList) int c = 0; if (privileges & DB_GRANT_SELECT) { - strcat(sqlStmt, "SELECT"); + strcat(sqlStmt, "SELECT("); c++; } if (privileges & DB_GRANT_INSERT) { if (c++) strcat(sqlStmt, ", "); - strcat(sqlStmt, "INSERT"); + strcat(sqlStmt, "INSERT("); } if (privileges & DB_GRANT_UPDATE) { diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 595643cba4..df030412fd 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -56,13 +56,13 @@ wxSizer *wxDialogBase::CreateTextSizer( const wxString &message ) wxString line; for (size_t pos = 0; pos < message.Len(); pos++) { - if (message[pos] == _T('\n')) + if (message[pos] == T('\n')) { if (!line.IsEmpty()) { wxStaticText *s1 = new wxStaticText( this, -1, line ); box->Add( s1 ); - line = _T(""); + line = T(""); } else { diff --git a/src/common/docmdi.cpp b/src/common/docmdi.cpp index 6ce731631b..0e8c9d1c35 100644 --- a/src/common/docmdi.cpp +++ b/src/common/docmdi.cpp @@ -51,7 +51,7 @@ void wxDocMDIParentFrame::OnExit(wxCommandEvent& WXUNUSED(event)) void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event) { wxString f(m_docManager->GetHistoryFile(event.GetSelection() - wxID_FILE1)); - if (f != _T("")) + if (f != T("")) (void)m_docManager->CreateDocument(f, wxDOC_SILENT); } diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 0f16972439..ef12c9a899 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -103,7 +103,7 @@ static inline wxString FindExtension(const wxChar *path); // local constants // ---------------------------------------------------------------------------- -static const char *s_MRUEntryFormat = _T("&%d %s"); +static const char *s_MRUEntryFormat = T("&%d %s"); // ============================================================================ // implementation @@ -224,7 +224,7 @@ bool wxDocument::Save() bool ret = FALSE; if (!IsModified()) return TRUE; - if (m_documentFile == _T("") || !m_savedYet) + if (m_documentFile == T("") || !m_savedYet) ret = SaveAs(); else ret = OnSaveDocument(m_documentFile); @@ -254,7 +254,7 @@ bool wxDocument::SaveAs() wxString path, name, ext; wxSplitPath(fileName, & path, & name, & ext); - if (ext.IsEmpty() || ext == _T("")) + if (ext.IsEmpty() || ext == T("")) { fileName += "."; fileName += docTemplate->GetDefaultExtension(); @@ -283,7 +283,7 @@ bool wxDocument::OnSaveDocument(const wxString& file) return FALSE; wxString msgTitle; - if (wxTheApp->GetAppName() != _T("")) + if (wxTheApp->GetAppName() != T("")) msgTitle = wxTheApp->GetAppName(); else msgTitle = wxString(_("File error")); @@ -319,7 +319,7 @@ bool wxDocument::OnOpenDocument(const wxString& file) return FALSE; wxString msgTitle; - if (wxTheApp->GetAppName() != _T("")) + if (wxTheApp->GetAppName() != T("")) msgTitle = wxTheApp->GetAppName(); else msgTitle = wxString(_("File error")); @@ -378,12 +378,12 @@ bool wxDocument::Revert() // Get title, or filename if no title, else unnamed bool wxDocument::GetPrintableName(wxString& buf) const { - if (m_documentTitle != _T("")) + if (m_documentTitle != T("")) { buf = m_documentTitle; return TRUE; } - else if (m_documentFile != _T("")) + else if (m_documentFile != T("")) { buf = wxFileNameFromPath(m_documentFile); return TRUE; @@ -418,7 +418,7 @@ bool wxDocument::OnSaveModified() GetPrintableName(title); wxString msgTitle; - if (wxTheApp->GetAppName() != _T("")) + if (wxTheApp->GetAppName() != T("")) msgTitle = wxTheApp->GetAppName(); else msgTitle = wxString(_("Warning")); @@ -985,8 +985,8 @@ wxDocument *wxDocManager::CreateDocument(const wxString& path, long flags) // Existing document wxDocTemplate *temp = (wxDocTemplate *) NULL; - wxString path2(_T("")); - if (path != _T("")) + wxString path2(T("")); + if (path != T("")) path2 = path; if (flags & wxDOC_SILENT) @@ -1211,21 +1211,21 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, { // add a '|' to separate this filter from the previous one if ( !descrBuf.IsEmpty() ) - descrBuf << _T('|'); + descrBuf << T('|'); descrBuf << templates[i]->GetDescription() - << _T(" (") << templates[i]->GetFileFilter() << _T(") |") + << T(" (") << templates[i]->GetFileFilter() << T(") |") << templates[i]->GetFileFilter(); } } #else - wxString descrBuf = _T("*.*"); + wxString descrBuf = T("*.*"); #endif int FilterIndex = 0; wxString pathTmp = wxFileSelectorEx(_("Select a file"), - _T(""), - _T(""), + T(""), + T(""), &FilterIndex, descrBuf, 0, @@ -1250,7 +1250,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, } else { - path = _T(""); + path = T(""); return (wxDocTemplate *) NULL; } #if 0 @@ -1261,7 +1261,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, if (!temp) return (wxDocTemplate *) NULL; - wxChar *pathTmp = wxFileSelector(_("Select a file"), _T(""), _T(""), + wxChar *pathTmp = wxFileSelector(_("Select a file"), T(""), T(""), temp->GetDefaultExtension(), temp->GetFileFilter(), 0, wxTheApp->GetTopWindow()); @@ -1279,7 +1279,7 @@ wxDocTemplate *wxDocManager::SelectDocumentPath(wxDocTemplate **templates, wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates, int noTemplates) { - wxChar **strings = new wxChar *[noTemplates]; + const wxChar **strings = new wxChar *[noTemplates]; wxChar **data = new wxChar *[noTemplates]; int i; int n = 0; @@ -1287,7 +1287,7 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates, { if (templates[i]->IsVisible()) { - strings[n] = WXSTRINGCAST templates[i]->m_description; + strings[n] = templates[i]->m_description; data[n] = (wxChar *)templates[i]; n ++; } @@ -1316,15 +1316,15 @@ wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates, wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates, int noTemplates) { - wxChar **strings = new wxChar *[noTemplates]; + const wxChar **strings = new wxChar *[noTemplates]; wxChar **data = new wxChar *[noTemplates]; int i; int n = 0; for (i = 0; i < noTemplates; i++) { - if (templates[i]->IsVisible() && (templates[i]->GetViewName() != _T(""))) + if (templates[i]->IsVisible() && (templates[i]->GetViewName() != T(""))) { - strings[n] = WXSTRINGCAST templates[i]->m_viewTypeName; + strings[n] = templates[i]->m_viewTypeName; data[n] = (wxChar *)templates[i]; n ++; } @@ -1543,7 +1543,7 @@ void wxDocParentFrame::OnCloseWindow(wxCloseEvent& event) #if wxUSE_PRINTING_ARCHITECTURE wxDocPrintout::wxDocPrintout(wxView *view, const wxString& title) - : wxPrintout(WXSTRINGCAST title) + : wxPrintout(title) { m_printoutView = view; } @@ -1759,7 +1759,7 @@ void wxCommandProcessor::SetMenuStrings() { wxCommand *command = (wxCommand *)m_currentCommand->Data(); wxString commandName(command->GetName()); - if (commandName == _T("")) commandName = _("Unnamed command"); + if (commandName == T("")) commandName = _("Unnamed command"); bool canUndo = command->CanUndo(); if (canUndo) buf = wxString(_("&Undo ")) + commandName; @@ -1774,7 +1774,7 @@ void wxCommandProcessor::SetMenuStrings() { wxCommand *redoCommand = (wxCommand *)m_currentCommand->Next()->Data(); wxString redoCommandName(redoCommand->GetName()); - if (redoCommandName == _T("")) redoCommandName = _("Unnamed command"); + if (redoCommandName == T("")) redoCommandName = _("Unnamed command"); buf = wxString(_("&Redo ")) + redoCommandName; m_commandEditMenu->SetLabel(wxID_REDO, buf); m_commandEditMenu->Enable(wxID_REDO, TRUE); @@ -1801,7 +1801,7 @@ void wxCommandProcessor::SetMenuStrings() // we've undone to the start of the list, but can redo the first. wxCommand *redoCommand = (wxCommand *)m_commands.First()->Data(); wxString redoCommandName(redoCommand->GetName()); - if (redoCommandName == _T("")) redoCommandName = _("Unnamed command"); + if (redoCommandName == T("")) redoCommandName = _("Unnamed command"); buf = wxString(_("&Redo ")) + redoCommandName; m_commandEditMenu->SetLabel(wxID_REDO, buf); m_commandEditMenu->Enable(wxID_REDO, TRUE); @@ -1900,7 +1900,7 @@ void wxFileHistory::AddFileToHistory(const wxString& file) void wxFileHistory::RemoveFileFromHistory(int i) { wxCHECK_RET( i < m_fileHistoryN, - _T("invalid index in wxFileHistory::RemoveFileFromHistory") ); + T("invalid index in wxFileHistory::RemoveFileFromHistory") ); wxNode* node = m_fileMenus.First(); while ( node ) @@ -1932,7 +1932,7 @@ void wxFileHistory::RemoveFileFromHistory(int i) // to be removed as soon as wxMenu::Delete() is implemented #if 1 - menu->SetLabel(wxID_FILE1 + m_fileHistoryN - 1, _T("")); + menu->SetLabel(wxID_FILE1 + m_fileHistoryN - 1, T("")); #endif node = node->Next(); @@ -1964,13 +1964,13 @@ void wxFileHistory::Load(wxConfigBase& config) { m_fileHistoryN = 0; wxString buf; - buf.Printf(_T("file%d"), m_fileHistoryN+1); + buf.Printf(T("file%d"), m_fileHistoryN+1); wxString historyFile; - while ((m_fileHistoryN <= m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != _T(""))) + while ((m_fileHistoryN <= m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != T(""))) { m_fileHistory[m_fileHistoryN] = copystring((const wxChar*) historyFile); m_fileHistoryN ++; - buf.Printf(_T("file%d"), m_fileHistoryN+1); + buf.Printf(T("file%d"), m_fileHistoryN+1); historyFile = ""; } AddFilesToMenu(); @@ -1982,7 +1982,7 @@ void wxFileHistory::Save(wxConfigBase& config) for (i = 0; i < m_fileHistoryN; i++) { wxString buf; - buf.Printf(_T("file%d"), i+1); + buf.Printf(T("file%d"), i+1); config.Write(buf, wxString(m_fileHistory[i])); } } diff --git a/src/common/dynarray.cpp b/src/common/dynarray.cpp index 07d31a52ae..5abc4b1f5c 100644 --- a/src/common/dynarray.cpp +++ b/src/common/dynarray.cpp @@ -250,7 +250,7 @@ void wxBaseArray::Add(long lItem, CMPFUNC fnCompare) // add item at the given position void wxBaseArray::Insert(long lItem, size_t nIndex) { - wxCHECK_RET( nIndex <= m_nCount, _T("bad index in wxArray::Insert") ); + wxCHECK_RET( nIndex <= m_nCount, T("bad index in wxArray::Insert") ); Grow(); @@ -263,7 +263,7 @@ void wxBaseArray::Insert(long lItem, size_t nIndex) // removes item from array (by index) void wxBaseArray::Remove(size_t nIndex) { - wxCHECK_RET( nIndex <= m_nCount, _T("bad index in wxArray::Remove") ); + wxCHECK_RET( nIndex <= m_nCount, T("bad index in wxArray::Remove") ); memmove(&m_pItems[nIndex], &m_pItems[nIndex + 1], (m_nCount - nIndex - 1)*sizeof(long)); @@ -276,7 +276,7 @@ void wxBaseArray::Remove(long lItem) int iIndex = Index(lItem); wxCHECK_RET( iIndex != wxNOT_FOUND, - _T("removing inexistent item in wxArray::Remove") ); + T("removing inexistent item in wxArray::Remove") ); Remove((size_t)iIndex); } diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index a3158210e2..ab4f28a049 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -322,7 +322,7 @@ wxLibrary *wxLibraries::LoadLibrary(const wxString& name) const char *envLibPath = getenv("LD_LIBRARY_PATH"); if ( envLibPath ) libPath << ':' << envLibPath; - wxStringTokenizer tokenizer(libPath, _T(':')); + wxStringTokenizer tokenizer(libPath, T(':')); while ( tokenizer.HasMoreToken() ) { wxString fullname(tokenizer.NextToken()); diff --git a/src/common/event.cpp b/src/common/event.cpp index d0e063d025..847582748d 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -6,7 +6,7 @@ // Created: 01/02/97 // RCS-ID: $Id$ // Copyright: (c) Julian Smart and Markus Holzem -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -22,46 +22,56 @@ #ifndef WX_PRECOMP #include "wx/defs.h" - #include "wx/control.h" - #include "wx/utils.h" #include "wx/app.h" - #include "wx/dc.h" + #include "wx/list.h" + + #if wxUSE_GUI + #include "wx/control.h" + #include "wx/utils.h" + #include "wx/dc.h" + #endif // wxUSE_GUI #endif #include "wx/event.h" -#include "wx/validate.h" + +#if wxUSE_GUI + #include "wx/validate.h" +#endif // wxUSE_GUI #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject) IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject) - IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxScrollWinEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxIconizeEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent) IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxCommandEvent) - IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxQueryNewPaletteEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent) - IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent) + + #if wxUSE_GUI + IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent) + IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent) + IMPLEMENT_DYNAMIC_CLASS(wxScrollWinEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxIconizeEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent) + IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxCommandEvent) + IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxQueryNewPaletteEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent) + IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent) + #endif // wxUSE_GUI const wxEventTable *wxEvtHandler::GetEventTable() const { return &wxEvtHandler::sm_eventTable; } @@ -102,7 +112,7 @@ wxEvent::wxEvent(int theId) void wxEvent::CopyObject(wxObject& object_dest) const { - wxEvent *obj = (wxEvent *)&object_dest; + wxEvent *obj = (wxEvent *)&object_dest; wxObject::CopyObject(object_dest); obj->m_eventType = m_eventType; @@ -114,6 +124,8 @@ void wxEvent::CopyObject(wxObject& object_dest) const obj->m_isCommandEvent = m_isCommandEvent; } +#if wxUSE_GUI + /* * Command events * @@ -133,7 +145,7 @@ wxCommandEvent::wxCommandEvent(wxEventType commandType, int theId) void wxCommandEvent::CopyObject(wxObject& obj_d) const { - wxCommandEvent *obj = (wxCommandEvent *)&obj_d; + wxCommandEvent *obj = (wxCommandEvent *)&obj_d; wxEvent::CopyObject(obj_d); @@ -172,7 +184,7 @@ wxScrollWinEvent::wxScrollWinEvent(wxEventType commandType, void wxScrollWinEvent::CopyObject(wxObject& obj_d) const { - wxScrollWinEvent *obj = (wxScrollWinEvent*)&obj_d; + wxScrollWinEvent *obj = (wxScrollWinEvent*)&obj_d; wxEvent::CopyObject(obj_d); @@ -231,7 +243,7 @@ bool wxMouseEvent::ButtonDClick(int but) const case 3: return RightDClick(); default: - wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonDClick")); + wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonDClick")); } return FALSE; @@ -252,7 +264,7 @@ bool wxMouseEvent::ButtonDown(int but) const case 3: return RightDown(); default: - wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonDown")); + wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonDown")); } return FALSE; @@ -272,7 +284,7 @@ bool wxMouseEvent::ButtonUp(int but) const case 3: return RightUp(); default: - wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonUp")); + wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonUp")); } return FALSE; @@ -291,7 +303,7 @@ bool wxMouseEvent::Button(int but) const case 3: return (RightDown() || RightUp() || RightDClick()); default: - wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::Button")); + wxFAIL_MSG(T("invalid parameter in wxMouseEvent::Button")); } return FALSE; @@ -309,7 +321,7 @@ bool wxMouseEvent::ButtonIsDown(int but) const case 3: return RightIsDown(); default: - wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonIsDown")); + wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonIsDown")); } return FALSE; @@ -408,7 +420,7 @@ void wxCloseEvent::CopyObject(wxObject& obj_d) const #endif obj->m_canVeto = m_canVeto; } - + void wxShowEvent::CopyObject(wxObject& obj_d) const { wxShowEvent *obj = (wxShowEvent *)&obj_d; @@ -427,7 +439,7 @@ void wxJoystickEvent::CopyObject(wxObject& obj_d) const obj->m_buttonChange = m_buttonChange; obj->m_buttonState = m_buttonState; obj->m_joyStick = m_joyStick; -} +} void wxDropFilesEvent::CopyObject(wxObject& obj_d) const { @@ -437,15 +449,7 @@ void wxDropFilesEvent::CopyObject(wxObject& obj_d) const obj->m_noFiles = m_noFiles; obj->m_pos = m_pos; // TODO: Problem with obj->m_files. It should be deallocated by the - // destructor of the event. -} - -void wxIdleEvent::CopyObject(wxObject& obj_d) const -{ - wxIdleEvent *obj = (wxIdleEvent *)&obj_d; - wxEvent::CopyObject(obj_d); - - obj->m_requestMore = m_requestMore; + // destructor of the event. } void wxUpdateUIEvent::CopyObject(wxObject &obj_d) const @@ -489,6 +493,16 @@ wxWindowDestroyEvent::wxWindowDestroyEvent(wxWindow *win) SetEventObject(win); } +#endif // wxUSE_GUI + +void wxIdleEvent::CopyObject(wxObject& obj_d) const +{ + wxIdleEvent *obj = (wxIdleEvent *)&obj_d; + wxEvent::CopyObject(obj_d); + + obj->m_requestMore = m_requestMore; +} + /* * Event handler */ @@ -564,7 +578,7 @@ bool wxEvtHandler::ProcessThreadEvent(wxEvent& event) // TODO: Wake up idle handler for the other platforms. #ifdef __WXGTK__ - if (g_isIdle) + if (g_isIdle) wxapp_install_idle_handler(); #endif @@ -592,14 +606,16 @@ void wxEvtHandler::ProcessPendingEvents() bool wxEvtHandler::ProcessEvent(wxEvent& event) { +#if wxUSE_GUI /* check that our flag corresponds to reality */ wxASSERT( m_isWindow == IsKindOf(CLASSINFO(wxWindow)) ); +#endif // wxUSE_GUI /* An event handler can be enabled or disabled */ if ( GetEvtHandlerEnabled() ) { #if wxUSE_THREADS - /* Check whether we are in a child thread. */ + /* Check whether we are in a child thread. */ if (!wxThread::IsMain()) return ProcessThreadEvent(event); #endif @@ -612,7 +628,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) const wxEventTable *table = GetEventTable(); -#if wxUSE_VALIDATORS +#if wxUSE_GUI && wxUSE_VALIDATORS // Try the associated validator first, if this is a window. // Problem: if the event handler of the window has been replaced, // this wxEvtHandler may no longer be a window. @@ -654,6 +670,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) return TRUE; } +#if wxUSE_GUI // Carry on up the parent-child hierarchy, // but only if event is a command event: it wouldn't // make sense for a parent to receive a child's size event, for example @@ -664,6 +681,7 @@ bool wxEvtHandler::ProcessEvent(wxEvent& event) if (parent && !parent->IsBeingDeleted()) return parent->GetEventHandler()->ProcessEvent(event); } +#endif // wxUSE_GUI // Last try - application object. if ( wxTheApp && (this != wxTheApp) ) @@ -735,7 +753,7 @@ void wxEvtHandler::Connect( int id, int lastId, bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) { wxCHECK_MSG( m_dynamicEvents, FALSE, - _T("caller should check that we have dynamic events") ); + T("caller should check that we have dynamic events") ); int commandId = event.GetId(); @@ -779,6 +797,8 @@ bool wxEvtHandler::OnClose() } #endif // WXWIN_COMPATIBILITY +#if wxUSE_GUI + // Find a window with the focus, that is also a descendant of the given window. // This is used to determine the window to initially send commands to. wxWindow* wxFindFocusDescendant(wxWindow* ancestor) @@ -802,3 +822,4 @@ wxWindow* wxFindFocusDescendant(wxWindow* ancestor) return focusWin; } +#endif // wxUSE_GUI diff --git a/src/common/ffile.cpp b/src/common/ffile.cpp index e1e5a2dbe1..4a1be06f8b 100644 --- a/src/common/ffile.cpp +++ b/src/common/ffile.cpp @@ -54,7 +54,7 @@ wxFFile::wxFFile(const wxChar *filename, const char *mode) bool wxFFile::Open(const wxChar *filename, const char *mode) { - wxASSERT_MSG( !m_fp, _T("should close or detach the old file first") ); + wxASSERT_MSG( !m_fp, T("should close or detach the old file first") ); #if wxUSE_UNICODE char *tmp_fname; @@ -107,8 +107,8 @@ bool wxFFile::Close() bool wxFFile::ReadAll(wxString *str) { - wxCHECK_MSG( str, FALSE, _T("invalid parameter") ); - wxCHECK_MSG( IsOpened(), FALSE, _T("can't read from closed file") ); + wxCHECK_MSG( str, FALSE, T("invalid parameter") ); + wxCHECK_MSG( IsOpened(), FALSE, T("can't read from closed file") ); clearerr(m_fp); @@ -137,8 +137,8 @@ bool wxFFile::ReadAll(wxString *str) size_t wxFFile::Read(void *pBuf, size_t nCount) { - wxCHECK_MSG( pBuf, FALSE, _T("invalid parameter") ); - wxCHECK_MSG( IsOpened(), FALSE, _T("can't read from closed file") ); + wxCHECK_MSG( pBuf, FALSE, T("invalid parameter") ); + wxCHECK_MSG( IsOpened(), FALSE, T("can't read from closed file") ); size_t nRead = fread(pBuf, 1, nCount, m_fp); if ( (nRead < nCount) && Error() ) @@ -151,8 +151,8 @@ size_t wxFFile::Read(void *pBuf, size_t nCount) size_t wxFFile::Write(const void *pBuf, size_t nCount) { - wxCHECK_MSG( pBuf, FALSE, _T("invalid parameter") ); - wxCHECK_MSG( IsOpened(), FALSE, _T("can't write to closed file") ); + wxCHECK_MSG( pBuf, FALSE, T("invalid parameter") ); + wxCHECK_MSG( IsOpened(), FALSE, T("can't write to closed file") ); size_t nWritten = fwrite(pBuf, 1, nCount, m_fp); if ( nWritten < nCount ) @@ -186,13 +186,13 @@ bool wxFFile::Flush() bool wxFFile::Seek(long ofs, wxSeekMode mode) { - wxCHECK_MSG( IsOpened(), FALSE, _T("can't seek on closed file") ); + wxCHECK_MSG( IsOpened(), FALSE, T("can't seek on closed file") ); int origin; switch ( mode ) { default: - wxFAIL_MSG(_T("unknown seek mode")); + wxFAIL_MSG(T("unknown seek mode")); // still fall through case wxFromStart: diff --git a/src/common/file.cpp b/src/common/file.cpp index 459e3d3709..83d73611a0 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -169,7 +169,7 @@ bool wxFile::Exists(const wxChar *name) wxCharBuffer fname = wxConvFile.cWC2MB(name); return !access(fname, 0) && - !stat(MBSTRINGCAST fname, &st) && + !stat(wxMBSTRINGCAST fname, &st) && (st.st_mode & S_IFREG); #else return !access(name, 0) && @@ -192,7 +192,7 @@ bool wxFile::Access(const wxChar *name, OpenMode mode) break; default: - wxFAIL_MSG(_T("bad wxFile::Access mode parameter.")); + wxFAIL_MSG(T("bad wxFile::Access mode parameter.")); } return access(wxFNCONV(name), how) == 0; @@ -481,28 +481,29 @@ bool wxTempFile::Open(const wxString& strName) // different partitions for example). Unfortunately, the only standard // (POSIX) temp file creation function tmpnam() can't do it. #if defined(__UNIX__) || defined(__WXSTUBS__)|| defined( __WXMAC__ ) - static const wxChar *szMktempSuffix = _T("XXXXXX"); + static const wxChar *szMktempSuffix = T("XXXXXX"); m_strTemp << strName << szMktempSuffix; - mktemp(MBSTRINGCAST m_strTemp.mb_str()); // will do because length doesn't change + // can use the cast because length doesn't change + mktemp(wxMBSTRINGCAST m_strTemp.mb_str()); #elif defined(__WXPM__) // for now just create a file // future enhancements can be to set some extended attributes for file systems // OS/2 supports that have them (HPFS, FAT32) and security (HPFS386) - static const wxChar *szMktempSuffix = _T("XXX"); + static const wxChar *szMktempSuffix = T("XXX"); m_strTemp << strName << szMktempSuffix; mkdir(m_strTemp.GetWriteBuf(MAX_PATH)); #else // Windows wxString strPath; wxSplitPath(strName, &strPath, NULL, NULL); if ( strPath.IsEmpty() ) - strPath = _T('.'); // GetTempFileName will fail if we give it empty string + strPath = T('.'); // GetTempFileName will fail if we give it empty string #ifdef __WIN32__ - if ( !GetTempFileName(strPath, _T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) ) + if ( !GetTempFileName(strPath, T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) ) #else // Not sure why MSVC++ 1.5 header defines first param as BYTE - bug? - if ( !GetTempFileName((BYTE) (DWORD)(const wxChar*) strPath, _T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) ) + if ( !GetTempFileName((BYTE) (DWORD)(const wxChar*) strPath, T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) ) #endif - wxLogLastError(_T("GetTempFileName")); + wxLogLastError(T("GetTempFileName")); m_strTemp.UngetWriteBuf(); #endif // Windows/Unix diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 0193dbdb2c..1ae6beaa4d 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -99,7 +99,7 @@ wxString wxFileConfig::GetGlobalDir() wxString strDir; #ifdef __UNIX__ - strDir = _T("/etc/"); + strDir = T("/etc/"); #elif defined(__WXPM__) ULONG aulSysInfo[QSV_MAX] = {0}; UINT drive; @@ -192,15 +192,15 @@ wxString wxFileConfig::GetGlobalDir() } } #elif defined(__WXSTUBS__) - wxASSERT_MSG( FALSE, _T("TODO") ) ; + wxASSERT_MSG( FALSE, T("TODO") ) ; #elif defined(__WXMAC__) - wxASSERT_MSG( FALSE, _T("TODO") ) ; + wxASSERT_MSG( FALSE, T("TODO") ) ; #else // Windows wxChar szWinDir[MAX_PATH]; ::GetWindowsDirectory(szWinDir, MAX_PATH); strDir = szWinDir; - strDir << _T('\\'); + strDir << T('\\'); #endif // Unix/Windows return strDir; @@ -213,9 +213,9 @@ wxString wxFileConfig::GetLocalDir() wxGetHomeDir(&strDir); #ifdef __UNIX__ - if (strDir.Last() != _T('/')) strDir << _T('/'); + if (strDir.Last() != T('/')) strDir << T('/'); #else - if (strDir.Last() != _T('\\')) strDir << _T('\\'); + if (strDir.Last() != T('\\')) strDir << T('\\'); #endif return strDir; @@ -226,11 +226,11 @@ wxString wxFileConfig::GetGlobalFileName(const wxChar *szFile) wxString str = GetGlobalDir(); str << szFile; - if ( wxStrchr(szFile, _T('.')) == NULL ) + if ( wxStrchr(szFile, T('.')) == NULL ) #ifdef __UNIX__ - str << _T(".conf"); + str << T(".conf"); #else // Windows - str << _T(".ini"); + str << T(".ini"); #endif // UNIX/Win return str; @@ -241,14 +241,14 @@ wxString wxFileConfig::GetLocalFileName(const wxChar *szFile) wxString str = GetLocalDir(); #ifdef __UNIX__ - str << _T('.'); + str << T('.'); #endif str << szFile; #ifdef __WXMSW__ - if ( wxStrchr(szFile, _T('.')) == NULL ) - str << _T(".ini"); + if ( wxStrchr(szFile, T('.')) == NULL ) + str << T(".ini"); #endif return str; @@ -385,18 +385,18 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal) ; // skip blank/comment lines - if ( *pStart == _T('\0')|| *pStart == _T(';') || *pStart == _T('#') ) + if ( *pStart == T('\0')|| *pStart == T(';') || *pStart == T('#') ) continue; - if ( *pStart == _T('[') ) { // a new group + if ( *pStart == T('[') ) { // a new group pEnd = pStart; - while ( *++pEnd != _T(']') ) { - if ( *pEnd == _T('\n') || *pEnd == _T('\0') ) + while ( *++pEnd != T(']') ) { + if ( *pEnd == T('\n') || *pEnd == T('\0') ) break; } - if ( *pEnd != _T(']') ) { + if ( *pEnd != T(']') ) { wxLogError(_("file '%s': unexpected character %c at line %d."), file.GetName(), *pEnd, n + 1); continue; // skip this line @@ -416,15 +416,15 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal) // check that there is nothing except comments left on this line bool bCont = TRUE; - while ( *++pEnd != _T('\0') && bCont ) { + while ( *++pEnd != T('\0') && bCont ) { switch ( *pEnd ) { - case _T('#'): - case _T(';'): + case T('#'): + case T(';'): bCont = FALSE; break; - case _T(' '): - case _T('\t'): + case T(' '): + case T('\t'): // ignore whitespace ('\n' impossible here) break; @@ -438,8 +438,8 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal) } else { // a key const wxChar *pEnd = pStart; - while ( *pEnd != _T('=') && !wxIsspace(*pEnd) ) { - if ( *pEnd == _T('\\') ) { + while ( *pEnd != T('=') && !wxIsspace(*pEnd) ) { + if ( *pEnd == T('\\') ) { // next character may be space or not - still take it because it's // quoted pEnd++; @@ -454,7 +454,7 @@ void wxFileConfig::Parse(wxTextFile& file, bool bLocal) while ( isspace(*pEnd) ) pEnd++; - if ( *pEnd++ != _T('=') ) { + if ( *pEnd++ != T('=') ) { wxLogError(_("file '%s', line %d: '=' expected."), file.GetName(), n + 1); } @@ -692,7 +692,7 @@ bool wxFileConfig::Write(const wxString& key, const wxString& szValue) wxString strName = path.Name(); if ( strName.IsEmpty() ) { // setting the value of a group is an error - wxASSERT_MSG( wxIsEmpty(szValue), _T("can't set value of a group!") ); + wxASSERT_MSG( wxIsEmpty(szValue), T("can't set value of a group!") ); // ... except if it's empty in which case it's a way to force it's creation m_pCurrentGroup->SetDirty(); @@ -724,7 +724,7 @@ bool wxFileConfig::Write(const wxString& key, long lValue) { // ltoa() is not ANSI :-( wxString buf; - buf.Printf(_T("%ld"), lValue); + buf.Printf(T("%ld"), lValue); return Write(key, buf); } @@ -809,7 +809,7 @@ bool wxFileConfig::DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso) if ( bGroupIfEmptyAlso && m_pCurrentGroup->IsEmpty() ) { if ( m_pCurrentGroup != m_pRootGroup ) { ConfigGroup *pGroup = m_pCurrentGroup; - SetPath(_T("..")); // changes m_pCurrentGroup! + SetPath(T("..")); // changes m_pCurrentGroup! m_pCurrentGroup->DeleteSubgroupByName(pGroup->Name()); } //else: never delete the root group @@ -832,7 +832,7 @@ bool wxFileConfig::DeleteAll() if ( remove(m_strLocalFile.fn_str()) == -1 ) wxLogSysError(_("can't delete user configuration file '%s'"), m_strLocalFile.c_str()); - m_strLocalFile = m_strGlobalFile = _T(""); + m_strLocalFile = m_strGlobalFile = T(""); Init(); return TRUE; @@ -1004,10 +1004,10 @@ LineList *ConfigGroup::GetGroupLine() // this group wasn't present in local config file, add it now if ( pParent != NULL ) { wxString strFullName; - strFullName << _T("[") + strFullName << T("[") // +1: no '/' << FilterOutEntryName(GetFullName().c_str() + 1) - << _T("]"); + << T("]"); m_pLine = m_pConfig->LineListInsert(strFullName, pParent->GetLastGroupLine()); pParent->SetLastGroup(this); // we're surely after all the others @@ -1065,7 +1065,7 @@ void ConfigGroup::Rename(const wxString& newName) LineList *line = GetGroupLine(); wxString strFullName; - strFullName << _T("[") << (GetFullName().c_str() + 1) << _T("]"); // +1: no '/' + strFullName << T("[") << (GetFullName().c_str() + 1) << T("]"); // +1: no '/' line->SetText(strFullName); SetDirty(); @@ -1076,7 +1076,7 @@ wxString ConfigGroup::GetFullName() const if ( Parent() ) return Parent()->GetFullName() + wxCONFIG_PATH_SEPARATOR + Name(); else - return _T(""); + return T(""); } // ---------------------------------------------------------------------------- @@ -1374,7 +1374,7 @@ void ConfigEntry::SetValue(const wxString& strValue, bool bUser) if ( bUser ) { wxString strVal = FilterOutValue(strValue); wxString strLine; - strLine << FilterOutEntryName(m_strName) << _T('=') << strVal; + strLine << FilterOutEntryName(m_strName) << T('=') << strVal; if ( m_pLine != NULL ) { // entry was read from the local config file, just modify the line @@ -1440,31 +1440,31 @@ static wxString FilterInValue(const wxString& str) bool bQuoted = !str.IsEmpty() && str[0] == '"'; for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) { - if ( str[n] == _T('\\') ) { + if ( str[n] == T('\\') ) { switch ( str[++n] ) { - case _T('n'): - strResult += _T('\n'); + case T('n'): + strResult += T('\n'); break; - case _T('r'): - strResult += _T('\r'); + case T('r'): + strResult += T('\r'); break; - case _T('t'): - strResult += _T('\t'); + case T('t'): + strResult += T('\t'); break; - case _T('\\'): - strResult += _T('\\'); + case T('\\'): + strResult += T('\\'); break; - case _T('"'): - strResult += _T('"'); + case T('"'): + strResult += T('"'); break; } } else { - if ( str[n] != _T('"') || !bQuoted ) + if ( str[n] != T('"') || !bQuoted ) strResult += str[n]; else if ( n != str.Len() - 1 ) { wxLogWarning(_("unexpected \" at position %d in '%s'."), @@ -1487,33 +1487,33 @@ static wxString FilterOutValue(const wxString& str) strResult.Alloc(str.Len()); // quoting is necessary to preserve spaces in the beginning of the string - bool bQuote = wxIsspace(str[0]) || str[0] == _T('"'); + bool bQuote = wxIsspace(str[0]) || str[0] == T('"'); if ( bQuote ) - strResult += _T('"'); + strResult += T('"'); wxChar c; for ( size_t n = 0; n < str.Len(); n++ ) { switch ( str[n] ) { - case _T('\n'): - c = _T('n'); + case T('\n'): + c = T('n'); break; - case _T('\r'): - c = _T('r'); + case T('\r'): + c = T('r'); break; - case _T('\t'): - c = _T('t'); + case T('\t'): + c = T('t'); break; - case _T('\\'): - c = _T('\\'); + case T('\\'): + c = T('\\'); break; - case _T('"'): + case T('"'): if ( bQuote ) { - c = _T('"'); + c = T('"'); break; } //else: fall through @@ -1524,11 +1524,11 @@ static wxString FilterOutValue(const wxString& str) } // we get here only for special characters - strResult << _T('\\') << c; + strResult << T('\\') << c; } if ( bQuote ) - strResult += _T('"'); + strResult += T('"'); return strResult; } @@ -1540,7 +1540,7 @@ static wxString FilterInEntryName(const wxString& str) strResult.Alloc(str.Len()); for ( const wxChar *pc = str.c_str(); *pc != '\0'; pc++ ) { - if ( *pc == _T('\\') ) + if ( *pc == T('\\') ) pc++; strResult += *pc; @@ -1555,15 +1555,15 @@ static wxString FilterOutEntryName(const wxString& str) wxString strResult; strResult.Alloc(str.Len()); - for ( const wxChar *pc = str.c_str(); *pc != _T('\0'); pc++ ) { + for ( const wxChar *pc = str.c_str(); *pc != T('\0'); pc++ ) { wxChar c = *pc; // we explicitly allow some of "safe" chars and 8bit ASCII characters // which will probably never have special meaning // NB: note that wxCONFIG_IMMUTABLE_PREFIX and wxCONFIG_PATH_SEPARATOR // should *not* be quoted - if ( !wxIsalnum(c) && !wxStrchr(_T("@_/-!.*%"), c) && ((c & 0x80) == 0) ) - strResult += _T('\\'); + if ( !wxIsalnum(c) && !wxStrchr(T("@_/-!.*%"), c) && ((c & 0x80) == 0) ) + strResult += T('\\'); strResult += c; } diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index 7461ca1dd4..d6b6b6d604 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -9,6 +9,14 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + #ifdef __GNUG__ #pragma implementation "filefn.h" #endif @@ -100,9 +108,12 @@ #include "windows.h" #endif +// ---------------------------------------------------------------------------- +// constants +// ---------------------------------------------------------------------------- + #define _MAXPATHLEN 500 -extern wxChar *wxBuffer; #ifdef __WXMAC__ extern wxChar gwxMacFileName[] ; extern wxChar gwxMacFileName2[] ; @@ -113,6 +124,16 @@ extern wxChar *wxBuffer; IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxStringList) #endif +// ---------------------------------------------------------------------------- +// private globals +// ---------------------------------------------------------------------------- + +static wxChar wxFileFunctionsBuffer[4*_MAXPATHLEN]; + +// ============================================================================ +// implementation +// ============================================================================ + void wxPathList::Add (const wxString& path) { wxStringList::Add (WXSTRINGCAST path); @@ -123,9 +144,9 @@ void wxPathList::AddEnvList (const wxString& envVariable) { static const wxChar PATH_TOKS[] = #ifdef __WINDOWS__ - _T(" ;"); // Don't seperate with colon in DOS (used for drive) + T(" ;"); // Don't seperate with colon in DOS (used for drive) #else - _T(" :;"); + T(" :;"); #endif wxChar *val = wxGetenv (WXSTRINGCAST envVariable); @@ -181,11 +202,11 @@ bool wxPathList::Member (const wxString& path) wxString wxPathList::FindValidPath (const wxString& file) { - if (wxFileExists (wxExpandPath(wxBuffer, file))) - return wxString(wxBuffer); + if (wxFileExists (wxExpandPath(wxFileFunctionsBuffer, file))) + return wxString(wxFileFunctionsBuffer); wxChar buf[_MAXPATHLEN]; - wxStrcpy(buf, wxBuffer); + wxStrcpy(buf, wxFileFunctionsBuffer); wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */ filename = IsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf; @@ -193,48 +214,39 @@ wxString wxPathList::FindValidPath (const wxString& file) for (wxNode * node = First (); node; node = node->Next ()) { wxChar *path = (wxChar *) node->Data (); - wxStrcpy (wxBuffer, path); - wxChar ch = wxBuffer[wxStrlen(wxBuffer)-1]; - if (ch != _T('\\') && ch != _T('/')) - wxStrcat (wxBuffer, _T("/")); - wxStrcat (wxBuffer, filename); + wxStrcpy (wxFileFunctionsBuffer, path); + wxChar ch = wxFileFunctionsBuffer[wxStrlen(wxFileFunctionsBuffer)-1]; + if (ch != T('\\') && ch != T('/')) + wxStrcat (wxFileFunctionsBuffer, T("/")); + wxStrcat (wxFileFunctionsBuffer, filename); #ifdef __WINDOWS__ - Unix2DosFilename (wxBuffer); + Unix2DosFilename (wxFileFunctionsBuffer); #endif - if (wxFileExists (wxBuffer)) + if (wxFileExists (wxFileFunctionsBuffer)) { - return wxString(wxBuffer); // Found! + return wxString(wxFileFunctionsBuffer); // Found! } } // for() - return wxString(_T("")); // Not found + return wxString(T("")); // Not found } wxString wxPathList::FindAbsoluteValidPath (const wxString& file) { - wxString f = FindValidPath(file); - if (wxIsAbsolutePath(f)) - return f; - else - { - wxChar buf[500]; - wxGetWorkingDirectory(buf, 499); - int len = (int)wxStrlen(buf); - wxChar lastCh = 0; - if (len > 0) - lastCh = buf[len-1]; - if (lastCh != _T('/') && lastCh != _T('\\')) + wxString f = FindValidPath(file); + if ( wxIsAbsolutePath(f) ) + return f; + + wxString buf; + wxGetWorkingDirectory(buf.GetWriteBuf(_MAXPATHLEN), _MAXPATHLEN - 1); + buf.UngetWriteBuf(); + if ( !wxEndsWithPathSeparator(buf) ) { -#ifdef __WINDOWS__ - wxStrcat(buf, _T("\\")); -#else - wxStrcat(buf, _T("/")); -#endif + buf += wxFILE_SEP_PATH; } - wxStrcat(buf, (const wxChar *)f); - wxStrcpy(wxBuffer, buf); - return wxString(wxBuffer); - } + buf += f; + + return buf; } bool @@ -260,7 +272,7 @@ wxFileExists (const wxString& filename) struct stat stbuf; #endif - if ((filename != _T("")) && stat (FNSTRINGCAST filename.fn_str(), &stbuf) == 0) + if ((filename != T("")) && stat (wxFNSTRINGCAST filename.fn_str(), &stbuf) == 0) return TRUE; return FALSE; #endif @@ -281,15 +293,15 @@ bool wxFileExists(const char *pszFileName) bool wxIsAbsolutePath (const wxString& filename) { - if (filename != _T("")) + if (filename != T("")) { - if (filename[0] == _T('/') + if (filename[0] == T('/') #ifdef __VMS__ - || (filename[0] == _T('[') && filename[1] != _T('.')) + || (filename[0] == T('[') && filename[1] != T('.')) #endif #ifdef __WINDOWS__ /* MSDOS */ - || filename[0] == _T('\\') || (wxIsalpha (filename[0]) && filename[1] == _T(':')) + || filename[0] == T('\\') || (wxIsalpha (filename[0]) && filename[1] == T(':')) #endif ) return TRUE; @@ -309,7 +321,7 @@ void wxStripExtension(wxChar *buffer) int i = len-1; while (i > 0) { - if (buffer[i] == _T('.')) + if (buffer[i] == T('.')) { buffer[i] = 0; break; @@ -324,7 +336,7 @@ void wxStripExtension(wxString& buffer) size_t i = len-1; while (i > 0) { - if (buffer.GetChar(i) == _T('.')) + if (buffer.GetChar(i) == T('.')) { buffer = buffer.Left(i); break; @@ -337,15 +349,15 @@ void wxStripExtension(wxString& buffer) wxChar *wxRealPath (wxChar *path) { #ifdef __WXMSW__ - static const wxChar SEP = _T('\\'); + static const wxChar SEP = T('\\'); Unix2DosFilename(path); #else - static const wxChar SEP = _T('/'); + static const wxChar SEP = T('/'); #endif if (path[0] && path[1]) { /* MATTHEW: special case "/./x" */ wxChar *p; - if (path[2] == SEP && path[1] == _T('.')) + if (path[2] == SEP && path[1] == T('.')) p = &path[0]; else p = &path[2]; @@ -353,31 +365,31 @@ wxChar *wxRealPath (wxChar *path) { if (*p == SEP) { - if (p[1] == _T('.') && p[2] == _T('.') && (p[3] == SEP || p[3] == _T('\0'))) + if (p[1] == T('.') && p[2] == T('.') && (p[3] == SEP || p[3] == T('\0'))) { wxChar *q; for (q = p - 1; q >= path && *q != SEP; q--); - if (q[0] == SEP && (q[1] != _T('.') || q[2] != _T('.') || q[3] != SEP) + if (q[0] == SEP && (q[1] != T('.') || q[2] != T('.') || q[3] != SEP) && (q - 1 <= path || q[-1] != SEP)) { wxStrcpy (q, p + 3); - if (path[0] == _T('\0')) + if (path[0] == T('\0')) { path[0] = SEP; - path[1] = _T('\0'); + path[1] = T('\0'); } #ifdef __WXMSW__ /* Check that path[2] is NULL! */ - else if (path[1] == _T(':') && !path[2]) + else if (path[1] == T(':') && !path[2]) { path[2] = SEP; - path[3] = _T('\0'); + path[3] = T('\0'); } #endif p = q - 1; } } - else if (p[1] == _T('.') && (p[2] == SEP || p[2] == _T('\0'))) + else if (p[1] == T('.') && (p[2] == SEP || p[2] == T('\0'))) wxStrcpy (p, p + 2); } } @@ -388,25 +400,25 @@ wxChar *wxRealPath (wxChar *path) // Must be destroyed wxChar *wxCopyAbsolutePath(const wxString& filename) { - if (filename == _T("")) + if (filename == T("")) return (wxChar *) NULL; - if (! IsAbsolutePath(wxExpandPath(wxBuffer, filename))) { + if (! IsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) { wxChar buf[_MAXPATHLEN]; - buf[0] = _T('\0'); + buf[0] = T('\0'); wxGetWorkingDirectory(buf, WXSIZEOF(buf)); wxChar ch = buf[wxStrlen(buf) - 1]; #ifdef __WXMSW__ - if (ch != _T('\\') && ch != _T('/')) - wxStrcat(buf, _T("\\")); + if (ch != T('\\') && ch != T('/')) + wxStrcat(buf, T("\\")); #else - if (ch != _T('/')) - wxStrcat(buf, _T("/")); + if (ch != T('/')) + wxStrcat(buf, T("/")); #endif - wxStrcat(buf, wxBuffer); + wxStrcat(buf, wxFileFunctionsBuffer); return copystring( wxRealPath(buf) ); } - return copystring( wxBuffer ); + return copystring( wxFileFunctionsBuffer ); } /*- @@ -439,21 +451,21 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) int q; // Some compilers don't like this line. -// const wxChar trimchars[] = _T("\n \t"); +// const wxChar trimchars[] = T("\n \t"); wxChar trimchars[4]; - trimchars[0] = _T('\n'); - trimchars[1] = _T(' '); - trimchars[2] = _T('\t'); + trimchars[0] = T('\n'); + trimchars[1] = T(' '); + trimchars[2] = T('\t'); trimchars[3] = 0; #ifdef __WXMSW__ - const wxChar SEP = _T('\\'); + const wxChar SEP = T('\\'); #else - const wxChar SEP = _T('/'); + const wxChar SEP = T('/'); #endif - buf[0] = _T('\0'); - if (name == NULL || *name == _T('\0')) + buf[0] = T('\0'); + if (name == NULL || *name == T('\0')) return buf; nm = copystring(name); // Make a scratch copy wxChar *nm_tmp = nm; @@ -464,14 +476,14 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) /* And strip off trailing whitespace and cr */ s = nm + (q = wxStrlen(nm)) - 1; while (q-- && wxStrchr((wxChar *)trimchars, *s) != NULL) - *s = _T('\0'); + *s = T('\0'); s = nm; d = lnm; #ifdef __WXMSW__ q = FALSE; #else - q = nm[0] == _T('\\') && nm[1] == _T('~'); + q = nm[0] == T('\\') && nm[1] == T('~'); #endif /* Expand inline environment variables */ @@ -479,7 +491,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) while (*d) { *d++ = *s; - if(*s == _T('\\')) + if(*s == T('\\')) { *(d - 1) = *++s; if (*d) @@ -494,7 +506,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) #else while ((*d++ = *s)) { # ifndef __WXMSW__ - if (*s == _T('\\')) { + if (*s == T('\\')) { if ((*(d - 1) = *++s)) { s++; continue; @@ -504,13 +516,13 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) # endif #endif #ifdef __WXMSW__ - if (*s++ == _T('$') && (*s == _T('{') || *s == _T(')'))) + if (*s++ == T('$') && (*s == T('{') || *s == T(')'))) #else - if (*s++ == _T('$')) + if (*s++ == T('$')) #endif { register wxChar *start = d; - register int braces = (*s == _T('{') || *s == _T('(')); + register int braces = (*s == T('{') || *s == T('(')); register wxChar *value; #ifdef __VISAGECPP__ // VA gives assignment in logical expr warning @@ -519,7 +531,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) #else while ((*d++ = *s)) #endif - if (braces ? (*s == _T('}') || *s == _T(')')) : !(wxIsalnum(*s) || *s == _T('_')) ) + if (braces ? (*s == T('}') || *s == T(')')) : !(wxIsalnum(*s) || *s == T('_')) ) break; else s++; @@ -541,14 +553,14 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) /* Expand ~ and ~user */ nm = lnm; - s = _T(""); - if (nm[0] == _T('~') && !q) + s = T(""); + if (nm[0] == T('~') && !q) { /* prefix ~ */ if (nm[1] == SEP || nm[1] == 0) { /* ~/filename */ // FIXME: wxGetUserHome could return temporary storage in Unicode mode - if ((s = WXSTRINGCAST wxGetUserHome(_T(""))) != NULL) { + if ((s = WXSTRINGCAST wxGetUserHome(T(""))) != NULL) { if (*++nm) nm++; } @@ -565,7 +577,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) { if (was_sep) /* replace only if it was there: */ *s = SEP; - s = _T(""); + s = T(""); } else { nm = nnm; s = home; @@ -576,7 +588,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name) d = buf; if (s && *s) { /* MATTHEW: s could be NULL if user '~' didn't exist */ /* Copy home dir */ - while (_T('\0') != (*d++ = *s++)) + while (T('\0') != (*d++ = *s++)) /* loop */; // Handle root home if (d - 1 > buf && *(d - 2) != SEP) @@ -608,7 +620,7 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin { static wxChar dest[_MAXPATHLEN]; - if (filename == _T("")) + if (filename == T("")) return (wxChar *) NULL; wxStrcpy (dest, WXSTRINGCAST filename); @@ -622,12 +634,12 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL && (tcp = wxStrstr (dest, val)) != NULL) { - wxStrcpy (wxBuffer, tcp + wxStrlen (val)); - *tcp++ = _T('$'); - *tcp++ = _T('{'); + wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val)); + *tcp++ = T('$'); + *tcp++ = T('{'); wxStrcpy (tcp, WXSTRINGCAST envname); - wxStrcat (tcp, _T("}")); - wxStrcat (tcp, wxBuffer); + wxStrcat (tcp, T("}")); + wxStrcat (tcp, wxFileFunctionsBuffer); } // Handle User's home (ignore root homes!) @@ -636,16 +648,16 @@ wxContractPath (const wxString& filename, const wxString& envname, const wxStrin (len = wxStrlen(val)) > 2 && wxStrncmp(dest, val, len) == 0) { - wxStrcpy(wxBuffer, _T("~")); - if (user != _T("")) - wxStrcat(wxBuffer, (const wxChar*) user); + wxStrcpy(wxFileFunctionsBuffer, T("~")); + if (user != T("")) + wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user); #ifdef __WXMSW__ -// strcat(wxBuffer, "\\"); +// strcat(wxFileFunctionsBuffer, "\\"); #else -// strcat(wxBuffer, "/"); +// strcat(wxFileFunctionsBuffer, "/"); #endif - wxStrcat(wxBuffer, dest + len); - wxStrcpy (dest, wxBuffer); + wxStrcat(wxFileFunctionsBuffer, dest + len); + wxStrcpy (dest, wxFileFunctionsBuffer); } return dest; @@ -662,16 +674,16 @@ wxChar *wxFileNameFromPath (wxChar *path) tcp = path + wxStrlen (path); while (--tcp >= path) { - if (*tcp == _T('/') || *tcp == _T('\\') + if (*tcp == T('/') || *tcp == T('\\') #ifdef __VMS__ - || *tcp == _T(':') || *tcp == _T(']')) + || *tcp == T(':') || *tcp == T(']')) #else ) #endif return tcp + 1; } /* while */ #if defined(__WXMSW__) || defined(__WXPM__) - if (wxIsalpha (*path) && *(path + 1) == _T(':')) + if (wxIsalpha (*path) && *(path + 1) == T(':')) return path + 2; #endif } @@ -680,7 +692,7 @@ wxChar *wxFileNameFromPath (wxChar *path) wxString wxFileNameFromPath (const wxString& path1) { - if (path1 != _T("")) + if (path1 != T("")) { wxChar *path = WXSTRINGCAST path1 ; @@ -689,16 +701,16 @@ wxString wxFileNameFromPath (const wxString& path1) tcp = path + wxStrlen (path); while (--tcp >= path) { - if (*tcp == _T('/') || *tcp == _T('\\') + if (*tcp == T('/') || *tcp == T('\\') #ifdef __VMS__ - || *tcp == _T(':') || *tcp == _T(']')) + || *tcp == T(':') || *tcp == T(']')) #else ) #endif return wxString(tcp + 1); } /* while */ #if defined(__WXMSW__) || defined(__WXPM__) - if (wxIsalpha (*path) && *(path + 1) == _T(':')) + if (wxIsalpha (*path) && *(path + 1) == T(':')) return wxString(path + 2); #endif } @@ -727,7 +739,7 @@ wxPathOnly (wxChar *path) while (!done && i > -1) { // ] is for VMS - if (path[i] == _T('/') || path[i] == _T('\\') || path[i] == _T(']')) + if (path[i] == T('/') || path[i] == T('\\') || path[i] == T(']')) { done = TRUE; #ifdef __VMS__ @@ -743,11 +755,11 @@ wxPathOnly (wxChar *path) #if defined(__WXMSW__) || defined(__WXPM__) // Try Drive specifier - if (wxIsalpha (buf[0]) && buf[1] == _T(':')) + if (wxIsalpha (buf[0]) && buf[1] == T(':')) { // A:junk --> A:. (since A:.\junk Not A:\junk) - buf[2] = _T('.'); - buf[3] = _T('\0'); + buf[2] = T('.'); + buf[3] = T('\0'); return buf; } #endif @@ -759,7 +771,7 @@ wxPathOnly (wxChar *path) // Return just the directory, or NULL if no directory wxString wxPathOnly (const wxString& path) { - if (path != _T("")) + if (path != T("")) { wxChar buf[_MAXPATHLEN]; @@ -775,7 +787,7 @@ wxString wxPathOnly (const wxString& path) while (!done && i > -1) { // ] is for VMS - if (path[i] == _T('/') || path[i] == _T('\\') || path[i] == _T(']')) + if (path[i] == T('/') || path[i] == T('\\') || path[i] == T(']')) { done = TRUE; #ifdef __VMS__ @@ -791,17 +803,17 @@ wxString wxPathOnly (const wxString& path) #if defined(__WXMSW__) || defined(__WXPM__) // Try Drive specifier - if (wxIsalpha (buf[0]) && buf[1] == _T(':')) + if (wxIsalpha (buf[0]) && buf[1] == T(':')) { // A:junk --> A:. (since A:.\junk Not A:\junk) - buf[2] = _T('.'); - buf[3] = _T('\0'); + buf[2] = T('.'); + buf[3] = T('\0'); return wxString(buf); } #endif } - return wxString(_T("")); + return wxString(T("")); } // Utility for converting delimiters in DOS filenames to UNIX style @@ -815,15 +827,15 @@ wxMac2UnixFilename (wxChar *s) if (s) { memmove( s+1 , s ,(strlen( s ) + 1)*sizeof(wxChar)) ; - if ( *s == _T(':') ) - *s = _T('.') ; + if ( *s == T(':') ) + *s = T('.') ; else - *s = _T('/') ; + *s = T('/') ; while (*s) { - if (*s == _T(':')) - *s = _T('/'); + if (*s == T(':')) + *s = T('/'); else *s = wxTolower(*s); // Case INDEPENDENT s++; @@ -836,24 +848,24 @@ wxUnix2MacFilename (wxChar *s) { if (s) { - if ( *s == _T('.') ) + if ( *s == T('.') ) { // relative path , since it goes on with slash which is translated to a : memmove( s , s+1 ,strlen( s )*sizeof(wxChar) ) ; } - else if ( *s == _T('/') ) + else if ( *s == T('/') ) { // absolute path -> on mac just start with the drive name memmove( s , s+1 ,strlen( s )*sizeof(wxChar) ) ; } else { - wxASSERT_MSG( 1 , _T("unknown path beginning") ) ; + wxASSERT_MSG( 1 , T("unknown path beginning") ) ; } while (*s) { - if (*s == _T('/') || *s == _T('\\')) - *s = _T(':'); + if (*s == T('/') || *s == T('\\')) + *s = T(':'); s++ ; } @@ -866,8 +878,8 @@ wxDos2UnixFilename (wxChar *s) if (s) while (*s) { - if (*s == _T('\\')) - *s = _T('/'); + if (*s == T('\\')) + *s = T('/'); #if defined(__WXMSW__) || defined(__WXPM__) else *s = wxTolower(*s); // Case INDEPENDENT @@ -888,8 +900,8 @@ wxUnix2DosFilename (wxChar *WXUNUSED(s)) if (s) while (*s) { - if (*s == _T('/')) - *s = _T('\\'); + if (*s == T('/')) + *s = T('\\'); s++; } #endif @@ -917,8 +929,8 @@ wxConcatFiles (const wxString& file1, const wxString& file2, const wxString& fil (fp2 = fopen (gwxMacFileName2, "rb")) == NULL || (fp3 = fopen (gwxMacFileName3, "wb")) == NULL) #else - if ((fp1 = fopen (FNSTRINGCAST file1.fn_str(), "rb")) == NULL || - (fp2 = fopen (FNSTRINGCAST file2.fn_str(), "rb")) == NULL || + if ((fp1 = fopen (wxFNSTRINGCAST file1.fn_str(), "rb")) == NULL || + (fp2 = fopen (wxFNSTRINGCAST file2.fn_str(), "rb")) == NULL || (fp3 = fopen (wxFNCONV(outfile), "wb")) == NULL) #endif { @@ -964,9 +976,9 @@ wxCopyFile (const wxString& file1, const wxString& file2) return FALSE; if ((fd2 = fopen (gwxMacFileName2, "wb")) == NULL) #else - if ((fd1 = fopen (FNSTRINGCAST file1.fn_str(), "rb")) == NULL) + if ((fd1 = fopen (wxFNSTRINGCAST file1.fn_str(), "rb")) == NULL) return FALSE; - if ((fd2 = fopen (FNSTRINGCAST file2.fn_str(), "wb")) == NULL) + if ((fd2 = fopen (wxFNSTRINGCAST file2.fn_str(), "wb")) == NULL) #endif { fclose (fd1); @@ -994,7 +1006,7 @@ wxRenameFile (const wxString& file1, const wxString& file2) return TRUE; #else // Normal system call - if (0 == rename (FNSTRINGCAST file1.fn_str(), FNSTRINGCAST file2.fn_str())) + if (0 == rename (wxFNSTRINGCAST file1.fn_str(), wxFNSTRINGCAST file2.fn_str())) return TRUE; #endif // Try to copy @@ -1009,13 +1021,13 @@ wxRenameFile (const wxString& file1, const wxString& file2) bool wxRemoveFile(const wxString& file) { #if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__) - int flag = remove(FNSTRINGCAST file.fn_str()); + int flag = remove(wxFNSTRINGCAST file.fn_str()); #elif defined( __WXMAC__ ) wxStrcpy( gwxMacFileName , file ) ; wxUnix2MacFilename( gwxMacFileName ) ; int flag = unlink(gwxMacFileName); #else - int flag = unlink(FNSTRINGCAST file.fn_str()); + int flag = unlink(wxFNSTRINGCAST file.fn_str()); #endif return (flag == 0) ; } @@ -1035,7 +1047,7 @@ bool wxMkdir(const wxString& dir, int perm) #if (!(defined(__WXMSW__) || defined(__WXPM__))) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) || defined(__WXWINE__) if ( mkdir(wxFNCONV(dirname), perm) != 0 ) #else // MSW and OS/2 - if ( mkdir(FNSTRINGCAST wxFNCONV(dirname)) != 0 ) + if ( mkdir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 ) #endif // !MSW/MSW { wxLogSysError(_("Directory '%s' couldn't be created"), dirname); @@ -1059,7 +1071,7 @@ bool wxRmdir(const wxString& dir, int WXUNUSED(flags)) #ifdef __SALFORDC__ return FALSE; // What to do? #else - return (rmdir(FNSTRINGCAST dir.fn_str()) == 0); + return (rmdir(wxFNSTRINGCAST dir.fn_str()) == 0); #endif #endif @@ -1117,8 +1129,8 @@ bool wxPathExists(const wxChar *pszPathName) /* Windows API returns -1 from stat for "c:\dir\" if "c:\dir" exists * OTOH, we should change "d:" to "d:\" and leave "\" as is. */ wxString strPath(pszPathName); - if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != _T('\0') ) - strPath.Last() = _T('\0'); + if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != T('\0') ) + strPath.Last() = T('\0'); #ifdef __SALFORDC__ struct _stat st; @@ -1126,7 +1138,7 @@ bool wxPathExists(const wxChar *pszPathName) struct stat st; #endif - return stat(FNSTRINGCAST strPath.fn_str(), &st) == 0 && (st.st_mode & S_IFDIR); + return stat(wxFNSTRINGCAST strPath.fn_str(), &st) == 0 && (st.st_mode & S_IFDIR); } // Get a temporary filename, opening and closing the file. @@ -1154,7 +1166,7 @@ wxChar *wxGetTempFileName(const wxString& prefix, wxChar *buf) for (short suffix = last_temp + 1; suffix != last_temp; ++suffix %= 1000) { - wxSprintf (tmp, _T("/tmp/%s%d.%03x"), WXSTRINGCAST prefix, (int) getpid (), (int) suffix); + wxSprintf (tmp, T("/tmp/%s%d.%03x"), WXSTRINGCAST prefix, (int) getpid (), (int) suffix); if (!wxFileExists( tmp )) { // Touch the file to create it (reserve name) @@ -1205,11 +1217,11 @@ wxString wxFindFirstFile(const wxChar *spec, int flags) wxString path(wxPathOnly(gs_strFileSpec)); // special case: path is really "/" - if ( !path && gs_strFileSpec[0u] == _T('/') ) - path = _T('/'); + if ( !path && gs_strFileSpec[0u] == T('/') ) + path = T('/'); // path is empty => Local directory if ( !path ) - path = _T('.'); + path = T('.'); gs_dirStream = opendir(path.fn_str()); if ( !gs_dirStream ) @@ -1231,7 +1243,7 @@ wxString wxFindNextFile() wxString result; #ifndef __VMS__ - wxCHECK_MSG( gs_dirStream, result, _T("must call wxFindFirstFile first") ); + wxCHECK_MSG( gs_dirStream, result, T("must call wxFindFirstFile first") ); // Find path only so we can concatenate // found file onto path @@ -1239,8 +1251,8 @@ wxString wxFindNextFile() wxString name(wxFileNameFromPath(gs_strFileSpec)); /* MATTHEW: special case: path is really "/" */ - if ( !path && gs_strFileSpec[0u] == _T('/')) - path = _T('/'); + if ( !path && gs_strFileSpec[0u] == T('/')) + path = T('/'); // Do the reading struct dirent *nextDir; @@ -1254,8 +1266,8 @@ wxString wxFindNextFile() if ( !path.IsEmpty() ) { result = path; - if ( path != _T('/') ) - result += _T('/'); + if ( path != T('/') ) + result += T('/'); } result += nextDir->d_name; @@ -1318,7 +1330,7 @@ wxString wxFindFirstFile(const wxChar *spec, int flags) // Find path only so we can concatenate found file onto path wxString path(wxPathOnly(gs_strFileSpec)); if ( !path.IsEmpty() ) - result << path << _T('\\'); + result << path << T('\\'); #ifdef __WIN32__ if ( gs_hFileStruct != INVALID_HANDLE_VALUE ) @@ -1411,7 +1423,7 @@ try_again: goto try_again; if ( !path.IsEmpty() ) - result << path << _T('\\'); + result << path << T('\\'); result << gs_findDataStruct.cFileName; } @@ -1477,8 +1489,8 @@ wxChar *wxGetWorkingDirectory(wxChar *buf, int sz) if (getcwd(buf, sz) == NULL) { #endif #endif - buf[0] = _T('.'); - buf[1] = _T('\0'); + buf[0] = T('.'); + buf[1] = T('\0'); } #if wxUSE_UNICODE else { @@ -1503,7 +1515,7 @@ wxString wxGetCwd() bool wxSetWorkingDirectory(const wxString& d) { #if defined( __UNIX__ ) || defined( __WXMAC__ ) || defined(__WXPM__) - return (chdir(FNSTRINGCAST d.fn_str()) == 0); + return (chdir(wxFNSTRINGCAST d.fn_str()) == 0); #elif defined(__WINDOWS__) #ifdef __WIN32__ @@ -1601,7 +1613,7 @@ void WXDLLEXPORT wxSplitPath(const wxChar *pszFileName, wxString *pstrExt) { // it can be empty, but it shouldn't be NULL - wxCHECK_RET( pszFileName, _T("NULL file name in wxSplitPath") ); + wxCHECK_RET( pszFileName, T("NULL file name in wxSplitPath") ); const wxChar *pDot = wxStrrchr(pszFileName, wxFILE_SEP_EXT); @@ -1661,9 +1673,9 @@ bool wxIsWild( const wxString& pattern ) wxChar *pat = WXSTRINGCAST(tmp); while (*pat) { switch (*pat++) { - case _T('?'): case _T('*'): case _T('['): case _T('{'): + case T('?'): case T('*'): case T('['): case T('{'): return TRUE; - case _T('\\'): + case T('\\'): if (!*pat++) return FALSE; } @@ -1697,57 +1709,57 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) wxChar *cp; bool done = FALSE, ret_code, ok; // Below is for vi fans - const wxChar OB = _T('{'), CB = _T('}'); + const wxChar OB = T('{'), CB = T('}'); // dot_special means '.' only matches '.' - if (dot_special && *str == _T('.') && *pattern != *str) + if (dot_special && *str == T('.') && *pattern != *str) return FALSE; - while ((*pattern != _T('\0')) && (!done) - && (((*str==_T('\0'))&&((*pattern==OB)||(*pattern==_T('*'))))||(*str!=_T('\0')))) { + while ((*pattern != T('\0')) && (!done) + && (((*str==T('\0'))&&((*pattern==OB)||(*pattern==T('*'))))||(*str!=T('\0')))) { switch (*pattern) { - case _T('\\'): + case T('\\'): pattern++; - if (*pattern != _T('\0')) + if (*pattern != T('\0')) pattern++; break; - case _T('*'): + case T('*'): pattern++; ret_code = FALSE; - while ((*str!=_T('\0')) + while ((*str!=T('\0')) && (!(ret_code=wxMatchWild(pattern, str++, FALSE)))) /*loop*/; if (ret_code) { - while (*str != _T('\0')) + while (*str != T('\0')) str++; - while (*pattern != _T('\0')) + while (*pattern != T('\0')) pattern++; } break; - case _T('['): + case T('['): pattern++; repeat: - if ((*pattern == _T('\0')) || (*pattern == _T(']'))) { + if ((*pattern == T('\0')) || (*pattern == T(']'))) { done = TRUE; break; } - if (*pattern == _T('\\')) { + if (*pattern == T('\\')) { pattern++; - if (*pattern == _T('\0')) { + if (*pattern == T('\0')) { done = TRUE; break; } } - if (*(pattern + 1) == _T('-')) { + if (*(pattern + 1) == T('-')) { c = *pattern; pattern += 2; - if (*pattern == _T(']')) { + if (*pattern == T(']')) { done = TRUE; break; } - if (*pattern == _T('\\')) { + if (*pattern == T('\\')) { pattern++; - if (*pattern == _T('\0')) { + if (*pattern == T('\0')) { done = TRUE; break; } @@ -1761,51 +1773,51 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) goto repeat; } pattern++; - while ((*pattern != _T(']')) && (*pattern != _T('\0'))) { - if ((*pattern == _T('\\')) && (*(pattern + 1) != _T('\0'))) + while ((*pattern != T(']')) && (*pattern != T('\0'))) { + if ((*pattern == T('\\')) && (*(pattern + 1) != T('\0'))) pattern++; pattern++; } - if (*pattern != _T('\0')) { + if (*pattern != T('\0')) { pattern++, str++; } break; - case _T('?'): + case T('?'): pattern++; str++; break; case OB: pattern++; - while ((*pattern != CB) && (*pattern != _T('\0'))) { + while ((*pattern != CB) && (*pattern != T('\0'))) { cp = str; ok = TRUE; - while (ok && (*cp != _T('\0')) && (*pattern != _T('\0')) - && (*pattern != _T(',')) && (*pattern != CB)) { - if (*pattern == _T('\\')) + while (ok && (*cp != T('\0')) && (*pattern != T('\0')) + && (*pattern != T(',')) && (*pattern != CB)) { + if (*pattern == T('\\')) pattern++; ok = (*pattern++ == *cp++); } - if (*pattern == _T('\0')) { + if (*pattern == T('\0')) { ok = FALSE; done = TRUE; break; } else if (ok) { str = cp; - while ((*pattern != CB) && (*pattern != _T('\0'))) { - if (*++pattern == _T('\\')) { + while ((*pattern != CB) && (*pattern != T('\0'))) { + if (*++pattern == T('\\')) { if (*++pattern == CB) pattern++; } } } else { - while (*pattern!=CB && *pattern!=_T(',') && *pattern!=_T('\0')) { - if (*++pattern == _T('\\')) { - if (*++pattern == CB || *pattern == _T(',')) + while (*pattern!=CB && *pattern!=T(',') && *pattern!=T('\0')) { + if (*++pattern == T('\\')) { + if (*++pattern == CB || *pattern == T(',')) pattern++; } } } - if (*pattern != _T('\0')) + if (*pattern != T('\0')) pattern++; } break; @@ -1817,9 +1829,9 @@ bool wxMatchWild( const wxString& pat, const wxString& text, bool dot_special ) } } } - while (*pattern == _T('*')) + while (*pattern == T('*')) pattern++; - return ((*str == _T('\0')) && (*pattern == _T('\0'))); + return ((*str == T('\0')) && (*pattern == T('\0'))); }; #endif diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index e166f1b2bf..54c8cc86e3 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -53,9 +53,9 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location) l2 = l; for (int i = l-1; i >= 0; i--) { c = loc[(unsigned int) i]; - if (c == _T('#')) l2 = i + 1; - if (c == _T('.')) {ext = loc.Right(l2-i-1); break;} - if ((c == _T('/')) || (c == _T('\\')) || (c == _T(':'))) {return wxEmptyString;} + if (c == T('#')) l2 = i + 1; + if (c == T('.')) {ext = loc.Right(l2-i-1); break;} + if ((c == T('/')) || (c == T('\\')) || (c == T(':'))) {return wxEmptyString;} } if (m_MimeMng == NULL) { @@ -110,11 +110,11 @@ wxString wxFileSystemHandler::GetProtocol(const wxString& location) const bool fnd; fnd = FALSE; - for (i = l-1; (i >= 0) && ((location[i] != _T('#')) || (!fnd)); i--) { - if ((location[i] == _T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE; + for (i = l-1; (i >= 0) && ((location[i] != T('#')) || (!fnd)); i--) { + if ((location[i] == T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE; } - if (!fnd) return _T("file"); - for (++i; (i < l) && (location[i] != _T(':')); i++) s << location[i]; + if (!fnd) return T("file"); + for (++i; (i < l) && (location[i] != T(':')); i++) s << location[i]; return s; } @@ -126,8 +126,8 @@ wxString wxFileSystemHandler::GetLeftLocation(const wxString& location) const fnd = FALSE; for (i = location.Length()-1; i >= 0; i--) { - if ((location[i] == _T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE; - else if (fnd && (location[i] == _T('#'))) return location.Left(i); + if ((location[i] == T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE; + else if (fnd && (location[i] == T('#'))) return location.Left(i); } return wxEmptyString; } @@ -136,7 +136,7 @@ wxString wxFileSystemHandler::GetRightLocation(const wxString& location) const { int i, l = location.Length(); int l2 = l + 1; - for (i = l-1; (i >= 0) && ((location[i] != _T(':')) || (i == 1) || (location[i-2] == _T(':'))); i--) {if (location[i] == _T('#')) l2 = i + 1;} + for (i = l-1; (i >= 0) && ((location[i] != T(':')) || (i == 1) || (location[i-2] == T(':'))); i--) {if (location[i] == T('#')) l2 = i + 1;} if (i == 0) return wxEmptyString; else return location.Mid(i + 1, l2 - i - 2); } @@ -148,8 +148,8 @@ wxString wxFileSystemHandler::GetAnchor(const wxString& location) const for (int i = l-1; i >= 0; i--) { c = location[i]; - if (c == _T('#')) return location.Right(l-i-1); - else if ((c == _T('.')) || (c == _T('/')) || (c == _T('\\')) || (c == _T(':'))) return wxEmptyString; + if (c == T('#')) return location.Right(l-i-1); + else if ((c == T('.')) || (c == T('/')) || (c == T('\\')) || (c == T(':'))) return wxEmptyString; } return wxEmptyString; } @@ -168,7 +168,7 @@ class wxLocalFSHandler : public wxFileSystemHandler bool wxLocalFSHandler::CanOpen(const wxString& location) { - return GetProtocol(location) == _T("file"); + return GetProtocol(location) == T("file"); } wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location) @@ -199,15 +199,15 @@ void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir) m_Path = location; for (i = m_Path.Length()-1; i >= 0; i--) - if (m_Path[(unsigned int) i] == _T('\\')) m_Path.GetWritableChar(i) = _T('/'); // wanna be windows-safe + if (m_Path[(unsigned int) i] == T('\\')) m_Path.GetWritableChar(i) = T('/'); // wanna be windows-safe if (is_dir == FALSE) { for (i = m_Path.Length()-1; i >= 0; i--) { - if (m_Path[(unsigned int) i] == _T('/')) + if (m_Path[(unsigned int) i] == T('/')) { - if ((i > 1) && (m_Path[(unsigned int) (i-1)] == _T('/')) && (m_Path[(unsigned int) (i-2)] == _T(':'))) + if ((i > 1) && (m_Path[(unsigned int) (i-1)] == T('/')) && (m_Path[(unsigned int) (i-2)] == T(':'))) { i -= 2; continue; @@ -218,7 +218,7 @@ void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir) break; } } - else if (m_Path[(unsigned int) i] == _T(':')) { + else if (m_Path[(unsigned int) i] == T(':')) { pathpos = i; break; } @@ -227,9 +227,9 @@ void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir) { for (i = 0; i < (int) m_Path.Length(); i++) { - if (m_Path[(unsigned int) i] == _T(':')) + if (m_Path[(unsigned int) i] == T(':')) { - //m_Path << _T('/'); + //m_Path << T('/'); m_Path.Remove(i+1); break; } @@ -239,8 +239,8 @@ void wxFileSystem::ChangePathTo(const wxString& location, bool is_dir) } else { - if (m_Path[m_Path.Length()-1] != _T('/')) - m_Path << _T('/'); + if (m_Path[m_Path.Length()-1] != T('/')) + m_Path << T('/'); m_Path.Remove(pathpos+1); } } @@ -260,16 +260,16 @@ wxFSFile* wxFileSystem::OpenFile(const wxString& location) meta = 0; for (i = 0; i < ln; i++) { - if (loc[(unsigned int) i] == _T('\\')) loc.GetWritableChar(i) = _T('/'); // wanna be windows-safe + if (loc[(unsigned int) i] == T('\\')) loc.GetWritableChar(i) = T('/'); // wanna be windows-safe if (!meta) switch (loc[(unsigned int) i]) { - case _T('/') : case _T(':') : case _T('#') : meta = loc[(unsigned int) i]; + case T('/') : case T(':') : case T('#') : meta = loc[(unsigned int) i]; } } m_LastName = wxEmptyString; // try relative paths first : - if (meta != _T(':')) + if (meta != T(':')) { node = m_Handlers.GetFirst(); while (node) diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index f7a0726e42..e50a844a60 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -70,43 +70,43 @@ bool wxFontBase::operator!=(const wxFont& font) const wxString wxFontBase::GetFamilyString() const { - wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") ); + wxCHECK_MSG( Ok(), T("wxDEFAULT("), T("invalid font") ); switch ( GetFamily() ) { - case wxDECORATIVE: return _T("wxDECORATIVE"); - case wxROMAN: return _T("wxROMAN"); - case wxSCRIPT: return _T("wxSCRIPT"); - case wxSWISS: return _T("wxSWISS"); - case wxMODERN: return _T("wxMODERN"); - case wxTELETYPE: return _T("wxTELETYPE"); - default: return _T("wxDEFAULT"); + case wxDECORATIVE: return T("wxDECORATIVE"); + case wxROMAN: return T("wxROMAN"); + case wxSCRIPT: return T("wxSCRIPT("); + case wxSWISS: return T("wxSWISS"); + case wxMODERN: return T("wxMODERN"); + case wxTELETYPE: return T("wxTELETYPE"); + default: return T("wxDEFAULT("); } } wxString wxFontBase::GetStyleString() const { - wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") ); + wxCHECK_MSG( Ok(), T("wxDEFAULT("), T("invalid font") ); switch ( GetStyle() ) { - case wxNORMAL: return _T("wxNORMAL"); - case wxSLANT: return _T("wxSLANT"); - case wxITALIC: return _T("wxITALIC"); - default: return _T("wxDEFAULT"); + case wxNORMAL: return T("wxNORMAL"); + case wxSLANT: return T("wxSLANT("); + case wxITALIC: return T("wxITALIC"); + default: return T("wxDEFAULT("); } } wxString wxFontBase::GetWeightString() const { - wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") ); + wxCHECK_MSG( Ok(), T("wxDEFAULT("), T("invalid font") ); switch ( GetWeight() ) { - case wxNORMAL: return _T("wxNORMAL"); - case wxBOLD: return _T("wxBOLD"); - case wxLIGHT: return _T("wxLIGHT"); - default: return _T("wxDEFAULT"); + case wxNORMAL: return T("wxNORMAL"); + case wxBOLD: return T("wxBOLD"); + case wxLIGHT: return T("wxLIGHT("); + default: return T("wxDEFAULT("); } } diff --git a/src/common/fs_inet.cpp b/src/common/fs_inet.cpp index f471a5bf83..6b75e4b9ef 100644 --- a/src/common/fs_inet.cpp +++ b/src/common/fs_inet.cpp @@ -69,13 +69,13 @@ class wxInetCacheNode : public wxObject bool wxInternetFSHandler::CanOpen(const wxString& location) { wxString p = GetProtocol(location); - return (p == _T("http")) || (p == _T("ftp")); + return (p == T("http")) || (p == T("ftp")); } wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location) { - wxString right = GetProtocol(location) + _T(":") + GetRightLocation(location); + wxString right = GetProtocol(location) + T(":") + GetRightLocation(location); wxInputStream *s; wxString content; wxInetCacheNode *info; @@ -93,7 +93,7 @@ wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxStri { wxChar buf[256]; - wxGetTempFileName( _T("wxhtml"), buf); + wxGetTempFileName( T("wxhtml"), buf); info = new wxInetCacheNode(buf, content); m_Cache.Put(right, info); diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 094fdad98b..3953563b10 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -50,7 +50,7 @@ #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxFTP, wxProtocol) -IMPLEMENT_PROTOCOL(wxFTP, _T("ftp"), _T("ftp"), TRUE) +IMPLEMENT_PROTOCOL(wxFTP, T("ftp"), T("ftp"), TRUE) #endif //////////////////////////////////////////////////////////////// @@ -63,7 +63,7 @@ wxFTP::wxFTP() m_lastError = wxPROTO_NOERR; m_streaming = FALSE; - m_user = _T("anonymous"); + m_user = T("anonymous"); m_passwd = wxGetUserId(); m_passwd += '@'; m_passwd += wxGetHostName(); @@ -74,7 +74,7 @@ wxFTP::wxFTP() wxFTP::~wxFTP() { - SendCommand("QUIT", '2'); + SendCommand("QUIT(", '2'); } //////////////////////////////////////////////////////////////// @@ -99,13 +99,13 @@ bool wxFTP::Connect(wxSockAddress& addr, bool WXUNUSED(wait)) return FALSE; } - command.sprintf(_T("USER %s"), (const wxChar *)m_user); + command.sprintf(T("USER %s"), (const wxChar *)m_user); if (!SendCommand(command, '3')) { Close(); return FALSE; } - command.sprintf(_T("PASS %s"), (const wxChar *)m_passwd); + command.sprintf(T("PASS %s"), (const wxChar *)m_passwd); if (!SendCommand(command, '2')) { Close(); return FALSE; @@ -120,7 +120,7 @@ bool wxFTP::Connect(const wxString& host) wxString my_host = host; addr.Hostname(my_host); - addr.Service(_T("ftp")); + addr.Service(T("ftp")); return Connect(addr); } @@ -132,7 +132,7 @@ bool wxFTP::Close() return FALSE; } if (m_connected) - SendCommand(wxString(_T("QUIT")), '2'); + SendCommand(wxString(T("QUIT(")), '2'); return wxSocketClient::Close(); } @@ -147,9 +147,9 @@ bool wxFTP::SendCommand(const wxString& command, char exp_ret) m_lastError = wxPROTO_STREAMING; return FALSE; } - tmp_str = command + _T("\r\n"); + tmp_str = command + T("\r\n"); const wxWX2MBbuf tmp_buf = tmp_str.mb_str(); - if (Write(MBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) { + if (Write(wxMBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) { m_lastError = wxPROTO_NETERR; return FALSE; } @@ -169,7 +169,7 @@ bool wxFTP::GetResult(char exp) if (m_lastResult.GetChar(3) == '-') { wxString key = m_lastResult.Left((size_t)3); - key += _T(' '); + key += T(' '); while (m_lastResult.Index(key) != 0) { m_lastError = GetLine(this, m_lastResult); @@ -187,14 +187,14 @@ bool wxFTP::ChDir(const wxString& dir) { wxString str = dir; - str.Prepend(_T("CWD ")); + str.Prepend(T("CWD ")); return SendCommand(str, '2'); } bool wxFTP::MkDir(const wxString& dir) { wxString str = dir; - str.Prepend(_T("MKD ")); + str.Prepend(T("MKD ")); return SendCommand(str, '2'); } @@ -202,7 +202,7 @@ bool wxFTP::RmDir(const wxString& dir) { wxString str = dir; - str.Prepend(_T("PWD ")); + str.Prepend(T("PWD ")); return SendCommand(str, '2'); } @@ -210,11 +210,11 @@ wxString wxFTP::Pwd() { int beg, end; - if (!SendCommand(_T("PWD"), '2')) + if (!SendCommand(T("PWD"), '2')) return wxString((char *)NULL); - beg = m_lastResult.Find(_T('\"'),FALSE); - end = m_lastResult.Find(_T('\"'),TRUE); + beg = m_lastResult.Find(T('\"'),FALSE); + end = m_lastResult.Find(T('\"'),TRUE); return wxString(beg+1, end); } @@ -223,11 +223,11 @@ bool wxFTP::Rename(const wxString& src, const wxString& dst) { wxString str; - str = _T("RNFR ") + src; + str = T("RNFR ") + src; if (!SendCommand(str, '3')) return FALSE; - str = _T("RNTO ") + dst; + str = T("RNTO ") + dst; return SendCommand(str, '2'); } @@ -235,7 +235,7 @@ bool wxFTP::RmFile(const wxString& path) { wxString str; - str = _T("DELE "); + str = T("DELE "); str += path; return SendCommand(str, '2'); } @@ -288,16 +288,16 @@ wxSocketClient *wxFTP::GetPort() wxUint16 port; wxUint32 hostaddr; - if (!SendCommand(_T("PASV"), '2')) + if (!SendCommand(T("PASV"), '2')) return NULL; - addr_pos = m_lastResult.Find(_T('(')); + addr_pos = m_lastResult.Find(T('(')); if (addr_pos == -1) { m_lastError = wxPROTO_PROTERR; return NULL; } straddr = m_lastResult(addr_pos+1, m_lastResult.Length()); - wxSscanf((const wxChar *)straddr,_T("%d,%d,%d,%d,%d,%d"),&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]); + wxSscanf((const wxChar *)straddr,T("%d,%d,%d,%d,%d,%d"),&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]); hostaddr = (wxUint16)a[5] << 24 | (wxUint16)a[4] << 16 | (wxUint16)a[3] << 8 | a[2]; @@ -319,7 +319,7 @@ wxSocketClient *wxFTP::GetPort() bool wxFTP::Abort(void) { m_streaming = FALSE; - if (!SendCommand(_T("ABOR"), '4')) + if (!SendCommand(T("ABOR"), '4')) return FALSE; return GetResult('2'); } @@ -330,7 +330,7 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path) int pos_size; wxInputFTPStream *in_stream; - if (!SendCommand(_T("TYPE I"), '2')) + if (!SendCommand(T("TYPE I"), '2')) return NULL; wxSocketClient *sock = GetPort(); @@ -340,15 +340,15 @@ wxInputStream *wxFTP::GetInputStream(const wxString& path) return NULL; } - tmp_str = _T("RETR ") + wxURL::ConvertFromURI(path); + tmp_str = T("RETR ") + wxURL::ConvertFromURI(path); if (!SendCommand(tmp_str, '1')) return NULL; in_stream = new wxInputFTPStream(this, sock); - pos_size = m_lastResult.Index(_T('(')); + pos_size = m_lastResult.Index(T('(')); if (pos_size != wxNOT_FOUND) { - wxString str_size = m_lastResult(pos_size+1, m_lastResult.Index(_T(')'))-1); + wxString str_size = m_lastResult(pos_size+1, m_lastResult.Index(T(')'))-1); in_stream->m_ftpsize = wxAtoi(WXSTRINGCAST str_size); } @@ -361,12 +361,12 @@ wxOutputStream *wxFTP::GetOutputStream(const wxString& path) { wxString tmp_str; - if (!SendCommand(_T("TYPE I"), '2')) + if (!SendCommand(T("TYPE I"), '2')) return NULL; wxSocketClient *sock = GetPort(); - tmp_str = _T("STOR ") + path; + tmp_str = T("STOR ") + path; if (!SendCommand(tmp_str, '1')) return FALSE; @@ -377,7 +377,7 @@ wxList *wxFTP::GetList(const wxString& wildcard) { wxList *file_list = new wxList; wxSocketBase *sock = GetPort(); - wxString tmp_str = _T("NLST"); + wxString tmp_str = T("NLST("); if (!wildcard.IsNull()) tmp_str += wildcard; diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 7755f181e1..539ab01dec 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -144,84 +144,84 @@ void wxColourDatabase::Initialize () static cdef table[]={ // #ifdef __WXMSW__ - {_T("AQUAMARINE"),112, 219, 147}, - {_T("BLACK"),0, 0, 0}, - {_T("BLUE"), 0, 0, 255}, - {_T("BLUE VIOLET"), 159, 95, 159}, - {_T("BROWN"), 165, 42, 42}, - {_T("CADET BLUE"), 95, 159, 159}, - {_T("CORAL"), 255, 127, 0}, - {_T("CORNFLOWER BLUE"), 66, 66, 111}, - {_T("CYAN"), 0, 255, 255}, - {_T("DARK GREY"), 47, 47, 47}, // ? - - {_T("DARK GREEN"), 47, 79, 47}, - {_T("DARK OLIVE GREEN"), 79, 79, 47}, - {_T("DARK ORCHID"), 153, 50, 204}, - {_T("DARK SLATE BLUE"), 107, 35, 142}, - {_T("DARK SLATE GREY"), 47, 79, 79}, - {_T("DARK TURQUOISE"), 112, 147, 219}, - {_T("DIM GREY"), 84, 84, 84}, - {_T("FIREBRICK"), 142, 35, 35}, - {_T("FOREST GREEN"), 35, 142, 35}, - {_T("GOLD"), 204, 127, 50}, - {_T("GOLDENROD"), 219, 219, 112}, - {_T("GREY"), 128, 128, 128}, - {_T("GREEN"), 0, 255, 0}, - {_T("GREEN YELLOW"), 147, 219, 112}, - {_T("INDIAN RED"), 79, 47, 47}, - {_T("KHAKI"), 159, 159, 95}, - {_T("LIGHT BLUE"), 191, 216, 216}, - {_T("LIGHT GREY"), 192, 192, 192}, - {_T("LIGHT STEEL BLUE"), 143, 143, 188}, - {_T("LIME GREEN"), 50, 204, 50}, - {_T("LIGHT MAGENTA"), 255, 0, 255}, - {_T("MAGENTA"), 255, 0, 255}, - {_T("MAROON"), 142, 35, 107}, - {_T("MEDIUM AQUAMARINE"), 50, 204, 153}, - {_T("MEDIUM GREY"), 100, 100, 100}, - {_T("MEDIUM BLUE"), 50, 50, 204}, - {_T("MEDIUM FOREST GREEN"), 107, 142, 35}, - {_T("MEDIUM GOLDENROD"), 234, 234, 173}, - {_T("MEDIUM ORCHID"), 147, 112, 219}, - {_T("MEDIUM SEA GREEN"), 66, 111, 66}, - {_T("MEDIUM SLATE BLUE"), 127, 0, 255}, - {_T("MEDIUM SPRING GREEN"), 127, 255, 0}, - {_T("MEDIUM TURQUOISE"), 112, 219, 219}, - {_T("MEDIUM VIOLET RED"), 219, 112, 147}, - {_T("MIDNIGHT BLUE"), 47, 47, 79}, - {_T("NAVY"), 35, 35, 142}, - {_T("ORANGE"), 204, 50, 50}, - {_T("ORANGE RED"), 255, 0, 127}, - {_T("ORCHID"), 219, 112, 219}, - {_T("PALE GREEN"), 143, 188, 143}, - {_T("PINK"), 188, 143, 234}, - {_T("PLUM"), 234, 173, 234}, - {_T("PURPLE"), 176, 0, 255}, - {_T("RED"), 255, 0, 0}, - {_T("SALMON"), 111, 66, 66}, - {_T("SEA GREEN"), 35, 142, 107}, - {_T("SIENNA"), 142, 107, 35}, - {_T("SKY BLUE"), 50, 153, 204}, - {_T("SLATE BLUE"), 0, 127, 255}, - {_T("SPRING GREEN"), 0, 255, 127}, - {_T("STEEL BLUE"), 35, 107, 142}, - {_T("TAN"), 219, 147, 112}, - {_T("THISTLE"), 216, 191, 216}, - {_T("TURQUOISE"), 173, 234, 234}, - {_T("VIOLET"), 79, 47, 79}, - {_T("VIOLET RED"), 204, 50, 153}, - {_T("WHEAT"), 216, 216, 191}, - {_T("WHITE"), 255, 255, 255}, - {_T("YELLOW"), 255, 255, 0}, - {_T("YELLOW GREEN"), 153, 204, 50}, + {T("AQUAMARINE"),112, 219, 147}, + {T("BLACK"),0, 0, 0}, + {T("BLUE"), 0, 0, 255}, + {T("BLUE VIOLET("), 159, 95, 159}, + {T("BROWN"), 165, 42, 42}, + {T("CADET BLUE"), 95, 159, 159}, + {T("CORAL"), 255, 127, 0}, + {T("CORNFLOWER BLUE"), 66, 66, 111}, + {T("CYAN"), 0, 255, 255}, + {T("DARK GREY"), 47, 47, 47}, // ? + + {T("DARK GREEN"), 47, 79, 47}, + {T("DARK OLIVE GREEN"), 79, 79, 47}, + {T("DARK ORCHID"), 153, 50, 204}, + {T("DARK SLATE BLUE"), 107, 35, 142}, + {T("DARK SLATE GREY"), 47, 79, 79}, + {T("DARK TURQUOISE"), 112, 147, 219}, + {T("DIM GREY"), 84, 84, 84}, + {T("FIREBRICK"), 142, 35, 35}, + {T("FOREST GREEN"), 35, 142, 35}, + {T("GOLD"), 204, 127, 50}, + {T("GOLDENROD"), 219, 219, 112}, + {T("GREY"), 128, 128, 128}, + {T("GREEN"), 0, 255, 0}, + {T("GREEN YELLOW"), 147, 219, 112}, + {T("INDIAN RED"), 79, 47, 47}, + {T("KHAKI"), 159, 159, 95}, + {T("LIGHT BLUE"), 191, 216, 216}, + {T("LIGHT GREY"), 192, 192, 192}, + {T("LIGHT STEEL BLUE"), 143, 143, 188}, + {T("LIME GREEN"), 50, 204, 50}, + {T("LIGHT MAGENTA"), 255, 0, 255}, + {T("MAGENTA"), 255, 0, 255}, + {T("MAROON"), 142, 35, 107}, + {T("MEDIUM AQUAMARINE"), 50, 204, 153}, + {T("MEDIUM GREY"), 100, 100, 100}, + {T("MEDIUM BLUE"), 50, 50, 204}, + {T("MEDIUM FOREST GREEN"), 107, 142, 35}, + {T("MEDIUM GOLDENROD"), 234, 234, 173}, + {T("MEDIUM ORCHID"), 147, 112, 219}, + {T("MEDIUM SEA GREEN"), 66, 111, 66}, + {T("MEDIUM SLATE BLUE"), 127, 0, 255}, + {T("MEDIUM SPRING GREEN"), 127, 255, 0}, + {T("MEDIUM TURQUOISE"), 112, 219, 219}, + {T("MEDIUM VIOLET RED"), 219, 112, 147}, + {T("MIDNIGHT BLUE"), 47, 47, 79}, + {T("NAVY"), 35, 35, 142}, + {T("ORANGE"), 204, 50, 50}, + {T("ORANGE RED"), 255, 0, 127}, + {T("ORCHID"), 219, 112, 219}, + {T("PALE GREEN"), 143, 188, 143}, + {T("PINK"), 188, 143, 234}, + {T("PLUM"), 234, 173, 234}, + {T("PURPLE"), 176, 0, 255}, + {T("RED"), 255, 0, 0}, + {T("SALMON"), 111, 66, 66}, + {T("SEA GREEN"), 35, 142, 107}, + {T("SIENNA"), 142, 107, 35}, + {T("SKY BLUE"), 50, 153, 204}, + {T("SLATE BLUE"), 0, 127, 255}, + {T("SPRING GREEN"), 0, 255, 127}, + {T("STEEL BLUE"), 35, 107, 142}, + {T("TAN"), 219, 147, 112}, + {T("THISTLE"), 216, 191, 216}, + {T("TURQUOISE"), 173, 234, 234}, + {T("VIOLET("), 79, 47, 79}, + {T("VIOLET RED"), 204, 50, 153}, + {T("WHEAT("), 216, 216, 191}, + {T("WHITE"), 255, 255, 255}, + {T("YELLOW"), 255, 255, 0}, + {T("YELLOW GREEN"), 153, 204, 50}, // #endif #if defined(__WXGTK__) || defined(__X__) - {_T("MEDIUM GOLDENROD"), 234, 234, 173}, - {_T("MEDIUM FOREST GREEN"), 107, 142, 35}, - {_T("LIGHT MAGENTA"), 255, 0, 255}, - {_T("MEDIUM GREY"), 100, 100, 100}, + {T("MEDIUM GOLDENROD"), 234, 234, 173}, + {T("MEDIUM FOREST GREEN"), 107, 142, 35}, + {T("LIGHT MAGENTA"), 255, 0, 255}, + {T("MEDIUM GREY"), 100, 100, 100}, #endif {0,0,0,0} @@ -604,7 +604,7 @@ wxFont *wxFontList:: #else each_font->GetFamily() == FamilyOrFontId && #endif - ((each_font->GetFaceName() == _T("")) || each_font->GetFaceName() == Face)) + ((each_font->GetFaceName() == T("")) || each_font->GetFaceName() == Face)) //#endif return each_font; } diff --git a/src/common/http.cpp b/src/common/http.cpp index 00b711b2ad..869d99b1f3 100644 --- a/src/common/http.cpp +++ b/src/common/http.cpp @@ -34,7 +34,7 @@ #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxHTTP, wxProtocol) -IMPLEMENT_PROTOCOL(wxHTTP, _T("http"), _T("80"), TRUE) +IMPLEMENT_PROTOCOL(wxHTTP, T("http"), T("80"), TRUE) #endif #define HTTP_BSIZE 2048 @@ -65,7 +65,7 @@ wxHTTP::~wxHTTP() wxString wxHTTP::GetContentType() { - return GetHeader(_T("Content-Type")); + return GetHeader(T("Content-Type")); } void wxHTTP::SetProxyMode(bool on) @@ -113,7 +113,7 @@ void wxHTTP::SendHeaders() wxString *str = (wxString *)head->Data(); wxString buf; - buf.Printf(_T("%s: %s\n\r"), head->GetKeyString(), str->GetData()); + buf.Printf(T("%s: %s\n\r"), head->GetKeyString(), str->GetData()); const wxWX2MBbuf cbuf = buf.mb_str(); Write(cbuf, strlen(cbuf)); @@ -171,7 +171,7 @@ bool wxHTTP::Connect(const wxString& host) return FALSE; } - if (!addr->Service(_T("http"))) + if (!addr->Service(T("http"))) addr->Service(80); return TRUE; @@ -196,12 +196,12 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) wxString tmp_str = path; // If there is no User-Agent defined, define it. - if (GetHeader(_T("User-Agent")).IsNull()) - SetHeader(_T("User-Agent"), _T("wxWindows 2.x")); + if (GetHeader(T("User-Agent")).IsNull()) + SetHeader(T("User-Agent"), T("wxWindows 2.x")); switch (req) { case wxHTTP_GET: - tmp_buf = _T("GET"); + tmp_buf = T("GET("); break; default: return FALSE; @@ -211,9 +211,9 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) SetFlags(NONE); Notify(FALSE); - wxSprintf(buf, _T("%s %s HTTP/1.0\n\r"), tmp_buf, tmp_str.GetData()); + wxSprintf(buf, T("%s %s HTTP/1.0\n\r"), tmp_buf, tmp_str.GetData()); const wxWX2MBbuf pathbuf = wxConvLibc.cWX2MB(buf); - Write(pathbuf, strlen(MBSTRINGCAST pathbuf)); + Write(pathbuf, strlen(wxMBSTRINGCAST pathbuf)); SendHeaders(); Write("\n\r", 2); @@ -223,16 +223,16 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) return FALSE; } - if (!tmp_str.Contains(_T("HTTP/"))) { + if (!tmp_str.Contains(T("HTTP/"))) { // TODO: support HTTP v0.9 which can have no header. // FIXME: tmp_str is not put back in the in-queue of the socket. - SetHeader(_T("Content-Length"), _T("-1")); - SetHeader(_T("Content-Type"), _T("none/none")); + SetHeader(T("Content-Length"), T("-1")); + SetHeader(T("Content-Type"), T("none/none")); RestoreState(); return TRUE; } - wxStringTokenizer token(tmp_str,_T(' ')); + wxStringTokenizer token(tmp_str,T(' ')); wxString tmp_str2; bool ret_value; @@ -240,13 +240,13 @@ bool wxHTTP::BuildRequest(const wxString& path, wxHTTP_Req req) tmp_str2 = token.NextToken(); switch (tmp_str2[(unsigned int) 0]) { - case _T('1'): + case T('1'): /* INFORMATION / SUCCESS */ break; - case _T('2'): + case T('2'): /* SUCCESS */ break; - case _T('3'): + case T('3'): /* REDIRECTION */ break; default: @@ -312,8 +312,8 @@ wxInputStream *wxHTTP::GetInputStream(const wxString& path) if (!BuildRequest(path, wxHTTP_GET)) return NULL; - if (!GetHeader(_T("Content-Length")).IsEmpty()) - inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(_T("Content-Length"))); + if (!GetHeader(T("Content-Length")).IsEmpty()) + inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(T("Content-Length"))); else inp_stream->m_httpsize = (size_t)-1; diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index 005e007dfa..468b1f5be5 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -97,12 +97,12 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE int height = (int)wxINT32_SWAP_ON_BE( dbuf[1] ); if (width > 32767) { - wxLogError( _T("Image width > 32767 pixels for file.") ); + wxLogError( T("Image width > 32767 pixels for file.") ); return FALSE; } if (height > 32767) { - wxLogError( _T("Image height > 32767 pixels for file.") ); + wxLogError( T("Image height > 32767 pixels for file.") ); return FALSE; } @@ -115,7 +115,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE int bpp = (int)wxUINT16_SWAP_ON_BE( aWord ); if (bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32) { - wxLogError( _T("unknown bitdepth in file.") ); + wxLogError( T("unknown bitdepth in file.") ); return FALSE; } @@ -123,7 +123,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE int comp = (int)wxINT32_SWAP_ON_BE( dbuf[0] ); if (comp != BI_RGB && comp != BI_RLE4 && comp != BI_RLE8 && comp != BI_BITFIELDS) { - wxLogError( _T("unknown encoding in Windows BMP file.") ); + wxLogError( T("unknown encoding in Windows BMP file.") ); return FALSE; } @@ -136,7 +136,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE ((comp == BI_RLE8) && (bpp != 8)) || ((comp == BI_BITFIELDS) && (bpp != 16 && bpp != 32))) { - wxLogError( _T("encoding of BMP doesn't match bitdepth.") ); + wxLogError( T("encoding of BMP doesn't match bitdepth.") ); return FALSE; } if (bpp < 16) @@ -144,7 +144,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE cmap = (struct _cmap *)malloc(sizeof(struct _cmap) * ncolors); if (!cmap) { - wxLogError( _T("Cannot allocate RAM for color map in BMP file.") ); + wxLogError( T("Cannot allocate RAM for color map in BMP file.") ); return FALSE; } } @@ -155,7 +155,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE unsigned char *ptr = image->GetData(); if (!ptr) { - wxLogError( _T("Cannot allocate RAM for RGB data in file.") ); + wxLogError( T("Cannot allocate RAM for RGB data in file.") ); if (cmap) free(cmap); return FALSE; @@ -263,7 +263,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE { if (comp == BI_RLE4) { - wxLogError( _T("Can't deal with 4bit encoded yet.") ); + wxLogError( T("Can't deal with 4bit encoded yet.") ); image->Destroy(); free(cmap); return FALSE; diff --git a/src/common/image.cpp b/src/common/image.cpp index e7d5fc7eae..be502d1e80 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -154,15 +154,15 @@ wxImage wxImage::Scale( int width, int height ) const { wxImage image; - wxCHECK_MSG( Ok(), image, _T("invalid image") ); + wxCHECK_MSG( Ok(), image, T("invalid image") ); - wxCHECK_MSG( (width > 0) && (height > 0), image, _T("invalid image size") ); + wxCHECK_MSG( (width > 0) && (height > 0), image, T("invalid image size") ); image.Create( width, height ); char unsigned *data = image.GetData(); - wxCHECK_MSG( data, image, _T("unable to create image") ); + wxCHECK_MSG( data, image, T("unable to create image") ); if (M_IMGDATA->m_hasMask) image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue ); @@ -193,10 +193,10 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const { wxImage image; - wxCHECK_MSG( Ok(), image, _T("invalid image") ); + wxCHECK_MSG( Ok(), image, T("invalid image") ); wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && (rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight()) - , image, _T("invalid subimage size") ); + , image, T("invalid subimage size") ); int subwidth=rect.GetWidth(); const int subheight=rect.GetHeight(); @@ -205,7 +205,7 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const char unsigned *subdata = image.GetData(), *data=GetData(); - wxCHECK_MSG( subdata, image, _T("unable to create image") ); + wxCHECK_MSG( subdata, image, T("unable to create image") ); if (M_IMGDATA->m_hasMask) image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue ); @@ -228,12 +228,12 @@ wxImage wxImage::GetSubImage( const wxRect &rect ) const void wxImage::SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b ) { - wxCHECK_RET( Ok(), _T("invalid image") ); + wxCHECK_RET( Ok(), T("invalid image") ); int w = M_IMGDATA->m_width; int h = M_IMGDATA->m_height; - wxCHECK_RET( (x>=0) && (y>=0) && (x=0) && (y>=0) && (xm_width; int h = M_IMGDATA->m_height; - wxCHECK_MSG( (x>=0) && (y>=0) && (x=0) && (y>=0) && (xm_width; int h = M_IMGDATA->m_height; - wxCHECK_MSG( (x>=0) && (y>=0) && (x=0) && (y>=0) && (xm_width; int h = M_IMGDATA->m_height; - wxCHECK_MSG( (x>=0) && (y>=0) && (x=0) && (y>=0) && (xm_data; } void wxImage::SetData( char unsigned *data ) { - wxCHECK_RET( Ok(), _T("invalid image") ); + wxCHECK_RET( Ok(), T("invalid image") ); wxImageRefData *newRefData = new wxImageRefData(); @@ -318,7 +318,7 @@ void wxImage::SetData( char unsigned *data ) void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b ) { - wxCHECK_RET( Ok(), _T("invalid image") ); + wxCHECK_RET( Ok(), T("invalid image") ); M_IMGDATA->m_maskRed = r; M_IMGDATA->m_maskGreen = g; @@ -328,49 +328,49 @@ void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b ) unsigned char wxImage::GetMaskRed() const { - wxCHECK_MSG( Ok(), 0, _T("invalid image") ); + wxCHECK_MSG( Ok(), 0, T("invalid image") ); return M_IMGDATA->m_maskRed; } unsigned char wxImage::GetMaskGreen() const { - wxCHECK_MSG( Ok(), 0, _T("invalid image") ); + wxCHECK_MSG( Ok(), 0, T("invalid image") ); return M_IMGDATA->m_maskGreen; } unsigned char wxImage::GetMaskBlue() const { - wxCHECK_MSG( Ok(), 0, _T("invalid image") ); + wxCHECK_MSG( Ok(), 0, T("invalid image") ); return M_IMGDATA->m_maskBlue; } void wxImage::SetMask( bool mask ) { - wxCHECK_RET( Ok(), _T("invalid image") ); + wxCHECK_RET( Ok(), T("invalid image") ); M_IMGDATA->m_hasMask = mask; } bool wxImage::HasMask() const { - wxCHECK_MSG( Ok(), FALSE, _T("invalid image") ); + wxCHECK_MSG( Ok(), FALSE, T("invalid image") ); return M_IMGDATA->m_hasMask; } int wxImage::GetWidth() const { - wxCHECK_MSG( Ok(), 0, _T("invalid image") ); + wxCHECK_MSG( Ok(), 0, T("invalid image") ); return M_IMGDATA->m_width; } int wxImage::GetHeight() const { - wxCHECK_MSG( Ok(), 0, _T("invalid image") ); + wxCHECK_MSG( Ok(), 0, T("invalid image") ); return M_IMGDATA->m_height; } @@ -385,7 +385,7 @@ bool wxImage::LoadFile( const wxString& filename, long type ) } else { - wxLogError( _T("Can't load image from file '%s': file does not exist."), filename.c_str() ); + wxLogError( T("Can't load image from file '%s': file does not exist."), filename.c_str() ); return FALSE; } @@ -404,7 +404,7 @@ bool wxImage::LoadFile( const wxString& filename, const wxString& mimetype ) } else { - wxLogError( _T("Can't load image from file '%s': file does not exist."), filename.c_str() ); + wxLogError( T("Can't load image from file '%s': file does not exist."), filename.c_str() ); return FALSE; } @@ -459,7 +459,7 @@ bool wxImage::LoadFile( wxInputStream& stream, long type ) } - wxLogWarning( _T("No handler found for this image.") ); + wxLogWarning( T("No handler found for this image.") ); return FALSE; } @@ -467,7 +467,7 @@ bool wxImage::LoadFile( wxInputStream& stream, long type ) if (handler == NULL) { - wxLogWarning( _T("No image handler for type %d defined."), type ); + wxLogWarning( T("No image handler for type %d defined."), type ); return FALSE; } @@ -485,7 +485,7 @@ bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype ) if (handler == NULL) { - wxLogWarning( _T("No image handler for type %s defined."), mimetype.GetData() ); + wxLogWarning( T("No image handler for type %s defined."), mimetype.GetData() ); return FALSE; } @@ -495,13 +495,13 @@ bool wxImage::LoadFile( wxInputStream& stream, const wxString& mimetype ) bool wxImage::SaveFile( wxOutputStream& stream, int type ) { - wxCHECK_MSG( Ok(), FALSE, _T("invalid image") ); + wxCHECK_MSG( Ok(), FALSE, T("invalid image") ); wxImageHandler *handler = FindHandler(type); if (handler == NULL) { - wxLogWarning( _T("No image handler for type %d defined."), type ); + wxLogWarning( T("No image handler for type %d defined."), type ); return FALSE; } @@ -511,13 +511,13 @@ bool wxImage::SaveFile( wxOutputStream& stream, int type ) bool wxImage::SaveFile( wxOutputStream& stream, const wxString& mimetype ) { - wxCHECK_MSG( Ok(), FALSE, _T("invalid image") ); + wxCHECK_MSG( Ok(), FALSE, T("invalid image") ); wxImageHandler *handler = FindHandlerMime(mimetype); if (handler == NULL) { - wxLogWarning( _T("No image handler for type %s defined."), mimetype.GetData() ); + wxLogWarning( T("No image handler for type %s defined."), mimetype.GetData() ); return FALSE; } @@ -657,7 +657,7 @@ bool wxImageHandler::CanRead( const wxString& name ) } else { - wxLogError( _T("Can't check image format of file '%s': file does not exist."), name.c_str() ); + wxLogError( T("Can't check image format of file '%s': file does not exist."), name.c_str() ); return FALSE; } @@ -717,7 +717,7 @@ wxBitmap wxImage::ConvertToBitmap() const // set bitmap parameters wxBitmap bitmap; - wxCHECK_MSG( Ok(), bitmap, _T("invalid image") ); + wxCHECK_MSG( Ok(), bitmap, T("invalid image") ); bitmap.SetWidth( width ); bitmap.SetHeight( bmpHeight ); bitmap.SetDepth( wxDisplayDepth() ); @@ -725,7 +725,7 @@ wxBitmap wxImage::ConvertToBitmap() const // create a DIB header int headersize = sizeof(BITMAPINFOHEADER); LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize ); - wxCHECK_MSG( lpDIBh, bitmap, _T("could not allocate memory for DIB header") ); + wxCHECK_MSG( lpDIBh, bitmap, T("could not allocate memory for DIB header") ); // Fill in the DIB header lpDIBh->bmiHeader.biSize = headersize; lpDIBh->bmiHeader.biWidth = (DWORD)width; @@ -746,7 +746,7 @@ wxBitmap wxImage::ConvertToBitmap() const lpBits = (unsigned char *)malloc( lpDIBh->bmiHeader.biSizeImage ); if( !lpBits ) { - wxFAIL_MSG( _T("could not allocate memory for DIB") ); + wxFAIL_MSG( T("could not allocate memory for DIB") ); free( lpDIBh ); return bitmap; } @@ -889,7 +889,7 @@ wxImage::wxImage( const wxBitmap &bitmap ) // check the bitmap if( !bitmap.Ok() ) { - wxFAIL_MSG( _T("invalid bitmap") ); + wxFAIL_MSG( T("invalid bitmap") ); return; } @@ -900,7 +900,7 @@ wxImage::wxImage( const wxBitmap &bitmap ) unsigned char *data = GetData(); if( !data ) { - wxFAIL_MSG( _T("could not allocate data for image") ); + wxFAIL_MSG( T("could not allocate data for image") ); return; } @@ -920,7 +920,7 @@ wxImage::wxImage( const wxBitmap &bitmap ) LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize ); if( !lpDIBh ) { - wxFAIL_MSG( _T("could not allocate data for DIB header") ); + wxFAIL_MSG( T("could not allocate data for DIB header") ); free( data ); return; } @@ -942,7 +942,7 @@ wxImage::wxImage( const wxBitmap &bitmap ) lpBits = (unsigned char *) malloc( lpDIBh->bmiHeader.biSizeImage ); if( !lpBits ) { - wxFAIL_MSG( _T("could not allocate data for DIB") ); + wxFAIL_MSG( T("could not allocate data for DIB") ); free( data ); free( lpDIBh ); return; @@ -1033,7 +1033,7 @@ wxBitmap wxImage::ConvertToBitmap() const { wxBitmap bitmap; - wxCHECK_MSG( Ok(), bitmap, _T("invalid image") ); + wxCHECK_MSG( Ok(), bitmap, T("invalid image") ); int width = GetWidth(); int height = GetHeight(); @@ -1241,13 +1241,13 @@ wxBitmap wxImage::ConvertToBitmap() const wxImage::wxImage( const wxBitmap &bitmap ) { - wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") ); GdkImage *gdk_image = gdk_image_get( bitmap.GetPixmap(), 0, 0, bitmap.GetWidth(), bitmap.GetHeight() ); - wxCHECK_RET( gdk_image, _T("couldn't create image") ); + wxCHECK_RET( gdk_image, T("couldn't create image") ); Create( bitmap.GetWidth(), bitmap.GetHeight() ); char unsigned *data = GetData(); @@ -1255,7 +1255,7 @@ wxImage::wxImage( const wxBitmap &bitmap ) if (!data) { gdk_image_destroy( gdk_image ); - wxFAIL_MSG( _T("couldn't create image") ); + wxFAIL_MSG( T("couldn't create image") ); return; } @@ -1340,7 +1340,7 @@ wxBitmap wxImage::ConvertToBitmap() const { wxBitmap bitmap; - wxCHECK_MSG( Ok(), bitmap, _T("invalid image") ); + wxCHECK_MSG( Ok(), bitmap, T("invalid image") ); int width = GetWidth(); int height = GetHeight(); @@ -1389,7 +1389,7 @@ wxBitmap wxImage::ConvertToBitmap() const vi = XGetVisualInfo( dpy, VisualIDMask|VisualDepthMask, &vinfo_template, &nitem ); - wxCHECK_MSG( vi, wxNullBitmap, _T("no visual") ); + wxCHECK_MSG( vi, wxNullBitmap, T("no visual") ); XFree( vi ); @@ -1540,7 +1540,7 @@ wxBitmap wxImage::ConvertToBitmap() const wxImage::wxImage( const wxBitmap &bitmap ) { - wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") ); Display *dpy = (Display*) wxGetDisplay(); Visual* vis = DefaultVisual( dpy, DefaultScreen( dpy ) ); @@ -1552,7 +1552,7 @@ wxImage::wxImage( const wxBitmap &bitmap ) bitmap.GetWidth(), bitmap.GetHeight(), AllPlanes, ZPixmap ); - wxCHECK_RET( ximage, _T("couldn't create image") ); + wxCHECK_RET( ximage, T("couldn't create image") ); Create( bitmap.GetWidth(), bitmap.GetHeight() ); char unsigned *data = GetData(); @@ -1560,7 +1560,7 @@ wxImage::wxImage( const wxBitmap &bitmap ) if (!data) { XDestroyImage( ximage ); - wxFAIL_MSG( _T("couldn't create image") ); + wxFAIL_MSG( T("couldn't create image") ); return; } @@ -1588,7 +1588,7 @@ wxImage::wxImage( const wxBitmap &bitmap ) vi = XGetVisualInfo( dpy, VisualIDMask|VisualDepthMask, &vinfo_template, &nitem ); - wxCHECK_RET( vi, _T("no visual") ); + wxCHECK_RET( vi, T("no visual") ); if ((bpp == 16) && (vi->red_mask != 0xf800)) bpp = 15; diff --git a/src/common/imaggif.cpp b/src/common/imaggif.cpp index e9a0fc880a..32f0539bc2 100644 --- a/src/common/imaggif.cpp +++ b/src/common/imaggif.cpp @@ -54,9 +54,9 @@ bool wxGIFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose { switch (error) { - case E_FORMATO: wxLogError(_T("wxGIFHandler: error in image format")); break; - case E_MEMORIA: wxLogError(_T("wxGIFHandler: couldn't allocate memory")); break; - default: wxLogError(_T("wxGIFHandler: unknown error !!!")); + case E_FORMATO: wxLogError(T("wxGIFHandler: error in image format")); break; + case E_MEMORIA: wxLogError(T("wxGIFHandler: couldn't allocate memory")); break; + default: wxLogError(T("wxGIFHandler: unknown error !!!")); } } delete decod; @@ -74,7 +74,7 @@ bool wxGIFHandler::SaveFile( wxImage * WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool verbose ) { if (verbose) - wxLogDebug(_T("wxGIFHandler is read-only!!")); + wxLogDebug(T("wxGIFHandler is read-only!!")); return FALSE; } diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp index 20dd5ff749..c2793f6d5f 100644 --- a/src/common/imagpcx.cpp +++ b/src/common/imagpcx.cpp @@ -229,7 +229,7 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose if (!CanRead(stream)) { if (verbose) - wxLogError(_T("wxPCXHandler: this is not a PCX file")); + wxLogError(T("wxPCXHandler: this is not a PCX file")); return FALSE; } @@ -242,10 +242,10 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose { switch (error) { - case E_FORMATO: wxLogError(_T("wxPCXHandler: image format unsupported")); break; - case E_MEMORIA: wxLogError(_T("wxPCXHandler: couldn't allocate memory")); break; - case E_VERSION: wxLogError(_T("wxPCXHandler: version number too low")); break; - default: wxLogError(_T("wxPCXHandler: unknown error !!!")); + case E_FORMATO: wxLogError(T("wxPCXHandler: image format unsupported")); break; + case E_MEMORIA: wxLogError(T("wxPCXHandler: couldn't allocate memory")); break; + case E_VERSION: wxLogError(T("wxPCXHandler: version number too low")); break; + default: wxLogError(T("wxPCXHandler: unknown error !!!")); } } image->Destroy(); @@ -258,7 +258,7 @@ bool wxPCXHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbose bool wxPCXHandler::SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool verbose ) { if (verbose) - wxLogError(_T("wxPCXHandler::SaveFile still not implemented")); + wxLogError(T("wxPCXHandler::SaveFile still not implemented")); return FALSE; } diff --git a/src/common/imagpnm.cpp b/src/common/imagpnm.cpp index 28bf08eba3..6a14eae9a6 100644 --- a/src/common/imagpnm.cpp +++ b/src/common/imagpnm.cpp @@ -44,7 +44,7 @@ void Skip_Comment(wxInputStream &stream) wxString line; wxTextInputStream text_stream(stream); - if (stream.Peek()==_T('#')) + if (stream.Peek()==T('#')) { text_stream >> line; Skip_Comment(stream); @@ -68,19 +68,19 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE wxTextInputStream text_stream(buf_stream); Skip_Comment(buf_stream); - if (buf_stream.GetC()==_T('P')) c=buf_stream.GetC(); + if (buf_stream.GetC()==T('P')) c=buf_stream.GetC(); switch (c) { - case _T('2'): - wxLogError(_T("Loading Grey Ascii PNM image is not yet implemented.")); + case T('2'): + wxLogError(T("Loading Grey Ascii PNM image is not yet implemented.")); return FALSE; - case _T('5'): - wxLogError(_T("Loading Grey Raw PNM image is not yet implemented.")); + case T('5'): + wxLogError(T("Loading Grey Raw PNM image is not yet implemented.")); return FALSE; - case _T('3'): case _T('6'): break; + case T('3'): case T('6'): break; default : - wxLogError(_T("Loading PNM image : file not recognized.")); + wxLogError(T("Loading PNM image : file not recognized.")); return FALSE; } @@ -95,7 +95,7 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE unsigned char *ptr = image->GetData(); if (!ptr) { - wxLogError( _T("Cannot allocate RAM for RGB data in PNM file.") ); + wxLogError( T("Cannot allocate RAM for RGB data in PNM file.") ); return FALSE; } @@ -111,7 +111,7 @@ bool wxPNMHandler::LoadFile( wxImage *image, wxInputStream& stream, bool WXUNUSE if (buf_stream.LastError()!=wxSTREAM_NOERROR) { - wxLogError(_T("Loading PNM image : file seems truncated.")); + wxLogError(T("Loading PNM image : file seems truncated.")); return FALSE; } } @@ -143,10 +143,10 @@ bool wxPNMHandler::CanRead( wxInputStream& stream ) Skip_Comment(stream); - if (stream.GetC()==_T('P')) + if (stream.GetC()==T('P')) switch (stream.GetC()) { - case _T('3'): case _T('6'): + case T('3'): case T('6'): stream.SeekI(pos); return TRUE; } diff --git a/src/common/init.cpp b/src/common/init.cpp new file mode 100644 index 0000000000..1af0b671f5 --- /dev/null +++ b/src/common/init.cpp @@ -0,0 +1,80 @@ +///////////////////////////////////////////////////////////////////////////// +// Name: common/init.cpp +// Purpose: initialisation for the library +// Author: Vadim Zeitlin +// Modified by: +// Created: 04.10.99 +// RCS-ID: $Id$ +// Copyright: (c) Vadim Zeitlin +// Licence: wxWindows licence +///////////////////////////////////////////////////////////////////////////// + +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + +#ifdef __GNUG__ + #pragma implementation "appbase.h" +#endif + +#include "wx/app.h" +#include "wx/debug.h" + +// ---------------------------------------------------------------------------- +// global vars +// ---------------------------------------------------------------------------- + +wxApp * WXDLLEXPORT wxTheApp = NULL; + +wxAppInitializerFunction + wxAppBase::m_appInitFn = (wxAppInitializerFunction)NULL; + +// ---------------------------------------------------------------------------- +// private classes +// ---------------------------------------------------------------------------- + +class /* no WXDLLEXPORT */ wxConsoleApp : public wxApp +{ +public: + virtual int OnRun() { wxFAIL_MSG(T("unreachable")); return 0; } +}; + +// ---------------------------------------------------------------------------- +// private vars +// ---------------------------------------------------------------------------- + +static size_t gs_nInitCount = 0; + +// ============================================================================ +// implementation +// ============================================================================ + +bool WXDLLEXPORT wxInitialize() +{ + if ( gs_nInitCount++ ) + { + // already initialized + return TRUE; + } + + wxASSERT_MSG( !wxTheApp, + T("either call wxInitialize or create app, not both!") ); + + wxTheApp = new wxConsoleApp; + + return wxTheApp != NULL; +} + +void WXDLLEXPORT wxUninitialize() +{ + if ( !--gs_nInitCount ) + { + // delete the application object + delete wxTheApp; + wxTheApp = (wxApp *)NULL; + } +} diff --git a/src/common/intl.cpp b/src/common/intl.cpp index 245ebe36bb..76b2e672f4 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -267,7 +267,7 @@ static wxString GetAllMsgCatalogSubdirs(const wxChar *prefix, // search first in prefix/fr/LC_MESSAGES, then in prefix/fr and finally in // prefix (assuming the language is 'fr') searchPath << prefix << wxFILE_SEP_PATH << lang << wxFILE_SEP_PATH - << _T("LC_MESSAGES") << wxPATH_SEP + << T("LC_MESSAGES") << wxPATH_SEP << prefix << wxFILE_SEP_PATH << lang << wxPATH_SEP << prefix << wxPATH_SEP; @@ -289,13 +289,13 @@ static wxString GetFullSearchPath(const wxChar *lang) // then take the current directory // FIXME it should be the directory of the executable - searchPath << GetAllMsgCatalogSubdirs(_T("."), lang) << wxPATH_SEP; + searchPath << GetAllMsgCatalogSubdirs(T("."), lang) << wxPATH_SEP; // and finally add some standard ones searchPath - << GetAllMsgCatalogSubdirs(_T("/usr/share/locale"), lang) << wxPATH_SEP - << GetAllMsgCatalogSubdirs(_T("/usr/lib/locale"), lang) << wxPATH_SEP - << GetAllMsgCatalogSubdirs(_T("/usr/local/share/locale"), lang); + << GetAllMsgCatalogSubdirs(T("/usr/share/locale"), lang) << wxPATH_SEP + << GetAllMsgCatalogSubdirs(T("/usr/lib/locale"), lang) << wxPATH_SEP + << GetAllMsgCatalogSubdirs(T("/usr/local/share/locale"), lang); return searchPath; } @@ -320,7 +320,7 @@ bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName0) #endif // 0 wxString searchPath = GetFullSearchPath(szDirPrefix); - const wxChar *sublocale = wxStrchr(szDirPrefix, _T('_')); + const wxChar *sublocale = wxStrchr(szDirPrefix, T('_')); if ( sublocale ) { // also add just base locale name: for things like "fr_BE" (belgium @@ -340,9 +340,7 @@ bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName0) // (we're using an object because we have several return paths) NoTransErr noTransErr; -// Then why do you translate at all? Just use _T() and not _(). RR. - - wxLogVerbose(_("looking for catalog '%s' in path '%s'."), + wxLogVerbose(T("looking for catalog '%s' in path '%s'."), szName.c_str(), searchPath.c_str()); wxString strFullName; @@ -498,7 +496,7 @@ bool wxLocale::Init(const wxChar *szName, m_pMsgCat = NULL; bool bOk = TRUE; if ( bLoadDefault ) - bOk = AddCatalog(_T("wxstd")); + bOk = AddCatalog(T("wxstd")); return bOk; } @@ -530,13 +528,17 @@ wxLocale::~wxLocale() // get the translation of given string in current locale const wxMB2WXbuf wxLocale::GetString(const wxChar *szOrigString, - const wxChar *szDomain) const + const wxChar *szDomain) const { if ( wxIsEmpty(szOrigString) ) return szDomain; const char *pszTrans = NULL; +#if wxUSE_UNICODE const wxWX2MBbuf szOrgString = wxConvCurrent->cWX2MB(szOrigString); +#else // ANSI + #define szOrgString szOrigString +#endif // Unicode/ANSI wxMsgCatalog *pMsgCat; if ( szDomain != NULL ) { @@ -583,7 +585,16 @@ const wxMB2WXbuf wxLocale::GetString(const wxChar *szOrigString, return (wxMB2WXbuf)(szOrigString); } else - return (wxMB2WXbuf)(wxConvCurrent->cMB2WX(pszTrans)); + { + // FIXME it was + // return (wxMB2WXbuf)(wxConvCurrent->cMB2WX(pszTrans)); + // before, but we don't want to use wxConvCurrent explicitly to + // avoid linking unnecessary code in ANSI programs without MB + // support + return (wxMB2WXbuf)(pszTrans); + } + + #undef szOrgString } // find catalog by name in a linked list, return NULL if !found diff --git a/src/common/list.cpp b/src/common/list.cpp index 48a91d0d9e..06759b42a5 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -52,7 +52,7 @@ bool wxListKey::operator==(wxListKeyValue value) const switch ( m_keyType ) { default: - wxFAIL_MSG(_T("bad key type.")); + wxFAIL_MSG(T("bad key type.")); // let compiler optimize the line above away in release build // by not putting return here... @@ -92,7 +92,7 @@ wxNodeBase::wxNodeBase(wxListBase *list, break; default: - wxFAIL_MSG(_T("invalid key type")); + wxFAIL_MSG(T("invalid key type")); } if ( previous ) @@ -120,7 +120,7 @@ wxNodeBase::~wxNodeBase() int wxNodeBase::IndexOf() const { - wxCHECK_MSG( m_list, wxNOT_FOUND, _T("node doesn't belong to a list in IndexOf")); + wxCHECK_MSG( m_list, wxNOT_FOUND, T("node doesn't belong to a list in IndexOf")); // It would be more efficient to implement IndexOf() completely inside // wxListBase (only traverse the list once), but this is probably a more @@ -163,7 +163,7 @@ wxListBase::wxListBase(size_t count, void *elements[]) void wxListBase::DoCopy(const wxListBase& list) { wxASSERT_MSG( !list.m_destroy, - _T("copying list which owns it's elements is a bad idea") ); + T("copying list which owns it's elements is a bad idea") ); m_count = list.m_count; m_destroy = list.m_destroy; @@ -210,7 +210,7 @@ wxNodeBase *wxListBase::Append(void *object) { // all objects in a keyed list should have a key wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL, - _T("need a key for the object to append") ); + T("need a key for the object to append") ); wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object); @@ -222,7 +222,7 @@ wxNodeBase *wxListBase::Append(long key, void *object) wxCHECK_MSG( (m_keyType == wxKEY_INTEGER) || (m_keyType == wxKEY_NONE && m_count == 0), (wxNodeBase *)NULL, - _T("can't append object with numeric key to this list") ); + T("can't append object with numeric key to this list") ); wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key); return AppendCommon(node); @@ -233,7 +233,7 @@ wxNodeBase *wxListBase::Append (const wxChar *key, void *object) wxCHECK_MSG( (m_keyType == wxKEY_STRING) || (m_keyType == wxKEY_NONE && m_count == 0), (wxNodeBase *)NULL, - _T("can't append object with string key to this list") ); + T("can't append object with string key to this list") ); wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key); return AppendCommon(node); @@ -243,10 +243,10 @@ wxNodeBase *wxListBase::Insert(wxNodeBase *position, void *object) { // all objects in a keyed list should have a key wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL, - _T("need a key for the object to insert") ); + T("need a key for the object to insert") ); wxCHECK_MSG( !position || position->m_list == this, (wxNodeBase *)NULL, - _T("can't insert before a node from another list") ); + T("can't insert before a node from another list") ); // previous and next node for the node being inserted wxNodeBase *prev, *next; @@ -288,7 +288,7 @@ wxNodeBase *wxListBase::Item(size_t n) const } } - wxFAIL_MSG( _T("invalid index in wxListBase::Item") ); + wxFAIL_MSG( T("invalid index in wxListBase::Item") ); return (wxNodeBase *)NULL; } @@ -296,7 +296,7 @@ wxNodeBase *wxListBase::Item(size_t n) const wxNodeBase *wxListBase::Find(const wxListKey& key) const { wxASSERT_MSG( m_keyType == key.GetKeyType(), - _T("this list is not keyed on the type of this key") ); + T("this list is not keyed on the type of this key") ); for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() ) { @@ -349,9 +349,9 @@ void wxListBase::DoDeleteNode(wxNodeBase *node) wxNodeBase *wxListBase::DetachNode(wxNodeBase *node) { - wxCHECK_MSG( node, NULL, _T("detaching NULL wxNodeBase") ); + wxCHECK_MSG( node, NULL, T("detaching NULL wxNodeBase") ); wxCHECK_MSG( node->m_list == this, NULL, - _T("detaching node which is not from this list") ); + T("detaching node which is not from this list") ); // update the list wxNodeBase **prevNext = node->GetPrevious() ? &node->GetPrevious()->m_next diff --git a/src/common/log.cpp b/src/common/log.cpp index f811d2b15d..a9a0c0c025 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -30,17 +30,17 @@ // wxWindows #ifndef WX_PRECOMP - #include "wx/window.h" - #ifdef __WXMSW__ - #include "wx/msw/private.h" - #endif - #include "wx/event.h" - #include "wx/app.h" - #include "wx/string.h" - #include "wx/intl.h" - #ifndef wxUSE_NOGUI - #include "wx/msgdlg.h" - #endif + #include "wx/string.h" + #include "wx/intl.h" + #include "wx/app.h" + + #if wxUSE_GUI + #include "wx/window.h" + #ifdef __WXMSW__ + #include "wx/msw/private.h" + #endif + #include "wx/msgdlg.h" + #endif #endif //WX_PRECOMP #include "wx/file.h" @@ -249,15 +249,11 @@ wxLog *wxLog::GetActiveTarget() if ( !s_bInGetActiveTarget ) { s_bInGetActiveTarget = TRUE; -#ifdef wxUSE_NOGUI - ms_pLogger = new wxLogStderr; -#else // GUI // ask the application to create a log target for us if ( wxTheApp != NULL ) ms_pLogger = wxTheApp->CreateLogTarget(); else ms_pLogger = new wxLogStderr; -#endif // !GUI/GUI s_bInGetActiveTarget = FALSE; @@ -299,7 +295,7 @@ void wxLog::TimeStamp(wxString *str) wxStrftime(buf, WXSIZEOF(buf), ms_timestamp, localtime(&timeNow)); str->Empty(); - *str << buf << _T(": "); + *str << buf << T(": "); } } @@ -343,7 +339,7 @@ void wxLog::DoLog(wxLogLevel level, const wxChar *szString, time_t t) void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t WXUNUSED(t)) { - wxFAIL_MSG(_T("DoLogString must be overriden if it's called.")); + wxFAIL_MSG(T("DoLogString must be overriden if it's called.")); } void wxLog::Flush() @@ -367,7 +363,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) { wxString str; TimeStamp(&str); - str << szString << _T('\n'); + str << szString << T('\n'); fputs(str.mb_str(), m_fp); fflush(m_fp); @@ -375,7 +371,7 @@ void wxLogStderr::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) // under Windows, programs usually don't have stderr at all, so make show the // messages also under debugger #ifdef __WXMSW__ - OutputDebugString(str + _T('\r')); + OutputDebugString(str + T('\r')); #endif // MSW } @@ -394,7 +390,7 @@ wxLogStream::wxLogStream(ostream *ostr) void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) { - (*m_ostr) << wxConvCurrent->cWX2MB(szString) << endl << flush; + (*m_ostr) << wxConvertWX2MB(szString) << endl; } #endif // wxUSE_STD_IOSTREAM @@ -410,7 +406,7 @@ wxLog *wxLog::ms_pLogger = (wxLog *)NULL; bool wxLog::ms_doLog = TRUE; bool wxLog::ms_bAutoCreate = TRUE; -const wxChar *wxLog::ms_timestamp = _T("%X"); // time only, no date +const wxChar *wxLog::ms_timestamp = T("%X"); // time only, no date wxTraceMask wxLog::ms_ulTraceMask = (wxTraceMask)0; wxArrayString wxLog::ms_aTraceMasks; @@ -491,7 +487,7 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode) // copy it to our buffer and free memory wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1); - s_szBuf[WXSIZEOF(s_szBuf) - 1] = _T('\0'); + s_szBuf[WXSIZEOF(s_szBuf) - 1] = T('\0'); LocalFree(lpMsgBuf); // returned string is capitalized and ended with '\r\n' - bad @@ -499,8 +495,8 @@ const wxChar *wxSysErrorMsg(unsigned long nErrCode) size_t len = wxStrlen(s_szBuf); if ( len > 0 ) { // truncate string - if ( s_szBuf[len - 2] == _T('\r') ) - s_szBuf[len - 2] = _T('\0'); + if ( s_szBuf[len - 2] == T('\r') ) + s_szBuf[len - 2] = T('\0'); } return s_szBuf; @@ -566,30 +562,28 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg) // make life easier for people using VC++ IDE: clicking on the message // will take us immediately to the place of the failed assert #ifdef __VISUALC__ - wxSprintf(szBuf, _T("%s(%d): assert failed"), szFile, nLine); + wxSprintf(szBuf, T("%s(%d): assert failed"), szFile, nLine); #else // !VC++ // make the error message more clear for all the others - wxSprintf(szBuf, _T("Assert failed in file %s at line %d"), szFile, nLine); + wxSprintf(szBuf, T("Assert failed in file %s at line %d"), szFile, nLine); #endif // VC/!VC if ( szMsg != NULL ) { - wxStrcat(szBuf, _T(": ")); + wxStrcat(szBuf, T(": ")); wxStrcat(szBuf, szMsg); } else { - wxStrcat(szBuf, _T(".")); + wxStrcat(szBuf, T(".")); } if ( !s_bNoAsserts ) { // send it to the normal log destination wxLogDebug(szBuf); -#if wxUSE_NOGUI - Trap(); -#else // GUI +#if wxUSE_GUI // this message is intentionally not translated - it is for // developpers only - wxStrcat(szBuf, _T("\nDo you want to stop the program?" + wxStrcat(szBuf, T("\nDo you want to stop the program?" "\nYou can also choose [Cancel] to suppress " "further warnings.")); @@ -605,7 +599,9 @@ void wxOnAssert(const wxChar *szFile, int nLine, const wxChar *szMsg) //case wxNO: nothing to do } -#endif // !GUI/GUI +#else // !GUI + Trap(); +#endif // GUI/!GUI } s_bInAssert = FALSE; diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 4b8af7b876..963838511f 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -110,7 +110,7 @@ */ void wxMemStruct::ErrorMsg (const char * mesg) { - wxLogDebug(_T("wxWindows memory checking error: %s"), mesg); + wxLogDebug(T("wxWindows memory checking error: %s"), mesg); PrintNode (); // << m_fileName << ' ' << m_lineNum << endl; @@ -121,7 +121,7 @@ void wxMemStruct::ErrorMsg (const char * mesg) */ void wxMemStruct::ErrorMsg () { - wxLogDebug(_T("wxWindows over/underwrite memory error:")); + wxLogDebug(T("wxWindows over/underwrite memory error:")); PrintNode (); // cerr << m_fileName << ' ' << m_lineNum << endl; @@ -329,18 +329,18 @@ void wxMemStruct::PrintNode () // Let's put this in standard form so IDEs can load the file at the appropriate // line - wxString msg(_T("")); + wxString msg(T("")); if (m_fileName) - msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum); + msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum); if (info && info->GetClassName()) msg += info->GetClassName(); else - msg += _T("object"); + msg += T("object"); wxString msg2; - msg2.Printf(_T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize()); + msg2.Printf(T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize()); msg += msg2; wxLogDebug(msg); @@ -350,10 +350,10 @@ void wxMemStruct::PrintNode () wxString msg(""); if (m_fileName) - msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum); - msg += _T("non-object data"); + msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum); + msg += T("non-object data"); wxString msg2; - msg2.Printf(_T(" at $%lX, size %d\n"), (long)GetActualData(), (int)RequestSize()); + msg2.Printf(T(" at $%lX, size %d\n"), (long)GetActualData(), (int)RequestSize()); msg += msg2; wxLogDebug(msg); @@ -368,9 +368,9 @@ void wxMemStruct::Dump () { wxObject *obj = (wxObject *)m_actualData; - wxString msg(_T("")); + wxString msg(T("")); if (m_fileName) - msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum); + msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum); /* TODO: We no longer have a stream (using wxLogDebug) so we can't dump it. @@ -383,22 +383,22 @@ void wxMemStruct::Dump () if (obj->GetClassInfo() && obj->GetClassInfo()->GetClassName()) msg += obj->GetClassInfo()->GetClassName(); else - msg += _T("unknown object class"); + msg += T("unknown object class"); wxString msg2(""); - msg2.Printf(_T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize()); + msg2.Printf(T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize()); msg += msg2; wxLogDebug(msg); } else { - wxString msg(_T("")); + wxString msg(T("")); if (m_fileName) - msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum); + msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum); wxString msg2(""); - msg2.Printf(_T("non-object data at $%lX, size %d"), (long)GetActualData(), (int)RequestSize() ); + msg2.Printf(T("non-object data at $%lX, size %d"), (long)GetActualData(), (int)RequestSize() ); msg += msg2; wxLogDebug(msg); } @@ -418,7 +418,7 @@ int wxMemStruct::ValidateNode () else { // Can't use the error routines as we have no recognisable object. #ifndef __WXGTK__ - wxLogDebug(_T("Can't verify memory struct - all bets are off!")); + wxLogDebug(T("Can't verify memory struct - all bets are off!")); #endif } return 0; @@ -666,23 +666,23 @@ bool wxDebugContext::Dump(void) // if (TRUE) { - wxChar* appName = _T("application"); + wxChar* appName = T("application"); wxString appNameStr(""); if (wxTheApp) { appNameStr = wxTheApp->GetAppName(); appName = WXSTRINGCAST appNameStr; - wxLogDebug(_T("----- Memory dump of %s at %s -----"), appName, WXSTRINGCAST wxNow() ); + wxLogDebug(T("----- Memory dump of %s at %s -----"), appName, WXSTRINGCAST wxNow() ); } else { - wxLogDebug( _T("----- Memory dump -----") ); + wxLogDebug( T("----- Memory dump -----") ); } } TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL)); - wxLogDebug( _T("") ); - wxLogDebug( _T("") ); + wxLogDebug( T("") ); + wxLogDebug( T("") ); return TRUE; #else @@ -723,17 +723,17 @@ bool wxDebugContext::PrintStatistics(bool detailed) // if (TRUE) { - wxChar* appName = _T("application"); - wxString appNameStr(_T("")); + wxChar* appName = T("application"); + wxString appNameStr(T("")); if (wxTheApp) { appNameStr = wxTheApp->GetAppName(); appName = WXSTRINGCAST appNameStr; - wxLogDebug(_T("----- Memory statistics of %s at %s -----"), appName, WXSTRINGCAST wxNow() ); + wxLogDebug(T("----- Memory statistics of %s at %s -----"), appName, WXSTRINGCAST wxNow() ); } else { - wxLogDebug( _T("----- Memory statistics -----") ); + wxLogDebug( T("----- Memory statistics -----") ); } } @@ -757,7 +757,7 @@ bool wxDebugContext::PrintStatistics(bool detailed) // if (detailed && (data != (void*)m_debugStream) && (data != (void*) m_streamBuf)) if (detailed && (data != (void*) wxLog::GetActiveTarget())) { - wxChar *className = _T("nonobject"); + wxChar *className = T("nonobject"); if (st->m_isObject && st->GetActualData()) { wxObject *obj = (wxObject *)st->GetActualData(); @@ -792,22 +792,22 @@ bool wxDebugContext::PrintStatistics(bool detailed) { while (list) { - wxLogDebug(_T("%ld objects of class %s, total size %ld"), + wxLogDebug(T("%ld objects of class %s, total size %ld"), list->instanceCount, list->instanceClass, list->totalSize); wxDebugStatsStruct *old = list; list = old->next; free((char *)old); } - wxLogDebug(_T("")); + wxLogDebug(T("")); } SetDebugMode(currentMode); - wxLogDebug(_T("Number of object items: %ld"), noObjectNodes); - wxLogDebug(_T("Number of non-object items: %ld"), noNonObjectNodes); - wxLogDebug(_T("Total allocated size: %ld"), totalSize); - wxLogDebug(_T("")); - wxLogDebug(_T("")); + wxLogDebug(T("Number of object items: %ld"), noObjectNodes); + wxLogDebug(T("Number of non-object items: %ld"), noNonObjectNodes); + wxLogDebug(T("Total allocated size: %ld"), totalSize); + wxLogDebug(T("")); + wxLogDebug(T("")); return TRUE; #else @@ -822,13 +822,13 @@ bool wxDebugContext::PrintClasses(void) // if (TRUE) { - wxChar* appName = _T("application"); - wxString appNameStr(_T("")); + wxChar* appName = T("application"); + wxString appNameStr(T("")); if (wxTheApp) { appNameStr = wxTheApp->GetAppName(); appName = WXSTRINGCAST appNameStr; - wxLogDebug(_T("----- Classes in %s -----"), appName); + wxLogDebug(T("----- Classes in %s -----"), appName); } } @@ -844,32 +844,32 @@ bool wxDebugContext::PrintClasses(void) if (info->GetClassName()) { wxString msg(info->GetClassName()); - msg += _T(" "); + msg += T(" "); if (info->GetBaseClassName1() && !info->GetBaseClassName2()) { - msg += _T("is a "); + msg += T("is a "); msg += info->GetBaseClassName1(); } else if (info->GetBaseClassName1() && info->GetBaseClassName2()) { - msg += _T("is a "); + msg += T("is a "); msg += info->GetBaseClassName1() ; - msg += _T(", "); + msg += T(", "); msg += info->GetBaseClassName2() ; } if (info->GetConstructor()) - msg += _T(": dynamic"); + msg += T(": dynamic"); wxLogDebug(msg); } node = wxClassInfo::sm_classTable->Next(); n ++; } - wxLogDebug(_T("")); - wxLogDebug(_T("There are %d classes derived from wxObject."), n); - wxLogDebug(_T("")); - wxLogDebug(_T("")); + wxLogDebug(T("")); + wxLogDebug(T("There are %d classes derived from wxObject."), n); + wxLogDebug(T("")); + wxLogDebug(T("")); return TRUE; } @@ -1040,7 +1040,7 @@ void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, int totSize = wxDebugContext::TotSize (size); char * buf = (char *) malloc(totSize); if (!buf) { - wxLogDebug(_T("Call to malloc (%ld) failed."), (long)size); + wxLogDebug(T("Call to malloc (%ld) failed."), (long)size); return 0; } wxMemStruct * st = (wxMemStruct *)buf; diff --git a/src/common/mimetype.cpp b/src/common/mimetype.cpp index 7340228145..b36a2dcfa8 100644 --- a/src/common/mimetype.cpp +++ b/src/common/mimetype.cpp @@ -249,7 +249,7 @@ public: break; } - wxASSERT_MSG( n == pos, _T("invalid position in MailCapEntry::Insert") ); + wxASSERT_MSG( n == pos, T("invalid position in MailCapEntry::Insert") ); m_next = cur->m_next; cur->m_next = this; @@ -257,7 +257,7 @@ public: // append this element to the list void Append(MailCapEntry *next) { - wxCHECK_RET( next != NULL, _T("Append()ing to what?") ); + wxCHECK_RET( next != NULL, T("Append()ing to what?") ); // FIXME slooow... MailCapEntry *cur; @@ -266,7 +266,7 @@ public: cur->m_next = this; - wxASSERT_MSG( !m_next, _T("Append()ing element already in the list?") ); + wxASSERT_MSG( !m_next, T("Append()ing element already in the list?") ); } private: @@ -413,57 +413,57 @@ wxString wxFileType::ExpandCommand(const wxString& command, bool hasFilename = FALSE; wxString str; - for ( const wxChar *pc = command.c_str(); *pc != _T('\0'); pc++ ) { - if ( *pc == _T('%') ) { + for ( const wxChar *pc = command.c_str(); *pc != T('\0'); pc++ ) { + if ( *pc == T('%') ) { switch ( *++pc ) { - case _T('s'): + case T('s'): // '%s' expands into file name (quoted because it might // contain spaces) - except if there are already quotes // there because otherwise some programs may get confused // by double double quotes #if 0 - if ( *(pc - 2) == _T('"') ) + if ( *(pc - 2) == T('"') ) str << params.GetFileName(); else - str << _T('"') << params.GetFileName() << _T('"'); + str << T('"') << params.GetFileName() << T('"'); #endif str << params.GetFileName(); hasFilename = TRUE; break; - case _T('t'): + case T('t'): // '%t' expands into MIME type (quote it too just to be // consistent) - str << _T('\'') << params.GetMimeType() << _T('\''); + str << T('\'') << params.GetMimeType() << T('\''); break; - case _T('{'): + case T('{'): { - const wxChar *pEnd = wxStrchr(pc, _T('}')); + const wxChar *pEnd = wxStrchr(pc, T('}')); if ( pEnd == NULL ) { wxString mimetype; wxLogWarning(_("Unmatched '{' in an entry for " "mime type %s."), params.GetMimeType().c_str()); - str << _T("%{"); + str << T("%{"); } else { wxString param(pc + 1, pEnd - pc - 1); - str << _T('\'') << params.GetParamValue(param) << _T('\''); + str << T('\'') << params.GetParamValue(param) << T('\''); pc = pEnd; } } break; - case _T('n'): - case _T('F'): + case T('n'): + case T('F'): // TODO %n is the number of parts, %F is an array containing // the names of temp files these parts were written to // and their mime types. break; default: - wxLogDebug(_T("Unknown field %%%c in command '%s'."), + wxLogDebug(T("Unknown field %%%c in command '%s'."), *pc, command.c_str()); str << *pc; } @@ -476,7 +476,7 @@ wxString wxFileType::ExpandCommand(const wxString& command, // metamail(1) man page states that if the mailcap entry doesn't have '%s' // the program will accept the data on stdin: so give it to it! if ( !hasFilename && !str.IsEmpty() ) { - str << _T(" < '") << params.GetFileName() << _T('\''); + str << T(" < '") << params.GetFileName() << T('\''); } return str; @@ -533,16 +533,16 @@ wxFileType::GetPrintCommand(wxString *printCmd, bool wxMimeTypesManager::IsOfType(const wxString& mimeType, const wxString& wildcard) { - wxASSERT_MSG( mimeType.Find(_T('*')) == wxNOT_FOUND, - _T("first MIME type can't contain wildcards") ); + wxASSERT_MSG( mimeType.Find(T('*')) == wxNOT_FOUND, + T("first MIME type can't contain wildcards") ); // all comparaisons are case insensitive (2nd arg of IsSameAs() is FALSE) - if ( wildcard.BeforeFirst(_T('/')).IsSameAs(mimeType.BeforeFirst(_T('/')), FALSE) ) + if ( wildcard.BeforeFirst(T('/')).IsSameAs(mimeType.BeforeFirst(T('/')), FALSE) ) { - wxString strSubtype = wildcard.AfterFirst(_T('/')); + wxString strSubtype = wildcard.AfterFirst(T('/')); - if ( strSubtype == _T("*") || - strSubtype.IsSameAs(mimeType.AfterFirst(_T('/')), FALSE) ) + if ( strSubtype == T("*") || + strSubtype.IsSameAs(mimeType.AfterFirst(T('/')), FALSE) ) { // matches (either exactly or it's a wildcard) return TRUE; @@ -602,13 +602,13 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const // suppress possible error messages wxLogNull nolog; wxString strKey; - strKey << m_strFileType << _T("\\shell\\") << verb << _T("\\command"); + strKey << m_strFileType << T("\\shell\\") << verb << T("\\command"); wxRegKey key(wxRegKey::HKCR, strKey); wxString command; if ( key.Open() ) { // it's the default value of the key - if ( key.QueryValue(_T(""), command) ) { + if ( key.QueryValue(T(""), command) ) { // transform it from '%1' to '%s' style format string // NB: we don't make any attempt to verify that the string is valid, @@ -617,10 +617,10 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const bool foundFilename = FALSE; size_t len = command.Len(); for ( size_t n = 0; (n < len) && !foundFilename; n++ ) { - if ( command[n] == _T('%') && - (n + 1 < len) && command[n + 1] == _T('1') ) { + if ( command[n] == T('%') && + (n + 1 < len) && command[n + 1] == T('1') ) { // replace it with '%s' - command[n + 1] = _T('s'); + command[n + 1] = T('s'); foundFilename = TRUE; } @@ -629,7 +629,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *verb) const if ( !foundFilename ) { // we didn't find any '%1'! // HACK: append the filename at the end, hope that it will do - command << _T(" %s"); + command << T(" %s"); } } } @@ -648,7 +648,7 @@ wxFileTypeImpl::GetOpenCommand(wxString *openCmd, cmd = m_info->GetOpenCommand(); } else { - cmd = GetCommand(_T("open")); + cmd = GetCommand(T("open")); } *openCmd = wxFileType::ExpandCommand(cmd, params); @@ -666,7 +666,7 @@ wxFileTypeImpl::GetPrintCommand(wxString *printCmd, cmd = m_info->GetPrintCommand(); } else { - cmd = GetCommand(_T("print")); + cmd = GetCommand(T("print")); } *printCmd = wxFileType::ExpandCommand(cmd, params); @@ -707,8 +707,8 @@ bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const // suppress possible error messages wxLogNull nolog; - wxRegKey key(wxRegKey::HKCR, /*m_strFileType*/ _T(".") + m_ext); - if ( key.Open() && key.QueryValue(_T("Content Type"), *mimeType) ) { + wxRegKey key(wxRegKey::HKCR, /*m_strFileType*/ T(".") + m_ext); + if ( key.Open() && key.QueryValue(T("Content Type"), *mimeType) ) { return TRUE; } else { @@ -724,7 +724,7 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon) const } wxString strIconKey; - strIconKey << m_strFileType << _T("\\DefaultIcon"); + strIconKey << m_strFileType << T("\\DefaultIcon"); // suppress possible error messages wxLogNull nolog; @@ -733,18 +733,18 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon) const if ( key.Open() ) { wxString strIcon; // it's the default value of the key - if ( key.QueryValue(_T(""), strIcon) ) { + if ( key.QueryValue(T(""), strIcon) ) { // the format is the following: , // NB: icon index may be negative as well as positive and the full // path may contain the environment variables inside '%' - wxString strFullPath = strIcon.BeforeLast(_T(',')), - strIndex = strIcon.AfterLast(_T(',')); + wxString strFullPath = strIcon.BeforeLast(T(',')), + strIndex = strIcon.AfterLast(T(',')); // index may be omitted, in which case BeforeLast(',') is empty and // AfterLast(',') is the whole string if ( strFullPath.IsEmpty() ) { strFullPath = strIndex; - strIndex = _T("0"); + strIndex = T("0"); } wxString strExpPath = wxExpandEnvVars(strFullPath); @@ -754,7 +754,7 @@ bool wxFileTypeImpl::GetIcon(wxIcon *icon) const switch ( (int)hIcon ) { case 0: // means no icons were found case 1: // means no such file or it wasn't a DLL/EXE/OCX/ICO/... - wxLogDebug(_T("incorrect registry entry '%s': no such icon."), + wxLogDebug(T("incorrect registry entry '%s': no such icon."), key.GetName().c_str()); break; @@ -784,7 +784,7 @@ bool wxFileTypeImpl::GetDescription(wxString *desc) const if ( key.Open() ) { // it's the default value of the key - if ( key.QueryValue(_T(""), *desc) ) { + if ( key.QueryValue(T(""), *desc) ) { return TRUE; } } @@ -798,8 +798,8 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext) { // add the leading point if necessary wxString str; - if ( ext[0u] != _T('.') ) { - str = _T('.'); + if ( ext[0u] != T('.') ) { + str = T('.'); } str << ext; @@ -810,7 +810,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext) wxRegKey key(wxRegKey::HKCR, str); if ( key.Open() ) { // it's the default value of the key - if ( key.QueryValue(_T(""), strFileType) ) { + if ( key.QueryValue(T(""), strFileType) ) { // create the new wxFileType object wxFileType *fileType = new wxFileType; fileType->m_impl->Init(strFileType, ext); @@ -842,7 +842,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType) { // HACK I don't know of any official documentation which mentions this // location, but as a matter of fact IE uses it, so why not we? - static const wxChar *szMimeDbase = _T("MIME\\Database\\Content Type\\"); + static const wxChar *szMimeDbase = T("MIME\\Database\\Content Type\\"); wxString strKey = szMimeDbase; strKey << mimeType; @@ -853,7 +853,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType) wxString ext; wxRegKey key(wxRegKey::HKCR, strKey); if ( key.Open() ) { - if ( key.QueryValue(_T("Extension"), ext) ) { + if ( key.QueryValue(T("Extension"), ext) ) { return GetFileTypeFromExtension(ext); } } @@ -889,12 +889,12 @@ wxFileTypeImpl::GetEntry(const wxFileType::MessageParameters& params) const if ( command.IsEmpty() || (wxSystem(command) == 0) ) { // ok, passed - wxLogTrace(_T("Test '%s' for mime type '%s' succeeded."), + wxLogTrace(T("Test '%s' for mime type '%s' succeeded."), command.c_str(), params.GetMimeType().c_str()); break; } else { - wxLogTrace(_T("Test '%s' for mime type '%s' failed."), + wxLogTrace(T("Test '%s' for mime type '%s' failed."), command.c_str(), params.GetMimeType().c_str()); } @@ -933,7 +933,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) // one extension in the space or comma delimitid list wxString strExt; for ( const wxChar *p = strExtensions; ; p++ ) { - if ( *p == _T(' ') || *p == _T(',') || *p == _T('\0') ) { + if ( *p == T(' ') || *p == T(',') || *p == T('\0') ) { if ( !strExt.IsEmpty() ) { extensions.Add(strExt); strExt.Empty(); @@ -941,13 +941,13 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) //else: repeated spaces (shouldn't happen, but it's not that // important if it does happen) - if ( *p == _T('\0') ) + if ( *p == T('\0') ) break; } - else if ( *p == _T('.') ) { + else if ( *p == T('.') ) { // remove the dot from extension (but only if it's the first char) if ( !strExt.IsEmpty() ) { - strExt += _T('.'); + strExt += T('.'); } //else: no, don't append it } @@ -966,38 +966,38 @@ wxMimeTypesManagerImpl::wxMimeTypesManagerImpl() // (taken from metamail(1) sources) static const wxChar *aStandardLocations[] = { - _T("/etc"), - _T("/usr/etc"), - _T("/usr/local/etc"), - _T("/etc/mail"), - _T("/usr/public/lib") + T("/etc"), + T("/usr/etc"), + T("/usr/local/etc"), + T("/etc/mail"), + T("/usr/public/lib") }; // first read the system wide file(s) for ( size_t n = 0; n < WXSIZEOF(aStandardLocations); n++ ) { wxString dir = aStandardLocations[n]; - wxString file = dir + _T("/mailcap"); + wxString file = dir + T("/mailcap"); if ( wxFile::Exists(file) ) { ReadMailcap(file); } - file = dir + _T("/mime.types"); + file = dir + T("/mime.types"); if ( wxFile::Exists(file) ) { ReadMimeTypes(file); } } - wxString strHome = wxGetenv(_T("HOME")); + wxString strHome = wxGetenv(T("HOME")); // and now the users mailcap - wxString strUserMailcap = strHome + _T("/.mailcap"); + wxString strUserMailcap = strHome + T("/.mailcap"); if ( wxFile::Exists(strUserMailcap) ) { ReadMailcap(strUserMailcap); } // read the users mime.types - wxString strUserMimeTypes = strHome + _T("/.mime.types"); + wxString strUserMimeTypes = strHome + T("/.mime.types"); if ( wxFile::Exists(strUserMimeTypes) ) { ReadMimeTypes(strUserMimeTypes); } @@ -1010,8 +1010,8 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& ext) for ( size_t n = 0; n < count; n++ ) { wxString extensions = m_aExtensions[n]; while ( !extensions.IsEmpty() ) { - wxString field = extensions.BeforeFirst(_T(' ')); - extensions = extensions.AfterFirst(_T(' ')); + wxString field = extensions.BeforeFirst(T(' ')); + extensions = extensions.AfterFirst(T(' ')); // consider extensions as not being case-sensitive if ( field.IsSameAs(ext, FALSE /* no case */) ) { @@ -1041,12 +1041,12 @@ wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType) // then try to find "text/*" as match for "text/plain" (for example) // NB: if mimeType doesn't contain '/' at all, BeforeFirst() will return // the whole string - ok. - wxString strCategory = mimetype.BeforeFirst(_T('/')); + wxString strCategory = mimetype.BeforeFirst(T('/')); size_t nCount = m_aTypes.Count(); for ( size_t n = 0; n < nCount; n++ ) { - if ( (m_aTypes[n].BeforeFirst(_T('/')) == strCategory ) && - m_aTypes[n].AfterFirst(_T('/')) == _T("*") ) { + if ( (m_aTypes[n].BeforeFirst(T('/')) == strCategory ) && + m_aTypes[n].AfterFirst(T('/')) == T("*") ) { index = n; break; } @@ -1072,7 +1072,7 @@ void wxMimeTypesManagerImpl::AddFallback(const wxFileTypeInfo& filetype) size_t nExts = exts.GetCount(); for ( size_t nExt = 0; nExt < nExts; nExt++ ) { if ( nExt > 0 ) { - extensions += _T(' '); + extensions += T(' '); } extensions += exts[nExt]; } @@ -1084,7 +1084,7 @@ void wxMimeTypesManagerImpl::AddFallback(const wxFileTypeInfo& filetype) AddMailcapInfo(filetype.GetMimeType(), filetype.GetOpenCommand(), filetype.GetPrintCommand(), - _T(""), + T(""), filetype.GetDescription()); } @@ -1123,7 +1123,7 @@ void wxMimeTypesManagerImpl::AddMailcapInfo(const wxString& strType, m_aTypes.Add(strType); m_aEntries.Add(entry); - m_aExtensions.Add(_T("")); + m_aExtensions.Add(T("")); m_aDescriptions.Add(strDesc); } else { @@ -1139,7 +1139,7 @@ void wxMimeTypesManagerImpl::AddMailcapInfo(const wxString& strType, bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) { - wxLogTrace(_T("--- Parsing mime.types file '%s' ---"), strFileName.c_str()); + wxLogTrace(T("--- Parsing mime.types file '%s' ---"), strFileName.c_str()); wxTextFile file(strFileName); if ( !file.Open() ) @@ -1165,20 +1165,20 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) pc++; // comment? - if ( *pc == _T('#') ) { + if ( *pc == T('#') ) { // skip the whole line pc = NULL; continue; } // detect file format - const wxChar *pEqualSign = wxStrchr(pc, _T('=')); + const wxChar *pEqualSign = wxStrchr(pc, T('=')); if ( pEqualSign == NULL ) { // brief format // ------------ // first field is mime type - for ( strMimeType.Empty(); !wxIsspace(*pc) && *pc != _T('\0'); pc++ ) { + for ( strMimeType.Empty(); !wxIsspace(*pc) && *pc != T('\0'); pc++ ) { strMimeType += *pc; } @@ -1204,9 +1204,9 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) ; const wxChar *pEnd; - if ( *pc == _T('"') ) { + if ( *pc == T('"') ) { // the string is quoted and ends at the matching quote - pEnd = wxStrchr(++pc, _T('"')); + pEnd = wxStrchr(++pc, T('"')); if ( pEnd == NULL ) { wxLogWarning(_("Mime.types file %s, line %d: unterminated " "quoted string."), @@ -1223,7 +1223,7 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) wxString strRHS(pc, pEnd - pc); // check what follows this entry - if ( *pEnd == _T('"') ) { + if ( *pEnd == T('"') ) { // skip this quote pEnd++; } @@ -1233,20 +1233,20 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) // if there is something left, it may be either a '\\' to continue // the line or the next field of the same entry - bool entryEnded = *pc == _T('\0'), + bool entryEnded = *pc == T('\0'), nextFieldOnSameLine = FALSE; if ( !entryEnded ) { - nextFieldOnSameLine = ((*pc != _T('\\')) || (pc[1] != _T('\0'))); + nextFieldOnSameLine = ((*pc != T('\\')) || (pc[1] != T('\0'))); } // now see what we got - if ( strLHS == _T("type") ) { + if ( strLHS == T("type") ) { strMimeType = strRHS; } - else if ( strLHS == _T("desc") ) { + else if ( strLHS == T("desc") ) { strDesc = strRHS; } - else if ( strLHS == _T("exts") ) { + else if ( strLHS == T("exts") ) { strExtensions = strRHS; } else { @@ -1269,10 +1269,10 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) // although it doesn't seem to be covered by RFCs, some programs // (notably Netscape) create their entries with several comma // separated extensions (RFC mention the spaces only) - strExtensions.Replace(_T(","), _T(" ")); + strExtensions.Replace(T(","), T(" ")); // also deal with the leading dot - if ( !strExtensions.IsEmpty() && strExtensions[0] == _T('.') ) { + if ( !strExtensions.IsEmpty() && strExtensions[0] == T('.') ) { strExtensions.erase(0, 1); } @@ -1293,7 +1293,7 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, bool fallback) { - wxLogTrace(_T("--- Parsing mailcap file '%s' ---"), strFileName.c_str()); + wxLogTrace(T("--- Parsing mailcap file '%s' ---"), strFileName.c_str()); wxTextFile file(strFileName); if ( !file.Open() ) @@ -1317,7 +1317,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, pc++; // comment or empty string? - if ( *pc == _T('#') || *pc == _T('\0') ) + if ( *pc == T('#') || *pc == T('\0') ) continue; // no, do parse @@ -1343,10 +1343,10 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, curField; // accumulator for ( bool cont = TRUE; cont; pc++ ) { switch ( *pc ) { - case _T('\\'): + case T('\\'): // interpret the next character literally (notice that // backslash can be used for line continuation) - if ( *++pc == _T('\0') ) { + if ( *++pc == T('\0') ) { // fetch the next line. // pc currently points to nowhere, but after the next @@ -1360,12 +1360,12 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, } break; - case _T('\0'): + case T('\0'): cont = FALSE; // end of line reached, exit the loop // fall through - case _T(';'): + case T(';'): // store this field and start looking for the next one // trim whitespaces from both sides @@ -1374,9 +1374,9 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, switch ( currentToken ) { case Field_Type: strType = curField; - if ( strType.Find(_T('/')) == wxNOT_FOUND ) { + if ( strType.Find(T('/')) == wxNOT_FOUND ) { // we interpret "type" as "type/*" - strType += _T("/*"); + strType += T("/*"); } currentToken = Field_OpenCmd; @@ -1394,22 +1394,22 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, bool ok = TRUE; // is this something of the form foo=bar? - const wxChar *pEq = wxStrchr(curField, _T('=')); + const wxChar *pEq = wxStrchr(curField, T('=')); if ( pEq != NULL ) { - wxString lhs = curField.BeforeFirst(_T('=')), - rhs = curField.AfterFirst(_T('=')); + wxString lhs = curField.BeforeFirst(T('=')), + rhs = curField.AfterFirst(T('=')); lhs.Trim(TRUE); // from right rhs.Trim(FALSE); // from left - if ( lhs == _T("print") ) + if ( lhs == T("print") ) strPrintCmd = rhs; - else if ( lhs == _T("test") ) + else if ( lhs == T("test") ) strTest = rhs; - else if ( lhs == _T("description") ) { + else if ( lhs == T("description") ) { // it might be quoted - if ( rhs[0u] == _T('"') && - rhs.Last() == _T('"') ) { + if ( rhs[0u] == T('"') && + rhs.Last() == T('"') ) { strDesc = wxString(rhs.c_str() + 1, rhs.Len() - 2); } @@ -1417,10 +1417,10 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, strDesc = rhs; } } - else if ( lhs == _T("compose") || - lhs == _T("composetyped") || - lhs == _T("notes") || - lhs == _T("edit") ) + else if ( lhs == T("compose") || + lhs == T("composetyped") || + lhs == T("notes") || + lhs == T("edit") ) ; // ignore else ok = FALSE; @@ -1431,11 +1431,11 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, // TODO support the flags: // 1. create an xterm for 'needsterminal' // 2. append "| $PAGER" for 'copiousoutput' - if ( curField == _T("needsterminal") ) + if ( curField == T("needsterminal") ) needsterminal = TRUE; - else if ( curField == _T("copiousoutput") ) + else if ( curField == T("copiousoutput") ) copiousoutput = TRUE; - else if ( curField == _T("textualnewlines") ) + else if ( curField == T("textualnewlines") ) ; // ignore else ok = FALSE; @@ -1450,7 +1450,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, // programmer wxLogDebug ( - _T("Mailcap file %s, line %d: unknown " + T("Mailcap file %s, line %d: unknown " "field '%s' for the MIME type " "'%s' ignored."), strFileName.c_str(), @@ -1466,7 +1466,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, break; default: - wxFAIL_MSG(_T("unknown field type in mailcap")); + wxFAIL_MSG(T("unknown field type in mailcap")); } // next token starts immediately after ';' @@ -1498,7 +1498,7 @@ bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName, m_aTypes.Add(strType); m_aEntries.Add(entry); - m_aExtensions.Add(_T("")); + m_aExtensions.Add(T("")); m_aDescriptions.Add(strDesc); } else { diff --git a/src/common/object.cpp b/src/common/object.cpp index 3e3a612d48..d2d37670fa 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -45,7 +45,7 @@ #endif #if !USE_SHARED_LIBRARY -wxClassInfo wxObject::sm_classwxObject((wxChar *) _T("wxObject"), (wxChar *) NULL, (wxChar *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL); +wxClassInfo wxObject::sm_classwxObject((wxChar *) T("wxObject"), (wxChar *) NULL, (wxChar *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL); wxClassInfo* wxClassInfo::sm_first = (wxClassInfo *) NULL; wxHashTable* wxClassInfo::sm_classTable = (wxHashTable*) NULL; #endif diff --git a/src/common/objstrm.cpp b/src/common/objstrm.cpp index 0f4a38608a..f5f8e8a8ce 100644 --- a/src/common/objstrm.cpp +++ b/src/common/objstrm.cpp @@ -45,7 +45,7 @@ wxString wxObjectOutputStream::GetObjectName(wxObject *obj) { wxString name; - name.Printf(_T("%x"), (unsigned long)obj); + name.Printf(T("%x"), (unsigned long)obj); return name; } @@ -58,16 +58,16 @@ void wxObjectOutputStream::WriteObjectDef(wxObjectStreamInfo& info) if (info.duplicate) { data_s.WriteString(TAG_DUPLICATE_OBJECT); data_s.WriteString(GetObjectName(info.object)); - wxPrintf(_T("info.object (dup %s)\n"), info.object->GetClassInfo()->GetClassName()); + wxPrintf(T("info.object (dup %s)\n"), info.object->GetClassInfo()->GetClassName()); return; } if (info.object) { data_s.WriteString(info.object->GetClassInfo()->GetClassName()); - wxPrintf(_T("info.object (%s)\n"), info.object->GetClassInfo()->GetClassName()); + wxPrintf(T("info.object (%s)\n"), info.object->GetClassInfo()->GetClassName()); } else { data_s.WriteString(TAG_EMPTY_OBJECT); - wxPrintf(_T("info.object (NULL)\n")); + wxPrintf(T("info.object (NULL)\n")); return; } diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index 5179a2a5b5..4de06a39de 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -409,7 +409,7 @@ void wxPreviewControlBar::SetZoomControl(int zoom) int wxPreviewControlBar::GetZoomControl() { wxChar buf[20]; - if (m_zoomControl && (m_zoomControl->GetStringSelection() != _T(""))) + if (m_zoomControl && (m_zoomControl->GetStringSelection() != T(""))) { wxStrcpy(buf, m_zoomControl->GetStringSelection()); buf[wxStrlen(buf) - 1] = 0; diff --git a/src/common/resourc2.cpp b/src/common/resourc2.cpp index 42deac36a0..cab337e437 100644 --- a/src/common/resourc2.cpp +++ b/src/common/resourc2.cpp @@ -422,7 +422,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { "wxLB_EXTENDED", wxLB_EXTENDED }, { "wxLB_NEEDED_SB", wxLB_NEEDED_SB }, { "wxLB_ALWAYS_SB", wxLB_ALWAYS_SB }, - { "wxLB_SORT", wxLB_SORT }, + { "wxLB_SORT(", wxLB_SORT }, { "wxLB_OWNERDRAW", wxLB_OWNERDRAW }, { "wxLB_HSCROLL", wxLB_HSCROLL }, @@ -430,7 +430,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { "wxCB_SIMPLE", wxCB_SIMPLE }, { "wxCB_DROPDOWN", wxCB_DROPDOWN }, { "wxCB_READONLY", wxCB_READONLY }, - { "wxCB_SORT", wxCB_SORT }, + { "wxCB_SORT(", wxCB_SORT }, /* wxGauge */ { "wxGA_PROGRESSBAR", wxGA_PROGRESSBAR }, @@ -457,9 +457,9 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { "wxSL_VERTICAL", wxSL_VERTICAL }, { "wxSL_AUTOTICKS", wxSL_AUTOTICKS }, { "wxSL_LABELS", wxSL_LABELS }, - { "wxSL_LEFT", wxSL_LEFT }, + { "wxSL_LEFT(", wxSL_LEFT }, { "wxSL_TOP", wxSL_TOP }, - { "wxSL_RIGHT", wxSL_RIGHT }, + { "wxSL_RIGHT(", wxSL_RIGHT }, { "wxSL_BOTTOM", wxSL_BOTTOM }, { "wxSL_BOTH", wxSL_BOTH }, { "wxSL_SELRANGE", wxSL_SELRANGE }, @@ -475,17 +475,17 @@ static wxResourceBitListStruct wxResourceBitListTable[] = /* wxTreeCtrl */ { "wxTR_HAS_BUTTONS", wxTR_HAS_BUTTONS }, { "wxTR_EDIT_LABELS", wxTR_EDIT_LABELS }, - { "wxTR_LINES_AT_ROOT", wxTR_LINES_AT_ROOT }, + { "wxTR_LINES_AT_ROOT(", wxTR_LINES_AT_ROOT }, /* wxListCtrl */ { "wxLC_ICON", wxLC_ICON }, { "wxLC_SMALL_ICON", wxLC_SMALL_ICON }, - { "wxLC_LIST", wxLC_LIST }, - { "wxLC_REPORT", wxLC_REPORT }, + { "wxLC_LIST(", wxLC_LIST }, + { "wxLC_REPORT(", wxLC_REPORT }, { "wxLC_ALIGN_TOP", wxLC_ALIGN_TOP }, - { "wxLC_ALIGN_LEFT", wxLC_ALIGN_LEFT }, + { "wxLC_ALIGN_LEFT(", wxLC_ALIGN_LEFT }, { "wxLC_AUTOARRANGE", wxLC_AUTOARRANGE }, - { "wxLC_USER_TEXT", wxLC_USER_TEXT }, + { "wxLC_USER_TEXT(", wxLC_USER_TEXT }, { "wxLC_EDIT_LABELS", wxLC_EDIT_LABELS }, { "wxLC_NO_HEADER", wxLC_NO_HEADER }, { "wxLC_NO_SORT_HEADER", wxLC_NO_SORT_HEADER }, @@ -515,17 +515,17 @@ static wxResourceBitListStruct wxResourceBitListTable[] = /* wxControl */ { "wxFIXED_LENGTH", wxFIXED_LENGTH}, - { "wxALIGN_LEFT", wxALIGN_LEFT}, + { "wxALIGN_LEFT(", wxALIGN_LEFT}, { "wxALIGN_CENTER", wxALIGN_CENTER}, { "wxALIGN_CENTRE", wxALIGN_CENTRE}, - { "wxALIGN_RIGHT", wxALIGN_RIGHT}, + { "wxALIGN_RIGHT(", wxALIGN_RIGHT}, { "wxCOLOURED", wxCOLOURED}, /* wxToolBar */ { "wxTB_3DBUTTONS", wxTB_3DBUTTONS}, { "wxTB_HORIZONTAL", wxTB_HORIZONTAL}, { "wxTB_VERTICAL", wxTB_VERTICAL}, - { "wxTB_FLAT", wxTB_FLAT}, + { "wxTB_FLAT(", wxTB_FLAT}, /* Generic */ { "wxVSCROLL", wxVSCROLL }, @@ -536,7 +536,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { "wxMINIMIZE", wxICONIZE}, { "wxMAXIMIZE", wxMAXIMIZE}, { "wxSDI", 0}, - { "wxMDI_PARENT", 0}, + { "wxMDI_PARENT(", 0}, { "wxMDI_CHILD", 0}, { "wxTHICK_FRAME", wxTHICK_FRAME}, { "wxRESIZE_BORDER", wxRESIZE_BORDER}, @@ -552,7 +552,7 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { "wxNATIVE_IMPL", 0}, { "wxEXTENDED_IMPL", 0}, { "wxBACKINGSTORE", wxBACKINGSTORE}, -// { "wxFLAT", wxFLAT}, +// { "wxFLAT(", wxFLAT}, // { "wxMOTIF_RESIZE", wxMOTIF_RESIZE}, { "wxFIXED_LENGTH", 0}, { "wxDOUBLE_BORDER", wxDOUBLE_BORDER}, @@ -565,30 +565,30 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { "wxCLIP_CHILDREN", wxCLIP_CHILDREN}, { "wxTINY_CAPTION_HORIZ", wxTINY_CAPTION_HORIZ}, - { "wxTINY_CAPTION_VERT", wxTINY_CAPTION_VERT}, + { "wxTINY_CAPTION_VERT(", wxTINY_CAPTION_VERT}, // Text font families - { "wxDEFAULT", wxDEFAULT}, + { "wxDEFAULT(", wxDEFAULT}, { "wxDECORATIVE", wxDECORATIVE}, { "wxROMAN", wxROMAN}, - { "wxSCRIPT", wxSCRIPT}, + { "wxSCRIPT(", wxSCRIPT}, { "wxSWISS", wxSWISS}, { "wxMODERN", wxMODERN}, { "wxTELETYPE", wxTELETYPE}, { "wxVARIABLE", wxVARIABLE}, { "wxFIXED", wxFIXED}, { "wxNORMAL", wxNORMAL}, - { "wxLIGHT", wxLIGHT}, + { "wxLIGHT(", wxLIGHT}, { "wxBOLD", wxBOLD}, { "wxITALIC", wxITALIC}, - { "wxSLANT", wxSLANT}, + { "wxSLANT(", wxSLANT}, { "wxSOLID", wxSOLID}, - { "wxDOT", wxDOT}, + { "wxDOT(", wxDOT}, { "wxLONG_DASH", wxLONG_DASH}, { "wxSHORT_DASH", wxSHORT_DASH}, { "wxDOT_DASH", wxDOT_DASH}, { "wxUSER_DASH", wxUSER_DASH}, - { "wxTRANSPARENT", wxTRANSPARENT}, + { "wxTRANSPARENT(", wxTRANSPARENT}, { "wxSTIPPLE", wxSTIPPLE}, { "wxBDIAGONAL_HATCH", wxBDIAGONAL_HATCH}, { "wxCROSSDIAG_HATCH", wxCROSSDIAG_HATCH}, @@ -601,25 +601,25 @@ static wxResourceBitListStruct wxResourceBitListTable[] = { "wxJOIN_ROUND", wxJOIN_ROUND}, { "wxCAP_ROUND", wxCAP_ROUND}, { "wxCAP_PROJECTING", wxCAP_PROJECTING}, - { "wxCAP_BUTT", wxCAP_BUTT}, + { "wxCAP_BUTT(", wxCAP_BUTT}, // Logical ops { "wxCLEAR", wxCLEAR}, { "wxXOR", wxXOR}, - { "wxINVERT", wxINVERT}, + { "wxINVERT(", wxINVERT}, { "wxOR_REVERSE", wxOR_REVERSE}, { "wxAND_REVERSE", wxAND_REVERSE}, { "wxCOPY", wxCOPY}, { "wxAND", wxAND}, - { "wxAND_INVERT", wxAND_INVERT}, + { "wxAND_INVERT(", wxAND_INVERT}, { "wxNO_OP", wxNO_OP}, { "wxNOR", wxNOR}, { "wxEQUIV", wxEQUIV}, - { "wxSRC_INVERT", wxSRC_INVERT}, - { "wxOR_INVERT", wxOR_INVERT}, + { "wxSRC_INVERT(", wxSRC_INVERT}, + { "wxOR_INVERT(", wxOR_INVERT}, { "wxNAND", wxNAND}, { "wxOR", wxOR}, - { "wxSET", wxSET}, + { "wxSET(", wxSET}, { "wxFLOOD_SURFACE", wxFLOOD_SURFACE}, { "wxFLOOD_BORDER", wxFLOOD_BORDER}, diff --git a/src/common/resource.cpp b/src/common/resource.cpp index 61ad5cf33d..4c53d60295 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -171,10 +171,10 @@ wxItemResource *wxResourceTable::FindResource(const wxString& name) const void wxResourceTable::AddResource(wxItemResource *item) { wxString name = item->GetName(); - if (name == _T("")) + if (name == T("")) name = item->GetTitle(); - if (name == _T("")) - name = _T("no name"); + if (name == T("")) + name = T("no name"); // Delete existing resource, if any. Delete(name); @@ -243,7 +243,7 @@ bool wxResourceTable::RegisterResourceBitmapData(const wxString& name, char bits // Register pre-loaded bitmap data wxItemResource *item = new wxItemResource; // item->SetType(wxRESOURCE_TYPE_XBM_DATA); - item->SetType(_T("wxXBMData")); + item->SetType(T("wxXBMData")); item->SetName(name); item->SetValue1((long)bits); item->SetValue2((long)width); @@ -257,7 +257,7 @@ bool wxResourceTable::RegisterResourceBitmapData(const wxString& name, char **da // Register pre-loaded bitmap data wxItemResource *item = new wxItemResource; // item->SetType(wxRESOURCE_TYPE_XPM_DATA); - item->SetType(_T("wxXPMData")); + item->SetType(T("wxXPMData")); item->SetName(name); item->SetValue1((long)data); AddResource(item); @@ -307,9 +307,9 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c size = wxSize(childResource->GetWidth(), childResource->GetHeight()); } - if (itemType == wxString(_T("wxButton")) || itemType == wxString(_T("wxBitmapButton"))) + if (itemType == wxString(T("wxButton")) || itemType == wxString(T("wxBitmapButton"))) { - if (childResource->GetValue4() != _T("")) + if (childResource->GetValue4() != T("")) { // Bitmap button wxBitmap bitmap = childResource->GetBitmap(); @@ -327,10 +327,10 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c control = new wxButton(parent, id, childResource->GetTitle(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } - else if (itemType == wxString(_T("wxMessage")) || itemType == wxString(_T("wxStaticText")) || - itemType == wxString(_T("wxStaticBitmap"))) + else if (itemType == wxString(T("wxMessage")) || itemType == wxString(T("wxStaticText")) || + itemType == wxString(T("wxStaticBitmap"))) { - if (childResource->GetValue4() != _T("")) + if (childResource->GetValue4() != T("")) { // Bitmap message wxBitmap bitmap = childResource->GetBitmap(); @@ -351,12 +351,12 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c childResource->GetStyle(), childResource->GetName()); } } - else if (itemType == wxString(_T("wxText")) || itemType == wxString(_T("wxTextCtrl")) || itemType == wxString(_T("wxMultiText"))) + else if (itemType == wxString(T("wxText")) || itemType == wxString(T("wxTextCtrl")) || itemType == wxString(T("wxMultiText"))) { control = new wxTextCtrl(parent, id, childResource->GetValue4(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } - else if (itemType == wxString(_T("wxCheckBox"))) + else if (itemType == wxString(T("wxCheckBox"))) { control = new wxCheckBox(parent, id, childResource->GetTitle(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); @@ -364,7 +364,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c ((wxCheckBox *)control)->SetValue((childResource->GetValue1() != 0)); } #if wxUSE_GAUGE - else if (itemType == wxString(_T("wxGauge"))) + else if (itemType == wxString(T("wxGauge"))) { control = new wxGauge(parent, id, (int)childResource->GetValue2(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); @@ -373,7 +373,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c } #endif #if wxUSE_RADIOBTN - else if (itemType == wxString(_T("wxRadioButton"))) + else if (itemType == wxString(T("wxRadioButton"))) { control = new wxRadioButton(parent, id, childResource->GetTitle(), // (int)childResource->GetValue1(), pos, size, @@ -381,7 +381,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c } #endif #if wxUSE_SCROLLBAR - else if (itemType == wxString(_T("wxScrollBar"))) + else if (itemType == wxString(T("wxScrollBar"))) { control = new wxScrollBar(parent, id, pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); @@ -396,18 +396,18 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c } #endif - else if (itemType == wxString(_T("wxSlider"))) + else if (itemType == wxString(T("wxSlider"))) { control = new wxSlider(parent, id, (int)childResource->GetValue1(), (int)childResource->GetValue2(), (int)childResource->GetValue3(), pos, size, childResource->GetStyle(), wxDefaultValidator, childResource->GetName()); } - else if (itemType == wxString(_T("wxGroupBox")) || itemType == wxString(_T("wxStaticBox"))) + else if (itemType == wxString(T("wxGroupBox")) || itemType == wxString(T("wxStaticBox"))) { control = new wxStaticBox(parent, id, childResource->GetTitle(), pos, size, childResource->GetStyle(), childResource->GetName()); } - else if (itemType == wxString(_T("wxListBox"))) + else if (itemType == wxString(T("wxListBox"))) { wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; @@ -431,7 +431,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c if (strings) delete[] strings; } - else if (itemType == wxString(_T("wxChoice"))) + else if (itemType == wxString(T("wxChoice"))) { wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; @@ -456,7 +456,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c delete[] strings; } #if wxUSE_COMBOBOX - else if (itemType == wxString(_T("wxComboBox"))) + else if (itemType == wxString(T("wxComboBox"))) { wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; @@ -481,7 +481,7 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c delete[] strings; } #endif - else if (itemType == wxString(_T("wxRadioBox"))) + else if (itemType == wxString(T("wxRadioBox"))) { wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; @@ -532,25 +532,25 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db) wxString functor(clause->Functor()); wxItemResource *item = (wxItemResource *) NULL; - if (functor == _T("dialog")) + if (functor == T("dialog")) item = wxResourceInterpretDialog(table, clause); - else if (functor == _T("panel")) + else if (functor == T("panel")) item = wxResourceInterpretDialog(table, clause, TRUE); - else if (functor == _T("menubar")) + else if (functor == T("menubar")) item = wxResourceInterpretMenuBar(table, clause); - else if (functor == _T("menu")) + else if (functor == T("menu")) item = wxResourceInterpretMenu(table, clause); - else if (functor == _T("string")) + else if (functor == T("string")) item = wxResourceInterpretString(table, clause); - else if (functor == _T("bitmap")) + else if (functor == T("bitmap")) item = wxResourceInterpretBitmap(table, clause); - else if (functor == _T("icon")) + else if (functor == T("icon")) item = wxResourceInterpretIcon(table, clause); if (item) { // Remove any existing resource of same name - if (item->GetName() != _T("")) + if (item->GetName() != T("")) table.DeleteResource(item->GetName()); table.AddResource(item); } @@ -561,26 +561,26 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db) static const wxChar *g_ValidControlClasses[] = { - _T("wxButton"), - _T("wxBitmapButton"), - _T("wxMessage"), - _T("wxStaticText"), - _T("wxStaticBitmap"), - _T("wxText"), - _T("wxTextCtrl"), - _T("wxMultiText"), - _T("wxListBox"), - _T("wxRadioBox"), - _T("wxRadioButton"), - _T("wxCheckBox"), - _T("wxBitmapCheckBox"), - _T("wxGroupBox"), - _T("wxStaticBox"), - _T("wxSlider"), - _T("wxGauge"), - _T("wxScrollBar"), - _T("wxChoice"), - _T("wxComboBox") + T("wxButton"), + T("wxBitmapButton"), + T("wxMessage"), + T("wxStaticText"), + T("wxStaticBitmap"), + T("wxText"), + T("wxTextCtrl"), + T("wxMultiText"), + T("wxListBox"), + T("wxRadioBox"), + T("wxRadioButton"), + T("wxCheckBox"), + T("wxBitmapCheckBox"), + T("wxGroupBox"), + T("wxStaticBox"), + T("wxSlider"), + T("wxGauge"), + T("wxScrollBar"), + T("wxChoice"), + T("wxComboBox") }; static bool wxIsValidControlClass(const wxString& c) @@ -597,15 +597,15 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, { wxItemResource *dialogItem = new wxItemResource; if (isPanel) - dialogItem->SetType(_T("wxPanel")); + dialogItem->SetType(T("wxPanel")); else - dialogItem->SetType(_T("wxDialog")); - wxString style = _T(""); - wxString title = _T(""); - wxString name = _T(""); - wxString backColourHex = _T(""); - wxString labelColourHex = _T(""); - wxString buttonColourHex = _T(""); + dialogItem->SetType(T("wxDialog")); + wxString style = T(""); + wxString title = T(""); + wxString name = T(""); + wxString backColourHex = T(""); + wxString labelColourHex = T(""); + wxString buttonColourHex = T(""); long windowStyle = wxDEFAULT_DIALOG_STYLE; if (isPanel) @@ -616,36 +616,36 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, wxExpr *labelFontExpr = (wxExpr *) NULL; wxExpr *buttonFontExpr = (wxExpr *) NULL; wxExpr *fontExpr = (wxExpr *) NULL; - expr->GetAttributeValue(_T("style"), style); - expr->GetAttributeValue(_T("name"), name); - expr->GetAttributeValue(_T("title"), title); - expr->GetAttributeValue(_T("x"), x); - expr->GetAttributeValue(_T("y"), y); - expr->GetAttributeValue(_T("width"), width); - expr->GetAttributeValue(_T("height"), height); - expr->GetAttributeValue(_T("modal"), isModal); - expr->GetAttributeValue(_T("label_font"), &labelFontExpr); - expr->GetAttributeValue(_T("button_font"), &buttonFontExpr); - expr->GetAttributeValue(_T("font"), &fontExpr); - expr->GetAttributeValue(_T("background_colour"), backColourHex); - expr->GetAttributeValue(_T("label_colour"), labelColourHex); - expr->GetAttributeValue(_T("button_colour"), buttonColourHex); + expr->GetAttributeValue(T("style"), style); + expr->GetAttributeValue(T("name"), name); + expr->GetAttributeValue(T("title"), title); + expr->GetAttributeValue(T("x"), x); + expr->GetAttributeValue(T("y"), y); + expr->GetAttributeValue(T("width"), width); + expr->GetAttributeValue(T("height"), height); + expr->GetAttributeValue(T("modal"), isModal); + expr->GetAttributeValue(T("label_font"), &labelFontExpr); + expr->GetAttributeValue(T("button_font"), &buttonFontExpr); + expr->GetAttributeValue(T("font"), &fontExpr); + expr->GetAttributeValue(T("background_colour"), backColourHex); + expr->GetAttributeValue(T("label_colour"), labelColourHex); + expr->GetAttributeValue(T("button_colour"), buttonColourHex); int useDialogUnits = 0; - expr->GetAttributeValue(_T("use_dialog_units"), useDialogUnits); + expr->GetAttributeValue(T("use_dialog_units"), useDialogUnits); if (useDialogUnits != 0) dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_DIALOG_UNITS); int useDefaults = 0; - expr->GetAttributeValue(_T("use_system_defaults"), useDefaults); + expr->GetAttributeValue(T("use_system_defaults"), useDefaults); if (useDefaults != 0) dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS); long id = 0; - expr->GetAttributeValue(_T("id"), id); + expr->GetAttributeValue(T("id"), id); dialogItem->SetId(id); - if (style != _T("")) + if (style != T("")) { windowStyle = wxParseWindowStyle(style); } @@ -658,7 +658,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, dialogItem->SetTitle(title); dialogItem->SetSize(x, y, width, height); - if (backColourHex != _T("")) + if (backColourHex != T("")) { int r = 0; int g = 0; @@ -668,7 +668,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, b = wxHexToDec(backColourHex.Mid(4, 2)); dialogItem->SetBackgroundColour(wxColour((unsigned char)r,(unsigned char)g,(unsigned char)b)); } - if (labelColourHex != _T("")) + if (labelColourHex != T("")) { int r = 0; int g = 0; @@ -678,7 +678,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, b = wxHexToDec(labelColourHex.Mid(4, 2)); dialogItem->SetLabelColour(wxColour((unsigned char)r,(unsigned char)g,(unsigned char)b)); } - if (buttonColourHex != _T("")) + if (buttonColourHex != T("")) { int r = 0; int g = 0; @@ -703,7 +703,7 @@ wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, if (controlExpr->Number() == 3) { wxString controlKeyword(controlExpr->Nth(1)->StringValue()); - if (controlKeyword != _T("") && controlKeyword == _T("control")) + if (controlKeyword != T("") && controlKeyword == T("control")) { // The value part: always a list. wxExpr *listExpr = controlExpr->Nth(2); @@ -821,7 +821,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) controlItem->SetType(controlType); controlItem->SetId(id); - if (controlType == _T("wxButton")) + if (controlType == T("wxButton")) { // Check for bitmap resource name (in case loading old-style resource file) if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -829,16 +829,16 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) wxString str(expr->Nth(count)->StringValue()); count ++; - if (str != _T("")) + if (str != T("")) { controlItem->SetValue4(str); - controlItem->SetType(_T("wxBitmapButton")); + controlItem->SetType(T("wxBitmapButton")); } } if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } - else if (controlType == _T("wxBitmapButton")) + else if (controlType == T("wxBitmapButton")) { // Check for bitmap resource name if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -850,7 +850,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } } - else if (controlType == _T("wxCheckBox")) + else if (controlType == T("wxCheckBox")) { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -862,7 +862,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } #if wxUSE_RADIOBTN - else if (controlType == _T("wxRadioButton")) + else if (controlType == T("wxRadioButton")) { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -874,7 +874,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } #endif - else if (controlType == _T("wxText") || controlType == _T("wxTextCtrl") || controlType == _T("wxMultiText")) + else if (controlType == T("wxText") || controlType == T("wxTextCtrl") || controlType == T("wxMultiText")) { // Check for default value if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -893,7 +893,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxMessage") || controlType == _T("wxStaticText")) + else if (controlType == T("wxMessage") || controlType == T("wxStaticText")) { // Check for bitmap resource name (in case it's an old-style .wxr file) if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -901,12 +901,12 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) wxString str(expr->Nth(count)->StringValue()); controlItem->SetValue4(str); count ++; - controlItem->SetType(_T("wxStaticText")); + controlItem->SetType(T("wxStaticText")); } if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } - else if (controlType == _T("wxStaticBitmap")) + else if (controlType == T("wxStaticBitmap")) { // Check for bitmap resource name if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord))) @@ -918,12 +918,12 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } - else if (controlType == _T("wxGroupBox") || controlType == _T("wxStaticBox")) + else if (controlType == T("wxGroupBox") || controlType == T("wxStaticBox")) { if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList) controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count))); } - else if (controlType == _T("wxGauge")) + else if (controlType == T("wxGauge")) { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -949,7 +949,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxSlider")) + else if (controlType == T("wxSlider")) { // Check for default value if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -982,7 +982,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxScrollBar")) + else if (controlType == T("wxScrollBar")) { // DEFAULT VALUE if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger)) @@ -1009,7 +1009,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxListBox")) + else if (controlType == T("wxListBox")) { wxExpr *valueList = (wxExpr *) NULL; @@ -1051,7 +1051,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } } - else if (controlType == _T("wxChoice")) + else if (controlType == T("wxChoice")) { wxExpr *valueList = (wxExpr *) NULL; // Check for default value list @@ -1079,7 +1079,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } } #if wxUSE_COMBOBOX - else if (controlType == _T("wxComboBox")) + else if (controlType == T("wxComboBox")) { wxExpr *textValue = expr->Nth(count); if (textValue && (textValue->Type() == PrologString || textValue->Type() == PrologWord)) @@ -1117,7 +1117,7 @@ wxItemResource *wxResourceInterpretControl(wxResourceTable& table, wxExpr *expr) } #endif #if 1 - else if (controlType == _T("wxRadioBox")) + else if (controlType == T("wxRadioBox")) { wxExpr *valueList = (wxExpr *) NULL; // Check for default value list @@ -1181,13 +1181,13 @@ wxItemResource *wxResourceInterpretMenuItem(wxResourceTable& table, wxExpr *expr if (expr->Number() == 0) { // item->SetType(wxRESOURCE_TYPE_SEPARATOR); - item->SetType(_T("wxMenuSeparator")); + item->SetType(T("wxMenuSeparator")); return item; } else { // item->SetType(wxTYPE_MENU); // Well, menu item, but doesn't matter. - item->SetType(_T("wxMenu")); // Well, menu item, but doesn't matter. + item->SetType(T("wxMenu")); // Well, menu item, but doesn't matter. if (labelExpr) { wxString str(labelExpr->StringValue()); @@ -1260,7 +1260,7 @@ wxItemResource *wxResourceInterpretMenu1(wxResourceTable& table, wxExpr *expr) wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, wxExpr *expr) { wxExpr *listExpr = (wxExpr *) NULL; - expr->GetAttributeValue(_T("menu"), &listExpr); + expr->GetAttributeValue(T("menu"), &listExpr); if (!listExpr) return (wxItemResource *) NULL; @@ -1270,7 +1270,7 @@ wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, wxExpr *expr) return (wxItemResource *) NULL; wxString name; - if (expr->GetAttributeValue(_T("name"), name)) + if (expr->GetAttributeValue(T("name"), name)) { menuResource->SetName(name); } @@ -1281,12 +1281,12 @@ wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, wxExpr *expr) wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, wxExpr *expr) { wxExpr *listExpr = (wxExpr *) NULL; - expr->GetAttributeValue(_T("menu"), &listExpr); + expr->GetAttributeValue(T("menu"), &listExpr); if (!listExpr) return (wxItemResource *) NULL; wxItemResource *resource = new wxItemResource; - resource->SetType(_T("wxMenu")); + resource->SetType(T("wxMenu")); // resource->SetType(wxTYPE_MENU); wxExpr *element = listExpr->GetFirst(); @@ -1298,7 +1298,7 @@ wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, wxExpr *expr) } wxString name; - if (expr->GetAttributeValue(_T("name"), name)) + if (expr->GetAttributeValue(T("name"), name)) { resource->SetName(name); } @@ -1315,9 +1315,9 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx { wxItemResource *bitmapItem = new wxItemResource; // bitmapItem->SetType(wxTYPE_BITMAP); - bitmapItem->SetType(_T("wxBitmap")); + bitmapItem->SetType(T("wxBitmap")); wxString name; - if (expr->GetAttributeValue(_T("name"), name)) + if (expr->GetAttributeValue(T("name"), name)) { bitmapItem->SetName(name); } @@ -1328,7 +1328,7 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx if (bitmapExpr->Number() == 3) { wxString bitmapKeyword(bitmapExpr->Nth(1)->StringValue()); - if (bitmapKeyword == _T("bitmap") || bitmapKeyword == _T("icon")) + if (bitmapKeyword == T("bitmap") || bitmapKeyword == T("icon")) { // The value part: always a list. wxExpr *listExpr = bitmapExpr->Nth(2); @@ -1336,7 +1336,7 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx { wxItemResource *bitmapSpec = new wxItemResource; // bitmapSpec->SetType(wxTYPE_BITMAP); - bitmapSpec->SetType(_T("wxBitmap")); + bitmapSpec->SetType(T("wxBitmap")); // List is of form: [filename, bitmaptype, platform, colours, xresolution, yresolution] // where everything after 'filename' is optional. @@ -1346,25 +1346,25 @@ wxItemResource *wxResourceInterpretBitmap(wxResourceTable& WXUNUSED(table), wxEx wxExpr *coloursExpr = listExpr->Nth(3); wxExpr *xresExpr = listExpr->Nth(4); wxExpr *yresExpr = listExpr->Nth(5); - if (nameExpr && nameExpr->StringValue() != _T("")) + if (nameExpr && nameExpr->StringValue() != T("")) { bitmapSpec->SetName(nameExpr->StringValue()); } - if (typeExpr && typeExpr->StringValue() != _T("")) + if (typeExpr && typeExpr->StringValue() != T("")) { bitmapSpec->SetValue1(wxParseWindowStyle(typeExpr->StringValue())); } else bitmapSpec->SetValue1(0); - if (platformExpr && platformExpr->StringValue() != _T("")) + if (platformExpr && platformExpr->StringValue() != T("")) { wxString plat(platformExpr->StringValue()); - if (plat == _T("windows") || plat == _T("WINDOWS")) + if (plat == T("windows") || plat == T("WINDOWS")) bitmapSpec->SetValue2(RESOURCE_PLATFORM_WINDOWS); - else if (plat == _T("x") || plat == _T("X")) + else if (plat == T("x") || plat == T("X")) bitmapSpec->SetValue2(RESOURCE_PLATFORM_X); - else if (plat == _T("mac") || plat == _T("MAC")) + else if (plat == T("mac") || plat == T("MAC")) bitmapSpec->SetValue2(RESOURCE_PLATFORM_MAC); else bitmapSpec->SetValue2(RESOURCE_PLATFORM_ANY); @@ -1398,7 +1398,7 @@ wxItemResource *wxResourceInterpretIcon(wxResourceTable& table, wxExpr *expr) if (item) { // item->SetType(wxTYPE_ICON); - item->SetType(_T("wxIcon")); + item->SetType(T("wxIcon")); return item; } else @@ -1416,7 +1416,7 @@ wxFont wxResourceInterpretFontSpec(wxExpr *expr) int style = wxNORMAL; int weight = wxNORMAL; int underline = 0; - wxString faceName(_T("")); + wxString faceName(T("")); wxExpr *pointExpr = expr->Nth(0); wxExpr *familyExpr = expr->Nth(1); @@ -1645,10 +1645,10 @@ bool wxResourceReadOneResource(FILE *fd, wxExprDatabase& db, bool *eof, wxResour wxGetResourceToken(fd); wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer)); wxChar *actualName = name; - if (name[0] == _T('"')) + if (name[0] == T('"')) actualName = name + 1; int len = wxStrlen(name); - if ((len > 0) && (name[len-1] == _T('"'))) + if ((len > 0) && (name[len-1] == T('"'))) name[len-1] = 0; if (!wxResourceParseIncludeFile(actualName, table)) { @@ -1753,7 +1753,7 @@ wxChar* wxResourceParseWord(wxChar*s, int *i) int len = wxStrlen(s); int j = 0; int ii = *i; - while ((ii < len) && (wxIsalpha(s[ii]) || (s[ii] == _T('_')))) + while ((ii < len) && (wxIsalpha(s[ii]) || (s[ii] == T('_')))) { buf[j] = s[ii]; j ++; @@ -1763,7 +1763,7 @@ wxChar* wxResourceParseWord(wxChar*s, int *i) // Eat whitespace and conjunction characters while ((ii < len) && - ((s[ii] == _T(' ')) || (s[ii] == _T('|')) || (s[ii] == _T(',')))) + ((s[ii] == T(' ')) || (s[ii] == T('|')) || (s[ii] == T(',')))) { ii ++; } @@ -1783,259 +1783,259 @@ struct wxResourceBitListStruct static wxResourceBitListStruct wxResourceBitListTable[] = { /* wxListBox */ - { _T("wxSINGLE"), wxLB_SINGLE }, - { _T("wxMULTIPLE"), wxLB_MULTIPLE }, - { _T("wxEXTENDED"), wxLB_EXTENDED }, - { _T("wxLB_SINGLE"), wxLB_SINGLE }, - { _T("wxLB_MULTIPLE"), wxLB_MULTIPLE }, - { _T("wxLB_EXTENDED"), wxLB_EXTENDED }, - { _T("wxLB_NEEDED_SB"), wxLB_NEEDED_SB }, - { _T("wxLB_ALWAYS_SB"), wxLB_ALWAYS_SB }, - { _T("wxLB_SORT"), wxLB_SORT }, - { _T("wxLB_OWNERDRAW"), wxLB_OWNERDRAW }, - { _T("wxLB_HSCROLL"), wxLB_HSCROLL }, + { T("wxSINGLE"), wxLB_SINGLE }, + { T("wxMULTIPLE"), wxLB_MULTIPLE }, + { T("wxEXTENDED"), wxLB_EXTENDED }, + { T("wxLB_SINGLE"), wxLB_SINGLE }, + { T("wxLB_MULTIPLE"), wxLB_MULTIPLE }, + { T("wxLB_EXTENDED"), wxLB_EXTENDED }, + { T("wxLB_NEEDED_SB"), wxLB_NEEDED_SB }, + { T("wxLB_ALWAYS_SB"), wxLB_ALWAYS_SB }, + { T("wxLB_SORT("), wxLB_SORT }, + { T("wxLB_OWNERDRAW"), wxLB_OWNERDRAW }, + { T("wxLB_HSCROLL"), wxLB_HSCROLL }, /* wxComboxBox */ - { _T("wxCB_SIMPLE"), wxCB_SIMPLE }, - { _T("wxCB_DROPDOWN"), wxCB_DROPDOWN }, - { _T("wxCB_READONLY"), wxCB_READONLY }, - { _T("wxCB_SORT"), wxCB_SORT }, + { T("wxCB_SIMPLE"), wxCB_SIMPLE }, + { T("wxCB_DROPDOWN"), wxCB_DROPDOWN }, + { T("wxCB_READONLY"), wxCB_READONLY }, + { T("wxCB_SORT("), wxCB_SORT }, /* wxGauge */ - { _T("wxGA_PROGRESSBAR"), wxGA_PROGRESSBAR }, - { _T("wxGA_HORIZONTAL"), wxGA_HORIZONTAL }, - { _T("wxGA_VERTICAL"), wxGA_VERTICAL }, + { T("wxGA_PROGRESSBAR"), wxGA_PROGRESSBAR }, + { T("wxGA_HORIZONTAL"), wxGA_HORIZONTAL }, + { T("wxGA_VERTICAL"), wxGA_VERTICAL }, /* wxTextCtrl */ - { _T("wxPASSWORD"), wxPASSWORD}, - { _T("wxPROCESS_ENTER"), wxPROCESS_ENTER}, - { _T("wxTE_PASSWORD"), wxTE_PASSWORD}, - { _T("wxTE_READONLY"), wxTE_READONLY}, - { _T("wxTE_PROCESS_ENTER"), wxTE_PROCESS_ENTER}, - { _T("wxTE_MULTILINE"), wxTE_MULTILINE}, - { _T("wxTE_NO_VSCROLL"), wxTE_NO_VSCROLL}, + { T("wxPASSWORD"), wxPASSWORD}, + { T("wxPROCESS_ENTER"), wxPROCESS_ENTER}, + { T("wxTE_PASSWORD"), wxTE_PASSWORD}, + { T("wxTE_READONLY"), wxTE_READONLY}, + { T("wxTE_PROCESS_ENTER"), wxTE_PROCESS_ENTER}, + { T("wxTE_MULTILINE"), wxTE_MULTILINE}, + { T("wxTE_NO_VSCROLL"), wxTE_NO_VSCROLL}, /* wxRadioBox/wxRadioButton */ - { _T("wxRB_GROUP"), wxRB_GROUP }, - { _T("wxRA_SPECIFY_COLS"), wxRA_SPECIFY_COLS }, - { _T("wxRA_SPECIFY_ROWS"), wxRA_SPECIFY_ROWS }, - { _T("wxRA_HORIZONTAL"), wxRA_HORIZONTAL }, - { _T("wxRA_VERTICAL"), wxRA_VERTICAL }, + { T("wxRB_GROUP"), wxRB_GROUP }, + { T("wxRA_SPECIFY_COLS"), wxRA_SPECIFY_COLS }, + { T("wxRA_SPECIFY_ROWS"), wxRA_SPECIFY_ROWS }, + { T("wxRA_HORIZONTAL"), wxRA_HORIZONTAL }, + { T("wxRA_VERTICAL"), wxRA_VERTICAL }, /* wxSlider */ - { _T("wxSL_HORIZONTAL"), wxSL_HORIZONTAL }, - { _T("wxSL_VERTICAL"), wxSL_VERTICAL }, - { _T("wxSL_AUTOTICKS"), wxSL_AUTOTICKS }, - { _T("wxSL_LABELS"), wxSL_LABELS }, - { _T("wxSL_LEFT"), wxSL_LEFT }, - { _T("wxSL_TOP"), wxSL_TOP }, - { _T("wxSL_RIGHT"), wxSL_RIGHT }, - { _T("wxSL_BOTTOM"), wxSL_BOTTOM }, - { _T("wxSL_BOTH"), wxSL_BOTH }, - { _T("wxSL_SELRANGE"), wxSL_SELRANGE }, + { T("wxSL_HORIZONTAL"), wxSL_HORIZONTAL }, + { T("wxSL_VERTICAL"), wxSL_VERTICAL }, + { T("wxSL_AUTOTICKS"), wxSL_AUTOTICKS }, + { T("wxSL_LABELS"), wxSL_LABELS }, + { T("wxSL_LEFT("), wxSL_LEFT }, + { T("wxSL_TOP"), wxSL_TOP }, + { T("wxSL_RIGHT("), wxSL_RIGHT }, + { T("wxSL_BOTTOM"), wxSL_BOTTOM }, + { T("wxSL_BOTH"), wxSL_BOTH }, + { T("wxSL_SELRANGE"), wxSL_SELRANGE }, /* wxScrollBar */ - { _T("wxSB_HORIZONTAL"), wxSB_HORIZONTAL }, - { _T("wxSB_VERTICAL"), wxSB_VERTICAL }, + { T("wxSB_HORIZONTAL"), wxSB_HORIZONTAL }, + { T("wxSB_VERTICAL"), wxSB_VERTICAL }, /* wxButton */ - { _T("wxBU_AUTODRAW"), wxBU_AUTODRAW }, - { _T("wxBU_NOAUTODRAW"), wxBU_NOAUTODRAW }, + { T("wxBU_AUTODRAW"), wxBU_AUTODRAW }, + { T("wxBU_NOAUTODRAW"), wxBU_NOAUTODRAW }, /* wxTreeCtrl */ - { _T("wxTR_HAS_BUTTONS"), wxTR_HAS_BUTTONS }, - { _T("wxTR_EDIT_LABELS"), wxTR_EDIT_LABELS }, - { _T("wxTR_LINES_AT_ROOT"), wxTR_LINES_AT_ROOT }, + { T("wxTR_HAS_BUTTONS"), wxTR_HAS_BUTTONS }, + { T("wxTR_EDIT_LABELS"), wxTR_EDIT_LABELS }, + { T("wxTR_LINES_AT_ROOT("), wxTR_LINES_AT_ROOT }, /* wxListCtrl */ - { _T("wxLC_ICON"), wxLC_ICON }, - { _T("wxLC_SMALL_ICON"), wxLC_SMALL_ICON }, - { _T("wxLC_LIST"), wxLC_LIST }, - { _T("wxLC_REPORT"), wxLC_REPORT }, - { _T("wxLC_ALIGN_TOP"), wxLC_ALIGN_TOP }, - { _T("wxLC_ALIGN_LEFT"), wxLC_ALIGN_LEFT }, - { _T("wxLC_AUTOARRANGE"), wxLC_AUTOARRANGE }, - { _T("wxLC_USER_TEXT"), wxLC_USER_TEXT }, - { _T("wxLC_EDIT_LABELS"), wxLC_EDIT_LABELS }, - { _T("wxLC_NO_HEADER"), wxLC_NO_HEADER }, - { _T("wxLC_NO_SORT_HEADER"), wxLC_NO_SORT_HEADER }, - { _T("wxLC_SINGLE_SEL"), wxLC_SINGLE_SEL }, - { _T("wxLC_SORT_ASCENDING"), wxLC_SORT_ASCENDING }, - { _T("wxLC_SORT_DESCENDING"), wxLC_SORT_DESCENDING }, + { T("wxLC_ICON"), wxLC_ICON }, + { T("wxLC_SMALL_ICON"), wxLC_SMALL_ICON }, + { T("wxLC_LIST("), wxLC_LIST }, + { T("wxLC_REPORT("), wxLC_REPORT }, + { T("wxLC_ALIGN_TOP"), wxLC_ALIGN_TOP }, + { T("wxLC_ALIGN_LEFT("), wxLC_ALIGN_LEFT }, + { T("wxLC_AUTOARRANGE"), wxLC_AUTOARRANGE }, + { T("wxLC_USER_TEXT("), wxLC_USER_TEXT }, + { T("wxLC_EDIT_LABELS"), wxLC_EDIT_LABELS }, + { T("wxLC_NO_HEADER"), wxLC_NO_HEADER }, + { T("wxLC_NO_SORT_HEADER"), wxLC_NO_SORT_HEADER }, + { T("wxLC_SINGLE_SEL"), wxLC_SINGLE_SEL }, + { T("wxLC_SORT_ASCENDING"), wxLC_SORT_ASCENDING }, + { T("wxLC_SORT_DESCENDING"), wxLC_SORT_DESCENDING }, /* wxSpinButton */ - { _T("wxSP_VERTICAL"), wxSP_VERTICAL}, - { _T("wxSP_HORIZONTAL"), wxSP_HORIZONTAL}, - { _T("wxSP_ARROW_KEYS"), wxSP_ARROW_KEYS}, - { _T("wxSP_WRAP"), wxSP_WRAP}, + { T("wxSP_VERTICAL"), wxSP_VERTICAL}, + { T("wxSP_HORIZONTAL"), wxSP_HORIZONTAL}, + { T("wxSP_ARROW_KEYS"), wxSP_ARROW_KEYS}, + { T("wxSP_WRAP"), wxSP_WRAP}, /* wxSplitterWnd */ - { _T("wxSP_NOBORDER"), wxSP_NOBORDER}, - { _T("wxSP_3D"), wxSP_3D}, - { _T("wxSP_BORDER"), wxSP_BORDER}, + { T("wxSP_NOBORDER"), wxSP_NOBORDER}, + { T("wxSP_3D"), wxSP_3D}, + { T("wxSP_BORDER"), wxSP_BORDER}, /* wxTabCtrl */ - { _T("wxTC_MULTILINE"), wxTC_MULTILINE}, - { _T("wxTC_RIGHTJUSTIFY"), wxTC_RIGHTJUSTIFY}, - { _T("wxTC_FIXEDWIDTH"), wxTC_FIXEDWIDTH}, - { _T("wxTC_OWNERDRAW"), wxTC_OWNERDRAW}, + { T("wxTC_MULTILINE"), wxTC_MULTILINE}, + { T("wxTC_RIGHTJUSTIFY"), wxTC_RIGHTJUSTIFY}, + { T("wxTC_FIXEDWIDTH"), wxTC_FIXEDWIDTH}, + { T("wxTC_OWNERDRAW"), wxTC_OWNERDRAW}, /* wxStatusBar95 */ - { _T("wxST_SIZEGRIP"), wxST_SIZEGRIP}, + { T("wxST_SIZEGRIP"), wxST_SIZEGRIP}, /* wxControl */ - { _T("wxFIXED_LENGTH"), wxFIXED_LENGTH}, - { _T("wxALIGN_LEFT"), wxALIGN_LEFT}, - { _T("wxALIGN_CENTER"), wxALIGN_CENTER}, - { _T("wxALIGN_CENTRE"), wxALIGN_CENTRE}, - { _T("wxALIGN_RIGHT"), wxALIGN_RIGHT}, - { _T("wxCOLOURED"), wxCOLOURED}, + { T("wxFIXED_LENGTH"), wxFIXED_LENGTH}, + { T("wxALIGN_LEFT("), wxALIGN_LEFT}, + { T("wxALIGN_CENTER"), wxALIGN_CENTER}, + { T("wxALIGN_CENTRE"), wxALIGN_CENTRE}, + { T("wxALIGN_RIGHT("), wxALIGN_RIGHT}, + { T("wxCOLOURED"), wxCOLOURED}, /* wxToolBar */ - { _T("wxTB_3DBUTTONS"), wxTB_3DBUTTONS}, - { _T("wxTB_HORIZONTAL"), wxTB_HORIZONTAL}, - { _T("wxTB_VERTICAL"), wxTB_VERTICAL}, - { _T("wxTB_FLAT"), wxTB_FLAT}, + { T("wxTB_3DBUTTONS"), wxTB_3DBUTTONS}, + { T("wxTB_HORIZONTAL"), wxTB_HORIZONTAL}, + { T("wxTB_VERTICAL"), wxTB_VERTICAL}, + { T("wxTB_FLAT("), wxTB_FLAT}, /* wxDialog */ - { _T("wxDIALOG_MODAL"), wxDIALOG_MODAL }, + { T("wxDIALOG_MODAL"), wxDIALOG_MODAL }, /* Generic */ - { _T("wxVSCROLL"), wxVSCROLL }, - { _T("wxHSCROLL"), wxHSCROLL }, - { _T("wxCAPTION"), wxCAPTION }, - { _T("wxSTAY_ON_TOP"), wxSTAY_ON_TOP}, - { _T("wxICONIZE"), wxICONIZE}, - { _T("wxMINIMIZE"), wxICONIZE}, - { _T("wxMAXIMIZE"), wxMAXIMIZE}, - { _T("wxSDI"), 0}, - { _T("wxMDI_PARENT"), 0}, - { _T("wxMDI_CHILD"), 0}, - { _T("wxTHICK_FRAME"), wxTHICK_FRAME}, - { _T("wxRESIZE_BORDER"), wxRESIZE_BORDER}, - { _T("wxSYSTEM_MENU"), wxSYSTEM_MENU}, - { _T("wxMINIMIZE_BOX"), wxMINIMIZE_BOX}, - { _T("wxMAXIMIZE_BOX"), wxMAXIMIZE_BOX}, - { _T("wxRESIZE_BOX"), wxRESIZE_BOX}, - { _T("wxDEFAULT_FRAME_STYLE"), wxDEFAULT_FRAME_STYLE}, - { _T("wxDEFAULT_FRAME"), wxDEFAULT_FRAME_STYLE}, - { _T("wxDEFAULT_DIALOG_STYLE"), wxDEFAULT_DIALOG_STYLE}, - { _T("wxBORDER"), wxBORDER}, - { _T("wxRETAINED"), wxRETAINED}, - { _T("wxNATIVE_IMPL"), 0}, - { _T("wxEXTENDED_IMPL"), 0}, - { _T("wxBACKINGSTORE"), wxBACKINGSTORE}, -// { _T("wxFLAT"), wxFLAT}, -// { _T("wxMOTIF_RESIZE"), wxMOTIF_RESIZE}, - { _T("wxFIXED_LENGTH"), 0}, - { _T("wxDOUBLE_BORDER"), wxDOUBLE_BORDER}, - { _T("wxSUNKEN_BORDER"), wxSUNKEN_BORDER}, - { _T("wxRAISED_BORDER"), wxRAISED_BORDER}, - { _T("wxSIMPLE_BORDER"), wxSIMPLE_BORDER}, - { _T("wxSTATIC_BORDER"), wxSTATIC_BORDER}, - { _T("wxTRANSPARENT_WINDOW"), wxTRANSPARENT_WINDOW}, - { _T("wxNO_BORDER"), wxNO_BORDER}, - { _T("wxCLIP_CHILDREN"), wxCLIP_CHILDREN}, - { _T("wxTAB_TRAVERSAL"), 0}, // Compatibility only - - { _T("wxTINY_CAPTION_HORIZ"), wxTINY_CAPTION_HORIZ}, - { _T("wxTINY_CAPTION_VERT"), wxTINY_CAPTION_VERT}, + { T("wxVSCROLL"), wxVSCROLL }, + { T("wxHSCROLL"), wxHSCROLL }, + { T("wxCAPTION"), wxCAPTION }, + { T("wxSTAY_ON_TOP"), wxSTAY_ON_TOP}, + { T("wxICONIZE"), wxICONIZE}, + { T("wxMINIMIZE"), wxICONIZE}, + { T("wxMAXIMIZE"), wxMAXIMIZE}, + { T("wxSDI"), 0}, + { T("wxMDI_PARENT("), 0}, + { T("wxMDI_CHILD"), 0}, + { T("wxTHICK_FRAME"), wxTHICK_FRAME}, + { T("wxRESIZE_BORDER"), wxRESIZE_BORDER}, + { T("wxSYSTEM_MENU"), wxSYSTEM_MENU}, + { T("wxMINIMIZE_BOX"), wxMINIMIZE_BOX}, + { T("wxMAXIMIZE_BOX"), wxMAXIMIZE_BOX}, + { T("wxRESIZE_BOX"), wxRESIZE_BOX}, + { T("wxDEFAULT_FRAME_STYLE"), wxDEFAULT_FRAME_STYLE}, + { T("wxDEFAULT_FRAME"), wxDEFAULT_FRAME_STYLE}, + { T("wxDEFAULT_DIALOG_STYLE"), wxDEFAULT_DIALOG_STYLE}, + { T("wxBORDER"), wxBORDER}, + { T("wxRETAINED"), wxRETAINED}, + { T("wxNATIVE_IMPL"), 0}, + { T("wxEXTENDED_IMPL"), 0}, + { T("wxBACKINGSTORE"), wxBACKINGSTORE}, +// { T("wxFLAT("), wxFLAT}, +// { T("wxMOTIF_RESIZE"), wxMOTIF_RESIZE}, + { T("wxFIXED_LENGTH"), 0}, + { T("wxDOUBLE_BORDER"), wxDOUBLE_BORDER}, + { T("wxSUNKEN_BORDER"), wxSUNKEN_BORDER}, + { T("wxRAISED_BORDER"), wxRAISED_BORDER}, + { T("wxSIMPLE_BORDER"), wxSIMPLE_BORDER}, + { T("wxSTATIC_BORDER"), wxSTATIC_BORDER}, + { T("wxTRANSPARENT_WINDOW"), wxTRANSPARENT_WINDOW}, + { T("wxNO_BORDER"), wxNO_BORDER}, + { T("wxCLIP_CHILDREN"), wxCLIP_CHILDREN}, + { T("wxTAB_TRAVERSAL"), 0}, // Compatibility only + + { T("wxTINY_CAPTION_HORIZ"), wxTINY_CAPTION_HORIZ}, + { T("wxTINY_CAPTION_VERT("), wxTINY_CAPTION_VERT}, // Text font families - { _T("wxDEFAULT"), wxDEFAULT}, - { _T("wxDECORATIVE"), wxDECORATIVE}, - { _T("wxROMAN"), wxROMAN}, - { _T("wxSCRIPT"), wxSCRIPT}, - { _T("wxSWISS"), wxSWISS}, - { _T("wxMODERN"), wxMODERN}, - { _T("wxTELETYPE"), wxTELETYPE}, - { _T("wxVARIABLE"), wxVARIABLE}, - { _T("wxFIXED"), wxFIXED}, - { _T("wxNORMAL"), wxNORMAL}, - { _T("wxLIGHT"), wxLIGHT}, - { _T("wxBOLD"), wxBOLD}, - { _T("wxITALIC"), wxITALIC}, - { _T("wxSLANT"), wxSLANT}, - { _T("wxSOLID"), wxSOLID}, - { _T("wxDOT"), wxDOT}, - { _T("wxLONG_DASH"), wxLONG_DASH}, - { _T("wxSHORT_DASH"), wxSHORT_DASH}, - { _T("wxDOT_DASH"), wxDOT_DASH}, - { _T("wxUSER_DASH"), wxUSER_DASH}, - { _T("wxTRANSPARENT"), wxTRANSPARENT}, - { _T("wxSTIPPLE"), wxSTIPPLE}, - { _T("wxBDIAGONAL_HATCH"), wxBDIAGONAL_HATCH}, - { _T("wxCROSSDIAG_HATCH"), wxCROSSDIAG_HATCH}, - { _T("wxFDIAGONAL_HATCH"), wxFDIAGONAL_HATCH}, - { _T("wxCROSS_HATCH"), wxCROSS_HATCH}, - { _T("wxHORIZONTAL_HATCH"), wxHORIZONTAL_HATCH}, - { _T("wxVERTICAL_HATCH"), wxVERTICAL_HATCH}, - { _T("wxJOIN_BEVEL"), wxJOIN_BEVEL}, - { _T("wxJOIN_MITER"), wxJOIN_MITER}, - { _T("wxJOIN_ROUND"), wxJOIN_ROUND}, - { _T("wxCAP_ROUND"), wxCAP_ROUND}, - { _T("wxCAP_PROJECTING"), wxCAP_PROJECTING}, - { _T("wxCAP_BUTT"), wxCAP_BUTT}, + { T("wxDEFAULT("), wxDEFAULT}, + { T("wxDECORATIVE"), wxDECORATIVE}, + { T("wxROMAN"), wxROMAN}, + { T("wxSCRIPT("), wxSCRIPT}, + { T("wxSWISS"), wxSWISS}, + { T("wxMODERN"), wxMODERN}, + { T("wxTELETYPE"), wxTELETYPE}, + { T("wxVARIABLE"), wxVARIABLE}, + { T("wxFIXED"), wxFIXED}, + { T("wxNORMAL"), wxNORMAL}, + { T("wxLIGHT("), wxLIGHT}, + { T("wxBOLD"), wxBOLD}, + { T("wxITALIC"), wxITALIC}, + { T("wxSLANT("), wxSLANT}, + { T("wxSOLID"), wxSOLID}, + { T("wxDOT("), wxDOT}, + { T("wxLONG_DASH"), wxLONG_DASH}, + { T("wxSHORT_DASH"), wxSHORT_DASH}, + { T("wxDOT_DASH"), wxDOT_DASH}, + { T("wxUSER_DASH"), wxUSER_DASH}, + { T("wxTRANSPARENT("), wxTRANSPARENT}, + { T("wxSTIPPLE"), wxSTIPPLE}, + { T("wxBDIAGONAL_HATCH"), wxBDIAGONAL_HATCH}, + { T("wxCROSSDIAG_HATCH"), wxCROSSDIAG_HATCH}, + { T("wxFDIAGONAL_HATCH"), wxFDIAGONAL_HATCH}, + { T("wxCROSS_HATCH"), wxCROSS_HATCH}, + { T("wxHORIZONTAL_HATCH"), wxHORIZONTAL_HATCH}, + { T("wxVERTICAL_HATCH"), wxVERTICAL_HATCH}, + { T("wxJOIN_BEVEL"), wxJOIN_BEVEL}, + { T("wxJOIN_MITER"), wxJOIN_MITER}, + { T("wxJOIN_ROUND"), wxJOIN_ROUND}, + { T("wxCAP_ROUND"), wxCAP_ROUND}, + { T("wxCAP_PROJECTING"), wxCAP_PROJECTING}, + { T("wxCAP_BUTT("), wxCAP_BUTT}, // Logical ops - { _T("wxCLEAR"), wxCLEAR}, - { _T("wxXOR"), wxXOR}, - { _T("wxINVERT"), wxINVERT}, - { _T("wxOR_REVERSE"), wxOR_REVERSE}, - { _T("wxAND_REVERSE"), wxAND_REVERSE}, - { _T("wxCOPY"), wxCOPY}, - { _T("wxAND"), wxAND}, - { _T("wxAND_INVERT"), wxAND_INVERT}, - { _T("wxNO_OP"), wxNO_OP}, - { _T("wxNOR"), wxNOR}, - { _T("wxEQUIV"), wxEQUIV}, - { _T("wxSRC_INVERT"), wxSRC_INVERT}, - { _T("wxOR_INVERT"), wxOR_INVERT}, - { _T("wxNAND"), wxNAND}, - { _T("wxOR"), wxOR}, - { _T("wxSET"), wxSET}, - - { _T("wxFLOOD_SURFACE"), wxFLOOD_SURFACE}, - { _T("wxFLOOD_BORDER"), wxFLOOD_BORDER}, - { _T("wxODDEVEN_RULE"), wxODDEVEN_RULE}, - { _T("wxWINDING_RULE"), wxWINDING_RULE}, - { _T("wxHORIZONTAL"), wxHORIZONTAL}, - { _T("wxVERTICAL"), wxVERTICAL}, - { _T("wxBOTH"), wxBOTH}, - { _T("wxCENTER_FRAME"), wxCENTER_FRAME}, - { _T("wxOK"), wxOK}, - { _T("wxYES_NO"), wxYES_NO}, - { _T("wxCANCEL"), wxCANCEL}, - { _T("wxYES"), wxYES}, - { _T("wxNO"), wxNO}, - { _T("wxICON_EXCLAMATION"), wxICON_EXCLAMATION}, - { _T("wxICON_HAND"), wxICON_HAND}, - { _T("wxICON_QUESTION"), wxICON_QUESTION}, - { _T("wxICON_INFORMATION"), wxICON_INFORMATION}, - { _T("wxICON_STOP"), wxICON_STOP}, - { _T("wxICON_ASTERISK"), wxICON_ASTERISK}, - { _T("wxICON_MASK"), wxICON_MASK}, - { _T("wxCENTRE"), wxCENTRE}, - { _T("wxCENTER"), wxCENTRE}, - { _T("wxUSER_COLOURS"), wxUSER_COLOURS}, - { _T("wxVERTICAL_LABEL"), 0}, - { _T("wxHORIZONTAL_LABEL"), 0}, + { T("wxCLEAR"), wxCLEAR}, + { T("wxXOR"), wxXOR}, + { T("wxINVERT("), wxINVERT}, + { T("wxOR_REVERSE"), wxOR_REVERSE}, + { T("wxAND_REVERSE"), wxAND_REVERSE}, + { T("wxCOPY"), wxCOPY}, + { T("wxAND"), wxAND}, + { T("wxAND_INVERT("), wxAND_INVERT}, + { T("wxNO_OP"), wxNO_OP}, + { T("wxNOR"), wxNOR}, + { T("wxEQUIV"), wxEQUIV}, + { T("wxSRC_INVERT("), wxSRC_INVERT}, + { T("wxOR_INVERT("), wxOR_INVERT}, + { T("wxNAND"), wxNAND}, + { T("wxOR"), wxOR}, + { T("wxSET("), wxSET}, + + { T("wxFLOOD_SURFACE"), wxFLOOD_SURFACE}, + { T("wxFLOOD_BORDER"), wxFLOOD_BORDER}, + { T("wxODDEVEN_RULE"), wxODDEVEN_RULE}, + { T("wxWINDING_RULE"), wxWINDING_RULE}, + { T("wxHORIZONTAL"), wxHORIZONTAL}, + { T("wxVERTICAL"), wxVERTICAL}, + { T("wxBOTH"), wxBOTH}, + { T("wxCENTER_FRAME"), wxCENTER_FRAME}, + { T("wxOK"), wxOK}, + { T("wxYES_NO"), wxYES_NO}, + { T("wxCANCEL"), wxCANCEL}, + { T("wxYES"), wxYES}, + { T("wxNO"), wxNO}, + { T("wxICON_EXCLAMATION"), wxICON_EXCLAMATION}, + { T("wxICON_HAND"), wxICON_HAND}, + { T("wxICON_QUESTION"), wxICON_QUESTION}, + { T("wxICON_INFORMATION"), wxICON_INFORMATION}, + { T("wxICON_STOP"), wxICON_STOP}, + { T("wxICON_ASTERISK"), wxICON_ASTERISK}, + { T("wxICON_MASK"), wxICON_MASK}, + { T("wxCENTRE"), wxCENTRE}, + { T("wxCENTER"), wxCENTRE}, + { T("wxUSER_COLOURS"), wxUSER_COLOURS}, + { T("wxVERTICAL_LABEL"), 0}, + { T("wxHORIZONTAL_LABEL"), 0}, // Bitmap types (not strictly styles) - { _T("wxBITMAP_TYPE_XPM"), wxBITMAP_TYPE_XPM}, - { _T("wxBITMAP_TYPE_XBM"), wxBITMAP_TYPE_XBM}, - { _T("wxBITMAP_TYPE_BMP"), wxBITMAP_TYPE_BMP}, - { _T("wxBITMAP_TYPE_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE}, - { _T("wxBITMAP_TYPE_BMP_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE}, - { _T("wxBITMAP_TYPE_GIF"), wxBITMAP_TYPE_GIF}, - { _T("wxBITMAP_TYPE_TIF"), wxBITMAP_TYPE_TIF}, - { _T("wxBITMAP_TYPE_ICO"), wxBITMAP_TYPE_ICO}, - { _T("wxBITMAP_TYPE_ICO_RESOURCE"), wxBITMAP_TYPE_ICO_RESOURCE}, - { _T("wxBITMAP_TYPE_CUR"), wxBITMAP_TYPE_CUR}, - { _T("wxBITMAP_TYPE_CUR_RESOURCE"), wxBITMAP_TYPE_CUR_RESOURCE}, - { _T("wxBITMAP_TYPE_XBM_DATA"), wxBITMAP_TYPE_XBM_DATA}, - { _T("wxBITMAP_TYPE_XPM_DATA"), wxBITMAP_TYPE_XPM_DATA}, - { _T("wxBITMAP_TYPE_ANY"), wxBITMAP_TYPE_ANY} + { T("wxBITMAP_TYPE_XPM"), wxBITMAP_TYPE_XPM}, + { T("wxBITMAP_TYPE_XBM"), wxBITMAP_TYPE_XBM}, + { T("wxBITMAP_TYPE_BMP"), wxBITMAP_TYPE_BMP}, + { T("wxBITMAP_TYPE_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE}, + { T("wxBITMAP_TYPE_BMP_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE}, + { T("wxBITMAP_TYPE_GIF"), wxBITMAP_TYPE_GIF}, + { T("wxBITMAP_TYPE_TIF"), wxBITMAP_TYPE_TIF}, + { T("wxBITMAP_TYPE_ICO"), wxBITMAP_TYPE_ICO}, + { T("wxBITMAP_TYPE_ICO_RESOURCE"), wxBITMAP_TYPE_ICO_RESOURCE}, + { T("wxBITMAP_TYPE_CUR"), wxBITMAP_TYPE_CUR}, + { T("wxBITMAP_TYPE_CUR_RESOURCE"), wxBITMAP_TYPE_CUR_RESOURCE}, + { T("wxBITMAP_TYPE_XBM_DATA"), wxBITMAP_TYPE_XBM_DATA}, + { T("wxBITMAP_TYPE_XPM_DATA"), wxBITMAP_TYPE_XPM_DATA}, + { T("wxBITMAP_TYPE_ANY"), wxBITMAP_TYPE_ANY} }; static int wxResourceBitListCount = (sizeof(wxResourceBitListTable)/sizeof(wxResourceBitListStruct)); @@ -2080,7 +2080,7 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table wxItemResource *item = table->FindResource(resource); if (item) { - if ((item->GetType() == _T("")) || (item->GetType() != _T("wxBitmap"))) + if ((item->GetType() == T("")) || (item->GetType() != T("wxBitmap"))) { wxLogWarning(_("%s not a bitmap resource specification."), (const wxChar*) resource); return wxNullBitmap; @@ -2235,7 +2235,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) wxItemResource *item = table->FindResource(resource); if (item) { - if ((item->GetType() == _T("")) || wxStrcmp(item->GetType(), _T("wxIcon")) != 0) + if ((item->GetType() == T("")) || wxStrcmp(item->GetType(), T("wxIcon")) != 0) { wxLogWarning(_("%s not an icon resource specification."), (const wxChar*) resource); return wxNullIcon; @@ -2393,7 +2393,7 @@ wxMenu *wxResourceCreateMenu(wxItemResource *item) while (node) { wxItemResource *child = (wxItemResource *)node->Data(); - if ((child->GetType() != _T("")) && (child->GetType() == _T("wxMenuSeparator"))) + if ((child->GetType() != T("")) && (child->GetType() == T("wxMenuSeparator"))) menu->AppendSeparator(); else if (child->GetChildren().Number() > 0) { @@ -2416,7 +2416,7 @@ wxMenuBar *wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *ta table = wxDefaultResourceTable; wxItemResource *menuResource = table->FindResource(resource); - if (menuResource && (menuResource->GetType() != _T("")) && (menuResource->GetType() == _T("wxMenu"))) + if (menuResource && (menuResource->GetType() != T("")) && (menuResource->GetType() == T("wxMenu"))) { if (!menuBar) menuBar = new wxMenuBar; @@ -2440,7 +2440,7 @@ wxMenu *wxResourceCreateMenu(const wxString& resource, wxResourceTable *table) table = wxDefaultResourceTable; wxItemResource *menuResource = table->FindResource(resource); - if (menuResource && (menuResource->GetType() != _T("")) && (menuResource->GetType() == _T("wxMenu"))) + if (menuResource && (menuResource->GetType() != T("")) && (menuResource->GetType() == T("wxMenu"))) // if (menuResource && (menuResource->GetType() == wxTYPE_MENU)) return wxResourceCreateMenu(menuResource); return (wxMenu *) NULL; @@ -2863,8 +2863,8 @@ bool wxWindowBase::LoadFromResource(wxWindow *parent, const wxString& resourceNa wxItemResource *resource = table->FindResource((const wxChar *)resourceName); // if (!resource || (resource->GetType() != wxTYPE_DIALOG_BOX)) - if (!resource || (resource->GetType() == _T("")) || - ! ((resource->GetType() == _T("wxDialog")) || (resource->GetType() == _T("wxPanel")))) + if (!resource || (resource->GetType() == T("")) || + ! ((resource->GetType() == T("wxDialog")) || (resource->GetType() == T("wxPanel")))) return FALSE; wxString title(resource->GetTitle()); diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index 5681aaadd7..25d22c56ca 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -103,8 +103,8 @@ wxIPV4address::~wxIPV4address() bool wxIPV4address::Hostname(const wxString& name) { // Some people are sometimes fool. - if (name == _T("")) { - wxLogWarning( _T("Trying to solve a NULL hostname: giving up") ); + if (name == T("")) { + wxLogWarning( T("Trying to solve a NULL hostname: giving up") ); return FALSE; } diff --git a/src/common/sckfile.cpp b/src/common/sckfile.cpp index 7cfb56086c..bdb5681d22 100644 --- a/src/common/sckfile.cpp +++ b/src/common/sckfile.cpp @@ -29,7 +29,7 @@ #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol) -IMPLEMENT_PROTOCOL(wxFileProto, _T("file"), NULL, FALSE) +IMPLEMENT_PROTOCOL(wxFileProto, T("file"), NULL, FALSE) #endif wxFileProto::wxFileProto() diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 5652d901cc..9034bc595b 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -215,7 +215,7 @@ bool wxTCPConnection::Disconnect () return TRUE; } -bool wxTCPConnection::Execute (wxChar *data, int size, wxIPCFormat format) +bool wxTCPConnection::Execute (const wxChar *data, int size, wxIPCFormat format) { if (!m_sock->IsConnected()) return FALSE; diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index c39180d898..48ebd0014b 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -473,7 +473,7 @@ wxSize wxBoxSizer::CalcMin() wxStaticBoxSizer::wxStaticBoxSizer( wxStaticBox *box, int orient ) : wxBoxSizer( orient ) { - wxASSERT_MSG( box, _T("wxStaticBoxSizer needs a static box") ); + wxASSERT_MSG( box, T("wxStaticBoxSizer needs a static box") ); m_staticBox = box; } diff --git a/src/common/socket.cpp b/src/common/socket.cpp index 32689fe50d..f66313eaf1 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -316,7 +316,7 @@ wxSocketBase& wxSocketBase::ReadMsg(char* buffer, wxUint32 nbytes) if (sig != 0xfeeddead) { - wxLogMessage(_T("Warning: invalid signature returned to ReadMsg")); + wxLogMessage(T("Warning: invalid signature returned to ReadMsg")); goto exit; } @@ -374,7 +374,7 @@ wxSocketBase& wxSocketBase::ReadMsg(char* buffer, wxUint32 nbytes) if (sig != 0xdeadfeed) { - //wxLogMessage(_T("Warning: invalid signature returned to ReadMsg")); + //wxLogMessage(T("Warning: invalid signature returned to ReadMsg")); goto exit; } diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index e61b9fd56c..46f51b10a7 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -280,7 +280,7 @@ static void wxLoadCharacterSets(void) #if defined(__UNIX__) && wxUSE_TEXTFILE // search through files in /usr/share/i18n/charmaps wxString fname; - for (fname = ::wxFindFirstFile(_T("/usr/share/i18n/charmaps/*")); + for (fname = ::wxFindFirstFile(T("/usr/share/i18n/charmaps/*")); !fname.IsEmpty(); fname = ::wxFindNextFile()) { wxTextFile cmap(fname); @@ -289,36 +289,36 @@ static void wxLoadCharacterSets(void) wxString comchar,escchar; bool in_charset = FALSE; - // wxFprintf(stderr,_T("Loaded: %s\n"),fname.c_str()); + // wxFprintf(stderr,T("Loaded: %s\n"),fname.c_str()); wxString line; for (line = cmap.GetFirstLine(); !cmap.Eof(); line = cmap.GetNextLine()) { - // wxFprintf(stderr,_T("line contents: %s\n"),line.c_str()); + // wxFprintf(stderr,T("line contents: %s\n"),line.c_str()); wxStringTokenizer token(line); wxString cmd = token.GetNextToken(); if (cmd == comchar) { - if (token.GetNextToken() == _T("alias")) + if (token.GetNextToken() == T("alias")) cset->names.Add(token.GetNextToken()); } - else if (cmd == _T("")) + else if (cmd == T("")) cset->names.Add(token.GetNextToken()); - else if (cmd == _T("")) + else if (cmd == T("")) comchar = token.GetNextToken(); - else if (cmd == _T("")) + else if (cmd == T("")) escchar = token.GetNextToken(); - else if (cmd == _T("")) { + else if (cmd == T("")) { delete cset; cset = (wxCharacterSet *) NULL; break; // we don't support multibyte charsets ourselves (yet) } - else if (cmd == _T("CHARMAP")) { + else if (cmd == T("CHARMAP")) { cset->data = (wchar_t *)calloc(256, sizeof(wchar_t)); in_charset = TRUE; } - else if (cmd == _T("END")) { - if (token.GetNextToken() == _T("CHARMAP")) + else if (cmd == T("END")) { + if (token.GetNextToken() == T("CHARMAP")) in_charset = FALSE; } else if (in_charset) { @@ -330,15 +330,15 @@ static void wxLoadCharacterSets(void) wxString uni = token.GetNextToken(); // skip whitespace again while (wxIsEmpty(uni) && token.HasMoreTokens()) uni = token.GetNextToken(); - if ((hex.Len() > 2) && (wxString(hex.GetChar(0)) == escchar) && (hex.GetChar(1) == _T('x')) && - (uni.Left(2) == _T(" 2) && (wxString(hex.GetChar(0)) == escchar) && (hex.GetChar(1) == T('x')) && + (uni.Left(2) == T("=0) { unsigned long uni1 = ::wxHexToDec(uni.Mid(2,2)); unsigned long uni2 = ::wxHexToDec(uni.Mid(4,2)); cset->data[pos] = (uni1 << 16) | uni2; - // wxFprintf(stderr,_T("char %02x mapped to %04x (%c)\n"),pos,cset->data[pos],cset->data[pos]); + // wxFprintf(stderr,T("char %02x mapped to %04x (%c)\n"),pos,cset->data[pos],cset->data[pos]); } } } @@ -384,15 +384,15 @@ void wxCSConv::SetName(const wxChar *charset) #ifdef __UNIX__ // first, convert the character set name to standard form wxString codeset; - if (wxString(charset,3).CmpNoCase(_T("ISO")) == 0) { + if (wxString(charset,3).CmpNoCase(T("ISO")) == 0) { // make sure it's represented in the standard form: ISO_8859-1 - codeset = _T("ISO_"); + codeset = T("ISO_"); charset += 3; - if ((*charset == _T('-')) || (*charset == _T('_'))) charset++; + if ((*charset == T('-')) || (*charset == T('_'))) charset++; if (wxStrlen(charset)>4) { - if (wxString(charset,4) == _T("8859")) { - codeset << _T("8859-"); - if (*charset == _T('-')) charset++; + if (wxString(charset,4) == T("8859")) { + codeset << T("8859-"); + if (*charset == T('-')) charset++; } } } @@ -406,12 +406,12 @@ void wxCSConv::SetName(const wxChar *charset) void wxCSConv::LoadNow() { -// wxPrintf(_T("Conversion request\n")); +// wxPrintf(T("Conversion request\n")); if (m_deferred) { if (!m_name) { #ifdef __UNIX__ - wxChar *lang = wxGetenv(_T("LANG")); - wxChar *dot = lang ? wxStrchr(lang, _T('.')) : (wxChar *)NULL; + wxChar *lang = wxGetenv(T("LANG")); + wxChar *dot = lang ? wxStrchr(lang, T('.')) : (wxChar *)NULL; if (dot) SetName(dot+1); #endif } diff --git a/src/common/string.cpp b/src/common/string.cpp index baa9fafce3..5782d1374b 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -85,10 +85,10 @@ static const struct { wxStringData data; wxChar dummy; -} g_strEmpty = { {-1, 0, 0}, _T('\0') }; +} g_strEmpty = { {-1, 0, 0}, T('\0') }; // empty C style string: points to 'string data' byte of g_strEmpty -extern const wxChar WXDLLEXPORT *g_szNul = &g_strEmpty.dummy; +extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy; // ---------------------------------------------------------------------------- // conditional compilation @@ -284,7 +284,7 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength) } } -#else +#else // ANSI #if wxUSE_WCHAR_T // from wide string @@ -302,9 +302,9 @@ wxString::wxString(const wchar_t *pwz) Init(); } } -#endif +#endif // wxUSE_WCHAR_T -#endif +#endif // Unicode/ANSI // --------------------------------------------------------------------------- // memory allocation @@ -327,7 +327,7 @@ void wxString::AllocBuffer(size_t nLen) pData->nDataLength = nLen; pData->nAllocLength = nLen + EXTRA_ALLOC; m_pchData = pData->data(); // data starts after wxStringData - m_pchData[nLen] = _T('\0'); + m_pchData[nLen] = T('\0'); } // must be called before changing this string @@ -379,7 +379,7 @@ void wxString::Alloc(size_t nLen) pData->nDataLength = 0; pData->nAllocLength = nLen; m_pchData = pData->data(); // data starts after wxStringData - m_pchData[0u] = _T('\0'); + m_pchData[0u] = T('\0'); } else if ( pData->IsShared() ) { pData->Unlock(); // memory not freed because shared @@ -461,7 +461,7 @@ void wxString::AssignCopy(size_t nSrcLen, const wxChar *pszSrcData) AllocBeforeWrite(nSrcLen); memcpy(m_pchData, pszSrcData, nSrcLen*sizeof(wxChar)); GetStringData()->nDataLength = nSrcLen; - m_pchData[nSrcLen] = _T('\0'); + m_pchData[nSrcLen] = T('\0'); } } @@ -563,7 +563,7 @@ void wxString::ConcatSelf(int nSrcLen, const wxChar *pszSrcData) // fast concatenation - all is done in our buffer memcpy(m_pchData + nLen, pszSrcData, nSrcLen*sizeof(wxChar)); - m_pchData[nNewLen] = _T('\0'); // put terminating '\0' + m_pchData[nNewLen] = T('\0'); // put terminating '\0' GetStringData()->nDataLength = nNewLen; // and fix the length } //else: the string to append was empty @@ -722,7 +722,7 @@ wxString wxString::Left(size_t nCount) const wxString wxString::BeforeFirst(wxChar ch) const { wxString str; - for ( const wxChar *pc = m_pchData; *pc != _T('\0') && *pc != ch; pc++ ) + for ( const wxChar *pc = m_pchData; *pc != T('\0') && *pc != ch; pc++ ) str += *pc; return str; @@ -762,7 +762,7 @@ size_t wxString::Replace(const wxChar *szOld, const wxChar *szNew, bool bReplace wxString strTemp; const wxChar *pCurrent = m_pchData; const wxChar *pSubstr; - while ( *pCurrent != _T('\0') ) { + while ( *pCurrent != T('\0') ) { pSubstr = wxStrstr(pCurrent, szOld); if ( pSubstr == NULL ) { // strTemp is unused if no replacements were made, so avoid the copy @@ -882,7 +882,7 @@ wxString& wxString::Trim(bool bFromRight) psz--; // truncate at trailing space start - *++psz = _T('\0'); + *++psz = T('\0'); GetStringData()->nDataLength = psz - m_pchData; } else @@ -924,7 +924,7 @@ wxString& wxString::Truncate(size_t uiLen) if ( uiLen < Len() ) { CopyBeforeWrite(); - *(m_pchData + uiLen) = _T('\0'); + *(m_pchData + uiLen) = T('\0'); GetStringData()->nDataLength = uiLen; } //else: nothing to do, string is already short enough @@ -958,7 +958,7 @@ int wxString::Find(const wxChar *pszSub) const wxString& wxString::operator<<(int i) { wxString res; - res.Printf(_T("%d"), i); + res.Printf(T("%d"), i); return (*this) << res; } @@ -966,7 +966,7 @@ wxString& wxString::operator<<(int i) wxString& wxString::operator<<(float f) { wxString res; - res.Printf(_T("%f"), f); + res.Printf(T("%f"), f); return (*this) << res; } @@ -974,7 +974,7 @@ wxString& wxString::operator<<(float f) wxString& wxString::operator<<(double d) { wxString res; - res.Printf(_T("%g"), d); + res.Printf(T("%g"), d); return (*this) << res; } @@ -1011,7 +1011,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) Reinit(); for (size_t n = 0; pszFormat[n]; n++) - if (pszFormat[n] == _T('%')) { + if (pszFormat[n] == T('%')) { static char s_szFlags[256] = "%"; size_t flagofs = 1; bool adj_left = FALSE, in_prec = FALSE, @@ -1021,55 +1021,55 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) do { #define CHECK_PREC if (in_prec && !prec_dot) { s_szFlags[flagofs++] = '.'; prec_dot = TRUE; } switch (pszFormat[++n]) { - case _T('\0'): + case T('\0'): done = TRUE; break; - case _T('%'): - *this += _T('%'); + case T('%'): + *this += T('%'); done = TRUE; break; - case _T('#'): - case _T('0'): - case _T(' '): - case _T('+'): - case _T('\''): + case T('#'): + case T('0'): + case T(' '): + case T('+'): + case T('\''): CHECK_PREC s_szFlags[flagofs++] = pszFormat[n]; break; - case _T('-'): + case T('-'): CHECK_PREC adj_left = TRUE; s_szFlags[flagofs++] = pszFormat[n]; break; - case _T('.'): + case T('.'): CHECK_PREC in_prec = TRUE; prec_dot = FALSE; max_width = 0; // dot will be auto-added to s_szFlags if non-negative number follows break; - case _T('h'): + case T('h'): ilen = -1; CHECK_PREC s_szFlags[flagofs++] = pszFormat[n]; break; - case _T('l'): + case T('l'): ilen = 1; CHECK_PREC s_szFlags[flagofs++] = pszFormat[n]; break; - case _T('q'): - case _T('L'): + case T('q'): + case T('L'): ilen = 2; CHECK_PREC s_szFlags[flagofs++] = pszFormat[n]; break; - case _T('Z'): + case T('Z'): ilen = 3; CHECK_PREC s_szFlags[flagofs++] = pszFormat[n]; break; - case _T('*'): + case T('*'): { int len = va_arg(argptr, int); if (in_prec) { @@ -1087,15 +1087,15 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) flagofs += ::sprintf(s_szFlags+flagofs,"%d",len); } break; - case _T('1'): case _T('2'): case _T('3'): - case _T('4'): case _T('5'): case _T('6'): - case _T('7'): case _T('8'): case _T('9'): + case T('1'): case T('2'): case T('3'): + case T('4'): case T('5'): case T('6'): + case T('7'): case T('8'): case T('9'): { int len = 0; CHECK_PREC - while ((pszFormat[n]>=_T('0')) && (pszFormat[n]<=_T('9'))) { + while ((pszFormat[n]>=T('0')) && (pszFormat[n]<=T('9'))) { s_szFlags[flagofs++] = pszFormat[n]; - len = len*10 + (pszFormat[n] - _T('0')); + len = len*10 + (pszFormat[n] - T('0')); n++; } if (in_prec) max_width = len; @@ -1103,12 +1103,12 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) n--; // the main loop pre-increments n again } break; - case _T('d'): - case _T('i'): - case _T('o'): - case _T('u'): - case _T('x'): - case _T('X'): + case T('d'): + case T('i'): + case T('o'): + case T('u'): + case T('x'): + case T('X'): CHECK_PREC s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs] = '\0'; @@ -1140,11 +1140,11 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) *this += wxString(s_szScratch); done = TRUE; break; - case _T('e'): - case _T('E'): - case _T('f'): - case _T('g'): - case _T('G'): + case T('e'): + case T('E'): + case T('f'): + case T('g'): + case T('G'): CHECK_PREC s_szFlags[flagofs++] = pszFormat[n]; s_szFlags[flagofs] = '\0'; @@ -1158,7 +1158,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) *this += wxString(s_szScratch); done = TRUE; break; - case _T('p'): + case T('p'): { void *val = va_arg(argptr, void *); CHECK_PREC @@ -1169,7 +1169,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) done = TRUE; } break; - case _T('c'): + case T('c'): { wxChar val = va_arg(argptr, int); // we don't need to honor padding here, do we? @@ -1177,7 +1177,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) done = TRUE; } break; - case _T('s'): + case T('s'): if (ilen == -1) { // wx extension: we'll let %hs mean non-Unicode strings char *val = va_arg(argptr, char *); @@ -1188,26 +1188,26 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) size_t len = wxSTRING_MAXLEN; if (val) { for (len = 0; val[len] && (lenGetC(); if (!m_input) return (wxChar) 0; - if (c != _T('\n') && - c != _T('\r') && - c != _T('\t') && - c != _T(' ')) + if (c != T('\n') && + c != T('\r') && + c != T('\t') && + c != T(' ')) { return c; } @@ -70,20 +70,20 @@ wxChar wxTextInputStream::NextNonWhiteSpace() void wxTextInputStream::SkipIfEndOfLine( wxChar c ) { - if (c == _T('\n')) + if (c == T('\n')) { // eat on UNIX return; } - if (c == _T('\r')) + if (c == T('\r')) { // eat on both Mac and DOS wxChar c2 = m_input->GetC(); if (!m_input) return; - if (c2 == _T('\n')) + if (c2 == T('\n')) { // eat on DOS return; @@ -111,18 +111,18 @@ wxUint32 wxTextInputStream::Read32() if (!m_input) return 0; i = 0; - if (! (c == _T('-') || c == _T('+') || isdigit(c)) ) + if (! (c == T('-') || c == T('+') || isdigit(c)) ) { m_input->Ungetch(c); return 0; } - if (c == _T('-')) + if (c == T('-')) { sign = -1; c = m_input->GetC(); } else - if (c == _T('+')) + if (c == T('+')) { sign = 1; c = m_input->GetC(); @@ -133,7 +133,7 @@ wxUint32 wxTextInputStream::Read32() while (isdigit(c)) { - i = i*10 + (c - (int)_T('0')); + i = i*10 + (c - (int)T('0')); c = m_input->GetC(); } @@ -164,18 +164,18 @@ double wxTextInputStream::ReadDouble() if (!m_input) return 0.0; f = 0.0; - if (! (c == _T('.') || c == _T('-') || c == _T('+') || isdigit(c)) ) + if (! (c == T('.') || c == T('-') || c == T('+') || isdigit(c)) ) { m_input->Ungetch(c); return 0.0; } - if (c == _T('-')) + if (c == T('-')) { sign = -1; c = m_input->GetC(); } else - if (c == _T('+')) + if (c == T('+')) { sign = 1; c = m_input->GetC(); @@ -187,11 +187,11 @@ double wxTextInputStream::ReadDouble() while (isdigit(c)) { - f = f*10 + (c - _T('0')); + f = f*10 + (c - T('0')); c = m_input->GetC(); } - if (c == _T('.')) + if (c == T('.')) { double f_multiplicator = (double) 0.1; @@ -199,12 +199,12 @@ double wxTextInputStream::ReadDouble() while (isdigit(c)) { - f += (c-_T('0'))*f_multiplicator; + f += (c-T('0'))*f_multiplicator; f_multiplicator /= 10; c = m_input->GetC(); } - if (c == _T('e')) + if (c == T('e')) { double f_multiplicator = 0.0; int i, e; @@ -213,8 +213,8 @@ double wxTextInputStream::ReadDouble() switch (c) { - case _T('-'): f_multiplicator = 0.1; break; - case _T('+'): f_multiplicator = 10.0; break; + case T('-'): f_multiplicator = 0.1; break; + case T('+'): f_multiplicator = 10.0; break; } e = Read8(); // why only max 256 ? @@ -245,20 +245,20 @@ wxString wxTextInputStream::ReadString() c = m_input->GetC(); if (!m_input) break; - if (c == _T('\n')) + if (c == T('\n')) { // eat on UNIX break; } - if (c == _T('\r')) + if (c == T('\r')) { // eat on both Mac and DOS wxChar c2 = m_input->GetC(); if (!m_input) break; - if (c2 == _T('\n')) + if (c2 == T('\n')) { // eat on DOS break; @@ -292,13 +292,13 @@ wxTextInputStream& wxTextInputStream::operator>>(wxChar& c) return *this; } - if (c1 == _T('\r')) + if (c1 == T('\r')) { - c = _T('\n'); + c = T('\n'); wxChar c2 = m_input->GetC(); if (!m_input) return *this; - if (c2 != _T('\n')) + if (c2 != T('\n')) { // we are on a Mac m_input->Ungetch( c2 ); @@ -360,7 +360,7 @@ wxTextOutputStream::~wxTextOutputStream() void wxTextOutputStream::Write32(wxUint32 i) { wxString str; - str.Printf(_T("%u"), i); + str.Printf(T("%u"), i); WriteString(str); } @@ -368,7 +368,7 @@ void wxTextOutputStream::Write32(wxUint32 i) void wxTextOutputStream::Write16(wxUint16 i) { wxString str; - str.Printf(_T("%u"), i); + str.Printf(T("%u"), i); WriteString(str); } @@ -376,7 +376,7 @@ void wxTextOutputStream::Write16(wxUint16 i) void wxTextOutputStream::Write8(wxUint8 i) { wxString str; - str.Printf(_T("%u"), i); + str.Printf(T("%u"), i); WriteString(str); } @@ -385,7 +385,7 @@ void wxTextOutputStream::WriteDouble(double d) { wxString str; - str.Printf(_T("%f"), d); + str.Printf(T("%f"), d); WriteString(str); } @@ -394,23 +394,23 @@ void wxTextOutputStream::WriteString(const wxString& string) for (size_t i = 0; i < string.Len(); i++) { wxChar c = string[i]; - if (c == _T('\n')) + if (c == T('\n')) { #if defined(__WINDOWS__) - c = _T('\r'); + c = T('\r'); m_output->Write( (const void*)(&c), sizeof(wxChar) ); - c = _T('\n'); + c = T('\n'); m_output->Write( (const void*)(&c), sizeof(wxChar) ); #elif defined(__UNIX__) - c = _T('\n'); + c = T('\n'); m_output->Write( (const void*)(&c), sizeof(wxChar) ); #elif defined(__WXMAC__) - c = _T('\r'); + c = T('\r'); m_output->Write( (const void*)(&c), sizeof(wxChar) ); #elif defined(__OS2__) - c = _T('\r'); + c = T('\r'); m_output->Write( (const void*)(&c), sizeof(wxChar) ); - c = _T('\n'); + c = T('\n'); m_output->Write( (const void*)(&c), sizeof(wxChar) ); #else #error "wxTextOutputStream: unsupported platform." @@ -479,7 +479,7 @@ wxTextOutputStream& wxTextOutputStream::operator<<(float f) wxTextOutputStream &endl( wxTextOutputStream &stream ) { - return stream << _T('\n'); + return stream << T('\n'); } #endif diff --git a/src/common/url.cpp b/src/common/url.cpp index 1e142f1ef1..aba9e7a5b5 100644 --- a/src/common/url.cpp +++ b/src/common/url.cpp @@ -105,9 +105,9 @@ bool wxURL::ParseURL() CleanData(); // Third, we rebuild the URL. - m_url = m_protoname + _T(":"); + m_url = m_protoname + T(":"); if (m_protoinfo->m_needhost) - m_url = m_url + _T("//") + m_hostname; + m_url = m_url + T("//") + m_hostname; m_url += m_path; @@ -146,7 +146,7 @@ bool wxURL::PrepProto(wxString& url) int pos; // Find end - pos = url.Find(_T(':')); + pos = url.Find(T(':')); if (pos == -1) return FALSE; @@ -167,7 +167,7 @@ bool wxURL::PrepHost(wxString& url) url = url(2, url.Length()); - pos = url.Find(_T('/')); + pos = url.Find(T('/')); if (pos == -1) pos = url.Length(); @@ -175,10 +175,10 @@ bool wxURL::PrepHost(wxString& url) return FALSE; temp_url = url(0, pos); - url = url(url.Find(_T('/')), url.Length()); + url = url(url.Find(T('/')), url.Length()); // Retrieve service number - pos2 = temp_url.Find(_T(':'), TRUE); + pos2 = temp_url.Find(T(':'), TRUE); if (pos2 != -1 && pos2 < pos) { m_servname = temp_url(pos2+1, pos); if (!m_servname.IsNumber()) @@ -187,18 +187,18 @@ bool wxURL::PrepHost(wxString& url) } // Retrieve user and password. - pos2 = temp_url.Find(_T('@')); + pos2 = temp_url.Find(T('@')); // Even if pos2 equals -1, this code is right. m_hostname = temp_url(pos2+1, temp_url.Length()); - m_user = _T(""); - m_password = _T(""); + m_user = T(""); + m_password = T(""); if (pos2 == -1) return TRUE; temp_url = temp_url(0, pos2); - pos2 = temp_url.Find(_T(':')); + pos2 = temp_url.Find(T(':')); if (pos2 == -1) return FALSE; @@ -214,7 +214,7 @@ bool wxURL::PrepPath(wxString& url) if (url.Length() != 0) m_path = ConvertToValidURI(url); else - m_path = _T("/"); + m_path = T("/"); return TRUE; } @@ -250,7 +250,7 @@ wxInputStream *wxURL::GetInputStream(void) } m_error = wxURL_NOERR; - if (m_user != _T("")) { + if (m_user != T("")) { m_protocol->SetUser(m_user); m_protocol->SetPassword(m_password); } @@ -300,7 +300,7 @@ void wxURL::SetDefaultProxy(const wxString& url_proxy) } wxString tmp_str = url_proxy; - int pos = tmp_str.Find(_T(':')); + int pos = tmp_str.Find(T(':')); if (pos == -1) return; @@ -338,7 +338,7 @@ void wxURL::SetProxy(const wxString& url_proxy) wxIPV4address addr; tmp_str = url_proxy; - pos = tmp_str.Find(_T(':')); + pos = tmp_str.Find(T(':')); // This is an invalid proxy name. if (pos == -1) return; @@ -371,11 +371,11 @@ wxString wxURL::ConvertToValidURI(const wxString& uri) for (i=0;i= _T('A') && uri[i] <= _T('F')) - code = (uri[i] - _T('A') + 10) * 16; + if (uri[i] >= T('A') && uri[i] <= T('F')) + code = (uri[i] - T('A') + 10) * 16; else - code = (uri[i] - _T('0')) * 16; + code = (uri[i] - T('0')) * 16; i++; - if (uri[i] >= _T('A') && uri[i] <= _T('F')) - code += (uri[i] - _T('A')) + 10; + if (uri[i] >= T('A') && uri[i] <= T('F')) + code += (uri[i] - T('A')) + 10; else - code += (uri[i] - _T('0')); + code += (uri[i] - T('0')); i++; new_uri += (wxChar)code; continue; diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 08eed2a299..f41b535fca 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -9,47 +9,62 @@ // Licence: wxWindows license ///////////////////////////////////////////////////////////////////////////// +// ============================================================================ +// declarations +// ============================================================================ + +// ---------------------------------------------------------------------------- +// headers +// ---------------------------------------------------------------------------- + #ifdef __GNUG__ -#pragma implementation "utils.h" + #pragma implementation "utils.h" #endif // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ -#pragma hdrstop + #pragma hdrstop #endif #ifndef WX_PRECOMP -#include "wx/defs.h" -#include "wx/utils.h" -#include "wx/window.h" -#include "wx/menu.h" -#include "wx/frame.h" -#include "wx/msgdlg.h" -#include "wx/textdlg.h" -#endif + #include "wx/defs.h" + #include "wx/string.h" + #include "wx/utils.h" + + #if wxUSE_GUI + #include "wx/window.h" + #include "wx/menu.h" + #include "wx/frame.h" + #include "wx/msgdlg.h" + #include "wx/textdlg.h" + #endif // wxUSE_GUI +#endif // WX_PRECOMP #include #include #include #include + #if !defined(__WATCOMC__) #if !(defined(_MSC_VER) && (_MSC_VER > 800)) #include #endif #endif + #include + #ifndef __MWERKS__ -#include -#include + #include + #include #endif #ifdef __SALFORDC__ -#include + #include #endif -// Pattern matching code. +// Pattern matching code. (FIXME) // Yes, this path is deliberate (for Borland compilation) #ifdef wx_mac /* MATTHEW: [5] Mac doesn't like paths with "/" */ #include "glob.inc" @@ -58,20 +73,26 @@ #endif #ifdef __WXMSW__ -#include "windows.h" + #include "windows.h" #endif -#define _MAXPATHLEN 500 +// ---------------------------------------------------------------------------- +// function protoypes +// ---------------------------------------------------------------------------- + +#if wxUSE_GUI + static wxWindow *wxFindWindowByLabel1(const wxString& title, wxWindow *parent); + static wxWindow *wxFindWindowByName1 (const wxString& title, wxWindow *parent); +#endif // wxUSE_GUI -extern wxChar *wxBuffer; +// ============================================================================ +// implementation +// ============================================================================ // ---------------------------------------------------------------------------- -// private functions +// string functions // ---------------------------------------------------------------------------- -static wxWindow *wxFindWindowByLabel1(const wxString& title, wxWindow * parent); -static wxWindow *wxFindWindowByName1 (const wxString& title, wxWindow * parent); - #ifdef __WXMAC__ int strcasecmp(const char *str_1, const char *str_2) { @@ -101,7 +122,8 @@ int strncasecmp(const char *str_1, const char *str_2, size_t maxchar) return 0 ; } -#endif +#endif // wxMAC + #ifdef __VMS__ // we have no strI functions under VMS, therefore I have implemented // an inefficient but portable version: convert copies of strings to lowercase @@ -145,7 +167,7 @@ int strncasecmp(const char *str_1, const char *str_2, size_t maxchar) return(result); } -#endif +#endif // __VMS__ #ifdef __WINDOWS__ @@ -185,7 +207,7 @@ extern "C" wxChar * copystring (const wxChar *s) { - if (s == NULL) s = _T(""); + if (s == NULL) s = T(""); size_t len = wxStrlen (s) + 1; wxChar *news = new wxChar[len]; @@ -265,7 +287,7 @@ IntToString (int number) { static wxChar buf[20]; - wxSprintf (buf, _T("%d"), number); + wxSprintf (buf, T("%d"), number); return buf; } @@ -274,27 +296,27 @@ LongToString (long number) { static wxChar buf[20]; - wxSprintf (buf, _T("%ld"), number); + wxSprintf (buf, T("%ld"), number); return buf; } // Array used in DecToHex conversion routine. -static wxChar hexArray[] = _T("0123456789ABCDEF"); +static wxChar hexArray[] = T("0123456789ABCDEF"); // Convert 2-digit hex number to decimal int wxHexToDec(const wxString& buf) { int firstDigit, secondDigit; - if (buf.GetChar(0) >= _T('A')) - firstDigit = buf.GetChar(0) - _T('A') + 10; + if (buf.GetChar(0) >= T('A')) + firstDigit = buf.GetChar(0) - T('A') + 10; else - firstDigit = buf.GetChar(0) - _T('0'); + firstDigit = buf.GetChar(0) - T('0'); - if (buf.GetChar(1) >= _T('A')) - secondDigit = buf.GetChar(1) - _T('A') + 10; + if (buf.GetChar(1) >= T('A')) + secondDigit = buf.GetChar(1) - T('A') + 10; else - secondDigit = buf.GetChar(1) - _T('0'); + secondDigit = buf.GetChar(1) - T('0'); return firstDigit * 16 + secondDigit; } @@ -357,19 +379,9 @@ StringMatch (char *str1, char *str2, bool subString, bool exact) return FALSE; } -// Don't synthesize KeyUp events holding down a key and producing -// KeyDown events with autorepeat. On by default and always on -// on in wxMSW. wxGTK version in utilsgtk.cpp. -#ifndef __WXGTK__ -bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) ) -{ - return TRUE; // detectable auto-repeat is the only mode MSW supports -} -#endif - // Return the current date/time // [volatile] -wxString wxNow( void ) +wxString wxNow() { time_t now = time((time_t *) NULL); char *date = ctime(&now); @@ -377,9 +389,11 @@ wxString wxNow( void ) return wxString(date); } -/* - * Strip out any menu codes - */ +#if wxUSE_GUI + +// ---------------------------------------------------------------------------- +// Strip out any menu codes +// ---------------------------------------------------------------------------- wxChar *wxStripMenuCodes (wxChar *in, wxChar *out) { @@ -393,13 +407,13 @@ wxChar *wxStripMenuCodes (wxChar *in, wxChar *out) while (*in) { - if (*in == _T('&')) + if (*in == T('&')) { // Check && -> &, &x -> x - if (*++in == _T('&')) + if (*++in == T('&')) *out++ = *in++; } - else if (*in == _T('\t')) + else if (*in == T('\t')) { // Remove all stuff after \t in X mode, and let the stuff as is // in Windows mode. @@ -411,7 +425,7 @@ wxChar *wxStripMenuCodes (wxChar *in, wxChar *out) *out++ = *in++; } // while - *out = _T('\0'); + *out = T('\0'); return tmpOut; } @@ -425,10 +439,9 @@ wxString wxStripMenuCodes(const wxString& str) return str1; } -/* - * Window search functions - * - */ +// ---------------------------------------------------------------------------- +// Window search functions +// ---------------------------------------------------------------------------- /* * If parent is non-NULL, look through children for a label or title @@ -553,6 +566,8 @@ wxFindMenuItemId (wxFrame * frame, const wxString& menuString, const wxString& i return menuBar->FindMenuItem (menuString, itemString); } +#endif // wxUSE_GUI + /* On Fri, 21 Jul 1995, Paul Craven wrote: @@ -745,24 +760,12 @@ whereami(name) } #endif -void wxEnableTopLevelWindows(bool enable) -{ - wxWindowList::Node *node; - for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() ) - node->GetData()->Enable(enable); -} -// Yield to other apps/messages and disable user input -bool wxSafeYield(wxWindow *win) -{ - wxEnableTopLevelWindows(FALSE); - // always enable ourselves - if ( win ) - win->Enable(TRUE); - bool rc = wxYield(); - wxEnableTopLevelWindows(TRUE); - return rc; -} +#if wxUSE_GUI + +// ---------------------------------------------------------------------------- +// GUI helpers +// ---------------------------------------------------------------------------- /* * N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp @@ -817,7 +820,42 @@ int isascii( int c ) { return ( c >= 0 && c < 128 ) ; } -#endif +#endif // __MWERKS__ + +// ---------------------------------------------------------------------------- +// misc functions +// ---------------------------------------------------------------------------- + +void wxEnableTopLevelWindows(bool enable) +{ + wxWindowList::Node *node; + for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() ) + node->GetData()->Enable(enable); +} + +// Yield to other apps/messages and disable user input +bool wxSafeYield(wxWindow *win) +{ + wxEnableTopLevelWindows(FALSE); + // always enable ourselves + if ( win ) + win->Enable(TRUE); + bool rc = wxYield(); + wxEnableTopLevelWindows(TRUE); + return rc; +} + +// Don't synthesize KeyUp events holding down a key and producing KeyDown +// events with autorepeat. On by default and always on in wxMSW. wxGTK version +// in utilsgtk.cpp. +#ifndef __WXGTK__ +bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) ) +{ + return TRUE; // detectable auto-repeat is the only mode MSW supports +} +#endif // !wxGTK + +#endif // wxUSE_GUI // ---------------------------------------------------------------------------- // network and user id functions @@ -831,7 +869,7 @@ bool wxGetEmailAddress(wxChar *address, int maxSize) return FALSE; wxStrncpy(address, email, maxSize - 1); - address[maxSize - 1] = _T('\0'); + address[maxSize - 1] = T('\0'); return TRUE; } @@ -847,7 +885,7 @@ wxString wxGetEmailAddress() if ( !!user ) { wxString email(user); - email << _T('@') << host; + email << T('@') << host; } } diff --git a/src/common/variant.cpp b/src/common/variant.cpp index 5b7126fd5e..c743090cc6 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -63,7 +63,7 @@ public: virtual bool Read(istream& str); #endif virtual bool Read(wxString& str); - virtual wxString GetType() const { return _T("list"); }; + virtual wxString GetType() const { return T("list"); }; void Clear(); @@ -109,7 +109,7 @@ void wxVariantDataList::Clear() void wxVariantDataList::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("list")), _T("wxVariantDataList::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("list")), T("wxVariantDataList::Copy: Can't copy to this type of data") ); wxVariantDataList& listData = (wxVariantDataList&) data; @@ -125,7 +125,7 @@ void wxVariantDataList::Copy(wxVariantData& data) bool wxVariantDataList::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("list")), _T("wxVariantDataList::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("list")), T("wxVariantDataList::Eq: argument mismatch") ); wxVariantDataList& listData = (wxVariantDataList&) data; wxNode* node1 = m_value.First(); @@ -155,13 +155,13 @@ bool wxVariantDataList::Write(ostream& str) const bool wxVariantDataList::Write(wxString& str) const { - str = _T(""); + str = T(""); wxNode* node = m_value.First(); while (node) { wxVariant* var = (wxVariant*) node->Data(); if (node != m_value.First()) - str += _T(" "); + str += T(" "); wxString str1; str += var->MakeString(); node = node->Next(); @@ -173,7 +173,7 @@ bool wxVariantDataList::Write(wxString& str) const #if wxUSE_STD_IOSTREAM bool wxVariantDataList::Read(istream& WXUNUSED(str)) { - wxFAIL_MSG(_T("Unimplemented")); + wxFAIL_MSG(T("Unimplemented")); // TODO return FALSE; } @@ -181,7 +181,7 @@ bool wxVariantDataList::Read(istream& WXUNUSED(str)) bool wxVariantDataList::Read(wxString& WXUNUSED(str)) { - wxFAIL_MSG(_T("Unimplemented")); + wxFAIL_MSG(T("Unimplemented")); // TODO return FALSE; } @@ -210,7 +210,7 @@ public: virtual bool Read(istream& str); #endif virtual bool Read(wxString& str); - virtual wxString GetType() const { return _T("stringlist"); }; + virtual wxString GetType() const { return T("stringlist"); }; protected: wxStringList m_value; @@ -225,7 +225,7 @@ void wxVariantDataStringList::SetValue(const wxStringList& value) void wxVariantDataStringList::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("stringlist")), _T("wxVariantDataStringList::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("stringlist")), T("wxVariantDataStringList::Copy: Can't copy to this type of data") ); wxVariantDataStringList& listData = (wxVariantDataStringList&) data; @@ -234,7 +234,7 @@ void wxVariantDataStringList::Copy(wxVariantData& data) bool wxVariantDataStringList::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("stringlist")), _T("wxVariantDataStringList::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("stringlist")), T("wxVariantDataStringList::Eq: argument mismatch") ); wxVariantDataStringList& listData = (wxVariantDataStringList&) data; wxNode* node1 = m_value.First(); @@ -264,13 +264,13 @@ bool wxVariantDataStringList::Write(ostream& str) const bool wxVariantDataStringList::Write(wxString& str) const { - str = _T(""); + str = T(""); wxNode* node = m_value.First(); while (node) { wxChar* s = (wxChar*) node->Data(); if (node != m_value.First()) - str += _T(" "); + str += T(" "); str += s; node = node->Next(); } @@ -281,7 +281,7 @@ bool wxVariantDataStringList::Write(wxString& str) const #if wxUSE_STD_IOSTREAM bool wxVariantDataStringList::Read(istream& WXUNUSED(str)) { - wxFAIL_MSG(_T("Unimplemented")); + wxFAIL_MSG(T("Unimplemented")); // TODO return FALSE; } @@ -289,7 +289,7 @@ bool wxVariantDataStringList::Read(istream& WXUNUSED(str)) bool wxVariantDataStringList::Read(wxString& WXUNUSED(str)) { - wxFAIL_MSG(_T("Unimplemented")); + wxFAIL_MSG(T("Unimplemented")); // TODO return FALSE; } @@ -322,7 +322,7 @@ public: virtual bool Write(wxOutputStream &str) const; #endif // wxUSE_STREAMS - virtual wxString GetType() const { return _T("long"); }; + virtual wxString GetType() const { return T("long"); }; protected: long m_value; @@ -332,7 +332,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataLong, wxVariantData) void wxVariantDataLong::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("long")), _T("wxVariantDataLong::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("long")), T("wxVariantDataLong::Copy: Can't copy to this type of data") ); wxVariantDataLong& otherData = (wxVariantDataLong&) data; @@ -341,7 +341,7 @@ void wxVariantDataLong::Copy(wxVariantData& data) bool wxVariantDataLong::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("long")), _T("wxVariantDataLong::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("long")), T("wxVariantDataLong::Eq: argument mismatch") ); wxVariantDataLong& otherData = (wxVariantDataLong&) data; @@ -360,7 +360,7 @@ bool wxVariantDataLong::Write(ostream& str) const bool wxVariantDataLong::Write(wxString& str) const { - str.Printf(_T("%ld"), m_value); + str.Printf(T("%ld"), m_value); return TRUE; } @@ -423,7 +423,7 @@ public: virtual bool Read(wxInputStream& str); virtual bool Write(wxOutputStream &str) const; #endif // wxUSE_STREAMS - virtual wxString GetType() const { return _T("double"); }; + virtual wxString GetType() const { return T("double"); }; protected: double m_value; @@ -433,7 +433,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataReal, wxVariantData) void wxVariantDataReal::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("double")), _T("wxVariantDataReal::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("double")), T("wxVariantDataReal::Copy: Can't copy to this type of data") ); wxVariantDataReal& otherData = (wxVariantDataReal&) data; @@ -442,7 +442,7 @@ void wxVariantDataReal::Copy(wxVariantData& data) bool wxVariantDataReal::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("double")), _T("wxVariantDataReal::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("double")), T("wxVariantDataReal::Eq: argument mismatch") ); wxVariantDataReal& otherData = (wxVariantDataReal&) data; @@ -461,7 +461,7 @@ bool wxVariantDataReal::Write(ostream& str) const bool wxVariantDataReal::Write(wxString& str) const { - str.Printf(_T("%.4f"), m_value); + str.Printf(T("%.4f"), m_value); return TRUE; } @@ -524,7 +524,7 @@ public: virtual bool Read(wxInputStream& str); virtual bool Write(wxOutputStream& str) const; #endif // wxUSE_STREAMS - virtual wxString GetType() const { return _T("bool"); }; + virtual wxString GetType() const { return T("bool"); }; protected: bool m_value; @@ -534,7 +534,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataBool, wxVariantData) void wxVariantDataBool::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("bool")), _T("wxVariantDataBool::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("bool")), T("wxVariantDataBool::Copy: Can't copy to this type of data") ); wxVariantDataBool& otherData = (wxVariantDataBool&) data; @@ -543,7 +543,7 @@ void wxVariantDataBool::Copy(wxVariantData& data) bool wxVariantDataBool::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("bool")), _T("wxVariantDataBool::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("bool")), T("wxVariantDataBool::Eq: argument mismatch") ); wxVariantDataBool& otherData = (wxVariantDataBool&) data; @@ -562,14 +562,14 @@ bool wxVariantDataBool::Write(ostream& str) const bool wxVariantDataBool::Write(wxString& str) const { - str.Printf(_T("%d"), (int) m_value); + str.Printf(T("%d"), (int) m_value); return TRUE; } #if wxUSE_STD_IOSTREAM bool wxVariantDataBool::Read(istream& WXUNUSED(str)) { - wxFAIL_MSG(_T("Unimplemented")); + wxFAIL_MSG(T("Unimplemented")); // str >> (long) m_value; return FALSE; } @@ -626,7 +626,7 @@ public: virtual bool Read(wxInputStream& str); virtual bool Write(wxOutputStream& str) const; #endif // wxUSE_STREAMS - virtual wxString GetType() const { return _T("char"); }; + virtual wxString GetType() const { return T("char"); }; protected: char m_value; @@ -636,7 +636,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataChar, wxVariantData) void wxVariantDataChar::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("char")), _T("wxVariantDataChar::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("char")), T("wxVariantDataChar::Copy: Can't copy to this type of data") ); wxVariantDataChar& otherData = (wxVariantDataChar&) data; @@ -645,7 +645,7 @@ void wxVariantDataChar::Copy(wxVariantData& data) bool wxVariantDataChar::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("char")), _T("wxVariantDataChar::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("char")), T("wxVariantDataChar::Eq: argument mismatch") ); wxVariantDataChar& otherData = (wxVariantDataChar&) data; @@ -664,14 +664,14 @@ bool wxVariantDataChar::Write(ostream& str) const bool wxVariantDataChar::Write(wxString& str) const { - str.Printf(_T("%c"), m_value); + str.Printf(T("%c"), m_value); return TRUE; } #if wxUSE_STD_IOSTREAM bool wxVariantDataChar::Read(istream& WXUNUSED(str)) { - wxFAIL_MSG(_T("Unimplemented")); + wxFAIL_MSG(T("Unimplemented")); // str >> m_value; return FALSE; } @@ -738,7 +738,7 @@ public: virtual bool Read(wxInputStream& str); virtual bool Write(wxOutputStream& str) const; #endif // wxUSE_STREAMS - virtual wxString GetType() const { return _T("string"); }; + virtual wxString GetType() const { return T("string"); }; protected: wxString m_value; @@ -746,7 +746,7 @@ protected: void wxVariantDataString::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("string")), _T("wxVariantDataString::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("string")), T("wxVariantDataString::Copy: Can't copy to this type of data") ); wxVariantDataString& otherData = (wxVariantDataString&) data; @@ -755,7 +755,7 @@ void wxVariantDataString::Copy(wxVariantData& data) bool wxVariantDataString::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("string")), _T("wxVariantDataString::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("string")), T("wxVariantDataString::Eq: argument mismatch") ); wxVariantDataString& otherData = (wxVariantDataString&) data; @@ -840,7 +840,7 @@ public: virtual bool Read(istream& str); #endif virtual bool Read(wxString& str); - virtual wxString GetType() const { return _T("time"); }; + virtual wxString GetType() const { return T("time"); }; virtual wxVariantData* Clone() { return new wxVariantDataTime; } protected: @@ -851,7 +851,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataTime, wxVariantData) void wxVariantDataTime::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("time")), _T("wxVariantDataTime::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("time")), T("wxVariantDataTime::Copy: Can't copy to this type of data") ); wxVariantDataTime& otherData = (wxVariantDataTime&) data; @@ -860,7 +860,7 @@ void wxVariantDataTime::Copy(wxVariantData& data) bool wxVariantDataTime::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("time")), _T("wxVariantDataTime::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("time")), T("wxVariantDataTime::Eq: argument mismatch") ); wxVariantDataTime& otherData = (wxVariantDataTime&) data; @@ -922,7 +922,7 @@ public: virtual bool Read(istream& str); #endif virtual bool Read(wxString& str); - virtual wxString GetType() const { return _T("date"); }; + virtual wxString GetType() const { return T("date"); }; virtual wxVariantData* Clone() { return new wxVariantDataDate; } protected: @@ -933,7 +933,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataDate, wxVariantData) void wxVariantDataDate::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("date")), _T("wxVariantDataDate::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("date")), T("wxVariantDataDate::Copy: Can't copy to this type of data") ); wxVariantDataDate& otherData = (wxVariantDataDate&) data; @@ -942,7 +942,7 @@ void wxVariantDataDate::Copy(wxVariantData& data) bool wxVariantDataDate::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("date")), _T("wxVariantDataDate::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("date")), T("wxVariantDataDate::Eq: argument mismatch") ); wxVariantDataDate& otherData = (wxVariantDataDate&) data; @@ -1005,7 +1005,7 @@ public: virtual bool Read(istream& str); #endif virtual bool Read(wxString& str); - virtual wxString GetType() const { return _T("void*"); }; + virtual wxString GetType() const { return T("void*"); }; virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; } protected: @@ -1016,7 +1016,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxVariantDataVoidPtr, wxVariantData) void wxVariantDataVoidPtr::Copy(wxVariantData& data) { - wxASSERT_MSG( (data.GetType() == _T("void*")), _T("wxVariantDataVoidPtr::Copy: Can't copy to this type of data") ); + wxASSERT_MSG( (data.GetType() == T("void*")), T("wxVariantDataVoidPtr::Copy: Can't copy to this type of data") ); wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data; @@ -1025,7 +1025,7 @@ void wxVariantDataVoidPtr::Copy(wxVariantData& data) bool wxVariantDataVoidPtr::Eq(wxVariantData& data) const { - wxASSERT_MSG( (data.GetType() == _T("void*")), _T("wxVariantDataVoidPtr::Eq: argument mismatch") ); + wxASSERT_MSG( (data.GetType() == T("void*")), T("wxVariantDataVoidPtr::Eq: argument mismatch") ); wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data; @@ -1044,7 +1044,7 @@ bool wxVariantDataVoidPtr::Write(ostream& str) const bool wxVariantDataVoidPtr::Write(wxString& str) const { - str.Printf(_T("%ld"), (long) m_value); + str.Printf(T("%ld"), (long) m_value); return TRUE; } @@ -1235,7 +1235,7 @@ bool wxVariant::operator!= (double value) const void wxVariant::operator= (double value) { - if (GetType() == _T("double")) + if (GetType() == T("double")) { ((wxVariantDataReal*)GetData())->SetValue(value); } @@ -1263,7 +1263,7 @@ bool wxVariant::operator!= (long value) const void wxVariant::operator= (long value) { - if (GetType() == _T("long")) + if (GetType() == T("long")) { ((wxVariantDataLong*)GetData())->SetValue(value); } @@ -1291,7 +1291,7 @@ bool wxVariant::operator!= (char value) const void wxVariant::operator= (char value) { - if (GetType() == _T("char")) + if (GetType() == T("char")) { ((wxVariantDataChar*)GetData())->SetValue(value); } @@ -1320,7 +1320,7 @@ bool wxVariant::operator!= (bool value) const void wxVariant::operator= (bool value) { - if (GetType() == _T("bool")) + if (GetType() == T("bool")) { ((wxVariantDataBool*)GetData())->SetValue(value); } @@ -1349,7 +1349,7 @@ bool wxVariant::operator!= (const wxString& value) const void wxVariant::operator= (const wxString& value) { - if (GetType() == _T("string")) + if (GetType() == T("string")) { ((wxVariantDataString*)GetData())->SetValue(value); } @@ -1363,7 +1363,7 @@ void wxVariant::operator= (const wxString& value) void wxVariant::operator= (const wxChar* value) { - if (GetType() == _T("string")) + if (GetType() == T("string")) { ((wxVariantDataString*)GetData())->SetValue(wxString(value)); } @@ -1377,7 +1377,7 @@ void wxVariant::operator= (const wxChar* value) bool wxVariant::operator== (const wxStringList& value) const { - wxASSERT_MSG( (GetType() == _T("stringlist")), _T("Invalid type for == operator") ); + wxASSERT_MSG( (GetType() == T("stringlist")), T("Invalid type for == operator") ); wxVariantDataStringList other(value); return (m_data->Eq(other)); @@ -1390,7 +1390,7 @@ bool wxVariant::operator!= (const wxStringList& value) const void wxVariant::operator= (const wxStringList& value) { - if (GetType() == _T("stringlist")) + if (GetType() == T("stringlist")) { ((wxVariantDataStringList*)GetData())->SetValue(value); } @@ -1404,7 +1404,7 @@ void wxVariant::operator= (const wxStringList& value) bool wxVariant::operator== (const wxList& value) const { - wxASSERT_MSG( (GetType() == _T("list")), _T("Invalid type for == operator") ); + wxASSERT_MSG( (GetType() == T("list")), T("Invalid type for == operator") ); wxVariantDataList other(value); return (m_data->Eq(other)); @@ -1417,7 +1417,7 @@ bool wxVariant::operator!= (const wxList& value) const void wxVariant::operator= (const wxList& value) { - if (GetType() == _T("list")) + if (GetType() == T("list")) { ((wxVariantDataList*)GetData())->SetValue(value); } @@ -1446,7 +1446,7 @@ bool wxVariant::operator!= (const wxTime& value) const void wxVariant::operator= (const wxTime& value) { - if (GetType() == _T("time")) + if (GetType() == T("time")) { ((wxVariantDataTime*)GetData())->SetValue(value); } @@ -1474,7 +1474,7 @@ bool wxVariant::operator!= (const wxDate& value) const void wxVariant::operator= (const wxDate& value) { - if (GetType() == _T("date")) + if (GetType() == T("date")) { ((wxVariantDataTime*)GetData())->SetValue(value); } @@ -1499,7 +1499,7 @@ bool wxVariant::operator!= (void* value) const void wxVariant::operator= (void* value) { - if (GetType() == _T("void*")) + if (GetType() == T("void*")) { ((wxVariantDataVoidPtr*)GetData())->SetValue(value); } @@ -1514,18 +1514,18 @@ void wxVariant::operator= (void* value) // Treat a list variant as an array wxVariant wxVariant::operator[] (size_t idx) const { - wxASSERT_MSG( (GetType() == _T("list") || GetType() == _T("stringlist")), _T("Invalid type for array operator") ); + wxASSERT_MSG( (GetType() == T("list") || GetType() == T("stringlist")), T("Invalid type for array operator") ); - if (GetType() == _T("list")) + if (GetType() == T("list")) { wxVariantDataList* data = (wxVariantDataList*) m_data; - wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), _T("Invalid index for array") ); + wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), T("Invalid index for array") ); return * (wxVariant*) (data->GetValue().Nth(idx)->Data()); } - else if (GetType() == _T("stringlist")) + else if (GetType() == T("stringlist")) { wxVariantDataStringList* data = (wxVariantDataStringList*) m_data; - wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), _T("Invalid index for array") ); + wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), T("Invalid index for array") ); wxVariant variant( wxString( (wxChar*) (data->GetValue().Nth(idx)->Data()) )); return variant; @@ -1538,10 +1538,10 @@ wxVariant& wxVariant::operator[] (size_t idx) // We can't return a reference to a variant for a string list, since the string // is actually stored as a char*, not a variant. - wxASSERT_MSG( (GetType() == _T("list")), _T("Invalid type for array operator") ); + wxASSERT_MSG( (GetType() == T("list")), T("Invalid type for array operator") ); wxVariantDataList* data = (wxVariantDataList*) m_data; - wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), _T("Invalid index for array") ); + wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), T("Invalid index for array") ); return * (wxVariant*) (data->GetValue().Nth(idx)->Data()); } @@ -1549,14 +1549,14 @@ wxVariant& wxVariant::operator[] (size_t idx) // Return the number of elements in a list int wxVariant::GetCount() const { - wxASSERT_MSG( (GetType() == _T("list") || GetType() == _T("stringlist")), _T("Invalid type for GetCount()") ); + wxASSERT_MSG( (GetType() == T("list") || GetType() == T("stringlist")), T("Invalid type for GetCount()") ); - if (GetType() == _T("list")) + if (GetType() == T("list")) { wxVariantDataList* data = (wxVariantDataList*) m_data; return data->GetValue().Number(); } - else if (GetType() == _T("stringlist")) + else if (GetType() == T("stringlist")) { wxVariantDataStringList* data = (wxVariantDataStringList*) m_data; return data->GetValue().Number(); @@ -1572,7 +1572,7 @@ wxString wxVariant::MakeString() const if (GetData()->Write(str)) return str; } - return wxString(_T("")); + return wxString(T("")); } // Accessors @@ -1589,7 +1589,7 @@ void wxVariant::SetData(wxVariantData* data) wxString wxVariant::GetType() const { if (IsNull()) - return wxString(_T("null")); + return wxString(T("null")); else return m_data->GetType(); } @@ -1609,7 +1609,7 @@ double wxVariant::GetReal() const return value; else { - wxFAIL_MSG(_T("Could not convert to a real number")); + wxFAIL_MSG(T("Could not convert to a real number")); return 0.0; } } @@ -1621,7 +1621,7 @@ long wxVariant::GetInteger() const return value; else { - wxFAIL_MSG(_T("Could not convert to an integer")); + wxFAIL_MSG(T("Could not convert to an integer")); return 0; } } @@ -1633,7 +1633,7 @@ char wxVariant::GetChar() const return value; else { - wxFAIL_MSG(_T("Could not convert to a char")); + wxFAIL_MSG(T("Could not convert to a char")); return 0; } } @@ -1645,7 +1645,7 @@ bool wxVariant::GetBool() const return value; else { - wxFAIL_MSG(_T("Could not convert to a bool")); + wxFAIL_MSG(T("Could not convert to a bool")); return 0; } } @@ -1657,7 +1657,7 @@ wxString wxVariant::GetString() const return value; else { - wxFAIL_MSG(_T("Could not convert to a string")); + wxFAIL_MSG(T("Could not convert to a string")); return wxString(""); } } @@ -1670,7 +1670,7 @@ wxTime wxVariant::GetTime() const return value; else { - wxFAIL_MSG(_T("Could not convert to a time")); + wxFAIL_MSG(T("Could not convert to a time")); return wxTime(); } } @@ -1682,7 +1682,7 @@ wxDate wxVariant::GetDate() const return value; else { - wxFAIL_MSG(_T("Could not convert to a date")); + wxFAIL_MSG(T("Could not convert to a date")); return wxDate(); } } @@ -1690,21 +1690,21 @@ wxDate wxVariant::GetDate() const void* wxVariant::GetVoidPtr() const { - wxASSERT( (GetType() == _T("void*")) ); + wxASSERT( (GetType() == T("void*")) ); return (void*) ((wxVariantDataVoidPtr*) m_data)->GetValue(); } wxList& wxVariant::GetList() const { - wxASSERT( (GetType() == _T("list")) ); + wxASSERT( (GetType() == T("list")) ); return (wxList&) ((wxVariantDataList*) m_data)->GetValue(); } wxStringList& wxVariant::GetStringList() const { - wxASSERT( (GetType() == _T("stringlist")) ); + wxASSERT( (GetType() == T("stringlist")) ); return (wxStringList&) ((wxVariantDataStringList*) m_data)->GetValue(); } @@ -1746,7 +1746,7 @@ bool wxVariant::Delete(int item) { wxList& list = GetList(); - wxASSERT_MSG( (item < list.Number()), _T("Invalid index to Delete") ); + wxASSERT_MSG( (item < list.Number()), T("Invalid index to Delete") ); wxNode* node = list.Nth(item); wxVariant* variant = (wxVariant*) node->Data(); delete variant; @@ -1757,13 +1757,13 @@ bool wxVariant::Delete(int item) // Clear list void wxVariant::ClearList() { - if (!IsNull() && (GetType() == _T("list"))) + if (!IsNull() && (GetType() == T("list"))) { ((wxVariantDataList*) m_data)->Clear(); } else { - if (GetType() != _T("list")) + if (GetType() != T("list")) { delete m_data; m_data = NULL; @@ -1776,15 +1776,15 @@ void wxVariant::ClearList() bool wxVariant::Convert(long* value) const { wxString type(GetType()); - if (type == _T("double")) + if (type == T("double")) *value = (long) (((wxVariantDataReal*)GetData())->GetValue()); - else if (type == _T("long")) + else if (type == T("long")) *value = ((wxVariantDataLong*)GetData())->GetValue(); #ifdef HAVE_BOOL - else if (type == _T("bool")) + else if (type == T("bool")) *value = (long) (((wxVariantDataBool*)GetData())->GetValue()); #endif - else if (type == _T("string")) + else if (type == T("string")) *value = wxAtol((const wxChar*) ((wxVariantDataString*)GetData())->GetValue()); else return FALSE; @@ -1795,21 +1795,21 @@ bool wxVariant::Convert(long* value) const bool wxVariant::Convert(bool* value) const { wxString type(GetType()); - if (type == _T("double")) + if (type == T("double")) *value = ((int) (((wxVariantDataReal*)GetData())->GetValue()) != 0); - else if (type == _T("long")) + else if (type == T("long")) *value = (((wxVariantDataLong*)GetData())->GetValue() != 0); #ifdef HAVE_BOOL - else if (type == _T("bool")) + else if (type == T("bool")) *value = ((wxVariantDataBool*)GetData())->GetValue(); #endif - else if (type == _T("string")) + else if (type == T("string")) { wxString val(((wxVariantDataString*)GetData())->GetValue()); val.MakeLower(); - if (val == _T("true") || val == _T("yes")) + if (val == T("true") || val == T("yes")) *value = TRUE; - else if (val == _T("false") || val == _T("no")) + else if (val == T("false") || val == T("no")) *value = FALSE; else return FALSE; @@ -1823,15 +1823,15 @@ bool wxVariant::Convert(bool* value) const bool wxVariant::Convert(double* value) const { wxString type(GetType()); - if (type == _T("double")) + if (type == T("double")) *value = ((wxVariantDataReal*)GetData())->GetValue(); - else if (type == _T("long")) + else if (type == T("long")) *value = (double) (((wxVariantDataLong*)GetData())->GetValue()); #ifdef HAVE_BOOL - else if (type == _T("bool")) + else if (type == T("bool")) *value = (double) (((wxVariantDataBool*)GetData())->GetValue()); #endif - else if (type == _T("string")) + else if (type == T("string")) *value = (double) wxAtof((const wxChar*) ((wxVariantDataString*)GetData())->GetValue()); else return FALSE; @@ -1842,12 +1842,12 @@ bool wxVariant::Convert(double* value) const bool wxVariant::Convert(char* value) const { wxString type(GetType()); - if (type == _T("char")) + if (type == T("char")) *value = ((wxVariantDataChar*)GetData())->GetValue(); - else if (type == _T("long")) + else if (type == T("long")) *value = (char) (((wxVariantDataLong*)GetData())->GetValue()); #ifdef HAVE_BOOL - else if (type == _T("bool")) + else if (type == T("bool")) *value = (char) (((wxVariantDataBool*)GetData())->GetValue()); #endif else @@ -1866,9 +1866,9 @@ bool wxVariant::Convert(wxString* value) const bool wxVariant::Convert(wxTime* value) const { wxString type(GetType()); - if (type == _T("time")) + if (type == T("time")) *value = ((wxVariantDataTime*)GetData())->GetValue(); - else if (type == _T("date")) + else if (type == T("date")) *value = wxTime(((wxVariantDataDate*)GetData())->GetValue()); else return FALSE; @@ -1879,7 +1879,7 @@ bool wxVariant::Convert(wxTime* value) const bool wxVariant::Convert(wxDate* value) const { wxString type(GetType()); - if (type == _T("date")) + if (type == T("date")) *value = ((wxVariantDataDate*)GetData())->GetValue(); else return FALSE; diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index d754cab345..20e32b7e83 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -160,7 +160,7 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, // m_isWindow is set to TRUE in wxWindowBase::Init() as well as many other // member variables - check that it has been called (will catch the case // when a new ctor is added which doesn't call InitWindow) - wxASSERT_MSG( m_isWindow, _T("Init() must have been called before!") ); + wxASSERT_MSG( m_isWindow, T("Init() must have been called before!") ); // generate a new id if the user doesn't care about it m_windowId = id == -1 ? NewControlId() : id; @@ -191,7 +191,7 @@ wxWindowBase::~wxWindowBase() // we weren't a dialog class wxTopLevelWindows.DeleteObject(this); - wxASSERT_MSG( GetChildren().GetCount() == 0, _T("children not destroyed") ); + wxASSERT_MSG( GetChildren().GetCount() == 0, T("children not destroyed") ); // make sure that there are no dangling pointers left pointing to us wxPanel *panel = wxDynamicCast(GetParent(), wxPanel); @@ -280,12 +280,12 @@ bool wxWindowBase::DestroyChildren() wxWindow *child = node->GetData(); - wxASSERT_MSG( child, _T("children list contains empty nodes") ); + wxASSERT_MSG( child, T("children list contains empty nodes") ); delete child; wxASSERT_MSG( !GetChildren().Find(child), - _T("child didn't remove itself using RemoveChild()") ); + T("child didn't remove itself using RemoveChild()") ); } return TRUE; @@ -335,7 +335,7 @@ void wxWindowBase::Centre(int direction) if ( !(direction & wxCENTRE_ON_SCREEN) || wxDynamicCast(this, wxControl) ) { // theo nly chance to get this is to have a wxControl without parent - wxCHECK_RET( parent, _T("a control must have a parent") ); + wxCHECK_RET( parent, T("a control must have a parent") ); // adjust to the parents client area origin wxPoint posParent = parent->ClientToScreen(wxPoint(0, 0)); @@ -436,7 +436,7 @@ bool wxWindowBase::IsTopLevel() const void wxWindowBase::AddChild(wxWindowBase *child) { - wxCHECK_RET( child, _T("can't add a NULL child") ); + wxCHECK_RET( child, T("can't add a NULL child") ); GetChildren().Append(child); child->SetParent(this); @@ -444,7 +444,7 @@ void wxWindowBase::AddChild(wxWindowBase *child) void wxWindowBase::RemoveChild(wxWindowBase *child) { - wxCHECK_RET( child, _T("can't remove a NULL child") ); + wxCHECK_RET( child, T("can't remove a NULL child") ); GetChildren().DeleteObject(child); child->SetParent((wxWindow *)NULL); @@ -579,7 +579,7 @@ void wxWindowBase::SetCaret(wxCaret *caret) if ( m_caret ) { wxASSERT_MSG( m_caret->GetWindow() == this, - _T("caret should be created associated to this window") ); + T("caret should be created associated to this window") ); } } #endif // wxUSE_CARET @@ -1038,18 +1038,18 @@ void wxWindowBase::SetConstraintSizes(bool recurse) wxChar *windowClass = GetClassInfo()->GetClassName(); wxString winName; - if ( GetName() == _T("") ) - winName = _T("unnamed"); + if ( GetName() == T("") ) + winName = T("unnamed"); else winName = GetName(); - wxLogDebug( _T("Constraint(s) not satisfied for window of type %s, name %s:\n"), + wxLogDebug( T("Constraint(s) not satisfied for window of type %s, name %s:\n"), (const wxChar *)windowClass, (const wxChar *)winName); - if ( !constr->left.GetDone()) wxLogDebug( _T(" unsatisfied 'left' constraint.\n") ); - if ( !constr->right.GetDone()) wxLogDebug( _T(" unsatisfied 'right' constraint.\n") ); - if ( !constr->width.GetDone()) wxLogDebug( _T(" unsatisfied 'width' constraint.\n") ); - if ( !constr->height.GetDone()) wxLogDebug( _T(" unsatisfied 'height' constraint.\n") ); - wxLogDebug( _T("Please check constraints: try adding AsIs() constraints.\n") ); + if ( !constr->left.GetDone()) wxLogDebug( T(" unsatisfied 'left' constraint.\n") ); + if ( !constr->right.GetDone()) wxLogDebug( T(" unsatisfied 'right' constraint.\n") ); + if ( !constr->width.GetDone()) wxLogDebug( T(" unsatisfied 'width' constraint.\n") ); + if ( !constr->height.GetDone()) wxLogDebug( T(" unsatisfied 'height' constraint.\n") ); + wxLogDebug( T("Please check constraints: try adding AsIs() constraints.\n") ); } if ( recurse ) @@ -1236,7 +1236,7 @@ wxPoint wxWindowBase::ConvertDialogToPixels(const wxPoint& pt) void wxWindowBase::DoSetClientObject( wxClientData *data ) { wxASSERT_MSG( m_clientDataType != ClientData_Void, - _T("can't have both object and void client data") ); + T("can't have both object and void client data") ); if ( m_clientObject ) delete m_clientObject; @@ -1248,7 +1248,7 @@ void wxWindowBase::DoSetClientObject( wxClientData *data ) wxClientData *wxWindowBase::DoGetClientObject() const { wxASSERT_MSG( m_clientDataType == ClientData_Object, - _T("this window doesn't have object client data") ); + T("this window doesn't have object client data") ); return m_clientObject; } @@ -1256,7 +1256,7 @@ wxClientData *wxWindowBase::DoGetClientObject() const void wxWindowBase::DoSetClientData( void *data ) { wxASSERT_MSG( m_clientDataType != ClientData_Object, - _T("can't have both object and void client data") ); + T("can't have both object and void client data") ); m_clientData = data; m_clientDataType = ClientData_Void; @@ -1265,7 +1265,7 @@ void wxWindowBase::DoSetClientData( void *data ) void *wxWindowBase::DoGetClientData() const { wxASSERT_MSG( m_clientDataType == ClientData_Void, - _T("this window doesn't have void client data") ); + T("this window doesn't have void client data") ); return m_clientData; } diff --git a/src/common/wxchar.cpp b/src/common/wxchar.cpp index ca5419f957..cad23ca412 100644 --- a/src/common/wxchar.cpp +++ b/src/common/wxchar.cpp @@ -52,7 +52,7 @@ size_t WXDLLEXPORT wxMB2WC(wchar_t *buf, const char *psz, size_t n) { if (buf) { if (!n || !*psz) { - if (n) *buf = _T('\0'); + if (n) *buf = T('\0'); return 0; } return mbstowcs(buf, psz, n); @@ -181,7 +181,7 @@ WXDLLEXPORT wxChar * wxStrtok(wxChar *psz, const wxChar *delim, wxChar **save_pt psz = wxStrpbrk(psz, delim); if (!psz) *save_ptr = (wxChar*)NULL; else { - *psz = _T('\0'); + *psz = T('\0'); *save_ptr = psz + 1; } return ret; @@ -292,21 +292,21 @@ WXDLLEXPORT double wxStrtod(const wxChar *nptr, wxChar **endptr) // FIXME: only correct for C locale while (wxIsspace(*nptr)) nptr++; - if (*nptr == _T('+') || *nptr == _T('-')) nptr++; + if (*nptr == T('+') || *nptr == T('-')) nptr++; while (wxIsdigit(*nptr)) nptr++; - if (*nptr == _T('.')) { + if (*nptr == T('.')) { nptr++; while (wxIsdigit(*nptr)) nptr++; } - if (*nptr == _T('E') || *nptr == _T('e')) { + if (*nptr == T('E') || *nptr == T('e')) { nptr++; - if (*nptr == _T('+') || *nptr == _T('-')) nptr++; + if (*nptr == T('+') || *nptr == T('-')) nptr++; while (wxIsdigit(*nptr)) nptr++; } wxString data(nptr, nptr-start); wxWX2MBbuf dat = data.mb_str(wxConvLibc); - char *rdat = MBSTRINGCAST dat; + char *rdat = wxMBSTRINGCAST dat; double ret = strtod(dat, &rdat); if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat)); @@ -320,21 +320,21 @@ WXDLLEXPORT long int wxStrtol(const wxChar *nptr, wxChar **endptr, int base) // FIXME: only correct for C locale while (wxIsspace(*nptr)) nptr++; - if (*nptr == _T('+') || *nptr == _T('-')) nptr++; + if (*nptr == T('+') || *nptr == T('-')) nptr++; if (((base == 0) || (base == 16)) && - (nptr[0] == _T('0') && nptr[1] == _T('x'))) { + (nptr[0] == T('0') && nptr[1] == T('x'))) { nptr += 2; base = 16; } - else if ((base == 0) && (nptr[0] == _T('0'))) base = 8; + else if ((base == 0) && (nptr[0] == T('0'))) base = 8; else if (base == 0) base = 10; - while ((wxIsdigit(*nptr) && (*nptr - _T('0') < base)) || - (wxIsalpha(*nptr) && (wxToupper(*nptr) - _T('A') + 10 < base))) nptr++; + while ((wxIsdigit(*nptr) && (*nptr - T('0') < base)) || + (wxIsalpha(*nptr) && (wxToupper(*nptr) - T('A') + 10 < base))) nptr++; wxString data(nptr, nptr-start); wxWX2MBbuf dat = data.mb_str(wxConvLibc); - char *rdat = MBSTRINGCAST dat; + char *rdat = wxMBSTRINGCAST dat; long int ret = strtol(dat, &rdat, base); if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat)); diff --git a/src/common/wxexpr.cpp b/src/common/wxexpr.cpp index 951445a595..feecedc3ae 100644 --- a/src/common/wxexpr.cpp +++ b/src/common/wxexpr.cpp @@ -275,12 +275,12 @@ wxExpr *wxExpr::AttributeValue(const wxString& word) const // Use only for a cla wxString wxExpr::Functor(void) const // Use only for a clause { if ((type != wxExprList) || !value.first) - return wxString(_T("")); + return wxString(T("")); if (value.first->type == wxExprWord) return wxString(value.first->value.word); else - return wxString(_T("")); + return wxString(T("")); } bool wxExpr::IsFunctor(const wxString& f) const // Use only for a clause @@ -390,7 +390,7 @@ void wxExpr::AddAttributeValue(const wxString& attribute, wxExpr *val) // DeleteAttributeValue(attribute); wxExpr *patt = new wxExpr(wxExprWord, attribute); - wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); + wxExpr *pequals = new wxExpr(wxExprWord, T("=")); wxExpr *listExpr = new wxExpr(wxExprList); @@ -414,7 +414,7 @@ void wxExpr::AddAttributeValue(const wxString& attribute, long val) wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *pval = new wxExpr(val); - wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); + wxExpr *pequals = new wxExpr(wxExprWord, T("=")); wxExpr *listExpr = new wxExpr(wxExprList); @@ -436,7 +436,7 @@ void wxExpr::AddAttributeValue(const wxString& attribute, double val) // DeleteAttributeValue(attribute); wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *pval = new wxExpr(val); - wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); + wxExpr *pequals = new wxExpr(wxExprWord, T("=")); wxExpr *listExpr = new wxExpr(wxExprList); @@ -459,7 +459,7 @@ void wxExpr::AddAttributeValueString(const wxString& attribute, const wxString& wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *pval = new wxExpr(wxExprString, val); - wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); + wxExpr *pequals = new wxExpr(wxExprWord, T("=")); wxExpr *listExpr = new wxExpr(wxExprList); @@ -482,7 +482,7 @@ void wxExpr::AddAttributeValueWord(const wxString& attribute, const wxString& va wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *pval = new wxExpr(wxExprWord, val); - wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); + wxExpr *pequals = new wxExpr(wxExprWord, T("=")); wxExpr *listExpr = new wxExpr(wxExprList); @@ -507,7 +507,7 @@ void wxExpr::AddAttributeValue(const wxString& attribute, wxList *val) wxExpr *patt = new wxExpr(wxExprWord, attribute); wxExpr *pval = new wxExpr(val); - wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); + wxExpr *pequals = new wxExpr(wxExprWord, T("=")); wxExpr *listExpr = new wxExpr(wxExprList); @@ -543,7 +543,7 @@ void wxExpr::AddAttributeValueStringList(const wxString& attribute, wxList *stri // Now make an (=, Att, Value) triple wxExpr *patt = new wxExpr(wxExprWord, attribute); - wxExpr *pequals = new wxExpr(wxExprWord, _T("=")); + wxExpr *pequals = new wxExpr(wxExprWord, T("=")); wxExpr *listExpr2 = new wxExpr(wxExprList); @@ -769,7 +769,7 @@ void wxExpr::WriteExpr(FILE* stream) // Write as any other subexpression { wxExpr *expr = value.first; - if ((expr->Type() == wxExprWord) && (wxStrcmp(expr->WordValue(), _T("=")) == 0)) + if ((expr->Type() == wxExprWord) && (wxStrcmp(expr->WordValue(), T("=")) == 0)) { wxExpr *arg1 = expr->next; wxExpr *arg2 = arg1->next; @@ -1018,7 +1018,7 @@ bool wxExprDatabase::ReadFromString(const wxString& buffer) thewxExprDatabase = this; const wxWX2MBbuf buf = buffer.mb_str(); - LexFromString(MBSTRINGCAST buf); + LexFromString(wxMBSTRINGCAST buf); yyparse(); wxExprCleanUp(); return (noErrors == 0); @@ -1143,21 +1143,21 @@ char *wxmake_string(char *str) t = s; for(i=1; i m_Pos) + if (nextpos > m_Pos) { buf = malloc(nextpos - m_Pos); unzReadCurrentFile((unzFile)m_Archive, buf, nextpos - m_Pos); @@ -107,8 +107,8 @@ off_t wxZipInputStream::OnSysSeek(off_t seek, wxSeekMode mode) } else if (nextpos < m_Pos) { unzCloseCurrentFile((unzFile)m_Archive); - if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK) - { + if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK) + { m_lasterror = wxStream_READ_ERR; return m_Pos; } @@ -122,4 +122,4 @@ off_t wxZipInputStream::OnSysSeek(off_t seek, wxSeekMode mode) } #endif - // wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB + // wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp index d6e0b5731b..8bb5c54c4b 100644 --- a/src/common/zstream.cpp +++ b/src/common/zstream.cpp @@ -138,7 +138,7 @@ wxZlibOutputStream::~wxZlibOutputStream() err = deflate(m_deflate, Z_FINISH); if (err != Z_STREAM_END) { - wxLogDebug( _T("wxZlibOutputStream: an error occured while closing the stream.\n") ); + wxLogDebug( T("wxZlibOutputStream: an error occured while closing the stream.\n") ); return; } diff --git a/src/generic/choicdgg.cpp b/src/generic/choicdgg.cpp index 5f82eb8ae0..53fc22e2bc 100644 --- a/src/generic/choicdgg.cpp +++ b/src/generic/choicdgg.cpp @@ -48,7 +48,7 @@ wxString wxGetSingleChoice( const wxString& message, const wxString& caption, in if ( dialog.ShowModal() == wxID_OK ) return dialog.GetStringSelection(); else - return _T(""); + return T(""); } // Overloaded for backward compatibility @@ -234,7 +234,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), { m_selection = 0; m_clientData = NULL; - m_stringSelection = _T(""); + m_stringSelection = T(""); m_dialogStyle = style; diff --git a/src/generic/colrdlgg.cpp b/src/generic/colrdlgg.cpp index 1e137f0743..0ec94904f7 100644 --- a/src/generic/colrdlgg.cpp +++ b/src/generic/colrdlgg.cpp @@ -61,59 +61,59 @@ END_EVENT_TABLE() */ #define NUM_COLS 48 -static wxString wxColourDialogNames[NUM_COLS]={_T("ORANGE"), - _T("GOLDENROD"), - _T("WHEAT"), - _T("SPRING GREEN"), - _T("SKY BLUE"), - _T("SLATE BLUE"), - _T("MEDIUM VIOLET RED"), - _T("PURPLE"), - - _T("RED"), - _T("YELLOW"), - _T("MEDIUM SPRING GREEN"), - _T("PALE GREEN"), - _T("CYAN"), - _T("LIGHT STEEL BLUE"), - _T("ORCHID"), - _T("LIGHT MAGENTA"), - - _T("BROWN"), - _T("YELLOW"), - _T("GREEN"), - _T("CADET BLUE"), - _T("MEDIUM BLUE"), - _T("MAGENTA"), - _T("MAROON"), - _T("ORANGE RED"), - - _T("FIREBRICK"), - _T("CORAL"), - _T("FOREST GREEN"), - _T("AQUAMARINE"), - _T("BLUE"), - _T("NAVY"), - _T("THISTLE"), - _T("MEDIUM VIOLET RED"), - - _T("INDIAN RED"), - _T("GOLD"), - _T("MEDIUM SEA GREEN"), - _T("MEDIUM BLUE"), - _T("MIDNIGHT BLUE"), - _T("GREY"), - _T("PURPLE"), - _T("KHAKI"), - - _T("BLACK"), - _T("MEDIUM FOREST GREEN"), - _T("KHAKI"), - _T("DARK GREY"), - _T("SEA GREEN"), - _T("LIGHT GREY"), - _T("MEDIUM SLATE BLUE"), - _T("WHITE") +static wxString wxColourDialogNames[NUM_COLS]={T("ORANGE"), + T("GOLDENROD"), + T("WHEAT("), + T("SPRING GREEN"), + T("SKY BLUE"), + T("SLATE BLUE"), + T("MEDIUM VIOLET RED"), + T("PURPLE"), + + T("RED"), + T("YELLOW"), + T("MEDIUM SPRING GREEN"), + T("PALE GREEN"), + T("CYAN"), + T("LIGHT STEEL BLUE"), + T("ORCHID"), + T("LIGHT MAGENTA"), + + T("BROWN"), + T("YELLOW"), + T("GREEN"), + T("CADET BLUE"), + T("MEDIUM BLUE"), + T("MAGENTA"), + T("MAROON"), + T("ORANGE RED"), + + T("FIREBRICK"), + T("CORAL"), + T("FOREST GREEN"), + T("AQUAMARINE"), + T("BLUE"), + T("NAVY"), + T("THISTLE"), + T("MEDIUM VIOLET RED"), + + T("INDIAN RED"), + T("GOLD"), + T("MEDIUM SEA GREEN"), + T("MEDIUM BLUE"), + T("MIDNIGHT BLUE"), + T("GREY"), + T("PURPLE"), + T("KHAKI"), + + T("BLACK"), + T("MEDIUM FOREST GREEN"), + T("KHAKI"), + T("DARK GREY"), + T("SEA GREEN"), + T("LIGHT GREY"), + T("MEDIUM SLATE BLUE"), + T("WHITE") }; wxGenericColourDialog::wxGenericColourDialog() diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index 88e3377174..a1744bfbeb 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -362,18 +362,18 @@ bool wxPostScriptDC::PrinterDialog(wxWindow *parent) wxChar userId[256]; wxGetUserId (userId, sizeof (userId) / sizeof (char)); wxChar tmp[256]; - wxStrcpy (tmp, _T("/tmp/preview_")); + wxStrcpy (tmp, T("/tmp/preview_")); wxStrcat (tmp, userId); m_printData.SetFilename(tmp); #endif wxChar tmp2[256]; wxStrcpy(tmp2, m_printData.GetFilename()); - wxStrcat (tmp2, _T(".ps")); + wxStrcat (tmp2, T(".ps")); m_printData.SetFilename(tmp2); } - else if ((m_printData.GetFilename() == _T("")) && (m_printData.GetPrintMode() == wxPRINT_MODE_FILE)) + else if ((m_printData.GetFilename() == T("")) && (m_printData.GetPrintMode() == wxPRINT_MODE_FILE)) { - wxString file = wxSaveFileSelector (_("PostScript"), _T("ps")); + wxString file = wxSaveFileSelector (_("PostScript"), T("ps")); if ( file.IsEmpty() ) { m_ok = FALSE; @@ -389,7 +389,7 @@ bool wxPostScriptDC::PrinterDialog(wxWindow *parent) void wxPostScriptDC::SetClippingRegion (long x, long y, long w, long h) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (m_clipping) return; @@ -411,12 +411,12 @@ void wxPostScriptDC::SetClippingRegion (long x, long y, long w, long h) void wxPostScriptDC::SetClippingRegion( const wxRegion &WXUNUSED(region) ) { - wxFAIL_MSG( _T("wxPostScriptDC::SetClippingRegion not implemented.") ); + wxFAIL_MSG( T("wxPostScriptDC::SetClippingRegion not implemented.") ); } void wxPostScriptDC::DestroyClippingRegion() { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); wxDC::DestroyClippingRegion(); @@ -429,28 +429,28 @@ void wxPostScriptDC::DestroyClippingRegion() void wxPostScriptDC::Clear() { - wxFAIL_MSG( _T("wxPostScriptDC::Clear not implemented.") ); + wxFAIL_MSG( T("wxPostScriptDC::Clear not implemented.") ); } void wxPostScriptDC::DoFloodFill (long WXUNUSED(x), long WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style)) { - wxFAIL_MSG( _T("wxPostScriptDC::FloodFill not implemented.") ); + wxFAIL_MSG( T("wxPostScriptDC::FloodFill not implemented.") ); } bool wxPostScriptDC::DoGetPixel (long WXUNUSED(x), long WXUNUSED(y), wxColour * WXUNUSED(col)) const { - wxFAIL_MSG( _T("wxPostScriptDC::GetPixel not implemented.") ); + wxFAIL_MSG( T("wxPostScriptDC::GetPixel not implemented.") ); return FALSE; } void wxPostScriptDC::DoCrossHair (long WXUNUSED(x), long WXUNUSED(y)) { - wxFAIL_MSG( _T("wxPostScriptDC::CrossHair not implemented.") ); + wxFAIL_MSG( T("wxPostScriptDC::CrossHair not implemented.") ); } void wxPostScriptDC::DoDrawLine (long x1, long y1, long x2, long y2) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (m_pen.GetStyle() == wxTRANSPARENT) return; @@ -472,7 +472,7 @@ void wxPostScriptDC::DoDrawLine (long x1, long y1, long x2, long y2) void wxPostScriptDC::DoDrawArc (long x1, long y1, long x2, long y2, long xc, long yc) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); long dx = x1 - xc; long dy = y1 - yc; @@ -539,7 +539,7 @@ void wxPostScriptDC::DoDrawArc (long x1, long y1, long x2, long y2, long xc, lon void wxPostScriptDC::DoDrawEllipticArc(long x,long y,long w,long h,double sa,double ea) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (sa>=360 || sa<=-360) sa=sa-int(sa/360)*360; if (ea>=360 || ea<=-360) ea=ea-int(ea/360)*360; @@ -581,7 +581,7 @@ void wxPostScriptDC::DoDrawEllipticArc(long x,long y,long w,long h,double sa,dou void wxPostScriptDC::DoDrawPoint (long x, long y) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (m_pen.GetStyle() == wxTRANSPARENT) return; @@ -600,7 +600,7 @@ void wxPostScriptDC::DoDrawPoint (long x, long y) void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle)) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (n <= 0) return; @@ -659,7 +659,7 @@ void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], long xoffset, long void wxPostScriptDC::DoDrawLines (int n, wxPoint points[], long xoffset, long yoffset) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (m_pen.GetStyle() == wxTRANSPARENT) return; @@ -690,7 +690,7 @@ void wxPostScriptDC::DoDrawLines (int n, wxPoint points[], long xoffset, long yo void wxPostScriptDC::DoDrawRectangle (long x, long y, long width, long height) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (m_brush.GetStyle () != wxTRANSPARENT) { @@ -737,7 +737,7 @@ void wxPostScriptDC::DoDrawRectangle (long x, long y, long width, long height) void wxPostScriptDC::DoDrawRoundedRectangle (long x, long y, long width, long height, double radius) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (radius < 0.0) { @@ -816,7 +816,7 @@ void wxPostScriptDC::DoDrawRoundedRectangle (long x, long y, long width, long he void wxPostScriptDC::DoDrawEllipse (long x, long y, long width, long height) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (m_brush.GetStyle () != wxTRANSPARENT) { @@ -867,7 +867,7 @@ static void LocalDecToHex( int dec, char *buf ) void wxPostScriptDC::DoDrawBitmap( const wxBitmap& bitmap, long x, long y, bool WXUNUSED(useMask) ) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (!bitmap.Ok()) return; @@ -921,7 +921,7 @@ void wxPostScriptDC::DoDrawBitmap( const wxBitmap& bitmap, long x, long y, bool void wxPostScriptDC::SetFont( const wxFont& font ) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (!font.Ok()) return; @@ -1016,7 +1016,7 @@ void wxPostScriptDC::SetFont( const wxFont& font ) void wxPostScriptDC::SetPen( const wxPen& pen ) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (!pen.Ok()) return; @@ -1101,7 +1101,7 @@ void wxPostScriptDC::SetPen( const wxPen& pen ) void wxPostScriptDC::SetBrush( const wxBrush& brush ) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (!brush.Ok()) return; @@ -1144,7 +1144,7 @@ void wxPostScriptDC::SetBrush( const wxBrush& brush ) void wxPostScriptDC::DoDrawText( const wxString& text, long x, long y ) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); SetFont( m_font ); @@ -1251,12 +1251,12 @@ void wxPostScriptDC::SetBackground (const wxBrush& brush) void wxPostScriptDC::SetLogicalFunction (int WXUNUSED(function)) { - wxFAIL_MSG( _T("wxPostScriptDC::SetLogicalFunction not implemented.") ); + wxFAIL_MSG( T("wxPostScriptDC::SetLogicalFunction not implemented.") ); } void wxPostScriptDC::DoDrawSpline( wxList *points ) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); SetPen( m_pen ); @@ -1328,7 +1328,7 @@ long wxPostScriptDC::GetCharWidth() const void wxPostScriptDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); m_signX = (xLeftRight ? 1 : -1); m_signY = (yBottomUp ? 1 : -1); @@ -1341,7 +1341,7 @@ void wxPostScriptDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) void wxPostScriptDC::SetDeviceOrigin( long x, long y ) { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); int h = 0; int w = 0; @@ -1413,7 +1413,7 @@ wxSize wxPostScriptDC::GetPPI(void) const bool wxPostScriptDC::StartDoc( const wxString& message ) { - wxCHECK_MSG( m_ok, FALSE, _T("invalid postscript dc") ); + wxCHECK_MSG( m_ok, FALSE, T("invalid postscript dc") ); if (m_printData.GetFilename() == "") { @@ -1458,7 +1458,7 @@ bool wxPostScriptDC::StartDoc( const wxString& message ) void wxPostScriptDC::EndDoc () { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); if (m_clipping) { @@ -1481,15 +1481,15 @@ void wxPostScriptDC::EndDoc () wxChar userID[256]; if ( wxGetEmailAddress(userID, sizeof(userID)) ) { - fprintf( m_pstream, "%%%%For: %s ", MBSTRINGCAST wxConvCurrent->cWX2MB(userID) ); + fprintf( m_pstream, "%%%%For: %s ", wxMBSTRINGCAST wxConvCurrent->cWX2MB(userID) ); wxChar userName[245]; if (wxGetUserName(userName, sizeof(userName))) - fprintf( m_pstream, " (%s)", MBSTRINGCAST wxConvCurrent->cWX2MB(userName) ); + fprintf( m_pstream, " (%s)", wxMBSTRINGCAST wxConvCurrent->cWX2MB(userName) ); fprintf( m_pstream, "\n" ); } else if ( wxGetUserName(userID, sizeof(userID)) ) { - fprintf( m_pstream, "%%%%For: %s\n", MBSTRINGCAST wxConvCurrent->cWX2MB(userID) );; + fprintf( m_pstream, "%%%%For: %s\n", wxMBSTRINGCAST wxConvCurrent->cWX2MB(userID) );; } // THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe @@ -1608,7 +1608,7 @@ void wxPostScriptDC::EndDoc () void wxPostScriptDC::StartPage() { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); fprintf( m_pstream, "%%%%Page: %d\n", wxPageNumber++ ); @@ -1648,7 +1648,7 @@ void wxPostScriptDC::StartPage() void wxPostScriptDC::EndPage () { - wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") ); + wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") ); fprintf( m_pstream, "showpage\n" ); } @@ -1659,9 +1659,9 @@ bool wxPostScriptDC::DoBlit( long xdest, long ydest, long xsrc, long ysrc, int rop, bool WXUNUSED(useMask) ) { - wxCHECK_MSG( m_ok && m_pstream, FALSE, _T("invalid postscript dc") ); + wxCHECK_MSG( m_ok && m_pstream, FALSE, T("invalid postscript dc") ); - wxCHECK_MSG( source, FALSE, _T("invalid source dc") ); + wxCHECK_MSG( source, FALSE, T("invalid source dc") ); /* blit into a bitmap */ wxBitmap bitmap( (int)fwidth, (int)fheight ); @@ -1691,9 +1691,9 @@ void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y, if (!fontToUse) fontToUse = (wxFont*) &m_font; - wxCHECK_RET( fontToUse, _T("GetTextExtent: no font defined") ); - wxCHECK_RET( x, _T("GetTextExtent: x == NULL") ); - wxCHECK_RET( y, _T("GetTextExtent: y == NULL") ); + wxCHECK_RET( fontToUse, T("GetTextExtent: no font defined") ); + wxCHECK_RET( x, T("GetTextExtent: x == NULL") ); + wxCHECK_RET( y, T("GetTextExtent: y == NULL") ); const wxWX2MBbuf strbuf = string.mb_str(); diff --git a/src/generic/dirdlgg.cpp b/src/generic/dirdlgg.cpp index ab07302a82..826703e3f7 100644 --- a/src/generic/dirdlgg.cpp +++ b/src/generic/dirdlgg.cpp @@ -6,7 +6,7 @@ // Created: 12/12/98 // RCS-ID: $Id$ // Copyright: (c) Harm van der Heijden and Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -55,12 +55,12 @@ static char * icon1_xpm[] = { /* width height ncolors chars_per_pixel */ "16 16 6 1", /* colors */ -" s None c None", -". c #000000", -"+ c #c0c0c0", -"@ c #808080", -"# c #ffff00", -"$ c #ffffff", +" s None c None", +". c #000000", +"+ c #c0c0c0", +"@ c #808080", +"# c #ffff00", +"$ c #ffffff", /* pixels */ " ", " @@@@@ ", @@ -84,12 +84,12 @@ static char * icon2_xpm[] = { /* width height ncolors chars_per_pixel */ "16 16 6 1", /* colors */ -" s None c None", -". c #000000", -"+ c #c0c0c0", -"@ c #808080", -"# c #ffff00", -"$ c #ffffff", +" s None c None", +". c #000000", +"+ c #c0c0c0", +"@ c #808080", +"# c #ffff00", +"$ c #ffffff", /* pixels */ " ", " @@@@@ ", @@ -123,8 +123,8 @@ wxDirItemData::wxDirItemData(wxString& path, wxString& name) { m_path = path; m_name = name; - /* Insert logic to detect hidden files here - * In UnixLand we just check whether the first char is a dot + /* Insert logic to detect hidden files here + * In UnixLand we just check whether the first char is a dot * For FileNameFromPath read LastDirNameInThisPath ;-) */ // m_isHidden = (bool)(wxFileNameFromPath(*m_path)[0] == '.'); m_isHidden = FALSE; @@ -179,7 +179,7 @@ wxDirCtrl::wxDirCtrl(wxWindow *parent, const wxWindowID id, const wxString &WXUN m_imageListNormal->Add(wxICON(icon2)); SetImageList(m_imageListNormal); #endif - + m_showHidden = FALSE; m_rootId = AddRoot( _("Sections") ); SetItemHasChildren(m_rootId); @@ -190,7 +190,7 @@ wxDirCtrl::wxDirCtrl(wxWindow *parent, const wxWindowID id, const wxString &WXUN #define ADD_SECTION(a,b) \ if (wxPathExists((a))) { m_paths.Add( (a) ); m_names.Add( (b) ); }; -void wxDirCtrl::SetupSections() +void wxDirCtrl::SetupSections() { wxString home; @@ -198,17 +198,17 @@ void wxDirCtrl::SetupSections() m_names.Clear(); #ifdef __WXMSW__ // better than nothing - ADD_SECTION(_T("c:\\"), _("My Harddisk") ) + ADD_SECTION(T("c:\\"), _("My Harddisk") ) #else - ADD_SECTION(_T("/"), _("The Computer") ) + ADD_SECTION(T("/"), _("The Computer") ) wxGetHomeDir(&home); ADD_SECTION(home, _("My Home") ) - ADD_SECTION(_T("/mnt"), _("Mounted Devices") ) - ADD_SECTION(_T("/usr"), _("User") ) - ADD_SECTION(_T("/usr/local"), _("User Local") ) - ADD_SECTION(_T("/var"), _("Variables") ) - ADD_SECTION(_T("/etc"), _("Etcetera") ) - ADD_SECTION(_T("/tmp"), _("Temporary") ) + ADD_SECTION(T("/mnt"), _("Mounted Devices") ) + ADD_SECTION(T("/usr"), _("User") ) + ADD_SECTION(T("/usr/local"), _("User Local") ) + ADD_SECTION(T("/var"), _("Variables") ) + ADD_SECTION(T("/etc"), _("Etcetera") ) + ADD_SECTION(T("/tmp"), _("Temporary") ) #endif } #undef ADD_SECTION @@ -219,14 +219,14 @@ void wxDirCtrl::CreateItems(const wxTreeItemId &parent) wxDirItemData *dir_item; // wxASSERT(m_paths.Count() == m_names.Count()); ? - - for (unsigned int i=0; im_hasSubDirs) SetItemHasChildren(id); } @@ -240,7 +240,7 @@ void wxDirCtrl::OnBeginEditItem(wxTreeEvent &event) event.Veto(); return; } - + // don't rename the individual sections if (GetParent( event.GetItem() ) == m_rootId) { @@ -254,31 +254,31 @@ void wxDirCtrl::OnEndEditItem(wxTreeEvent &event) if ((event.GetLabel().IsEmpty()) || (event.GetLabel() == _(".")) || (event.GetLabel() == _("..")) || - (event.GetLabel().First( _T("/") ) != wxNOT_FOUND)) + (event.GetLabel().First( T("/") ) != wxNOT_FOUND)) { wxMessageDialog dialog(this, _("Illegal directory name."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); + dialog.ShowModal(); event.Veto(); - return; + return; } wxTreeItemId id = event.GetItem(); wxDirItemData *data = (wxDirItemData*)GetItemData( id ); wxASSERT( data ); - + wxString new_name( wxPathOnly( data->m_path ) ); - new_name += _T("/"); + new_name += T("/"); new_name += event.GetLabel(); - + wxLogNull log; - + if (wxFileExists(new_name)) { wxMessageDialog dialog(this, _("File name exists already."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); + dialog.ShowModal(); event.Veto(); } - + if (wxRenameFile(data->m_path,new_name)) { data->SetNewDirName( new_name ); @@ -286,7 +286,7 @@ void wxDirCtrl::OnEndEditItem(wxTreeEvent &event) else { wxMessageDialog dialog(this, _("Operation not permitted."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); + dialog.ShowModal(); event.Veto(); } } @@ -311,23 +311,23 @@ void wxDirCtrl::OnExpandItem(wxTreeEvent &event) m_paths.Clear(); m_names.Clear(); search = data->m_path + "/*"; - for (path = wxFindFirstFile( search, wxDIR ); !path.IsNull(); - path=wxFindNextFile() ) + for (path = wxFindFirstFile( search, wxDIR ); !path.IsNull(); + path=wxFindNextFile() ) { filename = wxFileNameFromPath( path ); /* Don't add "." and ".." to the tree. I think wxFindNextFile * also checks this, but I don't quite understand what happens * there. Also wxFindNextFile seems to swallow hidden dirs */ - if ((filename != ".") && (filename != "..")) + if ((filename != ".") && (filename != "..")) { m_paths.Add(path); m_names.Add(filename); } } - + CreateItems( event.GetItem() ); SortChildren( event.GetItem() ); - + wxEndBusyCursor(); } @@ -338,10 +338,10 @@ void wxDirCtrl::OnCollapseItem(wxTreeEvent &event ) /* Workaround because DeleteChildren has disapeared (why?) and * CollapseAndReset doesn't work as advertised (deletes parent too) */ child = GetFirstChild(parent, cookie); - while (child.IsOk()) + while (child.IsOk()) { Delete(child); - /* Not GetNextChild below, because the cookie mechanism can't + /* Not GetNextChild below, because the cookie mechanism can't * handle disappearing children! */ child = GetFirstChild(parent, cookie); } @@ -370,33 +370,33 @@ BEGIN_EVENT_TABLE( wxDirDialog, wxDialog ) END_EVENT_TABLE() wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, - const wxString& defaultPath, long style, - const wxPoint& pos) : + const wxString& defaultPath, long style, + const wxPoint& pos) : wxDialog(parent, -1, message, pos, wxSize(300,300), - wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) + wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { m_message = message; m_dialogStyle = style; m_parent = parent; - + m_path = defaultPath; - + wxBeginBusyCursor(); - + wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); // 1) dir ctrl - m_dir = new wxDirCtrl( this, ID_DIRCTRL, "/", wxDefaultPosition, wxSize(200,200), - wxTR_HAS_BUTTONS | wxSUNKEN_BORDER | wxTR_EDIT_LABELS); + m_dir = new wxDirCtrl( this, ID_DIRCTRL, "/", wxDefaultPosition, wxSize(200,200), + wxTR_HAS_BUTTONS | wxSUNKEN_BORDER | wxTR_EDIT_LABELS); topsizer->Add( m_dir, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 ); - + // 2) text ctrl - m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition ); + m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition ); topsizer->Add( m_input, 0, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 ); - + // m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden") ); // m_check->SetValue(TRUE); - + #if wxUSE_STATLINE // 3) static line topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 ); @@ -410,15 +410,15 @@ wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, buttonsizer->Add( m_cancel, 0, wxLEFT|wxRIGHT, 10 ); m_new = new wxButton( this, ID_NEW, _("New...") ); buttonsizer->Add( m_new, 0, wxLEFT|wxRIGHT, 10 ); - + topsizer->Add( buttonsizer, 0, wxALL | wxCENTER, 10 ); m_ok->SetDefault(); m_dir->SetFocus(); - + SetAutoLayout( TRUE ); SetSizer( topsizer ); - + topsizer->SetSizeHints( this ); topsizer->Fit( this ); @@ -436,14 +436,14 @@ int wxDirDialog::ShowModal() void wxDirDialog::OnTreeSelected( wxTreeEvent &event ) { wxDirItemData *data = (wxDirItemData*)m_dir->GetItemData(event.GetItem()); - if (data) + if (data) m_input->SetValue( data->m_path ); }; void wxDirDialog::OnTreeKeyDown( wxTreeEvent &WXUNUSED(event) ) { wxDirItemData *data = (wxDirItemData*)m_dir->GetItemData(m_dir->GetSelection()); - if (data) + if (data) m_input->SetValue( data->m_path ); }; @@ -472,7 +472,7 @@ void wxDirDialog::OnOK( wxCommandEvent& WXUNUSED(event) ) else { // Trouble... msg = _("Failed to create directory ")+m_path+ - _("\n(Do you have the required permissions?)"); + _("\n(Do you have the required permissions?)"); wxMessageDialog errmsg(this, msg, _("Error creating directory"), wxOK | wxICON_ERROR); errmsg.ShowModal(); // We still don't have a valid dir. Back to the main dialog. @@ -492,8 +492,8 @@ void wxDirDialog::OnNew( wxCommandEvent& WXUNUSED(event) ) if ((id == m_dir->GetRootItem()) || (m_dir->GetParent(id) == m_dir->GetRootItem())) { - wxMessageDialog msg(this, _("You cannot add a new directory to this section."), - _("Create directory"), wxOK | wxICON_INFORMATION ); + wxMessageDialog msg(this, _("You cannot add a new directory to this section."), + _("Create directory"), wxOK | wxICON_INFORMATION ); msg.ShowModal(); return; } @@ -501,33 +501,33 @@ void wxDirDialog::OnNew( wxCommandEvent& WXUNUSED(event) ) wxTreeItemId parent = m_dir->GetParent( id ); wxDirItemData *data = (wxDirItemData*)m_dir->GetItemData( parent ); wxASSERT( data ); - - wxString new_name( _T("NewName") ); + + wxString new_name( T("NewName") ); wxString path( data->m_path ); - path += _T( "/" ); + path += T("/"); path += new_name; if (wxFileExists(path)) { // try NewName0, NewName1 etc. int i = 0; - do { - new_name = _T("NewName"); - wxString num; - num.Printf( "%d", i ); - new_name += num; - + do { + new_name = T("NewName"); + wxString num; + num.Printf( "%d", i ); + new_name += num; + path = data->m_path; - path += _T( "/" ); + path += T("/"); path += new_name; - i++; - } while (wxFileExists(path)); + i++; + } while (wxFileExists(path)); } - + wxLogNull log; - if (!wxMkdir(path)) + if (!wxMkdir(path)) { wxMessageDialog dialog(this, _("Operation not permitted."), _("Error"), wxOK | wxICON_ERROR ); - dialog.ShowModal(); + dialog.ShowModal(); return; } diff --git a/src/generic/filedlgg.cpp b/src/generic/filedlgg.cpp index fb4ea8ab41..dd7841da78 100644 --- a/src/generic/filedlgg.cpp +++ b/src/generic/filedlgg.cpp @@ -89,8 +89,8 @@ int ListCompare( long data1, long data2, long WXUNUSED(data) ) { wxFileData *fd1 = (wxFileData*)data1 ; wxFileData *fd2 = (wxFileData*)data2 ; - if (fd1->GetName() == _T("..")) return -1; - if (fd2->GetName() == _T("..")) return 1; + if (fd1->GetName() == T("..")) return -1; + if (fd2->GetName() == T("..")) return 1; if (fd1->IsDir() && !fd2->IsDir()) return -1; if (fd2->IsDir() && !fd1->IsDir()) return 1; return strcmp( fd1->GetName(), fd2->GetName() ); @@ -156,15 +156,15 @@ wxString wxFileData::GetHint() const s += _(" bytes "); } s += IntToString( m_day ); - s += _T("."); + s += T("."); s += IntToString( m_month ); - s += _T("."); + s += T("."); s += IntToString( m_year ); - s += _T(" "); + s += T(" "); s += IntToString( m_hour ); - s += _T(":"); + s += T(":"); s += IntToString( m_minute ); - s += _T(" "); + s += T(" "); s += m_permissions; return s; }; @@ -183,27 +183,27 @@ wxString wxFileData::GetEntry( int num ) else s = LongToString( m_size ); break; case 2: - if (m_day < 10) s = _T("0"); else s = _T(""); + if (m_day < 10) s = T("0"); else s = T(""); s += IntToString( m_day ); - s += _T("."); - if (m_month < 10) s += _T("0"); + s += T("."); + if (m_month < 10) s += T("0"); s += IntToString( m_month ); - s += _T("."); - if (m_year < 10) s += _T("0"); // this should happen real soon... + s += T("."); + if (m_year < 10) s += T("0"); // this should happen real soon... s += IntToString( m_year ); break; case 3: - if (m_hour < 10) s = _T("0"); else s = _T(""); + if (m_hour < 10) s = T("0"); else s = T(""); s += IntToString( m_hour ); - s += _T(":"); - if (m_minute < 10) s += _T("0"); + s += T(":"); + if (m_minute < 10) s += T("0"); s += IntToString( m_minute ); break; case 4: s = m_permissions; break; default: - s = _T("No entry"); + s = T("No entry"); break; } return s; @@ -263,7 +263,7 @@ END_EVENT_TABLE() wxFileCtrl::wxFileCtrl() { - m_dirName = _T("/"); + m_dirName = T("/"); m_showHidden = FALSE; } @@ -342,23 +342,23 @@ void wxFileCtrl::Update() item.m_itemId = 0; item.m_col = 0; - if (m_dirName != _T("/")) + if (m_dirName != T("/")) { wxString p( wxPathOnly(m_dirName) ); - if (p.IsEmpty()) p = _T("/"); - fd = new wxFileData( _T(".."), p ); + if (p.IsEmpty()) p = T("/"); + fd = new wxFileData( T(".."), p ); Add( fd, item ); item.m_itemId++; } - wxString res = m_dirName + _T("/*"); + wxString res = m_dirName + T("/*"); wxString f( wxFindFirstFile( res.GetData(), wxDIR ) ); while (!f.IsEmpty()) { res = wxFileNameFromPath( f ); fd = new wxFileData( res, f ); wxString s = fd->GetName(); - if (m_showHidden || (s[0] != _T('.'))) + if (m_showHidden || (s[0] != T('.'))) { Add( fd, item ); item.m_itemId++; @@ -366,14 +366,14 @@ void wxFileCtrl::Update() f = wxFindNextFile(); } - res = m_dirName + _T("/") + m_wild; + res = m_dirName + T("/") + m_wild; f = wxFindFirstFile( res.GetData(), wxFILE ); while (!f.IsEmpty()) { res = wxFileNameFromPath( f ); fd = new wxFileData( res, f ); wxString s = fd->GetName(); - if (m_showHidden || (s[0] != _T('.'))) + if (m_showHidden || (s[0] != T('.'))) { Add( fd, item ); item.m_itemId++; @@ -392,9 +392,9 @@ void wxFileCtrl::SetWild( const wxString &wild ) void wxFileCtrl::MakeDir() { - wxString new_name( _T("NewName") ); + wxString new_name( T("NewName") ); wxString path( m_dirName ); - path += _T( "/" ); + path += T("/"); path += new_name; if (wxFileExists(path)) { @@ -403,11 +403,11 @@ void wxFileCtrl::MakeDir() do { new_name = _("NewName"); wxString num; - num.Printf( _T("%d"), i ); + num.Printf( T("%d"), i ); new_name += num; path = m_dirName; - path += _T("/"); + path += T("/"); path += new_name; i++; } while (wxFileExists(path)); @@ -438,11 +438,11 @@ void wxFileCtrl::MakeDir() void wxFileCtrl::GoToParentDir() { - if (m_dirName != _T("/")) + if (m_dirName != T("/")) { wxString fname( wxFileNameFromPath(m_dirName) ); m_dirName = wxPathOnly( m_dirName ); - if (m_dirName.IsEmpty()) m_dirName = _T("/"); + if (m_dirName.IsEmpty()) m_dirName = T("/"); Update(); int id = FindItem( 0, fname ); if (id != -1) @@ -489,7 +489,7 @@ void wxFileCtrl::OnListEndLabelEdit( wxListEvent &event ) if ((event.GetLabel().IsEmpty()) || (event.GetLabel() == _(".")) || (event.GetLabel() == _("..")) || - (event.GetLabel().First( _T("/") ) != wxNOT_FOUND)) + (event.GetLabel().First( T("/") ) != wxNOT_FOUND)) { wxMessageDialog dialog(this, _("Illegal directory name."), _("Error"), wxOK | wxICON_ERROR ); dialog.ShowModal(); @@ -498,7 +498,7 @@ void wxFileCtrl::OnListEndLabelEdit( wxListEvent &event ) } wxString new_name( wxPathOnly( fd->GetFullName() ) ); - new_name += _T("/"); + new_name += T("/"); new_name += event.GetLabel(); wxLogNull log; @@ -573,7 +573,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, m_dir = getcwd( buf, sizeof(buf) ); } m_path = defaultDir; - m_path += _T("/"); + m_path += T("/"); m_path += defaultFile; m_fileName = defaultFile; m_wildCard = wildCard; @@ -584,7 +584,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, if (m_wildCard.IsEmpty()) m_wildCard = _("All files (*)|*"); - wxStringTokenizer tokens( m_wildCard, _T("|") ); + wxStringTokenizer tokens( m_wildCard, T("|") ); wxString firstWild; wxString firstWildText; if (tokens.CountTokens() == 1) @@ -594,7 +594,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, } else { - wxASSERT_MSG( tokens.CountTokens() % 2 == 0, _T("Wrong file type descripition") ); + wxASSERT_MSG( tokens.CountTokens() % 2 == 0, T("Wrong file type descripition") ); firstWildText = tokens.GetNextToken(); firstWild = tokens.GetNextToken(); } @@ -717,11 +717,11 @@ void wxFileDialog::OnSelected( wxListEvent &event ) if (FindFocus() != m_list) return; wxString filename( event.m_item.m_text ); - if (filename == _T("..")) return; + if (filename == T("..")) return; wxString dir; m_list->GetDir( dir ); - if (dir != _T("/")) dir += _T("/"); + if (dir != T("/")) dir += T("/"); dir += filename; if (wxDirExists(dir)) return; @@ -734,9 +734,9 @@ void wxFileDialog::HandleAction( const wxString &fn ) wxString dir; m_list->GetDir( dir ); if (filename.IsEmpty()) return; - if (filename == _T(".")) return; + if (filename == T(".")) return; - if (filename == _T("..")) + if (filename == T("..")) { m_list->GoToParentDir(); m_list->SetFocus(); @@ -745,7 +745,7 @@ void wxFileDialog::HandleAction( const wxString &fn ) return; } - if (filename == _T("~")) + if (filename == T("~")) { m_list->GoToHomeDir(); m_list->SetFocus(); @@ -754,19 +754,19 @@ void wxFileDialog::HandleAction( const wxString &fn ) return; } - if (filename[0] == _T('~')) + if (filename[0] == T('~')) { filename.Remove( 0, 1 ); wxString tmp( wxGetUserHome() ); - tmp += _T('/'); + tmp += T('/'); tmp += filename; filename = tmp; } - if ((filename.Find(_T('*')) != wxNOT_FOUND) || - (filename.Find(_T('?')) != wxNOT_FOUND)) + if ((filename.Find(T('*')) != wxNOT_FOUND) || + (filename.Find(T('?')) != wxNOT_FOUND)) { - if (filename.Find(_T('/')) != wxNOT_FOUND) + if (filename.Find(T('/')) != wxNOT_FOUND) { wxMessageBox(_("Illegal file specification."), _("Error"), wxOK | wxICON_ERROR ); return; @@ -775,8 +775,8 @@ void wxFileDialog::HandleAction( const wxString &fn ) return; } - if (dir != _T("/")) dir += _T("/"); - if (filename[0] != _T('/')) + if (dir != T("/")) dir += T("/"); + if (filename[0] != T('/')) { dir += filename; filename = dir; @@ -867,7 +867,7 @@ void wxFileDialog::SetPath( const wxString& path ) wxSplitPath(path, &m_dir, &m_fileName, &ext); if (!ext.IsEmpty()) { - m_fileName += _T("."); + m_fileName += T("."); m_fileName += ext; } } @@ -888,7 +888,7 @@ wxFileSelectorEx(const wxChar *message, int x, int y) { // TODO: implement this somehow - return wxFileSelector(message, default_path, default_filename, _T(""), + return wxFileSelector(message, default_path, default_filename, T(""), wildcard, flags, parent, x, y); } @@ -899,7 +899,7 @@ wxString wxFileSelector( const wxChar *title, { wxString filter2; if ( defaultExtension && !filter ) - filter2 = wxString(_T("*.")) + wxString(defaultExtension) ; + filter2 = wxString(T("*.")) + wxString(defaultExtension) ; else if ( filter ) filter2 = filter; @@ -931,9 +931,9 @@ wxString wxLoadFileSelector( const wxChar *what, const wxChar *extension, const wxString str = _("Load %s file"); wxSprintf(prompt, str, what); - if (*ext == _T('.')) ext++; + if (*ext == T('.')) ext++; wxChar wild[60]; - wxSprintf(wild, _T("*.%s"), ext); + wxSprintf(wild, T("*.%s"), ext); return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent); } @@ -947,9 +947,9 @@ wxString wxSaveFileSelector(const wxChar *what, const wxChar *extension, const w wxString str = _("Save %s file"); wxSprintf(prompt, str, what); - if (*ext == _T('.')) ext++; + if (*ext == T('.')) ext++; wxChar wild[60]; - wxSprintf(wild, _T("*.%s"), ext); + wxSprintf(wild, T("*.%s"), ext); return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent); } diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp index 5f1ad03f4c..81762a3223 100644 --- a/src/generic/fontdlgg.cpp +++ b/src/generic/fontdlgg.cpp @@ -57,59 +57,59 @@ END_EVENT_TABLE() #endif #define NUM_COLS 48 -static wxString wxColourDialogNames[NUM_COLS]={_T("ORANGE"), - _T("GOLDENROD"), - _T("WHEAT"), - _T("SPRING GREEN"), - _T("SKY BLUE"), - _T("SLATE BLUE"), - _T("MEDIUM VIOLET RED"), - _T("PURPLE"), - - _T("RED"), - _T("YELLOW"), - _T("MEDIUM SPRING GREEN"), - _T("PALE GREEN"), - _T("CYAN"), - _T("LIGHT STEEL BLUE"), - _T("ORCHID"), - _T("LIGHT MAGENTA"), - - _T("BROWN"), - _T("YELLOW"), - _T("GREEN"), - _T("CADET BLUE"), - _T("MEDIUM BLUE"), - _T("MAGENTA"), - _T("MAROON"), - _T("ORANGE RED"), - - _T("FIREBRICK"), - _T("CORAL"), - _T("FOREST GREEN"), - _T("AQUARAMINE"), - _T("BLUE"), - _T("NAVY"), - _T("THISTLE"), - _T("MEDIUM VIOLET RED"), - - _T("INDIAN RED"), - _T("GOLD"), - _T("MEDIUM SEA GREEN"), - _T("MEDIUM BLUE"), - _T("MIDNIGHT BLUE"), - _T("GREY"), - _T("PURPLE"), - _T("KHAKI"), - - _T("BLACK"), - _T("MEDIUM FOREST GREEN"), - _T("KHAKI"), - _T("DARK GREY"), - _T("SEA GREEN"), - _T("LIGHT GREY"), - _T("MEDIUM SLATE BLUE"), - _T("WHITE") +static wxString wxColourDialogNames[NUM_COLS]={T("ORANGE"), + T("GOLDENROD"), + T("WHEAT("), + T("SPRING GREEN"), + T("SKY BLUE"), + T("SLATE BLUE"), + T("MEDIUM VIOLET RED"), + T("PURPLE"), + + T("RED"), + T("YELLOW"), + T("MEDIUM SPRING GREEN"), + T("PALE GREEN"), + T("CYAN"), + T("LIGHT STEEL BLUE"), + T("ORCHID"), + T("LIGHT MAGENTA"), + + T("BROWN"), + T("YELLOW"), + T("GREEN"), + T("CADET BLUE"), + T("MEDIUM BLUE"), + T("MAGENTA"), + T("MAROON"), + T("ORANGE RED"), + + T("FIREBRICK"), + T("CORAL"), + T("FOREST GREEN"), + T("AQUARAMINE"), + T("BLUE"), + T("NAVY"), + T("THISTLE"), + T("MEDIUM VIOLET RED"), + + T("INDIAN RED"), + T("GOLD"), + T("MEDIUM SEA GREEN"), + T("MEDIUM BLUE"), + T("MIDNIGHT BLUE"), + T("GREY"), + T("PURPLE"), + T("KHAKI"), + + T("BLACK"), + T("MEDIUM FOREST GREEN"), + T("KHAKI"), + T("DARK GREY"), + T("SEA GREEN"), + T("LIGHT GREY"), + T("MEDIUM SLATE BLUE"), + T("WHITE") }; /* @@ -345,7 +345,7 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event)) int fontUnderline = underLineCheckBox->GetValue(); dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0)); - if (colourChoice->GetStringSelection() != _T("")) + if (colourChoice->GetStringSelection() != T("")) { wxColour *col = (wxColour*) NULL; col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection()); @@ -364,14 +364,14 @@ wxChar *wxFontWeightIntToString(int weight) switch (weight) { case wxLIGHT: - return _T("Light"); + return T("Light"); case wxBOLD: - return _T("Bold"); + return T("Bold"); case wxNORMAL: default: - return _T("Normal"); + return T("Normal"); } - return _T("Normal"); + return T("Normal"); } wxChar *wxFontStyleIntToString(int style) @@ -379,14 +379,14 @@ wxChar *wxFontStyleIntToString(int style) switch (style) { case wxITALIC: - return _T("Italic"); + return T("Italic"); case wxSLANT: - return _T("Slant"); + return T("Slant"); case wxNORMAL: default: - return _T("Normal"); + return T("Normal"); } - return _T("Normal"); + return T("Normal"); } wxChar *wxFontFamilyIntToString(int family) @@ -394,20 +394,20 @@ wxChar *wxFontFamilyIntToString(int family) switch (family) { case wxROMAN: - return _T("Roman"); + return T("Roman"); case wxDECORATIVE: - return _T("Decorative"); + return T("Decorative"); case wxMODERN: - return _T("Modern"); + return T("Modern"); case wxSCRIPT: - return _T("Script"); + return T("Script"); case wxTELETYPE: - return _T("Teletype"); + return T("Teletype"); case wxSWISS: default: - return _T("Swiss"); + return T("Swiss"); } - return _T("Swiss"); + return T("Swiss"); } int wxFontFamilyStringToInt(wxChar *family) @@ -415,15 +415,15 @@ int wxFontFamilyStringToInt(wxChar *family) if (!family) return wxSWISS; - if (wxStrcmp(family, _T("Roman")) == 0) + if (wxStrcmp(family, T("Roman")) == 0) return wxROMAN; - else if (wxStrcmp(family, _T("Decorative")) == 0) + else if (wxStrcmp(family, T("Decorative")) == 0) return wxDECORATIVE; - else if (wxStrcmp(family, _T("Modern")) == 0) + else if (wxStrcmp(family, T("Modern")) == 0) return wxMODERN; - else if (wxStrcmp(family, _T("Script")) == 0) + else if (wxStrcmp(family, T("Script")) == 0) return wxSCRIPT; - else if (wxStrcmp(family, _T("Teletype")) == 0) + else if (wxStrcmp(family, T("Teletype")) == 0) return wxTELETYPE; else return wxSWISS; } @@ -432,9 +432,9 @@ int wxFontStyleStringToInt(wxChar *style) { if (!style) return wxNORMAL; - if (wxStrcmp(style, _T("Italic")) == 0) + if (wxStrcmp(style, T("Italic")) == 0) return wxITALIC; - else if (wxStrcmp(style, _T("Slant")) == 0) + else if (wxStrcmp(style, T("Slant")) == 0) return wxSLANT; else return wxNORMAL; @@ -444,9 +444,9 @@ int wxFontWeightStringToInt(wxChar *weight) { if (!weight) return wxNORMAL; - if (wxStrcmp(weight, _T("Bold")) == 0) + if (wxStrcmp(weight, T("Bold")) == 0) return wxBOLD; - else if (wxStrcmp(weight, _T("Light")) == 0) + else if (wxStrcmp(weight, T("Light")) == 0) return wxLIGHT; else return wxNORMAL; diff --git a/src/generic/helpext.cpp b/src/generic/helpext.cpp index 057d510387..56a293ca42 100644 --- a/src/generic/helpext.cpp +++ b/src/generic/helpext.cpp @@ -102,23 +102,23 @@ wxExtHelpController::DisplayHelp(wxString const &relativeURL) { wxString lockfile; wxGetHomeDir(&lockfile); - lockfile << WXEXTHELP_SEPARATOR << _T(".netscape/lock"); + lockfile << WXEXTHELP_SEPARATOR << T(".netscape/lock"); struct stat statbuf; if(lstat(lockfile.fn_str(), &statbuf) == 0) // cannot use wxFileExists, because it's a link pointing to a // non-existing location if(wxFileExists(lockfile)) { long success; - command << m_BrowserName << _T(" -remote openURL(") - << _T("file://") << m_MapFile - << WXEXTHELP_SEPARATOR << relativeURL << _T(")"); + command << m_BrowserName << T(" -remote openURL(") + << T("file://") << m_MapFile + << WXEXTHELP_SEPARATOR << relativeURL << T(")"); success = wxExecute(command); if(success != 0 ) // returns PID on success return TRUE; } } command = m_BrowserName; - command << _T(" file://") + command << T(" file://") << m_MapFile << WXEXTHELP_SEPARATOR << relativeURL; return wxExecute(command) != 0; #endif diff --git a/src/generic/helphtml.cpp b/src/generic/helphtml.cpp index e342567285..721367da1a 100644 --- a/src/generic/helphtml.cpp +++ b/src/generic/helphtml.cpp @@ -143,7 +143,7 @@ wxHTMLHelpControllerBase::LoadFile(const wxString& ifile) { newfile = WXEXTHELP_SEPARATOR; const wxChar *cptr = wxGetLocale()->GetName().c_str(); - while(*cptr && *cptr != _T('_')) + while(*cptr && *cptr != T('_')) newfile << *(cptr++); if(wxDirExists(newfile)) file = newfile; @@ -223,13 +223,13 @@ wxHTMLHelpControllerBase::DisplayContents() bool rc = FALSE; wxString file; file << m_MapFile << WXEXTHELP_SEPARATOR << contents; - if(file.Contains(_T('#'))) - file = file.BeforeLast(_T('#')); + if(file.Contains(T('#'))) + file = file.BeforeLast(T('#')); if(contents.Length() && wxFileExists(file)) rc = DisplaySection(CONTENTS_ID); // if not found, open homemade toc: - return rc ? TRUE : KeywordSearch(_T("")); + return rc ? TRUE : KeywordSearch(T("")); } bool diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index e6dcbfd926..686fd59f36 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -62,7 +62,7 @@ const wxBitmap *wxImageList::GetBitmap( int index ) const { wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, (wxBitmap *) NULL, _T("wrong index in image list") ); + wxCHECK_MSG( node, (wxBitmap *) NULL, T("wrong index in image list") ); return (wxBitmap*)node->Data(); } @@ -71,7 +71,7 @@ bool wxImageList::Replace( int index, const wxBitmap &bitmap ) { wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, FALSE, _T("wrong index in image list") ); + wxCHECK_MSG( node, FALSE, T("wrong index in image list") ); wxBitmap* newBitmap = NULL; if (bitmap.IsKindOf(CLASSINFO(wxIcon))) @@ -98,7 +98,7 @@ bool wxImageList::Remove( int index ) { wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, FALSE, _T("wrong index in image list") ); + wxCHECK_MSG( node, FALSE, T("wrong index in image list") ); m_images.DeleteNode( node ); @@ -119,7 +119,7 @@ bool wxImageList::GetSize( int index, int &width, int &height ) const wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, FALSE, _T("wrong index in image list") ); + wxCHECK_MSG( node, FALSE, T("wrong index in image list") ); wxBitmap *bm = (wxBitmap*)node->Data(); width = bm->GetWidth(); @@ -133,7 +133,7 @@ bool wxImageList::Draw( int index, wxDC &dc, int x, int y, { wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, FALSE, _T("wrong index in image list") ); + wxCHECK_MSG( node, FALSE, T("wrong index in image list") ); wxBitmap *bm = (wxBitmap*)node->Data(); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 34358bb529..2f4cccc30c 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -436,7 +436,7 @@ void wxListLineData::SetPosition( wxDC *dc, int x, int y, int window_width ) wxListItemData *item = (wxListItemData*)node->Data(); wxString s; item->GetText( s ); - if (s.IsEmpty()) s = _T("H"); + if (s.IsEmpty()) s = T("H"); long lw,lh; dc->GetTextExtent( s, &lw, &lh ); m_bound_label.width = lw; @@ -1209,7 +1209,7 @@ void wxListMainWindow::DeleteLine( wxListLineData *line ) void wxListMainWindow::EditLabel( long item ) { wxNode *node = m_lines.Nth( item ); - wxCHECK_RET( node, _T("wrong index in wxListCtrl::Edit()") ); + wxCHECK_RET( node, T("wrong index in wxListCtrl::Edit()") ); m_currentEdit = (wxListLineData*) node->Data(); @@ -1247,7 +1247,7 @@ void wxListMainWindow::EditLabel( long item ) void wxListMainWindow::OnRenameTimer() { - wxCHECK_RET( m_current, _T("invalid m_current") ); + wxCHECK_RET( m_current, T("invalid m_current") ); Edit( m_lines.IndexOf( m_current ) ); } @@ -2251,7 +2251,7 @@ void wxListMainWindow::DeleteItem( long index ) void wxListMainWindow::DeleteColumn( int col ) { wxCHECK_RET( col < (int)m_columns.GetCount(), - _T("attempting to delete inexistent column in wxListView") ); + T("attempting to delete inexistent column in wxListView") ); m_dirty = TRUE; wxNode *node = m_columns.Nth( col ); diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 0714d5910f..bf9af38c48 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -27,8 +27,8 @@ #pragma hdrstop #endif -#ifdef wxUSE_NOGUI - #error "This file can't be compiled in NOGUI mode!" +#if !wxUSE_GUI + #error "This file can't be compiled without GUI!" #endif #ifndef WX_PRECOMP @@ -94,7 +94,7 @@ void wxLogTextCtrl::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) { wxString msg; TimeStamp(&msg); - msg << szString << _T('\n'); + msg << szString << T('\n'); m_pTextCtrl->AppendText(msg); } @@ -138,7 +138,7 @@ void wxLogGui::Flush() if ( nLines > 25 ) // don't put too many lines in message box break; - str << m_aMessages[n - 1] << _T("\n"); + str << m_aMessages[n - 1] << T("\n"); } const wxChar *title; @@ -208,13 +208,13 @@ void wxLogGui::DoLog(wxLogLevel level, const wxChar *szString, time_t t) // debug window anyhow, but do put a timestamp wxString str; TimeStamp(&str); - str << szString << _T("\n\r"); + str << szString << T("\n\r"); OutputDebugString(str); #else // send them to stderr - wxFprintf(stderr, _T("%s: %s\n"), - level == wxLOG_Trace ? _T("Trace") - : _T("Debug"), + wxFprintf(stderr, T("%s: %s\n"), + level == wxLOG_Trace ? T("Trace") + : T("Debug"), szString); fflush(stderr); #endif @@ -351,7 +351,7 @@ void wxLogFrame::OnSave(wxCommandEvent& WXUNUSED(event)) { // get the file name // ----------------- - const wxChar *szFileName = wxSaveFileSelector(_T("log"), _T("txt"), _T("log.txt")); + const wxChar *szFileName = wxSaveFileSelector(T("log"), T("txt"), T("log.txt")); if ( szFileName == NULL ) { // cancelled return; @@ -511,7 +511,7 @@ void wxLogWindow::DoLogString(const wxChar *szString, time_t WXUNUSED(t)) wxString msg; TimeStamp(&msg); - msg << szString << _T('\n'); + msg << szString << T('\n'); pText->AppendText(msg); diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp index 96b70f53a3..d6567fe138 100644 --- a/src/generic/numdlgg.cpp +++ b/src/generic/numdlgg.cpp @@ -120,7 +120,7 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent, inputsizer->Add( new wxStaticText( this, -1, prompt ), 0, wxCENTER | wxLEFT, 10 ); // spin ctrl wxString valStr; - valStr.Printf(_T("%lu"), m_value); + valStr.Printf(T("%lu"), m_value); m_spinctrl = new wxTextCtrl(this, -1, valStr, wxDefaultPosition, wxSize( 140, -1 ) ); inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 ); // add both @@ -149,7 +149,7 @@ wxNumberEntryDialog::wxNumberEntryDialog(wxWindow *parent, void wxNumberEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { - if ( (wxSscanf(m_spinctrl->GetValue(), _T("%lu"), &m_value) != 1) || + if ( (wxSscanf(m_spinctrl->GetValue(), T("%lu"), &m_value) != 1) || (m_value < m_min) || (m_value > m_max) ) { // not a number or out of range diff --git a/src/generic/prntdlgg.cpp b/src/generic/prntdlgg.cpp index 53fa919d26..47d3cfb3f1 100644 --- a/src/generic/prntdlgg.cpp +++ b/src/generic/prntdlgg.cpp @@ -274,7 +274,7 @@ void wxGenericPrintDialog::OnOK(wxCommandEvent& WXUNUSED(event)) wxString f = wxFileSelector(_("PostScript file"), wxPathOnly(wxThePrintSetupData->GetPrinterFile()), wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()), - _T("ps"), _T("*.ps"), 0, this); + T("ps"), T("*.ps"), 0, this); if ( f.IsEmpty() ) return; diff --git a/src/generic/progdlgg.cpp b/src/generic/progdlgg.cpp index 2a7eb07918..fffb684cc3 100644 --- a/src/generic/progdlgg.cpp +++ b/src/generic/progdlgg.cpp @@ -150,21 +150,21 @@ wxProgressDialog::wxProgressDialog(wxString const &title, { nTimeLabels++; - m_elapsed = CreateLabel(_T("Elapsed time : "), &lastWindow); + m_elapsed = CreateLabel(T("Elapsed time : "), &lastWindow); } if ( style & wxPD_ESTIMATED_TIME ) { nTimeLabels++; - m_estimated = CreateLabel(_T("Estimated time : "), &lastWindow); + m_estimated = CreateLabel(T("Estimated time : "), &lastWindow); } if ( style & wxPD_REMAINING_TIME ) { nTimeLabels++; - m_remaining = CreateLabel(_T("Remaining time : "), &lastWindow); + m_remaining = CreateLabel(T("Remaining time : "), &lastWindow); } if ( nTimeLabels > 0 ) @@ -234,7 +234,7 @@ wxStaticText *wxProgressDialog::CreateLabel(const wxString& text, { wxLayoutConstraints *c; - wxStaticText *label = new wxStaticText(this, -1, _T("unknown")); + wxStaticText *label = new wxStaticText(this, -1, T("unknown")); c = new wxLayoutConstraints; // VZ: I like the labels be centered - if the others don't mind, you may @@ -265,8 +265,8 @@ wxStaticText *wxProgressDialog::CreateLabel(const wxString& text, bool wxProgressDialog::Update(int value, const wxString& newmsg) { - wxASSERT_MSG( value == -1 || m_gauge, _T("cannot update non existent dialog") ); - wxASSERT_MSG( value <= m_maximum, _T("invalid progress value") ); + wxASSERT_MSG( value == -1 || m_gauge, T("cannot update non existent dialog") ); + wxASSERT_MSG( value <= m_maximum, T("invalid progress value") ); if( m_gauge ) @@ -374,7 +374,7 @@ static void SetTimeLabel(unsigned long val, wxStaticText *label) unsigned long hours = val / 3600; unsigned long minutes = (val % 3600) / 60; unsigned long seconds = val % 60; - s.Printf(_T("%lu:%02lu:%02lu"), hours, minutes, seconds); + s.Printf(T("%lu:%02lu:%02lu"), hours, minutes, seconds); if ( s != label->GetLabel() ) label->SetLabel(s); diff --git a/src/generic/prop.cpp b/src/generic/prop.cpp index a44800754d..81667fa193 100644 --- a/src/generic/prop.cpp +++ b/src/generic/prop.cpp @@ -328,7 +328,7 @@ wxPropertyValue *wxPropertyValue::NewCopy(void) const return new wxPropertyValue(m_value.stringPtr); case wxPropertyValueNull: - wxFAIL_MSG( _T("Should never get here!\n" ) ); + wxFAIL_MSG( T("Should never get here!\n" ) ); break; } return NULL; @@ -399,7 +399,7 @@ void wxPropertyValue::Copy(wxPropertyValue& copyFrom) return; } case wxPropertyValueNull: - wxFAIL_MSG( _T("Should never get here!\n" ) ); + wxFAIL_MSG( T("Should never get here!\n" ) ); break; } } @@ -461,20 +461,20 @@ void wxPropertyValue::WritePropertyClause(wxString& stream) // Write this expre if (node) { node->WritePropertyType(stream); - stream.Append( _T("(") ); + stream.Append( T("(") ); node = node->m_next; bool first = TRUE; while (node) { if (!first) - stream.Append( _T(" ") ); + stream.Append( T(" ") ); node->WritePropertyType(stream); node = node->m_next; if (node) - stream.Append( _T(",\n" ) ); + stream.Append( T(",\n" ) ); first = FALSE; } - stream.Append( _T(").\n\n") ); + stream.Append( T(").\n\n") ); } } @@ -485,43 +485,43 @@ void wxPropertyValue::WritePropertyType(wxString& stream) // Write as any oth { case wxPropertyValueInteger: { - tmp.Printf( _T("%ld"), m_value.integer ); + tmp.Printf( T("%ld"), m_value.integer ); stream.Append( tmp ); break; } case wxPropertyValueIntegerPtr: { - tmp.Printf( _T("%ld"), *m_value.integerPtr ); + tmp.Printf( T("%ld"), *m_value.integerPtr ); stream.Append( tmp ); break; } case wxPropertyValuebool: { if (m_value.integer) - stream.Append( _T("True") ); + stream.Append( T("True") ); else - stream.Append( _T("False") ); + stream.Append( T("False") ); break; } case wxPropertyValueboolPtr: { if (*m_value.integerPtr) - stream.Append( _T("True") ); + stream.Append( T("True") ); else - stream.Append( _T("False") ); + stream.Append( T("False") ); break; } case wxPropertyValueReal: { double d = m_value.real; - tmp.Printf( _T("%.6g"), d ); + tmp.Printf( T("%.6g"), d ); stream.Append( tmp ); break; } case wxPropertyValueRealPtr: { double d = *m_value.realPtr; - tmp.Printf( _T("%.6g"), d ); + tmp.Printf( T("%.6g"), d ); stream.Append( tmp ); break; } @@ -532,7 +532,7 @@ void wxPropertyValue::WritePropertyType(wxString& stream) // Write as any oth } case wxPropertyValueStringPtr: { - wxFAIL_MSG( _T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") ); + wxFAIL_MSG( T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") ); /* int i; int len = strlen(*(m_value.stringPtr)); @@ -547,20 +547,20 @@ void wxPropertyValue::WritePropertyType(wxString& stream) // Write as any oth case wxPropertyValueList: { if (!m_value.first) - stream.Append( _T("[]") ); + stream.Append( T("[]") ); else { wxPropertyValue *expr = m_value.first; - stream.Append( _T("[") ); + stream.Append( T("[") ); while (expr) { expr->WritePropertyType(stream); expr = expr->m_next; if (expr) - stream.Append( _T(", ") ); + stream.Append( T(", ") ); } - stream.Append( _T("]") ); + stream.Append( T("]") ); } break; } @@ -1097,13 +1097,13 @@ bool wxPropertyValidator::StringToLong (wxChar *s, long *number) { wxChar *wxPropertyValidator::FloatToString (float number) { static wxChar buf[20]; - wxSprintf (buf, _T("%.6g"), number); + wxSprintf (buf, T("%.6g"), number); return buf; } wxChar *wxPropertyValidator::DoubleToString (double number) { static wxChar buf[20]; - wxSprintf (buf, _T("%.6g"), number); + wxSprintf (buf, T("%.6g"), number); return buf; } diff --git a/src/generic/propform.cpp b/src/generic/propform.cpp index d017b0d4b8..af83e76fc0 100644 --- a/src/generic/propform.cpp +++ b/src/generic/propform.cpp @@ -150,7 +150,7 @@ bool wxPropertyFormView::AssociateNames(void) while (node) { wxWindow *win = (wxWindow *)node->Data(); - if (win->GetName() != _T("")) + if (win->GetName() != T("")) { wxProperty *prop = m_propertySheet->GetProperty(win->GetName()); if (prop) @@ -207,18 +207,18 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event) if (!m_propertySheet) return; - if (win.GetName() == _T("")) + if (win.GetName() == T("")) return; - if (wxStrcmp(win.GetName(), _T("ok")) == 0) + if (wxStrcmp(win.GetName(), T("ok")) == 0) OnOk(event); - else if (wxStrcmp(win.GetName(), _T("cancel")) == 0) + else if (wxStrcmp(win.GetName(), T("cancel")) == 0) OnCancel(event); - else if (wxStrcmp(win.GetName(), _T("help")) == 0) + else if (wxStrcmp(win.GetName(), T("help")) == 0) OnHelp(event); - else if (wxStrcmp(win.GetName(), _T("update")) == 0) + else if (wxStrcmp(win.GetName(), T("update")) == 0) OnUpdate(event); - else if (wxStrcmp(win.GetName(), _T("revert")) == 0) + else if (wxStrcmp(win.GetName(), T("revert")) == 0) OnRevert(event); else { @@ -427,16 +427,16 @@ bool wxRealFormValidator::OnCheckValue( wxProperty *property, wxPropertyFormView if (!StringToFloat(WXSTRINGCAST value, &val)) { wxChar buf[200]; - wxSprintf(buf, _T("Value %s is not a valid real number!"), (const wxChar *)value); - wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxSprintf(buf, T("Value %s is not a valid real number!"), (const wxChar *)value); + wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } if (val < m_realMin || val > m_realMax) { wxChar buf[200]; - wxSprintf(buf, _T("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax); - wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxSprintf(buf, T("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax); + wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } return TRUE; @@ -498,8 +498,8 @@ bool wxIntegerFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormVi if (!StringToLong(WXSTRINGCAST value, &val)) { wxChar buf[200]; - wxSprintf(buf, _T("Value %s is not a valid integer!"), (const wxChar *)value); - wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxSprintf(buf, T("Value %s is not a valid integer!"), (const wxChar *)value); + wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } } diff --git a/src/generic/proplist.cpp b/src/generic/proplist.cpp index c7374c15a2..c5e69cac4a 100644 --- a/src/generic/proplist.cpp +++ b/src/generic/proplist.cpp @@ -830,7 +830,7 @@ bool wxPropertyListValidator::OnSelect(bool select, wxProperty *property, wxProp bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { wxString s(view->GetValueList()->GetStringSelection()); - if (s != _T("")) + if (s != T("")) { view->GetValueText()->SetValue(s); view->RetrieveProperty(property); @@ -898,8 +898,8 @@ bool wxRealListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropert if (!StringToFloat(WXSTRINGCAST value, &val)) { wxChar buf[200]; - wxSprintf(buf, _T("Value %s is not a valid real number!"), value.GetData()); - wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxSprintf(buf, T("Value %s is not a valid real number!"), value.GetData()); + wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } @@ -961,15 +961,15 @@ bool wxIntegerListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxProp if (!StringToLong(WXSTRINGCAST value, &val)) { wxChar buf[200]; - wxSprintf(buf, _T("Value %s is not a valid integer!"), value.GetData()); - wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxSprintf(buf, T("Value %s is not a valid integer!"), value.GetData()); + wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } if (val < m_integerMin || val > m_integerMax) { wxChar buf[200]; - wxSprintf(buf, _T("Value must be an integer between %ld and %ld!"), m_integerMin, m_integerMax); - wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxSprintf(buf, T("Value must be an integer between %ld and %ld!"), m_integerMin, m_integerMax); + wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } return TRUE; @@ -1015,9 +1015,9 @@ bool wxBoolListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropert if (!view->GetValueText()) return FALSE; wxString value(view->GetValueText()->GetValue()); - if (value != _T("True") && value != _T("False")) + if (value != T("True") && value != T("False")) { - wxMessageBox(_T("Value must be True or False!"), _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); + wxMessageBox(T("Value must be True or False!"), T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); return FALSE; } return TRUE; @@ -1036,7 +1036,7 @@ bool wxBoolListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListVi wxString value(view->GetValueText()->GetValue()); bool boolValue = FALSE; - if (value == _T("True")) + if (value == T("True")) boolValue = TRUE; else boolValue = FALSE; @@ -1079,8 +1079,8 @@ bool wxBoolListValidator::OnPrepareDetailControls(wxProperty *WXUNUSED(property) view->ShowListBoxControl(TRUE); view->GetValueList()->Enable(TRUE); - view->GetValueList()->Append(_T("True")); - view->GetValueList()->Append(_T("False")); + view->GetValueList()->Append(T("True")); + view->GetValueList()->Append(T("False")); wxChar *currentString = copystring(view->GetValueText()->GetValue()); view->GetValueList()->SetStringSelection(currentString); delete[] currentString; @@ -1353,7 +1353,7 @@ void wxFilenameListValidator::OnEdit(wxProperty *property, wxPropertyListView *v m_filenameWildCard.GetData(), 0, parentWindow); - if (s != _T("")) + if (s != T("")) { property->GetValue() = s; view->DisplayProperty(property); @@ -1546,7 +1546,7 @@ void wxListOfStringsListValidator::OnEdit(wxProperty *property, wxPropertyListVi expr = expr->GetNext(); } - wxString title(_T("Editing ")); + wxString title(T("Editing ")); title += property->GetName(); if (EditStringList(parentWindow, stringList, title.GetData())) @@ -1766,7 +1766,7 @@ void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event)) { SaveCurrentSelection(); - wxChar *initialText = _T(""); + wxChar *initialText = T(""); wxNode *node = m_stringList->Add(initialText); m_listBox->Append(initialText, (void *)node); m_currentSelection = m_stringList->Number() - 1; diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index ba57b2732e..072448b191 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -373,7 +373,7 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event) if ( dialog ) iconized = dialog->IsIconized(); else - wxFAIL_MSG(_T("should have a top level frame or dialog parent!")); + wxFAIL_MSG(T("should have a top level frame or dialog parent!")); } if ( iconized ) @@ -742,7 +742,7 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove) } else { - wxFAIL_MSG(_T("splitter: attempt to remove a non-existent window")); + wxFAIL_MSG(T("splitter: attempt to remove a non-existent window")); return FALSE; } @@ -757,8 +757,8 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove) // Replace a window with another one bool wxSplitterWindow::ReplaceWindow(wxWindow *winOld, wxWindow *winNew) { - wxCHECK_MSG( winOld, FALSE, _T("use one of Split() functions instead") ); - wxCHECK_MSG( winNew, FALSE, _T("use Unsplit() functions instead") ); + wxCHECK_MSG( winOld, FALSE, T("use one of Split() functions instead") ); + wxCHECK_MSG( winNew, FALSE, T("use Unsplit() functions instead") ); if ( winOld == m_windowTwo ) { @@ -770,7 +770,7 @@ bool wxSplitterWindow::ReplaceWindow(wxWindow *winOld, wxWindow *winNew) } else { - wxFAIL_MSG(_T("splitter: attempt to replace a non-existent window")); + wxFAIL_MSG(T("splitter: attempt to replace a non-existent window")); return FALSE; } diff --git a/src/generic/statline.cpp b/src/generic/statline.cpp index 31bbdec49e..b430f8d280 100644 --- a/src/generic/statline.cpp +++ b/src/generic/statline.cpp @@ -55,7 +55,7 @@ bool wxStaticLine::Create( wxWindow *parent, wxSize sizeReal = AdjustSize(size); - m_statbox = new wxStaticBox(parent, id, _T(""), pos, sizeReal, style, name); + m_statbox = new wxStaticBox(parent, id, T(""), pos, sizeReal, style, name); return TRUE; } diff --git a/src/generic/tipdlg.cpp b/src/generic/tipdlg.cpp index 96a2dfbe47..7b06f357a1 100644 --- a/src/generic/tipdlg.cpp +++ b/src/generic/tipdlg.cpp @@ -183,7 +183,7 @@ wxTipDialog::wxTipDialog(wxWindow *parent, // // text->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE)); - m_text = new wxTextCtrl(this, -1, _T(""), + m_text = new wxTextCtrl(this, -1, T(""), wxDefaultPosition, wxSize(200, 160), wxTE_MULTILINE | wxTE_READONLY | wxSUNKEN_BORDER); m_text->SetFont(wxFont(14, wxROMAN, wxNORMAL, wxNORMAL)); diff --git a/src/generic/treectrl.cpp b/src/generic/treectrl.cpp index 66f716260b..8c64a4c26a 100644 --- a/src/generic/treectrl.cpp +++ b/src/generic/treectrl.cpp @@ -291,7 +291,7 @@ wxGenericTreeItem::~wxGenericTreeItem() delete m_data; wxASSERT_MSG( m_children.IsEmpty(), - _T("please call DeleteChildren() before deleting the item") ); + T("please call DeleteChildren() before deleting the item") ); } void wxGenericTreeItem::DeleteChildren(wxTreeCtrl *tree) @@ -574,7 +574,7 @@ void wxTreeCtrl::SetSpacing(unsigned int spacing) size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively) { - wxCHECK_MSG( item.IsOk(), 0u, _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), 0u, T("invalid tree item") ); return item.m_pItem->GetChildrenCount(recursively); } @@ -585,7 +585,7 @@ size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively) wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), _T(""), _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), T(""), T("invalid tree item") ); return item.m_pItem->GetText(); } @@ -593,21 +593,21 @@ wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const int wxTreeCtrl::GetItemImage(const wxTreeItemId& item, wxTreeItemIcon which) const { - wxCHECK_MSG( item.IsOk(), -1, _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), -1, T("invalid tree item") ); return item.m_pItem->GetImage(which); } wxTreeItemData *wxTreeCtrl::GetItemData(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), NULL, _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), NULL, T("invalid tree item") ); return item.m_pItem->GetData(); } void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text) { - wxCHECK_RET( item.IsOk(), _T("invalid tree item") ); + wxCHECK_RET( item.IsOk(), T("invalid tree item") ); wxClientDC dc(this); wxGenericTreeItem *pItem = item.m_pItem; @@ -620,7 +620,7 @@ void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, int image, wxTreeItemIcon which) { - wxCHECK_RET( item.IsOk(), _T("invalid tree item") ); + wxCHECK_RET( item.IsOk(), T("invalid tree item") ); wxGenericTreeItem *pItem = item.m_pItem; pItem->SetImage(image, which); @@ -632,14 +632,14 @@ void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data) { - wxCHECK_RET( item.IsOk(), _T("invalid tree item") ); + wxCHECK_RET( item.IsOk(), T("invalid tree item") ); item.m_pItem->SetData(data); } void wxTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has) { - wxCHECK_RET( item.IsOk(), _T("invalid tree item") ); + wxCHECK_RET( item.IsOk(), T("invalid tree item") ); wxGenericTreeItem *pItem = item.m_pItem; pItem->SetHasPlus(has); @@ -648,7 +648,7 @@ void wxTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has) void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold) { - wxCHECK_RET( item.IsOk(), _T("invalid tree item") ); + wxCHECK_RET( item.IsOk(), T("invalid tree item") ); // avoid redrawing the tree if no real change wxGenericTreeItem *pItem = item.m_pItem; @@ -665,35 +665,35 @@ void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold) bool wxTreeCtrl::IsVisible(const wxTreeItemId& WXUNUSED(item)) const { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return TRUE; } bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), FALSE, T("invalid tree item") ); return !item.m_pItem->GetChildren().IsEmpty(); } bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), FALSE, T("invalid tree item") ); return item.m_pItem->IsExpanded(); } bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), FALSE, T("invalid tree item") ); return item.m_pItem->IsSelected(); } bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), FALSE, T("invalid tree item") ); return item.m_pItem->IsBold(); } @@ -704,14 +704,14 @@ bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetParent(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") ); return item.m_pItem->GetParent(); } wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item, long& cookie) const { - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") ); cookie = 0; return GetNextChild(item, cookie); @@ -719,7 +719,7 @@ wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item, long& cookie) c wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& item, long& cookie) const { - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") ); wxArrayGenericTreeItems& children = item.m_pItem->GetChildren(); if ( (size_t)cookie < children.Count() ) @@ -735,7 +735,7 @@ wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& item, long& cookie) co wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") ); wxArrayGenericTreeItems& children = item.m_pItem->GetChildren(); return (children.IsEmpty() ? wxTreeItemId() : wxTreeItemId(children.Last())); @@ -743,7 +743,7 @@ wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetNextSibling(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") ); wxGenericTreeItem *i = item.m_pItem; wxGenericTreeItem *parent = i->GetParent(); @@ -763,7 +763,7 @@ wxTreeItemId wxTreeCtrl::GetNextSibling(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") ); wxGenericTreeItem *i = item.m_pItem; wxGenericTreeItem *parent = i->GetParent(); @@ -783,25 +783,25 @@ wxTreeItemId wxTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetFirstVisibleItem() const { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return wxTreeItemId(); } wxTreeItemId wxTreeCtrl::GetNextVisible(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") ); - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return wxTreeItemId(); } wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const { - wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") ); + wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") ); - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return wxTreeItemId(); } @@ -845,7 +845,7 @@ wxTreeItemId wxTreeCtrl::AddRoot(const wxString& text, int image, int selImage, wxTreeItemData *data) { - wxCHECK_MSG( !m_anchor, wxTreeItemId(), _T("tree can have only one root") ); + wxCHECK_MSG( !m_anchor, wxTreeItemId(), T("tree can have only one root") ); wxClientDC dc(this); m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text, dc, @@ -884,7 +884,7 @@ wxTreeItemId wxTreeCtrl::InsertItem(const wxTreeItemId& parentId, int index = parent->GetChildren().Index(idPrevious.m_pItem); wxASSERT_MSG( index != wxNOT_FOUND, - _T("previous item in wxTreeCtrl::InsertItem() is not a sibling") ); + T("previous item in wxTreeCtrl::InsertItem() is not a sibling") ); return DoInsertItem(parentId, (size_t)++index, text, image, selImage, data); } @@ -1126,13 +1126,13 @@ void wxTreeCtrl::SelectItem(const wxTreeItemId& itemId, bool unselect_others, bool extended_select) { - wxCHECK_RET( itemId.IsOk(), _T("invalid tree item") ); + wxCHECK_RET( itemId.IsOk(), T("invalid tree item") ); bool is_single=!(GetWindowStyleFlag() & wxTR_MULTIPLE); wxGenericTreeItem *item = itemId.m_pItem; //wxCHECK_RET( ( (!unselect_others) && is_single), - // _T("this is a single selection tree") ); + // T("this is a single selection tree") ); // to keep going anyhow !!! if (is_single) @@ -1286,7 +1286,7 @@ static wxTreeCtrl *s_treeBeingSorted = NULL; static int tree_ctrl_compare_func(wxGenericTreeItem **item1, wxGenericTreeItem **item2) { - wxCHECK_MSG( s_treeBeingSorted, 0, _T("bug in wxTreeCtrl::SortChildren()") ); + wxCHECK_MSG( s_treeBeingSorted, 0, T("bug in wxTreeCtrl::SortChildren()") ); return s_treeBeingSorted->OnCompareItems(*item1, *item2); } @@ -1299,12 +1299,12 @@ int wxTreeCtrl::OnCompareItems(const wxTreeItemId& item1, void wxTreeCtrl::SortChildren(const wxTreeItemId& itemId) { - wxCHECK_RET( itemId.IsOk(), _T("invalid tree item") ); + wxCHECK_RET( itemId.IsOk(), T("invalid tree item") ); wxGenericTreeItem *item = itemId.m_pItem; wxCHECK_RET( !s_treeBeingSorted, - _T("wxTreeCtrl::SortChildren is not reentrant") ); + T("wxTreeCtrl::SortChildren is not reentrant") ); wxArrayGenericTreeItems& children = item->GetChildren(); if ( children.Count() > 1 ) @@ -1411,7 +1411,7 @@ void wxTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc) } else { - wxFAIL_MSG(_T("wxDC::GetFont() failed!")); + wxFAIL_MSG(T("wxDC::GetFont() failed!")); } } @@ -2005,7 +2005,7 @@ void wxTreeCtrl::CalculateSize( wxGenericTreeItem *item, wxDC &dc ) } else { - wxFAIL_MSG(_T("wxDC::GetFont() failed!")); + wxFAIL_MSG(T("wxDC::GetFont() failed!")); } } diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 4d70f33f01..a09f08bef7 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -187,7 +187,7 @@ wxWizard::wxWizard(wxWindow *parent, bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) { - wxASSERT_MSG( page != m_page, _T("this is useless") ); + wxASSERT_MSG( page != m_page, T("this is useless") ); // we'll use this to decide whether we have to change the label of this // button or not (initially the label is "Next") @@ -252,7 +252,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) bool wxWizard::RunWizard(wxWizardPage *firstPage) { - wxCHECK_MSG( firstPage, FALSE, _T("can't run empty wizard") ); + wxCHECK_MSG( firstPage, FALSE, T("can't run empty wizard") ); // can't return FALSE here because there is no old page (void)ShowPage(firstPage, TRUE /* forward */); @@ -284,7 +284,7 @@ void wxWizard::OnBackOrNext(wxCommandEvent& event) { wxASSERT_MSG( (event.GetEventObject() == m_btnNext) || (event.GetEventObject() == m_btnPrev), - _T("unknown button") ); + T("unknown button") ); bool forward = event.GetEventObject() == m_btnNext; @@ -297,7 +297,7 @@ void wxWizard::OnBackOrNext(wxCommandEvent& event) { page = m_page->GetPrev(); - wxASSERT_MSG( page, _T("\"GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) && (((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) && (((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown())) - { + { return entry->GetCommand(); - } + } node = node->Next(); } - + return -1; } diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 2bce90acab..2572ce4997 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -144,7 +144,7 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) ); bool wxYield() { bool has_idle = (wxTheApp->m_idleTag != 0); - + if (has_idle) { /* We need to temporarily remove idle callbacks or the loop will @@ -160,20 +160,20 @@ bool wxYield() might have been changed (it also will update other things set from OnUpdateUI() which is a nice (and desired) side effect) */ while (wxTheApp->ProcessIdle()) { } - + if (has_idle) { /* re-add idle handler */ wxTheApp->m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL ); } - + return TRUE; } gint wxapp_idle_callback( gpointer WXUNUSED(data) ) { if (!wxTheApp) return TRUE; - + #if (GTK_MINOR_VERSION > 0) /* when getting called from GDK's idle handler we are no longer within GDK's grab on the GUI @@ -206,7 +206,7 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) ) void wxapp_install_idle_handler() { - wxASSERT_MSG( wxTheApp->m_idleTag == 0, _T("attempt to install idle handler twice") ); + wxASSERT_MSG( wxTheApp->m_idleTag == 0, T("attempt to install idle handler twice") ); /* this routine gets called by all event handlers indicating that the idle is over. */ @@ -224,14 +224,14 @@ static gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) ); void wxapp_install_thread_wakeup() { if (wxTheApp->m_wakeUpTimerTag) return; - + wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 100, wxapp_wakeup_timerout_callback, (gpointer) NULL ); } void wxapp_uninstall_thread_wakeup() { if (!wxTheApp->m_wakeUpTimerTag) return; - + gtk_timeout_remove( wxTheApp->m_wakeUpTimerTag ); wxTheApp->m_wakeUpTimerTag = 0; } @@ -397,7 +397,7 @@ bool wxApp::OnInitGui() index |= (g >> (5 - vis->green_prec)) << vis->green_shift; index |= (b >> (5 - vis->blue_prec)) << vis->blue_shift; #else - wxFAIL_MSG( _T("Unsupported graphics hardware") ); + wxFAIL_MSG( T("Unsupported graphics hardware") ); #endif } m_colorCube[ (r*1024) + (g*32) + b ] = index; @@ -478,7 +478,7 @@ bool wxApp::SendIdleEvents( wxWindow* win ) win->ProcessEvent(event); win->OnInternalIdle(); - + if (event.MoreRequested()) needMore = TRUE; @@ -640,7 +640,7 @@ void wxApp::CleanUp() #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT if (wxDebugContext::CountObjectsLeft() > 0) { - wxLogDebug(_T("There were memory leaks.\n")); + wxLogDebug(T("There were memory leaks.\n")); wxDebugContext::Dump(); wxDebugContext::PrintStatistics(); } @@ -681,7 +681,7 @@ int wxEntry( int argc, char *argv[] ) if (!wxTheApp) { wxCHECK_MSG( wxApp::GetInitializerFunction(), -1, - _T("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") ); + T("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") ); wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction(); @@ -690,7 +690,7 @@ int wxEntry( int argc, char *argv[] ) wxTheApp = (wxApp*) test_app; } - wxCHECK_MSG( wxTheApp, -1, _T("wxWindows error: no application object") ); + wxCHECK_MSG( wxTheApp, -1, T("wxWindows error: no application object") ); wxTheApp->argc = argc; #if wxUSE_UNICODE @@ -794,7 +794,7 @@ wxApp::GetStdIcon(int which) const return wxIcon(warning_xpm); default: - wxFAIL_MSG(_T("requested non existent standard icon")); + wxFAIL_MSG(T("requested non existent standard icon")); // still fall through case wxICON_HAND: diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index dec3ff0c40..707e07e951 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -60,7 +60,7 @@ bool wxMask::Create( const wxBitmap& WXUNUSED(bitmap), m_bitmap = (GdkBitmap*) NULL; } - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( T("TODO") ); return FALSE; } @@ -74,7 +74,7 @@ bool wxMask::Create( const wxBitmap& WXUNUSED(bitmap), m_bitmap = (GdkBitmap*) NULL; } - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( T("not implemented") ); return FALSE; } @@ -89,7 +89,7 @@ bool wxMask::Create( const wxBitmap& bitmap ) if (!bitmap.Ok()) return FALSE; - wxCHECK_MSG( bitmap.GetBitmap(), FALSE, _T("Cannot create mask from colour bitmap") ); + wxCHECK_MSG( bitmap.GetBitmap(), FALSE, T("Cannot create mask from colour bitmap") ); m_bitmap = gdk_pixmap_new( (GdkWindow*) &gdk_root_parent, bitmap.GetWidth(), bitmap.GetHeight(), 1 ); @@ -160,13 +160,13 @@ wxBitmap::wxBitmap() wxBitmap::wxBitmap( int width, int height, int depth ) { - wxCHECK_RET( (width > 0) && (height > 0), _T("invalid bitmap size") ) + wxCHECK_RET( (width > 0) && (height > 0), T("invalid bitmap size") ) GdkWindow *parent = (GdkWindow*) &gdk_root_parent; if (depth == -1) depth = gdk_window_get_visual( parent )->depth; wxCHECK_RET( (depth == gdk_window_get_visual( parent )->depth) || - (depth == 1), _T("invalid bitmap depth") ) + (depth == 1), T("invalid bitmap depth") ) m_refData = new wxBitmapRefData(); M_BMPDATA->m_mask = (wxMask *) NULL; @@ -188,7 +188,7 @@ wxBitmap::wxBitmap( int width, int height, int depth ) wxBitmap::wxBitmap( const char **bits ) { - wxCHECK_RET( bits != NULL, _T("invalid bitmap data") ) + wxCHECK_RET( bits != NULL, T("invalid bitmap data") ) m_refData = new wxBitmapRefData(); @@ -211,7 +211,7 @@ wxBitmap::wxBitmap( const char **bits ) wxBitmap::wxBitmap( char **bits ) { - wxCHECK_RET( bits != NULL, _T("invalid bitmap data") ) + wxCHECK_RET( bits != NULL, T("invalid bitmap data") ) m_refData = new wxBitmapRefData(); @@ -220,7 +220,7 @@ wxBitmap::wxBitmap( char **bits ) M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits ); - wxCHECK_RET( M_BMPDATA->m_pixmap, _T("couldn't create pixmap") ); + wxCHECK_RET( M_BMPDATA->m_pixmap, T("couldn't create pixmap") ); if (mask) { @@ -259,7 +259,7 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth M_BMPDATA->m_height = height; M_BMPDATA->m_bpp = 1; - wxCHECK_RET( M_BMPDATA->m_bitmap, _T("couldn't create bitmap") ); + wxCHECK_RET( M_BMPDATA->m_bitmap, T("couldn't create bitmap") ); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } @@ -293,35 +293,35 @@ bool wxBitmap::Ok() const int wxBitmap::GetHeight() const { - wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), -1, T("invalid bitmap") ); return M_BMPDATA->m_height; } int wxBitmap::GetWidth() const { - wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), -1, T("invalid bitmap") ); return M_BMPDATA->m_width; } int wxBitmap::GetDepth() const { - wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), -1, T("invalid bitmap") ); return M_BMPDATA->m_bpp; } wxMask *wxBitmap::GetMask() const { - wxCHECK_MSG( Ok(), (wxMask *) NULL, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), (wxMask *) NULL, T("invalid bitmap") ); return M_BMPDATA->m_mask; } void wxBitmap::SetMask( wxMask *mask ) { - wxCHECK_RET( Ok(), _T("invalid bitmap") ); + wxCHECK_RET( Ok(), T("invalid bitmap") ); if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask; @@ -330,7 +330,7 @@ void wxBitmap::SetMask( wxMask *mask ) bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(palette) ) { - wxCHECK_MSG( Ok(), FALSE, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), FALSE, T("invalid bitmap") ); if (type == wxBITMAP_TYPE_PNG) { @@ -420,14 +420,14 @@ void wxBitmap::SetPixmap( GdkPixmap *pixmap ) GdkPixmap *wxBitmap::GetPixmap() const { - wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, T("invalid bitmap") ); return M_BMPDATA->m_pixmap; } GdkBitmap *wxBitmap::GetBitmap() const { - wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, T("invalid bitmap") ); return M_BMPDATA->m_bitmap; } diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index b9226adabf..47f6662935 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -121,7 +121,7 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxBitmapButton creation failed") ); + wxFAIL_MSG( T("wxBitmapButton creation failed") ); return FALSE; } @@ -190,14 +190,14 @@ void wxBitmapButton::SetDefault() void wxBitmapButton::SetLabel( const wxString &label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); wxControl::SetLabel( label ); } wxString wxBitmapButton::GetLabel() const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid button") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid button") ); return wxControl::GetLabel(); } @@ -208,7 +208,7 @@ void wxBitmapButton::ApplyWidgetStyle() void wxBitmapButton::SetBitmap() { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); wxBitmap the_one; @@ -243,7 +243,7 @@ void wxBitmapButton::SetBitmap() void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); if ( ! m_disabled.Ok() ) return; m_disabled = bitmap; @@ -253,7 +253,7 @@ void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); if ( ! m_focus.Ok() ) return; m_focus = bitmap; @@ -263,7 +263,7 @@ void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); if (!m_bitmap.Ok()) return; m_bitmap = bitmap; @@ -273,7 +273,7 @@ void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); if ( ! m_selected.Ok() ) return; m_selected = bitmap; diff --git a/src/gtk/brush.cpp b/src/gtk/brush.cpp index ae8e34635c..a324ecea66 100644 --- a/src/gtk/brush.cpp +++ b/src/gtk/brush.cpp @@ -111,7 +111,7 @@ int wxBrush::GetStyle() const { if (m_refData == NULL) { - wxFAIL_MSG( _T("invalid brush") ); + wxFAIL_MSG( T("invalid brush") ); return 0; } @@ -122,7 +122,7 @@ wxColour &wxBrush::GetColour() const { if (m_refData == NULL) { - wxFAIL_MSG( _T("invalid brush") ); + wxFAIL_MSG( T("invalid brush") ); return wxNullColour; } @@ -133,7 +133,7 @@ wxBitmap *wxBrush::GetStipple() const { if (m_refData == NULL) { - wxFAIL_MSG( _T("invalid brush") ); + wxFAIL_MSG( T("invalid brush") ); return &wxNullBitmap; } diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 2bb626f031..0d2353b918 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -78,7 +78,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxButton creation failed") ); + wxFAIL_MSG( T("wxButton creation failed") ); return FALSE; } @@ -142,7 +142,7 @@ wxSize wxButton::GetDefaultSize() void wxButton::SetLabel( const wxString &label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); wxControl::SetLabel( label ); diff --git a/src/gtk/checkbox.cpp b/src/gtk/checkbox.cpp index af1d2592c3..a7763349d2 100644 --- a/src/gtk/checkbox.cpp +++ b/src/gtk/checkbox.cpp @@ -75,7 +75,7 @@ bool wxCheckBox::Create(wxWindow *parent, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxCheckBox creation failed") ); + wxFAIL_MSG( T("wxCheckBox creation failed") ); return FALSE; } @@ -136,7 +136,7 @@ bool wxCheckBox::Create(wxWindow *parent, void wxCheckBox::SetValue( bool state ) { - wxCHECK_RET( m_widgetCheckbox != NULL, _T("invalid checkbox") ); + wxCHECK_RET( m_widgetCheckbox != NULL, T("invalid checkbox") ); if (state == GetValue()) return; @@ -155,14 +155,14 @@ void wxCheckBox::SetValue( bool state ) bool wxCheckBox::GetValue() const { - wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, _T("invalid checkbox") ); + wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, T("invalid checkbox") ); return GTK_TOGGLE_BUTTON(m_widgetCheckbox)->active; } void wxCheckBox::SetLabel( const wxString& label ) { - wxCHECK_RET( m_widgetLabel != NULL, _T("invalid checkbox") ); + wxCHECK_RET( m_widgetLabel != NULL, T("invalid checkbox") ); wxControl::SetLabel( label ); diff --git a/src/gtk/checklst.cpp b/src/gtk/checklst.cpp index 6e97994417..5730929a86 100644 --- a/src/gtk/checklst.cpp +++ b/src/gtk/checklst.cpp @@ -44,7 +44,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id, bool wxCheckListBox::IsChecked( int index ) const { - wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid checklistbox") ); + wxCHECK_MSG( m_list != NULL, FALSE, T("invalid checklistbox") ); GList *child = g_list_nth( m_list->children, index ); if (child) @@ -54,16 +54,16 @@ bool wxCheckListBox::IsChecked( int index ) const wxString str = wxString(label->label,*wxConvCurrent); - return (str[1] == _T('X')); + return (str[1] == T('X')); } - wxFAIL_MSG(_T("wrong checklistbox index")); + wxFAIL_MSG(T("wrong checklistbox index")); return FALSE; } void wxCheckListBox::Check( int index, bool check ) { - wxCHECK_RET( m_list != NULL, _T("invalid checklistbox") ); + wxCHECK_RET( m_list != NULL, T("invalid checklistbox") ); GList *child = g_list_nth( m_list->children, index ); if (child) @@ -73,19 +73,19 @@ void wxCheckListBox::Check( int index, bool check ) wxString str = wxString(label->label,*wxConvCurrent); - if (check == (str[1] == _T('X'))) return; + if (check == (str[1] == T('X'))) return; if (check) - str.SetChar( 1, _T('X') ); + str.SetChar( 1, T('X') ); else - str.SetChar( 1, _T('-') ); + str.SetChar( 1, T('-') ); gtk_label_set( label, str.mbc_str() ); return; } - wxFAIL_MSG(_T("wrong checklistbox index")); + wxFAIL_MSG(T("wrong checklistbox index")); } int wxCheckListBox::GetItemHeight() const diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index c78d0a2e8f..21a697ce57 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -75,7 +75,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxChoice creation failed") ); + wxFAIL_MSG( T("wxChoice creation failed") ); return FALSE; } @@ -125,7 +125,7 @@ wxChoice::~wxChoice() void wxChoice::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); + wxCHECK_RET( m_widget != NULL, T("invalid choice") ); GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ); GtkWidget *menu_item = gtk_menu_item_new_with_label( item.mbc_str() ); @@ -172,7 +172,7 @@ void wxChoice::Append( const wxString &item, wxClientData *clientData ) void wxChoice::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -182,7 +182,7 @@ void wxChoice::SetClientData( int n, void* clientData ) void* wxChoice::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -192,7 +192,7 @@ void* wxChoice::GetClientData( int n ) void wxChoice::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -205,7 +205,7 @@ void wxChoice::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxChoice::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -215,7 +215,7 @@ wxClientData* wxChoice::GetClientObject( int n ) void wxChoice::Clear() { - wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); + wxCHECK_RET( m_widget != NULL, T("invalid choice") ); gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) ); GtkWidget *menu = gtk_menu_new(); @@ -235,12 +235,12 @@ void wxChoice::Clear() void wxChoice::Delete( int WXUNUSED(n) ) { - wxFAIL_MSG( _T("wxChoice:Delete not implemented") ); + wxFAIL_MSG( T("wxChoice:Delete not implemented") ); } int wxChoice::FindString( const wxString &string ) const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid choice") ); // If you read this code once and you think you understand // it, then you are very wrong. Robert Roebling. @@ -255,7 +255,7 @@ int wxChoice::FindString( const wxString &string ) const if (bin->child) label = GTK_LABEL(bin->child); if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); + wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") ); if (string == wxString(label->label,*wxConvCurrent)) return count; @@ -274,7 +274,7 @@ int wxChoice::GetColumns() const int wxChoice::GetSelection() { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -292,7 +292,7 @@ int wxChoice::GetSelection() wxString wxChoice::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -306,7 +306,7 @@ wxString wxChoice::GetString( int n ) const if (bin->child) label = GTK_LABEL(bin->child); if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); + wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") ); return wxString(label->label,*wxConvCurrent); } @@ -314,25 +314,25 @@ wxString wxChoice::GetString( int n ) const count++; } - wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") ); + wxFAIL_MSG( T("wxChoice: invalid index in GetString()") ); - return _T(""); + return T(""); } wxString wxChoice::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid choice") ); GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); + wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") ); return wxString(label->label,*wxConvCurrent); } int wxChoice::Number() const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -351,7 +351,7 @@ void wxChoice::SetColumns( int WXUNUSED(n) ) void wxChoice::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); + wxCHECK_RET( m_widget != NULL, T("invalid choice") ); int tmp = n; gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp ); @@ -359,7 +359,7 @@ void wxChoice::SetSelection( int n ) void wxChoice::SetStringSelection( const wxString &string ) { - wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); + wxCHECK_RET( m_widget != NULL, T("invalid choice") ); int n = FindString( string ); if (n != -1) SetSelection( n ); diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index d3cd53bc4e..29442366dc 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -450,7 +450,7 @@ void wxClipboard::Clear() bool wxClipboard::Open() { - wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") ); + wxCHECK_MSG( !m_open, FALSE, T("clipboard already open") ); m_open = TRUE; @@ -459,9 +459,9 @@ bool wxClipboard::Open() bool wxClipboard::SetData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); + wxCHECK_MSG( m_open, FALSE, T("clipboard not open") ); - wxCHECK_MSG( data, FALSE, _T("data is invalid") ); + wxCHECK_MSG( data, FALSE, T("data is invalid") ); Clear(); @@ -470,9 +470,9 @@ bool wxClipboard::SetData( wxDataObject *data ) bool wxClipboard::AddData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); + wxCHECK_MSG( m_open, FALSE, T("clipboard not open") ); - wxCHECK_MSG( data, FALSE, _T("data is invalid") ); + wxCHECK_MSG( data, FALSE, T("data is invalid") ); /* if clipboard has been cleared before, create new data broker */ if (!m_dataBroker) m_dataBroker = new wxDataBroker(); @@ -483,7 +483,7 @@ bool wxClipboard::AddData( wxDataObject *data ) /* get native format id of new data object */ GdkAtom format = data->GetFormat().GetAtom(); - wxCHECK_MSG( format, FALSE, _T("data has invalid format") ); + wxCHECK_MSG( format, FALSE, T("data has invalid format") ); /* This should happen automatically, but to be on the safe side */ m_ownsClipboard = FALSE; @@ -563,20 +563,20 @@ bool wxClipboard::AddData( wxDataObject *data ) void wxClipboard::Close() { - wxCHECK_RET( m_open, _T("clipboard not open") ); + wxCHECK_RET( m_open, T("clipboard not open") ); m_open = FALSE; } bool wxClipboard::IsSupported( wxDataFormat format ) { - wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); + wxCHECK_MSG( m_open, FALSE, T("clipboard not open") ); /* store requested format to be asked for by callbacks */ m_targetRequested = format.GetAtom(); - wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") ); + wxCHECK_MSG( m_targetRequested, FALSE, T("invalid clipboard format") ); m_formatSupported = FALSE; @@ -604,7 +604,7 @@ bool wxClipboard::IsSupported( wxDataFormat format ) bool wxClipboard::GetData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); + wxCHECK_MSG( m_open, FALSE, T("clipboard not open") ); /* is data supported by clipboard ? */ @@ -618,7 +618,7 @@ bool wxClipboard::GetData( wxDataObject *data ) m_targetRequested = data->GetFormat().GetAtom(); - wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") ); + wxCHECK_MSG( m_targetRequested, FALSE, T("invalid clipboard format") ); /* start query */ @@ -644,7 +644,7 @@ bool wxClipboard::GetData( wxDataObject *data ) /* this is a true error as we checked for the presence of such data before */ - wxCHECK_MSG( m_formatSupported, FALSE, _T("error retrieving data from clipboard") ); + wxCHECK_MSG( m_formatSupported, FALSE, T("error retrieving data from clipboard") ); return TRUE; } diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp index 51fde80c11..ac8a7022dd 100644 --- a/src/gtk/colour.cpp +++ b/src/gtk/colour.cpp @@ -91,8 +91,8 @@ void wxColour::InitFromName( const wxString &colourName ) m_refData = new wxColourRefData(); if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color )) { - wxFAIL_MSG( _T("wxColour: couldn't find colour") ); - wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName ); + wxFAIL_MSG( T("wxColour: couldn't find colour") ); + wxPrintf( T("Colourname %s.\n"), WXSTRINGCAST colourName ); delete m_refData; m_refData = (wxObjectRefData *) NULL; @@ -149,21 +149,21 @@ void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue ) unsigned char wxColour::Red() const { - wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); + wxCHECK_MSG( Ok(), 0, T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.red >> SHIFT); } unsigned char wxColour::Green() const { - wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); + wxCHECK_MSG( Ok(), 0, T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.green >> SHIFT); } unsigned char wxColour::Blue() const { - wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); + wxCHECK_MSG( Ok(), 0, T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT); } @@ -211,14 +211,14 @@ void wxColour::CalcPixel( GdkColormap *cmap ) int wxColour::GetPixel() const { - wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); + wxCHECK_MSG( Ok(), 0, T("invalid colour") ); return M_COLDATA->m_color.pixel; } GdkColor *wxColour::GetColor() const { - wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") ); + wxCHECK_MSG( Ok(), (GdkColor *) NULL, T("invalid colour") ); return &M_COLDATA->m_color; } diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index da4657688f..74ca53348b 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -104,7 +104,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxComboBox creation failed") ); + wxFAIL_MSG( T("wxComboBox creation failed") ); return FALSE; } @@ -180,7 +180,7 @@ wxComboBox::~wxComboBox() void wxComboBox::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -228,7 +228,7 @@ void wxComboBox::Append( const wxString &item, wxClientData *clientData ) void wxComboBox::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -238,7 +238,7 @@ void wxComboBox::SetClientData( int n, void* clientData ) void* wxComboBox::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -248,7 +248,7 @@ void* wxComboBox::GetClientData( int n ) void wxComboBox::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -261,7 +261,7 @@ void wxComboBox::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxComboBox::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -271,7 +271,7 @@ wxClientData* wxComboBox::GetClientObject( int n ) void wxComboBox::Clear() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; gtk_list_clear_items( GTK_LIST(list), 0, Number() ); @@ -290,7 +290,7 @@ void wxComboBox::Clear() void wxComboBox::Delete( int n ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkList *listbox = GTK_LIST( GTK_COMBO(m_widget)->list ); @@ -298,7 +298,7 @@ void wxComboBox::Delete( int n ) if (!child) { - wxFAIL_MSG(_T("wrong index")); + wxFAIL_MSG(T("wrong index")); return; } @@ -323,7 +323,7 @@ void wxComboBox::Delete( int n ) int wxComboBox::FindString( const wxString &item ) { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -344,7 +344,7 @@ int wxComboBox::FindString( const wxString &item ) int wxComboBox::GetSelection() const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -366,7 +366,7 @@ int wxComboBox::GetSelection() const wxString wxComboBox::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -380,7 +380,7 @@ wxString wxComboBox::GetString( int n ) const } else { - wxFAIL_MSG( _T("wxComboBox: wrong index") ); + wxFAIL_MSG( T("wxComboBox: wrong index") ); } return str; @@ -388,7 +388,7 @@ wxString wxComboBox::GetString( int n ) const wxString wxComboBox::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -400,14 +400,14 @@ wxString wxComboBox::GetStringSelection() const return tmp; } - wxFAIL_MSG( _T("wxComboBox: no selection") ); + wxFAIL_MSG( T("wxComboBox: no selection") ); - return _T(""); + return T(""); } int wxComboBox::Number() const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -419,7 +419,7 @@ int wxComboBox::Number() const void wxComboBox::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); DisableEvents(); @@ -431,7 +431,7 @@ void wxComboBox::SetSelection( int n ) void wxComboBox::SetStringSelection( const wxString &string ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); int res = FindString( string ); if (res == -1) return; @@ -447,17 +447,17 @@ wxString wxComboBox::GetValue() const void wxComboBox::SetValue( const wxString& value ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; - wxString tmp = _T(""); + wxString tmp = T(""); if (!value.IsNull()) tmp = value; gtk_entry_set_text( GTK_ENTRY(entry), tmp.mbc_str() ); } void wxComboBox::Copy() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -469,7 +469,7 @@ void wxComboBox::Copy() void wxComboBox::Cut() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -481,7 +481,7 @@ void wxComboBox::Cut() void wxComboBox::Paste() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -493,7 +493,7 @@ void wxComboBox::Paste() void wxComboBox::SetInsertionPoint( long pos ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_entry_set_position( GTK_ENTRY(entry), (int)pos ); @@ -501,7 +501,7 @@ void wxComboBox::SetInsertionPoint( long pos ) void wxComboBox::SetInsertionPointEnd() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); SetInsertionPoint( -1 ); } @@ -521,7 +521,7 @@ long wxComboBox::GetLastPosition() const void wxComboBox::Replace( long from, long to, const wxString& value ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); // FIXME: not quite sure how to do this method right in multibyte mode GtkWidget *entry = GTK_COMBO(m_widget)->entry; @@ -533,7 +533,7 @@ void wxComboBox::Replace( long from, long to, const wxString& value ) void wxComboBox::Remove(long from, long to) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); diff --git a/src/gtk/control.cpp b/src/gtk/control.cpp index 578b12cb9f..d69fae8dc1 100644 --- a/src/gtk/control.cpp +++ b/src/gtk/control.cpp @@ -39,13 +39,13 @@ wxControl::wxControl( wxWindow *parent, void wxControl::SetLabel( const wxString &label ) { m_label.Empty(); - for ( const wxChar *pc = label; *pc != _T('\0'); pc++ ) + for ( const wxChar *pc = label; *pc != T('\0'); pc++ ) { - if ( *pc == _T('&') ) + if ( *pc == T('&') ) { pc++; // skip it #if 0 // it would be unused anyhow for now - kbd interface not done yet - if ( *pc != _T('&') ) m_chAccel = *pc; + if ( *pc != T('&') ) m_chAccel = *pc; #endif } m_label << *pc; diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 7a47bd6bd9..b0f4363412 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -93,7 +93,7 @@ wxCursor::wxCursor( int cursorId ) case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break; */ default: - wxFAIL_MSG(_T("unsupported cursor type")); + wxFAIL_MSG(T("unsupported cursor type")); // will use the standard one case wxCURSOR_ARROW: @@ -168,7 +168,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) return; wxASSERT_MSG( !gs_savedCursor.Ok(), - _T("forgot to call wxEndBusyCursor, will leak memory") ); + T("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = g_globalCursor; diff --git a/src/gtk/data.cpp b/src/gtk/data.cpp index 2c366d7d29..063c74c4fe 100644 --- a/src/gtk/data.cpp +++ b/src/gtk/data.cpp @@ -142,46 +142,45 @@ wxColour wxNullColour; wxPalette wxNullPalette; /* Default window names */ -const wxChar *wxButtonNameStr = _T("button"); -const wxChar *wxCanvasNameStr = _T("canvas"); -const wxChar *wxCheckBoxNameStr = _T("check"); -const wxChar *wxChoiceNameStr = _T("choice"); -const wxChar *wxComboBoxNameStr = _T("comboBox"); -const wxChar *wxDialogNameStr = _T("dialog"); -const wxChar *wxFrameNameStr = _T("frame"); -const wxChar *wxGaugeNameStr = _T("gauge"); -const wxChar *wxStaticBoxNameStr = _T("groupBox"); -const wxChar *wxListBoxNameStr = _T("listBox"); -const wxChar *wxStaticTextNameStr = _T("message"); -const wxChar *wxStaticBitmapNameStr = _T("message"); -const wxChar *wxMultiTextNameStr = _T("multitext"); -const wxChar *wxPanelNameStr = _T("panel"); -const wxChar *wxRadioBoxNameStr = _T("radioBox"); -const wxChar *wxRadioButtonNameStr = _T("radioButton"); -const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton"); -const wxChar *wxScrollBarNameStr = _T("scrollBar"); -const wxChar *wxSliderNameStr = _T("slider"); -const wxChar *wxStaticNameStr = _T("static"); -const wxChar *wxTextCtrlWindowNameStr = _T("textWindow"); -const wxChar *wxTextCtrlNameStr = _T("text"); -const wxChar *wxVirtListBoxNameStr = _T("virtListBox"); -const wxChar *wxButtonBarNameStr = _T("buttonbar"); -const wxChar *wxEnhDialogNameStr = _T("Shell"); -const wxChar *wxToolBarNameStr = _T("toolbar"); -const wxChar *wxStatusLineNameStr = _T("status_line"); -const wxChar *wxEmptyString = _T(""); -const wxChar *wxGetTextFromUserPromptStr = _T("Input Text"); -const wxChar *wxMessageBoxCaptionStr = _T("Message"); -const wxChar *wxFileSelectorPromptStr = _T("Select a file"); -const wxChar *wxFileSelectorDefaultWildcardStr = _T("*"); -const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error"); -const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error"); -const wxChar *wxDirDialogNameStr = _T("wxDirCtrl"); -const wxChar *wxDirDialogDefaultFolderStr = _T("/"); +const wxChar *wxButtonNameStr = T("button"); +const wxChar *wxCanvasNameStr = T("canvas"); +const wxChar *wxCheckBoxNameStr = T("check"); +const wxChar *wxChoiceNameStr = T("choice"); +const wxChar *wxComboBoxNameStr = T("comboBox"); +const wxChar *wxDialogNameStr = T("dialog"); +const wxChar *wxFrameNameStr = T("frame"); +const wxChar *wxGaugeNameStr = T("gauge"); +const wxChar *wxStaticBoxNameStr = T("groupBox"); +const wxChar *wxListBoxNameStr = T("listBox"); +const wxChar *wxStaticTextNameStr = T("message"); +const wxChar *wxStaticBitmapNameStr = T("message"); +const wxChar *wxMultiTextNameStr = T("multitext"); +const wxChar *wxPanelNameStr = T("panel"); +const wxChar *wxRadioBoxNameStr = T("radioBox"); +const wxChar *wxRadioButtonNameStr = T("radioButton"); +const wxChar *wxBitmapRadioButtonNameStr = T("radioButton"); +const wxChar *wxScrollBarNameStr = T("scrollBar"); +const wxChar *wxSliderNameStr = T("slider"); +const wxChar *wxStaticNameStr = T("static"); +const wxChar *wxTextCtrlWindowNameStr = T("textWindow"); +const wxChar *wxTextCtrlNameStr = T("text"); +const wxChar *wxVirtListBoxNameStr = T("virtListBox"); +const wxChar *wxButtonBarNameStr = T("buttonbar"); +const wxChar *wxEnhDialogNameStr = T("Shell"); +const wxChar *wxToolBarNameStr = T("toolbar"); +const wxChar *wxStatusLineNameStr = T("status_line"); +const wxChar *wxGetTextFromUserPromptStr = T("Input Text"); +const wxChar *wxMessageBoxCaptionStr = T("Message"); +const wxChar *wxFileSelectorPromptStr = T("Select a file"); +const wxChar *wxFileSelectorDefaultWildcardStr = T("*"); +const wxChar *wxInternalErrorStr = T("wxWindows Internal Error"); +const wxChar *wxFatalErrorStr = T("wxWindows Fatal Error"); +const wxChar *wxDirDialogNameStr = T("wxDirCtrl"); +const wxChar *wxDirDialogDefaultFolderStr = T("/"); /* See wx/utils.h */ -const wxChar *wxFloatToStringStr = _T("%.2f"); -const wxChar *wxDoubleToStringStr = _T("%.2f"); +const wxChar *wxFloatToStringStr = T("%.2f"); +const wxChar *wxDoubleToStringStr = T("%.2f"); /* Dafaults for wxWindow etc. */ const wxSize wxDefaultSize(-1, -1); diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index 3af8442a63..8b217e7bc4 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -87,7 +87,7 @@ wxDataFormat::wxDataFormat( const GdkAtom atom ) m_type = wxDF_PRIVATE; m_id = gdk_atom_name( m_atom ); - if (m_id == _T("file:ALL")) + if (m_id == T("file:ALL")) { m_type = wxDF_FILENAME; } @@ -100,21 +100,21 @@ void wxDataFormat::SetType( wxDataFormatId type ) if (m_type == wxDF_TEXT) { - m_id = _T("STRING"); + m_id = T("STRING"); } else if (m_type == wxDF_BITMAP) { - m_id = _T("image/png"); + m_id = T("image/png"); } else if (m_type == wxDF_FILENAME) { - m_id = _T("file:ALL"); + m_id = T("file:ALL"); } else { - wxFAIL_MSG( _T("invalid dataformat") ); + wxFAIL_MSG( T("invalid dataformat") ); } m_hasAtom = FALSE; @@ -155,7 +155,7 @@ GdkAtom wxDataFormat::GetAtom() else if (m_type == wxDF_PRIVATE) { - m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE ); + m_atom = gdk_atom_intern( wxMBSTRINGCAST m_id.mbc_str(), FALSE ); } else if (m_type == wxDF_FILENAME) @@ -484,7 +484,7 @@ void wxPrivateDataObject::Free() wxPrivateDataObject::wxPrivateDataObject() { - wxString id = _T("application/"); + wxString id = T("application/"); id += wxTheApp->GetAppName(); m_format.SetId( id ); diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index e75b32227e..d0d94aaaf4 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -112,11 +112,11 @@ wxWindowDC::wxWindowDC( wxWindow *window ) m_isMemDC = FALSE; m_font = window->GetFont(); - wxASSERT_MSG( window, _T("DC needs a window") ); + wxASSERT_MSG( window, T("DC needs a window") ); GtkWidget *widget = window->m_wxwindow; - wxASSERT_MSG( widget, _T("DC needs a widget") ); + wxASSERT_MSG( widget, T("DC needs a widget") ); m_window = widget->window; @@ -154,18 +154,18 @@ wxWindowDC::~wxWindowDC() void wxWindowDC::DoFloodFill( long WXUNUSED(x), long WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style) ) { - wxFAIL_MSG( _T("wxWindowDC::DoFloodFill not implemented") ); + wxFAIL_MSG( T("wxWindowDC::DoFloodFill not implemented") ); } bool wxWindowDC::DoGetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const { - wxFAIL_MSG( _T("wxWindowDC::DoGetPixel not implemented") ); + wxFAIL_MSG( T("wxWindowDC::DoGetPixel not implemented") ); return FALSE; } void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) { @@ -179,7 +179,7 @@ void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 ) void wxWindowDC::DoCrossHair( long x, long y ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) { @@ -199,7 +199,7 @@ void wxWindowDC::DoCrossHair( long x, long y ) void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2, long xc, long yc ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); long xx1 = XLOG2DEV(x1); long yy1 = YLOG2DEV(y1); @@ -252,7 +252,7 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2, void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -281,7 +281,7 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou void wxWindowDC::DoDrawPoint( long x, long y ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if ((m_pen.GetStyle() != wxTRANSPARENT) && m_window) gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) ); @@ -291,7 +291,7 @@ void wxWindowDC::DoDrawPoint( long x, long y ) void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffset ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_pen.GetStyle() == wxTRANSPARENT) return; if (n <= 0) return; @@ -314,7 +314,7 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (n <= 0) return; @@ -350,7 +350,7 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoff void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -379,7 +379,7 @@ void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height ) void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height, double radius ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (radius < 0.0) radius = - radius * ((width < height) ? width : height); @@ -451,7 +451,7 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -485,9 +485,9 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, long x, long y, bool useMask ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); - wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") ); /* scale/translate size and position */ @@ -566,9 +566,9 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height, of the source dc, but scales correctly on the target dc and knows about possible mask information in a memory dc. */ - wxCHECK_MSG( Ok(), FALSE, _T("invalid window dc") ); + wxCHECK_MSG( Ok(), FALSE, T("invalid window dc") ); - wxCHECK_MSG( source, FALSE, _T("invalid source dc") ); + wxCHECK_MSG( source, FALSE, T("invalid source dc") ); if (!m_window) return FALSE; @@ -754,7 +754,7 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height, void wxWindowDC::DoDrawText( const wxString &text, long x, long y ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (!m_window) return; @@ -819,7 +819,7 @@ long wxWindowDC::GetCharHeight() const void wxWindowDC::Clear() { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (!m_window) return; @@ -854,7 +854,7 @@ void wxWindowDC::SetFont( const wxFont &font ) void wxWindowDC::SetPen( const wxPen &pen ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_pen == pen) return; @@ -985,7 +985,7 @@ void wxWindowDC::SetPen( const wxPen &pen ) void wxWindowDC::SetBrush( const wxBrush &brush ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_brush == brush) return; @@ -1027,7 +1027,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) /* CMB 21/7/98: Added SetBackground. Sets background brush * for Clear() and bg colour for shapes filled with cross-hatch brush */ - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_backgroundBrush == brush) return; @@ -1069,7 +1069,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) void wxWindowDC::SetLogicalFunction( int function ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_logicalFunction == function) return; @@ -1097,7 +1097,7 @@ void wxWindowDC::SetLogicalFunction( int function ) #endif default: { - wxFAIL_MSG( _T("unsupported logical function") ); + wxFAIL_MSG( T("unsupported logical function") ); break; } } @@ -1113,7 +1113,7 @@ void wxWindowDC::SetLogicalFunction( int function ) void wxWindowDC::SetTextForeground( const wxColour &col ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_textForegroundColour == col) return; @@ -1128,7 +1128,7 @@ void wxWindowDC::SetTextForeground( const wxColour &col ) void wxWindowDC::SetTextBackground( const wxColour &col ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_textBackgroundColour == col) return; @@ -1143,7 +1143,7 @@ void wxWindowDC::SetTextBackground( const wxColour &col ) void wxWindowDC::SetBackgroundMode( int mode ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); m_backgroundMode = mode; @@ -1161,12 +1161,12 @@ void wxWindowDC::SetBackgroundMode( int mode ) void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) ) { - wxFAIL_MSG( _T("wxWindowDC::SetPalette not implemented") ); + wxFAIL_MSG( T("wxWindowDC::SetPalette not implemented") ); } void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); wxDC::DoSetClippingRegion( x, y, width, height ); @@ -1185,7 +1185,7 @@ void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height ) void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (region.Empty()) { @@ -1203,7 +1203,7 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) void wxWindowDC::DestroyClippingRegion() { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); wxDC::DestroyClippingRegion(); @@ -1306,7 +1306,7 @@ wxSize wxWindowDC::GetPPI() const int wxWindowDC::GetDepth() const { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return -1; } @@ -1429,7 +1429,7 @@ static void wx_spline_draw_point_array(wxDC *dc) void wxWindowDC::DoDrawSpline( wxList *points ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); wxPoint *p; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 4869b9263f..275b1eb4e9 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -288,7 +288,7 @@ bool wxDialog::Create( wxWindow *parent, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxDialog creation failed") ); + wxFAIL_MSG( T("wxDialog creation failed") ); return FALSE; } @@ -356,7 +356,7 @@ wxDialog::~wxDialog() void wxDialog::SetTitle( const wxString& title ) { m_title = title; - if (m_title.IsNull()) m_title = _T(""); + if (m_title.IsNull()) m_title = T(""); gtk_window_set_title( GTK_WINDOW(m_widget), m_title.mbc_str() ); } @@ -442,7 +442,7 @@ bool wxDialog::Destroy() void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") ); #if wxUSE_CONSTRAINTS if (GetAutoLayout()) @@ -477,8 +477,8 @@ void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); - wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid dialog") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") ); + wxASSERT_MSG( (m_wxwindow != NULL), T("invalid dialog") ); if (m_resizing) return; /* I don't like recursions */ m_resizing = TRUE; @@ -567,7 +567,7 @@ void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int heigh void wxDialog::Centre( int direction ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") ); int x = 0; int y = 0; @@ -623,14 +623,14 @@ void wxDialog::SetModal( bool WXUNUSED(flag) ) else if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL; */ - wxFAIL_MSG( _T("wxDialog:SetModal obsolete now") ); + wxFAIL_MSG( T("wxDialog:SetModal obsolete now") ); } int wxDialog::ShowModal() { if (IsModal()) { - wxFAIL_MSG( _T("wxDialog:ShowModal called twice") ); + wxFAIL_MSG( T("wxDialog:ShowModal called twice") ); return GetReturnCode(); } @@ -653,7 +653,7 @@ void wxDialog::EndModal( int retCode ) if (!IsModal()) { - wxFAIL_MSG( _T("wxDialog:EndModal called twice") ); + wxFAIL_MSG( T("wxDialog:EndModal called twice") ); return; } diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index df6de3a991..7189c1286b 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -367,9 +367,9 @@ bool wxDropTarget::RequestData( wxDataFormat format ) if (!m_dragWidget) return FALSE; /* - wxPrintf( _T("format: %s.\n"), format.GetId().c_str() ); - if (format.GetType() == wxDF_PRIVATE) wxPrintf( _T("private data.\n") ); - if (format.GetType() == wxDF_TEXT) wxPrintf( _T("text data.\n") ); + wxPrintf( T("format: %s.\n"), format.GetId().c_str() ); + if (format.GetType() == wxDF_PRIVATE) wxPrintf( T("private data.\n") ); + if (format.GetType() == wxDF_TEXT) wxPrintf( T("text data.\n") ); */ #if wxUSE_THREADS @@ -437,7 +437,7 @@ bool wxDropTarget::GetData( wxDataObject *data_object ) void wxDropTarget::UnregisterWidget( GtkWidget *widget ) { - wxCHECK_RET( widget != NULL, _T("unregister widget is NULL") ); + wxCHECK_RET( widget != NULL, T("unregister widget is NULL") ); gtk_drag_dest_unset( widget ); @@ -456,7 +456,7 @@ void wxDropTarget::UnregisterWidget( GtkWidget *widget ) void wxDropTarget::RegisterWidget( GtkWidget *widget ) { - wxCHECK_RET( widget != NULL, _T("register widget is NULL") ); + wxCHECK_RET( widget != NULL, T("register widget is NULL") ); /* gtk_drag_dest_set() determines what default behaviour we'd like GTK to supply. we don't want to specify out targets (=formats) @@ -817,7 +817,7 @@ wxDropSource::~wxDropSource(void) wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) { - wxASSERT_MSG( m_data, _T("wxDragSource: no data") ); + wxASSERT_MSG( m_data, T("wxDragSource: no data") ); if (!m_data) return (wxDragResult) wxDragNone; diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index f2c2c99011..65552158fd 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -117,14 +117,14 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message, m_needParent = FALSE; if (!PreCreation( parent, pos, wxDefaultSize ) || - !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, _T("filedialog") )) + !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, T("filedialog") )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return; } m_message = message; - m_path = _T(""); + m_path = T(""); m_fileName = defaultFileName; m_dir = defaultDir; m_wildCard = wildCard; @@ -141,7 +141,7 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message, gtk_file_selection_hide_fileop_buttons( sel ); // they don't work anyway m_path.Append(m_dir); - if( ! m_path.IsEmpty() && m_path.Last()!=_T('/') ) + if( ! m_path.IsEmpty() && m_path.Last()!=T('/') ) m_path.Append('/'); m_path.Append(m_fileName); @@ -173,7 +173,7 @@ void wxFileDialog::SetPath(const wxString& path) wxSplitPath(path, &m_dir, &m_fileName, &ext); if (!ext.IsEmpty()) { - m_fileName += _T("."); + m_fileName += T("."); m_fileName += ext; } } @@ -194,7 +194,7 @@ wxFileSelectorEx(const wxChar *message, int x, int y) { // TODO: implement this somehow - return wxFileSelector(message, default_path, default_filename, _T(""), + return wxFileSelector(message, default_path, default_filename, T(""), wildcard, flags, parent, x, y); } @@ -205,7 +205,7 @@ wxString wxFileSelector( const wxChar *title, { wxString filter2; if ( defaultExtension && !filter ) - filter2 = wxString(_T("*.")) + wxString(defaultExtension) ; + filter2 = wxString(T("*.")) + wxString(defaultExtension) ; else if ( filter ) filter2 = filter; @@ -237,9 +237,9 @@ wxString wxLoadFileSelector( const wxChar *what, const wxChar *extension, const wxString str = _("Load %s file"); wxSprintf(prompt, str, what); - if (*ext == _T('.')) ext++; + if (*ext == T('.')) ext++; wxChar wild[60]; - wxSprintf(wild, _T("*.%s"), ext); + wxSprintf(wild, T("*.%s"), ext); return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent); } @@ -253,9 +253,9 @@ wxString wxSaveFileSelector(const wxChar *what, const wxChar *extension, const w wxString str = _("Save %s file"); wxSprintf(prompt, str, what); - if (*ext == _T('.')) ext++; + if (*ext == T('.')) ext++; wxChar wild[60]; - wxSprintf(wild, _T("*.%s"), ext); + wxSprintf(wild, T("*.%s"), ext); return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent); } diff --git a/src/gtk/font.cpp b/src/gtk/font.cpp index ec3b8427b2..c27134680f 100644 --- a/src/gtk/font.cpp +++ b/src/gtk/font.cpp @@ -162,18 +162,18 @@ wxFont::wxFont( GdkFont *WXUNUSED(font), char *xFontName ) wxString tmp; wxString fontname( xFontName ); - wxStringTokenizer tn( fontname, _T("-") ); + wxStringTokenizer tn( fontname, T("-") ); tn.GetNextToken(); // foundry M_FONTDATA->m_faceName = tn.GetNextToken(); // courier tmp = tn.GetNextToken().MakeUpper(); - if (tmp == _T("BOLD")) M_FONTDATA->m_weight = wxBOLD; + if (tmp == T("BOLD")) M_FONTDATA->m_weight = wxBOLD; tmp = tn.GetNextToken().MakeUpper(); - if (tmp == _T("I")) M_FONTDATA->m_style = wxITALIC; - if (tmp == _T("O")) M_FONTDATA->m_style = wxITALIC; + if (tmp == T("I")) M_FONTDATA->m_style = wxITALIC; + if (tmp == T("O")) M_FONTDATA->m_style = wxITALIC; tn.GetNextToken(); // set width tn.GetNextToken(); // ? @@ -187,12 +187,12 @@ wxFont::wxFont( GdkFont *WXUNUSED(font), char *xFontName ) tn.GetNextToken(); // y-res tmp = tn.GetNextToken().MakeUpper(); - if (tmp == _T("M")) M_FONTDATA->m_family = wxMODERN; - else if (M_FONTDATA->m_faceName == _T("TIMES")) M_FONTDATA->m_family = wxROMAN; - else if (M_FONTDATA->m_faceName == _T("HELVETICA")) M_FONTDATA->m_family = wxSWISS; - else if (M_FONTDATA->m_faceName == _T("LUCIDATYPEWRITER")) M_FONTDATA->m_family = wxTELETYPE; - else if (M_FONTDATA->m_faceName == _T("LUCIDA")) M_FONTDATA->m_family = wxDECORATIVE; - else if (M_FONTDATA->m_faceName == _T("UTOPIA")) M_FONTDATA->m_family = wxSCRIPT; + if (tmp == T("M")) M_FONTDATA->m_family = wxMODERN; + else if (M_FONTDATA->m_faceName == T("TIMES")) M_FONTDATA->m_family = wxROMAN; + else if (M_FONTDATA->m_faceName == T("HELVETICA")) M_FONTDATA->m_family = wxSWISS; + else if (M_FONTDATA->m_faceName == T("LUCIDATYPEWRITER")) M_FONTDATA->m_family = wxTELETYPE; + else if (M_FONTDATA->m_faceName == T("LUCIDA")) M_FONTDATA->m_family = wxDECORATIVE; + else if (M_FONTDATA->m_faceName == T("UTOPIA")) M_FONTDATA->m_family = wxSCRIPT; } bool wxFont::Create( int pointSize, @@ -235,42 +235,42 @@ wxFont::~wxFont() int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, _T("invalid font") ); + wxCHECK_MSG( Ok(), 0, T("invalid font") ); return M_FONTDATA->m_pointSize; } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), _T(""), _T("invalid font") ); + wxCHECK_MSG( Ok(), T(""), T("invalid font") ); return M_FONTDATA->m_faceName; } int wxFont::GetFamily() const { - wxCHECK_MSG( Ok(), 0, _T("invalid font") ); + wxCHECK_MSG( Ok(), 0, T("invalid font") ); return M_FONTDATA->m_family; } int wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), 0, _T("invalid font") ); + wxCHECK_MSG( Ok(), 0, T("invalid font") ); return M_FONTDATA->m_style; } int wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), 0, _T("invalid font") ); + wxCHECK_MSG( Ok(), 0, T("invalid font") ); return M_FONTDATA->m_weight; } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), FALSE, _T("invalid font") ); + wxCHECK_MSG( Ok(), FALSE, T("invalid font") ); return M_FONTDATA->m_underlined; } @@ -278,7 +278,7 @@ bool wxFont::GetUnderlined() const wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, _T("invalid font") ); + wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, T("invalid font") ); return M_FONTDATA->m_encoding; } @@ -344,7 +344,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const { if (!Ok()) { - wxFAIL_MSG( _T("invalid font") ); + wxFAIL_MSG( T("invalid font") ); return (GdkFont*) NULL; } @@ -387,7 +387,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const if (!font) { - wxLogError(_T("could not load any font")); + wxLogError(T("could not load any font")); } return font; diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp index 163c546614..a7808d8ba0 100644 --- a/src/gtk/fontdlg.cpp +++ b/src/gtk/fontdlg.cpp @@ -106,13 +106,13 @@ wxFontDialog::wxFontDialog( wxWindow *parent, wxFontData *WXUNUSED(data) ) if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, - wxDefaultValidator, _T("fontdialog") )) + wxDefaultValidator, T("fontdialog") )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return; } #ifndef __WXGTK12__ - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( T("TODO") ); #else // GTK+ 1.2 wxString m_message( _("Choose font") ); m_widget = gtk_font_selection_dialog_new( m_message.mbc_str() ); diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 07944b9b68..3065a36071 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -365,7 +365,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxFrame creation failed") ); + wxFAIL_MSG( T("wxFrame creation failed") ); return FALSE; } @@ -382,7 +382,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() ); #ifdef __WXDEBUG__ - debug_focus_in( m_widget, _T("wxFrame::m_widget"), name ); + debug_focus_in( m_widget, T("wxFrame::m_widget"), name ); #endif gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() ); @@ -398,7 +398,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget ); #ifdef __WXDEBUG__ - debug_focus_in( m_mainWidget, _T("wxFrame::m_mainWidget"), name ); + debug_focus_in( m_mainWidget, T("wxFrame::m_mainWidget"), name ); #endif /* m_wxwindow only represents the client area without toolbar and menubar */ @@ -407,7 +407,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow ); #ifdef __WXDEBUG__ - debug_focus_in( m_wxwindow, _T("wxFrame::m_wxwindow"), name ); + debug_focus_in( m_wxwindow, T("wxFrame::m_wxwindow"), name ); #endif /* we donm't allow the frame to get the focus as otherwise @@ -462,7 +462,7 @@ wxFrame::~wxFrame() bool wxFrame::Show( bool show ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); if (show && !m_sizeSet) { @@ -479,7 +479,7 @@ bool wxFrame::Show( bool show ) bool wxFrame::Destroy() { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this); @@ -488,10 +488,10 @@ bool wxFrame::Destroy() void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); /* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */ - wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") ); /* avoid recursions */ if (m_resizing) return; @@ -553,7 +553,7 @@ void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) void wxFrame::Centre( int direction ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); int x = 0; int y = 0; @@ -566,7 +566,7 @@ void wxFrame::Centre( int direction ) void wxFrame::DoGetClientSize( int *width, int *height ) const { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); wxWindow::DoGetClientSize( width, height ); if (height) @@ -611,7 +611,7 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const void wxFrame::DoSetClientSize( int width, int height ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); /* menu bar */ if (m_frameMenuBar) @@ -656,7 +656,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height m_resizing = TRUE; /* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */ - wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") ); m_width = width; m_height = height; @@ -813,7 +813,7 @@ void wxFrame::OnCloseWindow( wxCloseEvent& WXUNUSED(event) ) void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); #if wxUSE_CONSTRAINTS if (GetAutoLayout()) @@ -853,8 +853,8 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) void wxFrame::SetMenuBar( wxMenuBar *menuBar ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); - wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); + wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") ); m_frameMenuBar = menuBar; @@ -920,9 +920,9 @@ void wxFrame::OnMenuHighlight(wxMenuEvent& event) #if wxUSE_TOOLBAR wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& name ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); - wxCHECK_MSG( m_frameToolBar == NULL, FALSE, _T("recreating toolbar in wxFrame") ); + wxCHECK_MSG( m_frameToolBar == NULL, FALSE, T("recreating toolbar in wxFrame") ); m_insertInClientArea = FALSE; @@ -951,9 +951,9 @@ wxToolBar *wxFrame::GetToolBar() const #if wxUSE_STATUSBAR wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, const wxString& name ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); - wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, _T("recreating status bar in wxFrame") ); + wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, T("recreating status bar in wxFrame") ); m_frameStatusBar = OnCreateStatusBar( number, style, id, name ); @@ -990,18 +990,18 @@ wxStatusBar *wxFrame::GetStatusBar() const void wxFrame::SetStatusText(const wxString& text, int number) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); - wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set text for") ); + wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set text for") ); m_frameStatusBar->SetStatusText(text, number); } void wxFrame::SetStatusWidths(int n, const int widths_field[] ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); - wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set widths for") ); + wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set widths for") ); m_frameStatusBar->SetStatusWidths(n, widths_field); } @@ -1029,16 +1029,16 @@ void wxFrame::Command( int id ) void wxFrame::SetTitle( const wxString &title ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); m_title = title; - if (m_title.IsNull()) m_title = _T(""); + if (m_title.IsNull()) m_title = T(""); gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() ); } void wxFrame::SetIcon( const wxIcon &icon ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); m_icon = icon; if (!icon.Ok()) return; diff --git a/src/gtk/gauge.cpp b/src/gtk/gauge.cpp index 35d9ad6f37..46c3fbdb9f 100644 --- a/src/gtk/gauge.cpp +++ b/src/gtk/gauge.cpp @@ -33,7 +33,7 @@ bool wxGauge::Create( wxWindow *parent, wxWindowID id, int range, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxGauge creation failed") ); + wxFAIL_MSG( T("wxGauge creation failed") ); return FALSE; } diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index c27795d42e..4228d0d923 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -259,7 +259,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxListBox creation failed") ); + wxFAIL_MSG( T("wxListBox creation failed") ); return FALSE; } @@ -369,11 +369,11 @@ wxListBox::~wxListBox() void wxListBox::InsertItems(int nItems, const wxString items[], int pos) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); GList *children = m_list->children; int length = g_list_length(children); - wxCHECK_RET( pos <= length, _T("invalid index in wxListBox::InsertItems") ); + wxCHECK_RET( pos <= length, T("invalid index in wxListBox::InsertItems") ); // VZ: it seems that GTK 1.0.6 doesn't has a function to insert an item // into a listbox at the given position, this is why we first delete @@ -471,7 +471,7 @@ void wxListBox::InsertItems(int nItems, const wxString items[], int pos) void wxListBox::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); GtkWidget *list_item; @@ -570,7 +570,7 @@ void wxListBox::Append( const wxString &item, wxClientData *clientData ) void wxListBox::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -580,7 +580,7 @@ void wxListBox::SetClientData( int n, void* clientData ) void* wxListBox::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -590,7 +590,7 @@ void* wxListBox::GetClientData( int n ) void wxListBox::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -603,7 +603,7 @@ void wxListBox::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxListBox::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -613,7 +613,7 @@ wxClientData* wxListBox::GetClientObject( int n ) void wxListBox::Clear() { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); gtk_list_clear_items( m_list, 0, Number() ); @@ -631,11 +631,11 @@ void wxListBox::Clear() void wxListBox::Delete( int n ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); GList *child = g_list_nth( m_list->children, n ); - wxCHECK_RET( child, _T("wrong listbox index") ); + wxCHECK_RET( child, T("wrong listbox index") ); GList *list = g_list_append( (GList*) NULL, child->data ); gtk_list_remove_items( m_list, list ); @@ -658,7 +658,7 @@ void wxListBox::Delete( int n ) void wxListBox::Deselect( int n ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); DisableEvents(); @@ -669,7 +669,7 @@ void wxListBox::Deselect( int n ) int wxListBox::FindString( const wxString &item ) const { - wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") ); GList *child = m_list->children; int count = 0; @@ -694,7 +694,7 @@ int wxListBox::FindString( const wxString &item ) const int wxListBox::GetSelection() const { - wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") ); GList *child = m_list->children; int count = 0; @@ -709,7 +709,7 @@ int wxListBox::GetSelection() const int wxListBox::GetSelections( wxArrayInt& aSelections ) const { - wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") ); // get the number of selected items first GList *child = m_list->children; @@ -739,7 +739,7 @@ int wxListBox::GetSelections( wxArrayInt& aSelections ) const wxString wxListBox::GetString( int n ) const { - wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") ); GList *child = g_list_nth( m_list->children, n ); if (child) @@ -752,14 +752,14 @@ wxString wxListBox::GetString( int n ) const return str; } - wxFAIL_MSG(_T("wrong listbox index")); + wxFAIL_MSG(T("wrong listbox index")); - return _T(""); + return T(""); } wxString wxListBox::GetStringSelection() const { - wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") ); GList *selection = m_list->selection; if (selection) @@ -772,13 +772,13 @@ wxString wxListBox::GetStringSelection() const return str; } - wxFAIL_MSG(_T("no listbox selection available")); - return _T(""); + wxFAIL_MSG(T("no listbox selection available")); + return T(""); } int wxListBox::Number() { - wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") ); GList *child = m_list->children; int count = 0; @@ -788,7 +788,7 @@ int wxListBox::Number() bool wxListBox::Selected( int n ) { - wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, FALSE, T("invalid listbox") ); GList *target = g_list_nth( m_list->children, n ); if (target) @@ -800,28 +800,28 @@ bool wxListBox::Selected( int n ) child = child->next; } } - wxFAIL_MSG(_T("wrong listbox index")); + wxFAIL_MSG(T("wrong listbox index")); return FALSE; } void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) ) { - wxFAIL_MSG(_T("wxListBox::Set not implemented")); + wxFAIL_MSG(T("wxListBox::Set not implemented")); } void wxListBox::SetFirstItem( int WXUNUSED(n) ) { - wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented")); + wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented")); } void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) ) { - wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented")); + wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented")); } void wxListBox::SetSelection( int n, bool select ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); DisableEvents(); @@ -835,7 +835,7 @@ void wxListBox::SetSelection( int n, bool select ) void wxListBox::SetString( int n, const wxString &string ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); GList *child = g_list_nth( m_list->children, n ); if (child) @@ -854,13 +854,13 @@ void wxListBox::SetString( int n, const wxString &string ) } else { - wxFAIL_MSG(_T("wrong listbox index")); + wxFAIL_MSG(T("wrong listbox index")); } } void wxListBox::SetStringSelection( const wxString &string, bool select ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); SetSelection( FindString(string), select ); } @@ -896,7 +896,7 @@ void wxListBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) #if wxUSE_DRAG_AND_DROP void wxListBox::SetDropTarget( wxDropTarget *dropTarget ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); #ifndef NEW_GTK_DND_CODE if (m_dropTarget) diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp index 784dc97f73..cb14533ce2 100644 --- a/src/gtk/mdi.cpp +++ b/src/gtk/mdi.cpp @@ -319,7 +319,7 @@ void wxMDIChildFrame::AddChild( wxWindowBase *child ) void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar ) { - wxASSERT_MSG( m_menuBar == NULL, _T("Only one menubar allowed") ); + wxASSERT_MSG( m_menuBar == NULL, T("Only one menubar allowed") ); m_menuBar = menu_bar; @@ -431,9 +431,9 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style ) m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI; if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || - !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("wxMDIClientWindow") )) + !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, T("wxMDIClientWindow") )) { - wxFAIL_MSG( _T("wxMDIClientWindow creation failed") ); + wxFAIL_MSG( T("wxMDIClientWindow creation failed") ); return FALSE; } diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index 6b95c406e7..d3ebf032d7 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -41,9 +41,9 @@ wxMenuBar::wxMenuBar( long style ) m_invokingWindow = (wxWindow*) NULL; if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) || - !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("menubar") )) + !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, T("menubar") )) { - wxFAIL_MSG( _T("wxMenuBar creation failed") ); + wxFAIL_MSG( T("wxMenuBar creation failed") ); return; } @@ -80,9 +80,9 @@ wxMenuBar::wxMenuBar() m_invokingWindow = (wxWindow*) NULL; if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) || - !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("menubar") )) + !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, T("menubar") )) { - wxFAIL_MSG( _T("wxMenuBar creation failed") ); + wxFAIL_MSG( T("wxMenuBar creation failed") ); return; } @@ -202,22 +202,22 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title ) /* GTK 1.2 wants to have "_" instead of "&" for accelerators */ wxString str; - for ( pc = title; *pc != _T('\0'); pc++ ) + for ( pc = title; *pc != T('\0'); pc++ ) { - if (*pc == _T('&')) + if (*pc == T('&')) { #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) - str << _T('_'); + str << T('_'); } - else if (*pc == _T('/')) + else if (*pc == T('/')) { - str << _T('\\'); + str << T('\\'); #endif } else { #if __WXGTK12__ - if ( *pc == _T('_') ) + if ( *pc == T('_') ) { // underscores must be doubled to prevent them from being // interpreted as accelerator character prefix by GTK @@ -237,7 +237,7 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title ) /* local buffer in multibyte form */ wxString buf; - buf << _T('/') << str.c_str(); + buf << T('/') << str.c_str(); char *cbuf = new char[buf.Length()+1]; strcpy(cbuf, buf.mbc_str()); @@ -251,13 +251,13 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title ) gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */ /* in order to get the pointer to the item we need the item text _without_ underscores */ - wxString tmp = _T("

    /"); - for ( pc = str; *pc != _T('\0'); pc++ ) + wxString tmp = T("
    /"); + for ( pc = str; *pc != T('\0'); pc++ ) { // contrary to the common sense, we must throw out _all_ underscores, // (i.e. "Hello__World" => "HelloWorld" and not "Hello_World" as we // might naively think). IMHO it's a bug in GTK+ (VZ) - while (*pc == _T('_')) + while (*pc == T('_')) pc++; tmp << *pc; } @@ -364,7 +364,7 @@ void wxMenuBar::Check( int id, bool check ) { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_RET( item, _T("wxMenuBar::Check: no such item") ); + wxCHECK_RET( item, T("wxMenuBar::Check: no such item") ); item->Check(check); } @@ -373,7 +373,7 @@ bool wxMenuBar::IsChecked( int id ) const { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked: no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsChecked: no such item") ); return item->IsChecked(); } @@ -382,7 +382,7 @@ void wxMenuBar::Enable( int id, bool enable ) { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_RET( item, _T("wxMenuBar::Enable: no such item") ); + wxCHECK_RET( item, T("wxMenuBar::Enable: no such item") ); item->Enable(enable); } @@ -391,7 +391,7 @@ bool wxMenuBar::IsEnabled( int id ) const { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled: no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsEnabled: no such item") ); return item->IsEnabled(); } @@ -400,7 +400,7 @@ wxString wxMenuBar::GetLabel( int id ) const { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetLabel: no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenuBar::GetLabel: no such item") ); return item->GetText(); } @@ -409,7 +409,7 @@ void wxMenuBar::SetLabel( int id, const wxString &label ) { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_RET( item, _T("wxMenuBar::SetLabel: no such item") ); + wxCHECK_RET( item, T("wxMenuBar::SetLabel: no such item") ); item->SetText( label ); } @@ -418,7 +418,7 @@ void wxMenuBar::EnableTop( int pos, bool flag ) { wxNode *node = m_menus.Nth( pos ); - wxCHECK_RET( node, _T("menu not found") ); + wxCHECK_RET( node, T("menu not found") ); wxMenu* menu = (wxMenu*)node->Data(); @@ -430,7 +430,7 @@ wxString wxMenuBar::GetLabelTop( int pos ) const { wxNode *node = m_menus.Nth( pos ); - wxCHECK_MSG( node, _T("invalid"), _T("menu not found") ); + wxCHECK_MSG( node, T("invalid"), T("menu not found") ); wxMenu* menu = (wxMenu*)node->Data(); @@ -441,7 +441,7 @@ void wxMenuBar::SetLabelTop( int pos, const wxString& label ) { wxNode *node = m_menus.Nth( pos ); - wxCHECK_RET( node, _T("menu not found") ); + wxCHECK_RET( node, T("menu not found") ); wxMenu* menu = (wxMenu*)node->Data(); @@ -452,7 +452,7 @@ void wxMenuBar::SetHelpString( int id, const wxString& helpString ) { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_RET( item, _T("wxMenuBar::SetHelpString: no such item") ); + wxCHECK_RET( item, T("wxMenuBar::SetHelpString: no such item") ); item->SetHelp( helpString ); } @@ -461,7 +461,7 @@ wxString wxMenuBar::GetHelpString( int id ) const { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetHelpString: no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenuBar::GetHelpString: no such item") ); return item->GetHelp(); } @@ -483,7 +483,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) return; wxMenuItem* item = menu->FindItem( id ); - wxCHECK_RET( item, _T("error in menu item callback") ); + wxCHECK_RET( item, T("error in menu item callback") ); if (item->IsCheckable()) { @@ -588,22 +588,22 @@ wxMenuItem::wxMenuItem() void wxMenuItem::SetName( const wxString& str ) { /* '\t' is the deliminator indicating a hot key */ - m_text = _T(""); + m_text = T(""); const wxChar *pc = str; - for (; (*pc != _T('\0')) && (*pc != _T('\t')); pc++ ) + for (; (*pc != T('\0')) && (*pc != T('\t')); pc++ ) { - if (*pc == _T('&')) + if (*pc == T('&')) { #if (GTK_MINOR_VERSION > 0) - m_text << _T('_'); + m_text << T('_'); } - else if ( *pc == _T('_') ) // escape underscores + else if ( *pc == T('_') ) // escape underscores { - m_text << _T("__"); + m_text << T("__"); } - else if (*pc == _T('/')) /* we have to filter out slashes ... */ + else if (*pc == T('/')) /* we have to filter out slashes ... */ { - m_text << _T('\\'); /* ... and replace them with back slashes */ + m_text << T('\\'); /* ... and replace them with back slashes */ #endif } else @@ -611,9 +611,9 @@ void wxMenuItem::SetName( const wxString& str ) } /* only GTK 1.2 knows about hot keys */ - m_hotKey = _T(""); + m_hotKey = T(""); #if (GTK_MINOR_VERSION > 0) - if(*pc == _T('\t')) + if(*pc == T('\t')) { pc++; m_hotKey = pc; @@ -629,9 +629,9 @@ void wxMenuItem::SetName( const wxString& str ) void wxMenuItem::Check( bool check ) { - wxCHECK_RET( m_menuItem, _T("invalid menu item") ); + wxCHECK_RET( m_menuItem, T("invalid menu item") ); - wxCHECK_RET( IsCheckable(), _T("Can't check uncheckable item!") ) + wxCHECK_RET( IsCheckable(), T("Can't check uncheckable item!") ) if (check == m_isChecked) return; @@ -641,7 +641,7 @@ void wxMenuItem::Check( bool check ) void wxMenuItem::Enable( bool enable ) { - wxCHECK_RET( m_menuItem, _T("invalid menu item") ); + wxCHECK_RET( m_menuItem, T("invalid menu item") ); gtk_widget_set_sensitive( m_menuItem, enable ); m_isEnabled = enable; @@ -649,7 +649,7 @@ void wxMenuItem::Enable( bool enable ) bool wxMenuItem::IsChecked() const { - wxCHECK_MSG( m_menuItem, FALSE, _T("invalid menu item") ); + wxCHECK_MSG( m_menuItem, FALSE, T("invalid menu item") ); wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item! @@ -688,8 +688,8 @@ wxMenu::Init( const wxString& title, m_eventHandler = this; m_clientData = (void*) NULL; - if (m_title.IsNull()) m_title = _T(""); - if (m_title != _T("")) + if (m_title.IsNull()) m_title = T(""); + if (m_title != T("")) { Append(-2, m_title); AppendSeparator(); @@ -767,27 +767,27 @@ static char* GetHotKey( const wxString &hotkey, char *hotbuf ) switch (hotkey[0]) { - case _T('a'): /* Alt */ - case _T('A'): - case _T('m'): /* Meta */ - case _T('M'): + case T('a'): /* Alt */ + case T('A'): + case T('m'): /* Meta */ + case T('M'): { strcpy( hotbuf, "" ); wxString last = hotkey.Right(1); strcat( hotbuf, last.mb_str() ); return hotbuf; } - case _T('c'): /* Ctrl */ - case _T('C'): - case _T('s'): /* Strg, yeah man, I'm German */ - case _T('S'): + case T('c'): /* Ctrl */ + case T('C'): + case T('s'): /* Strg, yeah man, I'm German */ + case T('S'): { strcpy( hotbuf, "" ); wxString last = hotkey.Right(1); strcat( hotbuf, last.mb_str() ); return hotbuf; } - case _T('F'): /* function keys */ + case T('F'): /* function keys */ { strcpy( hotbuf, hotkey.mb_str() ); return hotbuf; @@ -832,10 +832,10 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */ /* in order to get the pointer to the item we need the item text _without_ underscores */ - wxString s = _T("
    /"); - for ( const wxChar *pc = text; *pc != _T('\0'); pc++ ) + wxString s = T("
    /"); + for ( const wxChar *pc = text; *pc != T('\0'); pc++ ) { - while (*pc == _T('_')) pc++; /* skip it */ + while (*pc == T('_')) pc++; /* skip it */ s << *pc; } @@ -893,10 +893,10 @@ void wxMenu::Append( int id, const wxString &item, wxMenu *subMenu, const wxStri gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */ /* in order to get the pointer to the item we need the item text _without_ underscores */ - wxString s = _T("
    /"); - for ( const wxChar *pc = text; *pc != _T('\0'); pc++ ) + wxString s = T("
    /"); + for ( const wxChar *pc = text; *pc != T('\0'); pc++ ) { - if (*pc == _T('_')) pc++; /* skip it */ + if (*pc == T('_')) pc++; /* skip it */ s << *pc; } @@ -966,14 +966,14 @@ void wxMenu::Append( wxMenuItem *item ) int wxMenu::FindItem( const wxString itemString ) const { - wxString s = _T(""); - for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ ) + wxString s = T(""); + for ( const wxChar *pc = itemString; *pc != T('\0'); pc++ ) { - if (*pc == _T('&')) + if (*pc == T('&')) { pc++; /* skip it */ #if (GTK_MINOR_VERSION > 0) - s << _T('_'); + s << T('_'); #endif } s << *pc; @@ -997,7 +997,7 @@ void wxMenu::Enable( int id, bool enable ) { wxMenuItem *item = FindItem(id); - wxCHECK_RET( item, _T("wxMenu::Enable: no such item") ); + wxCHECK_RET( item, T("wxMenu::Enable: no such item") ); item->Enable(enable); } @@ -1006,7 +1006,7 @@ bool wxMenu::IsEnabled( int id ) const { wxMenuItem *item = FindItem(id); - wxCHECK_MSG( item, FALSE, _T("wxMenu::IsEnabled: no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenu::IsEnabled: no such item") ); return item->IsEnabled(); } @@ -1015,7 +1015,7 @@ void wxMenu::Check( int id, bool enable ) { wxMenuItem *item = FindItem(id); - wxCHECK_RET( item, _T("wxMenu::Check: no such item") ); + wxCHECK_RET( item, T("wxMenu::Check: no such item") ); item->Check(enable); } @@ -1024,7 +1024,7 @@ bool wxMenu::IsChecked( int id ) const { wxMenuItem *item = FindItem(id); - wxCHECK_MSG( item, FALSE, _T("wxMenu::IsChecked: no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenu::IsChecked: no such item") ); return item->IsChecked(); } @@ -1033,7 +1033,7 @@ void wxMenu::SetLabel( int id, const wxString &label ) { wxMenuItem *item = FindItem(id); - wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") ); + wxCHECK_RET( item, T("wxMenu::SetLabel: no such item") ); item->SetText(label); } @@ -1042,7 +1042,7 @@ wxString wxMenu::GetLabel( int id ) const { wxMenuItem *item = FindItem(id); - wxCHECK_MSG( item, _T(""), _T("wxMenu::GetLabel: no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenu::GetLabel: no such item") ); return item->GetText(); } @@ -1051,7 +1051,7 @@ void wxMenu::SetHelpString( int id, const wxString& helpString ) { wxMenuItem *item = FindItem(id); - wxCHECK_RET( item, _T("wxMenu::SetHelpString: no such item") ); + wxCHECK_RET( item, T("wxMenu::SetHelpString: no such item") ); item->SetHelp( helpString ); } @@ -1060,7 +1060,7 @@ wxString wxMenu::GetHelpString( int id ) const { wxMenuItem *item = FindItem(id); - wxCHECK_MSG( item, _T(""), _T("wxMenu::GetHelpString: no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenu::GetHelpString: no such item") ); return item->GetHelp(); } diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 8d29d5e7e6..157bd90001 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -186,7 +186,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxNoteBook creation failed") ); + wxFAIL_MSG( T("wxNoteBook creation failed") ); return FALSE; } @@ -194,7 +194,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id, m_widget = gtk_notebook_new(); #ifdef __WXDEBUG__ - debug_focus_in( m_widget, _T("wxNotebook::m_widget"), name ); + debug_focus_in( m_widget, T("wxNotebook::m_widget"), name ); #endif gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 ); @@ -233,7 +233,7 @@ void wxNotebook::SetFocus() int wxNotebook::GetSelection() const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") ); GList *pages = GTK_NOTEBOOK(m_widget)->children; @@ -258,18 +258,18 @@ int wxNotebook::GetRowCount() const wxString wxNotebook::GetPageText( int page ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid notebook") ); wxNotebookPage* nb_page = GetNotebookPage(page); if (nb_page) return nb_page->m_text; else - return _T(""); + return T(""); } int wxNotebook::GetPageImage( int page ) const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") ); wxNotebookPage* nb_page = GetNotebookPage(page); if (nb_page) @@ -280,9 +280,9 @@ int wxNotebook::GetPageImage( int page ) const wxNotebookPage* wxNotebook::GetNotebookPage( int page ) const { - wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*) NULL, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*) NULL, T("invalid notebook") ); - wxCHECK_MSG( page < (int)m_pages.GetCount(), (wxNotebookPage*) NULL, _T("invalid notebook index") ); + wxCHECK_MSG( page < (int)m_pages.GetCount(), (wxNotebookPage*) NULL, T("invalid notebook index") ); wxNode *node = m_pages.Nth( page ); @@ -291,9 +291,9 @@ wxNotebookPage* wxNotebook::GetNotebookPage( int page ) const int wxNotebook::SetSelection( int page ) { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") ); - wxCHECK_MSG( page < (int)m_pages.GetCount(), -1, _T("invalid notebook index") ); + wxCHECK_MSG( page < (int)m_pages.GetCount(), -1, T("invalid notebook index") ); int selOld = GetSelection(); @@ -304,7 +304,7 @@ int wxNotebook::SetSelection( int page ) void wxNotebook::AdvanceSelection( bool forward ) { - wxCHECK_RET( m_widget != NULL, _T("invalid notebook") ); + wxCHECK_RET( m_widget != NULL, T("invalid notebook") ); int sel = GetSelection(); int max = GetPageCount(); @@ -322,11 +322,11 @@ void wxNotebook::SetImageList( wxImageList* imageList ) bool wxNotebook::SetPageText( int page, const wxString &text ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") ); wxNotebookPage* nb_page = GetNotebookPage(page); - wxCHECK_MSG( nb_page, FALSE, _T("SetPageText: invalid page index") ); + wxCHECK_MSG( nb_page, FALSE, T("SetPageText: invalid page index") ); nb_page->m_text = text; @@ -422,22 +422,22 @@ bool wxNotebook::SetPageImage( int page, int image ) void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) ) { - wxFAIL_MSG( _T("wxNotebook::SetPageSize not implemented") ); + wxFAIL_MSG( T("wxNotebook::SetPageSize not implemented") ); } void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) ) { - wxFAIL_MSG( _T("wxNotebook::SetPadding not implemented") ); + wxFAIL_MSG( T("wxNotebook::SetPadding not implemented") ); } void wxNotebook::SetTabSize(const wxSize& WXUNUSED(sz)) { - wxFAIL_MSG( _T("wxNotebook::SetTabSize not implemented") ); + wxFAIL_MSG( T("wxNotebook::SetTabSize not implemented") ); } bool wxNotebook::DeleteAllPages() { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") ); while (m_pages.GetCount() > 0) DeletePage( m_pages.GetCount()-1 ); @@ -478,10 +478,10 @@ bool wxNotebook::RemovePage( int page ) bool wxNotebook::InsertPage( int position, wxWindow* win, const wxString& text, bool select, int imageId ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") ); wxCHECK_MSG( win->GetParent() == this, FALSE, - _T("Can't add a page whose parent is not the notebook!") ); + T("Can't add a page whose parent is not the notebook!") ); /* don't receive switch page during addition */ gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget), @@ -535,7 +535,7 @@ bool wxNotebook::InsertPage( int position, wxWindow* win, const wxString& text, /* set the label text */ page->m_text = text; - if (page->m_text.IsEmpty()) page->m_text = _T(""); + if (page->m_text.IsEmpty()) page->m_text = T(""); page->m_label = GTK_LABEL( gtk_label_new(page->m_text.mbc_str()) ); gtk_box_pack_end( GTK_BOX(page->m_box), GTK_WIDGET(page->m_label), FALSE, FALSE, 3 ); @@ -573,7 +573,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) wxWindow *wxNotebook::GetPage( int page ) const { - wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, T("invalid notebook") ); wxNotebookPage* nb_page = GetNotebookPage(page); if (!nb_page) diff --git a/src/gtk/palette.cpp b/src/gtk/palette.cpp index 37b7e4d3a4..2a86eb1ba2 100644 --- a/src/gtk/palette.cpp +++ b/src/gtk/palette.cpp @@ -93,7 +93,7 @@ bool wxPalette::Create( int WXUNUSED(n), const unsigned char *WXUNUSED(green), const unsigned char *WXUNUSED(blue) ) { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return FALSE; } @@ -102,7 +102,7 @@ int wxPalette::GetPixel( const unsigned char WXUNUSED(red), const unsigned char WXUNUSED(green), const unsigned char WXUNUSED(blue) ) const { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return 0; } @@ -112,7 +112,7 @@ bool wxPalette::GetRGB( int WXUNUSED(pixel), unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(blue) ) const { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return 0; } diff --git a/src/gtk/pen.cpp b/src/gtk/pen.cpp index 00a092953f..a4fef2c642 100644 --- a/src/gtk/pen.cpp +++ b/src/gtk/pen.cpp @@ -171,35 +171,35 @@ wxDash* wxPen::GetDash() const int wxPen::GetCap() const { - wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + wxCHECK_MSG( Ok(), -1, T("invalid pen") ); return M_PENDATA->m_capStyle; } int wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + wxCHECK_MSG( Ok(), -1, T("invalid pen") ); return M_PENDATA->m_joinStyle; } int wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + wxCHECK_MSG( Ok(), -1, T("invalid pen") ); return M_PENDATA->m_style; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + wxCHECK_MSG( Ok(), -1, T("invalid pen") ); return M_PENDATA->m_width; } wxColour &wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid pen") ); + wxCHECK_MSG( Ok(), wxNullColour, T("invalid pen") ); return M_PENDATA->m_colour; } diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index 74160121f6..b1ecb3fc79 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -88,7 +88,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxRadioBox creation failed") ); + wxFAIL_MSG( T("wxRadioBox creation failed") ); return FALSE; } @@ -108,7 +108,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, label.Empty(); for ( const wxChar *pc = choices[i]; *pc; pc++ ) { - if ( *pc != _T('&') ) + if ( *pc != T('&') ) label += *pc; } @@ -176,7 +176,7 @@ wxSize wxRadioBox::LayoutItems() if ( m_majorDim == 0 ) { // avoid dividing by 0 below - wxFAIL_MSG( _T("dimension of radiobox should not be 0!") ); + wxFAIL_MSG( T("dimension of radiobox should not be 0!") ); m_majorDim = 1; } @@ -279,7 +279,7 @@ wxSize wxRadioBox::LayoutItems() bool wxRadioBox::Show( bool show ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobox") ); wxWindow::Show( show ); @@ -301,7 +301,7 @@ bool wxRadioBox::Show( bool show ) int wxRadioBox::FindString( const wxString &s ) const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid radiobox") ); int count = 0; @@ -322,7 +322,7 @@ int wxRadioBox::FindString( const wxString &s ) const void wxRadioBox::SetFocus() { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); if (m_boxes.GetCount() == 0) return; @@ -343,11 +343,11 @@ void wxRadioBox::SetFocus() void wxRadioBox::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxNode *node = m_boxes.Nth( n ); - wxCHECK_RET( node, _T("radiobox wrong index") ); + wxCHECK_RET( node, T("radiobox wrong index") ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); @@ -360,7 +360,7 @@ void wxRadioBox::SetSelection( int n ) int wxRadioBox::GetSelection(void) const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid radiobox") ); int count = 0; @@ -373,18 +373,18 @@ int wxRadioBox::GetSelection(void) const node = node->Next(); } - wxFAIL_MSG( _T("wxRadioBox none selected") ); + wxFAIL_MSG( T("wxRadioBox none selected") ); return -1; } wxString wxRadioBox::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") ); wxNode *node = m_boxes.Nth( n ); - wxCHECK_MSG( node, _T(""), _T("radiobox wrong index") ); + wxCHECK_MSG( node, T(""), T("radiobox wrong index") ); GtkButton *button = GTK_BUTTON( node->Data() ); GtkLabel *label = GTK_LABEL( button->child ); @@ -394,14 +394,14 @@ wxString wxRadioBox::GetString( int n ) const wxString wxRadioBox::GetLabel( int item ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") ); return GetString( item ); } void wxRadioBox::SetLabel( const wxString& label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxControl::SetLabel( label ); @@ -410,11 +410,11 @@ void wxRadioBox::SetLabel( const wxString& label ) void wxRadioBox::SetLabel( int item, const wxString& label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxNode *node = m_boxes.Nth( item ); - wxCHECK_RET( node, _T("radiobox wrong index") ); + wxCHECK_RET( node, T("radiobox wrong index") ); GtkButton *button = GTK_BUTTON( node->Data() ); GtkLabel *g_label = GTK_LABEL( button->child ); @@ -424,7 +424,7 @@ void wxRadioBox::SetLabel( int item, const wxString& label ) void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) ) { - wxFAIL_MSG(_T("wxRadioBox::SetLabel not implemented.")); + wxFAIL_MSG(T("wxRadioBox::SetLabel not implemented.")); } bool wxRadioBox::Enable( bool enable ) @@ -447,11 +447,11 @@ bool wxRadioBox::Enable( bool enable ) void wxRadioBox::Enable( int item, bool enable ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxNode *node = m_boxes.Nth( item ); - wxCHECK_RET( node, _T("radiobox wrong index") ); + wxCHECK_RET( node, T("radiobox wrong index") ); GtkButton *button = GTK_BUTTON( node->Data() ); GtkWidget *label = button->child; @@ -461,11 +461,11 @@ void wxRadioBox::Enable( int item, bool enable ) void wxRadioBox::Show( int item, bool show ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxNode *node = m_boxes.Nth( item ); - wxCHECK_RET( node, _T("radiobox wrong index") ); + wxCHECK_RET( node, T("radiobox wrong index") ); GtkWidget *button = GTK_WIDGET( node->Data() ); @@ -477,7 +477,7 @@ void wxRadioBox::Show( int item, bool show ) wxString wxRadioBox::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") ); wxNode *node = m_boxes.First(); while (node) @@ -491,13 +491,13 @@ wxString wxRadioBox::GetStringSelection() const node = node->Next(); } - wxFAIL_MSG( _T("wxRadioBox none selected") ); - return _T(""); + wxFAIL_MSG( T("wxRadioBox none selected") ); + return T(""); } bool wxRadioBox::SetStringSelection( const wxString &s ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobox") ); int res = FindString( s ); if (res == -1) return FALSE; @@ -518,7 +518,7 @@ int wxRadioBox::GetNumberOfRowsOrCols() const void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) ) { - wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented.")); + wxFAIL_MSG(T("wxRadioBox::SetNumberOfRowsOrCols not implemented.")); } void wxRadioBox::DisableEvents() diff --git a/src/gtk/radiobut.cpp b/src/gtk/radiobut.cpp index f7771f4ea6..fa026715f6 100644 --- a/src/gtk/radiobut.cpp +++ b/src/gtk/radiobut.cpp @@ -68,7 +68,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxRadioButton creation failed") ); + wxFAIL_MSG( T("wxRadioButton creation failed") ); return FALSE; } @@ -131,7 +131,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab void wxRadioButton::SetLabel( const wxString& label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobutton") ); wxControl::SetLabel( label ); GtkButton *bin = GTK_BUTTON( m_widget ); @@ -141,7 +141,7 @@ void wxRadioButton::SetLabel( const wxString& label ) void wxRadioButton::SetValue( bool val ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobutton") ); if (val == GetValue()) return; @@ -164,7 +164,7 @@ void wxRadioButton::SetValue( bool val ) bool wxRadioButton::GetValue() const { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobutton") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobutton") ); return GTK_TOGGLE_BUTTON(m_widget)->active; } diff --git a/src/gtk/scrolbar.cpp b/src/gtk/scrolbar.cpp index 43997ce96d..4d21168158 100644 --- a/src/gtk/scrolbar.cpp +++ b/src/gtk/scrolbar.cpp @@ -129,7 +129,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxScrollBar creation failed") ); + wxFAIL_MSG( T("wxScrollBar creation failed") ); return FALSE; } diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 8ee443f68b..5ff2d5c61a 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -191,7 +191,7 @@ int wxSystemSettings::GetSystemMetric( int index ) case wxSYS_VSCROLL_X: return 15; } - wxCHECK_MSG( index, 0, _T("wxSystemSettings::GetSystemMetric not fully implemented") ); + wxCHECK_MSG( index, 0, T("wxSystemSettings::GetSystemMetric not fully implemented") ); return 0; } diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp index d51d94f1d4..adc016c88f 100644 --- a/src/gtk/slider.cpp +++ b/src/gtk/slider.cpp @@ -97,7 +97,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxSlider creation failed") ); + wxFAIL_MSG( T("wxSlider creation failed") ); return FALSE; } diff --git a/src/gtk/spinbutt.cpp b/src/gtk/spinbutt.cpp index 762d4cc3be..fd5e0cd865 100644 --- a/src/gtk/spinbutt.cpp +++ b/src/gtk/spinbutt.cpp @@ -106,7 +106,7 @@ bool wxSpinButton::Create(wxWindow *parent, if (!PreCreation( parent, pos, new_size ) || !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return FALSE; } @@ -140,28 +140,28 @@ wxSpinButton::~wxSpinButton() int wxSpinButton::GetMin() const { - wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") ); + wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") ); return (int)ceil(m_adjust->lower); } int wxSpinButton::GetMax() const { - wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") ); + wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") ); return (int)ceil(m_adjust->upper); } int wxSpinButton::GetValue() const { - wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") ); + wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") ); return (int)ceil(m_adjust->value); } void wxSpinButton::SetValue( int value ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") ); + wxCHECK_RET( (m_widget != NULL), T("invalid spin button") ); float fpos = (float)value; m_oldPos = fpos; @@ -174,7 +174,7 @@ void wxSpinButton::SetValue( int value ) void wxSpinButton::SetRange(int minVal, int maxVal) { - wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") ); + wxCHECK_RET( (m_widget != NULL), T("invalid spin button") ); float fmin = (float)minVal; float fmax = (float)maxVal; @@ -197,7 +197,7 @@ void wxSpinButton::SetRange(int minVal, int maxVal) void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") ); + wxCHECK_RET( (m_widget != NULL), T("invalid spin button") ); m_width = 15; gtk_widget_set_usize( m_widget, m_width, m_height ); diff --git a/src/gtk/statbmp.cpp b/src/gtk/statbmp.cpp index f9e6700b8f..186947afb2 100644 --- a/src/gtk/statbmp.cpp +++ b/src/gtk/statbmp.cpp @@ -37,7 +37,7 @@ wxStaticBitmap::wxStaticBitmap( wxWindow *parent, wxWindowID id, const wxBitmap void wxStaticBitmap::CreatePixmapWidget() { - wxCHECK_RET( m_bitmap.Ok(), _T("should only be called if we have a bitmap") ); + wxCHECK_RET( m_bitmap.Ok(), T("should only be called if we have a bitmap") ); GdkBitmap *mask = (GdkBitmap *) NULL; if ( m_bitmap.GetMask() ) @@ -61,7 +61,7 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return FALSE; } diff --git a/src/gtk/statbox.cpp b/src/gtk/statbox.cpp index d39006cda7..0d4f598a2a 100644 --- a/src/gtk/statbox.cpp +++ b/src/gtk/statbox.cpp @@ -44,7 +44,7 @@ bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxStaticBox creation failed") ); + wxFAIL_MSG( T("wxStaticBox creation failed") ); return FALSE; } diff --git a/src/gtk/statline.cpp b/src/gtk/statline.cpp index cd67c8a642..6129db4500 100644 --- a/src/gtk/statline.cpp +++ b/src/gtk/statline.cpp @@ -44,7 +44,7 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxStaticLine creation failed") ); + wxFAIL_MSG( T("wxStaticLine creation failed") ); return FALSE; } diff --git a/src/gtk/stattext.cpp b/src/gtk/stattext.cpp index 42938260a3..81cf98c3a8 100644 --- a/src/gtk/stattext.cpp +++ b/src/gtk/stattext.cpp @@ -51,7 +51,7 @@ bool wxStaticText::Create(wxWindow *parent, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return FALSE; } diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index b3b92a7816..9d2c160e29 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -151,7 +151,7 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxToolBar creation failed") ); + wxFAIL_MSG( T("wxToolBar creation failed") ); return FALSE; } @@ -263,13 +263,13 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap, m_hasToolAlready = TRUE; wxCHECK_MSG( bitmap.Ok(), (wxToolBarTool *)NULL, - _T("invalid bitmap for wxToolBar icon") ); + T("invalid bitmap for wxToolBar icon") ); wxCHECK_MSG( bitmap.GetBitmap() == NULL, (wxToolBarTool *)NULL, - _T("wxToolBar doesn't support GdkBitmap") ); + T("wxToolBar doesn't support GdkBitmap") ); wxCHECK_MSG( bitmap.GetPixmap() != NULL, (wxToolBarTool *)NULL, - _T("wxToolBar::Add needs a wxBitmap") ); + T("wxToolBar::Add needs a wxBitmap") ); GtkWidget *tool_pixmap = (GtkWidget *)NULL; @@ -326,7 +326,7 @@ void wxToolBar::AddSeparator() void wxToolBar::ClearTools() { - wxFAIL_MSG( _T("wxToolBar::ClearTools not implemented") ); + wxFAIL_MSG( T("wxToolBar::ClearTools not implemented") ); } bool wxToolBar::Realize() @@ -376,7 +376,7 @@ void wxToolBar::EnableTool(int toolIndex, bool enable) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); } void wxToolBar::ToggleTool( int toolIndex, bool toggle ) @@ -418,7 +418,7 @@ void wxToolBar::ToggleTool( int toolIndex, bool toggle ) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); } wxObject *wxToolBar::GetToolClientData( int index ) const @@ -431,7 +431,7 @@ wxObject *wxToolBar::GetToolClientData( int index ) const node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return (wxObject*)NULL; } @@ -446,7 +446,7 @@ bool wxToolBar::GetToolState(int toolIndex) const node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return FALSE; } @@ -461,14 +461,14 @@ bool wxToolBar::GetToolEnabled(int toolIndex) const node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return FALSE; } void wxToolBar::SetMargins( int x, int y ) { - wxCHECK_RET( !m_hasToolAlready, _T("wxToolBar::SetMargins must be called before adding tool.") ); + wxCHECK_RET( !m_hasToolAlready, T("wxToolBar::SetMargins must be called before adding tool.") ); if (x > 2) gtk_toolbar_append_space( m_toolbar ); // oh well @@ -478,7 +478,7 @@ void wxToolBar::SetMargins( int x, int y ) void wxToolBar::SetToolPacking( int WXUNUSED(packing) ) { - wxFAIL_MSG( _T("wxToolBar::SetToolPacking not implemented") ); + wxFAIL_MSG( T("wxToolBar::SetToolPacking not implemented") ); } void wxToolBar::SetToolSeparation( int separation ) @@ -510,9 +510,9 @@ wxString wxToolBar::GetToolLongHelp(int toolIndex) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); - return _T(""); + return T(""); } wxString wxToolBar::GetToolShortHelp(int toolIndex) @@ -528,9 +528,9 @@ wxString wxToolBar::GetToolShortHelp(int toolIndex) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); - return _T(""); + return T(""); } void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString) @@ -547,7 +547,7 @@ void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return; } @@ -566,7 +566,7 @@ void wxToolBar::SetToolShortHelp(int toolIndex, const wxString& helpString) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return; } diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index c9c22b2e0f..1e4d3a3ceb 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -118,7 +118,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxTextCtrl creation failed") ); + wxFAIL_MSG( T("wxTextCtrl creation failed") ); return FALSE; } @@ -282,7 +282,7 @@ void wxTextCtrl::CalculateScrollbar() wxString wxTextCtrl::GetValue() const { - wxCHECK_MSG( m_text != NULL, _T(""), _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, T(""), T("invalid text ctrl") ); wxString tmp; if (m_windowStyle & wxTE_MULTILINE) @@ -301,9 +301,9 @@ wxString wxTextCtrl::GetValue() const void wxTextCtrl::SetValue( const wxString &value ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); - wxString tmp = _T(""); + wxString tmp = T(""); if (!value.IsNull()) tmp = value; if (m_windowStyle & wxTE_MULTILINE) { @@ -325,7 +325,7 @@ void wxTextCtrl::SetValue( const wxString &value ) void wxTextCtrl::WriteText( const wxString &text ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (text.IsEmpty()) return; @@ -365,7 +365,7 @@ void wxTextCtrl::WriteText( const wxString &text ) void wxTextCtrl::AppendText( const wxString &text ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (text.IsEmpty()) return; @@ -413,7 +413,7 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const if (text) { - wxString buf(_T("")); + wxString buf(T("")); long i; int currentLine = 0; for (i = 0; currentLine != lineNo && text[i]; i++ ) @@ -441,7 +441,7 @@ void wxTextCtrl::OnDropFiles( wxDropFilesEvent &WXUNUSED(event) ) { /* If you implement this, don't forget to update the documentation! * (file docs/latex/wx/text.tex) */ - wxFAIL_MSG( _T("wxTextCtrl::OnDropFiles not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::OnDropFiles not implemented") ); } bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const @@ -460,7 +460,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const const wxChar* stop = text.c_str() + pos; for ( const wxChar *p = text.c_str(); p < stop; p++ ) { - if (*p == _T('\n')) + if (*p == T('\n')) { (*y)++; *x=0; @@ -536,7 +536,7 @@ int wxTextCtrl::GetNumberOfLines() const void wxTextCtrl::SetInsertionPoint( long pos ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (m_windowStyle & wxTE_MULTILINE) { @@ -573,7 +573,7 @@ void wxTextCtrl::SetInsertionPoint( long pos ) void wxTextCtrl::SetInsertionPointEnd() { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (m_windowStyle & wxTE_MULTILINE) SetInsertionPoint(gtk_text_get_length(GTK_TEXT(m_text))); @@ -583,7 +583,7 @@ void wxTextCtrl::SetInsertionPointEnd() void wxTextCtrl::SetEditable( bool editable ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (m_windowStyle & wxTE_MULTILINE) gtk_text_set_editable( GTK_TEXT(m_text), editable ); @@ -598,7 +598,7 @@ void wxTextCtrl::DiscardEdits() void wxTextCtrl::SetSelection( long from, long to ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to ); } @@ -610,14 +610,14 @@ void wxTextCtrl::ShowPosition( long WXUNUSED(pos) ) long wxTextCtrl::GetInsertionPoint() const { - wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, 0, T("invalid text ctrl") ); return (long) GTK_EDITABLE(m_text)->current_pos; } long wxTextCtrl::GetLastPosition() const { - wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, 0, T("invalid text ctrl") ); int pos = 0; if (m_windowStyle & wxTE_MULTILINE) @@ -630,14 +630,14 @@ long wxTextCtrl::GetLastPosition() const void wxTextCtrl::Remove( long from, long to ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); 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, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to ); @@ -655,7 +655,7 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value ) void wxTextCtrl::Cut() { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); #if (GTK_MINOR_VERSION > 0) gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) ); @@ -666,7 +666,7 @@ void wxTextCtrl::Cut() void wxTextCtrl::Copy() { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); #if (GTK_MINOR_VERSION > 0) gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) ); @@ -677,7 +677,7 @@ void wxTextCtrl::Copy() void wxTextCtrl::Paste() { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); #if (GTK_MINOR_VERSION > 0) gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) ); @@ -711,26 +711,26 @@ bool wxTextCtrl::CanPaste() const void wxTextCtrl::Undo() { // TODO - wxFAIL_MSG( _T("wxTextCtrl::Undo not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::Undo not implemented") ); } void wxTextCtrl::Redo() { // TODO - wxFAIL_MSG( _T("wxTextCtrl::Redo not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::Redo not implemented") ); } bool wxTextCtrl::CanUndo() const { // TODO - wxFAIL_MSG( _T("wxTextCtrl::CanUndo not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::CanUndo not implemented") ); return FALSE; } bool wxTextCtrl::CanRedo() const { // TODO - wxFAIL_MSG( _T("wxTextCtrl::CanRedo not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::CanRedo not implemented") ); return FALSE; } @@ -738,7 +738,7 @@ bool wxTextCtrl::CanRedo() const // selection. void wxTextCtrl::GetSelection(long* from, long* to) const { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (!(GTK_EDITABLE(m_text)->has_selection)) { @@ -753,7 +753,7 @@ void wxTextCtrl::GetSelection(long* from, long* to) const bool wxTextCtrl::IsEditable() const { - wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") ); return GTK_EDITABLE(m_text)->editable; } @@ -765,12 +765,12 @@ bool wxTextCtrl::IsModified() const void wxTextCtrl::Clear() { - SetValue( _T("") ); + SetValue( T("") ); } void wxTextCtrl::OnChar( wxKeyEvent &key_event ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if ((key_event.KeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER)) { @@ -798,7 +798,7 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window ) // the font will change for subsequent text insertiongs bool wxTextCtrl::SetFont( const wxFont &font ) { - wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") ); if ( !wxWindowBase::SetFont(font) ) { @@ -824,7 +824,7 @@ bool wxTextCtrl::SetFont( const wxFont &font ) bool wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) ) { - wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") ); // doesn't work return FALSE; @@ -832,7 +832,7 @@ bool wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) ) bool wxTextCtrl::SetBackgroundColour( const wxColour &colour ) { - wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") ); wxControl::SetBackgroundColour( colour ); diff --git a/src/gtk/utilsres.cpp b/src/gtk/utilsres.cpp index 6082cd387e..f0bf3981a3 100644 --- a/src/gtk/utilsres.cpp +++ b/src/gtk/utilsres.cpp @@ -40,9 +40,9 @@ // Yuck this is really BOTH site and platform dependent // so we should use some other strategy! #ifdef __SUN__ - #define DEFAULT_XRESOURCE_DIR _T("/usr/openwin/lib/app-defaults") + #define DEFAULT_XRESOURCE_DIR T("/usr/openwin/lib/app-defaults") #else - #define DEFAULT_XRESOURCE_DIR _T("/usr/lib/X11/app-defaults") + #define DEFAULT_XRESOURCE_DIR T("/usr/lib/X11/app-defaults") #endif //----------------------------------------------------------------------------- @@ -63,13 +63,13 @@ static wxChar *GetResourcePath(wxChar *buf, wxChar *name, bool create) wxStrcpy(buf, name); return buf; // Exists so ... } - if (*name == _T('/')) + if (*name == T('/')) wxStrcpy(buf, name); else { // Put in standard place for resource files if not absolute wxStrcpy(buf, DEFAULT_XRESOURCE_DIR); - wxStrcat(buf, _T("/")); + wxStrcat(buf, T("/")); wxStrcat(buf, FileNameFromPath(name)); } if (create) @@ -96,18 +96,18 @@ static wxChar *GetIniFile(wxChar *dest, const wxChar *filename) if ((home = wxGetUserHome(wxString())) != NULL) { wxStrcpy(dest, home); - if (dest[wxStrlen(dest) - 1] != _T('/')) wxStrcat(dest, _T("/")); + if (dest[wxStrlen(dest) - 1] != T('/')) wxStrcat(dest, T("/")); if (filename == NULL) { - if ((filename = wxGetenv(_T("XENVIRONMENT"))) == NULL) filename = _T(".Xdefaults"); + if ((filename = wxGetenv(T("XENVIRONMENT("))) == NULL) filename = T(".Xdefaults"); } else - if (*filename != _T('.')) wxStrcat(dest, _T(".")); + if (*filename != T('.')) wxStrcat(dest, T(".")); wxStrcat(dest, filename); } else { - dest[0] = _T('\0'); + dest[0] = T('\0'); } } return dest; @@ -148,7 +148,7 @@ static void wxXMergeDatabases() // Open XENVIRONMENT file, or if not defined, the .Xdefaults, // and merge into existing database - if ((environment = wxGetenv(_T("XENVIRONMENT"))) == NULL) + if ((environment = wxGetenv(T("XENVIRONMENT("))) == NULL) { size_t len; #if wxUSE_UNICODE @@ -203,7 +203,7 @@ void wxFlushResources() void wxDeleteResources(const wxChar *file) { - wxLogTrace(wxTraceResAlloc, _T("Delete: Number = %d"), wxTheResourceCache->Number()); + wxLogTrace(wxTraceResAlloc, T("Delete: Number = %d"), wxTheResourceCache->Number()); wxChar buffer[500]; (void)GetIniFile(buffer, file); @@ -233,11 +233,11 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr database = (XrmDatabase)node->Data(); else { database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer)); - wxLogTrace(wxTraceResAlloc, _T("Write: Number = %d"), wxTheResourceCache->Number()); + wxLogTrace(wxTraceResAlloc, T("Write: Number = %d"), wxTheResourceCache->Number()); wxTheResourceCache->Append(buffer, (wxObject *)database); } char resName[300]; - strcpy(resName, !section.IsNull() ? MBSTRINGCAST section.mb_str() : "wxWindows"); + strcpy(resName, !section.IsNull() ? wxMBSTRINGCAST section.mb_str() : "wxWindows"); strcat(resName, "."); strcat(resName, entry.mb_str()); XrmPutStringResource(&database, resName, value.mb_str()); @@ -287,7 +287,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value, else { database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer)); - wxLogTrace(wxTraceResAlloc, _T("Get: Number = %d"), wxTheResourceCache->Number()); + wxLogTrace(wxTraceResAlloc, T("Get: Number = %d"), wxTheResourceCache->Number()); wxTheResourceCache->Append(buffer, (wxObject *)database); } } else @@ -352,7 +352,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c { // Handle True, False here // True, Yes, Enables, Set or Activated - if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A') + if (*s == 'T(' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A') *value = TRUE; // False, No, Disabled, Reset, Cleared, Deactivated else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C') diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index dd4d3e4b9e..8578feae96 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -155,7 +155,7 @@ static gint gtk_debug_focus_in_callback( GtkWidget *WXUNUSED(widget), wxLog::AddTraceMask("focus"); s_done = TRUE; } - wxLogTrace(_T("FOCUS NOW AT: %s"), name); + wxLogTrace(T("FOCUS NOW AT: %s"), name); */ return FALSE; @@ -164,7 +164,7 @@ static gint gtk_debug_focus_in_callback( GtkWidget *WXUNUSED(widget), void debug_focus_in( GtkWidget* widget, const wxChar* name, const wxChar *window ) { wxString tmp = name; - tmp += _T(" FROM "); + tmp += T(" FROM "); tmp += window; wxChar *s = new wxChar[tmp.Length()+1]; @@ -974,10 +974,10 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton wxapp_install_idle_handler(); /* - wxPrintf( _T("1) OnButtonPress from ") ); + wxPrintf( T("1) OnButtonPress from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) wxPrintf( win->GetClassInfo()->GetClassName() ); - wxPrintf( _T(".\n") ); + wxPrintf( T(".\n") ); */ if (!win->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return TRUE; @@ -992,20 +992,20 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton gtk_widget_grab_focus (win->m_wxwindow); /* - wxPrintf( _T("GrabFocus from ") ); + wxPrintf( T("GrabFocus from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) wxPrintf( win->GetClassInfo()->GetClassName() ); - wxPrintf( _T(".\n") ); + wxPrintf( T(".\n") ); */ } } /* - wxPrintf( _T("2) OnButtonPress from ") ); + wxPrintf( T("2) OnButtonPress from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) wxPrintf( win->GetClassInfo()->GetClassName() ); - wxPrintf( _T(".\n") ); + wxPrintf( T(".\n") ); */ wxEventType event_type = wxEVT_LEFT_DOWN; @@ -1807,7 +1807,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxWindow creation failed") ); + wxFAIL_MSG( T("wxWindow creation failed") ); return FALSE; } @@ -1817,14 +1817,14 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS ); #ifdef __WXDEBUG__ - debug_focus_in( m_widget, _T("wxWindow::m_widget"), name ); + debug_focus_in( m_widget, T("wxWindow::m_widget"), name ); #endif GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget); #ifdef __WXDEBUG__ - debug_focus_in( scrolledWindow->hscrollbar, _T("wxWindow::hsrcollbar"), name ); - debug_focus_in( scrolledWindow->vscrollbar, _T("wxWindow::vsrcollbar"), name ); + debug_focus_in( scrolledWindow->hscrollbar, T("wxWindow::hsrcollbar"), name ); + debug_focus_in( scrolledWindow->vscrollbar, T("wxWindow::vsrcollbar"), name ); #endif GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass ); @@ -1838,7 +1838,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, m_wxwindow = gtk_myfixed_new(); #ifdef __WXDEBUG__ - debug_focus_in( m_wxwindow, _T("wxWindow::m_wxwindow"), name ); + debug_focus_in( m_wxwindow, T("wxWindow::m_wxwindow"), name ); #endif gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow ); @@ -1996,7 +1996,7 @@ wxWindow::~wxWindow() bool wxWindow::PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize &size ) { - wxCHECK_MSG( !m_needParent || parent, FALSE, _T("Need complete parent.") ); + wxCHECK_MSG( !m_needParent || parent, FALSE, T("Need complete parent.") ); /* this turns -1 into 20 so that a minimal window is visible even although -1,-1 has been given as the @@ -2028,7 +2028,7 @@ bool wxWindow::PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize void wxWindow::PostCreation() { - wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid window") ); if (m_wxwindow) { @@ -2093,7 +2093,7 @@ void wxWindow::ConnectWidget( GtkWidget *widget ) bool wxWindow::Destroy() { - wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid window") ); m_hasVMT = FALSE; @@ -2102,8 +2102,8 @@ bool wxWindow::Destroy() void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); - wxASSERT_MSG( (m_parent != NULL), _T("wxWindow::SetSize requires parent.\n") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid window") ); + wxASSERT_MSG( (m_parent != NULL), T("wxWindow::SetSize requires parent.\n") ); if (m_resizing) return; /* I don't like recursions */ m_resizing = TRUE; @@ -2234,7 +2234,7 @@ void wxWindow::OnInternalIdle() void wxWindow::DoGetSize( int *width, int *height ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (width) (*width) = m_width; if (height) (*height) = m_height; @@ -2242,7 +2242,7 @@ void wxWindow::DoGetSize( int *width, int *height ) const void wxWindow::DoSetClientSize( int width, int height ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_wxwindow) { @@ -2316,7 +2316,7 @@ void wxWindow::DoSetClientSize( int width, int height ) void wxWindow::DoGetClientSize( int *width, int *height ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_wxwindow) { @@ -2391,7 +2391,7 @@ void wxWindow::DoGetClientSize( int *width, int *height ) const void wxWindow::DoGetPosition( int *x, int *y ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (x) (*x) = m_x; if (y) (*y) = m_y; @@ -2399,7 +2399,7 @@ void wxWindow::DoGetPosition( int *x, int *y ) const void wxWindow::DoClientToScreen( int *x, int *y ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2428,7 +2428,7 @@ void wxWindow::DoClientToScreen( int *x, int *y ) const void wxWindow::DoScreenToClient( int *x, int *y ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2457,7 +2457,7 @@ void wxWindow::DoScreenToClient( int *x, int *y ) const bool wxWindow::Show( bool show ) { - wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") ); if (!wxWindowBase::Show(show)) { @@ -2475,7 +2475,7 @@ bool wxWindow::Show( bool show ) bool wxWindow::Enable( bool enable ) { - wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") ); if (!wxWindowBase::Enable(enable)) { @@ -2492,9 +2492,9 @@ bool wxWindow::Enable( bool enable ) int wxWindow::GetCharHeight() const { - wxCHECK_MSG( (m_widget != NULL), 12, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), 12, T("invalid window") ); - wxCHECK_MSG( m_font.Ok(), 12, _T("invalid font") ); + wxCHECK_MSG( m_font.Ok(), 12, T("invalid font") ); GdkFont *font = m_font.GetInternalFont( 1.0 ); @@ -2503,9 +2503,9 @@ int wxWindow::GetCharHeight() const int wxWindow::GetCharWidth() const { - wxCHECK_MSG( (m_widget != NULL), 8, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), 8, T("invalid window") ); - wxCHECK_MSG( m_font.Ok(), 8, _T("invalid font") ); + wxCHECK_MSG( m_font.Ok(), 8, T("invalid font") ); GdkFont *font = m_font.GetInternalFont( 1.0 ); @@ -2522,7 +2522,7 @@ void wxWindow::GetTextExtent( const wxString& string, wxFont fontToUse = m_font; if (theFont) fontToUse = *theFont; - wxCHECK_RET( fontToUse.Ok(), _T("invalid font") ); + wxCHECK_RET( fontToUse.Ok(), T("invalid font") ); GdkFont *font = fontToUse.GetInternalFont( 1.0 ); if (x) (*x) = gdk_string_width( font, string.mbc_str() ); @@ -2533,7 +2533,7 @@ void wxWindow::GetTextExtent( const wxString& string, void wxWindow::SetFocus() { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); GtkWidget *connect_widget = GetConnectWidget(); if (connect_widget) @@ -2559,7 +2559,7 @@ bool wxWindow::AcceptsFocus() const bool wxWindow::Reparent( wxWindowBase *newParentBase ) { - wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") ); wxWindow *oldParent = m_parent, *newParent = (wxWindow *)newParentBase; @@ -2595,11 +2595,11 @@ bool wxWindow::Reparent( wxWindowBase *newParentBase ) void wxWindow::DoAddChild(wxWindow *child) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid window") ); - wxASSERT_MSG( (child != NULL), _T("invalid child window") ); + wxASSERT_MSG( (child != NULL), T("invalid child window") ); - wxASSERT_MSG( (m_insertCallback != NULL), _T("invalid child insertion function") ); + wxASSERT_MSG( (m_insertCallback != NULL), T("invalid child insertion function") ); /* add to list */ AddChild( child ); @@ -2610,7 +2610,7 @@ void wxWindow::DoAddChild(wxWindow *child) void wxWindow::Raise() { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2619,7 +2619,7 @@ void wxWindow::Raise() void wxWindow::Lower() { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2628,14 +2628,14 @@ void wxWindow::Lower() bool wxWindow::SetCursor( const wxCursor &cursor ) { - wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") ); return wxWindowBase::SetCursor( cursor ); } void wxWindow::WarpPointer( int x, int y ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); GtkWidget *connect_widget = GetConnectWidget(); if (connect_widget->window) @@ -2648,7 +2648,7 @@ void wxWindow::WarpPointer( int x, int y ) void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2710,7 +2710,7 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) void wxWindow::Clear() { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); if (!m_widget->window) return; @@ -2737,7 +2737,7 @@ void wxWindow::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) bool wxWindow::SetBackgroundColour( const wxColour &colour ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") ); if (!wxWindowBase::SetBackgroundColour(colour)) { @@ -2784,7 +2784,7 @@ bool wxWindow::SetBackgroundColour( const wxColour &colour ) bool wxWindow::SetForegroundColour( const wxColour &colour ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") ); if (!wxWindowBase::SetForegroundColour(colour)) { @@ -2900,9 +2900,9 @@ static void pop_pos_callback( GtkMenu * WXUNUSED(menu), bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") ); - wxCHECK_MSG( menu != NULL, FALSE, _T("invalid popup-menu") ); + wxCHECK_MSG( menu != NULL, FALSE, T("invalid popup-menu") ); SetInvokingWindow( menu, this ); @@ -2939,7 +2939,7 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y ) void wxWindow::SetDropTarget( wxDropTarget *dropTarget ) { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); GtkWidget *dnd_widget = GetConnectWidget(); @@ -2969,7 +2969,7 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window ) bool wxWindow::SetFont( const wxFont &font ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") ); if (!wxWindowBase::SetFont(font)) { @@ -3007,9 +3007,9 @@ bool wxWindow::SetFont( const wxFont &font ) void wxWindow::CaptureMouse() { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( g_captureWindow == NULL, _T("CaptureMouse called twice") ); + wxCHECK_RET( g_captureWindow == NULL, T("CaptureMouse called twice") ); GtkWidget *connect_widget = GetConnectWidget(); if (!connect_widget->window) return; @@ -3027,9 +3027,9 @@ void wxWindow::CaptureMouse() void wxWindow::ReleaseMouse() { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( g_captureWindow, _T("ReleaseMouse called twice") ); + wxCHECK_RET( g_captureWindow, T("ReleaseMouse called twice") ); GtkWidget *connect_widget = GetConnectWidget(); if (!connect_widget->window) return; @@ -3046,9 +3046,9 @@ bool wxWindow::IsRetained() const void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh ) { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); + wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") ); m_hasScrolling = TRUE; @@ -3109,9 +3109,9 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible, void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) ) { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); + wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) { @@ -3152,9 +3152,9 @@ void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) ) int wxWindow::GetScrollThumb( int orient ) const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") ); - wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") ); + wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) return (int)(m_hAdjust->page_size+0.5); @@ -3164,9 +3164,9 @@ int wxWindow::GetScrollThumb( int orient ) const int wxWindow::GetScrollPos( int orient ) const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") ); - wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") ); + wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) return (int)(m_hAdjust->value+0.5); @@ -3176,9 +3176,9 @@ int wxWindow::GetScrollPos( int orient ) const int wxWindow::GetScrollRange( int orient ) const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") ); - wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") ); + wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) return (int)(m_hAdjust->upper+0.5); @@ -3188,9 +3188,9 @@ int wxWindow::GetScrollRange( int orient ) const void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); + wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") ); if (!m_scrollGC) { diff --git a/src/gtk1/accel.cpp b/src/gtk1/accel.cpp index 3d161f1c31..c398e19e4c 100644 --- a/src/gtk1/accel.cpp +++ b/src/gtk1/accel.cpp @@ -4,7 +4,7 @@ // Author: Robert Roebling // Id: $id:$ // Copyright: (c) 1998 Robert Roebling -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifdef __GNUG__ @@ -24,13 +24,12 @@ class wxAccelRefData: public wxObjectRefData { public: - - wxAccelRefData(void); - + wxAccelRefData(); + wxList m_accels; }; -wxAccelRefData::wxAccelRefData(void) +wxAccelRefData::wxAccelRefData() { m_accels.DeleteContents( TRUE ); } @@ -40,7 +39,7 @@ wxAccelRefData::wxAccelRefData(void) #define M_ACCELDATA ((wxAccelRefData *)m_refData) IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable,wxObject) - + wxAcceleratorTable::wxAcceleratorTable() { } @@ -48,7 +47,7 @@ wxAcceleratorTable::wxAcceleratorTable() wxAcceleratorTable::wxAcceleratorTable( int n, wxAcceleratorEntry entries[] ) { m_refData = new wxAccelRefData(); - + for (int i = 0; i < n; i++) { int flag = entries[i].GetFlags(); @@ -80,12 +79,12 @@ int wxAcceleratorTable::GetCommand( wxKeyEvent &event ) (((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) && (((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) && (((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown())) - { + { return entry->GetCommand(); - } + } node = node->Next(); } - + return -1; } diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 2bce90acab..2572ce4997 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -144,7 +144,7 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) ); bool wxYield() { bool has_idle = (wxTheApp->m_idleTag != 0); - + if (has_idle) { /* We need to temporarily remove idle callbacks or the loop will @@ -160,20 +160,20 @@ bool wxYield() might have been changed (it also will update other things set from OnUpdateUI() which is a nice (and desired) side effect) */ while (wxTheApp->ProcessIdle()) { } - + if (has_idle) { /* re-add idle handler */ wxTheApp->m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL ); } - + return TRUE; } gint wxapp_idle_callback( gpointer WXUNUSED(data) ) { if (!wxTheApp) return TRUE; - + #if (GTK_MINOR_VERSION > 0) /* when getting called from GDK's idle handler we are no longer within GDK's grab on the GUI @@ -206,7 +206,7 @@ gint wxapp_idle_callback( gpointer WXUNUSED(data) ) void wxapp_install_idle_handler() { - wxASSERT_MSG( wxTheApp->m_idleTag == 0, _T("attempt to install idle handler twice") ); + wxASSERT_MSG( wxTheApp->m_idleTag == 0, T("attempt to install idle handler twice") ); /* this routine gets called by all event handlers indicating that the idle is over. */ @@ -224,14 +224,14 @@ static gint wxapp_wakeup_timerout_callback( gpointer WXUNUSED(data) ); void wxapp_install_thread_wakeup() { if (wxTheApp->m_wakeUpTimerTag) return; - + wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 100, wxapp_wakeup_timerout_callback, (gpointer) NULL ); } void wxapp_uninstall_thread_wakeup() { if (!wxTheApp->m_wakeUpTimerTag) return; - + gtk_timeout_remove( wxTheApp->m_wakeUpTimerTag ); wxTheApp->m_wakeUpTimerTag = 0; } @@ -397,7 +397,7 @@ bool wxApp::OnInitGui() index |= (g >> (5 - vis->green_prec)) << vis->green_shift; index |= (b >> (5 - vis->blue_prec)) << vis->blue_shift; #else - wxFAIL_MSG( _T("Unsupported graphics hardware") ); + wxFAIL_MSG( T("Unsupported graphics hardware") ); #endif } m_colorCube[ (r*1024) + (g*32) + b ] = index; @@ -478,7 +478,7 @@ bool wxApp::SendIdleEvents( wxWindow* win ) win->ProcessEvent(event); win->OnInternalIdle(); - + if (event.MoreRequested()) needMore = TRUE; @@ -640,7 +640,7 @@ void wxApp::CleanUp() #if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT if (wxDebugContext::CountObjectsLeft() > 0) { - wxLogDebug(_T("There were memory leaks.\n")); + wxLogDebug(T("There were memory leaks.\n")); wxDebugContext::Dump(); wxDebugContext::PrintStatistics(); } @@ -681,7 +681,7 @@ int wxEntry( int argc, char *argv[] ) if (!wxTheApp) { wxCHECK_MSG( wxApp::GetInitializerFunction(), -1, - _T("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") ); + T("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") ); wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction(); @@ -690,7 +690,7 @@ int wxEntry( int argc, char *argv[] ) wxTheApp = (wxApp*) test_app; } - wxCHECK_MSG( wxTheApp, -1, _T("wxWindows error: no application object") ); + wxCHECK_MSG( wxTheApp, -1, T("wxWindows error: no application object") ); wxTheApp->argc = argc; #if wxUSE_UNICODE @@ -794,7 +794,7 @@ wxApp::GetStdIcon(int which) const return wxIcon(warning_xpm); default: - wxFAIL_MSG(_T("requested non existent standard icon")); + wxFAIL_MSG(T("requested non existent standard icon")); // still fall through case wxICON_HAND: diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index dec3ff0c40..707e07e951 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -60,7 +60,7 @@ bool wxMask::Create( const wxBitmap& WXUNUSED(bitmap), m_bitmap = (GdkBitmap*) NULL; } - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( T("TODO") ); return FALSE; } @@ -74,7 +74,7 @@ bool wxMask::Create( const wxBitmap& WXUNUSED(bitmap), m_bitmap = (GdkBitmap*) NULL; } - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( T("not implemented") ); return FALSE; } @@ -89,7 +89,7 @@ bool wxMask::Create( const wxBitmap& bitmap ) if (!bitmap.Ok()) return FALSE; - wxCHECK_MSG( bitmap.GetBitmap(), FALSE, _T("Cannot create mask from colour bitmap") ); + wxCHECK_MSG( bitmap.GetBitmap(), FALSE, T("Cannot create mask from colour bitmap") ); m_bitmap = gdk_pixmap_new( (GdkWindow*) &gdk_root_parent, bitmap.GetWidth(), bitmap.GetHeight(), 1 ); @@ -160,13 +160,13 @@ wxBitmap::wxBitmap() wxBitmap::wxBitmap( int width, int height, int depth ) { - wxCHECK_RET( (width > 0) && (height > 0), _T("invalid bitmap size") ) + wxCHECK_RET( (width > 0) && (height > 0), T("invalid bitmap size") ) GdkWindow *parent = (GdkWindow*) &gdk_root_parent; if (depth == -1) depth = gdk_window_get_visual( parent )->depth; wxCHECK_RET( (depth == gdk_window_get_visual( parent )->depth) || - (depth == 1), _T("invalid bitmap depth") ) + (depth == 1), T("invalid bitmap depth") ) m_refData = new wxBitmapRefData(); M_BMPDATA->m_mask = (wxMask *) NULL; @@ -188,7 +188,7 @@ wxBitmap::wxBitmap( int width, int height, int depth ) wxBitmap::wxBitmap( const char **bits ) { - wxCHECK_RET( bits != NULL, _T("invalid bitmap data") ) + wxCHECK_RET( bits != NULL, T("invalid bitmap data") ) m_refData = new wxBitmapRefData(); @@ -211,7 +211,7 @@ wxBitmap::wxBitmap( const char **bits ) wxBitmap::wxBitmap( char **bits ) { - wxCHECK_RET( bits != NULL, _T("invalid bitmap data") ) + wxCHECK_RET( bits != NULL, T("invalid bitmap data") ) m_refData = new wxBitmapRefData(); @@ -220,7 +220,7 @@ wxBitmap::wxBitmap( char **bits ) M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits ); - wxCHECK_RET( M_BMPDATA->m_pixmap, _T("couldn't create pixmap") ); + wxCHECK_RET( M_BMPDATA->m_pixmap, T("couldn't create pixmap") ); if (mask) { @@ -259,7 +259,7 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth M_BMPDATA->m_height = height; M_BMPDATA->m_bpp = 1; - wxCHECK_RET( M_BMPDATA->m_bitmap, _T("couldn't create bitmap") ); + wxCHECK_RET( M_BMPDATA->m_bitmap, T("couldn't create bitmap") ); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } @@ -293,35 +293,35 @@ bool wxBitmap::Ok() const int wxBitmap::GetHeight() const { - wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), -1, T("invalid bitmap") ); return M_BMPDATA->m_height; } int wxBitmap::GetWidth() const { - wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), -1, T("invalid bitmap") ); return M_BMPDATA->m_width; } int wxBitmap::GetDepth() const { - wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), -1, T("invalid bitmap") ); return M_BMPDATA->m_bpp; } wxMask *wxBitmap::GetMask() const { - wxCHECK_MSG( Ok(), (wxMask *) NULL, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), (wxMask *) NULL, T("invalid bitmap") ); return M_BMPDATA->m_mask; } void wxBitmap::SetMask( wxMask *mask ) { - wxCHECK_RET( Ok(), _T("invalid bitmap") ); + wxCHECK_RET( Ok(), T("invalid bitmap") ); if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask; @@ -330,7 +330,7 @@ void wxBitmap::SetMask( wxMask *mask ) bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(palette) ) { - wxCHECK_MSG( Ok(), FALSE, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), FALSE, T("invalid bitmap") ); if (type == wxBITMAP_TYPE_PNG) { @@ -420,14 +420,14 @@ void wxBitmap::SetPixmap( GdkPixmap *pixmap ) GdkPixmap *wxBitmap::GetPixmap() const { - wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, T("invalid bitmap") ); return M_BMPDATA->m_pixmap; } GdkBitmap *wxBitmap::GetBitmap() const { - wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, _T("invalid bitmap") ); + wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, T("invalid bitmap") ); return M_BMPDATA->m_bitmap; } diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp index b9226adabf..47f6662935 100644 --- a/src/gtk1/bmpbuttn.cpp +++ b/src/gtk1/bmpbuttn.cpp @@ -121,7 +121,7 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxBitmapButton creation failed") ); + wxFAIL_MSG( T("wxBitmapButton creation failed") ); return FALSE; } @@ -190,14 +190,14 @@ void wxBitmapButton::SetDefault() void wxBitmapButton::SetLabel( const wxString &label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); wxControl::SetLabel( label ); } wxString wxBitmapButton::GetLabel() const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid button") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid button") ); return wxControl::GetLabel(); } @@ -208,7 +208,7 @@ void wxBitmapButton::ApplyWidgetStyle() void wxBitmapButton::SetBitmap() { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); wxBitmap the_one; @@ -243,7 +243,7 @@ void wxBitmapButton::SetBitmap() void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); if ( ! m_disabled.Ok() ) return; m_disabled = bitmap; @@ -253,7 +253,7 @@ void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); if ( ! m_focus.Ok() ) return; m_focus = bitmap; @@ -263,7 +263,7 @@ void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); if (!m_bitmap.Ok()) return; m_bitmap = bitmap; @@ -273,7 +273,7 @@ void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); if ( ! m_selected.Ok() ) return; m_selected = bitmap; diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp index ae8e34635c..a324ecea66 100644 --- a/src/gtk1/brush.cpp +++ b/src/gtk1/brush.cpp @@ -111,7 +111,7 @@ int wxBrush::GetStyle() const { if (m_refData == NULL) { - wxFAIL_MSG( _T("invalid brush") ); + wxFAIL_MSG( T("invalid brush") ); return 0; } @@ -122,7 +122,7 @@ wxColour &wxBrush::GetColour() const { if (m_refData == NULL) { - wxFAIL_MSG( _T("invalid brush") ); + wxFAIL_MSG( T("invalid brush") ); return wxNullColour; } @@ -133,7 +133,7 @@ wxBitmap *wxBrush::GetStipple() const { if (m_refData == NULL) { - wxFAIL_MSG( _T("invalid brush") ); + wxFAIL_MSG( T("invalid brush") ); return &wxNullBitmap; } diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 2bb626f031..0d2353b918 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -78,7 +78,7 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxButton creation failed") ); + wxFAIL_MSG( T("wxButton creation failed") ); return FALSE; } @@ -142,7 +142,7 @@ wxSize wxButton::GetDefaultSize() void wxButton::SetLabel( const wxString &label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid button") ); + wxCHECK_RET( m_widget != NULL, T("invalid button") ); wxControl::SetLabel( label ); diff --git a/src/gtk1/checkbox.cpp b/src/gtk1/checkbox.cpp index af1d2592c3..a7763349d2 100644 --- a/src/gtk1/checkbox.cpp +++ b/src/gtk1/checkbox.cpp @@ -75,7 +75,7 @@ bool wxCheckBox::Create(wxWindow *parent, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxCheckBox creation failed") ); + wxFAIL_MSG( T("wxCheckBox creation failed") ); return FALSE; } @@ -136,7 +136,7 @@ bool wxCheckBox::Create(wxWindow *parent, void wxCheckBox::SetValue( bool state ) { - wxCHECK_RET( m_widgetCheckbox != NULL, _T("invalid checkbox") ); + wxCHECK_RET( m_widgetCheckbox != NULL, T("invalid checkbox") ); if (state == GetValue()) return; @@ -155,14 +155,14 @@ void wxCheckBox::SetValue( bool state ) bool wxCheckBox::GetValue() const { - wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, _T("invalid checkbox") ); + wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, T("invalid checkbox") ); return GTK_TOGGLE_BUTTON(m_widgetCheckbox)->active; } void wxCheckBox::SetLabel( const wxString& label ) { - wxCHECK_RET( m_widgetLabel != NULL, _T("invalid checkbox") ); + wxCHECK_RET( m_widgetLabel != NULL, T("invalid checkbox") ); wxControl::SetLabel( label ); diff --git a/src/gtk1/checklst.cpp b/src/gtk1/checklst.cpp index 6e97994417..5730929a86 100644 --- a/src/gtk1/checklst.cpp +++ b/src/gtk1/checklst.cpp @@ -44,7 +44,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id, bool wxCheckListBox::IsChecked( int index ) const { - wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid checklistbox") ); + wxCHECK_MSG( m_list != NULL, FALSE, T("invalid checklistbox") ); GList *child = g_list_nth( m_list->children, index ); if (child) @@ -54,16 +54,16 @@ bool wxCheckListBox::IsChecked( int index ) const wxString str = wxString(label->label,*wxConvCurrent); - return (str[1] == _T('X')); + return (str[1] == T('X')); } - wxFAIL_MSG(_T("wrong checklistbox index")); + wxFAIL_MSG(T("wrong checklistbox index")); return FALSE; } void wxCheckListBox::Check( int index, bool check ) { - wxCHECK_RET( m_list != NULL, _T("invalid checklistbox") ); + wxCHECK_RET( m_list != NULL, T("invalid checklistbox") ); GList *child = g_list_nth( m_list->children, index ); if (child) @@ -73,19 +73,19 @@ void wxCheckListBox::Check( int index, bool check ) wxString str = wxString(label->label,*wxConvCurrent); - if (check == (str[1] == _T('X'))) return; + if (check == (str[1] == T('X'))) return; if (check) - str.SetChar( 1, _T('X') ); + str.SetChar( 1, T('X') ); else - str.SetChar( 1, _T('-') ); + str.SetChar( 1, T('-') ); gtk_label_set( label, str.mbc_str() ); return; } - wxFAIL_MSG(_T("wrong checklistbox index")); + wxFAIL_MSG(T("wrong checklistbox index")); } int wxCheckListBox::GetItemHeight() const diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index c78d0a2e8f..21a697ce57 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -75,7 +75,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxChoice creation failed") ); + wxFAIL_MSG( T("wxChoice creation failed") ); return FALSE; } @@ -125,7 +125,7 @@ wxChoice::~wxChoice() void wxChoice::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); + wxCHECK_RET( m_widget != NULL, T("invalid choice") ); GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ); GtkWidget *menu_item = gtk_menu_item_new_with_label( item.mbc_str() ); @@ -172,7 +172,7 @@ void wxChoice::Append( const wxString &item, wxClientData *clientData ) void wxChoice::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -182,7 +182,7 @@ void wxChoice::SetClientData( int n, void* clientData ) void* wxChoice::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -192,7 +192,7 @@ void* wxChoice::GetClientData( int n ) void wxChoice::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -205,7 +205,7 @@ void wxChoice::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxChoice::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -215,7 +215,7 @@ wxClientData* wxChoice::GetClientObject( int n ) void wxChoice::Clear() { - wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); + wxCHECK_RET( m_widget != NULL, T("invalid choice") ); gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) ); GtkWidget *menu = gtk_menu_new(); @@ -235,12 +235,12 @@ void wxChoice::Clear() void wxChoice::Delete( int WXUNUSED(n) ) { - wxFAIL_MSG( _T("wxChoice:Delete not implemented") ); + wxFAIL_MSG( T("wxChoice:Delete not implemented") ); } int wxChoice::FindString( const wxString &string ) const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid choice") ); // If you read this code once and you think you understand // it, then you are very wrong. Robert Roebling. @@ -255,7 +255,7 @@ int wxChoice::FindString( const wxString &string ) const if (bin->child) label = GTK_LABEL(bin->child); if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); + wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") ); if (string == wxString(label->label,*wxConvCurrent)) return count; @@ -274,7 +274,7 @@ int wxChoice::GetColumns() const int wxChoice::GetSelection() { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -292,7 +292,7 @@ int wxChoice::GetSelection() wxString wxChoice::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -306,7 +306,7 @@ wxString wxChoice::GetString( int n ) const if (bin->child) label = GTK_LABEL(bin->child); if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); + wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") ); return wxString(label->label,*wxConvCurrent); } @@ -314,25 +314,25 @@ wxString wxChoice::GetString( int n ) const count++; } - wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") ); + wxFAIL_MSG( T("wxChoice: invalid index in GetString()") ); - return _T(""); + return T(""); } wxString wxChoice::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid choice") ); GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); + wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") ); return wxString(label->label,*wxConvCurrent); } int wxChoice::Number() const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid choice") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -351,7 +351,7 @@ void wxChoice::SetColumns( int WXUNUSED(n) ) void wxChoice::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); + wxCHECK_RET( m_widget != NULL, T("invalid choice") ); int tmp = n; gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp ); @@ -359,7 +359,7 @@ void wxChoice::SetSelection( int n ) void wxChoice::SetStringSelection( const wxString &string ) { - wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); + wxCHECK_RET( m_widget != NULL, T("invalid choice") ); int n = FindString( string ); if (n != -1) SetSelection( n ); diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp index d3cd53bc4e..29442366dc 100644 --- a/src/gtk1/clipbrd.cpp +++ b/src/gtk1/clipbrd.cpp @@ -450,7 +450,7 @@ void wxClipboard::Clear() bool wxClipboard::Open() { - wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") ); + wxCHECK_MSG( !m_open, FALSE, T("clipboard already open") ); m_open = TRUE; @@ -459,9 +459,9 @@ bool wxClipboard::Open() bool wxClipboard::SetData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); + wxCHECK_MSG( m_open, FALSE, T("clipboard not open") ); - wxCHECK_MSG( data, FALSE, _T("data is invalid") ); + wxCHECK_MSG( data, FALSE, T("data is invalid") ); Clear(); @@ -470,9 +470,9 @@ bool wxClipboard::SetData( wxDataObject *data ) bool wxClipboard::AddData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); + wxCHECK_MSG( m_open, FALSE, T("clipboard not open") ); - wxCHECK_MSG( data, FALSE, _T("data is invalid") ); + wxCHECK_MSG( data, FALSE, T("data is invalid") ); /* if clipboard has been cleared before, create new data broker */ if (!m_dataBroker) m_dataBroker = new wxDataBroker(); @@ -483,7 +483,7 @@ bool wxClipboard::AddData( wxDataObject *data ) /* get native format id of new data object */ GdkAtom format = data->GetFormat().GetAtom(); - wxCHECK_MSG( format, FALSE, _T("data has invalid format") ); + wxCHECK_MSG( format, FALSE, T("data has invalid format") ); /* This should happen automatically, but to be on the safe side */ m_ownsClipboard = FALSE; @@ -563,20 +563,20 @@ bool wxClipboard::AddData( wxDataObject *data ) void wxClipboard::Close() { - wxCHECK_RET( m_open, _T("clipboard not open") ); + wxCHECK_RET( m_open, T("clipboard not open") ); m_open = FALSE; } bool wxClipboard::IsSupported( wxDataFormat format ) { - wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); + wxCHECK_MSG( m_open, FALSE, T("clipboard not open") ); /* store requested format to be asked for by callbacks */ m_targetRequested = format.GetAtom(); - wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") ); + wxCHECK_MSG( m_targetRequested, FALSE, T("invalid clipboard format") ); m_formatSupported = FALSE; @@ -604,7 +604,7 @@ bool wxClipboard::IsSupported( wxDataFormat format ) bool wxClipboard::GetData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); + wxCHECK_MSG( m_open, FALSE, T("clipboard not open") ); /* is data supported by clipboard ? */ @@ -618,7 +618,7 @@ bool wxClipboard::GetData( wxDataObject *data ) m_targetRequested = data->GetFormat().GetAtom(); - wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") ); + wxCHECK_MSG( m_targetRequested, FALSE, T("invalid clipboard format") ); /* start query */ @@ -644,7 +644,7 @@ bool wxClipboard::GetData( wxDataObject *data ) /* this is a true error as we checked for the presence of such data before */ - wxCHECK_MSG( m_formatSupported, FALSE, _T("error retrieving data from clipboard") ); + wxCHECK_MSG( m_formatSupported, FALSE, T("error retrieving data from clipboard") ); return TRUE; } diff --git a/src/gtk1/colour.cpp b/src/gtk1/colour.cpp index 51fde80c11..ac8a7022dd 100644 --- a/src/gtk1/colour.cpp +++ b/src/gtk1/colour.cpp @@ -91,8 +91,8 @@ void wxColour::InitFromName( const wxString &colourName ) m_refData = new wxColourRefData(); if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color )) { - wxFAIL_MSG( _T("wxColour: couldn't find colour") ); - wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName ); + wxFAIL_MSG( T("wxColour: couldn't find colour") ); + wxPrintf( T("Colourname %s.\n"), WXSTRINGCAST colourName ); delete m_refData; m_refData = (wxObjectRefData *) NULL; @@ -149,21 +149,21 @@ void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue ) unsigned char wxColour::Red() const { - wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); + wxCHECK_MSG( Ok(), 0, T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.red >> SHIFT); } unsigned char wxColour::Green() const { - wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); + wxCHECK_MSG( Ok(), 0, T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.green >> SHIFT); } unsigned char wxColour::Blue() const { - wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); + wxCHECK_MSG( Ok(), 0, T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT); } @@ -211,14 +211,14 @@ void wxColour::CalcPixel( GdkColormap *cmap ) int wxColour::GetPixel() const { - wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); + wxCHECK_MSG( Ok(), 0, T("invalid colour") ); return M_COLDATA->m_color.pixel; } GdkColor *wxColour::GetColor() const { - wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") ); + wxCHECK_MSG( Ok(), (GdkColor *) NULL, T("invalid colour") ); return &M_COLDATA->m_color; } diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index da4657688f..74ca53348b 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -104,7 +104,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxComboBox creation failed") ); + wxFAIL_MSG( T("wxComboBox creation failed") ); return FALSE; } @@ -180,7 +180,7 @@ wxComboBox::~wxComboBox() void wxComboBox::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -228,7 +228,7 @@ void wxComboBox::Append( const wxString &item, wxClientData *clientData ) void wxComboBox::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -238,7 +238,7 @@ void wxComboBox::SetClientData( int n, void* clientData ) void* wxComboBox::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -248,7 +248,7 @@ void* wxComboBox::GetClientData( int n ) void wxComboBox::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -261,7 +261,7 @@ void wxComboBox::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxComboBox::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -271,7 +271,7 @@ wxClientData* wxComboBox::GetClientObject( int n ) void wxComboBox::Clear() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; gtk_list_clear_items( GTK_LIST(list), 0, Number() ); @@ -290,7 +290,7 @@ void wxComboBox::Clear() void wxComboBox::Delete( int n ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkList *listbox = GTK_LIST( GTK_COMBO(m_widget)->list ); @@ -298,7 +298,7 @@ void wxComboBox::Delete( int n ) if (!child) { - wxFAIL_MSG(_T("wrong index")); + wxFAIL_MSG(T("wrong index")); return; } @@ -323,7 +323,7 @@ void wxComboBox::Delete( int n ) int wxComboBox::FindString( const wxString &item ) { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -344,7 +344,7 @@ int wxComboBox::FindString( const wxString &item ) int wxComboBox::GetSelection() const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -366,7 +366,7 @@ int wxComboBox::GetSelection() const wxString wxComboBox::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -380,7 +380,7 @@ wxString wxComboBox::GetString( int n ) const } else { - wxFAIL_MSG( _T("wxComboBox: wrong index") ); + wxFAIL_MSG( T("wxComboBox: wrong index") ); } return str; @@ -388,7 +388,7 @@ wxString wxComboBox::GetString( int n ) const wxString wxComboBox::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -400,14 +400,14 @@ wxString wxComboBox::GetStringSelection() const return tmp; } - wxFAIL_MSG( _T("wxComboBox: no selection") ); + wxFAIL_MSG( T("wxComboBox: no selection") ); - return _T(""); + return T(""); } int wxComboBox::Number() const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -419,7 +419,7 @@ int wxComboBox::Number() const void wxComboBox::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); DisableEvents(); @@ -431,7 +431,7 @@ void wxComboBox::SetSelection( int n ) void wxComboBox::SetStringSelection( const wxString &string ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); int res = FindString( string ); if (res == -1) return; @@ -447,17 +447,17 @@ wxString wxComboBox::GetValue() const void wxComboBox::SetValue( const wxString& value ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; - wxString tmp = _T(""); + wxString tmp = T(""); if (!value.IsNull()) tmp = value; gtk_entry_set_text( GTK_ENTRY(entry), tmp.mbc_str() ); } void wxComboBox::Copy() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -469,7 +469,7 @@ void wxComboBox::Copy() void wxComboBox::Cut() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -481,7 +481,7 @@ void wxComboBox::Cut() void wxComboBox::Paste() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -493,7 +493,7 @@ void wxComboBox::Paste() void wxComboBox::SetInsertionPoint( long pos ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_entry_set_position( GTK_ENTRY(entry), (int)pos ); @@ -501,7 +501,7 @@ void wxComboBox::SetInsertionPoint( long pos ) void wxComboBox::SetInsertionPointEnd() { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); SetInsertionPoint( -1 ); } @@ -521,7 +521,7 @@ long wxComboBox::GetLastPosition() const void wxComboBox::Replace( long from, long to, const wxString& value ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); // FIXME: not quite sure how to do this method right in multibyte mode GtkWidget *entry = GTK_COMBO(m_widget)->entry; @@ -533,7 +533,7 @@ void wxComboBox::Replace( long from, long to, const wxString& value ) void wxComboBox::Remove(long from, long to) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); diff --git a/src/gtk1/control.cpp b/src/gtk1/control.cpp index 578b12cb9f..d69fae8dc1 100644 --- a/src/gtk1/control.cpp +++ b/src/gtk1/control.cpp @@ -39,13 +39,13 @@ wxControl::wxControl( wxWindow *parent, void wxControl::SetLabel( const wxString &label ) { m_label.Empty(); - for ( const wxChar *pc = label; *pc != _T('\0'); pc++ ) + for ( const wxChar *pc = label; *pc != T('\0'); pc++ ) { - if ( *pc == _T('&') ) + if ( *pc == T('&') ) { pc++; // skip it #if 0 // it would be unused anyhow for now - kbd interface not done yet - if ( *pc != _T('&') ) m_chAccel = *pc; + if ( *pc != T('&') ) m_chAccel = *pc; #endif } m_label << *pc; diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index 7a47bd6bd9..b0f4363412 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -93,7 +93,7 @@ wxCursor::wxCursor( int cursorId ) case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break; */ default: - wxFAIL_MSG(_T("unsupported cursor type")); + wxFAIL_MSG(T("unsupported cursor type")); // will use the standard one case wxCURSOR_ARROW: @@ -168,7 +168,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) return; wxASSERT_MSG( !gs_savedCursor.Ok(), - _T("forgot to call wxEndBusyCursor, will leak memory") ); + T("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = g_globalCursor; diff --git a/src/gtk1/data.cpp b/src/gtk1/data.cpp index 2c366d7d29..063c74c4fe 100644 --- a/src/gtk1/data.cpp +++ b/src/gtk1/data.cpp @@ -142,46 +142,45 @@ wxColour wxNullColour; wxPalette wxNullPalette; /* Default window names */ -const wxChar *wxButtonNameStr = _T("button"); -const wxChar *wxCanvasNameStr = _T("canvas"); -const wxChar *wxCheckBoxNameStr = _T("check"); -const wxChar *wxChoiceNameStr = _T("choice"); -const wxChar *wxComboBoxNameStr = _T("comboBox"); -const wxChar *wxDialogNameStr = _T("dialog"); -const wxChar *wxFrameNameStr = _T("frame"); -const wxChar *wxGaugeNameStr = _T("gauge"); -const wxChar *wxStaticBoxNameStr = _T("groupBox"); -const wxChar *wxListBoxNameStr = _T("listBox"); -const wxChar *wxStaticTextNameStr = _T("message"); -const wxChar *wxStaticBitmapNameStr = _T("message"); -const wxChar *wxMultiTextNameStr = _T("multitext"); -const wxChar *wxPanelNameStr = _T("panel"); -const wxChar *wxRadioBoxNameStr = _T("radioBox"); -const wxChar *wxRadioButtonNameStr = _T("radioButton"); -const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton"); -const wxChar *wxScrollBarNameStr = _T("scrollBar"); -const wxChar *wxSliderNameStr = _T("slider"); -const wxChar *wxStaticNameStr = _T("static"); -const wxChar *wxTextCtrlWindowNameStr = _T("textWindow"); -const wxChar *wxTextCtrlNameStr = _T("text"); -const wxChar *wxVirtListBoxNameStr = _T("virtListBox"); -const wxChar *wxButtonBarNameStr = _T("buttonbar"); -const wxChar *wxEnhDialogNameStr = _T("Shell"); -const wxChar *wxToolBarNameStr = _T("toolbar"); -const wxChar *wxStatusLineNameStr = _T("status_line"); -const wxChar *wxEmptyString = _T(""); -const wxChar *wxGetTextFromUserPromptStr = _T("Input Text"); -const wxChar *wxMessageBoxCaptionStr = _T("Message"); -const wxChar *wxFileSelectorPromptStr = _T("Select a file"); -const wxChar *wxFileSelectorDefaultWildcardStr = _T("*"); -const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error"); -const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error"); -const wxChar *wxDirDialogNameStr = _T("wxDirCtrl"); -const wxChar *wxDirDialogDefaultFolderStr = _T("/"); +const wxChar *wxButtonNameStr = T("button"); +const wxChar *wxCanvasNameStr = T("canvas"); +const wxChar *wxCheckBoxNameStr = T("check"); +const wxChar *wxChoiceNameStr = T("choice"); +const wxChar *wxComboBoxNameStr = T("comboBox"); +const wxChar *wxDialogNameStr = T("dialog"); +const wxChar *wxFrameNameStr = T("frame"); +const wxChar *wxGaugeNameStr = T("gauge"); +const wxChar *wxStaticBoxNameStr = T("groupBox"); +const wxChar *wxListBoxNameStr = T("listBox"); +const wxChar *wxStaticTextNameStr = T("message"); +const wxChar *wxStaticBitmapNameStr = T("message"); +const wxChar *wxMultiTextNameStr = T("multitext"); +const wxChar *wxPanelNameStr = T("panel"); +const wxChar *wxRadioBoxNameStr = T("radioBox"); +const wxChar *wxRadioButtonNameStr = T("radioButton"); +const wxChar *wxBitmapRadioButtonNameStr = T("radioButton"); +const wxChar *wxScrollBarNameStr = T("scrollBar"); +const wxChar *wxSliderNameStr = T("slider"); +const wxChar *wxStaticNameStr = T("static"); +const wxChar *wxTextCtrlWindowNameStr = T("textWindow"); +const wxChar *wxTextCtrlNameStr = T("text"); +const wxChar *wxVirtListBoxNameStr = T("virtListBox"); +const wxChar *wxButtonBarNameStr = T("buttonbar"); +const wxChar *wxEnhDialogNameStr = T("Shell"); +const wxChar *wxToolBarNameStr = T("toolbar"); +const wxChar *wxStatusLineNameStr = T("status_line"); +const wxChar *wxGetTextFromUserPromptStr = T("Input Text"); +const wxChar *wxMessageBoxCaptionStr = T("Message"); +const wxChar *wxFileSelectorPromptStr = T("Select a file"); +const wxChar *wxFileSelectorDefaultWildcardStr = T("*"); +const wxChar *wxInternalErrorStr = T("wxWindows Internal Error"); +const wxChar *wxFatalErrorStr = T("wxWindows Fatal Error"); +const wxChar *wxDirDialogNameStr = T("wxDirCtrl"); +const wxChar *wxDirDialogDefaultFolderStr = T("/"); /* See wx/utils.h */ -const wxChar *wxFloatToStringStr = _T("%.2f"); -const wxChar *wxDoubleToStringStr = _T("%.2f"); +const wxChar *wxFloatToStringStr = T("%.2f"); +const wxChar *wxDoubleToStringStr = T("%.2f"); /* Dafaults for wxWindow etc. */ const wxSize wxDefaultSize(-1, -1); diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp index 3af8442a63..8b217e7bc4 100644 --- a/src/gtk1/dataobj.cpp +++ b/src/gtk1/dataobj.cpp @@ -87,7 +87,7 @@ wxDataFormat::wxDataFormat( const GdkAtom atom ) m_type = wxDF_PRIVATE; m_id = gdk_atom_name( m_atom ); - if (m_id == _T("file:ALL")) + if (m_id == T("file:ALL")) { m_type = wxDF_FILENAME; } @@ -100,21 +100,21 @@ void wxDataFormat::SetType( wxDataFormatId type ) if (m_type == wxDF_TEXT) { - m_id = _T("STRING"); + m_id = T("STRING"); } else if (m_type == wxDF_BITMAP) { - m_id = _T("image/png"); + m_id = T("image/png"); } else if (m_type == wxDF_FILENAME) { - m_id = _T("file:ALL"); + m_id = T("file:ALL"); } else { - wxFAIL_MSG( _T("invalid dataformat") ); + wxFAIL_MSG( T("invalid dataformat") ); } m_hasAtom = FALSE; @@ -155,7 +155,7 @@ GdkAtom wxDataFormat::GetAtom() else if (m_type == wxDF_PRIVATE) { - m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE ); + m_atom = gdk_atom_intern( wxMBSTRINGCAST m_id.mbc_str(), FALSE ); } else if (m_type == wxDF_FILENAME) @@ -484,7 +484,7 @@ void wxPrivateDataObject::Free() wxPrivateDataObject::wxPrivateDataObject() { - wxString id = _T("application/"); + wxString id = T("application/"); id += wxTheApp->GetAppName(); m_format.SetId( id ); diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index e75b32227e..d0d94aaaf4 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -112,11 +112,11 @@ wxWindowDC::wxWindowDC( wxWindow *window ) m_isMemDC = FALSE; m_font = window->GetFont(); - wxASSERT_MSG( window, _T("DC needs a window") ); + wxASSERT_MSG( window, T("DC needs a window") ); GtkWidget *widget = window->m_wxwindow; - wxASSERT_MSG( widget, _T("DC needs a widget") ); + wxASSERT_MSG( widget, T("DC needs a widget") ); m_window = widget->window; @@ -154,18 +154,18 @@ wxWindowDC::~wxWindowDC() void wxWindowDC::DoFloodFill( long WXUNUSED(x), long WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style) ) { - wxFAIL_MSG( _T("wxWindowDC::DoFloodFill not implemented") ); + wxFAIL_MSG( T("wxWindowDC::DoFloodFill not implemented") ); } bool wxWindowDC::DoGetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const { - wxFAIL_MSG( _T("wxWindowDC::DoGetPixel not implemented") ); + wxFAIL_MSG( T("wxWindowDC::DoGetPixel not implemented") ); return FALSE; } void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) { @@ -179,7 +179,7 @@ void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 ) void wxWindowDC::DoCrossHair( long x, long y ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) { @@ -199,7 +199,7 @@ void wxWindowDC::DoCrossHair( long x, long y ) void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2, long xc, long yc ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); long xx1 = XLOG2DEV(x1); long yy1 = YLOG2DEV(y1); @@ -252,7 +252,7 @@ void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2, void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -281,7 +281,7 @@ void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, dou void wxWindowDC::DoDrawPoint( long x, long y ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if ((m_pen.GetStyle() != wxTRANSPARENT) && m_window) gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) ); @@ -291,7 +291,7 @@ void wxWindowDC::DoDrawPoint( long x, long y ) void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffset ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_pen.GetStyle() == wxTRANSPARENT) return; if (n <= 0) return; @@ -314,7 +314,7 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffse void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (n <= 0) return; @@ -350,7 +350,7 @@ void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoff void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -379,7 +379,7 @@ void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height ) void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height, double radius ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (radius < 0.0) radius = - radius * ((width < height) ? width : height); @@ -451,7 +451,7 @@ void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -485,9 +485,9 @@ void wxWindowDC::DoDrawBitmap( const wxBitmap &bitmap, long x, long y, bool useMask ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); - wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") ); /* scale/translate size and position */ @@ -566,9 +566,9 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height, of the source dc, but scales correctly on the target dc and knows about possible mask information in a memory dc. */ - wxCHECK_MSG( Ok(), FALSE, _T("invalid window dc") ); + wxCHECK_MSG( Ok(), FALSE, T("invalid window dc") ); - wxCHECK_MSG( source, FALSE, _T("invalid source dc") ); + wxCHECK_MSG( source, FALSE, T("invalid source dc") ); if (!m_window) return FALSE; @@ -754,7 +754,7 @@ bool wxWindowDC::DoBlit( long xdest, long ydest, long width, long height, void wxWindowDC::DoDrawText( const wxString &text, long x, long y ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (!m_window) return; @@ -819,7 +819,7 @@ long wxWindowDC::GetCharHeight() const void wxWindowDC::Clear() { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (!m_window) return; @@ -854,7 +854,7 @@ void wxWindowDC::SetFont( const wxFont &font ) void wxWindowDC::SetPen( const wxPen &pen ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_pen == pen) return; @@ -985,7 +985,7 @@ void wxWindowDC::SetPen( const wxPen &pen ) void wxWindowDC::SetBrush( const wxBrush &brush ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_brush == brush) return; @@ -1027,7 +1027,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) /* CMB 21/7/98: Added SetBackground. Sets background brush * for Clear() and bg colour for shapes filled with cross-hatch brush */ - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_backgroundBrush == brush) return; @@ -1069,7 +1069,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) void wxWindowDC::SetLogicalFunction( int function ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_logicalFunction == function) return; @@ -1097,7 +1097,7 @@ void wxWindowDC::SetLogicalFunction( int function ) #endif default: { - wxFAIL_MSG( _T("unsupported logical function") ); + wxFAIL_MSG( T("unsupported logical function") ); break; } } @@ -1113,7 +1113,7 @@ void wxWindowDC::SetLogicalFunction( int function ) void wxWindowDC::SetTextForeground( const wxColour &col ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_textForegroundColour == col) return; @@ -1128,7 +1128,7 @@ void wxWindowDC::SetTextForeground( const wxColour &col ) void wxWindowDC::SetTextBackground( const wxColour &col ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (m_textBackgroundColour == col) return; @@ -1143,7 +1143,7 @@ void wxWindowDC::SetTextBackground( const wxColour &col ) void wxWindowDC::SetBackgroundMode( int mode ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); m_backgroundMode = mode; @@ -1161,12 +1161,12 @@ void wxWindowDC::SetBackgroundMode( int mode ) void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) ) { - wxFAIL_MSG( _T("wxWindowDC::SetPalette not implemented") ); + wxFAIL_MSG( T("wxWindowDC::SetPalette not implemented") ); } void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); wxDC::DoSetClippingRegion( x, y, width, height ); @@ -1185,7 +1185,7 @@ void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height ) void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); if (region.Empty()) { @@ -1203,7 +1203,7 @@ void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion ) void wxWindowDC::DestroyClippingRegion() { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); wxDC::DestroyClippingRegion(); @@ -1306,7 +1306,7 @@ wxSize wxWindowDC::GetPPI() const int wxWindowDC::GetDepth() const { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return -1; } @@ -1429,7 +1429,7 @@ static void wx_spline_draw_point_array(wxDC *dc) void wxWindowDC::DoDrawSpline( wxList *points ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); wxPoint *p; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 4869b9263f..275b1eb4e9 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -288,7 +288,7 @@ bool wxDialog::Create( wxWindow *parent, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxDialog creation failed") ); + wxFAIL_MSG( T("wxDialog creation failed") ); return FALSE; } @@ -356,7 +356,7 @@ wxDialog::~wxDialog() void wxDialog::SetTitle( const wxString& title ) { m_title = title; - if (m_title.IsNull()) m_title = _T(""); + if (m_title.IsNull()) m_title = T(""); gtk_window_set_title( GTK_WINDOW(m_widget), m_title.mbc_str() ); } @@ -442,7 +442,7 @@ bool wxDialog::Destroy() void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") ); #if wxUSE_CONSTRAINTS if (GetAutoLayout()) @@ -477,8 +477,8 @@ void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); - wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid dialog") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") ); + wxASSERT_MSG( (m_wxwindow != NULL), T("invalid dialog") ); if (m_resizing) return; /* I don't like recursions */ m_resizing = TRUE; @@ -567,7 +567,7 @@ void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int heigh void wxDialog::Centre( int direction ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") ); int x = 0; int y = 0; @@ -623,14 +623,14 @@ void wxDialog::SetModal( bool WXUNUSED(flag) ) else if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL; */ - wxFAIL_MSG( _T("wxDialog:SetModal obsolete now") ); + wxFAIL_MSG( T("wxDialog:SetModal obsolete now") ); } int wxDialog::ShowModal() { if (IsModal()) { - wxFAIL_MSG( _T("wxDialog:ShowModal called twice") ); + wxFAIL_MSG( T("wxDialog:ShowModal called twice") ); return GetReturnCode(); } @@ -653,7 +653,7 @@ void wxDialog::EndModal( int retCode ) if (!IsModal()) { - wxFAIL_MSG( _T("wxDialog:EndModal called twice") ); + wxFAIL_MSG( T("wxDialog:EndModal called twice") ); return; } diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index df6de3a991..7189c1286b 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -367,9 +367,9 @@ bool wxDropTarget::RequestData( wxDataFormat format ) if (!m_dragWidget) return FALSE; /* - wxPrintf( _T("format: %s.\n"), format.GetId().c_str() ); - if (format.GetType() == wxDF_PRIVATE) wxPrintf( _T("private data.\n") ); - if (format.GetType() == wxDF_TEXT) wxPrintf( _T("text data.\n") ); + wxPrintf( T("format: %s.\n"), format.GetId().c_str() ); + if (format.GetType() == wxDF_PRIVATE) wxPrintf( T("private data.\n") ); + if (format.GetType() == wxDF_TEXT) wxPrintf( T("text data.\n") ); */ #if wxUSE_THREADS @@ -437,7 +437,7 @@ bool wxDropTarget::GetData( wxDataObject *data_object ) void wxDropTarget::UnregisterWidget( GtkWidget *widget ) { - wxCHECK_RET( widget != NULL, _T("unregister widget is NULL") ); + wxCHECK_RET( widget != NULL, T("unregister widget is NULL") ); gtk_drag_dest_unset( widget ); @@ -456,7 +456,7 @@ void wxDropTarget::UnregisterWidget( GtkWidget *widget ) void wxDropTarget::RegisterWidget( GtkWidget *widget ) { - wxCHECK_RET( widget != NULL, _T("register widget is NULL") ); + wxCHECK_RET( widget != NULL, T("register widget is NULL") ); /* gtk_drag_dest_set() determines what default behaviour we'd like GTK to supply. we don't want to specify out targets (=formats) @@ -817,7 +817,7 @@ wxDropSource::~wxDropSource(void) wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) { - wxASSERT_MSG( m_data, _T("wxDragSource: no data") ); + wxASSERT_MSG( m_data, T("wxDragSource: no data") ); if (!m_data) return (wxDragResult) wxDragNone; diff --git a/src/gtk1/filedlg.cpp b/src/gtk1/filedlg.cpp index f2c2c99011..65552158fd 100644 --- a/src/gtk1/filedlg.cpp +++ b/src/gtk1/filedlg.cpp @@ -117,14 +117,14 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message, m_needParent = FALSE; if (!PreCreation( parent, pos, wxDefaultSize ) || - !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, _T("filedialog") )) + !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, T("filedialog") )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return; } m_message = message; - m_path = _T(""); + m_path = T(""); m_fileName = defaultFileName; m_dir = defaultDir; m_wildCard = wildCard; @@ -141,7 +141,7 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message, gtk_file_selection_hide_fileop_buttons( sel ); // they don't work anyway m_path.Append(m_dir); - if( ! m_path.IsEmpty() && m_path.Last()!=_T('/') ) + if( ! m_path.IsEmpty() && m_path.Last()!=T('/') ) m_path.Append('/'); m_path.Append(m_fileName); @@ -173,7 +173,7 @@ void wxFileDialog::SetPath(const wxString& path) wxSplitPath(path, &m_dir, &m_fileName, &ext); if (!ext.IsEmpty()) { - m_fileName += _T("."); + m_fileName += T("."); m_fileName += ext; } } @@ -194,7 +194,7 @@ wxFileSelectorEx(const wxChar *message, int x, int y) { // TODO: implement this somehow - return wxFileSelector(message, default_path, default_filename, _T(""), + return wxFileSelector(message, default_path, default_filename, T(""), wildcard, flags, parent, x, y); } @@ -205,7 +205,7 @@ wxString wxFileSelector( const wxChar *title, { wxString filter2; if ( defaultExtension && !filter ) - filter2 = wxString(_T("*.")) + wxString(defaultExtension) ; + filter2 = wxString(T("*.")) + wxString(defaultExtension) ; else if ( filter ) filter2 = filter; @@ -237,9 +237,9 @@ wxString wxLoadFileSelector( const wxChar *what, const wxChar *extension, const wxString str = _("Load %s file"); wxSprintf(prompt, str, what); - if (*ext == _T('.')) ext++; + if (*ext == T('.')) ext++; wxChar wild[60]; - wxSprintf(wild, _T("*.%s"), ext); + wxSprintf(wild, T("*.%s"), ext); return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent); } @@ -253,9 +253,9 @@ wxString wxSaveFileSelector(const wxChar *what, const wxChar *extension, const w wxString str = _("Save %s file"); wxSprintf(prompt, str, what); - if (*ext == _T('.')) ext++; + if (*ext == T('.')) ext++; wxChar wild[60]; - wxSprintf(wild, _T("*.%s"), ext); + wxSprintf(wild, T("*.%s"), ext); return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent); } diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index ec3b8427b2..c27134680f 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -162,18 +162,18 @@ wxFont::wxFont( GdkFont *WXUNUSED(font), char *xFontName ) wxString tmp; wxString fontname( xFontName ); - wxStringTokenizer tn( fontname, _T("-") ); + wxStringTokenizer tn( fontname, T("-") ); tn.GetNextToken(); // foundry M_FONTDATA->m_faceName = tn.GetNextToken(); // courier tmp = tn.GetNextToken().MakeUpper(); - if (tmp == _T("BOLD")) M_FONTDATA->m_weight = wxBOLD; + if (tmp == T("BOLD")) M_FONTDATA->m_weight = wxBOLD; tmp = tn.GetNextToken().MakeUpper(); - if (tmp == _T("I")) M_FONTDATA->m_style = wxITALIC; - if (tmp == _T("O")) M_FONTDATA->m_style = wxITALIC; + if (tmp == T("I")) M_FONTDATA->m_style = wxITALIC; + if (tmp == T("O")) M_FONTDATA->m_style = wxITALIC; tn.GetNextToken(); // set width tn.GetNextToken(); // ? @@ -187,12 +187,12 @@ wxFont::wxFont( GdkFont *WXUNUSED(font), char *xFontName ) tn.GetNextToken(); // y-res tmp = tn.GetNextToken().MakeUpper(); - if (tmp == _T("M")) M_FONTDATA->m_family = wxMODERN; - else if (M_FONTDATA->m_faceName == _T("TIMES")) M_FONTDATA->m_family = wxROMAN; - else if (M_FONTDATA->m_faceName == _T("HELVETICA")) M_FONTDATA->m_family = wxSWISS; - else if (M_FONTDATA->m_faceName == _T("LUCIDATYPEWRITER")) M_FONTDATA->m_family = wxTELETYPE; - else if (M_FONTDATA->m_faceName == _T("LUCIDA")) M_FONTDATA->m_family = wxDECORATIVE; - else if (M_FONTDATA->m_faceName == _T("UTOPIA")) M_FONTDATA->m_family = wxSCRIPT; + if (tmp == T("M")) M_FONTDATA->m_family = wxMODERN; + else if (M_FONTDATA->m_faceName == T("TIMES")) M_FONTDATA->m_family = wxROMAN; + else if (M_FONTDATA->m_faceName == T("HELVETICA")) M_FONTDATA->m_family = wxSWISS; + else if (M_FONTDATA->m_faceName == T("LUCIDATYPEWRITER")) M_FONTDATA->m_family = wxTELETYPE; + else if (M_FONTDATA->m_faceName == T("LUCIDA")) M_FONTDATA->m_family = wxDECORATIVE; + else if (M_FONTDATA->m_faceName == T("UTOPIA")) M_FONTDATA->m_family = wxSCRIPT; } bool wxFont::Create( int pointSize, @@ -235,42 +235,42 @@ wxFont::~wxFont() int wxFont::GetPointSize() const { - wxCHECK_MSG( Ok(), 0, _T("invalid font") ); + wxCHECK_MSG( Ok(), 0, T("invalid font") ); return M_FONTDATA->m_pointSize; } wxString wxFont::GetFaceName() const { - wxCHECK_MSG( Ok(), _T(""), _T("invalid font") ); + wxCHECK_MSG( Ok(), T(""), T("invalid font") ); return M_FONTDATA->m_faceName; } int wxFont::GetFamily() const { - wxCHECK_MSG( Ok(), 0, _T("invalid font") ); + wxCHECK_MSG( Ok(), 0, T("invalid font") ); return M_FONTDATA->m_family; } int wxFont::GetStyle() const { - wxCHECK_MSG( Ok(), 0, _T("invalid font") ); + wxCHECK_MSG( Ok(), 0, T("invalid font") ); return M_FONTDATA->m_style; } int wxFont::GetWeight() const { - wxCHECK_MSG( Ok(), 0, _T("invalid font") ); + wxCHECK_MSG( Ok(), 0, T("invalid font") ); return M_FONTDATA->m_weight; } bool wxFont::GetUnderlined() const { - wxCHECK_MSG( Ok(), FALSE, _T("invalid font") ); + wxCHECK_MSG( Ok(), FALSE, T("invalid font") ); return M_FONTDATA->m_underlined; } @@ -278,7 +278,7 @@ bool wxFont::GetUnderlined() const wxFontEncoding wxFont::GetEncoding() const { - wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, _T("invalid font") ); + wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, T("invalid font") ); return M_FONTDATA->m_encoding; } @@ -344,7 +344,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const { if (!Ok()) { - wxFAIL_MSG( _T("invalid font") ); + wxFAIL_MSG( T("invalid font") ); return (GdkFont*) NULL; } @@ -387,7 +387,7 @@ GdkFont *wxFont::GetInternalFont( float scale ) const if (!font) { - wxLogError(_T("could not load any font")); + wxLogError(T("could not load any font")); } return font; diff --git a/src/gtk1/fontdlg.cpp b/src/gtk1/fontdlg.cpp index 163c546614..a7808d8ba0 100644 --- a/src/gtk1/fontdlg.cpp +++ b/src/gtk1/fontdlg.cpp @@ -106,13 +106,13 @@ wxFontDialog::wxFontDialog( wxWindow *parent, wxFontData *WXUNUSED(data) ) if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, - wxDefaultValidator, _T("fontdialog") )) + wxDefaultValidator, T("fontdialog") )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return; } #ifndef __WXGTK12__ - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( T("TODO") ); #else // GTK+ 1.2 wxString m_message( _("Choose font") ); m_widget = gtk_font_selection_dialog_new( m_message.mbc_str() ); diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 07944b9b68..3065a36071 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -365,7 +365,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxFrame creation failed") ); + wxFAIL_MSG( T("wxFrame creation failed") ); return FALSE; } @@ -382,7 +382,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() ); #ifdef __WXDEBUG__ - debug_focus_in( m_widget, _T("wxFrame::m_widget"), name ); + debug_focus_in( m_widget, T("wxFrame::m_widget"), name ); #endif gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() ); @@ -398,7 +398,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget ); #ifdef __WXDEBUG__ - debug_focus_in( m_mainWidget, _T("wxFrame::m_mainWidget"), name ); + debug_focus_in( m_mainWidget, T("wxFrame::m_mainWidget"), name ); #endif /* m_wxwindow only represents the client area without toolbar and menubar */ @@ -407,7 +407,7 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow ); #ifdef __WXDEBUG__ - debug_focus_in( m_wxwindow, _T("wxFrame::m_wxwindow"), name ); + debug_focus_in( m_wxwindow, T("wxFrame::m_wxwindow"), name ); #endif /* we donm't allow the frame to get the focus as otherwise @@ -462,7 +462,7 @@ wxFrame::~wxFrame() bool wxFrame::Show( bool show ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); if (show && !m_sizeSet) { @@ -479,7 +479,7 @@ bool wxFrame::Show( bool show ) bool wxFrame::Destroy() { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this); @@ -488,10 +488,10 @@ bool wxFrame::Destroy() void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); /* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */ - wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") ); /* avoid recursions */ if (m_resizing) return; @@ -553,7 +553,7 @@ void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags ) void wxFrame::Centre( int direction ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); int x = 0; int y = 0; @@ -566,7 +566,7 @@ void wxFrame::Centre( int direction ) void wxFrame::DoGetClientSize( int *width, int *height ) const { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); wxWindow::DoGetClientSize( width, height ); if (height) @@ -611,7 +611,7 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const void wxFrame::DoSetClientSize( int width, int height ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); /* menu bar */ if (m_frameMenuBar) @@ -656,7 +656,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int height m_resizing = TRUE; /* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */ - wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") ); m_width = width; m_height = height; @@ -813,7 +813,7 @@ void wxFrame::OnCloseWindow( wxCloseEvent& WXUNUSED(event) ) void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); #if wxUSE_CONSTRAINTS if (GetAutoLayout()) @@ -853,8 +853,8 @@ void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) ) void wxFrame::SetMenuBar( wxMenuBar *menuBar ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); - wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); + wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") ); m_frameMenuBar = menuBar; @@ -920,9 +920,9 @@ void wxFrame::OnMenuHighlight(wxMenuEvent& event) #if wxUSE_TOOLBAR wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& name ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); - wxCHECK_MSG( m_frameToolBar == NULL, FALSE, _T("recreating toolbar in wxFrame") ); + wxCHECK_MSG( m_frameToolBar == NULL, FALSE, T("recreating toolbar in wxFrame") ); m_insertInClientArea = FALSE; @@ -951,9 +951,9 @@ wxToolBar *wxFrame::GetToolBar() const #if wxUSE_STATUSBAR wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, const wxString& name ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); - wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, _T("recreating status bar in wxFrame") ); + wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, T("recreating status bar in wxFrame") ); m_frameStatusBar = OnCreateStatusBar( number, style, id, name ); @@ -990,18 +990,18 @@ wxStatusBar *wxFrame::GetStatusBar() const void wxFrame::SetStatusText(const wxString& text, int number) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); - wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set text for") ); + wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set text for") ); m_frameStatusBar->SetStatusText(text, number); } void wxFrame::SetStatusWidths(int n, const int widths_field[] ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); - wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set widths for") ); + wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set widths for") ); m_frameStatusBar->SetStatusWidths(n, widths_field); } @@ -1029,16 +1029,16 @@ void wxFrame::Command( int id ) void wxFrame::SetTitle( const wxString &title ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); m_title = title; - if (m_title.IsNull()) m_title = _T(""); + if (m_title.IsNull()) m_title = T(""); gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() ); } void wxFrame::SetIcon( const wxIcon &icon ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid frame") ); m_icon = icon; if (!icon.Ok()) return; diff --git a/src/gtk1/gauge.cpp b/src/gtk1/gauge.cpp index 35d9ad6f37..46c3fbdb9f 100644 --- a/src/gtk1/gauge.cpp +++ b/src/gtk1/gauge.cpp @@ -33,7 +33,7 @@ bool wxGauge::Create( wxWindow *parent, wxWindowID id, int range, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxGauge creation failed") ); + wxFAIL_MSG( T("wxGauge creation failed") ); return FALSE; } diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index c27795d42e..4228d0d923 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -259,7 +259,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxListBox creation failed") ); + wxFAIL_MSG( T("wxListBox creation failed") ); return FALSE; } @@ -369,11 +369,11 @@ wxListBox::~wxListBox() void wxListBox::InsertItems(int nItems, const wxString items[], int pos) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); GList *children = m_list->children; int length = g_list_length(children); - wxCHECK_RET( pos <= length, _T("invalid index in wxListBox::InsertItems") ); + wxCHECK_RET( pos <= length, T("invalid index in wxListBox::InsertItems") ); // VZ: it seems that GTK 1.0.6 doesn't has a function to insert an item // into a listbox at the given position, this is why we first delete @@ -471,7 +471,7 @@ void wxListBox::InsertItems(int nItems, const wxString items[], int pos) void wxListBox::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); GtkWidget *list_item; @@ -570,7 +570,7 @@ void wxListBox::Append( const wxString &item, wxClientData *clientData ) void wxListBox::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -580,7 +580,7 @@ void wxListBox::SetClientData( int n, void* clientData ) void* wxListBox::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -590,7 +590,7 @@ void* wxListBox::GetClientData( int n ) void wxListBox::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -603,7 +603,7 @@ void wxListBox::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxListBox::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -613,7 +613,7 @@ wxClientData* wxListBox::GetClientObject( int n ) void wxListBox::Clear() { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); gtk_list_clear_items( m_list, 0, Number() ); @@ -631,11 +631,11 @@ void wxListBox::Clear() void wxListBox::Delete( int n ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); GList *child = g_list_nth( m_list->children, n ); - wxCHECK_RET( child, _T("wrong listbox index") ); + wxCHECK_RET( child, T("wrong listbox index") ); GList *list = g_list_append( (GList*) NULL, child->data ); gtk_list_remove_items( m_list, list ); @@ -658,7 +658,7 @@ void wxListBox::Delete( int n ) void wxListBox::Deselect( int n ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); DisableEvents(); @@ -669,7 +669,7 @@ void wxListBox::Deselect( int n ) int wxListBox::FindString( const wxString &item ) const { - wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") ); GList *child = m_list->children; int count = 0; @@ -694,7 +694,7 @@ int wxListBox::FindString( const wxString &item ) const int wxListBox::GetSelection() const { - wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") ); GList *child = m_list->children; int count = 0; @@ -709,7 +709,7 @@ int wxListBox::GetSelection() const int wxListBox::GetSelections( wxArrayInt& aSelections ) const { - wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") ); // get the number of selected items first GList *child = m_list->children; @@ -739,7 +739,7 @@ int wxListBox::GetSelections( wxArrayInt& aSelections ) const wxString wxListBox::GetString( int n ) const { - wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") ); GList *child = g_list_nth( m_list->children, n ); if (child) @@ -752,14 +752,14 @@ wxString wxListBox::GetString( int n ) const return str; } - wxFAIL_MSG(_T("wrong listbox index")); + wxFAIL_MSG(T("wrong listbox index")); - return _T(""); + return T(""); } wxString wxListBox::GetStringSelection() const { - wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") ); GList *selection = m_list->selection; if (selection) @@ -772,13 +772,13 @@ wxString wxListBox::GetStringSelection() const return str; } - wxFAIL_MSG(_T("no listbox selection available")); - return _T(""); + wxFAIL_MSG(T("no listbox selection available")); + return T(""); } int wxListBox::Number() { - wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") ); GList *child = m_list->children; int count = 0; @@ -788,7 +788,7 @@ int wxListBox::Number() bool wxListBox::Selected( int n ) { - wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid listbox") ); + wxCHECK_MSG( m_list != NULL, FALSE, T("invalid listbox") ); GList *target = g_list_nth( m_list->children, n ); if (target) @@ -800,28 +800,28 @@ bool wxListBox::Selected( int n ) child = child->next; } } - wxFAIL_MSG(_T("wrong listbox index")); + wxFAIL_MSG(T("wrong listbox index")); return FALSE; } void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) ) { - wxFAIL_MSG(_T("wxListBox::Set not implemented")); + wxFAIL_MSG(T("wxListBox::Set not implemented")); } void wxListBox::SetFirstItem( int WXUNUSED(n) ) { - wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented")); + wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented")); } void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) ) { - wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented")); + wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented")); } void wxListBox::SetSelection( int n, bool select ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); DisableEvents(); @@ -835,7 +835,7 @@ void wxListBox::SetSelection( int n, bool select ) void wxListBox::SetString( int n, const wxString &string ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); GList *child = g_list_nth( m_list->children, n ); if (child) @@ -854,13 +854,13 @@ void wxListBox::SetString( int n, const wxString &string ) } else { - wxFAIL_MSG(_T("wrong listbox index")); + wxFAIL_MSG(T("wrong listbox index")); } } void wxListBox::SetStringSelection( const wxString &string, bool select ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); SetSelection( FindString(string), select ); } @@ -896,7 +896,7 @@ void wxListBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) #if wxUSE_DRAG_AND_DROP void wxListBox::SetDropTarget( wxDropTarget *dropTarget ) { - wxCHECK_RET( m_list != NULL, _T("invalid listbox") ); + wxCHECK_RET( m_list != NULL, T("invalid listbox") ); #ifndef NEW_GTK_DND_CODE if (m_dropTarget) diff --git a/src/gtk1/mdi.cpp b/src/gtk1/mdi.cpp index 784dc97f73..cb14533ce2 100644 --- a/src/gtk1/mdi.cpp +++ b/src/gtk1/mdi.cpp @@ -319,7 +319,7 @@ void wxMDIChildFrame::AddChild( wxWindowBase *child ) void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar ) { - wxASSERT_MSG( m_menuBar == NULL, _T("Only one menubar allowed") ); + wxASSERT_MSG( m_menuBar == NULL, T("Only one menubar allowed") ); m_menuBar = menu_bar; @@ -431,9 +431,9 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style ) m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI; if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || - !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("wxMDIClientWindow") )) + !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, T("wxMDIClientWindow") )) { - wxFAIL_MSG( _T("wxMDIClientWindow creation failed") ); + wxFAIL_MSG( T("wxMDIClientWindow creation failed") ); return FALSE; } diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 6b95c406e7..d3ebf032d7 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -41,9 +41,9 @@ wxMenuBar::wxMenuBar( long style ) m_invokingWindow = (wxWindow*) NULL; if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) || - !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("menubar") )) + !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, T("menubar") )) { - wxFAIL_MSG( _T("wxMenuBar creation failed") ); + wxFAIL_MSG( T("wxMenuBar creation failed") ); return; } @@ -80,9 +80,9 @@ wxMenuBar::wxMenuBar() m_invokingWindow = (wxWindow*) NULL; if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) || - !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("menubar") )) + !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, T("menubar") )) { - wxFAIL_MSG( _T("wxMenuBar creation failed") ); + wxFAIL_MSG( T("wxMenuBar creation failed") ); return; } @@ -202,22 +202,22 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title ) /* GTK 1.2 wants to have "_" instead of "&" for accelerators */ wxString str; - for ( pc = title; *pc != _T('\0'); pc++ ) + for ( pc = title; *pc != T('\0'); pc++ ) { - if (*pc == _T('&')) + if (*pc == T('&')) { #if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0) - str << _T('_'); + str << T('_'); } - else if (*pc == _T('/')) + else if (*pc == T('/')) { - str << _T('\\'); + str << T('\\'); #endif } else { #if __WXGTK12__ - if ( *pc == _T('_') ) + if ( *pc == T('_') ) { // underscores must be doubled to prevent them from being // interpreted as accelerator character prefix by GTK @@ -237,7 +237,7 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title ) /* local buffer in multibyte form */ wxString buf; - buf << _T('/') << str.c_str(); + buf << T('/') << str.c_str(); char *cbuf = new char[buf.Length()+1]; strcpy(cbuf, buf.mbc_str()); @@ -251,13 +251,13 @@ void wxMenuBar::Append( wxMenu *menu, const wxString &title ) gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */ /* in order to get the pointer to the item we need the item text _without_ underscores */ - wxString tmp = _T("
    /"); - for ( pc = str; *pc != _T('\0'); pc++ ) + wxString tmp = T("
    /"); + for ( pc = str; *pc != T('\0'); pc++ ) { // contrary to the common sense, we must throw out _all_ underscores, // (i.e. "Hello__World" => "HelloWorld" and not "Hello_World" as we // might naively think). IMHO it's a bug in GTK+ (VZ) - while (*pc == _T('_')) + while (*pc == T('_')) pc++; tmp << *pc; } @@ -364,7 +364,7 @@ void wxMenuBar::Check( int id, bool check ) { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_RET( item, _T("wxMenuBar::Check: no such item") ); + wxCHECK_RET( item, T("wxMenuBar::Check: no such item") ); item->Check(check); } @@ -373,7 +373,7 @@ bool wxMenuBar::IsChecked( int id ) const { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked: no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsChecked: no such item") ); return item->IsChecked(); } @@ -382,7 +382,7 @@ void wxMenuBar::Enable( int id, bool enable ) { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_RET( item, _T("wxMenuBar::Enable: no such item") ); + wxCHECK_RET( item, T("wxMenuBar::Enable: no such item") ); item->Enable(enable); } @@ -391,7 +391,7 @@ bool wxMenuBar::IsEnabled( int id ) const { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled: no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsEnabled: no such item") ); return item->IsEnabled(); } @@ -400,7 +400,7 @@ wxString wxMenuBar::GetLabel( int id ) const { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetLabel: no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenuBar::GetLabel: no such item") ); return item->GetText(); } @@ -409,7 +409,7 @@ void wxMenuBar::SetLabel( int id, const wxString &label ) { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_RET( item, _T("wxMenuBar::SetLabel: no such item") ); + wxCHECK_RET( item, T("wxMenuBar::SetLabel: no such item") ); item->SetText( label ); } @@ -418,7 +418,7 @@ void wxMenuBar::EnableTop( int pos, bool flag ) { wxNode *node = m_menus.Nth( pos ); - wxCHECK_RET( node, _T("menu not found") ); + wxCHECK_RET( node, T("menu not found") ); wxMenu* menu = (wxMenu*)node->Data(); @@ -430,7 +430,7 @@ wxString wxMenuBar::GetLabelTop( int pos ) const { wxNode *node = m_menus.Nth( pos ); - wxCHECK_MSG( node, _T("invalid"), _T("menu not found") ); + wxCHECK_MSG( node, T("invalid"), T("menu not found") ); wxMenu* menu = (wxMenu*)node->Data(); @@ -441,7 +441,7 @@ void wxMenuBar::SetLabelTop( int pos, const wxString& label ) { wxNode *node = m_menus.Nth( pos ); - wxCHECK_RET( node, _T("menu not found") ); + wxCHECK_RET( node, T("menu not found") ); wxMenu* menu = (wxMenu*)node->Data(); @@ -452,7 +452,7 @@ void wxMenuBar::SetHelpString( int id, const wxString& helpString ) { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_RET( item, _T("wxMenuBar::SetHelpString: no such item") ); + wxCHECK_RET( item, T("wxMenuBar::SetHelpString: no such item") ); item->SetHelp( helpString ); } @@ -461,7 +461,7 @@ wxString wxMenuBar::GetHelpString( int id ) const { wxMenuItem* item = FindMenuItemById( id ); - wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetHelpString: no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenuBar::GetHelpString: no such item") ); return item->GetHelp(); } @@ -483,7 +483,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) return; wxMenuItem* item = menu->FindItem( id ); - wxCHECK_RET( item, _T("error in menu item callback") ); + wxCHECK_RET( item, T("error in menu item callback") ); if (item->IsCheckable()) { @@ -588,22 +588,22 @@ wxMenuItem::wxMenuItem() void wxMenuItem::SetName( const wxString& str ) { /* '\t' is the deliminator indicating a hot key */ - m_text = _T(""); + m_text = T(""); const wxChar *pc = str; - for (; (*pc != _T('\0')) && (*pc != _T('\t')); pc++ ) + for (; (*pc != T('\0')) && (*pc != T('\t')); pc++ ) { - if (*pc == _T('&')) + if (*pc == T('&')) { #if (GTK_MINOR_VERSION > 0) - m_text << _T('_'); + m_text << T('_'); } - else if ( *pc == _T('_') ) // escape underscores + else if ( *pc == T('_') ) // escape underscores { - m_text << _T("__"); + m_text << T("__"); } - else if (*pc == _T('/')) /* we have to filter out slashes ... */ + else if (*pc == T('/')) /* we have to filter out slashes ... */ { - m_text << _T('\\'); /* ... and replace them with back slashes */ + m_text << T('\\'); /* ... and replace them with back slashes */ #endif } else @@ -611,9 +611,9 @@ void wxMenuItem::SetName( const wxString& str ) } /* only GTK 1.2 knows about hot keys */ - m_hotKey = _T(""); + m_hotKey = T(""); #if (GTK_MINOR_VERSION > 0) - if(*pc == _T('\t')) + if(*pc == T('\t')) { pc++; m_hotKey = pc; @@ -629,9 +629,9 @@ void wxMenuItem::SetName( const wxString& str ) void wxMenuItem::Check( bool check ) { - wxCHECK_RET( m_menuItem, _T("invalid menu item") ); + wxCHECK_RET( m_menuItem, T("invalid menu item") ); - wxCHECK_RET( IsCheckable(), _T("Can't check uncheckable item!") ) + wxCHECK_RET( IsCheckable(), T("Can't check uncheckable item!") ) if (check == m_isChecked) return; @@ -641,7 +641,7 @@ void wxMenuItem::Check( bool check ) void wxMenuItem::Enable( bool enable ) { - wxCHECK_RET( m_menuItem, _T("invalid menu item") ); + wxCHECK_RET( m_menuItem, T("invalid menu item") ); gtk_widget_set_sensitive( m_menuItem, enable ); m_isEnabled = enable; @@ -649,7 +649,7 @@ void wxMenuItem::Enable( bool enable ) bool wxMenuItem::IsChecked() const { - wxCHECK_MSG( m_menuItem, FALSE, _T("invalid menu item") ); + wxCHECK_MSG( m_menuItem, FALSE, T("invalid menu item") ); wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item! @@ -688,8 +688,8 @@ wxMenu::Init( const wxString& title, m_eventHandler = this; m_clientData = (void*) NULL; - if (m_title.IsNull()) m_title = _T(""); - if (m_title != _T("")) + if (m_title.IsNull()) m_title = T(""); + if (m_title != T("")) { Append(-2, m_title); AppendSeparator(); @@ -767,27 +767,27 @@ static char* GetHotKey( const wxString &hotkey, char *hotbuf ) switch (hotkey[0]) { - case _T('a'): /* Alt */ - case _T('A'): - case _T('m'): /* Meta */ - case _T('M'): + case T('a'): /* Alt */ + case T('A'): + case T('m'): /* Meta */ + case T('M'): { strcpy( hotbuf, "" ); wxString last = hotkey.Right(1); strcat( hotbuf, last.mb_str() ); return hotbuf; } - case _T('c'): /* Ctrl */ - case _T('C'): - case _T('s'): /* Strg, yeah man, I'm German */ - case _T('S'): + case T('c'): /* Ctrl */ + case T('C'): + case T('s'): /* Strg, yeah man, I'm German */ + case T('S'): { strcpy( hotbuf, "" ); wxString last = hotkey.Right(1); strcat( hotbuf, last.mb_str() ); return hotbuf; } - case _T('F'): /* function keys */ + case T('F'): /* function keys */ { strcpy( hotbuf, hotkey.mb_str() ); return hotbuf; @@ -832,10 +832,10 @@ void wxMenu::Append( int id, const wxString &item, const wxString &helpStr, bool gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */ /* in order to get the pointer to the item we need the item text _without_ underscores */ - wxString s = _T("
    /"); - for ( const wxChar *pc = text; *pc != _T('\0'); pc++ ) + wxString s = T("
    /"); + for ( const wxChar *pc = text; *pc != T('\0'); pc++ ) { - while (*pc == _T('_')) pc++; /* skip it */ + while (*pc == T('_')) pc++; /* skip it */ s << *pc; } @@ -893,10 +893,10 @@ void wxMenu::Append( int id, const wxString &item, wxMenu *subMenu, const wxStri gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */ /* in order to get the pointer to the item we need the item text _without_ underscores */ - wxString s = _T("
    /"); - for ( const wxChar *pc = text; *pc != _T('\0'); pc++ ) + wxString s = T("
    /"); + for ( const wxChar *pc = text; *pc != T('\0'); pc++ ) { - if (*pc == _T('_')) pc++; /* skip it */ + if (*pc == T('_')) pc++; /* skip it */ s << *pc; } @@ -966,14 +966,14 @@ void wxMenu::Append( wxMenuItem *item ) int wxMenu::FindItem( const wxString itemString ) const { - wxString s = _T(""); - for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ ) + wxString s = T(""); + for ( const wxChar *pc = itemString; *pc != T('\0'); pc++ ) { - if (*pc == _T('&')) + if (*pc == T('&')) { pc++; /* skip it */ #if (GTK_MINOR_VERSION > 0) - s << _T('_'); + s << T('_'); #endif } s << *pc; @@ -997,7 +997,7 @@ void wxMenu::Enable( int id, bool enable ) { wxMenuItem *item = FindItem(id); - wxCHECK_RET( item, _T("wxMenu::Enable: no such item") ); + wxCHECK_RET( item, T("wxMenu::Enable: no such item") ); item->Enable(enable); } @@ -1006,7 +1006,7 @@ bool wxMenu::IsEnabled( int id ) const { wxMenuItem *item = FindItem(id); - wxCHECK_MSG( item, FALSE, _T("wxMenu::IsEnabled: no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenu::IsEnabled: no such item") ); return item->IsEnabled(); } @@ -1015,7 +1015,7 @@ void wxMenu::Check( int id, bool enable ) { wxMenuItem *item = FindItem(id); - wxCHECK_RET( item, _T("wxMenu::Check: no such item") ); + wxCHECK_RET( item, T("wxMenu::Check: no such item") ); item->Check(enable); } @@ -1024,7 +1024,7 @@ bool wxMenu::IsChecked( int id ) const { wxMenuItem *item = FindItem(id); - wxCHECK_MSG( item, FALSE, _T("wxMenu::IsChecked: no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenu::IsChecked: no such item") ); return item->IsChecked(); } @@ -1033,7 +1033,7 @@ void wxMenu::SetLabel( int id, const wxString &label ) { wxMenuItem *item = FindItem(id); - wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") ); + wxCHECK_RET( item, T("wxMenu::SetLabel: no such item") ); item->SetText(label); } @@ -1042,7 +1042,7 @@ wxString wxMenu::GetLabel( int id ) const { wxMenuItem *item = FindItem(id); - wxCHECK_MSG( item, _T(""), _T("wxMenu::GetLabel: no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenu::GetLabel: no such item") ); return item->GetText(); } @@ -1051,7 +1051,7 @@ void wxMenu::SetHelpString( int id, const wxString& helpString ) { wxMenuItem *item = FindItem(id); - wxCHECK_RET( item, _T("wxMenu::SetHelpString: no such item") ); + wxCHECK_RET( item, T("wxMenu::SetHelpString: no such item") ); item->SetHelp( helpString ); } @@ -1060,7 +1060,7 @@ wxString wxMenu::GetHelpString( int id ) const { wxMenuItem *item = FindItem(id); - wxCHECK_MSG( item, _T(""), _T("wxMenu::GetHelpString: no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenu::GetHelpString: no such item") ); return item->GetHelp(); } diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 8d29d5e7e6..157bd90001 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -186,7 +186,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxNoteBook creation failed") ); + wxFAIL_MSG( T("wxNoteBook creation failed") ); return FALSE; } @@ -194,7 +194,7 @@ bool wxNotebook::Create(wxWindow *parent, wxWindowID id, m_widget = gtk_notebook_new(); #ifdef __WXDEBUG__ - debug_focus_in( m_widget, _T("wxNotebook::m_widget"), name ); + debug_focus_in( m_widget, T("wxNotebook::m_widget"), name ); #endif gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 ); @@ -233,7 +233,7 @@ void wxNotebook::SetFocus() int wxNotebook::GetSelection() const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") ); GList *pages = GTK_NOTEBOOK(m_widget)->children; @@ -258,18 +258,18 @@ int wxNotebook::GetRowCount() const wxString wxNotebook::GetPageText( int page ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid notebook") ); wxNotebookPage* nb_page = GetNotebookPage(page); if (nb_page) return nb_page->m_text; else - return _T(""); + return T(""); } int wxNotebook::GetPageImage( int page ) const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") ); wxNotebookPage* nb_page = GetNotebookPage(page); if (nb_page) @@ -280,9 +280,9 @@ int wxNotebook::GetPageImage( int page ) const wxNotebookPage* wxNotebook::GetNotebookPage( int page ) const { - wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*) NULL, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*) NULL, T("invalid notebook") ); - wxCHECK_MSG( page < (int)m_pages.GetCount(), (wxNotebookPage*) NULL, _T("invalid notebook index") ); + wxCHECK_MSG( page < (int)m_pages.GetCount(), (wxNotebookPage*) NULL, T("invalid notebook index") ); wxNode *node = m_pages.Nth( page ); @@ -291,9 +291,9 @@ wxNotebookPage* wxNotebook::GetNotebookPage( int page ) const int wxNotebook::SetSelection( int page ) { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") ); - wxCHECK_MSG( page < (int)m_pages.GetCount(), -1, _T("invalid notebook index") ); + wxCHECK_MSG( page < (int)m_pages.GetCount(), -1, T("invalid notebook index") ); int selOld = GetSelection(); @@ -304,7 +304,7 @@ int wxNotebook::SetSelection( int page ) void wxNotebook::AdvanceSelection( bool forward ) { - wxCHECK_RET( m_widget != NULL, _T("invalid notebook") ); + wxCHECK_RET( m_widget != NULL, T("invalid notebook") ); int sel = GetSelection(); int max = GetPageCount(); @@ -322,11 +322,11 @@ void wxNotebook::SetImageList( wxImageList* imageList ) bool wxNotebook::SetPageText( int page, const wxString &text ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") ); wxNotebookPage* nb_page = GetNotebookPage(page); - wxCHECK_MSG( nb_page, FALSE, _T("SetPageText: invalid page index") ); + wxCHECK_MSG( nb_page, FALSE, T("SetPageText: invalid page index") ); nb_page->m_text = text; @@ -422,22 +422,22 @@ bool wxNotebook::SetPageImage( int page, int image ) void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) ) { - wxFAIL_MSG( _T("wxNotebook::SetPageSize not implemented") ); + wxFAIL_MSG( T("wxNotebook::SetPageSize not implemented") ); } void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) ) { - wxFAIL_MSG( _T("wxNotebook::SetPadding not implemented") ); + wxFAIL_MSG( T("wxNotebook::SetPadding not implemented") ); } void wxNotebook::SetTabSize(const wxSize& WXUNUSED(sz)) { - wxFAIL_MSG( _T("wxNotebook::SetTabSize not implemented") ); + wxFAIL_MSG( T("wxNotebook::SetTabSize not implemented") ); } bool wxNotebook::DeleteAllPages() { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") ); while (m_pages.GetCount() > 0) DeletePage( m_pages.GetCount()-1 ); @@ -478,10 +478,10 @@ bool wxNotebook::RemovePage( int page ) bool wxNotebook::InsertPage( int position, wxWindow* win, const wxString& text, bool select, int imageId ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") ); wxCHECK_MSG( win->GetParent() == this, FALSE, - _T("Can't add a page whose parent is not the notebook!") ); + T("Can't add a page whose parent is not the notebook!") ); /* don't receive switch page during addition */ gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget), @@ -535,7 +535,7 @@ bool wxNotebook::InsertPage( int position, wxWindow* win, const wxString& text, /* set the label text */ page->m_text = text; - if (page->m_text.IsEmpty()) page->m_text = _T(""); + if (page->m_text.IsEmpty()) page->m_text = T(""); page->m_label = GTK_LABEL( gtk_label_new(page->m_text.mbc_str()) ); gtk_box_pack_end( GTK_BOX(page->m_box), GTK_WIDGET(page->m_label), FALSE, FALSE, 3 ); @@ -573,7 +573,7 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) wxWindow *wxNotebook::GetPage( int page ) const { - wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, _T("invalid notebook") ); + wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, T("invalid notebook") ); wxNotebookPage* nb_page = GetNotebookPage(page); if (!nb_page) diff --git a/src/gtk1/palette.cpp b/src/gtk1/palette.cpp index 37b7e4d3a4..2a86eb1ba2 100644 --- a/src/gtk1/palette.cpp +++ b/src/gtk1/palette.cpp @@ -93,7 +93,7 @@ bool wxPalette::Create( int WXUNUSED(n), const unsigned char *WXUNUSED(green), const unsigned char *WXUNUSED(blue) ) { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return FALSE; } @@ -102,7 +102,7 @@ int wxPalette::GetPixel( const unsigned char WXUNUSED(red), const unsigned char WXUNUSED(green), const unsigned char WXUNUSED(blue) ) const { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return 0; } @@ -112,7 +112,7 @@ bool wxPalette::GetRGB( int WXUNUSED(pixel), unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(blue) ) const { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); return 0; } diff --git a/src/gtk1/pen.cpp b/src/gtk1/pen.cpp index 00a092953f..a4fef2c642 100644 --- a/src/gtk1/pen.cpp +++ b/src/gtk1/pen.cpp @@ -171,35 +171,35 @@ wxDash* wxPen::GetDash() const int wxPen::GetCap() const { - wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + wxCHECK_MSG( Ok(), -1, T("invalid pen") ); return M_PENDATA->m_capStyle; } int wxPen::GetJoin() const { - wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + wxCHECK_MSG( Ok(), -1, T("invalid pen") ); return M_PENDATA->m_joinStyle; } int wxPen::GetStyle() const { - wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + wxCHECK_MSG( Ok(), -1, T("invalid pen") ); return M_PENDATA->m_style; } int wxPen::GetWidth() const { - wxCHECK_MSG( Ok(), -1, _T("invalid pen") ); + wxCHECK_MSG( Ok(), -1, T("invalid pen") ); return M_PENDATA->m_width; } wxColour &wxPen::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid pen") ); + wxCHECK_MSG( Ok(), wxNullColour, T("invalid pen") ); return M_PENDATA->m_colour; } diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index 74160121f6..b1ecb3fc79 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -88,7 +88,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxRadioBox creation failed") ); + wxFAIL_MSG( T("wxRadioBox creation failed") ); return FALSE; } @@ -108,7 +108,7 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, label.Empty(); for ( const wxChar *pc = choices[i]; *pc; pc++ ) { - if ( *pc != _T('&') ) + if ( *pc != T('&') ) label += *pc; } @@ -176,7 +176,7 @@ wxSize wxRadioBox::LayoutItems() if ( m_majorDim == 0 ) { // avoid dividing by 0 below - wxFAIL_MSG( _T("dimension of radiobox should not be 0!") ); + wxFAIL_MSG( T("dimension of radiobox should not be 0!") ); m_majorDim = 1; } @@ -279,7 +279,7 @@ wxSize wxRadioBox::LayoutItems() bool wxRadioBox::Show( bool show ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobox") ); wxWindow::Show( show ); @@ -301,7 +301,7 @@ bool wxRadioBox::Show( bool show ) int wxRadioBox::FindString( const wxString &s ) const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid radiobox") ); int count = 0; @@ -322,7 +322,7 @@ int wxRadioBox::FindString( const wxString &s ) const void wxRadioBox::SetFocus() { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); if (m_boxes.GetCount() == 0) return; @@ -343,11 +343,11 @@ void wxRadioBox::SetFocus() void wxRadioBox::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxNode *node = m_boxes.Nth( n ); - wxCHECK_RET( node, _T("radiobox wrong index") ); + wxCHECK_RET( node, T("radiobox wrong index") ); GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() ); @@ -360,7 +360,7 @@ void wxRadioBox::SetSelection( int n ) int wxRadioBox::GetSelection(void) const { - wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, -1, T("invalid radiobox") ); int count = 0; @@ -373,18 +373,18 @@ int wxRadioBox::GetSelection(void) const node = node->Next(); } - wxFAIL_MSG( _T("wxRadioBox none selected") ); + wxFAIL_MSG( T("wxRadioBox none selected") ); return -1; } wxString wxRadioBox::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") ); wxNode *node = m_boxes.Nth( n ); - wxCHECK_MSG( node, _T(""), _T("radiobox wrong index") ); + wxCHECK_MSG( node, T(""), T("radiobox wrong index") ); GtkButton *button = GTK_BUTTON( node->Data() ); GtkLabel *label = GTK_LABEL( button->child ); @@ -394,14 +394,14 @@ wxString wxRadioBox::GetString( int n ) const wxString wxRadioBox::GetLabel( int item ) const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") ); return GetString( item ); } void wxRadioBox::SetLabel( const wxString& label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxControl::SetLabel( label ); @@ -410,11 +410,11 @@ void wxRadioBox::SetLabel( const wxString& label ) void wxRadioBox::SetLabel( int item, const wxString& label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxNode *node = m_boxes.Nth( item ); - wxCHECK_RET( node, _T("radiobox wrong index") ); + wxCHECK_RET( node, T("radiobox wrong index") ); GtkButton *button = GTK_BUTTON( node->Data() ); GtkLabel *g_label = GTK_LABEL( button->child ); @@ -424,7 +424,7 @@ void wxRadioBox::SetLabel( int item, const wxString& label ) void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) ) { - wxFAIL_MSG(_T("wxRadioBox::SetLabel not implemented.")); + wxFAIL_MSG(T("wxRadioBox::SetLabel not implemented.")); } bool wxRadioBox::Enable( bool enable ) @@ -447,11 +447,11 @@ bool wxRadioBox::Enable( bool enable ) void wxRadioBox::Enable( int item, bool enable ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxNode *node = m_boxes.Nth( item ); - wxCHECK_RET( node, _T("radiobox wrong index") ); + wxCHECK_RET( node, T("radiobox wrong index") ); GtkButton *button = GTK_BUTTON( node->Data() ); GtkWidget *label = button->child; @@ -461,11 +461,11 @@ void wxRadioBox::Enable( int item, bool enable ) void wxRadioBox::Show( int item, bool show ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobox") ); wxNode *node = m_boxes.Nth( item ); - wxCHECK_RET( node, _T("radiobox wrong index") ); + wxCHECK_RET( node, T("radiobox wrong index") ); GtkWidget *button = GTK_WIDGET( node->Data() ); @@ -477,7 +477,7 @@ void wxRadioBox::Show( int item, bool show ) wxString wxRadioBox::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") ); wxNode *node = m_boxes.First(); while (node) @@ -491,13 +491,13 @@ wxString wxRadioBox::GetStringSelection() const node = node->Next(); } - wxFAIL_MSG( _T("wxRadioBox none selected") ); - return _T(""); + wxFAIL_MSG( T("wxRadioBox none selected") ); + return T(""); } bool wxRadioBox::SetStringSelection( const wxString &s ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobox") ); int res = FindString( s ); if (res == -1) return FALSE; @@ -518,7 +518,7 @@ int wxRadioBox::GetNumberOfRowsOrCols() const void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) ) { - wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented.")); + wxFAIL_MSG(T("wxRadioBox::SetNumberOfRowsOrCols not implemented.")); } void wxRadioBox::DisableEvents() diff --git a/src/gtk1/radiobut.cpp b/src/gtk1/radiobut.cpp index f7771f4ea6..fa026715f6 100644 --- a/src/gtk1/radiobut.cpp +++ b/src/gtk1/radiobut.cpp @@ -68,7 +68,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxRadioButton creation failed") ); + wxFAIL_MSG( T("wxRadioButton creation failed") ); return FALSE; } @@ -131,7 +131,7 @@ bool wxRadioButton::Create( wxWindow *parent, wxWindowID id, const wxString& lab void wxRadioButton::SetLabel( const wxString& label ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobutton") ); wxControl::SetLabel( label ); GtkButton *bin = GTK_BUTTON( m_widget ); @@ -141,7 +141,7 @@ void wxRadioButton::SetLabel( const wxString& label ) void wxRadioButton::SetValue( bool val ) { - wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") ); + wxCHECK_RET( m_widget != NULL, T("invalid radiobutton") ); if (val == GetValue()) return; @@ -164,7 +164,7 @@ void wxRadioButton::SetValue( bool val ) bool wxRadioButton::GetValue() const { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobutton") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobutton") ); return GTK_TOGGLE_BUTTON(m_widget)->active; } diff --git a/src/gtk1/scrolbar.cpp b/src/gtk1/scrolbar.cpp index 43997ce96d..4d21168158 100644 --- a/src/gtk1/scrolbar.cpp +++ b/src/gtk1/scrolbar.cpp @@ -129,7 +129,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxScrollBar creation failed") ); + wxFAIL_MSG( T("wxScrollBar creation failed") ); return FALSE; } diff --git a/src/gtk1/settings.cpp b/src/gtk1/settings.cpp index 8ee443f68b..5ff2d5c61a 100644 --- a/src/gtk1/settings.cpp +++ b/src/gtk1/settings.cpp @@ -191,7 +191,7 @@ int wxSystemSettings::GetSystemMetric( int index ) case wxSYS_VSCROLL_X: return 15; } - wxCHECK_MSG( index, 0, _T("wxSystemSettings::GetSystemMetric not fully implemented") ); + wxCHECK_MSG( index, 0, T("wxSystemSettings::GetSystemMetric not fully implemented") ); return 0; } diff --git a/src/gtk1/slider.cpp b/src/gtk1/slider.cpp index d51d94f1d4..adc016c88f 100644 --- a/src/gtk1/slider.cpp +++ b/src/gtk1/slider.cpp @@ -97,7 +97,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxSlider creation failed") ); + wxFAIL_MSG( T("wxSlider creation failed") ); return FALSE; } diff --git a/src/gtk1/spinbutt.cpp b/src/gtk1/spinbutt.cpp index 762d4cc3be..fd5e0cd865 100644 --- a/src/gtk1/spinbutt.cpp +++ b/src/gtk1/spinbutt.cpp @@ -106,7 +106,7 @@ bool wxSpinButton::Create(wxWindow *parent, if (!PreCreation( parent, pos, new_size ) || !CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return FALSE; } @@ -140,28 +140,28 @@ wxSpinButton::~wxSpinButton() int wxSpinButton::GetMin() const { - wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") ); + wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") ); return (int)ceil(m_adjust->lower); } int wxSpinButton::GetMax() const { - wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") ); + wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") ); return (int)ceil(m_adjust->upper); } int wxSpinButton::GetValue() const { - wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") ); + wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") ); return (int)ceil(m_adjust->value); } void wxSpinButton::SetValue( int value ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") ); + wxCHECK_RET( (m_widget != NULL), T("invalid spin button") ); float fpos = (float)value; m_oldPos = fpos; @@ -174,7 +174,7 @@ void wxSpinButton::SetValue( int value ) void wxSpinButton::SetRange(int minVal, int maxVal) { - wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") ); + wxCHECK_RET( (m_widget != NULL), T("invalid spin button") ); float fmin = (float)minVal; float fmax = (float)maxVal; @@ -197,7 +197,7 @@ void wxSpinButton::SetRange(int minVal, int maxVal) void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") ); + wxCHECK_RET( (m_widget != NULL), T("invalid spin button") ); m_width = 15; gtk_widget_set_usize( m_widget, m_width, m_height ); diff --git a/src/gtk1/statbmp.cpp b/src/gtk1/statbmp.cpp index f9e6700b8f..186947afb2 100644 --- a/src/gtk1/statbmp.cpp +++ b/src/gtk1/statbmp.cpp @@ -37,7 +37,7 @@ wxStaticBitmap::wxStaticBitmap( wxWindow *parent, wxWindowID id, const wxBitmap void wxStaticBitmap::CreatePixmapWidget() { - wxCHECK_RET( m_bitmap.Ok(), _T("should only be called if we have a bitmap") ); + wxCHECK_RET( m_bitmap.Ok(), T("should only be called if we have a bitmap") ); GdkBitmap *mask = (GdkBitmap *) NULL; if ( m_bitmap.GetMask() ) @@ -61,7 +61,7 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return FALSE; } diff --git a/src/gtk1/statbox.cpp b/src/gtk1/statbox.cpp index d39006cda7..0d4f598a2a 100644 --- a/src/gtk1/statbox.cpp +++ b/src/gtk1/statbox.cpp @@ -44,7 +44,7 @@ bool wxStaticBox::Create( wxWindow *parent, wxWindowID id, const wxString &label if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxStaticBox creation failed") ); + wxFAIL_MSG( T("wxStaticBox creation failed") ); return FALSE; } diff --git a/src/gtk1/statline.cpp b/src/gtk1/statline.cpp index cd67c8a642..6129db4500 100644 --- a/src/gtk1/statline.cpp +++ b/src/gtk1/statline.cpp @@ -44,7 +44,7 @@ bool wxStaticLine::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxStaticLine creation failed") ); + wxFAIL_MSG( T("wxStaticLine creation failed") ); return FALSE; } diff --git a/src/gtk1/stattext.cpp b/src/gtk1/stattext.cpp index 42938260a3..81cf98c3a8 100644 --- a/src/gtk1/stattext.cpp +++ b/src/gtk1/stattext.cpp @@ -51,7 +51,7 @@ bool wxStaticText::Create(wxWindow *parent, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxXX creation failed") ); + wxFAIL_MSG( T("wxXX creation failed") ); return FALSE; } diff --git a/src/gtk1/tbargtk.cpp b/src/gtk1/tbargtk.cpp index b3b92a7816..9d2c160e29 100644 --- a/src/gtk1/tbargtk.cpp +++ b/src/gtk1/tbargtk.cpp @@ -151,7 +151,7 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxToolBar creation failed") ); + wxFAIL_MSG( T("wxToolBar creation failed") ); return FALSE; } @@ -263,13 +263,13 @@ wxToolBarTool *wxToolBar::AddTool( int toolIndex, const wxBitmap& bitmap, m_hasToolAlready = TRUE; wxCHECK_MSG( bitmap.Ok(), (wxToolBarTool *)NULL, - _T("invalid bitmap for wxToolBar icon") ); + T("invalid bitmap for wxToolBar icon") ); wxCHECK_MSG( bitmap.GetBitmap() == NULL, (wxToolBarTool *)NULL, - _T("wxToolBar doesn't support GdkBitmap") ); + T("wxToolBar doesn't support GdkBitmap") ); wxCHECK_MSG( bitmap.GetPixmap() != NULL, (wxToolBarTool *)NULL, - _T("wxToolBar::Add needs a wxBitmap") ); + T("wxToolBar::Add needs a wxBitmap") ); GtkWidget *tool_pixmap = (GtkWidget *)NULL; @@ -326,7 +326,7 @@ void wxToolBar::AddSeparator() void wxToolBar::ClearTools() { - wxFAIL_MSG( _T("wxToolBar::ClearTools not implemented") ); + wxFAIL_MSG( T("wxToolBar::ClearTools not implemented") ); } bool wxToolBar::Realize() @@ -376,7 +376,7 @@ void wxToolBar::EnableTool(int toolIndex, bool enable) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); } void wxToolBar::ToggleTool( int toolIndex, bool toggle ) @@ -418,7 +418,7 @@ void wxToolBar::ToggleTool( int toolIndex, bool toggle ) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); } wxObject *wxToolBar::GetToolClientData( int index ) const @@ -431,7 +431,7 @@ wxObject *wxToolBar::GetToolClientData( int index ) const node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return (wxObject*)NULL; } @@ -446,7 +446,7 @@ bool wxToolBar::GetToolState(int toolIndex) const node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return FALSE; } @@ -461,14 +461,14 @@ bool wxToolBar::GetToolEnabled(int toolIndex) const node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return FALSE; } void wxToolBar::SetMargins( int x, int y ) { - wxCHECK_RET( !m_hasToolAlready, _T("wxToolBar::SetMargins must be called before adding tool.") ); + wxCHECK_RET( !m_hasToolAlready, T("wxToolBar::SetMargins must be called before adding tool.") ); if (x > 2) gtk_toolbar_append_space( m_toolbar ); // oh well @@ -478,7 +478,7 @@ void wxToolBar::SetMargins( int x, int y ) void wxToolBar::SetToolPacking( int WXUNUSED(packing) ) { - wxFAIL_MSG( _T("wxToolBar::SetToolPacking not implemented") ); + wxFAIL_MSG( T("wxToolBar::SetToolPacking not implemented") ); } void wxToolBar::SetToolSeparation( int separation ) @@ -510,9 +510,9 @@ wxString wxToolBar::GetToolLongHelp(int toolIndex) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); - return _T(""); + return T(""); } wxString wxToolBar::GetToolShortHelp(int toolIndex) @@ -528,9 +528,9 @@ wxString wxToolBar::GetToolShortHelp(int toolIndex) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); - return _T(""); + return T(""); } void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString) @@ -547,7 +547,7 @@ void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return; } @@ -566,7 +566,7 @@ void wxToolBar::SetToolShortHelp(int toolIndex, const wxString& helpString) node = node->Next(); } - wxFAIL_MSG( _T("wrong toolbar index") ); + wxFAIL_MSG( T("wrong toolbar index") ); return; } diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index c9c22b2e0f..1e4d3a3ceb 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -118,7 +118,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, validator, name )) { - wxFAIL_MSG( _T("wxTextCtrl creation failed") ); + wxFAIL_MSG( T("wxTextCtrl creation failed") ); return FALSE; } @@ -282,7 +282,7 @@ void wxTextCtrl::CalculateScrollbar() wxString wxTextCtrl::GetValue() const { - wxCHECK_MSG( m_text != NULL, _T(""), _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, T(""), T("invalid text ctrl") ); wxString tmp; if (m_windowStyle & wxTE_MULTILINE) @@ -301,9 +301,9 @@ wxString wxTextCtrl::GetValue() const void wxTextCtrl::SetValue( const wxString &value ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); - wxString tmp = _T(""); + wxString tmp = T(""); if (!value.IsNull()) tmp = value; if (m_windowStyle & wxTE_MULTILINE) { @@ -325,7 +325,7 @@ void wxTextCtrl::SetValue( const wxString &value ) void wxTextCtrl::WriteText( const wxString &text ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (text.IsEmpty()) return; @@ -365,7 +365,7 @@ void wxTextCtrl::WriteText( const wxString &text ) void wxTextCtrl::AppendText( const wxString &text ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (text.IsEmpty()) return; @@ -413,7 +413,7 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const if (text) { - wxString buf(_T("")); + wxString buf(T("")); long i; int currentLine = 0; for (i = 0; currentLine != lineNo && text[i]; i++ ) @@ -441,7 +441,7 @@ void wxTextCtrl::OnDropFiles( wxDropFilesEvent &WXUNUSED(event) ) { /* If you implement this, don't forget to update the documentation! * (file docs/latex/wx/text.tex) */ - wxFAIL_MSG( _T("wxTextCtrl::OnDropFiles not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::OnDropFiles not implemented") ); } bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const @@ -460,7 +460,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const const wxChar* stop = text.c_str() + pos; for ( const wxChar *p = text.c_str(); p < stop; p++ ) { - if (*p == _T('\n')) + if (*p == T('\n')) { (*y)++; *x=0; @@ -536,7 +536,7 @@ int wxTextCtrl::GetNumberOfLines() const void wxTextCtrl::SetInsertionPoint( long pos ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (m_windowStyle & wxTE_MULTILINE) { @@ -573,7 +573,7 @@ void wxTextCtrl::SetInsertionPoint( long pos ) void wxTextCtrl::SetInsertionPointEnd() { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (m_windowStyle & wxTE_MULTILINE) SetInsertionPoint(gtk_text_get_length(GTK_TEXT(m_text))); @@ -583,7 +583,7 @@ void wxTextCtrl::SetInsertionPointEnd() void wxTextCtrl::SetEditable( bool editable ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (m_windowStyle & wxTE_MULTILINE) gtk_text_set_editable( GTK_TEXT(m_text), editable ); @@ -598,7 +598,7 @@ void wxTextCtrl::DiscardEdits() void wxTextCtrl::SetSelection( long from, long to ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to ); } @@ -610,14 +610,14 @@ void wxTextCtrl::ShowPosition( long WXUNUSED(pos) ) long wxTextCtrl::GetInsertionPoint() const { - wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, 0, T("invalid text ctrl") ); return (long) GTK_EDITABLE(m_text)->current_pos; } long wxTextCtrl::GetLastPosition() const { - wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, 0, T("invalid text ctrl") ); int pos = 0; if (m_windowStyle & wxTE_MULTILINE) @@ -630,14 +630,14 @@ long wxTextCtrl::GetLastPosition() const void wxTextCtrl::Remove( long from, long to ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); 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, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to ); @@ -655,7 +655,7 @@ void wxTextCtrl::Replace( long from, long to, const wxString &value ) void wxTextCtrl::Cut() { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); #if (GTK_MINOR_VERSION > 0) gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) ); @@ -666,7 +666,7 @@ void wxTextCtrl::Cut() void wxTextCtrl::Copy() { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); #if (GTK_MINOR_VERSION > 0) gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) ); @@ -677,7 +677,7 @@ void wxTextCtrl::Copy() void wxTextCtrl::Paste() { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); #if (GTK_MINOR_VERSION > 0) gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) ); @@ -711,26 +711,26 @@ bool wxTextCtrl::CanPaste() const void wxTextCtrl::Undo() { // TODO - wxFAIL_MSG( _T("wxTextCtrl::Undo not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::Undo not implemented") ); } void wxTextCtrl::Redo() { // TODO - wxFAIL_MSG( _T("wxTextCtrl::Redo not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::Redo not implemented") ); } bool wxTextCtrl::CanUndo() const { // TODO - wxFAIL_MSG( _T("wxTextCtrl::CanUndo not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::CanUndo not implemented") ); return FALSE; } bool wxTextCtrl::CanRedo() const { // TODO - wxFAIL_MSG( _T("wxTextCtrl::CanRedo not implemented") ); + wxFAIL_MSG( T("wxTextCtrl::CanRedo not implemented") ); return FALSE; } @@ -738,7 +738,7 @@ bool wxTextCtrl::CanRedo() const // selection. void wxTextCtrl::GetSelection(long* from, long* to) const { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if (!(GTK_EDITABLE(m_text)->has_selection)) { @@ -753,7 +753,7 @@ void wxTextCtrl::GetSelection(long* from, long* to) const bool wxTextCtrl::IsEditable() const { - wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") ); return GTK_EDITABLE(m_text)->editable; } @@ -765,12 +765,12 @@ bool wxTextCtrl::IsModified() const void wxTextCtrl::Clear() { - SetValue( _T("") ); + SetValue( T("") ); } void wxTextCtrl::OnChar( wxKeyEvent &key_event ) { - wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") ); + wxCHECK_RET( m_text != NULL, T("invalid text ctrl") ); if ((key_event.KeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER)) { @@ -798,7 +798,7 @@ bool wxTextCtrl::IsOwnGtkWindow( GdkWindow *window ) // the font will change for subsequent text insertiongs bool wxTextCtrl::SetFont( const wxFont &font ) { - wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") ); if ( !wxWindowBase::SetFont(font) ) { @@ -824,7 +824,7 @@ bool wxTextCtrl::SetFont( const wxFont &font ) bool wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) ) { - wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") ); // doesn't work return FALSE; @@ -832,7 +832,7 @@ bool wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) ) bool wxTextCtrl::SetBackgroundColour( const wxColour &colour ) { - wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") ); + wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") ); wxControl::SetBackgroundColour( colour ); diff --git a/src/gtk1/utilsres.cpp b/src/gtk1/utilsres.cpp index 6082cd387e..f0bf3981a3 100644 --- a/src/gtk1/utilsres.cpp +++ b/src/gtk1/utilsres.cpp @@ -40,9 +40,9 @@ // Yuck this is really BOTH site and platform dependent // so we should use some other strategy! #ifdef __SUN__ - #define DEFAULT_XRESOURCE_DIR _T("/usr/openwin/lib/app-defaults") + #define DEFAULT_XRESOURCE_DIR T("/usr/openwin/lib/app-defaults") #else - #define DEFAULT_XRESOURCE_DIR _T("/usr/lib/X11/app-defaults") + #define DEFAULT_XRESOURCE_DIR T("/usr/lib/X11/app-defaults") #endif //----------------------------------------------------------------------------- @@ -63,13 +63,13 @@ static wxChar *GetResourcePath(wxChar *buf, wxChar *name, bool create) wxStrcpy(buf, name); return buf; // Exists so ... } - if (*name == _T('/')) + if (*name == T('/')) wxStrcpy(buf, name); else { // Put in standard place for resource files if not absolute wxStrcpy(buf, DEFAULT_XRESOURCE_DIR); - wxStrcat(buf, _T("/")); + wxStrcat(buf, T("/")); wxStrcat(buf, FileNameFromPath(name)); } if (create) @@ -96,18 +96,18 @@ static wxChar *GetIniFile(wxChar *dest, const wxChar *filename) if ((home = wxGetUserHome(wxString())) != NULL) { wxStrcpy(dest, home); - if (dest[wxStrlen(dest) - 1] != _T('/')) wxStrcat(dest, _T("/")); + if (dest[wxStrlen(dest) - 1] != T('/')) wxStrcat(dest, T("/")); if (filename == NULL) { - if ((filename = wxGetenv(_T("XENVIRONMENT"))) == NULL) filename = _T(".Xdefaults"); + if ((filename = wxGetenv(T("XENVIRONMENT("))) == NULL) filename = T(".Xdefaults"); } else - if (*filename != _T('.')) wxStrcat(dest, _T(".")); + if (*filename != T('.')) wxStrcat(dest, T(".")); wxStrcat(dest, filename); } else { - dest[0] = _T('\0'); + dest[0] = T('\0'); } } return dest; @@ -148,7 +148,7 @@ static void wxXMergeDatabases() // Open XENVIRONMENT file, or if not defined, the .Xdefaults, // and merge into existing database - if ((environment = wxGetenv(_T("XENVIRONMENT"))) == NULL) + if ((environment = wxGetenv(T("XENVIRONMENT("))) == NULL) { size_t len; #if wxUSE_UNICODE @@ -203,7 +203,7 @@ void wxFlushResources() void wxDeleteResources(const wxChar *file) { - wxLogTrace(wxTraceResAlloc, _T("Delete: Number = %d"), wxTheResourceCache->Number()); + wxLogTrace(wxTraceResAlloc, T("Delete: Number = %d"), wxTheResourceCache->Number()); wxChar buffer[500]; (void)GetIniFile(buffer, file); @@ -233,11 +233,11 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr database = (XrmDatabase)node->Data(); else { database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer)); - wxLogTrace(wxTraceResAlloc, _T("Write: Number = %d"), wxTheResourceCache->Number()); + wxLogTrace(wxTraceResAlloc, T("Write: Number = %d"), wxTheResourceCache->Number()); wxTheResourceCache->Append(buffer, (wxObject *)database); } char resName[300]; - strcpy(resName, !section.IsNull() ? MBSTRINGCAST section.mb_str() : "wxWindows"); + strcpy(resName, !section.IsNull() ? wxMBSTRINGCAST section.mb_str() : "wxWindows"); strcat(resName, "."); strcat(resName, entry.mb_str()); XrmPutStringResource(&database, resName, value.mb_str()); @@ -287,7 +287,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, char **value, else { database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer)); - wxLogTrace(wxTraceResAlloc, _T("Get: Number = %d"), wxTheResourceCache->Number()); + wxLogTrace(wxTraceResAlloc, T("Get: Number = %d"), wxTheResourceCache->Number()); wxTheResourceCache->Append(buffer, (wxObject *)database); } } else @@ -352,7 +352,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c { // Handle True, False here // True, Yes, Enables, Set or Activated - if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A') + if (*s == 'T(' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A') *value = TRUE; // False, No, Disabled, Reset, Cleared, Deactivated else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C') diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index dd4d3e4b9e..8578feae96 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -155,7 +155,7 @@ static gint gtk_debug_focus_in_callback( GtkWidget *WXUNUSED(widget), wxLog::AddTraceMask("focus"); s_done = TRUE; } - wxLogTrace(_T("FOCUS NOW AT: %s"), name); + wxLogTrace(T("FOCUS NOW AT: %s"), name); */ return FALSE; @@ -164,7 +164,7 @@ static gint gtk_debug_focus_in_callback( GtkWidget *WXUNUSED(widget), void debug_focus_in( GtkWidget* widget, const wxChar* name, const wxChar *window ) { wxString tmp = name; - tmp += _T(" FROM "); + tmp += T(" FROM "); tmp += window; wxChar *s = new wxChar[tmp.Length()+1]; @@ -974,10 +974,10 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton wxapp_install_idle_handler(); /* - wxPrintf( _T("1) OnButtonPress from ") ); + wxPrintf( T("1) OnButtonPress from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) wxPrintf( win->GetClassInfo()->GetClassName() ); - wxPrintf( _T(".\n") ); + wxPrintf( T(".\n") ); */ if (!win->m_hasVMT) return FALSE; if (g_blockEventsOnDrag) return TRUE; @@ -992,20 +992,20 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton gtk_widget_grab_focus (win->m_wxwindow); /* - wxPrintf( _T("GrabFocus from ") ); + wxPrintf( T("GrabFocus from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) wxPrintf( win->GetClassInfo()->GetClassName() ); - wxPrintf( _T(".\n") ); + wxPrintf( T(".\n") ); */ } } /* - wxPrintf( _T("2) OnButtonPress from ") ); + wxPrintf( T("2) OnButtonPress from ") ); if (win->GetClassInfo() && win->GetClassInfo()->GetClassName()) wxPrintf( win->GetClassInfo()->GetClassName() ); - wxPrintf( _T(".\n") ); + wxPrintf( T(".\n") ); */ wxEventType event_type = wxEVT_LEFT_DOWN; @@ -1807,7 +1807,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxWindow creation failed") ); + wxFAIL_MSG( T("wxWindow creation failed") ); return FALSE; } @@ -1817,14 +1817,14 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS ); #ifdef __WXDEBUG__ - debug_focus_in( m_widget, _T("wxWindow::m_widget"), name ); + debug_focus_in( m_widget, T("wxWindow::m_widget"), name ); #endif GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget); #ifdef __WXDEBUG__ - debug_focus_in( scrolledWindow->hscrollbar, _T("wxWindow::hsrcollbar"), name ); - debug_focus_in( scrolledWindow->vscrollbar, _T("wxWindow::vsrcollbar"), name ); + debug_focus_in( scrolledWindow->hscrollbar, T("wxWindow::hsrcollbar"), name ); + debug_focus_in( scrolledWindow->vscrollbar, T("wxWindow::vsrcollbar"), name ); #endif GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass ); @@ -1838,7 +1838,7 @@ bool wxWindow::Create( wxWindow *parent, wxWindowID id, m_wxwindow = gtk_myfixed_new(); #ifdef __WXDEBUG__ - debug_focus_in( m_wxwindow, _T("wxWindow::m_wxwindow"), name ); + debug_focus_in( m_wxwindow, T("wxWindow::m_wxwindow"), name ); #endif gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow ); @@ -1996,7 +1996,7 @@ wxWindow::~wxWindow() bool wxWindow::PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize &size ) { - wxCHECK_MSG( !m_needParent || parent, FALSE, _T("Need complete parent.") ); + wxCHECK_MSG( !m_needParent || parent, FALSE, T("Need complete parent.") ); /* this turns -1 into 20 so that a minimal window is visible even although -1,-1 has been given as the @@ -2028,7 +2028,7 @@ bool wxWindow::PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize void wxWindow::PostCreation() { - wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid window") ); if (m_wxwindow) { @@ -2093,7 +2093,7 @@ void wxWindow::ConnectWidget( GtkWidget *widget ) bool wxWindow::Destroy() { - wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid window") ); m_hasVMT = FALSE; @@ -2102,8 +2102,8 @@ bool wxWindow::Destroy() void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); - wxASSERT_MSG( (m_parent != NULL), _T("wxWindow::SetSize requires parent.\n") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid window") ); + wxASSERT_MSG( (m_parent != NULL), T("wxWindow::SetSize requires parent.\n") ); if (m_resizing) return; /* I don't like recursions */ m_resizing = TRUE; @@ -2234,7 +2234,7 @@ void wxWindow::OnInternalIdle() void wxWindow::DoGetSize( int *width, int *height ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (width) (*width) = m_width; if (height) (*height) = m_height; @@ -2242,7 +2242,7 @@ void wxWindow::DoGetSize( int *width, int *height ) const void wxWindow::DoSetClientSize( int width, int height ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_wxwindow) { @@ -2316,7 +2316,7 @@ void wxWindow::DoSetClientSize( int width, int height ) void wxWindow::DoGetClientSize( int *width, int *height ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_wxwindow) { @@ -2391,7 +2391,7 @@ void wxWindow::DoGetClientSize( int *width, int *height ) const void wxWindow::DoGetPosition( int *x, int *y ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (x) (*x) = m_x; if (y) (*y) = m_y; @@ -2399,7 +2399,7 @@ void wxWindow::DoGetPosition( int *x, int *y ) const void wxWindow::DoClientToScreen( int *x, int *y ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2428,7 +2428,7 @@ void wxWindow::DoClientToScreen( int *x, int *y ) const void wxWindow::DoScreenToClient( int *x, int *y ) const { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2457,7 +2457,7 @@ void wxWindow::DoScreenToClient( int *x, int *y ) const bool wxWindow::Show( bool show ) { - wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") ); if (!wxWindowBase::Show(show)) { @@ -2475,7 +2475,7 @@ bool wxWindow::Show( bool show ) bool wxWindow::Enable( bool enable ) { - wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") ); if (!wxWindowBase::Enable(enable)) { @@ -2492,9 +2492,9 @@ bool wxWindow::Enable( bool enable ) int wxWindow::GetCharHeight() const { - wxCHECK_MSG( (m_widget != NULL), 12, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), 12, T("invalid window") ); - wxCHECK_MSG( m_font.Ok(), 12, _T("invalid font") ); + wxCHECK_MSG( m_font.Ok(), 12, T("invalid font") ); GdkFont *font = m_font.GetInternalFont( 1.0 ); @@ -2503,9 +2503,9 @@ int wxWindow::GetCharHeight() const int wxWindow::GetCharWidth() const { - wxCHECK_MSG( (m_widget != NULL), 8, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), 8, T("invalid window") ); - wxCHECK_MSG( m_font.Ok(), 8, _T("invalid font") ); + wxCHECK_MSG( m_font.Ok(), 8, T("invalid font") ); GdkFont *font = m_font.GetInternalFont( 1.0 ); @@ -2522,7 +2522,7 @@ void wxWindow::GetTextExtent( const wxString& string, wxFont fontToUse = m_font; if (theFont) fontToUse = *theFont; - wxCHECK_RET( fontToUse.Ok(), _T("invalid font") ); + wxCHECK_RET( fontToUse.Ok(), T("invalid font") ); GdkFont *font = fontToUse.GetInternalFont( 1.0 ); if (x) (*x) = gdk_string_width( font, string.mbc_str() ); @@ -2533,7 +2533,7 @@ void wxWindow::GetTextExtent( const wxString& string, void wxWindow::SetFocus() { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); GtkWidget *connect_widget = GetConnectWidget(); if (connect_widget) @@ -2559,7 +2559,7 @@ bool wxWindow::AcceptsFocus() const bool wxWindow::Reparent( wxWindowBase *newParentBase ) { - wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") ); wxWindow *oldParent = m_parent, *newParent = (wxWindow *)newParentBase; @@ -2595,11 +2595,11 @@ bool wxWindow::Reparent( wxWindowBase *newParentBase ) void wxWindow::DoAddChild(wxWindow *child) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid window") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid window") ); - wxASSERT_MSG( (child != NULL), _T("invalid child window") ); + wxASSERT_MSG( (child != NULL), T("invalid child window") ); - wxASSERT_MSG( (m_insertCallback != NULL), _T("invalid child insertion function") ); + wxASSERT_MSG( (m_insertCallback != NULL), T("invalid child insertion function") ); /* add to list */ AddChild( child ); @@ -2610,7 +2610,7 @@ void wxWindow::DoAddChild(wxWindow *child) void wxWindow::Raise() { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2619,7 +2619,7 @@ void wxWindow::Raise() void wxWindow::Lower() { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2628,14 +2628,14 @@ void wxWindow::Lower() bool wxWindow::SetCursor( const wxCursor &cursor ) { - wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") ); + wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") ); return wxWindowBase::SetCursor( cursor ); } void wxWindow::WarpPointer( int x, int y ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); GtkWidget *connect_widget = GetConnectWidget(); if (connect_widget->window) @@ -2648,7 +2648,7 @@ void wxWindow::WarpPointer( int x, int y ) void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) { - wxCHECK_RET( (m_widget != NULL), _T("invalid window") ); + wxCHECK_RET( (m_widget != NULL), T("invalid window") ); if (!m_widget->window) return; @@ -2710,7 +2710,7 @@ void wxWindow::Refresh( bool eraseBackground, const wxRect *rect ) void wxWindow::Clear() { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); if (!m_widget->window) return; @@ -2737,7 +2737,7 @@ void wxWindow::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) bool wxWindow::SetBackgroundColour( const wxColour &colour ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") ); if (!wxWindowBase::SetBackgroundColour(colour)) { @@ -2784,7 +2784,7 @@ bool wxWindow::SetBackgroundColour( const wxColour &colour ) bool wxWindow::SetForegroundColour( const wxColour &colour ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") ); if (!wxWindowBase::SetForegroundColour(colour)) { @@ -2900,9 +2900,9 @@ static void pop_pos_callback( GtkMenu * WXUNUSED(menu), bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") ); - wxCHECK_MSG( menu != NULL, FALSE, _T("invalid popup-menu") ); + wxCHECK_MSG( menu != NULL, FALSE, T("invalid popup-menu") ); SetInvokingWindow( menu, this ); @@ -2939,7 +2939,7 @@ bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y ) void wxWindow::SetDropTarget( wxDropTarget *dropTarget ) { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); GtkWidget *dnd_widget = GetConnectWidget(); @@ -2969,7 +2969,7 @@ bool wxWindow::IsOwnGtkWindow( GdkWindow *window ) bool wxWindow::SetFont( const wxFont &font ) { - wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") ); if (!wxWindowBase::SetFont(font)) { @@ -3007,9 +3007,9 @@ bool wxWindow::SetFont( const wxFont &font ) void wxWindow::CaptureMouse() { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( g_captureWindow == NULL, _T("CaptureMouse called twice") ); + wxCHECK_RET( g_captureWindow == NULL, T("CaptureMouse called twice") ); GtkWidget *connect_widget = GetConnectWidget(); if (!connect_widget->window) return; @@ -3027,9 +3027,9 @@ void wxWindow::CaptureMouse() void wxWindow::ReleaseMouse() { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( g_captureWindow, _T("ReleaseMouse called twice") ); + wxCHECK_RET( g_captureWindow, T("ReleaseMouse called twice") ); GtkWidget *connect_widget = GetConnectWidget(); if (!connect_widget->window) return; @@ -3046,9 +3046,9 @@ bool wxWindow::IsRetained() const void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible, int range, bool refresh ) { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); + wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") ); m_hasScrolling = TRUE; @@ -3109,9 +3109,9 @@ void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible, void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) ) { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); + wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) { @@ -3152,9 +3152,9 @@ void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) ) int wxWindow::GetScrollThumb( int orient ) const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") ); - wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") ); + wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) return (int)(m_hAdjust->page_size+0.5); @@ -3164,9 +3164,9 @@ int wxWindow::GetScrollThumb( int orient ) const int wxWindow::GetScrollPos( int orient ) const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") ); - wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") ); + wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) return (int)(m_hAdjust->value+0.5); @@ -3176,9 +3176,9 @@ int wxWindow::GetScrollPos( int orient ) const int wxWindow::GetScrollRange( int orient ) const { - wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") ); + wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") ); - wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") ); + wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") ); if (orient == wxHORIZONTAL) return (int)(m_hAdjust->upper+0.5); @@ -3188,9 +3188,9 @@ int wxWindow::GetScrollRange( int orient ) const void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) ) { - wxCHECK_RET( m_widget != NULL, _T("invalid window") ); + wxCHECK_RET( m_widget != NULL, T("invalid window") ); - wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") ); + wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") ); if (!m_scrollGC) { diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index 9379ddd1d9..7ce1523592 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -119,7 +119,7 @@ bool HP_TagHandler::HandleTag(const wxHtmlTag& tag) return TRUE; } - else if (tag.GetName() == "OBJECT") { + else if (tag.GetName() == "OBJECT(") { m_Name = m_Page = wxEmptyString; ParseInner(tag); if (m_Page != wxEmptyString) { diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 4e58006621..ea07bad616 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -323,9 +323,9 @@ void wxHtmlContainerCell::SetAlign(const wxHtmlTag& tag) alg.MakeUpper(); if (alg == "CENTER") SetAlignHor(HTML_ALIGN_CENTER); - else if (alg == "LEFT") + else if (alg == "LEFT(") SetAlignHor(HTML_ALIGN_LEFT); - else if (alg == "RIGHT") + else if (alg == "RIGHT(") SetAlignHor(HTML_ALIGN_RIGHT); } } diff --git a/src/html/htmlfilt.cpp b/src/html/htmlfilt.cpp index daddda164a..c0a56d9891 100644 --- a/src/html/htmlfilt.cpp +++ b/src/html/htmlfilt.cpp @@ -129,7 +129,7 @@ bool wxHtmlFilterHTML::CanRead(const wxFSFile& file) const // This is true in most case but some page can return: // "text/html; char-encoding=...." // So we use Find instead - return (file.GetMimeType().Find(_T("text/html")) == 0); + return (file.GetMimeType().Find(T("text/html")) == 0); } diff --git a/src/html/m_fonts.cpp b/src/html/m_fonts.cpp index 2919a029b4..1718aa01e7 100644 --- a/src/html/m_fonts.cpp +++ b/src/html/m_fonts.cpp @@ -30,7 +30,7 @@ FORCE_LINK_ME(mod_fonts) -TAG_HANDLER_BEGIN(FONT, "FONT") +TAG_HANDLER_BEGIN(FONT, "FONT(") TAG_HANDLER_PROC(tag) { @@ -71,7 +71,7 @@ TAG_HANDLER_BEGIN(FONT, "FONT") TAG_HANDLER_END(FONT) -TAG_HANDLER_BEGIN(FACES, "U,I,B,TT") +TAG_HANDLER_BEGIN(FACES, "U,I,B,TT(") TAG_HANDLER_PROC(tag) { diff --git a/src/html/m_image.cpp b/src/html/m_image.cpp index 020c60230e..556bbe4fdf 100644 --- a/src/html/m_image.cpp +++ b/src/html/m_image.cpp @@ -382,7 +382,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG, MAP, AREA") str = m_WParser -> GetFS() -> OpenFile(tmp); if (tag.HasParam("WIDTH")) tag.ScanParam("WIDTH", "%i", &w); - if (tag.HasParam("HEIGHT")) tag.ScanParam("HEIGHT", "%i", &h); + if (tag.HasParam("HEIGHT(")) tag.ScanParam("HEIGHT(", "%i", &h); al = HTML_ALIGN_BOTTOM; if (tag.HasParam("ALIGN")) { wxString alstr = tag.GetParam("ALIGN"); @@ -441,7 +441,7 @@ TAG_HANDLER_BEGIN(IMG, "IMG, MAP, AREA") { cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::CIRCLE, coords ); } - else if (tmp == "RECT") + else if (tmp == "RECT(") { cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::RECT, coords ); } diff --git a/src/html/m_layout.cpp b/src/html/m_layout.cpp index c34aa54868..c4c93728c9 100644 --- a/src/html/m_layout.cpp +++ b/src/html/m_layout.cpp @@ -165,8 +165,8 @@ TAG_HANDLER_BEGIN(BODY, "BODY") unsigned long tmp; wxColour clr; - if (tag.HasParam("TEXT")) { - if (tag.ScanParam("TEXT", "#%lX", &tmp) == 1) { + if (tag.HasParam("TEXT(")) { + if (tag.ScanParam("TEXT(", "#%lX", &tmp) == 1) { clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF)); m_WParser -> SetActualColor(clr); m_WParser -> GetContainer() -> InsertCell(new wxHtmlColourCell(clr)); diff --git a/src/html/m_tables.cpp b/src/html/m_tables.cpp index a93a089c9a..76f85d087e 100644 --- a/src/html/m_tables.cpp +++ b/src/html/m_tables.cpp @@ -469,7 +469,7 @@ TAG_HANDLER_BEGIN(TABLE, "TABLE,TR,TD,TH") als = m_rAlign; if (tag.HasParam("ALIGN")) als = tag.GetParam("ALIGN"); als.MakeUpper(); - if (als == "RIGHT") m_WParser -> SetAlign(HTML_ALIGN_RIGHT); + if (als == "RIGHT(") m_WParser -> SetAlign(HTML_ALIGN_RIGHT); else if (als == "CENTER") m_WParser -> SetAlign(HTML_ALIGN_CENTER); } m_WParser -> OpenContainer(); diff --git a/src/motif/clipbrd.cpp b/src/motif/clipbrd.cpp index 0cc48a40f0..84dca0b0f0 100644 --- a/src/motif/clipbrd.cpp +++ b/src/motif/clipbrd.cpp @@ -85,7 +85,7 @@ bool wxIsClipboardFormatAvailable(wxDataFormat dataFormat) window = XtWindow( (Widget) wxTheApp->GetTopWindow()->GetTopWidget() ); int success = XmClipboardRetrieve((Display*) wxGetDisplay(), - window, "TEXT", (XtPointer) 0, 0, & numBytes, & privateId) ; + window, "TEXT(", (XtPointer) 0, 0, & numBytes, & privateId) ; // Assume only text is supported. If we have anything at all, // or the clipboard is locked so we're not sure, we say we support it. @@ -128,7 +128,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width, int h XmClipboardCopy((Display*) wxGetDisplay(), window, itemId, - "TEXT", + "TEXT(", (XtPointer) data, strlen(data) + 1, 0, @@ -171,7 +171,7 @@ wxObject *wxGetClipboardData(wxDataFormat dataFormat, long *len) } result = XmClipboardRetrieve((Display*) wxGetDisplay(), window, - "TEXT", + "TEXT(", (XtPointer) data, currentDataSize, &numBytes, @@ -224,7 +224,7 @@ bool wxGetClipboardFormatName(wxDataFormat dataFormat, char *formatName, int max // Only wxDF_TEXT supported if (dataFormat == wxDF_TEXT) { - strcpy(formatName, "TEXT"); + strcpy(formatName, "TEXT("); return TRUE; } else @@ -413,7 +413,7 @@ wxClipboard::~wxClipboard() static int FormatStringToID(char *str) { - if (!strcmp(str, "TEXT")) + if (!strcmp(str, "TEXT(")) return wxDF_TEXT; return wxRegisterClipboardFormat(str); @@ -499,7 +499,7 @@ char *wxClipboard::GetClipboardString(long time) char *str; long length; - str = GetClipboardData("TEXT", &length, time); + str = GetClipboardData("TEXT(", &length, time); if (!str) { str = new char[1]; *str = 0; @@ -516,7 +516,7 @@ char *wxClipboard::GetClipboardData(char *format, long *length, long time) else return NULL; } else if (cbString) { - if (!strcmp(format, "TEXT")) + if (!strcmp(format, "TEXT(")) return copystring(cbString); else return NULL; diff --git a/src/motif/dataobj.cpp b/src/motif/dataobj.cpp index 2fdd9dd815..2edfb0e4b6 100644 --- a/src/motif/dataobj.cpp +++ b/src/motif/dataobj.cpp @@ -89,7 +89,7 @@ wxDataFormat::wxDataFormat( const Atom atom ) m_type = wxDF_PRIVATE; m_id = XGetAtomName( (Display*) wxGetDisplay(), m_atom ); - if (m_id == _T("file:ALL")) + if (m_id == T("file:ALL")) { m_type = wxDF_FILENAME; } @@ -102,21 +102,21 @@ void wxDataFormat::SetType( wxDataFormatId type ) if (m_type == wxDF_TEXT) { - m_id = _T("STRING"); + m_id = T("STRING"); } else if (m_type == wxDF_BITMAP) { - m_id = _T("BITMAP"); + m_id = T("BITMAP"); } else if (m_type == wxDF_FILENAME) { - m_id = _T("file:ALL"); + m_id = T("file:ALL"); } else { - wxFAIL_MSG( _T("invalid dataformat") ); + wxFAIL_MSG( T("invalid dataformat") ); } m_hasAtom = FALSE; @@ -159,7 +159,7 @@ Atom wxDataFormat::GetAtom() */ if (m_type == wxDF_PRIVATE) { - m_atom = XInternAtom( (Display*) wxGetDisplay(), MBSTRINGCAST m_id.mbc_str(), FALSE ); + m_atom = XInternAtom( (Display*) wxGetDisplay(), wxMBSTRINGCAST m_id.mbc_str(), FALSE ); } else if (m_type == wxDF_FILENAME) @@ -268,7 +268,7 @@ void wxPrivateDataObject::Free() wxPrivateDataObject::wxPrivateDataObject() { - wxString id = _T("application/"); + wxString id = T("application/"); id += wxTheApp->GetAppName(); m_format.SetId( id ); diff --git a/src/motif/dcclient.cpp b/src/motif/dcclient.cpp index bda0770424..b7d6e721ee 100644 --- a/src/motif/dcclient.cpp +++ b/src/motif/dcclient.cpp @@ -2194,7 +2194,7 @@ static void wx_spline_draw_point_array(wxDC *dc) void wxWindowDC::DoDrawSpline( wxList *points ) { - wxCHECK_RET( Ok(), _T("invalid window dc") ); + wxCHECK_RET( Ok(), T("invalid window dc") ); wxPoint *p; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; diff --git a/src/motif/font.cpp b/src/motif/font.cpp index c9b7ca780e..817ca89938 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -364,12 +364,12 @@ wxXFont* wxFont::GetInternalFont(double scale, WXDisplay* display) const M_FONTDATA->m_style, M_FONTDATA->m_weight, M_FONTDATA->m_underlined, - _T(""), + T(""), M_FONTDATA->m_encoding); if ( !font ) { - wxFAIL_MSG( _T("Could not allocate even a default font -- something is wrong.") ); + wxFAIL_MSG( T("Could not allocate even a default font -- something is wrong.") ); return (wxXFont*) NULL; } diff --git a/src/motif/fontenum.cpp b/src/motif/fontenum.cpp index 33c661dfa4..e427c02654 100644 --- a/src/motif/fontenum.cpp +++ b/src/motif/fontenum.cpp @@ -69,7 +69,7 @@ static int CMPFUNC_CONV CompareStrings(const char *s1, const char *s2) static char **CreateFontList(wxChar spacing, int *nFonts) { wxString pattern; - pattern.Printf(_T("-*-*-*-*-*-*-*-*-*-*-%c-*-*-*"), spacing); + pattern.Printf(T("-*-*-*-*-*-*-*-*-*-*-%c-*-*-*"), spacing); // get the list of all fonts return XListFonts((Display *)wxGetDisplay(), pattern, 32767, nFonts); @@ -123,7 +123,7 @@ bool wxFontEnumerator::EnumerateFamilies(bool fixedWidthOnly) if ( fixedWidthOnly ) { bool cont = TRUE; - fonts = CreateFontList(_T('m'), &nFonts); + fonts = CreateFontList(T('m'), &nFonts); if ( fonts ) { cont = ProcessFamiliesFromFontList(this, fonts, nFonts); @@ -136,7 +136,7 @@ bool wxFontEnumerator::EnumerateFamilies(bool fixedWidthOnly) return TRUE; } - fonts = CreateFontList(_T('c'), &nFonts); + fonts = CreateFontList(T('c'), &nFonts); if ( !fonts ) { return TRUE; @@ -144,11 +144,11 @@ bool wxFontEnumerator::EnumerateFamilies(bool fixedWidthOnly) } else { - fonts = CreateFontList(_T('*'), &nFonts); + fonts = CreateFontList(T('*'), &nFonts); if ( !fonts ) { - wxFAIL_MSG(_T("No fonts at all on this system?")); + wxFAIL_MSG(T("No fonts at all on this system?")); return FALSE; } @@ -165,8 +165,8 @@ bool wxFontEnumerator::EnumerateEncodings(const wxString& family) { #if 0 wxString pattern; - pattern.Printf(_T("-*-%s-*-*-*-*-*-*-*-*-*-*-*-*"), - family.IsEmpty() ? _T("*") : family.c_str()); + pattern.Printf(T("-*-%s-*-*-*-*-*-*-*-*-*-*-*-*"), + family.IsEmpty() ? T("*") : family.c_str()); // get the list of all fonts int nFonts; diff --git a/src/motif/utils.cpp b/src/motif/utils.cpp index 094a3e8699..10d2f165b3 100644 --- a/src/motif/utils.cpp +++ b/src/motif/utils.cpp @@ -194,7 +194,7 @@ static char * GetIniFile (char *dest, const char *filename) strcat (dest, "/"); if (filename == NULL) { - if ((filename = getenv ("XENVIRONMENT")) == NULL) + if ((filename = getenv ("XENVIRONMENT(")) == NULL) filename = ".Xdefaults"; } else if (*filename != '.') @@ -405,7 +405,7 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c { // Handle True, False here // True, Yes, Enables, Set or Activated - if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A') + if (*s == 'T(' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A') *value = TRUE; // False, No, Disabled, Reset, Cleared, Deactivated else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C') @@ -457,7 +457,7 @@ void wxXMergeDatabases (wxApp * theApp, Display * display) * and merge into existing database */ - if ((environment = getenv ("XENVIRONMENT")) == NULL) + if ((environment = getenv ("XENVIRONMENT(")) == NULL) { size_t len; environment = GetIniFile (filename, NULL); diff --git a/src/motif/window.cpp b/src/motif/window.cpp index e82f80539d..498fbedec9 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -719,7 +719,7 @@ bool wxWindow::SetCursor(const wxCursor& cursor) } wxASSERT_MSG( m_cursor.Ok(), - _T("cursor must be valid after call to the base version")); + T("cursor must be valid after call to the base version")); WXDisplay *dpy = GetXDisplay(); WXCursor x_cursor = m_cursor.GetXCursor(dpy); diff --git a/src/msw/app.cpp b/src/msw/app.cpp index d1a70a3d3c..36199a3d67 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -113,14 +113,14 @@ wxApp *wxTheApp = NULL; // NB: all "NoRedraw" classes must have the same names as the "normal" classes // with NR suffix - wxWindow::MSWCreate() supposes this -wxChar wxFrameClassName[] = _T("wxFrameClass"); -wxChar wxFrameClassNameNoRedraw[] = _T("wxFrameClassNR"); -wxChar wxMDIFrameClassName[] = _T("wxMDIFrameClass"); -wxChar wxMDIFrameClassNameNoRedraw[] = _T("wxMDIFrameClassNR"); -wxChar wxMDIChildFrameClassName[] = _T("wxMDIChildFrameClass"); -wxChar wxMDIChildFrameClassNameNoRedraw[] = _T("wxMDIChildFrameClassNR"); -wxChar wxPanelClassName[] = _T("wxPanelClass"); -wxChar wxCanvasClassName[] = _T("wxCanvasClass"); +wxChar wxFrameClassName[] = T("wxFrameClass"); +wxChar wxFrameClassNameNoRedraw[] = T("wxFrameClassNR"); +wxChar wxMDIFrameClassName[] = T("wxMDIFrameClass"); +wxChar wxMDIFrameClassNameNoRedraw[] = T("wxMDIFrameClassNR"); +wxChar wxMDIChildFrameClassName[] = T("wxMDIChildFrameClass"); +wxChar wxMDIChildFrameClassNameNoRedraw[] = T("wxMDIChildFrameClassNR"); +wxChar wxPanelClassName[] = T("wxPanelClass"); +wxChar wxCanvasClassName[] = T("wxCanvasClass"); HICON wxSTD_FRAME_ICON = (HICON) NULL; HICON wxSTD_MDICHILDFRAME_ICON = (HICON) NULL; @@ -176,7 +176,7 @@ bool wxApp::Initialize() wxClassInfo::InitializeClasses(); #if wxUSE_RESOURCES - wxGetResource(_T("wxWindows"), _T("OsVersion"), &wxOsVersion); + wxGetResource(T("wxWindows"), T("OsVersion"), &wxOsVersion); #endif // I'm annoyed ... I don't know where to put this and I don't want to @@ -202,7 +202,7 @@ bool wxApp::Initialize() InitCommonControls(); #if wxUSE_RICHEDIT - gs_hRichEdit = LoadLibrary(_T("RICHED32.DLL")); + gs_hRichEdit = LoadLibrary(T("RICHED32.DLL")); if (gs_hRichEdit == (HINSTANCE) NULL) { @@ -227,20 +227,20 @@ bool wxApp::Initialize() #if wxUSE_CTL3D if (!Ctl3dRegister(wxhInstance)) - wxLogError(_T("Cannot register CTL3D")); + wxLogError(T("Cannot register CTL3D")); Ctl3dAutoSubclass(wxhInstance); #endif g_globalCursor = new wxCursor; - wxSTD_FRAME_ICON = LoadIcon(wxhInstance, _T("wxSTD_FRAME")); - wxSTD_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, _T("wxSTD_MDIPARENTFRAME")); - wxSTD_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, _T("wxSTD_MDICHILDFRAME")); + wxSTD_FRAME_ICON = LoadIcon(wxhInstance, T("wxSTD_FRAME")); + wxSTD_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, T("wxSTD_MDIPARENTFRAME")); + wxSTD_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, T("wxSTD_MDICHILDFRAME")); - wxDEFAULT_FRAME_ICON = LoadIcon(wxhInstance, _T("wxDEFAULT_FRAME")); - wxDEFAULT_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, _T("wxDEFAULT_MDIPARENTFRAME")); - wxDEFAULT_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, _T("wxDEFAULT_MDICHILDFRAME")); + wxDEFAULT_FRAME_ICON = LoadIcon(wxhInstance, T("wxDEFAULT_FRAME")); + wxDEFAULT_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, T("wxDEFAULT_MDIPARENTFRAME")); + wxDEFAULT_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, T("wxDEFAULT_MDICHILDFRAME")); RegisterWindowClasses(); @@ -248,7 +248,7 @@ bool wxApp::Initialize() LOGBRUSH lb; lb.lbStyle = BS_PATTERN; - lb.lbHatch = (int)LoadBitmap( wxhInstance, _T("wxDISABLE_BUTTON_BITMAP") ); + lb.lbHatch = (int)LoadBitmap( wxhInstance, T("wxDISABLE_BUTTON_BITMAP") ); if ( lb.lbHatch ) { wxDisableButtonBrush = ::CreateBrushIndirect( & lb ); @@ -425,11 +425,11 @@ void wxApp::ConvertToStandardCommandArgs(char* lpCmdLine) if (i < len) { - if (cmdLine.GetChar(i) == _T('"')) // We found the start of a string + if (cmdLine.GetChar(i) == T('"')) // We found the start of a string { i ++; int first = i; - while ((i < len) && (cmdLine.GetChar(i) != _T('"'))) + while ((i < len) && (cmdLine.GetChar(i) != T('"'))) i ++; wxString arg(cmdLine.Mid(first, (i - first))); @@ -578,7 +578,7 @@ void wxApp::CleanUp() // wxDebugContext, too. if (wxDebugContext::CountObjectsLeft(TRUE) > 0) { - wxLogDebug(_T("There were memory leaks.")); + wxLogDebug(T("There were memory leaks.")); wxDebugContext::Dump(); wxDebugContext::PrintStatistics(); } @@ -635,12 +635,12 @@ int wxEntry(WXHINSTANCE hInstance, // the IMPLEMENT_APP macro is used instead, which sets an initializer // function for delayed, dynamic app object construction. wxCHECK_MSG( wxApp::GetInitializerFunction(), 0, - _T("No initializer - use IMPLEMENT_APP macro.") ); + T("No initializer - use IMPLEMENT_APP macro.") ); wxTheApp = (*wxApp::GetInitializerFunction()) (); } - wxCHECK_MSG( wxTheApp, 0, _T("You have to define an instance of wxApp!") ); + wxCHECK_MSG( wxTheApp, 0, T("You have to define an instance of wxApp!") ); // save the WinMain() parameters wxTheApp->ConvertToStandardCommandArgs(lpCmdLine); @@ -818,7 +818,7 @@ bool wxApp::DoMessage() { #if wxUSE_THREADS wxASSERT_MSG( wxThread::IsMain(), - _T("only the main thread can process Windows messages") ); + T("only the main thread can process Windows messages") ); static bool s_hadGuiLock = TRUE; static wxMsgArray s_aSavedMessages; @@ -1112,7 +1112,7 @@ void wxApp::OnQueryEndSession(wxCloseEvent& event) int wxApp::GetComCtl32Version() const { // have we loaded COMCTL32 yet? - HMODULE theModule = ::GetModuleHandle(_T("COMCTL32")); + HMODULE theModule = ::GetModuleHandle(T("COMCTL32")); int version = 0; // if so, then we can check for the version @@ -1197,7 +1197,7 @@ wxApp::GetStdIcon(int which) const return wxIcon("wxICON_WARNING"); default: - wxFAIL_MSG(_T("requested non existent standard icon")); + wxFAIL_MSG(T("requested non existent standard icon")); // still fall through case wxICON_HAND: diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index 40b199abce..2bf574d245 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -80,7 +80,7 @@ wxBitmapRefData::~wxBitmapRefData() if (m_selectedInto) { wxChar buf[200]; - wxSprintf(buf, _T("Bitmap was deleted without selecting out of wxMemoryDC %lX."), (unsigned long) m_selectedInto); + wxSprintf(buf, T("Bitmap was deleted without selecting out of wxMemoryDC %lX."), (unsigned long) m_selectedInto); wxFatalError(buf); } if (m_hBitmap) @@ -146,7 +146,7 @@ bool wxBitmap::FreeResource(bool WXUNUSED(force)) if (M_BITMAPDATA->m_selectedInto) { wxChar buf[200]; - wxSprintf(buf, _T("Bitmap %lX was deleted without selecting out of wxMemoryDC %lX."), (unsigned long) this, (unsigned long) M_BITMAPDATA->m_selectedInto); + wxSprintf(buf, T("Bitmap %lX was deleted without selecting out of wxMemoryDC %lX."), (unsigned long) this, (unsigned long) M_BITMAPDATA->m_selectedInto); wxFatalError(buf); } if (M_BITMAPDATA->m_hBitmap) @@ -255,7 +255,7 @@ bool wxBitmap::LoadFile(const wxString& filename, long type) wxBitmapHandler *handler = FindHandler(type); if ( handler == NULL ) { - wxLogWarning(_T("no bitmap handler for type %d defined."), type); + wxLogWarning(T("no bitmap handler for type %d defined."), type); return FALSE; } @@ -272,7 +272,7 @@ bool wxBitmap::Create(void *data, long type, int width, int height, int depth) wxBitmapHandler *handler = FindHandler(type); if ( handler == NULL ) { - wxLogWarning(_T("no bitmap handler for type %d defined."), type); + wxLogWarning(T("no bitmap handler for type %d defined."), type); return FALSE; } @@ -285,7 +285,7 @@ bool wxBitmap::SaveFile(const wxString& filename, int type, const wxPalette *pal wxBitmapHandler *handler = FindHandler(type); if ( handler == NULL ) { - wxLogWarning(_T("no bitmap handler for type %d defined."), type); + wxLogWarning(T("no bitmap handler for type %d defined."), type); return FALSE; } @@ -682,7 +682,7 @@ bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long } // it's probably not found - wxLogError(_T("Can't load bitmap '%s' from resources! Check .rc file."), name.c_str()); + wxLogError(T("Can't load bitmap '%s' from resources! Check .rc file."), name.c_str()); return FALSE; } diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index 4bd94f56a4..d0f3c7e9b3 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -75,8 +75,8 @@ bool wxBitmapButton::Create(wxWindow *parent, wxWindowID id, const wxBitmap& bit m_hWnd = (WXHWND)CreateWindowEx ( 0, - _T("BUTTON"), - _T(""), + T("BUTTON"), + T(""), WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_OWNERDRAW , 0, 0, 0, 0, GetWinHwnd(parent), diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 620c2a74ab..241f90a07e 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -81,7 +81,7 @@ bool wxButton::Create(wxWindow *parent, m_hWnd = (WXHWND)CreateWindowEx ( MakeExtendedStyle(m_windowStyle), - _T("BUTTON"), + T("BUTTON"), label, WS_VISIBLE | WS_TABSTOP | WS_CHILD, 0, 0, 0, 0, diff --git a/src/msw/caret.cpp b/src/msw/caret.cpp index 87e46935a5..55cd4242c9 100644 --- a/src/msw/caret.cpp +++ b/src/msw/caret.cpp @@ -81,8 +81,8 @@ void wxCaretBase::SetBlinkTime(int milliseconds) bool wxCaret::MSWCreateCaret() { - wxASSERT_MSG( GetWindow(), _T("caret without window cannot be created") ); - wxASSERT_MSG( IsOk(), _T("caret of zero size cannot be created") ); + wxASSERT_MSG( GetWindow(), T("caret without window cannot be created") ); + wxASSERT_MSG( IsOk(), T("caret of zero size cannot be created") ); if ( !m_hasCaret ) { @@ -127,8 +127,8 @@ void wxCaret::OnKillFocus() void wxCaret::DoShow() { - wxASSERT_MSG( GetWindow(), _T("caret without window cannot be shown") ); - wxASSERT_MSG( IsOk(), _T("caret of zero size cannot be shown") ); + wxASSERT_MSG( GetWindow(), T("caret without window cannot be shown") ); + wxASSERT_MSG( IsOk(), T("caret of zero size cannot be shown") ); if ( m_hasCaret ) { @@ -154,7 +154,7 @@ void wxCaret::DoMove() if ( m_hasCaret ) { wxWindow *winFocus = wxWindow::FindFocus(); - wxASSERT_MSG( winFocus == GetWindow(), _T("how did we lose focus?") ); + wxASSERT_MSG( winFocus == GetWindow(), T("how did we lose focus?") ); CALL_CARET_API(SetCaretPos, (m_x, m_y)); } diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index bb95665069..1953b6e32e 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -78,8 +78,8 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, m_windowStyle = style; wxString Label = label; - if (Label == _T("")) - Label = _T(" "); // Apparently needed or checkbox won't show + if (Label == T("")) + Label = T(" "); // Apparently needed or checkbox won't show if ( id == -1 ) m_windowId = NewControlId(); @@ -109,7 +109,7 @@ bool wxCheckBox::Create(wxWindow *parent, wxWindowID id, const wxString& label, msStyle |= WS_BORDER; */ - m_hWnd = (WXHWND)CreateWindowEx(exStyle, _T("BUTTON"), Label, + m_hWnd = (WXHWND)CreateWindowEx(exStyle, T("BUTTON"), Label, msStyle, 0, 0, 0, 0, (HWND)parent->GetHWND(), (HMENU)m_windowId, @@ -245,7 +245,7 @@ bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *l checkHeight = -1 ; long msStyle = CHECK_FLAGS; - HWND wx_button = CreateWindowEx(MakeExtendedStyle(m_windowStyle), CHECK_CLASS, _T("toggle"), + HWND wx_button = CreateWindowEx(MakeExtendedStyle(m_windowStyle), CHECK_CLASS, T("toggle"), msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); @@ -272,5 +272,5 @@ bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, const wxBitmap *l void wxBitmapCheckBox::SetLabel(const wxBitmap& bitmap) { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); } diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index 808ed0f727..2e67140448 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -225,7 +225,7 @@ void wxCheckListBoxItem::Check(bool check) // update it int index = m_pParent->GetItemIndex(this); - wxASSERT_MSG( index != wxNOT_FOUND, _T("what does this item do here?") ); + wxASSERT_MSG( index != wxNOT_FOUND, T("what does this item do here?") ); m_nIndex = (size_t)index; } @@ -238,7 +238,7 @@ void wxCheckListBoxItem::Check(bool check) if ( ::SendMessage(hwndListbox, LB_GETITEMRECT, m_nIndex, (LPARAM)&rcUpdate) == LB_ERR ) { - wxLogDebug(_T("LB_GETITEMRECT failed")); + wxLogDebug(T("LB_GETITEMRECT failed")); } #else // Win16 // FIXME this doesn't work if the listbox is scrolled! @@ -293,7 +293,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id, void wxCheckListBox::Delete(int N) { wxCHECK_RET( N >= 0 && N < m_noItems, - _T("invalid index in wxListBox::Delete") ); + T("invalid index in wxListBox::Delete") ); wxListBox::Delete(N); @@ -306,7 +306,7 @@ void wxCheckListBox::Delete(int N) void wxCheckListBox::InsertItems(int nItems, const wxString items[], int pos) { wxCHECK_RET( pos >= 0 && pos <= m_noItems, - _T("invalid index in wxCheckListBox::InsertItems") ); + T("invalid index in wxCheckListBox::InsertItems") ); wxListBox::InsertItems(nItems, items, pos); diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 86bf29fc1e..d63bd86976 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -69,10 +69,10 @@ bool wxChoice::Create(wxWindow *parent, wxASSERT_MSG( !(style & wxCB_DROPDOWN) && !(style & wxCB_READONLY) && !(style & wxCB_SIMPLE), - _T("this style flag is ignored by wxChoice, you " + T("this style flag is ignored by wxChoice, you " "probably want to use a wxComboBox") ); - if ( !MSWCreateControl(_T("COMBOBOX"), msStyle) ) + if ( !MSWCreateControl(T("COMBOBOX"), msStyle) ) return FALSE; for ( int i = 0; i < n; i++ ) @@ -102,7 +102,7 @@ int wxChoice::DoAppend(const wxString& item) void wxChoice::Delete(int n) { - wxCHECK_RET( n < GetCount(), _T("invalid item index in wxChoice::Delete") ); + wxCHECK_RET( n < GetCount(), T("invalid item index in wxChoice::Delete") ); SendMessage(GetHwnd(), CB_DELETESTRING, n, 0); } @@ -180,7 +180,7 @@ void wxChoice::DoSetClientData( int n, void* clientData ) { if ( SendMessage(GetHwnd(), CB_SETITEMDATA, n, (LPARAM)clientData) == CB_ERR ) { - wxLogLastError(_T("CB_SETITEMDATA")); + wxLogLastError(T("CB_SETITEMDATA")); } } @@ -189,7 +189,7 @@ void* wxChoice::DoGetClientData( int n ) const LPARAM rc = SendMessage(GetHwnd(), CB_GETITEMDATA, n, 0); if ( rc == CB_ERR ) { - wxLogLastError(_T("CB_GETITEMDATA")); + wxLogLastError(T("CB_GETITEMDATA")); // unfortunately, there is no way to return an error code to the user rc = (LPARAM) NULL; diff --git a/src/msw/clipbrd.cpp b/src/msw/clipbrd.cpp index 33407bebc0..424c1c4524 100644 --- a/src/msw/clipbrd.cpp +++ b/src/msw/clipbrd.cpp @@ -81,7 +81,7 @@ static bool gs_wxClipboardIsOpen = FALSE; bool wxOpenClipboard() { - wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, _T("clipboard already opened.") ); + wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, T("clipboard already opened.") ); wxWindow *win = wxTheApp->GetTopWindow(); if ( win ) @@ -95,7 +95,7 @@ bool wxOpenClipboard() } else { - wxLogDebug(_T("Can not open clipboard without a main window.")); + wxLogDebug(T("Can not open clipboard without a main window.")); return FALSE; } @@ -103,7 +103,7 @@ bool wxOpenClipboard() bool wxCloseClipboard() { - wxCHECK_MSG( gs_wxClipboardIsOpen, FALSE, _T("clipboard is not opened") ); + wxCHECK_MSG( gs_wxClipboardIsOpen, FALSE, T("clipboard is not opened") ); gs_wxClipboardIsOpen = FALSE; @@ -470,10 +470,10 @@ bool wxClipboard::SetData( wxDataObject *data ) bool wxClipboard::AddData( wxDataObject *data ) { - wxCHECK_MSG( data, FALSE, _T("data is invalid") ); + wxCHECK_MSG( data, FALSE, T("data is invalid") ); #if wxUSE_DRAG_AND_DROP - wxCHECK_MSG( wxIsClipboardOpened(), FALSE, _T("clipboard not open") ); + wxCHECK_MSG( wxIsClipboardOpened(), FALSE, T("clipboard not open") ); wxDataFormat format = data->GetFormat(); @@ -527,7 +527,7 @@ bool wxClipboard::IsSupported( wxDataFormat format ) bool wxClipboard::GetData( wxDataObject *data ) { - wxCHECK_MSG( wxIsClipboardOpened(), FALSE, _T("clipboard not open") ); + wxCHECK_MSG( wxIsClipboardOpened(), FALSE, T("clipboard not open") ); #if wxUSE_DRAG_AND_DROP wxDataFormat format = data->GetFormat(); diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index 9f7c5b9752..6dcb98fccb 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -107,12 +107,12 @@ bool wxComboBox::Create(wxWindow *parent, wxWindowID id, if ( want3D || wxStyleHasBorder(m_windowStyle) ) msStyle |= WS_BORDER; - m_hWnd = (WXHWND)::CreateWindowEx(exStyle, _T("COMBOBOX"), NULL, + m_hWnd = (WXHWND)::CreateWindowEx(exStyle, T("COMBOBOX"), NULL, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create combobox") ); + wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create combobox") ); /* #if wxUSE_CTL3D diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 3ae9f711d2..fc25a1a83b 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -76,7 +76,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname, WXDWORD style) if ( !m_hWnd ) { #ifdef __WXDEBUG__ - wxLogError(_T("Failed to create a control of class '%s'"), classname); + wxLogError(T("Failed to create a control of class '%s'"), classname); #endif // DEBUG return FALSE; diff --git a/src/msw/curico.cpp b/src/msw/curico.cpp index 518563ba23..bfca4c09d0 100644 --- a/src/msw/curico.cpp +++ b/src/msw/curico.cpp @@ -218,7 +218,7 @@ HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst) lpDIB->bmiHeader.biBitCount))); // Get a hDC so we can create a bitmap compatible with it - hDC = CreateDC( _T("DISPLAY"), NULL, NULL, NULL); + hDC = CreateDC( T("DISPLAY"), NULL, NULL, NULL); // 5) Create a device dependent bitmap with the XOR bits. hbmXor = CreateDIBitmap( hDC, (LPBITMAPINFOHEADER)&(lpDIB->bmiHeader), @@ -579,7 +579,7 @@ HCURSOR MakeCursor( HANDLE hDIB, LPPOINT lpptHotSpot, HINSTANCE hInst) lpDIB->bmiHeader.biBitCount))); // Get a hDC so we can create a bitmap compatible with it - hDC = CreateDC( _T("DISPLAY"), NULL, NULL, NULL); + hDC = CreateDC( T("DISPLAY"), NULL, NULL, NULL); // 5) Create a device dependent bitmap with the XOR bits. hbmXor = CreateBitmap( (int )lpDIB->bmiHeader.biWidth, diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index e88bb3d775..25ba3cb474 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -165,27 +165,27 @@ wxCursor::wxCursor(int cursor_type) } case wxCURSOR_HAND: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_HAND")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_HAND")); break; } case wxCURSOR_BULLSEYE: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_BULLSEYE")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_BULLSEYE")); break; } case wxCURSOR_PENCIL: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_PENCIL")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_PENCIL")); break; } case wxCURSOR_MAGNIFIER: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_MAGNIFIER")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_MAGNIFIER")); break; } case wxCURSOR_NO_ENTRY: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_NO_ENTRY")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_NO_ENTRY")); break; } case wxCURSOR_LEFT_BUTTON: @@ -205,42 +205,42 @@ wxCursor::wxCursor(int cursor_type) } case wxCURSOR_SIZING: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_SIZING")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_SIZING")); break; } case wxCURSOR_WATCH: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_WATCH")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_WATCH")); break; } case wxCURSOR_SPRAYCAN: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_ROLLER")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_ROLLER")); break; } case wxCURSOR_PAINT_BRUSH: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_PBRUSH")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_PBRUSH")); break; } case wxCURSOR_POINT_LEFT: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_PLEFT")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_PLEFT(")); break; } case wxCURSOR_POINT_RIGHT: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_PRIGHT")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_PRIGHT(")); break; } case wxCURSOR_QUESTION_ARROW: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_QARROW")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_QARROW")); break; } case wxCURSOR_BLANK: { - M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_BLANK")); + M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_BLANK")); break; } default: diff --git a/src/msw/data.cpp b/src/msw/data.cpp index 596cd8ff06..30cee8dff0 100644 --- a/src/msw/data.cpp +++ b/src/msw/data.cpp @@ -118,50 +118,49 @@ wxFont wxNullFont; wxColour wxNullColour; // Default window names -const wxChar *wxButtonNameStr = _T("button"); -const wxChar *wxCanvasNameStr = _T("canvas"); -const wxChar *wxCheckBoxNameStr = _T("check"); -const wxChar *wxChoiceNameStr = _T("choice"); -const wxChar *wxComboBoxNameStr = _T("comboBox"); -const wxChar *wxDialogNameStr = _T("dialog"); -const wxChar *wxFrameNameStr = _T("frame"); -const wxChar *wxGaugeNameStr = _T("gauge"); -const wxChar *wxStaticBoxNameStr = _T("groupBox"); -const wxChar *wxListBoxNameStr = _T("listBox"); -const wxChar *wxStaticTextNameStr = _T("message"); -const wxChar *wxStaticBitmapNameStr = _T("message"); -const wxChar *wxMultiTextNameStr = _T("multitext"); -const wxChar *wxPanelNameStr = _T("panel"); -const wxChar *wxRadioBoxNameStr = _T("radioBox"); -const wxChar *wxRadioButtonNameStr = _T("radioButton"); -const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton"); -const wxChar *wxScrollBarNameStr = _T("scrollBar"); -const wxChar *wxSliderNameStr = _T("slider"); -const wxChar *wxStaticNameStr = _T("static"); -const wxChar *wxTextCtrlWindowNameStr = _T("textWindow"); -const wxChar *wxTextCtrlNameStr = _T("text"); -const wxChar *wxVirtListBoxNameStr = _T("virtListBox"); -const wxChar *wxButtonBarNameStr = _T("buttonbar"); -const wxChar *wxEnhDialogNameStr = _T("Shell"); -const wxChar *wxToolBarNameStr = _T("toolbar"); -const wxChar *wxStatusLineNameStr = _T("status_line"); -const wxChar *wxEmptyString = _T(""); -const wxChar *wxGetTextFromUserPromptStr = _T("Input Text"); -const wxChar *wxMessageBoxCaptionStr = _T("Message"); -const wxChar *wxFileSelectorPromptStr = _T("Select a file"); -const wxChar *wxFileSelectorDefaultWildcardStr = _T("*.*"); -const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error"); -const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error"); -const wxChar *wxTreeCtrlNameStr = _T("treeCtrl"); -const wxChar *wxDirDialogNameStr = _T("wxDirCtrl"); -const wxChar *wxDirDialogDefaultFolderStr = _T("/"); +const wxChar *wxButtonNameStr = T("button"); +const wxChar *wxCanvasNameStr = T("canvas"); +const wxChar *wxCheckBoxNameStr = T("check"); +const wxChar *wxChoiceNameStr = T("choice"); +const wxChar *wxComboBoxNameStr = T("comboBox"); +const wxChar *wxDialogNameStr = T("dialog"); +const wxChar *wxFrameNameStr = T("frame"); +const wxChar *wxGaugeNameStr = T("gauge"); +const wxChar *wxStaticBoxNameStr = T("groupBox"); +const wxChar *wxListBoxNameStr = T("listBox"); +const wxChar *wxStaticTextNameStr = T("message"); +const wxChar *wxStaticBitmapNameStr = T("message"); +const wxChar *wxMultiTextNameStr = T("multitext"); +const wxChar *wxPanelNameStr = T("panel"); +const wxChar *wxRadioBoxNameStr = T("radioBox"); +const wxChar *wxRadioButtonNameStr = T("radioButton"); +const wxChar *wxBitmapRadioButtonNameStr = T("radioButton"); +const wxChar *wxScrollBarNameStr = T("scrollBar"); +const wxChar *wxSliderNameStr = T("slider"); +const wxChar *wxStaticNameStr = T("static"); +const wxChar *wxTextCtrlWindowNameStr = T("textWindow"); +const wxChar *wxTextCtrlNameStr = T("text"); +const wxChar *wxVirtListBoxNameStr = T("virtListBox"); +const wxChar *wxButtonBarNameStr = T("buttonbar"); +const wxChar *wxEnhDialogNameStr = T("Shell"); +const wxChar *wxToolBarNameStr = T("toolbar"); +const wxChar *wxStatusLineNameStr = T("status_line"); +const wxChar *wxGetTextFromUserPromptStr = T("Input Text"); +const wxChar *wxMessageBoxCaptionStr = T("Message"); +const wxChar *wxFileSelectorPromptStr = T("Select a file"); +const wxChar *wxFileSelectorDefaultWildcardStr = T("*.*"); +const wxChar *wxInternalErrorStr = T("wxWindows Internal Error"); +const wxChar *wxFatalErrorStr = T("wxWindows Fatal Error"); +const wxChar *wxTreeCtrlNameStr = T("treeCtrl"); +const wxChar *wxDirDialogNameStr = T("wxDirCtrl"); +const wxChar *wxDirDialogDefaultFolderStr = T("/"); // See wx/utils.h -const wxChar *wxFloatToStringStr = _T("%.2f"); -const wxChar *wxDoubleToStringStr = _T("%.2f"); +const wxChar *wxFloatToStringStr = T("%.2f"); +const wxChar *wxDoubleToStringStr = T("%.2f"); #ifdef __WXMSW__ -const wxChar *wxUserResourceStr = _T("TEXT"); +const wxChar *wxUserResourceStr = T("TEXT("); #endif #if wxUSE_SHARED_LIBRARY diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index fa195426e2..13f84710e2 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -177,7 +177,7 @@ void wxDC::DoSetClippingRegion(long cx, long cy, long cw, long ch) void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region) { - wxCHECK_RET( region.GetHRGN(), _T("invalid clipping region") ); + wxCHECK_RET( region.GetHRGN(), T("invalid clipping region") ); wxRect box = region.GetBox(); @@ -252,7 +252,7 @@ void wxDC::Clear() } else { - wxCHECK_RET( m_selectedBitmap.Ok(), _T("this DC can't be cleared") ); + wxCHECK_RET( m_selectedBitmap.Ok(), T("this DC can't be cleared") ); rect.left = 0; rect.top = 0; rect.right = m_selectedBitmap.GetWidth(); @@ -595,7 +595,7 @@ void wxDC::DoDrawBitmap( const wxBitmap &bmp, long x, long y, bool useMask ) HDC memdc = ::CreateCompatibleDC( cdc ); HBITMAP hbitmap = (HBITMAP) bmp.GetHBITMAP( ); - wxASSERT_MSG( hbitmap, _T("bitmap is ok but HBITMAP is NULL?") ); + wxASSERT_MSG( hbitmap, T("bitmap is ok but HBITMAP is NULL?") ); ::SelectObject( memdc, hbitmap ); ::BitBlt( cdc, x, y, bmp.GetWidth(), bmp.GetHeight(), memdc, 0, 0, SRCCOPY); @@ -718,7 +718,7 @@ void wxDC::SetFont(const wxFont& the_font) HFONT f = (HFONT) ::SelectObject(GetHdc(), (HFONT) m_font.GetResourceHandle()); if (f == (HFONT) NULL) { - wxLogDebug(_T("::SelectObject failed in wxDC::SetFont.")); + wxLogDebug(T("::SelectObject failed in wxDC::SetFont.")); } if (!m_oldFont) m_oldFont = (WXHFONT) f; diff --git a/src/msw/dcclient.cpp b/src/msw/dcclient.cpp index ea236015d5..d76f002aba 100644 --- a/src/msw/dcclient.cpp +++ b/src/msw/dcclient.cpp @@ -184,12 +184,12 @@ wxPaintDC::wxPaintDC() wxPaintDC::wxPaintDC(wxWindow *canvas) { - wxCHECK_RET( canvas, _T("NULL canvas in wxPaintDC ctor") ); + wxCHECK_RET( canvas, T("NULL canvas in wxPaintDC ctor") ); #ifdef __WXDEBUG__ if ( g_isPainting <= 0 ) { - wxFAIL_MSG( _T("wxPaintDC may be created only in EVT_PAINT handler!") ); + wxFAIL_MSG( T("wxPaintDC may be created only in EVT_PAINT handler!") ); return; } @@ -227,7 +227,7 @@ wxPaintDC::~wxPaintDC() size_t index; wxPaintDCInfo *info = FindInCache(&index); - wxCHECK_RET( info, _T("existing DC should have a cache entry") ); + wxCHECK_RET( info, T("existing DC should have a cache entry") ); if ( !--info->count ) { diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index 03e89a1c91..cf93c27c32 100644 --- a/src/msw/dcmemory.cpp +++ b/src/msw/dcmemory.cpp @@ -93,7 +93,7 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap) // a device context if (bitmap.GetSelectedInto() && (bitmap.GetSelectedInto() != this)) { - wxFatalError(_T("Error in wxMemoryDC::SelectObject\nBitmap is selected in another wxMemoryDC.\nDelete the first wxMemoryDC or use SelectObject(NULL)")); + wxFatalError(T("Error in wxMemoryDC::SelectObject\nBitmap is selected in another wxMemoryDC.\nDelete the first wxMemoryDC or use SelectObject(NULL)")); return; } @@ -122,7 +122,7 @@ void wxMemoryDC::SelectObject(const wxBitmap& bitmap) if (bm == ERROR) { - wxFatalError(_T("Error in wxMemoryDC::SelectObject\nBitmap may not be loaded, or may be selected in another wxMemoryDC.\nDelete the first wxMemoryDC to deselect bitmap.")); + wxFatalError(T("Error in wxMemoryDC::SelectObject\nBitmap may not be loaded, or may be selected in another wxMemoryDC.\nDelete the first wxMemoryDC to deselect bitmap.")); } else if (!m_oldBitmap) m_oldBitmap = (WXHBITMAP) bm; diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index fbd402eec5..0ec356c405 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -47,7 +47,7 @@ wxPrinterDC::wxPrinterDC(const wxString& driver_name, const wxString& device_nam { m_isInteractive = interactive; - if (!file.IsNull() && file != _T("")) + if (!file.IsNull() && file != T("")) m_printData.SetFilename(file); #if wxUSE_COMMON_DIALOGS @@ -82,9 +82,9 @@ wxPrinterDC::wxPrinterDC(const wxString& driver_name, const wxString& device_nam } else #endif - if ((!driver_name.IsNull() && driver_name != _T("")) && - (!device_name.IsNull() && device_name != _T("")) && - (!file.IsNull() && file != _T(""))) + if ((!driver_name.IsNull() && driver_name != T("")) && + (!device_name.IsNull() && device_name != T("")) && + (!file.IsNull() && file != T(""))) { m_hDC = (WXHDC) CreateDC(WXSTRINGCAST driver_name, WXSTRINGCAST device_name, WXSTRINGCAST file, NULL); m_ok = m_hDC ? TRUE: FALSE; @@ -184,7 +184,7 @@ bool wxPrinterDC::StartDoc(const wxString& message) if (ret <= 0) { DWORD lastError = GetLastError(); - wxLogDebug(_T("wxDC::StartDoc failed with error: %d\n"), lastError); + wxLogDebug(T("wxDC::StartDoc failed with error: %d\n"), lastError); } #endif @@ -262,7 +262,7 @@ static bool wxGetDefaultDeviceName(wxString& deviceName, wxString& portName) GlobalFree(pd.hDevMode); pd.hDevMode=NULL; } - return ( deviceName != _T("") ); + return ( deviceName != T("") ); } #if 0 @@ -354,7 +354,7 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) wxChar* deviceName; wxChar* portName = (wxChar*) NULL; // Obsolete in WIN32 - if (devNameStr == _T("")) + if (devNameStr == T("")) deviceName = (wxChar*) NULL; else deviceName = WXSTRINGCAST devNameStr; @@ -366,13 +366,13 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) if ( hDevMode ) lpDevMode = (DEVMODE*) GlobalLock(hDevMode); - if (devNameStr == _T("")) + if (devNameStr == T("")) { // Retrieve the default device name wxString portName; bool ret = wxGetDefaultDeviceName(devNameStr, portName); - wxASSERT_MSG( ret, _T("Could not get default device name.") ); + wxASSERT_MSG( ret, T("Could not get default device name.") ); deviceName = WXSTRINGCAST devNameStr; } diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index 9f652d12ec..039023005d 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -228,7 +228,7 @@ bool wxDDEServer::Create(const wxString& server_name) wxDDEServer::~wxDDEServer(void) { - if (m_serviceName != _T("")) + if (m_serviceName != T("")) { HSZ serviceName = DdeCreateStringHandle(DDEIdInst, WXSTRINGCAST m_serviceName, CP_WINANSI); if (DdeNameService(DDEIdInst, serviceName, NULL, DNS_UNREGISTER) == 0) @@ -742,64 +742,64 @@ void DDEPrintError(void) switch (DdeGetLastError(DDEIdInst)) { case DMLERR_ADVACKTIMEOUT: - err = _T("A request for a synchronous advise transaction has timed out."); + err = T("A request for a synchronous advise transaction has timed out."); break; case DMLERR_BUSY: - err = _T("The response to the transaction caused the DDE_FBUSY bit to be set."); + err = T("The response to the transaction caused the DDE_FBUSY bit to be set."); break; case DMLERR_DATAACKTIMEOUT: - err = _T("A request for a synchronous data transaction has timed out."); + err = T("A request for a synchronous data transaction has timed out."); break; case DMLERR_DLL_NOT_INITIALIZED: - err = _T("A DDEML function was called without first calling the DdeInitialize function,\n\ror an invalid instance identifier\n\rwas passed to a DDEML function."); + err = T("A DDEML function was called without first calling the DdeInitialize function,\n\ror an invalid instance identifier\n\rwas passed to a DDEML function."); break; case DMLERR_DLL_USAGE: - err = _T("An application initialized as APPCLASS_MONITOR has\n\rattempted to perform a DDE transaction,\n\ror an application initialized as APPCMD_CLIENTONLY has \n\rattempted to perform server transactions."); + err = T("An application initialized as APPCLASS_MONITOR has\n\rattempted to perform a DDE transaction,\n\ror an application initialized as APPCMD_CLIENTONLY has \n\rattempted to perform server transactions."); break; case DMLERR_EXECACKTIMEOUT: - err = _T("A request for a synchronous execute transaction has timed out."); + err = T("A request for a synchronous execute transaction has timed out."); break; case DMLERR_INVALIDPARAMETER: - err = _T("A parameter failed to be validated by the DDEML."); + err = T("A parameter failed to be validated by the DDEML."); break; case DMLERR_LOW_MEMORY: - err = _T("A DDEML application has created a prolonged race condition."); + err = T("A DDEML application has created a prolonged race condition."); break; case DMLERR_MEMORY_ERROR: - err = _T("A memory allocation failed."); + err = T("A memory allocation failed."); break; case DMLERR_NO_CONV_ESTABLISHED: - err = _T("A client's attempt to establish a conversation has failed."); + err = T("A client's attempt to establish a conversation has failed."); break; case DMLERR_NOTPROCESSED: - err = _T("A transaction failed."); + err = T("A transaction failed."); break; case DMLERR_POKEACKTIMEOUT: - err = _T("A request for a synchronous poke transaction has timed out."); + err = T("A request for a synchronous poke transaction has timed out."); break; case DMLERR_POSTMSG_FAILED: - err = _T("An internal call to the PostMessage function has failed. "); + err = T("An internal call to the PostMessage function has failed. "); break; case DMLERR_REENTRANCY: - err = _T("Reentrancy problem."); + err = T("Reentrancy problem."); break; case DMLERR_SERVER_DIED: - err = _T("A server-side transaction was attempted on a conversation\n\rthat was terminated by the client, or the server\n\rterminated before completing a transaction."); + err = T("A server-side transaction was attempted on a conversation\n\rthat was terminated by the client, or the server\n\rterminated before completing a transaction."); break; case DMLERR_SYS_ERROR: - err = _T("An internal error has occurred in the DDEML."); + err = T("An internal error has occurred in the DDEML."); break; case DMLERR_UNADVACKTIMEOUT: - err = _T("A request to end an advise transaction has timed out."); + err = T("A request to end an advise transaction has timed out."); break; case DMLERR_UNFOUND_QUEUE_ID: - err = _T("An invalid transaction identifier was passed to a DDEML function.\n\rOnce the application has returned from an XTYP_XACT_COMPLETE callback,\n\rthe transaction identifier for that callback is no longer valid."); + err = T("An invalid transaction identifier was passed to a DDEML function.\n\rOnce the application has returned from an XTYP_XACT_COMPLETE callback,\n\rthe transaction identifier for that callback is no longer valid."); break; default: - err = _T("Unrecognised error type."); + err = T("Unrecognised error type."); break; } - MessageBox((HWND) NULL, (LPCTSTR)err, _T("DDE Error"), MB_OK | MB_ICONINFORMATION); + MessageBox((HWND) NULL, (LPCTSTR)err, T("DDE Error"), MB_OK | MB_ICONINFORMATION); } #endif diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index d8ef9f1f46..8c3f4e9afa 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -124,11 +124,11 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, // otherwise it would look too strange) const wxChar *dlg; if ( style & wxRESIZE_BORDER ) - dlg = _T("wxResizeableDialog"); + dlg = T("wxResizeableDialog"); else if ( style & wxCAPTION ) - dlg = _T("wxCaptionDialog"); + dlg = T("wxCaptionDialog"); else - dlg = _T("wxNoCaptionDialog"); + dlg = T("wxNoCaptionDialog"); MSWCreate(m_windowId, parent, NULL, this, NULL, x, y, width, height, 0, // style is not used if we have dlg template diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index 3c17c47e14..81e4ed4288 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -637,11 +637,11 @@ bool wxDialUpManagerMSW::Dial(const wxString& nameOfISP, const wxString& password, bool async) { - wxCHECK_MSG( IsOk(), FALSE, _T("using uninitialized wxDialUpManager") ); + wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") ); if ( ms_hRasConnection ) { - wxFAIL_MSG(_T("there is already an active connection")); + wxFAIL_MSG(T("there is already an active connection")); return TRUE; } @@ -737,7 +737,7 @@ bool wxDialUpManagerMSW::CancelDialing() return FALSE; } - wxASSERT_MSG( ms_hRasConnection, _T("dialing but no connection?") ); + wxASSERT_MSG( ms_hRasConnection, T("dialing but no connection?") ); ms_dialer = NULL; @@ -746,7 +746,7 @@ bool wxDialUpManagerMSW::CancelDialing() bool wxDialUpManagerMSW::HangUp() { - wxCHECK_MSG( IsOk(), FALSE, _T("using uninitialized wxDialUpManager") ); + wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") ); // we may terminate either the connection we initiated or another one which // is active now @@ -783,7 +783,7 @@ bool wxDialUpManagerMSW::HangUp() bool wxDialUpManagerMSW::IsOnline() const { - wxCHECK_MSG( IsOk(), FALSE, _T("using uninitialized wxDialUpManager") ); + wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") ); if ( ms_userSpecifiedOnlineStatus != -1 ) { @@ -799,14 +799,14 @@ bool wxDialUpManagerMSW::IsOnline() const void wxDialUpManagerMSW::SetOnlineStatus(bool isOnline) { - wxCHECK_RET( IsOk(), _T("using uninitialized wxDialUpManager") ); + wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") ); ms_userSpecifiedOnlineStatus = isOnline; } bool wxDialUpManagerMSW::EnableAutoCheckOnlineStatus(size_t nSeconds) { - wxCHECK_MSG( IsOk(), FALSE, _T("using uninitialized wxDialUpManager") ); + wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") ); bool ok = ms_pfnRasConnectionNotification != 0; @@ -936,7 +936,7 @@ bool wxDialUpManagerMSW::EnableAutoCheckOnlineStatus(size_t nSeconds) if ( dwRet != 0 ) { - wxLogDebug(_T("RasConnectionNotification() failed: %s"), + wxLogDebug(T("RasConnectionNotification() failed: %s"), GetErrorString(dwRet)); CleanUpThreadData(); @@ -962,7 +962,7 @@ bool wxDialUpManagerMSW::EnableAutoCheckOnlineStatus(size_t nSeconds) void wxDialUpManagerMSW::DisableAutoCheckOnlineStatus() { - wxCHECK_RET( IsOk(), _T("using uninitialized wxDialUpManager") ); + wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") ); if ( m_hThread ) { @@ -986,7 +986,7 @@ void wxDialUpManagerMSW::DisableAutoCheckOnlineStatus() void wxDialUpManagerMSW::SetWellKnownHost(const wxString& WXUNUSED(hostname), int WXUNUSED(port)) { - wxCHECK_RET( IsOk(), _T("using uninitialized wxDialUpManager") ); + wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") ); // nothing to do - we don't use this } @@ -994,7 +994,7 @@ void wxDialUpManagerMSW::SetWellKnownHost(const wxString& WXUNUSED(hostname), void wxDialUpManagerMSW::SetConnectCommand(const wxString& WXUNUSED(dial), const wxString& WXUNUSED(hangup)) { - wxCHECK_RET( IsOk(), _T("using uninitialized wxDialUpManager") ); + wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") ); // nothing to do - we don't use this } @@ -1053,7 +1053,7 @@ static void WINAPI wxRasDialFunc(UINT unMsg, { wxDialUpManagerMSW *dialUpManager = wxDialUpManagerMSW::GetDialer(); - wxCHECK_RET( dialUpManager, _T("who started to dial then?") ); + wxCHECK_RET( dialUpManager, T("who started to dial then?") ); dialUpManager->OnDialProgress(rasconnstate, dwError); } diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 3d91a3250c..a2d7f69761 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -69,7 +69,7 @@ /* Header signatutes for various resources */ #define BFT_ICON 0x4349 /* 'IC' */ #define BFT_BITMAP 0x4d42 /* 'BM' */ -#define BFT_CURSOR 0x5450 /* 'PT' */ +#define BFT_CURSOR 0x5450 /* 'PT(' */ /* macro to determine if resource is a DIB */ #define ISDIB(bft) ((bft) == BFT_BITMAP) @@ -436,8 +436,8 @@ BOOL wxReadDIB(LPTSTR lpFileName, HBITMAP *bitmap, HPALETTE *palette) fh = OpenFile (wxFNCONV(lpFileName), &of, OF_READ); if (fh == -1) { - wsprintf(str,_T("Can't open file '%s'"), lpFileName); - MessageBox(NULL, str, _T("Error"), MB_ICONSTOP | MB_OK); + wsprintf(str,T("Can't open file '%s'"), lpFileName); + MessageBox(NULL, str, T("Error"), MB_ICONSTOP | MB_OK); return (0); } diff --git a/src/msw/dibutils.cpp b/src/msw/dibutils.cpp index 6736a42d66..cd99d6f028 100644 --- a/src/msw/dibutils.cpp +++ b/src/msw/dibutils.cpp @@ -48,7 +48,7 @@ #define BFT_ICON 0x4349 /* 'IC' */ #define BFT_BITMAP 0x4d42 /* 'BM' */ -#define BFT_CURSOR 0x5450 /* 'PT' */ +#define BFT_CURSOR 0x5450 /* 'PT(' */ #ifndef SEEK_CUR /* flags for _lseek */ diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index 667462e346..a23f964c4e 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -172,11 +172,11 @@ bool wxDragImage::Create(const wxListCtrl& listCtrl, long id) // Begin drag bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* WXUNUSED(window)) { - wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in BeginDrag.")); + wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in BeginDrag.")); bool ret = (ImageList_BeginDrag((HIMAGELIST) m_hImageList, 0, hotspot.x, hotspot.y) != 0); - wxASSERT_MSG( (ret), _T("BeginDrag failed.")); + wxASSERT_MSG( (ret), T("BeginDrag failed.")); if (!ret) return FALSE; @@ -186,7 +186,7 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* WXUNUSED(window)) // First add the cursor to the image list int cursorIndex = ImageList_AddIcon((HIMAGELIST) m_hImageList, (HICON) m_cursor.GetHCURSOR()); - wxASSERT_MSG( (cursorIndex != -1), _T("ImageList_AddIcon failed in BeginDrag.")); + wxASSERT_MSG( (cursorIndex != -1), T("ImageList_AddIcon failed in BeginDrag.")); if (cursorIndex != -1) { @@ -202,7 +202,7 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* WXUNUSED(window)) // End drag bool wxDragImage::EndDrag(wxWindow* WXUNUSED(window)) { - wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in EndDrag.")); + wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in EndDrag.")); ImageList_EndDrag(); @@ -215,7 +215,7 @@ bool wxDragImage::EndDrag(wxWindow* WXUNUSED(window)) // is non-NULL, or in screen coordinates if NULL. bool wxDragImage::Move(const wxPoint& pt, wxWindow* window) { - wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in Move.")); + wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in Move.")); // TODO: what coordinates are these in: window, client, or screen? bool ret = (ImageList_DragMove( pt.x, pt.y ) != 0); @@ -227,7 +227,7 @@ bool wxDragImage::Move(const wxPoint& pt, wxWindow* window) bool wxDragImage::Show(wxWindow* window) { - wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in Show.")); + wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in Show.")); HWND hWnd = 0; if (window) @@ -240,7 +240,7 @@ bool wxDragImage::Show(wxWindow* window) bool wxDragImage::Hide(wxWindow* window) { - wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in Hide.")); + wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in Hide.")); HWND hWnd = 0; if (window) diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index 6bf29addb8..5bddc8cf66 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -70,7 +70,7 @@ wxString wxFileSelector(const wxChar *title, wxString filter2; if ( defaultExtension && !filter ) - filter2 = wxString(_T("*.")) + defaultExtension; + filter2 = wxString(T("*.")) + defaultExtension; else if ( filter ) filter2 = filter; @@ -92,7 +92,7 @@ wxString wxFileSelector(const wxChar *title, for( unsigned int i = 0; i < filter2.Len(); i++ ) { - if( filter2.GetChar(i) == _T('|') ) + if( filter2.GetChar(i) == T('|') ) { // save the start index of the new filter unsigned int is = i++; @@ -101,7 +101,7 @@ wxString wxFileSelector(const wxChar *title, // find the end of the filter for( ; i < filter2.Len(); i++ ) { - if(filter2[i] == _T('|')) + if(filter2[i] == T('|')) break; } @@ -161,8 +161,8 @@ wxString wxFileSelectorEx(const wxChar *title, int y) { - wxFileDialog fileDialog(parent, title ? title : _T(""), defaultDir ? defaultDir : _T(""), - defaultFileName ? defaultFileName : _T(""), filter ? filter : _T(""), flags, wxPoint(x, y)); + wxFileDialog fileDialog(parent, title ? title : T(""), defaultDir ? defaultDir : T(""), + defaultFileName ? defaultFileName : T(""), filter ? filter : T(""), flags, wxPoint(x, y)); if ( fileDialog.ShowModal() == wxID_OK ) { @@ -181,7 +181,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, m_message = message; m_dialogStyle = style; m_parent = parent; - m_path = _T(""); + m_path = T(""); m_fileName = defaultFileName; m_dir = defaultDir; m_wildCard = wildCard; @@ -196,8 +196,8 @@ int wxFileDialog::ShowModal(void) static wxChar fileNameBuffer [ MAXPATH ]; // the file-name wxChar titleBuffer [ MAXFILE+1+MAXEXT ]; // the file-name, without path - *fileNameBuffer = _T('\0'); - *titleBuffer = _T('\0'); + *fileNameBuffer = T('\0'); + *titleBuffer = T('\0'); long msw_flags = 0; if ( (m_dialogStyle & wxHIDE_READONLY) || (m_dialogStyle & wxSAVE) ) @@ -228,8 +228,8 @@ int wxFileDialog::ShowModal(void) size_t i = 0; size_t len = m_dir.Length(); for (i = 0; i < len; i++) - if (m_dir[i] == _T('/')) - m_dir[i] = _T('\\'); + if (m_dir[i] == T('/')) + m_dir[i] = T('\\'); of.lpstrInitialDir = m_dir.c_str(); @@ -251,12 +251,12 @@ int wxFileDialog::ShowModal(void) wxString theFilter; if ( wxStrlen(m_wildCard) == 0 ) - theFilter = wxString(_T("*.*")); + theFilter = wxString(T("*.*")); else theFilter = m_wildCard ; wxString filterBuffer; - if ( !wxStrchr( theFilter, _T('|') ) ) { // only one filter ==> default text + if ( !wxStrchr( theFilter, T('|') ) ) { // only one filter ==> default text filterBuffer.Printf(_("Files (%s)|%s"), theFilter.c_str(), theFilter.c_str()); } @@ -265,11 +265,11 @@ int wxFileDialog::ShowModal(void) } - filterBuffer += _T("|"); + filterBuffer += T("|"); // Replace | with \0 for (i = 0; i < filterBuffer.Len(); i++ ) { - if ( filterBuffer.GetChar(i) == _T('|') ) { - filterBuffer[i] = _T('\0'); + if ( filterBuffer.GetChar(i) == T('|') ) { + filterBuffer[i] = T('\0'); } } @@ -279,7 +279,7 @@ int wxFileDialog::ShowModal(void) //=== Setting defaultFileName >>========================================= wxStrncpy( fileNameBuffer, (const wxChar *)m_fileName, MAXPATH-1 ); - fileNameBuffer[ MAXPATH-1 ] = _T('\0'); + fileNameBuffer[ MAXPATH-1 ] = T('\0'); of.lpstrFile = fileNameBuffer; // holds returned filename of.nMaxFile = MAXPATH; @@ -297,7 +297,7 @@ int wxFileDialog::ShowModal(void) m_filterIndex = (int)of.nFilterIndex; - if ( of.nFileExtension && fileNameBuffer[ of.nFileExtension-1] != _T('.') ) + if ( of.nFileExtension && fileNameBuffer[ of.nFileExtension-1] != T('.') ) { // user has typed an filename // without an extension: @@ -308,19 +308,19 @@ int wxFileDialog::ShowModal(void) extension = extension + wxStrlen( extension ) +1; } - extension = wxStrrchr( extension, _T('.') ); + extension = wxStrrchr( extension, T('.') ); if ( extension // != "blabla" - && !wxStrrchr( extension, _T('*') ) // != "blabla.*" - && !wxStrrchr( extension, _T('?') ) // != "blabla.?" + && !wxStrrchr( extension, T('*') ) // != "blabla.*" + && !wxStrrchr( extension, T('?') ) // != "blabla.?" && extension[1] // != "blabla." - && extension[1] != _T(' ') ) // != "blabla. " + && extension[1] != T(' ') ) // != "blabla. " { // now concat extension to the fileName: m_fileName = wxString(fileNameBuffer) + extension; int len = wxStrlen( fileNameBuffer ); wxStrncpy( fileNameBuffer + len, extension, MAXPATH - len ); - fileNameBuffer[ MAXPATH -1 ] = _T('\0'); + fileNameBuffer[ MAXPATH -1 ] = T('\0'); } } @@ -352,7 +352,7 @@ int wxFileDialog::ShowModal(void) if ( dwErr != 0 ) { // this msg is only for developers - wxLogError(_T("Common dialog failed with error code %0lx."), + wxLogError(T("Common dialog failed with error code %0lx."), dwErr); } //else: it was just cancelled @@ -378,11 +378,11 @@ wxString wxDefaultFileSelector(bool load, prompt.Printf(str, what); const wxChar *ext = extension; - if (*ext == _T('.')) + if (*ext == T('.')) ext++; wxString wild; - wild.Printf(_T("*.%s"), ext); + wild.Printf(T("*.%s"), ext); return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent); } diff --git a/src/msw/font.cpp b/src/msw/font.cpp index c7a304f445..6f1ea88cf8 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -200,7 +200,7 @@ bool wxFont::RealizeResource() { // VZ: the old code returned FALSE in this case, but it doesn't seem // to make sense because the font _was_ created - wxLogDebug(_T("Calling wxFont::RealizeResource() twice")); + wxLogDebug(T("Calling wxFont::RealizeResource() twice")); return TRUE; } @@ -212,7 +212,7 @@ bool wxFont::RealizeResource() { case wxSCRIPT: ff_family = FF_SCRIPT ; - ff_face = _T("Script") ; + ff_face = T("Script") ; break ; case wxDECORATIVE: @@ -221,24 +221,24 @@ bool wxFont::RealizeResource() case wxROMAN: ff_family = FF_ROMAN; - ff_face = _T("Times New Roman") ; + ff_face = T("Times New Roman") ; break; case wxTELETYPE: case wxMODERN: ff_family = FF_MODERN; - ff_face = _T("Courier New") ; + ff_face = T("Courier New") ; break; case wxSWISS: ff_family = FF_SWISS; - ff_face = _T("Arial") ; + ff_face = T("Arial") ; break; case wxDEFAULT: default: ff_family = FF_SWISS; - ff_face = _T("Arial") ; + ff_face = T("Arial") ; } BYTE ff_italic; @@ -250,7 +250,7 @@ bool wxFont::RealizeResource() break; default: - wxFAIL_MSG(_T("unknown font slant")); + wxFAIL_MSG(T("unknown font slant")); // fall through case wxNORMAL: @@ -261,7 +261,7 @@ bool wxFont::RealizeResource() switch ( M_FONTDATA->m_weight ) { default: - wxFAIL_MSG(_T("unknown font weight")); + wxFAIL_MSG(T("unknown font weight")); // fall through case wxNORMAL: @@ -383,7 +383,7 @@ bool wxFont::RealizeResource() break; default: - wxFAIL_MSG(_T("unsupported encoding")); + wxFAIL_MSG(T("unsupported encoding")); // fall through case wxFONTENCODING_SYSTEM: diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 54215fde43..9e41888e34 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -363,7 +363,7 @@ wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id, { // VZ: calling CreateStatusBar twice is an error - why anyone would do it? wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, - _T("recreating status bar in wxFrame") ); + T("recreating status bar in wxFrame") ); m_frameStatusBar = OnCreateStatusBar(number, style, id, name); @@ -378,14 +378,14 @@ wxStatusBar* wxFrame::CreateStatusBar(int number, long style, wxWindowID id, void wxFrame::SetStatusText(const wxString& text, int number) { - wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set text for") ); + wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set text for") ); m_frameStatusBar->SetStatusText(text, number); } void wxFrame::SetStatusWidths(int n, const int widths_field[]) { - wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set widths for") ); + wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set widths for") ); m_frameStatusBar->SetStatusWidths(n, widths_field); PositionStatusBar(); @@ -429,7 +429,7 @@ void wxFrame::SetMenuBar(wxMenuBar *menu_bar) return; } - wxCHECK_RET( !menu_bar->GetFrame(), _T("this menubar is already attached") ); + wxCHECK_RET( !menu_bar->GetFrame(), T("this menubar is already attached") ); if (m_frameMenuBar) delete m_frameMenuBar; @@ -733,7 +733,7 @@ void wxFrame::ClientToScreen(int *x, int *y) const wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name) { wxCHECK_MSG( m_frameToolBar == NULL, FALSE, - _T("recreating toolbar in wxFrame") ); + T("recreating toolbar in wxFrame") ); wxToolBar* toolBar = OnCreateToolBar(style, id, name); if (toolBar) diff --git a/src/msw/gaugemsw.cpp b/src/msw/gaugemsw.cpp index 1d46d463d3..0a06c08f03 100644 --- a/src/msw/gaugemsw.cpp +++ b/src/msw/gaugemsw.cpp @@ -107,7 +107,7 @@ bool wxGaugeMSW::Create(wxWindow *parent, wxWindowID id, msFlags |= ZYZGS_3D; HWND wx_button = - CreateWindowEx(MakeExtendedStyle(m_windowStyle), _T("zYzGauge"), NULL, msFlags, + CreateWindowEx(MakeExtendedStyle(m_windowStyle), T("zYzGauge"), NULL, msFlags, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); @@ -642,7 +642,7 @@ void FAR PASCAL Draw3DLine(HDC hdc, WORD x, WORD y, WORD nLen, /* static global variables */ -static wxChar gszzYzGaugeClass[] = _T("zYzGauge"); +static wxChar gszzYzGaugeClass[] = T("zYzGauge"); /* window word position definitions */ @@ -754,7 +754,7 @@ BOOL FAR PASCAL gaugeInit(HINSTANCE hInstance) /* Get a DC to determine whether device is mono or not, and set * default foreground/background colors as appropriate. */ - hdc = CreateIC(_T("DISPLAY"), NULL, NULL, 0L) ; + hdc = CreateIC(T("DISPLAY"), NULL, NULL, 0L) ; if (hdc) { /* check for mono-display */ @@ -909,7 +909,7 @@ static void PASCAL gaugePaint(HWND hwnd, HDC hdc) hFont = (HFONT) SelectObject(hdc, pgauge->hFont); /* build up a string to blit out--ie the meaning of life: "42%" */ - wsprintf(ach, _T("%3d%%"), (WORD)((DWORD)iPos * 100 / iRange)); + wsprintf(ach, T("%3d%%"), (WORD)((DWORD)iPos * 100 / iRange)); /* Win32s has no GetTextExtent(); let's try GetTextExtentPoint() instead */ #if defined(__WIN32__) GetTextExtentPoint(hdc, ach, wGomerX = lstrlen(ach), &size); diff --git a/src/msw/helpwin.cpp b/src/msw/helpwin.cpp index f5d4860472..835aeb48c2 100644 --- a/src/msw/helpwin.cpp +++ b/src/msw/helpwin.cpp @@ -68,12 +68,12 @@ bool wxWinHelpController::LoadFile(const wxString& file) bool wxWinHelpController::DisplayContents(void) { - if (m_helpFile == _T("")) return FALSE; + if (m_helpFile == T("")) return FALSE; wxString str = m_helpFile; size_t len = str.Length(); - if (!(str[(size_t)(len-1)] == _T('p') && str[(size_t)(len-2)] == _T('l') && str[(size_t)(len-3)] == _T('h') && str[(size_t)(len-4)] == _T('.'))) - str += _T(".hlp"); + if (!(str[(size_t)(len-1)] == T('p') && str[(size_t)(len-2)] == T('l') && str[(size_t)(len-3)] == T('h') && str[(size_t)(len-4)] == T('.'))) + str += T(".hlp"); if (wxTheApp->GetTopWindow()) { @@ -90,12 +90,12 @@ bool wxWinHelpController::DisplayContents(void) bool wxWinHelpController::DisplaySection(int section) { // Use context number - if (m_helpFile == _T("")) return FALSE; + if (m_helpFile == T("")) return FALSE; wxString str = m_helpFile; size_t len = str.Length(); - if (!(str[(size_t)(len-1)] == _T('p') && str[(size_t)(len-2)] == _T('l') && str[(size_t)(len-3)] == _T('h') && str[(size_t)(len-4)] == _T('.'))) - str += _T(".hlp"); + if (!(str[(size_t)(len-1)] == T('p') && str[(size_t)(len-2)] == T('l') && str[(size_t)(len-3)] == T('h') && str[(size_t)(len-4)] == T('.'))) + str += T(".hlp"); if (wxTheApp->GetTopWindow()) { @@ -108,12 +108,12 @@ bool wxWinHelpController::DisplaySection(int section) bool wxWinHelpController::DisplayBlock(long block) { // Use context number -- a very rough equivalent to block id! - if (m_helpFile == _T("")) return FALSE; + if (m_helpFile == T("")) return FALSE; wxString str = m_helpFile; size_t len = str.Length(); if (!(str[(size_t)(len-1)] == 'p' && str[(size_t)(len-2)] == 'l' && str[(size_t)(len-3)] == 'h' && str[(size_t)(len-4)] == '.')) - str += _T(".hlp"); + str += T(".hlp"); if (wxTheApp->GetTopWindow()) { @@ -125,12 +125,12 @@ bool wxWinHelpController::DisplayBlock(long block) bool wxWinHelpController::KeywordSearch(const wxString& k) { - if (m_helpFile == _T("")) return FALSE; + if (m_helpFile == T("")) return FALSE; wxString str = m_helpFile; size_t len = str.Length(); - if (!(str[(size_t)(len-1)] == _T('p') && str[(size_t)(len-2)] == _T('l') && str[(size_t)(len-3)] == _T('h') && str[(size_t)(len-4)] == _T('.'))) - str += _T(".hlp"); + if (!(str[(size_t)(len-1)] == T('p') && str[(size_t)(len-2)] == T('l') && str[(size_t)(len-3)] == T('h') && str[(size_t)(len-4)] == T('.'))) + str += T(".hlp"); if (wxTheApp->GetTopWindow()) { diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 02d55e900d..6d50248628 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -133,7 +133,7 @@ bool wxListBox::MSWCommand(WXUINT param, WXWORD WXUNUSED(id)) event.m_commandInt = aSelections[0] ; event.m_clientData = GetClientData(event.m_commandInt); wxString str(GetString(event.m_commandInt)); - if (str != _T("")) + if (str != T("")) { event.m_commandString = str; } @@ -232,13 +232,13 @@ bool wxListBox::Create(wxWindow *parent, wstyle |= WS_BORDER; } - m_hWnd = (WXHWND)::CreateWindowEx(exStyle, _T("LISTBOX"), NULL, + m_hWnd = (WXHWND)::CreateWindowEx(exStyle, T("LISTBOX"), NULL, wstyle | WS_CHILD, 0, 0, 0, 0, (HWND)parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create listbox") ); + wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create listbox") ); #if wxUSE_CTL3D if (want3D) @@ -287,7 +287,7 @@ void wxListBox::SetupColours() void wxListBox::SetFirstItem(int N) { wxCHECK_RET( N >= 0 && N < m_noItems, - _T("invalid index in wxListBox::SetFirstItem") ); + T("invalid index in wxListBox::SetFirstItem") ); SendMessage(GetHwnd(),LB_SETTOPINDEX,(WPARAM)N,(LPARAM)0) ; } @@ -303,7 +303,7 @@ void wxListBox::SetFirstItem(const wxString& s) void wxListBox::Delete(int N) { wxCHECK_RET( N >= 0 && N < m_noItems, - _T("invalid index in wxListBox::Delete") ); + T("invalid index in wxListBox::Delete") ); SendMessage(GetHwnd(), LB_DELETESTRING, N, 0); m_noItems--; @@ -337,7 +337,7 @@ void wxListBox::Append(const wxString& item, void *Client_data) if ( m_windowStyle & wxLB_OWNERDRAW ) { // client data must be pointer to wxOwnerDrawn, otherwise we would crash // in OnMeasure/OnDraw. - wxFAIL_MSG(_T("Can't use client data with owner-drawn listboxes")); + wxFAIL_MSG(T("Can't use client data with owner-drawn listboxes")); } else #endif @@ -377,7 +377,7 @@ void wxListBox::Set(int n, const wxString *choices, void** clientData) ListBox_SetItemData(GetHwnd(), ui, pNewItem); wxASSERT_MSG(clientData[ui] == NULL, - _T("Can't use client data with owner-drawn listboxes")); + T("Can't use client data with owner-drawn listboxes")); } } #endif @@ -415,7 +415,7 @@ void wxListBox::Clear() void wxListBox::SetSelection(int N, bool select) { wxCHECK_RET( N >= 0 && N < m_noItems, - _T("invalid index in wxListBox::SetSelection") ); + T("invalid index in wxListBox::SetSelection") ); if ((m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED)) SendMessage(GetHwnd(), LB_SETSEL, select, N); @@ -431,7 +431,7 @@ void wxListBox::SetSelection(int N, bool select) bool wxListBox::Selected(int N) const { wxCHECK_MSG( N >= 0 && N < m_noItems, FALSE, - _T("invalid index in wxListBox::Selected") ); + T("invalid index in wxListBox::Selected") ); return SendMessage(GetHwnd(), LB_GETSEL, N, 0) == 0 ? FALSE : TRUE; } @@ -439,7 +439,7 @@ bool wxListBox::Selected(int N) const void wxListBox::Deselect(int N) { wxCHECK_RET( N >= 0 && N < m_noItems, - _T("invalid index in wxListBox::Deselect") ); + T("invalid index in wxListBox::Deselect") ); if ((m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED)) SendMessage(GetHwnd(), LB_SETSEL, FALSE, N); @@ -448,7 +448,7 @@ void wxListBox::Deselect(int N) void *wxListBox::GetClientData(int N) const { wxCHECK_MSG( N >= 0 && N < m_noItems, NULL, - _T("invalid index in wxListBox::GetClientData") ); + T("invalid index in wxListBox::GetClientData") ); return (void *)SendMessage(GetHwnd(), LB_GETITEMDATA, N, 0); } @@ -456,10 +456,10 @@ void *wxListBox::GetClientData(int N) const void wxListBox::SetClientData(int N, void *Client_data) { wxCHECK_RET( N >= 0 && N < m_noItems, - _T("invalid index in wxListBox::SetClientData") ); + T("invalid index in wxListBox::SetClientData") ); if ( ListBox_SetItemData(GetHwnd(), N, Client_data) == LB_ERR ) - wxLogDebug(_T("LB_SETITEMDATA failed")); + wxLogDebug(T("LB_SETITEMDATA failed")); } // Return number of selections and an array of selected integers @@ -473,7 +473,7 @@ int wxListBox::GetSelections(wxArrayInt& aSelections) const if (no_sel != 0) { int *selections = new int[no_sel]; if ( ListBox_GetSelItems(GetHwnd(), no_sel, selections) == LB_ERR ) { - wxFAIL_MSG(_T("This listbox can't have single-selection style!")); + wxFAIL_MSG(T("This listbox can't have single-selection style!")); } aSelections.Alloc(no_sel); @@ -499,7 +499,7 @@ int wxListBox::GetSelection() const wxCHECK_MSG( !(m_windowStyle & wxLB_MULTIPLE) && !(m_windowStyle & wxLB_EXTENDED), -1, - _T("GetSelection() can't be used with multiple-selection " + T("GetSelection() can't be used with multiple-selection " "listboxes, use GetSelections() instead.") ); return ListBox_GetCurSel(GetHwnd()); @@ -509,7 +509,7 @@ int wxListBox::GetSelection() const wxString wxListBox::GetString(int N) const { wxCHECK_MSG( N >= 0 && N < m_noItems, "", - _T("invalid index in wxListBox::GetClientData") ); + T("invalid index in wxListBox::GetClientData") ); int len = ListBox_GetTextLen(GetHwnd(), N); @@ -531,7 +531,7 @@ void wxListBox::SetHorizontalExtent(const wxString& s) return; TEXTMETRIC lpTextMetric; - if (s != _T("")) + if (s != T("")) { int existingExtent = (int)SendMessage(GetHwnd(), LB_GETHORIZONTALEXTENT, 0, 0L); HDC dc = GetWindowDC(GetHwnd()); @@ -584,20 +584,20 @@ void wxListBox::InsertItems(int nItems, const wxString items[], int pos) { wxCHECK_RET( pos >= 0 && pos <= m_noItems, - _T("invalid index in wxListBox::InsertItems") ); + T("invalid index in wxListBox::InsertItems") ); int i; for (i = 0; i < nItems; i++) ListBox_InsertString(GetHwnd(), i + pos, items[i]); m_noItems += nItems; - SetHorizontalExtent(_T("")); + SetHorizontalExtent(T("")); } void wxListBox::SetString(int N, const wxString& s) { wxCHECK_RET( N >= 0 && N < m_noItems, - _T("invalid index in wxListBox::SetString") ); + T("invalid index in wxListBox::SetString") ); int sel = -1; if (!(m_windowStyle & wxLB_MULTIPLE) && !(m_windowStyle & wxLB_EXTENDED)) @@ -754,7 +754,7 @@ bool wxListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item) MEASUREITEMSTRUCT *pStruct = (MEASUREITEMSTRUCT *)item; wxDC dc; - dc.SetHDC((WXHDC)CreateIC(_T("DISPLAY"), NULL, NULL, 0)); + dc.SetHDC((WXHDC)CreateIC(T("DISPLAY"), NULL, NULL, 0)); dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_ANSI_VAR_FONT)); pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE; diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index afc8bb65ed..0d71e4aead 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -149,7 +149,7 @@ bool wxListCtrl::DoCreateControl(int x, int y, int w, int h) // Create the ListView control. m_hWnd = (WXHWND)CreateWindowEx(exStyle, WC_LISTVIEW, - _T(""), + T(""), wstyle, x, y, w, h, GetWinHwnd(GetParent()), @@ -159,7 +159,7 @@ bool wxListCtrl::DoCreateControl(int x, int y, int w, int h) if ( !m_hWnd ) { - wxLogError(_T("Can't create list control window.")); + wxLogError(T("Can't create list control window.")); return FALSE; } @@ -871,7 +871,7 @@ bool wxListCtrl::DeleteAllColumns() m_colCount--; } - wxASSERT_MSG( m_colCount == 0, _T("no columns should be left") ); + wxASSERT_MSG( m_colCount == 0, T("no columns should be left") ); return TRUE; } @@ -1116,7 +1116,7 @@ long wxListCtrl::InsertColumn(long col, wxListItem& item) } else { - wxLogDebug(_T("Failed to insert the column '%s' into listview!"), + wxLogDebug(T("Failed to insert the column '%s' into listview!"), lvCol.pszText); } diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index cfd5d647ce..3f371aa6d7 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -174,7 +174,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent, int width = size.x; int height = size.y; - m_windowMenu = (WXHMENU) ::LoadMenu(wxGetInstance(), _T("wxWindowMenu")); + m_windowMenu = (WXHMENU) ::LoadMenu(wxGetInstance(), T("wxWindowMenu")); DWORD msflags = WS_OVERLAPPED; if (style & wxMINIMIZE_BOX) @@ -505,7 +505,7 @@ bool wxMDIParentFrame::HandleCommand(WXWORD id, WXWORD cmd, WXHWND hwnd) { // this shouldn't happen because it means that our messages are being // lost (they're not sent to the parent frame nor to the children) - wxFAIL_MSG(_T("MDI parent frame is not active, " + wxFAIL_MSG(T("MDI parent frame is not active, " "yet there is no active MDI child?")); } @@ -926,7 +926,7 @@ bool wxMDIChildFrame::HandleMDIActivate(long WXUNUSED(activate), else if ( m_hWnd == hwndDeact ) { wxASSERT_MSG( parent->m_currentChild == this, - _T("can't deactivate MDI child which wasn't active!") ); + T("can't deactivate MDI child which wasn't active!") ); activated = FALSE; parent->m_currentChild = NULL; @@ -1099,7 +1099,7 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) m_hWnd = (WXHWND)::CreateWindowEx ( exStyle, - _T("MDICLIENT"), + T("MDICLIENT("), NULL, msStyle, 0, 0, 0, 0, @@ -1152,7 +1152,7 @@ static void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow) // update menu bar of the parent window wxWindow *parent = win->GetParent(); - wxCHECK_RET( parent, _T("MDI client without parent frame? weird...") ); + wxCHECK_RET( parent, T("MDI client without parent frame? weird...") ); ::DrawMenuBar(GetWinHwnd(parent)); } @@ -1169,23 +1169,23 @@ static void InsertWindowMenu(wxWindow *win, WXHMENU menu, HMENU subMenu) int chars = GetMenuString(hmenu, i, buf, WXSIZEOF(buf), MF_BYPOSITION); if ( chars == 0 ) { - wxLogLastError(_T("GetMenuString")); + wxLogLastError(T("GetMenuString")); continue; } - if ( wxStripMenuCodes(wxString(buf)).IsSameAs(_T("Help")) ) + if ( wxStripMenuCodes(wxString(buf)).IsSameAs(T("Help")) ) { success = TRUE; ::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING, - (UINT)subMenu, _T("&Window")); + (UINT)subMenu, T("&Window")); break; } } if ( !success ) { - ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _T("&Window")); + ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, T("&Window")); } MDISetMenu(win, hmenu, subMenu); diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 8ff9016a50..f36cf6573d 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -138,12 +138,12 @@ void wxMenu::Break() // function appends a new item or submenu to the menu void wxMenu::Append(wxMenuItem *pItem) { - wxCHECK_RET( pItem != NULL, _T("can't append NULL item to the menu") ); + wxCHECK_RET( pItem != NULL, T("can't append NULL item to the menu") ); #if wxUSE_ACCEL // check for accelerators: they are given after '\t' wxString label = pItem->GetName(); - int posTab = label.Find(_T('\t')); + int posTab = label.Find(T('\t')); if ( posTab != wxNOT_FOUND ) { // parse the accelerator string int keyCode = 0; @@ -158,7 +158,7 @@ void wxMenu::Append(wxMenuItem *pItem) else if ( current == _("shift") ) accelFlags |= wxACCEL_SHIFT; else { - wxLogDebug(_T("Unknown accel modifier: '%s'"), + wxLogDebug(T("Unknown accel modifier: '%s'"), current.c_str()); } @@ -170,7 +170,7 @@ void wxMenu::Append(wxMenuItem *pItem) } if ( current.IsEmpty() ) { - wxLogDebug(_T("No accel key found, accel string ignored.")); + wxLogDebug(T("No accel key found, accel string ignored.")); } else { if ( current.Len() == 1 ) { @@ -183,12 +183,12 @@ void wxMenu::Append(wxMenuItem *pItem) (current.Len() == 2 || (current.Len() == 3 && isdigit(current[2U]))) ) { int n; - wxSscanf(current.c_str() + 1, _T("%d"), &n); + wxSscanf(current.c_str() + 1, T("%d"), &n); keyCode = VK_F1 + n - 1; } else { - wxLogDebug(_T("Unrecognized accel key '%s', accel " + wxLogDebug(T("Unrecognized accel key '%s', accel " "string ignored."), current.c_str()); } } @@ -268,7 +268,7 @@ void wxMenu::Append(wxMenuItem *pItem) if ( !SetMenuItemInfo(GetHmenu(), (unsigned)id, FALSE, &mii) ) { - wxLogLastError(_T("SetMenuItemInfo")); + wxLogLastError(T("SetMenuItemInfo")); } } #endif // __WIN32__ @@ -315,7 +315,7 @@ void wxMenu::Delete(int id) break; } - wxCHECK_RET( node, _T("wxMenu::Delete(): item doesn't exist") ); + wxCHECK_RET( node, T("wxMenu::Delete(): item doesn't exist") ); HMENU menu = GetHmenu(); @@ -368,7 +368,7 @@ size_t wxMenu::CopyAccels(wxAcceleratorEntry *accels) const void wxMenu::Enable(int id, bool Flag) { wxMenuItem *item = FindItemForId(id); - wxCHECK_RET( item != NULL, _T("can't enable non-existing menu item") ); + wxCHECK_RET( item != NULL, T("can't enable non-existing menu item") ); item->Enable(Flag); } @@ -376,7 +376,7 @@ void wxMenu::Enable(int id, bool Flag) bool wxMenu::IsEnabled(int id) const { wxMenuItem *item = FindItemForId(id); - wxCHECK_MSG( item != NULL, FALSE, _T("invalid item id") ); + wxCHECK_MSG( item != NULL, FALSE, T("invalid item id") ); return item->IsEnabled(); } @@ -384,7 +384,7 @@ bool wxMenu::IsEnabled(int id) const void wxMenu::Check(int id, bool Flag) { wxMenuItem *item = FindItemForId(id); - wxCHECK_RET( item != NULL, _T("can't get status of non-existing menu item") ); + wxCHECK_RET( item != NULL, T("can't get status of non-existing menu item") ); item->Check(Flag); } @@ -392,7 +392,7 @@ void wxMenu::Check(int id, bool Flag) bool wxMenu::IsChecked(int id) const { wxMenuItem *item = FindItemForId(id); - wxCHECK_MSG( item != NULL, FALSE, _T("invalid item id") ); + wxCHECK_MSG( item != NULL, FALSE, T("invalid item id") ); return item->IsChecked(); } @@ -400,7 +400,7 @@ bool wxMenu::IsChecked(int id) const void wxMenu::SetLabel(int id, const wxString& label) { wxMenuItem *item = FindItemForId(id) ; - wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") ); + wxCHECK_RET( item, T("wxMenu::SetLabel: no such item") ); item->SetName(label); } @@ -412,7 +412,7 @@ wxString wxMenu::GetLabel(int id) const if (pItem) label = pItem->GetName() ; else - wxFAIL_MSG(_T("wxMenu::GetLabel: item doesn't exist")); + wxFAIL_MSG(T("wxMenu::GetLabel: item doesn't exist")); return label; } @@ -423,7 +423,7 @@ void wxMenu::SetHelpString(int itemId, const wxString& helpString) if (item) item->SetHelp(helpString); else - wxFAIL_MSG(_T("wxMenu::SetHelpString: item doesn't exist")); + wxFAIL_MSG(T("wxMenu::SetHelpString: item doesn't exist")); } wxString wxMenu::GetHelpString (int itemId) const @@ -433,7 +433,7 @@ wxString wxMenu::GetHelpString (int itemId) const if (item) help = item->GetHelp(); else - wxFAIL_MSG(_T("wxMenu::GetHelpString: item doesn't exist")); + wxFAIL_MSG(T("wxMenu::GetHelpString: item doesn't exist")); return help; } @@ -457,7 +457,7 @@ void wxMenu::SetTitle(const wxString& label) (unsigned)idMenuTitle, m_title) || !InsertMenu(hMenu, 1u, MF_BYPOSITION, (unsigned)-1, NULL) ) { - wxLogLastError(_T("InsertMenu")); + wxLogLastError(T("InsertMenu")); } } } @@ -618,7 +618,7 @@ void wxMenu::Attach(wxMenuBar *menubar) { // menu can be in at most one menubar because otherwise they would both // delete the menu pointer - wxASSERT_MSG( !m_menuBar, _T("menu belongs to 2 menubars, expect a crash") ); + wxASSERT_MSG( !m_menuBar, T("menu belongs to 2 menubars, expect a crash") ); m_menuBar = menubar; m_savehMenu = m_hMenu; @@ -627,7 +627,7 @@ void wxMenu::Attach(wxMenuBar *menubar) void wxMenu::Detach() { - wxASSERT_MSG( m_menuBar, _T("can't detach menu if it's not attached") ); + wxASSERT_MSG( m_menuBar, T("can't detach menu if it's not attached") ); m_hMenu = m_savehMenu; m_savehMenu = 0; @@ -690,7 +690,7 @@ wxMenuBar::~wxMenuBar() void wxMenuBar::Refresh() { - wxCHECK_RET( m_menuBarFrame, _T("can't refresh a menubar withotu a frame") ); + wxCHECK_RET( m_menuBarFrame, T("can't refresh a menubar withotu a frame") ); DrawMenuBar((HWND)m_menuBarFrame->GetHWND()) ; } @@ -700,7 +700,7 @@ WXHMENU wxMenuBar::Create() if (m_hMenu != 0 ) return m_hMenu; - wxCHECK_MSG( !m_hMenu, TRUE, _T("menubar already created") ); + wxCHECK_MSG( !m_hMenu, TRUE, T("menubar already created") ); m_hMenu = (WXHMENU)::CreateMenu(); @@ -735,7 +735,7 @@ void wxMenuBar::Enable(int id, bool enable) wxMenu *itemMenu = NULL; wxMenuItem *item = FindItemForId(id, &itemMenu) ; - wxCHECK_RET( item, _T("attempt to enable an item which doesn't exist") ); + wxCHECK_RET( item, T("attempt to enable an item which doesn't exist") ); item->Enable(enable); } @@ -754,8 +754,8 @@ void wxMenuBar::Check(int id, bool check) wxMenu *itemMenu = NULL; wxMenuItem *item = FindItemForId(id, &itemMenu) ; - wxCHECK_RET( item, _T("attempt to check an item which doesn't exist") ); - wxCHECK_RET( item->IsCheckable(), _T("attempt to check an uncheckable item") ); + wxCHECK_RET( item, T("attempt to check an item which doesn't exist") ); + wxCHECK_RET( item->IsCheckable(), T("attempt to check an uncheckable item") ); item->Check(check); } @@ -765,7 +765,7 @@ bool wxMenuBar::IsChecked(int id) const wxMenu *itemMenu = NULL; wxMenuItem *item = FindItemForId(id, &itemMenu) ; - wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked(): no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsChecked(): no such item") ); int flag = ::GetMenuState(GetHmenuOf(itemMenu), id, MF_BYCOMMAND); @@ -777,7 +777,7 @@ bool wxMenuBar::IsEnabled(int id) const wxMenu *itemMenu = NULL; wxMenuItem *item = FindItemForId(id, &itemMenu) ; - wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled(): no such item") ); + wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsEnabled(): no such item") ); int flag = ::GetMenuState(GetHmenuOf(itemMenu), id, MF_BYCOMMAND) ; @@ -790,7 +790,7 @@ void wxMenuBar::SetLabel(int id, const wxString& label) wxMenu *itemMenu = NULL; wxMenuItem *item = FindItemForId(id, &itemMenu) ; - wxCHECK_RET( item, _T("wxMenuBar::SetLabel(): no such item") ); + wxCHECK_RET( item, T("wxMenuBar::SetLabel(): no such item") ); item->SetName(label); } @@ -800,7 +800,7 @@ wxString wxMenuBar::GetLabel(int id) const wxMenu *itemMenu = NULL; wxMenuItem *item = FindItemForId(id, &itemMenu) ; - wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetLabel(): no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenuBar::GetLabel(): no such item") ); return item->GetName(); } @@ -810,7 +810,7 @@ void wxMenuBar::SetHelpString (int id, const wxString& helpString) wxMenu *itemMenu = NULL; wxMenuItem *item = FindItemForId(id, &itemMenu) ; - wxCHECK_RET( item, _T("wxMenuBar::SetHelpString(): no such item") ); + wxCHECK_RET( item, T("wxMenuBar::SetHelpString(): no such item") ); item->SetHelp(helpString); } @@ -820,7 +820,7 @@ wxString wxMenuBar::GetHelpString (int id) const wxMenu *itemMenu = NULL; wxMenuItem *item = FindItemForId(id, &itemMenu) ; - wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetHelpString(): no such item") ); + wxCHECK_MSG( item, T(""), T("wxMenuBar::GetHelpString(): no such item") ); return item->GetHelp(); } @@ -838,7 +838,7 @@ void wxMenuBar::SetLabelTop(int pos, const wxString& label) UINT flagsOld = ::GetMenuState((HMENU)m_hMenu, pos, MF_BYPOSITION); if ( flagsOld == 0xFFFFFFFF ) { - wxLogLastError(_T("GetMenuState")); + wxLogLastError(T("GetMenuState")); return; } @@ -885,7 +885,7 @@ bool wxMenuBar::OnDelete(wxMenu *a_menu, int pos) if ( ::RemoveMenu((HMENU)m_hMenu, (UINT)pos, MF_BYPOSITION) ) { // VZ: I'm not sure about what's going on here, so I leave an assert - wxASSERT_MSG( m_menus[pos] == a_menu, _T("what is this parameter for??") ); + wxASSERT_MSG( m_menus[pos] == a_menu, T("what is this parameter for??") ); a_menu->Detach(); @@ -916,7 +916,7 @@ bool wxMenuBar::OnAppend(wxMenu *a_menu, const wxChar *title) if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING, (UINT)submenu, title) ) { - wxLogLastError(_T("AppendMenu")); + wxLogLastError(T("AppendMenu")); } Refresh(); @@ -971,7 +971,7 @@ void wxMenuBar::Insert(int pos, wxMenu * menu, const wxString& title) new_menus[i] = m_menus[i]; m_menus[i] = NULL; new_titles[i] = m_titles[i]; - m_titles[i] = _T(""); + m_titles[i] = T(""); } new_menus[pos] = (wxMenu *)menu; @@ -982,7 +982,7 @@ void wxMenuBar::Insert(int pos, wxMenu * menu, const wxString& title) new_menus[i] = m_menus[i-1]; m_menus[i-1] = NULL; new_titles[i] = m_titles[i-1]; - m_titles[i-1] = _T(""); + m_titles[i-1] = T(""); } if (m_menus) { @@ -1012,7 +1012,7 @@ void wxMenuBar::Append (wxMenu * menu, const wxString& title) new_menus[i] = m_menus[i]; m_menus[i] = NULL; new_titles[i] = m_titles[i]; - m_titles[i] = _T(""); + m_titles[i] = T(""); } if (m_menus) { @@ -1060,7 +1060,7 @@ void wxMenuBar::Delete(wxMenu * menu, int i) void wxMenuBar::Attach(wxFrame *frame) { - wxASSERT_MSG( !m_menuBarFrame, _T("menubar already attached!") ); + wxASSERT_MSG( !m_menuBarFrame, T("menubar already attached!") ); m_menuBarFrame = frame; @@ -1154,7 +1154,7 @@ WXHMENU wxMenu::GetHMenu() const else if ( m_savehMenu != 0 ) return m_savehMenu; - wxFAIL_MSG(_T("wxMenu without HMENU")); + wxFAIL_MSG(T("wxMenu without HMENU")); return 0; } diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index bd46e7336a..f95be7f540 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -87,7 +87,7 @@ wxMenuItem::wxMenuItem(wxMenu *pParentMenu, int id, #endif //owner drawn m_strHelp(strHelp) { - wxASSERT_MSG( pParentMenu != NULL, _T("a menu item should have a parent") ); + wxASSERT_MSG( pParentMenu != NULL, T("a menu item should have a parent") ); #if wxUSE_OWNER_DRAWN // set default menu colors @@ -151,7 +151,7 @@ void wxMenuItem::Enable(bool bDoEnable) void wxMenuItem::Check(bool bDoCheck) { - wxCHECK_RET( IsCheckable(), _T("only checkable items may be checked") ); + wxCHECK_RET( IsCheckable(), T("only checkable items may be checked") ); if ( m_bChecked != bDoCheck ) { long rc = CheckMenuItem(GetHMenuOf(m_pParentMenu), @@ -210,7 +210,7 @@ void wxMenuItem::SetName(const wxString& strName) MF_BYCOMMAND | flagsOld, id, data) == 0xFFFFFFFF ) { - wxLogLastError(_T("ModifyMenu")); + wxLogLastError(T("ModifyMenu")); } } } diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index 0d4a30f506..2f570b80bf 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -72,7 +72,7 @@ wxMetafile::wxMetafile(const wxString& file) M_METAFILEDATA->m_windowsMappingMode = wxMM_ANISOTROPIC; M_METAFILEDATA->m_metafile = 0; - if (!file.IsNull() && (file.Cmp(_T("")) == 0)) + if (!file.IsNull() && (file.Cmp(T("")) == 0)) M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file); } @@ -146,7 +146,7 @@ wxMetafileDC::wxMetafileDC(const wxString& file) if (!file.IsNull() && wxFileExists(file)) wxRemoveFile(file); - if (!file.IsNull() && (file != _T(""))) + if (!file.IsNull() && (file != T(""))) m_hDC = (WXHDC) CreateMetaFile(file); else m_hDC = (WXHDC) CreateMetaFile(NULL); @@ -167,7 +167,7 @@ wxMetafileDC::wxMetafileDC(const wxString& file, int xext, int yext, int xorg, i m_minY = 10000; m_maxX = -10000; m_maxY = -10000; - if (file != _T("") && wxFileExists(file)) wxRemoveFile(file); + if (file != T("") && wxFileExists(file)) wxRemoveFile(file); m_hDC = (WXHDC) CreateMetaFile(file); m_ok = TRUE; @@ -344,7 +344,7 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i if (!fd) return FALSE; wxChar tempFileBuf[256]; - wxGetTempFileName(_T("mf"), tempFileBuf); + wxGetTempFileName(T("mf"), tempFileBuf); FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb"); if (!fHandle) return FALSE; diff --git a/src/msw/minifram.cpp b/src/msw/minifram.cpp index aee0054b64..ce0bee53ec 100644 --- a/src/msw/minifram.cpp +++ b/src/msw/minifram.cpp @@ -181,13 +181,13 @@ wxMiniFrame::~wxMiniFrame(void) #define HASCAPTION( hwnd ) (TestWinStyle( hwnd, IBS_VERTCAPTION ) ||\ TestWinStyle( hwnd, IBS_HORZCAPTION )) -#define SETCAPTIONSIZE(h,i) (UINT)SetProp(h,_T("ibSize"),(HANDLE)i) -#define GETCAPTIONSIZE(h) (UINT)GetProp(h,_T("ibSize")) -#define FREECAPTIONSIZE(h) RemoveProp(h,_T("ibSize")) +#define SETCAPTIONSIZE(h,i) (UINT)SetProp(h,T("ibSize"),(HANDLE)i) +#define GETCAPTIONSIZE(h) (UINT)GetProp(h,T("ibSize")) +#define FREECAPTIONSIZE(h) RemoveProp(h,T("ibSize")) -#define SETMENUWASUPFLAG(h,i) (UINT)SetProp(h,_T("ibFlag"),(HANDLE)i) -#define GETMENUWASUPFLAG(h) (UINT)GetProp(h,_T("ibFlag")) -#define FREEMENUWASUPFLAG(h) RemoveProp(h,_T("ibFlag")) +#define SETMENUWASUPFLAG(h,i) (UINT)SetProp(h,T("ibFlag"),(HANDLE)i) +#define GETMENUWASUPFLAG(h) (UINT)GetProp(h,T("ibFlag")) +#define FREEMENUWASUPFLAG(h) RemoveProp(h,T("ibFlag")) ///////////////////////////////////////////////////////////////////// // Little known fact: @@ -405,7 +405,7 @@ LRESULT WINAPI ibDefWindowProc( HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lPa { // VZ: I don't know what should be here, but the vars must // be inited! - wxFAIL_MSG(_T("don't know how to initialize cx, cy")); + wxFAIL_MSG(T("don't know how to initialize cx, cy")); cx = cy = 0; } @@ -916,7 +916,7 @@ BOOL PASCAL DrawCaption( HDC hDC, HWND hWnd, LPRECT lprc, { // Can only rotate true type fonts (well, ok, we could // try and use "modern"). - wxStrcpy( lf.lfFaceName, _T("Arial") ) ; + wxStrcpy( lf.lfFaceName, T("Arial") ) ; lf.lfPitchAndFamily = FF_SWISS | 0x04; lf.lfEscapement = 900 ; diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp index f85ff12896..0d9fca1ca2 100644 --- a/src/msw/nativdlg.cpp +++ b/src/msw/nativdlg.cpp @@ -173,7 +173,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) wxWindow* win = NULL; - if (str == _T("BUTTON")) + if (str == T("BUTTON")) { int style1 = (style & 0xFF); if ((style1 == BS_3STATE) || (style1 == BS_AUTO3STATE) || (style1 == BS_AUTOCHECKBOX) || @@ -190,7 +190,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) { // TODO: how to find the bitmap? win = new wxBitmapButton; - wxLogError(_T("Have not yet implemented bitmap button as BS_BITMAP button.")); + wxLogError(T("Have not yet implemented bitmap button as BS_BITMAP button.")); } #endif else if (style1 == BS_OWNERDRAW) @@ -213,11 +213,11 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) } else { - wxLogError(_T("Don't know what kind of button this is: id = %d"), + wxLogError(T("Don't know what kind of button this is: id = %d"), id); } } - else if (str == _T("COMBOBOX")) + else if (str == T("COMBOBOX")) { win = new wxComboBox; } @@ -227,30 +227,30 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) // for correct functioning. // Could have wxWindow::AdoptAttributesFromHWND(WXHWND) // to be overridden by each control class. - else if (str == _T("EDIT")) + else if (str == T("EDIT(")) { win = new wxTextCtrl; } - else if (str == _T("LISTBOX")) + else if (str == T("LISTBOX")) { win = new wxListBox; } - else if (str == _T("SCROLLBAR")) + else if (str == T("SCROLLBAR")) { win = new wxScrollBar; } #if defined(__WIN95__) && !defined(__TWIN32__) - else if (str == _T("MSCTLS_UPDOWN32")) + else if (str == T("MSCTLS_UPDOWN32")) { win = new wxSpinButton; } #endif - else if (str == _T("MSCTLS_TRACKBAR32")) + else if (str == T("MSCTLS_TRACKBAR32")) { // Need to ascertain if it's horiz or vert win = new wxSlider; } - else if (str == _T("STATIC")) + else if (str == T("STATIC")) { int style1 = (style & 0xFF); @@ -262,13 +262,13 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) win = new wxStaticBitmap; // Help! this doesn't correspond with the wxWin implementation. - wxLogError(_T("Please make SS_BITMAP statics into owner-draw buttons.")); + wxLogError(T("Please make SS_BITMAP statics into owner-draw buttons.")); } #endif } else { - wxString msg(_T("Don't know how to convert from Windows class ")); + wxString msg(T("Don't know how to convert from Windows class ")); msg += str; wxLogError(msg); } diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 67cc03440b..5ffffe5781 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -212,7 +212,7 @@ int wxNotebook::GetRowCount() const int wxNotebook::SetSelection(int nPage) { - wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("notebook page out of range") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, T("notebook page out of range") ); ChangePage(m_nSelection, nPage); @@ -231,7 +231,7 @@ void wxNotebook::AdvanceSelection(bool bForward) bool wxNotebook::SetPageText(int nPage, const wxString& strText) { - wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, T("notebook page out of range") ); TC_ITEM tcItem; tcItem.mask = TCIF_TEXT; @@ -242,7 +242,7 @@ bool wxNotebook::SetPageText(int nPage, const wxString& strText) wxString wxNotebook::GetPageText(int nPage) const { - wxCHECK_MSG( IS_VALID_PAGE(nPage), _T(""), _T("notebook page out of range") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), T(""), T("notebook page out of range") ); wxChar buf[256]; TC_ITEM tcItem; @@ -259,7 +259,7 @@ wxString wxNotebook::GetPageText(int nPage) const int wxNotebook::GetPageImage(int nPage) const { - wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("notebook page out of range") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, T("notebook page out of range") ); TC_ITEM tcItem; tcItem.mask = TCIF_IMAGE; @@ -269,7 +269,7 @@ int wxNotebook::GetPageImage(int nPage) const bool wxNotebook::SetPageImage(int nPage, int nImage) { - wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, T("notebook page out of range") ); TC_ITEM tcItem; tcItem.mask = TCIF_IMAGE; @@ -299,7 +299,7 @@ void wxNotebook::SetTabSize(const wxSize& sz) // remove one page from the notebook bool wxNotebook::DeletePage(int nPage) { - wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, T("notebook page out of range") ); if ( m_nSelection == nPage ) { // advance selection backwards - the page being deleted shouldn't be left @@ -323,7 +323,7 @@ bool wxNotebook::DeletePage(int nPage) // remove one page from the notebook, without deleting bool wxNotebook::RemovePage(int nPage) { - wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, T("notebook page out of range") ); TabCtrl_DeleteItem(m_hwnd, nPage); @@ -385,7 +385,7 @@ bool wxNotebook::InsertPage(int nPage, } if ( TabCtrl_InsertItem(m_hwnd, nPage, &tcItem) == -1 ) { - wxLogError(_T("Can't create the notebook page '%s'."), strText.c_str()); + wxLogError(T("Can't create the notebook page '%s'."), strText.c_str()); return FALSE; } diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 5263230b30..5f83323c4c 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -427,7 +427,7 @@ WXIDISPATCH* wxAutomationObject::GetDispatchProperty(const wxString& property, i wxVariant retVariant; if (Invoke(property, DISPATCH_PROPERTYGET, retVariant, noArgs, args)) { - if (retVariant.GetType() == _T("void*")) + if (retVariant.GetType() == T("void*")) { return (WXIDISPATCH*) retVariant.GetVoidPtr(); } @@ -467,19 +467,19 @@ bool wxAutomationObject::GetInstance(const wxString& classId) const if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId))) { - wxLogWarning(_T("Cannot obtain CLSID from ProgID")); + wxLogWarning(T("Cannot obtain CLSID from ProgID")); return FALSE; } if (FAILED(GetActiveObject(clsId, NULL, &pUnk))) { - wxLogWarning(_T("Cannot find an active object")); + wxLogWarning(T("Cannot find an active object")); return FALSE; } if (pUnk->QueryInterface(IID_IDispatch, (LPVOID*) &m_dispatchPtr) != S_OK) { - wxLogWarning(_T("Cannot find IDispatch interface")); + wxLogWarning(T("Cannot find IDispatch interface")); return FALSE; } @@ -499,14 +499,14 @@ bool wxAutomationObject::CreateInstance(const wxString& classId) const if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId))) { - wxLogWarning(_T("Cannot obtain CLSID from ProgID")); + wxLogWarning(T("Cannot obtain CLSID from ProgID")); return FALSE; } // start a new copy of Excel, grab the IDispatch interface if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void**)&m_dispatchPtr))) { - wxLogWarning(_T("Cannot start an instance of this class.")); + wxLogWarning(T("Cannot start an instance of this class.")); return FALSE; } @@ -525,17 +525,17 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) wxString type(variant.GetType()); - if (type == _T("long")) + if (type == T("long")) { oleVariant.vt = VT_I4; oleVariant.lVal = variant.GetLong() ; } - else if (type == _T("double")) + else if (type == T("double")) { oleVariant.vt = VT_R8; oleVariant.dblVal = variant.GetDouble(); } - else if (type == _T("bool")) + else if (type == T("bool")) { oleVariant.vt = VT_BOOL; // 'bool' required for VC++ 4 apparently @@ -545,13 +545,13 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) oleVariant.boolVal = variant.GetBool(); #endif } - else if (type == _T("string")) + else if (type == T("string")) { wxString str( variant.GetString() ); oleVariant.vt = VT_BSTR; oleVariant.bstrVal = ConvertStringToOle(str); } - else if (type == _T("date")) + else if (type == T("date")) { wxDate date( variant.GetDate() ); oleVariant.vt = VT_DATE; @@ -560,7 +560,7 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) 0, 0, 0, oleVariant.date)) return FALSE; } - else if (type == _T("time")) + else if (type == T("time")) { wxTime time( variant.GetTime() ); oleVariant.vt = VT_DATE; @@ -569,12 +569,12 @@ bool ConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant) time.GetHour(), time.GetMinute(), time.GetSecond(), oleVariant.date)) return FALSE; } - else if (type == _T("void*")) + else if (type == T("void*")) { oleVariant.vt = VT_DISPATCH; oleVariant.pdispVal = (IDispatch*) variant.GetVoidPtr(); } - else if (type == _T("list") || type == _T("stringlist")) + else if (type == T("list") || type == T("stringlist")) { oleVariant.vt = VT_VARIANT | VT_ARRAY; @@ -728,7 +728,7 @@ bool ConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) } default: { - wxLogError(_T("wxAutomationObject::ConvertOleToVariant: Unknown variant value type")); + wxLogError(T("wxAutomationObject::ConvertOleToVariant: Unknown variant value type")); return FALSE; } } @@ -1061,7 +1061,7 @@ static void ReleaseVariant(VARIANTARG *pvarg) } else { - wxLogWarning(_T("ReleaseVariant: Array contains non-variant type")); + wxLogWarning(T("ReleaseVariant: Array contains non-variant type")); } // Free the array itself. @@ -1088,7 +1088,7 @@ static void ReleaseVariant(VARIANTARG *pvarg) break; default: - wxLogWarning(_T("ReleaseVariant: Unknown type")); + wxLogWarning(T("ReleaseVariant: Unknown type")); break; } } diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index 1b3c066a8b..d39371cdf4 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -126,7 +126,7 @@ wxString wxDataFormat::GetId() const wxString s; wxCHECK_MSG( !IsStandard(), s, - _T("name of predefined format cannot be retrieved") ); + T("name of predefined format cannot be retrieved") ); int len = ::GetClipboardFormatName(m_format, s.GetWriteBuf(max), max); s.UngetWriteBuf(); @@ -165,7 +165,7 @@ STDMETHODIMP wxIEnumFORMATETC::Next(ULONG celt, FORMATETC *rgelt, ULONG *pceltFetched) { - wxLogTrace(_T("wxIEnumFORMATETC::Next")); + wxLogTrace(T("wxIEnumFORMATETC::Next")); if ( celt > 1 ) return S_FALSE; @@ -182,7 +182,7 @@ STDMETHODIMP wxIEnumFORMATETC::Next(ULONG celt, STDMETHODIMP wxIEnumFORMATETC::Skip(ULONG celt) { - wxLogTrace(_T("wxIEnumFORMATETC::Skip")); + wxLogTrace(T("wxIEnumFORMATETC::Skip")); if ( m_nCurrent == 0 ) m_nCurrent++; @@ -192,7 +192,7 @@ STDMETHODIMP wxIEnumFORMATETC::Skip(ULONG celt) STDMETHODIMP wxIEnumFORMATETC::Reset() { - wxLogTrace(_T("wxIEnumFORMATETC::Reset")); + wxLogTrace(T("wxIEnumFORMATETC::Reset")); m_nCurrent = 0; @@ -201,7 +201,7 @@ STDMETHODIMP wxIEnumFORMATETC::Reset() STDMETHODIMP wxIEnumFORMATETC::Clone(IEnumFORMATETC **ppenum) { - wxLogTrace(_T("wxIEnumFORMATETC::Clone")); + wxLogTrace(T("wxIEnumFORMATETC::Clone")); wxIEnumFORMATETC *pNew = new wxIEnumFORMATETC(m_format.cfFormat); pNew->AddRef(); @@ -230,7 +230,7 @@ wxIDataObject::wxIDataObject(wxDataObject *pDataObject) // get data functions STDMETHODIMP wxIDataObject::GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmedium) { - wxLogTrace(_T("wxIDataObject::GetData")); + wxLogTrace(T("wxIDataObject::GetData")); // is data is in our format? HRESULT hr = QueryGetData(pformatetcIn); @@ -262,7 +262,7 @@ STDMETHODIMP wxIDataObject::GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmedium) STDMETHODIMP wxIDataObject::GetDataHere(FORMATETC *pformatetc, STGMEDIUM *pmedium) { - wxLogTrace(_T("wxIDataObject::GetDataHere")); + wxLogTrace(T("wxIDataObject::GetDataHere")); // put data in caller provided medium if ( pmedium->tymed != TYMED_HGLOBAL ) @@ -271,7 +271,7 @@ STDMETHODIMP wxIDataObject::GetDataHere(FORMATETC *pformatetc, // copy data void *pBuf = GlobalLock(pmedium->hGlobal); if ( pBuf == NULL ) { - wxLogLastError(_T("GlobalLock")); + wxLogLastError(T("GlobalLock")); return E_OUTOFMEMORY; } @@ -287,7 +287,7 @@ STDMETHODIMP wxIDataObject::SetData(FORMATETC *pformatetc, STGMEDIUM *pmedium, BOOL fRelease) { - wxLogTrace(_T("wxIDataObject::SetData")); + wxLogTrace(T("wxIDataObject::SetData")); return E_NOTIMPL; } @@ -296,39 +296,39 @@ STDMETHODIMP wxIDataObject::QueryGetData(FORMATETC *pformatetc) { // do we accept data in this format? if ( pformatetc == NULL ) { - wxLogTrace(_T("wxIDataObject::QueryGetData: invalid ptr.")); + wxLogTrace(T("wxIDataObject::QueryGetData: invalid ptr.")); return E_INVALIDARG; } // the only one allowed by current COM implementation if ( pformatetc->lindex != -1 ) { - wxLogTrace(_T("wxIDataObject::QueryGetData: bad lindex %d"), + wxLogTrace(T("wxIDataObject::QueryGetData: bad lindex %d"), pformatetc->lindex); return DV_E_LINDEX; } // we don't support anything other (THUMBNAIL, ICON, DOCPRINT...) if ( pformatetc->dwAspect != DVASPECT_CONTENT ) { - wxLogTrace(_T("wxIDataObject::QueryGetData: bad dwAspect %d"), + wxLogTrace(T("wxIDataObject::QueryGetData: bad dwAspect %d"), pformatetc->dwAspect); return DV_E_DVASPECT; } // @@ we only transfer data by global memory (bad for large amounts of it!) if ( !(pformatetc->tymed & TYMED_HGLOBAL) ) { - wxLogTrace(_T("wxIDataObject::QueryGetData: %s != TYMED_HGLOBAL."), + wxLogTrace(T("wxIDataObject::QueryGetData: %s != TYMED_HGLOBAL."), GetTymedName(pformatetc->tymed)); return DV_E_TYMED; } // and now check the type of data requested if ( m_pDataObject->IsSupportedFormat((wxDataFormatId)pformatetc->cfFormat) ) { - wxLogTrace(_T("wxIDataObject::QueryGetData: %s ok"), + wxLogTrace(T("wxIDataObject::QueryGetData: %s ok"), wxDataObject::GetFormatName((wxDataFormatId)pformatetc->cfFormat)); return S_OK; } else { - wxLogTrace(_T("wxIDataObject::QueryGetData: %s unsupported"), + wxLogTrace(T("wxIDataObject::QueryGetData: %s unsupported"), wxDataObject::GetFormatName((wxDataFormatId)pformatetc->cfFormat)); return DV_E_FORMATETC; } @@ -337,7 +337,7 @@ STDMETHODIMP wxIDataObject::QueryGetData(FORMATETC *pformatetc) STDMETHODIMP wxIDataObject::GetCanonicalFormatEtc(FORMATETC *pFormatetcIn, FORMATETC *pFormatetcOut) { - wxLogTrace(_T("wxIDataObject::GetCanonicalFormatEtc")); + wxLogTrace(T("wxIDataObject::GetCanonicalFormatEtc")); // @@ implementation is trivial, we might want something better here if ( pFormatetcOut != NULL ) @@ -348,7 +348,7 @@ STDMETHODIMP wxIDataObject::GetCanonicalFormatEtc(FORMATETC *pFormatetcIn, STDMETHODIMP wxIDataObject::EnumFormatEtc(DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc) { - wxLogTrace(_T("wxIDataObject::EnumFormatEtc")); + wxLogTrace(T("wxIDataObject::EnumFormatEtc")); if ( dwDirection == DATADIR_SET ) { // we don't allow setting of data anyhow @@ -407,19 +407,19 @@ const char *wxDataObject::GetFormatName(wxDataFormat format) static char s_szBuf[128]; switch ( format ) { - case CF_TEXT: return "CF_TEXT"; + case CF_TEXT: return "CF_TEXT("; case CF_BITMAP: return "CF_BITMAP"; - case CF_METAFILEPICT: return "CF_METAFILEPICT"; + case CF_METAFILEPICT: return "CF_METAFILEPICT("; case CF_SYLK: return "CF_SYLK"; case CF_DIF: return "CF_DIF"; case CF_TIFF: return "CF_TIFF"; - case CF_OEMTEXT: return "CF_OEMTEXT"; + case CF_OEMTEXT: return "CF_OEMTEXT("; case CF_DIB: return "CF_DIB"; case CF_PALETTE: return "CF_PALETTE"; case CF_PENDATA: return "CF_PENDATA"; case CF_RIFF: return "CF_RIFF"; case CF_WAVE: return "CF_WAVE"; - case CF_UNICODETEXT: return "CF_UNICODETEXT"; + case CF_UNICODETEXT: return "CF_UNICODETEXT("; case CF_ENHMETAFILE: return "CF_ENHMETAFILE"; case CF_HDROP: return "CF_HDROP"; case CF_LOCALE: return "CF_LOCALE"; @@ -490,7 +490,7 @@ static const char *GetTymedName(DWORD tymed) case TYMED_ISTREAM: return "TYMED_ISTREAM"; case TYMED_ISTORAGE: return "TYMED_ISTORAGE"; case TYMED_GDI: return "TYMED_GDI"; - case TYMED_MFPICT: return "TYMED_MFPICT"; + case TYMED_MFPICT: return "TYMED_MFPICT("; case TYMED_ENHMF: return "TYMED_ENHMF"; default: sprintf(s_szBuf, "type of media format %d (unknown)", tymed); diff --git a/src/msw/ole/dropsrc.cpp b/src/msw/ole/dropsrc.cpp index 86f31d8c58..2943fd55d7 100644 --- a/src/msw/ole/dropsrc.cpp +++ b/src/msw/ole/dropsrc.cpp @@ -189,7 +189,7 @@ wxDropSource::~wxDropSource() // Notes : you must call SetData() before if you had used def ctor wxDragResult wxDropSource::DoDragDrop(bool bAllowMove) { - wxCHECK_MSG( m_pData != NULL, wxDragNone, _T("No data in wxDropSource!") ); + wxCHECK_MSG( m_pData != NULL, wxDragNone, T("No data in wxDropSource!") ); DWORD dwEffect; HRESULT hr = ::DoDragDrop(m_pData->GetInterface(), @@ -221,10 +221,10 @@ wxDragResult wxDropSource::DoDragDrop(bool bAllowMove) else { if ( FAILED(hr) ) { wxLogApiError("DoDragDrop", hr); - wxLogError(_T("Drag & drop operation failed.")); + wxLogError(T("Drag & drop operation failed.")); } else { - wxLogDebug(_T("Unexpected success return code %08lx from DoDragDrop."), hr); + wxLogDebug(T("Unexpected success return code %08lx from DoDragDrop."), hr); } return wxDragError; diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index eaf3737995..7101ef5eb2 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -136,7 +136,7 @@ STDMETHODIMP wxIDropTarget::DragEnter(IDataObject *pIDataSource, POINTL pt, DWORD *pdwEffect) { - wxLogDebug(_T("IDropTarget::DragEnter")); + wxLogDebug(T("IDropTarget::DragEnter")); wxASSERT( m_pIDataObject == NULL ); @@ -187,7 +187,7 @@ STDMETHODIMP wxIDropTarget::DragOver(DWORD grfKeyState, // Notes : good place to do any clean-up STDMETHODIMP wxIDropTarget::DragLeave() { - wxLogDebug(_T("IDropTarget::DragLeave")); + wxLogDebug(T("IDropTarget::DragLeave")); // remove the UI feedback m_pTarget->OnLeave(); @@ -212,7 +212,7 @@ STDMETHODIMP wxIDropTarget::Drop(IDataObject *pIDataSource, POINTL pt, DWORD *pdwEffect) { - wxLogDebug(_T("IDropTarget::Drop")); + wxLogDebug(T("IDropTarget::Drop")); // TODO I don't know why there is this parameter, but so far I assume // that it's the same we've already got in DragEnter @@ -385,7 +385,7 @@ bool wxFileDropTarget::OnDrop(long x, long y, const void *pData) UINT len2 = ::DragQueryFile(hdrop, n, aszFiles[n], len); if ( len2 != len - 1 ) { - wxLogDebug(_T("In wxFileDropTarget::OnDrop DragQueryFile returned %d " + wxLogDebug(T("In wxFileDropTarget::OnDrop DragQueryFile returned %d " "characters, %d expected."), len2, len - 1); } } diff --git a/src/msw/ole/uuid.cpp b/src/msw/ole/uuid.cpp index ac55158ea5..8f0d4eb98c 100644 --- a/src/msw/ole/uuid.cpp +++ b/src/msw/ole/uuid.cpp @@ -165,7 +165,7 @@ void Uuid::UuidToCForm() if ( m_pszCForm == NULL ) m_pszCForm = new wxChar[UUID_CSTRLEN]; - wsprintf(m_pszCForm, _T("0x%8.8X,0x%4.4X,0x%4.4X,0x%2.2X,0x2.2%X," + wsprintf(m_pszCForm, T("0x%8.8X,0x%4.4X,0x%4.4X,0x%2.2X,0x2.2%X," "0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X"), m_uuid.Data1, m_uuid.Data2, m_uuid.Data3, m_uuid.Data4[1], m_uuid.Data4[2], m_uuid.Data4[3], m_uuid.Data4[4], diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index 82fbbc8408..090c670bbf 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -74,7 +74,7 @@ bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight) delete [] szStripped; // # without this menu items look too tightly packed (at least under Windows) - str += _T('W'); // 'W' is typically the widest letter + str += T('W'); // 'W' is typically the widest letter dc.GetTextExtent(str, (long *)pwidth, (long *)pheight); diff --git a/src/msw/penwin.cpp b/src/msw/penwin.cpp index 3545a28bda..b9223a74f7 100644 --- a/src/msw/penwin.cpp +++ b/src/msw/penwin.cpp @@ -94,7 +94,7 @@ void wxRegisterPenWin(void) /////////////////////////////////////////////////////////////////////// // If running on a Pen Windows system, register this app so all // EDIT controls in dialogs are replaced by HEDIT controls. -// (Notice the CONTROL statement in the RC file is "EDIT", +// (Notice the CONTROL statement in the RC file is "EDIT(", // RegisterPenApp will automatically change that control to // an HEDIT. if ((g_hPenWin = (HANDLE)GetSystemMetrics(SM_PENWINDOWS)) != (HANDLE)NULL) { diff --git a/src/msw/printwin.cpp b/src/msw/printwin.cpp index b4fa85248e..847557f7e4 100644 --- a/src/msw/printwin.cpp +++ b/src/msw/printwin.cpp @@ -217,7 +217,7 @@ bool wxWindowsPrinter::Print(wxWindow *parent, wxPrintout *printout, bool prompt if (!win) { wxEndBusyCursor(); - wxLogDebug(_T("Could not create an abort dialog.")); + wxLogDebug(T("Could not create an abort dialog.")); delete dc; } diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index bd865c7542..9734f7914a 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -110,7 +110,7 @@ bool wxRadioBox::MSWCommand(WXUINT cmd, WXWORD id) } } - wxASSERT_MSG( selectedButton != -1, _T("click from alien button?") ); + wxASSERT_MSG( selectedButton != -1, T("click from alien button?") ); if ( selectedButton != m_selectedButton ) { @@ -257,7 +257,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowID id, const wxString& title, } // Create a dummy radio control to end the group. - (void)CreateWindowEx(0, RADIO_CLASS, _T(""), WS_GROUP | RADIO_FLAGS, + (void)CreateWindowEx(0, RADIO_CLASS, T(""), WS_GROUP | RADIO_FLAGS, 0, 0, 0, 0, hwndParent, (HMENU)NewControlId(), wxGetInstance(), NULL); @@ -289,14 +289,14 @@ wxRadioBox::~wxRadioBox() wxString wxRadioBox::GetLabel(int item) const { - wxCHECK_MSG( item >= 0 && item < m_noItems, _T(""), _T("invalid radiobox index") ); + wxCHECK_MSG( item >= 0 && item < m_noItems, T(""), T("invalid radiobox index") ); return wxGetWindowText(m_radioButtons[item]); } void wxRadioBox::SetLabel(int item, const wxString& label) { - wxCHECK_RET( item >= 0 && item < m_noItems, _T("invalid radiobox index") ); + wxCHECK_RET( item >= 0 && item < m_noItems, T("invalid radiobox index") ); m_radioWidth[item] = m_radioHeight[item] = -1; SetWindowText((HWND)m_radioButtons[item], label.c_str()); @@ -308,7 +308,7 @@ void wxRadioBox::SetLabel(int item, wxBitmap *bitmap) m_radioWidth[item] = bitmap->GetWidth() + FB_MARGIN; m_radioHeight[item] = bitmap->GetHeight() + FB_MARGIN; */ - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(T("not implemented")); } int wxRadioBox::FindString(const wxString& s) const @@ -324,7 +324,7 @@ int wxRadioBox::FindString(const wxString& s) const void wxRadioBox::SetSelection(int N) { - wxCHECK_RET( (N >= 0) && (N < m_noItems), _T("invalid radiobox index") ); + wxCHECK_RET( (N >= 0) && (N < m_noItems), T("invalid radiobox index") ); // Following necessary for Win32s, because Win32s translate BM_SETCHECK if (m_selectedButton >= 0 && m_selectedButton < m_noItems) @@ -591,7 +591,7 @@ bool wxRadioBox::Show(bool show) void wxRadioBox::Enable(int item, bool enable) { wxCHECK_RET( item >= 0 && item < m_noItems, - _T("invalid item in wxRadioBox::Enable()") ); + T("invalid item in wxRadioBox::Enable()") ); ::EnableWindow((HWND) m_radioButtons[item], enable); } @@ -612,7 +612,7 @@ bool wxRadioBox::Enable(bool enable) void wxRadioBox::Show(int item, bool show) { wxCHECK_RET( item >= 0 && item < m_noItems, - _T("invalid item in wxRadioBox::Show()") ); + T("invalid item in wxRadioBox::Show()") ); ::ShowWindow((HWND)m_radioButtons[item], show ? SW_SHOW : SW_HIDE); } @@ -724,7 +724,7 @@ LRESULT APIENTRY _EXPORT wxRadioBtnWndProc(HWND hwnd, { wxRadioBox *radiobox = (wxRadioBox *)::GetWindowLong(hwnd, GWL_USERDATA); - wxCHECK_MSG( radiobox, 0, _T("radio button without radio box?") ); + wxCHECK_MSG( radiobox, 0, T("radio button without radio box?") ); int sel = radiobox->GetSelection(); diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index 8f7c9786be..61dc038847 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -94,7 +94,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, msStyle,0,0,0,0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create radiobutton") ); + wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create radiobutton") ); #if wxUSE_CTL3D if (want3D) @@ -112,7 +112,7 @@ bool wxRadioButton::Create(wxWindow *parent, wxWindowID id, // SetValue(value); // start GRW fix - if (label != _T("")) + if (label != T("")) { int label_width, label_height; GetTextExtent(label, &label_width, &label_height, NULL, NULL, & this->GetFont()); diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 6ec17a61ff..5d18e7f81a 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -98,7 +98,7 @@ wxRegConfig::wxRegConfig(const wxString& appName, const wxString& vendorName, if ( appName.IsEmpty() ) { - wxCHECK_RET( wxTheApp, _T("No application name in wxRegConfig ctor!") ); + wxCHECK_RET( wxTheApp, T("No application name in wxRegConfig ctor!") ); strRoot << wxTheApp->GetAppName(); } else @@ -337,7 +337,7 @@ bool wxRegConfig::Read(const wxString& key, wxString *pStr) const if ( IsImmutable(path.Name()) ) { if ( TryGetValue(m_keyGlobal, path.Name(), *pStr) ) { if ( m_keyLocal.HasValue(path.Name()) ) { - wxLogWarning(_T("User value for immutable key '%s' ignored."), + wxLogWarning(T("User value for immutable key '%s' ignored."), path.Name().c_str()); } *pStr = wxConfigBase::ExpandEnvVars(*pStr); @@ -373,7 +373,7 @@ bool wxRegConfig::Read(const wxString& key, wxString *pStr, if ( IsImmutable(path.Name()) ) { if ( TryGetValue(m_keyGlobal, path.Name(), *pStr) ) { if ( m_keyLocal.HasValue(path.Name()) ) { - wxLogWarning(_T("User value for immutable key '%s' ignored."), + wxLogWarning(T("User value for immutable key '%s' ignored."), path.Name().c_str()); } @@ -416,7 +416,7 @@ bool wxRegConfig::Read(const wxString& key, long *plResult) const if ( IsImmutable(path.Name()) ) { if ( TryGetValue(m_keyGlobal, path.Name(), plResult) ) { if ( m_keyLocal.HasValue(path.Name()) ) { - wxLogWarning(_T("User value for immutable key '%s' ignored."), + wxLogWarning(T("User value for immutable key '%s' ignored."), path.Name().c_str()); } @@ -441,7 +441,7 @@ bool wxRegConfig::Write(const wxString& key, const wxString& szValue) wxConfigPathChanger path(this, key); if ( IsImmutable(path.Name()) ) { - wxLogError(_T("Can't change immutable entry '%s'."), path.Name().c_str()); + wxLogError(T("Can't change immutable entry '%s'."), path.Name().c_str()); return FALSE; } @@ -453,7 +453,7 @@ bool wxRegConfig::Write(const wxString& key, long lValue) wxConfigPathChanger path(this, key); if ( IsImmutable(path.Name()) ) { - wxLogError(_T("Can't change immutable entry '%s'."), path.Name().c_str()); + wxLogError(T("Can't change immutable entry '%s'."), path.Name().c_str()); return FALSE; } @@ -516,7 +516,7 @@ bool wxRegConfig::RenameGroup(const wxString& oldName, const wxString& newName) // TODO there is no way to rename a registry key - we must do a deep copy // ourselves - wxFAIL_MSG(_T("Registry key renaming not implemented")); + wxFAIL_MSG(T("Registry key renaming not implemented")); return FALSE; } diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index fe8897463e..c2f748e6db 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -67,23 +67,23 @@ static struct } aStdKeys[] = { - { HKEY_CLASSES_ROOT, _T("HKEY_CLASSES_ROOT"), _T("HKCR") }, + { HKEY_CLASSES_ROOT, T("HKEY_CLASSES_ROOT("), T("HKCR") }, #ifdef __WIN32__ - { HKEY_CURRENT_USER, _T("HKEY_CURRENT_USER"), _T("HKCU") }, - { HKEY_LOCAL_MACHINE, _T("HKEY_LOCAL_MACHINE"), _T("HKLM") }, - { HKEY_USERS, _T("HKEY_USERS"), _T("HKU") }, // short name? - { HKEY_PERFORMANCE_DATA, _T("HKEY_PERFORMANCE_DATA"), _T("HKPD") }, + { HKEY_CURRENT_USER, T("HKEY_CURRENT_USER"), T("HKCU") }, + { HKEY_LOCAL_MACHINE, T("HKEY_LOCAL_MACHINE"), T("HKLM") }, + { HKEY_USERS, T("HKEY_USERS"), T("HKU") }, // short name? + { HKEY_PERFORMANCE_DATA, T("HKEY_PERFORMANCE_DATA"), T("HKPD") }, #if WINVER >= 0x0400 - { HKEY_CURRENT_CONFIG, _T("HKEY_CURRENT_CONFIG"), _T("HKCC") }, + { HKEY_CURRENT_CONFIG, T("HKEY_CURRENT_CONFIG"), T("HKCC") }, #ifndef __GNUWIN32__ - { HKEY_DYN_DATA, _T("HKEY_DYN_DATA"), _T("HKDD") }, // short name? + { HKEY_DYN_DATA, T("HKEY_DYN_DATA"), T("HKDD") }, // short name? #endif //GNUWIN32 #endif //WINVER >= 4.0 #endif //WIN32 }; // the registry name separator (perhaps one day MS will change it to '/' ;-) -#define REG_SEPARATOR _T('\\') +#define REG_SEPARATOR T('\\') // useful for Windows programmers: makes somewhat more clear all these zeroes // being passed to Windows APIs @@ -128,7 +128,7 @@ const size_t wxRegKey::nStdKeys = WXSIZEOF(aStdKeys); const wxChar *wxRegKey::GetStdKeyName(size_t key) { // return empty string if key is invalid - wxCHECK_MSG( key < nStdKeys, _T(""), _T("invalid key in wxRegKey::GetStdKeyName") ); + wxCHECK_MSG( key < nStdKeys, T(""), T("invalid key in wxRegKey::GetStdKeyName") ); return aStdKeys[key].szName; } @@ -136,7 +136,7 @@ const wxChar *wxRegKey::GetStdKeyName(size_t key) const wxChar *wxRegKey::GetStdKeyShortName(size_t key) { // return empty string if key is invalid - wxCHECK( key < nStdKeys, _T("") ); + wxCHECK( key < nStdKeys, T("") ); return aStdKeys[key].szShortName; } @@ -156,7 +156,7 @@ wxRegKey::StdKey wxRegKey::ExtractKeyName(wxString& strKey) } if ( ui == nStdKeys ) { - wxFAIL_MSG(_T("invalid key prefix in wxRegKey::ExtractKeyName.")); + wxFAIL_MSG(T("invalid key prefix in wxRegKey::ExtractKeyName.")); hRootKey = HKEY_CLASSES_ROOT; } @@ -176,7 +176,7 @@ wxRegKey::StdKey wxRegKey::GetStdKeyFromHkey(WXHKEY hkey) return (StdKey)ui; } - wxFAIL_MSG(_T("non root hkey passed to wxRegKey::GetStdKeyFromHkey.")); + wxFAIL_MSG(T("non root hkey passed to wxRegKey::GetStdKeyFromHkey.")); return HKCR; } @@ -624,7 +624,7 @@ bool wxRegKey::QueryValue(const wxChar *szValue, long *plValue) const else { // check that we read the value of right type wxASSERT_MSG( dwType == REG_DWORD, - _T("Type mismatch in wxRegKey::QueryValue().") ); + T("Type mismatch in wxRegKey::QueryValue().") ); return TRUE; } @@ -651,7 +651,7 @@ bool wxRegKey::QueryValue(const wxChar *szValue, wxString& strValue) const if ( m_dwLastError == ERROR_SUCCESS ) { // check that it was the right type wxASSERT_MSG( dwType == REG_SZ, - _T("Type mismatch in wxRegKey::QueryValue().") ); + T("Type mismatch in wxRegKey::QueryValue().") ); return TRUE; } @@ -833,7 +833,7 @@ const wxChar *GetFullName(const wxRegKey *pKey, const wxChar *szValue) static wxString s_str; s_str = pKey->GetName(); if ( !wxIsEmpty(szValue) ) - s_str << _T("\\") << szValue; + s_str << T("\\") << szValue; return s_str.c_str(); } diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index 614a0cf640..2971968636 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -84,7 +84,7 @@ bool wxScrollBar::Create(wxWindow *parent, wxWindowID id, // Now create scrollbar DWORD _direction = (style & wxHORIZONTAL) ? SBS_HORZ: SBS_VERT; - HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(style), _T("SCROLLBAR"), _T("scrollbar"), + HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(style), T("SCROLLBAR"), T("scrollbar"), _direction | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); diff --git a/src/msw/slider95.cpp b/src/msw/slider95.cpp index d6334217be..fc1dd236c5 100644 --- a/src/msw/slider95.cpp +++ b/src/msw/slider95.cpp @@ -93,14 +93,14 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id, bool want3D; WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ; - m_staticValue = (WXHWND) CreateWindowEx(exStyle, _T("STATIC"), NULL, + m_staticValue = (WXHWND) CreateWindowEx(exStyle, T("STATIC"), NULL, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(), wxGetInstance(), NULL); // Now create min static control - wxSprintf(wxBuffer, _T("%d"), minValue); - m_staticMin = (WXHWND) CreateWindowEx(0, _T("STATIC"), wxBuffer, + wxSprintf(wxBuffer, T("%d"), minValue); + m_staticMin = (WXHWND) CreateWindowEx(0, T("STATIC"), wxBuffer, STATIC_FLAGS, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(), wxGetInstance(), NULL); @@ -149,15 +149,15 @@ bool wxSlider95::Create(wxWindow *parent, wxWindowID id, SubclassWin(GetHWND()); - SetWindowText((HWND) m_hWnd, _T("")); + SetWindowText((HWND) m_hWnd, T("")); SetFont(parent->GetFont()); if ( m_windowStyle & wxSL_LABELS ) { // Finally, create max value static item - wxSprintf(wxBuffer, _T("%d"), maxValue); - m_staticMax = (WXHWND) CreateWindowEx(0, _T("STATIC"), wxBuffer, + wxSprintf(wxBuffer, T("%d"), maxValue); + m_staticMax = (WXHWND) CreateWindowEx(0, T("STATIC"), wxBuffer, STATIC_FLAGS, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(), wxGetInstance(), NULL); @@ -285,7 +285,7 @@ void wxSlider95::SetValue(int value) ::SendMessage(GetHwnd(), TBM_SETPOS, (WPARAM)TRUE, (LPARAM)value); if (m_staticValue) { - wxSprintf(wxBuffer, _T("%d"), value); + wxSprintf(wxBuffer, T("%d"), value); SetWindowText((HWND) m_staticValue, wxBuffer); } } @@ -513,13 +513,13 @@ void wxSlider95::SetRange(int minValue, int maxValue) wxChar buf[40]; if ( m_staticMin ) { - wxSprintf(buf, _T("%d"), m_rangeMin); + wxSprintf(buf, T("%d"), m_rangeMin); SetWindowText((HWND) m_staticMin, buf); } if ( m_staticMax ) { - wxSprintf(buf, _T("%d"), m_rangeMax); + wxSprintf(buf, T("%d"), m_rangeMax); SetWindowText((HWND) m_staticMax, buf); } } diff --git a/src/msw/slidrmsw.cpp b/src/msw/slidrmsw.cpp index 18f85538ea..13a7b15ac4 100644 --- a/src/msw/slidrmsw.cpp +++ b/src/msw/slidrmsw.cpp @@ -85,14 +85,14 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id, bool want3D; WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ; - m_staticValue = (WXHWND) CreateWindowEx(exStyle, _T("STATIC"), NULL, + m_staticValue = (WXHWND) CreateWindowEx(exStyle, T("STATIC"), NULL, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(), wxGetInstance(), NULL); // Now create min static control - wxSprintf(wxBuffer, _T("%d"), minValue); - m_staticMin = (WXHWND) CreateWindowEx(0, _T("STATIC"), wxBuffer, + wxSprintf(wxBuffer, T("%d"), minValue); + m_staticMin = (WXHWND) CreateWindowEx(0, T("STATIC"), wxBuffer, STATIC_FLAGS, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(), wxGetInstance(), NULL); @@ -106,7 +106,7 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id, else msStyle = SBS_HORZ | WS_CHILD | WS_VISIBLE | WS_TABSTOP ; - HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(m_windowStyle), _T("SCROLLBAR"), wxBuffer, + HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(m_windowStyle), T("SCROLLBAR"), wxBuffer, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); @@ -125,8 +125,8 @@ bool wxSliderMSW::Create(wxWindow *parent, wxWindowID id, SubclassWin(GetHWND()); // Finally, create max value static item - wxSprintf(wxBuffer, _T("%d"), maxValue); - m_staticMax = (WXHWND) CreateWindowEx(0, _T("STATIC"), wxBuffer, + wxSprintf(wxBuffer, T("%d"), maxValue); + m_staticMax = (WXHWND) CreateWindowEx(0, T("STATIC"), wxBuffer, STATIC_FLAGS, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(), wxGetInstance(), NULL); @@ -256,7 +256,7 @@ void wxSliderMSW::SetValue(int value) ::SetScrollPos(GetHwnd(), SB_CTL, value, TRUE); if (m_staticValue) { - wxSprintf(wxBuffer, _T("%d"), value); + wxSprintf(wxBuffer, T("%d"), value); SetWindowText((HWND) m_staticValue, wxBuffer); } } @@ -463,13 +463,13 @@ void wxSliderMSW::SetRange(int minValue, int maxValue) wxChar buf[40]; if ( m_staticMin ) { - wxSprintf(buf, _T("%d"), m_rangeMin); + wxSprintf(buf, T("%d"), m_rangeMin); SetWindowText((HWND) m_staticMin, buf); } if ( m_staticMax ) { - wxSprintf(buf, _T("%d"), m_rangeMax); + wxSprintf(buf, T("%d"), m_rangeMax); SetWindowText((HWND) m_staticMax, buf); } } diff --git a/src/msw/spinbutt.cpp b/src/msw/spinbutt.cpp index 607c4f5826..1b89986f8d 100644 --- a/src/msw/spinbutt.cpp +++ b/src/msw/spinbutt.cpp @@ -133,7 +133,7 @@ void wxSpinButton::SetRange(int minVal, int maxVal) bool wxSpinButton::MSWOnScroll(int orientation, WXWORD wParam, WXWORD pos, WXHWND control) { - wxCHECK_MSG( control, FALSE, _T("scrolling what?") ) + wxCHECK_MSG( control, FALSE, T("scrolling what?") ) if ( wParam != SB_THUMBPOSITION ) { diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index cc8808dd41..1c0042887b 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -87,17 +87,17 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, #ifdef __WIN32__ // create a static control with either SS_BITMAP or SS_ICON style depending // on what we have here - const wxChar *classname = _T("STATIC"); + const wxChar *classname = T("STATIC"); int winstyle = m_isIcon ? SS_ICON : SS_BITMAP; #else // Win16 - const wxChar *classname = _T("BUTTON"); + const wxChar *classname = T("BUTTON"); int winstyle = BS_OWNERDRAW; #endif // Win32 m_hWnd = (WXHWND)::CreateWindow ( classname, - _T(""), + T(""), winstyle | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, (HWND)parent->GetHWND(), @@ -106,7 +106,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, NULL ); - wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create static bitmap") ); + wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create static bitmap") ); SetBitmap(bitmap); diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index 10f9310197..f8d0a9d693 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -75,7 +75,7 @@ bool wxStaticBox::Create(wxWindow *parent, wxWindowID id, WXDWORD exStyle = Determine3DEffects(0, &want3D) ; HWND wx_button = - CreateWindowEx(exStyle, _T("BUTTON"), (const wxChar *)label, msStyle, + CreateWindowEx(exStyle, T("BUTTON"), (const wxChar *)label, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); #if wxUSE_CTL3D diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp index b8de79f67c..17418306b8 100644 --- a/src/msw/statbr95.cpp +++ b/src/msw/statbr95.cpp @@ -97,11 +97,11 @@ bool wxStatusBar95::Create(wxWindow *parent, wxWindowID id, long style) wstyle |= SBARS_SIZEGRIP; m_hWnd = (WXHWND)CreateStatusWindow(wstyle, - _T(""), + T(""), (HWND)parent->GetHWND(), m_windowId); if ( m_hWnd == 0 ) { - wxLogSysError(_T("can't create status bar window")); + wxLogSysError(T("can't create status bar window")); return FALSE; } @@ -191,7 +191,7 @@ void wxStatusBar95::SetFieldsWidth() } if ( !StatusBar_SetParts(hwnd, m_nFields, pWidths) ) { - wxLogLastError(_T("StatusBar_SetParts")); + wxLogLastError(T("StatusBar_SetParts")); } delete [] pWidths; @@ -200,7 +200,7 @@ void wxStatusBar95::SetFieldsWidth() void wxStatusBar95::SetStatusText(const wxString& strText, int nField) { if ( !StatusBar_SetText(hwnd, nField, strText) ) { - wxLogLastError(_T("StatusBar_SetText")); + wxLogLastError(T("StatusBar_SetText")); } } @@ -208,7 +208,7 @@ wxString wxStatusBar95::GetStatusText(int nField) const { wxASSERT( (nField > -1) && (nField < m_nFields) ); - wxString str(_T("")); + wxString str(T("")); int len = StatusBar_GetTextLen(hwnd, nField); if (len > 0) { diff --git a/src/msw/statline.cpp b/src/msw/statline.cpp index 55d237160d..23318390bb 100644 --- a/src/msw/statline.cpp +++ b/src/msw/statline.cpp @@ -64,8 +64,8 @@ bool wxStaticLine::Create( wxWindow *parent, m_hWnd = (WXHWND)::CreateWindow ( - _T("STATIC"), - _T(""), + T("STATIC"), + T(""), WS_VISIBLE | WS_CHILD | SS_GRAYRECT | SS_SUNKEN, // | SS_ETCHEDFRAME, pos.x, pos.y, sizeReal.x, sizeReal.y, @@ -78,7 +78,7 @@ bool wxStaticLine::Create( wxWindow *parent, if ( !m_hWnd ) { #ifdef __WXDEBUG__ - wxLogDebug(_T("Failed to create static control")); + wxLogDebug(T("Failed to create static control")); #endif return FALSE; } diff --git a/src/msw/stattext.cpp b/src/msw/stattext.cpp index 084a748c6c..d8afd05b0c 100644 --- a/src/msw/stattext.cpp +++ b/src/msw/stattext.cpp @@ -72,12 +72,12 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, if ( wxStyleHasBorder(m_windowStyle) ) msStyle |= WS_BORDER; - m_hWnd = (WXHWND)::CreateWindowEx(MakeExtendedStyle(m_windowStyle), _T("STATIC"), (const wxChar *)label, + m_hWnd = (WXHWND)::CreateWindowEx(MakeExtendedStyle(m_windowStyle), T("STATIC"), (const wxChar *)label, msStyle, 0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create static ctrl") ); + wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create static ctrl") ); #if wxUSE_CTL3D /* @@ -103,13 +103,13 @@ wxSize wxStaticText::DoGetBestSize() wxString curLine; for ( const wxChar *pc = text; ; pc++ ) { - if ( *pc == _T('\n') || *pc == _T('\0') ) { + if ( *pc == T('\n') || *pc == T('\0') ) { GetTextExtent(curLine, &widthLine, &heightLine); if ( widthLine > widthTextMax ) widthTextMax = widthLine; heightTextTotal += heightLine; - if ( *pc == _T('\n') ) { + if ( *pc == T('\n') ) { curLine.Empty(); } else { diff --git a/src/msw/tabctrl.cpp b/src/msw/tabctrl.cpp index ee06ee6fe4..67043d3879 100644 --- a/src/msw/tabctrl.cpp +++ b/src/msw/tabctrl.cpp @@ -116,7 +116,7 @@ bool wxTabCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, cons // Create the toolbar control. HWND hWndTabCtrl = CreateWindowEx(0L, // No extended styles. WC_TABCONTROL, // Class name for the tab control - _T(""), // No default text. + T(""), // No default text. WS_CHILD | WS_BORDER | WS_VISIBLE | tabStyle, // Styles and defaults. x, y, width, height, // Standard size and position. (HWND) parent->GetHWND(), // Parent window @@ -244,7 +244,7 @@ int wxTabCtrl::GetRowCount() const wxString wxTabCtrl::GetItemText(int item) const { wxChar buf[256]; - wxString str(_T("")); + wxString str(T("")); TC_ITEM tcItem; tcItem.mask = TCIF_TEXT; tcItem.pszText = buf; @@ -306,7 +306,7 @@ bool wxTabCtrl::InsertItem(int item, const wxString& text, int imageId, void* da TC_ITEM tcItem; tcItem.mask = TCIF_PARAM; tcItem.lParam = (long) data; - if (text != _T("")) + if (text != T("")) { tcItem.mask |= TCIF_TEXT; wxStrcpy(buf, (const wxChar*) text); diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 36d0de6c52..b64a50cdf1 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -51,7 +51,7 @@ LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg, UINT wParam, LONG lParam ); -wxChar *wxTaskBarWindowClass = _T("wxTaskBarWindowClass"); +wxChar *wxTaskBarWindowClass = T("wxTaskBarWindowClass"); wxList wxTaskBarIcon::sm_taskBarIcons; bool wxTaskBarIcon::sm_registeredClass = FALSE; @@ -120,7 +120,7 @@ bool wxTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) notifyData.hIcon = (HICON) icon.GetHICON(); } - if (((const wxChar*) tooltip != NULL) && (tooltip != _T(""))) + if (((const wxChar*) tooltip != NULL) && (tooltip != T(""))) { notifyData.uFlags |= NIF_TIP ; lstrcpyn(notifyData.szTip, WXSTRINGCAST tooltip, sizeof(notifyData.szTip)); @@ -262,7 +262,7 @@ bool wxTaskBarIcon::RegisterWindowClass() return TRUE; // Also register the taskbar message here - sm_taskbarMsg = ::RegisterWindowMessage(_T("wxTaskBarIconMessage")); + sm_taskbarMsg = ::RegisterWindowMessage(T("wxTaskBarIconMessage")); WNDCLASS wc; bool rc; @@ -294,7 +294,7 @@ WXHWND wxTaskBarIcon::CreateTaskBarWindow() HINSTANCE hInstance = GetModuleHandle(NULL); HWND hWnd = CreateWindowEx (0, wxTaskBarWindowClass, - _T("wxTaskBarWindow"), + T("wxTaskBarWindow"), WS_OVERLAPPED, 0, 0, diff --git a/src/msw/tbar95.cpp b/src/msw/tbar95.cpp index 51c70e7556..89e95ab321 100644 --- a/src/msw/tbar95.cpp +++ b/src/msw/tbar95.cpp @@ -109,7 +109,7 @@ bool wxToolBar95::Create(wxWindow *parent, m_foregroundColour = *wxBLACK ; wxASSERT_MSG( (style & wxTB_VERTICAL) == 0, - _T("Sorry, wxToolBar95 under Windows 95 only " + T("Sorry, wxToolBar95 under Windows 95 only " "supports horizontal orientation.") ); m_maxWidth = -1; @@ -165,7 +165,7 @@ bool wxToolBar95::Create(wxWindow *parent, ( exStyle, // Extended styles. TOOLBARCLASSNAME, // Class name for the toolbar. - _T(""), // No default text. + T(""), // No default text. msflags, // Styles x, y, width, height, // Standard toolbar size and position. (HWND) parent->GetHWND(), // Parent window of the toolbar. @@ -174,7 +174,7 @@ bool wxToolBar95::Create(wxWindow *parent, NULL // No class data. ); - wxCHECK_MSG( hWndToolbar, FALSE, _T("Toolbar creation failed") ); + wxCHECK_MSG( hWndToolbar, FALSE, T("Toolbar creation failed") ); // Toolbar-specific initialisation ::SendMessage(hWndToolbar, TB_BUTTONSTRUCTSIZE, @@ -257,7 +257,7 @@ bool wxToolBar95::CreateTools() replaceBitmap.nButtons = noButtons; if (::SendMessage((HWND) GetHWND(), TB_REPLACEBITMAP, (WPARAM) 0, (LPARAM) &replaceBitmap) == -1) { - wxFAIL_MSG(_T("Could not add bitmap to toolbar")); + wxFAIL_MSG(T("Could not add bitmap to toolbar")); } ::DeleteObject((HBITMAP) oldToolBarBitmap); @@ -278,7 +278,7 @@ bool wxToolBar95::CreateTools() addBitmap.nID = (UINT)m_hBitmap; if (::SendMessage((HWND) GetHWND(), TB_ADDBITMAP, (WPARAM) noButtons, (LPARAM) &addBitmap) == -1) { - wxFAIL_MSG(_T("Could not add bitmap to toolbar")); + wxFAIL_MSG(T("Could not add bitmap to toolbar")); } } @@ -324,7 +324,7 @@ bool wxToolBar95::CreateTools() long rc = ::SendMessage((HWND) GetHWND(), TB_ADDBUTTONS, (WPARAM)i, (LPARAM)& buttons); - wxCHECK_MSG( rc, FALSE, _T("failed to add buttons to the toolbar") ); + wxCHECK_MSG( rc, FALSE, T("failed to add buttons to the toolbar") ); (void)::SendMessage((HWND) GetHWND(), TB_AUTOSIZE, (WPARAM)0, (LPARAM) 0); diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 6965ccf42a..79cab1c444 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -129,7 +129,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, if ( m_windowStyle & wxTE_MULTILINE ) { wxASSERT_MSG( !(m_windowStyle & wxTE_PROCESS_ENTER), - _T("wxTE_PROCESS_ENTER style is ignored for multiline " + T("wxTE_PROCESS_ENTER style is ignored for multiline " "text controls (they always process it)") ); msStyle |= ES_MULTILINE | ES_WANTRETURN; @@ -167,14 +167,14 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, m_lDlgCode |= DLGC_WANTTAB; // do create the control - either an EDIT or RICHEDIT - const wxChar *windowClass = _T("EDIT"); + const wxChar *windowClass = T("EDIT("); #if wxUSE_RICHEDIT if ( m_windowStyle & wxTE_RICH ) { msStyle |= ES_AUTOVSCROLL; m_isRich = TRUE; - windowClass = _T("RICHEDIT"); + windowClass = T("RICHEDIT("); } else m_isRich = FALSE; @@ -201,7 +201,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, wxGetInstance(), NULL); - wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create text ctrl") ); + wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create text ctrl") ); #if wxUSE_CTL3D if ( want3D ) @@ -260,7 +260,7 @@ void wxTextCtrl::AdoptAttributesFromHWND() GetClassName(hWnd, buf, WXSIZEOF(buf)); - if ( wxStricmp(buf, _T("EDIT")) == 0 ) + if ( wxStricmp(buf, T("EDIT(")) == 0 ) m_isRich = FALSE; else m_isRich = TRUE; @@ -318,7 +318,7 @@ void wxTextCtrl::AppendText(const wxString& text) void wxTextCtrl::Clear() { - SetWindowText(GetHwnd(), _T("")); + SetWindowText(GetHwnd(), T("")); } // ---------------------------------------------------------------------------- diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index ba50980e8e..8ac282a86e 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -105,7 +105,7 @@ wxMutex::wxMutex() wxMutex::~wxMutex() { if (m_locked > 0) - wxLogDebug(_T("Warning: freeing a locked mutex (%d locks)."), m_locked); + wxLogDebug(T("Warning: freeing a locked mutex (%d locks)."), m_locked); CloseHandle(p_internal->p_mutex); } @@ -129,7 +129,7 @@ wxMutexError wxMutex::Lock() case WAIT_TIMEOUT: default: - wxFAIL_MSG(_T("impossible return value in wxMutex::Lock")); + wxFAIL_MSG(T("impossible return value in wxMutex::Lock")); } m_locked++; @@ -375,7 +375,7 @@ bool wxThreadInternal::Create(wxThread *thread) win_priority = THREAD_PRIORITY_HIGHEST; else { - wxFAIL_MSG(_T("invalid value of thread priority parameter")); + wxFAIL_MSG(T("invalid value of thread priority parameter")); win_priority = THREAD_PRIORITY_NORMAL; } @@ -575,7 +575,7 @@ wxThread::ExitCode wxThread::Delete() break; default: - wxFAIL_MSG(_T("unexpected result of MsgWaitForMultipleObject")); + wxFAIL_MSG(T("unexpected result of MsgWaitForMultipleObject")); } } while ( result != WAIT_OBJECT_0 ); @@ -594,7 +594,7 @@ wxThread::ExitCode wxThread::Delete() } wxASSERT_MSG( (LPVOID)rc != (LPVOID)STILL_ACTIVE, - _T("thread must be already terminated.") ); + T("thread must be already terminated.") ); ::CloseHandle(hThread); } @@ -625,7 +625,7 @@ void wxThread::Exit(void *status) ::ExitThread((DWORD)status); - wxFAIL_MSG(_T("Couldn't return from ExitThread()!")); + wxFAIL_MSG(T("Couldn't return from ExitThread()!")); } void wxThread::SetPriority(unsigned int prio) @@ -770,7 +770,7 @@ void WXDLLEXPORT wxMutexGuiEnter() { // this would dead lock everything... wxASSERT_MSG( !wxThread::IsMain(), - _T("main thread doesn't want to block in wxMutexGuiEnter()!") ); + T("main thread doesn't want to block in wxMutexGuiEnter()!") ); // the order in which we enter the critical sections here is crucial!! @@ -800,7 +800,7 @@ void WXDLLEXPORT wxMutexGuiLeave() { // decrement the number of waiters now wxASSERT_MSG( s_nWaitingForGui > 0, - _T("calling wxMutexGuiLeave() without entering it first?") ); + T("calling wxMutexGuiLeave() without entering it first?") ); s_nWaitingForGui--; @@ -813,7 +813,7 @@ void WXDLLEXPORT wxMutexGuiLeave() void WXDLLEXPORT wxMutexGuiLeaveOrEnter() { wxASSERT_MSG( wxThread::IsMain(), - _T("only main thread may call wxMutexGuiLeaveOrEnter()!") ); + T("only main thread may call wxMutexGuiLeaveOrEnter()!") ); wxCriticalSectionLocker enter(*s_critsectWaitingForGui); diff --git a/src/msw/timer.cpp b/src/msw/timer.cpp index 6189c29160..d8cc8bd472 100644 --- a/src/msw/timer.cpp +++ b/src/msw/timer.cpp @@ -90,7 +90,7 @@ bool wxTimer::Start(int milliseconds, bool mode) if (milliseconds < 0) milliseconds = lastMilli; - wxCHECK_MSG( milliseconds > 0, FALSE, _T("invalid value for timer timeour") ); + wxCHECK_MSG( milliseconds > 0, FALSE, T("invalid value for timer timeour") ); lastMilli = milli = milliseconds; @@ -143,7 +143,7 @@ UINT WINAPI _EXPORT wxTimerProc(HWND WXUNUSED(hwnd), WORD, int idTimer, DWORD) { wxNode *node = wxTimerList.Find((long)idTimer); - wxCHECK_MSG( node, 0, _T("bogus timer id in wxTimerProc") ); + wxCHECK_MSG( node, 0, T("bogus timer id in wxTimerProc") ); wxProcessTimer(*(wxTimer *)node->Data()); diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index a6eb5f572f..e51192d9d9 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -352,7 +352,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_CHECKED) ) { - wxLogLastError(_T("DrawFrameControl(check)")); + wxLogLastError(T("DrawFrameControl(check)")); } bmp.SetHBITMAP((WXHBITMAP)hbmpCheck); @@ -362,7 +362,7 @@ bool wxTreeCtrl::Create(wxWindow *parent, DFC_BUTTON, DFCS_BUTTONCHECK) ) { - wxLogLastError(_T("DrawFrameControl(uncheck)")); + wxLogLastError(T("DrawFrameControl(uncheck)")); } bmp.SetHBITMAP((WXHBITMAP)hbmpCheck); @@ -480,7 +480,7 @@ wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const if ( !DoGetItem(&tvItem) ) { // don't return some garbage which was on stack, but an empty string - buf[0] = _T('\0'); + buf[0] = T('\0'); } return wxString(buf); @@ -555,7 +555,7 @@ int wxTreeCtrl::GetItemImage(const wxTreeItemId& item, switch ( which ) { default: - wxFAIL_MSG( _T("unknown tree item image type") ); + wxFAIL_MSG( T("unknown tree item image type") ); case wxTreeItemIcon_Normal: mask = TVIF_IMAGE; @@ -583,7 +583,7 @@ void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, int image, switch ( which ) { default: - wxFAIL_MSG( _T("unknown tree item image type") ); + wxFAIL_MSG( T("unknown tree item image type") ); case wxTreeItemIcon_Normal: imageNormal = image; @@ -659,7 +659,7 @@ void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data) } else { - wxFAIL_MSG( _T("failed to change tree items data") ); + wxFAIL_MSG( T("failed to change tree items data") ); } } else @@ -676,7 +676,7 @@ void wxTreeCtrl::SetIndirectItemData(const wxTreeItemId& item, // to crash too because the code elsewhere supposes that the pointer the // wxTreeItemIndirectData has is a real wxItemData and not // wxTreeItemIndirectData as well - wxASSERT_MSG( !HasIndirectData(item), _T("setting indirect data twice?") ); + wxASSERT_MSG( !HasIndirectData(item), T("setting indirect data twice?") ); SetItemData(item, (wxTreeItemData *)data); @@ -768,7 +768,7 @@ wxTreeItemId wxTreeCtrl::GetRootItem() const wxTreeItemId wxTreeCtrl::GetSelection() const { wxCHECK_MSG( !(m_windowStyle & wxTR_MULTIPLE), (WXHTREEITEM)0, - _T("this only works with single selection controls") ); + T("this only works with single selection controls") ); return wxTreeItemId((WXHTREEITEM) TreeView_GetSelection(GetHwnd())); } @@ -830,7 +830,7 @@ wxTreeItemId wxTreeCtrl::GetFirstVisibleItem() const wxTreeItemId wxTreeCtrl::GetNextVisible(const wxTreeItemId& item) const { - wxASSERT_MSG( IsVisible(item), _T("The item you call GetNextVisible() " + wxASSERT_MSG( IsVisible(item), T("The item you call GetNextVisible() " "for must be visible itself!")); return wxTreeItemId((WXHTREEITEM) TreeView_GetNextVisible(GetHwnd(), (HTREEITEM) (WXHTREEITEM) item)); @@ -838,7 +838,7 @@ wxTreeItemId wxTreeCtrl::GetNextVisible(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const { - wxASSERT_MSG( IsVisible(item), _T("The item you call GetPrevVisible() " + wxASSERT_MSG( IsVisible(item), T("The item you call GetPrevVisible() " "for must be visible itself!")); return wxTreeItemId((WXHTREEITEM) TreeView_GetPrevVisible(GetHwnd(), (HTREEITEM) (WXHTREEITEM) item)); @@ -1036,7 +1036,7 @@ void wxTreeCtrl::DoExpand(const wxTreeItemId& item, int flag) flag == (TVE_COLLAPSE | TVE_COLLAPSERESET) || flag == TVE_EXPAND || flag == TVE_TOGGLE, - _T("Unknown flag in wxTreeCtrl::DoExpand") ); + T("Unknown flag in wxTreeCtrl::DoExpand") ); // TreeView_Expand doesn't send TVN_ITEMEXPAND(ING) messages, so we must // emulate them. This behaviour has changed slightly with comctl32.dll @@ -1096,7 +1096,7 @@ void wxTreeCtrl::ExpandItem(const wxTreeItemId& item, int action) void wxTreeCtrl::Unselect() { - wxASSERT_MSG( !(m_windowStyle & wxTR_MULTIPLE), _T("doesn't make sense") ); + wxASSERT_MSG( !(m_windowStyle & wxTR_MULTIPLE), T("doesn't make sense") ); // just remove the selection SelectItem(wxTreeItemId((WXHTREEITEM) 0)); @@ -1274,7 +1274,7 @@ static int CALLBACK TreeView_CompareCallback(wxTreeItemData *pItem1, wxTreeCtrl *tree) { wxCHECK_MSG( pItem1 && pItem2, 0, - _T("sorting tree without data doesn't make sense") ); + T("sorting tree without data doesn't make sense") ); return tree->OnCompareItems(pItem1->GetId(), pItem2->GetId()); } @@ -1423,7 +1423,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) break; default: - wxLogDebug(_T("unexpected code %d in TVN_ITEMEXPAND " + wxLogDebug(T("unexpected code %d in TVN_ITEMEXPAND " "message"), tv->action); } diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 35c2de8be9..a4d3fbe045 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -119,10 +119,10 @@ /// END for console support // In the WIN.INI file -static const wxChar WX_SECTION[] = _T("wxWindows"); -static const wxChar eHOSTNAME[] = _T("HostName"); -static const wxChar eUSERID[] = _T("UserId"); -static const wxChar eUSERNAME[] = _T("UserName"); +static const wxChar WX_SECTION[] = T("wxWindows"); +static const wxChar eHOSTNAME[] = T("HostName"); +static const wxChar eUSERID[] = T("UserId"); +static const wxChar eUSERNAME[] = T("UserName"); // For the following functions we SHOULD fill in support // for Windows-NT (which I don't know) as I assume it begin @@ -137,13 +137,13 @@ bool wxGetHostName(wxChar *buf, int maxSize) return (::GetComputerName(buf, &nSize) != 0); #else wxChar *sysname; - const wxChar *default_host = _T("noname"); + const wxChar *default_host = T("noname"); - if ((sysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL) { + if ((sysname = wxGetenv(T("SYSTEM_NAME"))) == NULL) { GetProfileString(WX_SECTION, eHOSTNAME, default_host, buf, maxSize - 1); } else wxStrncpy(buf, sysname, maxSize - 1); - buf[maxSize] = _T('\0'); + buf[maxSize] = T('\0'); return *buf ? TRUE : FALSE; #endif } @@ -156,7 +156,7 @@ bool wxGetUserId(wxChar *buf, int maxSize) if ( ::GetUserName(buf, &nSize) == 0 ) { // actually, it does happen on Win9x if the user didn't log on - DWORD res = ::GetEnvironmentVariable(_T("username"), buf, maxSize); + DWORD res = ::GetEnvironmentVariable(T("username"), buf, maxSize); if ( res == 0 ) { // not found @@ -167,12 +167,12 @@ bool wxGetUserId(wxChar *buf, int maxSize) return TRUE; #else // Win16 or Win32s wxChar *user; - const wxChar *default_id = _T("anonymous"); + const wxChar *default_id = T("anonymous"); // Can't assume we have NIS (PC-NFS) or some other ID daemon // So we ... - if ( (user = wxGetenv(_T("USER"))) == NULL && - (user = wxGetenv(_T("LOGNAME"))) == NULL ) + if ( (user = wxGetenv(T("USER"))) == NULL && + (user = wxGetenv(T("LOGNAME"))) == NULL ) { // Use wxWindows configuration data (comming soon) GetProfileString(WX_SECTION, eUSERID, default_id, buf, maxSize - 1); @@ -225,7 +225,7 @@ bool wxGetUserName(wxChar *buf, int maxSize) // Get the computer name of a DC for the domain. if ( NetGetDCName( NULL, wszDomain, &ComputerName ) != NERR_Success ) { - wxLogError(_T("Can not find domain controller")); + wxLogError(T("Can not find domain controller")); goto error; } @@ -242,17 +242,17 @@ bool wxGetUserName(wxChar *buf, int maxSize) break; case NERR_InvalidComputer: - wxLogError(_T("Invalid domain controller name.")); + wxLogError(T("Invalid domain controller name.")); goto error; case NERR_UserNotFound: - wxLogError(_T("Invalid user name '%s'."), szUserName); + wxLogError(T("Invalid user name '%s'."), szUserName); goto error; default: - wxLogSysError(_T("Can't get information about user")); + wxLogSysError(T("Can't get information about user")); goto error; } @@ -264,13 +264,13 @@ bool wxGetUserName(wxChar *buf, int maxSize) return TRUE; error: - wxLogError(_T("Couldn't look up full user name.")); + wxLogError(T("Couldn't look up full user name.")); return FALSE; #else // !USE_NET_API // Could use NIS, MS-Mail or other site specific programs // Use wxWindows configuration data - bool ok = GetProfileString(WX_SECTION, eUSERNAME, _T(""), buf, maxSize - 1) != 0; + bool ok = GetProfileString(WX_SECTION, eUSERNAME, T(""), buf, maxSize - 1) != 0; if ( !ok ) { ok = wxGetUserId(buf, maxSize); @@ -278,7 +278,7 @@ error: if ( !ok ) { - wxStrncpy(buf, _T("Unknown User"), maxSize); + wxStrncpy(buf, T("Unknown User"), maxSize); } #endif // Win32/16 } @@ -298,12 +298,12 @@ bool wxShell(const wxString& command) { wxChar *shell; - if ((shell = wxGetenv(_T("COMSPEC"))) == NULL) - shell = _T("\\COMMAND.COM"); + if ((shell = wxGetenv(T("COMSPEC"))) == NULL) + shell = T("\\COMMAND.COM"); wxChar tmp[255]; - if (command != _T("")) - wxSprintf(tmp, _T("%s /c %s"), shell, WXSTRINGCAST command); + if (command != T("")) + wxSprintf(tmp, T("%s /c %s"), shell, WXSTRINGCAST command); else wxStrcpy(tmp, shell); @@ -405,7 +405,7 @@ void wxDebugMsg(const wxChar *fmt ...) // Non-fatal error: pop up message box and (possibly) continue void wxError(const wxString& msg, const wxString& title) { - wxSprintf(wxBuffer, _T("%s\nContinue?"), WXSTRINGCAST msg); + wxSprintf(wxBuffer, T("%s\nContinue?"), WXSTRINGCAST msg); if (MessageBox(NULL, (LPCTSTR)wxBuffer, (LPCTSTR)WXSTRINGCAST title, MB_ICONSTOP | MB_YESNO) == IDNO) wxExit(); @@ -414,7 +414,7 @@ void wxError(const wxString& msg, const wxString& title) // Fatal error: pop up message box and abort void wxFatalError(const wxString& msg, const wxString& title) { - wxSprintf(wxBuffer, _T("%s: %s"), WXSTRINGCAST title, WXSTRINGCAST msg); + wxSprintf(wxBuffer, T("%s: %s"), WXSTRINGCAST title, WXSTRINGCAST msg); FatalAppExit(0, (LPCTSTR)wxBuffer); } @@ -482,7 +482,7 @@ int wxGetOsVersion(int *majorVsn, int *minorVsn) #if wxUSE_RESOURCES bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file) { - if (file != _T("")) + if (file != T("")) return (WritePrivateProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)value, (LPCTSTR)WXSTRINGCAST file) != 0); else return (WriteProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)WXSTRINGCAST value) != 0); @@ -491,28 +491,28 @@ bool wxWriteResource(const wxString& section, const wxString& entry, const wxStr bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file) { wxChar buf[50]; - wxSprintf(buf, _T("%.4f"), value); + wxSprintf(buf, T("%.4f"), value); return wxWriteResource(section, entry, buf, file); } bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file) { wxChar buf[50]; - wxSprintf(buf, _T("%ld"), value); + wxSprintf(buf, T("%ld"), value); return wxWriteResource(section, entry, buf, file); } bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file) { wxChar buf[50]; - wxSprintf(buf, _T("%d"), value); + wxSprintf(buf, T("%d"), value); return wxWriteResource(section, entry, buf, file); } bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file) { - static const wxChar defunkt[] = _T("$$default"); - if (file != _T("")) + static const wxChar defunkt[] = T("$$default"); + if (file != T("")) { int n = GetPrivateProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)defunkt, (LPTSTR)wxBuffer, 1000, (LPCTSTR)WXSTRINGCAST file); @@ -594,7 +594,7 @@ void wxBeginBusyCursor(wxCursor *cursor) void wxEndBusyCursor() { wxCHECK_RET( gs_wxBusyCursorCount > 0, - _T("no matching wxBeginBusyCursor() for wxEndBusyCursor()") ); + T("no matching wxBeginBusyCursor() for wxEndBusyCursor()") ); if ( --gs_wxBusyCursorCount == 0 ) { @@ -620,20 +620,20 @@ const wxChar* wxGetHomeDir(wxString *pstr) if ( szHome == NULL ) { // we're homeless... wxLogWarning(_("can't find user's HOME, using current directory.")); - strDir = _T("."); + strDir = T("."); } else strDir = szHome; // add a trailing slash if needed - if ( strDir.Last() != _T('/') ) - strDir << _T('/'); + if ( strDir.Last() != T('/') ) + strDir << T('/'); #else // Windows #ifdef __WIN32__ - const wxChar *szHome = wxGetenv(_T("HOMEDRIVE")); + const wxChar *szHome = wxGetenv(T("HOMEDRIVE")); if ( szHome != NULL ) strDir << szHome; - szHome = wxGetenv(_T("HOMEPATH")); + szHome = wxGetenv(T("HOMEPATH")); if ( szHome != NULL ) { strDir << szHome; @@ -643,7 +643,7 @@ const wxChar* wxGetHomeDir(wxString *pstr) // create it in our program's dir. However, if the user took care // to set HOMEPATH to something other than "\\", we suppose that he // knows what he is doing and use the supplied value. - if ( wxStrcmp(szHome, _T("\\")) != 0 ) + if ( wxStrcmp(szHome, T("\\")) != 0 ) return strDir.c_str(); } @@ -675,22 +675,22 @@ wxChar *wxGetUserHome (const wxString& user) wxChar *home; wxString user1(user); - if (user1 != _T("")) { + if (user1 != T("")) { wxChar tmp[64]; if (wxGetUserId(tmp, sizeof(tmp)/sizeof(char))) { // Guests belong in the temp dir - if (wxStricmp(tmp, _T("annonymous")) == 0) { - if ((home = wxGetenv(_T("TMP"))) != NULL || - (home = wxGetenv(_T("TMPDIR"))) != NULL || - (home = wxGetenv(_T("TEMP"))) != NULL) - return *home ? home : (wxChar*)_T("\\"); + if (wxStricmp(tmp, T("annonymous")) == 0) { + if ((home = wxGetenv(T("TMP"))) != NULL || + (home = wxGetenv(T("TMPDIR"))) != NULL || + (home = wxGetenv(T("TEMP"))) != NULL) + return *home ? home : (wxChar*)T("\\"); } if (wxStricmp(tmp, WXSTRINGCAST user1) == 0) - user1 = _T(""); + user1 = T(""); } } - if (user1 == _T("")) - if ((home = wxGetenv(_T("HOME"))) != NULL) + if (user1 == T("")) + if ((home = wxGetenv(T("HOME"))) != NULL) { wxStrcpy(wxBuffer, home); Unix2DosFilename(wxBuffer); @@ -713,7 +713,7 @@ bool wxCheckForInterrupt(wxWindow *wnd) return TRUE;//*** temporary? } else{ - wxFAIL_MSG(_T("wnd==NULL !!!")); + wxFAIL_MSG(T("wnd==NULL !!!")); return FALSE;//*** temporary? } @@ -1132,26 +1132,26 @@ void OutputDebugStringW95(const wxChar* lpOutputString, ...) } /* make sure DBWIN is open and waiting */ - heventDBWIN = OpenEvent(EVENT_MODIFY_STATE, FALSE, _T("DBWIN_BUFFER_READY")); + heventDBWIN = OpenEvent(EVENT_MODIFY_STATE, FALSE, T("DBWIN_BUFFER_READY")); if ( !heventDBWIN ) { - //MessageBox(NULL, _T("DBWIN_BUFFER_READY nonexistent"), NULL, MB_OK); + //MessageBox(NULL, T("DBWIN_BUFFER_READY nonexistent"), NULL, MB_OK); return; } /* get a handle to the data synch object */ - heventData = OpenEvent(EVENT_MODIFY_STATE, FALSE, _T("DBWIN_DATA_READY")); + heventData = OpenEvent(EVENT_MODIFY_STATE, FALSE, T("DBWIN_DATA_READY")); if ( !heventData ) { - // MessageBox(NULL, _T("DBWIN_DATA_READY nonexistent"), NULL, MB_OK); + // MessageBox(NULL, T("DBWIN_DATA_READY nonexistent"), NULL, MB_OK); CloseHandle(heventDBWIN); return; } - hSharedFile = CreateFileMapping((HANDLE)-1, NULL, PAGE_READWRITE, 0, 4096, _T("DBWIN_BUFFER")); + hSharedFile = CreateFileMapping((HANDLE)-1, NULL, PAGE_READWRITE, 0, 4096, T("DBWIN_BUFFER")); if (!hSharedFile) { - //MessageBox(NULL, _T("DebugTrace: Unable to create file mapping object DBWIN_BUFFER"), _T("Error"), MB_OK); + //MessageBox(NULL, T("DebugTrace: Unable to create file mapping object DBWIN_BUFFER"), T("Error"), MB_OK); CloseHandle(heventDBWIN); CloseHandle(heventData); return; @@ -1160,7 +1160,7 @@ void OutputDebugStringW95(const wxChar* lpOutputString, ...) lpszSharedMem = (LPSTR)MapViewOfFile(hSharedFile, FILE_MAP_WRITE, 0, 0, 512); if (!lpszSharedMem) { - //MessageBox(NULL, _T("DebugTrace: Unable to map shared memory"), _T("Error"), MB_OK); + //MessageBox(NULL, T("DebugTrace: Unable to map shared memory"), T("Error"), MB_OK); CloseHandle(heventDBWIN); CloseHandle(heventData); return; @@ -1176,7 +1176,7 @@ void OutputDebugStringW95(const wxChar* lpOutputString, ...) *((LPDWORD)lpszSharedMem) = _getpid(); #endif - wsprintf((LPTSTR)(lpszSharedMem + sizeof(DWORD)), _T("%s"), achBuffer); + wsprintf((LPTSTR)(lpszSharedMem + sizeof(DWORD)), T("%s"), achBuffer); /* signal data ready event */ SetEvent(heventData); diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index 9363e5947b..a05db17293 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -109,7 +109,7 @@ static DWORD wxExecuteThread(wxExecuteData *data) } wxASSERT_MSG( data->dwExitCode != STILL_ACTIVE, - _T("process should have terminated") ); + T("process should have terminated") ); // send a message indicating process termination to the window SendMessage(data->hWnd, wxWM_PROC_TERMINATED, 0, (LPARAM)data); @@ -154,7 +154,7 @@ extern wxChar wxPanelClassName[]; long wxExecute(const wxString& command, bool sync, wxProcess *handler) { - wxCHECK_MSG( !!command, 0, _T("empty command in wxExecute") ); + wxCHECK_MSG( !!command, 0, T("empty command in wxExecute") ); #if defined(__WIN32__) && !defined(__TWIN32__) // the old code is disabled because we really need a process handle @@ -250,7 +250,7 @@ long wxExecute(const wxString& command, bool sync, wxProcess *handler) // termination HWND hwnd = ::CreateWindow(wxPanelClassName, NULL, 0, 0, 0, 0, 0, NULL, (HMENU)NULL, wxGetInstance(), 0); - wxASSERT_MSG( hwnd, _T("can't create a hidden window for wxExecute") ); + wxASSERT_MSG( hwnd, T("can't create a hidden window for wxExecute") ); FARPROC ExecuteWindowInstance = MakeProcInstance((FARPROC)wxExecuteWindowCbk, wxGetInstance()); @@ -265,7 +265,7 @@ long wxExecute(const wxString& command, bool sync, wxProcess *handler) data->state = sync; if ( sync ) { - wxASSERT_MSG( !handler, _T("wxProcess param ignored for sync execution") ); + wxASSERT_MSG( !handler, T("wxProcess param ignored for sync execution") ); data->handler = NULL; } diff --git a/src/msw/wave.cpp b/src/msw/wave.cpp index 19b164f5a0..699b92ebee 100644 --- a/src/msw/wave.cpp +++ b/src/msw/wave.cpp @@ -76,12 +76,12 @@ bool wxWave::Create(const wxString& fileName, bool isResource) HRSRC hresInfo; #if defined(__WIN32__) && !defined(__TWIN32__) #ifdef _UNICODE - hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, _T("WAVE")); + hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, T("WAVE")); #else - hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, _T("WAVE")); + hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, T("WAVE")); #endif #else - hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, _T("WAVE")); + hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, T("WAVE")); #endif if (!hresInfo) return FALSE; diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 380abf22fe..b2f9493965 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -297,7 +297,7 @@ bool wxWindow::Create(wxWindow *parent, wxWindowID id, long style, const wxString& name) { - wxCHECK_MSG( parent, FALSE, _T("can't create wxWindow without parent") ); + wxCHECK_MSG( parent, FALSE, T("can't create wxWindow without parent") ); if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) return FALSE; @@ -448,7 +448,7 @@ bool wxWindow::SetFont(const wxFont& font) { WXHANDLE hFont = m_font.GetResourceHandle(); - wxASSERT_MSG( hFont, _T("should have valid font") ); + wxASSERT_MSG( hFont, T("should have valid font") ); ::SendMessage(hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); } @@ -464,7 +464,7 @@ bool wxWindow::SetCursor(const wxCursor& cursor) } wxASSERT_MSG( m_cursor.Ok(), - _T("cursor must be valid after call to the base version")); + T("cursor must be valid after call to the base version")); HWND hWnd = GetHwnd(); @@ -801,10 +801,10 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) void wxWindow::SubclassWin(WXHWND hWnd) { - wxASSERT_MSG( !m_oldWndProc, _T("subclassing window twice?") ); + wxASSERT_MSG( !m_oldWndProc, T("subclassing window twice?") ); HWND hwnd = (HWND)hWnd; - wxCHECK_RET( ::IsWindow(hwnd), _T("invalid HWND in SubclassWin") ); + wxCHECK_RET( ::IsWindow(hwnd), T("invalid HWND in SubclassWin") ); wxAssociateWinWithHandle(hwnd, this); @@ -822,7 +822,7 @@ void wxWindow::UnsubclassWin() { m_hWnd = 0; - wxCHECK_RET( ::IsWindow(hwnd), _T("invalid HWND in UnsubclassWin") ); + wxCHECK_RET( ::IsWindow(hwnd), T("invalid HWND in UnsubclassWin") ); FARPROC farProc = (FARPROC) GetWindowLong(hwnd, GWL_WNDPROC); if ( (m_oldWndProc != 0) && (farProc != (FARPROC) m_oldWndProc) ) @@ -1709,7 +1709,7 @@ LRESULT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARA { // trace all messages - useful for the debugging #ifdef __WXDEBUG__ - wxLogTrace(wxTraceMessages, _T("Processing %s(wParam=%8lx, lParam=%8lx)"), + wxLogTrace(wxTraceMessages, T("Processing %s(wParam=%8lx, lParam=%8lx)"), wxGetMessageName(message), wParam, lParam); #endif // __WXDEBUG__ @@ -2094,7 +2094,7 @@ long wxWindow::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) if ( !processed ) { #ifdef __WXDEBUG__ - wxLogTrace(wxTraceMessages, _T("Forwarding %s to DefWindowProc."), + wxLogTrace(wxTraceMessages, T("Forwarding %s to DefWindowProc."), wxGetMessageName(message)); #endif // __WXDEBUG__ rc.result = MSWDefWindowProc(message, wParam, lParam); @@ -2139,7 +2139,7 @@ void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win) // adding NULL hWnd is (first) surely a result of an error and // (secondly) breaks menu command processing wxCHECK_RET( hWnd != (HWND)NULL, - _T("attempt to add a NULL hWnd to window list ignored") ); + T("attempt to add a NULL hWnd to window list ignored") ); wxWindow *oldWin = wxFindWinFromHandle((WXHWND) hWnd); @@ -2191,12 +2191,12 @@ void wxWindow::MSWDetachWindowMenu() int chars = GetMenuString(hMenu, i, buf, 100, MF_BYPOSITION); if ( !chars ) { - wxLogLastError(_T("GetMenuString")); + wxLogLastError(T("GetMenuString")); continue; } - if ( wxStrcmp(buf, _T("&Window")) == 0 ) + if ( wxStrcmp(buf, T("&Window")) == 0 ) { RemoveMenu(hMenu, i, MF_BYPOSITION); @@ -2272,14 +2272,14 @@ bool wxWindow::MSWCreate(int id, if ( !::SetWindowPos(GetHwnd(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE) ) { - wxLogLastError(_T("SetWindowPos")); + wxLogLastError(T("SetWindowPos")); } } // move the dialog to its initial position without forcing repainting if ( !::MoveWindow(GetHwnd(), x1, y1, width1, height1, FALSE) ) { - wxLogLastError(_T("MoveWindow")); + wxLogLastError(T("MoveWindow")); } } else @@ -2291,12 +2291,12 @@ bool wxWindow::MSWCreate(int id, wxString className(wclass); if ( GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE ) { - className += _T("NR"); + className += T("NR"); } m_hWnd = (WXHWND)CreateWindowEx(extendedStyle, wclass, - title ? title : _T(""), + title ? title : T(""), style, x1, y1, width1, height1, @@ -3271,7 +3271,7 @@ bool wxWindow::HandleJoystickEvent(WXUINT msg, int x, int y, WXUINT flags) break; default: - wxFAIL_MSG(_T("no such joystick event")); + wxFAIL_MSG(T("no such joystick event")); return FALSE; } @@ -3622,13 +3622,13 @@ const char *wxGetMessageName(int message) case 0x0008: return "WM_KILLFOCUS"; case 0x000A: return "WM_ENABLE"; case 0x000B: return "WM_SETREDRAW"; - case 0x000C: return "WM_SETTEXT"; - case 0x000D: return "WM_GETTEXT"; + case 0x000C: return "WM_SETTEXT("; + case 0x000D: return "WM_GETTEXT("; case 0x000E: return "WM_GETTEXTLENGTH"; - case 0x000F: return "WM_PAINT"; + case 0x000F: return "WM_PAINT("; case 0x0010: return "WM_CLOSE"; case 0x0011: return "WM_QUERYENDSESSION"; - case 0x0012: return "WM_QUIT"; + case 0x0012: return "WM_QUIT("; case 0x0013: return "WM_QUERYOPEN"; case 0x0014: return "WM_ERASEBKGND"; case 0x0015: return "WM_SYSCOLORCHANGE"; @@ -3656,8 +3656,8 @@ const char *wxGetMessageName(int message) case 0x002D: return "WM_DELETEITEM"; case 0x002E: return "WM_VKEYTOITEM"; case 0x002F: return "WM_CHARTOITEM"; - case 0x0030: return "WM_SETFONT"; - case 0x0031: return "WM_GETFONT"; + case 0x0030: return "WM_SETFONT("; + case 0x0031: return "WM_GETFONT("; case 0x0037: return "WM_QUERYDRAGICON"; case 0x0039: return "WM_COMPAREITEM"; case 0x0041: return "WM_COMPACTING"; @@ -3670,12 +3670,12 @@ const char *wxGetMessageName(int message) case 0x004A: return "WM_COPYDATA"; case 0x004B: return "WM_CANCELJOURNAL"; case 0x004E: return "WM_NOTIFY"; - case 0x0050: return "WM_INPUTLANGCHANGEREQUEST"; + case 0x0050: return "WM_INPUTLANGCHANGEREQUEST("; case 0x0051: return "WM_INPUTLANGCHANGE"; case 0x0052: return "WM_TCARD"; case 0x0053: return "WM_HELP"; case 0x0054: return "WM_USERCHANGED"; - case 0x0055: return "WM_NOTIFYFORMAT"; + case 0x0055: return "WM_NOTIFYFORMAT("; case 0x007B: return "WM_CONTEXTMENU"; case 0x007C: return "WM_STYLECHANGING"; case 0x007D: return "WM_STYLECHANGED"; @@ -3687,8 +3687,8 @@ const char *wxGetMessageName(int message) case 0x0081: return "WM_NCCREATE"; case 0x0082: return "WM_NCDESTROY"; case 0x0083: return "WM_NCCALCSIZE"; - case 0x0084: return "WM_NCHITTEST"; - case 0x0085: return "WM_NCPAINT"; + case 0x0084: return "WM_NCHITTEST("; + case 0x0085: return "WM_NCPAINT("; case 0x0086: return "WM_NCACTIVATE"; case 0x0087: return "WM_GETDLGCODE"; case 0x00A0: return "WM_NCMOUSEMOVE"; @@ -3709,7 +3709,7 @@ const char *wxGetMessageName(int message) case 0x0105: return "WM_SYSKEYUP"; case 0x0106: return "WM_SYSCHAR"; case 0x0107: return "WM_SYSDEADCHAR"; - case 0x0108: return "WM_KEYLAST"; + case 0x0108: return "WM_KEYLAST("; #ifdef __WIN32__ case 0x010D: return "WM_IME_STARTCOMPOSITION"; @@ -3725,7 +3725,7 @@ const char *wxGetMessageName(int message) case 0x0115: return "WM_VSCROLL"; case 0x0116: return "WM_INITMENU"; case 0x0117: return "WM_INITMENUPOPUP"; - case 0x011F: return "WM_MENUSELECT"; + case 0x011F: return "WM_MENUSELECT("; case 0x0120: return "WM_MENUCHAR"; case 0x0121: return "WM_ENTERIDLE"; case 0x0200: return "WM_MOUSEMOVE"; @@ -3747,7 +3747,7 @@ const char *wxGetMessageName(int message) case 0x0214: return "WM_SIZING"; case 0x0215: return "WM_CAPTURECHANGED"; case 0x0216: return "WM_MOVING"; - case 0x0218: return "WM_POWERBROADCAST"; + case 0x0218: return "WM_POWERBROADCAST("; case 0x0219: return "WM_DEVICECHANGE"; #endif //WIN32 @@ -3755,7 +3755,7 @@ const char *wxGetMessageName(int message) case 0x0221: return "WM_MDIDESTROY"; case 0x0222: return "WM_MDIACTIVATE"; case 0x0223: return "WM_MDIRESTORE"; - case 0x0224: return "WM_MDINEXT"; + case 0x0224: return "WM_MDINEXT("; case 0x0225: return "WM_MDIMAXIMIZE"; case 0x0226: return "WM_MDITILE"; case 0x0227: return "WM_MDICASCADE"; @@ -3765,22 +3765,22 @@ const char *wxGetMessageName(int message) case 0x0233: return "WM_DROPFILES"; #ifdef __WIN32__ - case 0x0281: return "WM_IME_SETCONTEXT"; + case 0x0281: return "WM_IME_SETCONTEXT("; case 0x0282: return "WM_IME_NOTIFY"; case 0x0283: return "WM_IME_CONTROL"; case 0x0284: return "WM_IME_COMPOSITIONFULL"; - case 0x0285: return "WM_IME_SELECT"; + case 0x0285: return "WM_IME_SELECT("; case 0x0286: return "WM_IME_CHAR"; case 0x0290: return "WM_IME_KEYDOWN"; case 0x0291: return "WM_IME_KEYUP"; #endif //WIN32 - case 0x0300: return "WM_CUT"; + case 0x0300: return "WM_CUT("; case 0x0301: return "WM_COPY"; case 0x0302: return "WM_PASTE"; case 0x0303: return "WM_CLEAR"; case 0x0304: return "WM_UNDO"; - case 0x0305: return "WM_RENDERFORMAT"; + case 0x0305: return "WM_RENDERFORMAT("; case 0x0306: return "WM_RENDERALLFORMATS"; case 0x0307: return "WM_DESTROYCLIPBOARD"; case 0x0308: return "WM_DRAWCLIPBOARD"; @@ -3801,9 +3801,9 @@ const char *wxGetMessageName(int message) // listview case 0x1000 + 0: return "LVM_GETBKCOLOR"; case 0x1000 + 1: return "LVM_SETBKCOLOR"; - case 0x1000 + 2: return "LVM_GETIMAGELIST"; - case 0x1000 + 3: return "LVM_SETIMAGELIST"; - case 0x1000 + 4: return "LVM_GETITEMCOUNT"; + case 0x1000 + 2: return "LVM_GETIMAGELIST("; + case 0x1000 + 3: return "LVM_SETIMAGELIST("; + case 0x1000 + 4: return "LVM_GETITEMCOUNT("; case 0x1000 + 5: return "LVM_GETITEMA"; case 0x1000 + 75: return "LVM_GETITEMW"; case 0x1000 + 6: return "LVM_SETITEMA"; @@ -3817,12 +3817,12 @@ const char *wxGetMessageName(int message) case 0x1000 + 12: return "LVM_GETNEXTITEM"; case 0x1000 + 13: return "LVM_FINDITEMA"; case 0x1000 + 83: return "LVM_FINDITEMW"; - case 0x1000 + 14: return "LVM_GETITEMRECT"; + case 0x1000 + 14: return "LVM_GETITEMRECT("; case 0x1000 + 15: return "LVM_SETITEMPOSITION"; case 0x1000 + 16: return "LVM_GETITEMPOSITION"; case 0x1000 + 17: return "LVM_GETSTRINGWIDTHA"; case 0x1000 + 87: return "LVM_GETSTRINGWIDTHW"; - case 0x1000 + 18: return "LVM_HITTEST"; + case 0x1000 + 18: return "LVM_HITTEST("; case 0x1000 + 19: return "LVM_ENSUREVISIBLE"; case 0x1000 + 20: return "LVM_SCROLL"; case 0x1000 + 21: return "LVM_REDRAWITEMS"; @@ -3841,7 +3841,7 @@ const char *wxGetMessageName(int message) case 0x1000 + 30: return "LVM_SETCOLUMNWIDTH"; case 0x1000 + 31: return "LVM_GETHEADER"; case 0x1000 + 33: return "LVM_CREATEDRAGIMAGE"; - case 0x1000 + 34: return "LVM_GETVIEWRECT"; + case 0x1000 + 34: return "LVM_GETVIEWRECT("; case 0x1000 + 35: return "LVM_GETTEXTCOLOR"; case 0x1000 + 36: return "LVM_SETTEXTCOLOR"; case 0x1000 + 37: return "LVM_GETTEXTBKCOLOR"; @@ -3856,25 +3856,25 @@ const char *wxGetMessageName(int message) case 0x1000 + 115: return "LVM_GETITEMTEXTW"; case 0x1000 + 46: return "LVM_SETITEMTEXTA"; case 0x1000 + 116: return "LVM_SETITEMTEXTW"; - case 0x1000 + 47: return "LVM_SETITEMCOUNT"; + case 0x1000 + 47: return "LVM_SETITEMCOUNT("; case 0x1000 + 48: return "LVM_SORTITEMS"; case 0x1000 + 49: return "LVM_SETITEMPOSITION32"; - case 0x1000 + 50: return "LVM_GETSELECTEDCOUNT"; + case 0x1000 + 50: return "LVM_GETSELECTEDCOUNT("; case 0x1000 + 51: return "LVM_GETITEMSPACING"; case 0x1000 + 52: return "LVM_GETISEARCHSTRINGA"; case 0x1000 + 117: return "LVM_GETISEARCHSTRINGW"; case 0x1000 + 53: return "LVM_SETICONSPACING"; case 0x1000 + 54: return "LVM_SETEXTENDEDLISTVIEWSTYLE"; case 0x1000 + 55: return "LVM_GETEXTENDEDLISTVIEWSTYLE"; - case 0x1000 + 56: return "LVM_GETSUBITEMRECT"; - case 0x1000 + 57: return "LVM_SUBITEMHITTEST"; + case 0x1000 + 56: return "LVM_GETSUBITEMRECT("; + case 0x1000 + 57: return "LVM_SUBITEMHITTEST("; case 0x1000 + 58: return "LVM_SETCOLUMNORDERARRAY"; case 0x1000 + 59: return "LVM_GETCOLUMNORDERARRAY"; case 0x1000 + 60: return "LVM_SETHOTITEM"; case 0x1000 + 61: return "LVM_GETHOTITEM"; case 0x1000 + 62: return "LVM_SETHOTCURSOR"; case 0x1000 + 63: return "LVM_GETHOTCURSOR"; - case 0x1000 + 64: return "LVM_APPROXIMATEVIEWRECT"; + case 0x1000 + 64: return "LVM_APPROXIMATEVIEWRECT("; case 0x1000 + 65: return "LVM_SETWORKAREA"; // tree view @@ -3882,12 +3882,12 @@ const char *wxGetMessageName(int message) case 0x1100 + 50: return "TVM_INSERTITEMW"; case 0x1100 + 1: return "TVM_DELETEITEM"; case 0x1100 + 2: return "TVM_EXPAND"; - case 0x1100 + 4: return "TVM_GETITEMRECT"; - case 0x1100 + 5: return "TVM_GETCOUNT"; - case 0x1100 + 6: return "TVM_GETINDENT"; - case 0x1100 + 7: return "TVM_SETINDENT"; - case 0x1100 + 8: return "TVM_GETIMAGELIST"; - case 0x1100 + 9: return "TVM_SETIMAGELIST"; + case 0x1100 + 4: return "TVM_GETITEMRECT("; + case 0x1100 + 5: return "TVM_GETCOUNT("; + case 0x1100 + 6: return "TVM_GETINDENT("; + case 0x1100 + 7: return "TVM_SETINDENT("; + case 0x1100 + 8: return "TVM_GETIMAGELIST("; + case 0x1100 + 9: return "TVM_SETIMAGELIST("; case 0x1100 + 10: return "TVM_GETNEXTITEM"; case 0x1100 + 11: return "TVM_SELECTITEM"; case 0x1100 + 12: return "TVM_GETITEMA"; @@ -3897,8 +3897,8 @@ const char *wxGetMessageName(int message) case 0x1100 + 14: return "TVM_EDITLABELA"; case 0x1100 + 65: return "TVM_EDITLABELW"; case 0x1100 + 15: return "TVM_GETEDITCONTROL"; - case 0x1100 + 16: return "TVM_GETVISIBLECOUNT"; - case 0x1100 + 17: return "TVM_HITTEST"; + case 0x1100 + 16: return "TVM_GETVISIBLECOUNT("; + case 0x1100 + 17: return "TVM_HITTEST("; case 0x1100 + 18: return "TVM_CREATEDRAGIMAGE"; case 0x1100 + 19: return "TVM_SORTCHILDREN"; case 0x1100 + 20: return "TVM_ENSUREVISIBLE"; @@ -3910,7 +3910,7 @@ const char *wxGetMessageName(int message) case 0x1100 + 25: return "TVM_GETTOOLTIPS"; // header - case 0x1200 + 0: return "HDM_GETITEMCOUNT"; + case 0x1200 + 0: return "HDM_GETITEMCOUNT("; case 0x1200 + 1: return "HDM_INSERTITEMA"; case 0x1200 + 10: return "HDM_INSERTITEMW"; case 0x1200 + 2: return "HDM_DELETEITEM"; @@ -3918,11 +3918,11 @@ const char *wxGetMessageName(int message) case 0x1200 + 11: return "HDM_GETITEMW"; case 0x1200 + 4: return "HDM_SETITEMA"; case 0x1200 + 12: return "HDM_SETITEMW"; - case 0x1200 + 5: return "HDM_LAYOUT"; - case 0x1200 + 6: return "HDM_HITTEST"; - case 0x1200 + 7: return "HDM_GETITEMRECT"; - case 0x1200 + 8: return "HDM_SETIMAGELIST"; - case 0x1200 + 9: return "HDM_GETIMAGELIST"; + case 0x1200 + 5: return "HDM_LAYOUT("; + case 0x1200 + 6: return "HDM_HITTEST("; + case 0x1200 + 7: return "HDM_GETITEMRECT("; + case 0x1200 + 8: return "HDM_SETIMAGELIST("; + case 0x1200 + 9: return "HDM_GETIMAGELIST("; case 0x1200 + 15: return "HDM_ORDERTOINDEX"; case 0x1200 + 16: return "HDM_CREATEDRAGIMAGE"; case 0x1200 + 17: return "HDM_GETORDERARRAY"; @@ -3930,9 +3930,9 @@ const char *wxGetMessageName(int message) case 0x1200 + 19: return "HDM_SETHOTDIVIDER"; // tab control - case 0x1300 + 2: return "TCM_GETIMAGELIST"; - case 0x1300 + 3: return "TCM_SETIMAGELIST"; - case 0x1300 + 4: return "TCM_GETITEMCOUNT"; + case 0x1300 + 2: return "TCM_GETIMAGELIST("; + case 0x1300 + 3: return "TCM_SETIMAGELIST("; + case 0x1300 + 4: return "TCM_GETITEMCOUNT("; case 0x1300 + 5: return "TCM_GETITEMA"; case 0x1300 + 60: return "TCM_GETITEMW"; case 0x1300 + 6: return "TCM_SETITEMA"; @@ -3941,16 +3941,16 @@ const char *wxGetMessageName(int message) case 0x1300 + 62: return "TCM_INSERTITEMW"; case 0x1300 + 8: return "TCM_DELETEITEM"; case 0x1300 + 9: return "TCM_DELETEALLITEMS"; - case 0x1300 + 10: return "TCM_GETITEMRECT"; + case 0x1300 + 10: return "TCM_GETITEMRECT("; case 0x1300 + 11: return "TCM_GETCURSEL"; case 0x1300 + 12: return "TCM_SETCURSEL"; - case 0x1300 + 13: return "TCM_HITTEST"; + case 0x1300 + 13: return "TCM_HITTEST("; case 0x1300 + 14: return "TCM_SETITEMEXTRA"; - case 0x1300 + 40: return "TCM_ADJUSTRECT"; + case 0x1300 + 40: return "TCM_ADJUSTRECT("; case 0x1300 + 41: return "TCM_SETITEMSIZE"; case 0x1300 + 42: return "TCM_REMOVEIMAGE"; case 0x1300 + 43: return "TCM_SETPADDING"; - case 0x1300 + 44: return "TCM_GETROWCOUNT"; + case 0x1300 + 44: return "TCM_GETROWCOUNT("; case 0x1300 + 45: return "TCM_GETTOOLTIPS"; case 0x1300 + 46: return "TCM_SETTOOLTIPS"; case 0x1300 + 47: return "TCM_GETCURFOCUS"; @@ -3976,21 +3976,21 @@ const char *wxGetMessageName(int message) case WM_USER+21: return "TB_INSERTBUTTON"; case WM_USER+22: return "TB_DELETEBUTTON"; case WM_USER+23: return "TB_GETBUTTON"; - case WM_USER+24: return "TB_BUTTONCOUNT"; + case WM_USER+24: return "TB_BUTTONCOUNT("; case WM_USER+25: return "TB_COMMANDTOINDEX"; case WM_USER+26: return "TB_SAVERESTOREA"; case WM_USER+76: return "TB_SAVERESTOREW"; case WM_USER+27: return "TB_CUSTOMIZE"; case WM_USER+28: return "TB_ADDSTRINGA"; case WM_USER+77: return "TB_ADDSTRINGW"; - case WM_USER+29: return "TB_GETITEMRECT"; + case WM_USER+29: return "TB_GETITEMRECT("; case WM_USER+30: return "TB_BUTTONSTRUCTSIZE"; case WM_USER+31: return "TB_SETBUTTONSIZE"; case WM_USER+32: return "TB_SETBITMAPSIZE"; case WM_USER+33: return "TB_AUTOSIZE"; case WM_USER+35: return "TB_GETTOOLTIPS"; case WM_USER+36: return "TB_SETTOOLTIPS"; - case WM_USER+37: return "TB_SETPARENT"; + case WM_USER+37: return "TB_SETPARENT("; case WM_USER+39: return "TB_SETROWS"; case WM_USER+40: return "TB_GETROWS"; case WM_USER+42: return "TB_SETCMDID"; @@ -3999,15 +3999,15 @@ const char *wxGetMessageName(int message) case WM_USER+45: return "TB_GETBUTTONTEXTA"; case WM_USER+75: return "TB_GETBUTTONTEXTW"; case WM_USER+46: return "TB_REPLACEBITMAP"; - case WM_USER+47: return "TB_SETINDENT"; - case WM_USER+48: return "TB_SETIMAGELIST"; - case WM_USER+49: return "TB_GETIMAGELIST"; + case WM_USER+47: return "TB_SETINDENT("; + case WM_USER+48: return "TB_SETIMAGELIST("; + case WM_USER+49: return "TB_GETIMAGELIST("; case WM_USER+50: return "TB_LOADIMAGES"; - case WM_USER+51: return "TB_GETRECT"; - case WM_USER+52: return "TB_SETHOTIMAGELIST"; - case WM_USER+53: return "TB_GETHOTIMAGELIST"; - case WM_USER+54: return "TB_SETDISABLEDIMAGELIST"; - case WM_USER+55: return "TB_GETDISABLEDIMAGELIST"; + case WM_USER+51: return "TB_GETRECT("; + case WM_USER+52: return "TB_SETHOTIMAGELIST("; + case WM_USER+53: return "TB_GETHOTIMAGELIST("; + case WM_USER+54: return "TB_SETDISABLEDIMAGELIST("; + case WM_USER+55: return "TB_GETDISABLEDIMAGELIST("; case WM_USER+56: return "TB_SETSTYLE"; case WM_USER+57: return "TB_GETSTYLE"; case WM_USER+58: return "TB_GETBUTTONSIZE"; diff --git a/src/msw/xpmhand.cpp b/src/msw/xpmhand.cpp index 8841226237..a90fa6eba8 100644 --- a/src/msw/xpmhand.cpp +++ b/src/msw/xpmhand.cpp @@ -60,7 +60,7 @@ bool wxXPMFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla if (dc) { xpmAttr.valuemask = XpmReturnPixels; - int errorStatus = XpmReadFileToImage(&dc, MBSTRINGCAST name.mb_str(wxConvFile), &ximage, (XImage **) NULL, &xpmAttr); + int errorStatus = XpmReadFileToImage(&dc, wxMBSTRINGCAST name.mb_str(wxConvFile), &ximage, (XImage **) NULL, &xpmAttr); DeleteDC(dc); if (errorStatus == XpmSuccess) { @@ -108,7 +108,7 @@ bool wxXPMFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type ximage.height = M_BITMAPHANDLERDATA->m_height; ximage.depth = M_BITMAPHANDLERDATA->m_depth; ximage.bitmap = (HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap; - int errorStatus = XpmWriteFileFromImage(&dc, MBSTRINGCAST name.mb_str(wxConvFile), + int errorStatus = XpmWriteFileFromImage(&dc, wxMBSTRINGCAST name.mb_str(wxConvFile), &ximage, (XImage *) NULL, (XpmAttributes *) NULL); if (dc) diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index 9714ab0ea6..c649b265a7 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -11,12 +11,12 @@ #include "wx/setup.h" -#if wxUSE_DIALUP_MANAGER - #ifdef __GNUG__ #pragma implementation "dialup.h" #endif +#if wxUSE_DIALUP_MANAGER + #ifndef WX_PRECOMP # include "wx/defs.h" #endif // !PCH @@ -72,7 +72,7 @@ class WXDLLEXPORT wxDialUpManagerImpl : public wxDialUpManager public: wxDialUpManagerImpl(); ~wxDialUpManagerImpl(); - + /** Could the dialup manager be initialized correctly? If this function returns FALSE, no other functions will work neither, so it's a good idea to call this function and check its result before calling any other @@ -110,7 +110,7 @@ public: } /// returns TRUE if (async) dialing is in progress - inline virtual bool IsDialling() const + inline virtual bool IsDialing() const { return m_DialProcess != NULL; } // cancel dialing the number initiated with Dial(async = TRUE) @@ -180,7 +180,7 @@ private: /// pid of dial process int m_DialPId; friend class wxDialProcess; - + /// determine status void CheckStatus(bool fromAsync = FALSE) const; @@ -282,7 +282,7 @@ wxDialUpManagerImpl::HangUp(void) { if(m_IsOnline == 0) return FALSE; - if(IsDialling()) + if(IsDialing()) { wxLogError(_("Already dialling ISP.")); return FALSE; @@ -300,7 +300,7 @@ wxDialUpManagerImpl::HangUp(void) bool wxDialUpManagerImpl::CancelDialing() { - if(! IsDialling()) + if(! IsDialing()) return FALSE; return kill(m_DialPId, SIGTERM) > 0; } @@ -397,13 +397,13 @@ wxDialUpManagerImpl::CheckStatusInternal(void) if(m_CanUseIfconfig != 0) // unknown or yes { wxASSERT(m_IfconfigPath.length()); - + wxString tmpfile = wxGetTempFileName("_wxdialuptest"); wxString cmd = "/bin/sh -c \'"; cmd << m_IfconfigPath << " >" << tmpfile << '\''; /* I tried to add an option to wxExecute() to not close stdout, so we could let ifconfig write directly to the tmpfile, but - this does not work. That should be faster, as it doesn´t call + this does not work. That should be faster, as it doesn´t call the shell first. I have no idea why. :-( (KB) */ #if 0 // temporarily redirect stdout/stderr: @@ -463,17 +463,17 @@ wxDialUpManagerImpl::CheckStatusInternal(void) // This can be used under Win 9x, too! struct hostent *hp; struct sockaddr_in serv_addr; - int sockfd; + int sockfd; m_IsOnline = 0; // assume false if((hp = gethostbyname(m_BeaconHost)) == NULL) return; // no DNS no net - - serv_addr.sin_family = hp->h_addrtype; + + serv_addr.sin_family = hp->h_addrtype; memcpy(&serv_addr.sin_addr,hp->h_addr, hp->h_length); - serv_addr.sin_port = htons(m_BeaconPort); - if( ( sockfd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) - { + serv_addr.sin_port = htons(m_BeaconPort); + if( ( sockfd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) + { // sys_error("cannot create socket for gw"); return; } @@ -484,9 +484,9 @@ wxDialUpManagerImpl::CheckStatusInternal(void) sizeof(serv_addr)) == -1) return; #endif - + if( connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0) - { + { //sys_error("cannot connect to server"); return; } diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index c3a6ff6268..513600f3b1 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -109,7 +109,7 @@ wxMutex::wxMutex() wxMutex::~wxMutex() { if (m_locked > 0) - wxLogDebug(_T("Freeing a locked mutex (%d locks)"), m_locked); + wxLogDebug(T("Freeing a locked mutex (%d locks)"), m_locked); pthread_mutex_destroy( &(p_internal->p_mutex) ); delete p_internal; @@ -120,7 +120,7 @@ wxMutexError wxMutex::Lock() int err = pthread_mutex_lock( &(p_internal->p_mutex) ); if (err == EDEADLK) { - wxLogDebug(_T("Locking this mutex would lead to deadlock!")); + wxLogDebug(T("Locking this mutex would lead to deadlock!")); return wxMUTEX_DEAD_LOCK; } @@ -156,7 +156,7 @@ wxMutexError wxMutex::Unlock() } else { - wxLogDebug(_T("Unlocking not locked mutex.")); + wxLogDebug(T("Unlocking not locked mutex.")); return wxMUTEX_UNLOCKED; } @@ -320,7 +320,7 @@ void *wxThreadInternal::PthreadStart(void *ptr) // terminate the thread thread->Exit(status); - wxFAIL_MSG(_T("wxThread::Exit() can't return.")); + wxFAIL_MSG(T("wxThread::Exit() can't return.")); return NULL; } @@ -389,7 +389,7 @@ wxThreadInternal::~wxThreadInternal() wxThreadError wxThreadInternal::Run() { wxCHECK_MSG( GetState() == STATE_NEW, wxTHREAD_RUNNING, - _T("thread may only be started once after successful Create()") ); + T("thread may only be started once after successful Create()") ); // the mutex was locked on Create(), so we will be able to lock it again // only when the thread really starts executing and enters the wait - @@ -408,7 +408,7 @@ wxThreadError wxThreadInternal::Run() void wxThreadInternal::Wait() { - wxCHECK_RET( WasCancelled(), _T("thread should have been cancelled first") ); + wxCHECK_RET( WasCancelled(), T("thread should have been cancelled first") ); // if the thread we're waiting for is waiting for the GUI mutex, we will // deadlock so make sure we release it temporarily @@ -452,7 +452,7 @@ void wxThreadInternal::Pause() // the state is set from the thread which pauses us first, this function // is called later so the state should have been already set wxCHECK_RET( m_state == STATE_PAUSED, - _T("thread must first be paused with wxThread::Pause().") ); + T("thread must first be paused with wxThread::Pause().") ); // don't pause the thread which is being terminated - this would lead to // deadlock if the thread is paused after Delete() had called Resume() but @@ -467,7 +467,7 @@ void wxThreadInternal::Pause() void wxThreadInternal::Resume() { wxCHECK_RET( m_state == STATE_PAUSED, - _T("can't resume thread which is not suspended.") ); + T("can't resume thread which is not suspended.") ); // we will be able to lock this mutex only when Pause() starts waiting wxMutexLocker lock(m_mutexSuspend); @@ -578,7 +578,7 @@ void wxThread::SetPriority(unsigned int prio) { wxCHECK_RET( ((int)WXTHREAD_MIN_PRIORITY <= (int)prio) && ((int)prio <= (int)WXTHREAD_MAX_PRIORITY), - _T("invalid thread priority") ); + T("invalid thread priority") ); wxCriticalSectionLocker lock(m_critsect); @@ -607,7 +607,7 @@ void wxThread::SetPriority(unsigned int prio) case STATE_EXITED: default: - wxFAIL_MSG(_T("impossible to set thread priority in this state")); + wxFAIL_MSG(T("impossible to set thread priority in this state")); } } @@ -633,7 +633,7 @@ wxThreadError wxThread::Pause() if ( p_internal->GetState() != STATE_RUNNING ) { - wxLogDebug(_T("Can't pause thread which is not running.")); + wxLogDebug(T("Can't pause thread which is not running.")); return wxTHREAD_NOT_RUNNING; } @@ -657,7 +657,7 @@ wxThreadError wxThread::Resume() } else { - wxLogDebug(_T("Attempt to resume a thread which is not paused.")); + wxLogDebug(T("Attempt to resume a thread which is not paused.")); return wxTHREAD_MISC_ERROR; } @@ -769,7 +769,7 @@ wxThread::~wxThread() m_critsect.Enter(); if (p_internal->GetState() != STATE_EXITED && p_internal->GetState() != STATE_NEW) - wxLogDebug(_T("The thread is being destroyed althought it is still running ! The application may crash.")); + wxLogDebug(T("The thread is being destroyed althought it is still running ! The application may crash.")); m_critsect.Leave(); @@ -849,12 +849,12 @@ bool wxThreadModule::OnInit() void wxThreadModule::OnExit() { - wxASSERT_MSG( wxThread::IsMain(), _T("only main thread can be here") ); + wxASSERT_MSG( wxThread::IsMain(), T("only main thread can be here") ); // terminate any threads left size_t count = gs_allThreads.GetCount(); if ( count != 0u ) - wxLogDebug(_T("Some threads were not terminated by the application.")); + wxLogDebug(T("Some threads were not terminated by the application.")); for ( size_t n = 0u; n < count; n++ ) { diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 1ecee5f029..57d3977889 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -64,7 +64,7 @@ #ifdef __SUN__ int usleep(unsigned int usec); #else // !Sun - #ifdef __EMX + #ifdef __EMX /* I copied this from the XFree86 diffs. AV. */ #define INCL_DOSPROCESS #include @@ -72,9 +72,9 @@ { DosSleep(delay ? (delay/1000l) : 1l); } - #else - void usleep(unsigned long usec); - #endif + #else + void usleep(unsigned long usec); + #endif #endif // Sun/EMX/Something else }; #define HAVE_USLEEP 1 @@ -130,31 +130,31 @@ int wxKill(long pid, wxSignal sig) long wxExecute( const wxString& command, bool sync, wxProcess *process ) { - wxCHECK_MSG( !command.IsEmpty(), 0, _T("can't exec empty command") ); + wxCHECK_MSG( !command.IsEmpty(), 0, T("can't exec empty command") ); int argc = 0; wxChar *argv[WXEXECUTE_NARGS]; wxString argument; const wxChar *cptr = command.c_str(); - wxChar quotechar = _T('\0'); // is arg quoted? + wxChar quotechar = T('\0'); // is arg quoted? bool escaped = FALSE; // split the command line in arguments do { - argument=_T(""); - quotechar = _T('\0'); + argument=T(""); + quotechar = T('\0'); // eat leading whitespace: while ( wxIsspace(*cptr) ) cptr++; - if ( *cptr == _T('\'') || *cptr == _T('"') ) + if ( *cptr == T('\'') || *cptr == T('"') ) quotechar = *cptr++; do { - if ( *cptr == _T('\\') && ! escaped ) + if ( *cptr == T('\\') && ! escaped ) { escaped = TRUE; cptr++; @@ -167,11 +167,11 @@ long wxExecute( const wxString& command, bool sync, wxProcess *process ) // have we reached the end of the argument? if ( (*cptr == quotechar && ! escaped) - || (quotechar == _T('\0') && wxIsspace(*cptr)) - || *cptr == _T('\0') ) + || (quotechar == T('\0') && wxIsspace(*cptr)) + || *cptr == T('\0') ) { wxASSERT_MSG( argc < WXEXECUTE_NARGS, - _T("too many arguments in wxExecute") ); + T("too many arguments in wxExecute") ); argv[argc] = new wxChar[argument.length() + 1]; wxStrcpy(argv[argc], argument.c_str()); @@ -202,7 +202,7 @@ bool wxShell(const wxString& command) { wxString cmd; if ( !!command ) - cmd.Printf(_T("xterm -e %s"), command.c_str()); + cmd.Printf(T("xterm -e %s"), command.c_str()); else cmd = command; @@ -247,34 +247,43 @@ void wxHandleProcessTermination(wxEndProcessData *proc_data) long wxExecute( wxChar **argv, bool sync, wxProcess *process ) { - wxCHECK_MSG( *argv, 0, _T("can't exec empty command") ); + wxCHECK_MSG( *argv, 0, T("can't exec empty command") ); - int end_proc_detect[2]; #if wxUSE_UNICODE int mb_argc = 0; char *mb_argv[WXEXECUTE_NARGS]; - while (argv[mb_argc]) { - wxWX2MBbuf mb_arg = wxConvCurrent->cWX2MB(argv[mb_argc]); + while (argv[mb_argc]) + { + wxWX2MBbuf mb_arg = wxConvertWX2MB(argv[mb_argc]); mb_argv[mb_argc] = strdup(mb_arg); mb_argc++; } mb_argv[mb_argc] = (char *) NULL; -#else + + // this macro will free memory we used above + #define ARGS_CLEANUP \ + for ( mb_argc = 0; mb_argb[mb_argc]; mb_argc++ ) \ + free(mb_argv[mb_argc]) +#else // ANSI + // no need for cleanup + #define ARGS_CLEANUP + wxChar **mb_argv = argv; -#endif +#endif // Unicode/ANSI +#if wxUSE_GUI // create pipes + int end_proc_detect[2]; if (pipe(end_proc_detect) == -1) { wxLogSysError( _("Pipe creation failed") ); -#if wxUSE_UNICODE - mb_argc = 0; - while (mb_argv[mb_argc]) - free(mb_argv[mb_argc++]); -#endif + + ARGS_CLEANUP; + return 0; } +#endif // wxUSE_GUI // fork the process #if HAVE_VFORK @@ -285,17 +294,17 @@ long wxExecute( wxChar **argv, bool sync, wxProcess *process ) if (pid == -1) { wxLogSysError( _("Fork failed") ); -#if wxUSE_UNICODE - mb_argc = 0; - while (mb_argv[mb_argc]) - free(mb_argv[mb_argc++]); -#endif + + ARGS_CLEANUP; + return 0; } else if (pid == 0) { +#if wxUSE_GUI // we're in child close(end_proc_detect[0]); // close reading side +#endif // wxUSE_GUI // These three lines close the open file descriptors to to avoid any // input/output which might block the process or irritate the user. If @@ -306,7 +315,12 @@ long wxExecute( wxChar **argv, bool sync, wxProcess *process ) // leave stderr opened, it won't do any hurm for ( int fd = 0; fd < FD_SETSIZE; fd++ ) { - if ( fd != end_proc_detect[1] && fd != STDERR_FILENO ) +#if wxUSE_GUI + if ( fd == end_proc_detect[1] ) + continue; +#endif // wxUSE_GUI + + if ( fd != STDERR_FILENO ) close(fd); } } @@ -330,21 +344,18 @@ long wxExecute( wxChar **argv, bool sync, wxProcess *process ) } else { +#if wxUSE_GUI // we're in parent close(end_proc_detect[1]); // close writing side wxEndProcessData *data = new wxEndProcessData; data->tag = wxAddProcessCallback(data, end_proc_detect[0]); -#if wxUSE_UNICODE - mb_argc = 0; - while (mb_argv[mb_argc]) - free(mb_argv[mb_argc++]); -#endif + ARGS_CLEANUP; if ( sync ) { - wxASSERT_MSG( !process, _T("wxProcess param ignored for sync exec") ); + wxASSERT_MSG( !process, T("wxProcess param ignored for sync exec") ); data->process = NULL; // sync execution: indicate it by negating the pid @@ -370,7 +381,20 @@ long wxExecute( wxChar **argv, bool sync, wxProcess *process ) return pid; } +#else // !wxUSE_GUI + wxASSERT_MSG( sync, T("async execution not supported yet") ); + + int exitcode = 0; + if ( waitpid(pid, &exitcode, 0) == -1 || !WIFEXITED(exitcode) ) + { + wxLogSysError(_("Waiting for subprocess termination failed")); + } + + return exitcode; +#endif // wxUSE_GUI } + + #undef ARGS_CLEANUP } // ---------------------------------------------------------------------------- @@ -381,14 +405,14 @@ const wxChar* wxGetHomeDir( wxString *home ) { *home = wxGetUserHome( wxString() ); if ( home->IsEmpty() ) - *home = _T("/"); + *home = T("/"); return home->c_str(); } #if wxUSE_UNICODE const wxMB2WXbuf wxGetUserHome( const wxString &user ) -#else // just for binary compatibility +#else // just for binary compatibility -- there is no 'const' here char *wxGetUserHome( const wxString &user ) #endif { @@ -396,15 +420,15 @@ char *wxGetUserHome( const wxString &user ) if ( !user ) { - register wxChar *ptr; + wxChar *ptr; - if ((ptr = wxGetenv(_T("HOME"))) != NULL) + if ((ptr = wxGetenv(T("HOME"))) != NULL) { return ptr; } - if ((ptr = wxGetenv(_T("USER"))) != NULL || (ptr = wxGetenv(_T("LOGNAME"))) != NULL) + if ((ptr = wxGetenv(T("USER"))) != NULL || (ptr = wxGetenv(T("LOGNAME"))) != NULL) { - who = getpwnam(wxConvCurrent->cWX2MB(ptr)); + who = getpwnam(wxConvertWX2MB(ptr)); } // We now make sure the the user exists! @@ -418,11 +442,7 @@ char *wxGetUserHome( const wxString &user ) who = getpwnam (user.mb_str()); } -#if wxUSE_UNICODE - return who ? wxConvCurrent->cMB2WX(who->pw_dir) : (wxMB2WXbuf)((wxChar*)NULL); -#else - return who ? who->pw_dir : ((char*)NULL); -#endif + return wxConvertMB2WX(who ? who->pw_dir : NULL); } // ---------------------------------------------------------------------------- @@ -434,9 +454,9 @@ char *wxGetUserHome( const wxString &user ) // private use only) static bool wxGetHostNameInternal(wxChar *buf, int sz) { - wxCHECK_MSG( buf, FALSE, _T("NULL pointer in wxGetHostNameInternal") ); + wxCHECK_MSG( buf, FALSE, T("NULL pointer in wxGetHostNameInternal") ); - *buf = _T('\0'); + *buf = T('\0'); // we're using uname() which is POSIX instead of less standard sysinfo() #if defined(HAVE_UNAME) @@ -444,13 +464,13 @@ static bool wxGetHostNameInternal(wxChar *buf, int sz) bool ok = uname(&uts) != -1; if ( ok ) { - wxStrncpy(buf, wxConvCurrent->cMB2WX(uts.nodename), sz - 1); - buf[sz] = _T('\0'); + wxStrncpy(buf, wxConvertMB2WX(uts.nodename), sz - 1); + buf[sz] = T('\0'); } #elif defined(HAVE_GETHOSTNAME) bool ok = gethostname(buf, sz) != -1; #else // no uname, no gethostname - wxFAIL_MSG(_T("don't know host name for this machine")); + wxFAIL_MSG(T("don't know host name for this machine")); bool ok = FALSE; #endif // uname/gethostname @@ -471,11 +491,11 @@ bool wxGetHostName(wxChar *buf, int sz) { // BSD systems return the FQDN, we only want the hostname, so extract // it (we consider that dots are domain separators) - wxChar *dot = wxStrchr(buf, _T('.')); + wxChar *dot = wxStrchr(buf, T('.')); if ( dot ) { // nuke it - *dot = _T('\0'); + *dot = T('\0'); } } @@ -488,9 +508,9 @@ bool wxGetFullHostName(wxChar *buf, int sz) if ( ok ) { - if ( !wxStrchr(buf, _T('.')) ) + if ( !wxStrchr(buf, T('.')) ) { - struct hostent *host = gethostbyname(wxConvCurrent->cWX2MB(buf)); + struct hostent *host = gethostbyname(wxConvertWX2MB(buf)); if ( !host ) { wxLogSysError(_("Cannot get the official hostname")); @@ -500,7 +520,7 @@ bool wxGetFullHostName(wxChar *buf, int sz) else { // the canonical name - wxStrncpy(buf, wxConvCurrent->cMB2WX(host->h_name), sz); + wxStrncpy(buf, wxConvertMB2WX(host->h_name), sz); } } //else: it's already a FQDN (BSD behaves this way) @@ -513,10 +533,10 @@ bool wxGetUserId(wxChar *buf, int sz) { struct passwd *who; - *buf = _T('\0'); + *buf = T('\0'); if ((who = getpwuid(getuid ())) != NULL) { - wxStrncpy (buf, wxConvCurrent->cMB2WX(who->pw_name), sz - 1); + wxStrncpy (buf, wxConvertMB2WX(who->pw_name), sz - 1); return TRUE; } @@ -528,18 +548,20 @@ bool wxGetUserName(wxChar *buf, int sz) struct passwd *who; char *comma; - *buf = _T('\0'); + *buf = T('\0'); if ((who = getpwuid (getuid ())) != NULL) { comma = strchr(who->pw_gecos, ','); if (comma) *comma = '\0'; // cut off non-name comment fields - wxStrncpy (buf, wxConvCurrent->cMB2WX(who->pw_gecos), sz - 1); + wxStrncpy (buf, wxConvertMB2WX(who->pw_gecos), sz - 1); return TRUE; } return FALSE; } +#if wxUSE_GUI + // ---------------------------------------------------------------------------- // error and debug output routines (deprecated, use wxLog) // ---------------------------------------------------------------------------- @@ -556,17 +578,17 @@ void wxDebugMsg( const char *format, ... ) void wxError( const wxString &msg, const wxString &title ) { wxFprintf( stderr, _("Error ") ); - if (!title.IsNull()) wxFprintf( stderr, _T("%s "), WXSTRINGCAST(title) ); - if (!msg.IsNull()) wxFprintf( stderr, _T(": %s"), WXSTRINGCAST(msg) ); - wxFprintf( stderr, _T(".\n") ); + if (!title.IsNull()) wxFprintf( stderr, T("%s "), WXSTRINGCAST(title) ); + if (!msg.IsNull()) wxFprintf( stderr, T(": %s"), WXSTRINGCAST(msg) ); + wxFprintf( stderr, T(".\n") ); } void wxFatalError( const wxString &msg, const wxString &title ) { wxFprintf( stderr, _("Error ") ); - if (!title.IsNull()) wxFprintf( stderr, _T("%s "), WXSTRINGCAST(title) ); - if (!msg.IsNull()) wxFprintf( stderr, _T(": %s"), WXSTRINGCAST(msg) ); - wxFprintf( stderr, _T(".\n") ); + if (!title.IsNull()) wxFprintf( stderr, T("%s "), WXSTRINGCAST(title) ); + if (!msg.IsNull()) wxFprintf( stderr, T(": %s"), WXSTRINGCAST(msg) ); + wxFprintf( stderr, T(".\n") ); exit(3); // the same exit code as for abort() } @@ -591,7 +613,7 @@ void wxFatalError( const wxString &msg, const wxString &title ) static inline wxNativeFont wxLoadFont(const wxString& fontSpec) { - return gdk_font_load( wxConvCurrent->cWX2MB(fontSpec) ); + return gdk_font_load( wxConvertWX2MB(fontSpec) ); } static inline void wxFreeFont(wxNativeFont font) @@ -630,19 +652,19 @@ static wxNativeFont wxLoadQueryFont(int pointSize, wxString xfamily; switch (family) { - case wxDECORATIVE: xfamily = _T("lucida"); break; - case wxROMAN: xfamily = _T("times"); break; - case wxMODERN: xfamily = _T("courier"); break; - case wxSWISS: xfamily = _T("helvetica"); break; - case wxTELETYPE: xfamily = _T("lucidatypewriter"); break; - case wxSCRIPT: xfamily = _T("utopia"); break; - default: xfamily = _T("*"); + case wxDECORATIVE: xfamily = T("lucida"); break; + case wxROMAN: xfamily = T("times"); break; + case wxMODERN: xfamily = T("courier"); break; + case wxSWISS: xfamily = T("helvetica"); break; + case wxTELETYPE: xfamily = T("lucidatypewriter"); break; + case wxSCRIPT: xfamily = T("utopia"); break; + default: xfamily = T("*"); } wxString fontSpec; if (!facename.IsEmpty()) { - fontSpec.Printf(_T("-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*"), + fontSpec.Printf(T("-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*"), facename.c_str()); if ( wxTestFontSpec(fontSpec) ) @@ -655,19 +677,19 @@ static wxNativeFont wxLoadQueryFont(int pointSize, wxString xstyle; switch (style) { - case wxITALIC: xstyle = _T("i"); break; - case wxSLANT: xstyle = _T("o"); break; - case wxNORMAL: xstyle = _T("r"); break; - default: xstyle = _T("*"); break; + case wxITALIC: xstyle = T("i"); break; + case wxSLANT: xstyle = T("o"); break; + case wxNORMAL: xstyle = T("r"); break; + default: xstyle = T("*"); break; } wxString xweight; switch (weight) { - case wxBOLD: xweight = _T("bold"); break; + case wxBOLD: xweight = T("bold"); break; case wxLIGHT: - case wxNORMAL: xweight = _T("medium"); break; - default: xweight = _T("*"); break; + case wxNORMAL: xweight = T("medium"); break; + default: xweight = T("*"); break; } wxString xregistry, xencoding; @@ -696,23 +718,23 @@ static wxNativeFont wxLoadQueryFont(int pointSize, case wxFONTENCODING_ISO8859_15: { int cp = encoding - wxFONTENCODING_ISO8859_1 + 1; - xregistry = _T("iso8859"); - xencoding.Printf(_T("%d"), cp); + xregistry = T("iso8859"); + xencoding.Printf(T("%d"), cp); } break; case wxFONTENCODING_KOI8: - xregistry = _T("koi8"); - if ( wxTestFontSpec(_T("-*-*-*-*-*-*-*-*-*-*-*-*-koi8-1")) ) + xregistry = T("koi8"); + if ( wxTestFontSpec(T("-*-*-*-*-*-*-*-*-*-*-*-*-koi8-1")) ) { - xencoding = _T("1"); + xencoding = T("1"); // test passed, no need to do it once more test = FALSE; } else { - xencoding = _T("*"); + xencoding = T("*"); } break; @@ -721,12 +743,12 @@ static wxNativeFont wxLoadQueryFont(int pointSize, case wxFONTENCODING_CP1252: { int cp = encoding - wxFONTENCODING_CP1250 + 1250; - fontSpec.Printf(_T("-*-*-*-*-*-*-*-*-*-*-*-*-microsoft-cp%d"), + fontSpec.Printf(T("-*-*-*-*-*-*-*-*-*-*-*-*-microsoft-cp%d"), cp); if ( wxTestFontSpec(fontSpec) ) { - xregistry = _T("microsoft"); - xencoding.Printf(_T("cp%d"), cp); + xregistry = T("microsoft"); + xencoding.Printf(T("cp%d"), cp); // test passed, no need to do it once more test = FALSE; @@ -734,8 +756,8 @@ static wxNativeFont wxLoadQueryFont(int pointSize, else { // fall back to LatinX - xregistry = _T("iso8859"); - xencoding.Printf(_T("%d"), cp - 1249); + xregistry = T("iso8859"); + xencoding.Printf(T("%d"), cp - 1249); } } break; @@ -744,23 +766,23 @@ static wxNativeFont wxLoadQueryFont(int pointSize, default: test = FALSE; xregistry = - xencoding = _T("*"); + xencoding = T("*"); } if ( test ) { - fontSpec.Printf(_T("-*-*-*-*-*-*-*-*-*-*-*-*-%s-%s"), + fontSpec.Printf(T("-*-*-*-*-*-*-*-*-*-*-*-*-%s-%s"), xregistry.c_str(), xencoding.c_str()); if ( !wxTestFontSpec(fontSpec) ) { // this encoding isn't available - what to do? xregistry = - xencoding = _T("*"); + xencoding = T("*"); } } // construct the X font spec from our data - fontSpec.Printf(_T("-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-%s-%s"), + fontSpec.Printf(T("-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-%s-%s"), xfamily.c_str(), xweight.c_str(), xstyle.c_str(), pointSize, xregistry.c_str(), xencoding.c_str()); @@ -818,3 +840,4 @@ wxNativeFont wxLoadQueryNearestFont(int pointSize, return font; } +#endif // wxUSE_GUI -- 2.45.2