From 9a83f860948059b0273b5cc6d9e43fadad3ebfca Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 23 Jul 2009 20:30:22 +0000 Subject: [PATCH] Globally replace _T() with wxT(). Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- build/bakefiles/wxpresets/sample/minimal.cpp | 18 +- demos/forty/canvas.cpp | 6 +- demos/forty/card.cpp | 4 +- demos/forty/forty.cpp | 54 +- demos/forty/game.cpp | 30 +- demos/forty/playerdg.cpp | 10 +- demos/forty/scoredg.cpp | 14 +- demos/forty/scorefil.cpp | 34 +- demos/fractal/fractal.cpp | 4 +- demos/life/game.h | 2 +- demos/poem/wxpoem.cpp | 116 +- distrib/autopackage/sample/minimal.cpp | 18 +- docs/doxygen/mainpages/const_cpp.h | 2 + docs/doxygen/overviews/archive.h | 26 +- docs/doxygen/overviews/nonenglish.h | 2 +- docs/doxygen/overviews/xrc.h | 4 +- include/wx/animdecod.h | 2 +- include/wx/arrstr.h | 4 +- include/wx/artprov.h | 6 +- include/wx/buffer.h | 6 +- include/wx/chartype.h | 38 +- include/wx/cocoa/dirdlg.h | 2 +- include/wx/confbase.h | 4 +- include/wx/containr.h | 2 +- include/wx/cppunit.h | 2 +- include/wx/cshelp.h | 2 +- include/wx/ctrlsub.h | 14 +- include/wx/datectrl.h | 2 +- include/wx/datetime.h | 34 +- include/wx/dcbuffer.h | 2 +- include/wx/dcmirror.h | 6 +- include/wx/debugrpt.h | 2 +- include/wx/defs.h | 18 +- include/wx/dynlib.h | 2 +- include/wx/dynload.h | 2 +- include/wx/event.h | 4 +- include/wx/ffile.h | 4 +- include/wx/filefn.h | 4 +- include/wx/filename.h | 4 +- include/wx/generic/calctrlg.h | 4 +- include/wx/generic/combo.h | 4 +- include/wx/generic/grid.h | 12 +- include/wx/generic/gridctrl.h | 4 +- include/wx/generic/grideditors.h | 4 +- include/wx/generic/private/listctrl.h | 10 +- include/wx/generic/spinctlg.h | 12 +- include/wx/generic/splitter.h | 2 +- include/wx/glcanvas.h | 2 +- include/wx/gtk/checklst.h | 6 +- include/wx/gtk/spinctrl.h | 10 +- include/wx/gtk1/checklst.h | 6 +- include/wx/gtk1/spinctrl.h | 4 +- include/wx/imagbmp.h | 26 +- include/wx/image.h | 16 +- include/wx/imagtiff.h | 8 +- include/wx/list.h | 2 +- include/wx/longlong.h | 8 +- include/wx/math.h | 2 +- include/wx/mimetype.h | 6 +- include/wx/module.h | 2 +- include/wx/msw/app.h | 2 +- include/wx/msw/dc.h | 2 +- include/wx/msw/gdiimage.h | 2 +- include/wx/msw/ole/dataobj.h | 2 +- include/wx/msw/ole/dropsrc.h | 2 +- include/wx/msw/ole/oleutils.h | 6 +- include/wx/msw/private.h | 28 +- include/wx/msw/private/button.h | 2 +- include/wx/msw/private/dc.h | 6 +- include/wx/msw/private/metrics.h | 2 +- include/wx/msw/slider.h | 2 +- include/wx/msw/spinctrl.h | 4 +- include/wx/msw/subwin.h | 8 +- include/wx/msw/wrapshl.h | 2 +- include/wx/os2/gdiimage.h | 2 +- include/wx/os2/private.h | 6 +- include/wx/os2/spinctrl.h | 4 +- include/wx/osx/dirdlg.h | 2 +- include/wx/osx/nonownedwnd.h | 2 +- include/wx/osx/spinctrl.h | 8 +- include/wx/palette.h | 2 +- include/wx/palmos/dc.h | 2 +- include/wx/palmos/gdiimage.h | 2 +- include/wx/palmos/spinctrl.h | 4 +- include/wx/palmos/statbmp.h | 4 +- include/wx/private/fileback.h | 2 +- include/wx/private/wxprintf.h | 10 +- include/wx/protocol/ftp.h | 2 +- include/wx/recguard.h | 2 +- include/wx/richtext/richtextbulletspage.h | 2 +- include/wx/richtext/richtextfontpage.h | 2 +- include/wx/richtext/richtextindentspage.h | 2 +- include/wx/richtext/richtextliststylepage.h | 2 +- include/wx/richtext/richtextstylepage.h | 2 +- include/wx/richtext/richtexttabspage.h | 2 +- include/wx/selstore.h | 2 +- include/wx/sizer.h | 2 +- include/wx/sound.h | 2 +- include/wx/spinbutt.h | 2 +- include/wx/stopwatch.h | 2 +- include/wx/string.h | 28 +- include/wx/stringimpl.h | 6 +- include/wx/tbarbase.h | 4 +- include/wx/thrimpl.cpp | 24 +- include/wx/tokenzr.h | 2 +- include/wx/univ/button.h | 8 +- include/wx/univ/checkbox.h | 6 +- include/wx/univ/checklst.h | 2 +- include/wx/univ/combobox.h | 6 +- include/wx/univ/control.h | 4 +- include/wx/univ/inpcons.h | 2 +- include/wx/univ/inphand.h | 30 +- include/wx/univ/listbox.h | 36 +- include/wx/univ/menuitem.h | 4 +- include/wx/univ/notebook.h | 6 +- include/wx/univ/scrolbar.h | 18 +- include/wx/univ/slider.h | 22 +- include/wx/univ/spinbutt.h | 4 +- include/wx/univ/textctrl.h | 52 +- include/wx/univ/toolbar.h | 4 +- include/wx/univ/toplevel.h | 12 +- include/wx/unix/private/timer.h | 2 +- include/wx/version.h | 4 +- include/wx/vlbox.h | 2 +- include/wx/wxcrtbase.h | 2 +- include/wx/x11/textctrl.h | 50 +- include/wx/xrc/xmlres.h | 2 +- include/wx/xti.h | 24 +- interface/wx/aboutdlg.h | 2 +- interface/wx/archive.h | 4 +- interface/wx/chartype.h | 5 +- interface/wx/generic/spinctrg.h | 2 +- interface/wx/html/helpwnd.h | 2 +- interface/wx/stream.h | 4 +- samples/access/accesstest.cpp | 22 +- samples/animate/anitest.cpp | 42 +- samples/artprov/artbrows.cpp | 12 +- samples/artprov/arttest.cpp | 32 +- samples/calendar/calendar.cpp | 76 +- samples/caret/caret.cpp | 40 +- samples/collpane/collpane.cpp | 16 +- samples/combo/combo.cpp | 24 +- samples/config/conftest.cpp | 72 +- samples/console/console.cpp | 1886 ++++++++--------- samples/controls/controls.cpp | 406 ++-- samples/dataview/dataview.cpp | 2 +- samples/debugrpt/debugrpt.cpp | 68 +- samples/dialogs/dialogs.cpp | 368 ++-- samples/dialup/nettest.cpp | 22 +- samples/display/display.cpp | 46 +- samples/dnd/dnd.cpp | 246 +-- samples/dragimag/dragimag.cpp | 22 +- samples/drawing/drawing.cpp | 204 +- samples/event/event.cpp | 52 +- samples/except/except.cpp | 66 +- samples/exec/exec.cpp | 256 +-- samples/font/font.cpp | 6 +- samples/grid/griddemo.cpp | 314 +-- samples/help/demo.cpp | 84 +- samples/htlbox/htlbox.cpp | 100 +- samples/html/htmlctrl/htmlctrl.cpp | 8 +- samples/html/test/test.cpp | 12 +- samples/image/canvas.cpp | 132 +- samples/image/image.cpp | 140 +- samples/internat/internat.cpp | 4 +- samples/ipc/client.cpp | 70 +- samples/ipc/ipcsetup.h | 2 +- samples/joytest/joytest.cpp | 18 +- samples/layout/layout.cpp | 140 +- samples/listctrl/listtest.cpp | 232 +- samples/memcheck/memcheck.cpp | 8 +- samples/menu/menu.cpp | 254 +-- samples/mfc/mfctest.cpp | 24 +- samples/nativdlg/nativdlg.cpp | 14 +- samples/notebook/notebook.cpp | 32 +- samples/oleauto/oleauto.cpp | 44 +- samples/opengl/cube/cube.cpp | 10 +- samples/opengl/isosurf/isosurf.cpp | 6 +- samples/ownerdrw/ownerdrw.cpp | 68 +- samples/popup/popup.cpp | 20 +- samples/power/power.cpp | 38 +- samples/printing/printing.cpp | 56 +- samples/printing/printing.h | 2 +- samples/propgrid/propgrid.cpp | 2 +- samples/regtest/regtest.cpp | 92 +- samples/render/renddll.cpp | 4 +- samples/render/render.cpp | 44 +- samples/richtext/richtext.cpp | 40 +- samples/sashtest/sashtest.cpp | 44 +- samples/shaped/shaped.cpp | 2 +- samples/sound/sound.cpp | 54 +- samples/splash/splash.cpp | 20 +- samples/splitter/splitter.cpp | 78 +- samples/statbar/statbar.cpp | 90 +- samples/stc/edit.cpp | 82 +- samples/stc/edit.h | 2 +- samples/stc/prefs.cpp | 186 +- samples/stc/stctest.cpp | 26 +- samples/svg/svgtest.cpp | 18 +- samples/taborder/taborder.cpp | 54 +- samples/taskbar/tbtest.cpp | 24 +- samples/text/text.cpp | 576 ++--- samples/thread/thread.cpp | 62 +- samples/toolbar/toolbar.cpp | 164 +- samples/treectrl/treetest.cpp | 22 +- samples/typetest/typetest.cpp | 522 ++--- samples/validate/validate.cpp | 16 +- samples/vscroll/vstest.cpp | 62 +- samples/widgets/bmpcombobox.cpp | 74 +- samples/widgets/button.cpp | 52 +- samples/widgets/checkbox.cpp | 32 +- samples/widgets/choice.cpp | 48 +- samples/widgets/clrpicker.cpp | 10 +- samples/widgets/combobox.cpp | 80 +- samples/widgets/datepick.cpp | 10 +- samples/widgets/dirctrl.cpp | 42 +- samples/widgets/dirpicker.cpp | 12 +- samples/widgets/editlbox.cpp | 14 +- samples/widgets/filectrl.cpp | 10 +- samples/widgets/filepicker.cpp | 18 +- samples/widgets/fontpicker.cpp | 12 +- samples/widgets/gauge.cpp | 46 +- samples/widgets/hyperlnk.cpp | 10 +- samples/widgets/itemcontainer.cpp | 58 +- samples/widgets/listbox.cpp | 68 +- samples/widgets/notebook.cpp | 70 +- samples/widgets/odcombobox.cpp | 88 +- samples/widgets/radiobox.cpp | 66 +- samples/widgets/searchctrl.cpp | 4 +- samples/widgets/slider.cpp | 74 +- samples/widgets/spinbtn.cpp | 62 +- samples/widgets/static.cpp | 50 +- samples/widgets/textctrl.cpp | 130 +- samples/widgets/toggle.cpp | 6 +- samples/widgets/widgets.cpp | 86 +- samples/wizard/wizard.cpp | 84 +- samples/xrc/myframe.cpp | 14 +- src/aui/auibook.cpp | 8 +- src/cocoa/app.mm | 2 +- src/cocoa/bitmap.mm | 2 +- src/cocoa/brush.mm | 6 +- src/cocoa/evtloop.mm | 6 +- src/cocoa/filedlg.mm | 6 +- src/common/accelcmn.cpp | 4 +- src/common/appbase.cpp | 28 +- src/common/appcmn.cpp | 4 +- src/common/artprov.cpp | 22 +- src/common/base64.cpp | 6 +- src/common/bmpbase.cpp | 2 +- src/common/bookctrl.cpp | 12 +- src/common/btncmn.cpp | 2 +- src/common/cmdline.cpp | 118 +- src/common/cmdproc.cpp | 4 +- src/common/cmndata.cpp | 4 +- src/common/colourcmn.cpp | 2 +- src/common/config.cpp | 18 +- src/common/containr.cpp | 24 +- src/common/convauto.cpp | 6 +- src/common/cshelp.cpp | 6 +- src/common/ctrlcmn.cpp | 4 +- src/common/ctrlsub.cpp | 6 +- src/common/datetime.cpp | 138 +- src/common/datetimefmt.cpp | 216 +- src/common/dcbase.cpp | 6 +- src/common/dcbufcmn.cpp | 4 +- src/common/debugrpt.cpp | 148 +- src/common/dircmn.cpp | 10 +- src/common/dlgcmn.cpp | 2 +- src/common/docview.cpp | 8 +- src/common/dpycmn.cpp | 14 +- src/common/dynlib.cpp | 24 +- src/common/dynload.cpp | 30 +- src/common/evtloopcmn.cpp | 4 +- src/common/ffile.cpp | 4 +- src/common/file.cpp | 8 +- src/common/fileconf.cpp | 92 +- src/common/filefn.cpp | 30 +- src/common/filename.cpp | 60 +- src/common/filepickercmn.cpp | 6 +- src/common/filesys.cpp | 36 +- src/common/fldlgcmn.cpp | 10 +- src/common/fmapbase.cpp | 36 +- src/common/fontcmn.cpp | 42 +- src/common/fontenumcmn.cpp | 2 +- src/common/fontmap.cpp | 4 +- src/common/fontmgrcmn.cpp | 8 +- src/common/framecmn.cpp | 2 +- src/common/ftp.cpp | 78 +- src/common/gbsizer.cpp | 12 +- src/common/gdicmn.cpp | 4 +- src/common/glcmn.cpp | 2 +- src/common/hashmap.cpp | 2 +- src/common/iconbndl.cpp | 4 +- src/common/imagbmp.cpp | 4 +- src/common/image.cpp | 14 +- src/common/imagiff.cpp | 18 +- src/common/imagpng.cpp | 8 +- src/common/imagtiff.cpp | 4 +- src/common/init.cpp | 2 +- src/common/intl.cpp | 14 +- src/common/ipcbase.cpp | 2 +- src/common/list.cpp | 2 +- src/common/longlong.cpp | 14 +- src/common/memory.cpp | 8 +- src/common/menucmn.cpp | 10 +- src/common/mimecmn.cpp | 26 +- src/common/module.cpp | 4 +- src/common/mstream.cpp | 6 +- src/common/object.cpp | 10 +- src/common/platinfo.cpp | 96 +- src/common/popupcmn.cpp | 2 +- src/common/prntbase.cpp | 2 +- src/common/process.cpp | 2 +- src/common/protocol.cpp | 2 +- src/common/radiocmn.cpp | 12 +- src/common/regex.cpp | 50 +- src/common/rgncmn.cpp | 2 +- src/common/sckipc.cpp | 4 +- src/common/selectdispatcher.cpp | 14 +- src/common/sizer.cpp | 72 +- src/common/socket.cpp | 18 +- src/common/sstream.cpp | 4 +- src/common/statbar.cpp | 8 +- src/common/stattextcmn.cpp | 6 +- src/common/stdpbase.cpp | 4 +- src/common/stockitem.cpp | 6 +- src/common/strconv.cpp | 34 +- src/common/stream.cpp | 44 +- src/common/string.cpp | 82 +- src/common/stringimpl.cpp | 24 +- src/common/stringops.cpp | 8 +- src/common/strvararg.cpp | 26 +- src/common/sysopt.cpp | 6 +- src/common/tarstrm.cpp | 88 +- src/common/tbarbase.cpp | 36 +- src/common/textbuf.cpp | 12 +- src/common/textcmn.cpp | 16 +- src/common/textfile.cpp | 8 +- src/common/timercmn.cpp | 20 +- src/common/timerimpl.cpp | 2 +- src/common/tokenzr.cpp | 20 +- src/common/txtstrm.cpp | 10 +- src/common/unichar.cpp | 2 +- src/common/url.cpp | 4 +- src/common/utilscmn.cpp | 30 +- src/common/valtext.cpp | 2 +- src/common/variant.cpp | 6 +- src/common/wincmn.cpp | 46 +- src/common/windowid.cpp | 2 +- src/common/wxcrt.cpp | 16 +- src/common/xti.cpp | 36 +- src/common/zipstrm.cpp | 20 +- src/common/zstream.cpp | 12 +- src/dfb/brush.cpp | 4 +- src/dfb/fontmgr.cpp | 2 +- src/dfb/window.cpp | 2 +- src/dfb/wrapdfb.cpp | 2 +- src/expat/xmlwf/win32filemap.c | 6 +- src/expat/xmlwf/xmlwin32url.cxx | 10 +- src/generic/aboutdlgg.cpp | 18 +- src/generic/accel.cpp | 2 +- src/generic/animateg.cpp | 4 +- src/generic/buttonbar.cpp | 6 +- src/generic/calctrlg.cpp | 24 +- src/generic/choicbkg.cpp | 4 +- src/generic/datavgen.cpp | 6 +- src/generic/datectlg.cpp | 6 +- src/generic/dbgrptg.cpp | 28 +- src/generic/dirctrlg.cpp | 8 +- src/generic/editlbox.cpp | 2 +- src/generic/fdrepdlg.cpp | 2 +- src/generic/filectrlg.cpp | 36 +- src/generic/fontdlgg.cpp | 4 +- src/generic/grid.cpp | 50 +- src/generic/gridctrl.cpp | 28 +- src/generic/grideditors.cpp | 36 +- src/generic/helpext.cpp | 12 +- src/generic/htmllbox.cpp | 14 +- src/generic/imaglist.cpp | 4 +- src/generic/listctrl.cpp | 138 +- src/generic/logg.cpp | 8 +- src/generic/numdlgg.cpp | 2 +- src/generic/odcombo.cpp | 8 +- src/generic/prntdlgg.cpp | 8 +- src/generic/scrlwing.cpp | 4 +- src/generic/selstore.cpp | 4 +- src/generic/spinctlg.cpp | 6 +- src/generic/splitter.cpp | 8 +- src/generic/statusbr.cpp | 8 +- src/generic/timer.cpp | 6 +- src/generic/tipwin.cpp | 4 +- src/generic/toolbkg.cpp | 2 +- src/generic/treebkg.cpp | 2 +- src/generic/treectlg.cpp | 12 +- src/generic/vlbox.cpp | 18 +- src/generic/vscroll.cpp | 10 +- src/generic/wizard.cpp | 6 +- src/gtk/aboutdlg.cpp | 2 +- src/gtk/app.cpp | 14 +- src/gtk/brush.cpp | 6 +- src/gtk/checkbox.cpp | 2 +- src/gtk/choice.cpp | 4 +- src/gtk/clipbrd.cpp | 22 +- src/gtk/colordlg.cpp | 2 +- src/gtk/dataview.cpp | 4 +- src/gtk/dcclient.cpp | 8 +- src/gtk/dnd.cpp | 2 +- src/gtk/evtloop.cpp | 2 +- src/gtk/fontdlg.cpp | 2 +- src/gtk/gauge.cpp | 4 +- src/gtk/glcanvas.cpp | 2 +- src/gtk/listbox.cpp | 4 +- src/gtk/menu.cpp | 2 +- src/gtk/msgdlg.cpp | 4 +- src/gtk/notebook.cpp | 2 +- src/gtk/region.cpp | 16 +- src/gtk/scrolwin.cpp | 2 +- src/gtk/settings.cpp | 2 +- src/gtk/slider.cpp | 2 +- src/gtk/tbargtk.cpp | 4 +- src/gtk/textctrl.cpp | 8 +- src/gtk/textentry.cpp | 2 +- src/gtk/timer.cpp | 4 +- src/gtk/toplevel.cpp | 4 +- src/gtk/utilsgtk.cpp | 14 +- src/gtk/window.cpp | 46 +- src/gtk1/app.cpp | 2 +- src/gtk1/bitmap.cpp | 2 +- src/gtk1/brush.cpp | 6 +- src/gtk1/choice.cpp | 2 +- src/gtk1/clipbrd.cpp | 6 +- src/gtk1/control.cpp | 4 +- src/gtk1/dataobj.cpp | 8 +- src/gtk1/dcclient.cpp | 12 +- src/gtk1/dnd.cpp | 4 +- src/gtk1/evtloop.cpp | 8 +- src/gtk1/font.cpp | 42 +- src/gtk1/fontdlg.cpp | 2 +- src/gtk1/gauge.cpp | 4 +- src/gtk1/mdi.cpp | 2 +- src/gtk1/menu.cpp | 6 +- src/gtk1/notebook.cpp | 8 +- src/gtk1/radiobox.cpp | 4 +- src/gtk1/region.cpp | 14 +- src/gtk1/scrolwin.cpp | 2 +- src/gtk1/settings.cpp | 6 +- src/gtk1/tbargtk.cpp | 8 +- src/gtk1/textctrl.cpp | 10 +- src/gtk1/timer.cpp | 4 +- src/gtk1/toplevel.cpp | 16 +- src/gtk1/window.cpp | 28 +- src/html/chm.cpp | 48 +- src/html/helpctrl.cpp | 2 +- src/html/helpdata.cpp | 56 +- src/html/helpwnd.cpp | 36 +- src/html/htmlcell.cpp | 10 +- src/html/htmlfilt.cpp | 4 +- src/html/htmlfilter.cpp | 8 +- src/html/htmlpars.cpp | 16 +- src/html/htmltag.cpp | 10 +- src/html/htmlwin.cpp | 6 +- src/mgl/app.cpp | 2 +- src/mgl/brush.cpp | 14 +- src/mgl/cursor.cpp | 4 +- src/mgl/dc.cpp | 4 +- src/mgl/dirmgl.cpp | 10 +- src/mgl/evtloop.cpp | 8 +- src/mgl/fontmgr.cpp | 16 +- src/mgl/fontutil.cpp | 6 +- src/mgl/pen.cpp | 8 +- src/mgl/region.cpp | 2 +- src/mgl/settings.cpp | 2 +- src/mgl/window.cpp | 10 +- src/motif/app.cpp | 6 +- src/motif/bmpmotif.cpp | 2 +- src/motif/evtloop.cpp | 6 +- src/motif/filedlg.cpp | 6 +- src/motif/font.cpp | 6 +- src/motif/scrolbar.cpp | 2 +- src/motif/settings.cpp | 2 +- src/motif/spinbutt.cpp | 2 +- src/motif/toolbar.cpp | 2 +- src/motif/window.cpp | 2 +- src/msdos/mimetype.cpp | 10 +- src/msdos/utilsdos.cpp | 40 +- src/msw/aboutdlg.cpp | 6 +- src/msw/app.cpp | 44 +- src/msw/bitmap.cpp | 36 +- src/msw/brush.cpp | 12 +- src/msw/button.cpp | 12 +- src/msw/calctrl.cpp | 8 +- src/msw/caret.cpp | 2 +- src/msw/checkbox.cpp | 8 +- src/msw/checklst.cpp | 8 +- src/msw/choice.cpp | 4 +- src/msw/combo.cpp | 2 +- src/msw/combobox.cpp | 10 +- src/msw/control.cpp | 2 +- src/msw/crashrpt.cpp | 24 +- src/msw/cursor.cpp | 32 +- src/msw/datecontrols.cpp | 2 +- src/msw/datectrl.cpp | 12 +- src/msw/dc.cpp | 66 +- src/msw/dcclient.cpp | 8 +- src/msw/dcmemory.cpp | 2 +- src/msw/dcprint.cpp | 6 +- src/msw/dde.cpp | 26 +- src/msw/debughlp.cpp | 240 +-- src/msw/dialog.cpp | 10 +- src/msw/dialup.cpp | 18 +- src/msw/dib.cpp | 34 +- src/msw/dir.cpp | 30 +- src/msw/dirdlg.cpp | 8 +- src/msw/display.cpp | 34 +- src/msw/dlmsw.cpp | 16 +- src/msw/dragimag.cpp | 2 +- src/msw/enhmeta.cpp | 58 +- src/msw/fdrepdlg.cpp | 14 +- src/msw/filedlg.cpp | 24 +- src/msw/fontutil.cpp | 12 +- src/msw/frame.cpp | 2 +- src/msw/gdiimage.cpp | 34 +- src/msw/gdiplus.cpp | 6 +- src/msw/glcanvas.cpp | 24 +- src/msw/headerctrl.cpp | 10 +- src/msw/helpchm.cpp | 2 +- src/msw/icon.cpp | 2 +- src/msw/imaglist.cpp | 6 +- src/msw/iniconf.cpp | 10 +- src/msw/listbox.cpp | 8 +- src/msw/listctrl.cpp | 56 +- src/msw/main.cpp | 12 +- src/msw/mdi.cpp | 10 +- src/msw/mediactrl.cpp | 4 +- src/msw/mediactrl_am.cpp | 2 +- src/msw/mediactrl_wmp10.cpp | 4 +- src/msw/menu.cpp | 8 +- src/msw/menuitem.cpp | 16 +- src/msw/metafile.cpp | 12 +- src/msw/mimetype.cpp | 96 +- src/msw/msgdlg.cpp | 8 +- src/msw/nativdlg.cpp | 2 +- src/msw/notebook.cpp | 12 +- src/msw/notifmsg.cpp | 6 +- src/msw/ole/automtn.cpp | 2 +- src/msw/ole/dataobj.cpp | 6 +- src/msw/ole/droptgt.cpp | 6 +- src/msw/ole/oleutils.cpp | 2 +- src/msw/ownerdrw.cpp | 2 +- src/msw/pen.cpp | 6 +- src/msw/popupwin.cpp | 2 +- src/msw/power.cpp | 4 +- src/msw/radiobox.cpp | 4 +- src/msw/radiobut.cpp | 8 +- src/msw/regconf.cpp | 16 +- src/msw/region.cpp | 18 +- src/msw/registry.cpp | 34 +- src/msw/scrolbar.cpp | 4 +- src/msw/settings.cpp | 12 +- src/msw/slider.cpp | 2 +- src/msw/snglinst.cpp | 12 +- src/msw/sockmsw.cpp | 4 +- src/msw/spinctrl.cpp | 10 +- src/msw/stackwalk.cpp | 18 +- src/msw/statbmp.cpp | 10 +- src/msw/statbox.cpp | 2 +- src/msw/statline.cpp | 2 +- src/msw/statusbar.cpp | 2 +- src/msw/stdpaths.cpp | 14 +- src/msw/taskbar.cpp | 4 +- src/msw/textctrl.cpp | 52 +- src/msw/textentry.cpp | 8 +- src/msw/tglbtn.cpp | 2 +- src/msw/thread.cpp | 34 +- src/msw/timer.cpp | 10 +- src/msw/toolbar.cpp | 22 +- src/msw/tooltip.cpp | 14 +- src/msw/toplevel.cpp | 38 +- src/msw/treectrl.cpp | 18 +- src/msw/utils.cpp | 54 +- src/msw/utilsexc.cpp | 42 +- src/msw/utilsgui.cpp | 14 +- src/msw/uxtheme.cpp | 4 +- src/msw/volume.cpp | 18 +- src/msw/wince/checklst.cpp | 18 +- src/msw/wince/choicece.cpp | 8 +- src/msw/wince/filedlgwce.cpp | 6 +- src/msw/wince/menuce.cpp | 2 +- src/msw/wince/tbarwce.cpp | 10 +- src/msw/wince/textctrlce.cpp | 10 +- src/msw/window.cpp | 104 +- src/os2/bitmap.cpp | 4 +- src/os2/brush.cpp | 14 +- src/os2/button.cpp | 4 +- src/os2/combobox.cpp | 2 +- src/os2/control.cpp | 10 +- src/os2/dc.cpp | 6 +- src/os2/dcclient.cpp | 10 +- src/os2/dcmemory.cpp | 2 +- src/os2/dcprint.cpp | 2 +- src/os2/dialog.cpp | 4 +- src/os2/dir.cpp | 22 +- src/os2/dnd.cpp | 42 +- src/os2/evtloop.cpp | 8 +- src/os2/filedlg.cpp | 12 +- src/os2/font.cpp | 10 +- src/os2/fontutil.cpp | 12 +- src/os2/frame.cpp | 6 +- src/os2/gdiimage.cpp | 14 +- src/os2/listbox.cpp | 2 +- src/os2/listctrl.cpp | 14 +- src/os2/menu.cpp | 4 +- src/os2/menuitem.cpp | 12 +- src/os2/mimetype.cpp | 28 +- src/os2/pen.cpp | 6 +- src/os2/radiobut.cpp | 4 +- src/os2/region.cpp | 4 +- src/os2/settings.cpp | 2 +- src/os2/snglinst.cpp | 10 +- src/os2/spinctrl.cpp | 2 +- src/os2/statbmp.cpp | 2 +- src/os2/stattext.cpp | 4 +- src/os2/stdpaths.cpp | 6 +- src/os2/textctrl.cpp | 2 +- src/os2/thread.cpp | 18 +- src/os2/toolbar.cpp | 2 +- src/os2/tooltip.cpp | 2 +- src/os2/toplevel.cpp | 24 +- src/os2/utils.cpp | 36 +- src/os2/utilsgui.cpp | 4 +- src/os2/window.cpp | 12 +- src/osx/artmac.cpp | 2 +- src/osx/brush.cpp | 6 +- src/osx/carbon/app.cpp | 2 +- src/osx/carbon/clipbrd.cpp | 2 +- src/osx/carbon/dcclient.cpp | 4 +- src/osx/carbon/dcprint.cpp | 2 +- src/osx/carbon/dirmac.cpp | 10 +- src/osx/carbon/font.cpp | 4 +- src/osx/carbon/fontdlg.cpp | 2 +- src/osx/carbon/graphics.cpp | 2 +- src/osx/carbon/listctrl_mac.cpp | 22 +- src/osx/carbon/region.cpp | 6 +- src/osx/carbon/settings.cpp | 2 +- src/osx/carbon/textctrl.cpp | 8 +- src/osx/carbon/thread.cpp | 2 +- src/osx/carbon/toolbar.cpp | 2 +- src/osx/carbon/window.cpp | 14 +- src/osx/checklst_osx.cpp | 4 +- src/osx/cocoa/nonownedwnd.mm | 4 +- src/osx/cocoa/toolbar.mm | 2 +- src/osx/cocoa/window.mm | 6 +- src/osx/core/hid.cpp | 18 +- src/osx/core/printmac.cpp | 4 +- src/osx/core/stdpaths_cf.cpp | 4 +- src/osx/core/utilsexc_base.cpp | 2 +- src/osx/glcanvas_osx.cpp | 2 +- src/osx/imaglist.cpp | 8 +- src/osx/iphone/window.mm | 4 +- src/osx/listbox_osx.cpp | 2 +- src/osx/menu_osx.cpp | 6 +- src/osx/menuitem_osx.cpp | 2 +- src/osx/nonownedwnd_osx.cpp | 2 +- src/osx/spinctrl_osx.cpp | 10 +- src/osx/window_osx.cpp | 4 +- src/palmos/caret.cpp | 2 +- src/palmos/datectrl.cpp | 2 +- src/palmos/dcclient.cpp | 6 +- src/palmos/dcmemory.cpp | 2 +- src/palmos/dir.cpp | 14 +- src/palmos/menu.cpp | 2 +- src/palmos/slider.cpp | 2 +- src/palmos/statbrpalm.cpp | 6 +- src/palmos/utils.cpp | 2 +- src/propgrid/propgrid.cpp | 4 +- src/regex/regc_locale.c | 206 +- src/richtext/richtextbuffer.cpp | 2 +- src/richtext/richtextbulletspage.cpp | 8 +- src/richtext/richtextfontpage.cpp | 10 +- src/richtext/richtextindentspage.cpp | 10 +- src/richtext/richtextliststylepage.cpp | 18 +- src/richtext/richtextstylepage.cpp | 6 +- src/richtext/richtextsymboldlg.cpp | 10 +- src/richtext/richtexttabspage.cpp | 4 +- src/univ/checkbox.cpp | 2 +- src/univ/checklst.cpp | 4 +- src/univ/combobox.cpp | 8 +- src/univ/ctrlrend.cpp | 22 +- src/univ/dialog.cpp | 4 +- src/univ/listbox.cpp | 20 +- src/univ/menu.cpp | 102 +- src/univ/notebook.cpp | 36 +- src/univ/radiobox.cpp | 20 +- src/univ/scrarrow.cpp | 2 +- src/univ/scrolbar.cpp | 6 +- src/univ/scrthumb.cpp | 6 +- src/univ/settingsuniv.cpp | 2 +- src/univ/slider.cpp | 14 +- src/univ/statusbr.cpp | 6 +- src/univ/stdrend.cpp | 8 +- src/univ/textctrl.cpp | 142 +- src/univ/theme.cpp | 2 +- src/univ/themes/gtk.cpp | 18 +- src/univ/themes/metal.cpp | 4 +- src/univ/themes/mono.cpp | 46 +- src/univ/themes/win32.cpp | 10 +- src/univ/toolbar.cpp | 18 +- src/univ/topluniv.cpp | 2 +- src/univ/winuniv.cpp | 16 +- src/unix/dialup.cpp | 32 +- src/unix/dir.cpp | 18 +- src/unix/displayx11.cpp | 4 +- src/unix/dlunix.cpp | 16 +- src/unix/epolldispatcher.cpp | 18 +- src/unix/evtloopunix.cpp | 2 +- src/unix/fontutil.cpp | 82 +- src/unix/glx11.cpp | 18 +- src/unix/mimetype.cpp | 8 +- src/unix/snglinst.cpp | 10 +- src/unix/sound.cpp | 50 +- src/unix/sound_sdl.cpp | 20 +- src/unix/stackwalk.cpp | 18 +- src/unix/stdpaths.cpp | 18 +- src/unix/taskbarx11.cpp | 8 +- src/unix/threadpsx.cpp | 124 +- src/unix/timerunx.cpp | 10 +- src/unix/utilsunx.cpp | 28 +- src/unix/utilsx11.cpp | 12 +- src/x11/app.cpp | 22 +- src/x11/brush.cpp | 6 +- src/x11/clipbrd.cpp | 4 +- src/x11/dataobj.cpp | 8 +- src/x11/dcclient.cpp | 8 +- src/x11/evtloop.cpp | 6 +- src/x11/font.cpp | 32 +- src/x11/region.cpp | 8 +- src/x11/reparent.cpp | 6 +- src/x11/window.cpp | 4 +- src/xrc/xh_animatctrl.cpp | 2 +- src/xrc/xh_clrpicker.cpp | 2 +- src/xrc/xh_collpane.cpp | 4 +- src/xrc/xh_datectrl.cpp | 2 +- src/xrc/xh_dirpicker.cpp | 2 +- src/xrc/xh_filectrl.cpp | 2 +- src/xrc/xh_filepicker.cpp | 2 +- src/xrc/xh_fontpicker.cpp | 2 +- src/xrc/xh_htmllbox.cpp | 2 +- src/xrc/xh_text.cpp | 2 +- src/xrc/xh_tree.cpp | 2 +- src/xrc/xh_unkwn.cpp | 2 +- src/xrc/xmlres.cpp | 10 +- tests/archive/archivetest.cpp | 110 +- tests/archive/tartest.cpp | 4 +- tests/archive/ziptest.cpp | 20 +- tests/arrays/arrays.cpp | 162 +- tests/benchmarks/htmlparser/htmlpars.cpp | 14 +- tests/benchmarks/htmlparser/htmltag.cpp | 10 +- tests/config/fileconf.cpp | 380 ++-- tests/datetime/datetimetest.cpp | 28 +- tests/filekind/filekind.cpp | 2 +- tests/filesys/filesystest.cpp | 22 +- tests/fontmap/fontmaptest.cpp | 66 +- tests/formatconverter/formatconvertertest.cpp | 96 +- tests/hashes/hashes.cpp | 28 +- tests/lists/lists.cpp | 4 +- tests/longlong/longlongtest.cpp | 16 +- tests/mbconv/convautotest.cpp | 14 +- tests/mbconv/mbconvtest.cpp | 14 +- tests/regex/regextest.cpp | 56 +- tests/regex/wxregextest.cpp | 36 +- tests/streams/bstream.h | 4 +- tests/streams/datastreamtest.cpp | 12 +- tests/streams/ffilestream.cpp | 4 +- tests/streams/filestream.cpp | 4 +- tests/streams/largefile.cpp | 24 +- tests/streams/sstream.cpp | 2 +- tests/streams/tempfile.cpp | 2 +- tests/streams/textstreamtest.cpp | 12 +- tests/streams/zlibstream.cpp | 40 +- tests/strings/crt.cpp | 6 +- tests/strings/stdstrings.cpp | 404 ++-- tests/strings/strings.cpp | 272 +-- tests/strings/tokenizer.cpp | 106 +- tests/strings/unichar.cpp | 34 +- tests/strings/unicode.cpp | 2 +- tests/strings/vararg.cpp | 12 +- tests/strings/vsnprintf.cpp | 12 +- tests/textfile/textfiletest.cpp | 18 +- tests/uris/uris.cpp | 2 +- utils/emulator/src/emulator.cpp | 34 +- utils/helpview/src/helpview.cpp | 4 +- utils/helpview/src/remhelp.cpp | 20 +- utils/hhp2cached/hhp2cached.cpp | 2 +- utils/screenshotgen/src/autocapture.cpp | 20 +- utils/screenshotgen/src/autocapture.h | 6 +- utils/screenshotgen/src/guiframe.cpp | 72 +- utils/screenshotgen/src/screenshot_main.cpp | 30 +- utils/wxrc/wxrc.cpp | 236 +-- 798 files changed, 10394 insertions(+), 10373 deletions(-) diff --git a/build/bakefiles/wxpresets/sample/minimal.cpp b/build/bakefiles/wxpresets/sample/minimal.cpp index 4825c0044d..06917571e7 100644 --- a/build/bakefiles/wxpresets/sample/minimal.cpp +++ b/build/bakefiles/wxpresets/sample/minimal.cpp @@ -115,7 +115,7 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { // create the main application window - MyFrame *frame = new MyFrame(_T("Minimal wxWindows App")); + MyFrame *frame = new MyFrame(wxT("Minimal wxWindows App")); // and show it (the frames, unlike simple controls, are not shown when // created initially) @@ -143,14 +143,14 @@ MyFrame::MyFrame(const wxString& title) // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(Minimal_About, wxT("&About...\tF1"), wxT("Show about dialog")); - menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -159,7 +159,7 @@ MyFrame::MyFrame(const wxString& title) #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWindows!")); + SetStatusText(wxT("Welcome to wxWindows!")); #endif // wxUSE_STATUSBAR } @@ -175,8 +175,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the About dialog of the minimal sample.\n") - _T("Welcome to %s"), wxVERSION_STRING); + msg.Printf( wxT("This is the About dialog of the minimal sample.\n") + wxT("Welcome to %s"), wxVERSION_STRING); - wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this); } diff --git a/demos/forty/canvas.cpp b/demos/forty/canvas.cpp index 3b1cc178d9..4fd11dc2fa 100644 --- a/demos/forty/canvas.cpp +++ b/demos/forty/canvas.cpp @@ -53,7 +53,7 @@ FortyCanvas::FortyCanvas(wxWindow* parent, const wxPoint& pos, const wxSize& siz m_arrowCursor = new wxCursor(wxCURSOR_ARROW); wxString name = wxTheApp->GetAppName(); - if (name.Length() <= 0) name = _T("forty"); + if (name.Length() <= 0) name = wxT("forty"); m_scoreFile = new ScoreFile(name); m_game = new Game(0, 0, 0); m_game->Deal(); @@ -156,8 +156,8 @@ Called when the main frame is closed bool FortyCanvas::OnCloseCanvas() { if (m_game->InPlay() && - wxMessageBox(_T("Are you sure you want to\nabandon the current game?"), - _T("Warning"), wxYES_NO | wxICON_QUESTION) == wxNO) + wxMessageBox(wxT("Are you sure you want to\nabandon the current game?"), + wxT("Warning"), wxYES_NO | wxICON_QUESTION) == wxNO) { return false; } diff --git a/demos/forty/card.cpp b/demos/forty/card.cpp index 44a0f65d4b..f1f9dea885 100644 --- a/demos/forty/card.cpp +++ b/demos/forty/card.cpp @@ -62,7 +62,7 @@ Card::Card(int value, WayUp way_up) : m_symbolBmap = new wxBitmap(symbols_xpm); if (!m_symbolBmap->Ok()) { - ::wxMessageBox(_T("Failed to load bitmap CardSymbols"), _T("Error")); + ::wxMessageBox(wxT("Failed to load bitmap CardSymbols"), wxT("Error")); } } if (!m_pictureBmap) @@ -70,7 +70,7 @@ Card::Card(int value, WayUp way_up) : m_pictureBmap = new wxBitmap(Pictures); if (!m_pictureBmap->Ok()) { - ::wxMessageBox(_T("Failed to load bitmap CardPictures"), _T("Error")); + ::wxMessageBox(wxT("Failed to load bitmap CardPictures"), wxT("Error")); } } diff --git a/demos/forty/forty.cpp b/demos/forty/forty.cpp index 24902505bb..ef09eafd1e 100644 --- a/demos/forty/forty.cpp +++ b/demos/forty/forty.cpp @@ -79,7 +79,7 @@ bool FortyApp::OnInit() wxSize size(668,510); - if ((argc > 1) && (!wxStrcmp(argv[1],_T("-L")))) + if ((argc > 1) && (!wxStrcmp(argv[1],wxT("-L")))) { largecards = true; size = wxSize(1000,750); @@ -87,7 +87,7 @@ bool FortyApp::OnInit() FortyFrame* frame = new FortyFrame( 0, - _T("Forty Thieves"), + wxT("Forty Thieves"), wxDefaultPosition, size, largecards @@ -140,35 +140,35 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos #endif // set the icon #ifdef __WXMSW__ - SetIcon(wxIcon(_T("CardsIcon"))); + SetIcon(wxIcon(wxT("CardsIcon"))); #else SetIcon(wxIcon(forty_xpm)); #endif // Make a menu bar wxMenu* gameMenu = new wxMenu; - gameMenu->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), _T("Start a new game")); - gameMenu->Append(SCORES, _T("&Scores..."), _T("Displays scores")); - gameMenu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT), _T("Exits Forty Thieves")); + gameMenu->Append(wxID_NEW, wxGetStockLabel(wxID_NEW), wxT("Start a new game")); + gameMenu->Append(SCORES, wxT("&Scores..."), wxT("Displays scores")); + gameMenu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT), wxT("Exits Forty Thieves")); wxMenu* editMenu = new wxMenu; - editMenu->Append(wxID_UNDO, wxGetStockLabel(wxID_UNDO), _T("Undo the last move")); - editMenu->Append(wxID_REDO, wxGetStockLabel(wxID_REDO), _T("Redo a move that has been undone")); + editMenu->Append(wxID_UNDO, wxGetStockLabel(wxID_UNDO), wxT("Undo the last move")); + editMenu->Append(wxID_REDO, wxGetStockLabel(wxID_REDO), wxT("Redo a move that has been undone")); wxMenu* optionsMenu = new wxMenu; optionsMenu->Append(RIGHT_BUTTON_UNDO, - _T("&Right button undo"), - _T("Enables/disables right mouse button undo and redo"), + wxT("&Right button undo"), + wxT("Enables/disables right mouse button undo and redo"), true ); optionsMenu->Append(HELPING_HAND, - _T("&Helping hand"), - _T("Enables/disables hand cursor when a card can be moved"), + wxT("&Helping hand"), + wxT("Enables/disables hand cursor when a card can be moved"), true ); optionsMenu->Append(LARGE_CARDS, - _T("&Large cards"), - _T("Enables/disables large cards for high resolution displays"), + wxT("&Large cards"), + wxT("Enables/disables large cards for high resolution displays"), true ); optionsMenu->Check(HELPING_HAND, true); @@ -176,14 +176,14 @@ FortyFrame::FortyFrame(wxFrame* frame, const wxString& title, const wxPoint& pos optionsMenu->Check(LARGE_CARDS, largecards ? true : false); wxMenu* helpMenu = new wxMenu; - helpMenu->Append(wxID_HELP_CONTENTS, _T("&Help Contents"), _T("Displays information about playing the game")); - helpMenu->Append(wxID_ABOUT, _T("&About..."), _T("About Forty Thieves")); + helpMenu->Append(wxID_HELP_CONTENTS, wxT("&Help Contents"), wxT("Displays information about playing the game")); + helpMenu->Append(wxID_ABOUT, wxT("&About..."), wxT("About Forty Thieves")); m_menuBar = new wxMenuBar; - m_menuBar->Append(gameMenu, _T("&Game")); - m_menuBar->Append(editMenu, _T("&Edit")); - m_menuBar->Append(optionsMenu, _T("&Options")); - m_menuBar->Append(helpMenu, _T("&Help")); + m_menuBar->Append(gameMenu, wxT("&Game")); + m_menuBar->Append(editMenu, wxT("&Edit")); + m_menuBar->Append(optionsMenu, wxT("&Options")); + m_menuBar->Append(helpMenu, wxT("&Help")); SetMenuBar(m_menuBar); @@ -247,11 +247,11 @@ void FortyFrame::About(wxCommandEvent&) { wxMessageBox( - _T("Forty Thieves\n\n") - _T("A free card game written with the wxWidgets toolkit\n") - _T("Author: Chris Breeze (c) 1992-2004\n") - _T("email: chris@breezesys.com"), - _T("About Forty Thieves"), + wxT("Forty Thieves\n\n") + wxT("A free card game written with the wxWidgets toolkit\n") + wxT("Author: Chris Breeze (c) 1992-2004\n") + wxT("email: chris@breezesys.com"), + wxT("About Forty Thieves"), wxOK|wxICON_INFORMATION, this ); } @@ -326,7 +326,7 @@ bool FortyAboutDialog::AddControls(wxWindow* parent) file.Open(); for ( htmlText = file.GetFirstLine(); !file.Eof(); - htmlText << file.GetNextLine() << _T("\n") ) ; + htmlText << file.GetNextLine() << wxT("\n") ) ; } } @@ -336,7 +336,7 @@ bool FortyAboutDialog::AddControls(wxWindow* parent) } // Customize the HTML - htmlText.Replace(wxT("$DATE$"), _T(__DATE__)); + htmlText.Replace(wxT("$DATE$"), wxT(__DATE__)); wxSize htmlSize(400, 290); diff --git a/demos/forty/game.cpp b/demos/forty/game.cpp index dcf32e42b1..24941f015d 100644 --- a/demos/forty/game.cpp +++ b/demos/forty/game.cpp @@ -158,7 +158,7 @@ void Game::DoMove(wxDC& dc, Pile* src, Pile* dest) { if (src == dest) { - wxMessageBox(_T("Game::DoMove() src == dest"), _T("Debug message"), + wxMessageBox(wxT("Game::DoMove() src == dest"), wxT("Debug message"), wxOK | wxICON_EXCLAMATION); } m_moves[m_moveIndex].src = src; @@ -170,7 +170,7 @@ void Game::DoMove(wxDC& dc, Pile* src, Pile* dest) } else { - wxMessageBox(_T("Game::DoMove() Undo buffer full"), _T("Debug message"), + wxMessageBox(wxT("Game::DoMove() Undo buffer full"), wxT("Debug message"), wxOK | wxICON_EXCLAMATION); } @@ -198,8 +198,8 @@ void Game::DoMove(wxDC& dc, Pile* src, Pile* dest) // Redraw the score box to update games won DisplayScore(dc); - if (wxMessageBox(_T("Do you wish to play again?"), - _T("Well Done, You have won!"), wxYES_NO | wxICON_QUESTION) == wxYES) + if (wxMessageBox(wxT("Do you wish to play again?"), + wxT("Well Done, You have won!"), wxYES_NO | wxICON_QUESTION) == wxYES) { Deal(); canvas->Refresh(); @@ -236,25 +236,25 @@ void Game::DisplayScore(wxDC& dc) wxCoord w, h; { wxCoord width, height; - dc.GetTextExtent(_T("Average score:m_x"), &width, &height); + dc.GetTextExtent(wxT("Average score:m_x"), &width, &height); w = width; h = height; } dc.DrawRectangle(x + w, y, 20, 4 * h); wxString str; - str.Printf(_T("%d"), m_currentScore); - dc.DrawText(_T("Score:"), x, y); + str.Printf(wxT("%d"), m_currentScore); + dc.DrawText(wxT("Score:"), x, y); dc.DrawText(str, x + w, y); y += h; - str.Printf(_T("%d"), m_numGames); - dc.DrawText(_T("Games played:"), x, y); + str.Printf(wxT("%d"), m_numGames); + dc.DrawText(wxT("Games played:"), x, y); dc.DrawText(str, x + w, y); y += h; - str.Printf(_T("%d"), m_numWins); - dc.DrawText(_T("Games won:"), x, y); + str.Printf(wxT("%d"), m_numWins); + dc.DrawText(wxT("Games won:"), x, y); dc.DrawText(str, x + w, y); y += h; @@ -263,8 +263,8 @@ void Game::DisplayScore(wxDC& dc) { average = (2 * (m_currentScore + m_totalScore) + m_numGames ) / (2 * m_numGames); } - str.Printf(_T("%d"), average); - dc.DrawText(_T("Average score:"), x, y); + str.Printf(wxT("%d"), average); + dc.DrawText(wxT("Average score:"), x, y); dc.DrawText(str, x + w, y); } @@ -794,7 +794,7 @@ void Pack::Redraw(wxDC& dc) Pile::Redraw(dc); wxString str; - str.Printf(_T("%d "), m_topCard + 1); + str.Printf(wxT("%d "), m_topCard + 1); dc.SetBackgroundMode( wxSOLID ); dc.SetTextBackground(FortyApp::BackgroundColour()); @@ -811,7 +811,7 @@ void Pack::AddCard(Card* card) } else { - wxMessageBox(_T("Pack::AddCard() Undo error"), _T("Forty Thieves: Warning"), + wxMessageBox(wxT("Pack::AddCard() Undo error"), wxT("Forty Thieves: Warning"), wxOK | wxICON_EXCLAMATION); } card->TurnCard(facedown); diff --git a/demos/forty/playerdg.cpp b/demos/forty/playerdg.cpp index 8a64623191..7f5effaa32 100644 --- a/demos/forty/playerdg.cpp +++ b/demos/forty/playerdg.cpp @@ -37,10 +37,10 @@ PlayerSelectionDialog::PlayerSelectionDialog( wxWindow* parent, ScoreFile* file ) : - wxDialog(parent, wxID_ANY, _T("Player Selection"), wxDefaultPosition), + wxDialog(parent, wxID_ANY, wxT("Player Selection"), wxDefaultPosition), m_scoreFile(file) { - wxStaticText* msg = new wxStaticText(this, wxID_ANY, _T("Please select a name or type a new one:")); + wxStaticText* msg = new wxStaticText(this, wxID_ANY, wxT("Please select a name or type a new one:")); wxListBox* list = new wxListBox( this, ID_LISTBOX, @@ -116,9 +116,9 @@ void PlayerSelectionDialog::ButtonCallback(wxCommandEvent& event) wxString name = m_textField->GetValue(); if (!name.IsNull() && name.Length() > 0) { - if (name.Contains(_T('@'))) + if (name.Contains(wxT('@'))) { - wxMessageBox(_T("Names should not contain the '@' character"), _T("Forty Thieves")); + wxMessageBox(wxT("Names should not contain the '@' character"), wxT("Forty Thieves")); } else { @@ -128,7 +128,7 @@ void PlayerSelectionDialog::ButtonCallback(wxCommandEvent& event) } else { - wxMessageBox(_T("Please enter your name"), _T("Forty Thieves")); + wxMessageBox(wxT("Please enter your name"), wxT("Forty Thieves")); } } else diff --git a/demos/forty/scoredg.cpp b/demos/forty/scoredg.cpp index ecd1bb44f4..b12e16f2c2 100644 --- a/demos/forty/scoredg.cpp +++ b/demos/forty/scoredg.cpp @@ -156,17 +156,17 @@ ScoreDialog::ScoreDialog(wxWindow* parent, ScoreFile* file) : average = (2 * score + games) / (2 * games); } list->SetCellValue(i,0,players[i]); - string_value.Printf( _T("%u"), wins ); + string_value.Printf( wxT("%u"), wins ); list->SetCellValue(i,1,string_value); - string_value.Printf( _T("%u"), games ); + string_value.Printf( wxT("%u"), games ); list->SetCellValue(i,2,string_value); - string_value.Printf( _T("%u"), average ); + string_value.Printf( wxT("%u"), average ); list->SetCellValue(i,3,string_value); } - list->SetColLabelValue(0, _T("Players")); - list->SetColLabelValue(1, _T("Wins")); - list->SetColLabelValue(2, _T("Games")); - list->SetColLabelValue(3, _T("Score")); + list->SetColLabelValue(0, wxT("Players")); + list->SetColLabelValue(1, wxT("Wins")); + list->SetColLabelValue(2, wxT("Games")); + list->SetColLabelValue(3, wxT("Score")); list->SetEditable(false); list->AutoSizeColumns(); list->AutoSizeRows(); diff --git a/demos/forty/scorefil.cpp b/demos/forty/scorefil.cpp index e49fb6afce..96f66d3198 100644 --- a/demos/forty/scorefil.cpp +++ b/demos/forty/scorefil.cpp @@ -33,7 +33,7 @@ ScoreFile::ScoreFile(const wxString& appName) { - m_config = new wxConfig(appName, _T("wxWidgets"), appName, wxEmptyString, + m_config = new wxConfig(appName, wxT("wxWidgets"), appName, wxEmptyString, wxCONFIG_USE_LOCAL_FILE); // only local } @@ -45,7 +45,7 @@ ScoreFile::~ScoreFile() void ScoreFile::GetPlayerList( wxArrayString &list ) { - m_config->SetPath(_T("/Players")); + m_config->SetPath(wxT("/Players")); int length = m_config->GetNumberOfGroups(); if (length <= 0) return; @@ -87,8 +87,8 @@ long ScoreFile::CalcCheck(const wxString& name, int p1, int p2, int p3) wxString ScoreFile::GetPreviousPlayer() const { wxString result; - m_config->SetPath(_T("/General")); - m_config->Read(_T("LastPlayer"), &result); + m_config->SetPath(wxT("/General")); + m_config->Read(wxT("LastPlayer"), &result); return result; } @@ -103,16 +103,16 @@ void ScoreFile::ReadPlayersScore( games = wins = score = 0; - m_config->SetPath(_T("/Players")); + m_config->SetPath(wxT("/Players")); m_config->SetPath(player); - if (m_config->Read(_T("Score"), &myScore, 0L) && - m_config->Read(_T("Games"), &myGames, 0L) && - m_config->Read(_T("Wins"), &myWins, 0L) && - m_config->Read(_T("Check"), &check, 0L)) + if (m_config->Read(wxT("Score"), &myScore, 0L) && + m_config->Read(wxT("Games"), &myGames, 0L) && + m_config->Read(wxT("Wins"), &myWins, 0L) && + m_config->Read(wxT("Check"), &check, 0L)) { if (check != CalcCheck(player, myGames, myWins, myScore)) { - wxMessageBox(_T("Score file corrupted"), _T("Warning"), + wxMessageBox(wxT("Score file corrupted"), wxT("Warning"), wxOK | wxICON_EXCLAMATION); } else @@ -130,14 +130,14 @@ void ScoreFile::WritePlayersScore(const wxString& player, int wins, int games, i { if (!player.empty()) { - m_config->SetPath(_T("/General")); - m_config->Write(_T("LastPlayer"), wxString(player)); // Without wxString tmp, thinks it's bool in VC++ + m_config->SetPath(wxT("/General")); + m_config->Write(wxT("LastPlayer"), wxString(player)); // Without wxString tmp, thinks it's bool in VC++ - m_config->SetPath(_T("/Players")); + m_config->SetPath(wxT("/Players")); m_config->SetPath(player); - m_config->Write(_T("Score"), (long)score); - m_config->Write(_T("Games"), (long)games); - m_config->Write(_T("Wins"), (long)wins); - m_config->Write(_T("Check"), CalcCheck(player, games, wins, score)); + m_config->Write(wxT("Score"), (long)score); + m_config->Write(wxT("Games"), (long)games); + m_config->Write(wxT("Wins"), (long)wins); + m_config->Write(wxT("Check"), CalcCheck(player, games, wins, score)); } } diff --git a/demos/fractal/fractal.cpp b/demos/fractal/fractal.cpp index 6ff04d4882..c03f98d001 100644 --- a/demos/fractal/fractal.cpp +++ b/demos/fractal/fractal.cpp @@ -93,13 +93,13 @@ DECLARE_EVENT_TABLE() bool MyApp::OnInit() { // Create the main frame window - MyFrame *frame = new MyFrame(NULL, _T("Fractal Mountains for wxWidgets"), wxDefaultPosition, wxSize(640, 480)); + MyFrame *frame = new MyFrame(NULL, wxT("Fractal Mountains for wxWidgets"), wxDefaultPosition, wxSize(640, 480)); // Make a menubar wxMenu *file_menu = new wxMenu; file_menu->Append(wxID_EXIT, wxGetStockLabel(wxID_EXIT)); menuBar = new wxMenuBar; - menuBar->Append(file_menu, _T("&File")); + menuBar->Append(file_menu, wxT("&File")); frame->SetMenuBar(menuBar); int width, height; diff --git a/demos/life/game.h b/demos/life/game.h index 2b5b548f0e..a95dae2656 100644 --- a/demos/life/game.h +++ b/demos/life/game.h @@ -46,7 +46,7 @@ public: // causes a crash due to conversion objects not being available // during initialisation. #ifndef __WXMAC__ - m_shape.Add( wxString::Format(_T("%i %i"), -width/2, -height/2) ); + m_shape.Add( wxString::Format(wxT("%i %i"), -width/2, -height/2) ); #endif for(int j = 0; j < height; j++) { diff --git a/demos/poem/wxpoem.cpp b/demos/poem/wxpoem.cpp index cde146f2e8..41221b2504 100644 --- a/demos/poem/wxpoem.cpp +++ b/demos/poem/wxpoem.cpp @@ -79,8 +79,8 @@ static int current_page = 0; // Currently viewed page // Backing bitmap wxBitmap *backingBitmap = NULL; -void PoetryError(const wxChar *, const wxChar *caption=_T("wxPoem Error")); -void PoetryNotify(const wxChar *Msg, const wxChar *caption=_T("wxPoem")); +void PoetryError(const wxChar *, const wxChar *caption=wxT("wxPoem Error")); +void PoetryNotify(const wxChar *Msg, const wxChar *caption=wxT("wxPoem")); void TryLoadIndex(); bool LoadPoem(const wxChar *, long); int GetIndex(); @@ -181,7 +181,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y) dc->SetFont(*m_normalFont); wxCoord xx; wxCoord yy; - dc->GetTextExtent(_T("X"), &xx, &yy); + dc->GetTextExtent(wxT("X"), &xx, &yy); char_height = (int)yy; if (current_page == 0) @@ -262,7 +262,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y) line_ptr = line+3; m_title = line_ptr; - m_title << _T(" (cont'd)"); + m_title << wxT(" (cont'd)"); dc->GetTextExtent(line_ptr, &xx, &yy); FindMax(&curr_width, (int)xx); @@ -325,7 +325,7 @@ void MainWindow::ScanBuffer(wxDC *dc, bool DrawIt, int *max_x, int *max_y) // Write (cont'd) if (page_break) { - const wxChar *cont = _T("(cont'd)"); + const wxChar *cont = wxT("(cont'd)"); dc->SetFont(* m_normalFont); @@ -481,7 +481,7 @@ void MainWindow::Search(bool ask) if (ask || m_searchString.empty()) { - wxString s = wxGetTextFromUser( _T("Enter search string"), _T("Search"), m_searchString); + wxString s = wxGetTextFromUser( wxT("Enter search string"), wxT("Search"), m_searchString); if (!s.empty()) { s.MakeLower(); @@ -510,7 +510,7 @@ void MainWindow::Search(bool ask) else { last_poem_start = 0; - PoetryNotify(_T("Search string not found.")); + PoetryNotify(wxT("Search string not found.")); } } } @@ -534,7 +534,7 @@ bool MyApp::OnInit() TheMainWindow = new MainWindow(NULL, wxID_ANY, - _T("wxPoem"), + wxT("wxPoem"), wxPoint(XPos, YPos), wxDefaultSize, wxCAPTION|wxMINIMIZE_BOX|wxSYSTEM_MENU|wxCLOSE_BOX|wxFULL_REPAINT_ON_RESIZE @@ -549,8 +549,8 @@ bool MyApp::OnInit() } else { - index_filename = _T(DEFAULT_POETRY_IND); - data_filename = _T(DEFAULT_POETRY_DAT); + index_filename = wxT(DEFAULT_POETRY_IND); + data_filename = wxT(DEFAULT_POETRY_DAT); } TryLoadIndex(); @@ -593,20 +593,20 @@ MyCanvas::MyCanvas(wxFrame *frame): wxWindow(frame, wxID_ANY) { m_popupMenu = new wxMenu; - m_popupMenu->Append(POEM_NEXT, _T("Next poem/page")); - m_popupMenu->Append(POEM_PREVIOUS, _T("Previous page")); + m_popupMenu->Append(POEM_NEXT, wxT("Next poem/page")); + m_popupMenu->Append(POEM_PREVIOUS, wxT("Previous page")); m_popupMenu->AppendSeparator(); - m_popupMenu->Append(POEM_SEARCH, _T("Search")); - m_popupMenu->Append(POEM_NEXT_MATCH, _T("Next match")); - m_popupMenu->Append(POEM_COPY, _T("Copy to clipboard")); - m_popupMenu->Append(POEM_MINIMIZE, _T("Minimize")); + m_popupMenu->Append(POEM_SEARCH, wxT("Search")); + m_popupMenu->Append(POEM_NEXT_MATCH, wxT("Next match")); + m_popupMenu->Append(POEM_COPY, wxT("Copy to clipboard")); + m_popupMenu->Append(POEM_MINIMIZE, wxT("Minimize")); m_popupMenu->AppendSeparator(); - m_popupMenu->Append(POEM_BIGGER_TEXT, _T("Bigger text")); - m_popupMenu->Append(POEM_SMALLER_TEXT, _T("Smaller text")); + m_popupMenu->Append(POEM_BIGGER_TEXT, wxT("Bigger text")); + m_popupMenu->Append(POEM_SMALLER_TEXT, wxT("Smaller text")); m_popupMenu->AppendSeparator(); - m_popupMenu->Append(POEM_ABOUT, _T("About wxPoem")); + m_popupMenu->Append(POEM_ABOUT, wxT("About wxPoem")); m_popupMenu->AppendSeparator(); - m_popupMenu->Append(POEM_EXIT, _T("Exit")); + m_popupMenu->Append(POEM_EXIT, wxT("Exit")); } MyCanvas::~MyCanvas() @@ -716,17 +716,17 @@ int LoadIndex(const wxChar *file_name) if (file_name == NULL) return 0; - wxSprintf(buf, _T("%s.idx"), file_name); + wxSprintf(buf, wxT("%s.idx"), file_name); - index_file = wxFopen(buf, _T("r")); + index_file = wxFopen(buf, wxT("r")); if (index_file == NULL) return 0; - wxFscanf(index_file, _T("%ld"), &nitems); + wxFscanf(index_file, wxT("%ld"), &nitems); for (int i = 0; i < nitems; i++) { - wxFscanf(index_file, _T("%ld"), &data); + wxFscanf(index_file, wxT("%ld"), &data); poem_index[i] = data; } @@ -741,7 +741,7 @@ int GetIndex() int indexn = (int)(rand() % nitems); if ((indexn < 0) || (indexn > nitems)) - { PoetryError(_T("No such poem!")); + { PoetryError(wxT("No such poem!")); return -1; } else @@ -753,9 +753,9 @@ void MainWindow::ReadPreferences() { /* TODO: convert this code to use wxConfig #if wxUSE_RESOURCES - wxGetResource(_T("wxPoem"), _T("FontSize"), &pointSize); - wxGetResource(_T("wxPoem"), _T("X"), &XPos); - wxGetResource(_T("wxPoem"), _T("Y"), &YPos); + wxGetResource(wxT("wxPoem"), wxT("FontSize"), &pointSize); + wxGetResource(wxT("wxPoem"), wxT("X"), &XPos); + wxGetResource(wxT("wxPoem"), wxT("Y"), &YPos); #endif */ } @@ -767,9 +767,9 @@ void MainWindow::WritePreferences() TheMainWindow->GetPosition(&XPos, &YPos); /* TODO: convert this code to use wxConfig #if wxUSE_RESOURCES - wxWriteResource(_T("wxPoem"), _T("FontSize"), pointSize); - wxWriteResource(_T("wxPoem"), _T("X"), XPos); - wxWriteResource(_T("wxPoem"), _T("Y"), YPos); + wxWriteResource(wxT("wxPoem"), wxT("FontSize"), pointSize); + wxWriteResource(wxT("wxPoem"), wxT("X"), XPos); + wxWriteResource(wxT("wxPoem"), wxT("Y"), YPos); #endif */ #endif @@ -791,17 +791,17 @@ bool LoadPoem(const wxChar *file_name, long position) if (file_name == NULL) { - wxSprintf(error_buf, _T("Error in Poem loading.")); + wxSprintf(error_buf, wxT("Error in Poem loading.")); PoetryError(error_buf); return false; } - wxSprintf(buf, _T("%s.dat"), file_name); - data_file = wxFopen(buf, _T("r")); + wxSprintf(buf, wxT("%s.dat"), file_name); + data_file = wxFopen(buf, wxT("r")); if (data_file == NULL) { - wxSprintf(error_buf, _T("Data file %s not found."), buf); + wxSprintf(error_buf, wxT("Data file %s not found."), buf); PoetryError(error_buf); return false; } @@ -830,7 +830,7 @@ bool LoadPoem(const wxChar *file_name, long position) if (i == BUFFER_SIZE) { - wxSprintf(error_buf, _T("%s"), _T("Poetry buffer exceeded.")); + wxSprintf(error_buf, wxT("%s"), wxT("Poetry buffer exceeded.")); PoetryError(error_buf); return false; } @@ -869,12 +869,12 @@ long MainWindow::DoSearch(void) } if (data_filename) - wxSprintf(buf, _T("%s.dat"), data_filename); + wxSprintf(buf, wxT("%s.dat"), data_filename); - file = wxFopen(buf, _T("r")); + file = wxFopen(buf, wxT("r")); if (! (data_filename && file)) { - wxSprintf(error_buf, _T("Poetry data file %s not found\n"), buf); + wxSprintf(error_buf, wxT("Poetry data file %s not found\n"), buf); PoetryError(error_buf); return false; } @@ -928,7 +928,7 @@ void TryLoadIndex() index_ok = (LoadIndex(index_filename) != 0); if (!index_ok || (nitems == 0)) { - PoetryError(_T("Index file not found; will compile new one"), _T("wxPoem")); + PoetryError(wxT("Index file not found; will compile new one"), wxT("wxPoem")); index_ok = Compile(); } } @@ -955,12 +955,12 @@ bool Compile(void) wxChar buf[100]; if (data_filename) - wxSprintf(buf, _T("%s.dat"), data_filename); + wxSprintf(buf, wxT("%s.dat"), data_filename); - file = wxFopen(buf, _T("r")); + file = wxFopen(buf, wxT("r")); if (! (data_filename && file)) { - wxSprintf(error_buf, _T("Poetry data file %s not found\n"), buf); + wxSprintf(error_buf, wxT("Poetry data file %s not found\n"), buf); PoetryError(error_buf); return false; } @@ -987,22 +987,22 @@ bool Compile(void) fclose(file); if (index_filename) - wxSprintf(buf, _T("%s.idx"), index_filename); + wxSprintf(buf, wxT("%s.idx"), index_filename); - file = wxFopen(buf, _T("w")); + file = wxFopen(buf, wxT("w")); if (! (data_filename && file)) { - wxSprintf(error_buf, _T("Poetry index file %s cannot be created\n"), buf); + wxSprintf(error_buf, wxT("Poetry index file %s cannot be created\n"), buf); PoetryError(error_buf); return false; } - wxFprintf(file, _T("%ld\n\n"), nitems); + wxFprintf(file, wxT("%ld\n\n"), nitems); for (j = 0; j < nitems; j++) - wxFprintf(file, _T("%ld\n"), poem_index[j]); + wxFprintf(file, wxT("%ld\n"), poem_index[j]); fclose(file); - PoetryNotify(_T("Poetry index compiled.")); + PoetryNotify(wxT("Poetry index compiled.")); return true; } @@ -1036,18 +1036,18 @@ void MainWindow::OnPopup(wxCommandEvent& event) { static wxString s; s = poem_buffer; - s.Replace( _T("@P"),wxEmptyString); - s.Replace( _T("@A "),wxEmptyString); - s.Replace( _T("@A"),wxEmptyString); - s.Replace( _T("@T "),wxEmptyString); - s.Replace( _T("@T"),wxEmptyString); + s.Replace( wxT("@P"),wxEmptyString); + s.Replace( wxT("@A "),wxEmptyString); + s.Replace( wxT("@A"),wxEmptyString); + s.Replace( wxT("@T "),wxEmptyString); + s.Replace( wxT("@T"),wxEmptyString); wxTextDataObject *data = new wxTextDataObject( s.c_str() ); if (!wxTheClipboard->SetData( data )) - wxMessageBox(_T("Error while copying to the clipboard.")); + wxMessageBox(wxT("Error while copying to the clipboard.")); } else { - wxMessageBox(_T("Error opening the clipboard.")); + wxMessageBox(wxT("Error opening the clipboard.")); } wxTheClipboard->Close(); break; @@ -1066,8 +1066,8 @@ void MainWindow::OnPopup(wxCommandEvent& event) } break; case POEM_ABOUT: - (void)wxMessageBox(_T("wxPoem Version 1.1\nJulian Smart (c) 1995"), - _T("About wxPoem"), wxOK, TheMainWindow); + (void)wxMessageBox(wxT("wxPoem Version 1.1\nJulian Smart (c) 1995"), + wxT("About wxPoem"), wxOK, TheMainWindow); break; case POEM_EXIT: // Exit diff --git a/distrib/autopackage/sample/minimal.cpp b/distrib/autopackage/sample/minimal.cpp index 4825c0044d..06917571e7 100644 --- a/distrib/autopackage/sample/minimal.cpp +++ b/distrib/autopackage/sample/minimal.cpp @@ -115,7 +115,7 @@ IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { // create the main application window - MyFrame *frame = new MyFrame(_T("Minimal wxWindows App")); + MyFrame *frame = new MyFrame(wxT("Minimal wxWindows App")); // and show it (the frames, unlike simple controls, are not shown when // created initially) @@ -143,14 +143,14 @@ MyFrame::MyFrame(const wxString& title) // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(Minimal_About, wxT("&About...\tF1"), wxT("Show about dialog")); - menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -159,7 +159,7 @@ MyFrame::MyFrame(const wxString& title) #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWindows!")); + SetStatusText(wxT("Welcome to wxWindows!")); #endif // wxUSE_STATUSBAR } @@ -175,8 +175,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the About dialog of the minimal sample.\n") - _T("Welcome to %s"), wxVERSION_STRING); + msg.Printf( wxT("This is the About dialog of the minimal sample.\n") + wxT("Welcome to %s"), wxVERSION_STRING); - wxMessageBox(msg, _T("About Minimal"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, wxT("About Minimal"), wxOK | wxICON_INFORMATION, this); } diff --git a/docs/doxygen/mainpages/const_cpp.h b/docs/doxygen/mainpages/const_cpp.h index b5a9c833f5..96b8baf173 100644 --- a/docs/doxygen/mainpages/const_cpp.h +++ b/docs/doxygen/mainpages/const_cpp.h @@ -288,6 +288,8 @@ for the GUI applications (i.e. those which don't define @c wxUSE_GUI as 0). defined when compiling code which uses wxWidgets as a DLL/shared library} @itemdef{WXBUILDING, defined when building wxWidgets itself, whether as a static or shared library} +@itemdef{wxNO_T, + may be predefined to prevent the library from defining _T() macro} @endDefList */ diff --git a/docs/doxygen/overviews/archive.h b/docs/doxygen/overviews/archive.h index 69aabb55dd..95e1782fc5 100644 --- a/docs/doxygen/overviews/archive.h +++ b/docs/doxygen/overviews/archive.h @@ -50,16 +50,16 @@ archive, then write the entry's data. Another call to PutNextEntry() closes the current entry and begins the next. For example: @code -wxFFileOutputStream out(_T("test.zip")); +wxFFileOutputStream out(wxT("test.zip")); wxZipOutputStream zip(out); wxTextOutputStream txt(zip); wxString sep(wxFileName::GetPathSeparator()); -zip.PutNextEntry(_T("entry1.txt")); -txt << _T("Some text for entry1.txt\n"); +zip.PutNextEntry(wxT("entry1.txt")); +txt << wxT("Some text for entry1.txt\n"); -zip.PutNextEntry(_T("subdir") + sep + _T("entry2.txt")); -txt << _T("Some text for subdir/entry2.txt\n"); +zip.PutNextEntry(wxT("subdir") + sep + wxT("entry2.txt")); +txt << wxT("Some text for subdir/entry2.txt\n"); @endcode The name of each entry can be a full path, which makes it possible to store @@ -80,7 +80,7 @@ When there are no more entries, GetNextEntry() returns @NULL and sets Eof(). @code auto_ptr entry; -wxFFileInputStream in(_T("test.zip")); +wxFFileInputStream in(wxT("test.zip")); wxZipInputStream zip(in); while (entry.reset(zip.GetNextEntry()), entry.get() != NULL) @@ -111,8 +111,8 @@ archive. wxTempFileOutputStream can be helpful to do this. For example to delete all entries matching the pattern "*.txt": @code -auto_ptr in(new wxFFileInputStream(_T("test.zip"))); -wxTempFileOutputStream out(_T("test.zip")); +auto_ptr in(new wxFFileInputStream(wxT("test.zip"))); +wxTempFileOutputStream out(wxT("test.zip")); wxZipInputStream inzip(*in); wxZipOutputStream outzip(out); @@ -125,7 +125,7 @@ outzip.CopyArchiveMetaData(inzip); // call CopyEntry for each entry except those matching the pattern while (entry.reset(inzip.GetNextEntry()), entry.get() != NULL) - if (!entry->GetName().Matches(_T("*.txt"))) + if (!entry->GetName().Matches(wxT("*.txt"))) if (!outzip.CopyEntry(entry.release(), inzip)) break; @@ -167,7 +167,7 @@ auto_ptr entry; wxString name = wxZipEntry::GetInternalName(localname); // open the zip -wxFFileInputStream in(_T("test.zip")); +wxFFileInputStream in(wxT("test.zip")); wxZipInputStream zip(in); // call GetNextEntry() until the required internal name is found @@ -195,7 +195,7 @@ wxZipEntry *entry; ZipCatalog cat; // open the zip -wxFFileInputStream in(_T("test.zip")); +wxFFileInputStream in(wxT("test.zip")); wxZipInputStream zip(in); // load the zip catalog @@ -222,7 +222,7 @@ stream on the same archive: @code // opening another entry without closing the first requires another // input stream for the same file -wxFFileInputStream in2(_T("test.zip")); +wxFFileInputStream in2(wxT("test.zip")); wxZipInputStream zip2(in2); if ((it = cat.find(wxZipEntry::GetInternalName(local2))) != cat.end()) zip2.OpenEntry(*it->second); @@ -311,7 +311,7 @@ if (in->IsOk()) } else { - wxLogError(_T("can't handle '%s'"), filename.c_str()); + wxLogError(wxT("can't handle '%s'"), filename.c_str()); } } @endcode diff --git a/docs/doxygen/overviews/nonenglish.h b/docs/doxygen/overviews/nonenglish.h index c709c6186b..5c49fc4513 100644 --- a/docs/doxygen/overviews/nonenglish.h +++ b/docs/doxygen/overviews/nonenglish.h @@ -123,7 +123,7 @@ English using message catalogs: @li Specify the source code language and charset as arguments to wxLocale::AddCatalog. For example: @code - locale.AddCatalog(_T("myapp"), wxLANGUAGE_GERMAN, _T("iso-8859-1")); + locale.AddCatalog(wxT("myapp"), wxLANGUAGE_GERMAN, wxT("iso-8859-1")); @endcode diff --git a/docs/doxygen/overviews/xrc.h b/docs/doxygen/overviews/xrc.h index 7b91f86468..f37df486a0 100644 --- a/docs/doxygen/overviews/xrc.h +++ b/docs/doxygen/overviews/xrc.h @@ -259,8 +259,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the about dialog of XML resources demo.\n") - _T("Welcome to %s"), wxVERSION_STRING); + msg.Printf( wxT("This is the about dialog of XML resources demo.\n") + wxT("Welcome to %s"), wxVERSION_STRING); wxMessageBox(msg, "About XML resources demo", wxOK | wxICON_INFORMATION, this); diff --git a/include/wx/animdecod.h b/include/wx/animdecod.h index 8e7b2a0a00..1c6cb20d1f 100644 --- a/include/wx/animdecod.h +++ b/include/wx/animdecod.h @@ -109,7 +109,7 @@ public: // restore the old position to be able to test other formats and so on if ( stream.SeekI(posOld) == wxInvalidOffset ) { - wxLogDebug(_T("Failed to rewind the stream in wxAnimationDecoder!")); + wxLogDebug(wxT("Failed to rewind the stream in wxAnimationDecoder!")); // reading would fail anyhow as we're not at the right position return false; diff --git a/include/wx/arrstr.h b/include/wx/arrstr.h index 9e6ec1a392..33a2f05de1 100644 --- a/include/wx/arrstr.h +++ b/include/wx/arrstr.h @@ -176,7 +176,7 @@ public: wxString& Item(size_t nIndex) const { wxASSERT_MSG( nIndex < m_nCount, - _T("wxArrayString: index out of bounds") ); + wxT("wxArrayString: index out of bounds") ); return m_pItems[nIndex]; } @@ -187,7 +187,7 @@ public: wxString& Last() const { wxASSERT_MSG( !IsEmpty(), - _T("wxArrayString: index out of bounds") ); + wxT("wxArrayString: index out of bounds") ); return Item(GetCount() - 1); } diff --git a/include/wx/artprov.h b/include/wx/artprov.h index b32e34b375..76d10d67df 100644 --- a/include/wx/artprov.h +++ b/include/wx/artprov.h @@ -28,10 +28,10 @@ class wxArtProviderModule; typedef wxString wxArtClient; typedef wxString wxArtID; -#define wxART_MAKE_CLIENT_ID_FROM_STR(id) (id + _T("_C")) -#define wxART_MAKE_CLIENT_ID(id) _T(#id) _T("_C") +#define wxART_MAKE_CLIENT_ID_FROM_STR(id) (id + wxT("_C")) +#define wxART_MAKE_CLIENT_ID(id) wxT(#id) wxT("_C") #define wxART_MAKE_ART_ID_FROM_STR(id) (id) -#define wxART_MAKE_ART_ID(id) _T(#id) +#define wxART_MAKE_ART_ID(id) wxT(#id) // ---------------------------------------------------------------------------- // Art clients diff --git a/include/wx/buffer.h b/include/wx/buffer.h index 558874d5df..864bb64eb7 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -142,8 +142,8 @@ public: if ( m_data == GetNullData() ) return NULL; - wxASSERT_MSG( m_data->m_owned, _T("can't release non-owned buffer") ); - wxASSERT_MSG( m_data->m_ref == 1, _T("can't release shared buffer") ); + wxASSERT_MSG( m_data->m_owned, wxT("can't release non-owned buffer") ); + wxASSERT_MSG( m_data->m_ref == 1, wxT("can't release shared buffer") ); CharType * const p = m_data->Get(); @@ -561,7 +561,7 @@ public: // Other ways to append to the buffer void AppendByte(char data) { - wxCHECK_RET( m_bufdata->m_data, _T("invalid wxMemoryBuffer") ); + wxCHECK_RET( m_bufdata->m_data, wxT("invalid wxMemoryBuffer") ); m_bufdata->ResizeIfNeeded(m_bufdata->m_len + 1); *(((char*)m_bufdata->m_data) + m_bufdata->m_len) = data; diff --git a/include/wx/chartype.h b/include/wx/chartype.h index 73606a61e0..a284e4de8c 100644 --- a/include/wx/chartype.h +++ b/include/wx/chartype.h @@ -222,7 +222,7 @@ /* ------------------------------------------------------------------------- */ -/* define _T() and related macros */ +/* define wxT() and related macros */ /* ------------------------------------------------------------------------- */ /* BSD systems define _T() to be something different in ctype.h, override it */ @@ -231,15 +231,19 @@ #undef _T #endif -/* could already be defined by tchar.h (it's quasi standard) */ -#ifndef _T +/* + wxT ("wx text") macro turns a literal string constant into a wide char + constant. It is mostly unnecessary with wx 2.9 but defined for + compatibility. + */ +#ifndef wxT #if !wxUSE_UNICODE - #define _T(x) x + #define wxT(x) x #else /* Unicode */ /* use wxCONCAT_HELPER so that x could be expanded if it's a macro */ - #define _T(x) wxCONCAT_HELPER(L, x) + #define wxT(x) wxCONCAT_HELPER(L, x) #endif /* ASCII/Unicode */ -#endif /* !defined(_T) */ +#endif /* !defined(wxT) */ /* wxS ("wx string") macro can be used to create literals using the same @@ -253,13 +257,25 @@ #define wxS(x) x #endif -/* although global macros with such names are normally bad, we want to have */ -/* another name for _T() which should be used to avoid confusion between */ -/* _T() and _() in wxWidgets sources */ -#define wxT(x) _T(x) +/* + _T() is a synonym for wxT() familiar to Windows programmers. As this macro + has even higher risk of conflicting with system headers, its use is + discouraged and you may predefine wxNO__T to disable it. Additionally, we + do it ourselves for Sun CC which is known to use it in its standard headers + (see #10660). + */ +#if defined(__SUNPRO_C) || defined(__SUNPRO_CC) + #ifndef wxNO__T + #define wxNO__T + #endif +#endif + +#if !defined(_T) && !defined(wxNO__T) + #define _T(x) wxT(x) +#endif /* a helper macro allowing to make another macro Unicode-friendly, see below */ -#define wxAPPLY_T(x) _T(x) +#define wxAPPLY_T(x) wxT(x) /* Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs */ #ifndef __TFILE__ diff --git a/include/wx/cocoa/dirdlg.h b/include/wx/cocoa/dirdlg.h index 29f4e9d471..04f9bc31e3 100644 --- a/include/wx/cocoa/dirdlg.h +++ b/include/wx/cocoa/dirdlg.h @@ -26,7 +26,7 @@ class WXDLLIMPEXP_CORE wxDirDialog: public wxDirDialogBase public: wxDirDialog(wxWindow *parent, const wxString& message = wxDirSelectorPromptStr, - const wxString& defaultPath = _T(""), + const wxString& defaultPath = wxT(""), long style = wxDD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, diff --git a/include/wx/confbase.h b/include/wx/confbase.h index ff50f65f4b..4534dcf9f0 100644 --- a/include/wx/confbase.h +++ b/include/wx/confbase.h @@ -32,13 +32,13 @@ class WXDLLIMPEXP_FWD_BASE wxArrayString; /// separates group and entry names (probably shouldn't be changed) #ifndef wxCONFIG_PATH_SEPARATOR - #define wxCONFIG_PATH_SEPARATOR _T('/') + #define wxCONFIG_PATH_SEPARATOR wxT('/') #endif /// introduces immutable entries // (i.e. the ones which can't be changed from the local config file) #ifndef wxCONFIG_IMMUTABLE_PREFIX - #define wxCONFIG_IMMUTABLE_PREFIX _T('!') + #define wxCONFIG_IMMUTABLE_PREFIX wxT('!') #endif #if wxUSE_CONFIG diff --git a/include/wx/containr.h b/include/wx/containr.h index d4648b841a..594af01367 100644 --- a/include/wx/containr.h +++ b/include/wx/containr.h @@ -49,7 +49,7 @@ public: void SetContainerWindow(wxWindow *winParent) { - wxASSERT_MSG( !m_winParent, _T("shouldn't be called twice") ); + wxASSERT_MSG( !m_winParent, wxT("shouldn't be called twice") ); m_winParent = winParent; } diff --git a/include/wx/cppunit.h b/include/wx/cppunit.h index 7e10e80a68..7d608a63ca 100644 --- a/include/wx/cppunit.h +++ b/include/wx/cppunit.h @@ -81,7 +81,7 @@ if (Condition) \ { anyTest; } \ else \ - wxLogInfo(wxString::Format(_T("skipping: %s.%s\n reason: %s equals false\n"), \ + wxLogInfo(wxString::Format(wxT("skipping: %s.%s\n reason: %s equals false\n"), \ wxString(suiteName, wxConvUTF8).c_str(), \ wxString(#testMethod, wxConvUTF8).c_str(), \ wxString(#Condition, wxConvUTF8).c_str())) diff --git a/include/wx/cshelp.h b/include/wx/cshelp.h index 19f6d4c700..87e0dbd137 100644 --- a/include/wx/cshelp.h +++ b/include/wx/cshelp.h @@ -134,7 +134,7 @@ public: const wxPoint& pt, wxHelpEvent::Origin origin) { - wxCHECK_MSG( window, false, _T("window must not be NULL") ); + wxCHECK_MSG( window, false, wxT("window must not be NULL") ); m_helptextAtPoint = pt; m_helptextOrigin = origin; diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h index 74dcd4b47d..dba63cca7b 100644 --- a/include/wx/ctrlsub.h +++ b/include/wx/ctrlsub.h @@ -122,7 +122,7 @@ private: int AppendItems(const wxArrayStringsAdapter& items, void **clientData) { wxASSERT_MSG( GetClientDataType() != wxClientData_Object, - _T("can't mix different types of client data") ); + wxT("can't mix different types of client data") ); return AppendItems(items, clientData, wxClientData_Void); } @@ -131,7 +131,7 @@ private: wxClientData **clientData) { wxASSERT_MSG( GetClientDataType() != wxClientData_Void, - _T("can't mix different types of client data") ); + wxT("can't mix different types of client data") ); return AppendItems(items, reinterpret_cast(clientData), wxClientData_Object); @@ -142,17 +142,17 @@ private: void **clientData, wxClientDataType type) { - wxASSERT_MSG( !IsSorted(), _T("can't insert items in sorted control") ); + wxASSERT_MSG( !IsSorted(), wxT("can't insert items in sorted control") ); wxCHECK_MSG( pos <= GetCount(), wxNOT_FOUND, - _T("position out of range") ); + wxT("position out of range") ); // not all derived classes handle empty arrays correctly in // DoInsertItems() and besides it really doesn't make much sense to do // this (for append it could correspond to creating an initially empty // control but why would anybody need to insert 0 items?) wxCHECK_MSG( !items.IsEmpty(), wxNOT_FOUND, - _T("need something to insert") ); + wxT("need something to insert") ); return DoInsertItems(items, pos, clientData, type); } @@ -167,7 +167,7 @@ private: void **clientData) { wxASSERT_MSG( GetClientDataType() != wxClientData_Object, - _T("can't mix different types of client data") ); + wxT("can't mix different types of client data") ); return InsertItems(items, pos, clientData, wxClientData_Void); } @@ -177,7 +177,7 @@ private: wxClientData **clientData) { wxASSERT_MSG( GetClientDataType() != wxClientData_Void, - _T("can't mix different types of client data") ); + wxT("can't mix different types of client data") ); return InsertItems(items, pos, reinterpret_cast(clientData), diff --git a/include/wx/datectrl.h b/include/wx/datectrl.h index 81f6c0d62e..822902f062 100644 --- a/include/wx/datectrl.h +++ b/include/wx/datectrl.h @@ -19,7 +19,7 @@ #include "wx/control.h" // the base class #include "wx/datetime.h" -#define wxDatePickerCtrlNameStr _T("datectrl") +#define wxDatePickerCtrlNameStr wxT("datectrl") // wxDatePickerCtrl styles enum diff --git a/include/wx/datetime.h b/include/wx/datetime.h index a431fd8e9f..dae827f700 100644 --- a/include/wx/datetime.h +++ b/include/wx/datetime.h @@ -985,37 +985,37 @@ public: inline bool operator<(const wxDateTime& dt) const { - wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); return GetValue() < dt.GetValue(); } inline bool operator<=(const wxDateTime& dt) const { - wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); return GetValue() <= dt.GetValue(); } inline bool operator>(const wxDateTime& dt) const { - wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); return GetValue() > dt.GetValue(); } inline bool operator>=(const wxDateTime& dt) const { - wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); return GetValue() >= dt.GetValue(); } inline bool operator==(const wxDateTime& dt) const { - wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); return GetValue() == dt.GetValue(); } inline bool operator!=(const wxDateTime& dt) const { - wxASSERT_MSG( IsValid() && dt.IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid() && dt.IsValid(), wxT("invalid wxDateTime") ); return GetValue() != dt.GetValue(); } @@ -1784,7 +1784,7 @@ inline wxDateTime::wxDateTime(double jdn) inline wxDateTime& wxDateTime::Set(const Tm& tm) { - wxASSERT_MSG( tm.IsValid(), _T("invalid broken down date/time") ); + wxASSERT_MSG( tm.IsValid(), wxT("invalid broken down date/time") ); return Set(tm.mday, (Month)tm.mon, tm.year, tm.hour, tm.min, tm.sec, tm.msec); @@ -1815,14 +1815,14 @@ inline wxDateTime::wxDateTime(wxDateTime_t day, inline wxLongLong wxDateTime::GetValue() const { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); return m_time; } inline time_t wxDateTime::GetTicks() const { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); if ( !IsInStdRange() ) { return (time_t)-1; @@ -1890,21 +1890,21 @@ inline wxDateTime wxDateTime::GetYearDay(wxDateTime_t yday) const inline bool wxDateTime::IsEqualTo(const wxDateTime& datetime) const { - wxASSERT_MSG( IsValid() && datetime.IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime")); return m_time == datetime.m_time; } inline bool wxDateTime::IsEarlierThan(const wxDateTime& datetime) const { - wxASSERT_MSG( IsValid() && datetime.IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime")); return m_time < datetime.m_time; } inline bool wxDateTime::IsLaterThan(const wxDateTime& datetime) const { - wxASSERT_MSG( IsValid() && datetime.IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime")); return m_time > datetime.m_time; } @@ -1961,14 +1961,14 @@ inline bool wxDateTime::IsEqualUpTo(const wxDateTime& dt, inline wxDateTime wxDateTime::Add(const wxTimeSpan& diff) const { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); return wxDateTime(m_time + diff.GetValue()); } inline wxDateTime& wxDateTime::Add(const wxTimeSpan& diff) { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); m_time += diff.GetValue(); @@ -1982,14 +1982,14 @@ inline wxDateTime& wxDateTime::operator+=(const wxTimeSpan& diff) inline wxDateTime wxDateTime::Subtract(const wxTimeSpan& diff) const { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); return wxDateTime(m_time - diff.GetValue()); } inline wxDateTime& wxDateTime::Subtract(const wxTimeSpan& diff) { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); m_time -= diff.GetValue(); @@ -2003,7 +2003,7 @@ inline wxDateTime& wxDateTime::operator-=(const wxTimeSpan& diff) inline wxTimeSpan wxDateTime::Subtract(const wxDateTime& datetime) const { - wxASSERT_MSG( IsValid() && datetime.IsValid(), _T("invalid wxDateTime")); + wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime")); return wxTimeSpan(GetValue() - datetime.GetValue()); } diff --git a/include/wx/dcbuffer.h b/include/wx/dcbuffer.h index 383dfcb3ae..521113e0c8 100644 --- a/include/wx/dcbuffer.h +++ b/include/wx/dcbuffer.h @@ -112,7 +112,7 @@ private: // common part of Init()s void InitCommon(wxDC *dc, int style) { - wxASSERT_MSG( !m_dc, _T("wxBufferedDC already initialised") ); + wxASSERT_MSG( !m_dc, wxT("wxBufferedDC already initialised") ); m_dc = dc; m_style = style; diff --git a/include/wx/dcmirror.h b/include/wx/dcmirror.h index d64f5004bc..6ed45a1ab3 100644 --- a/include/wx/dcmirror.h +++ b/include/wx/dcmirror.h @@ -127,7 +127,7 @@ protected: wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc) { - wxFAIL_MSG( _T("this is probably wrong") ); + wxFAIL_MSG( wxT("this is probably wrong") ); m_dc.DoDrawArc(GetX(x1, y1), GetY(x1, y1), GetX(x2, y2), GetY(x2, y2), @@ -144,7 +144,7 @@ protected: virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea) { - wxFAIL_MSG( _T("this is probably wrong") ); + wxFAIL_MSG( wxT("this is probably wrong") ); m_dc.DoDrawEllipticArc(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h), @@ -249,7 +249,7 @@ protected: virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region)) { - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); } virtual void DoSetClippingRegion(wxCoord x, wxCoord y, diff --git a/include/wx/debugrpt.h b/include/wx/debugrpt.h index 86ecdb5ab3..02c895c4e6 100644 --- a/include/wx/debugrpt.h +++ b/include/wx/debugrpt.h @@ -161,7 +161,7 @@ public: wxDebugReportUpload(const wxString& url, const wxString& input, const wxString& action, - const wxString& curl = _T("curl")); + const wxString& curl = wxT("curl")); protected: virtual bool DoProcess(); diff --git a/include/wx/defs.h b/include/wx/defs.h index 639508a86c..bcdfde6f44 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -978,28 +978,28 @@ typedef wxUint32 wxDword; #if (defined(__VISUALC__) && defined(__WIN32__)) #define wxLongLong_t __int64 #define wxLongLongSuffix i64 - #define wxLongLongFmtSpec _T("I64") + #define wxLongLongFmtSpec wxT("I64") #elif defined(__BORLANDC__) && defined(__WIN32__) && (__BORLANDC__ >= 0x520) #define wxLongLong_t __int64 #define wxLongLongSuffix i64 - #define wxLongLongFmtSpec _T("L") + #define wxLongLongFmtSpec wxT("L") #elif (defined(__WATCOMC__) && (defined(__WIN32__) || defined(__DOS__) || defined(__OS2__))) #define wxLongLong_t __int64 #define wxLongLongSuffix i64 - #define wxLongLongFmtSpec _T("L") + #define wxLongLongFmtSpec wxT("L") #elif defined(__DIGITALMARS__) #define wxLongLong_t __int64 #define wxLongLongSuffix LL - #define wxLongLongFmtSpec _T("ll") + #define wxLongLongFmtSpec wxT("ll") #elif defined(__MINGW32__) #define wxLongLong_t long long #define wxLongLongSuffix ll - #define wxLongLongFmtSpec _T("I64") + #define wxLongLongFmtSpec wxT("I64") #elif defined(__MWERKS__) #if __option(longlong) #define wxLongLong_t long long #define wxLongLongSuffix ll - #define wxLongLongFmtSpec _T("ll") + #define wxLongLongFmtSpec wxT("ll") #else #error "The 64 bit integer support in CodeWarrior has been disabled." #error "See the documentation on the 'longlong' pragma." @@ -1011,7 +1011,7 @@ typedef wxUint32 wxDword; #define wxLongLong_t long long #endif /* __WXPALMOS6__ */ #define wxLongLongSuffix ll - #define wxLongLongFmtSpec _T("ll") + #define wxLongLongFmtSpec wxT("ll") #elif defined(__VISAGECPP__) && __IBMCPP__ >= 400 #define wxLongLong_t long long #elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \ @@ -1021,11 +1021,11 @@ typedef wxUint32 wxDword; (defined(__DJGPP__) && __DJGPP__ >= 2) #define wxLongLong_t long long #define wxLongLongSuffix ll - #define wxLongLongFmtSpec _T("ll") + #define wxLongLongFmtSpec wxT("ll") #elif defined(SIZEOF_LONG) && (SIZEOF_LONG == 8) #define wxLongLong_t long #define wxLongLongSuffix l - #define wxLongLongFmtSpec _T("l") + #define wxLongLongFmtSpec wxT("l") #define wxLongLongIsLong #endif diff --git a/include/wx/dynlib.h b/include/wx/dynlib.h index 3ac5dfa24c..213df6a8fd 100644 --- a/include/wx/dynlib.h +++ b/include/wx/dynlib.h @@ -116,7 +116,7 @@ enum wxPluginCategory // type only once, as the first parameter, and creating a variable of this type // called "pfn" initialized with the "name" from the "dynlib" #define wxDYNLIB_FUNCTION(type, name, dynlib) \ - type pfn ## name = (type)(dynlib).GetSymbol(_T(#name)) + type pfn ## name = (type)(dynlib).GetSymbol(wxT(#name)) // a more convenient function replacing wxDYNLIB_FUNCTION above diff --git a/include/wx/dynload.h b/include/wx/dynload.h index 8b079d4630..8f440b78be 100644 --- a/include/wx/dynload.h +++ b/include/wx/dynload.h @@ -71,7 +71,7 @@ public: void RefObj() { ++m_objcount; } void UnrefObj() { - wxASSERT_MSG( m_objcount > 0, _T("Too many objects deleted??") ); + wxASSERT_MSG( m_objcount > 0, wxT("Too many objects deleted??") ); --m_objcount; } diff --git a/include/wx/event.h b/include/wx/event.h index de71cd631d..0a757f6a2f 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -1069,7 +1069,7 @@ public: wxPropagateOnce(wxEvent& event) : m_event(event) { wxASSERT_MSG( m_event.m_propagationLevel > 0, - _T("shouldn't be used unless ShouldPropagate()!") ); + wxT("shouldn't be used unless ShouldPropagate()!") ); m_event.m_propagationLevel--; } @@ -1917,7 +1917,7 @@ public: // m_loggingOff flag is only used by wxEVT_[QUERY_]END_SESSION, it // doesn't make sense for wxEVT_CLOSE_WINDOW wxASSERT_MSG( m_eventType != wxEVT_CLOSE_WINDOW, - _T("this flag is for end session events only") ); + wxT("this flag is for end session events only") ); return m_loggingOff; } diff --git a/include/wx/ffile.h b/include/wx/ffile.h index fff114e2a4..861f496547 100644 --- a/include/wx/ffile.h +++ b/include/wx/ffile.h @@ -37,13 +37,13 @@ public: // def ctor wxFFile() { m_fp = NULL; } // open specified file (may fail, use IsOpened()) - wxFFile(const wxString& filename, const wxString& mode = _T("r")); + wxFFile(const wxString& filename, const wxString& mode = wxT("r")); // attach to (already opened) file wxFFile(FILE *lfp) { m_fp = lfp; } // open/close // open a file (existing or not - the mode controls what happens) - bool Open(const wxString& filename, const wxString& mode = _T("r")); + bool Open(const wxString& filename, const wxString& mode = wxT("r")); // closes the opened file (this is a NOP if not opened) bool Close(); diff --git a/include/wx/filefn.h b/include/wx/filefn.h index 5ccb74e730..1c6246b13e 100644 --- a/include/wx/filefn.h +++ b/include/wx/filefn.h @@ -421,7 +421,7 @@ enum wxFileKind #define wxHAS_LARGE_FFILES #endif #else - #define wxFileOffsetFmtSpec _T("") + #define wxFileOffsetFmtSpec wxT("") #endif #define wxClose close #define wxRead ::read @@ -459,7 +459,7 @@ enum wxFileKind #define wxHAS_LARGE_FFILES #endif #else - #define wxFileOffsetFmtSpec _T("") + #define wxFileOffsetFmtSpec wxT("") #endif // functions #define wxClose close diff --git a/include/wx/filename.h b/include/wx/filename.h index 2c04ebb8a4..3da10d0384 100644 --- a/include/wx/filename.h +++ b/include/wx/filename.h @@ -535,10 +535,10 @@ public: static wxULongLong GetSize(const wxString &file); // returns the size in a human readable form - wxString GetHumanReadableSize(const wxString &nullsize = wxGetTranslation(_T("Not available")), + wxString GetHumanReadableSize(const wxString &nullsize = wxGetTranslation(wxT("Not available")), int precision = 1) const; static wxString GetHumanReadableSize(const wxULongLong &sz, - const wxString &nullsize = wxGetTranslation(_T("Not available")), + const wxString &nullsize = wxGetTranslation(wxT("Not available")), int precision = 1); #endif // wxUSE_LONGLONG diff --git a/include/wx/generic/calctrlg.h b/include/wx/generic/calctrlg.h index 0e97ee0854..8d115cac8f 100644 --- a/include/wx/generic/calctrlg.h +++ b/include/wx/generic/calctrlg.h @@ -125,14 +125,14 @@ public: virtual wxCalendarDateAttr *GetAttr(size_t day) const { - wxCHECK_MSG( day > 0 && day < 32, NULL, _T("invalid day") ); + wxCHECK_MSG( day > 0 && day < 32, NULL, wxT("invalid day") ); return m_attrs[day - 1]; } virtual void SetAttr(size_t day, wxCalendarDateAttr *attr) { - wxCHECK_RET( day > 0 && day < 32, _T("invalid day") ); + wxCHECK_RET( day > 0 && day < 32, wxT("invalid day") ); delete m_attrs[day - 1]; m_attrs[day - 1] = attr; diff --git a/include/wx/generic/combo.h b/include/wx/generic/combo.h index 913511fcbf..703e42fa3a 100644 --- a/include/wx/generic/combo.h +++ b/include/wx/generic/combo.h @@ -26,8 +26,8 @@ // all actions of single line text controls are supported // popup/dismiss the choice window -#define wxACTION_COMBOBOX_POPUP _T("popup") -#define wxACTION_COMBOBOX_DISMISS _T("dismiss") +#define wxACTION_COMBOBOX_POPUP wxT("popup") +#define wxACTION_COMBOBOX_DISMISS wxT("dismiss") #endif diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h index 8f66617f86..4b8ae36f03 100644 --- a/include/wx/generic/grid.h +++ b/include/wx/generic/grid.h @@ -44,11 +44,11 @@ extern WXDLLIMPEXP_DATA_ADV(const char) wxGridNameStr[]; #define WXGRID_DEFAULT_SCROLLBAR_WIDTH 16 // type names for grid table values -#define wxGRID_VALUE_STRING _T("string") -#define wxGRID_VALUE_BOOL _T("bool") -#define wxGRID_VALUE_NUMBER _T("long") -#define wxGRID_VALUE_FLOAT _T("double") -#define wxGRID_VALUE_CHOICE _T("choice") +#define wxGRID_VALUE_STRING wxT("string") +#define wxGRID_VALUE_BOOL wxT("bool") +#define wxGRID_VALUE_NUMBER wxT("long") +#define wxGRID_VALUE_FLOAT wxT("double") +#define wxGRID_VALUE_CHOICE wxT("choice") #define wxGRID_VALUE_TEXT wxGRID_VALUE_STRING #define wxGRID_VALUE_LONG wxGRID_VALUE_NUMBER @@ -2144,7 +2144,7 @@ public: // more than once void Create(wxGrid *grid) { - wxASSERT_MSG( !m_grid, _T("shouldn't be called more than once") ); + wxASSERT_MSG( !m_grid, wxT("shouldn't be called more than once") ); Init(grid); } diff --git a/include/wx/generic/gridctrl.h b/include/wx/generic/gridctrl.h index 987d2e9aed..d546205537 100644 --- a/include/wx/generic/gridctrl.h +++ b/include/wx/generic/gridctrl.h @@ -16,8 +16,8 @@ #if wxUSE_GRID -#define wxGRID_VALUE_CHOICEINT _T("choiceint") -#define wxGRID_VALUE_DATETIME _T("datetime") +#define wxGRID_VALUE_CHOICEINT wxT("choiceint") +#define wxGRID_VALUE_DATETIME wxT("datetime") // the default renderer for the cells containing string data diff --git a/include/wx/generic/grideditors.h b/include/wx/generic/grideditors.h index cc3ff67757..a81b17c9d9 100644 --- a/include/wx/generic/grideditors.h +++ b/include/wx/generic/grideditors.h @@ -143,7 +143,7 @@ protected: // string representation of our value wxString GetString() const - { return wxString::Format(_T("%ld"), m_value); } + { return wxString::Format(wxT("%ld"), m_value); } private: int m_min, @@ -227,7 +227,7 @@ public: // set the string values returned by GetValue() for the true and false // states, respectively - static void UseStringValues(const wxString& valueTrue = _T("1"), + static void UseStringValues(const wxString& valueTrue = wxT("1"), const wxString& valueFalse = wxEmptyString); // return true if the given string is equal to the string representation of diff --git a/include/wx/generic/private/listctrl.h b/include/wx/generic/private/listctrl.h index 35125d78d1..0123cacc1d 100644 --- a/include/wx/generic/private/listctrl.h +++ b/include/wx/generic/private/listctrl.h @@ -69,7 +69,7 @@ public: { wxString s = GetText(); if ( s.empty() ) - s = _T('H'); + s = wxT('H'); return s; } @@ -188,7 +188,7 @@ public: void ExtendWidth(wxCoord w) { wxASSERT_MSG( m_rectAll.width <= w, - _T("width can only be increased") ); + wxT("width can only be increased") ); m_rectAll.width = w; m_rectLabel.x = m_rectAll.x + (w - m_rectLabel.width) / 2; @@ -254,7 +254,7 @@ public: bool IsHighlighted() const { - wxASSERT_MSG( !IsVirtual(), _T("unexpected call to IsHighlighted") ); + wxASSERT_MSG( !IsVirtual(), wxT("unexpected call to IsHighlighted") ); return m_highlighted; } @@ -420,7 +420,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, - const wxString &name = _T("listctrlmainwindow") ); + const wxString &name = wxT("listctrlmainwindow") ); virtual ~wxListMainWindow(); @@ -719,7 +719,7 @@ protected: // get the line data for the given index wxListLineData *GetLine(size_t n) const { - wxASSERT_MSG( n != (size_t)-1, _T("invalid line index") ); + wxASSERT_MSG( n != (size_t)-1, wxT("invalid line index") ); if ( IsVirtual() ) { diff --git a/include/wx/generic/spinctlg.h b/include/wx/generic/spinctlg.h index 1fe9c2b984..83e529d2f5 100644 --- a/include/wx/generic/spinctlg.h +++ b/include/wx/generic/spinctlg.h @@ -53,7 +53,7 @@ public: long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, double min = 0, double max = 100, double initial = 0, double inc = 1, - const wxString& name = _T("wxSpinCtrl")); + const wxString& name = wxT("wxSpinCtrl")); virtual ~wxSpinCtrlGenericBase(); @@ -161,7 +161,7 @@ public: long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, double min = 0, double max = 100, double initial = 0, double inc = 1, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { m_min = min; m_max = max; @@ -245,7 +245,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { Create(parent, id, value, pos, size, style, min, max, initial, name); } @@ -257,7 +257,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size, style, min, max, initial, 1, name); @@ -302,7 +302,7 @@ public: long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, double min = 0, double max = 100, double initial = 0, double inc = 1, - const wxString& name = _T("wxSpinCtrlDouble")) + const wxString& name = wxT("wxSpinCtrlDouble")) { m_digits = 0; Create(parent, id, value, pos, size, style, @@ -317,7 +317,7 @@ public: long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, double min = 0, double max = 100, double initial = 0, double inc = 1, - const wxString& name = _T("wxSpinCtrlDouble")) + const wxString& name = wxT("wxSpinCtrlDouble")) { return wxSpinCtrlGenericBase::Create(parent, id, value, pos, size, style, min, max, initial, diff --git a/include/wx/generic/splitter.h b/include/wx/generic/splitter.h index 0cf27db3bf..d009107cd0 100644 --- a/include/wx/generic/splitter.h +++ b/include/wx/generic/splitter.h @@ -91,7 +91,7 @@ public: void SetSplitMode(int mode) { wxASSERT_MSG( mode == wxSPLIT_VERTICAL || mode == wxSPLIT_HORIZONTAL, - _T("invalid split mode") ); + wxT("invalid split mode") ); m_splitMode = (wxSplitMode)mode; } diff --git a/include/wx/glcanvas.h b/include/wx/glcanvas.h index 8b82b78c3a..6ead07f031 100644 --- a/include/wx/glcanvas.h +++ b/include/wx/glcanvas.h @@ -52,7 +52,7 @@ enum WX_GL_SAMPLES // 4 for 2x2 antialising supersampling on most graphics cards }; -#define wxGLCanvasName _T("GLCanvas") +#define wxGLCanvasName wxT("GLCanvas") // ---------------------------------------------------------------------------- // wxGLContextBase: OpenGL rendering context diff --git a/include/wx/gtk/checklst.h b/include/wx/gtk/checklst.h index cc8accdc95..c3aa5e6d83 100644 --- a/include/wx/gtk/checklst.h +++ b/include/wx/gtk/checklst.h @@ -18,10 +18,10 @@ // there is no "right" choice of the checkbox indicators, so allow the user to // define them himself if he wants #ifndef wxCHECKLBOX_CHECKED - #define wxCHECKLBOX_CHECKED _T('x') - #define wxCHECKLBOX_UNCHECKED _T(' ') + #define wxCHECKLBOX_CHECKED wxT('x') + #define wxCHECKLBOX_UNCHECKED wxT(' ') - #define wxCHECKLBOX_STRING _T("[ ] ") + #define wxCHECKLBOX_STRING wxT("[ ] ") #endif //----------------------------------------------------------------------------- diff --git a/include/wx/gtk/spinctrl.h b/include/wx/gtk/spinctrl.h index cab8c7db88..2954b27e9b 100644 --- a/include/wx/gtk/spinctrl.h +++ b/include/wx/gtk/spinctrl.h @@ -33,7 +33,7 @@ public: long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, double min = 0, double max = 100, double initial = 0, double inc = 1, - const wxString& name = _T("wxSpinCtrlGTKBase")); + const wxString& name = wxT("wxSpinCtrlGTKBase")); // wxSpinCtrl(Double) methods call DoXXX functions of the same name @@ -104,7 +104,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { Create(parent, id, value, pos, size, style, min, max, initial, name); } @@ -116,7 +116,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { return wxSpinCtrlGTKBase::Create(parent, id, value, pos, size, style, min, max, initial, 1, name); @@ -154,7 +154,7 @@ public: long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, double min = 0, double max = 100, double initial = 0, double inc = 1, - const wxString& name = _T("wxSpinCtrlDouble")) + const wxString& name = wxT("wxSpinCtrlDouble")) { Create(parent, id, value, pos, size, style, min, max, initial, inc, name); @@ -168,7 +168,7 @@ public: long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, double min = 0, double max = 100, double initial = 0, double inc = 1, - const wxString& name = _T("wxSpinCtrlDouble")) + const wxString& name = wxT("wxSpinCtrlDouble")) { return wxSpinCtrlGTKBase::Create(parent, id, value, pos, size, style, min, max, initial, inc, name); diff --git a/include/wx/gtk1/checklst.h b/include/wx/gtk1/checklst.h index ba0368baae..e96e56a746 100644 --- a/include/wx/gtk1/checklst.h +++ b/include/wx/gtk1/checklst.h @@ -18,10 +18,10 @@ // there is no "right" choice of the checkbox indicators, so allow the user to // define them himself if he wants #ifndef wxCHECKLBOX_CHECKED - #define wxCHECKLBOX_CHECKED _T('x') - #define wxCHECKLBOX_UNCHECKED _T(' ') + #define wxCHECKLBOX_CHECKED wxT('x') + #define wxCHECKLBOX_UNCHECKED wxT(' ') - #define wxCHECKLBOX_STRING _T("[ ] ") + #define wxCHECKLBOX_STRING wxT("[ ] ") #endif //----------------------------------------------------------------------------- diff --git a/include/wx/gtk1/spinctrl.h b/include/wx/gtk1/spinctrl.h index 3237b1eeee..e748a60ac9 100644 --- a/include/wx/gtk1/spinctrl.h +++ b/include/wx/gtk1/spinctrl.h @@ -32,7 +32,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { Create(parent, id, value, pos, size, style, min, max, initial, name); } @@ -44,7 +44,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")); + const wxString& name = wxT("wxSpinCtrl")); void SetValue(const wxString& text); void SetSelection(long from, long to); diff --git a/include/wx/imagbmp.h b/include/wx/imagbmp.h index b83c1df700..e14142c5eb 100644 --- a/include/wx/imagbmp.h +++ b/include/wx/imagbmp.h @@ -14,7 +14,7 @@ // defines for saving the BMP file in different formats, Bits Per Pixel // USE: wximage.SetOption( wxIMAGE_OPTION_BMP_FORMAT, wxBMP_xBPP ); -#define wxIMAGE_OPTION_BMP_FORMAT wxString(_T("wxBMP_FORMAT")) +#define wxIMAGE_OPTION_BMP_FORMAT wxString(wxT("wxBMP_FORMAT")) // These two options are filled in upon reading CUR file and can (should) be // specified when saving a CUR file - they define the hotspot of the cursor: @@ -45,10 +45,10 @@ class WXDLLIMPEXP_CORE wxBMPHandler : public wxImageHandler public: wxBMPHandler() { - m_name = _T("Windows bitmap file"); - m_extension = _T("bmp"); + m_name = wxT("Windows bitmap file"); + m_extension = wxT("bmp"); m_type = wxBITMAP_TYPE_BMP; - m_mime = _T("image/x-bmp"); + m_mime = wxT("image/x-bmp"); } #if wxUSE_STREAMS @@ -79,10 +79,10 @@ class WXDLLIMPEXP_CORE wxICOHandler : public wxBMPHandler public: wxICOHandler() { - m_name = _T("Windows icon file"); - m_extension = _T("ico"); + m_name = wxT("Windows icon file"); + m_extension = wxT("ico"); m_type = wxBITMAP_TYPE_ICO; - m_mime = _T("image/x-ico"); + m_mime = wxT("image/x-ico"); } #if wxUSE_STREAMS @@ -109,10 +109,10 @@ class WXDLLIMPEXP_CORE wxCURHandler : public wxICOHandler public: wxCURHandler() { - m_name = _T("Windows cursor file"); - m_extension = _T("cur"); + m_name = wxT("Windows cursor file"); + m_extension = wxT("cur"); m_type = wxBITMAP_TYPE_CUR; - m_mime = _T("image/x-cur"); + m_mime = wxT("image/x-cur"); } // VS: This handler's meat is implemented inside wxICOHandler (the two @@ -136,10 +136,10 @@ class WXDLLIMPEXP_CORE wxANIHandler : public wxCURHandler public: wxANIHandler() { - m_name = _T("Windows animated cursor file"); - m_extension = _T("ani"); + m_name = wxT("Windows animated cursor file"); + m_extension = wxT("ani"); m_type = wxBITMAP_TYPE_ANI; - m_mime = _T("image/x-ani"); + m_mime = wxT("image/x-ani"); } diff --git a/include/wx/image.h b/include/wx/image.h index 20fb50f5f6..bc0a60e61d 100644 --- a/include/wx/image.h +++ b/include/wx/image.h @@ -28,17 +28,17 @@ // which breaks the compilation below #undef index -#define wxIMAGE_OPTION_QUALITY wxString(_T("quality")) -#define wxIMAGE_OPTION_FILENAME wxString(_T("FileName")) +#define wxIMAGE_OPTION_QUALITY wxString(wxT("quality")) +#define wxIMAGE_OPTION_FILENAME wxString(wxT("FileName")) -#define wxIMAGE_OPTION_RESOLUTION wxString(_T("Resolution")) -#define wxIMAGE_OPTION_RESOLUTIONX wxString(_T("ResolutionX")) -#define wxIMAGE_OPTION_RESOLUTIONY wxString(_T("ResolutionY")) +#define wxIMAGE_OPTION_RESOLUTION wxString(wxT("Resolution")) +#define wxIMAGE_OPTION_RESOLUTIONX wxString(wxT("ResolutionX")) +#define wxIMAGE_OPTION_RESOLUTIONY wxString(wxT("ResolutionY")) -#define wxIMAGE_OPTION_RESOLUTIONUNIT wxString(_T("ResolutionUnit")) +#define wxIMAGE_OPTION_RESOLUTIONUNIT wxString(wxT("ResolutionUnit")) -#define wxIMAGE_OPTION_MAX_WIDTH wxString(_T("MaxWidth")) -#define wxIMAGE_OPTION_MAX_HEIGHT wxString(_T("MaxHeight")) +#define wxIMAGE_OPTION_MAX_WIDTH wxString(wxT("MaxWidth")) +#define wxIMAGE_OPTION_MAX_HEIGHT wxString(wxT("MaxHeight")) // constants used with wxIMAGE_OPTION_RESOLUTIONUNIT // diff --git a/include/wx/imagtiff.h b/include/wx/imagtiff.h index 4beb66c6ce..734bef514c 100644 --- a/include/wx/imagtiff.h +++ b/include/wx/imagtiff.h @@ -21,10 +21,10 @@ #include "wx/image.h" // defines for wxImage::SetOption -#define wxIMAGE_OPTION_BITSPERSAMPLE wxString(_T("BitsPerSample")) -#define wxIMAGE_OPTION_SAMPLESPERPIXEL wxString(_T("SamplesPerPixel")) -#define wxIMAGE_OPTION_COMPRESSION wxString(_T("Compression")) -#define wxIMAGE_OPTION_IMAGEDESCRIPTOR wxString(_T("ImageDescriptor")) +#define wxIMAGE_OPTION_BITSPERSAMPLE wxString(wxT("BitsPerSample")) +#define wxIMAGE_OPTION_SAMPLESPERPIXEL wxString(wxT("SamplesPerPixel")) +#define wxIMAGE_OPTION_COMPRESSION wxString(wxT("Compression")) +#define wxIMAGE_OPTION_IMAGEDESCRIPTOR wxString(wxT("ImageDescriptor")) class WXDLLIMPEXP_CORE wxTIFFHandler: public wxImageHandler { diff --git a/include/wx/list.h b/include/wx/list.h index b8cc07ea84..88913253ec 100644 --- a/include/wx/list.h +++ b/include/wx/list.h @@ -186,7 +186,7 @@ inline const void *wxListCastElementToVoidPtr(const wxString& str) bool operator==(const compatibility_iterator& i) const \ { \ wxASSERT_MSG( m_list && i.m_list, \ - _T("comparing invalid iterators is illegal") ); \ + wxT("comparing invalid iterators is illegal") ); \ return (m_list == i.m_list) && (m_iter == i.m_iter); \ } \ bool operator!=(const compatibility_iterator& i) const \ diff --git a/include/wx/longlong.h b/include/wx/longlong.h index e05287c965..71cb62bd4a 100644 --- a/include/wx/longlong.h +++ b/include/wx/longlong.h @@ -177,7 +177,7 @@ public: long ToLong() const { wxASSERT_MSG( (m_ll >= LONG_MIN) && (m_ll <= LONG_MAX), - _T("wxLongLong to long conversion loss of precision") ); + wxT("wxLongLong to long conversion loss of precision") ); return wx_truncate_cast(long, m_ll); } @@ -405,7 +405,7 @@ public: unsigned long ToULong() const { wxASSERT_MSG( m_ll <= LONG_MAX, - _T("wxULongLong to long conversion loss of precision") ); + wxT("wxULongLong to long conversion loss of precision") ); return wx_truncate_cast(unsigned long, m_ll); } @@ -683,7 +683,7 @@ public: long ToLong() const { wxASSERT_MSG( (m_hi == 0l) || (m_hi == -1l), - _T("wxLongLong to long conversion loss of precision") ); + wxT("wxLongLong to long conversion loss of precision") ); return (long)m_lo; } @@ -908,7 +908,7 @@ public: unsigned long ToULong() const { wxASSERT_MSG( m_hi == 0ul, - _T("wxULongLong to long conversion loss of precision") ); + wxT("wxULongLong to long conversion loss of precision") ); return (unsigned long)m_lo; } diff --git a/include/wx/math.h b/include/wx/math.h index 19518085f1..a17bb9d092 100644 --- a/include/wx/math.h +++ b/include/wx/math.h @@ -115,7 +115,7 @@ inline int wxRound(double x) { wxASSERT_MSG( x > INT_MIN - 0.5 && x < INT_MAX + 0.5, - _T("argument out of supported range") ); + wxT("argument out of supported range") ); #if defined(HAVE_ROUND) return int(round(x)); diff --git a/include/wx/mimetype.h b/include/wx/mimetype.h index b91059aaa0..d7b49260da 100644 --- a/include/wx/mimetype.h +++ b/include/wx/mimetype.h @@ -53,12 +53,12 @@ class WXDLLIMPEXP_BASE wxMimeType : public wxString public: // all string ctors here - wxString GetType() const { return BeforeFirst(_T('/')); } - wxString GetSubType() const { return AfterFirst(_T('/')); } + wxString GetType() const { return BeforeFirst(wxT('/')); } + wxString GetSubType() const { return AfterFirst(wxT('/')); } void SetSubType(const wxString& subtype) { - *this = GetType() + _T('/') + subtype; + *this = GetType() + wxT('/') + subtype; } bool Matches(const wxMimeType& wildcard) diff --git a/include/wx/module.h b/include/wx/module.h index c620974f52..652edead22 100644 --- a/include/wx/module.h +++ b/include/wx/module.h @@ -69,7 +69,7 @@ protected: // after that void AddDependency(wxClassInfo *dep) { - wxCHECK_RET( dep, _T("NULL module dependency") ); + wxCHECK_RET( dep, wxT("NULL module dependency") ); m_dependencies.Add(dep); } diff --git a/include/wx/msw/app.h b/include/wx/msw/app.h index a83d52ead8..fe6cd614b3 100644 --- a/include/wx/msw/app.h +++ b/include/wx/msw/app.h @@ -52,7 +52,7 @@ public: // this suffix should be appended to all our Win32 class names to obtain a // variant registered without CS_[HV]REDRAW styles - static const wxChar *GetNoRedrawClassSuffix() { return _T("NR"); } + static const wxChar *GetNoRedrawClassSuffix() { return wxT("NR"); } // get the name of the registered Win32 class with the given (unique) base // name: this function constructs the unique class name using this name as diff --git a/include/wx/msw/dc.h b/include/wx/msw/dc.h index 0622448279..dffa117b6a 100644 --- a/include/wx/msw/dc.h +++ b/include/wx/msw/dc.h @@ -338,7 +338,7 @@ public: virtual void DoGetSize(int *w, int *h) const { wxASSERT_MSG( m_size.IsFullySpecified(), - _T("size of this DC hadn't been set and is unknown") ); + wxT("size of this DC hadn't been set and is unknown") ); if ( w ) *w = m_size.x; diff --git a/include/wx/msw/gdiimage.h b/include/wx/msw/gdiimage.h index d39a52b79e..5d29779996 100644 --- a/include/wx/msw/gdiimage.h +++ b/include/wx/msw/gdiimage.h @@ -145,7 +145,7 @@ protected: virtual wxGDIRefData * CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const { - wxFAIL_MSG( _T("must be implemented if used") ); + wxFAIL_MSG( wxT("must be implemented if used") ); return NULL; } diff --git a/include/wx/msw/ole/dataobj.h b/include/wx/msw/ole/dataobj.h index dc7a89c2f2..5115c22425 100644 --- a/include/wx/msw/ole/dataobj.h +++ b/include/wx/msw/ole/dataobj.h @@ -59,7 +59,7 @@ public: #define wxGetFormatName(format) wxDataObject::GetFormatName(format) #else // !Debug - #define wxGetFormatName(format) _T("") + #define wxGetFormatName(format) wxT("") #endif // Debug/!Debug // they need to be accessed from wxIDataObject, so made them public, // or wxIDataObject friend diff --git a/include/wx/msw/ole/dropsrc.h b/include/wx/msw/ole/dropsrc.h index deb5a2e8f1..7ef2818a0a 100644 --- a/include/wx/msw/ole/dropsrc.h +++ b/include/wx/msw/ole/dropsrc.h @@ -30,7 +30,7 @@ class WXDLLIMPEXP_FWD_CORE wxWindow; // the cursor 'name' from the resources under MSW, but will expand to // something else under GTK. If you don't use it, you will have to use #ifdef // in the application code. -#define wxDROP_ICON(name) wxCursor(_T(#name)) +#define wxDROP_ICON(name) wxCursor(wxT(#name)) // ---------------------------------------------------------------------------- // wxDropSource is used to start the drag-&-drop operation on associated diff --git a/include/wx/msw/ole/oleutils.h b/include/wx/msw/ole/oleutils.h index 7766d6b9c5..a9891f8fca 100644 --- a/include/wx/msw/ole/oleutils.h +++ b/include/wx/msw/ole/oleutils.h @@ -143,7 +143,7 @@ private: #define IMPLEMENT_IUNKNOWN_METHODS(classname) \ STDMETHODIMP classname::QueryInterface(REFIID riid, void **ppv) \ { \ - wxLogQueryInterface(_T(#classname), riid); \ + wxLogQueryInterface(wxT(#classname), riid); \ \ if ( IsIidFromList(riid, ms_aIids, WXSIZEOF(ms_aIids)) ) { \ *ppv = this; \ @@ -160,14 +160,14 @@ private: \ STDMETHODIMP_(ULONG) classname::AddRef() \ { \ - wxLogAddRef(_T(#classname), m_cRef); \ + wxLogAddRef(wxT(#classname), m_cRef); \ \ return ++m_cRef; \ } \ \ STDMETHODIMP_(ULONG) classname::Release() \ { \ - wxLogRelease(_T(#classname), m_cRef); \ + wxLogRelease(wxT(#classname), m_cRef); \ \ if ( --m_cRef == wxAutoULong(0) ) { \ delete this; \ diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index b3efe36030..9e40732a37 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -369,7 +369,7 @@ inline RECT wxGetWindowRect(HWND hwnd) if ( !::GetWindowRect(hwnd, &rect) ) { - wxLogLastError(_T("GetWindowRect")); + wxLogLastError(wxT("GetWindowRect")); } return rect; @@ -381,7 +381,7 @@ inline RECT wxGetClientRect(HWND hwnd) if ( !::GetClientRect(hwnd, &rect) ) { - wxLogLastError(_T("GetClientRect")); + wxLogLastError(wxT("GetClientRect")); } return rect; @@ -452,7 +452,7 @@ public: void Init(HDC hdc, HGDIOBJ hgdiobj) { - wxASSERT_MSG( !m_hdc, _T("initializing twice?") ); + wxASSERT_MSG( !m_hdc, wxT("initializing twice?") ); m_hdc = hdc; @@ -481,7 +481,7 @@ protected: void InitGdiobj(HGDIOBJ gdiobj) { - wxASSERT_MSG( !m_gdiobj, _T("initializing twice?") ); + wxASSERT_MSG( !m_gdiobj, wxT("initializing twice?") ); m_gdiobj = gdiobj; } @@ -575,7 +575,7 @@ public: { if ( !::SelectClipRgn(hdc, hrgn) ) { - wxLogLastError(_T("SelectClipRgn")); + wxLogLastError(wxT("SelectClipRgn")); } } @@ -606,7 +606,7 @@ private: m_modeOld = ::SetMapMode(hdc, mm); if ( !m_modeOld ) { - wxLogLastError(_T("SelectClipRgn")); + wxLogLastError(wxT("SelectClipRgn")); } } @@ -643,7 +643,7 @@ public: m_hGlobal = ::GlobalAlloc(flags, size); if ( !m_hGlobal ) { - wxLogLastError(_T("GlobalAlloc")); + wxLogLastError(wxT("GlobalAlloc")); } } @@ -656,7 +656,7 @@ public: { if ( m_hGlobal && ::GlobalFree(m_hGlobal) ) { - wxLogLastError(_T("GlobalFree")); + wxLogLastError(wxT("GlobalFree")); } } @@ -694,7 +694,7 @@ public: m_ptr = GlobalLock(hGlobal); if ( !m_ptr ) { - wxLogLastError(_T("GlobalLock")); + wxLogLastError(wxT("GlobalLock")); } } @@ -712,7 +712,7 @@ public: DWORD dwLastError = ::GetLastError(); if ( dwLastError != NO_ERROR ) { - wxLogApiError(_T("GlobalUnlock"), dwLastError); + wxLogApiError(wxT("GlobalUnlock"), dwLastError); } } } @@ -745,12 +745,12 @@ public: { // we should only be called if we hadn't been initialized yet wxASSERT_MSG( m_registered == -1, - _T("calling ClassRegistrar::Register() twice?") ); + wxT("calling ClassRegistrar::Register() twice?") ); m_registered = ::RegisterClass(&wc) ? 1 : 0; if ( !IsRegistered() ) { - wxLogLastError(_T("RegisterClassEx()")); + wxLogLastError(wxT("RegisterClassEx()")); } else { @@ -771,7 +771,7 @@ public: { if ( !::UnregisterClass(m_clsname.wx_str(), wxhInstance) ) { - wxLogLastError(_T("UnregisterClass")); + wxLogLastError(wxT("UnregisterClass")); } } } @@ -857,7 +857,7 @@ inline wxString wxGetFullModuleName(HMODULE hmod) MAX_PATH ) ) { - wxLogLastError(_T("GetModuleFileName")); + wxLogLastError(wxT("GetModuleFileName")); } return fullname; diff --git a/include/wx/msw/private/button.h b/include/wx/msw/private/button.h index f279c3e089..7d006f747a 100644 --- a/include/wx/msw/private/button.h +++ b/include/wx/msw/private/button.h @@ -38,7 +38,7 @@ namespace wxMSWButton // returns BS_MULTILINE if the label contains new lines or 0 otherwise inline int GetMultilineStyle(const wxString& label) { - return label.find(_T('\n')) == wxString::npos ? 0 : BS_MULTILINE; + return label.find(wxT('\n')) == wxString::npos ? 0 : BS_MULTILINE; } // update the style of the specified HWND to include or exclude BS_MULTILINE diff --git a/include/wx/msw/private/dc.h b/include/wx/msw/private/dc.h index 85b4140f6b..0f4c428285 100644 --- a/include/wx/msw/private/dc.h +++ b/include/wx/msw/private/dc.h @@ -72,7 +72,7 @@ protected: m_oldColFg = ::SetTextColor(m_hdc, colFg); if ( m_oldColFg == CLR_INVALID ) { - wxLogLastError(_T("SetTextColor")); + wxLogLastError(wxT("SetTextColor")); } } else @@ -85,7 +85,7 @@ protected: m_oldColBg = ::SetBkColor(m_hdc, colBg); if ( m_oldColBg == CLR_INVALID ) { - wxLogLastError(_T("SetBkColor")); + wxLogLastError(wxT("SetBkColor")); } } else @@ -131,7 +131,7 @@ protected: : OPAQUE); if ( !m_oldMode ) { - wxLogLastError(_T("SetBkMode")); + wxLogLastError(wxT("SetBkMode")); } } diff --git a/include/wx/msw/private/metrics.h b/include/wx/msw/private/metrics.h index fe9483a3fa..22a6f551f0 100644 --- a/include/wx/msw/private/metrics.h +++ b/include/wx/msw/private/metrics.h @@ -36,7 +36,7 @@ inline const NONCLIENTMETRICS& GetNonClientMetrics() #endif // WINVER >= 0x0600 { // maybe we should initialize the struct with some defaults? - wxLogLastError(_T("SystemParametersInfo(SPI_GETNONCLIENTMETRICS)")); + wxLogLastError(wxT("SystemParametersInfo(SPI_GETNONCLIENTMETRICS)")); } } diff --git a/include/wx/msw/slider.h b/include/wx/msw/slider.h index 019bc233da..a692c9905c 100644 --- a/include/wx/msw/slider.h +++ b/include/wx/msw/slider.h @@ -101,7 +101,7 @@ protected: void Init(); // format an integer value as string - static wxString Format(int n) { return wxString::Format(_T("%d"), n); } + static wxString Format(int n) { return wxString::Format(wxT("%d"), n); } // get the boundig box for the slider and possible labels wxRect GetBoundingBox() const; diff --git a/include/wx/msw/spinctrl.h b/include/wx/msw/spinctrl.h index 3e533ed091..551b632f28 100644 --- a/include/wx/msw/spinctrl.h +++ b/include/wx/msw/spinctrl.h @@ -39,7 +39,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { Create(parent, id, value, pos, size, style, min, max, initial, name); } @@ -51,7 +51,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")); + const wxString& name = wxT("wxSpinCtrl")); // a wxTextCtrl-like method (but we can't have GetValue returning wxString // because the base class already has one returning int!) diff --git a/include/wx/msw/subwin.h b/include/wx/msw/subwin.h index 2c877186eb..90be4841a1 100644 --- a/include/wx/msw/subwin.h +++ b/include/wx/msw/subwin.h @@ -28,7 +28,7 @@ public: // allocate enough space for the given number of windows void Create(size_t n) { - wxASSERT_MSG( !m_hwnds, _T("Create() called twice?") ); + wxASSERT_MSG( !m_hwnds, wxT("Create() called twice?") ); m_count = n; m_hwnds = (HWND *)calloc(n, sizeof(HWND)); @@ -54,7 +54,7 @@ public: // access a given window HWND& Get(size_t n) { - wxASSERT_MSG( n < m_count, _T("subwindow index out of range") ); + wxASSERT_MSG( n < m_count, wxT("subwindow index out of range") ); return m_hwnds[n]; } @@ -68,7 +68,7 @@ public: // that it is not reused while this object exists void Set(size_t n, HWND hwnd, wxWindowID id) { - wxASSERT_MSG( n < m_count, _T("subwindow index out of range") ); + wxASSERT_MSG( n < m_count, wxT("subwindow index out of range") ); m_hwnds[n] = hwnd; m_ids[n] = id; @@ -115,7 +115,7 @@ public: void SetFont(const wxFont& font) { HFONT hfont = GetHfontOf(font); - wxCHECK_RET( hfont, _T("invalid font") ); + wxCHECK_RET( hfont, wxT("invalid font") ); for ( size_t n = 0; n < m_count; n++ ) { diff --git a/include/wx/msw/wrapshl.h b/include/wx/msw/wrapshl.h index 163f96b0a2..25585112e1 100644 --- a/include/wx/msw/wrapshl.h +++ b/include/wx/msw/wrapshl.h @@ -72,7 +72,7 @@ public: wxString path; if ( !SHGetPathFromIDList(m_pidl, wxStringBuffer(path, MAX_PATH)) ) { - wxLogLastError(_T("SHGetPathFromIDList")); + wxLogLastError(wxT("SHGetPathFromIDList")); } return path; diff --git a/include/wx/os2/gdiimage.h b/include/wx/os2/gdiimage.h index 7d96b89e9f..293b9147cd 100644 --- a/include/wx/os2/gdiimage.h +++ b/include/wx/os2/gdiimage.h @@ -241,7 +241,7 @@ protected: virtual wxGDIRefData * CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const { - wxFAIL_MSG( _T("must be implemented if used") ); + wxFAIL_MSG( wxT("must be implemented if used") ); return NULL; } diff --git a/include/wx/os2/private.h b/include/wx/os2/private.h index cd13cf995b..f343d85a69 100644 --- a/include/wx/os2/private.h +++ b/include/wx/os2/private.h @@ -169,12 +169,12 @@ typedef MRESULT (APIENTRY * WndProcCast) (HWND, ULONG, MPARAM, MPARAM); * for this combination of CTl3D/FAFA settings */ -#define STATIC_CLASS _T("STATIC") +#define STATIC_CLASS wxT("STATIC") #define STATIC_FLAGS (SS_TEXT|DT_LEFT|SS_LEFT|WS_VISIBLE) -#define CHECK_CLASS _T("BUTTON") +#define CHECK_CLASS wxT("BUTTON") #define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP) #define CHECK_IS_FAFA FALSE -#define RADIO_CLASS _T("BUTTON" ) +#define RADIO_CLASS wxT("BUTTON" ) #define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_VISIBLE) #define RADIO_SIZE 20 #define RADIO_IS_FAFA FALSE diff --git a/include/wx/os2/spinctrl.h b/include/wx/os2/spinctrl.h index 1b37a27fd2..3b666a6452 100644 --- a/include/wx/os2/spinctrl.h +++ b/include/wx/os2/spinctrl.h @@ -36,7 +36,7 @@ public: ,int nMin = 0 ,int nMax = 100 ,int nInitial = 0 - ,const wxString& rsName = _T("wxSpinCtrl") + ,const wxString& rsName = wxT("wxSpinCtrl") ) { Create(pParent, vId, rsValue, rPos, rSize, lStyle, nMin, nMax, nInitial, rsName); @@ -52,7 +52,7 @@ public: ,int nMin = 0 ,int nMax = 100 ,int nInitial = 0 - ,const wxString& rsName = _T("wxSpinCtrl") + ,const wxString& rsName = wxT("wxSpinCtrl") ); // diff --git a/include/wx/osx/dirdlg.h b/include/wx/osx/dirdlg.h index 4ffad16d34..7a40c8524c 100644 --- a/include/wx/osx/dirdlg.h +++ b/include/wx/osx/dirdlg.h @@ -17,7 +17,7 @@ class WXDLLIMPEXP_CORE wxDirDialog : public wxDirDialogBase public: wxDirDialog(wxWindow *parent, const wxString& message = wxDirSelectorPromptStr, - const wxString& defaultPath = _T(""), + const wxString& defaultPath = wxT(""), long style = wxDD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, diff --git a/include/wx/osx/nonownedwnd.h b/include/wx/osx/nonownedwnd.h index 61caeb7d00..77f328f2af 100644 --- a/include/wx/osx/nonownedwnd.h +++ b/include/wx/osx/nonownedwnd.h @@ -15,7 +15,7 @@ #include "wx/window.h" #if wxUSE_SYSTEM_OPTIONS - #define wxMAC_WINDOW_PLAIN_TRANSITION _T("mac.window-plain-transition") + #define wxMAC_WINDOW_PLAIN_TRANSITION wxT("mac.window-plain-transition") #endif //----------------------------------------------------------------------------- diff --git a/include/wx/osx/spinctrl.h b/include/wx/osx/spinctrl.h index efc6f7f554..04491ff269 100644 --- a/include/wx/osx/spinctrl.h +++ b/include/wx/osx/spinctrl.h @@ -45,7 +45,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { Init(); Create(parent, id, value, pos, size, style, min, max, initial, name); @@ -58,7 +58,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")); + const wxString& name = wxT("wxSpinCtrl")); // wxTextCtrl-like method void SetSelection(long from, long to); @@ -137,7 +137,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { Create(parent, id, value, pos, size, style, min, max, initial, name); } @@ -149,7 +149,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS | wxALIGN_RIGHT, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { SetRange(min, max); diff --git a/include/wx/palette.h b/include/wx/palette.h index 02edb405b5..ba94985c3a 100644 --- a/include/wx/palette.h +++ b/include/wx/palette.h @@ -25,7 +25,7 @@ class WXDLLIMPEXP_CORE wxPaletteBase: public wxGDIObject public: virtual ~wxPaletteBase() { } - virtual int GetColoursCount() const { wxFAIL_MSG( _T("not implemented") ); return 0; } + virtual int GetColoursCount() const { wxFAIL_MSG( wxT("not implemented") ); return 0; } }; #if defined(__WXPALMOS__) diff --git a/include/wx/palmos/dc.h b/include/wx/palmos/dc.h index 07565d3b4f..32572a25fc 100644 --- a/include/wx/palmos/dc.h +++ b/include/wx/palmos/dc.h @@ -335,7 +335,7 @@ public: virtual void DoGetSize(int *w, int *h) const { wxASSERT_MSG( m_size.IsFullySpecified(), - _T("size of this DC hadn't been set and is unknown") ); + wxT("size of this DC hadn't been set and is unknown") ); if ( w ) *w = m_size.x; diff --git a/include/wx/palmos/gdiimage.h b/include/wx/palmos/gdiimage.h index db0d112c37..43edb57a0c 100644 --- a/include/wx/palmos/gdiimage.h +++ b/include/wx/palmos/gdiimage.h @@ -180,7 +180,7 @@ protected: virtual wxGDIRefData * CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const { - wxFAIL_MSG( _T("must be implemented if used") ); + wxFAIL_MSG( wxT("must be implemented if used") ); return NULL; } diff --git a/include/wx/palmos/spinctrl.h b/include/wx/palmos/spinctrl.h index 912eb5532c..a740635957 100644 --- a/include/wx/palmos/spinctrl.h +++ b/include/wx/palmos/spinctrl.h @@ -37,7 +37,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")) + const wxString& name = wxT("wxSpinCtrl")) { Create(parent, id, value, pos, size, style, min, max, initial, name); } @@ -49,7 +49,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxSP_ARROW_KEYS, int min = 0, int max = 100, int initial = 0, - const wxString& name = _T("wxSpinCtrl")); + const wxString& name = wxT("wxSpinCtrl")); // a wxTextCtrl-like method (but we can't have GetValue returning wxString // because the base class already has one returning int!) diff --git a/include/wx/palmos/statbmp.h b/include/wx/palmos/statbmp.h index 556e853483..3511309423 100644 --- a/include/wx/palmos/statbmp.h +++ b/include/wx/palmos/statbmp.h @@ -54,14 +54,14 @@ public: // vice versa wxIcon GetIcon() const { - wxASSERT_MSG( m_isIcon, _T("no icon in this wxStaticBitmap") ); + wxASSERT_MSG( m_isIcon, wxT("no icon in this wxStaticBitmap") ); return *(wxIcon *)m_image; } wxBitmap GetBitmap() const { - wxASSERT_MSG( !m_isIcon, _T("no bitmap in this wxStaticBitmap") ); + wxASSERT_MSG( !m_isIcon, wxT("no bitmap in this wxStaticBitmap") ); return *(wxBitmap *)m_image; } diff --git a/include/wx/private/fileback.h b/include/wx/private/fileback.h index 898c37c093..9698fbc825 100644 --- a/include/wx/private/fileback.h +++ b/include/wx/private/fileback.h @@ -33,7 +33,7 @@ public: // backing file is never created and the backing is done with memory. wxBackingFile(wxInputStream *stream, size_t bufsize = DefaultBufSize, - const wxString& prefix = _T("wxbf")); + const wxString& prefix = wxT("wxbf")); wxBackingFile() : m_impl(NULL) { } ~wxBackingFile(); diff --git a/include/wx/private/wxprintf.h b/include/wx/private/wxprintf.h index 1bdc7b62ac..67f05f6f57 100644 --- a/include/wx/private/wxprintf.h +++ b/include/wx/private/wxprintf.h @@ -514,7 +514,7 @@ void wxPrintfConvSpec::ReplaceAsteriskWith(int width) // find the first * in our flag buffer char *pwidth = strchr(m_szFlags, '*'); - wxCHECK_RET(pwidth, _T("field width must be specified")); + wxCHECK_RET(pwidth, wxT("field width must be specified")); // save what follows the * (the +1 is to skip the asterisk itself!) strcpy(temp, pwidth+1); @@ -685,13 +685,13 @@ int wxPrintfConvSpec::Process(CharType *buf, size_t lenMax, wxPrintfAr if (!m_bAlignLeft) for (i = 1; i < (size_t)m_nMinWidth; i++) - APPEND_CH(_T(' ')); + APPEND_CH(wxT(' ')); APPEND_CH(val); if (m_bAlignLeft) for (i = 1; i < (size_t)m_nMinWidth; i++) - APPEND_CH(_T(' ')); + APPEND_CH(wxT(' ')); } break; @@ -716,7 +716,7 @@ int wxPrintfConvSpec::Process(CharType *buf, size_t lenMax, wxPrintfAr if (!m_bAlignLeft) { for (i = len; i < m_nMinWidth; i++) - APPEND_CH(_T(' ')); + APPEND_CH(wxT(' ')); } len = wxMin((unsigned int)len, lenMax-lenCur); @@ -726,7 +726,7 @@ int wxPrintfConvSpec::Process(CharType *buf, size_t lenMax, wxPrintfAr if (m_bAlignLeft) { for (i = len; i < m_nMinWidth; i++) - APPEND_CH(_T(' ')); + APPEND_CH(wxT(' ')); } } break; diff --git a/include/wx/protocol/ftp.h b/include/wx/protocol/ftp.h index f9489fefc7..bfe39ce017 100644 --- a/include/wx/protocol/ftp.h +++ b/include/wx/protocol/ftp.h @@ -169,7 +169,7 @@ protected: // the trace mask used by assorted wxLogTrace() in ftp code, do // wxLog::AddTraceMask(FTP_TRACE_MASK) to see them in output -#define FTP_TRACE_MASK _T("ftp") +#define FTP_TRACE_MASK wxT("ftp") #endif // wxUSE_PROTOCOL_FTP diff --git a/include/wx/recguard.h b/include/wx/recguard.h index 010637efdb..3b7fe8e90d 100644 --- a/include/wx/recguard.h +++ b/include/wx/recguard.h @@ -35,7 +35,7 @@ public: ~wxRecursionGuard() { - wxASSERT_MSG( m_flag > 0, _T("unbalanced wxRecursionGuards!?") ); + wxASSERT_MSG( m_flag > 0, wxT("unbalanced wxRecursionGuards!?") ); m_flag--; } diff --git a/include/wx/richtext/richtextbulletspage.h b/include/wx/richtext/richtextbulletspage.h index 111d0bc31e..36b4cc6eb6 100644 --- a/include/wx/richtext/richtextbulletspage.h +++ b/include/wx/richtext/richtextbulletspage.h @@ -32,7 +32,7 @@ class wxRichTextCtrl; ////@begin control identifiers #define SYMBOL_WXRICHTEXTBULLETSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE _T("") +#define SYMBOL_WXRICHTEXTBULLETSPAGE_TITLE wxT("") #define SYMBOL_WXRICHTEXTBULLETSPAGE_IDNAME ID_RICHTEXTBULLETSPAGE #define SYMBOL_WXRICHTEXTBULLETSPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTBULLETSPAGE_POSITION wxDefaultPosition diff --git a/include/wx/richtext/richtextfontpage.h b/include/wx/richtext/richtextfontpage.h index c7ac90cd2e..9027348fd0 100644 --- a/include/wx/richtext/richtextfontpage.h +++ b/include/wx/richtext/richtextfontpage.h @@ -35,7 +35,7 @@ class wxRichTextFontPreviewCtrl; ////@begin control identifiers #define SYMBOL_WXRICHTEXTFONTPAGE_STYLE wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTFONTPAGE_TITLE _T("") +#define SYMBOL_WXRICHTEXTFONTPAGE_TITLE wxT("") #define SYMBOL_WXRICHTEXTFONTPAGE_IDNAME ID_RICHTEXTFONTPAGE #define SYMBOL_WXRICHTEXTFONTPAGE_SIZE wxSize(200, 100) #define SYMBOL_WXRICHTEXTFONTPAGE_POSITION wxDefaultPosition diff --git a/include/wx/richtext/richtextindentspage.h b/include/wx/richtext/richtextindentspage.h index b175c70fed..ad6ae91029 100644 --- a/include/wx/richtext/richtextindentspage.h +++ b/include/wx/richtext/richtextindentspage.h @@ -34,7 +34,7 @@ class wxRichTextCtrl; ////@begin control identifiers #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_TITLE _T("") +#define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_TITLE wxT("") #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_IDNAME ID_RICHTEXTINDENTSSPACINGPAGE #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTINDENTSSPACINGPAGE_POSITION wxDefaultPosition diff --git a/include/wx/richtext/richtextliststylepage.h b/include/wx/richtext/richtextliststylepage.h index 0f2ab83690..832b3f2d75 100644 --- a/include/wx/richtext/richtextliststylepage.h +++ b/include/wx/richtext/richtextliststylepage.h @@ -28,7 +28,7 @@ ////@begin control identifiers #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_TITLE _T("") +#define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_TITLE wxT("") #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_IDNAME ID_RICHTEXTLISTSTYLEPAGE #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTLISTSTYLEPAGE_POSITION wxDefaultPosition diff --git a/include/wx/richtext/richtextstylepage.h b/include/wx/richtext/richtextstylepage.h index ee00fa4259..e80b0bbb66 100644 --- a/include/wx/richtext/richtextstylepage.h +++ b/include/wx/richtext/richtextstylepage.h @@ -18,7 +18,7 @@ ////@begin control identifiers #define SYMBOL_WXRICHTEXTSTYLEPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTSTYLEPAGE_TITLE _T("") +#define SYMBOL_WXRICHTEXTSTYLEPAGE_TITLE wxT("") #define SYMBOL_WXRICHTEXTSTYLEPAGE_IDNAME ID_RICHTEXTSTYLEPAGE #define SYMBOL_WXRICHTEXTSTYLEPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTSTYLEPAGE_POSITION wxDefaultPosition diff --git a/include/wx/richtext/richtexttabspage.h b/include/wx/richtext/richtexttabspage.h index 09ae0c16fc..6f8a91cb4f 100644 --- a/include/wx/richtext/richtexttabspage.h +++ b/include/wx/richtext/richtexttabspage.h @@ -32,7 +32,7 @@ ////@begin control identifiers #define SYMBOL_WXRICHTEXTTABSPAGE_STYLE wxRESIZE_BORDER|wxTAB_TRAVERSAL -#define SYMBOL_WXRICHTEXTTABSPAGE_TITLE _T("") +#define SYMBOL_WXRICHTEXTTABSPAGE_TITLE wxT("") #define SYMBOL_WXRICHTEXTTABSPAGE_IDNAME ID_RICHTEXTTABSPAGE #define SYMBOL_WXRICHTEXTTABSPAGE_SIZE wxSize(400, 300) #define SYMBOL_WXRICHTEXTTABSPAGE_POSITION wxDefaultPosition diff --git a/include/wx/selstore.h b/include/wx/selstore.h index f82d1ac5be..94ce566b88 100644 --- a/include/wx/selstore.h +++ b/include/wx/selstore.h @@ -49,7 +49,7 @@ public: void Clear() { m_itemsSel.Clear(); m_count = 0; m_defaultState = false; } // must be called when a new item is inserted/added - void OnItemAdd(unsigned WXUNUSED(item)) { wxFAIL_MSG( _T("TODO") ); } + void OnItemAdd(unsigned WXUNUSED(item)) { wxFAIL_MSG( wxT("TODO") ); } // must be called when an item is deleted void OnItemDelete(unsigned item); diff --git a/include/wx/sizer.h b/include/wx/sizer.h index 0390c59605..0bcc34cb34 100644 --- a/include/wx/sizer.h +++ b/include/wx/sizer.h @@ -857,7 +857,7 @@ public: m_totalProportion = 0; wxASSERT_MSG( m_orient == wxHORIZONTAL || m_orient == wxVERTICAL, - _T("invalid value for wxBoxSizer orientation") ); + wxT("invalid value for wxBoxSizer orientation") ); } int GetOrientation() const { return m_orient; } diff --git a/include/wx/sound.h b/include/wx/sound.h index 380baf2f1d..ef473443f7 100644 --- a/include/wx/sound.h +++ b/include/wx/sound.h @@ -40,7 +40,7 @@ public: { wxASSERT_MSG( (flags & wxSOUND_LOOP) == 0 || (flags & wxSOUND_ASYNC) != 0, - _T("sound can only be looped asynchronously") ); + wxT("sound can only be looped asynchronously") ); return DoPlay(flags); } diff --git a/include/wx/spinbutt.h b/include/wx/spinbutt.h index 53e84ea68f..eb79205a26 100644 --- a/include/wx/spinbutt.h +++ b/include/wx/spinbutt.h @@ -23,7 +23,7 @@ #include "wx/control.h" #include "wx/event.h" -#define wxSPIN_BUTTON_NAME _T("wxSpinButton") +#define wxSPIN_BUTTON_NAME wxT("wxSpinButton") // ---------------------------------------------------------------------------- // The wxSpinButton is like a small scrollbar than is often placed next diff --git a/include/wx/stopwatch.h b/include/wx/stopwatch.h index 583c75a495..325722a892 100644 --- a/include/wx/stopwatch.h +++ b/include/wx/stopwatch.h @@ -40,7 +40,7 @@ public: void Resume() { wxASSERT_MSG( m_pauseCount > 0, - _T("Resuming stop watch which is not paused") ); + wxT("Resuming stop watch which is not paused") ); if ( --m_pauseCount == 0 ) Start(m_pause); diff --git a/include/wx/string.h b/include/wx/string.h index cc9e4dc8c8..9ed73f5b82 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -288,7 +288,7 @@ public: wxCStrData operator-(ptrdiff_t n) const { wxASSERT_MSG( n <= (ptrdiff_t)m_offset, - _T("attempt to construct address before the beginning of the string") ); + wxT("attempt to construct address before the beginning of the string") ); return wxCStrData(m_str, m_offset - n, m_owned); } @@ -1513,14 +1513,14 @@ public: // get last character wxUniChar Last() const { - wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") ); + wxASSERT_MSG( !empty(), wxT("wxString: index out of bounds") ); return *rbegin(); } // get writable last character wxUniCharRef Last() { - wxASSERT_MSG( !empty(), _T("wxString: index out of bounds") ); + wxASSERT_MSG( !empty(), wxT("wxString: index out of bounds") ); return *rbegin(); } @@ -1963,7 +1963,7 @@ public: { #if WXWIN_COMPATIBILITY_2_8 && !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 wxASSERT_MSG( s.IsValid(), - _T("did you forget to call UngetWriteBuf()?") ); + wxT("did you forget to call UngetWriteBuf()?") ); #endif append(s); @@ -2057,36 +2057,36 @@ public: // stream-like functions // insert an int into string wxString& operator<<(int i) - { return (*this) << Format(_T("%d"), i); } + { return (*this) << Format(wxT("%d"), i); } // insert an unsigned int into string wxString& operator<<(unsigned int ui) - { return (*this) << Format(_T("%u"), ui); } + { return (*this) << Format(wxT("%u"), ui); } // insert a long into string wxString& operator<<(long l) - { return (*this) << Format(_T("%ld"), l); } + { return (*this) << Format(wxT("%ld"), l); } // insert an unsigned long into string wxString& operator<<(unsigned long ul) - { return (*this) << Format(_T("%lu"), ul); } + { return (*this) << Format(wxT("%lu"), ul); } #if defined wxLongLong_t && !defined wxLongLongIsLong // insert a long long if they exist and aren't longs wxString& operator<<(wxLongLong_t ll) { - const wxChar *fmt = _T("%") wxLongLongFmtSpec _T("d"); + const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("d"); return (*this) << Format(fmt, ll); } // insert an unsigned long long wxString& operator<<(wxULongLong_t ull) { - const wxChar *fmt = _T("%") wxLongLongFmtSpec _T("u"); + const wxChar *fmt = wxT("%") wxLongLongFmtSpec wxT("u"); return (*this) << Format(fmt , ull); } #endif // wxLongLong_t && !wxLongLongIsLong // insert a float into string wxString& operator<<(float f) - { return (*this) << Format(_T("%f"), f); } + { return (*this) << Format(wxT("%f"), f); } // insert a double into string wxString& operator<<(double d) - { return (*this) << Format(_T("%g"), d); } + { return (*this) << Format(wxT("%g"), d); } // string comparison // case-sensitive comparison (returns a value < 0, = 0 or > 0) @@ -2428,7 +2428,7 @@ public: CreateConstIterator(last).impl()) { wxASSERT_MSG( first.m_str == last.m_str, - _T("pointers must be into the same string") ); + wxT("pointers must be into the same string") ); } #endif // WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER @@ -4165,7 +4165,7 @@ inline const wxStringCharType *wxCStrData::AsInternal() const inline wxUniChar wxCStrData::operator*() const { if ( m_str->empty() ) - return wxUniChar(_T('\0')); + return wxUniChar(wxT('\0')); else return (*m_str)[m_offset]; } diff --git a/include/wx/stringimpl.h b/include/wx/stringimpl.h index 08880f3ebe..7371bfa39d 100644 --- a/include/wx/stringimpl.h +++ b/include/wx/stringimpl.h @@ -34,7 +34,7 @@ // implementation only #define wxASSERT_VALID_INDEX(i) \ - wxASSERT_MSG( (size_t)(i) <= length(), _T("invalid index in wxString") ) + wxASSERT_MSG( (size_t)(i) <= length(), wxT("invalid index in wxString") ) // ---------------------------------------------------------------------------- @@ -300,7 +300,7 @@ public: wxStringImpl(const wxStringImpl& stringSrc) { wxASSERT_MSG( stringSrc.GetStringData()->IsValid(), - _T("did you forget to call UngetWriteBuf()?") ); + wxT("did you forget to call UngetWriteBuf()?") ); if ( stringSrc.empty() ) { // nothing to do for an empty string @@ -323,7 +323,7 @@ public: wxStringImpl(const wxStringImpl& str, size_t nPos, size_t nLen) { wxASSERT_MSG( str.GetStringData()->IsValid(), - _T("did you forget to call UngetWriteBuf()?") ); + wxT("did you forget to call UngetWriteBuf()?") ); Init(); size_t strLen = str.length() - nPos; nLen = strLen < nLen ? strLen : nLen; InitWith(str.c_str(), nPos, nLen); diff --git a/include/wx/tbarbase.h b/include/wx/tbarbase.h index cc367e41bb..14d03e032b 100644 --- a/include/wx/tbarbase.h +++ b/include/wx/tbarbase.h @@ -121,7 +121,7 @@ public: wxControl *GetControl() const { - wxASSERT_MSG( IsControl(), _T("this toolbar tool is not a control") ); + wxASSERT_MSG( IsControl(), wxT("this toolbar tool is not a control") ); return m_control; } @@ -135,7 +135,7 @@ public: int GetStyle() const { return m_toolStyle; } wxItemKind GetKind() const { - wxASSERT_MSG( IsButton(), _T("only makes sense for buttons") ); + wxASSERT_MSG( IsButton(), wxT("only makes sense for buttons") ); return m_kind; } diff --git a/include/wx/thrimpl.cpp b/include/wx/thrimpl.cpp index 6664ce7ee4..3e3cb3cea8 100644 --- a/include/wx/thrimpl.cpp +++ b/include/wx/thrimpl.cpp @@ -39,7 +39,7 @@ bool wxMutex::IsOk() const wxMutexError wxMutex::Lock() { wxCHECK_MSG( m_internal, wxMUTEX_INVALID, - _T("wxMutex::Lock(): not initialized") ); + wxT("wxMutex::Lock(): not initialized") ); return m_internal->Lock(); } @@ -47,7 +47,7 @@ wxMutexError wxMutex::Lock() wxMutexError wxMutex::LockTimeout(unsigned long ms) { wxCHECK_MSG( m_internal, wxMUTEX_INVALID, - _T("wxMutex::Lock(): not initialized") ); + wxT("wxMutex::Lock(): not initialized") ); return m_internal->Lock(ms); } @@ -55,7 +55,7 @@ wxMutexError wxMutex::LockTimeout(unsigned long ms) wxMutexError wxMutex::TryLock() { wxCHECK_MSG( m_internal, wxMUTEX_INVALID, - _T("wxMutex::TryLock(): not initialized") ); + wxT("wxMutex::TryLock(): not initialized") ); return m_internal->TryLock(); } @@ -63,7 +63,7 @@ wxMutexError wxMutex::TryLock() wxMutexError wxMutex::Unlock() { wxCHECK_MSG( m_internal, wxMUTEX_INVALID, - _T("wxMutex::Unlock(): not initialized") ); + wxT("wxMutex::Unlock(): not initialized") ); return m_internal->Unlock(); } @@ -253,7 +253,7 @@ bool wxCondition::IsOk() const wxCondError wxCondition::Wait() { wxCHECK_MSG( m_internal, wxCOND_INVALID, - _T("wxCondition::Wait(): not initialized") ); + wxT("wxCondition::Wait(): not initialized") ); return m_internal->Wait(); } @@ -261,7 +261,7 @@ wxCondError wxCondition::Wait() wxCondError wxCondition::WaitTimeout(unsigned long milliseconds) { wxCHECK_MSG( m_internal, wxCOND_INVALID, - _T("wxCondition::Wait(): not initialized") ); + wxT("wxCondition::Wait(): not initialized") ); return m_internal->WaitTimeout(milliseconds); } @@ -269,7 +269,7 @@ wxCondError wxCondition::WaitTimeout(unsigned long milliseconds) wxCondError wxCondition::Signal() { wxCHECK_MSG( m_internal, wxCOND_INVALID, - _T("wxCondition::Signal(): not initialized") ); + wxT("wxCondition::Signal(): not initialized") ); return m_internal->Signal(); } @@ -277,7 +277,7 @@ wxCondError wxCondition::Signal() wxCondError wxCondition::Broadcast() { wxCHECK_MSG( m_internal, wxCOND_INVALID, - _T("wxCondition::Broadcast(): not initialized") ); + wxT("wxCondition::Broadcast(): not initialized") ); return m_internal->Broadcast(); } @@ -309,7 +309,7 @@ bool wxSemaphore::IsOk() const wxSemaError wxSemaphore::Wait() { wxCHECK_MSG( m_internal, wxSEMA_INVALID, - _T("wxSemaphore::Wait(): not initialized") ); + wxT("wxSemaphore::Wait(): not initialized") ); return m_internal->Wait(); } @@ -317,7 +317,7 @@ wxSemaError wxSemaphore::Wait() wxSemaError wxSemaphore::TryWait() { wxCHECK_MSG( m_internal, wxSEMA_INVALID, - _T("wxSemaphore::TryWait(): not initialized") ); + wxT("wxSemaphore::TryWait(): not initialized") ); return m_internal->TryWait(); } @@ -325,7 +325,7 @@ wxSemaError wxSemaphore::TryWait() wxSemaError wxSemaphore::WaitTimeout(unsigned long milliseconds) { wxCHECK_MSG( m_internal, wxSEMA_INVALID, - _T("wxSemaphore::WaitTimeout(): not initialized") ); + wxT("wxSemaphore::WaitTimeout(): not initialized") ); return m_internal->WaitTimeout(milliseconds); } @@ -333,7 +333,7 @@ wxSemaError wxSemaphore::WaitTimeout(unsigned long milliseconds) wxSemaError wxSemaphore::Post() { wxCHECK_MSG( m_internal, wxSEMA_INVALID, - _T("wxSemaphore::Post(): not initialized") ); + wxT("wxSemaphore::Post(): not initialized") ); return m_internal->Post(); } diff --git a/include/wx/tokenzr.h b/include/wx/tokenzr.h index fca43655d9..0708ebff13 100644 --- a/include/wx/tokenzr.h +++ b/include/wx/tokenzr.h @@ -21,7 +21,7 @@ // ---------------------------------------------------------------------------- // default: delimiters are usual white space characters -#define wxDEFAULT_DELIMITERS (_T(" \t\r\n")) +#define wxDEFAULT_DELIMITERS (wxT(" \t\r\n")) // wxStringTokenizer mode flags which determine its behaviour enum wxStringTokenizerMode diff --git a/include/wx/univ/button.h b/include/wx/univ/button.h index 9c41fb392c..542f9579d6 100644 --- a/include/wx/univ/button.h +++ b/include/wx/univ/button.h @@ -20,10 +20,10 @@ class WXDLLIMPEXP_FWD_CORE wxInputHandler; // the actions supported by this control // ---------------------------------------------------------------------------- -#define wxACTION_BUTTON_TOGGLE _T("toggle") // press/release the button -#define wxACTION_BUTTON_PRESS _T("press") // press the button -#define wxACTION_BUTTON_RELEASE _T("release") // release the button -#define wxACTION_BUTTON_CLICK _T("click") // generate button click event +#define wxACTION_BUTTON_TOGGLE wxT("toggle") // press/release the button +#define wxACTION_BUTTON_PRESS wxT("press") // press the button +#define wxACTION_BUTTON_RELEASE wxT("release") // release the button +#define wxACTION_BUTTON_CLICK wxT("click") // generate button click event // ---------------------------------------------------------------------------- // wxButton: a push button diff --git a/include/wx/univ/checkbox.h b/include/wx/univ/checkbox.h index aaa1dee616..8e12d7effa 100644 --- a/include/wx/univ/checkbox.h +++ b/include/wx/univ/checkbox.h @@ -18,9 +18,9 @@ // the actions supported by wxCheckBox // ---------------------------------------------------------------------------- -#define wxACTION_CHECKBOX_CHECK _T("check") // SetValue(true) -#define wxACTION_CHECKBOX_CLEAR _T("clear") // SetValue(false) -#define wxACTION_CHECKBOX_TOGGLE _T("toggle") // toggle the check state +#define wxACTION_CHECKBOX_CHECK wxT("check") // SetValue(true) +#define wxACTION_CHECKBOX_CLEAR wxT("clear") // SetValue(false) +#define wxACTION_CHECKBOX_TOGGLE wxT("toggle") // toggle the check state // additionally it accepts wxACTION_BUTTON_PRESS and RELEASE diff --git a/include/wx/univ/checklst.h b/include/wx/univ/checklst.h index d22b8f069e..fc0bb91ca1 100644 --- a/include/wx/univ/checklst.h +++ b/include/wx/univ/checklst.h @@ -16,7 +16,7 @@ // actions // ---------------------------------------------------------------------------- -#define wxACTION_CHECKLISTBOX_TOGGLE _T("toggle") +#define wxACTION_CHECKLISTBOX_TOGGLE wxT("toggle") // ---------------------------------------------------------------------------- // wxCheckListBox diff --git a/include/wx/univ/combobox.h b/include/wx/univ/combobox.h index a8ccdf0564..7fef4303bf 100644 --- a/include/wx/univ/combobox.h +++ b/include/wx/univ/combobox.h @@ -22,9 +22,9 @@ class WXDLLIMPEXP_FWD_CORE wxListBox; // ---------------------------------------------------------------------------- // choose the next/prev/specified (by numArg) item -#define wxACTION_COMBOBOX_SELECT_NEXT _T("next") -#define wxACTION_COMBOBOX_SELECT_PREV _T("prev") -#define wxACTION_COMBOBOX_SELECT _T("select") +#define wxACTION_COMBOBOX_SELECT_NEXT wxT("next") +#define wxACTION_COMBOBOX_SELECT_PREV wxT("prev") +#define wxACTION_COMBOBOX_SELECT wxT("select") // ---------------------------------------------------------------------------- diff --git a/include/wx/univ/control.h b/include/wx/univ/control.h index 74913c6fbc..2c8afed8f6 100644 --- a/include/wx/univ/control.h +++ b/include/wx/univ/control.h @@ -32,7 +32,7 @@ typedef wxString wxControlAction; // the list of actions which apply to all controls (other actions are defined // in the controls headers) -#define wxACTION_NONE _T("") // no action to perform +#define wxACTION_NONE wxT("") // no action to perform // ---------------------------------------------------------------------------- // wxControl: the base class for all GUI controls @@ -77,7 +77,7 @@ public: // return the accel char itself or 0 if none wxChar GetAccelChar() const { - return m_indexAccel == -1 ? _T('\0') : (wxChar)m_label[m_indexAccel]; + return m_indexAccel == -1 ? wxT('\0') : (wxChar)m_label[m_indexAccel]; } virtual wxWindow *GetInputWindow() const { return (wxWindow*)this; } diff --git a/include/wx/univ/inpcons.h b/include/wx/univ/inpcons.h index 3538acd3a8..d740769f58 100644 --- a/include/wx/univ/inpcons.h +++ b/include/wx/univ/inpcons.h @@ -28,7 +28,7 @@ typedef wxString wxControlAction; // the list of actions which apply to all controls (other actions are defined // in the controls headers) -#define wxACTION_NONE _T("") // no action to perform +#define wxACTION_NONE wxT("") // no action to perform // ---------------------------------------------------------------------------- // wxInputConsumer: mix-in class for handling wxControlActions (used by diff --git a/include/wx/univ/inphand.h b/include/wx/univ/inphand.h index fd36787fe8..5e09bebf1f 100644 --- a/include/wx/univ/inphand.h +++ b/include/wx/univ/inphand.h @@ -20,21 +20,21 @@ // wxTheme::GetInputHandler() // ---------------------------------------------------------------------------- -#define wxINP_HANDLER_DEFAULT _T("") -#define wxINP_HANDLER_BUTTON _T("button") -#define wxINP_HANDLER_CHECKBOX _T("checkbox") -#define wxINP_HANDLER_CHECKLISTBOX _T("checklistbox") -#define wxINP_HANDLER_COMBOBOX _T("combobox") -#define wxINP_HANDLER_LISTBOX _T("listbox") -#define wxINP_HANDLER_NOTEBOOK _T("notebook") -#define wxINP_HANDLER_RADIOBTN _T("radiobtn") -#define wxINP_HANDLER_SCROLLBAR _T("scrollbar") -#define wxINP_HANDLER_SLIDER _T("slider") -#define wxINP_HANDLER_SPINBTN _T("spinbtn") -#define wxINP_HANDLER_STATUSBAR _T("statusbar") -#define wxINP_HANDLER_TEXTCTRL _T("textctrl") -#define wxINP_HANDLER_TOOLBAR _T("toolbar") -#define wxINP_HANDLER_TOPLEVEL _T("toplevel") +#define wxINP_HANDLER_DEFAULT wxT("") +#define wxINP_HANDLER_BUTTON wxT("button") +#define wxINP_HANDLER_CHECKBOX wxT("checkbox") +#define wxINP_HANDLER_CHECKLISTBOX wxT("checklistbox") +#define wxINP_HANDLER_COMBOBOX wxT("combobox") +#define wxINP_HANDLER_LISTBOX wxT("listbox") +#define wxINP_HANDLER_NOTEBOOK wxT("notebook") +#define wxINP_HANDLER_RADIOBTN wxT("radiobtn") +#define wxINP_HANDLER_SCROLLBAR wxT("scrollbar") +#define wxINP_HANDLER_SLIDER wxT("slider") +#define wxINP_HANDLER_SPINBTN wxT("spinbtn") +#define wxINP_HANDLER_STATUSBAR wxT("statusbar") +#define wxINP_HANDLER_TEXTCTRL wxT("textctrl") +#define wxINP_HANDLER_TOOLBAR wxT("toolbar") +#define wxINP_HANDLER_TOPLEVEL wxT("toplevel") // ---------------------------------------------------------------------------- // wxInputHandler: maps the events to the actions diff --git a/include/wx/univ/listbox.h b/include/wx/univ/listbox.h index f70d98abc9..5431b7bd18 100644 --- a/include/wx/univ/listbox.h +++ b/include/wx/univ/listbox.h @@ -21,28 +21,28 @@ // ---------------------------------------------------------------------------- // change the current item -#define wxACTION_LISTBOX_SETFOCUS _T("setfocus") // select the item -#define wxACTION_LISTBOX_MOVEDOWN _T("down") // select item below -#define wxACTION_LISTBOX_MOVEUP _T("up") // select item above -#define wxACTION_LISTBOX_PAGEDOWN _T("pagedown") // go page down -#define wxACTION_LISTBOX_PAGEUP _T("pageup") // go page up -#define wxACTION_LISTBOX_START _T("start") // go to first item -#define wxACTION_LISTBOX_END _T("end") // go to last item -#define wxACTION_LISTBOX_FIND _T("find") // find item by 1st letter +#define wxACTION_LISTBOX_SETFOCUS wxT("setfocus") // select the item +#define wxACTION_LISTBOX_MOVEDOWN wxT("down") // select item below +#define wxACTION_LISTBOX_MOVEUP wxT("up") // select item above +#define wxACTION_LISTBOX_PAGEDOWN wxT("pagedown") // go page down +#define wxACTION_LISTBOX_PAGEUP wxT("pageup") // go page up +#define wxACTION_LISTBOX_START wxT("start") // go to first item +#define wxACTION_LISTBOX_END wxT("end") // go to last item +#define wxACTION_LISTBOX_FIND wxT("find") // find item by 1st letter // do something with the current item -#define wxACTION_LISTBOX_ACTIVATE _T("activate") // activate (choose) -#define wxACTION_LISTBOX_TOGGLE _T("toggle") // togglee selected state -#define wxACTION_LISTBOX_SELECT _T("select") // sel this, unsel others -#define wxACTION_LISTBOX_SELECTADD _T("selectadd") // add to selection -#define wxACTION_LISTBOX_UNSELECT _T("unselect") // unselect -#define wxACTION_LISTBOX_ANCHOR _T("selanchor") // anchor selection +#define wxACTION_LISTBOX_ACTIVATE wxT("activate") // activate (choose) +#define wxACTION_LISTBOX_TOGGLE wxT("toggle") // togglee selected state +#define wxACTION_LISTBOX_SELECT wxT("select") // sel this, unsel others +#define wxACTION_LISTBOX_SELECTADD wxT("selectadd") // add to selection +#define wxACTION_LISTBOX_UNSELECT wxT("unselect") // unselect +#define wxACTION_LISTBOX_ANCHOR wxT("selanchor") // anchor selection // do something with the selection globally (not for single selection ones) -#define wxACTION_LISTBOX_SELECTALL _T("selectall") // select all items -#define wxACTION_LISTBOX_UNSELECTALL _T("unselectall") // unselect all items -#define wxACTION_LISTBOX_SELTOGGLE _T("togglesel") // invert the selection -#define wxACTION_LISTBOX_EXTENDSEL _T("extend") // extend to item +#define wxACTION_LISTBOX_SELECTALL wxT("selectall") // select all items +#define wxACTION_LISTBOX_UNSELECTALL wxT("unselectall") // unselect all items +#define wxACTION_LISTBOX_SELTOGGLE wxT("togglesel") // invert the selection +#define wxACTION_LISTBOX_EXTENDSEL wxT("extend") // extend to item // ---------------------------------------------------------------------------- // wxListBox: a list of selectable items diff --git a/include/wx/univ/menuitem.h b/include/wx/univ/menuitem.h index 70d3350e6c..90da59a9fe 100644 --- a/include/wx/univ/menuitem.h +++ b/include/wx/univ/menuitem.h @@ -72,14 +72,14 @@ public: wxCoord GetPosition() const { - wxASSERT_MSG( m_posY != wxDefaultCoord, _T("must call SetHeight first!") ); + wxASSERT_MSG( m_posY != wxDefaultCoord, wxT("must call SetHeight first!") ); return m_posY; } wxCoord GetHeight() const { - wxASSERT_MSG( m_height != wxDefaultCoord, _T("must call SetHeight first!") ); + wxASSERT_MSG( m_height != wxDefaultCoord, wxT("must call SetHeight first!") ); return m_height; } diff --git a/include/wx/univ/notebook.h b/include/wx/univ/notebook.h index dda002abc9..064eb2cbed 100644 --- a/include/wx/univ/notebook.h +++ b/include/wx/univ/notebook.h @@ -21,9 +21,9 @@ class WXDLLIMPEXP_FWD_CORE wxSpinButton; // ---------------------------------------------------------------------------- // change the page: to the next/previous/given one -#define wxACTION_NOTEBOOK_NEXT _T("nexttab") -#define wxACTION_NOTEBOOK_PREV _T("prevtab") -#define wxACTION_NOTEBOOK_GOTO _T("gototab") +#define wxACTION_NOTEBOOK_NEXT wxT("nexttab") +#define wxACTION_NOTEBOOK_PREV wxT("prevtab") +#define wxACTION_NOTEBOOK_GOTO wxT("gototab") // ---------------------------------------------------------------------------- // wxNotebook diff --git a/include/wx/univ/scrolbar.h b/include/wx/univ/scrolbar.h index dd59432a36..5963989dcf 100644 --- a/include/wx/univ/scrolbar.h +++ b/include/wx/univ/scrolbar.h @@ -22,17 +22,17 @@ class WXDLLIMPEXP_FWD_CORE wxScrollTimer; // ---------------------------------------------------------------------------- // scroll the bar -#define wxACTION_SCROLL_START _T("start") // to the beginning -#define wxACTION_SCROLL_END _T("end") // to the end -#define wxACTION_SCROLL_LINE_UP _T("lineup") // one line up/left -#define wxACTION_SCROLL_PAGE_UP _T("pageup") // one page up/left -#define wxACTION_SCROLL_LINE_DOWN _T("linedown") // one line down/right -#define wxACTION_SCROLL_PAGE_DOWN _T("pagedown") // one page down/right +#define wxACTION_SCROLL_START wxT("start") // to the beginning +#define wxACTION_SCROLL_END wxT("end") // to the end +#define wxACTION_SCROLL_LINE_UP wxT("lineup") // one line up/left +#define wxACTION_SCROLL_PAGE_UP wxT("pageup") // one page up/left +#define wxACTION_SCROLL_LINE_DOWN wxT("linedown") // one line down/right +#define wxACTION_SCROLL_PAGE_DOWN wxT("pagedown") // one page down/right // the scrollbar thumb may be dragged -#define wxACTION_SCROLL_THUMB_DRAG _T("thumbdrag") -#define wxACTION_SCROLL_THUMB_MOVE _T("thumbmove") -#define wxACTION_SCROLL_THUMB_RELEASE _T("thumbrelease") +#define wxACTION_SCROLL_THUMB_DRAG wxT("thumbdrag") +#define wxACTION_SCROLL_THUMB_MOVE wxT("thumbmove") +#define wxACTION_SCROLL_THUMB_RELEASE wxT("thumbrelease") // ---------------------------------------------------------------------------- // wxScrollBar diff --git a/include/wx/univ/slider.h b/include/wx/univ/slider.h index 7be8cdde73..3ffb5dd6fd 100644 --- a/include/wx/univ/slider.h +++ b/include/wx/univ/slider.h @@ -20,17 +20,17 @@ // our actions are the same as scrollbars -#define wxACTION_SLIDER_START _T("start") // to the beginning -#define wxACTION_SLIDER_END _T("end") // to the end -#define wxACTION_SLIDER_LINE_UP _T("lineup") // one line up/left -#define wxACTION_SLIDER_PAGE_UP _T("pageup") // one page up/left -#define wxACTION_SLIDER_LINE_DOWN _T("linedown") // one line down/right -#define wxACTION_SLIDER_PAGE_DOWN _T("pagedown") // one page down/right -#define wxACTION_SLIDER_PAGE_CHANGE _T("pagechange")// change page by numArg - -#define wxACTION_SLIDER_THUMB_DRAG _T("thumbdrag") -#define wxACTION_SLIDER_THUMB_MOVE _T("thumbmove") -#define wxACTION_SLIDER_THUMB_RELEASE _T("thumbrelease") +#define wxACTION_SLIDER_START wxT("start") // to the beginning +#define wxACTION_SLIDER_END wxT("end") // to the end +#define wxACTION_SLIDER_LINE_UP wxT("lineup") // one line up/left +#define wxACTION_SLIDER_PAGE_UP wxT("pageup") // one page up/left +#define wxACTION_SLIDER_LINE_DOWN wxT("linedown") // one line down/right +#define wxACTION_SLIDER_PAGE_DOWN wxT("pagedown") // one page down/right +#define wxACTION_SLIDER_PAGE_CHANGE wxT("pagechange")// change page by numArg + +#define wxACTION_SLIDER_THUMB_DRAG wxT("thumbdrag") +#define wxACTION_SLIDER_THUMB_MOVE wxT("thumbmove") +#define wxACTION_SLIDER_THUMB_RELEASE wxT("thumbrelease") // ---------------------------------------------------------------------------- // wxSlider diff --git a/include/wx/univ/spinbutt.h b/include/wx/univ/spinbutt.h index aac61f9644..40a28c67a6 100644 --- a/include/wx/univ/spinbutt.h +++ b/include/wx/univ/spinbutt.h @@ -19,8 +19,8 @@ // ---------------------------------------------------------------------------- // actions supported by this control -#define wxACTION_SPIN_INC _T("inc") -#define wxACTION_SPIN_DEC _T("dec") +#define wxACTION_SPIN_INC wxT("inc") +#define wxACTION_SPIN_DEC wxT("dec") class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase, public wxControlWithArrows diff --git a/include/wx/univ/textctrl.h b/include/wx/univ/textctrl.h index 761ab3b805..087dbe59af 100644 --- a/include/wx/univ/textctrl.h +++ b/include/wx/univ/textctrl.h @@ -24,43 +24,43 @@ class WXDLLIMPEXP_FWD_CORE wxTextCtrlCommandProcessor; // ---------------------------------------------------------------------------- // cursor movement and also selection and delete operations -#define wxACTION_TEXT_GOTO _T("goto") // to pos in numArg -#define wxACTION_TEXT_FIRST _T("first") // go to pos 0 -#define wxACTION_TEXT_LAST _T("last") // go to last pos -#define wxACTION_TEXT_HOME _T("home") -#define wxACTION_TEXT_END _T("end") -#define wxACTION_TEXT_LEFT _T("left") -#define wxACTION_TEXT_RIGHT _T("right") -#define wxACTION_TEXT_UP _T("up") -#define wxACTION_TEXT_DOWN _T("down") -#define wxACTION_TEXT_WORD_LEFT _T("wordleft") -#define wxACTION_TEXT_WORD_RIGHT _T("wordright") -#define wxACTION_TEXT_PAGE_UP _T("pageup") -#define wxACTION_TEXT_PAGE_DOWN _T("pagedown") +#define wxACTION_TEXT_GOTO wxT("goto") // to pos in numArg +#define wxACTION_TEXT_FIRST wxT("first") // go to pos 0 +#define wxACTION_TEXT_LAST wxT("last") // go to last pos +#define wxACTION_TEXT_HOME wxT("home") +#define wxACTION_TEXT_END wxT("end") +#define wxACTION_TEXT_LEFT wxT("left") +#define wxACTION_TEXT_RIGHT wxT("right") +#define wxACTION_TEXT_UP wxT("up") +#define wxACTION_TEXT_DOWN wxT("down") +#define wxACTION_TEXT_WORD_LEFT wxT("wordleft") +#define wxACTION_TEXT_WORD_RIGHT wxT("wordright") +#define wxACTION_TEXT_PAGE_UP wxT("pageup") +#define wxACTION_TEXT_PAGE_DOWN wxT("pagedown") // clipboard operations -#define wxACTION_TEXT_COPY _T("copy") -#define wxACTION_TEXT_CUT _T("cut") -#define wxACTION_TEXT_PASTE _T("paste") +#define wxACTION_TEXT_COPY wxT("copy") +#define wxACTION_TEXT_CUT wxT("cut") +#define wxACTION_TEXT_PASTE wxT("paste") // insert text at the cursor position: the text is in strArg of PerformAction -#define wxACTION_TEXT_INSERT _T("insert") +#define wxACTION_TEXT_INSERT wxT("insert") // if the action starts with either of these prefixes and the rest of the // string is one of the movement commands, it means to select/delete text from // the current cursor position to the new one -#define wxACTION_TEXT_PREFIX_SEL _T("sel") -#define wxACTION_TEXT_PREFIX_DEL _T("del") +#define wxACTION_TEXT_PREFIX_SEL wxT("sel") +#define wxACTION_TEXT_PREFIX_DEL wxT("del") // mouse selection -#define wxACTION_TEXT_ANCHOR_SEL _T("anchorsel") -#define wxACTION_TEXT_EXTEND_SEL _T("extendsel") -#define wxACTION_TEXT_SEL_WORD _T("wordsel") -#define wxACTION_TEXT_SEL_LINE _T("linesel") +#define wxACTION_TEXT_ANCHOR_SEL wxT("anchorsel") +#define wxACTION_TEXT_EXTEND_SEL wxT("extendsel") +#define wxACTION_TEXT_SEL_WORD wxT("wordsel") +#define wxACTION_TEXT_SEL_LINE wxT("linesel") // undo or redo -#define wxACTION_TEXT_UNDO _T("undo") -#define wxACTION_TEXT_REDO _T("redo") +#define wxACTION_TEXT_UNDO wxT("undo") +#define wxACTION_TEXT_REDO wxT("redo") // ---------------------------------------------------------------------------- // wxTextCtrl @@ -408,7 +408,7 @@ protected: wxCoord GetLineHeight() const { // this one should be already precalculated - wxASSERT_MSG( m_heightLine != -1, _T("should have line height") ); + wxASSERT_MSG( m_heightLine != -1, wxT("should have line height") ); return m_heightLine; } diff --git a/include/wx/univ/toolbar.h b/include/wx/univ/toolbar.h index 2c736c1c8c..4827311177 100644 --- a/include/wx/univ/toolbar.h +++ b/include/wx/univ/toolbar.h @@ -24,8 +24,8 @@ class WXDLLIMPEXP_FWD_CORE wxToolBarTool; #define wxACTION_TOOLBAR_PRESS wxACTION_BUTTON_PRESS #define wxACTION_TOOLBAR_RELEASE wxACTION_BUTTON_RELEASE #define wxACTION_TOOLBAR_CLICK wxACTION_BUTTON_CLICK -#define wxACTION_TOOLBAR_ENTER _T("enter") // highlight the tool -#define wxACTION_TOOLBAR_LEAVE _T("leave") // unhighlight the tool +#define wxACTION_TOOLBAR_ENTER wxT("enter") // highlight the tool +#define wxACTION_TOOLBAR_LEAVE wxT("leave") // unhighlight the tool // ---------------------------------------------------------------------------- // wxToolBar diff --git a/include/wx/univ/toplevel.h b/include/wx/univ/toplevel.h index d72d9ac85a..242a46dc38 100644 --- a/include/wx/univ/toplevel.h +++ b/include/wx/univ/toplevel.h @@ -77,12 +77,12 @@ enum // the actions supported by this control // ---------------------------------------------------------------------------- -#define wxACTION_TOPLEVEL_ACTIVATE _T("activate") // (de)activate the frame -#define wxACTION_TOPLEVEL_BUTTON_PRESS _T("pressbtn") // press titlebar btn -#define wxACTION_TOPLEVEL_BUTTON_RELEASE _T("releasebtn") // press titlebar btn -#define wxACTION_TOPLEVEL_BUTTON_CLICK _T("clickbtn") // press titlebar btn -#define wxACTION_TOPLEVEL_MOVE _T("move") // move the frame -#define wxACTION_TOPLEVEL_RESIZE _T("resize") // resize the frame +#define wxACTION_TOPLEVEL_ACTIVATE wxT("activate") // (de)activate the frame +#define wxACTION_TOPLEVEL_BUTTON_PRESS wxT("pressbtn") // press titlebar btn +#define wxACTION_TOPLEVEL_BUTTON_RELEASE wxT("releasebtn") // press titlebar btn +#define wxACTION_TOPLEVEL_BUTTON_CLICK wxT("clickbtn") // press titlebar btn +#define wxACTION_TOPLEVEL_MOVE wxT("move") // move the frame +#define wxACTION_TOPLEVEL_RESIZE wxT("resize") // resize the frame //----------------------------------------------------------------------------- // wxTopLevelWindow diff --git a/include/wx/unix/private/timer.h b/include/wx/unix/private/timer.h index 630676cb37..d879f3640d 100644 --- a/include/wx/unix/private/timer.h +++ b/include/wx/unix/private/timer.h @@ -39,7 +39,7 @@ public: // timer is running void MarkStopped() { - wxASSERT_MSG( m_isRunning, _T("stopping non-running timer?") ); + wxASSERT_MSG( m_isRunning, wxT("stopping non-running timer?") ); m_isRunning = false; } diff --git a/include/wx/version.h b/include/wx/version.h index b0c4f60f0a..3ca52626b9 100644 --- a/include/wx/version.h +++ b/include/wx/version.h @@ -30,7 +30,7 @@ #define wxMINOR_VERSION 9 #define wxRELEASE_NUMBER 1 #define wxSUBRELEASE_NUMBER 0 -#define wxVERSION_STRING _T("wxWidgets 2.9.1") +#define wxVERSION_STRING wxT("wxWidgets 2.9.1") /* nothing to update below this line when updating the version */ /* ---------------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ #define wxMAKE_VERSION_STRING_T(x, y, z) \ wxSTRINGIZE_T(x) wxSTRINGIZE_T(y) wxSTRINGIZE_T(z) #define wxMAKE_VERSION_DOT_STRING_T(x, y, z) \ - wxSTRINGIZE_T(x) _T(".") wxSTRINGIZE_T(y) _T(".") wxSTRINGIZE_T(z) + wxSTRINGIZE_T(x) wxT(".") wxSTRINGIZE_T(y) wxT(".") wxSTRINGIZE_T(z) /* these are used by src/msw/version.rc and should always be ASCII, not Unicode */ #define wxVERSION_NUM_STRING \ diff --git a/include/wx/vlbox.h b/include/wx/vlbox.h index 9556033827..96ab2bde6f 100644 --- a/include/wx/vlbox.h +++ b/include/wx/vlbox.h @@ -85,7 +85,7 @@ public: int GetSelection() const { wxASSERT_MSG( !HasMultipleSelection(), - _T("GetSelection() can't be used with wxLB_MULTIPLE") ); + wxT("GetSelection() can't be used with wxLB_MULTIPLE") ); return m_current; } diff --git a/include/wx/wxcrtbase.h b/include/wx/wxcrtbase.h index bf28f4cade..5f665b878e 100644 --- a/include/wx/wxcrtbase.h +++ b/include/wx/wxcrtbase.h @@ -72,7 +72,7 @@ #ifdef _WIN32_WCE #if _WIN32_WCE <= 211 - #define isspace(c) ((c) == _T(' ') || (c) == _T('\t')) + #define isspace(c) ((c) == wxT(' ') || (c) == wxT('\t')) #endif #endif /* _WIN32_WCE */ diff --git a/include/wx/x11/textctrl.h b/include/wx/x11/textctrl.h index b076e0ec72..81a7e70662 100644 --- a/include/wx/x11/textctrl.h +++ b/include/wx/x11/textctrl.h @@ -317,43 +317,43 @@ private: //----------------------------------------------------------------------------- // cursor movement and also selection and delete operations -#define wxACTION_TEXT_GOTO _T("goto") // to pos in numArg -#define wxACTION_TEXT_FIRST _T("first") // go to pos 0 -#define wxACTION_TEXT_LAST _T("last") // go to last pos -#define wxACTION_TEXT_HOME _T("home") -#define wxACTION_TEXT_END _T("end") -#define wxACTION_TEXT_LEFT _T("left") -#define wxACTION_TEXT_RIGHT _T("right") -#define wxACTION_TEXT_UP _T("up") -#define wxACTION_TEXT_DOWN _T("down") -#define wxACTION_TEXT_WORD_LEFT _T("wordleft") -#define wxACTION_TEXT_WORD_RIGHT _T("wordright") -#define wxACTION_TEXT_PAGE_UP _T("pageup") -#define wxACTION_TEXT_PAGE_DOWN _T("pagedown") +#define wxACTION_TEXT_GOTO wxT("goto") // to pos in numArg +#define wxACTION_TEXT_FIRST wxT("first") // go to pos 0 +#define wxACTION_TEXT_LAST wxT("last") // go to last pos +#define wxACTION_TEXT_HOME wxT("home") +#define wxACTION_TEXT_END wxT("end") +#define wxACTION_TEXT_LEFT wxT("left") +#define wxACTION_TEXT_RIGHT wxT("right") +#define wxACTION_TEXT_UP wxT("up") +#define wxACTION_TEXT_DOWN wxT("down") +#define wxACTION_TEXT_WORD_LEFT wxT("wordleft") +#define wxACTION_TEXT_WORD_RIGHT wxT("wordright") +#define wxACTION_TEXT_PAGE_UP wxT("pageup") +#define wxACTION_TEXT_PAGE_DOWN wxT("pagedown") // clipboard operations -#define wxACTION_TEXT_COPY _T("copy") -#define wxACTION_TEXT_CUT _T("cut") -#define wxACTION_TEXT_PASTE _T("paste") +#define wxACTION_TEXT_COPY wxT("copy") +#define wxACTION_TEXT_CUT wxT("cut") +#define wxACTION_TEXT_PASTE wxT("paste") // insert text at the cursor position: the text is in strArg of PerformAction -#define wxACTION_TEXT_INSERT _T("insert") +#define wxACTION_TEXT_INSERT wxT("insert") // if the action starts with either of these prefixes and the rest of the // string is one of the movement commands, it means to select/delete text from // the current cursor position to the new one -#define wxACTION_TEXT_PREFIX_SEL _T("sel") -#define wxACTION_TEXT_PREFIX_DEL _T("del") +#define wxACTION_TEXT_PREFIX_SEL wxT("sel") +#define wxACTION_TEXT_PREFIX_DEL wxT("del") // mouse selection -#define wxACTION_TEXT_ANCHOR_SEL _T("anchorsel") -#define wxACTION_TEXT_EXTEND_SEL _T("extendsel") -#define wxACTION_TEXT_SEL_WORD _T("wordsel") -#define wxACTION_TEXT_SEL_LINE _T("linesel") +#define wxACTION_TEXT_ANCHOR_SEL wxT("anchorsel") +#define wxACTION_TEXT_EXTEND_SEL wxT("extendsel") +#define wxACTION_TEXT_SEL_WORD wxT("wordsel") +#define wxACTION_TEXT_SEL_LINE wxT("linesel") // undo or redo -#define wxACTION_TEXT_UNDO _T("undo") -#define wxACTION_TEXT_REDO _T("redo") +#define wxACTION_TEXT_UNDO wxT("undo") +#define wxACTION_TEXT_REDO wxT("redo") // ---------------------------------------------------------------------------- // wxTextCtrl types diff --git a/include/wx/xrc/xmlres.h b/include/wx/xrc/xmlres.h index 26c54f4f25..97c1732d89 100644 --- a/include/wx/xrc/xmlres.h +++ b/include/wx/xrc/xmlres.h @@ -65,7 +65,7 @@ class wxXmlResourceDataRecords; #define WX_XMLRES_CURRENT_VERSION_MINOR 5 #define WX_XMLRES_CURRENT_VERSION_RELEASE 3 #define WX_XMLRES_CURRENT_VERSION_REVISION 0 -#define WX_XMLRES_CURRENT_VERSION_STRING _T("2.5.3.0") +#define WX_XMLRES_CURRENT_VERSION_STRING wxT("2.5.3.0") #define WX_XMLRES_CURRENT_VERSION \ (WX_XMLRES_CURRENT_VERSION_MAJOR * 256*256*256 + \ diff --git a/include/wx/xti.h b/include/wx/xti.h index ad53a5d129..c5b650f2b6 100644 --- a/include/wx/xti.h +++ b/include/wx/xti.h @@ -422,11 +422,11 @@ public : // convert a wxxVariant holding data of this type into a string void ConvertToString( const wxxVariant& data , wxString &result ) const - { if ( m_toString ) (*m_toString)( data , result ) ; else wxLogError( wxGetTranslation(_T("String conversions not supported")) ) ; } + { if ( m_toString ) (*m_toString)( data , result ) ; else wxLogError( wxGetTranslation(wxT("String conversions not supported")) ) ; } // convert a string into a wxxVariant holding the corresponding data in this type void ConvertFromString( const wxString& data , wxxVariant &result ) const - { if( m_fromString ) (*m_fromString)( data , result ) ; else wxLogError( wxGetTranslation(_T("String conversions not supported")) ) ; } + { if( m_fromString ) (*m_fromString)( data , result ) ; else wxLogError( wxGetTranslation(wxT("String conversions not supported")) ) ; } #if wxUSE_UNICODE static wxTypeInfo *FindType(const char *typeName) { return FindType( wxString::FromAscii(typeName) ) ; } @@ -503,11 +503,11 @@ public : // convert a wxxVariant holding data of this type into a long void ConvertToLong( const wxxVariant& data , long &result ) const - { if( m_toLong ) (*m_toLong)( data , result ) ; else wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ) ; } + { if( m_toLong ) (*m_toLong)( data , result ) ; else wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) ) ; } // convert a long into a wxxVariant holding the corresponding data in this type void ConvertFromLong( long data , wxxVariant &result ) const - { if( m_fromLong ) (*m_fromLong)( data , result ) ; else wxLogError( wxGetTranslation(_T("Long Conversions not supported")) ) ;} + { if( m_fromLong ) (*m_fromLong)( data , result ) ; else wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) ) ;} private : converterToLong_t m_toLong ; @@ -843,19 +843,19 @@ public : // Setting a simple property (non-collection) virtual void SetProperty(wxObject *object, const wxxVariant &value) const - { if ( m_setter ) m_setter->Set( object , value ) ; else wxLogError( wxGetTranslation(_T("SetProperty called w/o valid setter")) ) ;} + { if ( m_setter ) m_setter->Set( object , value ) ; else wxLogError( wxGetTranslation(wxT("SetProperty called w/o valid setter")) ) ;} // Getting a simple property (non-collection) virtual void GetProperty(const wxObject *object, wxxVariant &result) const - { if ( m_getter ) m_getter->Get( object , result ) ; else wxLogError( wxGetTranslation(_T("GetProperty called w/o valid getter")) ) ;} + { if ( m_getter ) m_getter->Get( object , result ) ; else wxLogError( wxGetTranslation(wxT("GetProperty called w/o valid getter")) ) ;} // Adding an element to a collection property virtual void AddToPropertyCollection(wxObject *object, const wxxVariant &value) const - { if ( m_adder ) m_adder->Add( object , value ) ; else wxLogError( wxGetTranslation(_T("AddToPropertyCollection called w/o valid adder")) ) ;} + { if ( m_adder ) m_adder->Add( object , value ) ; else wxLogError( wxGetTranslation(wxT("AddToPropertyCollection called w/o valid adder")) ) ;} // Getting a collection property virtual void GetPropertyCollection( const wxObject *obj, wxxVariantArray &result) const - { if ( m_collectionGetter ) m_collectionGetter->Get( obj , result) ; else wxLogError( wxGetTranslation(_T("GetPropertyCollection called w/o valid collection getter")) ) ;} + { if ( m_collectionGetter ) m_collectionGetter->Get( obj , result) ; else wxLogError( wxGetTranslation(wxT("GetPropertyCollection called w/o valid collection getter")) ) ;} virtual bool HasSetter() const { return m_setter != NULL ; } virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL ; } @@ -904,11 +904,11 @@ public : // Adding an element to a collection property virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), const wxxVariant &WXUNUSED(value)) const - { wxLogError( wxGetTranslation(_T("AddToPropertyCollection called on a generic accessor")) ) ;} + { wxLogError( wxGetTranslation(wxT("AddToPropertyCollection called on a generic accessor")) ) ;} // Getting a collection property virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), wxxVariantArray &WXUNUSED(result)) const - { wxLogError ( wxGetTranslation(_T("GetPropertyCollection called on a generic accessor")) ) ;} + { wxLogError ( wxGetTranslation(wxT("GetPropertyCollection called on a generic accessor")) ) ;} private : struct wxGenericPropertyAccessorInternal ; wxGenericPropertyAccessorInternal* m_data ; @@ -1676,7 +1676,7 @@ public: { if ( ParamCount != m_constructorPropertiesCount ) { - wxLogError( wxGetTranslation(_T("Illegal Parameter Count for ConstructObject Method")) ) ; + wxLogError( wxGetTranslation(wxT("Illegal Parameter Count for ConstructObject Method")) ) ; return NULL ; } wxObject *object = NULL ; @@ -1746,7 +1746,7 @@ public: { if ( ParamCount != m_constructorPropertiesCount ) { - wxLogError( wxGetTranslation(_T("Illegal Parameter Count for Create Method")) ) ; + wxLogError( wxGetTranslation(wxT("Illegal Parameter Count for Create Method")) ) ; return ; } m_constructor->Create( object , Params ) ; diff --git a/interface/wx/aboutdlg.h b/interface/wx/aboutdlg.h index 9d19a3f2fe..44cd0df753 100644 --- a/interface/wx/aboutdlg.h +++ b/interface/wx/aboutdlg.h @@ -189,7 +189,7 @@ public: info.SetName(_("My Program")); info.SetVersion(_("1.2.3 Beta")); info.SetDescription(_("This program does something great.")); - info.SetCopyright(_T("(C) 2007 Me ")); + info.SetCopyright(wxT("(C) 2007 Me ")); wxAboutBox(info); } diff --git a/interface/wx/archive.h b/interface/wx/archive.h index 1bb6579bfe..646aa8ce4a 100644 --- a/interface/wx/archive.h +++ b/interface/wx/archive.h @@ -384,7 +384,7 @@ public: const wxArchiveClassFactory *factory = wxArchiveClassFactory::GetFirst(); while (factory) { - list << factory->GetProtocol() << _T("\n"); + list << factory->GetProtocol() << wxT("\n"); factory = factory->GetNext(); } @endcode @@ -421,7 +421,7 @@ public: const wxChar *const *p; for (p = factory->GetProtocols(wxSTREAM_FILEEXT); *p; p++) - list << *p << _T("\n"); + list << *p << wxT("\n"); @endcode */ virtual const wxChar** GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const = 0; diff --git a/interface/wx/chartype.h b/interface/wx/chartype.h index 59c51e8232..ff550ef8be 100644 --- a/interface/wx/chartype.h +++ b/interface/wx/chartype.h @@ -60,7 +60,10 @@ Don't confuse this macro with _()! - Note that since wxWidgets 2.9.0 the use of _T() is discouraged just like for wxT(). + Note that since wxWidgets 2.9.0 the use of _T() is discouraged just like + for wxT() and also that this macro may conflict with identifiers defined in + standard headers of some compilers (such as Sun CC) so its use should + really be avoided. @header{wx/chartype.h} */ diff --git a/interface/wx/generic/spinctrg.h b/interface/wx/generic/spinctrg.h index bccf568a54..a18f12287a 100644 --- a/interface/wx/generic/spinctrg.h +++ b/interface/wx/generic/spinctrg.h @@ -70,7 +70,7 @@ public: long style = wxSP_ARROW_KEYS, double min = 0, double max = 100, double initial = 0, double inc = 1, - const wxString& name = _T("wxSpinCtrlDouble")); + const wxString& name = wxT("wxSpinCtrlDouble")); /** Creation function called by the spin control constructor. diff --git a/interface/wx/html/helpwnd.h b/interface/wx/html/helpwnd.h index 1b0b0c7991..49e3faaa2d 100644 --- a/interface/wx/html/helpwnd.h +++ b/interface/wx/html/helpwnd.h @@ -23,7 +23,7 @@ m_embeddedHtmlHelp.SetHelpWindow(m_embeddedHelpWindow); m_embeddedHelpWindow->Create(this, wxID_ANY, wxDefaultPosition, GetClientSize(), wxTAB_TRAVERSAL|wxBORDER_NONE, wxHF_DEFAULT_STYLE); - m_embeddedHtmlHelp.AddBook(wxFileName(_T("doc.zip"))); + m_embeddedHtmlHelp.AddBook(wxFileName(wxT("doc.zip"))); @endcode You should pass the style wxHF_EMBEDDED to the style parameter of diff --git a/interface/wx/stream.h b/interface/wx/stream.h index 51db34912d..104af9a968 100644 --- a/interface/wx/stream.h +++ b/interface/wx/stream.h @@ -836,7 +836,7 @@ public: const wxFilterClassFactory *factory = wxFilterClassFactory::GetFirst(); while (factory) { - list << factory->GetProtocol() << _T("\n"); + list << factory->GetProtocol() << wxT("\n"); factory = factory->GetNext(); } @endcode @@ -866,7 +866,7 @@ public: const wxChar *const *p; for (p = factory->GetProtocols(wxSTREAM_FILEEXT); *p; p++) - list << *p << _T("\n"); + list << *p << wxT("\n"); @endcode */ virtual const wxChar * const* GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const = 0; diff --git a/samples/access/accesstest.cpp b/samples/access/accesstest.cpp index 3b0938b983..47653bdabd 100644 --- a/samples/access/accesstest.cpp +++ b/samples/access/accesstest.cpp @@ -175,7 +175,7 @@ bool MyApp::OnInit() wxHelpProvider::Set(new wxSimpleHelpProvider()); // create the main application window - MyFrame *frame = new MyFrame(_T("AccessTest wxWidgets App"), + MyFrame *frame = new MyFrame(wxT("AccessTest wxWidgets App"), wxPoint(50, 50), wxSize(450, 340)); // and show it (the frames, unlike simple controls, are not shown when @@ -187,7 +187,7 @@ bool MyApp::OnInit() // application would exit immediately. return true; #else - wxMessageBox( _T("This sample has to be compiled with wxUSE_ACCESSIBILITY"), _T("Building error"), wxOK); + wxMessageBox( wxT("This sample has to be compiled with wxUSE_ACCESSIBILITY"), wxT("Building error"), wxOK); return false; #endif // wxUSE_ACCESSIBILITY } @@ -337,16 +337,16 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(AccessTest_About, _T("&About..."), _T("Show about dialog")); + helpMenu->Append(AccessTest_About, wxT("&About..."), wxT("Show about dialog")); - menuFile->Append(AccessTest_Query, _T("Query"), _T("Query the window hierarchy")); + menuFile->Append(AccessTest_Query, wxT("Query"), wxT("Query the window hierarchy")); menuFile->AppendSeparator(); - menuFile->Append(AccessTest_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(AccessTest_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -355,7 +355,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, #if 0 // wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR @@ -395,10 +395,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the About dialog of the AccessTest sample.\n") - _T("Welcome to %s"), wxVERSION_STRING); + msg.Printf( wxT("This is the About dialog of the AccessTest sample.\n") + wxT("Welcome to %s"), wxVERSION_STRING); - wxMessageBox(msg, _T("About AccessTest"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, wxT("About AccessTest"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnQuery(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/animate/anitest.cpp b/samples/animate/anitest.cpp index 52748aa693..d2f5bef31a 100644 --- a/samples/animate/anitest.cpp +++ b/samples/animate/anitest.cpp @@ -97,7 +97,7 @@ bool MyApp::OnInit() // Create the main frame window - MyFrame* frame = new MyFrame((wxFrame *)NULL, wxID_ANY, _T("Animation Demo"), + MyFrame* frame = new MyFrame((wxFrame *)NULL, wxID_ANY, wxT("Animation Demo"), wxDefaultPosition, wxSize(500, 400), wxDEFAULT_FRAME_STYLE); frame->Show(true); @@ -127,31 +127,31 @@ MyFrame::MyFrame(wxWindow *parent, wxMenu *file_menu = new wxMenu; #if wxUSE_FILEDLG - file_menu->Append(wxID_OPEN, _T("&Open Animation...\tCtrl+O"), _T("Loads an animation")); + file_menu->Append(wxID_OPEN, wxT("&Open Animation...\tCtrl+O"), wxT("Loads an animation")); #endif // wxUSE_FILEDLG file_menu->Append(wxID_EXIT); wxMenu *play_menu = new wxMenu; - play_menu->Append(ID_PLAY, _T("Play\tCtrl+P"), _T("Play the animation")); - play_menu->Append(wxID_STOP, _T("Stop\tCtrl+P"), _T("Stop the animation")); + play_menu->Append(ID_PLAY, wxT("Play\tCtrl+P"), wxT("Play the animation")); + play_menu->Append(wxID_STOP, wxT("Stop\tCtrl+P"), wxT("Stop the animation")); play_menu->AppendSeparator(); - play_menu->Append(ID_SET_NULL_ANIMATION, _T("Set null animation"), - _T("Sets the empty animation in the control")); - play_menu->AppendCheckItem(ID_SET_INACTIVE_BITMAP, _T("Set inactive bitmap"), - _T("Sets an inactive bitmap for the control")); - play_menu->AppendCheckItem(ID_SET_NO_AUTO_RESIZE, _T("Set no autoresize"), - _T("Tells the control not to resize automatically")); - play_menu->Append(ID_SET_BGCOLOR, _T("Set background colour..."), - _T("Sets the background colour of the control")); + play_menu->Append(ID_SET_NULL_ANIMATION, wxT("Set null animation"), + wxT("Sets the empty animation in the control")); + play_menu->AppendCheckItem(ID_SET_INACTIVE_BITMAP, wxT("Set inactive bitmap"), + wxT("Sets an inactive bitmap for the control")); + play_menu->AppendCheckItem(ID_SET_NO_AUTO_RESIZE, wxT("Set no autoresize"), + wxT("Tells the control not to resize automatically")); + play_menu->Append(ID_SET_BGCOLOR, wxT("Set background colour..."), + wxT("Sets the background colour of the control")); wxMenu *help_menu = new wxMenu; help_menu->Append(wxID_ABOUT); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); - menu_bar->Append(play_menu, _T("&Animation")); - menu_bar->Append(help_menu, _T("&Help")); + menu_bar->Append(file_menu, wxT("&File")); + menu_bar->Append(play_menu, wxT("&Animation")); + menu_bar->Append(help_menu, wxT("&Help")); // Associate the menu bar with this frame SetMenuBar(menu_bar); @@ -258,11 +258,11 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) wxAboutDialogInfo info; info.SetName(_("wxAnimationCtrl and wxAnimation sample")); info.SetDescription(_("This sample program demonstrates the usage of wxAnimationCtrl")); - info.SetCopyright(_T("(C) 2006 Julian Smart")); + info.SetCopyright(wxT("(C) 2006 Julian Smart")); - info.AddDeveloper(_T("Julian Smart")); - info.AddDeveloper(_T("Guillermo Rodriguez Garcia")); - info.AddDeveloper(_T("Francesco Montorsi")); + info.AddDeveloper(wxT("Julian Smart")); + info.AddDeveloper(wxT("Guillermo Rodriguez Garcia")); + info.AddDeveloper(wxT("Francesco Montorsi")); wxAboutBox(info); } @@ -270,7 +270,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) #if wxUSE_FILEDLG void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) { - wxFileDialog dialog(this, _T("Please choose an animation"), + wxFileDialog dialog(this, wxT("Please choose an animation"), wxEmptyString, wxEmptyString, wxT("*.gif;*.ani"), wxFD_OPEN); if (dialog.ShowModal() == wxID_OK) { @@ -281,7 +281,7 @@ void MyFrame::OnOpen(wxCommandEvent& WXUNUSED(event)) if (m_animationCtrl->LoadFile(filename)) m_animationCtrl->Play(); else - wxMessageBox(_T("Sorry, this animation is not a valid format for wxAnimation.")); + wxMessageBox(wxT("Sorry, this animation is not a valid format for wxAnimation.")); #else #if 0 wxAnimation temp; diff --git a/samples/artprov/artbrows.cpp b/samples/artprov/artbrows.cpp index 599c36c9c3..2d4915d5a4 100644 --- a/samples/artprov/artbrows.cpp +++ b/samples/artprov/artbrows.cpp @@ -29,7 +29,7 @@ #include "artbrows.h" #define ART_CLIENT(id) \ - choice->Append(_T(#id), (void*)id); + choice->Append(wxT(#id), (void*)id); #define ART_ICON(id) \ { \ int ind; \ @@ -38,7 +38,7 @@ ind = images->Add(icon); \ else \ ind = 0; \ - list->InsertItem(index, _T(#id), ind); \ + list->InsertItem(index, wxT(#id), ind); \ list->SetItemData(index, (long)id); \ index++; \ } @@ -125,7 +125,7 @@ BEGIN_EVENT_TABLE(wxArtBrowserDialog, wxDialog) END_EVENT_TABLE() wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent) - : wxDialog(parent, wxID_ANY, _T("Art resources browser"), + : wxDialog(parent, wxID_ANY, wxT("Art resources browser"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) { @@ -136,7 +136,7 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent) FillClients(choice); subsizer = new wxBoxSizer(wxHORIZONTAL); - subsizer->Add(new wxStaticText(this, wxID_ANY, _T("Client:")), 0, wxALIGN_CENTER_VERTICAL); + subsizer->Add(new wxStaticText(this, wxID_ANY, wxT("Client:")), 0, wxALIGN_CENTER_VERTICAL); subsizer->Add(choice, 1, wxLEFT, 5); sizer->Add(subsizer, 0, wxALL | wxEXPAND, 10); @@ -144,7 +144,7 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent) m_list = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(250, 300), wxLC_REPORT | wxSUNKEN_BORDER); - m_list->InsertColumn(0, _T("wxArtID")); + m_list->InsertColumn(0, wxT("wxArtID")); subsizer->Add(m_list, 1, wxEXPAND | wxRIGHT, 10); wxSizer *subsub = new wxBoxSizer(wxVERTICAL); @@ -158,7 +158,7 @@ wxArtBrowserDialog::wxArtBrowserDialog(wxWindow *parent) sizer->Add(subsizer, 1, wxEXPAND | wxLEFT|wxRIGHT, 10); - wxButton *ok = new wxButton(this, wxID_OK, _T("Close")); + wxButton *ok = new wxButton(this, wxID_OK, wxT("Close")); ok->SetDefault(); sizer->Add(ok, 0, wxALIGN_RIGHT | wxALL, 10); diff --git a/samples/artprov/arttest.cpp b/samples/artprov/arttest.cpp index 45c5d1f45f..464bf3a27d 100644 --- a/samples/artprov/arttest.cpp +++ b/samples/artprov/arttest.cpp @@ -100,7 +100,7 @@ bool MyApp::OnInit() return false; // create the main application window - MyFrame *frame = new MyFrame(_T("wxArtProvider sample"), + MyFrame *frame = new MyFrame(wxT("wxArtProvider sample"), wxPoint(50, 50), wxSize(450, 340)); frame->Show(true); return true; @@ -157,23 +157,23 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"), wxT("Show about dialog")); - menuFile->AppendCheckItem(ID_PlugProvider, _T("&Plug-in art provider"), _T("Enable custom art provider")); + menuFile->AppendCheckItem(ID_PlugProvider, wxT("&Plug-in art provider"), wxT("Enable custom art provider")); menuFile->AppendSeparator(); #if wxUSE_LOG - menuFile->Append(ID_Logs, _T("&Logging test"), _T("Show some logging output")); + menuFile->Append(ID_Logs, wxT("&Logging test"), wxT("Show some logging output")); #endif // wxUSE_LOG - menuFile->Append(ID_Browser, _T("&Resources browser"), _T("Browse all available icons")); + menuFile->Append(ID_Browser, wxT("&Resources browser"), wxT("Browse all available icons")); menuFile->AppendSeparator(); - menuFile->Append(ID_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(ID_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -191,22 +191,22 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) #if wxUSE_LOG void MyFrame::OnLogs(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Some information.")); - wxLogError(_T("This is an error.")); - wxLogWarning(_T("A warning.")); - wxLogError(_T("Yet another error.")); + wxLogMessage(wxT("Some information.")); + wxLogError(wxT("This is an error.")); + wxLogWarning(wxT("A warning.")); + wxLogError(wxT("Yet another error.")); wxLog::GetActiveTarget()->Flush(); - wxLogMessage(_T("Check/uncheck 'File/Plug-in art provider' and try again.")); + wxLogMessage(wxT("Check/uncheck 'File/Plug-in art provider' and try again.")); } #endif // wxUSE_LOG void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the about dialog of wxArtProvider sample.\n") - _T("Welcome to %s"), wxVERSION_STRING); + msg.Printf( wxT("This is the about dialog of wxArtProvider sample.\n") + wxT("Welcome to %s"), wxVERSION_STRING); - wxMessageBox(msg, _T("About wxArtProvider sample"), + wxMessageBox(msg, wxT("About wxArtProvider sample"), wxOK | wxICON_INFORMATION, this); } diff --git a/samples/calendar/calendar.cpp b/samples/calendar/calendar.cpp index 47d7dbae30..2215b95d66 100644 --- a/samples/calendar/calendar.cpp +++ b/samples/calendar/calendar.cpp @@ -319,7 +319,7 @@ bool MyApp::OnInit() return false; // Create the main application window - MyFrame *frame = new MyFrame(_T("Calendar wxWidgets sample") + MyFrame *frame = new MyFrame(wxT("Calendar wxWidgets sample") #ifndef __WXWINCE__ ,wxPoint(50, 50), wxSize(450, 340) #endif @@ -346,11 +346,11 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->Append(Calendar_File_About, _T("&About...\tCtrl-A"), _T("Show about dialog")); + menuFile->Append(Calendar_File_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog")); menuFile->AppendSeparator(); - menuFile->Append(Calendar_File_ClearLog, _T("&Clear log\tCtrl-L")); + menuFile->Append(Calendar_File_ClearLog, wxT("&Clear log\tCtrl-L")); menuFile->AppendSeparator(); - menuFile->Append(Calendar_File_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Calendar_File_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenu *menuCal = new wxMenu; #ifdef wxHAS_NATIVE_CALENDARCTRL @@ -359,62 +359,62 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) menuCal->AppendSeparator(); #endif // wxHAS_NATIVE_CALENDARCTRL menuCal->Append(Calendar_Cal_Monday, - _T("Monday &first weekday\tCtrl-F"), - _T("Toggle between Mon and Sun as the first week day"), + wxT("Monday &first weekday\tCtrl-F"), + wxT("Toggle between Mon and Sun as the first week day"), true); - menuCal->Append(Calendar_Cal_Holidays, _T("Show &holidays\tCtrl-H"), - _T("Toggle highlighting the holidays"), + menuCal->Append(Calendar_Cal_Holidays, wxT("Show &holidays\tCtrl-H"), + wxT("Toggle highlighting the holidays"), true); - menuCal->Append(Calendar_Cal_Special, _T("Highlight &special dates\tCtrl-S"), - _T("Test custom highlighting"), + menuCal->Append(Calendar_Cal_Special, wxT("Highlight &special dates\tCtrl-S"), + wxT("Test custom highlighting"), true); menuCal->Append(Calendar_Cal_SurroundWeeks, - _T("Show s&urrounding weeks\tCtrl-W"), - _T("Show the neighbouring weeks in the prev/next month"), + wxT("Show s&urrounding weeks\tCtrl-W"), + wxT("Show the neighbouring weeks in the prev/next month"), true); menuCal->Append(Calendar_Cal_WeekNumbers, - _T("Show &week numbers"), - _T("Toggle week numbers"), + wxT("Show &week numbers"), + wxT("Toggle week numbers"), true); menuCal->AppendSeparator(); menuCal->Append(Calendar_Cal_SeqMonth, - _T("Toggle month selector st&yle\tCtrl-Y"), - _T("Use another style for the calendar controls"), + wxT("Toggle month selector st&yle\tCtrl-Y"), + wxT("Use another style for the calendar controls"), true); - menuCal->Append(Calendar_Cal_Month, _T("&Month can be changed\tCtrl-M"), - _T("Allow changing the month in the calendar"), + menuCal->Append(Calendar_Cal_Month, wxT("&Month can be changed\tCtrl-M"), + wxT("Allow changing the month in the calendar"), true); menuCal->AppendSeparator(); - menuCal->Append(Calendar_Cal_SetDate, _T("Call &SetDate(2005-12-24)"), _T("Set date to 2005-12-24.")); - menuCal->Append(Calendar_Cal_Today, _T("Call &Today()"), _T("Set to the current date.")); + menuCal->Append(Calendar_Cal_SetDate, wxT("Call &SetDate(2005-12-24)"), wxT("Set date to 2005-12-24.")); + menuCal->Append(Calendar_Cal_Today, wxT("Call &Today()"), wxT("Set to the current date.")); menuCal->Append(Calendar_Cal_BeginDST, "Call SetDate(GetBeginDST())"); menuCal->AppendSeparator(); - menuCal->AppendCheckItem(Calendar_Cal_Resizable, _T("Make &resizable\tCtrl-R")); + menuCal->AppendCheckItem(Calendar_Cal_Resizable, wxT("Make &resizable\tCtrl-R")); #if wxUSE_DATEPICKCTRL wxMenu *menuDate = new wxMenu; menuDate->AppendCheckItem(Calendar_DatePicker_ShowCentury, - _T("Al&ways show century")); + wxT("Al&ways show century")); menuDate->AppendCheckItem(Calendar_DatePicker_DropDown, - _T("Use &drop down control")); + wxT("Use &drop down control")); menuDate->AppendCheckItem(Calendar_DatePicker_AllowNone, - _T("Allow &no date")); + wxT("Allow &no date")); menuDate->AppendCheckItem(Calendar_DatePicker_StartWithNone, - _T("Start &with no date")); + wxT("Start &with no date")); #if wxUSE_DATEPICKCTRL_GENERIC menuDate->AppendCheckItem(Calendar_DatePicker_Generic, - _T("Use &generic version of the control")); + wxT("Use &generic version of the control")); #endif // wxUSE_DATEPICKCTRL_GENERIC menuDate->AppendSeparator(); - menuDate->Append(Calendar_DatePicker_AskDate, _T("&Choose date...\tCtrl-D"), _T("Show dialog with wxDatePickerCtrl")); + menuDate->Append(Calendar_DatePicker_AskDate, wxT("&Choose date...\tCtrl-D"), wxT("Show dialog with wxDatePickerCtrl")); #endif // wxUSE_DATEPICKCTRL // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(menuCal, _T("&Calendar")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(menuCal, wxT("&Calendar")); #if wxUSE_DATEPICKCTRL - menuBar->Append(menuDate, _T("&Date picker")); + menuBar->Append(menuDate, wxT("&Date picker")); #endif // wxUSE_DATEPICKCTRL menuBar->Check(Calendar_Cal_Monday, true); @@ -448,8 +448,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("wxCalendarCtrl sample\n(c) 2000--2008 Vadim Zeitlin"), - _T("About Calendar"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(wxT("wxCalendarCtrl sample\n(c) 2000--2008 Vadim Zeitlin"), + wxT("About Calendar"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnClearLog(wxCommandEvent& WXUNUSED(event)) @@ -604,16 +604,16 @@ void MyFrame::OnAskDate(wxCommandEvent& WXUNUSED(event)) if ( dt.GetDay() == today.GetDay() && dt.GetMonth() == today.GetMonth() ) { - wxMessageBox(_T("Happy birthday!"), _T("Calendar Sample")); + wxMessageBox(wxT("Happy birthday!"), wxT("Calendar Sample")); } m_panel->SetDate(dt); - wxLogStatus(_T("Changed the date to your input")); + wxLogStatus(wxT("Changed the date to your input")); } else { - wxLogStatus(_T("No date entered")); + wxLogStatus(wxT("No date entered")); } } } @@ -781,7 +781,7 @@ void MyPanel::HighlightSpecial(bool on) #if wxUSE_DATEPICKCTRL MyDialog::MyDialog(wxWindow *parent, const wxDateTime& dt, int dtpStyle) - : wxDialog(parent, wxID_ANY, wxString(_T("Calendar: Choose a date"))) + : wxDialog(parent, wxID_ANY, wxString(wxT("Calendar: Choose a date"))) { wxStdDialogButtonSizer *sizerBtns = new wxStdDialogButtonSizer; sizerBtns->AddButton(new wxButton(this, wxID_OK)); @@ -789,7 +789,7 @@ MyDialog::MyDialog(wxWindow *parent, const wxDateTime& dt, int dtpStyle) sizerBtns->Realize(); wxSizer *sizerText = new wxBoxSizer(wxHORIZONTAL); - sizerText->Add(new wxStaticText(this, wxID_ANY, _T("Date in ISO format: ")), + sizerText->Add(new wxStaticText(this, wxID_ANY, wxT("Date in ISO format: ")), wxSizerFlags().Border().Align(wxALIGN_CENTRE_VERTICAL)); m_text = new wxTextCtrl(this, wxID_ANY); sizerText->Add(m_text, wxSizerFlags(). @@ -799,7 +799,7 @@ MyDialog::MyDialog(wxWindow *parent, const wxDateTime& dt, int dtpStyle) sizerTop->Add(new wxStaticText ( this, wxID_ANY, - _T("Enter your birthday date (not before 20th century):") + wxT("Enter your birthday date (not before 20th century):") ), wxSizerFlags().Border()); diff --git a/samples/caret/caret.cpp b/samples/caret/caret.cpp index a519db7faa..a1f025a653 100644 --- a/samples/caret/caret.cpp +++ b/samples/caret/caret.cpp @@ -186,7 +186,7 @@ bool MyApp::OnInit() return false; // create and show the main application window - MyFrame *frame = new MyFrame(_T("Caret wxWidgets sample"), + MyFrame *frame = new MyFrame(wxT("Caret wxWidgets sample"), wxPoint(50, 50), wxSize(450, 340)); frame->Show(true); @@ -211,17 +211,17 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->Append(Caret_SetBlinkTime, _T("&Blink time...\tCtrl-B")); - menuFile->Append(Caret_SetFontSize, _T("&Font size...\tCtrl-S")); - menuFile->Append(Caret_Move, _T("&Move caret\tCtrl-C")); + menuFile->Append(Caret_SetBlinkTime, wxT("&Blink time...\tCtrl-B")); + menuFile->Append(Caret_SetFontSize, wxT("&Font size...\tCtrl-S")); + menuFile->Append(Caret_Move, wxT("&Move caret\tCtrl-C")); menuFile->AppendSeparator(); - menuFile->Append(Caret_About, _T("&About...\tCtrl-A"), _T("Show about dialog")); + menuFile->Append(Caret_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog")); menuFile->AppendSeparator(); - menuFile->Append(Caret_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Caret_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menuFile, _T("&File")); + menuBar->Append(menuFile, wxT("&File")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -231,7 +231,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR } @@ -246,8 +246,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("The caret wxWidgets sample.\n(c) 1999 Vadim Zeitlin"), - _T("About Caret"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(wxT("The caret wxWidgets sample.\n(c) 1999 Vadim Zeitlin"), + wxT("About Caret"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnCaretMove(wxCommandEvent& WXUNUSED(event)) @@ -259,9 +259,9 @@ void MyFrame::OnSetBlinkTime(wxCommandEvent& WXUNUSED(event)) { long blinkTime = wxGetNumberFromUser ( - _T("The caret blink time is the time between two blinks"), - _T("Time in milliseconds:"), - _T("wxCaret sample"), + wxT("The caret blink time is the time between two blinks"), + wxT("Time in milliseconds:"), + wxT("wxCaret sample"), wxCaret::GetBlinkTime(), 0, 10000, this ); @@ -269,7 +269,7 @@ void MyFrame::OnSetBlinkTime(wxCommandEvent& WXUNUSED(event)) { wxCaret::SetBlinkTime((int)blinkTime); m_canvas->CreateCaret(); - wxLogStatus(this, _T("Blink time set to %ld milliseconds."), blinkTime); + wxLogStatus(this, wxT("Blink time set to %ld milliseconds."), blinkTime); } } @@ -277,9 +277,9 @@ void MyFrame::OnSetFontSize(wxCommandEvent& WXUNUSED(event)) { long fontSize = wxGetNumberFromUser ( - _T("The font size also determines the caret size so\nthis demonstrates resizing the caret."), - _T("Font size (in points):"), - _T("wxCaret sample"), + wxT("The font size also determines the caret size so\nthis demonstrates resizing the caret."), + wxT("Font size (in points):"), + wxT("wxCaret sample"), 12, 1, 100, this ); @@ -364,7 +364,7 @@ void MyCanvas::MoveCaret(int x, int y) void MyCanvas::DoMoveCaret() { - wxLogStatus(_T("Caret is at (%d, %d)"), m_xCaret, m_yCaret); + wxLogStatus(wxT("Caret is at (%d, %d)"), m_xCaret, m_yCaret); GetCaret()->Move(m_xMargin + m_xCaret * m_widthChar, m_yMargin + m_yCaret * m_heightChar); @@ -396,7 +396,7 @@ void MyCanvas::ChangeSize() if ( frame && frame->GetStatusBar() ) { wxString msg; - msg.Printf(_T("Panel size is (%d, %d)"), m_xChars, m_yChars); + msg.Printf(wxT("Panel size is (%d, %d)"), m_xChars, m_yChars); frame->SetStatusText(msg, 1); } #endif // wxUSE_STATUSBAR @@ -423,7 +423,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) { wxChar ch = CharAt(x, y); if ( !ch ) - ch = _T(' '); + ch = wxT(' '); line += ch; } diff --git a/samples/collpane/collpane.cpp b/samples/collpane/collpane.cpp index 2cd10c25c9..fccfa6a56f 100644 --- a/samples/collpane/collpane.cpp +++ b/samples/collpane/collpane.cpp @@ -166,7 +166,7 @@ END_EVENT_TABLE() // My frame constructor MyFrame::MyFrame() - : wxFrame(NULL, wxID_ANY, _T("wxCollapsiblePane sample"), + : wxFrame(NULL, wxID_ANY, wxT("wxCollapsiblePane sample"), wxDefaultPosition, wxSize(420, 300), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) { @@ -178,12 +178,12 @@ MyFrame::MyFrame() // Make a menubar wxMenu *paneMenu = new wxMenu; - paneMenu->Append(PANE_COLLAPSE, _T("Collapse\tCtrl-C")); - paneMenu->Append(PANE_EXPAND, _T("Expand\tCtrl-E")); + paneMenu->Append(PANE_COLLAPSE, wxT("Collapse\tCtrl-C")); + paneMenu->Append(PANE_EXPAND, wxT("Expand\tCtrl-E")); paneMenu->AppendSeparator(); - paneMenu->Append(PANE_SETLABEL, _T("Set label...\tCtrl-L")); + paneMenu->Append(PANE_SETLABEL, wxT("Set label...\tCtrl-L")); paneMenu->AppendSeparator(); - paneMenu->Append(PANE_SHOWDLG, _T("Show dialog...\tCtrl-S")); + paneMenu->Append(PANE_SHOWDLG, wxT("Show dialog...\tCtrl-S")); paneMenu->AppendSeparator(); paneMenu->Append(PANE_QUIT); @@ -191,8 +191,8 @@ MyFrame::MyFrame() helpMenu->Append(PANE_ABOUT); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(paneMenu, _T("&Pane")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(paneMenu, wxT("&Pane")); + menuBar->Append(helpMenu, wxT("&Help")); SetMenuBar(menuBar); m_collPane = new wxCollapsiblePane(this, -1, wxT("test!")); @@ -249,7 +249,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) wxAboutDialogInfo info; info.SetName(_("wxCollapsiblePane sample")); info.SetDescription(_("This sample program demonstrates usage of wxCollapsiblePane")); - info.SetCopyright(_T("(C) 2006 Francesco Montorsi ")); + info.SetCopyright(wxT("(C) 2006 Francesco Montorsi ")); wxAboutBox(info); } diff --git a/samples/combo/combo.cpp b/samples/combo/combo.cpp index 62ed8af72e..2de27dd64b 100644 --- a/samples/combo/combo.cpp +++ b/samples/combo/combo.cpp @@ -158,7 +158,7 @@ bool MyApp::OnInit() return false; // create the main application window - MyFrame *frame = new MyFrame(_T("wxComboCtrl and wxOwnerDrawnComboBox Sample")); + MyFrame *frame = new MyFrame(wxT("wxComboCtrl and wxOwnerDrawnComboBox Sample")); // and show it (the frames, unlike simple controls, are not shown when // created initially) @@ -724,17 +724,17 @@ MyFrame::MyFrame(const wxString& title) // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(ComboControl_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(ComboControl_About, wxT("&About...\tF1"), wxT("Show about dialog")); - fileMenu->Append(ComboControl_Compare, _T("&Compare against wxComboBox..."), - _T("Show some wxOwnerDrawnComboBoxes side-by-side with native wxComboBoxes.")); + fileMenu->Append(ComboControl_Compare, wxT("&Compare against wxComboBox..."), + wxT("Show some wxOwnerDrawnComboBoxes side-by-side with native wxComboBoxes.")); fileMenu->AppendSeparator(); - fileMenu->Append(ComboControl_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + fileMenu->Append(ComboControl_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(fileMenu, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(fileMenu, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -1206,14 +1206,14 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox(wxString::Format( - _T("Welcome to %s!\n") - _T("\n") - _T("This is the wxWidgets wxComboCtrl and wxOwnerDrawnComboBox sample\n") - _T("running under %s."), + wxT("Welcome to %s!\n") + wxT("\n") + wxT("This is the wxWidgets wxComboCtrl and wxOwnerDrawnComboBox sample\n") + wxT("running under %s."), wxVERSION_STRING, wxGetOsDescription().c_str() ), - _T("About wxComboCtrl sample"), + wxT("About wxComboCtrl sample"), wxOK | wxICON_INFORMATION, this); } diff --git a/samples/config/conftest.cpp b/samples/config/conftest.cpp index c829260882..c19f0f9e47 100644 --- a/samples/config/conftest.cpp +++ b/samples/config/conftest.cpp @@ -106,8 +106,8 @@ bool MyApp::OnInit() // of the config file/registry key and must be set before the first call // to Get() if you want to override the default values (the application // name is the name of the executable and the vendor name is the same) - SetVendorName(_T("wxWidgets")); - SetAppName(_T("conftest")); // not needed, it's the default value + SetVendorName(wxT("wxWidgets")); + SetAppName(wxT("conftest")); // not needed, it's the default value wxConfigBase *pConfig = wxConfigBase::Get(); @@ -129,11 +129,11 @@ bool MyApp::OnInit() SetTopWindow(frame); // use our config object... - if ( pConfig->Read(_T("/Controls/Check"), 1l) != 0 ) { - wxMessageBox(_T("You can disable this message box by unchecking\n") - _T("the checkbox in the main window (of course, a real\n") - _T("program would have a checkbox right here but we\n") - _T("keep it simple)"), _T("Welcome to wxConfig demo"), + if ( pConfig->Read(wxT("/Controls/Check"), 1l) != 0 ) { + wxMessageBox(wxT("You can disable this message box by unchecking\n") + wxT("the checkbox in the main window (of course, a real\n") + wxT("program would have a checkbox right here but we\n") + wxT("keep it simple)"), wxT("Welcome to wxConfig demo"), wxICON_INFORMATION | wxOK); } @@ -156,20 +156,20 @@ int MyApp::OnExit() // main frame ctor MyFrame::MyFrame() - : wxFrame((wxFrame *) NULL, wxID_ANY, _T("wxConfig Demo")) + : wxFrame((wxFrame *) NULL, wxID_ANY, wxT("wxConfig Demo")) { SetIcon(wxICON(sample)); // menu wxMenu *file_menu = new wxMenu; - file_menu->Append(ConfTest_Delete, _T("&Delete"), _T("Delete config file")); + file_menu->Append(ConfTest_Delete, wxT("&Delete"), wxT("Delete config file")); file_menu->AppendSeparator(); - file_menu->Append(ConfTest_About, _T("&About\tF1"), _T("About this sample")); + file_menu->Append(ConfTest_About, wxT("&About\tF1"), wxT("About this sample")); file_menu->AppendSeparator(); - file_menu->Append(ConfTest_Quit, _T("E&xit\tAlt-X"), _T("Exit the program")); + file_menu->Append(ConfTest_Quit, wxT("E&xit\tAlt-X"), wxT("Exit the program")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); SetMenuBar(menu_bar); #if wxUSE_STATUSBAR @@ -178,10 +178,10 @@ MyFrame::MyFrame() // child controls wxPanel *panel = new wxPanel(this); - (void)new wxStaticText(panel, wxID_ANY, _T("These controls remember their values!"), + (void)new wxStaticText(panel, wxID_ANY, wxT("These controls remember their values!"), wxPoint(10, 10), wxSize(300, 20)); - m_text = new wxTextCtrl(panel, wxID_ANY, _T(""), wxPoint(10, 40), wxSize(300, 20)); - m_check = new wxCheckBox(panel, wxID_ANY, _T("show welcome message box at startup"), + m_text = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxPoint(10, 40), wxSize(300, 20)); + m_check = new wxCheckBox(panel, wxID_ANY, wxT("show welcome message box at startup"), wxPoint(10, 70), wxSize(300, 20)); // restore the control's values from the config @@ -194,25 +194,25 @@ MyFrame::MyFrame() wxConfigBase *pConfig = wxConfigBase::Get(); // we could write Read("/Controls/Text") as well, it's just to show SetPath() - pConfig->SetPath(_T("/Controls")); + pConfig->SetPath(wxT("/Controls")); - m_text->SetValue(pConfig->Read(_T("Text"), _T(""))); - m_check->SetValue(pConfig->Read(_T("Check"), 1l) != 0); + m_text->SetValue(pConfig->Read(wxT("Text"), wxT(""))); + m_check->SetValue(pConfig->Read(wxT("Check"), 1l) != 0); // SetPath() understands ".." - pConfig->SetPath(_T("../MainFrame")); + pConfig->SetPath(wxT("../MainFrame")); // restore frame position and size - int x = pConfig->Read(_T("x"), 50), - y = pConfig->Read(_T("y"), 50), - w = pConfig->Read(_T("w"), 350), - h = pConfig->Read(_T("h"), 200); + int x = pConfig->Read(wxT("x"), 50), + y = pConfig->Read(wxT("y"), 50), + w = pConfig->Read(wxT("w"), 350), + h = pConfig->Read(wxT("h"), 200); Move(x, y); SetClientSize(w, h); - pConfig->SetPath(_T("/")); + pConfig->SetPath(wxT("/")); wxString s; - if ( pConfig->Read(_T("TestValue"), &s) ) + if ( pConfig->Read(wxT("TestValue"), &s) ) { wxLogStatus(this, wxT("TestValue from config is '%s'"), s.c_str()); } @@ -229,7 +229,7 @@ void MyFrame::OnQuit(wxCommandEvent&) void MyFrame::OnAbout(wxCommandEvent&) { - wxMessageBox(_T("wxConfig demo\n(c) 1998-2001 Vadim Zeitlin"), _T("About"), + wxMessageBox(wxT("wxConfig demo\n(c) 1998-2001 Vadim Zeitlin"), wxT("About"), wxICON_INFORMATION | wxOK); } @@ -238,20 +238,20 @@ void MyFrame::OnDelete(wxCommandEvent&) wxConfigBase *pConfig = wxConfigBase::Get(); if ( pConfig == NULL ) { - wxLogError(_T("No config to delete!")); + wxLogError(wxT("No config to delete!")); return; } if ( pConfig->DeleteAll() ) { - wxLogMessage(_T("Config file/registry key successfully deleted.")); + wxLogMessage(wxT("Config file/registry key successfully deleted.")); delete wxConfigBase::Set(NULL); wxConfigBase::DontCreateOnDemand(); } else { - wxLogError(_T("Deleting config file/registry key failed.")); + wxLogError(wxT("Deleting config file/registry key failed.")); } } @@ -262,18 +262,18 @@ MyFrame::~MyFrame() return; // save the control's values to the config - pConfig->Write(_T("/Controls/Text"), m_text->GetValue()); - pConfig->Write(_T("/Controls/Check"), m_check->GetValue()); + pConfig->Write(wxT("/Controls/Text"), m_text->GetValue()); + pConfig->Write(wxT("/Controls/Check"), m_check->GetValue()); // save the frame position int x, y, w, h; GetClientSize(&w, &h); GetPosition(&x, &y); - pConfig->Write(_T("/MainFrame/x"), (long) x); - pConfig->Write(_T("/MainFrame/y"), (long) y); - pConfig->Write(_T("/MainFrame/w"), (long) w); - pConfig->Write(_T("/MainFrame/h"), (long) h); + pConfig->Write(wxT("/MainFrame/x"), (long) x); + pConfig->Write(wxT("/MainFrame/y"), (long) y); + pConfig->Write(wxT("/MainFrame/w"), (long) w); + pConfig->Write(wxT("/MainFrame/h"), (long) h); - pConfig->Write(_T("/TestValue"), wxT("A test value")); + pConfig->Write(wxT("/TestValue"), wxT("A test value")); } diff --git a/samples/console/console.cpp b/samples/console/console.cpp index 5165ec811f..e62d060ea7 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -41,7 +41,7 @@ switch ( parser.Parse() ) { case -1: - wxLogMessage(_T("Help was given, terminating.")); + wxLogMessage(wxT("Help was given, terminating.")); break; case 0: @@ -49,7 +49,7 @@ break; default: - wxLogMessage(_T("Syntax error detected, aborting.")); + wxLogMessage(wxT("Syntax error detected, aborting.")); break; } @@ -164,9 +164,9 @@ static wxString MakePrintable(const wxChar *s) { wxString str(s); - (void)str.Replace(_T("\t"), _T("\\t")); - (void)str.Replace(_T("\n"), _T("\\n")); - (void)str.Replace(_T("\r"), _T("\\r")); + (void)str.Replace(wxT("\t"), wxT("\\t")); + (void)str.Replace(wxT("\n"), wxT("\\n")); + (void)str.Replace(wxT("\r"), wxT("\\r")); return str; } @@ -186,7 +186,7 @@ static wxString MakePrintable(const wxChar *s) static void ShowCmdLine(const wxCmdLineParser& parser) { - wxString s = _T("Command line parsed successfully:\nInput files: "); + wxString s = wxT("Command line parsed successfully:\nInput files: "); size_t count = parser.GetParamCount(); for ( size_t param = 0; param < count; param++ ) @@ -195,25 +195,25 @@ static void ShowCmdLine(const wxCmdLineParser& parser) } s << '\n' - << _T("Verbose:\t") << (parser.Found(_T("v")) ? _T("yes") : _T("no")) << '\n' - << _T("Quiet:\t") << (parser.Found(_T("q")) ? _T("yes") : _T("no")) << '\n'; + << wxT("Verbose:\t") << (parser.Found(wxT("v")) ? wxT("yes") : wxT("no")) << '\n' + << wxT("Quiet:\t") << (parser.Found(wxT("q")) ? wxT("yes") : wxT("no")) << '\n'; wxString strVal; long lVal; double dVal; wxDateTime dt; - if ( parser.Found(_T("o"), &strVal) ) - s << _T("Output file:\t") << strVal << '\n'; - if ( parser.Found(_T("i"), &strVal) ) - s << _T("Input dir:\t") << strVal << '\n'; - if ( parser.Found(_T("s"), &lVal) ) - s << _T("Size:\t") << lVal << '\n'; - if ( parser.Found(_T("f"), &dVal) ) - s << _T("Double:\t") << dVal << '\n'; - if ( parser.Found(_T("d"), &dt) ) - s << _T("Date:\t") << dt.FormatISODate() << '\n'; - if ( parser.Found(_T("project_name"), &strVal) ) - s << _T("Project:\t") << strVal << '\n'; + if ( parser.Found(wxT("o"), &strVal) ) + s << wxT("Output file:\t") << strVal << '\n'; + if ( parser.Found(wxT("i"), &strVal) ) + s << wxT("Input dir:\t") << strVal << '\n'; + if ( parser.Found(wxT("s"), &lVal) ) + s << wxT("Size:\t") << lVal << '\n'; + if ( parser.Found(wxT("f"), &dVal) ) + s << wxT("Double:\t") << dVal << '\n'; + if ( parser.Found(wxT("d"), &dt) ) + s << wxT("Date:\t") << dt.FormatISODate() << '\n'; + if ( parser.Found(wxT("project_name"), &strVal) ) + s << wxT("Project:\t") << strVal << '\n'; wxLogMessage(s); } @@ -224,22 +224,22 @@ static void TestCmdLineConvert() { static const wxChar *cmdlines[] = { - _T("arg1 arg2"), - _T("-a \"-bstring 1\" -c\"string 2\" \"string 3\""), - _T("literal \\\" and \"\""), + wxT("arg1 arg2"), + wxT("-a \"-bstring 1\" -c\"string 2\" \"string 3\""), + wxT("literal \\\" and \"\""), }; for ( size_t n = 0; n < WXSIZEOF(cmdlines); n++ ) { const wxChar *cmdline = cmdlines[n]; - wxPrintf(_T("Parsing: %s\n"), cmdline); + wxPrintf(wxT("Parsing: %s\n"), cmdline); wxArrayString args = wxCmdLineParser::ConvertStringToArgs(cmdline); size_t count = args.GetCount(); - wxPrintf(_T("\targc = %u\n"), count); + wxPrintf(wxT("\targc = %u\n"), count); for ( size_t arg = 0; arg < count; arg++ ) { - wxPrintf(_T("\targv[%u] = %s\n"), arg, args[arg].c_str()); + wxPrintf(wxT("\targv[%u] = %s\n"), arg, args[arg].c_str()); } } } @@ -255,11 +255,11 @@ static void TestCmdLineConvert() #include "wx/dir.h" #ifdef __UNIX__ - static const wxChar *ROOTDIR = _T("/"); - static const wxChar *TESTDIR = _T("/usr/local/share"); + static const wxChar *ROOTDIR = wxT("/"); + static const wxChar *TESTDIR = wxT("/usr/local/share"); #elif defined(__WXMSW__) || defined(__DOS__) || defined(__OS2__) - static const wxChar *ROOTDIR = _T("c:\\"); - static const wxChar *TESTDIR = _T("d:\\"); + static const wxChar *ROOTDIR = wxT("c:\\"); + static const wxChar *TESTDIR = wxT("d:\\"); #else #error "don't know where the root directory is" #endif @@ -276,7 +276,7 @@ static void TestDirEnumHelper(wxDir& dir, bool cont = dir.GetFirst(&filename, filespec, flags); while ( cont ) { - wxPrintf(_T("\t%s\n"), filename.c_str()); + wxPrintf(wxT("\t%s\n"), filename.c_str()); cont = dir.GetNext(&filename); } @@ -288,56 +288,56 @@ static void TestDirEnumHelper(wxDir& dir, static void TestDirEnum() { - wxPuts(_T("*** Testing wxDir::GetFirst/GetNext ***")); + wxPuts(wxT("*** Testing wxDir::GetFirst/GetNext ***")); wxString cwd = wxGetCwd(); if ( !wxDir::Exists(cwd) ) { - wxPrintf(_T("ERROR: current directory '%s' doesn't exist?\n"), cwd.c_str()); + wxPrintf(wxT("ERROR: current directory '%s' doesn't exist?\n"), cwd.c_str()); return; } wxDir dir(cwd); if ( !dir.IsOpened() ) { - wxPrintf(_T("ERROR: failed to open current directory '%s'.\n"), cwd.c_str()); + wxPrintf(wxT("ERROR: failed to open current directory '%s'.\n"), cwd.c_str()); return; } - wxPuts(_T("Enumerating everything in current directory:")); + wxPuts(wxT("Enumerating everything in current directory:")); TestDirEnumHelper(dir); - wxPuts(_T("Enumerating really everything in current directory:")); + wxPuts(wxT("Enumerating really everything in current directory:")); TestDirEnumHelper(dir, wxDIR_DEFAULT | wxDIR_DOTDOT); - wxPuts(_T("Enumerating object files in current directory:")); - TestDirEnumHelper(dir, wxDIR_DEFAULT, _T("*.o*")); + wxPuts(wxT("Enumerating object files in current directory:")); + TestDirEnumHelper(dir, wxDIR_DEFAULT, wxT("*.o*")); - wxPuts(_T("Enumerating directories in current directory:")); + wxPuts(wxT("Enumerating directories in current directory:")); TestDirEnumHelper(dir, wxDIR_DIRS); - wxPuts(_T("Enumerating files in current directory:")); + wxPuts(wxT("Enumerating files in current directory:")); TestDirEnumHelper(dir, wxDIR_FILES); - wxPuts(_T("Enumerating files including hidden in current directory:")); + wxPuts(wxT("Enumerating files including hidden in current directory:")); TestDirEnumHelper(dir, wxDIR_FILES | wxDIR_HIDDEN); dir.Open(ROOTDIR); - wxPuts(_T("Enumerating everything in root directory:")); + wxPuts(wxT("Enumerating everything in root directory:")); TestDirEnumHelper(dir, wxDIR_DEFAULT); - wxPuts(_T("Enumerating directories in root directory:")); + wxPuts(wxT("Enumerating directories in root directory:")); TestDirEnumHelper(dir, wxDIR_DIRS); - wxPuts(_T("Enumerating files in root directory:")); + wxPuts(wxT("Enumerating files in root directory:")); TestDirEnumHelper(dir, wxDIR_FILES); - wxPuts(_T("Enumerating files including hidden in root directory:")); + wxPuts(wxT("Enumerating files including hidden in root directory:")); TestDirEnumHelper(dir, wxDIR_FILES | wxDIR_HIDDEN); - wxPuts(_T("Enumerating files in non existing directory:")); - wxDir dirNo(_T("nosuchdir")); + wxPuts(wxT("Enumerating files in non existing directory:")); + wxDir dirNo(wxT("nosuchdir")); TestDirEnumHelper(dirNo); } @@ -357,16 +357,16 @@ public: wxFileName::SplitPath(dirname, &path, &name, &ext); if ( !ext.empty() ) - name << _T('.') << ext; + name << wxT('.') << ext; wxString indent; for ( const wxChar *p = path.c_str(); *p; p++ ) { if ( wxIsPathSeparator(*p) ) - indent += _T(" "); + indent += wxT(" "); } - wxPrintf(_T("%s%s\n"), indent.c_str(), name.c_str()); + wxPrintf(wxT("%s%s\n"), indent.c_str(), name.c_str()); return wxDIR_CONTINUE; } @@ -374,20 +374,20 @@ public: static void TestDirTraverse() { - wxPuts(_T("*** Testing wxDir::Traverse() ***")); + wxPuts(wxT("*** Testing wxDir::Traverse() ***")); // enum all files wxArrayString files; size_t n = wxDir::GetAllFiles(TESTDIR, &files); - wxPrintf(_T("There are %u files under '%s'\n"), n, TESTDIR); + wxPrintf(wxT("There are %u files under '%s'\n"), n, TESTDIR); if ( n > 1 ) { - wxPrintf(_T("First one is '%s'\n"), files[0u].c_str()); - wxPrintf(_T(" last one is '%s'\n"), files[n - 1].c_str()); + wxPrintf(wxT("First one is '%s'\n"), files[0u].c_str()); + wxPrintf(wxT(" last one is '%s'\n"), files[n - 1].c_str()); } // enum again with custom traverser - wxPuts(_T("Now enumerating directories:")); + wxPuts(wxT("Now enumerating directories:")); wxDir dir(TESTDIR); DirPrintTraverser traverser; dir.Traverse(traverser, wxEmptyString, wxDIR_DIRS | wxDIR_HIDDEN); @@ -397,34 +397,34 @@ static void TestDirTraverse() static void TestDirExists() { - wxPuts(_T("*** Testing wxDir::Exists() ***")); + wxPuts(wxT("*** Testing wxDir::Exists() ***")); static const wxChar *dirnames[] = { - _T("."), + wxT("."), #if defined(__WXMSW__) - _T("c:"), - _T("c:\\"), - _T("\\\\share\\file"), - _T("c:\\dos"), - _T("c:\\dos\\"), - _T("c:\\dos\\\\"), - _T("c:\\autoexec.bat"), + wxT("c:"), + wxT("c:\\"), + wxT("\\\\share\\file"), + wxT("c:\\dos"), + wxT("c:\\dos\\"), + wxT("c:\\dos\\\\"), + wxT("c:\\autoexec.bat"), #elif defined(__UNIX__) - _T("/"), - _T("//"), - _T("/usr/bin"), - _T("/usr//bin"), - _T("/usr///bin"), + wxT("/"), + wxT("//"), + wxT("/usr/bin"), + wxT("/usr//bin"), + wxT("/usr///bin"), #endif }; for ( size_t n = 0; n < WXSIZEOF(dirnames); n++ ) { - wxPrintf(_T("%-40s: %s\n"), + wxPrintf(wxT("%-40s: %s\n"), dirnames[n], - wxDir::Exists(dirnames[n]) ? _T("exists") - : _T("doesn't exist")); + wxDir::Exists(dirnames[n]) ? wxT("exists") + : wxT("doesn't exist")); } } @@ -443,22 +443,22 @@ static void TestDirExists() static void TestDllLoad() { #if defined(__WXMSW__) - static const wxChar *LIB_NAME = _T("kernel32.dll"); - static const wxChar *FUNC_NAME = _T("lstrlenA"); + static const wxChar *LIB_NAME = wxT("kernel32.dll"); + static const wxChar *FUNC_NAME = wxT("lstrlenA"); #elif defined(__UNIX__) // weird: using just libc.so does *not* work! - static const wxChar *LIB_NAME = _T("/lib/libc.so.6"); - static const wxChar *FUNC_NAME = _T("strlen"); + static const wxChar *LIB_NAME = wxT("/lib/libc.so.6"); + static const wxChar *FUNC_NAME = wxT("strlen"); #else #error "don't know how to test wxDllLoader on this platform" #endif - wxPuts(_T("*** testing basic wxDynamicLibrary functions ***\n")); + wxPuts(wxT("*** testing basic wxDynamicLibrary functions ***\n")); wxDynamicLibrary lib(LIB_NAME); if ( !lib.IsLoaded() ) { - wxPrintf(_T("ERROR: failed to load '%s'.\n"), LIB_NAME); + wxPrintf(wxT("ERROR: failed to load '%s'.\n"), LIB_NAME); } else { @@ -466,40 +466,40 @@ static void TestDllLoad() wxStrlenType pfnStrlen = (wxStrlenType)lib.GetSymbol(FUNC_NAME); if ( !pfnStrlen ) { - wxPrintf(_T("ERROR: function '%s' wasn't found in '%s'.\n"), + wxPrintf(wxT("ERROR: function '%s' wasn't found in '%s'.\n"), FUNC_NAME, LIB_NAME); } else { - wxPrintf(_T("Calling %s dynamically loaded from %s "), + wxPrintf(wxT("Calling %s dynamically loaded from %s "), FUNC_NAME, LIB_NAME); if ( pfnStrlen("foo") != 3 ) { - wxPrintf(_T("ERROR: loaded function is not wxStrlen()!\n")); + wxPrintf(wxT("ERROR: loaded function is not wxStrlen()!\n")); } else { - wxPuts(_T("... ok")); + wxPuts(wxT("... ok")); } } #ifdef __WXMSW__ - static const wxChar *FUNC_NAME_AW = _T("lstrlen"); + static const wxChar *FUNC_NAME_AW = wxT("lstrlen"); typedef int (wxSTDCALL *wxStrlenTypeAorW)(const wxChar *); wxStrlenTypeAorW pfnStrlenAorW = (wxStrlenTypeAorW)lib.GetSymbolAorW(FUNC_NAME_AW); if ( !pfnStrlenAorW ) { - wxPrintf(_T("ERROR: function '%s' wasn't found in '%s'.\n"), + wxPrintf(wxT("ERROR: function '%s' wasn't found in '%s'.\n"), FUNC_NAME_AW, LIB_NAME); } else { - if ( pfnStrlenAorW(_T("foobar")) != 6 ) + if ( pfnStrlenAorW(wxT("foobar")) != 6 ) { - wxPrintf(_T("ERROR: loaded function is not wxStrlen()!\n")); + wxPrintf(wxT("ERROR: loaded function is not wxStrlen()!\n")); } } #endif // __WXMSW__ @@ -510,7 +510,7 @@ static void TestDllLoad() static void TestDllListLoaded() { - wxPuts(_T("*** testing wxDynamicLibrary::ListLoaded() ***\n")); + wxPuts(wxT("*** testing wxDynamicLibrary::ListLoaded() ***\n")); puts("\nLoaded modules:"); wxDynamicLibraryDetailsArray dlls = wxDynamicLibrary::ListLoaded(); @@ -548,27 +548,27 @@ static wxString MyGetEnv(const wxString& var) { wxString val; if ( !wxGetEnv(var, &val) ) - val = _T(""); + val = wxT(""); else - val = wxString(_T('\'')) + val + _T('\''); + val = wxString(wxT('\'')) + val + wxT('\''); return val; } static void TestEnvironment() { - const wxChar *var = _T("wxTestVar"); + const wxChar *var = wxT("wxTestVar"); - wxPuts(_T("*** testing environment access functions ***")); + wxPuts(wxT("*** testing environment access functions ***")); - wxPrintf(_T("Initially getenv(%s) = %s\n"), var, MyGetEnv(var).c_str()); - wxSetEnv(var, _T("value for wxTestVar")); - wxPrintf(_T("After wxSetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str()); - wxSetEnv(var, _T("another value")); - wxPrintf(_T("After 2nd wxSetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str()); + wxPrintf(wxT("Initially getenv(%s) = %s\n"), var, MyGetEnv(var).c_str()); + wxSetEnv(var, wxT("value for wxTestVar")); + wxPrintf(wxT("After wxSetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str()); + wxSetEnv(var, wxT("another value")); + wxPrintf(wxT("After 2nd wxSetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str()); wxUnsetEnv(var); - wxPrintf(_T("After wxUnsetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str()); - wxPrintf(_T("PATH = %s\n"), MyGetEnv(_T("PATH")).c_str()); + wxPrintf(wxT("After wxUnsetEnv: getenv(%s) = %s\n"), var, MyGetEnv(var).c_str()); + wxPrintf(wxT("PATH = %s\n"), MyGetEnv(wxT("PATH")).c_str()); } #endif // TEST_ENVIRON @@ -585,14 +585,14 @@ static void TestEnvironment() static void TestFileRead() { - wxPuts(_T("*** wxFile read test ***")); + wxPuts(wxT("*** wxFile read test ***")); - wxFile file(_T("testdata.fc")); + wxFile file(wxT("testdata.fc")); if ( file.IsOpened() ) { - wxPrintf(_T("File length: %lu\n"), file.Length()); + wxPrintf(wxT("File length: %lu\n"), file.Length()); - wxPuts(_T("File dump:\n----------")); + wxPuts(wxT("File dump:\n----------")); static const size_t len = 1024; wxChar buf[len]; @@ -601,7 +601,7 @@ static void TestFileRead() size_t nRead = file.Read(buf, len); if ( nRead == (size_t)wxInvalidOffset ) { - wxPrintf(_T("Failed to read the file.")); + wxPrintf(wxT("Failed to read the file.")); break; } @@ -611,11 +611,11 @@ static void TestFileRead() break; } - wxPuts(_T("----------")); + wxPuts(wxT("----------")); } else { - wxPrintf(_T("ERROR: can't open test file.\n")); + wxPrintf(wxT("ERROR: can't open test file.\n")); } wxPuts(wxEmptyString); @@ -623,35 +623,35 @@ static void TestFileRead() static void TestTextFileRead() { - wxPuts(_T("*** wxTextFile read test ***")); + wxPuts(wxT("*** wxTextFile read test ***")); - wxTextFile file(_T("testdata.fc")); + wxTextFile file(wxT("testdata.fc")); if ( file.Open() ) { - wxPrintf(_T("Number of lines: %u\n"), file.GetLineCount()); - wxPrintf(_T("Last line: '%s'\n"), file.GetLastLine().c_str()); + wxPrintf(wxT("Number of lines: %u\n"), file.GetLineCount()); + wxPrintf(wxT("Last line: '%s'\n"), file.GetLastLine().c_str()); wxString s; - wxPuts(_T("\nDumping the entire file:")); + wxPuts(wxT("\nDumping the entire file:")); for ( s = file.GetFirstLine(); !file.Eof(); s = file.GetNextLine() ) { - wxPrintf(_T("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str()); + wxPrintf(wxT("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str()); } - wxPrintf(_T("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str()); + wxPrintf(wxT("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str()); - wxPuts(_T("\nAnd now backwards:")); + wxPuts(wxT("\nAnd now backwards:")); for ( s = file.GetLastLine(); file.GetCurrentLine() != 0; s = file.GetPrevLine() ) { - wxPrintf(_T("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str()); + wxPrintf(wxT("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str()); } - wxPrintf(_T("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str()); + wxPrintf(wxT("%6u: %s\n"), file.GetCurrentLine() + 1, s.c_str()); } else { - wxPrintf(_T("ERROR: can't open '%s'\n"), file.GetName()); + wxPrintf(wxT("ERROR: can't open '%s'\n"), file.GetName()); } wxPuts(wxEmptyString); @@ -659,40 +659,40 @@ static void TestTextFileRead() static void TestFileCopy() { - wxPuts(_T("*** Testing wxCopyFile ***")); + wxPuts(wxT("*** Testing wxCopyFile ***")); - static const wxChar *filename1 = _T("testdata.fc"); - static const wxChar *filename2 = _T("test2"); + static const wxChar *filename1 = wxT("testdata.fc"); + static const wxChar *filename2 = wxT("test2"); if ( !wxCopyFile(filename1, filename2) ) { - wxPuts(_T("ERROR: failed to copy file")); + wxPuts(wxT("ERROR: failed to copy file")); } else { - wxFFile f1(filename1, _T("rb")), - f2(filename2, _T("rb")); + wxFFile f1(filename1, wxT("rb")), + f2(filename2, wxT("rb")); if ( !f1.IsOpened() || !f2.IsOpened() ) { - wxPuts(_T("ERROR: failed to open file(s)")); + wxPuts(wxT("ERROR: failed to open file(s)")); } else { wxString s1, s2; if ( !f1.ReadAll(&s1) || !f2.ReadAll(&s2) ) { - wxPuts(_T("ERROR: failed to read file(s)")); + wxPuts(wxT("ERROR: failed to read file(s)")); } else { if ( (s1.length() != s2.length()) || (memcmp(s1.c_str(), s2.c_str(), s1.length()) != 0) ) { - wxPuts(_T("ERROR: copy error!")); + wxPuts(wxT("ERROR: copy error!")); } else { - wxPuts(_T("File was copied ok.")); + wxPuts(wxT("File was copied ok.")); } } } @@ -700,7 +700,7 @@ static void TestFileCopy() if ( !wxRemoveFile(filename2) ) { - wxPuts(_T("ERROR: failed to remove the file")); + wxPuts(wxT("ERROR: failed to remove the file")); } wxPuts(wxEmptyString); @@ -708,17 +708,17 @@ static void TestFileCopy() static void TestTempFile() { - wxPuts(_T("*** wxTempFile test ***")); + wxPuts(wxT("*** wxTempFile test ***")); wxTempFile tmpFile; - if ( tmpFile.Open(_T("test2")) && tmpFile.Write(_T("the answer is 42")) ) + if ( tmpFile.Open(wxT("test2")) && tmpFile.Write(wxT("the answer is 42")) ) { if ( tmpFile.Commit() ) - wxPuts(_T("File committed.")); + wxPuts(wxT("File committed.")); else - wxPuts(_T("ERROR: could't commit temp file.")); + wxPuts(wxT("ERROR: could't commit temp file.")); - wxRemoveFile(_T("test2")); + wxRemoveFile(wxT("test2")); } wxPuts(wxEmptyString); @@ -741,56 +741,56 @@ static const struct FileConfTestData const wxChar *value; // the value from the file } fcTestData[] = { - { _T("value1"), _T("one") }, - { _T("value2"), _T("two") }, - { _T("novalue"), _T("default") }, + { wxT("value1"), wxT("one") }, + { wxT("value2"), wxT("two") }, + { wxT("novalue"), wxT("default") }, }; static void TestFileConfRead() { - wxPuts(_T("*** testing wxFileConfig loading/reading ***")); + wxPuts(wxT("*** testing wxFileConfig loading/reading ***")); - wxFileConfig fileconf(_T("test"), wxEmptyString, - _T("testdata.fc"), wxEmptyString, + wxFileConfig fileconf(wxT("test"), wxEmptyString, + wxT("testdata.fc"), wxEmptyString, wxCONFIG_USE_RELATIVE_PATH); // test simple reading - wxPuts(_T("\nReading config file:")); - wxString defValue(_T("default")), value; + wxPuts(wxT("\nReading config file:")); + wxString defValue(wxT("default")), value; for ( size_t n = 0; n < WXSIZEOF(fcTestData); n++ ) { const FileConfTestData& data = fcTestData[n]; value = fileconf.Read(data.name, defValue); - wxPrintf(_T("\t%s = %s "), data.name, value.c_str()); + wxPrintf(wxT("\t%s = %s "), data.name, value.c_str()); if ( value == data.value ) { - wxPuts(_T("(ok)")); + wxPuts(wxT("(ok)")); } else { - wxPrintf(_T("(ERROR: should be %s)\n"), data.value); + wxPrintf(wxT("(ERROR: should be %s)\n"), data.value); } } // test enumerating the entries - wxPuts(_T("\nEnumerating all root entries:")); + wxPuts(wxT("\nEnumerating all root entries:")); long dummy; wxString name; bool cont = fileconf.GetFirstEntry(name, dummy); while ( cont ) { - wxPrintf(_T("\t%s = %s\n"), + wxPrintf(wxT("\t%s = %s\n"), name.c_str(), - fileconf.Read(name.c_str(), _T("ERROR")).c_str()); + fileconf.Read(name.c_str(), wxT("ERROR")).c_str()); cont = fileconf.GetNextEntry(name, dummy); } - static const wxChar *testEntry = _T("TestEntry"); - wxPrintf(_T("\nTesting deletion of newly created \"Test\" entry: ")); - fileconf.Write(testEntry, _T("A value")); + static const wxChar *testEntry = wxT("TestEntry"); + wxPrintf(wxT("\nTesting deletion of newly created \"Test\" entry: ")); + fileconf.Write(testEntry, wxT("A value")); fileconf.DeleteEntry(testEntry); - wxPrintf(fileconf.HasEntry(testEntry) ? _T("ERROR\n") : _T("ok\n")); + wxPrintf(fileconf.HasEntry(testEntry) ? wxT("ERROR\n") : wxT("ok\n")); } #endif // TEST_FILECONF @@ -813,44 +813,44 @@ static void DumpFileName(const wxChar *desc, const wxFileName& fn) wxString vol, path, name, ext; wxFileName::SplitPath(full, &vol, &path, &name, &ext); - wxPrintf(_T("'%s'-> vol '%s', path '%s', name '%s', ext '%s'\n"), + wxPrintf(wxT("'%s'-> vol '%s', path '%s', name '%s', ext '%s'\n"), full.c_str(), vol.c_str(), path.c_str(), name.c_str(), ext.c_str()); wxFileName::SplitPath(full, &path, &name, &ext); - wxPrintf(_T("or\t\t-> path '%s', name '%s', ext '%s'\n"), + wxPrintf(wxT("or\t\t-> path '%s', name '%s', ext '%s'\n"), path.c_str(), name.c_str(), ext.c_str()); - wxPrintf(_T("path is also:\t'%s'\n"), fn.GetPath().c_str()); - wxPrintf(_T("with volume: \t'%s'\n"), + wxPrintf(wxT("path is also:\t'%s'\n"), fn.GetPath().c_str()); + wxPrintf(wxT("with volume: \t'%s'\n"), fn.GetPath(wxPATH_GET_VOLUME).c_str()); - wxPrintf(_T("with separator:\t'%s'\n"), + wxPrintf(wxT("with separator:\t'%s'\n"), fn.GetPath(wxPATH_GET_SEPARATOR).c_str()); - wxPrintf(_T("with both: \t'%s'\n"), + wxPrintf(wxT("with both: \t'%s'\n"), fn.GetPath(wxPATH_GET_SEPARATOR | wxPATH_GET_VOLUME).c_str()); - wxPuts(_T("The directories in the path are:")); + wxPuts(wxT("The directories in the path are:")); wxArrayString dirs = fn.GetDirs(); size_t count = dirs.GetCount(); for ( size_t n = 0; n < count; n++ ) { - wxPrintf(_T("\t%u: %s\n"), n, dirs[n].c_str()); + wxPrintf(wxT("\t%u: %s\n"), n, dirs[n].c_str()); } } #endif static void TestFileNameTemp() { - wxPuts(_T("*** testing wxFileName temp file creation ***")); + wxPuts(wxT("*** testing wxFileName temp file creation ***")); static const wxChar *tmpprefixes[] = { - _T(""), - _T("foo"), - _T(".."), - _T("../bar"), + wxT(""), + wxT("foo"), + wxT(".."), + wxT("../bar"), #ifdef __UNIX__ - _T("/tmp/foo"), - _T("/tmp/foo/bar"), // this one must be an error + wxT("/tmp/foo"), + wxT("/tmp/foo/bar"), // this one must be an error #endif // __UNIX__ }; @@ -860,16 +860,16 @@ static void TestFileNameTemp() if ( path.empty() ) { // "error" is not in upper case because it may be ok - wxPrintf(_T("Prefix '%s'\t-> error\n"), tmpprefixes[n]); + wxPrintf(wxT("Prefix '%s'\t-> error\n"), tmpprefixes[n]); } else { - wxPrintf(_T("Prefix '%s'\t-> temp file '%s'\n"), + wxPrintf(wxT("Prefix '%s'\t-> temp file '%s'\n"), tmpprefixes[n], path.c_str()); if ( !wxRemoveFile(path) ) { - wxLogWarning(_T("Failed to remove temp file '%s'"), + wxLogWarning(wxT("Failed to remove temp file '%s'"), path.c_str()); } } @@ -909,32 +909,32 @@ static void TestFileNameCwd() static void TestFileGetTimes() { - wxFileName fn(_T("testdata.fc")); + wxFileName fn(wxT("testdata.fc")); wxDateTime dtAccess, dtMod, dtCreate; if ( !fn.GetTimes(&dtAccess, &dtMod, &dtCreate) ) { - wxPrintf(_T("ERROR: GetTimes() failed.\n")); + wxPrintf(wxT("ERROR: GetTimes() failed.\n")); } else { - static const wxChar *fmt = _T("%Y-%b-%d %H:%M:%S"); + static const wxChar *fmt = wxT("%Y-%b-%d %H:%M:%S"); - wxPrintf(_T("File times for '%s':\n"), fn.GetFullPath().c_str()); - wxPrintf(_T("Creation: \t%s\n"), dtCreate.Format(fmt).c_str()); - wxPrintf(_T("Last read: \t%s\n"), dtAccess.Format(fmt).c_str()); - wxPrintf(_T("Last write: \t%s\n"), dtMod.Format(fmt).c_str()); + wxPrintf(wxT("File times for '%s':\n"), fn.GetFullPath().c_str()); + wxPrintf(wxT("Creation: \t%s\n"), dtCreate.Format(fmt).c_str()); + wxPrintf(wxT("Last read: \t%s\n"), dtAccess.Format(fmt).c_str()); + wxPrintf(wxT("Last write: \t%s\n"), dtMod.Format(fmt).c_str()); } } #if 0 static void TestFileSetTimes() { - wxFileName fn(_T("testdata.fc")); + wxFileName fn(wxT("testdata.fc")); if ( !fn.Touch() ) { - wxPrintf(_T("ERROR: Touch() failed.\n")); + wxPrintf(wxT("ERROR: Touch() failed.\n")); } } #endif @@ -960,266 +960,266 @@ static const wxChar *GetLangName(int lang) { static const wxChar *languageNames[] = { - _T("DEFAULT"), - _T("UNKNOWN"), - _T("ABKHAZIAN"), - _T("AFAR"), - _T("AFRIKAANS"), - _T("ALBANIAN"), - _T("AMHARIC"), - _T("ARABIC"), - _T("ARABIC_ALGERIA"), - _T("ARABIC_BAHRAIN"), - _T("ARABIC_EGYPT"), - _T("ARABIC_IRAQ"), - _T("ARABIC_JORDAN"), - _T("ARABIC_KUWAIT"), - _T("ARABIC_LEBANON"), - _T("ARABIC_LIBYA"), - _T("ARABIC_MOROCCO"), - _T("ARABIC_OMAN"), - _T("ARABIC_QATAR"), - _T("ARABIC_SAUDI_ARABIA"), - _T("ARABIC_SUDAN"), - _T("ARABIC_SYRIA"), - _T("ARABIC_TUNISIA"), - _T("ARABIC_UAE"), - _T("ARABIC_YEMEN"), - _T("ARMENIAN"), - _T("ASSAMESE"), - _T("AYMARA"), - _T("AZERI"), - _T("AZERI_CYRILLIC"), - _T("AZERI_LATIN"), - _T("BASHKIR"), - _T("BASQUE"), - _T("BELARUSIAN"), - _T("BENGALI"), - _T("BHUTANI"), - _T("BIHARI"), - _T("BISLAMA"), - _T("BRETON"), - _T("BULGARIAN"), - _T("BURMESE"), - _T("CAMBODIAN"), - _T("CATALAN"), - _T("CHINESE"), - _T("CHINESE_SIMPLIFIED"), - _T("CHINESE_TRADITIONAL"), - _T("CHINESE_HONGKONG"), - _T("CHINESE_MACAU"), - _T("CHINESE_SINGAPORE"), - _T("CHINESE_TAIWAN"), - _T("CORSICAN"), - _T("CROATIAN"), - _T("CZECH"), - _T("DANISH"), - _T("DUTCH"), - _T("DUTCH_BELGIAN"), - _T("ENGLISH"), - _T("ENGLISH_UK"), - _T("ENGLISH_US"), - _T("ENGLISH_AUSTRALIA"), - _T("ENGLISH_BELIZE"), - _T("ENGLISH_BOTSWANA"), - _T("ENGLISH_CANADA"), - _T("ENGLISH_CARIBBEAN"), - _T("ENGLISH_DENMARK"), - _T("ENGLISH_EIRE"), - _T("ENGLISH_JAMAICA"), - _T("ENGLISH_NEW_ZEALAND"), - _T("ENGLISH_PHILIPPINES"), - _T("ENGLISH_SOUTH_AFRICA"), - _T("ENGLISH_TRINIDAD"), - _T("ENGLISH_ZIMBABWE"), - _T("ESPERANTO"), - _T("ESTONIAN"), - _T("FAEROESE"), - _T("FARSI"), - _T("FIJI"), - _T("FINNISH"), - _T("FRENCH"), - _T("FRENCH_BELGIAN"), - _T("FRENCH_CANADIAN"), - _T("FRENCH_LUXEMBOURG"), - _T("FRENCH_MONACO"), - _T("FRENCH_SWISS"), - _T("FRISIAN"), - _T("GALICIAN"), - _T("GEORGIAN"), - _T("GERMAN"), - _T("GERMAN_AUSTRIAN"), - _T("GERMAN_BELGIUM"), - _T("GERMAN_LIECHTENSTEIN"), - _T("GERMAN_LUXEMBOURG"), - _T("GERMAN_SWISS"), - _T("GREEK"), - _T("GREENLANDIC"), - _T("GUARANI"), - _T("GUJARATI"), - _T("HAUSA"), - _T("HEBREW"), - _T("HINDI"), - _T("HUNGARIAN"), - _T("ICELANDIC"), - _T("INDONESIAN"), - _T("INTERLINGUA"), - _T("INTERLINGUE"), - _T("INUKTITUT"), - _T("INUPIAK"), - _T("IRISH"), - _T("ITALIAN"), - _T("ITALIAN_SWISS"), - _T("JAPANESE"), - _T("JAVANESE"), - _T("KANNADA"), - _T("KASHMIRI"), - _T("KASHMIRI_INDIA"), - _T("KAZAKH"), - _T("KERNEWEK"), - _T("KINYARWANDA"), - _T("KIRGHIZ"), - _T("KIRUNDI"), - _T("KONKANI"), - _T("KOREAN"), - _T("KURDISH"), - _T("LAOTHIAN"), - _T("LATIN"), - _T("LATVIAN"), - _T("LINGALA"), - _T("LITHUANIAN"), - _T("MACEDONIAN"), - _T("MALAGASY"), - _T("MALAY"), - _T("MALAYALAM"), - _T("MALAY_BRUNEI_DARUSSALAM"), - _T("MALAY_MALAYSIA"), - _T("MALTESE"), - _T("MANIPURI"), - _T("MAORI"), - _T("MARATHI"), - _T("MOLDAVIAN"), - _T("MONGOLIAN"), - _T("NAURU"), - _T("NEPALI"), - _T("NEPALI_INDIA"), - _T("NORWEGIAN_BOKMAL"), - _T("NORWEGIAN_NYNORSK"), - _T("OCCITAN"), - _T("ORIYA"), - _T("OROMO"), - _T("PASHTO"), - _T("POLISH"), - _T("PORTUGUESE"), - _T("PORTUGUESE_BRAZILIAN"), - _T("PUNJABI"), - _T("QUECHUA"), - _T("RHAETO_ROMANCE"), - _T("ROMANIAN"), - _T("RUSSIAN"), - _T("RUSSIAN_UKRAINE"), - _T("SAMOAN"), - _T("SANGHO"), - _T("SANSKRIT"), - _T("SCOTS_GAELIC"), - _T("SERBIAN"), - _T("SERBIAN_CYRILLIC"), - _T("SERBIAN_LATIN"), - _T("SERBO_CROATIAN"), - _T("SESOTHO"), - _T("SETSWANA"), - _T("SHONA"), - _T("SINDHI"), - _T("SINHALESE"), - _T("SISWATI"), - _T("SLOVAK"), - _T("SLOVENIAN"), - _T("SOMALI"), - _T("SPANISH"), - _T("SPANISH_ARGENTINA"), - _T("SPANISH_BOLIVIA"), - _T("SPANISH_CHILE"), - _T("SPANISH_COLOMBIA"), - _T("SPANISH_COSTA_RICA"), - _T("SPANISH_DOMINICAN_REPUBLIC"), - _T("SPANISH_ECUADOR"), - _T("SPANISH_EL_SALVADOR"), - _T("SPANISH_GUATEMALA"), - _T("SPANISH_HONDURAS"), - _T("SPANISH_MEXICAN"), - _T("SPANISH_MODERN"), - _T("SPANISH_NICARAGUA"), - _T("SPANISH_PANAMA"), - _T("SPANISH_PARAGUAY"), - _T("SPANISH_PERU"), - _T("SPANISH_PUERTO_RICO"), - _T("SPANISH_URUGUAY"), - _T("SPANISH_US"), - _T("SPANISH_VENEZUELA"), - _T("SUNDANESE"), - _T("SWAHILI"), - _T("SWEDISH"), - _T("SWEDISH_FINLAND"), - _T("TAGALOG"), - _T("TAJIK"), - _T("TAMIL"), - _T("TATAR"), - _T("TELUGU"), - _T("THAI"), - _T("TIBETAN"), - _T("TIGRINYA"), - _T("TONGA"), - _T("TSONGA"), - _T("TURKISH"), - _T("TURKMEN"), - _T("TWI"), - _T("UIGHUR"), - _T("UKRAINIAN"), - _T("URDU"), - _T("URDU_INDIA"), - _T("URDU_PAKISTAN"), - _T("UZBEK"), - _T("UZBEK_CYRILLIC"), - _T("UZBEK_LATIN"), - _T("VIETNAMESE"), - _T("VOLAPUK"), - _T("WELSH"), - _T("WOLOF"), - _T("XHOSA"), - _T("YIDDISH"), - _T("YORUBA"), - _T("ZHUANG"), - _T("ZULU"), + wxT("DEFAULT"), + wxT("UNKNOWN"), + wxT("ABKHAZIAN"), + wxT("AFAR"), + wxT("AFRIKAANS"), + wxT("ALBANIAN"), + wxT("AMHARIC"), + wxT("ARABIC"), + wxT("ARABIC_ALGERIA"), + wxT("ARABIC_BAHRAIN"), + wxT("ARABIC_EGYPT"), + wxT("ARABIC_IRAQ"), + wxT("ARABIC_JORDAN"), + wxT("ARABIC_KUWAIT"), + wxT("ARABIC_LEBANON"), + wxT("ARABIC_LIBYA"), + wxT("ARABIC_MOROCCO"), + wxT("ARABIC_OMAN"), + wxT("ARABIC_QATAR"), + wxT("ARABIC_SAUDI_ARABIA"), + wxT("ARABIC_SUDAN"), + wxT("ARABIC_SYRIA"), + wxT("ARABIC_TUNISIA"), + wxT("ARABIC_UAE"), + wxT("ARABIC_YEMEN"), + wxT("ARMENIAN"), + wxT("ASSAMESE"), + wxT("AYMARA"), + wxT("AZERI"), + wxT("AZERI_CYRILLIC"), + wxT("AZERI_LATIN"), + wxT("BASHKIR"), + wxT("BASQUE"), + wxT("BELARUSIAN"), + wxT("BENGALI"), + wxT("BHUTANI"), + wxT("BIHARI"), + wxT("BISLAMA"), + wxT("BRETON"), + wxT("BULGARIAN"), + wxT("BURMESE"), + wxT("CAMBODIAN"), + wxT("CATALAN"), + wxT("CHINESE"), + wxT("CHINESE_SIMPLIFIED"), + wxT("CHINESE_TRADITIONAL"), + wxT("CHINESE_HONGKONG"), + wxT("CHINESE_MACAU"), + wxT("CHINESE_SINGAPORE"), + wxT("CHINESE_TAIWAN"), + wxT("CORSICAN"), + wxT("CROATIAN"), + wxT("CZECH"), + wxT("DANISH"), + wxT("DUTCH"), + wxT("DUTCH_BELGIAN"), + wxT("ENGLISH"), + wxT("ENGLISH_UK"), + wxT("ENGLISH_US"), + wxT("ENGLISH_AUSTRALIA"), + wxT("ENGLISH_BELIZE"), + wxT("ENGLISH_BOTSWANA"), + wxT("ENGLISH_CANADA"), + wxT("ENGLISH_CARIBBEAN"), + wxT("ENGLISH_DENMARK"), + wxT("ENGLISH_EIRE"), + wxT("ENGLISH_JAMAICA"), + wxT("ENGLISH_NEW_ZEALAND"), + wxT("ENGLISH_PHILIPPINES"), + wxT("ENGLISH_SOUTH_AFRICA"), + wxT("ENGLISH_TRINIDAD"), + wxT("ENGLISH_ZIMBABWE"), + wxT("ESPERANTO"), + wxT("ESTONIAN"), + wxT("FAEROESE"), + wxT("FARSI"), + wxT("FIJI"), + wxT("FINNISH"), + wxT("FRENCH"), + wxT("FRENCH_BELGIAN"), + wxT("FRENCH_CANADIAN"), + wxT("FRENCH_LUXEMBOURG"), + wxT("FRENCH_MONACO"), + wxT("FRENCH_SWISS"), + wxT("FRISIAN"), + wxT("GALICIAN"), + wxT("GEORGIAN"), + wxT("GERMAN"), + wxT("GERMAN_AUSTRIAN"), + wxT("GERMAN_BELGIUM"), + wxT("GERMAN_LIECHTENSTEIN"), + wxT("GERMAN_LUXEMBOURG"), + wxT("GERMAN_SWISS"), + wxT("GREEK"), + wxT("GREENLANDIC"), + wxT("GUARANI"), + wxT("GUJARATI"), + wxT("HAUSA"), + wxT("HEBREW"), + wxT("HINDI"), + wxT("HUNGARIAN"), + wxT("ICELANDIC"), + wxT("INDONESIAN"), + wxT("INTERLINGUA"), + wxT("INTERLINGUE"), + wxT("INUKTITUT"), + wxT("INUPIAK"), + wxT("IRISH"), + wxT("ITALIAN"), + wxT("ITALIAN_SWISS"), + wxT("JAPANESE"), + wxT("JAVANESE"), + wxT("KANNADA"), + wxT("KASHMIRI"), + wxT("KASHMIRI_INDIA"), + wxT("KAZAKH"), + wxT("KERNEWEK"), + wxT("KINYARWANDA"), + wxT("KIRGHIZ"), + wxT("KIRUNDI"), + wxT("KONKANI"), + wxT("KOREAN"), + wxT("KURDISH"), + wxT("LAOTHIAN"), + wxT("LATIN"), + wxT("LATVIAN"), + wxT("LINGALA"), + wxT("LITHUANIAN"), + wxT("MACEDONIAN"), + wxT("MALAGASY"), + wxT("MALAY"), + wxT("MALAYALAM"), + wxT("MALAY_BRUNEI_DARUSSALAM"), + wxT("MALAY_MALAYSIA"), + wxT("MALTESE"), + wxT("MANIPURI"), + wxT("MAORI"), + wxT("MARATHI"), + wxT("MOLDAVIAN"), + wxT("MONGOLIAN"), + wxT("NAURU"), + wxT("NEPALI"), + wxT("NEPALI_INDIA"), + wxT("NORWEGIAN_BOKMAL"), + wxT("NORWEGIAN_NYNORSK"), + wxT("OCCITAN"), + wxT("ORIYA"), + wxT("OROMO"), + wxT("PASHTO"), + wxT("POLISH"), + wxT("PORTUGUESE"), + wxT("PORTUGUESE_BRAZILIAN"), + wxT("PUNJABI"), + wxT("QUECHUA"), + wxT("RHAETO_ROMANCE"), + wxT("ROMANIAN"), + wxT("RUSSIAN"), + wxT("RUSSIAN_UKRAINE"), + wxT("SAMOAN"), + wxT("SANGHO"), + wxT("SANSKRIT"), + wxT("SCOTS_GAELIC"), + wxT("SERBIAN"), + wxT("SERBIAN_CYRILLIC"), + wxT("SERBIAN_LATIN"), + wxT("SERBO_CROATIAN"), + wxT("SESOTHO"), + wxT("SETSWANA"), + wxT("SHONA"), + wxT("SINDHI"), + wxT("SINHALESE"), + wxT("SISWATI"), + wxT("SLOVAK"), + wxT("SLOVENIAN"), + wxT("SOMALI"), + wxT("SPANISH"), + wxT("SPANISH_ARGENTINA"), + wxT("SPANISH_BOLIVIA"), + wxT("SPANISH_CHILE"), + wxT("SPANISH_COLOMBIA"), + wxT("SPANISH_COSTA_RICA"), + wxT("SPANISH_DOMINICAN_REPUBLIC"), + wxT("SPANISH_ECUADOR"), + wxT("SPANISH_EL_SALVADOR"), + wxT("SPANISH_GUATEMALA"), + wxT("SPANISH_HONDURAS"), + wxT("SPANISH_MEXICAN"), + wxT("SPANISH_MODERN"), + wxT("SPANISH_NICARAGUA"), + wxT("SPANISH_PANAMA"), + wxT("SPANISH_PARAGUAY"), + wxT("SPANISH_PERU"), + wxT("SPANISH_PUERTO_RICO"), + wxT("SPANISH_URUGUAY"), + wxT("SPANISH_US"), + wxT("SPANISH_VENEZUELA"), + wxT("SUNDANESE"), + wxT("SWAHILI"), + wxT("SWEDISH"), + wxT("SWEDISH_FINLAND"), + wxT("TAGALOG"), + wxT("TAJIK"), + wxT("TAMIL"), + wxT("TATAR"), + wxT("TELUGU"), + wxT("THAI"), + wxT("TIBETAN"), + wxT("TIGRINYA"), + wxT("TONGA"), + wxT("TSONGA"), + wxT("TURKISH"), + wxT("TURKMEN"), + wxT("TWI"), + wxT("UIGHUR"), + wxT("UKRAINIAN"), + wxT("URDU"), + wxT("URDU_INDIA"), + wxT("URDU_PAKISTAN"), + wxT("UZBEK"), + wxT("UZBEK_CYRILLIC"), + wxT("UZBEK_LATIN"), + wxT("VIETNAMESE"), + wxT("VOLAPUK"), + wxT("WELSH"), + wxT("WOLOF"), + wxT("XHOSA"), + wxT("YIDDISH"), + wxT("YORUBA"), + wxT("ZHUANG"), + wxT("ZULU"), }; if ( (size_t)lang < WXSIZEOF(languageNames) ) return languageNames[lang]; else - return _T("INVALID"); + return wxT("INVALID"); } static void TestDefaultLang() { - wxPuts(_T("*** Testing wxLocale::GetSystemLanguage ***")); + wxPuts(wxT("*** Testing wxLocale::GetSystemLanguage ***")); gs_localeDefault.Init(wxLANGUAGE_ENGLISH); static const wxChar *langStrings[] = { NULL, // system default - _T("C"), - _T("fr"), - _T("fr_FR"), - _T("en"), - _T("en_GB"), - _T("en_US"), - _T("de_DE.iso88591"), - _T("german"), - _T("?"), // invalid lang spec - _T("klingonese"), // I bet on some systems it does exist... + wxT("C"), + wxT("fr"), + wxT("fr_FR"), + wxT("en"), + wxT("en_GB"), + wxT("en_US"), + wxT("de_DE.iso88591"), + wxT("german"), + wxT("?"), // invalid lang spec + wxT("klingonese"), // I bet on some systems it does exist... }; - wxPrintf(_T("The default system encoding is %s (%d)\n"), + wxPrintf(wxT("The default system encoding is %s (%d)\n"), wxLocale::GetSystemEncodingName().c_str(), wxLocale::GetSystemEncoding()); @@ -1230,12 +1230,12 @@ static void TestDefaultLang() { // FIXME: this doesn't do anything at all under Windows, we need // to create a new wxLocale! - wxSetEnv(_T("LC_ALL"), langStr); + wxSetEnv(wxT("LC_ALL"), langStr); } int lang = gs_localeDefault.GetSystemLanguage(); - wxPrintf(_T("Locale for '%s' is %s.\n"), - langStr ? langStr : _T("system default"), GetLangName(lang)); + wxPrintf(wxT("Locale for '%s' is %s.\n"), + langStr ? langStr : wxT("system default"), GetLangName(lang)); } } @@ -1251,13 +1251,13 @@ static void TestDefaultLang() static void TestMimeEnum() { - wxPuts(_T("*** Testing wxMimeTypesManager::EnumAllFileTypes() ***\n")); + wxPuts(wxT("*** Testing wxMimeTypesManager::EnumAllFileTypes() ***\n")); wxArrayString mimetypes; size_t count = wxTheMimeTypesManager->EnumAllFileTypes(mimetypes); - wxPrintf(_T("*** All %u known filetypes: ***\n"), count); + wxPrintf(wxT("*** All %u known filetypes: ***\n"), count); wxArrayString exts; wxString desc; @@ -1268,7 +1268,7 @@ static void TestMimeEnum() wxTheMimeTypesManager->GetFileTypeFromMimeType(mimetypes[n]); if ( !filetype ) { - wxPrintf(_T("nothing known about the filetype '%s'!\n"), + wxPrintf(wxT("nothing known about the filetype '%s'!\n"), mimetypes[n].c_str()); continue; } @@ -1282,11 +1282,11 @@ static void TestMimeEnum() for ( size_t e = 0; e < exts.GetCount(); e++ ) { if ( e > 0 ) - extsAll << _T(", "); + extsAll << wxT(", "); extsAll += exts[e]; } - wxPrintf(_T("\t%s: %s (%s)\n"), + wxPrintf(wxT("\t%s: %s (%s)\n"), mimetypes[n].c_str(), desc.c_str(), extsAll.c_str()); } @@ -1295,39 +1295,39 @@ static void TestMimeEnum() static void TestMimeFilename() { - wxPuts(_T("*** Testing MIME type from filename query ***\n")); + wxPuts(wxT("*** Testing MIME type from filename query ***\n")); static const wxChar *filenames[] = { - _T("readme.txt"), - _T("document.pdf"), - _T("image.gif"), - _T("picture.jpeg"), + wxT("readme.txt"), + wxT("document.pdf"), + wxT("image.gif"), + wxT("picture.jpeg"), }; for ( size_t n = 0; n < WXSIZEOF(filenames); n++ ) { const wxString fname = filenames[n]; - wxString ext = fname.AfterLast(_T('.')); + wxString ext = fname.AfterLast(wxT('.')); wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext); if ( !ft ) { - wxPrintf(_T("WARNING: extension '%s' is unknown.\n"), ext.c_str()); + wxPrintf(wxT("WARNING: extension '%s' is unknown.\n"), ext.c_str()); } else { wxString desc; if ( !ft->GetDescription(&desc) ) - desc = _T(""); + desc = wxT(""); wxString cmd; if ( !ft->GetOpenCommand(&cmd, wxFileType::MessageParameters(fname, wxEmptyString)) ) - cmd = _T(""); + cmd = wxT(""); else - cmd = wxString(_T('"')) + cmd + _T('"'); + cmd = wxString(wxT('"')) + cmd + wxT('"'); - wxPrintf(_T("To open %s (%s) do %s.\n"), + wxPrintf(wxT("To open %s (%s) do %s.\n"), fname.c_str(), desc.c_str(), cmd.c_str()); delete ft; @@ -1342,25 +1342,25 @@ static void TestMimeFilename() static void TestMimeOverride() { - wxPuts(_T("*** Testing wxMimeTypesManager additional files loading ***\n")); + wxPuts(wxT("*** Testing wxMimeTypesManager additional files loading ***\n")); - static const wxChar *mailcap = _T("/tmp/mailcap"); - static const wxChar *mimetypes = _T("/tmp/mime.types"); + static const wxChar *mailcap = wxT("/tmp/mailcap"); + static const wxChar *mimetypes = wxT("/tmp/mime.types"); if ( wxFile::Exists(mailcap) ) - wxPrintf(_T("Loading mailcap from '%s': %s\n"), + wxPrintf(wxT("Loading mailcap from '%s': %s\n"), mailcap, - wxTheMimeTypesManager->ReadMailcap(mailcap) ? _T("ok") : _T("ERROR")); + wxTheMimeTypesManager->ReadMailcap(mailcap) ? wxT("ok") : wxT("ERROR")); else - wxPrintf(_T("WARN: mailcap file '%s' doesn't exist, not loaded.\n"), + wxPrintf(wxT("WARN: mailcap file '%s' doesn't exist, not loaded.\n"), mailcap); if ( wxFile::Exists(mimetypes) ) - wxPrintf(_T("Loading mime.types from '%s': %s\n"), + wxPrintf(wxT("Loading mime.types from '%s': %s\n"), mimetypes, - wxTheMimeTypesManager->ReadMimeTypes(mimetypes) ? _T("ok") : _T("ERROR")); + wxTheMimeTypesManager->ReadMimeTypes(mimetypes) ? wxT("ok") : wxT("ERROR")); else - wxPrintf(_T("WARN: mime.types file '%s' doesn't exist, not loaded.\n"), + wxPrintf(wxT("WARN: mime.types file '%s' doesn't exist, not loaded.\n"), mimetypes); wxPuts(wxEmptyString); @@ -1368,22 +1368,22 @@ static void TestMimeOverride() static void TestMimeAssociate() { - wxPuts(_T("*** Testing creation of filetype association ***\n")); + wxPuts(wxT("*** Testing creation of filetype association ***\n")); wxFileTypeInfo ftInfo( - _T("application/x-xyz"), - _T("xyzview '%s'"), // open cmd - _T(""), // print cmd - _T("XYZ File"), // description - _T(".xyz"), // extensions + wxT("application/x-xyz"), + wxT("xyzview '%s'"), // open cmd + wxT(""), // print cmd + wxT("XYZ File"), // description + wxT(".xyz"), // extensions wxNullPtr // end of extensions ); - ftInfo.SetShortDesc(_T("XYZFile")); // used under Win32 only + ftInfo.SetShortDesc(wxT("XYZFile")); // used under Win32 only wxFileType *ft = wxTheMimeTypesManager->Associate(ftInfo); if ( !ft ) { - wxPuts(_T("ERROR: failed to create association!")); + wxPuts(wxT("ERROR: failed to create association!")); } else { @@ -1409,8 +1409,8 @@ static void TestMimeAssociate() class wxTestModule : public wxModule { protected: - virtual bool OnInit() { wxPrintf(_T("Load module: %s\n"), GetClassInfo()->GetClassName()); return true; } - virtual void OnExit() { wxPrintf(_T("Unload module: %s\n"), GetClassInfo()->GetClassName()); } + virtual bool OnInit() { wxPrintf(wxT("Load module: %s\n"), GetClassInfo()->GetClassName()); return true; } + virtual void OnExit() { wxPrintf(wxT("Unload module: %s\n"), GetClassInfo()->GetClassName()); } }; class wxTestModuleA : public wxTestModule @@ -1483,12 +1483,12 @@ wxTestModuleB::wxTestModuleB() #if TEST_INTERACTIVE static void TestDiskInfo() { - wxPuts(_T("*** Testing wxGetDiskSpace() ***")); + wxPuts(wxT("*** Testing wxGetDiskSpace() ***")); for ( ;; ) { wxChar pathname[128]; - wxPrintf(_T("\nEnter a directory name: ")); + wxPrintf(wxT("\nEnter a directory name: ")); if ( !wxFgets(pathname, WXSIZEOF(pathname), stdin) ) break; @@ -1498,11 +1498,11 @@ static void TestDiskInfo() wxLongLong total, free; if ( !wxGetDiskSpace(pathname, &total, &free) ) { - wxPuts(_T("ERROR: wxGetDiskSpace failed.")); + wxPuts(wxT("ERROR: wxGetDiskSpace failed.")); } else { - wxPrintf(_T("%sKb total, %sKb free on '%s'.\n"), + wxPrintf(wxT("%sKb total, %sKb free on '%s'.\n"), (total / 1024).ToString().c_str(), (free / 1024).ToString().c_str(), pathname); @@ -1513,16 +1513,16 @@ static void TestDiskInfo() static void TestOsInfo() { - wxPuts(_T("*** Testing OS info functions ***\n")); + wxPuts(wxT("*** Testing OS info functions ***\n")); int major, minor; wxGetOsVersion(&major, &minor); - wxPrintf(_T("Running under: %s, version %d.%d\n"), + wxPrintf(wxT("Running under: %s, version %d.%d\n"), wxGetOsDescription().c_str(), major, minor); - wxPrintf(_T("%ld free bytes of memory left.\n"), wxGetFreeMemory().ToLong()); + wxPrintf(wxT("%ld free bytes of memory left.\n"), wxGetFreeMemory().ToLong()); - wxPrintf(_T("Host name is %s (%s).\n"), + wxPrintf(wxT("Host name is %s (%s).\n"), wxGetHostName().c_str(), wxGetFullHostName().c_str()); wxPuts(wxEmptyString); @@ -1530,29 +1530,29 @@ static void TestOsInfo() static void TestPlatformInfo() { - wxPuts(_T("*** Testing wxPlatformInfo functions ***\n")); + wxPuts(wxT("*** Testing wxPlatformInfo functions ***\n")); // get this platform wxPlatformInfo plat; - wxPrintf(_T("Operating system family name is: %s\n"), plat.GetOperatingSystemFamilyName().c_str()); - wxPrintf(_T("Operating system name is: %s\n"), plat.GetOperatingSystemIdName().c_str()); - wxPrintf(_T("Port ID name is: %s\n"), plat.GetPortIdName().c_str()); - wxPrintf(_T("Port ID short name is: %s\n"), plat.GetPortIdShortName().c_str()); - wxPrintf(_T("Architecture is: %s\n"), plat.GetArchName().c_str()); - wxPrintf(_T("Endianness is: %s\n"), plat.GetEndiannessName().c_str()); + wxPrintf(wxT("Operating system family name is: %s\n"), plat.GetOperatingSystemFamilyName().c_str()); + wxPrintf(wxT("Operating system name is: %s\n"), plat.GetOperatingSystemIdName().c_str()); + wxPrintf(wxT("Port ID name is: %s\n"), plat.GetPortIdName().c_str()); + wxPrintf(wxT("Port ID short name is: %s\n"), plat.GetPortIdShortName().c_str()); + wxPrintf(wxT("Architecture is: %s\n"), plat.GetArchName().c_str()); + wxPrintf(wxT("Endianness is: %s\n"), plat.GetEndiannessName().c_str()); wxPuts(wxEmptyString); } static void TestUserInfo() { - wxPuts(_T("*** Testing user info functions ***\n")); + wxPuts(wxT("*** Testing user info functions ***\n")); - wxPrintf(_T("User id is:\t%s\n"), wxGetUserId().c_str()); - wxPrintf(_T("User name is:\t%s\n"), wxGetUserName().c_str()); - wxPrintf(_T("Home dir is:\t%s\n"), wxGetHomeDir().c_str()); - wxPrintf(_T("Email address:\t%s\n"), wxGetEmailAddress().c_str()); + wxPrintf(wxT("User id is:\t%s\n"), wxGetUserId().c_str()); + wxPrintf(wxT("User name is:\t%s\n"), wxGetUserName().c_str()); + wxPrintf(wxT("Home dir is:\t%s\n"), wxGetHomeDir().c_str()); + wxPrintf(wxT("Email address:\t%s\n"), wxGetEmailAddress().c_str()); wxPuts(wxEmptyString); } @@ -1566,25 +1566,25 @@ static void TestUserInfo() #ifdef TEST_PATHLIST #ifdef __UNIX__ - #define CMD_IN_PATH _T("ls") + #define CMD_IN_PATH wxT("ls") #else - #define CMD_IN_PATH _T("command.com") + #define CMD_IN_PATH wxT("command.com") #endif static void TestPathList() { - wxPuts(_T("*** Testing wxPathList ***\n")); + wxPuts(wxT("*** Testing wxPathList ***\n")); wxPathList pathlist; - pathlist.AddEnvList(_T("PATH")); + pathlist.AddEnvList(wxT("PATH")); wxString path = pathlist.FindValidPath(CMD_IN_PATH); if ( path.empty() ) { - wxPrintf(_T("ERROR: command not found in the path.\n")); + wxPrintf(wxT("ERROR: command not found in the path.\n")); } else { - wxPrintf(_T("Command found in the path as '%s'.\n"), path.c_str()); + wxPrintf(wxT("Command found in the path as '%s'.\n"), path.c_str()); } } @@ -1600,12 +1600,12 @@ static void TestPathList() static void TestRegExInteractive() { - wxPuts(_T("*** Testing RE interactively ***")); + wxPuts(wxT("*** Testing RE interactively ***")); for ( ;; ) { wxChar pattern[128]; - wxPrintf(_T("\nEnter a pattern: ")); + wxPrintf(wxT("\nEnter a pattern: ")); if ( !wxFgets(pattern, WXSIZEOF(pattern), stdin) ) break; @@ -1621,7 +1621,7 @@ static void TestRegExInteractive() wxChar text[128]; for ( ;; ) { - wxPrintf(_T("Enter text to match: ")); + wxPrintf(wxT("Enter text to match: ")); if ( !wxFgets(text, WXSIZEOF(text), stdin) ) break; @@ -1630,11 +1630,11 @@ static void TestRegExInteractive() if ( !re.Matches(text) ) { - wxPrintf(_T("No match.\n")); + wxPrintf(wxT("No match.\n")); } else { - wxPrintf(_T("Pattern matches at '%s'\n"), re.GetMatch(text).c_str()); + wxPrintf(wxT("Pattern matches at '%s'\n"), re.GetMatch(text).c_str()); size_t start, len; for ( size_t n = 1; ; n++ ) @@ -1644,7 +1644,7 @@ static void TestRegExInteractive() break; } - wxPrintf(_T("Subexpr %u matched '%s'\n"), + wxPrintf(wxT("Subexpr %u matched '%s'\n"), n, wxString(text + start, len).c_str()); } } @@ -1688,25 +1688,25 @@ static void rfg2 (void); static void fmtchk (const wxChar *fmt) { - (void) wxPrintf(_T("%s:\t`"), fmt); + (void) wxPrintf(wxT("%s:\t`"), fmt); (void) wxPrintf(fmt, 0x12); - (void) wxPrintf(_T("'\n")); + (void) wxPrintf(wxT("'\n")); } static void fmtst1chk (const wxChar *fmt) { - (void) wxPrintf(_T("%s:\t`"), fmt); + (void) wxPrintf(wxT("%s:\t`"), fmt); (void) wxPrintf(fmt, 4, 0x12); - (void) wxPrintf(_T("'\n")); + (void) wxPrintf(wxT("'\n")); } static void fmtst2chk (const wxChar *fmt) { - (void) wxPrintf(_T("%s:\t`"), fmt); + (void) wxPrintf(wxT("%s:\t`"), fmt); (void) wxPrintf(fmt, 4, 4, 0x12); - (void) wxPrintf(_T("'\n")); + (void) wxPrintf(wxT("'\n")); } /* This page is covered by the following copyright: */ @@ -1742,125 +1742,125 @@ fp_test (void) wxChar *prefix = buf; wxChar tp[20]; - wxPuts(_T("\nFormatted output test")); - wxPrintf(_T("prefix 6d 6o 6x 6X 6u\n")); - wxStrcpy(prefix, _T("%")); + wxPuts(wxT("\nFormatted output test")); + wxPrintf(wxT("prefix 6d 6o 6x 6X 6u\n")); + wxStrcpy(prefix, wxT("%")); for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) { for (k = 0; k < 2; k++) { for (l = 0; l < 2; l++) { - wxStrcpy(prefix, _T("%")); - if (i == 0) wxStrcat(prefix, _T("-")); - if (j == 0) wxStrcat(prefix, _T("+")); - if (k == 0) wxStrcat(prefix, _T("#")); - if (l == 0) wxStrcat(prefix, _T("0")); - wxPrintf(_T("%5s |"), prefix); + wxStrcpy(prefix, wxT("%")); + if (i == 0) wxStrcat(prefix, wxT("-")); + if (j == 0) wxStrcat(prefix, wxT("+")); + if (k == 0) wxStrcat(prefix, wxT("#")); + if (l == 0) wxStrcat(prefix, wxT("0")); + wxPrintf(wxT("%5s |"), prefix); wxStrcpy(tp, prefix); - wxStrcat(tp, _T("6d |")); + wxStrcat(tp, wxT("6d |")); wxPrintf(tp, DEC); wxStrcpy(tp, prefix); - wxStrcat(tp, _T("6o |")); + wxStrcat(tp, wxT("6o |")); wxPrintf(tp, INT); wxStrcpy(tp, prefix); - wxStrcat(tp, _T("6x |")); + wxStrcat(tp, wxT("6x |")); wxPrintf(tp, INT); wxStrcpy(tp, prefix); - wxStrcat(tp, _T("6X |")); + wxStrcat(tp, wxT("6X |")); wxPrintf(tp, INT); wxStrcpy(tp, prefix); - wxStrcat(tp, _T("6u |")); + wxStrcat(tp, wxT("6u |")); wxPrintf(tp, UNS); - wxPrintf(_T("\n")); + wxPrintf(wxT("\n")); } } } } - wxPrintf(_T("%10s\n"), PointerNull); - wxPrintf(_T("%-10s\n"), PointerNull); + wxPrintf(wxT("%10s\n"), PointerNull); + wxPrintf(wxT("%-10s\n"), PointerNull); } static void TestPrintf() { - static wxChar shortstr[] = _T("Hi, Z."); - static wxChar longstr[] = _T("Good morning, Doctor Chandra. This is Hal. \ + static wxChar shortstr[] = wxT("Hi, Z."); + static wxChar longstr[] = wxT("Good morning, Doctor Chandra. This is Hal. \ I am ready for my first lesson today."); int result = 0; wxString test_format; - fmtchk(_T("%.4x")); - fmtchk(_T("%04x")); - fmtchk(_T("%4.4x")); - fmtchk(_T("%04.4x")); - fmtchk(_T("%4.3x")); - fmtchk(_T("%04.3x")); + fmtchk(wxT("%.4x")); + fmtchk(wxT("%04x")); + fmtchk(wxT("%4.4x")); + fmtchk(wxT("%04.4x")); + fmtchk(wxT("%4.3x")); + fmtchk(wxT("%04.3x")); - fmtst1chk(_T("%.*x")); - fmtst1chk(_T("%0*x")); - fmtst2chk(_T("%*.*x")); - fmtst2chk(_T("%0*.*x")); + fmtst1chk(wxT("%.*x")); + fmtst1chk(wxT("%0*x")); + fmtst2chk(wxT("%*.*x")); + fmtst2chk(wxT("%0*.*x")); - wxString bad_format = _T("bad format:\t\"%b\"\n"); + wxString bad_format = wxT("bad format:\t\"%b\"\n"); wxPrintf(bad_format.c_str()); - wxPrintf(_T("nil pointer (padded):\t\"%10p\"\n"), (void *) NULL); - - wxPrintf(_T("decimal negative:\t\"%d\"\n"), -2345); - wxPrintf(_T("octal negative:\t\"%o\"\n"), -2345); - wxPrintf(_T("hex negative:\t\"%x\"\n"), -2345); - wxPrintf(_T("long decimal number:\t\"%ld\"\n"), -123456L); - wxPrintf(_T("long octal negative:\t\"%lo\"\n"), -2345L); - wxPrintf(_T("long unsigned decimal number:\t\"%lu\"\n"), -123456L); - wxPrintf(_T("zero-padded LDN:\t\"%010ld\"\n"), -123456L); - test_format = _T("left-adjusted ZLDN:\t\"%-010ld\"\n"); + wxPrintf(wxT("nil pointer (padded):\t\"%10p\"\n"), (void *) NULL); + + wxPrintf(wxT("decimal negative:\t\"%d\"\n"), -2345); + wxPrintf(wxT("octal negative:\t\"%o\"\n"), -2345); + wxPrintf(wxT("hex negative:\t\"%x\"\n"), -2345); + wxPrintf(wxT("long decimal number:\t\"%ld\"\n"), -123456L); + wxPrintf(wxT("long octal negative:\t\"%lo\"\n"), -2345L); + wxPrintf(wxT("long unsigned decimal number:\t\"%lu\"\n"), -123456L); + wxPrintf(wxT("zero-padded LDN:\t\"%010ld\"\n"), -123456L); + test_format = wxT("left-adjusted ZLDN:\t\"%-010ld\"\n"); wxPrintf(test_format.c_str(), -123456); - wxPrintf(_T("space-padded LDN:\t\"%10ld\"\n"), -123456L); - wxPrintf(_T("left-adjusted SLDN:\t\"%-10ld\"\n"), -123456L); + wxPrintf(wxT("space-padded LDN:\t\"%10ld\"\n"), -123456L); + wxPrintf(wxT("left-adjusted SLDN:\t\"%-10ld\"\n"), -123456L); - test_format = _T("zero-padded string:\t\"%010s\"\n"); + test_format = wxT("zero-padded string:\t\"%010s\"\n"); wxPrintf(test_format.c_str(), shortstr); - test_format = _T("left-adjusted Z string:\t\"%-010s\"\n"); + test_format = wxT("left-adjusted Z string:\t\"%-010s\"\n"); wxPrintf(test_format.c_str(), shortstr); - wxPrintf(_T("space-padded string:\t\"%10s\"\n"), shortstr); - wxPrintf(_T("left-adjusted S string:\t\"%-10s\"\n"), shortstr); - wxPrintf(_T("null string:\t\"%s\"\n"), PointerNull); - wxPrintf(_T("limited string:\t\"%.22s\"\n"), longstr); - - wxPrintf(_T("e-style >= 1:\t\"%e\"\n"), 12.34); - wxPrintf(_T("e-style >= .1:\t\"%e\"\n"), 0.1234); - wxPrintf(_T("e-style < .1:\t\"%e\"\n"), 0.001234); - wxPrintf(_T("e-style big:\t\"%.60e\"\n"), 1e20); - wxPrintf(_T("e-style == .1:\t\"%e\"\n"), 0.1); - wxPrintf(_T("f-style >= 1:\t\"%f\"\n"), 12.34); - wxPrintf(_T("f-style >= .1:\t\"%f\"\n"), 0.1234); - wxPrintf(_T("f-style < .1:\t\"%f\"\n"), 0.001234); - wxPrintf(_T("g-style >= 1:\t\"%g\"\n"), 12.34); - wxPrintf(_T("g-style >= .1:\t\"%g\"\n"), 0.1234); - wxPrintf(_T("g-style < .1:\t\"%g\"\n"), 0.001234); - wxPrintf(_T("g-style big:\t\"%.60g\"\n"), 1e20); - - wxPrintf (_T(" %6.5f\n"), .099999999860301614); - wxPrintf (_T(" %6.5f\n"), .1); - wxPrintf (_T("x%5.4fx\n"), .5); - - wxPrintf (_T("%#03x\n"), 1); - - //wxPrintf (_T("something really insane: %.10000f\n"), 1.0); + wxPrintf(wxT("space-padded string:\t\"%10s\"\n"), shortstr); + wxPrintf(wxT("left-adjusted S string:\t\"%-10s\"\n"), shortstr); + wxPrintf(wxT("null string:\t\"%s\"\n"), PointerNull); + wxPrintf(wxT("limited string:\t\"%.22s\"\n"), longstr); + + wxPrintf(wxT("e-style >= 1:\t\"%e\"\n"), 12.34); + wxPrintf(wxT("e-style >= .1:\t\"%e\"\n"), 0.1234); + wxPrintf(wxT("e-style < .1:\t\"%e\"\n"), 0.001234); + wxPrintf(wxT("e-style big:\t\"%.60e\"\n"), 1e20); + wxPrintf(wxT("e-style == .1:\t\"%e\"\n"), 0.1); + wxPrintf(wxT("f-style >= 1:\t\"%f\"\n"), 12.34); + wxPrintf(wxT("f-style >= .1:\t\"%f\"\n"), 0.1234); + wxPrintf(wxT("f-style < .1:\t\"%f\"\n"), 0.001234); + wxPrintf(wxT("g-style >= 1:\t\"%g\"\n"), 12.34); + wxPrintf(wxT("g-style >= .1:\t\"%g\"\n"), 0.1234); + wxPrintf(wxT("g-style < .1:\t\"%g\"\n"), 0.001234); + wxPrintf(wxT("g-style big:\t\"%.60g\"\n"), 1e20); + + wxPrintf (wxT(" %6.5f\n"), .099999999860301614); + wxPrintf (wxT(" %6.5f\n"), .1); + wxPrintf (wxT("x%5.4fx\n"), .5); + + wxPrintf (wxT("%#03x\n"), 1); + + //wxPrintf (wxT("something really insane: %.10000f\n"), 1.0); { double d = FLT_MIN; int niter = 17; while (niter-- != 0) - wxPrintf (_T("%.17e\n"), d / 2); + wxPrintf (wxT("%.17e\n"), d / 2); fflush (stdout); } #ifndef __WATCOMC__ // Open Watcom cause compiler error here // Error! E173: col(24) floating-point constant too small to represent - wxPrintf (_T("%15.5e\n"), 4.9406564584124654e-324); + wxPrintf (wxT("%15.5e\n"), 4.9406564584124654e-324); #endif -#define FORMAT _T("|%12.4f|%12.4e|%12.4g|\n") +#define FORMAT wxT("|%12.4f|%12.4e|%12.4g|\n") wxPrintf (FORMAT, 0.0, 0.0, 0.0); wxPrintf (FORMAT, 1.0, 1.0, 1.0); wxPrintf (FORMAT, -1.0, -1.0, -1.0); @@ -1874,9 +1874,9 @@ I am ready for my first lesson today."); { wxChar buf[20]; - int rc = wxSnprintf (buf, WXSIZEOF(buf), _T("%30s"), _T("foo")); + int rc = wxSnprintf (buf, WXSIZEOF(buf), wxT("%30s"), wxT("foo")); - wxPrintf(_T("snprintf (\"%%30s\", \"foo\") == %d, \"%.*s\"\n"), + wxPrintf(wxT("snprintf (\"%%30s\", \"foo\") == %d, \"%.*s\"\n"), rc, WXSIZEOF(buf), buf); #if 0 wxChar buf2[512]; @@ -1887,54 +1887,54 @@ I am ready for my first lesson today."); fp_test (); - wxPrintf (_T("%e should be 1.234568e+06\n"), 1234567.8); - wxPrintf (_T("%f should be 1234567.800000\n"), 1234567.8); - wxPrintf (_T("%g should be 1.23457e+06\n"), 1234567.8); - wxPrintf (_T("%g should be 123.456\n"), 123.456); - wxPrintf (_T("%g should be 1e+06\n"), 1000000.0); - wxPrintf (_T("%g should be 10\n"), 10.0); - wxPrintf (_T("%g should be 0.02\n"), 0.02); + wxPrintf (wxT("%e should be 1.234568e+06\n"), 1234567.8); + wxPrintf (wxT("%f should be 1234567.800000\n"), 1234567.8); + wxPrintf (wxT("%g should be 1.23457e+06\n"), 1234567.8); + wxPrintf (wxT("%g should be 123.456\n"), 123.456); + wxPrintf (wxT("%g should be 1e+06\n"), 1000000.0); + wxPrintf (wxT("%g should be 10\n"), 10.0); + wxPrintf (wxT("%g should be 0.02\n"), 0.02); { double x=1.0; - wxPrintf(_T("%.17f\n"),(1.0/x/10.0+1.0)*x-x); + wxPrintf(wxT("%.17f\n"),(1.0/x/10.0+1.0)*x-x); } { wxChar buf[200]; - wxSprintf(buf,_T("%*s%*s%*s"),-1,_T("one"),-20,_T("two"),-30,_T("three")); + wxSprintf(buf,wxT("%*s%*s%*s"),-1,wxT("one"),-20,wxT("two"),-30,wxT("three")); result |= wxStrcmp (buf, - _T("onetwo three ")); + wxT("onetwo three ")); - wxPuts (result != 0 ? _T("Test failed!") : _T("Test ok.")); + wxPuts (result != 0 ? wxT("Test failed!") : wxT("Test ok.")); } #ifdef wxLongLong_t { wxChar buf[200]; - wxSprintf(buf, _T("%07") wxLongLongFmtSpec _T("o"), wxLL(040000000000)); + wxSprintf(buf, wxT("%07") wxLongLongFmtSpec wxT("o"), wxLL(040000000000)); #if 0 // for some reason below line fails under Borland - wxPrintf (_T("sprintf (buf, \"%%07Lo\", 040000000000ll) = %s"), buf); + wxPrintf (wxT("sprintf (buf, \"%%07Lo\", 040000000000ll) = %s"), buf); #endif - if (wxStrcmp (buf, _T("40000000000")) != 0) + if (wxStrcmp (buf, wxT("40000000000")) != 0) { result = 1; - wxPuts (_T("\tFAILED")); + wxPuts (wxT("\tFAILED")); } wxUnusedVar(result); wxPuts (wxEmptyString); } #endif // wxLongLong_t - wxPrintf (_T("printf (\"%%hhu\", %u) = %hhu\n"), UCHAR_MAX + 2, UCHAR_MAX + 2); - wxPrintf (_T("printf (\"%%hu\", %u) = %hu\n"), USHRT_MAX + 2, USHRT_MAX + 2); + wxPrintf (wxT("printf (\"%%hhu\", %u) = %hhu\n"), UCHAR_MAX + 2, UCHAR_MAX + 2); + wxPrintf (wxT("printf (\"%%hu\", %u) = %hu\n"), USHRT_MAX + 2, USHRT_MAX + 2); - wxPuts (_T("--- Should be no further output. ---")); + wxPuts (wxT("--- Should be no further output. ---")); rfg1 (); rfg2 (); @@ -1944,16 +1944,16 @@ I am ready for my first lesson today."); wxChar buf[20]; memset (bytes, '\xff', sizeof bytes); - wxSprintf (buf, _T("foo%hhn\n"), &bytes[3]); + wxSprintf (buf, wxT("foo%hhn\n"), &bytes[3]); if (bytes[0] != '\xff' || bytes[1] != '\xff' || bytes[2] != '\xff' || bytes[4] != '\xff' || bytes[5] != '\xff' || bytes[6] != '\xff') { - wxPuts (_T("%hhn overwrite more bytes")); + wxPuts (wxT("%hhn overwrite more bytes")); result = 1; } if (bytes[3] != 3) { - wxPuts (_T("%hhn wrote incorrect value")); + wxPuts (wxT("%hhn wrote incorrect value")); result = 1; } } @@ -1965,24 +1965,24 @@ rfg1 (void) { wxChar buf[100]; - wxSprintf (buf, _T("%5.s"), _T("xyz")); - if (wxStrcmp (buf, _T(" ")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" ")); - wxSprintf (buf, _T("%5.f"), 33.3); - if (wxStrcmp (buf, _T(" 33")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 33")); - wxSprintf (buf, _T("%8.e"), 33.3e7); - if (wxStrcmp (buf, _T(" 3e+08")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 3e+08")); - wxSprintf (buf, _T("%8.E"), 33.3e7); - if (wxStrcmp (buf, _T(" 3E+08")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 3E+08")); - wxSprintf (buf, _T("%.g"), 33.3); - if (wxStrcmp (buf, _T("3e+01")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T("3e+01")); - wxSprintf (buf, _T("%.G"), 33.3); - if (wxStrcmp (buf, _T("3E+01")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T("3E+01")); + wxSprintf (buf, wxT("%5.s"), wxT("xyz")); + if (wxStrcmp (buf, wxT(" ")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" ")); + wxSprintf (buf, wxT("%5.f"), 33.3); + if (wxStrcmp (buf, wxT(" 33")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 33")); + wxSprintf (buf, wxT("%8.e"), 33.3e7); + if (wxStrcmp (buf, wxT(" 3e+08")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 3e+08")); + wxSprintf (buf, wxT("%8.E"), 33.3e7); + if (wxStrcmp (buf, wxT(" 3E+08")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 3E+08")); + wxSprintf (buf, wxT("%.g"), 33.3); + if (wxStrcmp (buf, wxT("3e+01")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT("3e+01")); + wxSprintf (buf, wxT("%.G"), 33.3); + if (wxStrcmp (buf, wxT("3E+01")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT("3E+01")); } static void @@ -1993,37 +1993,37 @@ rfg2 (void) wxString test_format; prec = 0; - wxSprintf (buf, _T("%.*g"), prec, 3.3); - if (wxStrcmp (buf, _T("3")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T("3")); + wxSprintf (buf, wxT("%.*g"), prec, 3.3); + if (wxStrcmp (buf, wxT("3")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT("3")); prec = 0; - wxSprintf (buf, _T("%.*G"), prec, 3.3); - if (wxStrcmp (buf, _T("3")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T("3")); + wxSprintf (buf, wxT("%.*G"), prec, 3.3); + if (wxStrcmp (buf, wxT("3")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT("3")); prec = 0; - wxSprintf (buf, _T("%7.*G"), prec, 3.33); - if (wxStrcmp (buf, _T(" 3")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 3")); + wxSprintf (buf, wxT("%7.*G"), prec, 3.33); + if (wxStrcmp (buf, wxT(" 3")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 3")); prec = 3; - test_format = _T("%04.*o"); + test_format = wxT("%04.*o"); wxSprintf (buf, test_format.c_str(), prec, 33); - if (wxStrcmp (buf, _T(" 041")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 041")); + if (wxStrcmp (buf, wxT(" 041")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 041")); prec = 7; - test_format = _T("%09.*u"); + test_format = wxT("%09.*u"); wxSprintf (buf, test_format.c_str(), prec, 33); - if (wxStrcmp (buf, _T(" 0000033")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 0000033")); + if (wxStrcmp (buf, wxT(" 0000033")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 0000033")); prec = 3; - test_format = _T("%04.*x"); + test_format = wxT("%04.*x"); wxSprintf (buf, test_format.c_str(), prec, 33); - if (wxStrcmp (buf, _T(" 021")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 021")); + if (wxStrcmp (buf, wxT(" 021")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 021")); prec = 3; - test_format = _T("%04.*X"); + test_format = wxT("%04.*X"); wxSprintf (buf, test_format.c_str(), prec, 33); - if (wxStrcmp (buf, _T(" 021")) != 0) - wxPrintf (_T("got: '%s', expected: '%s'\n"), buf, _T(" 021")); + if (wxStrcmp (buf, wxT(" 021")) != 0) + wxPrintf (wxT("got: '%s', expected: '%s'\n"), buf, wxT(" 021")); } #endif // TEST_PRINTF @@ -2046,22 +2046,22 @@ rfg2 (void) #if 0 static void TestRegConfWrite() { - wxConfig *config = new wxConfig(_T("myapp")); - config->SetPath(_T("/group1")); - config->Write(_T("entry1"), _T("foo")); - config->SetPath(_T("/group2")); - config->Write(_T("entry1"), _T("bar")); + wxConfig *config = new wxConfig(wxT("myapp")); + config->SetPath(wxT("/group1")); + config->Write(wxT("entry1"), wxT("foo")); + config->SetPath(wxT("/group2")); + config->Write(wxT("entry1"), wxT("bar")); } #endif static void TestRegConfRead() { - wxRegConfig *config = new wxRegConfig(_T("myapp")); + wxRegConfig *config = new wxRegConfig(wxT("myapp")); wxString str; long dummy; - config->SetPath(_T("/")); - wxPuts(_T("Enumerating / subgroups:")); + config->SetPath(wxT("/")); + wxPuts(wxT("Enumerating / subgroups:")); bool bCont = config->GetFirstGroup(str, dummy); while(bCont) { @@ -2079,17 +2079,17 @@ static void TestRegConfRead() // I chose this one because I liked its name, but it probably only exists under // NT static const wxChar *TESTKEY = - _T("HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Control\\CrashControl"); + wxT("HKEY_LOCAL_MACHINE\\SYSTEM\\ControlSet001\\Control\\CrashControl"); static void TestRegistryRead() { - wxPuts(_T("*** testing registry reading ***")); + wxPuts(wxT("*** testing registry reading ***")); wxRegKey key(TESTKEY); - wxPrintf(_T("The test key name is '%s'.\n"), key.GetName().c_str()); + wxPrintf(wxT("The test key name is '%s'.\n"), key.GetName().c_str()); if ( !key.Open() ) { - wxPuts(_T("ERROR: test key can't be opened, aborting test.")); + wxPuts(wxT("ERROR: test key can't be opened, aborting test.")); return; } @@ -2097,43 +2097,43 @@ static void TestRegistryRead() size_t nSubKeys, nValues; if ( key.GetKeyInfo(&nSubKeys, NULL, &nValues, NULL) ) { - wxPrintf(_T("It has %u subkeys and %u values.\n"), nSubKeys, nValues); + wxPrintf(wxT("It has %u subkeys and %u values.\n"), nSubKeys, nValues); } - wxPrintf(_T("Enumerating values:\n")); + wxPrintf(wxT("Enumerating values:\n")); long dummy; wxString value; bool cont = key.GetFirstValue(value, dummy); while ( cont ) { - wxPrintf(_T("Value '%s': type "), value.c_str()); + wxPrintf(wxT("Value '%s': type "), value.c_str()); switch ( key.GetValueType(value) ) { - case wxRegKey::Type_None: wxPrintf(_T("ERROR (none)")); break; - case wxRegKey::Type_String: wxPrintf(_T("SZ")); break; - case wxRegKey::Type_Expand_String: wxPrintf(_T("EXPAND_SZ")); break; - case wxRegKey::Type_Binary: wxPrintf(_T("BINARY")); break; - case wxRegKey::Type_Dword: wxPrintf(_T("DWORD")); break; - case wxRegKey::Type_Multi_String: wxPrintf(_T("MULTI_SZ")); break; - default: wxPrintf(_T("other (unknown)")); break; + case wxRegKey::Type_None: wxPrintf(wxT("ERROR (none)")); break; + case wxRegKey::Type_String: wxPrintf(wxT("SZ")); break; + case wxRegKey::Type_Expand_String: wxPrintf(wxT("EXPAND_SZ")); break; + case wxRegKey::Type_Binary: wxPrintf(wxT("BINARY")); break; + case wxRegKey::Type_Dword: wxPrintf(wxT("DWORD")); break; + case wxRegKey::Type_Multi_String: wxPrintf(wxT("MULTI_SZ")); break; + default: wxPrintf(wxT("other (unknown)")); break; } - wxPrintf(_T(", value = ")); + wxPrintf(wxT(", value = ")); if ( key.IsNumericValue(value) ) { long val; key.QueryValue(value, &val); - wxPrintf(_T("%ld"), val); + wxPrintf(wxT("%ld"), val); } else // string { wxString val; key.QueryValue(value, val); - wxPrintf(_T("'%s'"), val.c_str()); + wxPrintf(wxT("'%s'"), val.c_str()); key.QueryRawValue(value, val); - wxPrintf(_T(" (raw value '%s')"), val.c_str()); + wxPrintf(wxT(" (raw value '%s')"), val.c_str()); } wxPutchar('\n'); @@ -2152,26 +2152,26 @@ static void TestRegistryAssociation() wxRegKey key; - key.SetName(_T("HKEY_CLASSES_ROOT\\.ddf") ); + key.SetName(wxT("HKEY_CLASSES_ROOT\\.ddf") ); key.Create(); - key = _T("ddxf_auto_file") ; - key.SetName(_T("HKEY_CLASSES_ROOT\\.flo") ); + key = wxT("ddxf_auto_file") ; + key.SetName(wxT("HKEY_CLASSES_ROOT\\.flo") ); key.Create(); - key = _T("ddxf_auto_file") ; - key.SetName(_T("HKEY_CLASSES_ROOT\\ddxf_auto_file\\DefaultIcon")); + key = wxT("ddxf_auto_file") ; + key.SetName(wxT("HKEY_CLASSES_ROOT\\ddxf_auto_file\\DefaultIcon")); key.Create(); - key = _T("program,0") ; - key.SetName(_T("HKEY_CLASSES_ROOT\\ddxf_auto_file\\shell\\open\\command")); + key = wxT("program,0") ; + key.SetName(wxT("HKEY_CLASSES_ROOT\\ddxf_auto_file\\shell\\open\\command")); key.Create(); - key = _T("program \"%1\"") ; + key = wxT("program \"%1\"") ; - key.SetName(_T("HKEY_CLASSES_ROOT\\.ddf") ); + key.SetName(wxT("HKEY_CLASSES_ROOT\\.ddf") ); key.DeleteSelf(); - key.SetName(_T("HKEY_CLASSES_ROOT\\.flo") ); + key.SetName(wxT("HKEY_CLASSES_ROOT\\.flo") ); key.DeleteSelf(); - key.SetName(_T("HKEY_CLASSES_ROOT\\ddxf_auto_file\\DefaultIcon")); + key.SetName(wxT("HKEY_CLASSES_ROOT\\ddxf_auto_file\\DefaultIcon")); key.DeleteSelf(); - key.SetName(_T("HKEY_CLASSES_ROOT\\ddxf_auto_file\\shell\\open\\command")); + key.SetName(wxT("HKEY_CLASSES_ROOT\\ddxf_auto_file\\shell\\open\\command")); key.DeleteSelf(); } @@ -2225,7 +2225,7 @@ static void TestScopeGuard() static void TestSocketServer() { - wxPuts(_T("*** Testing wxSocketServer ***\n")); + wxPuts(wxT("*** Testing wxSocketServer ***\n")); static const int PORT = 3000; @@ -2235,7 +2235,7 @@ static void TestSocketServer() wxSocketServer *server = new wxSocketServer(addr); if ( !server->Ok() ) { - wxPuts(_T("ERROR: failed to bind")); + wxPuts(wxT("ERROR: failed to bind")); return; } @@ -2243,16 +2243,16 @@ static void TestSocketServer() bool quit = false; while ( !quit ) { - wxPrintf(_T("Server: waiting for connection on port %d...\n"), PORT); + wxPrintf(wxT("Server: waiting for connection on port %d...\n"), PORT); wxSocketBase *socket = server->Accept(); if ( !socket ) { - wxPuts(_T("ERROR: wxSocketServer::Accept() failed.")); + wxPuts(wxT("ERROR: wxSocketServer::Accept() failed.")); break; } - wxPuts(_T("Server: got a client.")); + wxPuts(wxT("Server: got a client.")); server->SetTimeout(60); // 1 min @@ -2260,7 +2260,7 @@ static void TestSocketServer() while ( !close && socket->IsConnected() ) { wxString s; - wxChar ch = _T('\0'); + wxChar ch = wxT('\0'); for ( ;; ) { if ( socket->Read(&ch, sizeof(ch)).Error() ) @@ -2268,7 +2268,7 @@ static void TestSocketServer() // don't log error if the client just close the connection if ( socket->IsConnected() ) { - wxPuts(_T("ERROR: in wxSocket::Read.")); + wxPuts(wxT("ERROR: in wxSocket::Read.")); } break; @@ -2288,31 +2288,31 @@ static void TestSocketServer() break; } - wxPrintf(_T("Server: got '%s'.\n"), s.c_str()); - if ( s == _T("close") ) + wxPrintf(wxT("Server: got '%s'.\n"), s.c_str()); + if ( s == wxT("close") ) { - wxPuts(_T("Closing connection")); + wxPuts(wxT("Closing connection")); close = true; } - else if ( s == _T("quit") ) + else if ( s == wxT("quit") ) { close = quit = true; - wxPuts(_T("Shutting down the server")); + wxPuts(wxT("Shutting down the server")); } else // not a special command { socket->Write(s.MakeUpper().c_str(), s.length()); socket->Write("\r\n", 2); - wxPrintf(_T("Server: wrote '%s'.\n"), s.c_str()); + wxPrintf(wxT("Server: wrote '%s'.\n"), s.c_str()); } } if ( !close ) { - wxPuts(_T("Server: lost a client unexpectedly.")); + wxPuts(wxT("Server: lost a client unexpectedly.")); } socket->Destroy(); @@ -2324,36 +2324,36 @@ static void TestSocketServer() static void TestSocketClient() { - wxPuts(_T("*** Testing wxSocketClient ***\n")); + wxPuts(wxT("*** Testing wxSocketClient ***\n")); - static const wxChar *hostname = _T("www.wxwidgets.org"); + static const wxChar *hostname = wxT("www.wxwidgets.org"); wxIPV4address addr; addr.Hostname(hostname); addr.Service(80); - wxPrintf(_T("--- Attempting to connect to %s:80...\n"), hostname); + wxPrintf(wxT("--- Attempting to connect to %s:80...\n"), hostname); wxSocketClient client; if ( !client.Connect(addr) ) { - wxPrintf(_T("ERROR: failed to connect to %s\n"), hostname); + wxPrintf(wxT("ERROR: failed to connect to %s\n"), hostname); } else { - wxPrintf(_T("--- Connected to %s:%u...\n"), + wxPrintf(wxT("--- Connected to %s:%u...\n"), addr.Hostname().c_str(), addr.Service()); wxChar buf[8192]; // could use simply "GET" here I suppose wxString cmdGet = - wxString::Format(_T("GET http://%s/\r\n"), hostname); + wxString::Format(wxT("GET http://%s/\r\n"), hostname); client.Write(cmdGet, cmdGet.length()); - wxPrintf(_T("--- Sent command '%s' to the server\n"), + wxPrintf(wxT("--- Sent command '%s' to the server\n"), MakePrintable(cmdGet).c_str()); client.Read(buf, WXSIZEOF(buf)); - wxPrintf(_T("--- Server replied:\n%s"), buf); + wxPrintf(wxT("--- Server replied:\n%s"), buf); } } @@ -2373,21 +2373,21 @@ static void TestSocketClient() static wxFTP *ftp; #ifdef FTP_ANONYMOUS - static const wxChar *directory = _T("/pub"); - static const wxChar *filename = _T("welcome.msg"); + static const wxChar *directory = wxT("/pub"); + static const wxChar *filename = wxT("welcome.msg"); #else - static const wxChar *directory = _T("/etc"); - static const wxChar *filename = _T("issue"); + static const wxChar *directory = wxT("/etc"); + static const wxChar *filename = wxT("issue"); #endif static bool TestFtpConnect() { - wxPuts(_T("*** Testing FTP connect ***")); + wxPuts(wxT("*** Testing FTP connect ***")); #ifdef FTP_ANONYMOUS - static const wxChar *hostname = _T("ftp.wxwidgets.org"); + static const wxChar *hostname = wxT("ftp.wxwidgets.org"); - wxPrintf(_T("--- Attempting to connect to %s:21 anonymously...\n"), hostname); + wxPrintf(wxT("--- Attempting to connect to %s:21 anonymously...\n"), hostname); #else // !FTP_ANONYMOUS static const wxChar *hostname = "localhost"; @@ -2397,23 +2397,23 @@ static bool TestFtpConnect() ftp->SetUser(user); wxChar password[256]; - wxPrintf(_T("Password for %s: "), password); + wxPrintf(wxT("Password for %s: "), password); wxFgets(password, WXSIZEOF(password), stdin); password[wxStrlen(password) - 1] = '\0'; // chop off '\n' ftp->SetPassword(password); - wxPrintf(_T("--- Attempting to connect to %s:21 as %s...\n"), hostname, user); + wxPrintf(wxT("--- Attempting to connect to %s:21 as %s...\n"), hostname, user); #endif // FTP_ANONYMOUS/!FTP_ANONYMOUS if ( !ftp->Connect(hostname) ) { - wxPrintf(_T("ERROR: failed to connect to %s\n"), hostname); + wxPrintf(wxT("ERROR: failed to connect to %s\n"), hostname); return false; } else { - wxPrintf(_T("--- Connected to %s, current directory is '%s'\n"), + wxPrintf(wxT("--- Connected to %s, current directory is '%s'\n"), hostname, ftp->Pwd().c_str()); ftp->Close(); } @@ -2423,80 +2423,80 @@ static bool TestFtpConnect() static void TestFtpList() { - wxPuts(_T("*** Testing wxFTP file listing ***\n")); + wxPuts(wxT("*** Testing wxFTP file listing ***\n")); // test CWD if ( !ftp->ChDir(directory) ) { - wxPrintf(_T("ERROR: failed to cd to %s\n"), directory); + wxPrintf(wxT("ERROR: failed to cd to %s\n"), directory); } - wxPrintf(_T("Current directory is '%s'\n"), ftp->Pwd().c_str()); + wxPrintf(wxT("Current directory is '%s'\n"), ftp->Pwd().c_str()); // test NLIST and LIST wxArrayString files; if ( !ftp->GetFilesList(files) ) { - wxPuts(_T("ERROR: failed to get NLIST of files")); + wxPuts(wxT("ERROR: failed to get NLIST of files")); } else { - wxPrintf(_T("Brief list of files under '%s':\n"), ftp->Pwd().c_str()); + wxPrintf(wxT("Brief list of files under '%s':\n"), ftp->Pwd().c_str()); size_t count = files.GetCount(); for ( size_t n = 0; n < count; n++ ) { - wxPrintf(_T("\t%s\n"), files[n].c_str()); + wxPrintf(wxT("\t%s\n"), files[n].c_str()); } - wxPuts(_T("End of the file list")); + wxPuts(wxT("End of the file list")); } if ( !ftp->GetDirList(files) ) { - wxPuts(_T("ERROR: failed to get LIST of files")); + wxPuts(wxT("ERROR: failed to get LIST of files")); } else { - wxPrintf(_T("Detailed list of files under '%s':\n"), ftp->Pwd().c_str()); + wxPrintf(wxT("Detailed list of files under '%s':\n"), ftp->Pwd().c_str()); size_t count = files.GetCount(); for ( size_t n = 0; n < count; n++ ) { - wxPrintf(_T("\t%s\n"), files[n].c_str()); + wxPrintf(wxT("\t%s\n"), files[n].c_str()); } - wxPuts(_T("End of the file list")); + wxPuts(wxT("End of the file list")); } - if ( !ftp->ChDir(_T("..")) ) + if ( !ftp->ChDir(wxT("..")) ) { - wxPuts(_T("ERROR: failed to cd to ..")); + wxPuts(wxT("ERROR: failed to cd to ..")); } - wxPrintf(_T("Current directory is '%s'\n"), ftp->Pwd().c_str()); + wxPrintf(wxT("Current directory is '%s'\n"), ftp->Pwd().c_str()); } static void TestFtpDownload() { - wxPuts(_T("*** Testing wxFTP download ***\n")); + wxPuts(wxT("*** Testing wxFTP download ***\n")); // test RETR wxInputStream *in = ftp->GetInputStream(filename); if ( !in ) { - wxPrintf(_T("ERROR: couldn't get input stream for %s\n"), filename); + wxPrintf(wxT("ERROR: couldn't get input stream for %s\n"), filename); } else { size_t size = in->GetSize(); - wxPrintf(_T("Reading file %s (%u bytes)..."), filename, size); + wxPrintf(wxT("Reading file %s (%u bytes)..."), filename, size); fflush(stdout); wxChar *data = new wxChar[size]; if ( !in->Read(data, size) ) { - wxPuts(_T("ERROR: read error")); + wxPuts(wxT("ERROR: read error")); } else { - wxPrintf(_T("\nContents of %s:\n%s\n"), filename, data); + wxPrintf(wxT("\nContents of %s:\n%s\n"), filename, data); } delete [] data; @@ -2506,49 +2506,49 @@ static void TestFtpDownload() static void TestFtpFileSize() { - wxPuts(_T("*** Testing FTP SIZE command ***")); + wxPuts(wxT("*** Testing FTP SIZE command ***")); if ( !ftp->ChDir(directory) ) { - wxPrintf(_T("ERROR: failed to cd to %s\n"), directory); + wxPrintf(wxT("ERROR: failed to cd to %s\n"), directory); } - wxPrintf(_T("Current directory is '%s'\n"), ftp->Pwd().c_str()); + wxPrintf(wxT("Current directory is '%s'\n"), ftp->Pwd().c_str()); if ( ftp->FileExists(filename) ) { int size = ftp->GetFileSize(filename); if ( size == -1 ) - wxPrintf(_T("ERROR: couldn't get size of '%s'\n"), filename); + wxPrintf(wxT("ERROR: couldn't get size of '%s'\n"), filename); else - wxPrintf(_T("Size of '%s' is %d bytes.\n"), filename, size); + wxPrintf(wxT("Size of '%s' is %d bytes.\n"), filename, size); } else { - wxPrintf(_T("ERROR: '%s' doesn't exist\n"), filename); + wxPrintf(wxT("ERROR: '%s' doesn't exist\n"), filename); } } static void TestFtpMisc() { - wxPuts(_T("*** Testing miscellaneous wxFTP functions ***")); + wxPuts(wxT("*** Testing miscellaneous wxFTP functions ***")); - if ( ftp->SendCommand(_T("STAT")) != '2' ) + if ( ftp->SendCommand(wxT("STAT")) != '2' ) { - wxPuts(_T("ERROR: STAT failed")); + wxPuts(wxT("ERROR: STAT failed")); } else { - wxPrintf(_T("STAT returned:\n\n%s\n"), ftp->GetLastResult().c_str()); + wxPrintf(wxT("STAT returned:\n\n%s\n"), ftp->GetLastResult().c_str()); } - if ( ftp->SendCommand(_T("HELP SITE")) != '2' ) + if ( ftp->SendCommand(wxT("HELP SITE")) != '2' ) { - wxPuts(_T("ERROR: HELP SITE failed")); + wxPuts(wxT("ERROR: HELP SITE failed")); } else { - wxPrintf(_T("The list of site-specific commands:\n\n%s\n"), + wxPrintf(wxT("The list of site-specific commands:\n\n%s\n"), ftp->GetLastResult().c_str()); } } @@ -2557,13 +2557,13 @@ static void TestFtpMisc() static void TestFtpInteractive() { - wxPuts(_T("\n*** Interactive wxFTP test ***")); + wxPuts(wxT("\n*** Interactive wxFTP test ***")); wxChar buf[128]; for ( ;; ) { - wxPrintf(_T("Enter FTP command: ")); + wxPrintf(wxT("Enter FTP command: ")); if ( !wxFgets(buf, WXSIZEOF(buf), stdin) ) break; @@ -2573,77 +2573,77 @@ static void TestFtpInteractive() // special handling of LIST and NLST as they require data connection wxString start(buf, 4); start.MakeUpper(); - if ( start == _T("LIST") || start == _T("NLST") ) + if ( start == wxT("LIST") || start == wxT("NLST") ) { wxString wildcard; if ( wxStrlen(buf) > 4 ) wildcard = buf + 5; wxArrayString files; - if ( !ftp->GetList(files, wildcard, start == _T("LIST")) ) + if ( !ftp->GetList(files, wildcard, start == wxT("LIST")) ) { - wxPrintf(_T("ERROR: failed to get %s of files\n"), start.c_str()); + wxPrintf(wxT("ERROR: failed to get %s of files\n"), start.c_str()); } else { - wxPrintf(_T("--- %s of '%s' under '%s':\n"), + wxPrintf(wxT("--- %s of '%s' under '%s':\n"), start.c_str(), wildcard.c_str(), ftp->Pwd().c_str()); size_t count = files.GetCount(); for ( size_t n = 0; n < count; n++ ) { - wxPrintf(_T("\t%s\n"), files[n].c_str()); + wxPrintf(wxT("\t%s\n"), files[n].c_str()); } - wxPuts(_T("--- End of the file list")); + wxPuts(wxT("--- End of the file list")); } } else // !list { wxChar ch = ftp->SendCommand(buf); - wxPrintf(_T("Command %s"), ch ? _T("succeeded") : _T("failed")); + wxPrintf(wxT("Command %s"), ch ? wxT("succeeded") : wxT("failed")); if ( ch ) { - wxPrintf(_T(" (return code %c)"), ch); + wxPrintf(wxT(" (return code %c)"), ch); } - wxPrintf(_T(", server reply:\n%s\n\n"), ftp->GetLastResult().c_str()); + wxPrintf(wxT(", server reply:\n%s\n\n"), ftp->GetLastResult().c_str()); } } - wxPuts(_T("\n*** done ***")); + wxPuts(wxT("\n*** done ***")); } #endif // TEST_INTERACTIVE static void TestFtpUpload() { - wxPuts(_T("*** Testing wxFTP uploading ***\n")); + wxPuts(wxT("*** Testing wxFTP uploading ***\n")); // upload a file - static const wxChar *file1 = _T("test1"); - static const wxChar *file2 = _T("test2"); + static const wxChar *file1 = wxT("test1"); + static const wxChar *file2 = wxT("test2"); wxOutputStream *out = ftp->GetOutputStream(file1); if ( out ) { - wxPrintf(_T("--- Uploading to %s ---\n"), file1); + wxPrintf(wxT("--- Uploading to %s ---\n"), file1); out->Write("First hello", 11); delete out; } // send a command to check the remote file - if ( ftp->SendCommand(wxString(_T("STAT ")) + file1) != '2' ) + if ( ftp->SendCommand(wxString(wxT("STAT ")) + file1) != '2' ) { - wxPrintf(_T("ERROR: STAT %s failed\n"), file1); + wxPrintf(wxT("ERROR: STAT %s failed\n"), file1); } else { - wxPrintf(_T("STAT %s returned:\n\n%s\n"), + wxPrintf(wxT("STAT %s returned:\n\n%s\n"), file1, ftp->GetLastResult().c_str()); } out = ftp->GetOutputStream(file2); if ( out ) { - wxPrintf(_T("--- Uploading to %s ---\n"), file1); + wxPrintf(wxT("--- Uploading to %s ---\n"), file1); out->Write("Second hello", 12); delete out; } @@ -2671,7 +2671,7 @@ public: virtual void Walk(size_t skip = 1, size_t maxdepth = wxSTACKWALKER_MAX_DEPTH) { - wxPuts(_T("Stack dump:")); + wxPuts(wxT("Stack dump:")); wxStackWalker::Walk(skip, maxdepth); } @@ -2712,7 +2712,7 @@ protected: static void TestStackWalk(const char *argv0) { - wxPuts(_T("*** Testing wxStackWalker ***\n")); + wxPuts(wxT("*** Testing wxStackWalker ***\n")); StackDump dump(argv0); dump.Walk(); @@ -2733,27 +2733,27 @@ static void TestStackWalk(const char *argv0) static void TestStandardPaths() { - wxPuts(_T("*** Testing wxStandardPaths ***\n")); + wxPuts(wxT("*** Testing wxStandardPaths ***\n")); - wxTheApp->SetAppName(_T("console")); + wxTheApp->SetAppName(wxT("console")); wxStandardPathsBase& stdp = wxStandardPaths::Get(); - wxPrintf(_T("Config dir (sys):\t%s\n"), stdp.GetConfigDir().c_str()); - wxPrintf(_T("Config dir (user):\t%s\n"), stdp.GetUserConfigDir().c_str()); - wxPrintf(_T("Data dir (sys):\t\t%s\n"), stdp.GetDataDir().c_str()); - wxPrintf(_T("Data dir (sys local):\t%s\n"), stdp.GetLocalDataDir().c_str()); - wxPrintf(_T("Data dir (user):\t%s\n"), stdp.GetUserDataDir().c_str()); - wxPrintf(_T("Data dir (user local):\t%s\n"), stdp.GetUserLocalDataDir().c_str()); - wxPrintf(_T("Documents dir:\t\t%s\n"), stdp.GetDocumentsDir().c_str()); - wxPrintf(_T("Executable path:\t%s\n"), stdp.GetExecutablePath().c_str()); - wxPrintf(_T("Plugins dir:\t\t%s\n"), stdp.GetPluginsDir().c_str()); - wxPrintf(_T("Resources dir:\t\t%s\n"), stdp.GetResourcesDir().c_str()); - wxPrintf(_T("Localized res. dir:\t%s\n"), - stdp.GetLocalizedResourcesDir(_T("fr")).c_str()); - wxPrintf(_T("Message catalogs dir:\t%s\n"), + wxPrintf(wxT("Config dir (sys):\t%s\n"), stdp.GetConfigDir().c_str()); + wxPrintf(wxT("Config dir (user):\t%s\n"), stdp.GetUserConfigDir().c_str()); + wxPrintf(wxT("Data dir (sys):\t\t%s\n"), stdp.GetDataDir().c_str()); + wxPrintf(wxT("Data dir (sys local):\t%s\n"), stdp.GetLocalDataDir().c_str()); + wxPrintf(wxT("Data dir (user):\t%s\n"), stdp.GetUserDataDir().c_str()); + wxPrintf(wxT("Data dir (user local):\t%s\n"), stdp.GetUserLocalDataDir().c_str()); + wxPrintf(wxT("Documents dir:\t\t%s\n"), stdp.GetDocumentsDir().c_str()); + wxPrintf(wxT("Executable path:\t%s\n"), stdp.GetExecutablePath().c_str()); + wxPrintf(wxT("Plugins dir:\t\t%s\n"), stdp.GetPluginsDir().c_str()); + wxPrintf(wxT("Resources dir:\t\t%s\n"), stdp.GetResourcesDir().c_str()); + wxPrintf(wxT("Localized res. dir:\t%s\n"), + stdp.GetLocalizedResourcesDir(wxT("fr")).c_str()); + wxPrintf(wxT("Message catalogs dir:\t%s\n"), stdp.GetLocalizedResourcesDir ( - _T("fr"), + wxT("fr"), wxStandardPaths::ResourceCat_Messages ).c_str()); } @@ -2771,9 +2771,9 @@ static void TestStandardPaths() static void TestFileStream() { - wxPuts(_T("*** Testing wxFileInputStream ***")); + wxPuts(wxT("*** Testing wxFileInputStream ***")); - static const wxString filename = _T("testdata.fs"); + static const wxString filename = wxT("testdata.fs"); { wxFileOutputStream fsOut(filename); fsOut.Write("foo", 3); @@ -2781,7 +2781,7 @@ static void TestFileStream() { wxFileInputStream fsIn(filename); - wxPrintf(_T("File stream size: %u\n"), fsIn.GetSize()); + wxPrintf(wxT("File stream size: %u\n"), fsIn.GetSize()); int c; while ( (c=fsIn.GetC()) != wxEOF ) { @@ -2791,42 +2791,42 @@ static void TestFileStream() if ( !wxRemoveFile(filename) ) { - wxPrintf(_T("ERROR: failed to remove the file '%s'.\n"), filename.c_str()); + wxPrintf(wxT("ERROR: failed to remove the file '%s'.\n"), filename.c_str()); } - wxPuts(_T("\n*** wxFileInputStream test done ***")); + wxPuts(wxT("\n*** wxFileInputStream test done ***")); } static void TestMemoryStream() { - wxPuts(_T("*** Testing wxMemoryOutputStream ***")); + wxPuts(wxT("*** Testing wxMemoryOutputStream ***")); wxMemoryOutputStream memOutStream; - wxPrintf(_T("Initially out stream offset: %lu\n"), + wxPrintf(wxT("Initially out stream offset: %lu\n"), (unsigned long)memOutStream.TellO()); - for ( const wxChar *p = _T("Hello, stream!"); *p; p++ ) + for ( const wxChar *p = wxT("Hello, stream!"); *p; p++ ) { memOutStream.PutC(*p); } - wxPrintf(_T("Final out stream offset: %lu\n"), + wxPrintf(wxT("Final out stream offset: %lu\n"), (unsigned long)memOutStream.TellO()); - wxPuts(_T("*** Testing wxMemoryInputStream ***")); + wxPuts(wxT("*** Testing wxMemoryInputStream ***")); wxChar buf[1024]; size_t len = memOutStream.CopyTo(buf, WXSIZEOF(buf)); wxMemoryInputStream memInpStream(buf, len); - wxPrintf(_T("Memory stream size: %u\n"), memInpStream.GetSize()); + wxPrintf(wxT("Memory stream size: %u\n"), memInpStream.GetSize()); int c; while ( (c=memInpStream.GetC()) != wxEOF ) { wxPutchar(c); } - wxPuts(_T("\n*** wxMemoryInputStream test done ***")); + wxPuts(wxT("\n*** wxMemoryInputStream test done ***")); } #endif // TEST_STREAMS @@ -2842,35 +2842,35 @@ static void TestMemoryStream() static void TestStopWatch() { - wxPuts(_T("*** Testing wxStopWatch ***\n")); + wxPuts(wxT("*** Testing wxStopWatch ***\n")); wxStopWatch sw; sw.Pause(); - wxPrintf(_T("Initially paused, after 2 seconds time is...")); + wxPrintf(wxT("Initially paused, after 2 seconds time is...")); fflush(stdout); wxSleep(2); - wxPrintf(_T("\t%ldms\n"), sw.Time()); + wxPrintf(wxT("\t%ldms\n"), sw.Time()); - wxPrintf(_T("Resuming stopwatch and sleeping 3 seconds...")); + wxPrintf(wxT("Resuming stopwatch and sleeping 3 seconds...")); fflush(stdout); sw.Resume(); wxSleep(3); - wxPrintf(_T("\telapsed time: %ldms\n"), sw.Time()); + wxPrintf(wxT("\telapsed time: %ldms\n"), sw.Time()); sw.Pause(); - wxPrintf(_T("Pausing agan and sleeping 2 more seconds...")); + wxPrintf(wxT("Pausing agan and sleeping 2 more seconds...")); fflush(stdout); wxSleep(2); - wxPrintf(_T("\telapsed time: %ldms\n"), sw.Time()); + wxPrintf(wxT("\telapsed time: %ldms\n"), sw.Time()); sw.Resume(); - wxPrintf(_T("Finally resuming and sleeping 2 more seconds...")); + wxPrintf(wxT("Finally resuming and sleeping 2 more seconds...")); fflush(stdout); wxSleep(2); - wxPrintf(_T("\telapsed time: %ldms\n"), sw.Time()); + wxPrintf(wxT("\telapsed time: %ldms\n"), sw.Time()); wxStopWatch sw2; - wxPuts(_T("\nChecking for 'backwards clock' bug...")); + wxPuts(wxT("\nChecking for 'backwards clock' bug...")); for ( size_t n = 0; n < 70; n++ ) { sw2.Start(); @@ -2879,7 +2879,7 @@ static void TestStopWatch() { if ( sw.Time() < 0 || sw2.Time() < 0 ) { - wxPuts(_T("\ntime is negative - ERROR!")); + wxPuts(wxT("\ntime is negative - ERROR!")); } } @@ -2887,7 +2887,7 @@ static void TestStopWatch() fflush(stdout); } - wxPuts(_T(", ok.")); + wxPuts(wxT(", ok.")); } #include "wx/timer.h" @@ -2895,7 +2895,7 @@ static void TestStopWatch() void TestTimer() { - wxPuts(_T("*** Testing wxTimer ***\n")); + wxPuts(wxT("*** Testing wxTimer ***\n")); class MyTimer : public wxTimer { @@ -2904,16 +2904,16 @@ void TestTimer() virtual void Notify() { - wxPrintf(_T("%d"), m_num++); + wxPrintf(wxT("%d"), m_num++); fflush(stdout); if ( m_num == 10 ) { - wxPrintf(_T("... exiting the event loop")); + wxPrintf(wxT("... exiting the event loop")); Stop(); wxEventLoop::GetActive()->Exit(0); - wxPuts(_T(", ok.")); + wxPuts(wxT(", ok.")); } fflush(stdout); @@ -2952,46 +2952,46 @@ void TestTimer() static const wxChar *volumeKinds[] = { - _T("floppy"), - _T("hard disk"), - _T("CD-ROM"), - _T("DVD-ROM"), - _T("network volume"), - _T("other volume"), + wxT("floppy"), + wxT("hard disk"), + wxT("CD-ROM"), + wxT("DVD-ROM"), + wxT("network volume"), + wxT("other volume"), }; static void TestFSVolume() { - wxPuts(_T("*** Testing wxFSVolume class ***")); + wxPuts(wxT("*** Testing wxFSVolume class ***")); wxArrayString volumes = wxFSVolume::GetVolumes(); size_t count = volumes.GetCount(); if ( !count ) { - wxPuts(_T("ERROR: no mounted volumes?")); + wxPuts(wxT("ERROR: no mounted volumes?")); return; } - wxPrintf(_T("%u mounted volumes found:\n"), count); + wxPrintf(wxT("%u mounted volumes found:\n"), count); for ( size_t n = 0; n < count; n++ ) { wxFSVolume vol(volumes[n]); if ( !vol.IsOk() ) { - wxPuts(_T("ERROR: couldn't create volume")); + wxPuts(wxT("ERROR: couldn't create volume")); continue; } - wxPrintf(_T("%u: %s (%s), %s, %s, %s\n"), + wxPrintf(wxT("%u: %s (%s), %s, %s, %s\n"), n + 1, vol.GetDisplayName().c_str(), vol.GetName().c_str(), volumeKinds[vol.GetKind()], - vol.IsWritable() ? _T("rw") : _T("ro"), - vol.GetFlags() & wxFS_VOL_REMOVABLE ? _T("removable") - : _T("fixed")); + vol.IsWritable() ? wxT("rw") : wxT("ro"), + vol.GetFlags() & wxFS_VOL_REMOVABLE ? wxT("removable") + : wxT("fixed")); } } @@ -3045,14 +3045,14 @@ static const struct Utf8Data wxFontEncoding encoding; } utf8data[] = { - { utf8Invalid, WXSIZEOF(utf8Invalid), _T("iso8859-1"), wxFONTENCODING_ISO8859_1 }, - { utf8koi8r, WXSIZEOF(utf8koi8r), _T("koi8-r"), wxFONTENCODING_KOI8 }, - { utf8iso8859_1, WXSIZEOF(utf8iso8859_1), _T("iso8859-1"), wxFONTENCODING_ISO8859_1 }, + { utf8Invalid, WXSIZEOF(utf8Invalid), wxT("iso8859-1"), wxFONTENCODING_ISO8859_1 }, + { utf8koi8r, WXSIZEOF(utf8koi8r), wxT("koi8-r"), wxFONTENCODING_KOI8 }, + { utf8iso8859_1, WXSIZEOF(utf8iso8859_1), wxT("iso8859-1"), wxFONTENCODING_ISO8859_1 }, }; static void TestUtf8() { - wxPuts(_T("*** Testing UTF8 support ***\n")); + wxPuts(wxT("*** Testing UTF8 support ***\n")); char buf[1024]; wchar_t wbuf[1024]; @@ -3063,25 +3063,25 @@ static void TestUtf8() if ( wxConvUTF8.MB2WC(wbuf, (const char *)u8d.text, WXSIZEOF(wbuf)) == (size_t)-1 ) { - wxPuts(_T("ERROR: UTF-8 decoding failed.")); + wxPuts(wxT("ERROR: UTF-8 decoding failed.")); } else { wxCSConv conv(u8d.charset); if ( conv.WC2MB(buf, wbuf, WXSIZEOF(buf)) == (size_t)-1 ) { - wxPrintf(_T("ERROR: conversion to %s failed.\n"), u8d.charset); + wxPrintf(wxT("ERROR: conversion to %s failed.\n"), u8d.charset); } else { - wxPrintf(_T("String in %s: %s\n"), u8d.charset, buf); + wxPrintf(wxT("String in %s: %s\n"), u8d.charset, buf); } } wxString s(wxConvUTF8.cMB2WC((const char *)u8d.text)); if ( s.empty() ) - s = _T("<< conversion failed >>"); - wxPrintf(_T("String in current cset: %s\n"), s.c_str()); + s = wxT("<< conversion failed >>"); + wxPrintf(wxT("String in current cset: %s\n"), s.c_str()); } @@ -3090,7 +3090,7 @@ static void TestUtf8() static void TestEncodingConverter() { - wxPuts(_T("*** Testing wxEncodingConverter ***\n")); + wxPuts(wxT("*** Testing wxEncodingConverter ***\n")); // using wxEncodingConverter should give the same result as above char buf[1024]; @@ -3098,14 +3098,14 @@ static void TestEncodingConverter() if ( wxConvUTF8.MB2WC(wbuf, (const char *)utf8koi8r, WXSIZEOF(utf8koi8r)) == (size_t)-1 ) { - wxPuts(_T("ERROR: UTF-8 decoding failed.")); + wxPuts(wxT("ERROR: UTF-8 decoding failed.")); } else { wxEncodingConverter ec; ec.Init(wxFONTENCODING_UNICODE, wxFONTENCODING_KOI8); ec.Convert(wbuf, buf); - wxPrintf(_T("The same KOI8-R string using wxEC: %s\n"), buf); + wxPrintf(wxT("The same KOI8-R string using wxEC: %s\n"), buf); } wxPuts(wxEmptyString); @@ -3123,21 +3123,21 @@ static void TestEncodingConverter() #include "wx/fs_zip.h" #include "wx/zipstrm.h" -static const wxChar *TESTFILE_ZIP = _T("testdata.zip"); +static const wxChar *TESTFILE_ZIP = wxT("testdata.zip"); static void TestZipStreamRead() { - wxPuts(_T("*** Testing ZIP reading ***\n")); + wxPuts(wxT("*** Testing ZIP reading ***\n")); - static const wxString filename = _T("foo"); + static const wxString filename = wxT("foo"); wxFFileInputStream in(TESTFILE_ZIP); wxZipInputStream istr(in); wxZipEntry entry(filename); istr.OpenEntry(entry); - wxPrintf(_T("Archive size: %u\n"), istr.GetSize()); + wxPrintf(wxT("Archive size: %u\n"), istr.GetSize()); - wxPrintf(_T("Dumping the file '%s':\n"), filename.c_str()); + wxPrintf(wxT("Dumping the file '%s':\n"), filename.c_str()); int c; while ( (c=istr.GetC()) != wxEOF ) { @@ -3145,31 +3145,31 @@ static void TestZipStreamRead() fflush(stdout); } - wxPuts(_T("\n----- done ------")); + wxPuts(wxT("\n----- done ------")); } static void DumpZipDirectory(wxFileSystem& fs, const wxString& dir, const wxString& indent) { - wxString prefix = wxString::Format(_T("%s#zip:%s"), + wxString prefix = wxString::Format(wxT("%s#zip:%s"), TESTFILE_ZIP, dir.c_str()); - wxString wildcard = prefix + _T("/*"); + wxString wildcard = prefix + wxT("/*"); wxString dirname = fs.FindFirst(wildcard, wxDIR); while ( !dirname.empty() ) { - if ( !dirname.StartsWith(prefix + _T('/'), &dirname) ) + if ( !dirname.StartsWith(prefix + wxT('/'), &dirname) ) { - wxPrintf(_T("ERROR: unexpected wxFileSystem::FindNext result\n")); + wxPrintf(wxT("ERROR: unexpected wxFileSystem::FindNext result\n")); break; } - wxPrintf(_T("%s%s\n"), indent.c_str(), dirname.c_str()); + wxPrintf(wxT("%s%s\n"), indent.c_str(), dirname.c_str()); DumpZipDirectory(fs, dirname, - indent + wxString(_T(' '), 4)); + indent + wxString(wxT(' '), 4)); dirname = fs.FindNext(); } @@ -3179,12 +3179,12 @@ static void DumpZipDirectory(wxFileSystem& fs, { if ( !filename.StartsWith(prefix, &filename) ) { - wxPrintf(_T("ERROR: unexpected wxFileSystem::FindNext result\n")); + wxPrintf(wxT("ERROR: unexpected wxFileSystem::FindNext result\n")); break; } - wxPrintf(_T("%s%s\n"), indent.c_str(), filename.c_str()); + wxPrintf(wxT("%s%s\n"), indent.c_str(), filename.c_str()); filename = fs.FindNext(); } @@ -3192,13 +3192,13 @@ static void DumpZipDirectory(wxFileSystem& fs, static void TestZipFileSystem() { - wxPuts(_T("*** Testing ZIP file system ***\n")); + wxPuts(wxT("*** Testing ZIP file system ***\n")); wxFileSystem::AddHandler(new wxZipFSHandler); wxFileSystem fs; - wxPrintf(_T("Dumping all files in the archive %s:\n"), TESTFILE_ZIP); + wxPrintf(wxT("Dumping all files in the archive %s:\n"), TESTFILE_ZIP); - DumpZipDirectory(fs, _T(""), wxString(_T(' '), 4)); + DumpZipDirectory(fs, wxT(""), wxString(wxT(' '), 4)); } #endif // TEST_ZIP @@ -3218,17 +3218,17 @@ static void TestZipFileSystem() static void TestTimeStatic() { - wxPuts(_T("\n*** wxDateTime static methods test ***")); + wxPuts(wxT("\n*** wxDateTime static methods test ***")); // some info about the current date int year = wxDateTime::GetCurrentYear(); - wxPrintf(_T("Current year %d is %sa leap one and has %d days.\n"), + wxPrintf(wxT("Current year %d is %sa leap one and has %d days.\n"), year, wxDateTime::IsLeapYear(year) ? "" : "not ", wxDateTime::GetNumberOfDays(year)); wxDateTime::Month month = wxDateTime::GetCurrentMonth(); - wxPrintf(_T("Current month is '%s' ('%s') and it has %d days\n"), + wxPrintf(wxT("Current month is '%s' ('%s') and it has %d days\n"), wxDateTime::GetMonthName(month, wxDateTime::Name_Abbr).c_str(), wxDateTime::GetMonthName(month).c_str(), wxDateTime::GetNumberOfDays(month)); @@ -3237,23 +3237,23 @@ static void TestTimeStatic() // test time zones stuff static void TestTimeZones() { - wxPuts(_T("\n*** wxDateTime timezone test ***")); + wxPuts(wxT("\n*** wxDateTime timezone test ***")); wxDateTime now = wxDateTime::Now(); - wxPrintf(_T("Current GMT time:\t%s\n"), now.Format(_T("%c"), wxDateTime::GMT0).c_str()); - wxPrintf(_T("Unix epoch (GMT):\t%s\n"), wxDateTime((time_t)0).Format(_T("%c"), wxDateTime::GMT0).c_str()); - wxPrintf(_T("Unix epoch (EST):\t%s\n"), wxDateTime((time_t)0).Format(_T("%c"), wxDateTime::EST).c_str()); - wxPrintf(_T("Current time in Paris:\t%s\n"), now.Format(_T("%c"), wxDateTime::CET).c_str()); - wxPrintf(_T(" Moscow:\t%s\n"), now.Format(_T("%c"), wxDateTime::MSK).c_str()); - wxPrintf(_T(" New York:\t%s\n"), now.Format(_T("%c"), wxDateTime::EST).c_str()); + wxPrintf(wxT("Current GMT time:\t%s\n"), now.Format(wxT("%c"), wxDateTime::GMT0).c_str()); + wxPrintf(wxT("Unix epoch (GMT):\t%s\n"), wxDateTime((time_t)0).Format(wxT("%c"), wxDateTime::GMT0).c_str()); + wxPrintf(wxT("Unix epoch (EST):\t%s\n"), wxDateTime((time_t)0).Format(wxT("%c"), wxDateTime::EST).c_str()); + wxPrintf(wxT("Current time in Paris:\t%s\n"), now.Format(wxT("%c"), wxDateTime::CET).c_str()); + wxPrintf(wxT(" Moscow:\t%s\n"), now.Format(wxT("%c"), wxDateTime::MSK).c_str()); + wxPrintf(wxT(" New York:\t%s\n"), now.Format(wxT("%c"), wxDateTime::EST).c_str()); - wxPrintf(_T("%s\n"), wxDateTime::Now().Format(_T("Our timezone is %Z")).c_str()); + wxPrintf(wxT("%s\n"), wxDateTime::Now().Format(wxT("Our timezone is %Z")).c_str()); wxDateTime::Tm tm = now.GetTm(); if ( wxDateTime(tm) != now ) { - wxPrintf(_T("ERROR: got %s instead of %s\n"), + wxPrintf(wxT("ERROR: got %s instead of %s\n"), wxDateTime(tm).Format().c_str(), now.Format().c_str()); } } @@ -3261,33 +3261,33 @@ static void TestTimeZones() // test some minimal support for the dates outside the standard range static void TestTimeRange() { - wxPuts(_T("\n*** wxDateTime out-of-standard-range dates test ***")); + wxPuts(wxT("\n*** wxDateTime out-of-standard-range dates test ***")); - static const wxChar *fmt = _T("%d-%b-%Y %H:%M:%S"); + static const wxChar *fmt = wxT("%d-%b-%Y %H:%M:%S"); - wxPrintf(_T("Unix epoch:\t%s\n"), + wxPrintf(wxT("Unix epoch:\t%s\n"), wxDateTime(2440587.5).Format(fmt).c_str()); - wxPrintf(_T("Feb 29, 0: \t%s\n"), + wxPrintf(wxT("Feb 29, 0: \t%s\n"), wxDateTime(29, wxDateTime::Feb, 0).Format(fmt).c_str()); - wxPrintf(_T("JDN 0: \t%s\n"), + wxPrintf(wxT("JDN 0: \t%s\n"), wxDateTime(0.0).Format(fmt).c_str()); - wxPrintf(_T("Jan 1, 1AD:\t%s\n"), + wxPrintf(wxT("Jan 1, 1AD:\t%s\n"), wxDateTime(1, wxDateTime::Jan, 1).Format(fmt).c_str()); - wxPrintf(_T("May 29, 2099:\t%s\n"), + wxPrintf(wxT("May 29, 2099:\t%s\n"), wxDateTime(29, wxDateTime::May, 2099).Format(fmt).c_str()); } // test DST calculations static void TestTimeDST() { - wxPuts(_T("\n*** wxDateTime DST test ***")); + wxPuts(wxT("\n*** wxDateTime DST test ***")); - wxPrintf(_T("DST is%s in effect now.\n\n"), - wxDateTime::Now().IsDST() ? wxEmptyString : _T(" not")); + wxPrintf(wxT("DST is%s in effect now.\n\n"), + wxDateTime::Now().IsDST() ? wxEmptyString : wxT(" not")); for ( int year = 1990; year < 2005; year++ ) { - wxPrintf(_T("DST period in Europe for year %d: from %s to %s\n"), + wxPrintf(wxT("DST period in Europe for year %d: from %s to %s\n"), year, wxDateTime::GetBeginDST(year, wxDateTime::Country_EEC).Format().c_str(), wxDateTime::GetEndDST(year, wxDateTime::Country_EEC).Format().c_str()); @@ -3300,13 +3300,13 @@ static void TestTimeDST() static void TestDateTimeInteractive() { - wxPuts(_T("\n*** interactive wxDateTime tests ***")); + wxPuts(wxT("\n*** interactive wxDateTime tests ***")); wxChar buf[128]; for ( ;; ) { - wxPrintf(_T("Enter a date: ")); + wxPrintf(wxT("Enter a date: ")); if ( !wxFgets(buf, WXSIZEOF(buf), stdin) ) break; @@ -3317,24 +3317,24 @@ static void TestDateTimeInteractive() const wxChar *p = dt.ParseDate(buf); if ( !p ) { - wxPrintf(_T("ERROR: failed to parse the date '%s'.\n"), buf); + wxPrintf(wxT("ERROR: failed to parse the date '%s'.\n"), buf); continue; } else if ( *p ) { - wxPrintf(_T("WARNING: parsed only first %u characters.\n"), p - buf); + wxPrintf(wxT("WARNING: parsed only first %u characters.\n"), p - buf); } - wxPrintf(_T("%s: day %u, week of month %u/%u, week of year %u\n"), - dt.Format(_T("%b %d, %Y")).c_str(), + wxPrintf(wxT("%s: day %u, week of month %u/%u, week of year %u\n"), + dt.Format(wxT("%b %d, %Y")).c_str(), dt.GetDayOfYear(), dt.GetWeekOfMonth(wxDateTime::Monday_First), dt.GetWeekOfMonth(wxDateTime::Sunday_First), dt.GetWeekOfYear(wxDateTime::Monday_First)); } - wxPuts(_T("\n*** done ***")); + wxPuts(wxT("\n*** done ***")); } #endif // TEST_INTERACTIVE @@ -3343,39 +3343,39 @@ static void TestDateTimeInteractive() static void TestTimeMS() { - wxPuts(_T("*** testing millisecond-resolution support in wxDateTime ***")); + wxPuts(wxT("*** testing millisecond-resolution support in wxDateTime ***")); wxDateTime dt1 = wxDateTime::Now(), dt2 = wxDateTime::UNow(); - wxPrintf(_T("Now = %s\n"), dt1.Format(_T("%H:%M:%S:%l")).c_str()); - wxPrintf(_T("UNow = %s\n"), dt2.Format(_T("%H:%M:%S:%l")).c_str()); - wxPrintf(_T("Dummy loop: ")); + wxPrintf(wxT("Now = %s\n"), dt1.Format(wxT("%H:%M:%S:%l")).c_str()); + wxPrintf(wxT("UNow = %s\n"), dt2.Format(wxT("%H:%M:%S:%l")).c_str()); + wxPrintf(wxT("Dummy loop: ")); for ( int i = 0; i < 6000; i++ ) { //for ( int j = 0; j < 10; j++ ) { wxString s; - s.Printf(_T("%g"), sqrt((float)i)); + s.Printf(wxT("%g"), sqrt((float)i)); } if ( !(i % 100) ) wxPutchar('.'); } - wxPuts(_T(", done")); + wxPuts(wxT(", done")); dt1 = dt2; dt2 = wxDateTime::UNow(); - wxPrintf(_T("UNow = %s\n"), dt2.Format(_T("%H:%M:%S:%l")).c_str()); + wxPrintf(wxT("UNow = %s\n"), dt2.Format(wxT("%H:%M:%S:%l")).c_str()); - wxPrintf(_T("Loop executed in %s ms\n"), (dt2 - dt1).Format(_T("%l")).c_str()); + wxPrintf(wxT("Loop executed in %s ms\n"), (dt2 - dt1).Format(wxT("%l")).c_str()); - wxPuts(_T("\n*** done ***")); + wxPuts(wxT("\n*** done ***")); } static void TestTimeHolidays() { - wxPuts(_T("\n*** testing wxDateTimeHolidayAuthority ***\n")); + wxPuts(wxT("\n*** testing wxDateTimeHolidayAuthority ***\n")); wxDateTime::Tm tm = wxDateTime(29, wxDateTime::May, 2000).GetTm(); wxDateTime dtStart(1, tm.mon, tm.year), @@ -3384,15 +3384,15 @@ static void TestTimeHolidays() wxDateTimeArray hol; wxDateTimeHolidayAuthority::GetHolidaysInRange(dtStart, dtEnd, hol); - const wxChar *format = _T("%d-%b-%Y (%a)"); + const wxChar *format = wxT("%d-%b-%Y (%a)"); - wxPrintf(_T("All holidays between %s and %s:\n"), + wxPrintf(wxT("All holidays between %s and %s:\n"), dtStart.Format(format).c_str(), dtEnd.Format(format).c_str()); size_t count = hol.GetCount(); for ( size_t n = 0; n < count; n++ ) { - wxPrintf(_T("\t%s\n"), hol[n].Format(format).c_str()); + wxPrintf(wxT("\t%s\n"), hol[n].Format(format).c_str()); } wxPuts(wxEmptyString); @@ -3400,13 +3400,13 @@ static void TestTimeHolidays() static void TestTimeZoneBug() { - wxPuts(_T("\n*** testing for DST/timezone bug ***\n")); + wxPuts(wxT("\n*** testing for DST/timezone bug ***\n")); wxDateTime date = wxDateTime(1, wxDateTime::Mar, 2000); for ( int i = 0; i < 31; i++ ) { - wxPrintf(_T("Date %s: week day %s.\n"), - date.Format(_T("%d-%m-%Y")).c_str(), + wxPrintf(wxT("Date %s: week day %s.\n"), + date.Format(wxT("%d-%m-%Y")).c_str(), date.GetWeekDayName(date.GetWeekDay()).c_str()); date += wxDateSpan::Day(); @@ -3417,24 +3417,24 @@ static void TestTimeZoneBug() static void TestTimeSpanFormat() { - wxPuts(_T("\n*** wxTimeSpan tests ***")); + wxPuts(wxT("\n*** wxTimeSpan tests ***")); static const wxChar *formats[] = { - _T("(default) %H:%M:%S"), - _T("%E weeks and %D days"), - _T("%l milliseconds"), - _T("(with ms) %H:%M:%S:%l"), - _T("100%% of minutes is %M"), // test "%%" - _T("%D days and %H hours"), - _T("or also %S seconds"), + wxT("(default) %H:%M:%S"), + wxT("%E weeks and %D days"), + wxT("%l milliseconds"), + wxT("(with ms) %H:%M:%S:%l"), + wxT("100%% of minutes is %M"), // test "%%" + wxT("%D days and %H hours"), + wxT("or also %S seconds"), }; wxTimeSpan ts1(1, 2, 3, 4), ts2(111, 222, 333); for ( size_t n = 0; n < WXSIZEOF(formats); n++ ) { - wxPrintf(_T("ts1 = %s\tts2 = %s\n"), + wxPrintf(wxT("ts1 = %s\tts2 = %s\n"), ts1.Format(formats[n]).c_str(), ts2.Format(formats[n]).c_str()); } @@ -3457,13 +3457,13 @@ static void TestTimeSpanFormat() static void TestTextInputStream() { - wxPuts(_T("\n*** wxTextInputStream test ***")); + wxPuts(wxT("\n*** wxTextInputStream test ***")); - wxString filename = _T("testdata.fc"); + wxString filename = wxT("testdata.fc"); wxFileInputStream fsIn(filename); if ( !fsIn.Ok() ) { - wxPuts(_T("ERROR: couldn't open file.")); + wxPuts(wxT("ERROR: couldn't open file.")); } else { @@ -3479,7 +3479,7 @@ static void TestTextInputStream() if ( fsIn.Eof() && s.empty() ) break; - wxPrintf(_T("Line %d: %s\n"), line++, s.c_str()); + wxPrintf(wxT("Line %d: %s\n"), line++, s.c_str()); } } } @@ -3580,7 +3580,7 @@ wxThread::ExitCode MyDetachedThread::Entry() void MyDetachedThread::OnExit() { - wxLogTrace(_T("thread"), _T("Thread %ld is in OnExit"), GetId()); + wxLogTrace(wxT("thread"), wxT("Thread %ld is in OnExit"), GetId()); wxCriticalSectionLocker lock(gs_critsect); if ( !--gs_counter && !m_cancelled ) @@ -3589,7 +3589,7 @@ void MyDetachedThread::OnExit() static void TestDetachedThreads() { - wxPuts(_T("\n*** Testing detached threads ***")); + wxPuts(wxT("\n*** Testing detached threads ***")); static const size_t nThreads = 3; MyDetachedThread *threads[nThreads]; @@ -3615,19 +3615,19 @@ static void TestDetachedThreads() static void TestJoinableThreads() { - wxPuts(_T("\n*** Testing a joinable thread (a loooong calculation...) ***")); + wxPuts(wxT("\n*** Testing a joinable thread (a loooong calculation...) ***")); // calc 10! in the background MyJoinableThread thread(10); thread.Run(); - wxPrintf(_T("\nThread terminated with exit code %lu.\n"), + wxPrintf(wxT("\nThread terminated with exit code %lu.\n"), (unsigned long)thread.Wait()); } static void TestThreadSuspend() { - wxPuts(_T("\n*** Testing thread suspend/resume functions ***")); + wxPuts(wxT("\n*** Testing thread suspend/resume functions ***")); MyDetachedThread *thread = new MyDetachedThread(15, 'X'); @@ -3645,18 +3645,18 @@ static void TestThreadSuspend() { thread->Pause(); - wxPuts(_T("\nThread suspended")); + wxPuts(wxT("\nThread suspended")); if ( n > 0 ) { // don't sleep but resume immediately the first time wxThread::Sleep(300); } - wxPuts(_T("Going to resume the thread")); + wxPuts(wxT("Going to resume the thread")); thread->Resume(); } - wxPuts(_T("Waiting until it terminates now")); + wxPuts(wxT("Waiting until it terminates now")); // wait until the thread terminates gs_cond.Wait(); @@ -3671,13 +3671,13 @@ static void TestThreadDelete() // running when we delete it - deleting a detached thread which already // terminated will lead to a crash! - wxPuts(_T("\n*** Testing thread delete function ***")); + wxPuts(wxT("\n*** Testing thread delete function ***")); MyDetachedThread *thread0 = new MyDetachedThread(30, 'W'); thread0->Delete(); - wxPuts(_T("\nDeleted a thread which didn't start to run yet.")); + wxPuts(wxT("\nDeleted a thread which didn't start to run yet.")); MyDetachedThread *thread1 = new MyDetachedThread(30, 'Y'); @@ -3687,7 +3687,7 @@ static void TestThreadDelete() thread1->Delete(); - wxPuts(_T("\nDeleted a running thread.")); + wxPuts(wxT("\nDeleted a running thread.")); MyDetachedThread *thread2 = new MyDetachedThread(30, 'Z'); @@ -3699,14 +3699,14 @@ static void TestThreadDelete() thread2->Delete(); - wxPuts(_T("\nDeleted a sleeping thread.")); + wxPuts(wxT("\nDeleted a sleeping thread.")); MyJoinableThread thread3(20); thread3.Run(); thread3.Delete(); - wxPuts(_T("\nDeleted a joinable thread.")); + wxPuts(wxT("\nDeleted a joinable thread.")); MyJoinableThread thread4(2); thread4.Run(); @@ -3715,7 +3715,7 @@ static void TestThreadDelete() thread4.Delete(); - wxPuts(_T("\nDeleted a joinable thread which already terminated.")); + wxPuts(wxT("\nDeleted a joinable thread which already terminated.")); wxPuts(wxEmptyString); } @@ -3733,19 +3733,19 @@ public: virtual ExitCode Entry() { - wxPrintf(_T("Thread %lu has started running.\n"), GetId()); + wxPrintf(wxT("Thread %lu has started running.\n"), GetId()); fflush(stdout); gs_cond.Post(); - wxPrintf(_T("Thread %lu starts to wait...\n"), GetId()); + wxPrintf(wxT("Thread %lu starts to wait...\n"), GetId()); fflush(stdout); m_mutex->Lock(); m_condition->Wait(); m_mutex->Unlock(); - wxPrintf(_T("Thread %lu finished to wait, exiting.\n"), GetId()); + wxPrintf(wxT("Thread %lu finished to wait, exiting.\n"), GetId()); fflush(stdout); return 0; @@ -3763,7 +3763,7 @@ static void TestThreadConditions() // otherwise its difficult to understand which log messages pertain to // which condition - //wxLogTrace(_T("thread"), _T("Local condition var is %08x, gs_cond = %08x"), + //wxLogTrace(wxT("thread"), wxT("Local condition var is %08x, gs_cond = %08x"), // condition.GetId(), gs_cond.GetId()); // create and launch threads @@ -3781,7 +3781,7 @@ static void TestThreadConditions() } // wait until all threads run - wxPuts(_T("Main thread is waiting for the other threads to start")); + wxPuts(wxT("Main thread is waiting for the other threads to start")); fflush(stdout); size_t nRunning = 0; @@ -3791,18 +3791,18 @@ static void TestThreadConditions() nRunning++; - wxPrintf(_T("Main thread: %u already running\n"), nRunning); + wxPrintf(wxT("Main thread: %u already running\n"), nRunning); fflush(stdout); } - wxPuts(_T("Main thread: all threads started up.")); + wxPuts(wxT("Main thread: all threads started up.")); fflush(stdout); wxThread::Sleep(500); #if 1 // now wake one of them up - wxPrintf(_T("Main thread: about to signal the condition.\n")); + wxPrintf(wxT("Main thread: about to signal the condition.\n")); fflush(stdout); condition.Signal(); #endif @@ -3810,7 +3810,7 @@ static void TestThreadConditions() wxThread::Sleep(200); // wake all the (remaining) threads up, so that they can exit - wxPrintf(_T("Main thread: about to broadcast the condition.\n")); + wxPrintf(wxT("Main thread: about to broadcast the condition.\n")); fflush(stdout); condition.Broadcast(); @@ -3834,17 +3834,17 @@ public: virtual ExitCode Entry() { - wxPrintf(_T("%s: Thread #%d (%ld) starting to wait for semaphore...\n"), + wxPrintf(wxT("%s: Thread #%d (%ld) starting to wait for semaphore...\n"), wxDateTime::Now().FormatTime().c_str(), m_i, (long)GetId()); m_sem->Wait(); - wxPrintf(_T("%s: Thread #%d (%ld) acquired the semaphore.\n"), + wxPrintf(wxT("%s: Thread #%d (%ld) acquired the semaphore.\n"), wxDateTime::Now().FormatTime().c_str(), m_i, (long)GetId()); Sleep(1000); - wxPrintf(_T("%s: Thread #%d (%ld) releasing the semaphore.\n"), + wxPrintf(wxT("%s: Thread #%d (%ld) releasing the semaphore.\n"), wxDateTime::Now().FormatTime().c_str(), m_i, (long)GetId()); m_sem->Post(); @@ -3861,7 +3861,7 @@ WX_DEFINE_ARRAY_PTR(wxThread *, ArrayThreads); static void TestSemaphore() { - wxPuts(_T("*** Testing wxSemaphore class. ***")); + wxPuts(wxT("*** Testing wxSemaphore class. ***")); static const int SEM_LIMIT = 3; @@ -3923,22 +3923,22 @@ int main(int argc, char **argv) #ifdef TEST_SNGLINST wxSingleInstanceChecker checker; - if ( checker.Create(_T(".wxconsole.lock")) ) + if ( checker.Create(wxT(".wxconsole.lock")) ) { if ( checker.IsAnotherRunning() ) { - wxPrintf(_T("Another instance of the program is running, exiting.\n")); + wxPrintf(wxT("Another instance of the program is running, exiting.\n")); return 1; } // wait some time to give time to launch another instance - wxPrintf(_T("Press \"Enter\" to continue...")); + wxPrintf(wxT("Press \"Enter\" to continue...")); wxFgetc(stdin); } else // failed to create { - wxPrintf(_T("Failed to init wxSingleInstanceChecker.\n")); + wxPrintf(wxT("Failed to init wxSingleInstanceChecker.\n")); } #endif // TEST_SNGLINST @@ -3970,14 +3970,14 @@ int main(int argc, char **argv) wxCmdLineParser parser(cmdLineDesc, argc, wxArgv); - parser.AddOption(_T("project_name"), _T(""), _T("full path to project file"), + parser.AddOption(wxT("project_name"), wxT(""), wxT("full path to project file"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_OPTION_MANDATORY | wxCMD_LINE_NEEDS_SEPARATOR); switch ( parser.Parse() ) { case -1: - wxLogMessage(_T("Help was given, terminating.")); + wxLogMessage(wxT("Help was given, terminating.")); break; case 0: @@ -3985,7 +3985,7 @@ int main(int argc, char **argv) break; default: - wxLogMessage(_T("Syntax error detected, aborting.")); + wxLogMessage(wxT("Syntax error detected, aborting.")); break; } #endif // wxUSE_CMDLINE_PARSER @@ -4018,19 +4018,19 @@ int main(int argc, char **argv) #endif // TEST_LOCALE #ifdef TEST_LOG - wxPuts(_T("*** Testing wxLog ***")); + wxPuts(wxT("*** Testing wxLog ***")); wxString s; for ( size_t n = 0; n < 8000; n++ ) { - s << (wxChar)(_T('A') + (n % 26)); + s << (wxChar)(wxT('A') + (n % 26)); } - wxLogWarning(_T("The length of the string is %lu"), + wxLogWarning(wxT("The length of the string is %lu"), (unsigned long)s.length()); wxString msg; - msg.Printf(_T("A very very long message: '%s', the end!\n"), s.c_str()); + msg.Printf(wxT("A very very long message: '%s', the end!\n"), s.c_str()); // this one shouldn't be truncated wxPrintf(msg); @@ -4038,7 +4038,7 @@ int main(int argc, char **argv) // but this one will because log functions use fixed size buffer // (note that it doesn't need '\n' at the end neither - will be added // by wxLog anyhow) - wxLogMessage(_T("A very very long message 2: '%s', the end!"), s.c_str()); + wxLogMessage(wxT("A very very long message 2: '%s', the end!"), s.c_str()); #endif // TEST_LOG #ifdef TEST_FILE @@ -4091,7 +4091,7 @@ int main(int argc, char **argv) #endif // TEST_FTP #ifdef TEST_MIME - //wxLog::AddTraceMask(_T("mime")); + //wxLog::AddTraceMask(wxT("mime")); TestMimeEnum(); #if 0 TestMimeOverride(); @@ -4152,7 +4152,7 @@ int main(int argc, char **argv) #ifdef TEST_THREADS int nCPUs = wxThread::GetCPUCount(); - wxPrintf(_T("This system has %d CPUs\n"), nCPUs); + wxPrintf(wxT("This system has %d CPUs\n"), nCPUs); if ( nCPUs != -1 ) wxThread::SetConcurrency(nCPUs); @@ -4206,7 +4206,7 @@ int main(int argc, char **argv) #endif #ifdef TEST_USLEEP - wxPuts(_T("Sleeping for 3 seconds... z-z-z-z-z...")); + wxPuts(wxT("Sleeping for 3 seconds... z-z-z-z-z...")); wxUsleep(3000); #endif // TEST_USLEEP diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 1a2f51ba43..330fcd6efc 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -251,7 +251,7 @@ public: void OnDClick(wxMouseEvent& event) { - wxLogMessage(_T("MyButton::OnDClick")); + wxLogMessage(wxT("MyButton::OnDClick")); event.Skip(); } @@ -281,7 +281,7 @@ protected: void OnKeyUp(wxKeyEvent& event); void OnFocusGot(wxFocusEvent& event) { - wxLogMessage(_T("MyComboBox::OnFocusGot")); + wxLogMessage(wxT("MyComboBox::OnFocusGot")); event.Skip(); } @@ -312,14 +312,14 @@ public: protected: void OnFocusGot(wxFocusEvent& event) { - wxLogMessage(_T("MyRadioBox::OnFocusGot")); + wxLogMessage(wxT("MyRadioBox::OnFocusGot")); event.Skip(); } void OnFocusLost(wxFocusEvent& event) { - wxLogMessage(_T("MyRadioBox::OnFocusLost")); + wxLogMessage(wxT("MyRadioBox::OnFocusLost")); event.Skip(); } @@ -346,14 +346,14 @@ public: protected: void OnFocusGot(wxFocusEvent& event) { - wxLogMessage(_T("MyChoice::OnFocusGot")); + wxLogMessage(wxT("MyChoice::OnFocusGot")); event.Skip(); } void OnFocusLost(wxFocusEvent& event) { - wxLogMessage(_T("MyChoice::OnFocusLost")); + wxLogMessage(wxT("MyChoice::OnFocusLost")); event.Skip(); } @@ -419,7 +419,7 @@ bool MyApp::OnInit() #endif // wxUSE_HELP // Create the main frame window - MyFrame *frame = new MyFrame(_T("Controls wxWidgets App"), x, y); + MyFrame *frame = new MyFrame(wxT("Controls wxWidgets App"), x, y); frame->Show(true); return true; @@ -646,7 +646,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_book = NULL; m_label = NULL; - m_text = new wxTextCtrl(this, wxID_ANY, _T("This is the log window.\n"), + m_text = new wxTextCtrl(this, wxID_ANY, wxT("This is the log window.\n"), wxPoint(0, 250), wxSize(100, 50), wxTE_MULTILINE); m_logTargetOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_text)); @@ -655,11 +655,11 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) wxString choices[] = { - _T("This"), - _T("is"), - _T("one of my long and"), - _T("wonderful"), - _T("examples.") + wxT("This"), + wxT("is"), + wxT("one of my long and"), + wxT("wonderful"), + wxT("examples.") }; #ifdef USE_XPM @@ -709,13 +709,13 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) static const wxChar *s_iconNames[Image_Max] = { - _T("list") - , _T("choice") - , _T("combo") - , _T("text") - , _T("radio") + wxT("list") + , wxT("choice") + , wxT("combo") + , wxT("text") + , wxT("radio") #if wxUSE_GAUGE - , _T("gauge") + , wxT("gauge") #endif // wxUSE_GAUGE }; @@ -758,22 +758,22 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_listbox->SetCursor(*wxCROSS_CURSOR); - m_lbSelectNum = new wxButton( panel, ID_LISTBOX_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) ); - m_lbSelectThis = new wxButton( panel, ID_LISTBOX_SEL_STR, _T("&Select 'This'"), wxPoint(340,30), wxSize(140,30) ); - (void)new wxButton( panel, ID_LISTBOX_CLEAR, _T("&Clear"), wxPoint(180,80), wxSize(140,30) ); - (void)new MyButton( panel, ID_LISTBOX_APPEND, _T("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) ); - (void)new wxButton( panel, ID_LISTBOX_DELETE, _T("D&elete selected item"), wxPoint(180,130), wxSize(140,30) ); - wxButton *button = new MyButton( panel, ID_LISTBOX_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); + m_lbSelectNum = new wxButton( panel, ID_LISTBOX_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) ); + m_lbSelectThis = new wxButton( panel, ID_LISTBOX_SEL_STR, wxT("&Select 'This'"), wxPoint(340,30), wxSize(140,30) ); + (void)new wxButton( panel, ID_LISTBOX_CLEAR, wxT("&Clear"), wxPoint(180,80), wxSize(140,30) ); + (void)new MyButton( panel, ID_LISTBOX_APPEND, wxT("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) ); + (void)new wxButton( panel, ID_LISTBOX_DELETE, wxT("D&elete selected item"), wxPoint(180,130), wxSize(140,30) ); + wxButton *button = new MyButton( panel, ID_LISTBOX_FONT, wxT("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); button->SetDefault(); - m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, _T("&Disable"), wxPoint(20,170) ); + m_checkbox = new wxCheckBox( panel, ID_LISTBOX_ENABLE, wxT("&Disable"), wxPoint(20,170) ); m_checkbox->SetValue(false); button->MoveAfterInTabOrder(m_checkbox); - (void)new wxCheckBox( panel, ID_CHANGE_COLOUR, _T("&Toggle colour"), + (void)new wxCheckBox( panel, ID_CHANGE_COLOUR, wxT("&Toggle colour"), wxPoint(110,170) ); panel->SetCursor(wxCursor(wxCURSOR_HAND)); - m_book->AddPage(panel, _T("wxListBox"), true, Image_List); + m_book->AddPage(panel, wxT("wxListBox"), true, Image_List); #if wxUSE_CHOICE panel = new wxPanel(m_book); @@ -785,73 +785,73 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) SetChoiceClientData(wxT("choice"), m_choiceSorted); m_choice->SetSelection(2); - (void)new wxButton( panel, ID_CHOICE_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) ); - (void)new wxButton( panel, ID_CHOICE_SEL_STR, _T("&Select 'This'"), wxPoint(340,30), wxSize(140,30) ); - (void)new wxButton( panel, ID_CHOICE_CLEAR, _T("&Clear"), wxPoint(180,80), wxSize(140,30) ); - (void)new wxButton( panel, ID_CHOICE_APPEND, _T("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) ); - (void)new wxButton( panel, ID_CHOICE_DELETE, _T("D&elete selected item"), wxPoint(180,130), wxSize(140,30) ); - (void)new wxButton( panel, ID_CHOICE_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); - (void)new wxCheckBox( panel, ID_CHOICE_ENABLE, _T("&Disable"), wxPoint(20,130), wxSize(140,30) ); - - m_book->AddPage(panel, _T("wxChoice"), false, Image_Choice); + (void)new wxButton( panel, ID_CHOICE_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) ); + (void)new wxButton( panel, ID_CHOICE_SEL_STR, wxT("&Select 'This'"), wxPoint(340,30), wxSize(140,30) ); + (void)new wxButton( panel, ID_CHOICE_CLEAR, wxT("&Clear"), wxPoint(180,80), wxSize(140,30) ); + (void)new wxButton( panel, ID_CHOICE_APPEND, wxT("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) ); + (void)new wxButton( panel, ID_CHOICE_DELETE, wxT("D&elete selected item"), wxPoint(180,130), wxSize(140,30) ); + (void)new wxButton( panel, ID_CHOICE_FONT, wxT("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); + (void)new wxCheckBox( panel, ID_CHOICE_ENABLE, wxT("&Disable"), wxPoint(20,130), wxSize(140,30) ); + + m_book->AddPage(panel, wxT("wxChoice"), false, Image_Choice); #endif // wxUSE_CHOICE panel = new wxPanel(m_book); - (void)new wxStaticBox( panel, wxID_ANY, _T("&Box around combobox"), + (void)new wxStaticBox( panel, wxID_ANY, wxT("&Box around combobox"), wxPoint(5, 5), wxSize(150, 100)); - m_combo = new MyComboBox( panel, ID_COMBO, _T("This"), + m_combo = new MyComboBox( panel, ID_COMBO, wxT("This"), wxPoint(20,25), wxSize(120, wxDefaultCoord), 5, choices, wxTE_PROCESS_ENTER); - (void)new wxButton( panel, ID_COMBO_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) ); - (void)new wxButton( panel, ID_COMBO_SEL_STR, _T("&Select 'This'"), wxPoint(340,30), wxSize(140,30) ); - (void)new wxButton( panel, ID_COMBO_CLEAR, _T("&Clear"), wxPoint(180,80), wxSize(140,30) ); - (void)new wxButton( panel, ID_COMBO_APPEND, _T("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) ); - (void)new wxButton( panel, ID_COMBO_DELETE, _T("D&elete selected item"), wxPoint(180,130), wxSize(140,30) ); - (void)new wxButton( panel, ID_COMBO_FONT, _T("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); - (void)new wxButton( panel, ID_COMBO_SET_TEXT, _T("Set 'Hi!' at #2"), wxPoint(340,180), wxSize(140,30) ); - (void)new wxCheckBox( panel, ID_COMBO_ENABLE, _T("&Disable"), wxPoint(20,130), wxSize(140,30) ); - m_book->AddPage(panel, _T("wxComboBox"), false, Image_Combo); + (void)new wxButton( panel, ID_COMBO_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) ); + (void)new wxButton( panel, ID_COMBO_SEL_STR, wxT("&Select 'This'"), wxPoint(340,30), wxSize(140,30) ); + (void)new wxButton( panel, ID_COMBO_CLEAR, wxT("&Clear"), wxPoint(180,80), wxSize(140,30) ); + (void)new wxButton( panel, ID_COMBO_APPEND, wxT("&Append 'Hi!'"), wxPoint(340,80), wxSize(140,30) ); + (void)new wxButton( panel, ID_COMBO_DELETE, wxT("D&elete selected item"), wxPoint(180,130), wxSize(140,30) ); + (void)new wxButton( panel, ID_COMBO_FONT, wxT("Set &Italic font"), wxPoint(340,130), wxSize(140,30) ); + (void)new wxButton( panel, ID_COMBO_SET_TEXT, wxT("Set 'Hi!' at #2"), wxPoint(340,180), wxSize(140,30) ); + (void)new wxCheckBox( panel, ID_COMBO_ENABLE, wxT("&Disable"), wxPoint(20,130), wxSize(140,30) ); + m_book->AddPage(panel, wxT("wxComboBox"), false, Image_Combo); wxString choices2[] = { - _T("First"), _T("Second"), + wxT("First"), wxT("Second"), /* "Third", "Fourth", "Fifth", "Sixth", "Seventh", "Eighth", "Nineth", "Tenth" */ }; panel = new wxPanel(m_book); - new MyRadioBox(panel, ID_RADIOBOX2, _T("&That"), + new MyRadioBox(panel, ID_RADIOBOX2, wxT("&That"), wxPoint(10,160), wxDefaultSize, WXSIZEOF(choices2), choices2, 1, wxRA_SPECIFY_ROWS ); - m_radio = new wxRadioBox(panel, ID_RADIOBOX, _T("T&his"), + m_radio = new wxRadioBox(panel, ID_RADIOBOX, wxT("T&his"), wxPoint(10,10), wxDefaultSize, WXSIZEOF(choices), choices, 1, wxRA_SPECIFY_COLS ); #if wxUSE_HELP for( unsigned int item = 0; item < WXSIZEOF(choices); ++item ) - m_radio->SetItemHelpText( item, wxString::Format( _T("Help text for \"%s\""), choices[item].c_str() ) ); + m_radio->SetItemHelpText( item, wxString::Format( wxT("Help text for \"%s\""), choices[item].c_str() ) ); // erase help text for the second item - m_radio->SetItemHelpText( 1, _T("") ); + m_radio->SetItemHelpText( 1, wxT("") ); // set default help text for control - m_radio->SetHelpText( _T("Default helptext for wxRadioBox") ); + m_radio->SetHelpText( wxT("Default helptext for wxRadioBox") ); #endif // wxUSE_HELP - (void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) ); - (void)new wxButton( panel, ID_RADIOBOX_SEL_STR, _T("&Select 'This'"), wxPoint(180,80), wxSize(140,30) ); - m_fontButton = new wxButton( panel, ID_SET_FONT, _T("Set &more Italic font"), wxPoint(340,30), wxSize(140,30) ); - (void)new wxButton( panel, ID_RADIOBOX_FONT, _T("Set &Italic font"), wxPoint(340,80), wxSize(140,30) ); - (void)new wxCheckBox( panel, ID_RADIOBOX_ENABLE, _T("&Disable"), wxPoint(340,130), wxDefaultSize ); + (void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, wxT("Select #&2"), wxPoint(180,30), wxSize(140,30) ); + (void)new wxButton( panel, ID_RADIOBOX_SEL_STR, wxT("&Select 'This'"), wxPoint(180,80), wxSize(140,30) ); + m_fontButton = new wxButton( panel, ID_SET_FONT, wxT("Set &more Italic font"), wxPoint(340,30), wxSize(140,30) ); + (void)new wxButton( panel, ID_RADIOBOX_FONT, wxT("Set &Italic font"), wxPoint(340,80), wxSize(140,30) ); + (void)new wxCheckBox( panel, ID_RADIOBOX_ENABLE, wxT("&Disable"), wxPoint(340,130), wxDefaultSize ); - wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, _T("Radiobutton1"), wxPoint(210,170), wxDefaultSize, wxRB_GROUP ); + wxRadioButton *rb = new wxRadioButton( panel, ID_RADIOBUTTON_1, wxT("Radiobutton1"), wxPoint(210,170), wxDefaultSize, wxRB_GROUP ); rb->SetValue( false ); - (void)new wxRadioButton( panel, ID_RADIOBUTTON_2, _T("&Radiobutton2"), wxPoint(340,170), wxDefaultSize ); - m_book->AddPage(panel, _T("wxRadioBox"), false, Image_Radio); + (void)new wxRadioButton( panel, ID_RADIOBUTTON_2, wxT("&Radiobutton2"), wxPoint(340,170), wxDefaultSize ); + m_book->AddPage(panel, wxT("wxRadioBox"), false, Image_Radio); #if wxUSE_SLIDER && wxUSE_GAUGE @@ -860,7 +860,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) wxBoxSizer *main_sizer = new wxBoxSizer( wxHORIZONTAL ); panel->SetSizer( main_sizer ); - wxStaticBoxSizer *gauge_sizer = new wxStaticBoxSizer( wxHORIZONTAL, panel, _T("&wxGauge and wxSlider") ); + wxStaticBoxSizer *gauge_sizer = new wxStaticBoxSizer( wxHORIZONTAL, panel, wxT("&wxGauge and wxSlider") ); main_sizer->Add( gauge_sizer, 0, wxALL, 5 ); wxBoxSizer *sz = new wxBoxSizer( wxVERTICAL ); gauge_sizer->Add( sz ); @@ -879,7 +879,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) - wxStaticBox *sb = new wxStaticBox( panel, wxID_ANY, _T("&Explanation"), + wxStaticBox *sb = new wxStaticBox( panel, wxID_ANY, wxT("&Explanation"), wxDefaultPosition, wxDefaultSize ); //, wxALIGN_CENTER ); wxStaticBoxSizer *wrapping_sizer = new wxStaticBoxSizer( sb, wxVERTICAL ); main_sizer->Add( wrapping_sizer, 0, wxALL, 5 ); @@ -887,18 +887,18 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) #ifdef __WXMOTIF__ // No wrapping text in wxStaticText yet :-( m_wrappingText = new wxStaticText( panel, wxID_ANY, - _T("Drag the slider!"), + wxT("Drag the slider!"), wxPoint(250,30), wxSize(240, wxDefaultCoord) ); #else m_wrappingText = new wxStaticText( panel, wxID_ANY, - _T("In order see the gauge (aka progress bar) ") - _T("control do something you have to drag the ") - _T("handle of the slider to the right.") - _T("\n\n") - _T("This is also supposed to demonstrate how ") - _T("to use static controls with line wrapping."), + wxT("In order see the gauge (aka progress bar) ") + wxT("control do something you have to drag the ") + wxT("handle of the slider to the right.") + wxT("\n\n") + wxT("This is also supposed to demonstrate how ") + wxT("to use static controls with line wrapping."), wxDefaultPosition, wxSize(240, wxDefaultCoord) ); @@ -909,7 +909,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) main_sizer->Add( non_wrapping_sizer, 0, wxALL, 5 ); m_nonWrappingText = new wxStaticText( panel, wxID_ANY, - _T("This static text has two lines.\nThey do not wrap."), + wxT("This static text has two lines.\nThey do not wrap."), wxDefaultPosition, wxDefaultSize ); @@ -927,7 +927,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_spinbutton->SetValue(initialSpinValue); #if wxUSE_PROGRESSDLG - m_btnProgress = new wxButton( panel, ID_BTNPROGRESS, _T("&Show progress dialog"), + m_btnProgress = new wxButton( panel, ID_BTNPROGRESS, wxT("&Show progress dialog"), wxPoint(300, 160) ); #endif // wxUSE_PROGRESSDLG #endif // wxUSE_SPINBTN @@ -938,7 +938,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_spinctrl->SetValue(15); #endif // wxUSE_SPINCTRL - m_book->AddPage(panel, _T("wxGauge"), false, Image_Gauge); + m_book->AddPage(panel, wxT("wxGauge"), false, Image_Gauge); #endif // wxUSE_SLIDER && wxUSE_GAUGE @@ -960,16 +960,16 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) dc.SetPen(*wxRED_PEN); dc.Clear(); dc.DrawEllipse(5, 5, 90, 90); - dc.DrawText(_T("Bitmap"), 30, 40); + dc.DrawText(wxT("Bitmap"), 30, 40); dc.SelectObject( wxNullBitmap ); (void)new wxBitmapButton(panel, ID_BITMAP_BTN, bitmap, wxPoint(100, 20)); (void)new wxToggleButton(panel, ID_BITMAP_BTN_ENABLE, - _T("Enable/disable &bitmap"), wxPoint(100, 140)); + wxT("Enable/disable &bitmap"), wxPoint(100, 140)); #if defined(__WXMSW__) || defined(__WXMOTIF__) // test for masked bitmap display - bitmap = wxBitmap(_T("test2.bmp"), wxBITMAP_TYPE_BMP); + bitmap = wxBitmap(wxT("test2.bmp"), wxBITMAP_TYPE_BMP); if (bitmap.Ok()) { bitmap.SetMask(new wxMask(bitmap, *wxBLUE)); @@ -992,14 +992,14 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) bmpBtn->SetBitmapFocus(bmp3); (void)new wxToggleButton(panel, ID_BUTTON_LABEL, - _T("&Toggle label"), wxPoint(250, 20)); + wxT("&Toggle label"), wxPoint(250, 20)); - m_label = new wxStaticText(panel, wxID_ANY, _T("Label with some long text"), + m_label = new wxStaticText(panel, wxID_ANY, wxT("Label with some long text"), wxPoint(250, 60), wxDefaultSize, wxALIGN_RIGHT /*| wxST_NO_AUTORESIZE*/); m_label->SetForegroundColour( *wxBLUE ); - m_book->AddPage(panel, _T("wxBitmapXXX")); + m_book->AddPage(panel, wxT("wxBitmapXXX")); // sizer panel = new wxPanel(m_book); @@ -1007,25 +1007,25 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) wxBoxSizer *sizer = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer *csizer = - new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, _T("Show Buttons")), wxHORIZONTAL ); + new wxStaticBoxSizer (new wxStaticBox (panel, wxID_ANY, wxT("Show Buttons")), wxHORIZONTAL ); wxCheckBox *check1, *check2, *check3, *check4, *check14, *checkBig; - check1 = new wxCheckBox (panel, ID_SIZER_CHECK1, _T("1")); + check1 = new wxCheckBox (panel, ID_SIZER_CHECK1, wxT("1")); check1->SetValue (true); csizer->Add (check1); - check2 = new wxCheckBox (panel, ID_SIZER_CHECK2, _T("2")); + check2 = new wxCheckBox (panel, ID_SIZER_CHECK2, wxT("2")); check2->SetValue (true); csizer->Add (check2); - check3 = new wxCheckBox (panel, ID_SIZER_CHECK3, _T("3")); + check3 = new wxCheckBox (panel, ID_SIZER_CHECK3, wxT("3")); check3->SetValue (true); csizer->Add (check3); - check4 = new wxCheckBox (panel, ID_SIZER_CHECK4, _T("4")); + check4 = new wxCheckBox (panel, ID_SIZER_CHECK4, wxT("4")); check4->SetValue (true); csizer->Add (check4); - check14 = new wxCheckBox (panel, ID_SIZER_CHECK14, _T("1-4")); + check14 = new wxCheckBox (panel, ID_SIZER_CHECK14, wxT("1-4")); check14->SetValue (true); csizer->Add (check14); - checkBig = new wxCheckBox (panel, ID_SIZER_CHECKBIG, _T("Big")); + checkBig = new wxCheckBox (panel, ID_SIZER_CHECKBIG, wxT("Big")); checkBig->SetValue (true); csizer->Add (checkBig); @@ -1035,27 +1035,27 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_buttonSizer = new wxBoxSizer (wxVERTICAL); - m_sizerBtn1 = new wxButton(panel, wxID_ANY, _T("Test Button &1 (tab order 1)") ); + m_sizerBtn1 = new wxButton(panel, wxID_ANY, wxT("Test Button &1 (tab order 1)") ); m_buttonSizer->Add( m_sizerBtn1, 0, wxALL, 10 ); - m_sizerBtn2 = new wxButton(panel, wxID_ANY, _T("Test Button &2 (tab order 3)") ); + m_sizerBtn2 = new wxButton(panel, wxID_ANY, wxT("Test Button &2 (tab order 3)") ); m_buttonSizer->Add( m_sizerBtn2, 0, wxALL, 10 ); - m_sizerBtn3 = new wxButton(panel, wxID_ANY, _T("Test Button &3 (tab order 2)") ); + m_sizerBtn3 = new wxButton(panel, wxID_ANY, wxT("Test Button &3 (tab order 2)") ); m_buttonSizer->Add( m_sizerBtn3, 0, wxALL, 10 ); - m_sizerBtn4 = new wxButton(panel, wxID_ANY, _T("Test Button &4 (tab order 4)") ); + m_sizerBtn4 = new wxButton(panel, wxID_ANY, wxT("Test Button &4 (tab order 4)") ); m_buttonSizer->Add( m_sizerBtn4, 0, wxALL, 10 ); m_sizerBtn3->MoveBeforeInTabOrder(m_sizerBtn2); m_hsizer->Add (m_buttonSizer); m_hsizer->Add( 20,20, 1 ); - m_bigBtn = new wxButton(panel, wxID_ANY, _T("Multiline\nbutton") ); + m_bigBtn = new wxButton(panel, wxID_ANY, wxT("Multiline\nbutton") ); m_hsizer->Add( m_bigBtn , 3, wxGROW|wxALL, 10 ); sizer->Add (m_hsizer, 1, wxGROW); panel->SetSizer( sizer ); - m_book->AddPage(panel, _T("wxSizer")); + m_book->AddPage(panel, wxT("wxSizer")); // set the sizer for the panel itself sizer = new wxBoxSizer(wxVERTICAL); @@ -1121,7 +1121,7 @@ void MyPanel::OnIdle(wxIdleEvent& event) { if ( s_selCombo != INVALID_SELECTION ) { - wxLogMessage(_T("EVT_IDLE: combobox selection changed from %d to %d"), + wxLogMessage(wxT("EVT_IDLE: combobox selection changed from %d to %d"), s_selCombo, sel); } @@ -1134,7 +1134,7 @@ void MyPanel::OnIdle(wxIdleEvent& event) { if ( s_selChoice != INVALID_SELECTION ) { - wxLogMessage(_T("EVT_IDLE: choice selection changed from %d to %d"), + wxLogMessage(wxT("EVT_IDLE: choice selection changed from %d to %d"), s_selChoice, sel); } @@ -1149,10 +1149,10 @@ void MyPanel::OnPageChanging( wxBookCtrlEvent &event ) int selOld = event.GetOldSelection(); if ( selOld == 2 ) { - if ( wxMessageBox(_T("This demonstrates how a program may prevent the\n") - _T("page change from taking place - if you select\n") - _T("[No] the current page will stay the third one\n"), - _T("Control sample"), + if ( wxMessageBox(wxT("This demonstrates how a program may prevent the\n") + wxT("page change from taking place - if you select\n") + wxT("[No] the current page will stay the third one\n"), + wxT("Control sample"), wxICON_QUESTION | wxYES_NO, this) != wxYES ) { event.Veto(); @@ -1161,28 +1161,28 @@ void MyPanel::OnPageChanging( wxBookCtrlEvent &event ) } } - *m_text << _T("Book selection is being changed from ") << selOld - << _T(" to ") << event.GetSelection() - << _T(" (current page from book is ") - << m_book->GetSelection() << _T(")\n"); + *m_text << wxT("Book selection is being changed from ") << selOld + << wxT(" to ") << event.GetSelection() + << wxT(" (current page from book is ") + << m_book->GetSelection() << wxT(")\n"); } void MyPanel::OnPageChanged( wxBookCtrlEvent &event ) { - *m_text << _T("Book selection is now ") << event.GetSelection() - << _T(" (from book: ") << m_book->GetSelection() - << _T(")\n"); + *m_text << wxT("Book selection is now ") << event.GetSelection() + << wxT(" (from book: ") << m_book->GetSelection() + << wxT(")\n"); } void MyPanel::OnTestButton(wxCommandEvent& event) { - wxLogMessage(_T("Button %c clicked."), - event.GetId() == ID_BUTTON_TEST1 ? _T('1') : _T('2')); + wxLogMessage(wxT("Button %c clicked."), + event.GetId() == ID_BUTTON_TEST1 ? wxT('1') : wxT('2')); } void MyPanel::OnBmpButton(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Bitmap button clicked.")); + wxLogMessage(wxT("Bitmap button clicked.")); } void MyPanel::OnBmpButtonToggle(wxCommandEvent& event) @@ -1227,44 +1227,44 @@ void MyPanel::OnListBox( wxCommandEvent &event ) { deselect = !event.IsSelection(); if (deselect) - m_text->AppendText( _T("ListBox deselection event\n") ); + m_text->AppendText( wxT("ListBox deselection event\n") ); } - m_text->AppendText( _T("ListBox event selection string is: '") ); + m_text->AppendText( wxT("ListBox event selection string is: '") ); m_text->AppendText( event.GetString() ); - m_text->AppendText( _T("'\n") ); + m_text->AppendText( wxT("'\n") ); // can't use GetStringSelection() with multiple selections, there could be // more than one of them if ( !listbox->HasFlag(wxLB_MULTIPLE) && !listbox->HasFlag(wxLB_EXTENDED) ) { - m_text->AppendText( _T("ListBox control selection string is: '") ); + m_text->AppendText( wxT("ListBox control selection string is: '") ); m_text->AppendText( listbox->GetStringSelection() ); - m_text->AppendText( _T("'\n") ); + m_text->AppendText( wxT("'\n") ); } wxStringClientData *obj = ((wxStringClientData *)event.GetClientObject()); - m_text->AppendText( _T("ListBox event client data string is: '") ); + m_text->AppendText( wxT("ListBox event client data string is: '") ); if (obj) // BC++ doesn't like use of '? .. : .. ' in this context m_text->AppendText( obj->GetData() ); else - m_text->AppendText( wxString(_T("none")) ); + m_text->AppendText( wxString(wxT("none")) ); - m_text->AppendText( _T("'\n") ); - m_text->AppendText( _T("ListBox control client data string is: '") ); + m_text->AppendText( wxT("'\n") ); + m_text->AppendText( wxT("ListBox control client data string is: '") ); obj = (wxStringClientData *)listbox->GetClientObject(event.GetInt()); if (obj) m_text->AppendText( obj->GetData() ); else - m_text->AppendText( wxString(_T("none")) ); - m_text->AppendText( _T("'\n") ); + m_text->AppendText( wxString(wxT("none")) ); + m_text->AppendText( wxT("'\n") ); } void MyPanel::OnListBoxDoubleClick( wxCommandEvent &event ) { - m_text->AppendText( _T("ListBox double click string is: ") ); + m_text->AppendText( wxT("ListBox double click string is: ") ); m_text->AppendText( event.GetString() ); - m_text->AppendText( _T("\n") ); + m_text->AppendText( wxT("\n") ); } void MyPanel::OnListBoxButtons( wxCommandEvent &event ) @@ -1273,13 +1273,13 @@ void MyPanel::OnListBoxButtons( wxCommandEvent &event ) { case ID_LISTBOX_ENABLE: { - m_text->AppendText(_T("Checkbox clicked.\n")); + m_text->AppendText(wxT("Checkbox clicked.\n")); #if wxUSE_TOOLTIPS wxCheckBox *cb = (wxCheckBox*)event.GetEventObject(); if (event.GetInt()) - cb->SetToolTip( _T("Click to enable listbox") ); + cb->SetToolTip( wxT("Click to enable listbox") ); else - cb->SetToolTip( _T("Click to disable listbox") ); + cb->SetToolTip( wxT("Click to disable listbox") ); #endif // wxUSE_TOOLTIPS m_listbox->Enable( event.GetInt() == 0 ); m_lbSelectThis->Enable( event.GetInt() == 0 ); @@ -1299,10 +1299,10 @@ void MyPanel::OnListBoxButtons( wxCommandEvent &event ) } case ID_LISTBOX_SEL_STR: { - if (m_listbox->FindString(_T("This")) != wxNOT_FOUND) - m_listbox->SetStringSelection( _T("This") ); - if (m_listboxSorted->FindString(_T("This")) != wxNOT_FOUND) - m_listboxSorted->SetStringSelection( _T("This") ); + if (m_listbox->FindString(wxT("This")) != wxNOT_FOUND) + m_listbox->SetStringSelection( wxT("This") ); + if (m_listboxSorted->FindString(wxT("This")) != wxNOT_FOUND) + m_listboxSorted->SetStringSelection( wxT("This") ); m_lbSelectNum->WarpPointer( 40, 14 ); break; } @@ -1314,8 +1314,8 @@ void MyPanel::OnListBoxButtons( wxCommandEvent &event ) } case ID_LISTBOX_APPEND: { - m_listbox->Append( _T("Hi kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk!") ); - m_listboxSorted->Append( _T("Hi hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!") ); + m_listbox->Append( wxT("Hi kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk!") ); + m_listboxSorted->Append( wxT("Hi hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!") ); break; } case ID_LISTBOX_DELETE: @@ -1357,9 +1357,9 @@ void MyPanel::OnChoice( wxCommandEvent &event ) wxClientData *dataEvt = event.GetClientObject(), *dataCtrl = choice->GetClientObject(sel); - wxLogMessage(_T("EVT_CHOICE: item %d/%d (event/control), ") - _T("string \"%s\"/\"%s\", ") - _T("data \"%s\"/\"%s\""), + wxLogMessage(wxT("EVT_CHOICE: item %d/%d (event/control), ") + wxT("string \"%s\"/\"%s\", ") + wxT("data \"%s\"/\"%s\""), (int)event.GetInt(), sel, event.GetString(), @@ -1386,8 +1386,8 @@ void MyPanel::OnChoiceButtons( wxCommandEvent &event ) } case ID_CHOICE_SEL_STR: { - m_choice->SetStringSelection( _T("This") ); - m_choiceSorted->SetStringSelection( _T("This") ); + m_choice->SetStringSelection( wxT("This") ); + m_choiceSorted->SetStringSelection( wxT("This") ); break; } case ID_CHOICE_CLEAR: @@ -1398,8 +1398,8 @@ void MyPanel::OnChoiceButtons( wxCommandEvent &event ) } case ID_CHOICE_APPEND: { - m_choice->Append( _T("Hi!") ); - m_choiceSorted->Append( _T("Hi!") ); + m_choice->Append( wxT("Hi!") ); + m_choiceSorted->Append( wxT("Hi!") ); break; } case ID_CHOICE_DELETE: @@ -1427,7 +1427,7 @@ void MyPanel::OnCombo( wxCommandEvent &event ) if (!m_combo) return; - wxLogMessage(_T("EVT_COMBOBOX: item %d/%d (event/control), string \"%s\"/\"%s\""), + wxLogMessage(wxT("EVT_COMBOBOX: item %d/%d (event/control), string \"%s\"/\"%s\""), (int)event.GetInt(), m_combo->GetSelection(), event.GetString().c_str(), @@ -1448,7 +1448,7 @@ void MyPanel::OnComboTextEnter(wxCommandEvent& WXUNUSED(event)) { if (m_combo) { - wxLogMessage(_T("Enter pressed in the combobox: value is '%s'."), + wxLogMessage(wxT("Enter pressed in the combobox: value is '%s'."), m_combo->GetValue().c_str()); } } @@ -1469,7 +1469,7 @@ void MyPanel::OnComboButtons( wxCommandEvent &event ) } case ID_COMBO_SEL_STR: { - m_combo->SetStringSelection( _T("This") ); + m_combo->SetStringSelection( wxT("This") ); break; } case ID_COMBO_CLEAR: @@ -1479,7 +1479,7 @@ void MyPanel::OnComboButtons( wxCommandEvent &event ) } case ID_COMBO_APPEND: { - m_combo->Append( _T("Hi!") ); + m_combo->Append( wxT("Hi!") ); break; } case ID_COMBO_DELETE: @@ -1503,19 +1503,19 @@ void MyPanel::OnComboButtons( wxCommandEvent &event ) void MyPanel::OnRadio( wxCommandEvent &event ) { - m_text->AppendText( _T("RadioBox selection string is: ") ); + m_text->AppendText( wxT("RadioBox selection string is: ") ); m_text->AppendText( event.GetString() ); - m_text->AppendText( _T("\n") ); + m_text->AppendText( wxT("\n") ); } void MyPanel::OnRadioButton1( wxCommandEvent & WXUNUSED(event) ) { - wxMessageBox(_T("First wxRadioButton selected."), _T("wxControl sample")); + wxMessageBox(wxT("First wxRadioButton selected."), wxT("wxControl sample")); } void MyPanel::OnRadioButton2( wxCommandEvent & WXUNUSED(event) ) { - m_text->AppendText(_T("Second wxRadioButton selected.\n")); + m_text->AppendText(wxT("Second wxRadioButton selected.\n")); } void MyPanel::OnRadioButtons( wxCommandEvent &event ) @@ -1531,7 +1531,7 @@ void MyPanel::OnRadioButtons( wxCommandEvent &event ) break; case ID_RADIOBOX_SEL_STR: - m_radio->SetStringSelection( _T("This") ); + m_radio->SetStringSelection( wxT("This") ); break; case ID_RADIOBOX_FONT: @@ -1548,8 +1548,8 @@ void MyPanel::OnSetFont( wxCommandEvent &WXUNUSED(event) ) void MyPanel::OnUpdateLabel( wxCommandEvent &event ) { - m_label->SetLabel(event.GetInt() ? _T("Very very very very very long text.") - : _T("Shorter text.")); + m_label->SetLabel(event.GetInt() ? wxT("Very very very very very long text.") + : wxT("Shorter text.")); } #if wxUSE_SLIDER @@ -1571,7 +1571,7 @@ void MyPanel::OnSpinCtrlText(wxCommandEvent& event) if ( m_spinctrl ) { wxString s; - s.Printf( _T("Spin ctrl text changed: now %d (from event: %s)\n"), + s.Printf( wxT("Spin ctrl text changed: now %d (from event: %s)\n"), m_spinctrl->GetValue(), event.GetString().c_str() ); m_text->AppendText(s); } @@ -1582,7 +1582,7 @@ void MyPanel::OnSpinCtrl(wxSpinEvent& event) if ( m_spinctrl ) { wxString s; - s.Printf( _T("Spin ctrl changed: now %d (from event: %d)\n"), + s.Printf( wxT("Spin ctrl changed: now %d (from event: %d)\n"), m_spinctrl->GetValue(), event.GetInt() ); m_text->AppendText(s); } @@ -1593,7 +1593,7 @@ void MyPanel::OnSpinCtrlUp(wxSpinEvent& event) if ( m_spinctrl ) { m_text->AppendText( wxString::Format( - _T("Spin up: %d (from event: %d)\n"), + wxT("Spin up: %d (from event: %d)\n"), m_spinctrl->GetValue(), event.GetInt() ) ); } } @@ -1603,7 +1603,7 @@ void MyPanel::OnSpinCtrlDown(wxSpinEvent& event) if ( m_spinctrl ) { m_text->AppendText( wxString::Format( - _T("Spin down: %d (from event: %d)\n"), + wxT("Spin down: %d (from event: %d)\n"), m_spinctrl->GetValue(), event.GetInt() ) ); } } @@ -1614,12 +1614,12 @@ void MyPanel::OnSpinCtrlDown(wxSpinEvent& event) void MyPanel::OnSpinUp( wxSpinEvent &event ) { wxString value; - value.Printf( _T("Spin control up: current = %d\n"), + value.Printf( wxT("Spin control up: current = %d\n"), m_spinbutton->GetValue()); if ( event.GetPosition() > 17 ) { - value += _T("Preventing the spin button from going above 17.\n"); + value += wxT("Preventing the spin button from going above 17.\n"); event.Veto(); } @@ -1630,12 +1630,12 @@ void MyPanel::OnSpinUp( wxSpinEvent &event ) void MyPanel::OnSpinDown( wxSpinEvent &event ) { wxString value; - value.Printf( _T("Spin control down: current = %d\n"), + value.Printf( wxT("Spin control down: current = %d\n"), m_spinbutton->GetValue()); if ( event.GetPosition() < -17 ) { - value += _T("Preventing the spin button from going below -17.\n"); + value += wxT("Preventing the spin button from going below -17.\n"); event.Veto(); } @@ -1646,10 +1646,10 @@ void MyPanel::OnSpinDown( wxSpinEvent &event ) void MyPanel::OnSpinUpdate( wxSpinEvent &event ) { wxString value; - value.Printf( _T("%d"), event.GetPosition() ); + value.Printf( wxT("%d"), event.GetPosition() ); m_spintext->SetValue( value ); - value.Printf( _T("Spin control range: (%d, %d), current = %d\n"), + value.Printf( wxT("Spin control range: (%d, %d), current = %d\n"), m_spinbutton->GetMin(), m_spinbutton->GetMax(), m_spinbutton->GetValue()); @@ -1676,12 +1676,12 @@ void MyPanel::OnShowProgress( wxCommandEvent& WXUNUSED(event) ) if ( max <= 0 ) { - wxLogError(_T("You must set positive range!")); + wxLogError(wxT("You must set positive range!")); return; } - wxProgressDialog dialog(_T("Progress dialog example"), - _T("An informative message"), + wxProgressDialog dialog(wxT("Progress dialog example"), + wxT("An informative message"), max, // range this, // parent wxPD_CAN_ABORT | @@ -1698,11 +1698,11 @@ void MyPanel::OnShowProgress( wxCommandEvent& WXUNUSED(event) ) wxSleep(1); if ( i == max ) { - cont = dialog.Update(i, _T("That's all, folks!")); + cont = dialog.Update(i, wxT("That's all, folks!")); } else if ( i == max / 2 ) { - cont = dialog.Update(i, _T("Only a half left (very long message)!")); + cont = dialog.Update(i, wxT("Only a half left (very long message)!")); } else { @@ -1712,11 +1712,11 @@ void MyPanel::OnShowProgress( wxCommandEvent& WXUNUSED(event) ) if ( !cont ) { - *m_text << _T("Progress dialog aborted!\n"); + *m_text << wxT("Progress dialog aborted!\n"); } else { - *m_text << _T("Countdown from ") << max << _T(" finished.\n"); + *m_text << wxT("Countdown from ") << max << wxT(" finished.\n"); } } @@ -1756,7 +1756,7 @@ void MyPanel::OnSizerCheck( wxCommandEvent &event) MyPanel::~MyPanel() { - //wxLog::RemoveTraceMask(_T("focus")); + //wxLog::RemoveTraceMask(wxT("focus")); delete wxLog::SetActiveTarget(m_logTargetOld); delete m_book->GetImageList(); @@ -1794,7 +1794,7 @@ END_EVENT_TABLE() MyFrame::MyFrame(const wxChar *title, int x, int y) : wxFrame(NULL, wxID_ANY, title, wxPoint(x, y), wxSize(700, 450)) { - SetHelpText( _T("Controls sample demonstrating various widgets") ); + SetHelpText( wxT("Controls sample demonstrating various widgets") ); // Give it an icon // The wxICON() macros loads an icon from a resource under Windows @@ -1806,38 +1806,38 @@ MyFrame::MyFrame(const wxChar *title, int x, int y) wxMenu *file_menu = new wxMenu; - file_menu->Append(CONTROLS_CLEAR_LOG, _T("&Clear log\tCtrl-L")); + file_menu->Append(CONTROLS_CLEAR_LOG, wxT("&Clear log\tCtrl-L")); file_menu->AppendSeparator(); - file_menu->Append(CONTROLS_ABOUT, _T("&About\tF1")); + file_menu->Append(CONTROLS_ABOUT, wxT("&About\tF1")); file_menu->AppendSeparator(); - file_menu->Append(CONTROLS_QUIT, _T("E&xit\tAlt-X"), _T("Quit controls sample")); + file_menu->Append(CONTROLS_QUIT, wxT("E&xit\tAlt-X"), wxT("Quit controls sample")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); #if wxUSE_TOOLTIPS wxMenu *tooltip_menu = new wxMenu; - tooltip_menu->Append(CONTROLS_SET_TOOLTIP_DELAY, _T("Set &delay\tCtrl-D")); + tooltip_menu->Append(CONTROLS_SET_TOOLTIP_DELAY, wxT("Set &delay\tCtrl-D")); tooltip_menu->AppendSeparator(); - tooltip_menu->Append(CONTROLS_ENABLE_TOOLTIPS, _T("&Toggle tooltips\tCtrl-T"), - _T("enable/disable tooltips"), true); + tooltip_menu->Append(CONTROLS_ENABLE_TOOLTIPS, wxT("&Toggle tooltips\tCtrl-T"), + wxT("enable/disable tooltips"), true); tooltip_menu->Check(CONTROLS_ENABLE_TOOLTIPS, true); #ifdef __WXMSW__ tooltip_menu->Append(CONTROLS_SET_TOOLTIPS_MAX_WIDTH, "Set maximal &width"); #endif // __WXMSW__ - menu_bar->Append(tooltip_menu, _T("&Tooltips")); + menu_bar->Append(tooltip_menu, wxT("&Tooltips")); #endif // wxUSE_TOOLTIPS wxMenu *panel_menu = new wxMenu; - panel_menu->Append(CONTROLS_ENABLE_ALL, _T("&Disable all\tCtrl-E"), - _T("Enable/disable all panel controls"), true); - panel_menu->Append(CONTROLS_HIDE_ALL, _T("&Hide all\tCtrl-I"), - _T("Show/hide thoe whole panel controls"), true); - panel_menu->Append(CONTROLS_HIDE_LIST, _T("Hide &list ctrl\tCtrl-S"), - _T("Enable/disable all panel controls"), true); - panel_menu->Append(CONTROLS_CONTEXT_HELP, _T("&Context help...\tCtrl-H"), - _T("Get context help for a control")); - menu_bar->Append(panel_menu, _T("&Panel")); + panel_menu->Append(CONTROLS_ENABLE_ALL, wxT("&Disable all\tCtrl-E"), + wxT("Enable/disable all panel controls"), true); + panel_menu->Append(CONTROLS_HIDE_ALL, wxT("&Hide all\tCtrl-I"), + wxT("Show/hide thoe whole panel controls"), true); + panel_menu->Append(CONTROLS_HIDE_LIST, wxT("Hide &list ctrl\tCtrl-S"), + wxT("Enable/disable all panel controls"), true); + panel_menu->Append(CONTROLS_CONTEXT_HELP, wxT("&Context help...\tCtrl-H"), + wxT("Get context help for a control")); + menu_bar->Append(panel_menu, wxT("&Panel")); SetMenuBar(menu_bar); @@ -1857,7 +1857,7 @@ void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) { wxBusyCursor bc; - wxMessageDialog dialog(this, _T("This is a control sample"), _T("About Controls"), wxOK ); + wxMessageDialog dialog(this, wxT("This is a control sample"), wxT("About Controls"), wxOK ); dialog.ShowModal(); } @@ -1872,20 +1872,20 @@ void MyFrame::OnSetTooltipDelay(wxCommandEvent& WXUNUSED(event)) static long s_delay = 5000; wxString delay; - delay.Printf( _T("%ld"), s_delay); + delay.Printf( wxT("%ld"), s_delay); - delay = wxGetTextFromUser(_T("Enter delay (in milliseconds)"), - _T("Set tooltip delay"), + delay = wxGetTextFromUser(wxT("Enter delay (in milliseconds)"), + wxT("Set tooltip delay"), delay, this); if ( !delay ) return; // cancelled - wxSscanf(delay, _T("%ld"), &s_delay); + wxSscanf(delay, wxT("%ld"), &s_delay); wxToolTip::SetDelay(s_delay); - wxLogStatus(this, _T("Tooltip delay set to %ld milliseconds"), s_delay); + wxLogStatus(this, wxT("Tooltip delay set to %ld milliseconds"), s_delay); } void MyFrame::OnToggleTooltips(wxCommandEvent& WXUNUSED(event)) @@ -1896,7 +1896,7 @@ void MyFrame::OnToggleTooltips(wxCommandEvent& WXUNUSED(event)) wxToolTip::Enable(s_enabled); - wxLogStatus(this, _T("Tooltips %sabled"), s_enabled ? _T("en") : _T("dis") ); + wxLogStatus(this, wxT("Tooltips %sabled"), s_enabled ? wxT("en") : wxT("dis") ); } #ifdef __WXMSW__ @@ -1979,14 +1979,14 @@ void MyFrame::OnMove( wxMoveEvent& event ) void MyFrame::OnIconized( wxIconizeEvent& event ) { - wxLogMessage(_T("Frame %s"), event.IsIconized() ? _T("iconized") - : _T("restored")); + wxLogMessage(wxT("Frame %s"), event.IsIconized() ? wxT("iconized") + : wxT("restored")); event.Skip(); } void MyFrame::OnMaximized( wxMaximizeEvent& WXUNUSED(event) ) { - wxLogMessage(_T("Frame maximized")); + wxLogMessage(wxT("Frame maximized")); } void MyFrame::OnSize( wxSizeEvent& event ) @@ -2011,9 +2011,9 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) ) if ( focus ) { msg.Printf( - _T("Focus: %s") + wxT("Focus: %s") #ifdef __WXMSW__ - , _T(", HWND = %08x") + , wxT(", HWND = %08x") #endif , s_windowFocus->GetName().c_str() #ifdef __WXMSW__ @@ -2023,7 +2023,7 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) ) } else { - msg = _T("No focus"); + msg = wxT("No focus"); } #if wxUSE_STATUSBAR @@ -2034,11 +2034,11 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) ) void MyComboBox::OnChar(wxKeyEvent& event) { - wxLogMessage(_T("MyComboBox::OnChar")); + wxLogMessage(wxT("MyComboBox::OnChar")); if ( event.GetKeyCode() == 'w' ) { - wxLogMessage(_T("MyComboBox: 'w' will be ignored.")); + wxLogMessage(wxT("MyComboBox: 'w' will be ignored.")); } else { @@ -2048,11 +2048,11 @@ void MyComboBox::OnChar(wxKeyEvent& event) void MyComboBox::OnKeyDown(wxKeyEvent& event) { - wxLogMessage(_T("MyComboBox::OnKeyDown")); + wxLogMessage(wxT("MyComboBox::OnKeyDown")); if ( event.GetKeyCode() == 'w' ) { - wxLogMessage(_T("MyComboBox: 'w' will be ignored.")); + wxLogMessage(wxT("MyComboBox: 'w' will be ignored.")); } else { @@ -2062,7 +2062,7 @@ void MyComboBox::OnKeyDown(wxKeyEvent& event) void MyComboBox::OnKeyUp(wxKeyEvent& event) { - wxLogMessage(_T("MyComboBox::OnKeyUp")); + wxLogMessage(wxT("MyComboBox::OnKeyUp")); event.Skip(); } diff --git a/samples/dataview/dataview.cpp b/samples/dataview/dataview.cpp index 9b80b93b69..692d94eb2d 100644 --- a/samples/dataview/dataview.cpp +++ b/samples/dataview/dataview.cpp @@ -692,7 +692,7 @@ void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) wxAboutDialogInfo info; info.SetName(_("DataView sample")); info.SetDescription(_("This sample demonstrates wxDataViewCtrl")); - info.SetCopyright(_T("(C) 2007-2009 Robert Roebling")); + info.SetCopyright(wxT("(C) 2007-2009 Robert Roebling")); info.AddDeveloper("Robert Roebling"); info.AddDeveloper("Francesco Montorsi"); diff --git a/samples/debugrpt/debugrpt.cpp b/samples/debugrpt/debugrpt.cpp index 61f58a1394..152e2664ec 100644 --- a/samples/debugrpt/debugrpt.cpp +++ b/samples/debugrpt/debugrpt.cpp @@ -51,9 +51,9 @@ class MyDebugReport : public wxDebugReportUpload public: MyDebugReport() : wxDebugReportUpload ( - _T("http://your.url.here/"), - _T("report:file"), - _T("action") + wxT("http://your.url.here/"), + wxT("report:file"), + wxT("action") ) { } @@ -66,19 +66,19 @@ protected: { if ( reply.IsEmpty() ) { - wxLogError(_T("Didn't receive the expected server reply.")); + wxLogError(wxT("Didn't receive the expected server reply.")); return false; } - wxString s(_T("Server replied:\n")); + wxString s(wxT("Server replied:\n")); const size_t count = reply.GetCount(); for ( size_t n = 0; n < count; n++ ) { - s << _T('\t') << reply[n] << _T('\n'); + s << wxT('\t') << reply[n] << wxT('\n'); } - wxLogMessage(_T("%s"), s.c_str()); + wxLogMessage(wxT("%s"), s.c_str()); return true; } @@ -97,12 +97,12 @@ public: { if ( !wxDebugReportCompress::DoProcess() ) return false; - wxMailMessage msg(GetReportName() + _T(" crash report"), - _T("vadim@wxwindows.org"), + wxMailMessage msg(GetReportName() + wxT(" crash report"), + wxT("vadim@wxwindows.org"), wxEmptyString, // mail body wxEmptyString, // from address GetCompressedFileName(), - _T("crashreport.zip")); + wxT("crashreport.zip")); return wxEmail::Send(msg); } @@ -229,7 +229,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE() MyFrame::MyFrame() - : wxFrame(NULL, wxID_ANY, _T("wxWidgets Debug Report Sample"), + : wxFrame(NULL, wxID_ANY, wxT("wxWidgets Debug Report Sample"), wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE|wxDEFAULT_FRAME_STYLE) { m_numLines = 10; @@ -237,26 +237,26 @@ MyFrame::MyFrame() SetIcon(wxICON(sample)); wxMenu *menuFile = new wxMenu; - menuFile->Append(DebugRpt_Quit, _T("E&xit\tAlt-X")); + menuFile->Append(DebugRpt_Quit, wxT("E&xit\tAlt-X")); wxMenu *menuReport = new wxMenu; - menuReport->Append(DebugRpt_Crash, _T("Report for &crash\tCtrl-C"), - _T("Provoke a crash inside the program and create report for it")); - menuReport->Append(DebugRpt_Current, _T("Report for c&urrent context\tCtrl-U"), - _T("Create report for the current program context")); - menuReport->Append(DebugRpt_Paint, _T("Report for &paint handler\tCtrl-P"), - _T("Provoke a repeatable crash in wxEVT_PAINT handler")); + menuReport->Append(DebugRpt_Crash, wxT("Report for &crash\tCtrl-C"), + wxT("Provoke a crash inside the program and create report for it")); + menuReport->Append(DebugRpt_Current, wxT("Report for c&urrent context\tCtrl-U"), + wxT("Create report for the current program context")); + menuReport->Append(DebugRpt_Paint, wxT("Report for &paint handler\tCtrl-P"), + wxT("Provoke a repeatable crash in wxEVT_PAINT handler")); menuReport->AppendSeparator(); - menuReport->AppendCheckItem(DebugRpt_Upload, _T("Up&load debug report"), - _T("You need to configure a web server accepting debug report uploads to use this function")); + menuReport->AppendCheckItem(DebugRpt_Upload, wxT("Up&load debug report"), + wxT("You need to configure a web server accepting debug report uploads to use this function")); wxMenu *menuHelp = new wxMenu; - menuHelp->Append(DebugRpt_About, _T("&About...\tF1")); + menuHelp->Append(DebugRpt_About, wxT("&About...\tF1")); wxMenuBar *mbar = new wxMenuBar(); - mbar->Append(menuFile, _T("&File")); - mbar->Append(menuReport, _T("&Report")); - mbar->Append(menuHelp, _T("&Help")); + mbar->Append(menuFile, wxT("&File")); + mbar->Append(menuReport, wxT("&Report")); + mbar->Append(menuHelp, wxT("&Help")); SetMenuBar(mbar); CreateStatusBar(); @@ -301,8 +301,8 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageBox ( - _T("wxDebugReport sample\n(c) 2005 Vadim Zeitlin "), - _T("wxWidgets Debug Report Sample"), + wxT("wxDebugReport sample\n(c) 2005 Vadim Zeitlin "), + wxT("wxWidgets Debug Report Sample"), wxOK | wxICON_INFORMATION, this ); @@ -356,23 +356,23 @@ void MyApp::GenerateReport(wxDebugReport::Context ctx) // you can also call report->AddFile(...) with your own log files, files // created using wxRegKey::Export() and so on, here we just add a test // file containing the date of the crash - wxFileName fn(report->GetDirectory(), _T("timestamp.my")); - wxFFile file(fn.GetFullPath(), _T("w")); + wxFileName fn(report->GetDirectory(), wxT("timestamp.my")); + wxFFile file(fn.GetFullPath(), wxT("w")); if ( file.IsOpened() ) { wxDateTime dt = wxDateTime::Now(); - file.Write(dt.FormatISODate() + _T(' ') + dt.FormatISOTime()); + file.Write(dt.FormatISODate() + wxT(' ') + dt.FormatISOTime()); file.Close(); } - report->AddFile(fn.GetFullName(), _T("timestamp of this report")); + report->AddFile(fn.GetFullName(), wxT("timestamp of this report")); // can also add an existing file directly, it will be copied // automatically #ifdef __WXMSW__ - report->AddFile(_T("c:\\autoexec.bat"), _T("DOS startup file")); + report->AddFile(wxT("c:\\autoexec.bat"), wxT("DOS startup file")); #else - report->AddFile(_T("/etc/motd"), _T("Message of the day")); + report->AddFile(wxT("/etc/motd"), wxT("Message of the day")); #endif // calling Show() is not mandatory, but is more polite @@ -382,11 +382,11 @@ void MyApp::GenerateReport(wxDebugReport::Context ctx) { if ( m_uploadReport ) { - wxLogMessage(_T("Report successfully uploaded.")); + wxLogMessage(wxT("Report successfully uploaded.")); } else { - wxLogMessage(_T("Report generated in \"%s\"."), + wxLogMessage(wxT("Report generated in \"%s\"."), report->GetCompressedFileName().c_str()); report->Reset(); } diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index 248f717fcc..d81a728015 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -276,13 +276,13 @@ bool MyApp::OnInit() m_canvasFont = *wxNORMAL_FONT; // Create the main frame window - MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets dialogs example")); + MyFrame *frame = new MyFrame((wxFrame *) NULL, wxT("wxWidgets dialogs example")); // Make a menubar wxMenu *menuDlg = new wxMenu; - menuDlg->Append(DIALOGS_MESSAGE_BOX, _T("&Message box\tCtrl-M")); - menuDlg->Append(DIALOGS_MESSAGE_DIALOG, _T("Message dialog\tShift-Ctrl-M")); + menuDlg->Append(DIALOGS_MESSAGE_BOX, wxT("&Message box\tCtrl-M")); + menuDlg->Append(DIALOGS_MESSAGE_DIALOG, wxT("Message dialog\tShift-Ctrl-M")); #if wxUSE_COLOURDLG || wxUSE_FONTDLG || wxUSE_CHOICEDLG @@ -290,21 +290,21 @@ bool MyApp::OnInit() wxMenu *choices_menu = new wxMenu; #if wxUSE_COLOURDLG - choices_menu->Append(DIALOGS_CHOOSE_COLOUR, _T("&Choose bg colour")); - choices_menu->Append(DIALOGS_GET_COLOUR, _T("&Choose fg colour")); + choices_menu->Append(DIALOGS_CHOOSE_COLOUR, wxT("&Choose bg colour")); + choices_menu->Append(DIALOGS_GET_COLOUR, wxT("&Choose fg colour")); #endif // wxUSE_COLOURDLG #if wxUSE_FONTDLG - choices_menu->Append(DIALOGS_CHOOSE_FONT, _T("Choose &font")); + choices_menu->Append(DIALOGS_CHOOSE_FONT, wxT("Choose &font")); #endif // wxUSE_FONTDLG #if wxUSE_CHOICEDLG - choices_menu->Append(DIALOGS_SINGLE_CHOICE, _T("&Single choice\tCtrl-C")); - choices_menu->Append(DIALOGS_MULTI_CHOICE, _T("M&ultiple choice\tCtrl-U")); + choices_menu->Append(DIALOGS_SINGLE_CHOICE, wxT("&Single choice\tCtrl-C")); + choices_menu->Append(DIALOGS_MULTI_CHOICE, wxT("M&ultiple choice\tCtrl-U")); #endif // wxUSE_CHOICEDLG #if wxUSE_REARRANGECTRL - choices_menu->Append(DIALOGS_REARRANGE, _T("&Rearrange dialog\tCtrl-R")); + choices_menu->Append(DIALOGS_REARRANGE, wxT("&Rearrange dialog\tCtrl-R")); #endif // wxUSE_REARRANGECTRL #if USE_COLOURDLG_GENERIC || USE_FONTDLG_GENERIC @@ -312,14 +312,14 @@ bool MyApp::OnInit() #endif // USE_COLOURDLG_GENERIC || USE_FONTDLG_GENERIC #if USE_COLOURDLG_GENERIC - choices_menu->Append(DIALOGS_CHOOSE_COLOUR_GENERIC, _T("&Choose colour (generic)")); + choices_menu->Append(DIALOGS_CHOOSE_COLOUR_GENERIC, wxT("&Choose colour (generic)")); #endif // USE_COLOURDLG_GENERIC #if USE_FONTDLG_GENERIC - choices_menu->Append(DIALOGS_CHOOSE_FONT_GENERIC, _T("Choose &font (generic)")); + choices_menu->Append(DIALOGS_CHOOSE_FONT_GENERIC, wxT("Choose &font (generic)")); #endif // USE_FONTDLG_GENERIC - menuDlg->Append(wxID_ANY,_T("&Choices and selectors"),choices_menu); + menuDlg->Append(wxID_ANY,wxT("&Choices and selectors"),choices_menu); #endif // wxUSE_COLOURDLG || wxUSE_FONTDLG || wxUSE_CHOICEDLG @@ -328,15 +328,15 @@ bool MyApp::OnInit() wxMenu *entry_menu = new wxMenu; #if wxUSE_TEXTDLG - entry_menu->Append(DIALOGS_TEXT_ENTRY, _T("Text &entry\tCtrl-E")); - entry_menu->Append(DIALOGS_PASSWORD_ENTRY, _T("&Password entry\tCtrl-P")); + entry_menu->Append(DIALOGS_TEXT_ENTRY, wxT("Text &entry\tCtrl-E")); + entry_menu->Append(DIALOGS_PASSWORD_ENTRY, wxT("&Password entry\tCtrl-P")); #endif // wxUSE_TEXTDLG #if wxUSE_NUMBERDLG - entry_menu->Append(DIALOGS_NUM_ENTRY, _T("&Numeric entry\tCtrl-N")); + entry_menu->Append(DIALOGS_NUM_ENTRY, wxT("&Numeric entry\tCtrl-N")); #endif // wxUSE_NUMBERDLG - menuDlg->Append(wxID_ANY,_T("&Entry dialogs"),entry_menu); + menuDlg->Append(wxID_ANY,wxT("&Entry dialogs"),entry_menu); #endif // wxUSE_TEXTDLG || wxUSE_NUMBERDLG @@ -344,32 +344,32 @@ bool MyApp::OnInit() #if wxUSE_FILEDLG wxMenu *filedlg_menu = new wxMenu; - filedlg_menu->Append(DIALOGS_FILE_OPEN, _T("&Open file\tCtrl-O")); - filedlg_menu->Append(DIALOGS_FILE_OPEN2, _T("&Second open file\tCtrl-2")); - filedlg_menu->Append(DIALOGS_FILES_OPEN, _T("Open &files\tCtrl-Q")); - filedlg_menu->Append(DIALOGS_FILE_SAVE, _T("Sa&ve file\tCtrl-S")); + filedlg_menu->Append(DIALOGS_FILE_OPEN, wxT("&Open file\tCtrl-O")); + filedlg_menu->Append(DIALOGS_FILE_OPEN2, wxT("&Second open file\tCtrl-2")); + filedlg_menu->Append(DIALOGS_FILES_OPEN, wxT("Open &files\tCtrl-Q")); + filedlg_menu->Append(DIALOGS_FILE_SAVE, wxT("Sa&ve file\tCtrl-S")); #if USE_FILEDLG_GENERIC filedlg_menu->AppendSeparator(); - filedlg_menu->Append(DIALOGS_FILE_OPEN_GENERIC, _T("&Open file (generic)")); - filedlg_menu->Append(DIALOGS_FILES_OPEN_GENERIC, _T("Open &files (generic)")); - filedlg_menu->Append(DIALOGS_FILE_SAVE_GENERIC, _T("Sa&ve file (generic)")); + filedlg_menu->Append(DIALOGS_FILE_OPEN_GENERIC, wxT("&Open file (generic)")); + filedlg_menu->Append(DIALOGS_FILES_OPEN_GENERIC, wxT("Open &files (generic)")); + filedlg_menu->Append(DIALOGS_FILE_SAVE_GENERIC, wxT("Sa&ve file (generic)")); #endif // USE_FILEDLG_GENERIC - menuDlg->Append(wxID_ANY,_T("&File operations"),filedlg_menu); + menuDlg->Append(wxID_ANY,wxT("&File operations"),filedlg_menu); #endif // wxUSE_FILEDLG #if wxUSE_DIRDLG wxMenu *dir_menu = new wxMenu; - dir_menu->Append(DIALOGS_DIR_CHOOSE, _T("&Choose a directory\tCtrl-D")); - dir_menu->Append(DIALOGS_DIRNEW_CHOOSE, _T("Choose a directory (with \"Ne&w\" button)\tShift-Ctrl-D")); - menuDlg->Append(wxID_ANY,_T("&Directory operations"),dir_menu); + dir_menu->Append(DIALOGS_DIR_CHOOSE, wxT("&Choose a directory\tCtrl-D")); + dir_menu->Append(DIALOGS_DIRNEW_CHOOSE, wxT("Choose a directory (with \"Ne&w\" button)\tShift-Ctrl-D")); + menuDlg->Append(wxID_ANY,wxT("&Directory operations"),dir_menu); #if USE_DIRDLG_GENERIC dir_menu->AppendSeparator(); - dir_menu->Append(DIALOGS_GENERIC_DIR_CHOOSE, _T("&Choose a directory (generic)")); + dir_menu->Append(DIALOGS_GENERIC_DIR_CHOOSE, wxT("&Choose a directory (generic)")); #endif // USE_DIRDLG_GENERIC #endif // wxUSE_DIRDLG @@ -384,68 +384,68 @@ bool MyApp::OnInit() wxMenu *info_menu = new wxMenu; #if wxUSE_STARTUP_TIPS - info_menu->Append(DIALOGS_TIP, _T("&Tip of the day\tCtrl-T")); + info_menu->Append(DIALOGS_TIP, wxT("&Tip of the day\tCtrl-T")); #endif // wxUSE_STARTUP_TIPS #if wxUSE_PROGRESSDLG - info_menu->Append(DIALOGS_PROGRESS, _T("Pro&gress dialog\tCtrl-G")); + info_menu->Append(DIALOGS_PROGRESS, wxT("Pro&gress dialog\tCtrl-G")); #endif // wxUSE_PROGRESSDLG #if wxUSE_BUSYINFO - info_menu->Append(DIALOGS_BUSYINFO, _T("&Busy info dialog\tCtrl-B")); + info_menu->Append(DIALOGS_BUSYINFO, wxT("&Busy info dialog\tCtrl-B")); #endif // wxUSE_BUSYINFO #if wxUSE_LOG_DIALOG - info_menu->Append(DIALOGS_LOG_DIALOG, _T("&Log dialog\tCtrl-L")); + info_menu->Append(DIALOGS_LOG_DIALOG, wxT("&Log dialog\tCtrl-L")); #endif // wxUSE_LOG_DIALOG #if wxUSE_MSGDLG info_menu->Append(DIALOGS_MESSAGE_BOX_WXINFO, - _T("&wxWidgets information\tCtrl-I")); + wxT("&wxWidgets information\tCtrl-I")); #endif // wxUSE_MSGDLG - menuDlg->Append(wxID_ANY,_T("&Informative dialogs"),info_menu); + menuDlg->Append(wxID_ANY,wxT("&Informative dialogs"),info_menu); #endif // wxUSE_STARTUP_TIPS || wxUSE_PROGRESSDLG || wxUSE_BUSYINFO || wxUSE_LOG_DIALOG #if wxUSE_FINDREPLDLG wxMenu *find_menu = new wxMenu; - find_menu->AppendCheckItem(DIALOGS_FIND, _T("&Find dialog\tCtrl-F")); - find_menu->AppendCheckItem(DIALOGS_REPLACE, _T("Find and &replace dialog\tShift-Ctrl-F")); - menuDlg->Append(wxID_ANY,_T("&Searching"),find_menu); + find_menu->AppendCheckItem(DIALOGS_FIND, wxT("&Find dialog\tCtrl-F")); + find_menu->AppendCheckItem(DIALOGS_REPLACE, wxT("Find and &replace dialog\tShift-Ctrl-F")); + menuDlg->Append(wxID_ANY,wxT("&Searching"),find_menu); #endif // wxUSE_FINDREPLDLG wxMenu *dialogs_menu = new wxMenu; #if USE_MODAL_PRESENTATION - dialogs_menu->Append(DIALOGS_MODAL, _T("&Modal dialog\tCtrl-W")); + dialogs_menu->Append(DIALOGS_MODAL, wxT("&Modal dialog\tCtrl-W")); #endif // USE_MODAL_PRESENTATION - dialogs_menu->AppendCheckItem(DIALOGS_MODELESS, _T("Mode&less dialog\tCtrl-Z")); - dialogs_menu->Append(DIALOGS_CENTRE_SCREEN, _T("Centered on &screen\tShift-Ctrl-1")); - dialogs_menu->Append(DIALOGS_CENTRE_PARENT, _T("Centered on &parent\tShift-Ctrl-2")); + dialogs_menu->AppendCheckItem(DIALOGS_MODELESS, wxT("Mode&less dialog\tCtrl-Z")); + dialogs_menu->Append(DIALOGS_CENTRE_SCREEN, wxT("Centered on &screen\tShift-Ctrl-1")); + dialogs_menu->Append(DIALOGS_CENTRE_PARENT, wxT("Centered on &parent\tShift-Ctrl-2")); #if wxUSE_MINIFRAME - dialogs_menu->Append(DIALOGS_MINIFRAME, _T("&Mini frame")); + dialogs_menu->Append(DIALOGS_MINIFRAME, wxT("&Mini frame")); #endif // wxUSE_MINIFRAME - dialogs_menu->Append(DIALOGS_ONTOP, _T("Dialog staying on &top")); - menuDlg->Append(wxID_ANY, _T("&Generic dialogs"), dialogs_menu); + dialogs_menu->Append(DIALOGS_ONTOP, wxT("Dialog staying on &top")); + menuDlg->Append(wxID_ANY, wxT("&Generic dialogs"), dialogs_menu); #if USE_SETTINGS_DIALOG wxMenu *sheet_menu = new wxMenu; - sheet_menu->Append(DIALOGS_PROPERTY_SHEET, _T("&Standard property sheet\tShift-Ctrl-P")); - sheet_menu->Append(DIALOGS_PROPERTY_SHEET_TOOLBOOK, _T("&Toolbook sheet\tShift-Ctrl-T")); + sheet_menu->Append(DIALOGS_PROPERTY_SHEET, wxT("&Standard property sheet\tShift-Ctrl-P")); + sheet_menu->Append(DIALOGS_PROPERTY_SHEET_TOOLBOOK, wxT("&Toolbook sheet\tShift-Ctrl-T")); if (wxPlatformIs(wxPORT_MAC)) - sheet_menu->Append(DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK, _T("Button &Toolbook sheet\tShift-Ctrl-U")); + sheet_menu->Append(DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK, wxT("Button &Toolbook sheet\tShift-Ctrl-U")); /* #ifdef __WXMAC__ - sheet_menu->Append(DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK, _T("Button &Toolbook sheet\tShift-Ctrl-U")); + sheet_menu->Append(DIALOGS_PROPERTY_SHEET_BUTTONTOOLBOOK, wxT("Button &Toolbook sheet\tShift-Ctrl-U")); #endif */ - menuDlg->Append(wxID_ANY, _T("&Property sheets"), sheet_menu); + menuDlg->Append(wxID_ANY, wxT("&Property sheets"), sheet_menu); #endif // USE_SETTINGS_DIALOG wxMenu *menuNotif = new wxMenu; - menuNotif->Append(DIALOGS_REQUEST, _T("&Request user attention\tCtrl-Shift-R")); + menuNotif->Append(DIALOGS_REQUEST, wxT("&Request user attention\tCtrl-Shift-R")); #if wxUSE_NOTIFICATION_MESSAGE menuNotif->Append(DIALOGS_NOTIFY_AUTO, "&Automatically hidden notification"); menuNotif->Append(DIALOGS_NOTIFY_SHOW, "&Show manual notification"); @@ -453,24 +453,24 @@ bool MyApp::OnInit() #endif // wxUSE_NOTIFICATION_MESSAGE menuDlg->AppendSubMenu(menuNotif, "&User notifications"); - menuDlg->Append(DIALOGS_STANDARD_BUTTON_SIZER_DIALOG, _T("&Standard Buttons Sizer Dialog")); - menuDlg->Append(DIALOGS_TEST_DEFAULT_ACTION, _T("&Test dialog default action")); + menuDlg->Append(DIALOGS_STANDARD_BUTTON_SIZER_DIALOG, wxT("&Standard Buttons Sizer Dialog")); + menuDlg->Append(DIALOGS_TEST_DEFAULT_ACTION, wxT("&Test dialog default action")); menuDlg->AppendSeparator(); - menuDlg->Append(wxID_EXIT, _T("E&xit\tAlt-X")); + menuDlg->Append(wxID_EXIT, wxT("E&xit\tAlt-X")); #if wxUSE_ABOUTDLG wxMenu *menuHelp = new wxMenu; - menuHelp->Append(DIALOGS_ABOUTDLG_SIMPLE, _T("&About (simple)...\tF1")); - menuHelp->Append(DIALOGS_ABOUTDLG_FANCY, _T("About (&fancy)...\tShift-F1")); - menuHelp->Append(DIALOGS_ABOUTDLG_FULL, _T("About (f&ull)...\tCtrl-F1")); - menuHelp->Append(DIALOGS_ABOUTDLG_CUSTOM, _T("About (&custom)...\tCtrl-Shift-F1")); + menuHelp->Append(DIALOGS_ABOUTDLG_SIMPLE, wxT("&About (simple)...\tF1")); + menuHelp->Append(DIALOGS_ABOUTDLG_FANCY, wxT("About (&fancy)...\tShift-F1")); + menuHelp->Append(DIALOGS_ABOUTDLG_FULL, wxT("About (f&ull)...\tCtrl-F1")); + menuHelp->Append(DIALOGS_ABOUTDLG_CUSTOM, wxT("About (&custom)...\tCtrl-Shift-F1")); #endif // wxUSE_ABOUTDLG wxMenuBar *menubar = new wxMenuBar; - menubar->Append(menuDlg, _T("&Dialogs")); + menubar->Append(menuDlg, wxT("&Dialogs")); #if wxUSE_ABOUTDLG - menubar->Append(menuHelp, _T("&Help")); + menubar->Append(menuHelp, wxT("&Help")); #endif // wxUSE_ABOUTDLG frame->SetMenuBar(menubar); @@ -727,54 +727,54 @@ void MyFrame::MessageBoxInfo(wxCommandEvent& WXUNUSED(event)) #if wxUSE_NUMBERDLG void MyFrame::NumericEntry(wxCommandEvent& WXUNUSED(event)) { - long res = wxGetNumberFromUser( _T("This is some text, actually a lot of text.\n") - _T("Even two rows of text."), - _T("Enter a number:"), _T("Numeric input test"), + long res = wxGetNumberFromUser( wxT("This is some text, actually a lot of text.\n") + wxT("Even two rows of text."), + wxT("Enter a number:"), wxT("Numeric input test"), 50, 0, 100, this ); wxString msg; int icon; if ( res == -1 ) { - msg = _T("Invalid number entered or dialog cancelled."); + msg = wxT("Invalid number entered or dialog cancelled."); icon = wxICON_HAND; } else { - msg.Printf(_T("You've entered %lu"), res ); + msg.Printf(wxT("You've entered %lu"), res ); icon = wxICON_INFORMATION; } - wxMessageBox(msg, _T("Numeric test result"), wxOK | icon, this); + wxMessageBox(msg, wxT("Numeric test result"), wxOK | icon, this); } #endif // wxUSE_NUMBERDLG #if wxUSE_TEXTDLG void MyFrame::PasswordEntry(wxCommandEvent& WXUNUSED(event)) { - wxString pwd = wxGetPasswordFromUser(_T("Enter password:"), - _T("Password entry dialog"), + wxString pwd = wxGetPasswordFromUser(wxT("Enter password:"), + wxT("Password entry dialog"), wxEmptyString, this); if ( !pwd.empty() ) { wxMessageBox(wxString::Format(wxT("Your password is '%s'"), pwd.c_str()), - _T("Got password"), wxOK | wxICON_INFORMATION, this); + wxT("Got password"), wxOK | wxICON_INFORMATION, this); } } void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event)) { wxTextEntryDialog dialog(this, - _T("This is a small sample\n") - _T("A long, long string to test out the text entrybox"), - _T("Please enter a string"), - _T("Default value"), + wxT("This is a small sample\n") + wxT("A long, long string to test out the text entrybox"), + wxT("Please enter a string"), + wxT("Default value"), wxOK | wxCANCEL); if (dialog.ShowModal() == wxID_OK) { - wxMessageBox(dialog.GetValue(), _T("Got string"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(dialog.GetValue(), wxT("Got string"), wxOK | wxICON_INFORMATION, this); } } #endif // wxUSE_TEXTDLG @@ -782,19 +782,19 @@ void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event)) #if wxUSE_CHOICEDLG void MyFrame::SingleChoice(wxCommandEvent& WXUNUSED(event) ) { - const wxString choices[] = { _T("One"), _T("Two"), _T("Three"), _T("Four"), _T("Five") } ; + const wxString choices[] = { wxT("One"), wxT("Two"), wxT("Three"), wxT("Four"), wxT("Five") } ; wxSingleChoiceDialog dialog(this, - _T("This is a small sample\n") - _T("A single-choice convenience dialog"), - _T("Please select a value"), + wxT("This is a small sample\n") + wxT("A single-choice convenience dialog"), + wxT("Please select a value"), WXSIZEOF(choices), choices); dialog.SetSelection(2); if (dialog.ShowModal() == wxID_OK) { - wxMessageDialog dialog2(this, dialog.GetStringSelection(), _T("Got string")); + wxMessageDialog dialog2(this, dialog.GetStringSelection(), wxT("Got string")); dialog2.ShowModal(); } } @@ -803,16 +803,16 @@ void MyFrame::MultiChoice(wxCommandEvent& WXUNUSED(event) ) { const wxString choices[] = { - _T("One"), _T("Two"), _T("Three"), _T("Four"), _T("Five"), - _T("Six"), _T("Seven"), _T("Eight"), _T("Nine"), _T("Ten"), - _T("Eleven"), _T("Twelve"), _T("Seventeen"), + wxT("One"), wxT("Two"), wxT("Three"), wxT("Four"), wxT("Five"), + wxT("Six"), wxT("Seven"), wxT("Eight"), wxT("Nine"), wxT("Ten"), + wxT("Eleven"), wxT("Twelve"), wxT("Seventeen"), }; wxArrayInt selections; const int count = wxGetSelectedChoices(selections, - _T("This is a small sample\n") - _T("A multi-choice convenience dialog"), - _T("Please select a value"), + wxT("This is a small sample\n") + wxT("A multi-choice convenience dialog"), + wxT("Please select a value"), WXSIZEOF(choices), choices, this); if ( count >= 0 ) @@ -1085,9 +1085,9 @@ private: MyExtraPanel::MyExtraPanel(wxWindow *parent) : wxPanel(parent) { - m_btn = new wxButton(this, -1, _T("Custom Button")); + m_btn = new wxButton(this, -1, wxT("Custom Button")); m_btn->Enable(false); - m_cb = new wxCheckBox(this, -1, _T("Enable Custom Button")); + m_cb = new wxCheckBox(this, -1, wxT("Enable Custom Button")); m_cb->Connect(wxID_ANY, wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(MyExtraPanel::OnCheckBox), NULL, this); wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); @@ -1108,13 +1108,13 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) ) wxFileDialog dialog ( this, - _T("Testing open file dialog"), + wxT("Testing open file dialog"), wxEmptyString, wxEmptyString, #ifdef __WXMOTIF__ - _T("C++ files (*.cpp)|*.cpp") + wxT("C++ files (*.cpp)|*.cpp") #else - _T("C++ files (*.cpp;*.h)|*.cpp;*.h") + wxT("C++ files (*.cpp;*.h)|*.cpp;*.h") #endif ); @@ -1126,16 +1126,16 @@ void MyFrame::FileOpen(wxCommandEvent& WXUNUSED(event) ) { wxString info; wxWindow * const extra = dialog.GetExtraControl(); - info.Printf(_T("Full file name: %s\n") - _T("Path: %s\n") - _T("Name: %s\n") - _T("Custom window: %s"), + info.Printf(wxT("Full file name: %s\n") + wxT("Path: %s\n") + wxT("Name: %s\n") + wxT("Custom window: %s"), dialog.GetPath().c_str(), dialog.GetDirectory().c_str(), dialog.GetFilename().c_str(), extra ? static_cast(extra)->GetInfo() : wxString("None")); - wxMessageDialog dialog2(this, info, _T("Selected file")); + wxMessageDialog dialog2(this, info, wxT("Selected file")); dialog2.ShowModal(); } } @@ -1147,12 +1147,12 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) ) { static wxString s_extDef; wxString path = wxFileSelector( - _T("Select the file to load"), + wxT("Select the file to load"), wxEmptyString, wxEmptyString, s_extDef, wxString::Format ( - _T("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (%s)|%s"), + wxT("Waveform (*.wav)|*.wav|Plain text (*.txt)|*.txt|All files (%s)|%s"), wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr ), @@ -1164,9 +1164,9 @@ void MyFrame::FileOpen2(wxCommandEvent& WXUNUSED(event) ) return; // it is just a sample, would use wxSplitPath in real program - s_extDef = path.AfterLast(_T('.')); + s_extDef = path.AfterLast(wxT('.')); - wxLogMessage(_T("You selected the file '%s', remembered extension '%s'"), + wxLogMessage(wxT("You selected the file '%s', remembered extension '%s'"), path, s_extDef); } @@ -1174,16 +1174,16 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) ) { wxString wildcards = #ifdef __WXMOTIF__ - _T("C++ files (*.cpp)|*.cpp"); + wxT("C++ files (*.cpp)|*.cpp"); #else wxString::Format ( - _T("All files (%s)|%s|C++ files (*.cpp;*.h)|*.cpp;*.h"), + wxT("All files (%s)|%s|C++ files (*.cpp;*.h)|*.cpp;*.h"), wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr ); #endif - wxFileDialog dialog(this, _T("Testing open multiple file dialog"), + wxFileDialog dialog(this, wxT("Testing open multiple file dialog"), wxEmptyString, wxEmptyString, wildcards, wxFD_OPEN|wxFD_MULTIPLE); @@ -1198,15 +1198,15 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) ) size_t count = paths.GetCount(); for ( size_t n = 0; n < count; n++ ) { - s.Printf(_T("File %d: %s (%s)\n"), + s.Printf(wxT("File %d: %s (%s)\n"), (int)n, paths[n].c_str(), filenames[n].c_str()); msg += s; } - s.Printf(_T("Filter index: %d"), dialog.GetFilterIndex()); + s.Printf(wxT("Filter index: %d"), dialog.GetFilterIndex()); msg += s; - wxMessageDialog dialog2(this, msg, _T("Selected files")); + wxMessageDialog dialog2(this, msg, wxT("Selected files")); dialog2.ShowModal(); } } @@ -1214,17 +1214,17 @@ void MyFrame::FilesOpen(wxCommandEvent& WXUNUSED(event) ) void MyFrame::FileSave(wxCommandEvent& WXUNUSED(event) ) { wxFileDialog dialog(this, - _T("Testing save file dialog"), + wxT("Testing save file dialog"), wxEmptyString, - _T("myletter.doc"), - _T("Text files (*.txt)|*.txt|Document files (*.doc;*.ods)|*.doc;*.ods"), + wxT("myletter.doc"), + wxT("Text files (*.txt)|*.txt|Document files (*.doc;*.ods)|*.doc;*.ods"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); dialog.SetFilterIndex(1); if (dialog.ShowModal() == wxID_OK) { - wxLogMessage(_T("%s, filter %d"), + wxLogMessage(wxT("%s, filter %d"), dialog.GetPath().c_str(), dialog.GetFilterIndex()); } } @@ -1236,10 +1236,10 @@ void MyFrame::FileOpenGeneric(wxCommandEvent& WXUNUSED(event) ) wxGenericFileDialog dialog ( this, - _T("Testing open file dialog"), + wxT("Testing open file dialog"), wxEmptyString, wxEmptyString, - _T("C++ files (*.cpp;*.h)|*.cpp;*.h") + wxT("C++ files (*.cpp;*.h)|*.cpp;*.h") ); dialog.SetExtraControlCreator(&createMyExtraPanel); @@ -1248,13 +1248,13 @@ void MyFrame::FileOpenGeneric(wxCommandEvent& WXUNUSED(event) ) if (dialog.ShowModal() == wxID_OK) { wxString info; - info.Printf(_T("Full file name: %s\n") - _T("Path: %s\n") - _T("Name: %s"), + info.Printf(wxT("Full file name: %s\n") + wxT("Path: %s\n") + wxT("Name: %s"), dialog.GetPath().c_str(), dialog.GetDirectory().c_str(), dialog.GetFilename().c_str()); - wxMessageDialog dialog2(this, info, _T("Selected file")); + wxMessageDialog dialog2(this, info, wxT("Selected file")); dialog2.ShowModal(); } } @@ -1265,8 +1265,8 @@ void MyFrame::FilesOpenGeneric(wxCommandEvent& WXUNUSED(event) ) int buttons = wxSystemOptions::GetOptionInt(wxT("wince.dialog.real-ok-cancel")); wxSystemOptions::SetOption(wxT("wince.dialog.real-ok-cancel"), 1); - wxString wildcards = _T("All files (*.*)|*.*|C++ files (*.cpp;*.h)|*.cpp;*.h"); - wxGenericFileDialog dialog(this, _T("Testing open multiple file dialog"), + wxString wildcards = wxT("All files (*.*)|*.*|C++ files (*.cpp;*.h)|*.cpp;*.h"); + wxGenericFileDialog dialog(this, wxT("Testing open multiple file dialog"), wxEmptyString, wxEmptyString, wildcards, wxFD_MULTIPLE); @@ -1281,15 +1281,15 @@ void MyFrame::FilesOpenGeneric(wxCommandEvent& WXUNUSED(event) ) size_t count = paths.GetCount(); for ( size_t n = 0; n < count; n++ ) { - s.Printf(_T("File %d: %s (%s)\n"), + s.Printf(wxT("File %d: %s (%s)\n"), (int)n, paths[n].c_str(), filenames[n].c_str()); msg += s; } - s.Printf(_T("Filter index: %d"), dialog.GetFilterIndex()); + s.Printf(wxT("Filter index: %d"), dialog.GetFilterIndex()); msg += s; - wxMessageDialog dialog2(this, msg, _T("Selected files")); + wxMessageDialog dialog2(this, msg, wxT("Selected files")); dialog2.ShowModal(); } @@ -1300,17 +1300,17 @@ void MyFrame::FilesOpenGeneric(wxCommandEvent& WXUNUSED(event) ) void MyFrame::FileSaveGeneric(wxCommandEvent& WXUNUSED(event) ) { wxGenericFileDialog dialog(this, - _T("Testing save file dialog"), + wxT("Testing save file dialog"), wxEmptyString, - _T("myletter.doc"), - _T("Text files (*.txt)|*.txt|Document files (*.doc;*.ods)|*.doc;*.ods"), + wxT("myletter.doc"), + wxT("Text files (*.txt)|*.txt|Document files (*.doc;*.ods)|*.doc;*.ods"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); dialog.SetFilterIndex(1); if (dialog.ShowModal() == wxID_OK) { - wxLogMessage(_T("%s, filter %d"), + wxLogMessage(wxT("%s, filter %d"), dialog.GetPath().c_str(), dialog.GetFilterIndex()); } } @@ -1323,11 +1323,11 @@ void MyFrame::DoDirChoose(int style) wxString dirHome; wxGetHomeDir(&dirHome); - wxDirDialog dialog(this, _T("Testing directory picker"), dirHome, style); + wxDirDialog dialog(this, wxT("Testing directory picker"), dirHome, style); if (dialog.ShowModal() == wxID_OK) { - wxLogMessage(_T("Selected path: %s"), dialog.GetPath().c_str()); + wxLogMessage(wxT("Selected path: %s"), dialog.GetPath().c_str()); } } @@ -1349,11 +1349,11 @@ void MyFrame::GenericDirChoose(wxCommandEvent& WXUNUSED(event) ) wxString dirHome; wxGetHomeDir(&dirHome); - wxGenericDirDialog dialog(this, _T("Testing generic directory picker"), dirHome); + wxGenericDirDialog dialog(this, wxT("Testing generic directory picker"), dirHome); if (dialog.ShowModal() == wxID_OK) { - wxMessageDialog dialog2(this, dialog.GetPath(), _T("Selected path")); + wxMessageDialog dialog2(this, dialog.GetPath(), wxT("Selected path")); dialog2.ShowModal(); } } @@ -1395,18 +1395,18 @@ void MyFrame::ModelessDlg(wxCommandEvent& event) void MyFrame::DlgCenteredScreen(wxCommandEvent& WXUNUSED(event)) { - wxDialog dlg(this, wxID_ANY, _T("Dialog centered on screen"), + wxDialog dlg(this, wxID_ANY, wxT("Dialog centered on screen"), wxDefaultPosition, wxSize(200, 100)); - (new wxButton(&dlg, wxID_OK, _T("Close")))->Centre(); + (new wxButton(&dlg, wxID_OK, wxT("Close")))->Centre(); dlg.CentreOnScreen(); dlg.ShowModal(); } void MyFrame::DlgCenteredParent(wxCommandEvent& WXUNUSED(event)) { - wxDialog dlg(this, wxID_ANY, _T("Dialog centered on parent"), + wxDialog dlg(this, wxID_ANY, wxT("Dialog centered on parent"), wxDefaultPosition, wxSize(200, 100)); - (new wxButton(&dlg, wxID_OK, _T("Close")))->Centre(); + (new wxButton(&dlg, wxID_OK, wxT("Close")))->Centre(); dlg.CentreOnParent(); dlg.ShowModal(); } @@ -1414,16 +1414,16 @@ void MyFrame::DlgCenteredParent(wxCommandEvent& WXUNUSED(event)) #if wxUSE_MINIFRAME void MyFrame::MiniFrame(wxCommandEvent& WXUNUSED(event)) { - wxFrame *frame = new wxMiniFrame(this, wxID_ANY, _T("Mini frame"), + wxFrame *frame = new wxMiniFrame(this, wxID_ANY, wxT("Mini frame"), wxDefaultPosition, wxSize(300, 100), wxCAPTION | wxCLOSE_BOX); new wxStaticText(frame, wxID_ANY, - _T("Mini frames have slightly different appearance"), + wxT("Mini frames have slightly different appearance"), wxPoint(5, 5)); new wxStaticText(frame, wxID_ANY, - _T("from the normal frames but that's the only difference."), + wxT("from the normal frames but that's the only difference."), wxPoint(5, 25)); frame->CentreOnParent(); @@ -1433,10 +1433,10 @@ void MyFrame::MiniFrame(wxCommandEvent& WXUNUSED(event)) void MyFrame::DlgOnTop(wxCommandEvent& WXUNUSED(event)) { - wxDialog dlg(this, wxID_ANY, _T("Dialog staying on top of other windows"), + wxDialog dlg(this, wxID_ANY, wxT("Dialog staying on top of other windows"), wxDefaultPosition, wxSize(300, 100), wxDEFAULT_DIALOG_STYLE | wxSTAY_ON_TOP); - (new wxButton(&dlg, wxID_OK, _T("Close")))->Centre(); + (new wxButton(&dlg, wxID_OK, wxT("Close")))->Centre(); dlg.ShowModal(); } @@ -1454,13 +1454,13 @@ void MyFrame::ShowTip(wxCommandEvent& WXUNUSED(event)) s_index = rand() % 5; } - wxTipProvider *tipProvider = wxCreateFileTipProvider(_T("tips.txt"), s_index); + wxTipProvider *tipProvider = wxCreateFileTipProvider(wxT("tips.txt"), s_index); bool showAtStartup = wxShowTip(this, tipProvider); if ( showAtStartup ) { - wxMessageBox(_T("Will show tips on startup"), _T("Tips dialog"), + wxMessageBox(wxT("Will show tips on startup"), wxT("Tips dialog"), wxOK | wxICON_INFORMATION, this); } @@ -1479,7 +1479,7 @@ void MyFrame::OnPropertySheet(wxCommandEvent& event) void MyFrame::OnRequestUserAttention(wxCommandEvent& WXUNUSED(event)) { - wxLogStatus(_T("Sleeping for 3 seconds to allow you to switch to another window")); + wxLogStatus(wxT("Sleeping for 3 seconds to allow you to switch to another window")); wxSleep(3); @@ -1607,8 +1607,8 @@ void MyFrame::ShowProgress( wxCommandEvent& WXUNUSED(event) ) { static const int max = 100; - wxProgressDialog dialog(_T("Progress dialog example"), - _T("An informative message"), + wxProgressDialog dialog(wxT("Progress dialog example"), + wxT("An informative message"), max, // range this, // parent wxPD_CAN_ABORT | @@ -1634,15 +1634,15 @@ void MyFrame::ShowProgress( wxCommandEvent& WXUNUSED(event) ) if ( i == max ) { - msg = _T("That's all, folks!"); + msg = wxT("That's all, folks!"); } else if ( !determinate ) { - msg = _T("Testing indeterminate mode"); + msg = wxT("Testing indeterminate mode"); } else if ( determinate ) { - msg = _T("Now in standard determinate mode"); + msg = wxT("Now in standard determinate mode"); } // will be set to true if "Skip" button was pressed @@ -1662,8 +1662,8 @@ void MyFrame::ShowProgress( wxCommandEvent& WXUNUSED(event) ) if ( !cont ) { - if ( wxMessageBox(_T("Do you really want to cancel?"), - _T("Progress dialog question"), // caption + if ( wxMessageBox(wxT("Do you really want to cancel?"), + wxT("Progress dialog question"), // caption wxYES_NO | wxICON_QUESTION) == wxYES ) break; @@ -1688,18 +1688,18 @@ void MyFrame::ShowProgress( wxCommandEvent& WXUNUSED(event) ) static void InitAboutInfoMinimal(wxAboutDialogInfo& info) { - info.SetName(_T("Dialogs Sample")); + info.SetName(wxT("Dialogs Sample")); info.SetVersion(wxVERSION_NUM_DOT_STRING_T); - info.SetDescription(_T("This sample shows different wxWidgets dialogs")); - info.SetCopyright(_T("(C) 1998-2006 wxWidgets dev team")); - info.AddDeveloper(_T("Vadim Zeitlin")); + info.SetDescription(wxT("This sample shows different wxWidgets dialogs")); + info.SetCopyright(wxT("(C) 1998-2006 wxWidgets dev team")); + info.AddDeveloper(wxT("Vadim Zeitlin")); } static void InitAboutInfoWebsite(wxAboutDialogInfo& info) { InitAboutInfoMinimal(info); - info.SetWebSite(_T("http://www.wxwidgets.org/"), _T("wxWidgets web site")); + info.SetWebSite(wxT("http://www.wxwidgets.org/"), wxT("wxWidgets web site")); } static void InitAboutInfoAll(wxAboutDialogInfo& info) @@ -1707,13 +1707,13 @@ static void InitAboutInfoAll(wxAboutDialogInfo& info) InitAboutInfoWebsite(info); // we can add a second developer - info.AddDeveloper(_T("A.N. Other")); + info.AddDeveloper(wxT("A.N. Other")); // or we can add several persons at once like this static const wxChar *docwriters[] = { - _T("First D. Writer"), - _T("Second One"), + wxT("First D. Writer"), + wxT("Second One"), }; info.SetDocWriters(wxArrayString(WXSIZEOF(docwriters), docwriters)); @@ -1732,7 +1732,7 @@ static void InitAboutInfoAll(wxAboutDialogInfo& info) " ...and so on and so forth...\n" )); - info.AddTranslator(_T("Wun Ngo Wen (Martian)")); + info.AddTranslator(wxT("Wun Ngo Wen (Martian)")); } void MyFrame::ShowSimpleAboutDialog(wxCommandEvent& WXUNUSED(event)) @@ -1772,7 +1772,7 @@ public: virtual void DoAddCustomControls() { AddControl(new wxStaticLine(this), wxSizerFlags().Expand()); - AddText(_T("Some custom text")); + AddText(wxT("Some custom text")); AddControl(new wxStaticLine(this), wxSizerFlags().Expand()); } }; @@ -1794,7 +1794,7 @@ void MyFrame::ShowBusyInfo(wxCommandEvent& WXUNUSED(event)) { wxWindowDisabler disableAll; - wxBusyInfo info(_T("Working, please wait..."), this); + wxBusyInfo info(wxT("Working, please wait..."), this); for ( int i = 0; i < 18; i++ ) { @@ -1823,7 +1823,7 @@ void MyFrame::ShowReplaceDialog( wxCommandEvent& WXUNUSED(event) ) ( this, &m_findData, - _T("Find and replace dialog"), + wxT("Find and replace dialog"), wxFR_REPLACEDIALOG ); @@ -1844,7 +1844,7 @@ void MyFrame::ShowFindDialog( wxCommandEvent& WXUNUSED(event) ) ( this, &m_findData, - _T("Find dialog"), + wxT("Find dialog"), // just for testing wxFR_NOWHOLEWORD ); @@ -1856,10 +1856,10 @@ void MyFrame::ShowFindDialog( wxCommandEvent& WXUNUSED(event) ) static wxString DecodeFindDialogEventFlags(int flags) { wxString str; - str << (flags & wxFR_DOWN ? _T("down") : _T("up")) << _T(", ") - << (flags & wxFR_WHOLEWORD ? _T("whole words only, ") : _T("")) - << (flags & wxFR_MATCHCASE ? _T("") : _T("not ")) - << _T("case sensitive"); + str << (flags & wxFR_DOWN ? wxT("down") : wxT("up")) << wxT(", ") + << (flags & wxFR_WHOLEWORD ? wxT("whole words only, ") : wxT("")) + << (flags & wxFR_MATCHCASE ? wxT("") : wxT("not ")) + << wxT("case sensitive"); return str; } @@ -1879,7 +1879,7 @@ void MyFrame::OnFindDialog(wxFindDialogEvent& event) type == wxEVT_COMMAND_FIND_REPLACE_ALL ) { wxLogMessage(wxT("Replace %s'%s' with '%s' (flags: %s)"), - type == wxEVT_COMMAND_FIND_REPLACE_ALL ? _T("all ") : wxT(""), + type == wxEVT_COMMAND_FIND_REPLACE_ALL ? wxT("all ") : wxT(""), event.GetFindString().c_str(), event.GetReplaceString().c_str(), DecodeFindDialogEventFlags(event.GetFlags()).c_str()); @@ -1892,22 +1892,22 @@ void MyFrame::OnFindDialog(wxFindDialogEvent& event) const wxChar *txt; if ( dlg == m_dlgFind ) { - txt = _T("Find"); + txt = wxT("Find"); idMenu = DIALOGS_FIND; m_dlgFind = NULL; } else if ( dlg == m_dlgReplace ) { - txt = _T("Replace"); + txt = wxT("Replace"); idMenu = DIALOGS_REPLACE; m_dlgReplace = NULL; } else { - txt = _T("Unknown"); + txt = wxT("Unknown"); idMenu = wxID_ANY; - wxFAIL_MSG( _T("unexpected event") ); + wxFAIL_MSG( wxT("unexpected event") ); } wxLogMessage(wxT("%s dialog is being closed."), txt); @@ -1938,9 +1938,9 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event) ) dc.SetTextForeground(wxGetApp().m_canvasTextColour); dc.SetBackgroundMode(wxTRANSPARENT); dc.DrawText( - _T("wxWidgets common dialogs") + wxT("wxWidgets common dialogs") #if !defined(__SMARTPHONE__) - _T(" test application") + wxT(" test application") #endif , 10, 10); } @@ -1952,12 +1952,12 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event) ) // ---------------------------------------------------------------------------- MyModelessDialog::MyModelessDialog(wxWindow *parent) - : wxDialog(parent, wxID_ANY, wxString(_T("Modeless dialog"))) + : wxDialog(parent, wxID_ANY, wxString(wxT("Modeless dialog"))) { wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); - wxButton *btn = new wxButton(this, DIALOGS_MODELESS_BTN, _T("Press me")); - wxCheckBox *check = new wxCheckBox(this, wxID_ANY, _T("Should be disabled")); + wxButton *btn = new wxButton(this, DIALOGS_MODELESS_BTN, wxT("Press me")); + wxCheckBox *check = new wxCheckBox(this, wxID_ANY, wxT("Should be disabled")); check->Disable(); sizerTop->Add(btn, 1, wxEXPAND | wxALL, 5); @@ -1968,7 +1968,7 @@ MyModelessDialog::MyModelessDialog(wxWindow *parent) void MyModelessDialog::OnButton(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Button pressed in modeless dialog"), _T("Info"), + wxMessageBox(wxT("Button pressed in modeless dialog"), wxT("Info"), wxOK | wxICON_INFORMATION, this); } @@ -1976,8 +1976,8 @@ void MyModelessDialog::OnClose(wxCloseEvent& event) { if ( event.CanVeto() ) { - wxMessageBox(_T("Use the menu item to close this dialog"), - _T("Modeless dialog"), + wxMessageBox(wxT("Use the menu item to close this dialog"), + wxT("Modeless dialog"), wxOK | wxICON_INFORMATION, this); event.Veto(); @@ -1989,13 +1989,13 @@ void MyModelessDialog::OnClose(wxCloseEvent& event) // ---------------------------------------------------------------------------- MyModalDialog::MyModalDialog(wxWindow *parent) - : wxDialog(parent, wxID_ANY, wxString(_T("Modal dialog"))) + : wxDialog(parent, wxID_ANY, wxString(wxT("Modal dialog"))) { wxBoxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); - m_btnModal = new wxButton(this, wxID_ANY, _T("&Modal dialog...")); - m_btnModeless = new wxButton(this, wxID_ANY, _T("Mode&less dialog")); - m_btnDelete = new wxButton(this, wxID_ANY, _T("&Delete button")); + m_btnModal = new wxButton(this, wxID_ANY, wxT("&Modal dialog...")); + m_btnModeless = new wxButton(this, wxID_ANY, wxT("Mode&less dialog")); + m_btnDelete = new wxButton(this, wxID_ANY, wxT("&Delete button")); sizerTop->Add(m_btnModal, 0, wxALIGN_CENTER | wxALL, 5); sizerTop->Add(m_btnModeless, 0, wxALIGN_CENTER | wxALL, 5); @@ -2022,11 +2022,11 @@ void MyModalDialog::OnButton(wxCommandEvent& event) else if ( event.GetEventObject() == m_btnModal ) { #if wxUSE_TEXTDLG - wxGetTextFromUser(_T("Dummy prompt"), - _T("Modal dialog called from dialog"), + wxGetTextFromUser(wxT("Dummy prompt"), + wxT("Modal dialog called from dialog"), wxEmptyString, this); #else - wxMessageBox(_T("Modal dialog called from dialog")); + wxMessageBox(wxT("Modal dialog called from dialog")); #endif // wxUSE_TEXTDLG } else if ( event.GetEventObject() == m_btnModeless ) @@ -2046,7 +2046,7 @@ void MyModalDialog::OnButton(wxCommandEvent& event) // ---------------------------------------------------------------------------- StdButtonSizerDialog::StdButtonSizerDialog(wxWindow *parent) - : wxDialog(parent, wxID_ANY, wxString(_T("StdButtonSizer dialog")), + : wxDialog(parent, wxID_ANY, wxString(wxT("StdButtonSizer dialog")), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER), m_buttonsSizer(NULL) { diff --git a/samples/dialup/nettest.cpp b/samples/dialup/nettest.cpp index 1b57f27557..8e68d35171 100644 --- a/samples/dialup/nettest.cpp +++ b/samples/dialup/nettest.cpp @@ -158,7 +158,7 @@ bool MyApp::OnInit() return false; // Create the main application window - MyFrame *frame = new MyFrame(_T("Dial-up wxWidgets demo"), + MyFrame *frame = new MyFrame(wxT("Dial-up wxWidgets demo"), wxPoint(50, 50), wxSize(450, 340)); // Show it and tell the application that it's our main window @@ -183,7 +183,7 @@ bool MyApp::OnInit() } #if wxUSE_STATUSBAR - frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? _T("LAN") : _T("No LAN"), 2); + frame->SetStatusText(GetDialer()->IsAlwaysOnline() ? wxT("LAN") : wxT("No LAN"), 2); #endif // wxUSE_STATUSBAR return true; @@ -229,19 +229,19 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->Append(NetTest_Dial, _T("&Dial\tCtrl-D"), _T("Dial default ISP")); - menuFile->Append(NetTest_HangUp, _T("&HangUp\tCtrl-H"), _T("Hang up modem")); + menuFile->Append(NetTest_Dial, wxT("&Dial\tCtrl-D"), wxT("Dial default ISP")); + menuFile->Append(NetTest_HangUp, wxT("&HangUp\tCtrl-H"), wxT("Hang up modem")); menuFile->AppendSeparator(); - menuFile->Append(NetTest_EnumISP, _T("&Enumerate ISPs...\tCtrl-E")); - menuFile->Append(NetTest_Check, _T("&Check connection status...\tCtrl-C")); + menuFile->Append(NetTest_EnumISP, wxT("&Enumerate ISPs...\tCtrl-E")); + menuFile->Append(NetTest_Check, wxT("&Check connection status...\tCtrl-C")); menuFile->AppendSeparator(); - menuFile->Append(NetTest_About, _T("&About...\tCtrl-A"), _T("Show about dialog")); + menuFile->Append(NetTest_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog")); menuFile->AppendSeparator(); - menuFile->Append(NetTest_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(NetTest_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menuFile, _T("&File")); + menuBar->Append(menuFile, wxT("&File")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -324,7 +324,7 @@ void MyFrame::OnEnumISPs(wxCommandEvent& WXUNUSED(event)) } else { - wxString msg = _T("Known ISPs:\n"); + wxString msg = wxT("Known ISPs:\n"); for ( size_t n = 0; n < nCount; n++ ) { msg << names[n] << '\n'; @@ -350,7 +350,7 @@ void MyFrame::OnIdle(wxIdleEvent& WXUNUSED(event)) s_isOnline = isOnline; #if wxUSE_STATUSBAR - SetStatusText(isOnline ? _T("Online") : _T("Offline"), 1); + SetStatusText(isOnline ? wxT("Online") : wxT("Offline"), 1); #endif // wxUSE_STATUSBAR } } diff --git a/samples/display/display.cpp b/samples/display/display.cpp index 456f75f97e..7172e2ae61 100644 --- a/samples/display/display.cpp +++ b/samples/display/display.cpp @@ -171,9 +171,9 @@ bool MyApp::OnInit() return false; #ifdef __WXMSW__ - if ( argc == 2 && !wxStricmp(argv[1], _T("/dx")) ) + if ( argc == 2 && !wxStricmp(argv[1], wxT("/dx")) ) { - wxSystemOptions::SetOption(_T("msw.display.directdraw"), 1); + wxSystemOptions::SetOption(wxT("msw.display.directdraw"), 1); } #endif // __WXMSW__ @@ -245,35 +245,35 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, sizer->AddGrowableCol(1); const wxRect r(display.GetGeometry()); - sizer->Add(new wxStaticText(page, wxID_ANY, _T("Origin: "))); + sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Origin: "))); sizer->Add(new wxStaticText ( page, wxID_ANY, - wxString::Format(_T("(%d, %d)"), + wxString::Format(wxT("(%d, %d)"), r.x, r.y) )); - sizer->Add(new wxStaticText(page, wxID_ANY, _T("Size: "))); + sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Size: "))); sizer->Add(new wxStaticText ( page, wxID_ANY, - wxString::Format(_T("(%d, %d)"), + wxString::Format(wxT("(%d, %d)"), r.width, r.height) )); const wxRect rc(display.GetClientArea()); - sizer->Add(new wxStaticText(page, wxID_ANY, _T("Client area: "))); + sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Client area: "))); sizer->Add(new wxStaticText ( page, wxID_ANY, - wxString::Format(_T("(%d, %d)-(%d, %d)"), + wxString::Format(wxT("(%d, %d)-(%d, %d)"), rc.x, rc.y, rc.width, rc.height) )); - sizer->Add(new wxStaticText(page, wxID_ANY, _T("Name: "))); + sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Name: "))); sizer->Add(new wxStaticText(page, wxID_ANY, display.GetName())); wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); @@ -291,22 +291,22 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, new MyVideoModeClientData(mode)); } - sizer->Add(new wxStaticText(page, wxID_ANY, _T("&Modes: "))); + sizer->Add(new wxStaticText(page, wxID_ANY, wxT("&Modes: "))); sizer->Add(choiceModes, 0, wxEXPAND); - sizer->Add(new wxStaticText(page, wxID_ANY, _T("Current: "))); + sizer->Add(new wxStaticText(page, wxID_ANY, wxT("Current: "))); sizer->Add(new wxStaticText(page, Display_CurrentMode, VideoModeToText(display.GetCurrentMode()))); // add it to another sizer to have borders around it and button below - sizerTop->Add(new wxButton(page, Display_ResetMode, _T("&Reset mode")), + sizerTop->Add(new wxButton(page, Display_ResetMode, wxT("&Reset mode")), 0, wxALL | wxCENTRE, 5); #endif // wxUSE_DISPLAY page->SetSizer(sizerTop); m_book->AddPage(page, - wxString::Format(_T("Display %lu"), + wxString::Format(wxT("Display %lu"), (unsigned long)nDpy)); } @@ -321,16 +321,16 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, wxString MyFrame::VideoModeToText(const wxVideoMode& mode) { wxString s; - s.Printf(_T("%dx%d"), mode.w, mode.h); + s.Printf(wxT("%dx%d"), mode.w, mode.h); if ( mode.bpp ) { - s += wxString::Format(_T(", %dbpp"), mode.bpp); + s += wxString::Format(wxT(", %dbpp"), mode.bpp); } if ( mode.refresh ) { - s += wxString::Format(_T(", %dHz"), mode.refresh); + s += wxString::Format(wxT(", %dHz"), mode.refresh); } return s; @@ -348,8 +348,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Demo program for wxDisplay class.\n\n(c) 2003-2006 Vadim Zeitlin"), - _T("About Display Sample"), + wxMessageBox(wxT("Demo program for wxDisplay class.\n\n(c) 2003-2006 Vadim Zeitlin"), + wxT("About Display Sample"), wxOK | wxICON_INFORMATION, this); } @@ -357,7 +357,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnFromPoint(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_STATUSBAR - SetStatusText(_T("Press the mouse anywhere...")); + SetStatusText(wxT("Press the mouse anywhere...")); #endif // wxUSE_STATUSBAR CaptureMouse(); @@ -379,7 +379,7 @@ void MyFrame::OnChangeMode(wxCommandEvent& event) wxDynamicCast(event.GetEventObject(), wxChoice)-> GetClientObject(event.GetInt()))->mode) ) { - wxLogError(_T("Changing video mode failed!")); + wxLogError(wxT("Changing video mode failed!")); } } @@ -401,10 +401,10 @@ void MyFrame::OnLeftClick(wxMouseEvent& event) int dpy = wxDisplay::GetFromPoint(ptScreen); if ( dpy == wxNOT_FOUND ) { - wxLogError(_T("Mouse clicked outside of display!?")); + wxLogError(wxT("Mouse clicked outside of display!?")); } - wxLogStatus(this, _T("Mouse clicked in display %d (at (%d, %d))"), + wxLogStatus(this, wxT("Mouse clicked in display %d (at (%d, %d))"), dpy, ptScreen.x, ptScreen.y); ReleaseMouse(); @@ -426,7 +426,7 @@ void MyFrame::OnDisplayChanged(wxDisplayChangedEvent& event) } - wxLogStatus(this, _T("Display resolution was changed.")); + wxLogStatus(this, wxT("Display resolution was changed.")); event.Skip(); } diff --git a/samples/dnd/dnd.cpp b/samples/dnd/dnd.cpp index 9c2651c34b..038b87eea2 100644 --- a/samples/dnd/dnd.cpp +++ b/samples/dnd/dnd.cpp @@ -78,7 +78,7 @@ public: void OnDropURL(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), const wxString& text) { // of course, a real program would do something more useful here... - wxMessageBox(text, _T("wxDnD sample: got URL"), + wxMessageBox(text, wxT("wxDnD sample: got URL"), wxICON_INFORMATION | wxOK); } @@ -755,14 +755,14 @@ public: virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def) { #if wxUSE_STATUSBAR - m_frame->SetStatusText(_T("Mouse entered the frame")); + m_frame->SetStatusText(wxT("Mouse entered the frame")); #endif // wxUSE_STATUSBAR return OnDragOver(x, y, def); } virtual void OnLeave() { #if wxUSE_STATUSBAR - m_frame->SetStatusText(_T("Mouse left the frame")); + m_frame->SetStatusText(wxT("Mouse left the frame")); #endif // wxUSE_STATUSBAR } virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) @@ -907,7 +907,7 @@ bool DnDApp::OnInit() // switch on trace messages #if wxUSE_LOG #if defined(__WXGTK__) - wxLog::AddTraceMask(_T("clipboard")); + wxLog::AddTraceMask(wxT("clipboard")); #elif defined(__WXMSW__) wxLog::AddTraceMask(wxTRACE_OleCalls); #endif @@ -922,7 +922,7 @@ bool DnDApp::OnInit() return true; #else - wxMessageBox( _T("This sample has to be compiled with wxUSE_DRAG_AND_DROP"), _T("Building error"), wxOK); + wxMessageBox( wxT("This sample has to be compiled with wxUSE_DRAG_AND_DROP"), wxT("Building error"), wxOK); return false; #endif // wxUSE_DRAG_AND_DROP } @@ -930,9 +930,9 @@ bool DnDApp::OnInit() #if wxUSE_DRAG_AND_DROP || wxUSE_CLIPBOARD DnDFrame::DnDFrame() - : wxFrame(NULL, wxID_ANY, _T("Drag-and-Drop/Clipboard wxWidgets Sample"), + : wxFrame(NULL, wxID_ANY, wxT("Drag-and-Drop/Clipboard wxWidgets Sample"), wxPoint(10, 100)), - m_strText(_T("wxWidgets drag & drop works :-)")) + m_strText(wxT("wxWidgets drag & drop works :-)")) { // frame icon and status bar @@ -944,53 +944,53 @@ DnDFrame::DnDFrame() // construct menu wxMenu *file_menu = new wxMenu; - file_menu->Append(Menu_Drag, _T("&Test drag...")); - file_menu->AppendCheckItem(Menu_DragMoveDef, _T("&Move by default")); - file_menu->AppendCheckItem(Menu_DragMoveAllow, _T("&Allow moving")); + file_menu->Append(Menu_Drag, wxT("&Test drag...")); + file_menu->AppendCheckItem(Menu_DragMoveDef, wxT("&Move by default")); + file_menu->AppendCheckItem(Menu_DragMoveAllow, wxT("&Allow moving")); file_menu->AppendSeparator(); - file_menu->Append(Menu_NewFrame, _T("&New frame\tCtrl-N")); + file_menu->Append(Menu_NewFrame, wxT("&New frame\tCtrl-N")); file_menu->AppendSeparator(); - file_menu->Append(Menu_Quit, _T("E&xit\tCtrl-Q")); + file_menu->Append(Menu_Quit, wxT("E&xit\tCtrl-Q")); #if wxUSE_LOG wxMenu *log_menu = new wxMenu; - log_menu->Append(Menu_Clear, _T("Clear\tCtrl-L")); + log_menu->Append(Menu_Clear, wxT("Clear\tCtrl-L")); #endif // wxUSE_LOG wxMenu *help_menu = new wxMenu; - help_menu->Append(Menu_Help, _T("&Help...")); + help_menu->Append(Menu_Help, wxT("&Help...")); help_menu->AppendSeparator(); - help_menu->Append(Menu_About, _T("&About")); + help_menu->Append(Menu_About, wxT("&About")); wxMenu *clip_menu = new wxMenu; - clip_menu->Append(Menu_Copy, _T("&Copy text\tCtrl-C")); - clip_menu->Append(Menu_Paste, _T("&Paste text\tCtrl-V")); + clip_menu->Append(Menu_Copy, wxT("&Copy text\tCtrl-C")); + clip_menu->Append(Menu_Paste, wxT("&Paste text\tCtrl-V")); clip_menu->AppendSeparator(); - clip_menu->Append(Menu_CopyBitmap, _T("Copy &bitmap\tCtrl-Shift-C")); - clip_menu->Append(Menu_PasteBitmap, _T("Paste b&itmap\tCtrl-Shift-V")); + clip_menu->Append(Menu_CopyBitmap, wxT("Copy &bitmap\tCtrl-Shift-C")); + clip_menu->Append(Menu_PasteBitmap, wxT("Paste b&itmap\tCtrl-Shift-V")); #if wxUSE_METAFILE clip_menu->AppendSeparator(); - clip_menu->Append(Menu_PasteMFile, _T("Paste &metafile\tCtrl-M")); + clip_menu->Append(Menu_PasteMFile, wxT("Paste &metafile\tCtrl-M")); #endif // wxUSE_METAFILE clip_menu->AppendSeparator(); - clip_menu->Append(Menu_CopyFiles, _T("Copy &files\tCtrl-F")); + clip_menu->Append(Menu_CopyFiles, wxT("Copy &files\tCtrl-F")); clip_menu->AppendSeparator(); - clip_menu->AppendCheckItem(Menu_UsePrimary, _T("Use &primary selection\tCtrl-P")); + clip_menu->AppendCheckItem(Menu_UsePrimary, wxT("Use &primary selection\tCtrl-P")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); #if wxUSE_LOG - menu_bar->Append(log_menu, _T("&Log")); + menu_bar->Append(log_menu, wxT("&Log")); #endif // wxUSE_LOG - menu_bar->Append(clip_menu, _T("&Clipboard")); - menu_bar->Append(help_menu, _T("&Help")); + menu_bar->Append(clip_menu, wxT("&Clipboard")); + menu_bar->Append(help_menu, wxT("&Help")); SetMenuBar(menu_bar); // create the child controls SetBackgroundColour(*wxWHITE); // labels read better on this background - wxString strFile(_T("Drop files here!")), strText(_T("Drop text on me")); + wxString strFile(wxT("Drop files here!")), strText(wxT("Drop text on me")); m_ctrlFile = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 1, &strFile, wxLB_HSCROLL | wxLB_ALWAYS_SB ); @@ -1082,8 +1082,8 @@ void DnDFrame::OnPaint(wxPaintEvent& WXUNUSED(event)) wxPaintDC dc(this); // dc.Clear(); -- this kills wxGTK - dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL, false, _T("charter") ) ); - dc.DrawText( _T("Drag text from here!"), 100, h-50 ); + dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL, false, wxT("charter") ) ); + dc.DrawText( wxT("Drag text from here!"), 100, h-50 ); } void DnDFrame::OnUpdateUIMoveByDefault(wxUpdateUIEvent& event) @@ -1128,11 +1128,11 @@ void DnDFrame::OnDrag(wxCommandEvent& WXUNUSED(event)) #if wxUSE_DRAG_AND_DROP wxString strText = wxGetTextFromUser ( - _T("After you enter text in this dialog, press any mouse\n") - _T("button in the bottom (empty) part of the frame and \n") - _T("drag it anywhere - you will be in fact dragging the\n") - _T("text object containing this text"), - _T("Please enter some text"), m_strText, this + wxT("After you enter text in this dialog, press any mouse\n") + wxT("button in the bottom (empty) part of the frame and \n") + wxT("drag it anywhere - you will be in fact dragging the\n") + wxT("text object containing this text"), + wxT("Please enter some text"), m_strText, this ); m_strText = strText; @@ -1151,10 +1151,10 @@ void DnDFrame::OnDragMoveAllow(wxCommandEvent& event) void DnDFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Drag-&-Drop Demo\n") - _T("Please see \"Help|Help...\" for details\n") - _T("Copyright (c) 1998 Vadim Zeitlin"), - _T("About wxDnD"), + wxMessageBox(wxT("Drag-&-Drop Demo\n") + wxT("Please see \"Help|Help...\" for details\n") + wxT("Copyright (c) 1998 Vadim Zeitlin"), + wxT("About wxDnD"), wxICON_INFORMATION | wxOK, this); } @@ -1162,27 +1162,27 @@ void DnDFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) void DnDFrame::OnHelp(wxCommandEvent& /* event */) { wxMessageDialog dialog(this, - _T("This small program demonstrates drag & drop support in wxWidgets. The program window\n") - _T("consists of 3 parts: the bottom pane is for debug messages, so that you can see what's\n") - _T("going on inside. The top part is split into 2 listboxes, the left one accepts files\n") - _T("and the right one accepts text.\n") - _T("\n") - _T("To test wxDropTarget: open wordpad (write.exe), select some text in it and drag it to\n") - _T("the right listbox (you'll notice the usual visual feedback, i.e. the cursor will change).\n") - _T("Also, try dragging some files (you can select several at once) from Windows Explorer (or \n") - _T("File Manager) to the left pane. Hold down Ctrl/Shift keys when you drop text (doesn't \n") - _T("work with files) and see what changes.\n") - _T("\n") - _T("To test wxDropSource: just press any mouse button on the empty zone of the window and drag\n") - _T("it to wordpad or any other droptarget accepting text (and of course you can just drag it\n") - _T("to the right pane). Due to a lot of trace messages, the cursor might take some time to \n") - _T("change, don't release the mouse button until it does. You can change the string being\n") - _T("dragged in in \"File|Test drag...\" dialog.\n") - _T("\n") - _T("\n") - _T("Please send all questions/bug reports/suggestions &c to \n") - _T("Vadim Zeitlin "), - _T("wxDnD Help")); + wxT("This small program demonstrates drag & drop support in wxWidgets. The program window\n") + wxT("consists of 3 parts: the bottom pane is for debug messages, so that you can see what's\n") + wxT("going on inside. The top part is split into 2 listboxes, the left one accepts files\n") + wxT("and the right one accepts text.\n") + wxT("\n") + wxT("To test wxDropTarget: open wordpad (write.exe), select some text in it and drag it to\n") + wxT("the right listbox (you'll notice the usual visual feedback, i.e. the cursor will change).\n") + wxT("Also, try dragging some files (you can select several at once) from Windows Explorer (or \n") + wxT("File Manager) to the left pane. Hold down Ctrl/Shift keys when you drop text (doesn't \n") + wxT("work with files) and see what changes.\n") + wxT("\n") + wxT("To test wxDropSource: just press any mouse button on the empty zone of the window and drag\n") + wxT("it to wordpad or any other droptarget accepting text (and of course you can just drag it\n") + wxT("to the right pane). Due to a lot of trace messages, the cursor might take some time to \n") + wxT("change, don't release the mouse button until it does. You can change the string being\n") + wxT("dragged in in \"File|Test drag...\" dialog.\n") + wxT("\n") + wxT("\n") + wxT("Please send all questions/bug reports/suggestions &c to \n") + wxT("Vadim Zeitlin "), + wxT("wxDnD Help")); dialog.ShowModal(); } @@ -1204,15 +1204,15 @@ void DnDFrame::LogDragResult(wxDragResult result) const wxChar *pc; switch ( result ) { - case wxDragError: pc = _T("Error!"); break; - case wxDragNone: pc = _T("Nothing"); break; - case wxDragCopy: pc = _T("Copied"); break; - case wxDragMove: pc = _T("Moved"); break; - case wxDragCancel: pc = _T("Cancelled"); break; - default: pc = _T("Huh?"); break; + case wxDragError: pc = wxT("Error!"); break; + case wxDragNone: pc = wxT("Nothing"); break; + case wxDragCopy: pc = wxT("Copied"); break; + case wxDragMove: pc = wxT("Moved"); break; + case wxDragCancel: pc = wxT("Cancelled"); break; + default: pc = wxT("Huh?"); break; } - SetStatusText(wxString(_T("Drag result: ")) + pc); + SetStatusText(wxString(wxT("Drag result: ")) + pc); #else wxUnusedVar(result); #endif // wxUSE_STATUSBAR @@ -1245,11 +1245,11 @@ void DnDFrame::OnLeftDown(wxMouseEvent &WXUNUSED(event) ) void DnDFrame::OnRightDown(wxMouseEvent &event ) { - wxMenu menu(_T("Dnd sample menu")); + wxMenu menu(wxT("Dnd sample menu")); - menu.Append(Menu_Drag, _T("&Test drag...")); + menu.Append(Menu_Drag, wxT("&Test drag...")); menu.AppendSeparator(); - menu.Append(Menu_About, _T("&About")); + menu.Append(Menu_About, wxT("&About")); PopupMenu( &menu, event.GetX(), event.GetY() ); } @@ -1269,8 +1269,8 @@ void DnDFrame::OnUsePrimary(wxCommandEvent& event) const bool usePrimary = event.IsChecked(); wxTheClipboard->UsePrimarySelection(usePrimary); - wxLogStatus(_T("Now using %s selection"), usePrimary ? _T("primary") - : _T("clipboard")); + wxLogStatus(wxT("Now using %s selection"), usePrimary ? wxT("primary") + : wxT("clipboard")); } #if wxUSE_DRAG_AND_DROP @@ -1296,26 +1296,26 @@ void DnDFrame::OnCopyBitmap(wxCommandEvent& WXUNUSED(event)) { // PNG support is not always compiled in under Windows, so use BMP there #if wxUSE_LIBPNG - wxFileDialog dialog(this, _T("Open a PNG file"), wxEmptyString, wxEmptyString, _T("PNG files (*.png)|*.png"), 0); + wxFileDialog dialog(this, wxT("Open a PNG file"), wxEmptyString, wxEmptyString, wxT("PNG files (*.png)|*.png"), 0); #else - wxFileDialog dialog(this, _T("Open a BMP file"), wxEmptyString, wxEmptyString, _T("BMP files (*.bmp)|*.bmp"), 0); + wxFileDialog dialog(this, wxT("Open a BMP file"), wxEmptyString, wxEmptyString, wxT("BMP files (*.bmp)|*.bmp"), 0); #endif if (dialog.ShowModal() != wxID_OK) { - wxLogMessage( _T("Aborted file open") ); + wxLogMessage( wxT("Aborted file open") ); return; } if (dialog.GetPath().empty()) { - wxLogMessage( _T("Returned empty string.") ); + wxLogMessage( wxT("Returned empty string.") ); return; } if (!wxFileExists(dialog.GetPath())) { - wxLogMessage( _T("File doesn't exist.") ); + wxLogMessage( wxT("File doesn't exist.") ); return; } @@ -1329,33 +1329,33 @@ void DnDFrame::OnCopyBitmap(wxCommandEvent& WXUNUSED(event)) ); if (!image.Ok()) { - wxLogError( _T("Invalid image file...") ); + wxLogError( wxT("Invalid image file...") ); return; } - wxLogStatus( _T("Decoding image file...") ); + wxLogStatus( wxT("Decoding image file...") ); wxYield(); wxBitmap bitmap( image ); if ( !wxTheClipboard->Open() ) { - wxLogError(_T("Can't open clipboard.")); + wxLogError(wxT("Can't open clipboard.")); return; } - wxLogMessage( _T("Creating wxBitmapDataObject...") ); + wxLogMessage( wxT("Creating wxBitmapDataObject...") ); wxYield(); if ( !wxTheClipboard->AddData(new wxBitmapDataObject(bitmap)) ) { - wxLogError(_T("Can't copy image to the clipboard.")); + wxLogError(wxT("Can't copy image to the clipboard.")); } else { - wxLogMessage(_T("Image has been put on the clipboard.") ); - wxLogMessage(_T("You can paste it now and look at it.") ); + wxLogMessage(wxT("Image has been put on the clipboard.") ); + wxLogMessage(wxT("You can paste it now and look at it.") ); } wxTheClipboard->Close(); @@ -1365,14 +1365,14 @@ void DnDFrame::OnPasteBitmap(wxCommandEvent& WXUNUSED(event)) { if ( !wxTheClipboard->Open() ) { - wxLogError(_T("Can't open clipboard.")); + wxLogError(wxT("Can't open clipboard.")); return; } if ( !wxTheClipboard->IsSupported(wxDF_BITMAP) ) { - wxLogWarning(_T("No bitmap on clipboard")); + wxLogWarning(wxT("No bitmap on clipboard")); wxTheClipboard->Close(); return; @@ -1381,13 +1381,13 @@ void DnDFrame::OnPasteBitmap(wxCommandEvent& WXUNUSED(event)) wxBitmapDataObject data; if ( !wxTheClipboard->GetData(data) ) { - wxLogError(_T("Can't paste bitmap from the clipboard")); + wxLogError(wxT("Can't paste bitmap from the clipboard")); } else { const wxBitmap& bmp = data.GetBitmap(); - wxLogMessage(_T("Bitmap %dx%d pasted from the clipboard"), + wxLogMessage(wxT("Bitmap %dx%d pasted from the clipboard"), bmp.GetWidth(), bmp.GetHeight()); ShowBitmap(bmp); } @@ -1401,27 +1401,27 @@ void DnDFrame::OnPasteMetafile(wxCommandEvent& WXUNUSED(event)) { if ( !wxTheClipboard->Open() ) { - wxLogError(_T("Can't open clipboard.")); + wxLogError(wxT("Can't open clipboard.")); return; } if ( !wxTheClipboard->IsSupported(wxDF_METAFILE) ) { - wxLogWarning(_T("No metafile on clipboard")); + wxLogWarning(wxT("No metafile on clipboard")); } else { wxMetaFileDataObject data; if ( !wxTheClipboard->GetData(data) ) { - wxLogError(_T("Can't paste metafile from the clipboard")); + wxLogError(wxT("Can't paste metafile from the clipboard")); } else { const wxMetaFile& mf = data.GetMetafile(); - wxLogMessage(_T("Metafile %dx%d pasted from the clipboard"), + wxLogMessage(wxT("Metafile %dx%d pasted from the clipboard"), mf.GetWidth(), mf.GetHeight()); ShowMetaFile(mf); @@ -1440,8 +1440,8 @@ void DnDFrame::OnPasteMetafile(wxCommandEvent& WXUNUSED(event)) void DnDFrame::OnCopyFiles(wxCommandEvent& WXUNUSED(event)) { #ifdef __WXMSW__ - wxFileDialog dialog(this, _T("Select a file to copy"), wxEmptyString, wxEmptyString, - _T("All files (*.*)|*.*"), 0); + wxFileDialog dialog(this, wxT("Select a file to copy"), wxEmptyString, wxEmptyString, + wxT("All files (*.*)|*.*"), 0); wxArrayString filenames; while ( dialog.ShowModal() == wxID_OK ) @@ -1493,18 +1493,18 @@ void DnDFrame::OnCopy(wxCommandEvent& WXUNUSED(event)) { if ( !wxTheClipboard->Open() ) { - wxLogError(_T("Can't open clipboard.")); + wxLogError(wxT("Can't open clipboard.")); return; } if ( !wxTheClipboard->AddData(new wxTextDataObject(m_strText)) ) { - wxLogError(_T("Can't copy data to the clipboard")); + wxLogError(wxT("Can't copy data to the clipboard")); } else { - wxLogMessage(_T("Text '%s' put on the clipboard"), m_strText.c_str()); + wxLogMessage(wxT("Text '%s' put on the clipboard"), m_strText.c_str()); } wxTheClipboard->Close(); @@ -1514,14 +1514,14 @@ void DnDFrame::OnPaste(wxCommandEvent& WXUNUSED(event)) { if ( !wxTheClipboard->Open() ) { - wxLogError(_T("Can't open clipboard.")); + wxLogError(wxT("Can't open clipboard.")); return; } if ( !wxTheClipboard->IsSupported(wxDF_TEXT) ) { - wxLogWarning(_T("No text data on clipboard")); + wxLogWarning(wxT("No text data on clipboard")); wxTheClipboard->Close(); return; @@ -1530,11 +1530,11 @@ void DnDFrame::OnPaste(wxCommandEvent& WXUNUSED(event)) wxTextDataObject text; if ( !wxTheClipboard->GetData(text) ) { - wxLogError(_T("Can't paste data from the clipboard")); + wxLogError(wxT("Can't paste data from the clipboard")); } else { - wxLogMessage(_T("Text '%s' pasted from the clipboard"), + wxLogMessage(wxT("Text '%s' pasted from the clipboard"), text.GetText().c_str()); } @@ -1558,7 +1558,7 @@ bool DnDFile::OnDropFiles(wxCoord, wxCoord, const wxArrayString& filenames) { size_t nFiles = filenames.GetCount(); wxString str; - str.Printf( _T("%d files dropped"), (int)nFiles); + str.Printf( wxT("%d files dropped"), (int)nFiles); if (m_pOwner != NULL) { @@ -1689,8 +1689,8 @@ bool DnDShapeDialog::TransferDataFromWindow() if ( !m_pos.x || !m_pos.y || !m_size.x || !m_size.y ) { - wxMessageBox(_T("All sizes and positions should be non null!"), - _T("Invalid shape"), wxICON_HAND | wxOK, this); + wxMessageBox(wxT("All sizes and positions should be non null!"), + wxT("Invalid shape"), wxICON_HAND | wxOK, this); return false; } @@ -1722,30 +1722,30 @@ void DnDShapeDialog::OnColour(wxCommandEvent& WXUNUSED(event)) DnDShapeFrame *DnDShapeFrame::ms_lastDropTarget = NULL; DnDShapeFrame::DnDShapeFrame(wxFrame *parent) - : wxFrame(parent, wxID_ANY, _T("Shape Frame")) + : wxFrame(parent, wxID_ANY, wxT("Shape Frame")) { #if wxUSE_STATUSBAR CreateStatusBar(); #endif // wxUSE_STATUSBAR wxMenu *menuShape = new wxMenu; - menuShape->Append(Menu_Shape_New, _T("&New default shape\tCtrl-S")); - menuShape->Append(Menu_Shape_Edit, _T("&Edit shape\tCtrl-E")); + menuShape->Append(Menu_Shape_New, wxT("&New default shape\tCtrl-S")); + menuShape->Append(Menu_Shape_Edit, wxT("&Edit shape\tCtrl-E")); menuShape->AppendSeparator(); - menuShape->Append(Menu_Shape_Clear, _T("&Clear shape\tCtrl-L")); + menuShape->Append(Menu_Shape_Clear, wxT("&Clear shape\tCtrl-L")); wxMenu *menuClipboard = new wxMenu; - menuClipboard->Append(Menu_ShapeClipboard_Copy, _T("&Copy\tCtrl-C")); - menuClipboard->Append(Menu_ShapeClipboard_Paste, _T("&Paste\tCtrl-V")); + menuClipboard->Append(Menu_ShapeClipboard_Copy, wxT("&Copy\tCtrl-C")); + menuClipboard->Append(Menu_ShapeClipboard_Paste, wxT("&Paste\tCtrl-V")); wxMenuBar *menubar = new wxMenuBar; - menubar->Append(menuShape, _T("&Shape")); - menubar->Append(menuClipboard, _T("&Clipboard")); + menubar->Append(menuShape, wxT("&Shape")); + menubar->Append(menuClipboard, wxT("&Clipboard")); SetMenuBar(menubar); #if wxUSE_STATUSBAR - SetStatusText(_T("Press Ctrl-S to create a new shape")); + SetStatusText(wxT("Press Ctrl-S to create a new shape")); #endif // wxUSE_STATUSBAR SetDropTarget(new DnDShapeDropTarget(this)); @@ -1793,16 +1793,16 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) case wxDragNone: #if wxUSE_STATUSBAR - SetStatusText(_T("Nothing happened")); + SetStatusText(wxT("Nothing happened")); #endif // wxUSE_STATUSBAR break; case wxDragCopy: - pc = _T("copied"); + pc = wxT("copied"); break; case wxDragMove: - pc = _T("moved"); + pc = wxT("moved"); if ( ms_lastDropTarget != this ) { // don't delete the shape if we dropped it on ourselves! @@ -1812,7 +1812,7 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) case wxDragCancel: #if wxUSE_STATUSBAR - SetStatusText(_T("Drag and drop operation cancelled")); + SetStatusText(wxT("Drag and drop operation cancelled")); #endif // wxUSE_STATUSBAR break; } @@ -1820,7 +1820,7 @@ void DnDShapeFrame::OnDrag(wxMouseEvent& event) if ( pc ) { #if wxUSE_STATUSBAR - SetStatusText(wxString(_T("Shape successfully ")) + pc); + SetStatusText(wxString(wxT("Shape successfully ")) + pc); #endif // wxUSE_STATUSBAR } //else: status text already set @@ -1852,7 +1852,7 @@ void DnDShapeFrame::OnEditShape(wxCommandEvent& WXUNUSED(event)) #if wxUSE_STATUSBAR if ( m_shape ) { - SetStatusText(_T("You can now drag the shape to another frame")); + SetStatusText(wxT("You can now drag the shape to another frame")); } #endif // wxUSE_STATUSBAR } @@ -1863,7 +1863,7 @@ void DnDShapeFrame::OnNewShape(wxCommandEvent& WXUNUSED(event)) SetShape(new DnDEllipticShape(wxPoint(10, 10), wxSize(80, 60), *wxRED)); #if wxUSE_STATUSBAR - SetStatusText(_T("You can now drag the shape to another frame")); + SetStatusText(wxT("You can now drag the shape to another frame")); #endif // wxUSE_STATUSBAR } @@ -2016,7 +2016,7 @@ void DnDShapeDataObject::CreateBitmap() const static void ShowBitmap(const wxBitmap& bitmap) { - wxFrame *frame = new wxFrame(NULL, wxID_ANY, _T("Bitmap view")); + wxFrame *frame = new wxFrame(NULL, wxID_ANY, wxT("Bitmap view")); #if wxUSE_STATUSBAR frame->CreateStatusBar(); #endif // wxUSE_STATUSBAR @@ -2026,7 +2026,7 @@ static void ShowBitmap(const wxBitmap& bitmap) int w = bitmap.GetWidth(), h = bitmap.GetHeight(); #if wxUSE_STATUSBAR - frame->SetStatusText(wxString::Format(_T("%dx%d"), w, h)); + frame->SetStatusText(wxString::Format(wxT("%dx%d"), w, h)); #endif // wxUSE_STATUSBAR frame->SetClientSize(w > 100 ? 100 : w, h > 100 ? 100 : h); @@ -2037,13 +2037,13 @@ static void ShowBitmap(const wxBitmap& bitmap) static void ShowMetaFile(const wxMetaFile& metafile) { - wxFrame *frame = new wxFrame(NULL, wxID_ANY, _T("Metafile view")); + wxFrame *frame = new wxFrame(NULL, wxID_ANY, wxT("Metafile view")); frame->CreateStatusBar(); DnDCanvasMetafile *canvas = new DnDCanvasMetafile(frame); canvas->SetMetafile(metafile); wxSize size = metafile.GetSize(); - frame->SetStatusText(wxString::Format(_T("%dx%d"), size.x, size.y)); + frame->SetStatusText(wxString::Format(wxT("%dx%d"), size.x, size.y)); frame->SetClientSize(size.x > 100 ? 100 : size.x, size.y > 100 ? 100 : size.y); diff --git a/samples/dragimag/dragimag.cpp b/samples/dragimag/dragimag.cpp index 31b3f4c2e0..fc0755b6ff 100644 --- a/samples/dragimag/dragimag.cpp +++ b/samples/dragimag/dragimag.cpp @@ -180,7 +180,7 @@ void MyCanvas::OnMouseEvent(wxMouseEvent& event) } case SHAPE_DRAG_TEXT: { - m_dragImage = new MyDragImage(this, wxString(_T("Dragging some test text")), wxCursor(wxCURSOR_HAND)); + m_dragImage = new MyDragImage(this, wxString(wxT("Dragging some test text")), wxCursor(wxCURSOR_HAND)); break; } case SHAPE_DRAG_ICON: @@ -316,16 +316,16 @@ BEGIN_EVENT_TABLE(MyFrame,wxFrame) END_EVENT_TABLE() MyFrame::MyFrame() -: wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxDragImage sample"), +: wxFrame( (wxFrame *)NULL, wxID_ANY, wxT("wxDragImage sample"), wxPoint(20,20), wxSize(470,360) ) { wxMenu *file_menu = new wxMenu(); - file_menu->Append( wxID_ABOUT, _T("&About...")); - file_menu->AppendCheckItem( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen")); - file_menu->Append( wxID_EXIT, _T("E&xit")); + file_menu->Append( wxID_ABOUT, wxT("&About...")); + file_menu->AppendCheckItem( TEST_USE_SCREEN, wxT("&Use whole screen for dragging"), wxT("Use whole screen")); + file_menu->Append( wxID_EXIT, wxT("E&xit")); wxMenuBar *menu_bar = new wxMenuBar(); - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); SetIcon(wxICON(mondrian)); SetMenuBar( menu_bar ); @@ -346,9 +346,9 @@ void MyFrame::OnQuit( wxCommandEvent &WXUNUSED(event) ) void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) ) { - (void)wxMessageBox( _T("wxDragImage demo\n") - _T("Julian Smart (c) 2000"), - _T("About wxDragImage Demo"), + (void)wxMessageBox( wxT("wxDragImage demo\n") + wxT("Julian Smart (c) 2000"), + wxT("About wxDragImage Demo"), wxICON_INFORMATION | wxOK ); } @@ -376,14 +376,14 @@ bool MyApp::OnInit() #endif wxImage image; - if (image.LoadFile(_T("backgrnd.png"), wxBITMAP_TYPE_PNG)) + if (image.LoadFile(wxT("backgrnd.png"), wxBITMAP_TYPE_PNG)) { m_background = wxBitmap(image); } MyFrame *frame = new MyFrame(); - wxString rootName(_T("shape0")); + wxString rootName(wxT("shape0")); for (int i = 1; i < 4; i++) { diff --git a/samples/drawing/drawing.cpp b/samples/drawing/drawing.cpp index 54378c6043..8da014ba72 100644 --- a/samples/drawing/drawing.cpp +++ b/samples/drawing/drawing.cpp @@ -294,11 +294,11 @@ bool MyApp::LoadImages() // special hack for Unix in-tree sample build, don't do this in real // programs, use wxStandardPaths instead pathList.Add(wxFileName(argv[0]).GetPath()); - pathList.Add(_T(".")); - pathList.Add(_T("..")); - pathList.Add(_T("../..")); + pathList.Add(wxT(".")); + pathList.Add(wxT("..")); + pathList.Add(wxT("../..")); - wxString path = pathList.FindValidPath(_T("pat4.bmp")); + wxString path = pathList.FindValidPath(wxT("pat4.bmp")); if ( !path ) return false; @@ -309,21 +309,21 @@ bool MyApp::LoadImages() wxMask* mask4 = new wxMask(*gs_bmp4_mono, *wxBLACK); gs_bmp4_mono->SetMask(mask4); - path = pathList.FindValidPath(_T("pat36.bmp")); + path = pathList.FindValidPath(wxT("pat36.bmp")); if ( !path ) return false; gs_bmp36->LoadFile(path, wxBITMAP_TYPE_BMP); wxMask* mask36 = new wxMask(*gs_bmp36, *wxBLACK); gs_bmp36->SetMask(mask36); - path = pathList.FindValidPath(_T("image.bmp")); + path = pathList.FindValidPath(wxT("image.bmp")); if ( !path ) return false; gs_bmpNoMask->LoadFile(path, wxBITMAP_TYPE_BMP); gs_bmpWithMask->LoadFile(path, wxBITMAP_TYPE_BMP); gs_bmpWithColMask->LoadFile(path, wxBITMAP_TYPE_BMP); - path = pathList.FindValidPath(_T("mask.bmp")); + path = pathList.FindValidPath(wxT("mask.bmp")); if ( !path ) return false; gs_bmpMask->LoadFile(path, wxBITMAP_TYPE_BMP); @@ -344,7 +344,7 @@ bool MyApp::OnInit() return false; // Create the main application window - MyFrame *frame = new MyFrame(_T("Drawing sample"), + MyFrame *frame = new MyFrame(wxT("Drawing sample"), wxPoint(50, 50), wxSize(550, 340)); // Show it and tell the application that it's our main window @@ -423,22 +423,22 @@ void MyCanvas::DrawTestBrushes(wxDC& dc) dc.SetBrush(wxBrush(*wxGREEN, wxSOLID)); dc.DrawRectangle(x, y, WIDTH, HEIGHT); - dc.DrawText(_T("Solid green"), x + 10, y + 10); + dc.DrawText(wxT("Solid green"), x + 10, y + 10); y += HEIGHT; dc.SetBrush(wxBrush(*wxRED, wxCROSSDIAG_HATCH)); dc.DrawRectangle(x, y, WIDTH, HEIGHT); - dc.DrawText(_T("Hatched red"), x + 10, y + 10); + dc.DrawText(wxT("Hatched red"), x + 10, y + 10); y += HEIGHT; dc.SetBrush(wxBrush(*gs_bmpMask)); dc.DrawRectangle(x, y, WIDTH, HEIGHT); - dc.DrawText(_T("Stipple mono"), x + 10, y + 10); + dc.DrawText(wxT("Stipple mono"), x + 10, y + 10); y += HEIGHT; dc.SetBrush(wxBrush(*gs_bmpNoMask)); dc.DrawRectangle(x, y, WIDTH, HEIGHT); - dc.DrawText(_T("Stipple colour"), x + 10, y + 10); + dc.DrawText(wxT("Stipple colour"), x + 10, y + 10); } void MyCanvas::DrawTestPoly(wxDC& dc) @@ -453,11 +453,11 @@ void MyCanvas::DrawTestPoly(wxDC& dc) star[3] = wxPoint(40, 100); star[4] = wxPoint(140, 150); - dc.DrawText(_T("You should see two (irregular) stars below, the left one ") - _T("hatched"), 10, 10); - dc.DrawText(_T("except for the central region and the right ") - _T("one entirely hatched"), 10, 30); - dc.DrawText(_T("The third star only has a hatched outline"), 10, 50); + dc.DrawText(wxT("You should see two (irregular) stars below, the left one ") + wxT("hatched"), 10, 10); + dc.DrawText(wxT("except for the central region and the right ") + wxT("one entirely hatched"), 10, 30); + dc.DrawText(wxT("The third star only has a hatched outline"), 10, 50); dc.DrawPolygon(WXSIZEOF(star), star, 0, 30); dc.DrawPolygon(WXSIZEOF(star), star, 160, 30, wxWINDING_RULE); @@ -485,7 +485,7 @@ void MyCanvas::DrawTestLines( int x, int y, int width, wxDC &dc ) dc.DrawText(wxString::Format(wxT("Testing lines of width %d"), width), x + 10, y - 10); dc.DrawRectangle( x+10, y+10, 100, 190 ); - dc.DrawText(_T("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10); + dc.DrawText(wxT("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10); dc.SetPen( wxPen( wxT("black"), width, wxSOLID) ); dc.DrawLine( x+20, y+20, 100, y+20 ); dc.SetPen( wxPen( wxT("black"), width, wxDOT) ); @@ -497,7 +497,7 @@ void MyCanvas::DrawTestLines( int x, int y, int width, wxDC &dc ) dc.SetPen( wxPen( wxT("black"), width, wxDOT_DASH) ); dc.DrawLine( x+20, y+60, 100, y+60 ); - dc.DrawText(_T("Misc hatches"), x + 150, y + 70); + dc.DrawText(wxT("Misc hatches"), x + 150, y + 70); dc.SetPen( wxPen( wxT("black"), width, wxBDIAGONAL_HATCH) ); dc.DrawLine( x+20, y+70, 100, y+70 ); dc.SetPen( wxPen( wxT("black"), width, wxCROSSDIAG_HATCH) ); @@ -511,7 +511,7 @@ void MyCanvas::DrawTestLines( int x, int y, int width, wxDC &dc ) dc.SetPen( wxPen( wxT("black"), width, wxVERTICAL_HATCH) ); dc.DrawLine( x+20, y+120, 100, y+120 ); - dc.DrawText(_T("User dash"), x + 150, y + 140); + dc.DrawText(wxT("User dash"), x + 150, y + 140); wxPen ud( wxT("black"), width, wxUSER_DASH ); wxDash dash1[6]; dash1[0] = 8; // Long dash <---------+ @@ -748,8 +748,8 @@ void MyCanvas::DrawText(wxDC& dc) { // set underlined font for testing dc.SetFont( wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, true) ); - dc.DrawText( _T("This is text"), 110, 10 ); - dc.DrawRotatedText( _T("That is text"), 20, 10, -45 ); + dc.DrawText( wxT("This is text"), 110, 10 ); + dc.DrawRotatedText( wxT("That is text"), 20, 10, -45 ); // use wxSWISS_FONT and not wxNORMAL_FONT as the latter can't be rotated // under Win9x (it is not TrueType) @@ -766,12 +766,12 @@ void MyCanvas::DrawText(wxDC& dc) dc.SetFont( wxFont( 18, wxSWISS, wxNORMAL, wxNORMAL ) ); - dc.DrawText( _T("This is Swiss 18pt text."), 110, 40 ); + dc.DrawText( wxT("This is Swiss 18pt text."), 110, 40 ); wxCoord length; wxCoord height; wxCoord descent; - dc.GetTextExtent( _T("This is Swiss 18pt text."), &length, &height, &descent ); + dc.GetTextExtent( wxT("This is Swiss 18pt text."), &length, &height, &descent ); text.Printf( wxT("Dimensions are length %ld, height %ld, descent %ld"), length, height, descent ); dc.DrawText( text, 110, 80 ); @@ -784,19 +784,19 @@ void MyCanvas::DrawText(wxDC& dc) wxCoord y = 150; dc.SetLogicalFunction(wxINVERT); // text drawing should ignore logical function - dc.DrawText( _T("There should be a text below"), 110, 150 ); + dc.DrawText( wxT("There should be a text below"), 110, 150 ); dc.DrawRectangle( 110, y, 100, height ); y += height; - dc.DrawText( _T("Visible text"), 110, y ); + dc.DrawText( wxT("Visible text"), 110, y ); dc.DrawRectangle( 110, y, 100, height ); - dc.DrawText( _T("Visible text"), 110, y ); + dc.DrawText( wxT("Visible text"), 110, y ); dc.DrawRectangle( 110, y, 100, height ); dc.SetLogicalFunction(wxCOPY); y += height; dc.DrawRectangle( 110, y, 100, height ); - dc.DrawText( _T("Another visible text"), 110, y ); + dc.DrawText( wxT("Another visible text"), 110, y ); } static const struct @@ -824,13 +824,13 @@ static const struct void MyCanvas::DrawImages(wxDC& dc, DrawMode mode) { - dc.DrawText(_T("original image"), 0, 0); + dc.DrawText(wxT("original image"), 0, 0); dc.DrawBitmap(*gs_bmpNoMask, 0, 20, 0); - dc.DrawText(_T("with colour mask"), 0, 100); + dc.DrawText(wxT("with colour mask"), 0, 100); dc.DrawBitmap(*gs_bmpWithColMask, 0, 120, true); - dc.DrawText(_T("the mask image"), 0, 200); + dc.DrawText(wxT("the mask image"), 0, 200); dc.DrawBitmap(*gs_bmpMask, 0, 220, 0); - dc.DrawText(_T("masked image"), 0, 300); + dc.DrawText(wxT("masked image"), 0, 300); dc.DrawBitmap(*gs_bmpWithMask, 0, 320, true); int cx = gs_bmpWithColMask->GetWidth(), @@ -1064,19 +1064,19 @@ void MyCanvas::DrawCircles(wxDC& dc) dc.SetPen( *wxRED_PEN ); dc.SetBrush( *wxGREEN_BRUSH ); - dc.DrawText(_T("Some circles"), 0, y); + dc.DrawText(wxT("Some circles"), 0, y); dc.DrawCircle(x, y, r); dc.DrawCircle(x + 2*r, y, r); dc.DrawCircle(x + 4*r, y, r); y += 2*r; - dc.DrawText(_T("And ellipses"), 0, y); + dc.DrawText(wxT("And ellipses"), 0, y); dc.DrawEllipse(x - r, y, 2*r, r); dc.DrawEllipse(x + r, y, 2*r, r); dc.DrawEllipse(x + 3*r, y, 2*r, r); y += 2*r; - dc.DrawText(_T("And arcs"), 0, y); + dc.DrawText(wxT("And arcs"), 0, y); dc.DrawArc(x - r, y, x + r, y, x, y); dc.DrawArc(x + 4*r, y, x + 2*r, y, x + 3*r, y); dc.DrawArc(x + 5*r, y, x + 5*r, y, x + 6*r, y); @@ -1093,19 +1093,19 @@ void MyCanvas::DrawCircles(wxDC& dc) dc.SetBrush( *wxTRANSPARENT_BRUSH ); y += 2*r; - dc.DrawText(_T("Some circles"), 0, y); + dc.DrawText(wxT("Some circles"), 0, y); dc.DrawCircle(x, y, r); dc.DrawCircle(x + 2*r, y, r); dc.DrawCircle(x + 4*r, y, r); y += 2*r; - dc.DrawText(_T("And ellipses"), 0, y); + dc.DrawText(wxT("And ellipses"), 0, y); dc.DrawEllipse(x - r, y, 2*r, r); dc.DrawEllipse(x + r, y, 2*r, r); dc.DrawEllipse(x + 3*r, y, 2*r, r); y += 2*r; - dc.DrawText(_T("And arcs"), 0, y); + dc.DrawText(wxT("And arcs"), 0, y); dc.DrawArc(x - r, y, x + r, y, x, y); dc.DrawArc(x + 4*r, y, x + 2*r, y, x + 3*r, y); dc.DrawArc(x + 5*r, y, x + 5*r, y, x + 6*r, y); @@ -1121,7 +1121,7 @@ void MyCanvas::DrawCircles(wxDC& dc) void MyCanvas::DrawSplines(wxDC& dc) { #if wxUSE_SPLINES - dc.DrawText(_T("Some splines"), 10, 5); + dc.DrawText(wxT("Some splines"), 10, 5); // values are hardcoded rather than randomly generated // so the output can be compared between native @@ -1202,7 +1202,7 @@ void MyCanvas::DrawSplines(wxDC& dc) } #else - dc.DrawText(_T("Splines not supported."), 10, 5); + dc.DrawText(wxT("Splines not supported."), 10, 5); #endif } @@ -1212,44 +1212,44 @@ void MyCanvas::DrawGradients(wxDC& dc) // LHS: linear wxRect r(10, 10, 50, 50); - dc.DrawText(_T("wxRIGHT"), r.x, r.y); + dc.DrawText(wxT("wxRIGHT"), r.x, r.y); r.Offset(0, TEXT_HEIGHT); dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxRIGHT); r.Offset(0, r.height + 10); - dc.DrawText(_T("wxLEFT"), r.x, r.y); + dc.DrawText(wxT("wxLEFT"), r.x, r.y); r.Offset(0, TEXT_HEIGHT); dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxLEFT); r.Offset(0, r.height + 10); - dc.DrawText(_T("wxDOWN"), r.x, r.y); + dc.DrawText(wxT("wxDOWN"), r.x, r.y); r.Offset(0, TEXT_HEIGHT); dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxDOWN); r.Offset(0, r.height + 10); - dc.DrawText(_T("wxUP"), r.x, r.y); + dc.DrawText(wxT("wxUP"), r.x, r.y); r.Offset(0, TEXT_HEIGHT); dc.GradientFillLinear(r, *wxWHITE, *wxBLUE, wxUP); // RHS: concentric r = wxRect(200, 10, 50, 50); - dc.DrawText(_T("Blue inside"), r.x, r.y); + dc.DrawText(wxT("Blue inside"), r.x, r.y); r.Offset(0, TEXT_HEIGHT); dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE); r.Offset(0, r.height + 10); - dc.DrawText(_T("White inside"), r.x, r.y); + dc.DrawText(wxT("White inside"), r.x, r.y); r.Offset(0, TEXT_HEIGHT); dc.GradientFillConcentric(r, *wxWHITE, *wxBLUE); r.Offset(0, r.height + 10); - dc.DrawText(_T("Blue in top left corner"), r.x, r.y); + dc.DrawText(wxT("Blue in top left corner"), r.x, r.y); r.Offset(0, TEXT_HEIGHT); dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE, wxPoint(0, 0)); r.Offset(0, r.height + 10); - dc.DrawText(_T("Blue in bottom right corner"), r.x, r.y); + dc.DrawText(wxT("Blue in bottom right corner"), r.x, r.y); r.Offset(0, TEXT_HEIGHT); dc.GradientFillConcentric(r, *wxBLUE, *wxWHITE, wxPoint(r.width, r.height)); @@ -1287,12 +1287,12 @@ void MyCanvas::DrawGradients(wxDC& dc) void MyCanvas::DrawRegions(wxDC& dc) { - dc.DrawText(_T("You should see a red rect partly covered by a cyan one ") - _T("on the left"), 10, 5); - dc.DrawText(_T("and 5 smileys from which 4 are partially clipped on the right"), + dc.DrawText(wxT("You should see a red rect partly covered by a cyan one ") + wxT("on the left"), 10, 5); + dc.DrawText(wxT("and 5 smileys from which 4 are partially clipped on the right"), 10, 5 + dc.GetCharHeight()); - dc.DrawText(_T("The second copy should be identical but right part of it ") - _T("should be offset by 10 pixels."), + dc.DrawText(wxT("The second copy should be identical but right part of it ") + wxT("should be offset by 10 pixels."), 10, 5 + 2*dc.GetCharHeight()); DrawRegionsHelper(dc, 10, true); @@ -1568,86 +1568,86 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) SetIcon(wxICON(mondrian)); wxMenu *menuFile = new wxMenu; - menuFile->Append(File_ShowDefault, _T("&Default screen\tF1")); - menuFile->Append(File_ShowText, _T("&Text screen\tF2")); - menuFile->Append(File_ShowLines, _T("&Lines screen\tF3")); - menuFile->Append(File_ShowBrushes, _T("&Brushes screen\tF4")); - menuFile->Append(File_ShowPolygons, _T("&Polygons screen\tF5")); - menuFile->Append(File_ShowMask, _T("&Mask screen\tF6")); - menuFile->Append(File_ShowMaskStretch, _T("1/&2 scaled mask\tShift-F6")); - menuFile->Append(File_ShowOps, _T("&Raster operations screen\tF7")); - menuFile->Append(File_ShowRegions, _T("Re&gions screen\tF8")); - menuFile->Append(File_ShowCircles, _T("&Circles screen\tF9")); + menuFile->Append(File_ShowDefault, wxT("&Default screen\tF1")); + menuFile->Append(File_ShowText, wxT("&Text screen\tF2")); + menuFile->Append(File_ShowLines, wxT("&Lines screen\tF3")); + menuFile->Append(File_ShowBrushes, wxT("&Brushes screen\tF4")); + menuFile->Append(File_ShowPolygons, wxT("&Polygons screen\tF5")); + menuFile->Append(File_ShowMask, wxT("&Mask screen\tF6")); + menuFile->Append(File_ShowMaskStretch, wxT("1/&2 scaled mask\tShift-F6")); + menuFile->Append(File_ShowOps, wxT("&Raster operations screen\tF7")); + menuFile->Append(File_ShowRegions, wxT("Re&gions screen\tF8")); + menuFile->Append(File_ShowCircles, wxT("&Circles screen\tF9")); #if wxUSE_GRAPHICS_CONTEXT - menuFile->Append(File_ShowAlpha, _T("&Alpha screen\tF10")); + menuFile->Append(File_ShowAlpha, wxT("&Alpha screen\tF10")); #endif - menuFile->Append(File_ShowSplines, _T("&Splines screen\tF11")); - menuFile->Append(File_ShowGradients, _T("&Gradients screen\tF12")); + menuFile->Append(File_ShowSplines, wxT("&Splines screen\tF11")); + menuFile->Append(File_ShowGradients, wxT("&Gradients screen\tF12")); #if wxUSE_GRAPHICS_CONTEXT - menuFile->Append(File_ShowGraphics, _T("&Graphics screen")); + menuFile->Append(File_ShowGraphics, wxT("&Graphics screen")); #endif menuFile->AppendSeparator(); - menuFile->AppendCheckItem(File_Clip, _T("&Clip\tCtrl-C"), _T("Clip/unclip drawing")); + menuFile->AppendCheckItem(File_Clip, wxT("&Clip\tCtrl-C"), wxT("Clip/unclip drawing")); #if wxUSE_GRAPHICS_CONTEXT - menuFile->AppendCheckItem(File_GraphicContext, _T("&Use GraphicContext\tCtrl-Y"), _T("Use GraphicContext")); + menuFile->AppendCheckItem(File_GraphicContext, wxT("&Use GraphicContext\tCtrl-Y"), wxT("Use GraphicContext")); #endif menuFile->AppendSeparator(); - menuFile->Append(File_About, _T("&About...\tCtrl-A"), _T("Show about dialog")); + menuFile->Append(File_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog")); menuFile->AppendSeparator(); - menuFile->Append(File_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(File_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenu *menuMapMode = new wxMenu; - menuMapMode->Append( MapMode_Text, _T("&TEXT map mode") ); - menuMapMode->Append( MapMode_Lometric, _T("&LOMETRIC map mode") ); - menuMapMode->Append( MapMode_Twips, _T("T&WIPS map mode") ); - menuMapMode->Append( MapMode_Points, _T("&POINTS map mode") ); - menuMapMode->Append( MapMode_Metric, _T("&METRIC map mode") ); + menuMapMode->Append( MapMode_Text, wxT("&TEXT map mode") ); + menuMapMode->Append( MapMode_Lometric, wxT("&LOMETRIC map mode") ); + menuMapMode->Append( MapMode_Twips, wxT("T&WIPS map mode") ); + menuMapMode->Append( MapMode_Points, wxT("&POINTS map mode") ); + menuMapMode->Append( MapMode_Metric, wxT("&METRIC map mode") ); wxMenu *menuUserScale = new wxMenu; - menuUserScale->Append( UserScale_StretchHoriz, _T("Stretch &horizontally\tCtrl-H") ); - menuUserScale->Append( UserScale_ShrinkHoriz, _T("Shrin&k horizontally\tCtrl-G") ); - menuUserScale->Append( UserScale_StretchVertic, _T("Stretch &vertically\tCtrl-V") ); - menuUserScale->Append( UserScale_ShrinkVertic, _T("&Shrink vertically\tCtrl-W") ); + menuUserScale->Append( UserScale_StretchHoriz, wxT("Stretch &horizontally\tCtrl-H") ); + menuUserScale->Append( UserScale_ShrinkHoriz, wxT("Shrin&k horizontally\tCtrl-G") ); + menuUserScale->Append( UserScale_StretchVertic, wxT("Stretch &vertically\tCtrl-V") ); + menuUserScale->Append( UserScale_ShrinkVertic, wxT("&Shrink vertically\tCtrl-W") ); menuUserScale->AppendSeparator(); - menuUserScale->Append( UserScale_Restore, _T("&Restore to normal\tCtrl-0") ); + menuUserScale->Append( UserScale_Restore, wxT("&Restore to normal\tCtrl-0") ); wxMenu *menuAxis = new wxMenu; - menuAxis->AppendCheckItem( AxisMirror_Horiz, _T("Mirror horizontally\tCtrl-M") ); - menuAxis->AppendCheckItem( AxisMirror_Vertic, _T("Mirror vertically\tCtrl-N") ); + menuAxis->AppendCheckItem( AxisMirror_Horiz, wxT("Mirror horizontally\tCtrl-M") ); + menuAxis->AppendCheckItem( AxisMirror_Vertic, wxT("Mirror vertically\tCtrl-N") ); wxMenu *menuLogical = new wxMenu; - menuLogical->Append( LogicalOrigin_MoveDown, _T("Move &down\tCtrl-D") ); - menuLogical->Append( LogicalOrigin_MoveUp, _T("Move &up\tCtrl-U") ); - menuLogical->Append( LogicalOrigin_MoveLeft, _T("Move &right\tCtrl-L") ); - menuLogical->Append( LogicalOrigin_MoveRight, _T("Move &left\tCtrl-R") ); + menuLogical->Append( LogicalOrigin_MoveDown, wxT("Move &down\tCtrl-D") ); + menuLogical->Append( LogicalOrigin_MoveUp, wxT("Move &up\tCtrl-U") ); + menuLogical->Append( LogicalOrigin_MoveLeft, wxT("Move &right\tCtrl-L") ); + menuLogical->Append( LogicalOrigin_MoveRight, wxT("Move &left\tCtrl-R") ); menuLogical->AppendSeparator(); - menuLogical->Append( LogicalOrigin_Set, _T("Set to (&100, 100)\tShift-Ctrl-1") ); - menuLogical->Append( LogicalOrigin_Restore, _T("&Restore to normal\tShift-Ctrl-0") ); + menuLogical->Append( LogicalOrigin_Set, wxT("Set to (&100, 100)\tShift-Ctrl-1") ); + menuLogical->Append( LogicalOrigin_Restore, wxT("&Restore to normal\tShift-Ctrl-0") ); wxMenu *menuColour = new wxMenu; #if wxUSE_COLOURDLG - menuColour->Append( Colour_TextForeground, _T("Text &foreground...") ); - menuColour->Append( Colour_TextBackground, _T("Text &background...") ); - menuColour->Append( Colour_Background, _T("Background &colour...") ); + menuColour->Append( Colour_TextForeground, wxT("Text &foreground...") ); + menuColour->Append( Colour_TextBackground, wxT("Text &background...") ); + menuColour->Append( Colour_Background, wxT("Background &colour...") ); #endif // wxUSE_COLOURDLG - menuColour->AppendCheckItem( Colour_BackgroundMode, _T("&Opaque/transparent\tCtrl-B") ); - menuColour->AppendCheckItem( Colour_TextureBackgound, _T("Draw textured back&ground\tCtrl-T") ); + menuColour->AppendCheckItem( Colour_BackgroundMode, wxT("&Opaque/transparent\tCtrl-B") ); + menuColour->AppendCheckItem( Colour_TextureBackgound, wxT("Draw textured back&ground\tCtrl-T") ); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(menuMapMode, _T("&Mode")); - menuBar->Append(menuUserScale, _T("&Scale")); - menuBar->Append(menuAxis, _T("&Axis")); - menuBar->Append(menuLogical, _T("&Origin")); - menuBar->Append(menuColour, _T("&Colours")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(menuMapMode, wxT("&Mode")); + menuBar->Append(menuUserScale, wxT("&Scale")); + menuBar->Append(menuAxis, wxT("&Axis")); + menuBar->Append(menuLogical, wxT("&Origin")); + menuBar->Append(menuColour, wxT("&Colours")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); #if wxUSE_STATUSBAR CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR m_mapMode = wxMM_TEXT; @@ -1683,7 +1683,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) wxT("Copyright (c) Robert Roebling 1999") ); - wxMessageBox(msg, _T("About Drawing"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, wxT("About Drawing"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnClip(wxCommandEvent& event) diff --git a/samples/event/event.cpp b/samples/event/event.cpp index 3cc8c01e55..d2b7679af1 100644 --- a/samples/event/event.cpp +++ b/samples/event/event.cpp @@ -134,7 +134,7 @@ public: void OnTest(wxCommandEvent& event) { - wxLogMessage(_T("This is the pushed test event handler #%u"), m_level); + wxLogMessage(wxT("This is the pushed test event handler #%u"), m_level); // if we don't skip the event, the other event handlers won't get it: // try commenting out this line and see what changes @@ -222,7 +222,7 @@ bool MyApp::OnInit() return false; // create the main application window - MyFrame *frame = new MyFrame(_T("Event wxWidgets Sample"), + MyFrame *frame = new MyFrame(wxT("Event wxWidgets Sample"), wxPoint(50, 50), wxSize(600, 340)); // and show it (the frames, unlike simple controls, are not shown when @@ -252,43 +252,43 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->Append(Event_About, _T("&About...\tCtrl-A"), _T("Show about dialog")); + menuFile->Append(Event_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog")); menuFile->AppendSeparator(); - menuFile->Append(Event_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Event_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenu *menuEvent = new wxMenu; #ifdef wxHAS_EVENT_BIND menuEvent->AppendCheckItem(Event_Bind, "&Bind\tCtrl-B", "Bind or unbind a dynamic event handler"); #endif // wxHAS_EVENT_BIND - menuEvent->AppendCheckItem(Event_Connect, _T("&Connect\tCtrl-C"), - _T("Connect or disconnect the dynamic event handler")); - menuEvent->Append(Event_Dynamic, _T("&Dynamic event\tCtrl-D"), - _T("Dynamic event sample - only works after Connect")); + menuEvent->AppendCheckItem(Event_Connect, wxT("&Connect\tCtrl-C"), + wxT("Connect or disconnect the dynamic event handler")); + menuEvent->Append(Event_Dynamic, wxT("&Dynamic event\tCtrl-D"), + wxT("Dynamic event sample - only works after Connect")); menuEvent->AppendSeparator(); - menuEvent->Append(Event_Push, _T("&Push event handler\tCtrl-P"), - _T("Push event handler for test event")); - menuEvent->Append(Event_Pop, _T("P&op event handler\tCtrl-O"), - _T("Pop event handler for test event")); - menuEvent->Append(Event_Test, _T("Test event\tCtrl-T"), - _T("Test event processed by pushed event handler")); + menuEvent->Append(Event_Push, wxT("&Push event handler\tCtrl-P"), + wxT("Push event handler for test event")); + menuEvent->Append(Event_Pop, wxT("P&op event handler\tCtrl-O"), + wxT("Pop event handler for test event")); + menuEvent->Append(Event_Test, wxT("Test event\tCtrl-T"), + wxT("Test event processed by pushed event handler")); menuEvent->AppendSeparator(); - menuEvent->Append(Event_Custom, _T("Fire c&ustom event\tCtrl-U"), - _T("Generate a custom event")); + menuEvent->Append(Event_Custom, wxT("Fire c&ustom event\tCtrl-U"), + wxT("Generate a custom event")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(menuEvent, _T("&Event")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(menuEvent, wxT("&Event")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); #if wxUSE_STATUSBAR CreateStatusBar(3); - SetStatusText(_T("Welcome to wxWidgets event sample")); - SetStatusText(_T("Dynamic: off"), Status_Dynamic); - SetStatusText(_T("Push count: 0"), Status_Push); + SetStatusText(wxT("Welcome to wxWidgets event sample")); + SetStatusText(wxT("Dynamic: off"), Status_Dynamic); + SetStatusText(wxT("Push count: 0"), Status_Push); #endif // wxUSE_STATUSBAR wxPanel * const panel = new wxPanel(this); @@ -412,25 +412,25 @@ void MyFrame::OnPushEventHandler(wxCommandEvent& WXUNUSED(event)) PushEventHandler(new MyEvtHandler(++m_nPush)); #if wxUSE_STATUSBAR - SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push); + SetStatusText(wxString::Format(wxT("Push count: %u"), m_nPush), Status_Push); #endif // wxUSE_STATUSBAR } void MyFrame::OnPopEventHandler(wxCommandEvent& WXUNUSED(event)) { - wxCHECK_RET( m_nPush, _T("this command should be disabled!") ); + wxCHECK_RET( m_nPush, wxT("this command should be disabled!") ); PopEventHandler(true /* delete handler */); m_nPush--; #if wxUSE_STATUSBAR - SetStatusText(wxString::Format(_T("Push count: %u"), m_nPush), Status_Push); + SetStatusText(wxString::Format(wxT("Push count: %u"), m_nPush), Status_Push); #endif // wxUSE_STATUSBAR } void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("This is the test event handler in the main frame")); + wxLogMessage(wxT("This is the test event handler in the main frame")); } void MyFrame::OnUpdateUIPop(wxUpdateUIEvent& event) @@ -451,6 +451,6 @@ void MyFrame::OnFireCustom(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnProcessCustom(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Got a custom event!")); + wxLogMessage(wxT("Got a custom event!")); } diff --git a/samples/except/except.cpp b/samples/except/except.cpp index 95502800c7..ed04aec596 100644 --- a/samples/except/except.cpp +++ b/samples/except/except.cpp @@ -264,11 +264,11 @@ bool MyApp::OnExceptionInMainLoop() } catch ( int i ) { - wxLogWarning(_T("Caught an int %d in MyApp."), i); + wxLogWarning(wxT("Caught an int %d in MyApp."), i); } catch ( MyException& e ) { - wxLogWarning(_T("Caught MyException(%s) in MyApp."), e.what()); + wxLogWarning(wxT("Caught MyException(%s) in MyApp."), e.what()); } catch ( ... ) { @@ -291,15 +291,15 @@ void MyApp::OnUnhandledException() } catch ( ... ) { - wxMessageBox(_T("Unhandled exception caught, program will terminate."), - _T("wxExcept Sample"), wxOK | wxICON_ERROR); + wxMessageBox(wxT("Unhandled exception caught, program will terminate."), + wxT("wxExcept Sample"), wxOK | wxICON_ERROR); } } void MyApp::OnFatalException() { - wxMessageBox(_T("Program has crashed and will terminate."), - _T("wxExcept Sample"), wxOK | wxICON_ERROR); + wxMessageBox(wxT("Program has crashed and will terminate."), + wxT("wxExcept Sample"), wxOK | wxICON_ERROR); } #ifdef __WXDEBUG__ @@ -321,7 +321,7 @@ void MyApp::OnAssert(const wxChar *file, // frame constructor MyFrame::MyFrame() - : wxFrame(NULL, wxID_ANY, _T("Except wxWidgets App"), + : wxFrame(NULL, wxID_ANY, wxT("Except wxWidgets App"), wxPoint(50, 50), wxSize(450, 340)) { // set the frame icon @@ -330,32 +330,32 @@ MyFrame::MyFrame() #if wxUSE_MENUS // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->Append(Except_Dialog, _T("Show &dialog\tCtrl-D")); + menuFile->Append(Except_Dialog, wxT("Show &dialog\tCtrl-D")); menuFile->AppendSeparator(); - menuFile->Append(Except_ThrowInt, _T("Throw an &int\tCtrl-I")); - menuFile->Append(Except_ThrowString, _T("Throw a &string\tCtrl-S")); - menuFile->Append(Except_ThrowObject, _T("Throw an &object\tCtrl-O")); + menuFile->Append(Except_ThrowInt, wxT("Throw an &int\tCtrl-I")); + menuFile->Append(Except_ThrowString, wxT("Throw a &string\tCtrl-S")); + menuFile->Append(Except_ThrowObject, wxT("Throw an &object\tCtrl-O")); menuFile->Append(Except_ThrowUnhandled, - _T("Throw &unhandled exception\tCtrl-U")); - menuFile->Append(Except_Crash, _T("&Crash\tCtrl-C")); + wxT("Throw &unhandled exception\tCtrl-U")); + menuFile->Append(Except_Crash, wxT("&Crash\tCtrl-C")); menuFile->AppendSeparator(); #if wxUSE_ON_FATAL_EXCEPTION - menuFile->AppendCheckItem(Except_HandleCrash, _T("&Handle crashes\tCtrl-H")); + menuFile->AppendCheckItem(Except_HandleCrash, wxT("&Handle crashes\tCtrl-H")); menuFile->AppendSeparator(); #endif // wxUSE_ON_FATAL_EXCEPTION #ifdef __WXDEBUG__ - menuFile->Append(Except_ShowAssert, _T("Provoke &assert failure\tCtrl-A")); + menuFile->Append(Except_ShowAssert, wxT("Provoke &assert failure\tCtrl-A")); menuFile->AppendSeparator(); #endif // __WXDEBUG__ - menuFile->Append(Except_Quit, _T("E&xit\tCtrl-Q"), _T("Quit this program")); + menuFile->Append(Except_Quit, wxT("E&xit\tCtrl-Q"), wxT("Quit this program")); wxMenu *helpMenu = new wxMenu; - helpMenu->Append(Except_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(Except_About, wxT("&About...\tF1"), wxT("Show about dialog")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -364,7 +364,7 @@ MyFrame::MyFrame() #if wxUSE_STATUSBAR && !defined(__WXWINCE__) // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR } @@ -376,7 +376,7 @@ bool MyFrame::ProcessEvent(wxEvent& event) } catch ( const wxChar *msg ) { - wxLogMessage(_T("Caught a string \"%s\" in MyFrame"), msg); + wxLogMessage(wxT("Caught a string \"%s\" in MyFrame"), msg); return true; } @@ -398,7 +398,7 @@ void MyFrame::OnDialog(wxCommandEvent& WXUNUSED(event)) } catch ( ... ) { - wxLogWarning(_T("An exception in MyDialog")); + wxLogWarning(wxT("An exception in MyDialog")); Destroy(); throw; @@ -412,12 +412,12 @@ void MyFrame::OnThrowInt(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnThrowString(wxCommandEvent& WXUNUSED(event)) { - throw _T("string thrown from MyFrame"); + throw wxT("string thrown from MyFrame"); } void MyFrame::OnThrowObject(wxCommandEvent& WXUNUSED(event)) { - throw MyException(_T("Exception thrown from MyFrame")); + throw MyException(wxT("Exception thrown from MyFrame")); } void MyFrame::OnThrowUnhandled(wxCommandEvent& WXUNUSED(event)) @@ -453,10 +453,10 @@ void MyFrame::OnShowAssert(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the About dialog of the except sample.\n") - _T("Welcome to %s"), wxVERSION_STRING); + msg.Printf( wxT("This is the About dialog of the except sample.\n") + wxT("Welcome to %s"), wxVERSION_STRING); - wxMessageBox(msg, _T("About Except"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, wxT("About Except"), wxOK | wxICON_INFORMATION, this); } // ============================================================================ @@ -464,17 +464,17 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) // ============================================================================ MyDialog::MyDialog(wxFrame *parent) - : wxDialog(parent, wxID_ANY, wxString(_T("Throw exception dialog"))) + : wxDialog(parent, wxID_ANY, wxString(wxT("Throw exception dialog"))) { wxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); - sizerTop->Add(new wxButton(this, Except_ThrowInt, _T("Throw &int")), + sizerTop->Add(new wxButton(this, Except_ThrowInt, wxT("Throw &int")), 0, wxCENTRE | wxALL, 5); - sizerTop->Add(new wxButton(this, Except_ThrowObject, _T("Throw &object")), + sizerTop->Add(new wxButton(this, Except_ThrowObject, wxT("Throw &object")), 0, wxCENTRE | wxALL, 5); - sizerTop->Add(new wxButton(this, Except_Crash, _T("&Crash")), + sizerTop->Add(new wxButton(this, Except_Crash, wxT("&Crash")), 0, wxCENTRE | wxALL, 5); - sizerTop->Add(new wxButton(this, wxID_CANCEL, _T("&Cancel")), + sizerTop->Add(new wxButton(this, wxID_CANCEL, wxT("&Cancel")), 0, wxCENTRE | wxALL, 5); SetSizerAndFit(sizerTop); @@ -487,7 +487,7 @@ void MyDialog::OnThrowInt(wxCommandEvent& WXUNUSED(event)) void MyDialog::OnThrowObject(wxCommandEvent& WXUNUSED(event)) { - throw MyException(_T("Exception thrown from MyDialog")); + throw MyException(wxT("Exception thrown from MyDialog")); } void MyDialog::OnCrash(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/exec/exec.cpp b/samples/exec/exec.cpp index a979d505ab..ab63144a8e 100644 --- a/samples/exec/exec.cpp +++ b/samples/exec/exec.cpp @@ -209,7 +209,7 @@ protected: void DoSend() { wxString s(m_textOut->GetValue()); - s += _T('\n'); + s += wxT('\n'); m_out.Write(s.c_str(), s.length()); m_textOut->Clear(); @@ -331,7 +331,7 @@ enum Exec_Btn_Close }; -static const wxChar *DIALOG_TITLE = _T("Exec sample"); +static const wxChar *DIALOG_TITLE = wxT("Exec sample"); // ---------------------------------------------------------------------------- // event tables and other macros for wxWidgets @@ -408,7 +408,7 @@ bool MyApp::OnInit() return false; // Create the main application window - MyFrame *frame = new MyFrame(_T("Exec wxWidgets sample"), + MyFrame *frame = new MyFrame(wxT("Exec wxWidgets sample"), wxDefaultPosition, wxSize(500, 140)); // Show it and tell the application that it's our main window @@ -445,55 +445,55 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a menu bar wxMenu *menuFile = new wxMenu(wxEmptyString, wxMENU_TEAROFF); - menuFile->Append(Exec_Kill, _T("&Kill process...\tCtrl-K"), - _T("Kill a process by PID")); + menuFile->Append(Exec_Kill, wxT("&Kill process...\tCtrl-K"), + wxT("Kill a process by PID")); menuFile->AppendSeparator(); - menuFile->Append(Exec_ClearLog, _T("&Clear log\tCtrl-L"), - _T("Clear the log window")); + menuFile->Append(Exec_ClearLog, wxT("&Clear log\tCtrl-L"), + wxT("Clear the log window")); menuFile->AppendSeparator(); - menuFile->Append(Exec_BeginBusyCursor, _T("Show &busy cursor\tCtrl-C")); - menuFile->Append(Exec_EndBusyCursor, _T("Show &normal cursor\tShift-Ctrl-C")); + menuFile->Append(Exec_BeginBusyCursor, wxT("Show &busy cursor\tCtrl-C")); + menuFile->Append(Exec_EndBusyCursor, wxT("Show &normal cursor\tShift-Ctrl-C")); menuFile->AppendSeparator(); - menuFile->Append(Exec_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Exec_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenu *execMenu = new wxMenu; - execMenu->Append(Exec_SyncExec, _T("Sync &execution...\tCtrl-E"), - _T("Launch a program and return when it terminates")); - execMenu->Append(Exec_SyncNoEventsExec, _T("Sync execution and &block...\tCtrl-B"), - _T("Launch a program and block until it terminates")); - execMenu->Append(Exec_AsyncExec, _T("&Async execution...\tCtrl-A"), - _T("Launch a program and return immediately")); - execMenu->Append(Exec_Shell, _T("Execute &shell command...\tCtrl-S"), - _T("Launch a shell and execute a command in it")); + execMenu->Append(Exec_SyncExec, wxT("Sync &execution...\tCtrl-E"), + wxT("Launch a program and return when it terminates")); + execMenu->Append(Exec_SyncNoEventsExec, wxT("Sync execution and &block...\tCtrl-B"), + wxT("Launch a program and block until it terminates")); + execMenu->Append(Exec_AsyncExec, wxT("&Async execution...\tCtrl-A"), + wxT("Launch a program and return immediately")); + execMenu->Append(Exec_Shell, wxT("Execute &shell command...\tCtrl-S"), + wxT("Launch a shell and execute a command in it")); execMenu->AppendSeparator(); - execMenu->Append(Exec_Redirect, _T("Capture command &output...\tCtrl-O"), - _T("Launch a program and capture its output")); - execMenu->Append(Exec_Pipe, _T("&Pipe through command..."), - _T("Pipe a string through a filter")); - execMenu->Append(Exec_POpen, _T("&Open a pipe to a command...\tCtrl-P"), - _T("Open a pipe to and from another program")); + execMenu->Append(Exec_Redirect, wxT("Capture command &output...\tCtrl-O"), + wxT("Launch a program and capture its output")); + execMenu->Append(Exec_Pipe, wxT("&Pipe through command..."), + wxT("Pipe a string through a filter")); + execMenu->Append(Exec_POpen, wxT("&Open a pipe to a command...\tCtrl-P"), + wxT("Open a pipe to and from another program")); execMenu->AppendSeparator(); - execMenu->Append(Exec_OpenFile, _T("Open &file...\tCtrl-F"), - _T("Launch the command to open this kind of files")); - execMenu->Append(Exec_LaunchFile, _T("La&unch file...\tShift-Ctrl-F"), - _T("Launch the default application associated with the file")); - execMenu->Append(Exec_OpenURL, _T("Open &URL...\tCtrl-U"), - _T("Launch the default browser with the given URL")); + execMenu->Append(Exec_OpenFile, wxT("Open &file...\tCtrl-F"), + wxT("Launch the command to open this kind of files")); + execMenu->Append(Exec_LaunchFile, wxT("La&unch file...\tShift-Ctrl-F"), + wxT("Launch the default application associated with the file")); + execMenu->Append(Exec_OpenURL, wxT("Open &URL...\tCtrl-U"), + wxT("Launch the default browser with the given URL")); #ifdef __WINDOWS__ execMenu->AppendSeparator(); - execMenu->Append(Exec_DDEExec, _T("Execute command via &DDE...\tCtrl-D")); - execMenu->Append(Exec_DDERequest, _T("Send DDE &request...\tCtrl-R")); + execMenu->Append(Exec_DDEExec, wxT("Execute command via &DDE...\tCtrl-D")); + execMenu->Append(Exec_DDERequest, wxT("Send DDE &request...\tCtrl-R")); #endif wxMenu *helpMenu = new wxMenu(wxEmptyString, wxMENU_TEAROFF); - helpMenu->Append(Exec_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(Exec_About, wxT("&About...\tF1"), wxT("Show about dialog")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(execMenu, _T("&Exec")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(execMenu, wxT("&Exec")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -508,7 +508,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets exec sample!")); + SetStatusText(wxT("Welcome to wxWidgets exec sample!")); #endif // wxUSE_STATUSBAR m_timerBg.Start(1000); @@ -552,15 +552,15 @@ void MyFrame::OnEndBusyCursor(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Exec wxWidgets Sample\n(c) 2000-2002 Vadim Zeitlin"), - _T("About Exec"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(wxT("Exec wxWidgets Sample\n(c) 2000-2002 Vadim Zeitlin"), + wxT("About Exec"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event)) { - long pid = wxGetNumberFromUser(_T("Please specify the process to kill"), - _T("Enter PID:"), - _T("Exec question"), + long pid = wxGetNumberFromUser(wxT("Please specify the process to kill"), + wxT("Enter PID:"), + wxT("Exec question"), m_pidLast, // we need the full unsigned int range -INT_MAX, INT_MAX, @@ -573,32 +573,32 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event)) static const wxString signalNames[] = { - _T("Just test (SIGNONE)"), - _T("Hangup (SIGHUP)"), - _T("Interrupt (SIGINT)"), - _T("Quit (SIGQUIT)"), - _T("Illegal instruction (SIGILL)"), - _T("Trap (SIGTRAP)"), - _T("Abort (SIGABRT)"), - _T("Emulated trap (SIGEMT)"), - _T("FP exception (SIGFPE)"), - _T("Kill (SIGKILL)"), - _T("Bus (SIGBUS)"), - _T("Segment violation (SIGSEGV)"), - _T("System (SIGSYS)"), - _T("Broken pipe (SIGPIPE)"), - _T("Alarm (SIGALRM)"), - _T("Terminate (SIGTERM)"), + wxT("Just test (SIGNONE)"), + wxT("Hangup (SIGHUP)"), + wxT("Interrupt (SIGINT)"), + wxT("Quit (SIGQUIT)"), + wxT("Illegal instruction (SIGILL)"), + wxT("Trap (SIGTRAP)"), + wxT("Abort (SIGABRT)"), + wxT("Emulated trap (SIGEMT)"), + wxT("FP exception (SIGFPE)"), + wxT("Kill (SIGKILL)"), + wxT("Bus (SIGBUS)"), + wxT("Segment violation (SIGSEGV)"), + wxT("System (SIGSYS)"), + wxT("Broken pipe (SIGPIPE)"), + wxT("Alarm (SIGALRM)"), + wxT("Terminate (SIGTERM)"), }; - int sig = wxGetSingleChoiceIndex(_T("How to kill the process?"), - _T("Exec question"), + int sig = wxGetSingleChoiceIndex(wxT("How to kill the process?"), + wxT("Exec question"), WXSIZEOF(signalNames), signalNames, this); switch ( sig ) { default: - wxFAIL_MSG( _T("unexpected return value") ); + wxFAIL_MSG( wxT("unexpected return value") ); // fall through case -1: @@ -628,11 +628,11 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event)) { if ( wxProcess::Exists(pid) ) { - wxLogStatus(_T("Process %ld is running."), pid); + wxLogStatus(wxT("Process %ld is running."), pid); } else { - wxLogStatus(_T("No process with pid = %ld."), pid); + wxLogStatus(wxT("No process with pid = %ld."), pid); } } else // not SIGNONE @@ -640,20 +640,20 @@ void MyFrame::OnKill(wxCommandEvent& WXUNUSED(event)) wxKillError rc = wxProcess::Kill(pid, (wxSignal)sig); if ( rc == wxKILL_OK ) { - wxLogStatus(_T("Process %ld killed with signal %d."), pid, sig); + wxLogStatus(wxT("Process %ld killed with signal %d."), pid, sig); } else { static const wxChar *errorText[] = { - _T(""), // no error - _T("signal not supported"), - _T("permission denied"), - _T("no such process"), - _T("unspecified error"), + wxT(""), // no error + wxT("signal not supported"), + wxT("permission denied"), + wxT("no such process"), + wxT("unspecified error"), }; - wxLogStatus(_T("Failed to kill process %ld with signal %d: %s"), + wxLogStatus(wxT("Failed to kill process %ld with signal %d: %s"), pid, sig, errorText[rc]); } } @@ -669,13 +669,13 @@ void MyFrame::DoAsyncExec(const wxString& cmd) m_pidLast = wxExecute(cmd, wxEXEC_ASYNC, process); if ( !m_pidLast ) { - wxLogError(_T("Execution of '%s' failed."), cmd.c_str()); + wxLogError(wxT("Execution of '%s' failed."), cmd.c_str()); delete process; } else { - wxLogStatus(_T("Process %ld (%s) launched."), m_pidLast, cmd.c_str()); + wxLogStatus(wxT("Process %ld (%s) launched."), m_pidLast, cmd.c_str()); m_cmdLast = cmd; @@ -687,18 +687,18 @@ void MyFrame::DoAsyncExec(const wxString& cmd) void MyFrame::OnSyncExec(wxCommandEvent& WXUNUSED(event)) { - wxString cmd = wxGetTextFromUser(_T("Enter the command: "), + wxString cmd = wxGetTextFromUser(wxT("Enter the command: "), DIALOG_TITLE, m_cmdLast); if ( !cmd ) return; - wxLogStatus( _T("'%s' is running please wait..."), cmd.c_str() ); + wxLogStatus( wxT("'%s' is running please wait..."), cmd.c_str() ); int code = wxExecute(cmd, wxEXEC_SYNC); - wxLogStatus(_T("Process '%s' terminated with exit code %d."), + wxLogStatus(wxT("Process '%s' terminated with exit code %d."), cmd.c_str(), code); m_cmdLast = cmd; @@ -706,18 +706,18 @@ void MyFrame::OnSyncExec(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnSyncNoEventsExec(wxCommandEvent& WXUNUSED(event)) { - wxString cmd = wxGetTextFromUser(_T("Enter the command: "), + wxString cmd = wxGetTextFromUser(wxT("Enter the command: "), DIALOG_TITLE, m_cmdLast); if ( !cmd ) return; - wxLogStatus( _T("'%s' is running please wait..."), cmd.c_str() ); + wxLogStatus( wxT("'%s' is running please wait..."), cmd.c_str() ); int code = wxExecute(cmd, wxEXEC_BLOCK); - wxLogStatus(_T("Process '%s' terminated with exit code %d."), + wxLogStatus(wxT("Process '%s' terminated with exit code %d."), cmd.c_str(), code); m_cmdLast = cmd; @@ -725,7 +725,7 @@ void MyFrame::OnSyncNoEventsExec(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAsyncExec(wxCommandEvent& WXUNUSED(event)) { - wxString cmd = wxGetTextFromUser(_T("Enter the command: "), + wxString cmd = wxGetTextFromUser(wxT("Enter the command: "), DIALOG_TITLE, m_cmdLast); @@ -737,7 +737,7 @@ void MyFrame::OnAsyncExec(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnShell(wxCommandEvent& WXUNUSED(event)) { - wxString cmd = wxGetTextFromUser(_T("Enter the command: "), + wxString cmd = wxGetTextFromUser(wxT("Enter the command: "), DIALOG_TITLE, m_cmdLast); @@ -745,7 +745,7 @@ void MyFrame::OnShell(wxCommandEvent& WXUNUSED(event)) return; int code = wxShell(cmd); - wxLogStatus(_T("Shell command '%s' terminated with exit code %d."), + wxLogStatus(wxT("Shell command '%s' terminated with exit code %d."), cmd.c_str(), code); m_cmdLast = cmd; } @@ -761,7 +761,7 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) #endif } - wxString cmd = wxGetTextFromUser(_T("Enter the command: "), + wxString cmd = wxGetTextFromUser(wxT("Enter the command: "), DIALOG_TITLE, m_cmdLast); @@ -769,8 +769,8 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) return; bool sync; - switch ( wxMessageBox(_T("Execute it synchronously?"), - _T("Exec question"), + switch ( wxMessageBox(wxT("Execute it synchronously?"), + wxT("Exec question"), wxYES_NO | wxCANCEL | wxICON_QUESTION, this) ) { case wxYES: @@ -799,8 +799,8 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) if ( code != -1 ) { - ShowOutput(cmd, output, _T("Output")); - ShowOutput(cmd, errors, _T("Errors")); + ShowOutput(cmd, output, wxT("Output")); + ShowOutput(cmd, errors, wxT("Errors")); } } else // async exec @@ -808,7 +808,7 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) MyPipedProcess *process = new MyPipedProcess(this, cmd); if ( !wxExecute(cmd, wxEXEC_ASYNC, process) ) { - wxLogError(_T("Execution of '%s' failed."), cmd.c_str()); + wxLogError(wxT("Execution of '%s' failed."), cmd.c_str()); delete process; } @@ -824,16 +824,16 @@ void MyFrame::OnExecWithRedirect(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event)) { if ( !m_cmdLast ) - m_cmdLast = _T("tr [a-z] [A-Z]"); + m_cmdLast = wxT("tr [a-z] [A-Z]"); - wxString cmd = wxGetTextFromUser(_T("Enter the command: "), + wxString cmd = wxGetTextFromUser(wxT("Enter the command: "), DIALOG_TITLE, m_cmdLast); if ( !cmd ) return; - wxString input = wxGetTextFromUser(_T("Enter the string to send to it: "), + wxString input = wxGetTextFromUser(wxT("Enter the string to send to it: "), DIALOG_TITLE); if ( !input ) return; @@ -843,13 +843,13 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event)) long pid = wxExecute(cmd, wxEXEC_ASYNC, process); if ( pid ) { - wxLogStatus(_T("Process %ld (%s) launched."), pid, cmd.c_str()); + wxLogStatus(wxT("Process %ld (%s) launched."), pid, cmd.c_str()); AddPipedProcess(process); } else { - wxLogError(_T("Execution of '%s' failed."), cmd.c_str()); + wxLogError(wxT("Execution of '%s' failed."), cmd.c_str()); delete process; } @@ -859,7 +859,7 @@ void MyFrame::OnExecWithPipe(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPOpen(wxCommandEvent& WXUNUSED(event)) { - wxString cmd = wxGetTextFromUser(_T("Enter the command to launch: "), + wxString cmd = wxGetTextFromUser(wxT("Enter the command to launch: "), DIALOG_TITLE, m_cmdLast); if ( cmd.empty() ) @@ -868,23 +868,23 @@ void MyFrame::OnPOpen(wxCommandEvent& WXUNUSED(event)) wxProcess *process = wxProcess::Open(cmd); if ( !process ) { - wxLogError(_T("Failed to launch the command.")); + wxLogError(wxT("Failed to launch the command.")); return; } - wxLogVerbose(_T("PID of the new process: %ld"), process->GetPid()); + wxLogVerbose(wxT("PID of the new process: %ld"), process->GetPid()); wxOutputStream *out = process->GetOutputStream(); if ( !out ) { - wxLogError(_T("Failed to connect to child stdin")); + wxLogError(wxT("Failed to connect to child stdin")); return; } wxInputStream *in = process->GetInputStream(); if ( !in ) { - wxLogError(_T("Failed to connect to child stdout")); + wxLogError(wxT("Failed to connect to child stdout")); return; } @@ -898,9 +898,9 @@ static bool AskUserForFileName() wxString filename; #if wxUSE_FILEDLG - filename = wxLoadFileSelector(_T("any"), wxEmptyString, gs_lastFile); + filename = wxLoadFileSelector(wxT("any"), wxEmptyString, gs_lastFile); #else // !wxUSE_FILEDLG - filename = wxGetTextFromUser(_T("Enter the file name"), _T("exec sample"), + filename = wxGetTextFromUser(wxT("Enter the file name"), wxT("exec sample"), gs_lastFile); #endif // wxUSE_FILEDLG/!wxUSE_FILEDLG @@ -917,11 +917,11 @@ void MyFrame::OnFileExec(wxCommandEvent& WXUNUSED(event)) if ( !AskUserForFileName() ) return; - wxString ext = gs_lastFile.AfterLast(_T('.')); + wxString ext = gs_lastFile.AfterLast(wxT('.')); wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(ext); if ( !ft ) { - wxLogError(_T("Impossible to determine the file type for extension '%s'"), + wxLogError(wxT("Impossible to determine the file type for extension '%s'"), ext.c_str()); return; } @@ -932,7 +932,7 @@ void MyFrame::OnFileExec(wxCommandEvent& WXUNUSED(event)) delete ft; if ( !ok ) { - wxLogError(_T("Impossible to find out how to open files of extension '%s'"), + wxLogError(wxT("Impossible to find out how to open files of extension '%s'"), ext.c_str()); return; } @@ -953,12 +953,12 @@ void MyFrame::OnFileLaunch(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event)) { - static wxString s_url(_T("http://www.wxwidgets.org/")); + static wxString s_url(wxT("http://www.wxwidgets.org/")); wxString filename = wxGetTextFromUser ( - _T("Enter the URL"), - _T("exec sample"), + wxT("Enter the URL"), + wxT("exec sample"), s_url, this ); @@ -970,7 +970,7 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event)) if ( !wxLaunchDefaultBrowser(s_url) ) { - wxLogError(_T("Failed to open URL \"%s\""), s_url.c_str()); + wxLogError(wxT("Failed to open URL \"%s\""), s_url.c_str()); } } @@ -982,20 +982,20 @@ void MyFrame::OnOpenURL(wxCommandEvent& WXUNUSED(event)) bool MyFrame::GetDDEServer() { - wxString server = wxGetTextFromUser(_T("Server to connect to:"), + wxString server = wxGetTextFromUser(wxT("Server to connect to:"), DIALOG_TITLE, m_server); if ( !server ) return false; m_server = server; - wxString topic = wxGetTextFromUser(_T("DDE topic:"), DIALOG_TITLE, m_topic); + wxString topic = wxGetTextFromUser(wxT("DDE topic:"), DIALOG_TITLE, m_topic); if ( !topic ) return false; m_topic = topic; - wxString cmd = wxGetTextFromUser(_T("DDE command:"), DIALOG_TITLE, m_cmdDde); + wxString cmd = wxGetTextFromUser(wxT("DDE command:"), DIALOG_TITLE, m_cmdDde); if ( !cmd ) return false; @@ -1013,19 +1013,19 @@ void MyFrame::OnDDEExec(wxCommandEvent& WXUNUSED(event)) wxConnectionBase *conn = client.MakeConnection(wxEmptyString, m_server, m_topic); if ( !conn ) { - wxLogError(_T("Failed to connect to the DDE server '%s'."), + wxLogError(wxT("Failed to connect to the DDE server '%s'."), m_server.c_str()); } else { if ( !conn->Execute(m_cmdDde) ) { - wxLogError(_T("Failed to execute command '%s' via DDE."), + wxLogError(wxT("Failed to execute command '%s' via DDE."), m_cmdDde.c_str()); } else { - wxLogStatus(_T("Successfully executed DDE command")); + wxLogStatus(wxT("Successfully executed DDE command")); } } } @@ -1039,19 +1039,19 @@ void MyFrame::OnDDERequest(wxCommandEvent& WXUNUSED(event)) wxConnectionBase *conn = client.MakeConnection(wxEmptyString, m_server, m_topic); if ( !conn ) { - wxLogError(_T("Failed to connect to the DDE server '%s'."), + wxLogError(wxT("Failed to connect to the DDE server '%s'."), m_server.c_str()); } else { if ( !conn->Request(m_cmdDde) ) { - wxLogError(_T("Failed to send request '%s' via DDE."), + wxLogError(wxT("Failed to send request '%s' via DDE."), m_cmdDde.c_str()); } else { - wxLogStatus(_T("Successfully sent DDE request.")); + wxLogStatus(wxT("Successfully sent DDE request.")); } } } @@ -1132,7 +1132,7 @@ void MyFrame::ShowOutput(const wxString& cmd, if ( !count ) return; - m_lbox->Append(wxString::Format(_T("--- %s of '%s' ---"), + m_lbox->Append(wxString::Format(wxT("--- %s of '%s' ---"), title.c_str(), cmd.c_str())); for ( size_t n = 0; n < count; n++ ) @@ -1140,7 +1140,7 @@ void MyFrame::ShowOutput(const wxString& cmd, m_lbox->Append(output[n]); } - m_lbox->Append(wxString::Format(_T("--- End of %s ---"), + m_lbox->Append(wxString::Format(wxT("--- End of %s ---"), title.Lower().c_str())); } @@ -1150,7 +1150,7 @@ void MyFrame::ShowOutput(const wxString& cmd, void MyProcess::OnTerminate(int pid, int status) { - wxLogStatus(m_parent, _T("Process %u ('%s') terminated with exit code %d."), + wxLogStatus(m_parent, wxT("Process %u ('%s') terminated with exit code %d."), pid, m_cmd.c_str(), status); m_parent->OnAsyncTermination(this); @@ -1170,7 +1170,7 @@ bool MyPipedProcess::HasInput() // this assumes that the output is always line buffered wxString msg; - msg << m_cmd << _T(" (stdout): ") << tis.ReadLine(); + msg << m_cmd << wxT(" (stdout): ") << tis.ReadLine(); m_parent->GetLogListBox()->Append(msg); @@ -1183,7 +1183,7 @@ bool MyPipedProcess::HasInput() // this assumes that the output is always line buffered wxString msg; - msg << m_cmd << _T(" (stderr): ") << tis.ReadLine(); + msg << m_cmd << wxT(" (stderr): ") << tis.ReadLine(); m_parent->GetLogListBox()->Append(msg); @@ -1260,13 +1260,13 @@ MyPipeFrame::MyPipeFrame(wxFrame *parent, wxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL); sizerBtns-> - Add(new wxButton(panel, Exec_Btn_Send, _T("&Send")), 0, wxALL, 5); + Add(new wxButton(panel, Exec_Btn_Send, wxT("&Send")), 0, wxALL, 5); sizerBtns-> - Add(new wxButton(panel, Exec_Btn_SendFile, _T("&File...")), 0, wxALL, 5); + Add(new wxButton(panel, Exec_Btn_SendFile, wxT("&File...")), 0, wxALL, 5); sizerBtns-> - Add(new wxButton(panel, Exec_Btn_Get, _T("&Get")), 0, wxALL, 5); + Add(new wxButton(panel, Exec_Btn_Get, wxT("&Get")), 0, wxALL, 5); sizerBtns-> - Add(new wxButton(panel, Exec_Btn_Close, _T("&Close")), 0, wxALL, 5); + Add(new wxButton(panel, Exec_Btn_Close, wxT("&Close")), 0, wxALL, 5); sizerTop->Add(sizerBtns, 0, wxCENTRE | wxALL, 5); sizerTop->Add(m_textIn, 1, wxGROW | wxALL, 5); @@ -1281,11 +1281,11 @@ MyPipeFrame::MyPipeFrame(wxFrame *parent, void MyPipeFrame::OnBtnSendFile(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_FILEDLG - wxFileDialog filedlg(this, _T("Select file to send")); + wxFileDialog filedlg(this, wxT("Select file to send")); if ( filedlg.ShowModal() != wxID_OK ) return; - wxFFile file(filedlg.GetFilename(), _T("r")); + wxFFile file(filedlg.GetFilename(), wxT("r")); wxString data; if ( !file.IsOpened() || !file.ReadAll(&data) ) return; @@ -1324,7 +1324,7 @@ void MyPipeFrame::DoGetFromStream(wxTextCtrl *text, wxInputStream& in) while ( in.CanRead() ) { wxChar buffer[4096]; - buffer[in.Read(buffer, WXSIZEOF(buffer) - 1).LastRead()] = _T('\0'); + buffer[in.Read(buffer, WXSIZEOF(buffer) - 1).LastRead()] = wxT('\0'); text->AppendText(buffer); } @@ -1373,7 +1373,7 @@ void MyPipeFrame::OnProcessTerm(wxProcessEvent& WXUNUSED(event)) delete m_process; m_process = NULL; - wxLogWarning(_T("The other process has terminated, closing")); + wxLogWarning(wxT("The other process has terminated, closing")); DisableInput(); DisableOutput(); diff --git a/samples/font/font.cpp b/samples/font/font.cpp index 41c14bed32..1dbcd33367 100644 --- a/samples/font/font.cpp +++ b/samples/font/font.cpp @@ -41,7 +41,7 @@ #endif // used as title for several dialog boxes -static const wxChar SAMPLE_TITLE[] = _T("wxWidgets Font Sample"); +static const wxChar SAMPLE_TITLE[] = wxT("wxWidgets Font Sample"); // ---------------------------------------------------------------------------- // private classes @@ -1041,7 +1041,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) fontInfo.Printf(wxT("Style: %s, weight: %s, fixed width: %s"), m_font.GetStyleString().c_str(), m_font.GetWeightString().c_str(), - m_font.IsFixedWidth() ? _T("yes") : _T("no")); + m_font.IsFixedWidth() ? wxT("yes") : wxT("no")); dc.DrawText(fontInfo, x, y); y += hLine; @@ -1091,7 +1091,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) } // draw the lines between them - dc.SetPen(wxPen(wxColour(_T("blue")), 1, wxSOLID)); + dc.SetPen(wxPen(wxColour(wxT("blue")), 1, wxSOLID)); int l; // horizontal diff --git a/samples/grid/griddemo.cpp b/samples/grid/griddemo.cpp index 37d438987e..636d367496 100644 --- a/samples/grid/griddemo.cpp +++ b/samples/grid/griddemo.cpp @@ -148,18 +148,18 @@ END_EVENT_TABLE() GridFrame::GridFrame() - : wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxWidgets grid class demo"), + : wxFrame( (wxFrame *)NULL, wxID_ANY, wxT("wxWidgets grid class demo"), wxDefaultPosition, wxDefaultSize ) { SetIcon(wxICON(sample)); wxMenu *fileMenu = new wxMenu; - fileMenu->Append( ID_VTABLE, _T("&Virtual table test\tCtrl-V")); - fileMenu->Append( ID_BUGS_TABLE, _T("&Bugs table test\tCtrl-B")); - fileMenu->Append( ID_TABULAR_TABLE, _T("&Tabular table test\tCtrl-T")); + fileMenu->Append( ID_VTABLE, wxT("&Virtual table test\tCtrl-V")); + fileMenu->Append( ID_BUGS_TABLE, wxT("&Bugs table test\tCtrl-B")); + fileMenu->Append( ID_TABULAR_TABLE, wxT("&Tabular table test\tCtrl-T")); fileMenu->AppendSeparator(); - fileMenu->Append( wxID_EXIT, _T("E&xit\tAlt-X") ); + fileMenu->Append( wxID_EXIT, wxT("E&xit\tAlt-X") ); wxMenu *viewMenu = new wxMenu; viewMenu->AppendCheckItem(ID_TOGGLEROWLABELS, "&Row labels"); @@ -180,83 +180,83 @@ GridFrame::GridFrame() wxMenu *rowLabelMenu = new wxMenu; - viewMenu->Append( ID_ROWLABELALIGN, _T("R&ow label alignment"), + viewMenu->Append( ID_ROWLABELALIGN, wxT("R&ow label alignment"), rowLabelMenu, - _T("Change alignment of row labels") ); + wxT("Change alignment of row labels") ); - rowLabelMenu->Append( ID_ROWLABELHORIZALIGN, _T("&Horizontal") ); - rowLabelMenu->Append( ID_ROWLABELVERTALIGN, _T("&Vertical") ); + rowLabelMenu->Append( ID_ROWLABELHORIZALIGN, wxT("&Horizontal") ); + rowLabelMenu->Append( ID_ROWLABELVERTALIGN, wxT("&Vertical") ); wxMenu *colLabelMenu = new wxMenu; - viewMenu->Append( ID_COLLABELALIGN, _T("Col l&abel alignment"), + viewMenu->Append( ID_COLLABELALIGN, wxT("Col l&abel alignment"), colLabelMenu, - _T("Change alignment of col labels") ); + wxT("Change alignment of col labels") ); - colLabelMenu->Append( ID_COLLABELHORIZALIGN, _T("&Horizontal") ); - colLabelMenu->Append( ID_COLLABELVERTALIGN, _T("&Vertical") ); + colLabelMenu->Append( ID_COLLABELHORIZALIGN, wxT("&Horizontal") ); + colLabelMenu->Append( ID_COLLABELVERTALIGN, wxT("&Vertical") ); wxMenu *colMenu = new wxMenu; - colMenu->Append( ID_SETLABELCOLOUR, _T("Set &label colour...") ); - colMenu->Append( ID_SETLABELTEXTCOLOUR, _T("Set label &text colour...") ); - colMenu->Append( ID_SETLABEL_FONT, _T("Set label fo&nt...") ); - colMenu->Append( ID_GRIDLINECOLOUR, _T("&Grid line colour...") ); - colMenu->Append( ID_SET_CELL_FG_COLOUR, _T("Set cell &foreground colour...") ); - colMenu->Append( ID_SET_CELL_BG_COLOUR, _T("Set cell &background colour...") ); + colMenu->Append( ID_SETLABELCOLOUR, wxT("Set &label colour...") ); + colMenu->Append( ID_SETLABELTEXTCOLOUR, wxT("Set label &text colour...") ); + colMenu->Append( ID_SETLABEL_FONT, wxT("Set label fo&nt...") ); + colMenu->Append( ID_GRIDLINECOLOUR, wxT("&Grid line colour...") ); + colMenu->Append( ID_SET_CELL_FG_COLOUR, wxT("Set cell &foreground colour...") ); + colMenu->Append( ID_SET_CELL_BG_COLOUR, wxT("Set cell &background colour...") ); wxMenu *editMenu = new wxMenu; - editMenu->Append( ID_INSERTROW, _T("Insert &row") ); - editMenu->Append( ID_INSERTCOL, _T("Insert &column") ); - editMenu->Append( ID_DELETEROW, _T("Delete selected ro&ws") ); - editMenu->Append( ID_DELETECOL, _T("Delete selected co&ls") ); - editMenu->Append( ID_CLEARGRID, _T("Cl&ear grid cell contents") ); + editMenu->Append( ID_INSERTROW, wxT("Insert &row") ); + editMenu->Append( ID_INSERTCOL, wxT("Insert &column") ); + editMenu->Append( ID_DELETEROW, wxT("Delete selected ro&ws") ); + editMenu->Append( ID_DELETECOL, wxT("Delete selected co&ls") ); + editMenu->Append( ID_CLEARGRID, wxT("Cl&ear grid cell contents") ); wxMenu *selectMenu = new wxMenu; - selectMenu->Append( ID_SELECT_UNSELECT, _T("Add new cells to the selection"), - _T("When off, old selection is deselected before ") - _T("selecting the new cells"), wxITEM_CHECK ); + selectMenu->Append( ID_SELECT_UNSELECT, wxT("Add new cells to the selection"), + wxT("When off, old selection is deselected before ") + wxT("selecting the new cells"), wxITEM_CHECK ); selectMenu->Append( ID_SHOW_SELECTION, - _T("&Show current selection\tCtrl-Alt-S")); + wxT("&Show current selection\tCtrl-Alt-S")); selectMenu->AppendSeparator(); - selectMenu->Append( ID_SELECT_ALL, _T("Select all")); - selectMenu->Append( ID_SELECT_ROW, _T("Select row 2")); - selectMenu->Append( ID_SELECT_COL, _T("Select col 2")); - selectMenu->Append( ID_SELECT_CELL, _T("Select cell (3, 1)")); + selectMenu->Append( ID_SELECT_ALL, wxT("Select all")); + selectMenu->Append( ID_SELECT_ROW, wxT("Select row 2")); + selectMenu->Append( ID_SELECT_COL, wxT("Select col 2")); + selectMenu->Append( ID_SELECT_CELL, wxT("Select cell (3, 1)")); selectMenu->AppendSeparator(); - selectMenu->Append( ID_DESELECT_ALL, _T("Deselect all")); - selectMenu->Append( ID_DESELECT_ROW, _T("Deselect row 2")); - selectMenu->Append( ID_DESELECT_COL, _T("Deselect col 2")); - selectMenu->Append( ID_DESELECT_CELL, _T("Deselect cell (3, 1)")); + selectMenu->Append( ID_DESELECT_ALL, wxT("Deselect all")); + selectMenu->Append( ID_DESELECT_ROW, wxT("Deselect row 2")); + selectMenu->Append( ID_DESELECT_COL, wxT("Deselect col 2")); + selectMenu->Append( ID_DESELECT_CELL, wxT("Deselect cell (3, 1)")); wxMenu *selectionMenu = new wxMenu; - selectMenu->Append( ID_CHANGESEL, _T("Change &selection mode"), + selectMenu->Append( ID_CHANGESEL, wxT("Change &selection mode"), selectionMenu, - _T("Change selection mode") ); + wxT("Change selection mode") ); - selectionMenu->Append( ID_SELCELLS, _T("Select &cells") ); - selectionMenu->Append( ID_SELROWS, _T("Select &rows") ); - selectionMenu->Append( ID_SELCOLS, _T("Select col&umns") ); - selectionMenu->Append( ID_SELROWSORCOLS, _T("Select rows &or columns") ); + selectionMenu->Append( ID_SELCELLS, wxT("Select &cells") ); + selectionMenu->Append( ID_SELROWS, wxT("Select &rows") ); + selectionMenu->Append( ID_SELCOLS, wxT("Select col&umns") ); + selectionMenu->Append( ID_SELROWSORCOLS, wxT("Select rows &or columns") ); wxMenu *autosizeMenu = new wxMenu; - autosizeMenu->Append( ID_SIZE_ROW, _T("Selected &row data") ); - autosizeMenu->Append( ID_SIZE_COL, _T("Selected &column data") ); - autosizeMenu->Append( ID_SIZE_ROW_LABEL, _T("Selected row la&bel") ); - autosizeMenu->Append( ID_SIZE_COL_LABEL, _T("Selected column &label") ); - autosizeMenu->Append( ID_SIZE_LABELS_COL, _T("Column la&bels") ); - autosizeMenu->Append( ID_SIZE_LABELS_ROW, _T("Row label&s") ); - autosizeMenu->Append( ID_SIZE_GRID, _T("Entire &grid") ); + autosizeMenu->Append( ID_SIZE_ROW, wxT("Selected &row data") ); + autosizeMenu->Append( ID_SIZE_COL, wxT("Selected &column data") ); + autosizeMenu->Append( ID_SIZE_ROW_LABEL, wxT("Selected row la&bel") ); + autosizeMenu->Append( ID_SIZE_COL_LABEL, wxT("Selected column &label") ); + autosizeMenu->Append( ID_SIZE_LABELS_COL, wxT("Column la&bels") ); + autosizeMenu->Append( ID_SIZE_LABELS_ROW, wxT("Row label&s") ); + autosizeMenu->Append( ID_SIZE_GRID, wxT("Entire &grid") ); wxMenu *helpMenu = new wxMenu; - helpMenu->Append( wxID_ABOUT, _T("&About wxGrid demo") ); + helpMenu->Append( wxID_ABOUT, wxT("&About wxGrid demo") ); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append( fileMenu, _T("&File") ); - menuBar->Append( viewMenu, _T("&Grid") ); - menuBar->Append( colMenu, _T("&Colours") ); - menuBar->Append( editMenu, _T("&Edit") ); - menuBar->Append( selectMenu, _T("&Select") ); - menuBar->Append( autosizeMenu, _T("&Autosize") ); - menuBar->Append( helpMenu, _T("&Help") ); + menuBar->Append( fileMenu, wxT("&File") ); + menuBar->Append( viewMenu, wxT("&Grid") ); + menuBar->Append( colMenu, wxT("&Colours") ); + menuBar->Append( editMenu, wxT("&Edit") ); + menuBar->Append( selectMenu, wxT("&Select") ); + menuBar->Append( autosizeMenu, wxT("&Autosize") ); + menuBar->Append( helpMenu, wxT("&Help") ); SetMenuBar( menuBar ); @@ -294,37 +294,37 @@ GridFrame::GridFrame() grid->AppendRows(ir); grid->SetRowSize( 0, 60 ); - grid->SetCellValue( 0, 0, _T("Ctrl+Home\nwill go to\nthis cell") ); + grid->SetCellValue( 0, 0, wxT("Ctrl+Home\nwill go to\nthis cell") ); - grid->SetCellValue( 0, 1, _T("A long piece of text to demonstrate wrapping.") ); + grid->SetCellValue( 0, 1, wxT("A long piece of text to demonstrate wrapping.") ); grid->SetCellRenderer(0 , 1, new wxGridCellAutoWrapStringRenderer); grid->SetCellEditor( 0, 1 , new wxGridCellAutoWrapStringEditor); - grid->SetCellValue( 0, 2, _T("Blah") ); - grid->SetCellValue( 0, 3, _T("Read only") ); + grid->SetCellValue( 0, 2, wxT("Blah") ); + grid->SetCellValue( 0, 3, wxT("Read only") ); grid->SetReadOnly( 0, 3 ); - grid->SetCellValue( 0, 4, _T("Can veto edit this cell") ); + grid->SetCellValue( 0, 4, wxT("Can veto edit this cell") ); - grid->SetCellValue( 0, 5, _T("Press\nCtrl+arrow\nto skip over\ncells") ); + grid->SetCellValue( 0, 5, wxT("Press\nCtrl+arrow\nto skip over\ncells") ); grid->SetRowSize( 99, 60 ); - grid->SetCellValue( 99, 99, _T("Ctrl+End\nwill go to\nthis cell") ); - grid->SetCellValue( 1, 0, _T("This default cell will overflow into neighboring cells, but not if you turn overflow off.")); + grid->SetCellValue( 99, 99, wxT("Ctrl+End\nwill go to\nthis cell") ); + grid->SetCellValue( 1, 0, wxT("This default cell will overflow into neighboring cells, but not if you turn overflow off.")); grid->SetCellTextColour(1, 2, *wxRED); grid->SetCellBackgroundColour(1, 2, *wxGREEN); - grid->SetCellValue( 1, 4, _T("I'm in the middle")); + grid->SetCellValue( 1, 4, wxT("I'm in the middle")); - grid->SetCellValue(2, 2, _T("red")); + grid->SetCellValue(2, 2, wxT("red")); grid->SetCellTextColour(2, 2, *wxRED); - grid->SetCellValue(3, 3, _T("green on grey")); + grid->SetCellValue(3, 3, wxT("green on grey")); grid->SetCellTextColour(3, 3, *wxGREEN); grid->SetCellBackgroundColour(3, 3, *wxLIGHT_GREY); - grid->SetCellValue(4, 4, _T("a weird looking cell")); + grid->SetCellValue(4, 4, wxT("a weird looking cell")); grid->SetCellAlignment(4, 4, wxALIGN_CENTRE, wxALIGN_CENTRE); grid->SetCellRenderer(4, 4, new MyGridCellRenderer); @@ -339,13 +339,13 @@ GridFrame::GridFrame() attr->SetBackgroundColour(*wxRED); grid->SetRowAttr(5, attr); - grid->SetCellValue(2, 4, _T("a wider column")); + grid->SetCellValue(2, 4, wxT("a wider column")); grid->SetColSize(4, 120); grid->SetColMinimalWidth(4, 120); grid->SetCellTextColour(5, 8, *wxGREEN); - grid->SetCellValue(5, 8, _T("Bg from row attr\nText col from cell attr")); - grid->SetCellValue(5, 5, _T("Bg from row attr Text col from col attr and this text is so long that it covers over many many empty cells but is broken by one that isn't")); + grid->SetCellValue(5, 8, wxT("Bg from row attr\nText col from cell attr")); + grid->SetCellValue(5, 5, wxT("Bg from row attr Text col from col attr and this text is so long that it covers over many many empty cells but is broken by one that isn't")); grid->SetColFormatFloat(6); grid->SetCellValue(0, 6, wxString::Format(wxT("%g"), 3.1415)); @@ -364,9 +364,9 @@ GridFrame::GridFrame() const wxString choices[] = { - _T("Please select a choice"), - _T("This takes two cells"), - _T("Another choice"), + wxT("Please select a choice"), + wxT("This takes two cells"), + wxT("Another choice"), }; grid->SetCellEditor(4, 0, new wxGridCellChoiceEditor(WXSIZEOF(choices), choices)); grid->SetCellSize(4, 0, 1, 2); @@ -375,7 +375,7 @@ GridFrame::GridFrame() grid->SetCellSize(7, 1, 3, 4); grid->SetCellAlignment(7, 1, wxALIGN_CENTRE, wxALIGN_CENTRE); - grid->SetCellValue(7, 1, _T("Big box!")); + grid->SetCellValue(7, 1, wxT("Big box!")); // create a separator-like row: it's grey and it's non-resizeable grid->DisableRowResize(10); @@ -511,10 +511,10 @@ void GridFrame::ToggleGridLines( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::OnSetHighlightWidth( wxCommandEvent& WXUNUSED(ev) ) { - wxString choices[] = { _T("0"), _T("1"), _T("2"), _T("3"), _T("4"), _T("5"), _T("6"), _T("7"), _T("8"), _T("9"), _T("10")}; + wxString choices[] = { wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8"), wxT("9"), wxT("10")}; - wxSingleChoiceDialog dlg(this, _T("Choose the thickness of the highlight pen:"), - _T("Pen Width"), 11, choices); + wxSingleChoiceDialog dlg(this, wxT("Choose the thickness of the highlight pen:"), + wxT("Pen Width"), 11, choices); int current = grid->GetCellHighlightPenWidth(); dlg.SetSelection(current); @@ -525,10 +525,10 @@ void GridFrame::OnSetHighlightWidth( wxCommandEvent& WXUNUSED(ev) ) void GridFrame::OnSetROHighlightWidth( wxCommandEvent& WXUNUSED(ev) ) { - wxString choices[] = { _T("0"), _T("1"), _T("2"), _T("3"), _T("4"), _T("5"), _T("6"), _T("7"), _T("8"), _T("9"), _T("10")}; + wxString choices[] = { wxT("0"), wxT("1"), wxT("2"), wxT("3"), wxT("4"), wxT("5"), wxT("6"), wxT("7"), wxT("8"), wxT("9"), wxT("10")}; - wxSingleChoiceDialog dlg(this, _T("Choose the thickness of the highlight pen:"), - _T("Pen Width"), 11, choices); + wxSingleChoiceDialog dlg(this, wxT("Choose the thickness of the highlight pen:"), + wxT("Pen Width"), 11, choices); int current = grid->GetCellHighlightROPenWidth(); dlg.SetSelection(current); @@ -904,21 +904,21 @@ void GridFrame::OnLabelLeftClick( wxGridEvent& ev ) wxString logBuf; if ( ev.GetRow() != -1 ) { - logBuf << _T("Left click on row label ") << ev.GetRow(); + logBuf << wxT("Left click on row label ") << ev.GetRow(); } else if ( ev.GetCol() != -1 ) { - logBuf << _T("Left click on col label ") << ev.GetCol(); + logBuf << wxT("Left click on col label ") << ev.GetCol(); } else { - logBuf << _T("Left click on corner label"); + logBuf << wxT("Left click on corner label"); } if ( ev.ShiftDown() ) - logBuf << _T(" (shift down)"); + logBuf << wxT(" (shift down)"); if ( ev.ControlDown() ) - logBuf << _T(" (control down)"); + logBuf << wxT(" (control down)"); wxLogMessage( wxT("%s"), logBuf.c_str() ); // you must call event skip if you want default grid processing @@ -929,7 +929,7 @@ void GridFrame::OnLabelLeftClick( wxGridEvent& ev ) void GridFrame::OnCellLeftClick( wxGridEvent& ev ) { - wxLogMessage(_T("Left click at row %d, col %d"), ev.GetRow(), ev.GetCol()); + wxLogMessage(wxT("Left click at row %d, col %d"), ev.GetRow(), ev.GetCol()); // you must call event skip if you want default grid processing // (cell highlighting etc.) @@ -973,11 +973,11 @@ void GridFrame::OnShowSelection(wxCommandEvent& WXUNUSED(event)) { const wxGridCellCoordsArray cells(grid->GetSelectedCells()); size_t count = cells.size(); - wxLogMessage(_T("%lu cells selected:"), (unsigned long)count); + wxLogMessage(wxT("%lu cells selected:"), (unsigned long)count); if ( count > countMax ) { - wxLogMessage(_T("[too many selected cells, ") - _T("showing only the first %lu]"), + wxLogMessage(wxT("[too many selected cells, ") + wxT("showing only the first %lu]"), (unsigned long)countMax); count = countMax; } @@ -985,7 +985,7 @@ void GridFrame::OnShowSelection(wxCommandEvent& WXUNUSED(event)) for ( size_t n = 0; n < count; n++ ) { const wxGridCellCoords& c = cells[n]; - wxLogMessage(_T(" selected cell %lu: (%d, %d)"), + wxLogMessage(wxT(" selected cell %lu: (%d, %d)"), (unsigned long)n, c.GetCol(), c.GetRow()); } } @@ -1000,38 +1000,38 @@ void GridFrame::OnShowSelection(wxCommandEvent& WXUNUSED(event)) const wxChar *plural, *single; if ( rows ) { - plural = _T("rows"); - single = _T("row"); + plural = wxT("rows"); + single = wxT("row"); } else // columns { - plural = _T("columns"); - single = _T("column"); + plural = wxT("columns"); + single = wxT("column"); } const wxArrayInt sels((const wxArrayInt)(rows ? grid->GetSelectedRows() : grid->GetSelectedCols())); size_t count = sels.size(); - wxLogMessage(_T("%lu %s selected:"), + wxLogMessage(wxT("%lu %s selected:"), (unsigned long)count, plural); if ( count > countMax ) { - wxLogMessage(_T("[too many selected %s, ") - _T("showing only the first %lu]"), + wxLogMessage(wxT("[too many selected %s, ") + wxT("showing only the first %lu]"), plural, (unsigned long)countMax); count = countMax; } for ( size_t n = 0; n < count; n++ ) { - wxLogMessage(_T(" selected %s %lu: %d"), + wxLogMessage(wxT(" selected %s %lu: %d"), single, (unsigned long)n, sels[n]); } } break; default: - wxFAIL_MSG( _T("unknown wxGrid selection mode") ); + wxFAIL_MSG( wxT("unknown wxGrid selection mode") ); break; } } @@ -1040,19 +1040,19 @@ void GridFrame::OnSelectCell( wxGridEvent& ev ) { wxString logBuf; if ( ev.Selecting() ) - logBuf << _T("Selected "); + logBuf << wxT("Selected "); else - logBuf << _T("Deselected "); - logBuf << _T("cell at row ") << ev.GetRow() - << _T(" col ") << ev.GetCol() - << _T(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F') - << _T(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F') - << _T(", AltDown: ")<< (ev.AltDown() ? 'T':'F') - << _T(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << _T(" )"); + logBuf << wxT("Deselected "); + logBuf << wxT("cell at row ") << ev.GetRow() + << wxT(" col ") << ev.GetCol() + << wxT(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F') + << wxT(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F') + << wxT(", AltDown: ")<< (ev.AltDown() ? 'T':'F') + << wxT(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << wxT(" )"); //Indicate whether this column was moved if ( ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() ) != ev.GetCol() ) - logBuf << _T(" *** Column moved, current position: ") << ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() ); + logBuf << wxT(" *** Column moved, current position: ") << ((wxGrid *)ev.GetEventObject())->GetColPos( ev.GetCol() ); wxLogMessage( wxT("%s"), logBuf.c_str() ); @@ -1065,17 +1065,17 @@ void GridFrame::OnRangeSelected( wxGridRangeSelectEvent& ev ) { wxString logBuf; if ( ev.Selecting() ) - logBuf << _T("Selected "); + logBuf << wxT("Selected "); else - logBuf << _T("Deselected "); - logBuf << _T("cells from row ") << ev.GetTopRow() - << _T(" col ") << ev.GetLeftCol() - << _T(" to row ") << ev.GetBottomRow() - << _T(" col ") << ev.GetRightCol() - << _T(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F') - << _T(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F') - << _T(", AltDown: ")<< (ev.AltDown() ? 'T':'F') - << _T(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << _T(" )"); + logBuf << wxT("Deselected "); + logBuf << wxT("cells from row ") << ev.GetTopRow() + << wxT(" col ") << ev.GetLeftCol() + << wxT(" to row ") << ev.GetBottomRow() + << wxT(" col ") << ev.GetRightCol() + << wxT(" ( ControlDown: ")<< (ev.ControlDown() ? 'T':'F') + << wxT(", ShiftDown: ")<< (ev.ShiftDown() ? 'T':'F') + << wxT(", AltDown: ")<< (ev.AltDown() ? 'T':'F') + << wxT(", MetaDown: ")<< (ev.MetaDown() ? 'T':'F') << wxT(" )"); wxLogMessage( wxT("%s"), logBuf.c_str() ); ev.Skip(); @@ -1117,7 +1117,7 @@ void GridFrame::OnCellValueChanged( wxGridEvent& ev ) void GridFrame::OnCellBeginDrag( wxGridEvent& ev ) { - wxLogMessage(_T("Got request to drag cell at row %d, col %d"), + wxLogMessage(wxT("Got request to drag cell at row %d, col %d"), ev.GetRow(), ev.GetCol()); ev.Skip(); @@ -1128,8 +1128,8 @@ void GridFrame::OnEditorShown( wxGridEvent& ev ) if ( (ev.GetCol() == 4) && (ev.GetRow() == 0) && - (wxMessageBox(_T("Are you sure you wish to edit this cell"), - _T("Checking"),wxYES_NO) == wxNO ) ) { + (wxMessageBox(wxT("Are you sure you wish to edit this cell"), + wxT("Checking"),wxYES_NO) == wxNO ) ) { ev.Veto(); return; @@ -1145,8 +1145,8 @@ void GridFrame::OnEditorHidden( wxGridEvent& ev ) if ( (ev.GetCol() == 4) && (ev.GetRow() == 0) && - (wxMessageBox(_T("Are you sure you wish to finish editing this cell"), - _T("Checking"),wxYES_NO) == wxNO ) ) { + (wxMessageBox(wxT("Are you sure you wish to finish editing this cell"), + wxT("Checking"),wxYES_NO) == wxNO ) ) { ev.Veto(); return; @@ -1234,9 +1234,9 @@ void GridFrame::OnVTable(wxCommandEvent& ) { static long s_sizeGrid = 10000; - s_sizeGrid = wxGetNumberFromUser(_T("Size of the table to create"), - _T("Size: "), - _T("wxGridDemo question"), + s_sizeGrid = wxGetNumberFromUser(wxT("Size of the table to create"), + wxT("Size: "), + wxT("wxGridDemo question"), s_sizeGrid, 0, 32000, this); @@ -1273,7 +1273,7 @@ void MyGridCellRenderer::Draw(wxGrid& grid, // ============================================================================ BigGridFrame::BigGridFrame(long sizeGrid) - : wxFrame(NULL, wxID_ANY, _T("Plugin Virtual Table"), + : wxFrame(NULL, wxID_ANY, wxT("Plugin Virtual Table"), wxDefaultPosition, wxSize(500, 450)) { m_grid = new wxGrid(this, wxID_ANY, wxDefaultPosition, wxDefaultSize); @@ -1324,11 +1324,11 @@ enum Severity static const wxString severities[] = { - _T("wishlist"), - _T("minor"), - _T("normal"), - _T("major"), - _T("critical"), + wxT("wishlist"), + wxT("minor"), + wxT("normal"), + wxT("major"), + wxT("critical"), }; static struct BugsGridData @@ -1341,20 +1341,20 @@ static struct BugsGridData bool opened; } gs_dataBugsGrid [] = { - { 18, _T("foo doesn't work"), Sev_Major, 1, _T("wxMSW"), true }, - { 27, _T("bar crashes"), Sev_Critical, 1, _T("all"), false }, - { 45, _T("printing is slow"), Sev_Minor, 3, _T("wxMSW"), true }, - { 68, _T("Rectangle() fails"), Sev_Normal, 1, _T("wxMSW"), false }, + { 18, wxT("foo doesn't work"), Sev_Major, 1, wxT("wxMSW"), true }, + { 27, wxT("bar crashes"), Sev_Critical, 1, wxT("all"), false }, + { 45, wxT("printing is slow"), Sev_Minor, 3, wxT("wxMSW"), true }, + { 68, wxT("Rectangle() fails"), Sev_Normal, 1, wxT("wxMSW"), false }, }; static const wxChar *headers[Col_Max] = { - _T("Id"), - _T("Summary"), - _T("Severity"), - _T("Priority"), - _T("Platform"), - _T("Opened?"), + wxT("Id"), + wxT("Summary"), + wxT("Severity"), + wxT("Priority"), + wxT("Platform"), + wxT("Opened?"), }; // ---------------------------------------------------------------------------- @@ -1373,16 +1373,16 @@ wxString BugsGridTable::GetTypeName(int WXUNUSED(row), int col) // fall thorugh (TODO should be a list) case Col_Summary: - return wxString::Format(_T("%s:80"), wxGRID_VALUE_STRING); + return wxString::Format(wxT("%s:80"), wxGRID_VALUE_STRING); case Col_Platform: - return wxString::Format(_T("%s:all,MSW,GTK,other"), wxGRID_VALUE_CHOICE); + return wxString::Format(wxT("%s:all,MSW,GTK,other"), wxGRID_VALUE_CHOICE); case Col_Opened: return wxGRID_VALUE_BOOL; } - wxFAIL_MSG(_T("unknown column")); + wxFAIL_MSG(wxT("unknown column")); return wxEmptyString; } @@ -1409,13 +1409,13 @@ wxString BugsGridTable::GetValue( int row, int col ) switch ( col ) { case Col_Id: - return wxString::Format(_T("%d"), gd.id); + return wxString::Format(wxT("%d"), gd.id); case Col_Priority: - return wxString::Format(_T("%d"), gd.prio); + return wxString::Format(wxT("%d"), gd.prio); case Col_Opened: - return gd.opened ? _T("1") : _T("0"); + return gd.opened ? wxT("1") : wxT("0"); case Col_Severity: return severities[gd.severity]; @@ -1439,7 +1439,7 @@ void BugsGridTable::SetValue( int row, int col, const wxString& value ) case Col_Id: case Col_Priority: case Col_Opened: - wxFAIL_MSG(_T("unexpected column")); + wxFAIL_MSG(wxT("unexpected column")); break; case Col_Severity: @@ -1456,7 +1456,7 @@ void BugsGridTable::SetValue( int row, int col, const wxString& value ) if ( n == WXSIZEOF(severities) ) { - wxLogWarning(_T("Invalid severity value '%s'."), + wxLogWarning(wxT("Invalid severity value '%s'."), value.c_str()); gd.severity = Sev_Normal; } @@ -1517,7 +1517,7 @@ long BugsGridTable::GetValueAsLong( int row, int col ) return gd.severity; default: - wxFAIL_MSG(_T("unexpected column")); + wxFAIL_MSG(wxT("unexpected column")); return -1; } } @@ -1530,7 +1530,7 @@ bool BugsGridTable::GetValueAsBool( int row, int col ) } else { - wxFAIL_MSG(_T("unexpected column")); + wxFAIL_MSG(wxT("unexpected column")); return false; } @@ -1547,7 +1547,7 @@ void BugsGridTable::SetValueAsLong( int row, int col, long value ) break; default: - wxFAIL_MSG(_T("unexpected column")); + wxFAIL_MSG(wxT("unexpected column")); } } @@ -1559,7 +1559,7 @@ void BugsGridTable::SetValueAsBool( int row, int col, bool value ) } else { - wxFAIL_MSG(_T("unexpected column")); + wxFAIL_MSG(wxT("unexpected column")); } } @@ -1573,7 +1573,7 @@ wxString BugsGridTable::GetColLabelValue( int col ) // ---------------------------------------------------------------------------- BugsGridFrame::BugsGridFrame() - : wxFrame(NULL, wxID_ANY, _T("Bugs table")) + : wxFrame(NULL, wxID_ANY, wxT("Bugs table")) { wxGrid *grid = new wxGrid(this, wxID_ANY); wxGridTableBase *table = new BugsGridTable(); diff --git a/samples/help/demo.cpp b/samples/help/demo.cpp index 74574c239f..5935d59b1f 100644 --- a/samples/help/demo.cpp +++ b/samples/help/demo.cpp @@ -312,7 +312,7 @@ bool MyApp::OnInit() #endif // wxUSE_HTML // Create the main application window - MyFrame *frame = new MyFrame(_T("HelpDemo wxWidgets App"), + MyFrame *frame = new MyFrame(wxT("HelpDemo wxWidgets App"), wxPoint(50, 50), wxSize(450, 340)); #if !USE_SIMPLE_HELP_PROVIDER @@ -329,7 +329,7 @@ bool MyApp::OnInit() // initialise the help system: this means that we'll use doc.hlp file under // Windows and that the HTML docs are in the subdirectory doc for platforms // using HTML help - if ( !frame->GetHelpController().Initialize(_T("doc")) ) + if ( !frame->GetHelpController().Initialize(wxT("doc")) ) { wxLogError(wxT("Cannot initialize the help system, aborting.")); @@ -337,7 +337,7 @@ bool MyApp::OnInit() } #if wxUSE_MS_HTML_HELP && !defined(__WXUNIVERSAL__) - if( !frame->GetMSHtmlHelpController().Initialize(_T("doc")) ) + if( !frame->GetMSHtmlHelpController().Initialize(wxT("doc")) ) { wxLogError(wxT("Cannot initialize the MS HTML Help system.")); } @@ -345,7 +345,7 @@ bool MyApp::OnInit() #if wxUSE_MS_HTML_HELP && wxUSE_WXHTML_HELP && !defined(__WXUNIVERSAL__) // you need to call Initialize in order to use wxBestHelpController - if( !frame->GetBestHelpController().Initialize(_T("doc")) ) + if( !frame->GetBestHelpController().Initialize(wxT("doc")) ) { wxLogError(wxT("Cannot initialize the best help system, aborting.")); } @@ -354,7 +354,7 @@ bool MyApp::OnInit() #if USE_HTML_HELP // initialise the advanced HTML help system: this means that the HTML docs are in .htb // (zipped) form - if ( !frame->GetAdvancedHtmlHelpController().Initialize(_T("doc")) ) + if ( !frame->GetAdvancedHtmlHelpController().Initialize(wxT("doc")) ) { wxLogError(wxT("Cannot initialize the advanced HTML help system, aborting.")); @@ -365,7 +365,7 @@ bool MyApp::OnInit() #if 0 // defined(__WXMSW__) && wxUSE_MS_HTML_HELP wxString path(wxGetCwd()); - if ( !frame->GetMSHtmlHelpController().Initialize(path + _T("\\doc.chm")) ) + if ( !frame->GetMSHtmlHelpController().Initialize(path + wxT("\\doc.chm")) ) { wxLogError("Cannot initialize the MS HTML help system, aborting."); @@ -401,51 +401,51 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->Append(HelpDemo_Help_Index, _T("&Help Index...")); - menuFile->Append(HelpDemo_Help_Classes, _T("&Help on Classes...")); - menuFile->Append(HelpDemo_Help_Functions, _T("&Help on Functions...")); - menuFile->Append(HelpDemo_Help_ContextHelp, _T("&Context Help...")); - menuFile->Append(HelpDemo_Help_DialogContextHelp, _T("&Dialog Context Help...\tCtrl-H")); - menuFile->Append(HelpDemo_Help_Help, _T("&About Help Demo...")); - menuFile->Append(HelpDemo_Help_Search, _T("&Search help...")); + menuFile->Append(HelpDemo_Help_Index, wxT("&Help Index...")); + menuFile->Append(HelpDemo_Help_Classes, wxT("&Help on Classes...")); + menuFile->Append(HelpDemo_Help_Functions, wxT("&Help on Functions...")); + menuFile->Append(HelpDemo_Help_ContextHelp, wxT("&Context Help...")); + menuFile->Append(HelpDemo_Help_DialogContextHelp, wxT("&Dialog Context Help...\tCtrl-H")); + menuFile->Append(HelpDemo_Help_Help, wxT("&About Help Demo...")); + menuFile->Append(HelpDemo_Help_Search, wxT("&Search help...")); #if USE_HTML_HELP menuFile->AppendSeparator(); - menuFile->Append(HelpDemo_Advanced_Html_Help_Index, _T("Advanced HTML &Help Index...")); - menuFile->Append(HelpDemo_Advanced_Html_Help_Classes, _T("Advanced HTML &Help on Classes...")); - menuFile->Append(HelpDemo_Advanced_Html_Help_Functions, _T("Advanced HTML &Help on Functions...")); - menuFile->Append(HelpDemo_Advanced_Html_Help_Help, _T("Advanced HTML &About Help Demo...")); - menuFile->Append(HelpDemo_Advanced_Html_Help_Search, _T("Advanced HTML &Search help...")); - menuFile->Append(HelpDemo_Advanced_Html_Help_Modal, _T("Advanced HTML Help &Modal Dialog...")); + menuFile->Append(HelpDemo_Advanced_Html_Help_Index, wxT("Advanced HTML &Help Index...")); + menuFile->Append(HelpDemo_Advanced_Html_Help_Classes, wxT("Advanced HTML &Help on Classes...")); + menuFile->Append(HelpDemo_Advanced_Html_Help_Functions, wxT("Advanced HTML &Help on Functions...")); + menuFile->Append(HelpDemo_Advanced_Html_Help_Help, wxT("Advanced HTML &About Help Demo...")); + menuFile->Append(HelpDemo_Advanced_Html_Help_Search, wxT("Advanced HTML &Search help...")); + menuFile->Append(HelpDemo_Advanced_Html_Help_Modal, wxT("Advanced HTML Help &Modal Dialog...")); #endif #if wxUSE_MS_HTML_HELP && !defined(__WXUNIVERSAL__) menuFile->AppendSeparator(); - menuFile->Append(HelpDemo_MS_Html_Help_Index, _T("MS HTML &Help Index...")); - menuFile->Append(HelpDemo_MS_Html_Help_Classes, _T("MS HTML &Help on Classes...")); - menuFile->Append(HelpDemo_MS_Html_Help_Functions, _T("MS HTML &Help on Functions...")); - menuFile->Append(HelpDemo_MS_Html_Help_Help, _T("MS HTML &About Help Demo...")); - menuFile->Append(HelpDemo_MS_Html_Help_Search, _T("MS HTML &Search help...")); + menuFile->Append(HelpDemo_MS_Html_Help_Index, wxT("MS HTML &Help Index...")); + menuFile->Append(HelpDemo_MS_Html_Help_Classes, wxT("MS HTML &Help on Classes...")); + menuFile->Append(HelpDemo_MS_Html_Help_Functions, wxT("MS HTML &Help on Functions...")); + menuFile->Append(HelpDemo_MS_Html_Help_Help, wxT("MS HTML &About Help Demo...")); + menuFile->Append(HelpDemo_MS_Html_Help_Search, wxT("MS HTML &Search help...")); #endif #if wxUSE_MS_HTML_HELP && wxUSE_WXHTML_HELP && !defined(__WXUNIVERSAL__) menuFile->AppendSeparator(); - menuFile->Append(HelpDemo_Best_Help_Index, _T("Best &Help Index...")); + menuFile->Append(HelpDemo_Best_Help_Index, wxT("Best &Help Index...")); #endif #ifndef __WXMSW__ #if !wxUSE_HTML menuFile->AppendSeparator(); - menuFile->Append(HelpDemo_Help_KDE, _T("Use &KDE")); - menuFile->Append(HelpDemo_Help_GNOME, _T("Use &GNOME")); - menuFile->Append(HelpDemo_Help_Netscape, _T("Use &Netscape")); + menuFile->Append(HelpDemo_Help_KDE, wxT("Use &KDE")); + menuFile->Append(HelpDemo_Help_GNOME, wxT("Use &GNOME")); + menuFile->Append(HelpDemo_Help_Netscape, wxT("Use &Netscape")); #endif #endif menuFile->AppendSeparator(); - menuFile->Append(HelpDemo_Quit, _T("E&xit")); + menuFile->Append(HelpDemo_Quit, wxT("E&xit")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menuFile, _T("&File")); + menuBar->Append(menuFile, wxT("&File")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -453,7 +453,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR #if USE_HTML_HELP @@ -465,8 +465,8 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) m_embeddedHelpWindow->Create(this, wxID_ANY, wxDefaultPosition, GetClientSize(), wxTAB_TRAVERSAL|wxNO_BORDER, wxHF_DEFAULT_STYLE); - m_embeddedHtmlHelp.AddBook(wxFileName(_T("doc.zip"))); - m_embeddedHtmlHelp.Display(_T("Introduction")); + m_embeddedHtmlHelp.AddBook(wxFileName(wxT("doc.zip"))); + m_embeddedHtmlHelp.Display(wxT("Introduction")); #else // now create some controls @@ -477,7 +477,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) //panel->SetHelpText(wxContextId(300)); // and a static control whose parent is the panel - wxStaticText* staticText = new wxStaticText(panel, 302, _T("Hello, world!"), wxPoint(10, 10)); + wxStaticText* staticText = new wxStaticText(panel, 302, wxT("Hello, world!"), wxPoint(10, 10)); staticText->SetHelpText(_("This static text control isn't doing a lot right now.")); #endif } @@ -640,8 +640,8 @@ void MyFrame::ShowHelp(int commandId, wxHelpControllerBase& helpController) case HelpDemo_MS_Html_Help_Search: case HelpDemo_Best_Help_Search: { - wxString key = wxGetTextFromUser(_T("Search for?"), - _T("Search help for keyword"), + wxString key = wxGetTextFromUser(wxT("Search for?"), + wxT("Search help for keyword"), wxEmptyString, this); if(! key.IsEmpty()) @@ -660,13 +660,13 @@ void MyFrame::ShowHelp(int commandId, wxHelpControllerBase& helpController) // These three calls are only used by wxExtHelpController case HelpDemo_Help_KDE: - helpController.SetViewer(_T("kdehelp")); + helpController.SetViewer(wxT("kdehelp")); break; case HelpDemo_Help_GNOME: - helpController.SetViewer(_T("gnome-help-browser")); + helpController.SetViewer(wxT("gnome-help-browser")); break; case HelpDemo_Help_Netscape: - helpController.SetViewer(_T("netscape"), wxHELP_NETSCAPE); + helpController.SetViewer(wxT("netscape"), wxHELP_NETSCAPE); break; } } @@ -680,7 +680,7 @@ BEGIN_EVENT_TABLE(MyModalDialog, wxDialog) END_EVENT_TABLE() MyModalDialog::MyModalDialog(wxWindow *parent) - : wxDialog(parent, wxID_ANY, wxString(_T("Modal dialog"))) + : wxDialog(parent, wxID_ANY, wxString(wxT("Modal dialog"))) { // Add the context-sensitive help button on the caption for the platforms // which support it (currently MSW only) @@ -690,10 +690,10 @@ MyModalDialog::MyModalDialog(wxWindow *parent) wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); wxBoxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); - wxButton* btnOK = new wxButton(this, wxID_OK, _T("&OK")); + wxButton* btnOK = new wxButton(this, wxID_OK, wxT("&OK")); btnOK->SetHelpText(_("The OK button confirms the dialog choices.")); - wxButton* btnCancel = new wxButton(this, wxID_CANCEL, _T("&Cancel")); + wxButton* btnCancel = new wxButton(this, wxID_CANCEL, wxT("&Cancel")); btnCancel->SetHelpText(_("The Cancel button cancels the dialog.")); sizerRow->Add(btnOK, 0, wxALIGN_CENTER | wxALL, 5); diff --git a/samples/htlbox/htlbox.cpp b/samples/htlbox/htlbox.cpp index a24887bb79..af34173fa0 100644 --- a/samples/htlbox/htlbox.cpp +++ b/samples/htlbox/htlbox.cpp @@ -129,7 +129,7 @@ public: void OnLboxSelect(wxCommandEvent& event); void OnLboxDClick(wxCommandEvent& event) { - wxLogMessage(_T("Listbox item %d double clicked."), event.GetInt()); + wxLogMessage(wxT("Listbox item %d double clicked."), event.GetInt()); } void OnHtmlLinkClicked(wxHtmlLinkEvent& event); @@ -237,7 +237,7 @@ IMPLEMENT_APP(MyApp) // frame constructor MyFrame::MyFrame() - : wxFrame(NULL, wxID_ANY, _T("HtmlLbox wxWidgets Sample"), + : wxFrame(NULL, wxID_ANY, wxT("HtmlLbox wxWidgets Sample"), wxDefaultPosition, wxSize(500, 500)) { // set the frame icon @@ -246,48 +246,48 @@ MyFrame::MyFrame() #if wxUSE_MENUS // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->AppendRadioItem(HtmlLbox_CustomBox, _T("Use custom box"), - _T("Use a wxHtmlListBox virtual class control")); - menuFile->AppendRadioItem(HtmlLbox_SimpleBox, _T("Use simple box"), - _T("Use a wxSimpleHtmlListBox control")); + menuFile->AppendRadioItem(HtmlLbox_CustomBox, wxT("Use custom box"), + wxT("Use a wxHtmlListBox virtual class control")); + menuFile->AppendRadioItem(HtmlLbox_SimpleBox, wxT("Use simple box"), + wxT("Use a wxSimpleHtmlListBox control")); menuFile->AppendSeparator(); - menuFile->Append(HtmlLbox_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(HtmlLbox_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // create our specific menu wxMenu *menuHLbox = new wxMenu; menuHLbox->Append(HtmlLbox_SetMargins, - _T("Set &margins...\tCtrl-G"), - _T("Change the margins around the items")); + wxT("Set &margins...\tCtrl-G"), + wxT("Change the margins around the items")); menuHLbox->AppendCheckItem(HtmlLbox_DrawSeparator, - _T("&Draw separators\tCtrl-D"), - _T("Toggle drawing separators between cells")); + wxT("&Draw separators\tCtrl-D"), + wxT("Toggle drawing separators between cells")); menuHLbox->AppendSeparator(); menuHLbox->AppendCheckItem(HtmlLbox_ToggleMulti, - _T("&Multiple selection\tCtrl-M"), - _T("Toggle multiple selection on/off")); + wxT("&Multiple selection\tCtrl-M"), + wxT("Toggle multiple selection on/off")); menuHLbox->AppendSeparator(); - menuHLbox->Append(HtmlLbox_SelectAll, _T("Select &all items\tCtrl-A")); - menuHLbox->Append(HtmlLbox_UpdateItem, _T("Update &first item\tCtrl-U")); - menuHLbox->Append(HtmlLbox_GetItemRect, _T("Show &rectangle of item #10\tCtrl-R")); + menuHLbox->Append(HtmlLbox_SelectAll, wxT("Select &all items\tCtrl-A")); + menuHLbox->Append(HtmlLbox_UpdateItem, wxT("Update &first item\tCtrl-U")); + menuHLbox->Append(HtmlLbox_GetItemRect, wxT("Show &rectangle of item #10\tCtrl-R")); menuHLbox->AppendSeparator(); - menuHLbox->Append(HtmlLbox_SetBgCol, _T("Set &background...\tCtrl-B")); + menuHLbox->Append(HtmlLbox_SetBgCol, wxT("Set &background...\tCtrl-B")); menuHLbox->Append(HtmlLbox_SetSelBgCol, - _T("Set &selection background...\tCtrl-S")); + wxT("Set &selection background...\tCtrl-S")); menuHLbox->AppendCheckItem(HtmlLbox_SetSelFgCol, - _T("Keep &foreground in selection\tCtrl-F")); + wxT("Keep &foreground in selection\tCtrl-F")); menuHLbox->AppendSeparator(); - menuHLbox->Append(HtmlLbox_Clear, _T("&Clear\tCtrl-L")); + menuHLbox->Append(HtmlLbox_Clear, wxT("&Clear\tCtrl-L")); // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(HtmlLbox_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(HtmlLbox_About, wxT("&About...\tF1"), wxT("Show about dialog")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(menuHLbox, _T("&Listbox")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(menuHLbox, wxT("&Listbox")); + menuBar->Append(helpMenu, wxT("&Help")); menuBar->Check(HtmlLbox_DrawSeparator, true); @@ -298,12 +298,12 @@ MyFrame::MyFrame() #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR // create the child controls CreateBox(); - wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""), + wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); delete wxLog::SetActiveTarget(new wxLogTextCtrl(text)); @@ -345,9 +345,9 @@ void MyFrame::CreateBox() (unsigned char)(abs((int)n - 128) % 256)); int level = n % 6 + 1; - wxString label = wxString::Format(_T("") - _T("Item %lu") - _T(""), + wxString label = wxString::Format(wxT("") + wxT("Item %lu") + wxT(""), level, clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(), (unsigned long)n, level); @@ -384,10 +384,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("This sample shows wxHtmlListBox class.\n") - _T("\n") - _T("(c) 2003 Vadim Zeitlin"), - _T("About HtmlLbox"), + wxMessageBox(wxT("This sample shows wxHtmlListBox class.\n") + wxT("\n") + wxT("(c) 2003 Vadim Zeitlin"), + wxT("About HtmlLbox"), wxOK | wxICON_INFORMATION, this); } @@ -396,9 +396,9 @@ void MyFrame::OnSetMargins(wxCommandEvent& WXUNUSED(event)) { long margin = wxGetNumberFromUser ( - _T("Enter the margins to use for the listbox items."), - _T("Margin: "), - _T("HtmlLbox: Set the margins"), + wxT("Enter the margins to use for the listbox items."), + wxT("Margin: "), + wxT("HtmlLbox: Set the margins"), 0, 0, 20, this ); @@ -455,7 +455,7 @@ void MyFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) m_hlbox->Refresh(); #if wxUSE_STATUSBAR - SetStatusText(_T("Background colour changed.")); + SetStatusText(wxT("Background colour changed.")); #endif // wxUSE_STATUSBAR } } @@ -469,7 +469,7 @@ void MyFrame::OnSetSelBgCol(wxCommandEvent& WXUNUSED(event)) m_hlbox->Refresh(); #if wxUSE_STATUSBAR - SetStatusText(_T("Selection background colour changed.")); + SetStatusText(wxT("Selection background colour changed.")); #endif // wxUSE_STATUSBAR } } @@ -520,7 +520,7 @@ void MyFrame::OnHtmlCellClicked(wxHtmlCellEvent &event) void MyFrame::OnLboxSelect(wxCommandEvent& event) { - wxLogMessage(_T("Listbox selection is now %d."), event.GetInt()); + wxLogMessage(wxT("Listbox selection is now %d."), event.GetInt()); if ( m_hlbox->HasMultipleSelection() ) { @@ -535,20 +535,20 @@ void MyFrame::OnLboxSelect(wxCommandEvent& event) if ( first ) first = false; else - s << _T(", "); + s << wxT(", "); s << item; } if ( !s.empty() ) { - wxLogMessage(_T("Selected items: %s"), s.c_str()); + wxLogMessage(wxT("Selected items: %s"), s.c_str()); } } #if wxUSE_STATUSBAR SetStatusText(wxString::Format( - _T("# items selected = %lu"), + wxT("# items selected = %lu"), (unsigned long)m_hlbox->GetSelectedCount() )); #endif // wxUSE_STATUSBAR @@ -572,9 +572,9 @@ MyHtmlListBox::MyHtmlListBox(wxWindow *parent, bool multi) SetMargins(5, 5); #ifdef USE_HTML_FILE - if ( !m_file.Open(_T("results")) ) + if ( !m_file.Open(wxT("results")) ) { - wxLogError(_T("Failed to open results file")); + wxLogError(wxT("Failed to open results file")); } else { @@ -602,7 +602,7 @@ wxString MyHtmlListBox::OnGetItem(size_t n) const { if ( !n && m_firstItemUpdated ) { - return _T("

Just updated

"); + return wxT("

Just updated

"); } #ifdef USE_HTML_FILE @@ -618,18 +618,18 @@ wxString MyHtmlListBox::OnGetItem(size_t n) const (unsigned char)(abs((int)n - 256) % 256), (unsigned char)(abs((int)n - 128) % 256)); - wxString label = wxString::Format(_T("") - _T("Item %lu") - _T(""), + wxString label = wxString::Format(wxT("") + wxT("Item %lu") + wxT(""), level, clr.GetAsString(wxC2S_HTML_SYNTAX).c_str(), (unsigned long)n, level); if ( n == 1 ) { if ( !m_linkClicked ) - label += _T("Click here..."); + label += wxT("Click here..."); else - label += _T("Clicked here..."); + label += wxT("Clicked here..."); } return label; diff --git a/samples/html/htmlctrl/htmlctrl.cpp b/samples/html/htmlctrl/htmlctrl.cpp index cd470a3491..4cc6aca4e9 100644 --- a/samples/html/htmlctrl/htmlctrl.cpp +++ b/samples/html/htmlctrl/htmlctrl.cpp @@ -133,7 +133,7 @@ bool MyApp::OnInit() return false; // create the main application window - MyFrame *frame = new MyFrame(_T("wxWebKit Sample")); + MyFrame *frame = new MyFrame(wxT("wxWebKit Sample")); // and show it (the frames, unlike simple controls, are not shown when // created initially) @@ -184,7 +184,7 @@ MyFrame::MyFrame(const wxString& title) wxButton* btnReload = new wxButton(myToolbar, ID_RELOAD, _("Reload")); myToolbar->AddControl(btnReload); myToolbar->AddSeparator(); - urlText = new wxTextCtrl(myToolbar, ID_URLLIST, _T("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(220, -1), wxTE_PROCESS_ENTER); + urlText = new wxTextCtrl(myToolbar, ID_URLLIST, wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(220, -1), wxTE_PROCESS_ENTER); myToolbar->AddControl(urlText); myToolbar->AddSeparator(); myToolbar->Realize(); @@ -196,7 +196,7 @@ MyFrame::MyFrame(const wxString& title) wxBoxSizer* boxSizer = new wxBoxSizer(wxVERTICAL); panel->SetSizer(boxSizer); - mySafari = new wxWebKitCtrl(panel, ID_WEBKIT, _T("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200)); + mySafari = new wxWebKitCtrl(panel, ID_WEBKIT, wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200)); boxSizer->Add(mySafari, 1, wxEXPAND); @@ -204,7 +204,7 @@ MyFrame::MyFrame(const wxString& title) SetSizer(frameSizer); frameSizer->Add(panel, 1, wxEXPAND); #else - mySafari = new wxWebKitCtrl(this, ID_WEBKIT, _T("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200)); + mySafari = new wxWebKitCtrl(this, ID_WEBKIT, wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxSize(200, 200)); #endif #if wxUSE_STATUSBAR diff --git a/samples/html/test/test.cpp b/samples/html/test/test.cpp index 6931da1ba3..d42117b966 100644 --- a/samples/html/test/test.cpp +++ b/samples/html/test/test.cpp @@ -258,7 +258,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) m_Html->LoadFile(wxFileName(wxT("test.htm"))); m_Html->AddProcessor(m_Processor); - wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""), + wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); @@ -374,7 +374,7 @@ wxHtmlOpeningStatus MyHtmlWindow::OnOpeningURL(wxHtmlURLType WXUNUSED(type), const wxString& url, wxString *WXUNUSED(redirect)) const { - GetRelatedFrame()->SetStatusText(url + _T(" lately opened"),1); + GetRelatedFrame()->SetStatusText(url + wxT(" lately opened"),1); return wxHTML_OPEN; } @@ -398,17 +398,17 @@ void MyHtmlWindow::OnClipboardEvent(wxClipboardTextEvent& WXUNUSED(event)) const wxString text = data.GetText(); const size_t maxTextLength = 100; - wxLogStatus(wxString::Format(_T("Clipboard: '%s%s'"), + wxLogStatus(wxString::Format(wxT("Clipboard: '%s%s'"), wxString(text, maxTextLength).c_str(), - (text.length() > maxTextLength) ? _T("...") - : _T(""))); + (text.length() > maxTextLength) ? wxT("...") + : wxT(""))); wxTheClipboard->Close(); return; } } - wxLogStatus(_T("Clipboard: nothing")); + wxLogStatus(wxT("Clipboard: nothing")); } #endif // wxUSE_CLIPBOARD diff --git a/samples/image/canvas.cpp b/samples/image/canvas.cpp index 69168b346c..4f370f6b47 100644 --- a/samples/image/canvas.cpp +++ b/samples/image/canvas.cpp @@ -81,19 +81,19 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, wxImage image = bitmap.ConvertToImage(); #if wxUSE_LIBPNG - if ( !image.SaveFile( dir + _T("test.png"), wxBITMAP_TYPE_PNG )) + if ( !image.SaveFile( dir + wxT("test.png"), wxBITMAP_TYPE_PNG )) { wxLogError(wxT("Can't save file")); } image.Destroy(); - if ( image.LoadFile( dir + _T("test.png") ) ) + if ( image.LoadFile( dir + wxT("test.png") ) ) my_square = wxBitmap( image ); image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.png")) ) + if ( !image.LoadFile( dir + wxT("horse.png")) ) { wxLogError(wxT("Can't load PNG image")); } @@ -102,7 +102,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, my_horse_png = wxBitmap( image ); } - if ( !image.LoadFile( dir + _T("toucan.png")) ) + if ( !image.LoadFile( dir + wxT("toucan.png")) ) { wxLogError(wxT("Can't load PNG image")); } @@ -125,7 +125,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_LIBJPEG image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.jpg")) ) + if ( !image.LoadFile( dir + wxT("horse.jpg")) ) { wxLogError(wxT("Can't load JPG image")); } @@ -140,9 +140,9 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, colorized_horse_jpeg = wxBitmap( image ); } - if ( !image.LoadFile( dir + _T("cmyk.jpg")) ) + if ( !image.LoadFile( dir + wxT("cmyk.jpg")) ) { - wxLogError(_T("Can't load CMYK JPG image")); + wxLogError(wxT("Can't load CMYK JPG image")); } else { @@ -153,7 +153,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_GIF image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.gif" )) ) + if ( !image.LoadFile( dir + wxT("horse.gif" )) ) { wxLogError(wxT("Can't load GIF image")); } @@ -166,7 +166,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_PCX image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.pcx"), wxBITMAP_TYPE_PCX ) ) + if ( !image.LoadFile( dir + wxT("horse.pcx"), wxBITMAP_TYPE_PCX ) ) { wxLogError(wxT("Can't load PCX image")); } @@ -178,7 +178,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.bmp"), wxBITMAP_TYPE_BMP ) ) + if ( !image.LoadFile( dir + wxT("horse.bmp"), wxBITMAP_TYPE_BMP ) ) { wxLogError(wxT("Can't load BMP image")); } @@ -190,7 +190,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_XPM image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.xpm"), wxBITMAP_TYPE_XPM ) ) + if ( !image.LoadFile( dir + wxT("horse.xpm"), wxBITMAP_TYPE_XPM ) ) { wxLogError(wxT("Can't load XPM image")); } @@ -199,7 +199,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, my_horse_xpm = wxBitmap( image ); } - if ( !image.SaveFile( dir + _T("test.xpm"), wxBITMAP_TYPE_XPM )) + if ( !image.SaveFile( dir + wxT("test.xpm"), wxBITMAP_TYPE_XPM )) { wxLogError(wxT("Can't save file")); } @@ -208,7 +208,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_PNM image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.pnm"), wxBITMAP_TYPE_PNM ) ) + if ( !image.LoadFile( dir + wxT("horse.pnm"), wxBITMAP_TYPE_PNM ) ) { wxLogError(wxT("Can't load PNM image")); } @@ -219,7 +219,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); - if ( !image.LoadFile( dir + _T("horse_ag.pnm"), wxBITMAP_TYPE_PNM ) ) + if ( !image.LoadFile( dir + wxT("horse_ag.pnm"), wxBITMAP_TYPE_PNM ) ) { wxLogError(wxT("Can't load PNM image")); } @@ -230,7 +230,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); - if ( !image.LoadFile( dir + _T("horse_rg.pnm"), wxBITMAP_TYPE_PNM ) ) + if ( !image.LoadFile( dir + wxT("horse_rg.pnm"), wxBITMAP_TYPE_PNM ) ) { wxLogError(wxT("Can't load PNM image")); } @@ -243,7 +243,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_LIBTIFF image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.tif"), wxBITMAP_TYPE_TIF ) ) + if ( !image.LoadFile( dir + wxT("horse.tif"), wxBITMAP_TYPE_TIF ) ) { wxLogError(wxT("Can't load TIFF image")); } @@ -256,7 +256,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, #if wxUSE_LIBTIFF image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.tga"), wxBITMAP_TYPE_TGA ) ) + if ( !image.LoadFile( dir + wxT("horse.tga"), wxBITMAP_TYPE_TGA ) ) { wxLogError(wxT("Can't load TGA image")); } @@ -273,12 +273,12 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, // demonstrates XPM automatically using the mask when saving if ( m_bmpSmileXpm.Ok() ) - m_bmpSmileXpm.SaveFile(_T("saved.xpm"), wxBITMAP_TYPE_XPM); + m_bmpSmileXpm.SaveFile(wxT("saved.xpm"), wxBITMAP_TYPE_XPM); #if wxUSE_ICO_CUR image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 0 ) ) + if ( !image.LoadFile( dir + wxT("horse.ico"), wxBITMAP_TYPE_ICO, 0 ) ) { wxLogError(wxT("Can't load first ICO image")); } @@ -289,7 +289,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 1 ) ) + if ( !image.LoadFile( dir + wxT("horse.ico"), wxBITMAP_TYPE_ICO, 1 ) ) { wxLogError(wxT("Can't load second ICO image")); } @@ -300,7 +300,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.ico") ) ) + if ( !image.LoadFile( dir + wxT("horse.ico") ) ) { wxLogError(wxT("Can't load best ICO image")); } @@ -311,7 +311,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); - if ( !image.LoadFile( dir + _T("horse.cur"), wxBITMAP_TYPE_CUR ) ) + if ( !image.LoadFile( dir + wxT("horse.cur"), wxBITMAP_TYPE_CUR ) ) { wxLogError(wxT("Can't load best ICO image")); } @@ -322,7 +322,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, yH = 2420 + image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ; } - m_ani_images = wxImage::GetImageCount ( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI ); + m_ani_images = wxImage::GetImageCount ( dir + wxT("horse3.ani"), wxBITMAP_TYPE_ANI ); if (m_ani_images==0) { wxLogError(wxT("No ANI-format images found")); @@ -336,7 +336,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, for (i=0; i < m_ani_images; i++) { image.Destroy(); - if (!image.LoadFile( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI, i )) + if (!image.LoadFile( dir + wxT("horse3.ani"), wxBITMAP_TYPE_ANI, i )) { wxString tmp = wxT("Can't load image number "); tmp << i ; @@ -351,7 +351,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, image.Destroy(); // test image loading from stream - wxFile file(dir + _T("horse.bmp")); + wxFile file(dir + wxT("horse.bmp")); if ( file.IsOpened() ) { wxFileOffset len = file.Length(); @@ -359,7 +359,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, void *data = malloc(dataSize); if ( file.Read(data, dataSize) != len ) { - wxLogError(_T("Reading bitmap file failed")); + wxLogError(wxT("Reading bitmap file failed")); } else { @@ -388,11 +388,11 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxPaintDC dc( this ); PrepareDC( dc ); - dc.DrawText( _T("Loaded image"), 30, 10 ); + dc.DrawText( wxT("Loaded image"), 30, 10 ); if (my_square.Ok()) dc.DrawBitmap( my_square, 30, 30 ); - dc.DrawText( _T("Drawn directly"), 150, 10 ); + dc.DrawText( wxT("Drawn directly"), 150, 10 ); dc.SetBrush( wxBrush( wxT("orange"), wxSOLID ) ); dc.SetPen( *wxBLACK_PEN ); dc.DrawRectangle( 150, 30, 100, 100 ); @@ -402,65 +402,65 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) if (my_anti.Ok()) dc.DrawBitmap( my_anti, 280, 30 ); - dc.DrawText( _T("PNG handler"), 30, 135 ); + dc.DrawText( wxT("PNG handler"), 30, 135 ); if (my_horse_png.Ok()) { dc.DrawBitmap( my_horse_png, 30, 150 ); wxRect rect(0,0,100,100); wxBitmap sub( my_horse_png.GetSubBitmap(rect) ); - dc.DrawText( _T("GetSubBitmap()"), 280, 175 ); + dc.DrawText( wxT("GetSubBitmap()"), 280, 175 ); dc.DrawBitmap( sub, 280, 195 ); } - dc.DrawText( _T("JPEG handler"), 30, 365 ); + dc.DrawText( wxT("JPEG handler"), 30, 365 ); if (my_horse_jpeg.Ok()) dc.DrawBitmap( my_horse_jpeg, 30, 380 ); - dc.DrawText( _T("Green rotated to red"), 280, 365 ); + dc.DrawText( wxT("Green rotated to red"), 280, 365 ); if (colorized_horse_jpeg.Ok()) dc.DrawBitmap( colorized_horse_jpeg, 280, 380 ); - dc.DrawText( _T("CMYK JPEG image"), 530, 365 ); + dc.DrawText( wxT("CMYK JPEG image"), 530, 365 ); if (my_cmyk_jpeg.Ok()) dc.DrawBitmap( my_cmyk_jpeg, 530, 380 ); - dc.DrawText( _T("GIF handler"), 30, 595 ); + dc.DrawText( wxT("GIF handler"), 30, 595 ); if (my_horse_gif.Ok()) dc.DrawBitmap( my_horse_gif, 30, 610 ); - dc.DrawText( _T("PCX handler"), 30, 825 ); + dc.DrawText( wxT("PCX handler"), 30, 825 ); if (my_horse_pcx.Ok()) dc.DrawBitmap( my_horse_pcx, 30, 840 ); - dc.DrawText( _T("BMP handler"), 30, 1055 ); + dc.DrawText( wxT("BMP handler"), 30, 1055 ); if (my_horse_bmp.Ok()) dc.DrawBitmap( my_horse_bmp, 30, 1070 ); - dc.DrawText( _T("BMP read from memory"), 280, 1055 ); + dc.DrawText( wxT("BMP read from memory"), 280, 1055 ); if (my_horse_bmp2.Ok()) dc.DrawBitmap( my_horse_bmp2, 280, 1070 ); - dc.DrawText( _T("PNM handler"), 30, 1285 ); + dc.DrawText( wxT("PNM handler"), 30, 1285 ); if (my_horse_pnm.Ok()) dc.DrawBitmap( my_horse_pnm, 30, 1300 ); - dc.DrawText( _T("PNM handler (ascii grey)"), 280, 1285 ); + dc.DrawText( wxT("PNM handler (ascii grey)"), 280, 1285 ); if (my_horse_asciigrey_pnm.Ok()) dc.DrawBitmap( my_horse_asciigrey_pnm, 280, 1300 ); - dc.DrawText( _T("PNM handler (raw grey)"), 530, 1285 ); + dc.DrawText( wxT("PNM handler (raw grey)"), 530, 1285 ); if (my_horse_rawgrey_pnm.Ok()) dc.DrawBitmap( my_horse_rawgrey_pnm, 530, 1300 ); - dc.DrawText( _T("TIFF handler"), 30, 1515 ); + dc.DrawText( wxT("TIFF handler"), 30, 1515 ); if (my_horse_tiff.Ok()) dc.DrawBitmap( my_horse_tiff, 30, 1530 ); - dc.DrawText( _T("TGA handler"), 30, 1745 ); + dc.DrawText( wxT("TGA handler"), 30, 1745 ); if (my_horse_tga.Ok()) dc.DrawBitmap( my_horse_tga, 30, 1760 ); - dc.DrawText( _T("XPM handler"), 30, 1975 ); + dc.DrawText( wxT("XPM handler"), 30, 1975 ); if (my_horse_xpm.Ok()) dc.DrawBitmap( my_horse_xpm, 30, 2000 ); @@ -505,15 +505,15 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) { int x = 300, y = 1800; - dc.DrawText( _T("XBM bitmap"), x, y ); - dc.DrawText( _T("(green on red)"), x, y + 15 ); - dc.SetTextForeground( _T("GREEN") ); - dc.SetTextBackground( _T("RED") ); + dc.DrawText( wxT("XBM bitmap"), x, y ); + dc.DrawText( wxT("(green on red)"), x, y + 15 ); + dc.SetTextForeground( wxT("GREEN") ); + dc.SetTextBackground( wxT("RED") ); dc.DrawBitmap( my_smile_xbm, x, y + 30 ); dc.SetTextForeground( *wxBLACK ); - dc.DrawText( _T("After wxImage conversion"), x + 120, y ); - dc.DrawText( _T("(red on white)"), x + 120, y + 15 ); + dc.DrawText( wxT("After wxImage conversion"), x + 120, y ); + dc.DrawText( wxT("(red on white)"), x + 120, y + 15 ); dc.SetTextForeground( wxT("RED") ); wxImage i = my_smile_xbm.ConvertToImage(); i.SetMaskColour( 255, 255, 255 ); @@ -535,7 +535,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) memdc.SetTextForeground( *wxBLACK ); #ifndef __WXGTK20__ // I cannot convince GTK2 to draw into mono bitmaps - memdc.DrawText( _T("Hi!"), 5, 5 ); + memdc.DrawText( wxT("Hi!"), 5, 5 ); #endif memdc.SetBrush( *wxBLACK_BRUSH ); memdc.DrawRectangle( 33,5,20,20 ); @@ -547,15 +547,15 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) { int x = 300, y = 1900; - dc.DrawText( _T("Mono bitmap"), x, y ); - dc.DrawText( _T("(red on green)"), x, y + 15 ); + dc.DrawText( wxT("Mono bitmap"), x, y ); + dc.DrawText( wxT("(red on green)"), x, y + 15 ); dc.SetTextForeground( wxT("RED") ); dc.SetTextBackground( wxT("GREEN") ); dc.DrawBitmap( mono, x, y + 30 ); dc.SetTextForeground( *wxBLACK ); - dc.DrawText( _T("After wxImage conversion"), x + 120, y ); - dc.DrawText( _T("(red on white)"), x + 120, y + 15 ); + dc.DrawText( wxT("After wxImage conversion"), x + 120, y ); + dc.DrawText( wxT("(red on white)"), x + 120, y + 15 ); dc.SetTextForeground( wxT("RED") ); wxImage i = mono.ConvertToImage(); i.SetMaskColour( 255,255,255 ); @@ -571,11 +571,11 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.SetBrush( *wxRED_BRUSH ); dc.DrawRectangle( 20, 2220, 560, 68 ); - dc.DrawText(_T("XPM bitmap"), 30, 2230 ); + dc.DrawText(wxT("XPM bitmap"), 30, 2230 ); if ( m_bmpSmileXpm.Ok() ) dc.DrawBitmap(m_bmpSmileXpm, 30, 2250, true); - dc.DrawText(_T("XPM icon"), 110, 2230 ); + dc.DrawText(wxT("XPM icon"), 110, 2230 ); if ( m_iconSmileXpm.Ok() ) dc.DrawIcon(m_iconSmileXpm, 110, 2250); @@ -583,19 +583,19 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) wxBitmap to_blit( m_iconSmileXpm ); if (to_blit.Ok()) { - dc.DrawText( _T("SubBitmap"), 170, 2230 ); + dc.DrawText( wxT("SubBitmap"), 170, 2230 ); wxBitmap sub = to_blit.GetSubBitmap( wxRect(0,0,15,15) ); if (sub.Ok()) dc.DrawBitmap( sub, 170, 2250, true ); - dc.DrawText( _T("Enlarged"), 250, 2230 ); + dc.DrawText( wxT("Enlarged"), 250, 2230 ); dc.SetUserScale( 1.5, 1.5 ); dc.DrawBitmap( to_blit, (int)(250/1.5), (int)(2250/1.5), true ); dc.SetUserScale( 2, 2 ); dc.DrawBitmap( to_blit, (int)(300/2), (int)(2250/2), true ); dc.SetUserScale( 1.0, 1.0 ); - dc.DrawText( _T("Blit"), 400, 2230); + dc.DrawText( wxT("Blit"), 400, 2230); wxMemoryDC blit_dc; blit_dc.SelectObject( to_blit ); dc.Blit( 400, 2250, to_blit.GetWidth(), to_blit.GetHeight(), &blit_dc, 0, 0, wxCOPY, true ); @@ -606,19 +606,19 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.SetUserScale( 1.0, 1.0 ); } - dc.DrawText( _T("ICO handler (1st image)"), 30, 2290 ); + dc.DrawText( wxT("ICO handler (1st image)"), 30, 2290 ); if (my_horse_ico32.Ok()) dc.DrawBitmap( my_horse_ico32, 30, 2330, true ); - dc.DrawText( _T("ICO handler (2nd image)"), 230, 2290 ); + dc.DrawText( wxT("ICO handler (2nd image)"), 230, 2290 ); if (my_horse_ico16.Ok()) dc.DrawBitmap( my_horse_ico16, 230, 2330, true ); - dc.DrawText( _T("ICO handler (best image)"), 430, 2290 ); + dc.DrawText( wxT("ICO handler (best image)"), 430, 2290 ); if (my_horse_ico.Ok()) dc.DrawBitmap( my_horse_ico, 430, 2330, true ); - dc.DrawText( _T("CUR handler"), 30, 2390 ); + dc.DrawText( wxT("CUR handler"), 30, 2390 ); if (my_horse_cur.Ok()) { dc.DrawBitmap( my_horse_cur, 30, 2420, true ); @@ -627,7 +627,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) ) dc.DrawLine (xH,yH-10,xH,yH+10); } - dc.DrawText( _T("ANI handler"), 230, 2390 ); + dc.DrawText( wxT("ANI handler"), 230, 2390 ); for ( int i=0; i < m_ani_images; i++ ) { if (my_horse_ani[i].Ok()) @@ -649,8 +649,8 @@ void MyCanvas::CreateAntiAliasedBitmap() dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL) ); dc.SetTextForeground( wxT("RED") ); - dc.DrawText( _T("This is anti-aliased Text."), 20, 5 ); - dc.DrawText( _T("And a Rectangle."), 20, 45 ); + dc.DrawText( wxT("This is anti-aliased Text."), 20, 5 ); + dc.DrawText( wxT("And a Rectangle."), 20, 45 ); dc.SetBrush( *wxRED_BRUSH ); dc.SetPen( *wxTRANSPARENT_PEN ); diff --git a/samples/image/image.cpp b/samples/image/image.cpp index 0466355e71..f42aca9f04 100644 --- a/samples/image/image.cpp +++ b/samples/image/image.cpp @@ -135,7 +135,7 @@ private: int numImages = 1) { if ( !wxFrame::Create(parent, wxID_ANY, - wxString::Format(_T("Image from %s"), desc), + wxString::Format(wxT("Image from %s"), desc), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxFULL_REPAINT_ON_RESIZE) ) return false; @@ -146,19 +146,19 @@ private: wxMenu *menu = new wxMenu; menu->Append(wxID_SAVE); menu->AppendSeparator(); - menu->AppendCheckItem(ID_PAINT_BG, _T("&Paint background"), + menu->AppendCheckItem(ID_PAINT_BG, wxT("&Paint background"), "Uncheck this for transparent images"); menu->AppendSeparator(); - menu->Append(ID_RESIZE, _T("&Fit to window\tCtrl-F")); + menu->Append(ID_RESIZE, wxT("&Fit to window\tCtrl-F")); menu->Append(wxID_ZOOM_IN, "Zoom &in\tCtrl-+"); menu->Append(wxID_ZOOM_OUT, "Zoom &out\tCtrl--"); menu->Append(wxID_ZOOM_100, "Reset zoom to &100%\tCtrl-1"); menu->AppendSeparator(); - menu->Append(ID_ROTATE_LEFT, _T("Rotate &left\tCtrl-L")); - menu->Append(ID_ROTATE_RIGHT, _T("Rotate &right\tCtrl-R")); + menu->Append(ID_ROTATE_LEFT, wxT("Rotate &left\tCtrl-L")); + menu->Append(ID_ROTATE_RIGHT, wxT("Rotate &right\tCtrl-R")); wxMenuBar *mbar = new wxMenuBar; - mbar->Append(menu, _T("&Image")); + mbar->Append(menu, wxT("&Image")); SetMenuBar(mbar); mbar->Check(ID_PAINT_BG, true); @@ -227,7 +227,7 @@ private: wxFileName::SplitPath(savefilename, NULL, NULL, &extension); bool saved = false; - if ( extension == _T("bmp") ) + if ( extension == wxT("bmp") ) { static const int bppvalues[] = { @@ -243,18 +243,18 @@ private: const wxString bppchoices[] = { - _T("1 bpp color"), - _T("1 bpp B&W"), - _T("4 bpp color"), - _T("8 bpp color"), - _T("8 bpp greyscale"), - _T("8 bpp red"), - _T("8 bpp own palette"), - _T("24 bpp") + wxT("1 bpp color"), + wxT("1 bpp B&W"), + wxT("4 bpp color"), + wxT("8 bpp color"), + wxT("8 bpp greyscale"), + wxT("8 bpp red"), + wxT("8 bpp own palette"), + wxT("24 bpp") }; - int bppselection = wxGetSingleChoiceIndex(_T("Set BMP BPP"), - _T("Image sample: save file"), + int bppselection = wxGetSingleChoiceIndex(wxT("Set BMP BPP"), + wxT("Image sample: save file"), WXSIZEOF(bppchoices), bppchoices, this); @@ -274,7 +274,7 @@ private: } } } - else if ( extension == _T("png") ) + else if ( extension == wxT("png") ) { static const int pngvalues[] = { @@ -288,16 +288,16 @@ private: const wxString pngchoices[] = { - _T("Colour 8bpp"), - _T("Colour 16bpp"), - _T("Grey 8bpp"), - _T("Grey 16bpp"), - _T("Grey red 8bpp"), - _T("Grey red 16bpp"), + wxT("Colour 8bpp"), + wxT("Colour 16bpp"), + wxT("Grey 8bpp"), + wxT("Grey 16bpp"), + wxT("Grey red 8bpp"), + wxT("Grey red 16bpp"), }; - int sel = wxGetSingleChoiceIndex(_T("Set PNG format"), - _T("Image sample: save file"), + int sel = wxGetSingleChoiceIndex(wxT("Set PNG format"), + wxT("Image sample: save file"), WXSIZEOF(pngchoices), pngchoices, this); @@ -309,22 +309,22 @@ private: // these values are taken from OptiPNG with -o3 switch const wxString compressionChoices[] = { - _T("compression = 9, memory = 8, strategy = 0, filter = 0"), - _T("compression = 9, memory = 9, strategy = 0, filter = 0"), - _T("compression = 9, memory = 8, strategy = 1, filter = 0"), - _T("compression = 9, memory = 9, strategy = 1, filter = 0"), - _T("compression = 1, memory = 8, strategy = 2, filter = 0"), - _T("compression = 1, memory = 9, strategy = 2, filter = 0"), - _T("compression = 9, memory = 8, strategy = 0, filter = 5"), - _T("compression = 9, memory = 9, strategy = 0, filter = 5"), - _T("compression = 9, memory = 8, strategy = 1, filter = 5"), - _T("compression = 9, memory = 9, strategy = 1, filter = 5"), - _T("compression = 1, memory = 8, strategy = 2, filter = 5"), - _T("compression = 1, memory = 9, strategy = 2, filter = 5"), + wxT("compression = 9, memory = 8, strategy = 0, filter = 0"), + wxT("compression = 9, memory = 9, strategy = 0, filter = 0"), + wxT("compression = 9, memory = 8, strategy = 1, filter = 0"), + wxT("compression = 9, memory = 9, strategy = 1, filter = 0"), + wxT("compression = 1, memory = 8, strategy = 2, filter = 0"), + wxT("compression = 1, memory = 9, strategy = 2, filter = 0"), + wxT("compression = 9, memory = 8, strategy = 0, filter = 5"), + wxT("compression = 9, memory = 9, strategy = 0, filter = 5"), + wxT("compression = 9, memory = 8, strategy = 1, filter = 5"), + wxT("compression = 9, memory = 9, strategy = 1, filter = 5"), + wxT("compression = 1, memory = 8, strategy = 2, filter = 5"), + wxT("compression = 1, memory = 9, strategy = 2, filter = 5"), }; - int sel = wxGetSingleChoiceIndex(_T("Select compression option (Cancel to use default)\n"), - _T("PNG Compression Options"), + int sel = wxGetSingleChoiceIndex(wxT("Select compression option (Cancel to use default)\n"), + wxT("PNG Compression Options"), WXSIZEOF(compressionChoices), compressionChoices, this); @@ -344,7 +344,7 @@ private: } } } - else if ( extension == _T("cur") ) + else if ( extension == wxT("cur") ) { image.Rescale(32,32); image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, 0); @@ -396,7 +396,7 @@ private: img = img.Rotate(angle, wxPoint(img.GetWidth() / 2, img.GetHeight() / 2)); if ( !img.Ok() ) { - wxLogWarning(_T("Rotation failed")); + wxLogWarning(wxT("Rotation failed")); return; } @@ -407,7 +407,7 @@ private: void UpdateStatusBar() { - wxLogStatus(this, _T("Image size: (%d, %d), zoom %.2f"), + wxLogStatus(this, wxT("Image size: (%d, %d), zoom %.2f"), m_bitmap.GetWidth(), m_bitmap.GetHeight(), m_zoom); @@ -435,7 +435,7 @@ public: }; MyRawBitmapFrame(wxFrame *parent) - : wxFrame(parent, wxID_ANY, _T("Raw bitmaps (how exciting)")), + : wxFrame(parent, wxID_ANY, wxT("Raw bitmaps (how exciting)")), m_bitmap(SIZE, SIZE, 24), m_alphaBitmap(SIZE, SIZE, 32) { @@ -453,7 +453,7 @@ public: wxAlphaPixelData data( m_alphaBitmap, wxPoint(0,0), wxSize(SIZE, SIZE) ); if ( !data ) { - wxLogError(_T("Failed to gain raw access to bitmap data")); + wxLogError(wxT("Failed to gain raw access to bitmap data")); return; } wxAlphaPixelData::Iterator p(data); @@ -475,7 +475,7 @@ public: wxSize(REAL_SIZE, REAL_SIZE)); if ( !data ) { - wxLogError(_T("Failed to gain raw access to bitmap data")); + wxLogError(wxT("Failed to gain raw access to bitmap data")); return; } @@ -512,7 +512,7 @@ public: wxNativePixelData data(m_bitmap); if ( !data ) { - wxLogError(_T("Failed to gain raw access to bitmap data")); + wxLogError(wxT("Failed to gain raw access to bitmap data")); return; } @@ -541,12 +541,12 @@ public: void OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc( this ); - dc.DrawText(_T("This is alpha and raw bitmap test"), 0, BORDER); - dc.DrawText(_T("This is alpha and raw bitmap test"), 0, SIZE/2 - BORDER); - dc.DrawText(_T("This is alpha and raw bitmap test"), 0, SIZE - 2*BORDER); + dc.DrawText(wxT("This is alpha and raw bitmap test"), 0, BORDER); + dc.DrawText(wxT("This is alpha and raw bitmap test"), 0, SIZE/2 - BORDER); + dc.DrawText(wxT("This is alpha and raw bitmap test"), 0, SIZE - 2*BORDER); dc.DrawBitmap( m_alphaBitmap, 0, 0, true /* use mask */ ); - dc.DrawText(_T("Raw bitmap access without alpha"), 0, SIZE+5); + dc.DrawText(wxT("Raw bitmap access without alpha"), 0, SIZE+5); dc.DrawBitmap( m_bitmap, 0, SIZE+5+dc.GetCharHeight()); } @@ -624,7 +624,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE() MyFrame::MyFrame() - : wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxImage sample"), + : wxFrame( (wxFrame *)NULL, wxID_ANY, wxT("wxImage sample"), wxPoint(20, 20), wxSize(950, 700) ) { SetIcon(wxICON(sample)); @@ -632,26 +632,26 @@ MyFrame::MyFrame() wxMenuBar *menu_bar = new wxMenuBar(); wxMenu *menuImage = new wxMenu; - menuImage->Append( ID_NEW, _T("&Show any image...\tCtrl-O")); - menuImage->Append( ID_INFO, _T("Show image &information...\tCtrl-I")); + menuImage->Append( ID_NEW, wxT("&Show any image...\tCtrl-O")); + menuImage->Append( ID_INFO, wxT("Show image &information...\tCtrl-I")); #ifdef wxHAVE_RAW_BITMAP menuImage->AppendSeparator(); - menuImage->Append( ID_SHOWRAW, _T("Test &raw bitmap...\tCtrl-R")); + menuImage->Append( ID_SHOWRAW, wxT("Test &raw bitmap...\tCtrl-R")); #endif menuImage->AppendSeparator(); - menuImage->Append( ID_SHOWTHUMBNAIL, _T("Test &thumbnail...\tCtrl-T"), + menuImage->Append( ID_SHOWTHUMBNAIL, wxT("Test &thumbnail...\tCtrl-T"), "Test scaling the image during load (try with JPEG)"); menuImage->AppendSeparator(); - menuImage->Append( ID_ABOUT, _T("&About...")); + menuImage->Append( ID_ABOUT, wxT("&About...")); menuImage->AppendSeparator(); - menuImage->Append( ID_QUIT, _T("E&xit\tCtrl-Q")); - menu_bar->Append(menuImage, _T("&Image")); + menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q")); + menu_bar->Append(menuImage, wxT("&Image")); #if wxUSE_CLIPBOARD wxMenu *menuClipboard = new wxMenu; - menuClipboard->Append(wxID_COPY, _T("&Copy test image\tCtrl-C")); - menuClipboard->Append(wxID_PASTE, _T("&Paste image\tCtrl-V")); - menu_bar->Append(menuClipboard, _T("&Clipboard")); + menuClipboard->Append(wxID_COPY, wxT("&Copy test image\tCtrl-C")); + menuClipboard->Append(wxID_PASTE, wxT("&Paste image\tCtrl-V")); + menu_bar->Append(menuClipboard, wxT("&Clipboard")); #endif // wxUSE_CLIPBOARD SetMenuBar( menu_bar ); @@ -687,12 +687,12 @@ wxString MyFrame::LoadUserImage(wxImage& image) wxString filename; #if wxUSE_FILEDLG - filename = wxLoadFileSelector(_T("image"), wxEmptyString); + filename = wxLoadFileSelector(wxT("image"), wxEmptyString); if ( !filename.empty() ) { if ( !image.LoadFile(filename) ) { - wxLogError(_T("Couldn't load image from '%s'."), filename.c_str()); + wxLogError(wxT("Couldn't load image from '%s'."), filename.c_str()); return wxEmptyString; } @@ -769,7 +769,7 @@ void MyFrame::OnCopy(wxCommandEvent& WXUNUSED(event)) if ( !wxTheClipboard->SetData(dobjBmp) ) { - wxLogError(_T("Failed to copy bitmap to clipboard")); + wxLogError(wxT("Failed to copy bitmap to clipboard")); } wxTheClipboard->Close(); @@ -782,11 +782,11 @@ void MyFrame::OnPaste(wxCommandEvent& WXUNUSED(event)) wxTheClipboard->Open(); if ( !wxTheClipboard->GetData(dobjBmp) ) { - wxLogMessage(_T("No bitmap data in the clipboard")); + wxLogMessage(wxT("No bitmap data in the clipboard")); } else { - new MyImageFrame(this, _T("Clipboard"), dobjBmp.GetBitmap()); + new MyImageFrame(this, wxT("Clipboard"), dobjBmp.GetBitmap()); } wxTheClipboard->Close(); } @@ -796,7 +796,7 @@ void MyFrame::OnPaste(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) ) { #if wxUSE_FILEDLG - wxString filename = wxLoadFileSelector(_T("image"), wxEmptyString, wxEmptyString, this); + wxString filename = wxLoadFileSelector(wxT("image"), wxEmptyString, wxEmptyString, this); if ( filename.empty() ) return; @@ -810,7 +810,7 @@ void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) ) wxStopWatch sw; if ( !image.LoadFile(filename) ) { - wxLogError(_T("Couldn't load image from '%s'."), filename.c_str()); + wxLogError(wxT("Couldn't load image from '%s'."), filename.c_str()); return; } @@ -819,7 +819,7 @@ void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) ) MyImageFrame * const frame = new MyImageFrame(this, filename, image); wxLogStatus(frame, "Loaded \"%s\" in %ldms", filename, loadTime); #else - wxLogError( _T("Couldn't create file selector dialog") ); + wxLogError( wxT("Couldn't create file selector dialog") ); return; #endif // wxUSE_FILEDLG } diff --git a/samples/internat/internat.cpp b/samples/internat/internat.cpp index 421ef38ee3..7a5c5b65a3 100644 --- a/samples/internat/internat.cpp +++ b/samples/internat/internat.cpp @@ -376,9 +376,9 @@ void MyFrame::OnPlay(wxCommandEvent& WXUNUSED(event)) } else if ( num == 9 ) { - // this message is not translated (not in catalog) because we used _T() + // this message is not translated (not in catalog) because we used wxT() // and not _() around it - str = _T("You've found a bug in this program!"); + str = wxT("You've found a bug in this program!"); } else if ( num == 17 ) { diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index 326e359365..36c9d4552d 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -80,7 +80,7 @@ bool MyApp::OnInit() return false; // Create the main frame window - m_frame = new MyFrame(NULL, _T("Client")); + m_frame = new MyFrame(NULL, wxT("Client")); m_frame->Show(true); return true; @@ -102,11 +102,11 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title) // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(wxID_EXIT, _T("&Quit\tCtrl-Q")); + file_menu->Append(wxID_EXIT, wxT("&Quit\tCtrl-Q")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); // Associate the menu bar with the frame SetMenuBar(menu_bar); @@ -117,15 +117,15 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title) // add the controls to the frame wxString strs4[] = { - IPC_SERVICE, _T("...") + IPC_SERVICE, wxT("...") }; wxString strs5[] = { - IPC_HOST, _T("...") + IPC_HOST, wxT("...") }; wxString strs6[] = { - IPC_TOPIC, _T("...") + IPC_TOPIC, wxT("...") }; wxBoxSizer *item0 = new wxBoxSizer( wxVERTICAL ); @@ -210,7 +210,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title) GetTopic()->SetSelection(0); wxLogTextCtrl *logWindow = new wxLogTextCtrl(GetLog()); delete wxLog::SetActiveTarget(logWindow); - wxLogMessage(_T("Click on Connect to connect to the server")); + wxLogMessage(wxT("Click on Connect to connect to the server")); EnableControls(); } @@ -255,9 +255,9 @@ void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event)) m_client = new MyClient; bool retval = m_client->Connect(hostname, servername, topic); - wxLogMessage(_T("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s"), + wxLogMessage(wxT("Client host=\"%s\" port=\"%s\" topic=\"%s\" %s"), hostname.c_str(), servername.c_str(), topic.c_str(), - retval ? _T("connected") : _T("failed to connect")); + retval ? wxT("connected") : wxT("failed to connect")); if (!retval) { @@ -269,10 +269,10 @@ void MyFrame::OnStart(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnServername( wxCommandEvent& WXUNUSED(event) ) { - if (GetServername()->GetStringSelection() == _T("...")) + if (GetServername()->GetStringSelection() == wxT("...")) { - wxString s = wxGetTextFromUser(_T("Specify the name of the server"), - _T("Server Name"), wxEmptyString, this); + wxString s = wxGetTextFromUser(wxT("Specify the name of the server"), + wxT("Server Name"), wxEmptyString, this); if (!s.IsEmpty() && s != IPC_SERVICE) { GetServername()->Insert(s, 0); @@ -283,10 +283,10 @@ void MyFrame::OnServername( wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnHostname( wxCommandEvent& WXUNUSED(event) ) { - if (GetHostname()->GetStringSelection() == _T("...")) + if (GetHostname()->GetStringSelection() == wxT("...")) { - wxString s = wxGetTextFromUser(_T("Specify the name of the host (ignored under DDE)"), - _T("Host Name"), wxEmptyString, this); + wxString s = wxGetTextFromUser(wxT("Specify the name of the host (ignored under DDE)"), + wxT("Host Name"), wxEmptyString, this); if (!s.IsEmpty() && s != IPC_HOST) { GetHostname()->Insert(s, 0); @@ -297,10 +297,10 @@ void MyFrame::OnHostname( wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnTopic( wxCommandEvent& WXUNUSED(event) ) { - if (GetTopic()->GetStringSelection() == _T("...")) + if (GetTopic()->GetStringSelection() == wxT("...")) { - wxString s = wxGetTextFromUser(_T("Specify the name of the topic"), - _T("Topic Name"), wxEmptyString, this); + wxString s = wxGetTextFromUser(wxT("Specify the name of the topic"), + wxT("Topic Name"), wxEmptyString, this); if (!s.IsEmpty() && s != IPC_TOPIC) { GetTopic()->Insert(s, 0); @@ -323,19 +323,19 @@ void MyFrame::Disconnect() void MyFrame::OnStartAdvise(wxCommandEvent& WXUNUSED(event)) { - m_client->GetConnection()->StartAdvise(_T("something")); + m_client->GetConnection()->StartAdvise(wxT("something")); } void MyFrame::OnStopAdvise(wxCommandEvent& WXUNUSED(event)) { - m_client->GetConnection()->StopAdvise(_T("something")); + m_client->GetConnection()->StopAdvise(wxT("something")); } void MyFrame::OnExecute(wxCommandEvent& WXUNUSED(event)) { if (m_client->IsConnected()) { - wxString s = _T("Date"); + wxString s = wxT("Date"); m_client->GetConnection()->Execute(s); m_client->GetConnection()->Execute((const char *)s.c_str(), s.length() + 1); @@ -352,12 +352,12 @@ void MyFrame::OnPoke(wxCommandEvent& WXUNUSED(event)) if (m_client->IsConnected()) { wxString s = wxDateTime::Now().Format(); - m_client->GetConnection()->Poke(_T("Date"), s); - s = wxDateTime::Now().FormatTime() + _T(" ") + wxDateTime::Now().FormatDate(); - m_client->GetConnection()->Poke(_T("Date"), (const char *)s.c_str(), s.length() + 1); + m_client->GetConnection()->Poke(wxT("Date"), s); + s = wxDateTime::Now().FormatTime() + wxT(" ") + wxDateTime::Now().FormatDate(); + m_client->GetConnection()->Poke(wxT("Date"), (const char *)s.c_str(), s.length() + 1); char bytes[3]; bytes[0] = '1'; bytes[1] = '2'; bytes[2] = '3'; - m_client->GetConnection()->Poke(_T("bytes[3]"), bytes, 3, wxIPC_PRIVATE); + m_client->GetConnection()->Poke(wxT("bytes[3]"), bytes, 3, wxIPC_PRIVATE); } } @@ -366,9 +366,9 @@ void MyFrame::OnRequest(wxCommandEvent& WXUNUSED(event)) if (m_client->IsConnected()) { size_t size; - m_client->GetConnection()->Request(_T("Date")); - m_client->GetConnection()->Request(_T("Date+len"), &size); - m_client->GetConnection()->Request(_T("bytes[3]"), &size, wxIPC_PRIVATE); + m_client->GetConnection()->Request(wxT("Date")); + m_client->GetConnection()->Request(wxT("Date+len"), &size); + m_client->GetConnection()->Request(wxT("bytes[3]"), &size, wxIPC_PRIVATE); } } @@ -402,7 +402,7 @@ void MyClient::Disconnect() delete m_connection; m_connection = NULL; wxGetApp().GetFrame()->EnableControls(); - wxLogMessage(_T("Client disconnected from server")); + wxLogMessage(wxT("Client disconnected from server")); } } @@ -418,24 +418,24 @@ MyClient::~MyClient() bool MyConnection::OnAdvise(const wxString& topic, const wxString& item, const void *data, size_t size, wxIPCFormat format) { - Log(_T("OnAdvise"), topic, item, data, size, format); + Log(wxT("OnAdvise"), topic, item, data, size, format); return true; } bool MyConnection::OnDisconnect() { - wxLogMessage(_T("OnDisconnect()")); + wxLogMessage(wxT("OnDisconnect()")); wxGetApp().GetFrame()->Disconnect(); return true; } bool MyConnection::DoExecute(const void *data, size_t size, wxIPCFormat format) { - Log(_T("Execute"), wxEmptyString, wxEmptyString, data, size, format); + Log(wxT("Execute"), wxEmptyString, wxEmptyString, data, size, format); bool retval = wxConnection::DoExecute(data, size, format); if (!retval) { - wxLogMessage(_T("Execute failed!")); + wxLogMessage(wxT("Execute failed!")); } return retval; } @@ -443,12 +443,12 @@ bool MyConnection::DoExecute(const void *data, size_t size, wxIPCFormat format) const void *MyConnection::Request(const wxString& item, size_t *size, wxIPCFormat format) { const void *data = wxConnection::Request(item, size, format); - Log(_T("Request"), wxEmptyString, item, data, size ? *size : wxNO_LEN, format); + Log(wxT("Request"), wxEmptyString, item, data, size ? *size : wxNO_LEN, format); return data; } bool MyConnection::DoPoke(const wxString& item, const void *data, size_t size, wxIPCFormat format) { - Log(_T("Poke"), wxEmptyString, item, data, size, format); + Log(wxT("Poke"), wxEmptyString, item, data, size, format); return wxConnection::DoPoke(item, data, size, format); } diff --git a/samples/ipc/ipcsetup.h b/samples/ipc/ipcsetup.h index 1dbffab7bf..17fc121318 100644 --- a/samples/ipc/ipcsetup.h +++ b/samples/ipc/ipcsetup.h @@ -16,7 +16,7 @@ // the default service name #define IPC_SERVICE "4242" -//#define IPC_SERVICE _T("/tmp/wxsrv424") +//#define IPC_SERVICE wxT("/tmp/wxsrv424") // the hostname #define IPC_HOST "localhost" diff --git a/samples/joytest/joytest.cpp b/samples/joytest/joytest.cpp index 0da7193b51..2f77ae74c2 100644 --- a/samples/joytest/joytest.cpp +++ b/samples/joytest/joytest.cpp @@ -49,12 +49,12 @@ bool MyApp::OnInit() wxJoystick stick(wxJOYSTICK1); if (!stick.IsOk()) { - wxMessageBox(_T("No joystick detected!")); + wxMessageBox(wxT("No joystick detected!")); return false; } #if wxUSE_SOUND - m_fire.Create(_T("buttonpress.wav")); + m_fire.Create(wxT("buttonpress.wav")); #endif // wxUSE_SOUND m_minX = stick.GetXMin(); @@ -64,25 +64,25 @@ bool MyApp::OnInit() // Create the main frame window - frame = new MyFrame(NULL, _T("Joystick Demo"), wxDefaultPosition, + frame = new MyFrame(NULL, wxT("Joystick Demo"), wxDefaultPosition, wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL); // Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ - frame->SetIcon(wxIcon(_T("joyicon"))); + frame->SetIcon(wxIcon(wxT("joyicon"))); #endif #ifdef __X__ - frame->SetIcon(wxIcon(_T("joyicon.xbm"))); + frame->SetIcon(wxIcon(wxT("joyicon.xbm"))); #endif // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(JOYTEST_QUIT, _T("&Exit")); + file_menu->Append(JOYTEST_QUIT, wxT("&Exit")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); @@ -158,9 +158,9 @@ void MyCanvas::OnJoystickEvent(wxJoystickEvent& event) #if wxUSE_STATUSBAR wxString buf; if (event.ButtonDown()) - buf.Printf(_T("Joystick (%d, %d) #%i Fire!"), pt.x, pt.y, event.GetButtonChange()); + buf.Printf(wxT("Joystick (%d, %d) #%i Fire!"), pt.x, pt.y, event.GetButtonChange()); else - buf.Printf(_T("Joystick (%d, %d) "), pt.x, pt.y); + buf.Printf(wxT("Joystick (%d, %d) "), pt.x, pt.y); /* for(int i = 0; i < nButtons; ++i) diff --git a/samples/layout/layout.cpp b/samples/layout/layout.cpp index c7d56a3360..41249df292 100644 --- a/samples/layout/layout.cpp +++ b/samples/layout/layout.cpp @@ -77,7 +77,7 @@ END_EVENT_TABLE() // Define my frame constructor MyFrame::MyFrame() - : wxFrame(NULL, wxID_ANY, _T("wxWidgets Layout Demo"), + : wxFrame(NULL, wxID_ANY, wxT("wxWidgets Layout Demo"), wxPoint(30,30), wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) { @@ -86,31 +86,31 @@ MyFrame::MyFrame() // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(LAYOUT_TEST_PROPORTIONS, _T("&Proportions demo...\tF1")); - file_menu->Append(LAYOUT_TEST_SIZER, _T("Test wx&FlexSizer...\tF2")); - file_menu->Append(LAYOUT_TEST_NB_SIZER, _T("Test ¬ebook sizers...\tF3")); - file_menu->Append(LAYOUT_TEST_GB_SIZER, _T("Test &gridbag sizer...\tF4")); - file_menu->Append(LAYOUT_TEST_SET_MINIMAL, _T("Test Set&ItemMinSize...\tF5")); - file_menu->Append(LAYOUT_TEST_NESTED, _T("Test nested sizer in a wxPanel...\tF6")); - file_menu->Append(LAYOUT_TEST_WRAP, _T("Test wrap sizers...\tF7")); + file_menu->Append(LAYOUT_TEST_PROPORTIONS, wxT("&Proportions demo...\tF1")); + file_menu->Append(LAYOUT_TEST_SIZER, wxT("Test wx&FlexSizer...\tF2")); + file_menu->Append(LAYOUT_TEST_NB_SIZER, wxT("Test ¬ebook sizers...\tF3")); + file_menu->Append(LAYOUT_TEST_GB_SIZER, wxT("Test &gridbag sizer...\tF4")); + file_menu->Append(LAYOUT_TEST_SET_MINIMAL, wxT("Test Set&ItemMinSize...\tF5")); + file_menu->Append(LAYOUT_TEST_NESTED, wxT("Test nested sizer in a wxPanel...\tF6")); + file_menu->Append(LAYOUT_TEST_WRAP, wxT("Test wrap sizers...\tF7")); file_menu->AppendSeparator(); - file_menu->Append(LAYOUT_QUIT, _T("E&xit"), _T("Quit program")); + file_menu->Append(LAYOUT_QUIT, wxT("E&xit"), wxT("Quit program")); wxMenu *help_menu = new wxMenu; - help_menu->Append(LAYOUT_ABOUT, _T("&About"), _T("About layout demo...")); + help_menu->Append(LAYOUT_ABOUT, wxT("&About"), wxT("About layout demo...")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); - menu_bar->Append(help_menu, _T("&Help")); + menu_bar->Append(file_menu, wxT("&File")); + menu_bar->Append(help_menu, wxT("&Help")); // Associate the menu bar with the frame SetMenuBar(menu_bar); #if wxUSE_STATUSBAR CreateStatusBar(2); - SetStatusText(_T("wxWidgets layout demo")); + SetStatusText(wxT("wxWidgets layout demo")); #endif // wxUSE_STATUSBAR wxPanel* p = new wxPanel(this, wxID_ANY); @@ -123,25 +123,25 @@ MyFrame::MyFrame() // 1) top: create wxStaticText with minimum size equal to its default size topsizer->Add( - new wxStaticText( p, wxID_ANY, _T("An explanation (wxALIGN_RIGHT).") ), + new wxStaticText( p, wxID_ANY, wxT("An explanation (wxALIGN_RIGHT).") ), wxSizerFlags().Align(wxALIGN_RIGHT).Border(wxALL & ~wxBOTTOM, 5)); topsizer->Add( - new wxStaticText( p, wxID_ANY, _T("An explanation (wxALIGN_LEFT).") ), + new wxStaticText( p, wxID_ANY, wxT("An explanation (wxALIGN_LEFT).") ), wxSizerFlags().Align(wxALIGN_LEFT).Border(wxALL & ~wxBOTTOM, 5)); topsizer->Add( - new wxStaticText( p, wxID_ANY, _T("An explanation (wxALIGN_CENTRE_HORIZONTAL).") ), + new wxStaticText( p, wxID_ANY, wxT("An explanation (wxALIGN_CENTRE_HORIZONTAL).") ), wxSizerFlags().Align(wxALIGN_CENTRE_HORIZONTAL).Border(wxALL & ~wxBOTTOM, 5)); // 2) top: create wxTextCtrl with minimum size (100x60) topsizer->Add( - new wxTextCtrl( p, wxID_ANY, _T("My text (wxEXPAND)."), wxDefaultPosition, wxSize(100,60), wxTE_MULTILINE), + new wxTextCtrl( p, wxID_ANY, wxT("My text (wxEXPAND)."), wxDefaultPosition, wxSize(100,60), wxTE_MULTILINE), wxSizerFlags(1).Expand().Border(wxALL, 5)); // 2.5) Gratuitous test of wxStaticBoxSizers wxBoxSizer *statsizer = new wxStaticBoxSizer( - new wxStaticBox(p, wxID_ANY, _T("A wxStaticBoxSizer")), wxVERTICAL ); + new wxStaticBox(p, wxID_ANY, wxT("A wxStaticBoxSizer")), wxVERTICAL ); statsizer->Add( - new wxStaticText(p, wxID_ANY, _T("And some TEXT inside it")), + new wxStaticText(p, wxID_ANY, wxT("And some TEXT inside it")), wxSizerFlags().Border(wxALL, 30)); topsizer->Add( statsizer, @@ -149,17 +149,17 @@ MyFrame::MyFrame() // 2.7) And a test of wxGridSizer wxGridSizer *gridsizer = new wxGridSizer(2, 5, 5); - gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Label")), + gridsizer->Add(new wxStaticText(p, wxID_ANY, wxT("Label")), wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL)); - gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("Grid sizer demo")), + gridsizer->Add(new wxTextCtrl(p, wxID_ANY, wxT("Grid sizer demo")), wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL)); - gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Another label")), + gridsizer->Add(new wxStaticText(p, wxID_ANY, wxT("Another label")), wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL)); - gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("More text")), + gridsizer->Add(new wxTextCtrl(p, wxID_ANY, wxT("More text")), wxSizerFlags(1).Align(wxGROW | wxALIGN_CENTER_VERTICAL)); - gridsizer->Add(new wxStaticText(p, wxID_ANY, _T("Final label")), + gridsizer->Add(new wxStaticText(p, wxID_ANY, wxT("Final label")), wxSizerFlags().Align(wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL)); - gridsizer->Add(new wxTextCtrl(p, wxID_ANY, _T("And yet more text")), + gridsizer->Add(new wxTextCtrl(p, wxID_ANY, wxT("And yet more text")), wxSizerFlags().Align(wxGROW | wxALIGN_CENTER_VERTICAL)); topsizer->Add( gridsizer, @@ -177,10 +177,10 @@ MyFrame::MyFrame() // 4) bottom: create two centred wxButtons wxBoxSizer *button_box = new wxBoxSizer( wxHORIZONTAL ); button_box->Add( - new wxButton( p, wxID_ANY, _T("Two buttons in a box") ), + new wxButton( p, wxID_ANY, wxT("Two buttons in a box") ), wxSizerFlags().Border(wxALL, 7)); button_box->Add( - new wxButton( p, wxID_ANY, _T("(wxCENTER)") ), + new wxButton( p, wxID_ANY, wxT("(wxCENTER)") ), wxSizerFlags().Border(wxALL, 7)); topsizer->Add(button_box, wxSizerFlags().Center()); @@ -204,46 +204,46 @@ void MyFrame::TestProportions(wxCommandEvent& WXUNUSED(event)) void MyFrame::TestFlexSizers(wxCommandEvent& WXUNUSED(event) ) { - MyFlexSizerFrame *newFrame = new MyFlexSizerFrame(_T("Flex Sizer Test Frame"), 50, 50); + MyFlexSizerFrame *newFrame = new MyFlexSizerFrame(wxT("Flex Sizer Test Frame"), 50, 50); newFrame->Show(true); } void MyFrame::TestNotebookSizers(wxCommandEvent& WXUNUSED(event) ) { - MySizerDialog dialog( this, _T("Notebook Sizer Test Dialog") ); + MySizerDialog dialog( this, wxT("Notebook Sizer Test Dialog") ); dialog.ShowModal(); } void MyFrame::TestSetMinimal(wxCommandEvent& WXUNUSED(event) ) { - MySimpleSizerFrame *newFrame = new MySimpleSizerFrame(_T("Simple Sizer Test Frame"), 50, 50); + MySimpleSizerFrame *newFrame = new MySimpleSizerFrame(wxT("Simple Sizer Test Frame"), 50, 50); newFrame->Show(true); } void MyFrame::TestNested(wxCommandEvent& WXUNUSED(event) ) { - MyNestedSizerFrame *newFrame = new MyNestedSizerFrame(_T("Nested Sizer Test Frame"), 50, 50); + MyNestedSizerFrame *newFrame = new MyNestedSizerFrame(wxT("Nested Sizer Test Frame"), 50, 50); newFrame->Show(true); } void MyFrame::TestWrap(wxCommandEvent& WXUNUSED(event) ) { - MyWrapSizerFrame *newFrame = new MyWrapSizerFrame(_T("Wrap Sizer Test Frame"), 50, 50); + MyWrapSizerFrame *newFrame = new MyWrapSizerFrame(wxT("Wrap Sizer Test Frame"), 50, 50); newFrame->Show(true); } void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) { - (void)wxMessageBox(_T("wxWidgets GUI library layout demo\n"), - _T("About Layout Demo"), wxOK|wxICON_INFORMATION); + (void)wxMessageBox(wxT("wxWidgets GUI library layout demo\n"), + wxT("About Layout Demo"), wxOK|wxICON_INFORMATION); } void MyFrame::TestGridBagSizer(wxCommandEvent& WXUNUSED(event) ) { MyGridBagSizerFrame *newFrame = new - MyGridBagSizerFrame(_T("wxGridBagSizer Test Frame"), 50, 50); + MyGridBagSizerFrame(wxT("wxGridBagSizer Test Frame"), 50, 50); newFrame->Show(true); } @@ -252,7 +252,7 @@ void MyFrame::TestGridBagSizer(wxCommandEvent& WXUNUSED(event) ) // ---------------------------------------------------------------------------- MyProportionsFrame::MyProportionsFrame(wxFrame *parent) - : wxFrame(parent, wxID_ANY, _T("Box Sizer Proportions Demo")) + : wxFrame(parent, wxID_ANY, wxT("Box Sizer Proportions Demo")) { size_t n; @@ -266,7 +266,7 @@ MyProportionsFrame::MyProportionsFrame(wxFrame *parent) // lay them out m_sizer = new wxStaticBoxSizer(wxHORIZONTAL, panel, - _T("Try changing elements proportions and resizing the window")); + wxT("Try changing elements proportions and resizing the window")); for ( n = 0; n < WXSIZEOF(m_spins); n++ ) m_sizer->Add(m_spins[n], wxSizerFlags().Border()); @@ -318,7 +318,7 @@ void MyFlexSizerFrame::InitFlexSizer(wxFlexGridSizer *sizer, wxWindow* parent) ( parent, wxID_ANY, - wxString::Format(_T("(%d, %d)"), i + 1, j + 1), + wxString::Format(wxT("(%d, %d)"), i + 1, j + 1), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER @@ -336,24 +336,24 @@ MyFlexSizerFrame::MyFlexSizerFrame(const wxString &title, int x, int y ) // consttuct the first column wxSizer *sizerCol1 = new wxBoxSizer(wxVERTICAL); - sizerCol1->Add(new wxStaticText(p, wxID_ANY, _T("Ungrowable:")), 0, wxCENTER | wxTOP, 20); + sizerCol1->Add(new wxStaticText(p, wxID_ANY, wxT("Ungrowable:")), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3); InitFlexSizer(sizerFlex, p); sizerCol1->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol1->Add(new wxStaticText(p, wxID_ANY, _T("Growable middle column:")), 0, wxCENTER | wxTOP, 20); + sizerCol1->Add(new wxStaticText(p, wxID_ANY, wxT("Growable middle column:")), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(1); sizerCol1->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol1->Add(new wxStaticText(p, wxID_ANY, _T("Growable middle row:")), 0, wxCENTER | wxTOP, 20); + sizerCol1->Add(new wxStaticText(p, wxID_ANY, wxT("Growable middle row:")), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableRow(1); sizerCol1->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol1->Add(new wxStaticText(p, wxID_ANY, _T("All growable columns:")), 0, wxCENTER | wxTOP, 20); + sizerCol1->Add(new wxStaticText(p, wxID_ANY, wxT("All growable columns:")), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(0, 1); @@ -363,14 +363,14 @@ MyFlexSizerFrame::MyFlexSizerFrame(const wxString &title, int x, int y ) // the second one wxSizer *sizerCol2 = new wxBoxSizer(wxVERTICAL); - sizerCol2->Add(new wxStaticText(p, wxID_ANY, _T("Growable middle row and column:")), 0, wxCENTER | wxTOP, 20); + sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Growable middle row and column:")), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(1); sizerFlex->AddGrowableRow(1); sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol2->Add(new wxStaticText(p, wxID_ANY, _T("Same with horz flex direction")), 0, wxCENTER | wxTOP, 20); + sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with horz flex direction")), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(1); @@ -378,7 +378,7 @@ MyFlexSizerFrame::MyFlexSizerFrame(const wxString &title, int x, int y ) sizerFlex->SetFlexibleDirection(wxHORIZONTAL); sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol2->Add(new wxStaticText(p, wxID_ANY, _T("Same with grow mode == \"none\"")), 0, wxCENTER | wxTOP, 20); + sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"none\"")), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(1); @@ -387,7 +387,7 @@ MyFlexSizerFrame::MyFlexSizerFrame(const wxString &title, int x, int y ) sizerFlex->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_NONE); sizerCol2->Add(sizerFlex, 1, wxALL | wxEXPAND, 10); - sizerCol2->Add(new wxStaticText(p, wxID_ANY, _T("Same with grow mode == \"all\"")), 0, wxCENTER | wxTOP, 20); + sizerCol2->Add(new wxStaticText(p, wxID_ANY, wxT("Same with grow mode == \"all\"")), 0, wxCENTER | wxTOP, 20); sizerFlex = new wxFlexGridSizer(3, 3); InitFlexSizer(sizerFlex, p); sizerFlex->AddGrowableCol(1); @@ -420,24 +420,24 @@ MySizerDialog::MySizerDialog(wxWindow *parent, const wxString &title) wxNotebook *notebook = new wxNotebook( this, wxID_ANY ); topsizer->Add( notebook, 1, wxGROW ); - wxButton *button = new wxButton( this, wxID_OK, _T("OK") ); + wxButton *button = new wxButton( this, wxID_OK, wxT("OK") ); topsizer->Add( button, 0, wxALIGN_RIGHT | wxALL, 10 ); // First page: one big text ctrl - wxTextCtrl *multi = new wxTextCtrl( notebook, wxID_ANY, _T("TextCtrl."), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); - notebook->AddPage( multi, _T("Page One") ); + wxTextCtrl *multi = new wxTextCtrl( notebook, wxID_ANY, wxT("TextCtrl."), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); + notebook->AddPage( multi, wxT("Page One") ); // Second page: a text ctrl and a button wxPanel *panel = new wxPanel( notebook, wxID_ANY ); - notebook->AddPage( panel, _T("Page Two") ); + notebook->AddPage( panel, wxT("Page Two") ); wxSizer *panelsizer = new wxBoxSizer( wxVERTICAL ); - wxTextCtrl *text = new wxTextCtrl( panel, wxID_ANY, _T("TextLine 1."), wxDefaultPosition, wxSize(250,wxDefaultCoord) ); + wxTextCtrl *text = new wxTextCtrl( panel, wxID_ANY, wxT("TextLine 1."), wxDefaultPosition, wxSize(250,wxDefaultCoord) ); panelsizer->Add( text, 0, wxGROW|wxALL, 30 ); - text = new wxTextCtrl( panel, wxID_ANY, _T("TextLine 2."), wxDefaultPosition, wxSize(250,wxDefaultCoord) ); + text = new wxTextCtrl( panel, wxID_ANY, wxT("TextLine 2."), wxDefaultPosition, wxSize(250,wxDefaultCoord) ); panelsizer->Add( text, 0, wxGROW|wxALL, 30 ); - wxButton *button2 = new wxButton( panel, wxID_ANY, _T("Hallo") ); + wxButton *button2 = new wxButton( panel, wxID_ANY, wxT("Hallo") ); panelsizer->Add( button2, 0, wxALIGN_RIGHT | wxLEFT|wxRIGHT|wxBOTTOM, 30 ); panel->SetSizer( panelsizer ); @@ -451,12 +451,12 @@ MySizerDialog::MySizerDialog(wxWindow *parent, const wxString &title) // ---------------------------------------------------------------------------- // some simple macros to help make the sample code below more clear -#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, _T(text)) -#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, _T(text), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE) +#define TEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text)) +#define MLTEXTCTRL(text) new wxTextCtrl(p, wxID_ANY, wxT(text), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE) #define POS(r, c) wxGBPosition(r,c) #define SPAN(r, c) wxGBSpan(r,c) -const wxChar gbsDescription[] =_T("\ +const wxChar gbsDescription[] =wxT("\ The wxGridBagSizer is similar to the wxFlexGridSizer except the items are explicitly positioned\n\ in a virtual cell of the layout grid, and column or row spanning is allowed. For example, this\n\ static text is positioned at (0,0) and it spans 7 columns."); @@ -509,19 +509,19 @@ MyGridBagSizerFrame::MyGridBagSizerFrame(const wxString &title, int x, int y ) //m_gbs->Add( TEXTCTRL("bad position"), POS(5,3) ); // Test for assert - m_moveBtn1 = new wxButton(p, GBS_MOVE_BTN1, _T("Move this to (3,6)")); - m_moveBtn2 = new wxButton(p, GBS_MOVE_BTN2, _T("Move this to (3,6)")); + m_moveBtn1 = new wxButton(p, GBS_MOVE_BTN1, wxT("Move this to (3,6)")); + m_moveBtn2 = new wxButton(p, GBS_MOVE_BTN2, wxT("Move this to (3,6)")); m_gbs->Add( m_moveBtn1, POS(10,2) ); m_gbs->Add( m_moveBtn2, POS(10,3) ); - m_hideBtn = new wxButton(p, GBS_HIDE_BTN, _T("Hide this item -->")); + m_hideBtn = new wxButton(p, GBS_HIDE_BTN, wxT("Hide this item -->")); m_gbs->Add(m_hideBtn, POS(12, 3)); - m_hideTxt = new wxTextCtrl(p, wxID_ANY, _T("pos(12,4), size(150, wxDefaultCoord)"), + m_hideTxt = new wxTextCtrl(p, wxID_ANY, wxT("pos(12,4), size(150, wxDefaultCoord)"), wxDefaultPosition, wxSize(150,wxDefaultCoord)); m_gbs->Add( m_hideTxt, POS(12,4) ); - m_showBtn = new wxButton(p, GBS_SHOW_BTN, _T("<-- Show it again")); + m_showBtn = new wxButton(p, GBS_SHOW_BTN, wxT("<-- Show it again")); m_gbs->Add(m_showBtn, POS(12, 5)); m_showBtn->Disable(); @@ -561,20 +561,20 @@ void MyGridBagSizerFrame::OnMoveBtn(wxCommandEvent& event) if (curPos == wxGBPosition(3,6)) { m_gbs->SetItemPosition(btn, m_lastPos); - btn->SetLabel(_T("Move this to (3,6)")); + btn->SetLabel(wxT("Move this to (3,6)")); } else { if ( m_gbs->CheckForIntersection(wxGBPosition(3,6), wxGBSpan(1,1)) ) wxMessageBox( -_T("wxGridBagSizer will not allow items to be in the same cell as\n\ +wxT("wxGridBagSizer will not allow items to be in the same cell as\n\ another item, so this operation will fail. You will also get an assert\n\ -when compiled in debug mode."), _T("Warning"), wxOK | wxICON_INFORMATION); +when compiled in debug mode."), wxT("Warning"), wxOK | wxICON_INFORMATION); if ( m_gbs->SetItemPosition(btn, wxGBPosition(3,6)) ) { m_lastPos = curPos; - btn->SetLabel(_T("Move it back")); + btn->SetLabel(wxT("Move it back")); } } m_gbs->Layout(); @@ -600,11 +600,11 @@ MySimpleSizerFrame::MySimpleSizerFrame(const wxString &title, int x, int y ) { wxMenu *menu = new wxMenu; - menu->Append(ID_SET_SMALL, _T("Make text control small\tF4")); - menu->Append(ID_SET_BIG, _T("Make text control big\tF5")); + menu->Append(ID_SET_SMALL, wxT("Make text control small\tF4")); + menu->Append(ID_SET_BIG, wxT("Make text control big\tF5")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(menu, _T("&File")); + menu_bar->Append(menu, wxT("&File")); SetMenuBar( menu_bar ); @@ -646,10 +646,10 @@ MyNestedSizerFrame::MyNestedSizerFrame(const wxString &title, int x, int y ) { wxMenu *menu = new wxMenu; - menu->Append(wxID_ABOUT, _T("Do nothing")); + menu->Append(wxID_ABOUT, wxT("Do nothing")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(menu, _T("&File")); + menu_bar->Append(menu, wxT("&File")); SetMenuBar( menu_bar ); diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 96ee8fcd24..96afe78e75 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -54,16 +54,16 @@ const wxChar *SMALL_VIRTUAL_VIEW_ITEMS[][2] = { - { _T("Cat"), _T("meow") }, - { _T("Cow"), _T("moo") }, - { _T("Crow"), _T("caw") }, - { _T("Dog"), _T("woof") }, - { _T("Duck"), _T("quack") }, - { _T("Mouse"), _T("squeak") }, - { _T("Owl"), _T("hoo") }, - { _T("Pig"), _T("oink") }, - { _T("Pigeon"), _T("coo") }, - { _T("Sheep"), _T("baaah") }, + { wxT("Cat"), wxT("meow") }, + { wxT("Cow"), wxT("moo") }, + { wxT("Crow"), wxT("caw") }, + { wxT("Dog"), wxT("woof") }, + { wxT("Duck"), wxT("quack") }, + { wxT("Mouse"), wxT("squeak") }, + { wxT("Owl"), wxT("hoo") }, + { wxT("Pig"), wxT("oink") }, + { wxT("Pigeon"), wxT("coo") }, + { wxT("Sheep"), wxT("baaah") }, }; // number of items in icon/small icon view @@ -176,17 +176,17 @@ MyFrame::MyFrame(const wxChar *title) m_imageListSmall = new wxImageList(16, 16, true); #ifdef __WXMSW__ - m_imageListNormal->Add( wxIcon(_T("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(_T("icon2"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(_T("icon3"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(_T("icon4"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(_T("icon5"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(_T("icon6"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(_T("icon7"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(_T("icon8"), wxBITMAP_TYPE_ICO_RESOURCE) ); - m_imageListNormal->Add( wxIcon(_T("icon9"), wxBITMAP_TYPE_ICO_RESOURCE) ); - - m_imageListSmall->Add( wxIcon(_T("iconsmall"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon(wxT("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon(wxT("icon2"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon(wxT("icon3"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon(wxT("icon4"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon(wxT("icon5"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon(wxT("icon6"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon(wxT("icon7"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon(wxT("icon8"), wxBITMAP_TYPE_ICO_RESOURCE) ); + m_imageListNormal->Add( wxIcon(wxT("icon9"), wxBITMAP_TYPE_ICO_RESOURCE) ); + + m_imageListSmall->Add( wxIcon(wxT("iconsmall"), wxBITMAP_TYPE_ICO_RESOURCE) ); #else m_imageListNormal->Add( wxIcon( toolbrai_xpm ) ); @@ -204,65 +204,65 @@ MyFrame::MyFrame(const wxChar *title) // Make a menubar wxMenu *menuFile = new wxMenu; - menuFile->Append(LIST_ABOUT, _T("&About")); + menuFile->Append(LIST_ABOUT, wxT("&About")); menuFile->AppendSeparator(); - menuFile->Append(LIST_QUIT, _T("E&xit\tAlt-X")); + menuFile->Append(LIST_QUIT, wxT("E&xit\tAlt-X")); wxMenu *menuView = new wxMenu; - menuView->Append(LIST_LIST_VIEW, _T("&List view\tF1")); - menuView->Append(LIST_REPORT_VIEW, _T("&Report view\tF2")); - menuView->Append(LIST_ICON_VIEW, _T("&Icon view\tF3")); - menuView->Append(LIST_ICON_TEXT_VIEW, _T("Icon view with &text\tF4")); - menuView->Append(LIST_SMALL_ICON_VIEW, _T("&Small icon view\tF5")); - menuView->Append(LIST_SMALL_ICON_TEXT_VIEW, _T("Small icon &view with text\tF6")); - menuView->Append(LIST_VIRTUAL_VIEW, _T("&Virtual view\tF7")); - menuView->Append(LIST_SMALL_VIRTUAL_VIEW, _T("Small virtual vie&w\tF8")); + menuView->Append(LIST_LIST_VIEW, wxT("&List view\tF1")); + menuView->Append(LIST_REPORT_VIEW, wxT("&Report view\tF2")); + menuView->Append(LIST_ICON_VIEW, wxT("&Icon view\tF3")); + menuView->Append(LIST_ICON_TEXT_VIEW, wxT("Icon view with &text\tF4")); + menuView->Append(LIST_SMALL_ICON_VIEW, wxT("&Small icon view\tF5")); + menuView->Append(LIST_SMALL_ICON_TEXT_VIEW, wxT("Small icon &view with text\tF6")); + menuView->Append(LIST_VIRTUAL_VIEW, wxT("&Virtual view\tF7")); + menuView->Append(LIST_SMALL_VIRTUAL_VIEW, wxT("Small virtual vie&w\tF8")); menuView->AppendSeparator(); menuView->Append(LIST_SET_ITEMS_COUNT, "Set &number of items"); #ifdef __WXOSX__ menuView->AppendSeparator(); - menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, _T("Mac: Use Generic Control")); + menuView->AppendCheckItem(LIST_MAC_USE_GENERIC, wxT("Mac: Use Generic Control")); #endif wxMenu *menuList = new wxMenu; - menuList->Append(LIST_GOTO, _T("&Go to item #3\tCtrl-3")); - menuList->Append(LIST_FOCUS_LAST, _T("&Make last item current\tCtrl-L")); - menuList->Append(LIST_TOGGLE_FIRST, _T("To&ggle first item\tCtrl-G")); - menuList->Append(LIST_DESELECT_ALL, _T("&Deselect All\tCtrl-D")); - menuList->Append(LIST_SELECT_ALL, _T("S&elect All\tCtrl-A")); + menuList->Append(LIST_GOTO, wxT("&Go to item #3\tCtrl-3")); + menuList->Append(LIST_FOCUS_LAST, wxT("&Make last item current\tCtrl-L")); + menuList->Append(LIST_TOGGLE_FIRST, wxT("To&ggle first item\tCtrl-G")); + menuList->Append(LIST_DESELECT_ALL, wxT("&Deselect All\tCtrl-D")); + menuList->Append(LIST_SELECT_ALL, wxT("S&elect All\tCtrl-A")); menuList->AppendSeparator(); - menuList->Append(LIST_SHOW_COL_INFO, _T("Show &column info\tCtrl-C")); - menuList->Append(LIST_SHOW_SEL_INFO, _T("Show &selected items\tCtrl-S")); - menuList->Append(LIST_SHOW_VIEW_RECT, _T("Show &view rect")); + menuList->Append(LIST_SHOW_COL_INFO, wxT("Show &column info\tCtrl-C")); + menuList->Append(LIST_SHOW_SEL_INFO, wxT("Show &selected items\tCtrl-S")); + menuList->Append(LIST_SHOW_VIEW_RECT, wxT("Show &view rect")); #ifdef wxHAS_LISTCTRL_COLUMN_ORDER - menuList->Append(LIST_SET_COL_ORDER, _T("Se&t columns order\tShift-Ctrl-O")); - menuList->Append(LIST_GET_COL_ORDER, _T("Sho&w columns order\tCtrl-O")); + menuList->Append(LIST_SET_COL_ORDER, wxT("Se&t columns order\tShift-Ctrl-O")); + menuList->Append(LIST_GET_COL_ORDER, wxT("Sho&w columns order\tCtrl-O")); #endif // wxHAS_LISTCTRL_COLUMN_ORDER menuList->AppendSeparator(); - menuList->Append(LIST_SORT, _T("Sor&t\tCtrl-T")); + menuList->Append(LIST_SORT, wxT("Sor&t\tCtrl-T")); menuList->Append(LIST_FIND, "Test Find() performance"); menuList->AppendSeparator(); - menuList->Append(LIST_ADD, _T("&Append an item\tCtrl-P")); - menuList->Append(LIST_EDIT, _T("&Edit the item\tCtrl-E")); - menuList->Append(LIST_DELETE, _T("&Delete first item\tCtrl-X")); - menuList->Append(LIST_DELETE_ALL, _T("Delete &all items")); + menuList->Append(LIST_ADD, wxT("&Append an item\tCtrl-P")); + menuList->Append(LIST_EDIT, wxT("&Edit the item\tCtrl-E")); + menuList->Append(LIST_DELETE, wxT("&Delete first item\tCtrl-X")); + menuList->Append(LIST_DELETE_ALL, wxT("Delete &all items")); menuList->AppendSeparator(); - menuList->Append(LIST_FREEZE, _T("Free&ze\tCtrl-Z")); - menuList->Append(LIST_THAW, _T("Tha&w\tCtrl-W")); + menuList->Append(LIST_FREEZE, wxT("Free&ze\tCtrl-Z")); + menuList->Append(LIST_THAW, wxT("Tha&w\tCtrl-W")); menuList->AppendSeparator(); - menuList->AppendCheckItem(LIST_TOGGLE_LINES, _T("Toggle &lines\tCtrl-I")); - menuList->Append(LIST_TOGGLE_MULTI_SEL, _T("&Multiple selection\tCtrl-M"), - _T("Toggle multiple selection"), true); + menuList->AppendCheckItem(LIST_TOGGLE_LINES, wxT("Toggle &lines\tCtrl-I")); + menuList->Append(LIST_TOGGLE_MULTI_SEL, wxT("&Multiple selection\tCtrl-M"), + wxT("Toggle multiple selection"), true); wxMenu *menuCol = new wxMenu; - menuCol->Append(LIST_SET_FG_COL, _T("&Foreground colour...")); - menuCol->Append(LIST_SET_BG_COL, _T("&Background colour...")); + menuCol->Append(LIST_SET_FG_COL, wxT("&Foreground colour...")); + menuCol->Append(LIST_SET_BG_COL, wxT("&Background colour...")); wxMenuBar *menubar = new wxMenuBar; - menubar->Append(menuFile, _T("&File")); - menubar->Append(menuView, _T("&View")); - menubar->Append(menuList, _T("&List")); - menubar->Append(menuCol, _T("&Colour")); + menubar->Append(menuFile, wxT("&File")); + menubar->Append(menuView, wxT("&View")); + menubar->Append(menuList, wxT("&List")); + menubar->Append(menuCol, wxT("&Colour")); SetMenuBar(menubar); m_panel = new wxPanel(this, wxID_ANY); @@ -317,7 +317,7 @@ bool MyFrame::CheckNonVirtual() const return true; // "this" == whatever - wxLogWarning(_T("Can't do this in virtual view, sorry.")); + wxLogWarning(wxT("Can't do this in virtual view, sorry.")); return false; } @@ -329,22 +329,22 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageDialog dialog(this, _T("List test sample\nJulian Smart (c) 1997"), - _T("About list test"), wxOK|wxCANCEL); + wxMessageDialog dialog(this, wxT("List test sample\nJulian Smart (c) 1997"), + wxT("About list test"), wxOK|wxCANCEL); dialog.ShowModal(); } void MyFrame::OnFreeze(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Freezing the control")); + wxLogMessage(wxT("Freezing the control")); m_listCtrl->Freeze(); } void MyFrame::OnThaw(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Thawing the control")); + wxLogMessage(wxT("Thawing the control")); m_listCtrl->Thaw(); } @@ -454,7 +454,7 @@ void MyFrame::RecreateList(long flags, bool withText) break; default: - wxFAIL_MSG( _T("unknown listctrl mode") ); + wxFAIL_MSG( wxT("unknown listctrl mode") ); } } @@ -472,7 +472,7 @@ void MyFrame::InitWithListItems() { for ( int i = 0; i < m_numListItems; i++ ) { - m_listCtrl->InsertItem(i, wxString::Format(_T("Item %d"), i)); + m_listCtrl->InsertItem(i, wxString::Format(wxT("Item %d"), i)); } } @@ -488,15 +488,15 @@ void MyFrame::InitWithReportItems() // note that under MSW for SetColumnWidth() to work we need to create the // items with images initially even if we specify dummy image id wxListItem itemCol; - itemCol.SetText(_T("Column 1")); + itemCol.SetText(wxT("Column 1")); itemCol.SetImage(-1); m_listCtrl->InsertColumn(0, itemCol); - itemCol.SetText(_T("Column 2")); + itemCol.SetText(wxT("Column 2")); itemCol.SetAlign(wxLIST_FORMAT_CENTRE); m_listCtrl->InsertColumn(1, itemCol); - itemCol.SetText(_T("Column 3")); + itemCol.SetText(wxT("Column 3")); itemCol.SetAlign(wxLIST_FORMAT_RIGHT); m_listCtrl->InsertColumn(2, itemCol); @@ -510,7 +510,7 @@ void MyFrame::InitWithReportItems() m_listCtrl->InsertItemInReportView(i); } - m_logWindow->WriteText(wxString::Format(_T("%d items inserted in %ldms\n"), + m_logWindow->WriteText(wxString::Format(wxT("%d items inserted in %ldms\n"), m_numListItems, sw.Time())); m_listCtrl->Show(); @@ -559,7 +559,7 @@ void MyFrame::InitWithIconItems(bool withText, bool sameIcon) if ( withText ) { - m_listCtrl->InsertItem(i, wxString::Format(_T("Label %d"), i), + m_listCtrl->InsertItem(i, wxString::Format(wxT("Label %d"), i), image); } else @@ -632,14 +632,14 @@ void MyFrame::InitWithVirtualItems() if ( m_smallVirtual ) { - m_listCtrl->InsertColumn(0, _T("Animal")); - m_listCtrl->InsertColumn(1, _T("Sound")); + m_listCtrl->InsertColumn(0, wxT("Animal")); + m_listCtrl->InsertColumn(1, wxT("Sound")); m_listCtrl->SetItemCount(WXSIZEOF(SMALL_VIRTUAL_VIEW_ITEMS)); } else { - m_listCtrl->InsertColumn(0, _T("First Column")); - m_listCtrl->InsertColumn(1, _T("Second Column")); + m_listCtrl->InsertColumn(0, wxT("First Column")); + m_listCtrl->InsertColumn(1, wxT("Second Column")); m_listCtrl->SetColumnWidth(0, 150); m_listCtrl->SetColumnWidth(1, 150); m_listCtrl->SetItemCount(1000000); @@ -652,7 +652,7 @@ void MyFrame::OnSort(wxCommandEvent& WXUNUSED(event)) m_listCtrl->SortItems(MyCompareFunction, 0); - m_logWindow->WriteText(wxString::Format(_T("Sorting %d items took %ld ms\n"), + m_logWindow->WriteText(wxString::Format(wxT("Sorting %d items took %ld ms\n"), m_listCtrl->GetItemCount(), sw.Time())); } @@ -672,7 +672,7 @@ void MyFrame::OnFind(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event)) { int selCount = m_listCtrl->GetSelectedItemCount(); - wxLogMessage(_T("%d items selected:"), selCount); + wxLogMessage(wxT("%d items selected:"), selCount); // don't show too many items size_t shownCount = 0; @@ -681,12 +681,12 @@ void MyFrame::OnShowSelInfo(wxCommandEvent& WXUNUSED(event)) wxLIST_STATE_SELECTED); while ( item != -1 ) { - wxLogMessage(_T("\t%ld (%s)"), + wxLogMessage(wxT("\t%ld (%s)"), item, m_listCtrl->GetItemText(item).c_str()); if ( ++shownCount > 10 ) { - wxLogMessage(_T("\t... more selected items snipped...")); + wxLogMessage(wxT("\t... more selected items snipped...")); break; } @@ -792,7 +792,7 @@ void MyFrame::OnToggleMultiSel(wxCommandEvent& WXUNUSED(event)) flags |= wxLC_SINGLE_SEL; m_logWindow->WriteText(wxString::Format(wxT("Current selection mode: %sle\n"), - (flags & wxLC_SINGLE_SEL) ? _T("sing") : _T("multip"))); + (flags & wxLC_SINGLE_SEL) ? wxT("sing") : wxT("multip"))); RecreateList(flags); } @@ -816,7 +816,7 @@ void MyFrame::OnSetBgColour(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAdd(wxCommandEvent& WXUNUSED(event)) { - m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), _T("Appended item")); + m_listCtrl->InsertItem(m_listCtrl->GetItemCount(), wxT("Appended item")); } void MyFrame::OnEdit(wxCommandEvent& WXUNUSED(event)) @@ -830,7 +830,7 @@ void MyFrame::OnEdit(wxCommandEvent& WXUNUSED(event)) } else { - m_logWindow->WriteText(_T("No item to edit")); + m_logWindow->WriteText(wxT("No item to edit")); } } @@ -842,7 +842,7 @@ void MyFrame::OnDelete(wxCommandEvent& WXUNUSED(event)) } else { - m_logWindow->WriteText(_T("Nothing to delete")); + m_logWindow->WriteText(wxT("Nothing to delete")); } } @@ -854,7 +854,7 @@ void MyFrame::OnDeleteAll(wxCommandEvent& WXUNUSED(event)) m_listCtrl->DeleteAllItems(); - m_logWindow->WriteText(wxString::Format(_T("Deleting %d items took %ld ms\n"), + m_logWindow->WriteText(wxString::Format(wxT("Deleting %d items took %ld ms\n"), itemCount, sw.Time())); } @@ -929,7 +929,7 @@ void MyListCtrl::OnColRightClick(wxListEvent& event) // Show popupmenu at position wxMenu menu(wxT("Test")); - menu.Append(LIST_ABOUT, _T("&About")); + menu.Append(LIST_ABOUT, wxT("&About")); PopupMenu(&menu, event.GetPoint()); wxLogMessage( wxT("OnColumnRightClick at %d."), event.GetColumn() ); @@ -952,7 +952,7 @@ void MyListCtrl::OnColBeginDrag(wxListEvent& event) if ( event.GetColumn() == 0 ) { - wxLogMessage(_T("Resizing this column shouldn't work.")); + wxLogMessage(wxT("Resizing this column shouldn't work.")); event.Veto(); } @@ -1011,18 +1011,18 @@ void MyListCtrl::OnEndLabelEdit(wxListEvent& event) void MyListCtrl::OnDeleteItem(wxListEvent& event) { - LogEvent(event, _T("OnDeleteItem")); + LogEvent(event, wxT("OnDeleteItem")); wxLogMessage( wxT("Number of items when delete event is sent: %d"), GetItemCount() ); } void MyListCtrl::OnDeleteAllItems(wxListEvent& event) { - LogEvent(event, _T("OnDeleteAllItems")); + LogEvent(event, wxT("OnDeleteAllItems")); } void MyListCtrl::OnSelected(wxListEvent& event) { - LogEvent(event, _T("OnSelected")); + LogEvent(event, wxT("OnSelected")); if ( GetWindowStyle() & wxLC_REPORT ) { @@ -1044,17 +1044,17 @@ void MyListCtrl::OnSelected(wxListEvent& event) void MyListCtrl::OnDeselected(wxListEvent& event) { - LogEvent(event, _T("OnDeselected")); + LogEvent(event, wxT("OnDeselected")); } void MyListCtrl::OnActivated(wxListEvent& event) { - LogEvent(event, _T("OnActivated")); + LogEvent(event, wxT("OnActivated")); } void MyListCtrl::OnFocused(wxListEvent& event) { - LogEvent(event, _T("OnFocused")); + LogEvent(event, wxT("OnFocused")); event.Skip(); } @@ -1096,7 +1096,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) item = 0; } - wxLogMessage(_T("Focusing item %ld"), item); + wxLogMessage(wxT("Focusing item %ld"), item); SetItemState(item, wxLIST_STATE_FOCUSED, wxLIST_STATE_FOCUSED); EnsureVisible(item); @@ -1108,11 +1108,11 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) wxRect r; if ( !GetItemRect(item, r) ) { - wxLogError(_T("Failed to retrieve rect of item %ld"), item); + wxLogError(wxT("Failed to retrieve rect of item %ld"), item); break; } - wxLogMessage(_T("Bounding rect of item %ld is (%d, %d)-(%d, %d)"), + wxLogMessage(wxT("Bounding rect of item %ld is (%d, %d)-(%d, %d)"), item, r.x, r.y, r.x + r.width, r.y + r.height); } break; @@ -1128,11 +1128,11 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) wxRect r; if ( !GetSubItemRect(item, subItem, r) ) { - wxLogError(_T("Failed to retrieve rect of item %ld column %d"), item, subItem + 1); + wxLogError(wxT("Failed to retrieve rect of item %ld column %d"), item, subItem + 1); break; } - wxLogMessage(_T("Bounding rect of item %ld column %d is (%d, %d)-(%d, %d)"), + wxLogMessage(wxT("Bounding rect of item %ld column %d is (%d, %d)-(%d, %d)"), item, subItem + 1, r.x, r.y, r.x + r.width, r.y + r.height); } @@ -1164,7 +1164,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) { DeleteItem(item); - wxLogMessage(_T("Item %ld deleted"), item); + wxLogMessage(wxT("Item %ld deleted"), item); // -1 because the indices were shifted by DeleteItem() item = GetNextItem(item - 1, @@ -1187,7 +1187,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) //else: fall through default: - LogEvent(event, _T("OnListKeyDown")); + LogEvent(event, wxT("OnListKeyDown")); event.Skip(); } @@ -1195,7 +1195,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) void MyListCtrl::OnChar(wxKeyEvent& event) { - wxLogMessage(_T("Got char event.")); + wxLogMessage(wxT("Got char event.")); switch ( event.GetKeyCode() ) { @@ -1234,24 +1234,24 @@ void MyListCtrl::OnRightClick(wxMouseEvent& event) wxString where; switch ( flags ) { - case wxLIST_HITTEST_ABOVE: where = _T("above"); break; - case wxLIST_HITTEST_BELOW: where = _T("below"); break; - case wxLIST_HITTEST_NOWHERE: where = _T("nowhere near"); break; - case wxLIST_HITTEST_ONITEMICON: where = _T("on icon of"); break; - case wxLIST_HITTEST_ONITEMLABEL: where = _T("on label of"); break; - case wxLIST_HITTEST_ONITEMRIGHT: where = _T("right on"); break; - case wxLIST_HITTEST_TOLEFT: where = _T("to the left of"); break; - case wxLIST_HITTEST_TORIGHT: where = _T("to the right of"); break; - default: where = _T("not clear exactly where on"); break; + case wxLIST_HITTEST_ABOVE: where = wxT("above"); break; + case wxLIST_HITTEST_BELOW: where = wxT("below"); break; + case wxLIST_HITTEST_NOWHERE: where = wxT("nowhere near"); break; + case wxLIST_HITTEST_ONITEMICON: where = wxT("on icon of"); break; + case wxLIST_HITTEST_ONITEMLABEL: where = wxT("on label of"); break; + case wxLIST_HITTEST_ONITEMRIGHT: where = wxT("right on"); break; + case wxLIST_HITTEST_TOLEFT: where = wxT("to the left of"); break; + case wxLIST_HITTEST_TORIGHT: where = wxT("to the right of"); break; + default: where = wxT("not clear exactly where on"); break; } - wxLogMessage(_T("Right double click %s item %ld, subitem %ld"), + wxLogMessage(wxT("Right double click %s item %ld, subitem %ld"), where.c_str(), item, subitem); } void MyListCtrl::LogEvent(const wxListEvent& event, const wxChar *eventName) { - wxLogMessage(_T("Item %ld: %s (item text = %s, data = %ld)"), + wxLogMessage(wxT("Item %ld: %s (item text = %s, data = %ld)"), event.GetIndex(), eventName, event.GetText().c_str(), event.GetData()); } @@ -1264,7 +1264,7 @@ wxString MyListCtrl::OnGetItemText(long item, long column) const } else // "big" virtual control { - return wxString::Format(_T("Column %ld of item %ld"), column, item); + return wxString::Format(wxT("Column %ld of item %ld"), column, item); } } @@ -1295,14 +1295,14 @@ wxListItemAttr *MyListCtrl::OnGetItemAttr(long item) const void MyListCtrl::InsertItemInReportView(int i) { wxString buf; - buf.Printf(_T("This is item %d"), i); + buf.Printf(wxT("This is item %d"), i); long tmp = InsertItem(i, buf, 0); SetItemData(tmp, i); - buf.Printf(_T("Col 1, item %d"), i); + buf.Printf(wxT("Col 1, item %d"), i); SetItem(tmp, 1, buf); - buf.Printf(_T("Item %d in column 2"), i); + buf.Printf(wxT("Item %d in column 2"), i); SetItem(tmp, 2, buf); } @@ -1339,9 +1339,9 @@ void MyListCtrl::ShowContextMenu(const wxPoint& pos) { wxMenu menu; - menu.Append(wxID_ABOUT, _T("&About")); + menu.Append(wxID_ABOUT, wxT("&About")); menu.AppendSeparator(); - menu.Append(wxID_EXIT, _T("E&xit")); + menu.Append(wxID_EXIT, wxT("E&xit")); PopupMenu(&menu, pos.x, pos.y); } diff --git a/samples/memcheck/memcheck.cpp b/samples/memcheck/memcheck.cpp index 82cbc1e0c4..a637d6a0a7 100644 --- a/samples/memcheck/memcheck.cpp +++ b/samples/memcheck/memcheck.cpp @@ -68,15 +68,15 @@ bool MyApp::OnInit(void) // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(wxID_EXIT, _T("E&xit")); + file_menu->Append(wxID_EXIT, wxT("E&xit")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("File")); + menu_bar->Append(file_menu, wxT("File")); frame->SetMenuBar(menu_bar); // Make a panel with a message wxPanel *panel = new wxPanel(frame); - (void)new wxStaticText(panel, wxID_ANY, _T("Hello, this is a minimal debugging wxWidgets program!"), wxPoint(10, 10)); + (void)new wxStaticText(panel, wxID_ANY, wxT("Hello, this is a minimal debugging wxWidgets program!"), wxPoint(10, 10)); // Show the frame frame->Show(true); @@ -127,7 +127,7 @@ END_EVENT_TABLE() // My frame constructor MyFrame::MyFrame(wxFrame *parent): - wxFrame(parent, wxID_ANY, _T("MemCheck wxWidgets Sample"), wxDefaultPosition, wxSize(400, 200)) + wxFrame(parent, wxID_ANY, wxT("MemCheck wxWidgets Sample"), wxDefaultPosition, wxSize(400, 200)) {} // Intercept menu commands diff --git a/samples/menu/menu.cpp b/samples/menu/menu.cpp index f4820fb1d1..7fd3a3292a 100644 --- a/samples/menu/menu.cpp +++ b/samples/menu/menu.cpp @@ -139,13 +139,13 @@ protected: void OnMenuOpen(wxMenuEvent& event) { #if USE_LOG_WINDOW - LogMenuOpenOrClose(event, _T("opened")); event.Skip(); + LogMenuOpenOrClose(event, wxT("opened")); event.Skip(); #endif } void OnMenuClose(wxMenuEvent& event) { #if USE_LOG_WINDOW - LogMenuOpenOrClose(event, _T("closed")); event.Skip(); + LogMenuOpenOrClose(event, wxT("closed")); event.Skip(); #endif } @@ -359,7 +359,7 @@ bool MyApp::OnInit() frame->Show(true); #if wxUSE_STATUSBAR - frame->SetStatusText(_T("Welcome to wxWidgets menu sample")); + frame->SetStatusText(wxT("Welcome to wxWidgets menu sample")); #endif // wxUSE_STATUSBAR SetTopWindow(frame); @@ -373,7 +373,7 @@ bool MyApp::OnInit() // Define my frame constructor MyFrame::MyFrame() - : wxFrame((wxFrame *)NULL, wxID_ANY, _T("wxWidgets menu sample")) + : wxFrame((wxFrame *)NULL, wxID_ANY, wxT("wxWidgets menu sample")) { SetIcon(wxICON(sample)); @@ -460,11 +460,11 @@ MyFrame::MyFrame() stockSubMenu->Append(wxID_ZOOM_FIT); stockSubMenu->Append(wxID_ZOOM_IN); stockSubMenu->Append(wxID_ZOOM_OUT); - fileMenu->AppendSubMenu(stockSubMenu, _T("&Standard items demo")); + fileMenu->AppendSubMenu(stockSubMenu, wxT("&Standard items demo")); #if USE_LOG_WINDOW wxMenuItem *item = new wxMenuItem(fileMenu, Menu_File_ClearLog, - _T("Clear &log\tCtrl-L")); + wxT("Clear &log\tCtrl-L")); #if wxUSE_OWNER_DRAWN || defined(__WXGTK__) item->SetBitmap(copy_xpm); #endif @@ -472,86 +472,86 @@ MyFrame::MyFrame() fileMenu->AppendSeparator(); #endif // USE_LOG_WINDOW - fileMenu->Append(Menu_File_Quit, _T("E&xit\tAlt-X"), _T("Quit menu sample")); + fileMenu->Append(Menu_File_Quit, wxT("E&xit\tAlt-X"), wxT("Quit menu sample")); wxMenu *menubarMenu = new wxMenu; - menubarMenu->Append(Menu_MenuBar_Append, _T("&Append menu\tCtrl-A"), - _T("Append a menu to the menubar")); - menubarMenu->Append(Menu_MenuBar_Insert, _T("&Insert menu\tCtrl-I"), - _T("Insert a menu into the menubar")); - menubarMenu->Append(Menu_MenuBar_Delete, _T("&Delete menu\tCtrl-D"), - _T("Delete the last menu from the menubar")); - menubarMenu->Append(Menu_MenuBar_Toggle, _T("&Toggle menu\tCtrl-T"), - _T("Toggle the first menu in the menubar"), true); + menubarMenu->Append(Menu_MenuBar_Append, wxT("&Append menu\tCtrl-A"), + wxT("Append a menu to the menubar")); + menubarMenu->Append(Menu_MenuBar_Insert, wxT("&Insert menu\tCtrl-I"), + wxT("Insert a menu into the menubar")); + menubarMenu->Append(Menu_MenuBar_Delete, wxT("&Delete menu\tCtrl-D"), + wxT("Delete the last menu from the menubar")); + menubarMenu->Append(Menu_MenuBar_Toggle, wxT("&Toggle menu\tCtrl-T"), + wxT("Toggle the first menu in the menubar"), true); menubarMenu->AppendSeparator(); - menubarMenu->Append(Menu_MenuBar_Enable, _T("&Enable menu\tCtrl-E"), - _T("Enable or disable the last menu"), true); + menubarMenu->Append(Menu_MenuBar_Enable, wxT("&Enable menu\tCtrl-E"), + wxT("Enable or disable the last menu"), true); menubarMenu->AppendSeparator(); - menubarMenu->Append(Menu_MenuBar_GetLabel, _T("&Get menu label\tCtrl-G"), - _T("Get the label of the last menu")); + menubarMenu->Append(Menu_MenuBar_GetLabel, wxT("&Get menu label\tCtrl-G"), + wxT("Get the label of the last menu")); #if wxUSE_TEXTDLG - menubarMenu->Append(Menu_MenuBar_SetLabel, _T("&Set menu label\tCtrl-S"), - _T("Change the label of the last menu")); + menubarMenu->Append(Menu_MenuBar_SetLabel, wxT("&Set menu label\tCtrl-S"), + wxT("Change the label of the last menu")); menubarMenu->AppendSeparator(); - menubarMenu->Append(Menu_MenuBar_FindMenu, _T("&Find menu from label\tCtrl-F"), - _T("Find a menu by searching for its label")); + menubarMenu->Append(Menu_MenuBar_FindMenu, wxT("&Find menu from label\tCtrl-F"), + wxT("Find a menu by searching for its label")); #endif wxMenu* subMenu = new wxMenu; - subMenu->Append(Menu_SubMenu_Normal, _T("&Normal submenu item"), _T("Disabled submenu item")); - subMenu->AppendCheckItem(Menu_SubMenu_Check, _T("&Check submenu item"), _T("Check submenu item")); - subMenu->AppendRadioItem(Menu_SubMenu_Radio1, _T("Radio item &1"), _T("Radio item")); - subMenu->AppendRadioItem(Menu_SubMenu_Radio2, _T("Radio item &2"), _T("Radio item")); - subMenu->AppendRadioItem(Menu_SubMenu_Radio3, _T("Radio item &3"), _T("Radio item")); + subMenu->Append(Menu_SubMenu_Normal, wxT("&Normal submenu item"), wxT("Disabled submenu item")); + subMenu->AppendCheckItem(Menu_SubMenu_Check, wxT("&Check submenu item"), wxT("Check submenu item")); + subMenu->AppendRadioItem(Menu_SubMenu_Radio1, wxT("Radio item &1"), wxT("Radio item")); + subMenu->AppendRadioItem(Menu_SubMenu_Radio2, wxT("Radio item &2"), wxT("Radio item")); + subMenu->AppendRadioItem(Menu_SubMenu_Radio3, wxT("Radio item &3"), wxT("Radio item")); - menubarMenu->Append(Menu_SubMenu, _T("Submenu"), subMenu); + menubarMenu->Append(Menu_SubMenu, wxT("Submenu"), subMenu); wxMenu *menuMenu = new wxMenu; - menuMenu->Append(Menu_Menu_Append, _T("&Append menu item\tAlt-A"), - _T("Append a menu item to the last menu")); - menuMenu->Append(Menu_Menu_AppendSub, _T("&Append sub menu\tAlt-S"), - _T("Append a sub menu to the last menu")); - menuMenu->Append(Menu_Menu_Insert, _T("&Insert menu item\tAlt-I"), - _T("Insert a menu item in head of the last menu")); - menuMenu->Append(Menu_Menu_Delete, _T("&Delete menu item\tAlt-D"), - _T("Delete the last menu item from the last menu")); + menuMenu->Append(Menu_Menu_Append, wxT("&Append menu item\tAlt-A"), + wxT("Append a menu item to the last menu")); + menuMenu->Append(Menu_Menu_AppendSub, wxT("&Append sub menu\tAlt-S"), + wxT("Append a sub menu to the last menu")); + menuMenu->Append(Menu_Menu_Insert, wxT("&Insert menu item\tAlt-I"), + wxT("Insert a menu item in head of the last menu")); + menuMenu->Append(Menu_Menu_Delete, wxT("&Delete menu item\tAlt-D"), + wxT("Delete the last menu item from the last menu")); menuMenu->AppendSeparator(); - menuMenu->Append(Menu_Menu_Enable, _T("&Enable menu item\tAlt-E"), - _T("Enable or disable the last menu item"), true); - menuMenu->Append(Menu_Menu_Check, _T("&Check menu item\tAlt-C"), - _T("Check or uncheck the last menu item"), true); + menuMenu->Append(Menu_Menu_Enable, wxT("&Enable menu item\tAlt-E"), + wxT("Enable or disable the last menu item"), true); + menuMenu->Append(Menu_Menu_Check, wxT("&Check menu item\tAlt-C"), + wxT("Check or uncheck the last menu item"), true); menuMenu->AppendSeparator(); - menuMenu->Append(Menu_Menu_GetInfo, _T("Get menu item in&fo\tAlt-F"), - _T("Show the state of the last menu item")); + menuMenu->Append(Menu_Menu_GetInfo, wxT("Get menu item in&fo\tAlt-F"), + wxT("Show the state of the last menu item")); #if wxUSE_TEXTDLG - menuMenu->Append(Menu_Menu_SetLabel, _T("Set menu item label\tAlt-L"), - _T("Set the label of a menu item")); + menuMenu->Append(Menu_Menu_SetLabel, wxT("Set menu item label\tAlt-L"), + wxT("Set the label of a menu item")); #endif #if wxUSE_TEXTDLG menuMenu->AppendSeparator(); - menuMenu->Append(Menu_Menu_FindItem, _T("Find menu item from label"), - _T("Find a menu item by searching for its label")); + menuMenu->Append(Menu_Menu_FindItem, wxT("Find menu item from label"), + wxT("Find a menu item by searching for its label")); #endif wxMenu *testMenu = new wxMenu; - testMenu->Append(Menu_Test_Normal, _T("&Normal item")); + testMenu->Append(Menu_Test_Normal, wxT("&Normal item")); testMenu->AppendSeparator(); - testMenu->AppendCheckItem(Menu_Test_Check, _T("&Check item")); + testMenu->AppendCheckItem(Menu_Test_Check, wxT("&Check item")); testMenu->AppendSeparator(); - testMenu->AppendRadioItem(Menu_Test_Radio1, _T("Radio item &1")); - testMenu->AppendRadioItem(Menu_Test_Radio2, _T("Radio item &2")); - testMenu->AppendRadioItem(Menu_Test_Radio3, _T("Radio item &3")); + testMenu->AppendRadioItem(Menu_Test_Radio1, wxT("Radio item &1")); + testMenu->AppendRadioItem(Menu_Test_Radio2, wxT("Radio item &2")); + testMenu->AppendRadioItem(Menu_Test_Radio3, wxT("Radio item &3")); wxMenu *helpMenu = new wxMenu; - helpMenu->Append(Menu_Help_About, _T("&About\tF1"), _T("About menu sample")); + helpMenu->Append(Menu_Help_About, wxT("&About\tF1"), wxT("About menu sample")); wxMenuBar* menuBar = new wxMenuBar( wxMB_DOCKABLE ); - menuBar->Append(fileMenu, _T("&File")); - menuBar->Append(menubarMenu, _T("Menu&bar")); - menuBar->Append(menuMenu, _T("&Menu")); - menuBar->Append(testMenu, _T("&Test")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(fileMenu, wxT("&File")); + menuBar->Append(menubarMenu, wxT("Menu&bar")); + menuBar->Append(menuMenu, wxT("&Menu")); + menuBar->Append(testMenu, wxT("&Test")); + menuBar->Append(helpMenu, wxT("&Help")); // these items should be initially checked menuBar->Check(Menu_MenuBar_Toggle, true); @@ -575,11 +575,11 @@ MyFrame::MyFrame() wxLog::DisableTimestamp(); m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(m_textctrl)); - wxLogMessage(_T("Brief explanations: the commands or the \"Menu\" menu ") - _T("append/insert/delete items to/from the last menu.\n") - _T("The commands from \"Menubar\" menu work with the ") - _T("menubar itself.\n\n") - _T("Right click the band below to test popup menus.\n")); + wxLogMessage(wxT("Brief explanations: the commands or the \"Menu\" menu ") + wxT("append/insert/delete items to/from the last menu.\n") + wxT("The commands from \"Menubar\" menu work with the ") + wxT("menubar itself.\n\n") + wxT("Right click the band below to test popup menus.\n")); #endif #ifdef __POCKETPC__ EnableContextMenu(); @@ -602,13 +602,13 @@ MyFrame::~MyFrame() wxMenu *MyFrame::CreateDummyMenu(wxString *title) { wxMenu *menu = new wxMenu; - menu->Append(Menu_Dummy_First, _T("&First item\tCtrl-F1")); + menu->Append(Menu_Dummy_First, wxT("&First item\tCtrl-F1")); menu->AppendSeparator(); - menu->AppendCheckItem(Menu_Dummy_Second, _T("&Second item\tCtrl-F2")); + menu->AppendCheckItem(Menu_Dummy_Second, wxT("&Second item\tCtrl-F2")); if ( title ) { - title->Printf(_T("Dummy menu &%u"), (unsigned)++m_countDummy); + title->Printf(wxT("Dummy menu &%u"), (unsigned)++m_countDummy); } return menu; @@ -622,7 +622,7 @@ wxMenuItem *MyFrame::GetLastMenuItem() const wxMenuItemList::compatibility_iterator node = menu->GetMenuItems().GetLast(); if ( !node ) { - wxLogWarning(_T("No last item in the last menu!")); + wxLogWarning(wxT("No last item in the last menu!")); return NULL; } @@ -636,15 +636,15 @@ void MyFrame::LogMenuEvent(const wxCommandEvent& event) { int id = event.GetId(); - wxString msg = wxString::Format(_T("Menu command %d"), id); + wxString msg = wxString::Format(wxT("Menu command %d"), id); // catch all checkable menubar items and also the check item from the popup // menu wxMenuItem *item = GetMenuBar()->FindItem(id); if ( (item && item->IsCheckable()) || id == Menu_Popup_ToBeChecked ) { - msg += wxString::Format(_T(" (the item is currently %schecked)"), - event.IsChecked() ? _T("") : _T("not ")); + msg += wxString::Format(wxT(" (the item is currently %schecked)"), + event.IsChecked() ? wxT("") : wxT("not ")); } wxLogMessage(msg); @@ -678,8 +678,8 @@ void MyFrame::OnClearLogUpdateUI(wxUpdateUIEvent& event) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox(_T("wxWidgets menu sample\n(c) 1999-2001 Vadim Zeitlin"), - _T("About wxWidgets menu sample"), + (void)wxMessageBox(wxT("wxWidgets menu sample\n(c) 1999-2001 Vadim Zeitlin"), + wxT("About wxWidgets menu sample"), wxOK | wxICON_INFORMATION); } @@ -691,7 +691,7 @@ void MyFrame::OnDeleteMenu(wxCommandEvent& WXUNUSED(event)) if ( count == 2 ) { // don't let delete the first 2 menus - wxLogError(_T("Can't delete any more menus")); + wxLogError(wxT("Can't delete any more menus")); } else { @@ -724,7 +724,7 @@ void MyFrame::OnToggleMenu(wxCommandEvent& WXUNUSED(event)) else { // restore it - mbar->Insert(0, m_menu, _T("&File")); + mbar->Insert(0, m_menu, wxT("&File")); m_menu = NULL; } } @@ -742,9 +742,9 @@ void MyFrame::OnGetLabelMenu(wxCommandEvent& WXUNUSED(event)) wxMenuBar *mbar = GetMenuBar(); size_t count = mbar->GetMenuCount(); - wxCHECK_RET( count, _T("no last menu?") ); + wxCHECK_RET( count, wxT("no last menu?") ); - wxLogMessage(_T("The label of the last menu item is '%s'"), + wxLogMessage(wxT("The label of the last menu item is '%s'"), mbar->GetMenuLabel(count - 1).c_str()); } @@ -754,12 +754,12 @@ void MyFrame::OnSetLabelMenu(wxCommandEvent& WXUNUSED(event)) wxMenuBar *mbar = GetMenuBar(); size_t count = mbar->GetMenuCount(); - wxCHECK_RET( count, _T("no last menu?") ); + wxCHECK_RET( count, wxT("no last menu?") ); wxString label = wxGetTextFromUser ( - _T("Enter new label: "), - _T("Change last menu text"), + wxT("Enter new label: "), + wxT("Change last menu text"), mbar->GetMenuLabel(count - 1), this ); @@ -775,12 +775,12 @@ void MyFrame::OnFindMenu(wxCommandEvent& WXUNUSED(event)) wxMenuBar *mbar = GetMenuBar(); size_t count = mbar->GetMenuCount(); - wxCHECK_RET( count, _T("no last menu?") ); + wxCHECK_RET( count, wxT("no last menu?") ); wxString label = wxGetTextFromUser ( - _T("Enter label to search for: "), - _T("Find menu"), + wxT("Enter label to search for: "), + wxT("Find menu"), wxEmptyString, this ); @@ -791,11 +791,11 @@ void MyFrame::OnFindMenu(wxCommandEvent& WXUNUSED(event)) if (index == wxNOT_FOUND) { - wxLogWarning(_T("No menu with label '%s'"), label.c_str()); + wxLogWarning(wxT("No menu with label '%s'"), label.c_str()); } else { - wxLogMessage(_T("Menu %d has label '%s'"), index, label.c_str()); + wxLogMessage(wxT("Menu %d has label '%s'"), index, label.c_str()); } } } @@ -803,7 +803,7 @@ void MyFrame::OnFindMenu(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnDummy(wxCommandEvent& event) { - wxLogMessage(_T("Dummy item #%d"), event.GetId() - Menu_Dummy_First + 1); + wxLogMessage(wxT("Dummy item #%d"), event.GetId() - Menu_Dummy_First + 1); } void MyFrame::OnAppendMenuItem(wxCommandEvent& WXUNUSED(event)) @@ -812,8 +812,8 @@ void MyFrame::OnAppendMenuItem(wxCommandEvent& WXUNUSED(event)) wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 1); menu->AppendSeparator(); - menu->Append(Menu_Dummy_Third, _T("&Third dummy item\tCtrl-F3"), - _T("Checkable item"), true); + menu->Append(Menu_Dummy_Third, wxT("&Third dummy item\tCtrl-F3"), + wxT("Checkable item"), true); } void MyFrame::OnAppendSubMenu(wxCommandEvent& WXUNUSED(event)) @@ -822,8 +822,8 @@ void MyFrame::OnAppendSubMenu(wxCommandEvent& WXUNUSED(event)) wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 2); - menu->Append(Menu_Dummy_Last, _T("&Dummy sub menu"), - CreateDummyMenu(NULL), _T("Dummy sub menu help")); + menu->Append(Menu_Dummy_Last, wxT("&Dummy sub menu"), + CreateDummyMenu(NULL), wxT("Dummy sub menu help")); } void MyFrame::OnDeleteMenuItem(wxCommandEvent& WXUNUSED(event)) @@ -834,7 +834,7 @@ void MyFrame::OnDeleteMenuItem(wxCommandEvent& WXUNUSED(event)) size_t count = menu->GetMenuItemCount(); if ( !count ) { - wxLogWarning(_T("No items to delete!")); + wxLogWarning(wxT("No items to delete!")); } else { @@ -848,7 +848,7 @@ void MyFrame::OnInsertMenuItem(wxCommandEvent& WXUNUSED(event)) wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 1); menu->Insert(0, wxMenuItem::New(menu, Menu_Dummy_Fourth, - _T("Fourth dummy item\tCtrl-F4"))); + wxT("Fourth dummy item\tCtrl-F4"))); menu->Insert(1, wxMenuItem::New(menu, wxID_SEPARATOR)); } @@ -885,7 +885,7 @@ void MyFrame::OnGetLabelMenuItem(wxCommandEvent& WXUNUSED(event)) if ( item ) { wxString label = item->GetItemLabel(); - wxLogMessage(_T("The label of the last menu item is '%s'"), + wxLogMessage(wxT("The label of the last menu item is '%s'"), label.c_str()); } } @@ -899,12 +899,12 @@ void MyFrame::OnSetLabelMenuItem(wxCommandEvent& WXUNUSED(event)) { wxString label = wxGetTextFromUser ( - _T("Enter new label: "), - _T("Change last menu item text"), + wxT("Enter new label: "), + wxT("Change last menu item text"), item->GetItemLabel(), this ); - label.Replace( _T("\\t"), _T("\t") ); + label.Replace( wxT("\\t"), wxT("\t") ); if ( !label.empty() ) { @@ -921,29 +921,29 @@ void MyFrame::OnGetMenuItemInfo(wxCommandEvent& WXUNUSED(event)) if ( item ) { wxString msg; - msg << _T("The item is ") << (item->IsEnabled() ? _T("enabled") - : _T("disabled")) - << _T('\n'); + msg << wxT("The item is ") << (item->IsEnabled() ? wxT("enabled") + : wxT("disabled")) + << wxT('\n'); if ( item->IsCheckable() ) { - msg << _T("It is checkable and ") << (item->IsChecked() ? _T("") : _T("un")) - << _T("checked\n"); + msg << wxT("It is checkable and ") << (item->IsChecked() ? wxT("") : wxT("un")) + << wxT("checked\n"); } #if wxUSE_ACCEL wxAcceleratorEntry *accel = item->GetAccel(); if ( accel ) { - msg << _T("Its accelerator is "); + msg << wxT("Its accelerator is "); int flags = accel->GetFlags(); if ( flags & wxACCEL_ALT ) - msg << _T("Alt-"); + msg << wxT("Alt-"); if ( flags & wxACCEL_CTRL ) - msg << _T("Ctrl-"); + msg << wxT("Ctrl-"); if ( flags & wxACCEL_SHIFT ) - msg << _T("Shift-"); + msg << wxT("Shift-"); int code = accel->GetKeyCode(); switch ( code ) @@ -960,7 +960,7 @@ void MyFrame::OnGetMenuItemInfo(wxCommandEvent& WXUNUSED(event)) case WXK_F10: case WXK_F11: case WXK_F12: - msg << _T('F') << code - WXK_F1 + 1; + msg << wxT('F') << code - WXK_F1 + 1; break; // if there are any other keys wxGetAccelFromString() may return, @@ -974,14 +974,14 @@ void MyFrame::OnGetMenuItemInfo(wxCommandEvent& WXUNUSED(event)) break; } - wxFAIL_MSG( _T("unknown keyboard accel") ); + wxFAIL_MSG( wxT("unknown keyboard accel") ); } delete accel; } else { - msg << _T("It doesn't have an accelerator"); + msg << wxT("It doesn't have an accelerator"); } #endif // wxUSE_ACCEL @@ -995,12 +995,12 @@ void MyFrame::OnFindMenuItem(wxCommandEvent& WXUNUSED(event)) wxMenuBar *mbar = GetMenuBar(); size_t count = mbar->GetMenuCount(); - wxCHECK_RET( count, _T("no last menu?") ); + wxCHECK_RET( count, wxT("no last menu?") ); wxString label = wxGetTextFromUser ( - _T("Enter label to search for: "), - _T("Find menu item"), + wxT("Enter label to search for: "), + wxT("Find menu item"), wxEmptyString, this ); @@ -1016,11 +1016,11 @@ void MyFrame::OnFindMenuItem(wxCommandEvent& WXUNUSED(event)) } if (index == wxNOT_FOUND) { - wxLogWarning(_T("No menu item with label '%s'"), label.c_str()); + wxLogWarning(wxT("No menu item with label '%s'"), label.c_str()); } else { - wxLogMessage(_T("Menu item %d in menu %lu has label '%s'"), + wxLogMessage(wxT("Menu item %d in menu %lu has label '%s'"), index, (unsigned long)menuindex, label.c_str()); } } @@ -1053,14 +1053,14 @@ void MyFrame::ShowContextMenu(const wxPoint& pos) } else // normal case, shift not pressed { - menu.Append(Menu_Help_About, _T("&About")); - menu.Append(Menu_Popup_Submenu, _T("&Submenu"), CreateDummyMenu(NULL)); - menu.Append(Menu_Popup_ToBeDeleted, _T("To be &deleted")); - menu.AppendCheckItem(Menu_Popup_ToBeChecked, _T("To be &checked")); - menu.Append(Menu_Popup_ToBeGreyed, _T("To be &greyed"), - _T("This menu item should be initially greyed out")); + menu.Append(Menu_Help_About, wxT("&About")); + menu.Append(Menu_Popup_Submenu, wxT("&Submenu"), CreateDummyMenu(NULL)); + menu.Append(Menu_Popup_ToBeDeleted, wxT("To be &deleted")); + menu.AppendCheckItem(Menu_Popup_ToBeChecked, wxT("To be &checked")); + menu.Append(Menu_Popup_ToBeGreyed, wxT("To be &greyed"), + wxT("This menu item should be initially greyed out")); menu.AppendSeparator(); - menu.Append(Menu_File_Quit, _T("E&xit")); + menu.Append(Menu_File_Quit, wxT("E&xit")); menu.Delete(Menu_Popup_ToBeDeleted); menu.Check(Menu_Popup_ToBeChecked, true); @@ -1079,18 +1079,18 @@ void MyFrame::ShowContextMenu(const wxPoint& pos) void MyFrame::OnTestNormal(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Normal item selected")); + wxLogMessage(wxT("Normal item selected")); } void MyFrame::OnTestCheck(wxCommandEvent& event) { - wxLogMessage(_T("Check item %schecked"), - event.IsChecked() ? _T("") : _T("un")); + wxLogMessage(wxT("Check item %schecked"), + event.IsChecked() ? wxT("") : wxT("un")); } void MyFrame::OnTestRadio(wxCommandEvent& event) { - wxLogMessage(_T("Radio item %d selected"), + wxLogMessage(wxT("Radio item %d selected"), event.GetId() - Menu_Test_Radio1 + 1); } @@ -1098,11 +1098,11 @@ void MyFrame::OnTestRadio(wxCommandEvent& event) void MyFrame::LogMenuOpenOrClose(const wxMenuEvent& event, const wxChar *what) { wxString msg; - msg << _T("A ") - << ( event.IsPopup() ? _T("popup ") : _T("") ) - << _T("menu has been ") + msg << wxT("A ") + << ( event.IsPopup() ? wxT("popup ") : wxT("") ) + << wxT("menu has been ") << what - << _T("."); + << wxT("."); wxLogStatus(this, msg.c_str()); } diff --git a/samples/mfc/mfctest.cpp b/samples/mfc/mfctest.cpp index a4102648a9..ec1fbfc480 100644 --- a/samples/mfc/mfctest.cpp +++ b/samples/mfc/mfctest.cpp @@ -130,14 +130,14 @@ IMPLEMENT_APP_NO_MAIN(MyApp) CMainWindow::CMainWindow() { - LoadAccelTable( _T("MainAccelTable") ); - Create( NULL, _T("Hello Foundation Application"), - WS_OVERLAPPEDWINDOW, rectDefault, NULL, _T("MainMenu") ); + LoadAccelTable( wxT("MainAccelTable") ); + Create( NULL, wxT("Hello Foundation Application"), + WS_OVERLAPPEDWINDOW, rectDefault, NULL, wxT("MainMenu") ); } void CMainWindow::OnPaint() { - CString s = _T("Hello, Windows!"); + CString s = wxT("Hello, Windows!"); CPaintDC dc( this ); CRect rect; @@ -151,13 +151,13 @@ void CMainWindow::OnPaint() void CMainWindow::OnAbout() { - CDialog about( _T("AboutBox"), this ); + CDialog about( wxT("AboutBox"), this ); about.DoModal(); } void CMainWindow::OnTest() { - wxMessageBox(_T("This is a wxWidgets message box.\nWe're about to create a new wxWidgets frame."), _T("wxWidgets"), wxOK); + wxMessageBox(wxT("This is a wxWidgets message box.\nWe're about to create a new wxWidgets frame."), wxT("wxWidgets"), wxOK); wxGetApp().CreateFrame(); } @@ -268,10 +268,10 @@ void MyApp::ExitMainLoop() wxFrame *MyApp::CreateFrame() { - MyChild *subframe = new MyChild(NULL, _T("Canvas Frame"), wxPoint(10, 10), wxSize(300, 300), + MyChild *subframe = new MyChild(NULL, wxT("Canvas Frame"), wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE); - subframe->SetTitle(_T("wxWidgets canvas frame")); + subframe->SetTitle(wxT("wxWidgets canvas frame")); // Give it a status line subframe->CreateStatusBar(); @@ -279,12 +279,12 @@ wxFrame *MyApp::CreateFrame() // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(HELLO_NEW, _T("&New MFC Window")); - file_menu->Append(HELLO_QUIT, _T("&Close")); + file_menu->Append(HELLO_NEW, wxT("&New MFC Window")); + file_menu->Append(HELLO_QUIT, wxT("&Close")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); // Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); @@ -329,7 +329,7 @@ void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) dc.DrawEllipse(250, 250, 100, 50); dc.DrawLine(50, 230, 200, 230); - dc.DrawText(_T("This is a test string"), 50, 230); + dc.DrawText(wxT("This is a test string"), 50, 230); } // This implements a tiny doodling program! Drag the mouse using diff --git a/samples/nativdlg/nativdlg.cpp b/samples/nativdlg/nativdlg.cpp index ef9b9f06b4..73d53aacc2 100644 --- a/samples/nativdlg/nativdlg.cpp +++ b/samples/nativdlg/nativdlg.cpp @@ -43,7 +43,7 @@ bool MyApp::OnInit(void) return false; // Create the main frame window - MyFrame *frame = new MyFrame(NULL, wxID_ANY, _T("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250)); + MyFrame *frame = new MyFrame(NULL, wxID_ANY, wxT("wxWidgets Native Dialog Sample"), wxPoint(0, 0), wxSize(300, 250)); #if wxUSE_STATUSBAR // Give it a status line @@ -53,18 +53,18 @@ bool MyApp::OnInit(void) // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(RESOURCE_TEST1, _T("&Dialog box test"), _T("Test dialog box resource")); - file_menu->Append(RESOURCE_QUIT, _T("E&xit"), _T("Quit program")); + file_menu->Append(RESOURCE_TEST1, wxT("&Dialog box test"), wxT("Test dialog box resource")); + file_menu->Append(RESOURCE_QUIT, wxT("E&xit"), wxT("Quit program")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); // Make a panel - frame->panel = new wxWindow(frame, wxID_ANY, wxPoint(0, 0), wxSize(400, 400), 0, _T("MyMainFrame")); + frame->panel = new wxWindow(frame, wxID_ANY, wxPoint(0, 0), wxSize(400, 400), 0, wxT("MyMainFrame")); frame->Show(true); // Return the main frame window @@ -96,12 +96,12 @@ void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event)) { #if ( defined(__WXPM__) || defined(__WXMSW__) ) && !defined(__WXUNIVERSAL__) MyDialog dialog; - if (dialog.LoadNativeDialog(this, _T("dialog1"))) + if (dialog.LoadNativeDialog(this, wxT("dialog1"))) { dialog.ShowModal(); } #else - wxMessageBox(_T("No native dialog support"),_T("Platform limitation")); + wxMessageBox(wxT("No native dialog support"),wxT("Platform limitation")); #endif } diff --git a/samples/notebook/notebook.cpp b/samples/notebook/notebook.cpp index 63116dd916..31d2067898 100644 --- a/samples/notebook/notebook.cpp +++ b/samples/notebook/notebook.cpp @@ -213,7 +213,7 @@ wxPanel *CreatePage(wxBookCtrlBase *parent, const wxString&pageName) if ( pageName == MAXIMIZED_BUTTON_PAGE_NAME ) return CreateBigButtonPage(parent); - wxFAIL_MSG( _T("unknown page name") ); + wxFAIL_MSG( wxT("unknown page name") ); return NULL; } @@ -461,7 +461,7 @@ MyFrame::~MyFrame() CASE_TOOLBOOK(before toolb after) \ \ default: \ - wxFAIL_MSG( _T("unknown book control type") ); \ + wxFAIL_MSG( wxT("unknown book control type") ); \ } int MyFrame::TranslateBookFlag(int nb, int lb, int chb, int tbk, int toolbk) const @@ -584,7 +584,7 @@ void MyFrame::AddFlagStrIfFlagPresent(wxString & flagStr, long flags, long flag, if( (flags & flag) == flag ) { if( !flagStr.empty() ) - flagStr += _T(" | "); + flagStr += wxT(" | "); flagStr += flagName; } } @@ -628,10 +628,10 @@ void MyFrame::OnHitTest(wxCommandEvent& WXUNUSED(event)) wxString flagsStr; - AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_NOWHERE, _T("wxBK_HITTEST_NOWHERE") ); - AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONICON, _T("wxBK_HITTEST_ONICON") ); - AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONLABEL, _T("wxBK_HITTEST_ONLABEL") ); - AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONPAGE, _T("wxBK_HITTEST_ONPAGE") ); + AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_NOWHERE, wxT("wxBK_HITTEST_NOWHERE") ); + AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONICON, wxT("wxBK_HITTEST_ONICON") ); + AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONLABEL, wxT("wxBK_HITTEST_ONLABEL") ); + AddFlagStrIfFlagPresent( flagsStr, flags, wxBK_HITTEST_ONPAGE, wxT("wxBK_HITTEST_ONPAGE") ); wxLogMessage(wxT("HitTest at (%d,%d): %d: %s"), pt.x, @@ -678,7 +678,7 @@ void MyFrame::OnMulti(wxCommandEvent& event) m_multi = event.IsChecked(); RecreateBook(); m_sizerFrame->Layout(); - wxLogMessage(_T("Multiline setting works only in wxNotebook.")); + wxLogMessage(wxT("Multiline setting works only in wxNotebook.")); } void MyFrame::OnExit(wxCommandEvent& WXUNUSED(event)) @@ -731,7 +731,7 @@ void MyFrame::OnAddSubPage(wxCommandEvent& WXUNUSED(event)) const int selPos = currBook->GetSelection(); if ( selPos == wxNOT_FOUND ) { - wxLogError(_T("Select the parent page first!")); + wxLogError(wxT("Select the parent page first!")); return; } @@ -759,7 +759,7 @@ void MyFrame::OnAddPageBefore(wxCommandEvent& WXUNUSED(event)) const int selPos = currBook->GetSelection(); if ( selPos == wxNOT_FOUND ) { - wxLogError(_T("Select the parent page first!")); + wxLogError(wxT("Select the parent page first!")); return; } @@ -890,35 +890,35 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event) { wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, - _T("wxNotebook") + wxT("wxNotebook") }, #endif // wxUSE_NOTEBOOK #if wxUSE_LISTBOOK { wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED, wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING, - _T("wxListbook") + wxT("wxListbook") }, #endif // wxUSE_LISTBOOK #if wxUSE_CHOICEBOOK { wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED, wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING, - _T("wxChoicebook") + wxT("wxChoicebook") }, #endif // wxUSE_CHOICEBOOK #if wxUSE_TREEBOOK { wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED, wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING, - _T("wxTreebook") + wxT("wxTreebook") }, #endif // wxUSE_TREEBOOK #if wxUSE_TOOLBOOK { wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED, wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING, - _T("wxToolbook") + wxT("wxToolbook") }, #endif // wxUSE_TOOLBOOK }; @@ -956,7 +956,7 @@ void MyFrame::OnBookCtrl(wxBookCtrlBaseEvent& event) ) != wxYES ) { event.Veto(); - veto = _T(" (vetoed)"); + veto = wxT(" (vetoed)"); } } diff --git a/samples/oleauto/oleauto.cpp b/samples/oleauto/oleauto.cpp index f803eaf7c0..383ef4d012 100644 --- a/samples/oleauto/oleauto.cpp +++ b/samples/oleauto/oleauto.cpp @@ -129,7 +129,7 @@ bool MyApp::OnInit() return false; // Create the main application window - MyFrame *frame = new MyFrame(_T("OleAuto wxWidgets App"), + MyFrame *frame = new MyFrame(wxT("OleAuto wxWidgets App"), wxPoint(50, 50), wxSize(450, 340)); // Show it and tell the application that it's our main window @@ -157,14 +157,14 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->Append(OleAuto_Test, _T("&Test Excel Automation...")); - menuFile->Append(OleAuto_About, _T("&About...")); + menuFile->Append(OleAuto_Test, wxT("&Test Excel Automation...")); + menuFile->Append(OleAuto_About, wxT("&About...")); menuFile->AppendSeparator(); - menuFile->Append(OleAuto_Quit, _T("E&xit")); + menuFile->Append(OleAuto_Quit, wxT("E&xit")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menuFile, _T("&File")); + menuBar->Append(menuFile, wxT("&File")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -172,7 +172,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR } @@ -187,8 +187,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("This is an OLE Automation sample"), - _T("About OleAuto"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(wxT("This is an OLE Automation sample"), + wxT("About OleAuto"), wxOK | wxICON_INFORMATION, this); } /* Tests OLE automation by making the active Excel cell bold, @@ -196,49 +196,49 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) */ void MyFrame::OnTest(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Please ensure Excel is running, then press OK.\nThe active cell should then say 'wxWidgets automation test!' in bold.")); + wxMessageBox(wxT("Please ensure Excel is running, then press OK.\nThe active cell should then say 'wxWidgets automation test!' in bold.")); wxAutomationObject excelObject, rangeObject; - if (!excelObject.GetInstance(_T("Excel.Application"))) + if (!excelObject.GetInstance(wxT("Excel.Application"))) { // Start Excel if it is not running - if (!excelObject.CreateInstance(_T("Excel.Application"))) + if (!excelObject.CreateInstance(wxT("Excel.Application"))) { - wxMessageBox(_T("Could not create Excel object.")); + wxMessageBox(wxT("Could not create Excel object.")); return; } } // Ensure that Excel is visible - if (!excelObject.PutProperty(_T("Visible"), true)) + if (!excelObject.PutProperty(wxT("Visible"), true)) { - wxMessageBox(_T("Could not make Excel object visible")); + wxMessageBox(wxT("Could not make Excel object visible")); } - const wxVariant workbooksCountVariant = excelObject.GetProperty(_T("Workbooks.Count")); + const wxVariant workbooksCountVariant = excelObject.GetProperty(wxT("Workbooks.Count")); if (workbooksCountVariant.IsNull()) { - wxMessageBox(_T("Could not get workbooks count")); + wxMessageBox(wxT("Could not get workbooks count")); return; } const long workbooksCount = workbooksCountVariant; if (workbooksCount == 0) { - const wxVariant workbook = excelObject.CallMethod(_T("Workbooks.Add")); + const wxVariant workbook = excelObject.CallMethod(wxT("Workbooks.Add")); if (workbook.IsNull()) { - wxMessageBox(_T("Could not create new Workbook")); + wxMessageBox(wxT("Could not create new Workbook")); return; } } - if (!excelObject.PutProperty(_T("ActiveCell.Value"), _T("wxWidgets automation test!"))) + if (!excelObject.PutProperty(wxT("ActiveCell.Value"), wxT("wxWidgets automation test!"))) { - wxMessageBox(_T("Could not set active cell value.")); + wxMessageBox(wxT("Could not set active cell value.")); return; } - if (!excelObject.PutProperty(_T("ActiveCell.Font.Bold"), wxVariant(true)) ) + if (!excelObject.PutProperty(wxT("ActiveCell.Font.Bold"), wxVariant(true)) ) { - wxMessageBox(_T("Could not put Bold property to active cell.")); + wxMessageBox(wxT("Could not put Bold property to active cell.")); return; } } diff --git a/samples/opengl/cube/cube.cpp b/samples/opengl/cube/cube.cpp index 74cd1bf7eb..7396d9bb5e 100644 --- a/samples/opengl/cube/cube.cpp +++ b/samples/opengl/cube/cube.cpp @@ -57,20 +57,20 @@ static void CheckGLError() // so check that we get a different error than the last time if ( err == errLast ) { - wxLogError(_T("OpenGL error state couldn't be reset.")); + wxLogError(wxT("OpenGL error state couldn't be reset.")); return; } errLast = err; - wxLogError(_T("OpenGL error %d"), err); + wxLogError(wxT("OpenGL error %d"), err); } } // function to draw the texture for cube faces static wxImage DrawDice(int size, unsigned num) { - wxASSERT_MSG( num >= 1 && num <= 6, _T("invalid dice index") ); + wxASSERT_MSG( num >= 1 && num <= 6, wxT("invalid dice index") ); const int dot = size/16; // radius of a single dot const int gap = 5*size/32; // gap between dots @@ -369,7 +369,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE() MyFrame::MyFrame() - : wxFrame(NULL, wxID_ANY, _T("wxWidgets OpenGL Cube Sample")) + : wxFrame(NULL, wxID_ANY, wxT("wxWidgets OpenGL Cube Sample")) { new TestGLCanvas(this); @@ -381,7 +381,7 @@ MyFrame::MyFrame() menu->AppendSeparator(); menu->Append(wxID_CLOSE); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menu, _T("&Cube")); + menuBar->Append(menu, wxT("&Cube")); SetMenuBar(menuBar); diff --git a/samples/opengl/isosurf/isosurf.cpp b/samples/opengl/isosurf/isosurf.cpp index 8798d37922..471942b637 100644 --- a/samples/opengl/isosurf/isosurf.cpp +++ b/samples/opengl/isosurf/isosurf.cpp @@ -103,9 +103,9 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, // Make a menubar wxMenu *fileMenu = new wxMenu; - fileMenu->Append(wxID_EXIT, _T("E&xit")); + fileMenu->Append(wxID_EXIT, wxT("E&xit")); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(fileMenu, _T("&File")); + menuBar->Append(fileMenu, wxT("&File")); SetMenuBar(menuBar); @@ -230,7 +230,7 @@ void TestGLCanvas::LoadSurface(const wxString& filename) delete stream; - wxLogMessage(_T("Loaded %d vertices, %d triangles from '%s'"), + wxLogMessage(wxT("Loaded %d vertices, %d triangles from '%s'"), m_numverts, m_numverts-2, filename.c_str()); // NOTE: for some reason under wxGTK the following is required to avoid that diff --git a/samples/ownerdrw/ownerdrw.cpp b/samples/ownerdrw/ownerdrw.cpp index de9d8f4cde..f7c3a5d32b 100644 --- a/samples/ownerdrw/ownerdrw.cpp +++ b/samples/ownerdrw/ownerdrw.cpp @@ -92,7 +92,7 @@ bool OwnerDrawnApp::OnInit(void) return false; OwnerDrawnFrame *pFrame - = new OwnerDrawnFrame(NULL, _T("wxWidgets Ownerdraw Sample"), + = new OwnerDrawnFrame(NULL, wxT("wxWidgets Ownerdraw Sample"), 50, 50, 450, 340); SetTopWindow(pFrame); @@ -118,75 +118,75 @@ void OwnerDrawnFrame::InitMenu() fontBmp(14, wxDEFAULT, wxNORMAL, wxNORMAL, false); // sorry for my artistic skills... - wxBitmap bmpBell(_T("bell")), - bmpSound(_T("sound")), - bmpNoSound(_T("nosound")), - bmpInfo(_T("info")), - bmpInfo_mono(_T("info_mono")); + wxBitmap bmpBell(wxT("bell")), + bmpSound(wxT("sound")), + bmpNoSound(wxT("nosound")), + bmpInfo(wxT("info")), + bmpInfo_mono(wxT("info_mono")); // construct submenu - pItem = new wxMenuItem(sub_menu, Menu_Sub1, _T("Submenu &first"), _T("large")); + pItem = new wxMenuItem(sub_menu, Menu_Sub1, wxT("Submenu &first"), wxT("large")); pItem->SetFont(fontLarge); sub_menu->Append(pItem); - pItem = new wxMenuItem(sub_menu, Menu_Sub2, _T("Submenu &second"), _T("italic"), + pItem = new wxMenuItem(sub_menu, Menu_Sub2, wxT("Submenu &second"), wxT("italic"), wxITEM_CHECK); pItem->SetFont(fontItalic); sub_menu->Append(pItem); - pItem = new wxMenuItem(sub_menu, Menu_Sub3, _T("Submenu &third"), _T("underlined"), + pItem = new wxMenuItem(sub_menu, Menu_Sub3, wxT("Submenu &third"), wxT("underlined"), wxITEM_CHECK); pItem->SetFont(fontUlined); sub_menu->Append(pItem); // construct menu - pItem = new wxMenuItem(file_menu, Menu_Test1, _T("&Uncheckable"), _T("red item")); + pItem = new wxMenuItem(file_menu, Menu_Test1, wxT("&Uncheckable"), wxT("red item")); pItem->SetFont(*wxITALIC_FONT); pItem->SetTextColour(wxColor(255, 0, 0)); file_menu->Append(pItem); - pItem = new wxMenuItem(file_menu, Menu_Test2, _T("&Checkable"), - _T("checkable item"), wxITEM_CHECK); + pItem = new wxMenuItem(file_menu, Menu_Test2, wxT("&Checkable"), + wxT("checkable item"), wxITEM_CHECK); pItem->SetFont(*wxSMALL_FONT); file_menu->Append(pItem); file_menu->Check(Menu_Test2, true); - pItem = new wxMenuItem(file_menu, Menu_Test3, _T("&Disabled"), _T("disabled item")); + pItem = new wxMenuItem(file_menu, Menu_Test3, wxT("&Disabled"), wxT("disabled item")); pItem->SetFont(*wxNORMAL_FONT); file_menu->Append(pItem); file_menu->Enable(Menu_Test3, false); file_menu->AppendSeparator(); - pItem = new wxMenuItem(file_menu, Menu_Bitmap, _T("&Bell"), - _T("check/uncheck me!"), wxITEM_CHECK); + pItem = new wxMenuItem(file_menu, Menu_Bitmap, wxT("&Bell"), + wxT("check/uncheck me!"), wxITEM_CHECK); pItem->SetFont(fontBmp); pItem->SetBitmaps(bmpBell); file_menu->Append(pItem); - pItem = new wxMenuItem(file_menu, Menu_Bitmap2, _T("So&und"), - _T("icon changes!"), wxITEM_CHECK); + pItem = new wxMenuItem(file_menu, Menu_Bitmap2, wxT("So&und"), + wxT("icon changes!"), wxITEM_CHECK); pItem->SetFont(fontBmp); pItem->SetBitmaps(bmpSound, bmpNoSound); file_menu->Append(pItem); file_menu->AppendSeparator(); - pItem = new wxMenuItem(file_menu, Menu_Submenu, _T("&Sub menu"), _T(""), + pItem = new wxMenuItem(file_menu, Menu_Submenu, wxT("&Sub menu"), wxT(""), wxITEM_CHECK, sub_menu); pItem->SetFont(*wxSWISS_FONT); file_menu->Append(pItem); file_menu->AppendSeparator(); - pItem = new wxMenuItem(file_menu, Menu_Toggle, _T("&Disable/Enable\tCtrl+D"), - _T("enables/disables the About-Item"), wxITEM_NORMAL); + pItem = new wxMenuItem(file_menu, Menu_Toggle, wxT("&Disable/Enable\tCtrl+D"), + wxT("enables/disables the About-Item"), wxITEM_NORMAL); pItem->SetFont(*wxNORMAL_FONT); file_menu->Append(pItem); // Of course Ctrl+RatherLongAccel will not work in this example: - pAboutItem = new wxMenuItem(file_menu, Menu_About, _T("&About\tCtrl+RatherLongAccel"), - _T("display program information"), wxITEM_NORMAL); + pAboutItem = new wxMenuItem(file_menu, Menu_About, wxT("&About\tCtrl+RatherLongAccel"), + wxT("display program information"), wxITEM_NORMAL); pAboutItem->SetBitmap(bmpInfo); pAboutItem->SetDisabledBitmap(bmpInfo_mono); file_menu->Append(pAboutItem); @@ -194,13 +194,13 @@ void OwnerDrawnFrame::InitMenu() file_menu->AppendSeparator(); #endif - pItem = new wxMenuItem(file_menu, Menu_Quit, _T("&Quit"), _T("Normal item"), + pItem = new wxMenuItem(file_menu, Menu_Quit, wxT("&Quit"), wxT("Normal item"), wxITEM_NORMAL); file_menu->Append(pItem); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); SetMenuBar(menu_bar); } @@ -210,7 +210,7 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, const wxChar *title, : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { // set the icon - SetIcon(wxIcon(_T("mondrian"))); + SetIcon(wxIcon(wxT("mondrian"))); // create the menu InitMenu(); @@ -220,16 +220,16 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, const wxChar *title, const int widths[] = { -1, 60 }; CreateStatusBar(2); SetStatusWidths(2, widths); - SetStatusText(_T("no selection"), 0); + SetStatusText(wxT("no selection"), 0); #endif // wxUSE_STATUSBAR // make a panel with some controls wxPanel *pPanel = new wxPanel(this); // check list box - static const wxChar* aszChoices[] = { _T("Hello"), _T("world"), _T("and"), - _T("goodbye"), _T("cruel"), _T("world"), - _T("-------"), _T("owner-drawn"), _T("listbox") }; + static const wxChar* aszChoices[] = { wxT("Hello"), wxT("world"), wxT("and"), + wxT("goodbye"), wxT("cruel"), wxT("world"), + wxT("-------"), wxT("owner-drawn"), wxT("listbox") }; wxString *astrChoices = new wxString[WXSIZEOF(aszChoices)]; unsigned int ui; @@ -258,9 +258,9 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, const wxChar *title, m_pListBox->Check(2); // normal (but owner-drawn) listbox - static const wxChar* aszColors[] = { _T("Red"), _T("Blue"), _T("Pink"), - _T("Green"), _T("Yellow"), - _T("Black"), _T("Violet") }; + static const wxChar* aszColors[] = { wxT("Red"), wxT("Blue"), wxT("Pink"), + wxT("Green"), wxT("Yellow"), + wxT("Black"), wxT("Violet") }; astrChoices = new wxString[WXSIZEOF(aszColors)]; @@ -326,8 +326,8 @@ void OwnerDrawnFrame::OnMenuToggle(wxCommandEvent& WXUNUSED(event)) void OwnerDrawnFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageDialog dialog(this, - _T("Demo of owner-drawn controls\n"), - _T("About wxOwnerDrawn"), wxYES_NO | wxCANCEL); + wxT("Demo of owner-drawn controls\n"), + wxT("About wxOwnerDrawn"), wxYES_NO | wxCANCEL); dialog.ShowModal(); } diff --git a/samples/popup/popup.cpp b/samples/popup/popup.cpp index 547a1bf1a0..d6f5aca84a 100644 --- a/samples/popup/popup.cpp +++ b/samples/popup/popup.cpp @@ -295,7 +295,7 @@ bool MyApp::OnInit() return false; // create the main application window - m_frame = new MyFrame(_T("Popup wxWidgets App")); + m_frame = new MyFrame(wxT("Popup wxWidgets App")); // and show it (the frames, unlike simple controls, are not shown when // created initially) @@ -332,15 +332,15 @@ MyFrame::MyFrame(const wxString& title) // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(Minimal_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(Minimal_About, wxT("&About...\tF1"), wxT("Show about dialog")); - menuFile->Append(Minimal_TestDialog, _T("&Test dialog\tAlt-T"), _T("Test dialog")); - menuFile->Append(Minimal_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Minimal_TestDialog, wxT("&Test dialog\tAlt-T"), wxT("Test dialog")); + menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -349,7 +349,7 @@ MyFrame::MyFrame(const wxString& title) #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR wxPanel *panel = new wxPanel(this, -1); @@ -427,10 +427,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the About dialog of the popup sample.\n") - _T("Welcome to %s"), wxVERSION_STRING); + msg.Printf( wxT("This is the About dialog of the popup sample.\n") + wxT("Welcome to %s"), wxVERSION_STRING); - wxMessageBox(msg, _T("About Popup"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, wxT("About Popup"), wxOK | wxICON_INFORMATION, this); } // ---------------------------------------------------------------------------- diff --git a/samples/power/power.cpp b/samples/power/power.cpp index cbd674d1d3..9f7d040d6b 100644 --- a/samples/power/power.cpp +++ b/samples/power/power.cpp @@ -45,10 +45,10 @@ class MyFrame : public wxFrame { public: MyFrame() - : wxFrame(NULL, wxID_ANY, _T("wxWidgets Power Management Sample"), + : wxFrame(NULL, wxID_ANY, wxT("wxWidgets Power Management Sample"), wxDefaultPosition, wxSize(500, 200)) { - wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, _T(""), + wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY); m_logOld = wxLog::SetActiveTarget(new wxLogTextCtrl(text)); @@ -81,28 +81,28 @@ private: #ifdef wxHAS_POWER_EVENTS void OnSuspending(wxPowerEvent& event) { - wxLogMessage(_T("System suspend starting...")); - if ( wxMessageBox(_T("Veto suspend?"), _T("Please answer"), + wxLogMessage(wxT("System suspend starting...")); + if ( wxMessageBox(wxT("Veto suspend?"), wxT("Please answer"), wxYES_NO, this) == wxYES ) { event.Veto(); - wxLogMessage(_T("Vetoed suspend.")); + wxLogMessage(wxT("Vetoed suspend.")); } } void OnSuspended(wxPowerEvent& WXUNUSED(event)) { - wxLogMessage(_T("System is going to suspend.")); + wxLogMessage(wxT("System is going to suspend.")); } void OnSuspendCancel(wxPowerEvent& WXUNUSED(event)) { - wxLogMessage(_T("System suspend was cancelled.")); + wxLogMessage(wxT("System suspend was cancelled.")); } void OnResume(wxPowerEvent& WXUNUSED(event)) { - wxLogMessage(_T("System resumed from suspend.")); + wxLogMessage(wxT("System resumed from suspend.")); } #endif // wxHAS_POWER_EVENTS @@ -113,19 +113,19 @@ private: switch ( m_powerType = powerType ) { case wxPOWER_SOCKET: - powerStr = _T("wall"); + powerStr = wxT("wall"); break; case wxPOWER_BATTERY: - powerStr = _T("battery"); + powerStr = wxT("battery"); break; default: - wxFAIL_MSG(_T("unknown wxPowerType value")); + wxFAIL_MSG(wxT("unknown wxPowerType value")); // fall through case wxPOWER_UNKNOWN: - powerStr = _T("psychic"); + powerStr = wxT("psychic"); break; } @@ -133,32 +133,32 @@ private: switch ( m_batteryState = batteryState ) { case wxBATTERY_NORMAL_STATE: - batteryStr = _T("charged"); + batteryStr = wxT("charged"); break; case wxBATTERY_LOW_STATE: - batteryStr = _T("low"); + batteryStr = wxT("low"); break; case wxBATTERY_CRITICAL_STATE: - batteryStr = _T("critical"); + batteryStr = wxT("critical"); break; case wxBATTERY_SHUTDOWN_STATE: - batteryStr = _T("empty"); + batteryStr = wxT("empty"); break; default: - wxFAIL_MSG(_T("unknown wxBatteryState value")); + wxFAIL_MSG(wxT("unknown wxBatteryState value")); // fall through case wxBATTERY_UNKNOWN_STATE: - batteryStr = _T("unknown"); + batteryStr = wxT("unknown"); break; } SetStatusText(wxString::Format( - _T("System is on %s power, battery state is %s"), + wxT("System is on %s power, battery state is %s"), powerStr.c_str(), batteryStr.c_str())); } diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index fd48a07d30..735b36f391 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -117,7 +117,7 @@ bool MyApp::OnInit(void) // Create the main frame window // ---------------------------- - MyFrame* frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Printing Demo"), + MyFrame* frame = new MyFrame((wxFrame *) NULL, wxT("wxWidgets Printing Demo"), wxPoint(0, 0), wxSize(400, 400)); frame->Centre(wxBOTH); @@ -282,7 +282,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString&title, const wxPoint&pos, const #if wxUSE_STATUSBAR // Give us a status line CreateStatusBar(2); - SetStatusText(_T("Printing demo")); + SetStatusText(wxT("Printing demo")); #endif // wxUSE_STATUSBAR // Load icon and bitmap @@ -291,12 +291,12 @@ MyFrame::MyFrame(wxFrame *frame, const wxString&title, const wxPoint&pos, const // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(wxID_PRINT, _T("&Print..."), _T("Print")); - file_menu->Append(WXPRINT_PAGE_SETUP, _T("Page Set&up..."), _T("Page setup")); + file_menu->Append(wxID_PRINT, wxT("&Print..."), wxT("Print")); + file_menu->Append(WXPRINT_PAGE_SETUP, wxT("Page Set&up..."), wxT("Page setup")); #ifdef __WXMAC__ - file_menu->Append(WXPRINT_PAGE_MARGINS, _T("Page Margins..."), _T("Page margins")); + file_menu->Append(WXPRINT_PAGE_MARGINS, wxT("Page Margins..."), wxT("Page margins")); #endif - file_menu->Append(wxID_PREVIEW, _T("Print Pre&view"), _T("Preview")); + file_menu->Append(wxID_PREVIEW, wxT("Print Pre&view"), wxT("Preview")); #if wxUSE_ACCEL // Accelerators @@ -308,24 +308,24 @@ MyFrame::MyFrame(wxFrame *frame, const wxString&title, const wxPoint&pos, const #if defined(__WXMSW__) &&wxTEST_POSTSCRIPT_IN_MSW file_menu->AppendSeparator(); - file_menu->Append(WXPRINT_PRINT_PS, _T("Print PostScript..."), _T("Print (PostScript)")); - file_menu->Append(WXPRINT_PAGE_SETUP_PS, _T("Page Setup PostScript..."), _T("Page setup (PostScript)")); - file_menu->Append(WXPRINT_PREVIEW_PS, _T("Print Preview PostScript"), _T("Preview (PostScript)")); + file_menu->Append(WXPRINT_PRINT_PS, wxT("Print PostScript..."), wxT("Print (PostScript)")); + file_menu->Append(WXPRINT_PAGE_SETUP_PS, wxT("Page Setup PostScript..."), wxT("Page setup (PostScript)")); + file_menu->Append(WXPRINT_PREVIEW_PS, wxT("Print Preview PostScript"), wxT("Preview (PostScript)")); #endif file_menu->AppendSeparator(); - file_menu->Append(WXPRINT_ANGLEUP, _T("Angle up\tAlt-U"), _T("Raise rotated text angle")); - file_menu->Append(WXPRINT_ANGLEDOWN, _T("Angle down\tAlt-D"), _T("Lower rotated text angle")); + file_menu->Append(WXPRINT_ANGLEUP, wxT("Angle up\tAlt-U"), wxT("Raise rotated text angle")); + file_menu->Append(WXPRINT_ANGLEDOWN, wxT("Angle down\tAlt-D"), wxT("Lower rotated text angle")); file_menu->AppendSeparator(); - file_menu->Append(wxID_EXIT, _T("E&xit"), _T("Exit program")); + file_menu->Append(wxID_EXIT, wxT("E&xit"), wxT("Exit program")); wxMenu *help_menu = new wxMenu; - help_menu->Append(wxID_ABOUT, _T("&About"), _T("About this demo")); + help_menu->Append(wxID_ABOUT, wxT("&About"), wxT("About this demo")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); - menu_bar->Append(help_menu, _T("&Help")); + menu_bar->Append(file_menu, wxT("&File")); + menu_bar->Append(help_menu, wxT("&Help")); // Associate the menu bar with the frame SetMenuBar(menu_bar); @@ -351,16 +351,16 @@ void MyFrame::OnPrint(wxCommandEvent& WXUNUSED(event)) wxPrintDialogData printDialogData(* g_printData); wxPrinter printer(&printDialogData); - MyPrintout printout(this, _T("My printout")); + MyPrintout printout(this, wxT("My printout")); if (!printer.Print(this, &printout, true /*prompt*/)) { if (wxPrinter::GetLastError() == wxPRINTER_ERROR) { - wxLogError(_T("There was a problem printing. Perhaps your current printer is not set correctly?")); + wxLogError(wxT("There was a problem printing. Perhaps your current printer is not set correctly?")); } else { - wxLogMessage(_T("You canceled printing")); + wxLogMessage(wxT("You canceled printing")); } } else @@ -378,12 +378,12 @@ void MyFrame::OnPrintPreview(wxCommandEvent& WXUNUSED(event)) if (!preview->IsOk()) { delete preview; - wxLogError(_T("There was a problem previewing.\nPerhaps your current printer is not set correctly?")); + wxLogError(wxT("There was a problem previewing.\nPerhaps your current printer is not set correctly?")); return; } wxPreviewFrame *frame = - new wxPreviewFrame(preview, this, _T("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650)); + new wxPreviewFrame(preview, this, wxT("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650)); frame->Centre(wxBOTH); frame->Initialize(); frame->Show(); @@ -404,7 +404,7 @@ void MyFrame::OnPageSetup(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPrintPS(wxCommandEvent& WXUNUSED(event)) { wxPostScriptPrinter printer(g_printData); - MyPrintout printout(_T("My printout")); + MyPrintout printout(wxT("My printout")); printer.Print(this, &printout, true/*prompt*/); (*g_printData) = printer.GetPrintData(); @@ -416,7 +416,7 @@ void MyFrame::OnPrintPreviewPS(wxCommandEvent& WXUNUSED(event)) wxPrintDialogData printDialogData(* g_printData); wxPrintPreview *preview = new wxPrintPreview(new MyPrintout, new MyPrintout, &printDialogData); wxPreviewFrame *frame = - new wxPreviewFrame(preview, this, _T("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650)); + new wxPreviewFrame(preview, this, wxT("Demo Print Preview"), wxPoint(100, 100), wxSize(600, 650)); frame->Centre(wxBOTH); frame->Initialize(); frame->Show(); @@ -449,8 +449,8 @@ void MyFrame::OnPageMargins(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnPrintAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox(_T("wxWidgets printing demo\nAuthor: Julian Smart"), - _T("About wxWidgets printing demo"), wxOK|wxCENTRE); + (void)wxMessageBox(wxT("wxWidgets printing demo\nAuthor: Julian Smart"), + wxT("About wxWidgets printing demo"), wxOK|wxCENTRE); } void MyFrame::OnAngleUp(wxCommandEvent& WXUNUSED(event)) @@ -662,8 +662,8 @@ void MyPrintout::DrawPageTwo() dc->SetBrush(*wxTRANSPARENT_BRUSH); { // GetTextExtent demo: - wxString words[7] = { _T("This "), _T("is "), _T("GetTextExtent "), - _T("testing "), _T("string. "), _T("Enjoy "), _T("it!") }; + wxString words[7] = { wxT("This "), wxT("is "), wxT("GetTextExtent "), + wxT("testing "), wxT("string. "), wxT("Enjoy "), wxT("it!") }; wxCoord w, h; long x = 200, y= 250; wxFont fnt(15, wxSWISS, wxNORMAL, wxNORMAL); @@ -685,7 +685,7 @@ void MyPrintout::DrawPageTwo() dc->SetFont(wxGetApp().GetTestFont()); - dc->DrawText(_T("Some test text"), 200, 300 ); + dc->DrawText(wxT("Some test text"), 200, 300 ); // TESTING @@ -708,7 +708,7 @@ void MyPrintout::DrawPageTwo() dc->DrawLine( (long)leftMarginLogical, (long)bottomMarginLogical, (long)rightMarginLogical, (long)bottomMarginLogical); - WritePageHeader(this, dc, _T("A header"), logUnitsFactor); + WritePageHeader(this, dc, wxT("A header"), logUnitsFactor); } // Writes a header on a page. Margin units are in millimetres. diff --git a/samples/printing/printing.h b/samples/printing/printing.h index e167f6970d..1dea9dcc66 100644 --- a/samples/printing/printing.h +++ b/samples/printing/printing.h @@ -84,7 +84,7 @@ private: class MyPrintout: public wxPrintout { public: - MyPrintout(MyFrame* frame, const wxString &title = _T("My printout")) + MyPrintout(MyFrame* frame, const wxString &title = wxT("My printout")) : wxPrintout(title) { m_frame=frame; } bool OnPrintPage(int page); diff --git a/samples/propgrid/propgrid.cpp b/samples/propgrid/propgrid.cpp index 2585d1fb15..f2b0a821d2 100644 --- a/samples/propgrid/propgrid.cpp +++ b/samples/propgrid/propgrid.cpp @@ -2784,7 +2784,7 @@ void FormMain::OnAbout(wxCommandEvent& WXUNUSED(event)) wxT("Jaakko Salli"), wxVERSION_STRING ); - wxMessageBox(msg, _T("About"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this); } // ----------------------------------------------------------------------- diff --git a/samples/regtest/regtest.cpp b/samples/regtest/regtest.cpp index 4ead1d3df7..3baae4694f 100644 --- a/samples/regtest/regtest.cpp +++ b/samples/regtest/regtest.cpp @@ -290,23 +290,23 @@ END_EVENT_TABLE() wxMenu *CreateRegistryMenu() { wxMenu *pMenuNew = new wxMenu; - pMenuNew->Append(Menu_NewKey, _T("&Key"), _T("Create a new key")); + pMenuNew->Append(Menu_NewKey, wxT("&Key"), wxT("Create a new key")); pMenuNew->AppendSeparator(); - pMenuNew->Append(Menu_NewText, _T("&Text value"), _T("Create a new text value")); - pMenuNew->Append(Menu_NewBinary, _T("&Binary value"), _T("Create a new binary value")); + pMenuNew->Append(Menu_NewText, wxT("&Text value"), wxT("Create a new text value")); + pMenuNew->Append(Menu_NewBinary, wxT("&Binary value"), wxT("Create a new binary value")); wxMenu *pMenuReg = new wxMenu; - pMenuReg->Append(Menu_New, _T("&New"), pMenuNew); - pMenuReg->Append(Menu_Delete, _T("&Delete..."), _T("Delete selected key/value")); + pMenuReg->Append(Menu_New, wxT("&New"), pMenuNew); + pMenuReg->Append(Menu_Delete, wxT("&Delete..."), wxT("Delete selected key/value")); pMenuReg->AppendSeparator(); - pMenuReg->Append(Menu_GoTo, _T("&Go to...\tCtrl-G"), _T("Go to registry key")); - pMenuReg->Append(Menu_Expand, _T("&Expand"), _T("Expand current key")); - pMenuReg->Append(Menu_Collapse, _T("&Collapse"), _T("Collapse current key")); - pMenuReg->Append(Menu_Toggle, _T("&Toggle"), _T("Toggle current key")); + pMenuReg->Append(Menu_GoTo, wxT("&Go to...\tCtrl-G"), wxT("Go to registry key")); + pMenuReg->Append(Menu_Expand, wxT("&Expand"), wxT("Expand current key")); + pMenuReg->Append(Menu_Collapse, wxT("&Collapse"), wxT("Collapse current key")); + pMenuReg->Append(Menu_Toggle, wxT("&Toggle"), wxT("Toggle current key")); pMenuReg->AppendSeparator(); - pMenuReg->Append(Menu_Refresh, _T("&Refresh"), _T("Refresh the subtree")); + pMenuReg->Append(Menu_Refresh, wxT("&Refresh"), wxT("Refresh the subtree")); pMenuReg->AppendSeparator(); - pMenuReg->Append(Menu_Info, _T("&Properties"),_T("Information about current selection")); + pMenuReg->Append(Menu_Info, wxT("&Properties"),wxT("Information about current selection")); return pMenuReg; } @@ -323,7 +323,7 @@ bool RegApp::OnInit() return false; // create the main frame window and show it - RegFrame *frame = new RegFrame(NULL, _T("wxRegTest"), 50, 50, 600, 350); + RegFrame *frame = new RegFrame(NULL, wxT("wxRegTest"), 50, 50, 600, 350); frame->Show(true); SetTopWindow(frame); @@ -343,20 +343,20 @@ RegFrame::RegFrame(wxFrame *parent, const wxChar *title, int x, int y, int w, in // set the icon // ------------ - SetIcon(wxIcon(_T("app_icon"))); + SetIcon(wxIcon(wxT("app_icon"))); // create menu // ----------- wxMenu *pMenuFile = new wxMenu; - pMenuFile->Append(Menu_Test, _T("Te&st"), _T("Test key creation")); + pMenuFile->Append(Menu_Test, wxT("Te&st"), wxT("Test key creation")); pMenuFile->AppendSeparator(); - pMenuFile->Append(Menu_About, _T("&About..."), _T("Show an extraordinarly beautiful dialog")); + pMenuFile->Append(Menu_About, wxT("&About..."), wxT("Show an extraordinarly beautiful dialog")); pMenuFile->AppendSeparator(); - pMenuFile->Append(Menu_Quit, _T("E&xit"), _T("Quit this program")); + pMenuFile->Append(Menu_Quit, wxT("E&xit"), wxT("Quit this program")); wxMenuBar *pMenu = new wxMenuBar; - pMenu->Append(pMenuFile, _T("&File")); - pMenu->Append(CreateRegistryMenu(), _T("&Registry")); + pMenu->Append(pMenuFile, wxT("&File")); + pMenu->Append(CreateRegistryMenu(), wxT("&Registry")); SetMenuBar(pMenu); #if DO_REGTEST @@ -388,9 +388,9 @@ void RegFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void RegFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxMessageDialog dialog(this, - _T("wxRegistry sample\n") - _T("(c) 1998, 2000 Vadim Zeitlin"), - _T("About wxRegTest"), wxOK); + wxT("wxRegistry sample\n") + wxT("(c) 1998, 2000 Vadim Zeitlin"), + wxT("About wxRegTest"), wxOK); dialog.ShowModal(); } @@ -404,11 +404,11 @@ void RegFrame::OnTest(wxCommandEvent& WXUNUSED(event)) void RegFrame::OnGoTo(wxCommandEvent& WXUNUSED(event)) { - static wxString s_location = _T("HKEY_CURRENT_USER\\Software\\wxWidgets"); + static wxString s_location = wxT("HKEY_CURRENT_USER\\Software\\wxWidgets"); wxString location = wxGetTextFromUser( - _T("Enter the location to go to:"), - _T("wxRegTest question"), + wxT("Enter the location to go to:"), + wxT("wxRegTest question"), s_location, this); @@ -462,7 +462,7 @@ void RegFrame::OnNewKey(wxCommandEvent& WXUNUSED(event)) if ( m_treeCtrl->IsKeySelected() ) { m_treeCtrl->CreateNewKey( - wxGetTextFromUser(_T("Enter the name of the new key"))); + wxGetTextFromUser(wxT("Enter the name of the new key"))); } #endif } @@ -473,7 +473,7 @@ void RegFrame::OnNewText(wxCommandEvent& WXUNUSED(event)) if ( m_treeCtrl->IsKeySelected() ) { m_treeCtrl->CreateNewTextValue( - wxGetTextFromUser(_T("Enter the name for the new text value"))); + wxGetTextFromUser(wxT("Enter the name for the new text value"))); } #endif } @@ -484,7 +484,7 @@ void RegFrame::OnNewBinary(wxCommandEvent& WXUNUSED(event)) if ( m_treeCtrl->IsKeySelected() ) { m_treeCtrl->CreateNewBinaryValue( - wxGetTextFromUser(_T("Enter the name for the new binary value"))); + wxGetTextFromUser(wxT("Enter the name for the new binary value"))); } #endif } @@ -502,8 +502,8 @@ void RegFrame::OnInfo(wxCommandEvent& WXUNUSED(event)) RegImageList::RegImageList() : wxImageList(16, 16, true) { // should be in sync with enum RegImageList::RegIcon - static const wxChar *aszIcons[] = { _T("key1"),_T("key2"),_T("key3"),_T("value1"),_T("value2") }; - wxString str = _T("icon_"); + static const wxChar *aszIcons[] = { wxT("key1"),wxT("key2"),wxT("key3"),wxT("value1"),wxT("value2") }; + wxString str = wxT("icon_"); for ( unsigned int n = 0; n < WXSIZEOF(aszIcons); n++ ) { Add(wxIcon(str + aszIcons[n], wxBITMAP_TYPE_ICO_RESOURCE)); @@ -582,7 +582,7 @@ RegTreeCtrl::RegTreeCtrl(wxWindow *parent, wxWindowID id) // create root keys // ---------------- - m_pRoot = InsertNewTreeNode(NULL, _T("Registry Root"), RegImageList::Root); + m_pRoot = InsertNewTreeNode(NULL, wxT("Registry Root"), RegImageList::Root); // create popup menu // ----------------- @@ -659,16 +659,16 @@ void RegTreeCtrl::OnMenuTest() return; } - wxRegKey key1(pNode->Key(), _T("key1")); + wxRegKey key1(pNode->Key(), wxT("key1")); if ( key1.Create() ) { - wxRegKey key2a(key1, _T("key2a")), key2b(key1, _T("key2b")); + wxRegKey key2a(key1, wxT("key2a")), key2b(key1, wxT("key2b")); if ( key2a.Create() && key2b.Create() ) { // put some values under the newly created keys - key1.SetValue(wxT("first_term"), _T("10")); - key1.SetValue(wxT("second_term"), _T("7")); - key2a = _T("this is the unnamed value"); + key1.SetValue(wxT("first_term"), wxT("10")); + key1.SetValue(wxT("second_term"), wxT("7")); + key2a = wxT("this is the unnamed value"); key2b.SetValue(wxT("sum"), 17); // refresh tree @@ -743,7 +743,7 @@ void RegTreeCtrl::OnBeginEdit(wxTreeEvent& event) TreeNode *pNode = GetNode(event); if ( pNode->IsRoot() || pNode->Parent()->IsRoot() ) { - wxLogStatus(_T("This registry key can't be renamed.")); + wxLogStatus(wxT("This registry key can't be renamed.")); event.Veto(); } @@ -775,7 +775,7 @@ void RegTreeCtrl::OnEndEdit(wxTreeEvent& event) if ( !ok ) { - wxLogError(_T("Failed to rename '%s' to '%s'."), + wxLogError(wxT("Failed to rename '%s' to '%s'."), m_nameOld.c_str(), name.c_str()); } #if 0 // MSW tree ctrl doesn't like this at all, it hangs @@ -845,8 +845,8 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event) nameDst << wxString(dst->FullName()).AfterFirst('\\') << '\\' << wxString(src->FullName()).AfterLast('\\'); - wxString verb = m_copyOnDrop ? _T("copy") : _T("move"); - wxString what = isKey ? _T("key") : _T("value"); + wxString verb = m_copyOnDrop ? wxT("copy") : wxT("move"); + wxString what = isKey ? wxT("key") : wxT("value"); if ( wxMessageBox(wxString::Format ( @@ -856,7 +856,7 @@ void RegTreeCtrl::OnEndDrag(wxTreeEvent& event) nameSrc.c_str(), nameDst.c_str() ), - _T("RegTest Confirm"), + wxT("RegTest Confirm"), wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) { return; } @@ -969,10 +969,10 @@ bool RegTreeCtrl::TreeNode::OnExpand() { wxString strItem; if (str.empty()) - strItem = _T(""); + strItem = wxT(""); else strItem = str; - strItem += _T(" = "); + strItem += wxT(" = "); // determine the appropriate icon RegImageList::Icon icon; @@ -1129,7 +1129,7 @@ const wxChar *RegTreeCtrl::TreeNode::FullName() const void RegTreeCtrl::GoTo(const wxString& location) { - wxStringTokenizer tk(location, _T("\\")); + wxStringTokenizer tk(location, wxT("\\")); wxTreeItemId id = GetRootItem(); @@ -1172,7 +1172,7 @@ void RegTreeCtrl::GoTo(const wxString& location) if ( !id.IsOk() ) { - wxLogError(_T("No such key '%s'."), location.c_str()); + wxLogError(wxT("No such key '%s'."), location.c_str()); return; } @@ -1204,13 +1204,13 @@ void RegTreeCtrl::DeleteSelected() return; } - wxString what = pCurrent->IsKey() ? _T("key") : _T("value"); + wxString what = pCurrent->IsKey() ? wxT("key") : wxT("value"); if ( wxMessageBox(wxString::Format ( wxT("Do you really want to delete this %s?"), what.c_str() ), - _T("Confirmation"), + wxT("Confirmation"), wxICON_QUESTION | wxYES_NO | wxCANCEL, this) != wxYES ) { return; diff --git a/samples/render/renddll.cpp b/samples/render/renddll.cpp index bcf4e698f3..3789822551 100644 --- a/samples/render/renddll.cpp +++ b/samples/render/renddll.cpp @@ -51,12 +51,12 @@ public: #if 0 // just for debugging MyDllRenderer() { - wxMessageBox(_T("Creating MyDllRenderer"), _T("Renderer Sample")); + wxMessageBox(wxT("Creating MyDllRenderer"), wxT("Renderer Sample")); } virtual ~MyDllRenderer() { - wxMessageBox(_T("Deleting MyDllRenderer"), _T("Renderer Sample")); + wxMessageBox(wxT("Deleting MyDllRenderer"), wxT("Renderer Sample")); } #endif // 0 }; diff --git a/samples/render/render.cpp b/samples/render/render.cpp index 782bd03f70..0233d24bce 100644 --- a/samples/render/render.cpp +++ b/samples/render/render.cpp @@ -69,7 +69,7 @@ public: dc.SetBrush(*wxBLUE_BRUSH); dc.SetTextForeground(*wxWHITE); dc.DrawRoundedRectangle(rect, 5); - dc.DrawLabel(_T("MyRenderer"), wxNullBitmap, rect, wxALIGN_CENTER); + dc.DrawLabel(wxT("MyRenderer"), wxNullBitmap, rect, wxALIGN_CENTER); return rect.width; } }; @@ -130,8 +130,8 @@ public: { wxPaintDC dc(this); - dc.DrawText(_T("Below is the standard header button drawn"), 10, 10); - dc.DrawText(_T("using the current renderer:"), 10, 40); + dc.DrawText(wxT("Below is the standard header button drawn"), 10, 10); + dc.DrawText(wxT("using the current renderer:"), 10, 40); wxRendererNative& renderer = wxRendererNative::Get(); const wxCoord height = renderer.GetHeaderButtonHeight(this); @@ -220,7 +220,7 @@ bool MyApp::OnInit() MyFrame::MyFrame() : wxFrame(NULL, wxID_ANY, - _T("Render wxWidgets Sample"), + wxT("Render wxWidgets Sample"), wxPoint(50, 50), wxSize(450, 340)) { @@ -231,19 +231,19 @@ MyFrame::MyFrame() // create a menu bar wxMenu *menuFile = new wxMenu; #if wxUSE_DYNLIB_CLASS - menuFile->Append(Render_Load, _T("&Load renderer...\tCtrl-L")); - menuFile->Append(Render_Unload, _T("&Unload renderer\tCtrl-U")); + menuFile->Append(Render_Load, wxT("&Load renderer...\tCtrl-L")); + menuFile->Append(Render_Unload, wxT("&Unload renderer\tCtrl-U")); #endif // wxUSE_DYNLIB_CLASS - menuFile->Append(Render_Quit, _T("E&xit\tCtrl-Q"), _T("Quit this program")); + menuFile->Append(Render_Quit, wxT("E&xit\tCtrl-Q"), wxT("Quit this program")); // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(Render_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(Render_About, wxT("&About...\tF1"), wxT("Show about dialog")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -254,7 +254,7 @@ MyFrame::MyFrame() #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR Show(); @@ -272,12 +272,12 @@ MyFrame::~MyFrame() void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event)) { - static wxString s_name = _T("renddll"); + static wxString s_name = wxT("renddll"); wxString name = wxGetTextFromUser ( - _T("Name of the renderer to load:"), - _T("Render wxWidgets Sample"), + wxT("Name of the renderer to load:"), + wxT("Render wxWidgets Sample"), s_name, this ); @@ -292,7 +292,7 @@ void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event)) wxRendererNative *renderer = wxRendererNative::Load(name); if ( !renderer ) { - wxLogError(_T("Failed to load renderer \"%s\"."), name.c_str()); + wxLogError(wxT("Failed to load renderer \"%s\"."), name.c_str()); } else // loaded ok { @@ -300,7 +300,7 @@ void MyFrame::OnLoad(wxCommandEvent& WXUNUSED(event)) m_panel->Refresh(); - wxLogStatus(this, _T("Successfully loaded the renderer \"%s\"."), + wxLogStatus(this, wxT("Successfully loaded the renderer \"%s\"."), name.c_str()); } } @@ -314,11 +314,11 @@ void MyFrame::OnUnload(wxCommandEvent& WXUNUSED(event)) m_panel->Refresh(); - wxLogStatus(this, _T("Unloaded the previously loaded renderer.")); + wxLogStatus(this, wxT("Unloaded the previously loaded renderer.")); } else { - wxLogWarning(_T("No renderer to unload.")); + wxLogWarning(wxT("No renderer to unload.")); } } @@ -332,10 +332,10 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Render sample shows how to use custom renderers.\n") - _T("\n") - _T("(c) 2003 Vadim Zeitlin"), - _T("About Render wxWidgets Sample"), + wxMessageBox(wxT("Render sample shows how to use custom renderers.\n") + wxT("\n") + wxT("(c) 2003 Vadim Zeitlin"), + wxT("About Render wxWidgets Sample"), wxOK | wxICON_INFORMATION, this); } diff --git a/samples/richtext/richtext.cpp b/samples/richtext/richtext.cpp index d41e8e90f9..168a2046f9 100644 --- a/samples/richtext/richtext.cpp +++ b/samples/richtext/richtext.cpp @@ -381,7 +381,7 @@ bool MyApp::OnInit() #endif // create the main application window - MyFrame *frame = new MyFrame(_T("wxRichTextCtrl Sample"), wxID_ANY, wxDefaultPosition, wxSize(700, 600)); + MyFrame *frame = new MyFrame(wxT("wxRichTextCtrl Sample"), wxID_ANY, wxDefaultPosition, wxSize(700, 600)); m_printing->SetParentWindow(frame); @@ -569,21 +569,21 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos, // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(ID_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(ID_About, wxT("&About...\tF1"), wxT("Show about dialog")); - fileMenu->Append(wxID_OPEN, _T("&Open\tCtrl+O"), _T("Open a file")); - fileMenu->Append(wxID_SAVE, _T("&Save\tCtrl+S"), _T("Save a file")); - fileMenu->Append(wxID_SAVEAS, _T("&Save As...\tF12"), _T("Save to a new file")); + fileMenu->Append(wxID_OPEN, wxT("&Open\tCtrl+O"), wxT("Open a file")); + fileMenu->Append(wxID_SAVE, wxT("&Save\tCtrl+S"), wxT("Save a file")); + fileMenu->Append(wxID_SAVEAS, wxT("&Save As...\tF12"), wxT("Save to a new file")); fileMenu->AppendSeparator(); - fileMenu->Append(ID_RELOAD, _T("&Reload Text\tF2"), _T("Reload the initial text")); + fileMenu->Append(ID_RELOAD, wxT("&Reload Text\tF2"), wxT("Reload the initial text")); fileMenu->AppendSeparator(); - fileMenu->Append(ID_PAGE_SETUP, _T("Page Set&up..."), _T("Page setup")); - fileMenu->Append(ID_PRINT, _T("&Print...\tCtrl+P"), _T("Print")); - fileMenu->Append(ID_PREVIEW, _T("Print Pre&view"), _T("Print preview")); + fileMenu->Append(ID_PAGE_SETUP, wxT("Page Set&up..."), wxT("Page setup")); + fileMenu->Append(ID_PRINT, wxT("&Print...\tCtrl+P"), wxT("Print")); + fileMenu->Append(ID_PREVIEW, wxT("Print Pre&view"), wxT("Print preview")); fileMenu->AppendSeparator(); - fileMenu->Append(ID_VIEW_HTML, _T("&View as HTML"), _T("View HTML")); + fileMenu->Append(ID_VIEW_HTML, wxT("&View as HTML"), wxT("View HTML")); fileMenu->AppendSeparator(); - fileMenu->Append(ID_Quit, _T("E&xit\tAlt+X"), _T("Quit this program")); + fileMenu->Append(ID_Quit, wxT("E&xit\tAlt+X"), wxT("Quit this program")); wxMenu* editMenu = new wxMenu; editMenu->Append(wxID_UNDO, _("&Undo\tCtrl+Z")); @@ -643,12 +643,12 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos, // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(fileMenu, _T("&File")); - menuBar->Append(editMenu, _T("&Edit")); - menuBar->Append(formatMenu, _T("F&ormat")); - menuBar->Append(listsMenu, _T("&Lists")); - menuBar->Append(insertMenu, _T("&Insert")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(fileMenu, wxT("&File")); + menuBar->Append(editMenu, wxT("&Edit")); + menuBar->Append(formatMenu, wxT("F&ormat")); + menuBar->Append(listsMenu, wxT("&Lists")); + menuBar->Append(insertMenu, wxT("&Insert")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -661,7 +661,7 @@ MyFrame::MyFrame(const wxString& title, wxWindowID id, const wxPoint& pos, if ( !is_pda ) { CreateStatusBar(2); - SetStatusText(_T("Welcome to wxRichTextCtrl!")); + SetStatusText(wxT("Welcome to wxRichTextCtrl!")); } #endif @@ -937,8 +937,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is a demo for wxRichTextCtrl, a control for editing styled text.\n(c) Julian Smart, 2005")); - wxMessageBox(msg, _T("About wxRichTextCtrl Sample"), wxOK | wxICON_INFORMATION, this); + msg.Printf( wxT("This is a demo for wxRichTextCtrl, a control for editing styled text.\n(c) Julian Smart, 2005")); + wxMessageBox(msg, wxT("About wxRichTextCtrl Sample"), wxOK | wxICON_INFORMATION, this); } // Forward command events to the current rich text control, if any diff --git a/samples/sashtest/sashtest.cpp b/samples/sashtest/sashtest.cpp index 16dd9ff186..7552e91e01 100644 --- a/samples/sashtest/sashtest.cpp +++ b/samples/sashtest/sashtest.cpp @@ -45,30 +45,30 @@ bool MyApp::OnInit(void) // Create the main frame window - frame = new MyFrame(NULL, wxID_ANY, _T("Sash Demo"), wxPoint(0, 0), wxSize(500, 400), + frame = new MyFrame(NULL, wxID_ANY, wxT("Sash Demo"), wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE | wxHSCROLL | wxVSCROLL); // Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ - frame->SetIcon(wxIcon(_T("sashtest_icn"))); + frame->SetIcon(wxIcon(wxT("sashtest_icn"))); #endif // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(SASHTEST_NEW_WINDOW, _T("&New window")); - file_menu->Append(SASHTEST_TOGGLE_WINDOW, _T("&Toggle window")); - file_menu->Append(SASHTEST_QUIT, _T("&Exit")); + file_menu->Append(SASHTEST_NEW_WINDOW, wxT("&New window")); + file_menu->Append(SASHTEST_TOGGLE_WINDOW, wxT("&Toggle window")); + file_menu->Append(SASHTEST_QUIT, wxT("&Exit")); wxMenu *help_menu = new wxMenu; - help_menu->Append(SASHTEST_ABOUT, _T("&About")); + help_menu->Append(SASHTEST_ABOUT, wxT("&About")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); - menu_bar->Append(help_menu, _T("&Help")); + menu_bar->Append(file_menu, wxT("&File")); + menu_bar->Append(help_menu, wxT("&Help")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); @@ -141,7 +141,7 @@ MyFrame::MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, c wxTextCtrl* textWindow = new wxTextCtrl(win, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxSUNKEN_BORDER); // wxTE_MULTILINE|wxNO_BORDER); - textWindow->SetValue(_T("A help window")); + textWindow->SetValue(wxT("A help window")); m_leftWindow1 = win; @@ -165,7 +165,7 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox(_T("wxWidgets 2.0 Sash Demo\nAuthor: Julian Smart (c) 1998"), _T("About Sash Demo")); + (void)wxMessageBox(wxT("wxWidgets 2.0 Sash Demo\nAuthor: Julian Smart (c) 1998"), wxT("About Sash Demo")); } void MyFrame::OnToggleWindow(wxCommandEvent& WXUNUSED(event)) @@ -225,17 +225,17 @@ void MyFrame::OnSashDrag(wxSashEvent& event) void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event)) { // Make another frame, containing a canvas - MyChild *subframe = new MyChild(frame, _T("Canvas Frame"), + MyChild *subframe = new MyChild(frame, wxT("Canvas Frame"), wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE); - subframe->SetTitle(wxString::Format(_T("Canvas Frame %d"), winNumber)); + subframe->SetTitle(wxString::Format(wxT("Canvas Frame %d"), winNumber)); winNumber ++; // Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ - subframe->SetIcon(wxIcon(_T("sashtest_icn"))); + subframe->SetIcon(wxIcon(wxT("sashtest_icn"))); #endif #if wxUSE_STATUSBAR @@ -246,23 +246,23 @@ void MyFrame::OnNewWindow(wxCommandEvent& WXUNUSED(event)) // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(SASHTEST_NEW_WINDOW, _T("&New window")); - file_menu->Append(SASHTEST_CHILD_QUIT, _T("&Close child")); - file_menu->Append(SASHTEST_QUIT, _T("&Exit")); + file_menu->Append(SASHTEST_NEW_WINDOW, wxT("&New window")); + file_menu->Append(SASHTEST_CHILD_QUIT, wxT("&Close child")); + file_menu->Append(SASHTEST_QUIT, wxT("&Exit")); wxMenu *option_menu = new wxMenu; // Dummy option - option_menu->Append(SASHTEST_REFRESH, _T("&Refresh picture")); + option_menu->Append(SASHTEST_REFRESH, wxT("&Refresh picture")); wxMenu *help_menu = new wxMenu; - help_menu->Append(SASHTEST_ABOUT, _T("&About")); + help_menu->Append(SASHTEST_ABOUT, wxT("&About")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); - menu_bar->Append(option_menu, _T("&Options")); - menu_bar->Append(help_menu, _T("&Help")); + menu_bar->Append(file_menu, wxT("&File")); + menu_bar->Append(option_menu, wxT("&Options")); + menu_bar->Append(help_menu, wxT("&Help")); // Associate the menu bar with the frame subframe->SetMenuBar(menu_bar); @@ -309,7 +309,7 @@ void MyCanvas::OnDraw(wxDC& dc) dc.DrawSpline(50, 200, 50, 100, 200, 10); #endif // wxUSE_SPLINES dc.DrawLine(50, 230, 200, 230); - dc.DrawText(_T("This is a test string"), 50, 230); + dc.DrawText(wxT("This is a test string"), 50, 230); wxPoint points[3]; points[0].x = 200; points[0].y = 300; diff --git a/samples/shaped/shaped.cpp b/samples/shaped/shaped.cpp index 4e828a41f8..6f93d5c8c1 100644 --- a/samples/shaped/shaped.cpp +++ b/samples/shaped/shaped.cpp @@ -375,7 +375,7 @@ ShapedFrame::ShapedFrame(wxFrame *parent) ) { m_hasShape = false; - m_bmp = wxBitmap(_T("star.png"), wxBITMAP_TYPE_PNG); + m_bmp = wxBitmap(wxT("star.png"), wxBITMAP_TYPE_PNG); SetSize(wxSize(m_bmp.GetWidth(), m_bmp.GetHeight())); SetToolTip(wxT("Right-click to close")); SetWindowShape(); diff --git a/samples/sound/sound.cpp b/samples/sound/sound.cpp index c82d84be90..ab745c89ac 100644 --- a/samples/sound/sound.cpp +++ b/samples/sound/sound.cpp @@ -40,7 +40,7 @@ #include "../sample.xpm" #endif -#define WAV_FILE _T("doggrowl.wav") +#define WAV_FILE wxT("doggrowl.wav") // ---------------------------------------------------------------------------- // private classes @@ -166,7 +166,7 @@ bool MyApp::OnInit() return false; // create the main application window - MyFrame *frame = new MyFrame(_T("wxWidgets Sound Sample")); + MyFrame *frame = new MyFrame(wxT("wxWidgets Sound Sample")); // and show it (the frames, unlike simple controls, are not shown when // created initially) @@ -194,32 +194,32 @@ MyFrame::MyFrame(const wxString& title) SetIcon(wxICON(sample)); wxMenu *menuFile = new wxMenu; - menuFile->Append(Sound_SelectFile, _T("Select WAV &file...\tCtrl-O"), _T("Select a new wav file to play")); + menuFile->Append(Sound_SelectFile, wxT("Select WAV &file...\tCtrl-O"), wxT("Select a new wav file to play")); #ifdef __WXMSW__ - menuFile->Append(Sound_SelectResource, _T("Select WAV &resource...\tCtrl-R"), _T("Select a new resource to play")); - menuFile->Append(Sound_SelectMemory, _T("Select WAV &data\tCtrl-M"), _T("Choose to play from memory buffer")); + menuFile->Append(Sound_SelectResource, wxT("Select WAV &resource...\tCtrl-R"), wxT("Select a new resource to play")); + menuFile->Append(Sound_SelectMemory, wxT("Select WAV &data\tCtrl-M"), wxT("Choose to play from memory buffer")); #endif // __WXMSW__ - menuFile->Append(Sound_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Sound_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenu *playMenu = new wxMenu; - playMenu->Append(Sound_PlaySync, _T("Play sound &synchronously\tCtrl-S")); - playMenu->Append(Sound_PlayAsync, _T("Play sound &asynchronously\tCtrl-A")); - playMenu->Append(Sound_PlayAsyncOnStack, _T("Play sound asynchronously (&object on stack)\tCtrl-K")); - playMenu->Append(Sound_PlayLoop, _T("&Loop sound\tCtrl-L")); + playMenu->Append(Sound_PlaySync, wxT("Play sound &synchronously\tCtrl-S")); + playMenu->Append(Sound_PlayAsync, wxT("Play sound &asynchronously\tCtrl-A")); + playMenu->Append(Sound_PlayAsyncOnStack, wxT("Play sound asynchronously (&object on stack)\tCtrl-K")); + playMenu->Append(Sound_PlayLoop, wxT("&Loop sound\tCtrl-L")); playMenu->AppendSeparator(); - playMenu->Append(Sound_Stop, _T("&Stop playing\tCtrl-T")); + playMenu->Append(Sound_Stop, wxT("&Stop playing\tCtrl-T")); playMenu->AppendSeparator(); - playMenu->Append(Sound_PlayBell, _T("Play system bell")); + playMenu->Append(Sound_PlayBell, wxT("Play system bell")); wxMenu *helpMenu = new wxMenu; - helpMenu->Append(Sound_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(Sound_About, wxT("&About...\tF1"), wxT("Show about dialog")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(playMenu, _T("&Play")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(playMenu, wxT("&Play")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -980,7 +980,7 @@ bool MyFrame::CreateSound(wxSound& snd) const void MyFrame::NotifyUsingFile(const wxString& name) { wxString msg; - msg << _T("Using sound file: ") << name << _T("\n"); + msg << wxT("Using sound file: ") << name << wxT("\n"); m_tc->AppendText(msg); } @@ -991,9 +991,9 @@ void MyFrame::NotifyUsingFile(const wxString& name) void MyFrame::OnSelectFile(wxCommandEvent& WXUNUSED(event)) { #if wxUSE_FILEDLG - wxFileDialog dlg(this, _T("Choose a sound file"), + wxFileDialog dlg(this, wxT("Choose a sound file"), wxEmptyString, wxEmptyString, - _T("WAV files (*.wav)|*.wav"), wxFD_OPEN|wxFD_CHANGE_DIR); + wxT("WAV files (*.wav)|*.wav"), wxFD_OPEN|wxFD_CHANGE_DIR); if ( dlg.ShowModal() == wxID_OK ) { m_soundFile = dlg.GetPath(); @@ -1015,9 +1015,9 @@ void MyFrame::OnSelectResource(wxCommandEvent& WXUNUSED(event)) { m_soundRes = wxGetTextFromUser ( - _T("Enter resource name:"), - _T("wxWidgets Sound Sample"), - _T("FromResource"), + wxT("Enter resource name:"), + wxT("wxWidgets Sound Sample"), + wxT("FromResource"), this ); if ( m_soundRes.empty() ) @@ -1029,7 +1029,7 @@ void MyFrame::OnSelectResource(wxCommandEvent& WXUNUSED(event)) delete m_sound; m_sound = NULL; - NotifyUsingFile(_T("Windows WAV resource")); + NotifyUsingFile(wxT("Windows WAV resource")); } #endif // __WXMSW__ @@ -1038,7 +1038,7 @@ void MyFrame::OnSelectMemory(wxCommandEvent& WXUNUSED(event)) { m_useMemory = true; - NotifyUsingFile(_T("embedded sound fragment")); + NotifyUsingFile(wxT("embedded sound fragment")); } void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) @@ -1103,10 +1103,10 @@ void MyFrame::OnPlayBell(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the About dialog of the sound sample.\n") - _T("Welcome to %s"), wxVERSION_STRING); + msg.Printf( wxT("This is the About dialog of the sound sample.\n") + wxT("Welcome to %s"), wxVERSION_STRING); - wxMessageBox(msg, _T("About"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, wxT("About"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnStop(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/splash/splash.cpp b/samples/splash/splash.cpp index 3b9af61fd4..de0654b1dc 100644 --- a/samples/splash/splash.cpp +++ b/samples/splash/splash.cpp @@ -129,7 +129,7 @@ bool MyApp::OnInit() wxImage::AddHandler(new wxPNGHandler); // create the main application window - MyFrame *frame = new MyFrame(_T("wxSplashScreen sample application")); + MyFrame *frame = new MyFrame(wxT("wxSplashScreen sample application")); wxBitmap bitmap; @@ -138,7 +138,7 @@ bool MyApp::OnInit() bool ok = frame->m_isPda ? bitmap.Ok() - : bitmap.LoadFile(_T("splash.png"), wxBITMAP_TYPE_PNG); + : bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG); if (ok) { @@ -182,14 +182,14 @@ MyFrame::MyFrame(const wxString& title) // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about frame")); + helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"), wxT("Show about frame")); - menuFile->Append(wxID_EXIT, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(wxID_EXIT, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -198,7 +198,7 @@ MyFrame::MyFrame(const wxString& title) #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR } @@ -219,7 +219,7 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) bool ok = m_isPda ? bitmap.Ok() - : bitmap.LoadFile(_T("splash.png"), wxBITMAP_TYPE_PNG); + : bitmap.LoadFile(wxT("splash.png"), wxBITMAP_TYPE_PNG); if (ok) { @@ -237,12 +237,12 @@ void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) wxWindow *win = splash->GetSplashWindow(); #if wxUSE_MEDIACTRL - wxMediaCtrl *media = new wxMediaCtrl( win, wxID_EXIT, _T("press.mpg"), wxPoint(2,2)); + wxMediaCtrl *media = new wxMediaCtrl( win, wxID_EXIT, wxT("press.mpg"), wxPoint(2,2)); media->Play(); #else wxStaticText *text = new wxStaticText( win, wxID_EXIT, - _T("click somewhere\non this image"), + wxT("click somewhere\non this image"), wxPoint(m_isPda ? 0 : 13, m_isPda ? 0 : 11) ); diff --git a/samples/splitter/splitter.cpp b/samples/splitter/splitter.cpp index ca7c7e9449..0b046d33cb 100644 --- a/samples/splitter/splitter.cpp +++ b/samples/splitter/splitter.cpp @@ -197,7 +197,7 @@ END_EVENT_TABLE() // My frame constructor MyFrame::MyFrame() - : wxFrame(NULL, wxID_ANY, _T("wxSplitterWindow sample"), + : wxFrame(NULL, wxID_ANY, wxT("wxSplitterWindow sample"), wxDefaultPosition, wxSize(420, 300), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE) { @@ -210,47 +210,47 @@ MyFrame::MyFrame() // Make a menubar wxMenu *splitMenu = new wxMenu; splitMenu->Append(SPLIT_VERTICAL, - _T("Split &Vertically\tCtrl-V"), - _T("Split vertically")); + wxT("Split &Vertically\tCtrl-V"), + wxT("Split vertically")); splitMenu->Append(SPLIT_HORIZONTAL, - _T("Split &Horizontally\tCtrl-H"), - _T("Split horizontally")); + wxT("Split &Horizontally\tCtrl-H"), + wxT("Split horizontally")); splitMenu->Append(SPLIT_UNSPLIT, - _T("&Unsplit\tCtrl-U"), - _T("Unsplit")); + wxT("&Unsplit\tCtrl-U"), + wxT("Unsplit")); splitMenu->AppendSeparator(); splitMenu->AppendCheckItem(SPLIT_LIVE, - _T("&Live update\tCtrl-L"), - _T("Toggle live update mode")); + wxT("&Live update\tCtrl-L"), + wxT("Toggle live update mode")); splitMenu->AppendCheckItem(SPLIT_BORDER, - _T("3D &Border"), - _T("Toggle wxSP_BORDER flag")); + wxT("3D &Border"), + wxT("Toggle wxSP_BORDER flag")); splitMenu->Check(SPLIT_BORDER, true); splitMenu->AppendCheckItem(SPLIT_3DSASH, - _T("&3D Sash"), - _T("Toggle wxSP_3DSASH flag")); + wxT("&3D Sash"), + wxT("Toggle wxSP_3DSASH flag")); splitMenu->Check(SPLIT_3DSASH, true); splitMenu->Append(SPLIT_SETPOSITION, - _T("Set splitter &position\tCtrl-P"), - _T("Set the splitter position")); + wxT("Set splitter &position\tCtrl-P"), + wxT("Set the splitter position")); splitMenu->Append(SPLIT_SETMINSIZE, - _T("Set &min size\tCtrl-M"), - _T("Set minimum pane size")); + wxT("Set &min size\tCtrl-M"), + wxT("Set minimum pane size")); splitMenu->Append(SPLIT_SETGRAVITY, - _T("Set &gravity\tCtrl-G"), - _T("Set gravity of sash")); + wxT("Set &gravity\tCtrl-G"), + wxT("Set gravity of sash")); splitMenu->AppendSeparator(); splitMenu->Append(SPLIT_REPLACE, - _T("&Replace right window"), - _T("Replace right window")); + wxT("&Replace right window"), + wxT("Replace right window")); splitMenu->AppendSeparator(); - splitMenu->Append(SPLIT_QUIT, _T("E&xit\tAlt-X"), _T("Exit")); + splitMenu->Append(SPLIT_QUIT, wxT("E&xit\tAlt-X"), wxT("Exit")); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(splitMenu, _T("&Splitter")); + menuBar->Append(splitMenu, wxT("&Splitter")); SetMenuBar(menuBar); @@ -269,8 +269,8 @@ MyFrame::MyFrame() m_right->SetBackgroundColour(*wxCYAN); m_right->SetScrollbars(20, 20, 5, 5); #else // for testing kbd navigation inside the splitter - m_left = new wxTextCtrl(m_splitter, wxID_ANY, _T("first text")); - m_right = new wxTextCtrl(m_splitter, wxID_ANY, _T("second text")); + m_left = new wxTextCtrl(m_splitter, wxID_ANY, wxT("first text")); + m_right = new wxTextCtrl(m_splitter, wxID_ANY, wxT("second text")); #endif // you can also do this to start with a single window @@ -283,7 +283,7 @@ MyFrame::MyFrame() #endif #if wxUSE_STATUSBAR - SetStatusText(_T("Min pane size = 0"), 1); + SetStatusText(wxT("Min pane size = 0"), 1); #endif // wxUSE_STATUSBAR m_replacewindow = NULL; @@ -313,7 +313,7 @@ void MyFrame::OnSplitHorizontal(wxCommandEvent& WXUNUSED(event) ) m_replacewindow = NULL; #if wxUSE_STATUSBAR - SetStatusText(_T("Splitter split horizontally"), 1); + SetStatusText(wxT("Splitter split horizontally"), 1); #endif // wxUSE_STATUSBAR } @@ -327,7 +327,7 @@ void MyFrame::OnSplitVertical(wxCommandEvent& WXUNUSED(event) ) m_replacewindow = NULL; #if wxUSE_STATUSBAR - SetStatusText(_T("Splitter split vertically"), 1); + SetStatusText(wxT("Splitter split vertically"), 1); #endif // wxUSE_STATUSBAR } @@ -336,7 +336,7 @@ void MyFrame::OnUnsplit(wxCommandEvent& WXUNUSED(event) ) if ( m_splitter->IsSplit() ) m_splitter->Unsplit(); #if wxUSE_STATUSBAR - SetStatusText(_T("No splitter")); + SetStatusText(wxT("No splitter")); #endif // wxUSE_STATUSBAR } @@ -361,7 +361,7 @@ void MyFrame::OnSetPosition(wxCommandEvent& WXUNUSED(event) ) wxString str; str.Printf( wxT("%d"), m_splitter->GetSashPosition()); #if wxUSE_TEXTDLG - str = wxGetTextFromUser(_T("Enter splitter position:"), _T(""), str, this); + str = wxGetTextFromUser(wxT("Enter splitter position:"), wxT(""), str, this); #endif if ( str.empty() ) return; @@ -369,13 +369,13 @@ void MyFrame::OnSetPosition(wxCommandEvent& WXUNUSED(event) ) long pos; if ( !str.ToLong(&pos) ) { - wxLogError(_T("The splitter position should be an integer.")); + wxLogError(wxT("The splitter position should be an integer.")); return; } m_splitter->SetSashPosition(pos); - wxLogStatus(this, _T("Splitter position set to %ld"), pos); + wxLogStatus(this, wxT("Splitter position set to %ld"), pos); } void MyFrame::OnSetMinSize(wxCommandEvent& WXUNUSED(event) ) @@ -383,7 +383,7 @@ void MyFrame::OnSetMinSize(wxCommandEvent& WXUNUSED(event) ) wxString str; str.Printf( wxT("%d"), m_splitter->GetMinimumPaneSize()); #if wxUSE_TEXTDLG - str = wxGetTextFromUser(_T("Enter minimal size for panes:"), _T(""), str, this); + str = wxGetTextFromUser(wxT("Enter minimal size for panes:"), wxT(""), str, this); #endif if ( str.empty() ) return; @@ -401,7 +401,7 @@ void MyFrame::OnSetGravity(wxCommandEvent& WXUNUSED(event) ) wxString str; str.Printf( wxT("%g"), m_splitter->GetSashGravity()); #if wxUSE_TEXTDLG - str = wxGetTextFromUser(_T("Enter sash gravity (0,1):"), _T(""), str, this); + str = wxGetTextFromUser(wxT("Enter sash gravity (0,1):"), wxT(""), str, this); #endif if ( str.empty() ) return; @@ -471,7 +471,7 @@ MySplitterWindow::MySplitterWindow(wxFrame *parent) void MySplitterWindow::OnPositionChanged(wxSplitterEvent& event) { - wxLogStatus(m_frame, _T("Position has changed, now = %d (or %d)"), + wxLogStatus(m_frame, wxT("Position has changed, now = %d (or %d)"), event.GetSashPosition(), GetSashPosition()); event.Skip(); @@ -479,7 +479,7 @@ void MySplitterWindow::OnPositionChanged(wxSplitterEvent& event) void MySplitterWindow::OnPositionChanging(wxSplitterEvent& event) { - wxLogStatus(m_frame, _T("Position is changing, now = %d (or %d)"), + wxLogStatus(m_frame, wxT("Position is changing, now = %d (or %d)"), event.GetSashPosition(), GetSashPosition()); event.Skip(); @@ -488,7 +488,7 @@ void MySplitterWindow::OnPositionChanging(wxSplitterEvent& event) void MySplitterWindow::OnDClick(wxSplitterEvent& event) { #if wxUSE_STATUSBAR - m_frame->SetStatusText(_T("Splitter double clicked"), 1); + m_frame->SetStatusText(wxT("Splitter double clicked"), 1); #endif // wxUSE_STATUSBAR event.Skip(); @@ -497,7 +497,7 @@ void MySplitterWindow::OnDClick(wxSplitterEvent& event) void MySplitterWindow::OnUnsplitEvent(wxSplitterEvent& event) { #if wxUSE_STATUSBAR - m_frame->SetStatusText(_T("Splitter unsplit"), 1); + m_frame->SetStatusText(wxT("Splitter unsplit"), 1); #endif // wxUSE_STATUSBAR event.Skip(); @@ -522,7 +522,7 @@ void MyCanvas::OnDraw(wxDC& dcOrig) dc.DrawLine(0, 0, 100, 200); dc.SetBackgroundMode(wxBRUSHSTYLE_TRANSPARENT); - dc.DrawText(_T("Testing"), 50, 50); + dc.DrawText(wxT("Testing"), 50, 50); dc.SetPen(*wxRED_PEN); dc.SetBrush(*wxGREEN_BRUSH); diff --git a/samples/statbar/statbar.cpp b/samples/statbar/statbar.cpp index 4b705b4a01..db21938159 100644 --- a/samples/statbar/statbar.cpp +++ b/samples/statbar/statbar.cpp @@ -303,7 +303,7 @@ bool MyApp::OnInit() return false; // create the main application window - MyFrame *frame = new MyFrame(_T("wxStatusBar sample"), + MyFrame *frame = new MyFrame(wxT("wxStatusBar sample"), wxPoint(50, 50), wxSize(450, 340)); // and show it (the frames, unlike simple controls, are not shown when @@ -340,57 +340,57 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) // create a menu bar wxMenu *menuFile = new wxMenu; - menuFile->Append(StatusBar_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(StatusBar_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenu *statbarMenu = new wxMenu; wxMenu *statbarStyleMenu = new wxMenu; - statbarStyleMenu->Append(StatusBar_SetStyleSizeGrip, _T("wxSTB_SIZE_GRIP"), _T("Toggles the wxSTB_SIZE_GRIP style"), true); - statbarStyleMenu->Append(StatusBar_SetStyleShowTips, _T("wxSTB_SHOW_TIPS"), _T("Toggles the wxSTB_SHOW_TIPS style"), true); + statbarStyleMenu->Append(StatusBar_SetStyleSizeGrip, wxT("wxSTB_SIZE_GRIP"), wxT("Toggles the wxSTB_SIZE_GRIP style"), true); + statbarStyleMenu->Append(StatusBar_SetStyleShowTips, wxT("wxSTB_SHOW_TIPS"), wxT("Toggles the wxSTB_SHOW_TIPS style"), true); statbarStyleMenu->AppendSeparator(); - statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeStart, _T("wxSTB_ELLIPSIZE_START"), _T("Toggles the wxSTB_ELLIPSIZE_START style"), true); - statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeMiddle, _T("wxSTB_ELLIPSIZE_MIDDLE"), _T("Toggles the wxSTB_ELLIPSIZE_MIDDLE style"), true); - statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeEnd, _T("wxSTB_ELLIPSIZE_END"), _T("Toggles the wxSTB_ELLIPSIZE_END style"), true); - statbarMenu->Append(StatusBar_SetPaneStyle, _T("Status bar style"), statbarStyleMenu); + statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeStart, wxT("wxSTB_ELLIPSIZE_START"), wxT("Toggles the wxSTB_ELLIPSIZE_START style"), true); + statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeMiddle, wxT("wxSTB_ELLIPSIZE_MIDDLE"), wxT("Toggles the wxSTB_ELLIPSIZE_MIDDLE style"), true); + statbarStyleMenu->Append(StatusBar_SetStyleEllipsizeEnd, wxT("wxSTB_ELLIPSIZE_END"), wxT("Toggles the wxSTB_ELLIPSIZE_END style"), true); + statbarMenu->Append(StatusBar_SetPaneStyle, wxT("Status bar style"), statbarStyleMenu); statbarMenu->AppendSeparator(); - statbarMenu->Append(StatusBar_SetFields, _T("&Set field count\tCtrl-C"), - _T("Set the number of status bar fields")); - statbarMenu->Append(StatusBar_SetTexts, _T("&Set field text\tCtrl-T"), - _T("Set the text to display for each status bar field")); - statbarMenu->Append(StatusBar_SetFont, _T("&Set field font\tCtrl-F"), - _T("Set the font to use for rendering status bar fields")); + statbarMenu->Append(StatusBar_SetFields, wxT("&Set field count\tCtrl-C"), + wxT("Set the number of status bar fields")); + statbarMenu->Append(StatusBar_SetTexts, wxT("&Set field text\tCtrl-T"), + wxT("Set the text to display for each status bar field")); + statbarMenu->Append(StatusBar_SetFont, wxT("&Set field font\tCtrl-F"), + wxT("Set the font to use for rendering status bar fields")); wxMenu *statbarPaneStyleMenu = new wxMenu; - statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleNormal, _T("&Normal"), _T("Sets the style of the first field to normal (sunken) look"), true); - statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleFlat, _T("&Flat"), _T("Sets the style of the first field to flat look"), true); - statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleRaised, _T("&Raised"), _T("Sets the style of the first field to raised look"), true); - statbarMenu->Append(StatusBar_SetPaneStyle, _T("Field style"), statbarPaneStyleMenu); + statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleNormal, wxT("&Normal"), wxT("Sets the style of the first field to normal (sunken) look"), true); + statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleFlat, wxT("&Flat"), wxT("Sets the style of the first field to flat look"), true); + statbarPaneStyleMenu->Append(StatusBar_SetPaneStyleRaised, wxT("&Raised"), wxT("Sets the style of the first field to raised look"), true); + statbarMenu->Append(StatusBar_SetPaneStyle, wxT("Field style"), statbarPaneStyleMenu); - statbarMenu->Append(StatusBar_ResetFieldsWidth, _T("Reset field widths"), - _T("Sets all fields to the same width")); + statbarMenu->Append(StatusBar_ResetFieldsWidth, wxT("Reset field widths"), + wxT("Sets all fields to the same width")); statbarMenu->AppendSeparator(); - statbarMenu->Append(StatusBar_Toggle, _T("&Toggle Status Bar"), - _T("Toggle the status bar display"), true); - statbarMenu->Append(StatusBar_Recreate, _T("&Recreate\tCtrl-R"), - _T("Toggle status bar format")); + statbarMenu->Append(StatusBar_Toggle, wxT("&Toggle Status Bar"), + wxT("Toggle the status bar display"), true); + statbarMenu->Append(StatusBar_Recreate, wxT("&Recreate\tCtrl-R"), + wxT("Toggle status bar format")); wxMenu *helpMenu = new wxMenu; - helpMenu->Append(StatusBar_About, _T("&About...\tCtrl-A"), _T("Show about dialog")); + helpMenu->Append(StatusBar_About, wxT("&About...\tCtrl-A"), wxT("Show about dialog")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(statbarMenu, _T("&Status bar")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(statbarMenu, wxT("&Status bar")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); // create default status bar to start with DoCreateStatusBar(StatBar_Default, wxSTB_DEFAULT_STYLE); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); } MyFrame::~MyFrame() @@ -483,9 +483,9 @@ void MyFrame::OnSetStatusFields(wxCommandEvent& WXUNUSED(event)) long nFields = wxGetNumberFromUser ( - _T("Select the number of fields in the status bar"), - _T("Fields:"), - _T("wxWidgets statusbar sample"), + wxT("Select the number of fields in the status bar"), + wxT("Fields:"), + wxT("wxWidgets statusbar sample"), sb->GetFieldsCount(), 1, 5, this @@ -517,13 +517,13 @@ void MyFrame::OnSetStatusFields(wxCommandEvent& WXUNUSED(event)) if ( widths ) { if ( widths[n] > 0 ) - s.Printf(_T("fixed (%d)"), widths[n]); + s.Printf(wxT("fixed (%d)"), widths[n]); else - s.Printf(_T("variable (*%d)"), -widths[n]); + s.Printf(wxT("variable (*%d)"), -widths[n]); } else { - s = _T("default"); + s = wxT("default"); } SetStatusText(s, n); @@ -712,28 +712,28 @@ void MyFrame::OnSetStyle(wxCommandEvent& event) // ---------------------------------------------------------------------------- MyAboutDialog::MyAboutDialog(wxWindow *parent) - : wxDialog(parent, wxID_ANY, wxString(_T("About statbar")), + : wxDialog(parent, wxID_ANY, wxString(wxT("About statbar")), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { wxStaticText *text = new wxStaticText(this, wxID_ANY, - _T("wxStatusBar sample\n") - _T("(c) 2000 Vadim Zeitlin")); + wxT("wxStatusBar sample\n") + wxT("(c) 2000 Vadim Zeitlin")); - wxButton *btn = new wxButton(this, wxID_OK, _T("&Close")); + wxButton *btn = new wxButton(this, wxID_OK, wxT("&Close")); // create the top status bar without the size grip (default style), // otherwise it looks weird wxStatusBar *statbarTop = new wxStatusBar(this, wxID_ANY, 0); statbarTop->SetFieldsCount(3); - statbarTop->SetStatusText(_T("This is a top status bar"), 0); - statbarTop->SetStatusText(_T("in a dialog"), 1); - statbarTop->SetStatusText(_T("Great, isn't it?"), 2); + statbarTop->SetStatusText(wxT("This is a top status bar"), 0); + statbarTop->SetStatusText(wxT("in a dialog"), 1); + statbarTop->SetStatusText(wxT("Great, isn't it?"), 2); wxStatusBar *statbarBottom = new wxStatusBar(this, wxID_ANY); statbarBottom->SetFieldsCount(2); - statbarBottom->SetStatusText(_T("This is a bottom status bar"), 0); - statbarBottom->SetStatusText(_T("in a dialog"), 1); + statbarBottom->SetStatusText(wxT("This is a bottom status bar"), 0); + statbarBottom->SetStatusText(wxT("in a dialog"), 1); wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); sizerTop->Add(statbarTop, 0, wxGROW); @@ -771,7 +771,7 @@ MyStatusBar::MyStatusBar(wxWindow *parent, long style) SetStatusWidths(Field_Max, widths); #if wxUSE_CHECKBOX - m_checkbox = new wxCheckBox(this, StatusBar_Checkbox, _T("&Toggle clock")); + m_checkbox = new wxCheckBox(this, StatusBar_Checkbox, wxT("&Toggle clock")); m_checkbox->SetValue(true); #endif diff --git a/samples/stc/edit.cpp b/samples/stc/edit.cpp index 30f64ebb27..df2fdf1530 100644 --- a/samples/stc/edit.cpp +++ b/samples/stc/edit.cpp @@ -134,9 +134,9 @@ Edit::Edit (wxWindow *parent, wxWindowID id, StyleSetFont (wxSTC_STYLE_DEFAULT, font); StyleSetForeground (wxSTC_STYLE_DEFAULT, *wxBLACK); StyleSetBackground (wxSTC_STYLE_DEFAULT, *wxWHITE); - StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (_T("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY"))); StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE); - StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour (_T("DARK GREY"))); + StyleSetForeground(wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY"))); InitializePrefs (DEFAULT_LANGUAGE); // set visibility @@ -145,16 +145,16 @@ Edit::Edit (wxWindow *parent, wxWindowID id, SetYCaretPolicy (wxSTC_CARET_EVEN|wxSTC_VISIBLE_STRICT|wxSTC_CARET_SLOP, 1); // markers - MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, _T("BLACK"), _T("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, _T("BLACK"), _T("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, _T("BLACK"), _T("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, _T("BLACK"), _T("WHITE")); - MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, _T("BLACK"), _T("WHITE")); - MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, _T("BLACK"), _T("BLACK")); - MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, _T("BLACK"), _T("BLACK")); + MarkerDefine (wxSTC_MARKNUM_FOLDER, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("BLACK")); + MarkerDefine (wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("BLACK")); + MarkerDefine (wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK")); + MarkerDefine (wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_DOTDOTDOT, wxT("BLACK"), wxT("WHITE")); + MarkerDefine (wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN, wxT("BLACK"), wxT("WHITE")); + MarkerDefine (wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK")); + MarkerDefine (wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_EMPTY, wxT("BLACK"), wxT("BLACK")); // miscelaneous - m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, _T("_999999")); + m_LineNrMargin = TextWidth (wxSTC_STYLE_LINENUMBER, wxT("_999999")); m_FoldingMargin = 16; CmdKeyClear (wxSTC_KEY_TAB, 0); // this is done by the menu accelerator key SetLayoutCache (wxSTC_CACHE_PAGE); @@ -369,8 +369,8 @@ wxString Edit::DeterminePrefs (const wxString &filename) { while (!filepattern.empty()) { wxString cur = filepattern.BeforeFirst (';'); if ((cur == filename) || - (cur == (filename.BeforeLast ('.') + _T(".*"))) || - (cur == (_T("*.") + filename.AfterLast ('.')))) { + (cur == (filename.BeforeLast ('.') + wxT(".*"))) || + (cur == (wxT("*.") + filename.AfterLast ('.')))) { return curInfo->name; } filepattern = filepattern.AfterFirst (';'); @@ -404,7 +404,7 @@ bool Edit::InitializePrefs (const wxString &name) { // set margin for line numbers SetMarginType (m_LineNrID, wxSTC_MARGIN_NUMBER); - StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (_T("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_LINENUMBER, wxColour (wxT("DARK GREY"))); StyleSetBackground (wxSTC_STYLE_LINENUMBER, *wxWHITE); SetMarginWidth (m_LineNrID, 0); // start out not visible @@ -416,8 +416,8 @@ bool Edit::InitializePrefs (const wxString &name) { } // set common styles - StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (_T("DARK GREY"))); - StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (_T("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_DEFAULT, wxColour (wxT("DARK GREY"))); + StyleSetForeground (wxSTC_STYLE_INDENTGUIDE, wxColour (wxT("DARK GREY"))); // initialize settings if (g_CommonPrefs.syntaxEnable) { @@ -461,21 +461,21 @@ bool Edit::InitializePrefs (const wxString &name) { if (g_CommonPrefs.foldEnable) { SetMarginWidth (m_FoldingID, curInfo->folds != 0? m_FoldingMargin: 0); SetMarginSensitive (m_FoldingID, curInfo->folds != 0); - SetProperty (_T("fold"), curInfo->folds != 0? _T("1"): _T("0")); - SetProperty (_T("fold.comment"), - (curInfo->folds & mySTC_FOLD_COMMENT) > 0? _T("1"): _T("0")); - SetProperty (_T("fold.compact"), - (curInfo->folds & mySTC_FOLD_COMPACT) > 0? _T("1"): _T("0")); - SetProperty (_T("fold.preprocessor"), - (curInfo->folds & mySTC_FOLD_PREPROC) > 0? _T("1"): _T("0")); - SetProperty (_T("fold.html"), - (curInfo->folds & mySTC_FOLD_HTML) > 0? _T("1"): _T("0")); - SetProperty (_T("fold.html.preprocessor"), - (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? _T("1"): _T("0")); - SetProperty (_T("fold.comment.python"), - (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? _T("1"): _T("0")); - SetProperty (_T("fold.quotes.python"), - (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? _T("1"): _T("0")); + SetProperty (wxT("fold"), curInfo->folds != 0? wxT("1"): wxT("0")); + SetProperty (wxT("fold.comment"), + (curInfo->folds & mySTC_FOLD_COMMENT) > 0? wxT("1"): wxT("0")); + SetProperty (wxT("fold.compact"), + (curInfo->folds & mySTC_FOLD_COMPACT) > 0? wxT("1"): wxT("0")); + SetProperty (wxT("fold.preprocessor"), + (curInfo->folds & mySTC_FOLD_PREPROC) > 0? wxT("1"): wxT("0")); + SetProperty (wxT("fold.html"), + (curInfo->folds & mySTC_FOLD_HTML) > 0? wxT("1"): wxT("0")); + SetProperty (wxT("fold.html.preprocessor"), + (curInfo->folds & mySTC_FOLD_HTMLPREP) > 0? wxT("1"): wxT("0")); + SetProperty (wxT("fold.comment.python"), + (curInfo->folds & mySTC_FOLD_COMMENTPY) > 0? wxT("1"): wxT("0")); + SetProperty (wxT("fold.quotes.python"), + (curInfo->folds & mySTC_FOLD_QUOTESPY) > 0? wxT("1"): wxT("0")); } SetFoldFlags (wxSTC_FOLDFLAG_LINEBEFORE_CONTRACTED | wxSTC_FOLDFLAG_LINEAFTER_CONTRACTED); @@ -507,8 +507,8 @@ bool Edit::LoadFile () #if wxUSE_FILEDLG // get filname if (!m_filename) { - wxFileDialog dlg (this, _T("Open file"), wxEmptyString, wxEmptyString, - _T("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR); + wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString, + wxT("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR); if (dlg.ShowModal() != wxID_OK) return false; m_filename = dlg.GetPath(); } @@ -556,7 +556,7 @@ bool Edit::SaveFile () // get filname if (!m_filename) { - wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"), + wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT); if (dlg.ShowModal() != wxID_OK) return false; m_filename = dlg.GetPath(); @@ -630,14 +630,14 @@ EditProperties::EditProperties (Edit *edit, textinfo->Add (new wxStaticText (this, wxID_ANY, _("Lexer-ID: "), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (_T("%d"), edit->GetLexer()); + text = wxString::Format (wxT("%d"), edit->GetLexer()); textinfo->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); wxString EOLtype = wxEmptyString; switch (edit->GetEOLMode()) { - case wxSTC_EOL_CR: {EOLtype = _T("CR (Unix)"); break; } - case wxSTC_EOL_CRLF: {EOLtype = _T("CRLF (Windows)"); break; } - case wxSTC_EOL_LF: {EOLtype = _T("CR (Macintosh)"); break; } + case wxSTC_EOL_CR: {EOLtype = wxT("CR (Unix)"); break; } + case wxSTC_EOL_CRLF: {EOLtype = wxT("CRLF (Windows)"); break; } + case wxSTC_EOL_LF: {EOLtype = wxT("CR (Macintosh)"); break; } } textinfo->Add (new wxStaticText (this, wxID_ANY, _("Line endings"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), @@ -657,25 +657,25 @@ EditProperties::EditProperties (Edit *edit, statistic->Add (new wxStaticText (this, wxID_ANY, _("Total lines"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (_T("%d"), edit->GetLineCount()); + text = wxString::Format (wxT("%d"), edit->GetLineCount()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); statistic->Add (new wxStaticText (this, wxID_ANY, _("Total chars"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (_T("%d"), edit->GetTextLength()); + text = wxString::Format (wxT("%d"), edit->GetTextLength()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); statistic->Add (new wxStaticText (this, wxID_ANY, _("Current line"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (_T("%d"), edit->GetCurrentLine()); + text = wxString::Format (wxT("%d"), edit->GetCurrentLine()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); statistic->Add (new wxStaticText (this, wxID_ANY, _("Current pos"), wxDefaultPosition, wxSize(80, wxDefaultCoord)), 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT, 4); - text = wxString::Format (_T("%d"), edit->GetCurrentPos()); + text = wxString::Format (wxT("%d"), edit->GetCurrentPos()); statistic->Add (new wxStaticText (this, wxID_ANY, text), 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); diff --git a/samples/stc/edit.h b/samples/stc/edit.h index b96c9f5790..44e185ead9 100644 --- a/samples/stc/edit.h +++ b/samples/stc/edit.h @@ -152,7 +152,7 @@ class EditPrint: public wxPrintout { public: //! constructor - EditPrint (Edit *edit, const wxChar *title = _T("")); + EditPrint (Edit *edit, const wxChar *title = wxT("")); //! event handlers bool OnPrintPage (int page); diff --git a/samples/stc/prefs.cpp b/samples/stc/prefs.cpp index b2275b1231..96ce8c49e2 100644 --- a/samples/stc/prefs.cpp +++ b/samples/stc/prefs.cpp @@ -219,159 +219,159 @@ const int g_LanguagePrefsSize = WXSIZEOF(g_LanguagePrefs); //! style types const StyleInfo g_StylePrefs [] = { // mySTC_TYPE_DEFAULT - {_T("Default"), - _T("BLACK"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Default"), + wxT("BLACK"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_WORD1 - {_T("Keyword1"), - _T("BLUE"), _T("WHITE"), - _T(""), 10, mySTC_STYLE_BOLD, 0}, + {wxT("Keyword1"), + wxT("BLUE"), wxT("WHITE"), + wxT(""), 10, mySTC_STYLE_BOLD, 0}, // mySTC_TYPE_WORD2 - {_T("Keyword2"), - _T("DARK BLUE"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Keyword2"), + wxT("DARK BLUE"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_WORD3 - {_T("Keyword3"), - _T("CORNFLOWER BLUE"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Keyword3"), + wxT("CORNFLOWER BLUE"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_WORD4 - {_T("Keyword4"), - _T("CYAN"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Keyword4"), + wxT("CYAN"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_WORD5 - {_T("Keyword5"), - _T("DARK GREY"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Keyword5"), + wxT("DARK GREY"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_WORD6 - {_T("Keyword6"), - _T("GREY"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Keyword6"), + wxT("GREY"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_COMMENT - {_T("Comment"), - _T("FOREST GREEN"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Comment"), + wxT("FOREST GREEN"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_COMMENT_DOC - {_T("Comment (Doc)"), - _T("FOREST GREEN"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Comment (Doc)"), + wxT("FOREST GREEN"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_COMMENT_LINE - {_T("Comment line"), - _T("FOREST GREEN"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Comment line"), + wxT("FOREST GREEN"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_COMMENT_SPECIAL - {_T("Special comment"), - _T("FOREST GREEN"), _T("WHITE"), - _T(""), 10, mySTC_STYLE_ITALIC, 0}, + {wxT("Special comment"), + wxT("FOREST GREEN"), wxT("WHITE"), + wxT(""), 10, mySTC_STYLE_ITALIC, 0}, // mySTC_TYPE_CHARACTER - {_T("Character"), - _T("KHAKI"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Character"), + wxT("KHAKI"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_CHARACTER_EOL - {_T("Character (EOL)"), - _T("KHAKI"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Character (EOL)"), + wxT("KHAKI"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_STRING - {_T("String"), - _T("BROWN"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("String"), + wxT("BROWN"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_STRING_EOL - {_T("String (EOL)"), - _T("BROWN"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("String (EOL)"), + wxT("BROWN"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_DELIMITER - {_T("Delimiter"), - _T("ORANGE"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Delimiter"), + wxT("ORANGE"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_PUNCTUATION - {_T("Punctuation"), - _T("ORANGE"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Punctuation"), + wxT("ORANGE"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_OPERATOR - {_T("Operator"), - _T("BLACK"), _T("WHITE"), - _T(""), 10, mySTC_STYLE_BOLD, 0}, + {wxT("Operator"), + wxT("BLACK"), wxT("WHITE"), + wxT(""), 10, mySTC_STYLE_BOLD, 0}, // mySTC_TYPE_BRACE - {_T("Label"), - _T("VIOLET"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Label"), + wxT("VIOLET"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_COMMAND - {_T("Command"), - _T("BLUE"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Command"), + wxT("BLUE"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_IDENTIFIER - {_T("Identifier"), - _T("BLACK"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Identifier"), + wxT("BLACK"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_LABEL - {_T("Label"), - _T("VIOLET"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Label"), + wxT("VIOLET"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_NUMBER - {_T("Number"), - _T("SIENNA"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Number"), + wxT("SIENNA"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_PARAMETER - {_T("Parameter"), - _T("VIOLET"), _T("WHITE"), - _T(""), 10, mySTC_STYLE_ITALIC, 0}, + {wxT("Parameter"), + wxT("VIOLET"), wxT("WHITE"), + wxT(""), 10, mySTC_STYLE_ITALIC, 0}, // mySTC_TYPE_REGEX - {_T("Regular expression"), - _T("ORCHID"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Regular expression"), + wxT("ORCHID"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_UUID - {_T("UUID"), - _T("ORCHID"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("UUID"), + wxT("ORCHID"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_VALUE - {_T("Value"), - _T("ORCHID"), _T("WHITE"), - _T(""), 10, mySTC_STYLE_ITALIC, 0}, + {wxT("Value"), + wxT("ORCHID"), wxT("WHITE"), + wxT(""), 10, mySTC_STYLE_ITALIC, 0}, // mySTC_TYPE_PREPROCESSOR - {_T("Preprocessor"), - _T("GREY"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Preprocessor"), + wxT("GREY"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_SCRIPT - {_T("Script"), - _T("DARK GREY"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Script"), + wxT("DARK GREY"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_ERROR - {_T("Error"), - _T("RED"), _T("WHITE"), - _T(""), 10, 0, 0}, + {wxT("Error"), + wxT("RED"), wxT("WHITE"), + wxT(""), 10, 0, 0}, // mySTC_TYPE_UNDEFINED - {_T("Undefined"), - _T("ORANGE"), _T("WHITE"), - _T(""), 10, 0, 0} + {wxT("Undefined"), + wxT("ORANGE"), wxT("WHITE"), + wxT(""), 10, 0, 0} }; diff --git a/samples/stc/stctest.cpp b/samples/stc/stctest.cpp index 06889c1c71..8e4093a93e 100644 --- a/samples/stc/stctest.cpp +++ b/samples/stc/stctest.cpp @@ -56,19 +56,19 @@ // declarations //============================================================================ -#define APP_NAME _T("STC-Test") +#define APP_NAME wxT("STC-Test") #define APP_DESCR _("See http://wxguide.sourceforge.net/") -#define APP_MAINT _T("Otto Wyss") -#define APP_VENDOR _T("wxWidgets") -#define APP_COPYRIGTH _T("(C) 2003 Otto Wyss") -#define APP_LICENCE _T("wxWidgets") +#define APP_MAINT wxT("Otto Wyss") +#define APP_VENDOR wxT("wxWidgets") +#define APP_COPYRIGTH wxT("(C) 2003 Otto Wyss") +#define APP_LICENCE wxT("wxWidgets") -#define APP_VERSION _T("0.1.alpha") +#define APP_VERSION wxT("0.1.alpha") #define APP_BUILD __DATE__ -#define APP_WEBSITE _T("http://www.wxWidgets.org") -#define APP_MAIL _T("mailto://???") +#define APP_WEBSITE wxT("http://www.wxWidgets.org") +#define APP_MAIL wxT("mailto://???") #define NONAME _("") @@ -206,7 +206,7 @@ bool App::OnInit () { SetVendorName (APP_VENDOR); g_appname = new wxString (); g_appname->Append (APP_VENDOR); - g_appname->Append (_T("-")); + g_appname->Append (wxT("-")); g_appname->Append (APP_NAME); #if wxUSE_PRINTING_ARCHITECTURE @@ -313,7 +313,7 @@ AppFrame::AppFrame (const wxString &title) // set icon and background SetTitle (*g_appname); SetIcon (wxICON (mondrian)); - SetBackgroundColour (_T("WHITE")); + SetBackgroundColour (wxT("WHITE")); // about box shown for 1 seconds AppAbout dlg(this, 1000); @@ -326,7 +326,7 @@ AppFrame::AppFrame (const wxString &title) m_edit = new Edit (this, wxID_ANY); m_edit->SetFocus(); - FileOpen (_T("stctest.cpp")); + FileOpen (wxT("stctest.cpp")); } AppFrame::~AppFrame () { @@ -356,7 +356,7 @@ void AppFrame::OnFileOpen (wxCommandEvent &WXUNUSED(event)) { if (!m_edit) return; #if wxUSE_FILEDLG wxString fname; - wxFileDialog dlg (this, _T("Open file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"), + wxFileDialog dlg (this, wxT("Open file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), wxFD_OPEN | wxFD_FILE_MUST_EXIST | wxFD_CHANGE_DIR); if (dlg.ShowModal() != wxID_OK) return; fname = dlg.GetPath (); @@ -378,7 +378,7 @@ void AppFrame::OnFileSaveAs (wxCommandEvent &WXUNUSED(event)) { if (!m_edit) return; #if wxUSE_FILEDLG wxString filename = wxEmptyString; - wxFileDialog dlg (this, _T("Save file"), wxEmptyString, wxEmptyString, _T("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); + wxFileDialog dlg (this, wxT("Save file"), wxEmptyString, wxEmptyString, wxT("Any file (*)|*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT); if (dlg.ShowModal() != wxID_OK) return; filename = dlg.GetPath(); m_edit->SaveFile (filename); diff --git a/samples/svg/svgtest.cpp b/samples/svg/svgtest.cpp index ccf21cff55..0cf0c134ca 100644 --- a/samples/svg/svgtest.cpp +++ b/samples/svg/svgtest.cpp @@ -318,7 +318,7 @@ END_EVENT_TABLE() MyCanvas::MyCanvas(MyChild *parent, const wxPoint& pos, const wxSize& size) : wxScrolledWindow(parent, wxID_ANY, pos, size, wxSUNKEN_BORDER|wxVSCROLL|wxHSCROLL) { - SetBackgroundColour(wxColour(_T("WHITE"))); + SetBackgroundColour(wxColour(wxT("WHITE"))); m_child = parent; m_index = m_child->GetFrame()->GetCountOfChildren() % 7; @@ -365,10 +365,10 @@ void MyCanvas::OnDraw(wxDC& dc) dc.SetBrush(*wxCYAN_BRUSH); dc.SetPen(*wxRED_PEN); dc.DrawRectangle(10, 10, 100, 70); - wB = wxBrush (_T("DARK ORCHID"), wxBRUSHSTYLE_TRANSPARENT); + wB = wxBrush (wxT("DARK ORCHID"), wxBRUSHSTYLE_TRANSPARENT); dc.SetBrush (wB); dc.DrawRoundedRectangle(50, 50, 100, 70, 20); - dc.SetBrush (wxBrush(_T("GOLDENROD")) ); + dc.SetBrush (wxBrush(wxT("GOLDENROD")) ); dc.DrawEllipse(100, 100, 100, 50); points[0].x = 100; points[0].y = 200; @@ -391,10 +391,10 @@ void MyCanvas::OnDraw(wxDC& dc) dc.DrawLine(45,30,55,30); dc.DrawText(wxT("This is a Swiss-style string"), 50, 30); wC = dc.GetTextForeground(); - dc.SetTextForeground (_T("FIREBRICK")); + dc.SetTextForeground (wxT("FIREBRICK")); // no effect in msw ?? - dc.SetTextBackground (_T("WHEAT")); + dc.SetTextBackground (wxT("WHEAT")); dc.DrawText(wxT("This is a Red string"), 50, 200); dc.DrawRotatedText(wxT("This is a 45 deg string"), 50, 200, 45); dc.DrawRotatedText(wxT("This is a 90 deg string"), 50, 200, 90); @@ -417,11 +417,11 @@ void MyCanvas::OnDraw(wxDC& dc) dc.DrawArc ( 270-50, 270-86, 270-86, 270-50, 270,270 ); dc.SetDeviceOrigin(0,0); - wP.SetColour (_T("CADET BLUE")); + wP.SetColour (wxT("CADET BLUE")); dc.SetPen(wP); dc.DrawArc ( 75,125, 110, 40, 75, 75 ); - wP.SetColour (_T("SALMON")); + wP.SetColour (wxT("SALMON")); dc.SetPen(wP); dc.SetBrush(*wxRED_BRUSH); //top left corner, width and height, start and end angle @@ -432,7 +432,7 @@ void MyCanvas::OnDraw(wxDC& dc) wP.SetWidth(3); dc.SetPen(wP); //wxTRANSPARENT)); - dc.SetBrush (wxBrush (_T("SALMON"))); + dc.SetBrush (wxBrush (wxT("SALMON"))); dc.DrawEllipticArc(300, 0,200,100, 0.0,145.0); //same end point dc.DrawEllipticArc(300, 50,200,100,90.0,145.0); @@ -445,7 +445,7 @@ void MyCanvas::OnDraw(wxDC& dc) case 4: dc.DrawCheckMark ( 30,30,25,25); - dc.SetBrush (wxBrush (_T("SALMON"),wxBRUSHSTYLE_TRANSPARENT)); + dc.SetBrush (wxBrush (wxT("SALMON"),wxBRUSHSTYLE_TRANSPARENT)); dc.DrawCheckMark ( 80,50,75,75); dc.DrawRectangle ( 80,50,75,75); #if wxUSE_STATUSBAR diff --git a/samples/taborder/taborder.cpp b/samples/taborder/taborder.cpp index 3e070a9c22..957841e074 100644 --- a/samples/taborder/taborder.cpp +++ b/samples/taborder/taborder.cpp @@ -101,11 +101,11 @@ private: { if ( m_panel->NavigateIn(flags) ) { - wxLogStatus(this, _T("Navigation event processed")); + wxLogStatus(this, wxT("Navigation event processed")); } else { - wxLogStatus(this, _T("Navigation event ignored")); + wxLogStatus(this, wxT("Navigation event ignored")); } } @@ -144,8 +144,8 @@ private: if ( event.GetKeyCode() == WXK_TAB && wxMessageBox ( - _T("Let the Tab be used for navigation?"), - _T("wxWidgets TabOrder sample: Tab key pressed"), + wxT("Let the Tab be used for navigation?"), + wxT("wxWidgets TabOrder sample: Tab key pressed"), wxICON_QUESTION | wxYES_NO, this ) != wxYES ) @@ -195,7 +195,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE() MyFrame::MyFrame() - : wxFrame(NULL, wxID_ANY, _T("TabOrder wxWidgets Sample"), + : wxFrame(NULL, wxID_ANY, wxT("TabOrder wxWidgets Sample"), wxDefaultPosition, wxSize(700, 450)) { SetIcon(wxICON(sample)); @@ -206,14 +206,14 @@ MyFrame::MyFrame() menuFile->Append(TabOrder_Quit); wxMenu *menuNav = new wxMenu; - menuNav->Append(TabOrder_TabForward, _T("Tab &forward\tCtrl-F"), - _T("Emulate a press")); - menuNav->Append(TabOrder_TabBackward, _T("Tab &backward\tCtrl-B"), - _T("Emulate a press")); + menuNav->Append(TabOrder_TabForward, wxT("Tab &forward\tCtrl-F"), + wxT("Emulate a press")); + menuNav->Append(TabOrder_TabBackward, wxT("Tab &backward\tCtrl-B"), + wxT("Emulate a press")); wxMenuBar *mbar = new wxMenuBar; - mbar->Append(menuFile, _T("&File")); - mbar->Append(menuNav, _T("&Navigate")); + mbar->Append(menuFile, wxT("&File")); + mbar->Append(menuNav, wxT("&Navigate")); SetMenuBar(mbar); @@ -229,8 +229,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Tab navigation sample\n(c) 2007 Vadim Zeitlin"), - _T("About TabOrder wxWidgets Sample"), wxOK, this); + wxMessageBox(wxT("Tab navigation sample\n(c) 2007 Vadim Zeitlin"), + wxT("About TabOrder wxWidgets Sample"), wxOK, this); } void MyFrame::OnTabForward(wxCommandEvent& WXUNUSED(event)) @@ -255,11 +255,11 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) ) wxString msg; if ( focus ) { - msg.Printf(_T("Focus is at %s"), s_windowFocus->GetName().c_str()); + msg.Printf(wxT("Focus is at %s"), s_windowFocus->GetName().c_str()); } else { - msg = _T("No focus"); + msg = wxT("No focus"); } SetStatusText(msg, StatusPane_Focus); @@ -274,16 +274,16 @@ MyPanel::MyPanel(wxWindow *parent) : wxPanel(parent, wxID_ANY) { wxNotebook *notebook = new wxNotebook(this, wxID_ANY); - notebook->AddPage(CreateButtonPage(notebook), _T("Button")); - notebook->AddPage(CreateTextPage(notebook), _T("Text")); + notebook->AddPage(CreateButtonPage(notebook), wxT("Button")); + notebook->AddPage(CreateTextPage(notebook), wxT("Text")); wxSizer *sizerV = new wxBoxSizer(wxVERTICAL); sizerV->Add(notebook, wxSizerFlags(1).Expand()); wxListBox *lbox = new wxListBox(this, wxID_ANY); - lbox->AppendString(_T("Just a")); - lbox->AppendString(_T("simple")); - lbox->AppendString(_T("listbox")); + lbox->AppendString(wxT("Just a")); + lbox->AppendString(wxT("simple")); + lbox->AppendString(wxT("listbox")); sizerV->Add(lbox, wxSizerFlags(1).Expand()); SetSizerAndFit(sizerV); @@ -295,10 +295,10 @@ wxWindow *MyPanel::CreateButtonPage(wxWindow *parent) wxPanel *page = new wxPanel(parent); wxSizer *sizerPage = new wxBoxSizer(wxHORIZONTAL); - sizerPage->Add(new wxButton(page, wxID_ANY, _T("&First")), flagsBorder); - sizerPage->Add(new wxStaticText(page, wxID_ANY, _T("[st&atic]")), + sizerPage->Add(new wxButton(page, wxID_ANY, wxT("&First")), flagsBorder); + sizerPage->Add(new wxStaticText(page, wxID_ANY, wxT("[st&atic]")), flagsBorder); - sizerPage->Add(new wxButton(page, wxID_ANY, _T("&Second")), flagsBorder); + sizerPage->Add(new wxButton(page, wxID_ANY, wxT("&Second")), flagsBorder); page->SetSizer(sizerPage); @@ -313,14 +313,14 @@ wxWindow *MyPanel::CreateTextPage(wxWindow *parent) wxPanel *page = new wxPanel(parent); wxSizer *sizerH = new wxBoxSizer(wxHORIZONTAL); - sizerH->Add(new wxStaticText(page, wxID_ANY, _T("&Label:")), flagsBorder); - sizerH->Add(new MyTabTextCtrl(page, _T("TAB ignored here")), flagsBorder); + sizerH->Add(new wxStaticText(page, wxID_ANY, wxT("&Label:")), flagsBorder); + sizerH->Add(new MyTabTextCtrl(page, wxT("TAB ignored here")), flagsBorder); sizerPage->Add(sizerH, wxSizerFlags(1).Expand()); sizerH = new wxBoxSizer(wxHORIZONTAL); - sizerH->Add(new wxStaticText(page, wxID_ANY, _T("&Another one:")), + sizerH->Add(new wxStaticText(page, wxID_ANY, wxT("&Another one:")), flagsBorder); - sizerH->Add(new MyTabTextCtrl(page, _T("press Tab here"), wxTE_PROCESS_TAB), + sizerH->Add(new MyTabTextCtrl(page, wxT("press Tab here"), wxTE_PROCESS_TAB), flagsBorder); sizerPage->Add(sizerH, wxSizerFlags(1).Expand()); diff --git a/samples/taskbar/tbtest.cpp b/samples/taskbar/tbtest.cpp index 9256009cdd..a9abff2cb1 100644 --- a/samples/taskbar/tbtest.cpp +++ b/samples/taskbar/tbtest.cpp @@ -103,22 +103,22 @@ MyDialog::MyDialog(const wxString& title) ( this, wxID_ANY, - _T("Press 'Hide me' to hide this window, Exit to quit.") + wxT("Press 'Hide me' to hide this window, Exit to quit.") ), flags); sizerTop->Add(new wxStaticText ( this, wxID_ANY, - _T("Double-click on the taskbar icon to show me again.") + wxT("Double-click on the taskbar icon to show me again.") ), flags); sizerTop->AddStretchSpacer()->SetMinSize(200, 50); wxSizer * const sizerBtns = new wxBoxSizer(wxHORIZONTAL); - sizerBtns->Add(new wxButton(this, wxID_ABOUT, _T("&About")), flags); - sizerBtns->Add(new wxButton(this, wxID_OK, _T("&Hide")), flags); - sizerBtns->Add(new wxButton(this, wxID_EXIT, _T("E&xit")), flags); + sizerBtns->Add(new wxButton(this, wxID_ABOUT, wxT("&About")), flags); + sizerBtns->Add(new wxButton(this, wxID_OK, wxT("&Hide")), flags); + sizerBtns->Add(new wxButton(this, wxID_EXIT, wxT("E&xit")), flags); sizerTop->Add(sizerBtns, flags.Align(wxALIGN_CENTER_HORIZONTAL)); SetSizerAndFit(sizerTop); @@ -247,20 +247,20 @@ void MyTaskBarIcon::OnMenuSub(wxCommandEvent&) wxMenu *MyTaskBarIcon::CreatePopupMenu() { wxMenu *menu = new wxMenu; - menu->Append(PU_RESTORE, _T("&Restore main window")); + menu->Append(PU_RESTORE, wxT("&Restore main window")); menu->AppendSeparator(); - menu->Append(PU_NEW_ICON, _T("&Set New Icon")); + menu->Append(PU_NEW_ICON, wxT("&Set New Icon")); menu->AppendSeparator(); - menu->AppendCheckItem(PU_CHECKMARK, _T("Test &check mark")); + menu->AppendCheckItem(PU_CHECKMARK, wxT("Test &check mark")); menu->AppendSeparator(); wxMenu *submenu = new wxMenu; - submenu->Append(PU_SUB1, _T("One submenu")); + submenu->Append(PU_SUB1, wxT("One submenu")); submenu->AppendSeparator(); - submenu->Append(PU_SUB2, _T("Another submenu")); - menu->Append(PU_SUBMAIN, _T("Submenu"), submenu); + submenu->Append(PU_SUB2, wxT("Another submenu")); + menu->Append(PU_SUBMAIN, wxT("Submenu"), submenu); #ifndef __WXMAC_OSX__ /*Mac has built-in quit menu*/ menu->AppendSeparator(); - menu->Append(PU_EXIT, _T("E&xit")); + menu->Append(PU_EXIT, wxT("E&xit")); #endif return menu; } diff --git a/samples/text/text.cpp b/samples/text/text.cpp index 462317e9c3..6cd3a13646 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -97,7 +97,7 @@ public: static bool ms_logClip; private: - static inline wxChar GetChar(bool on, wxChar c) { return on ? c : _T('-'); } + static inline wxChar GetChar(bool on, wxChar c) { return on ? c : wxT('-'); } void LogKeyEvent(const wxChar *name, wxKeyEvent& event) const; void LogClipEvent(const wxChar *what, wxClipboardTextEvent& event); @@ -176,12 +176,12 @@ public: #if wxUSE_CLIPBOARD void OnPasteFromClipboard( wxCommandEvent& WXUNUSED(event) ) { - wxLogMessage(_T("Pasting text from clipboard.")); + wxLogMessage(wxT("Pasting text from clipboard.")); m_panel->DoPasteFromClipboard(); } void OnCopyToClipboard( wxCommandEvent& WXUNUSED(event) ) { - wxLogMessage(_T("Copying text to clipboard.")); + wxLogMessage(wxT("Copying text to clipboard.")); m_panel->DoCopyToClipboard(); } @@ -224,7 +224,7 @@ public: { if ( !m_panel->m_textrich->LineDown() ) { - wxLogMessage(_T("Already at the bottom")); + wxLogMessage(wxT("Already at the bottom")); } } @@ -232,7 +232,7 @@ public: { if ( !m_panel->m_textrich->LineUp() ) { - wxLogMessage(_T("Already at the top")); + wxLogMessage(wxT("Already at the top")); } } @@ -240,7 +240,7 @@ public: { if ( !m_panel->m_textrich->PageDown() ) { - wxLogMessage(_T("Already at the bottom")); + wxLogMessage(wxT("Already at the bottom")); } } @@ -248,7 +248,7 @@ public: { if ( !m_panel->m_textrich->PageUp() ) { - wxLogMessage(_T("Already at the top")); + wxLogMessage(wxT("Already at the top")); } } @@ -315,12 +315,12 @@ public: void OnSetText(wxCommandEvent& WXUNUSED(event)) { - m_panel->m_text->SetValue(_T("Hello, world! (what else did you expect?)")); + m_panel->m_text->SetValue(wxT("Hello, world! (what else did you expect?)")); } void OnChangeText(wxCommandEvent& WXUNUSED(event)) { - m_panel->m_text->ChangeValue(_T("Changed, not set: no event")); + m_panel->m_text->ChangeValue(wxT("Changed, not set: no event")); } void OnIdle( wxIdleEvent& event ); @@ -450,85 +450,85 @@ bool MyApp::OnInit() // Create the main frame window MyFrame *frame = new MyFrame((wxFrame *) NULL, - _T("Text wxWidgets sample"), 50, 50, 700, 550); + wxT("Text wxWidgets sample"), 50, 50, 700, 550); frame->SetSizeHints( 500, 400 ); wxMenu *file_menu = new wxMenu; - file_menu->Append(TEXT_SAVE, _T("&Save file\tCtrl-S"), - _T("Save the text control contents to file")); - file_menu->Append(TEXT_LOAD, _T("&Load file\tCtrl-O"), - _T("Load the sample file into text control")); + file_menu->Append(TEXT_SAVE, wxT("&Save file\tCtrl-S"), + wxT("Save the text control contents to file")); + file_menu->Append(TEXT_LOAD, wxT("&Load file\tCtrl-O"), + wxT("Load the sample file into text control")); file_menu->AppendSeparator(); - file_menu->Append(TEXT_RICH_TEXT_TEST, _T("Show Rich Text Editor")); + file_menu->Append(TEXT_RICH_TEXT_TEST, wxT("Show Rich Text Editor")); file_menu->AppendSeparator(); - file_menu->Append(TEXT_ABOUT, _T("&About\tAlt-A")); + file_menu->Append(TEXT_ABOUT, wxT("&About\tAlt-A")); file_menu->AppendSeparator(); - file_menu->Append(TEXT_QUIT, _T("E&xit\tAlt-X"), _T("Quit this sample")); + file_menu->Append(TEXT_QUIT, wxT("E&xit\tAlt-X"), wxT("Quit this sample")); wxMenuBar *menu_bar = new wxMenuBar( wxMB_DOCKABLE ); - menu_bar->Append(file_menu, _T("&File")); + menu_bar->Append(file_menu, wxT("&File")); #if wxUSE_TOOLTIPS wxMenu *tooltip_menu = new wxMenu; - tooltip_menu->Append(TEXT_TOOLTIPS_SETDELAY, _T("Set &delay\tCtrl-D")); + tooltip_menu->Append(TEXT_TOOLTIPS_SETDELAY, wxT("Set &delay\tCtrl-D")); tooltip_menu->AppendSeparator(); - tooltip_menu->Append(TEXT_TOOLTIPS_ENABLE, _T("&Toggle tooltips\tCtrl-T"), - _T("enable/disable tooltips"), true); + tooltip_menu->Append(TEXT_TOOLTIPS_ENABLE, wxT("&Toggle tooltips\tCtrl-T"), + wxT("enable/disable tooltips"), true); tooltip_menu->Check(TEXT_TOOLTIPS_ENABLE, true); - menu_bar->Append(tooltip_menu, _T("&Tooltips")); + menu_bar->Append(tooltip_menu, wxT("&Tooltips")); #endif // wxUSE_TOOLTIPS #if wxUSE_CLIPBOARD // notice that we use non default accelerators on purpose here to compare // their behaviour with the built in handling of standard Ctrl/Cmd-C/V wxMenu *menuClipboard = new wxMenu; - menuClipboard->Append(TEXT_CLIPBOARD_COPY, _T("&Copy\tCtrl-Shift-C"), - _T("Copy the selection to the clipboard")); - menuClipboard->Append(TEXT_CLIPBOARD_PASTE, _T("&Paste\tCtrl-Shift-V"), - _T("Paste from clipboard to the text control")); + menuClipboard->Append(TEXT_CLIPBOARD_COPY, wxT("&Copy\tCtrl-Shift-C"), + wxT("Copy the selection to the clipboard")); + menuClipboard->Append(TEXT_CLIPBOARD_PASTE, wxT("&Paste\tCtrl-Shift-V"), + wxT("Paste from clipboard to the text control")); menuClipboard->AppendSeparator(); - menuClipboard->AppendCheckItem(TEXT_CLIPBOARD_VETO, _T("Vet&o\tCtrl-Shift-O"), - _T("Veto all clipboard operations")); - menu_bar->Append(menuClipboard, _T("&Clipboard")); + menuClipboard->AppendCheckItem(TEXT_CLIPBOARD_VETO, wxT("Vet&o\tCtrl-Shift-O"), + wxT("Veto all clipboard operations")); + menu_bar->Append(menuClipboard, wxT("&Clipboard")); #endif // wxUSE_CLIPBOARD wxMenu *menuText = new wxMenu; - menuText->Append(TEXT_ADD_SOME, _T("&Append some text\tCtrl-A")); - menuText->Append(TEXT_ADD_FREEZE, _T("&Append text with freeze/thaw\tShift-Ctrl-A")); - menuText->Append(TEXT_ADD_LINE, _T("Append a new &line\tAlt-Shift-A")); - menuText->Append(TEXT_REMOVE, _T("&Remove first 10 characters\tCtrl-Y")); - menuText->Append(TEXT_REPLACE, _T("&Replace characters 4 to 8 with ABC\tCtrl-R")); - menuText->Append(TEXT_SELECT, _T("&Select characters 4 to 8\tCtrl-I")); - menuText->Append(TEXT_SET, _T("&Set the first text zone value\tCtrl-E")); - menuText->Append(TEXT_CHANGE, _T("&Change the first text zone value\tShift-Ctrl-E")); + menuText->Append(TEXT_ADD_SOME, wxT("&Append some text\tCtrl-A")); + menuText->Append(TEXT_ADD_FREEZE, wxT("&Append text with freeze/thaw\tShift-Ctrl-A")); + menuText->Append(TEXT_ADD_LINE, wxT("Append a new &line\tAlt-Shift-A")); + menuText->Append(TEXT_REMOVE, wxT("&Remove first 10 characters\tCtrl-Y")); + menuText->Append(TEXT_REPLACE, wxT("&Replace characters 4 to 8 with ABC\tCtrl-R")); + menuText->Append(TEXT_SELECT, wxT("&Select characters 4 to 8\tCtrl-I")); + menuText->Append(TEXT_SET, wxT("&Set the first text zone value\tCtrl-E")); + menuText->Append(TEXT_CHANGE, wxT("&Change the first text zone value\tShift-Ctrl-E")); menuText->AppendSeparator(); - menuText->Append(TEXT_MOVE_ENDTEXT, _T("Move cursor to the end of &text")); - menuText->Append(TEXT_MOVE_ENDENTRY, _T("Move cursor to the end of &entry")); - menuText->AppendCheckItem(TEXT_SET_EDITABLE, _T("Toggle &editable state")); - menuText->AppendCheckItem(TEXT_SET_ENABLED, _T("Toggle e&nabled state")); + menuText->Append(TEXT_MOVE_ENDTEXT, wxT("Move cursor to the end of &text")); + menuText->Append(TEXT_MOVE_ENDENTRY, wxT("Move cursor to the end of &entry")); + menuText->AppendCheckItem(TEXT_SET_EDITABLE, wxT("Toggle &editable state")); + menuText->AppendCheckItem(TEXT_SET_ENABLED, wxT("Toggle e&nabled state")); menuText->Check(TEXT_SET_EDITABLE, true); menuText->Check(TEXT_SET_ENABLED, true); menuText->AppendSeparator(); - menuText->Append(TEXT_LINE_DOWN, _T("Scroll text one line down")); - menuText->Append(TEXT_LINE_UP, _T("Scroll text one line up")); - menuText->Append(TEXT_PAGE_DOWN, _T("Scroll text one page down")); - menuText->Append(TEXT_PAGE_UP, _T("Scroll text one page up")); + menuText->Append(TEXT_LINE_DOWN, wxT("Scroll text one line down")); + menuText->Append(TEXT_LINE_UP, wxT("Scroll text one line up")); + menuText->Append(TEXT_PAGE_DOWN, wxT("Scroll text one page down")); + menuText->Append(TEXT_PAGE_UP, wxT("Scroll text one page up")); menuText->AppendSeparator(); - menuText->Append(TEXT_GET_LINE, _T("Get the text of a line of the tabbed multiline")); - menuText->Append(TEXT_GET_LINELENGTH, _T("Get the length of a line of the tabbed multiline")); - menu_bar->Append(menuText, _T("Te&xt")); + menuText->Append(TEXT_GET_LINE, wxT("Get the text of a line of the tabbed multiline")); + menuText->Append(TEXT_GET_LINELENGTH, wxT("Get the length of a line of the tabbed multiline")); + menu_bar->Append(menuText, wxT("Te&xt")); #if wxUSE_LOG wxMenu *menuLog = new wxMenu; - menuLog->AppendCheckItem(TEXT_LOG_KEY, _T("Log &key events")); - menuLog->AppendCheckItem(TEXT_LOG_CHAR, _T("Log &char events")); - menuLog->AppendCheckItem(TEXT_LOG_MOUSE, _T("Log &mouse events")); - menuLog->AppendCheckItem(TEXT_LOG_TEXT, _T("Log &text events")); - menuLog->AppendCheckItem(TEXT_LOG_FOCUS, _T("Log &focus events")); - menuLog->AppendCheckItem(TEXT_LOG_CLIP, _T("Log clip&board events")); + menuLog->AppendCheckItem(TEXT_LOG_KEY, wxT("Log &key events")); + menuLog->AppendCheckItem(TEXT_LOG_CHAR, wxT("Log &char events")); + menuLog->AppendCheckItem(TEXT_LOG_MOUSE, wxT("Log &mouse events")); + menuLog->AppendCheckItem(TEXT_LOG_TEXT, wxT("Log &text events")); + menuLog->AppendCheckItem(TEXT_LOG_FOCUS, wxT("Log &focus events")); + menuLog->AppendCheckItem(TEXT_LOG_CLIP, wxT("Log clip&board events")); menuLog->AppendSeparator(); - menuLog->Append(TEXT_CLEAR, _T("&Clear the log\tCtrl-L"), - _T("Clear the log window contents")); + menuLog->Append(TEXT_CLEAR, wxT("&Clear the log\tCtrl-L"), + wxT("Clear the log window contents")); // select only the interesting events by default MyTextCtrl::ms_logClip = @@ -538,7 +538,7 @@ bool MyApp::OnInit() menuLog->Check(TEXT_LOG_CHAR, MyTextCtrl::ms_logChar); menuLog->Check(TEXT_LOG_TEXT, MyTextCtrl::ms_logText); - menu_bar->Append(menuLog, _T("&Log")); + menu_bar->Append(menuLog, wxT("&Log")); #endif // wxUSE_LOG frame->SetMenuBar(menu_bar); @@ -588,128 +588,128 @@ void MyTextCtrl::LogKeyEvent(const wxChar *name, wxKeyEvent& event) const { switch ( keycode ) { - case WXK_BACK: key = _T("BACK"); break; - case WXK_TAB: key = _T("TAB"); break; - case WXK_RETURN: key = _T("RETURN"); break; - case WXK_ESCAPE: key = _T("ESCAPE"); break; - case WXK_SPACE: key = _T("SPACE"); break; - case WXK_DELETE: key = _T("DELETE"); break; - case WXK_START: key = _T("START"); break; - case WXK_LBUTTON: key = _T("LBUTTON"); break; - case WXK_RBUTTON: key = _T("RBUTTON"); break; - case WXK_CANCEL: key = _T("CANCEL"); break; - case WXK_MBUTTON: key = _T("MBUTTON"); break; - case WXK_CLEAR: key = _T("CLEAR"); break; - case WXK_SHIFT: key = _T("SHIFT"); break; - case WXK_ALT: key = _T("ALT"); break; - case WXK_CONTROL: key = _T("CONTROL"); break; - case WXK_MENU: key = _T("MENU"); break; - case WXK_PAUSE: key = _T("PAUSE"); break; - case WXK_CAPITAL: key = _T("CAPITAL"); break; - case WXK_END: key = _T("END"); break; - case WXK_HOME: key = _T("HOME"); break; - case WXK_LEFT: key = _T("LEFT"); break; - case WXK_UP: key = _T("UP"); break; - case WXK_RIGHT: key = _T("RIGHT"); break; - case WXK_DOWN: key = _T("DOWN"); break; - case WXK_SELECT: key = _T("SELECT"); break; - case WXK_PRINT: key = _T("PRINT"); break; - case WXK_EXECUTE: key = _T("EXECUTE"); break; - case WXK_SNAPSHOT: key = _T("SNAPSHOT"); break; - case WXK_INSERT: key = _T("INSERT"); break; - case WXK_HELP: key = _T("HELP"); break; - case WXK_NUMPAD0: key = _T("NUMPAD0"); break; - case WXK_NUMPAD1: key = _T("NUMPAD1"); break; - case WXK_NUMPAD2: key = _T("NUMPAD2"); break; - case WXK_NUMPAD3: key = _T("NUMPAD3"); break; - case WXK_NUMPAD4: key = _T("NUMPAD4"); break; - case WXK_NUMPAD5: key = _T("NUMPAD5"); break; - case WXK_NUMPAD6: key = _T("NUMPAD6"); break; - case WXK_NUMPAD7: key = _T("NUMPAD7"); break; - case WXK_NUMPAD8: key = _T("NUMPAD8"); break; - case WXK_NUMPAD9: key = _T("NUMPAD9"); break; - case WXK_MULTIPLY: key = _T("MULTIPLY"); break; - case WXK_ADD: key = _T("ADD"); break; - case WXK_SEPARATOR: key = _T("SEPARATOR"); break; - case WXK_SUBTRACT: key = _T("SUBTRACT"); break; - case WXK_DECIMAL: key = _T("DECIMAL"); break; - case WXK_DIVIDE: key = _T("DIVIDE"); break; - case WXK_F1: key = _T("F1"); break; - case WXK_F2: key = _T("F2"); break; - case WXK_F3: key = _T("F3"); break; - case WXK_F4: key = _T("F4"); break; - case WXK_F5: key = _T("F5"); break; - case WXK_F6: key = _T("F6"); break; - case WXK_F7: key = _T("F7"); break; - case WXK_F8: key = _T("F8"); break; - case WXK_F9: key = _T("F9"); break; - case WXK_F10: key = _T("F10"); break; - case WXK_F11: key = _T("F11"); break; - case WXK_F12: key = _T("F12"); break; - case WXK_F13: key = _T("F13"); break; - case WXK_F14: key = _T("F14"); break; - case WXK_F15: key = _T("F15"); break; - case WXK_F16: key = _T("F16"); break; - case WXK_F17: key = _T("F17"); break; - case WXK_F18: key = _T("F18"); break; - case WXK_F19: key = _T("F19"); break; - case WXK_F20: key = _T("F20"); break; - case WXK_F21: key = _T("F21"); break; - case WXK_F22: key = _T("F22"); break; - case WXK_F23: key = _T("F23"); break; - case WXK_F24: key = _T("F24"); break; - case WXK_NUMLOCK: key = _T("NUMLOCK"); break; - case WXK_SCROLL: key = _T("SCROLL"); break; - case WXK_PAGEUP: key = _T("PAGEUP"); break; - case WXK_PAGEDOWN: key = _T("PAGEDOWN"); break; - case WXK_NUMPAD_SPACE: key = _T("NUMPAD_SPACE"); break; - case WXK_NUMPAD_TAB: key = _T("NUMPAD_TAB"); break; - case WXK_NUMPAD_ENTER: key = _T("NUMPAD_ENTER"); break; - case WXK_NUMPAD_F1: key = _T("NUMPAD_F1"); break; - case WXK_NUMPAD_F2: key = _T("NUMPAD_F2"); break; - case WXK_NUMPAD_F3: key = _T("NUMPAD_F3"); break; - case WXK_NUMPAD_F4: key = _T("NUMPAD_F4"); break; - case WXK_NUMPAD_HOME: key = _T("NUMPAD_HOME"); break; - case WXK_NUMPAD_LEFT: key = _T("NUMPAD_LEFT"); break; - case WXK_NUMPAD_UP: key = _T("NUMPAD_UP"); break; - case WXK_NUMPAD_RIGHT: key = _T("NUMPAD_RIGHT"); break; - case WXK_NUMPAD_DOWN: key = _T("NUMPAD_DOWN"); break; - case WXK_NUMPAD_PAGEUP: key = _T("NUMPAD_PAGEUP"); break; - case WXK_NUMPAD_PAGEDOWN: key = _T("NUMPAD_PAGEDOWN"); break; - case WXK_NUMPAD_END: key = _T("NUMPAD_END"); break; - case WXK_NUMPAD_BEGIN: key = _T("NUMPAD_BEGIN"); break; - case WXK_NUMPAD_INSERT: key = _T("NUMPAD_INSERT"); break; - case WXK_NUMPAD_DELETE: key = _T("NUMPAD_DELETE"); break; - case WXK_NUMPAD_EQUAL: key = _T("NUMPAD_EQUAL"); break; - case WXK_NUMPAD_MULTIPLY: key = _T("NUMPAD_MULTIPLY"); break; - case WXK_NUMPAD_ADD: key = _T("NUMPAD_ADD"); break; - case WXK_NUMPAD_SEPARATOR: key = _T("NUMPAD_SEPARATOR"); break; - case WXK_NUMPAD_SUBTRACT: key = _T("NUMPAD_SUBTRACT"); break; - case WXK_NUMPAD_DECIMAL: key = _T("NUMPAD_DECIMAL"); break; + case WXK_BACK: key = wxT("BACK"); break; + case WXK_TAB: key = wxT("TAB"); break; + case WXK_RETURN: key = wxT("RETURN"); break; + case WXK_ESCAPE: key = wxT("ESCAPE"); break; + case WXK_SPACE: key = wxT("SPACE"); break; + case WXK_DELETE: key = wxT("DELETE"); break; + case WXK_START: key = wxT("START"); break; + case WXK_LBUTTON: key = wxT("LBUTTON"); break; + case WXK_RBUTTON: key = wxT("RBUTTON"); break; + case WXK_CANCEL: key = wxT("CANCEL"); break; + case WXK_MBUTTON: key = wxT("MBUTTON"); break; + case WXK_CLEAR: key = wxT("CLEAR"); break; + case WXK_SHIFT: key = wxT("SHIFT"); break; + case WXK_ALT: key = wxT("ALT"); break; + case WXK_CONTROL: key = wxT("CONTROL"); break; + case WXK_MENU: key = wxT("MENU"); break; + case WXK_PAUSE: key = wxT("PAUSE"); break; + case WXK_CAPITAL: key = wxT("CAPITAL"); break; + case WXK_END: key = wxT("END"); break; + case WXK_HOME: key = wxT("HOME"); break; + case WXK_LEFT: key = wxT("LEFT"); break; + case WXK_UP: key = wxT("UP"); break; + case WXK_RIGHT: key = wxT("RIGHT"); break; + case WXK_DOWN: key = wxT("DOWN"); break; + case WXK_SELECT: key = wxT("SELECT"); break; + case WXK_PRINT: key = wxT("PRINT"); break; + case WXK_EXECUTE: key = wxT("EXECUTE"); break; + case WXK_SNAPSHOT: key = wxT("SNAPSHOT"); break; + case WXK_INSERT: key = wxT("INSERT"); break; + case WXK_HELP: key = wxT("HELP"); break; + case WXK_NUMPAD0: key = wxT("NUMPAD0"); break; + case WXK_NUMPAD1: key = wxT("NUMPAD1"); break; + case WXK_NUMPAD2: key = wxT("NUMPAD2"); break; + case WXK_NUMPAD3: key = wxT("NUMPAD3"); break; + case WXK_NUMPAD4: key = wxT("NUMPAD4"); break; + case WXK_NUMPAD5: key = wxT("NUMPAD5"); break; + case WXK_NUMPAD6: key = wxT("NUMPAD6"); break; + case WXK_NUMPAD7: key = wxT("NUMPAD7"); break; + case WXK_NUMPAD8: key = wxT("NUMPAD8"); break; + case WXK_NUMPAD9: key = wxT("NUMPAD9"); break; + case WXK_MULTIPLY: key = wxT("MULTIPLY"); break; + case WXK_ADD: key = wxT("ADD"); break; + case WXK_SEPARATOR: key = wxT("SEPARATOR"); break; + case WXK_SUBTRACT: key = wxT("SUBTRACT"); break; + case WXK_DECIMAL: key = wxT("DECIMAL"); break; + case WXK_DIVIDE: key = wxT("DIVIDE"); break; + case WXK_F1: key = wxT("F1"); break; + case WXK_F2: key = wxT("F2"); break; + case WXK_F3: key = wxT("F3"); break; + case WXK_F4: key = wxT("F4"); break; + case WXK_F5: key = wxT("F5"); break; + case WXK_F6: key = wxT("F6"); break; + case WXK_F7: key = wxT("F7"); break; + case WXK_F8: key = wxT("F8"); break; + case WXK_F9: key = wxT("F9"); break; + case WXK_F10: key = wxT("F10"); break; + case WXK_F11: key = wxT("F11"); break; + case WXK_F12: key = wxT("F12"); break; + case WXK_F13: key = wxT("F13"); break; + case WXK_F14: key = wxT("F14"); break; + case WXK_F15: key = wxT("F15"); break; + case WXK_F16: key = wxT("F16"); break; + case WXK_F17: key = wxT("F17"); break; + case WXK_F18: key = wxT("F18"); break; + case WXK_F19: key = wxT("F19"); break; + case WXK_F20: key = wxT("F20"); break; + case WXK_F21: key = wxT("F21"); break; + case WXK_F22: key = wxT("F22"); break; + case WXK_F23: key = wxT("F23"); break; + case WXK_F24: key = wxT("F24"); break; + case WXK_NUMLOCK: key = wxT("NUMLOCK"); break; + case WXK_SCROLL: key = wxT("SCROLL"); break; + case WXK_PAGEUP: key = wxT("PAGEUP"); break; + case WXK_PAGEDOWN: key = wxT("PAGEDOWN"); break; + case WXK_NUMPAD_SPACE: key = wxT("NUMPAD_SPACE"); break; + case WXK_NUMPAD_TAB: key = wxT("NUMPAD_TAB"); break; + case WXK_NUMPAD_ENTER: key = wxT("NUMPAD_ENTER"); break; + case WXK_NUMPAD_F1: key = wxT("NUMPAD_F1"); break; + case WXK_NUMPAD_F2: key = wxT("NUMPAD_F2"); break; + case WXK_NUMPAD_F3: key = wxT("NUMPAD_F3"); break; + case WXK_NUMPAD_F4: key = wxT("NUMPAD_F4"); break; + case WXK_NUMPAD_HOME: key = wxT("NUMPAD_HOME"); break; + case WXK_NUMPAD_LEFT: key = wxT("NUMPAD_LEFT"); break; + case WXK_NUMPAD_UP: key = wxT("NUMPAD_UP"); break; + case WXK_NUMPAD_RIGHT: key = wxT("NUMPAD_RIGHT"); break; + case WXK_NUMPAD_DOWN: key = wxT("NUMPAD_DOWN"); break; + case WXK_NUMPAD_PAGEUP: key = wxT("NUMPAD_PAGEUP"); break; + case WXK_NUMPAD_PAGEDOWN: key = wxT("NUMPAD_PAGEDOWN"); break; + case WXK_NUMPAD_END: key = wxT("NUMPAD_END"); break; + case WXK_NUMPAD_BEGIN: key = wxT("NUMPAD_BEGIN"); break; + case WXK_NUMPAD_INSERT: key = wxT("NUMPAD_INSERT"); break; + case WXK_NUMPAD_DELETE: key = wxT("NUMPAD_DELETE"); break; + case WXK_NUMPAD_EQUAL: key = wxT("NUMPAD_EQUAL"); break; + case WXK_NUMPAD_MULTIPLY: key = wxT("NUMPAD_MULTIPLY"); break; + case WXK_NUMPAD_ADD: key = wxT("NUMPAD_ADD"); break; + case WXK_NUMPAD_SEPARATOR: key = wxT("NUMPAD_SEPARATOR"); break; + case WXK_NUMPAD_SUBTRACT: key = wxT("NUMPAD_SUBTRACT"); break; + case WXK_NUMPAD_DECIMAL: key = wxT("NUMPAD_DECIMAL"); break; default: { if ( wxIsprint((int)keycode) ) - key.Printf(_T("'%c'"), (char)keycode); + key.Printf(wxT("'%c'"), (char)keycode); else if ( keycode > 0 && keycode < 27 ) - key.Printf(_("Ctrl-%c"), _T('A') + keycode - 1); + key.Printf(_("Ctrl-%c"), wxT('A') + keycode - 1); else - key.Printf(_T("unknown (%ld)"), keycode); + key.Printf(wxT("unknown (%ld)"), keycode); } } } #if wxUSE_UNICODE - key += wxString::Format(_T(" (Unicode: %#04x)"), event.GetUnicodeKey()); + key += wxString::Format(wxT(" (Unicode: %#04x)"), event.GetUnicodeKey()); #endif // wxUSE_UNICODE - wxLogMessage( _T("%s event: %s (flags = %c%c%c%c)"), + wxLogMessage( wxT("%s event: %s (flags = %c%c%c%c)"), name, key.c_str(), - GetChar( event.ControlDown(), _T('C') ), - GetChar( event.AltDown(), _T('A') ), - GetChar( event.ShiftDown(), _T('S') ), - GetChar( event.MetaDown(), _T('M') ) ); + GetChar( event.ControlDown(), wxT('C') ), + GetChar( event.AltDown(), wxT('A') ), + GetChar( event.ShiftDown(), wxT('S') ), + GetChar( event.MetaDown(), wxT('M') ) ); } static wxString GetMouseEventDesc(const wxMouseEvent& ev) @@ -719,31 +719,31 @@ static wxString GetMouseEventDesc(const wxMouseEvent& ev) bool dbl, up; if ( ev.LeftDown() || ev.LeftUp() || ev.LeftDClick() ) { - button = _T("Left"); + button = wxT("Left"); dbl = ev.LeftDClick(); up = ev.LeftUp(); } else if ( ev.MiddleDown() || ev.MiddleUp() || ev.MiddleDClick() ) { - button = _T("Middle"); + button = wxT("Middle"); dbl = ev.MiddleDClick(); up = ev.MiddleUp(); } else if ( ev.RightDown() || ev.RightUp() || ev.RightDClick() ) { - button = _T("Right"); + button = wxT("Right"); dbl = ev.RightDClick(); up = ev.RightUp(); } else { - return _T("Unknown mouse event"); + return wxT("Unknown mouse event"); } - return wxString::Format(_T("%s mouse button %s"), + return wxString::Format(wxT("%s mouse button %s"), button.c_str(), - dbl ? _T("double clicked") - : up ? _T("released") : _T("clicked")); + dbl ? wxT("double clicked") + : up ? wxT("released") : wxT("clicked")); } void MyTextCtrl::OnMouseEvent(wxMouseEvent& ev) @@ -758,35 +758,35 @@ void MyTextCtrl::OnMouseEvent(wxMouseEvent& ev) wxString msg; if ( ev.Entering() ) { - msg = _T("Mouse entered the window"); + msg = wxT("Mouse entered the window"); } else if ( ev.Leaving() ) { - msg = _T("Mouse left the window"); + msg = wxT("Mouse left the window"); } else { msg = GetMouseEventDesc(ev); } - msg << _T(" at (") << ev.GetX() << _T(", ") << ev.GetY() << _T(") "); + msg << wxT(" at (") << ev.GetX() << wxT(", ") << ev.GetY() << wxT(") "); long pos; wxTextCtrlHitTestResult rc = HitTest(ev.GetPosition(), &pos); if ( rc != wxTE_HT_UNKNOWN ) { - msg << _T("at position ") << pos << _T(' '); + msg << wxT("at position ") << pos << wxT(' '); } - msg << _T("[Flags: ") - << GetChar( ev.LeftIsDown(), _T('1') ) - << GetChar( ev.MiddleIsDown(), _T('2') ) - << GetChar( ev.RightIsDown(), _T('3') ) - << GetChar( ev.ControlDown(), _T('C') ) - << GetChar( ev.AltDown(), _T('A') ) - << GetChar( ev.ShiftDown(), _T('S') ) - << GetChar( ev.MetaDown(), _T('M') ) - << _T(']'); + msg << wxT("[Flags: ") + << GetChar( ev.LeftIsDown(), wxT('1') ) + << GetChar( ev.MiddleIsDown(), wxT('2') ) + << GetChar( ev.RightIsDown(), wxT('3') ) + << GetChar( ev.ControlDown(), wxT('C') ) + << GetChar( ev.AltDown(), wxT('A') ) + << GetChar( ev.ShiftDown(), wxT('S') ) + << GetChar( ev.MetaDown(), wxT('M') ) + << wxT(']'); wxLogMessage(msg); } @@ -819,16 +819,16 @@ void MyTextCtrl::OnText(wxCommandEvent& event) return; MyTextCtrl *win = (MyTextCtrl *)event.GetEventObject(); - const wxChar *changeVerb = win->IsModified() ? _T("changed") - : _T("set by program"); + const wxChar *changeVerb = win->IsModified() ? wxT("changed") + : wxT("set by program"); const wxChar *data = (const wxChar *)(win->GetClientData()); if ( data ) { - wxLogMessage(_T("Text %s in control \"%s\""), changeVerb, data); + wxLogMessage(wxT("Text %s in control \"%s\""), changeVerb, data); } else { - wxLogMessage(_T("Text %s in some control"), changeVerb); + wxLogMessage(wxT("Text %s in some control"), changeVerb); } } @@ -841,39 +841,39 @@ void MyTextCtrl::OnTextEnter(wxCommandEvent& event) const wxChar *data = (const wxChar *)(win->GetClientData()); if ( data ) { - wxLogMessage(_T("Enter pressed in control '%s'"), data); + wxLogMessage(wxT("Enter pressed in control '%s'"), data); } else { - wxLogMessage(_T("Enter pressed in some control")); + wxLogMessage(wxT("Enter pressed in some control")); } } void MyTextCtrl::OnTextMaxLen(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("You can't enter more characters into this control.")); + wxLogMessage(wxT("You can't enter more characters into this control.")); } void MyTextCtrl::OnTextCut(wxClipboardTextEvent& event) { - LogClipEvent(_T("cut to"), event); + LogClipEvent(wxT("cut to"), event); } void MyTextCtrl::OnTextCopy(wxClipboardTextEvent& event) { - LogClipEvent(_T("copied to"), event); + LogClipEvent(wxT("copied to"), event); } void MyTextCtrl::OnTextPaste(wxClipboardTextEvent& event) { - LogClipEvent(_T("pasted from"), event); + LogClipEvent(wxT("pasted from"), event); } void MyTextCtrl::LogClipEvent(const wxChar *what, wxClipboardTextEvent& event) { wxFrame *frame = wxDynamicCast(wxGetTopLevelParent(this), wxFrame); - wxCHECK_RET( frame, _T("no parent frame?") ); + wxCHECK_RET( frame, wxT("no parent frame?") ); const bool veto = frame->GetMenuBar()->IsChecked(TEXT_CLIPBOARD_VETO); if ( !veto ) @@ -881,8 +881,8 @@ void MyTextCtrl::LogClipEvent(const wxChar *what, wxClipboardTextEvent& event) if ( ms_logClip ) { - wxLogMessage(_T("Text %s%s the clipboard."), - veto ? _T("not ") : _T(""), what); + wxLogMessage(wxT("Text %s%s the clipboard."), + veto ? wxT("not ") : wxT(""), what); } } @@ -898,7 +898,7 @@ void MyTextCtrl::OnTextURL(wxTextUrlEvent& event) long start = event.GetURLStart(), end = event.GetURLEnd(); - wxLogMessage(_T("Mouse event over URL '%s': %s"), + wxLogMessage(wxT("Mouse event over URL '%s': %s"), GetValue().Mid(start, end - start).c_str(), GetMouseEventDesc(ev).c_str()); } @@ -906,7 +906,7 @@ void MyTextCtrl::OnTextURL(wxTextUrlEvent& event) void MyTextCtrl::OnChar(wxKeyEvent& event) { if ( ms_logChar ) - LogKeyEvent( _T("Char"), event); + LogKeyEvent( wxT("Char"), event); event.Skip(); } @@ -914,7 +914,7 @@ void MyTextCtrl::OnChar(wxKeyEvent& event) void MyTextCtrl::OnKeyUp(wxKeyEvent& event) { if ( ms_logKey ) - LogKeyEvent( _T("Key up"), event); + LogKeyEvent( wxT("Key up"), event); event.Skip(); } @@ -929,7 +929,7 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event) long line, column, pos = GetInsertionPoint(); PositionToXY(pos, &column, &line); - wxLogMessage(_T("Current position: %ld\nCurrent line, column: (%ld, %ld)\nNumber of lines: %ld\nCurrent line length: %ld\nTotal text length: %u (%ld)"), + wxLogMessage(wxT("Current position: %ld\nCurrent line, column: (%ld, %ld)\nNumber of lines: %ld\nCurrent line length: %ld\nTotal text length: %u (%ld)"), pos, line, column, (long) GetNumberOfLines(), @@ -942,13 +942,13 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event) wxString sel = GetStringSelection(); - wxLogMessage(_T("Selection: from %ld to %ld."), from, to); - wxLogMessage(_T("Selection = '%s' (len = %u)"), + wxLogMessage(wxT("Selection: from %ld to %ld."), from, to); + wxLogMessage(wxT("Selection = '%s' (len = %u)"), sel.c_str(), (unsigned int) sel.length()); const wxString text = GetLineText(line); - wxLogMessage(_T("Current line: \"%s\"; length = %lu"), + wxLogMessage(wxT("Current line: \"%s\"; length = %lu"), text.c_str(), text.length()); } break; @@ -980,38 +980,38 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event) case WXK_F5: // insert a blank line - WriteText(_T("\n")); + WriteText(wxT("\n")); break; case WXK_F6: - wxLogMessage(_T("IsModified() before SetValue(): %d"), + wxLogMessage(wxT("IsModified() before SetValue(): %d"), IsModified()); - ChangeValue(_T("ChangeValue() has been called")); - wxLogMessage(_T("IsModified() after SetValue(): %d"), + ChangeValue(wxT("ChangeValue() has been called")); + wxLogMessage(wxT("IsModified() after SetValue(): %d"), IsModified()); break; case WXK_F7: - wxLogMessage(_T("Position 10 should be now visible.")); + wxLogMessage(wxT("Position 10 should be now visible.")); ShowPosition(10); break; case WXK_F8: - wxLogMessage(_T("Control has been cleared")); + wxLogMessage(wxT("Control has been cleared")); Clear(); break; case WXK_F9: - WriteText(_T("WriteText() has been called")); + WriteText(wxT("WriteText() has been called")); break; case WXK_F10: - AppendText(_T("AppendText() has been called")); + AppendText(wxT("AppendText() has been called")); break; case WXK_F11: DiscardEdits(); - wxLogMessage(_T("Control marked as non modified")); + wxLogMessage(wxT("Control marked as non modified")); break; } @@ -1029,7 +1029,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) : wxPanel( frame, wxID_ANY, wxPoint(x, y), wxSize(w, h) ) { #if wxUSE_LOG - m_log = new wxTextCtrl( this, wxID_ANY, _T("This is the log window.\n"), + m_log = new wxTextCtrl( this, wxID_ANY, wxT("This is the log window.\n"), wxPoint(5,260), wxSize(630,100), wxTE_MULTILINE | wxTE_READONLY /* | wxTE_RICH */); @@ -1038,28 +1038,28 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) // single line text controls - m_text = new MyTextCtrl( this, wxID_ANY, _T("Single line."), + m_text = new MyTextCtrl( this, wxID_ANY, wxT("Single line."), wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER); m_text->SetForegroundColour(*wxBLUE); m_text->SetBackgroundColour(*wxLIGHT_GREY); - (*m_text) << _T(" Appended."); + (*m_text) << wxT(" Appended."); m_text->SetInsertionPoint(0); - m_text->WriteText( _T("Prepended. ") ); + m_text->WriteText( wxT("Prepended. ") ); - m_password = new MyTextCtrl( this, wxID_ANY, _T(""), + m_password = new MyTextCtrl( this, wxID_ANY, wxT(""), wxPoint(10,50), wxSize(140,wxDefaultCoord), wxTE_PASSWORD ); - m_readonly = new MyTextCtrl( this, wxID_ANY, _T("Read only"), + m_readonly = new MyTextCtrl( this, wxID_ANY, wxT("Read only"), wxPoint(10,90), wxSize(140,wxDefaultCoord), wxTE_READONLY ); - m_limited = new MyTextCtrl(this, wxID_ANY, _T("Max 8 ch"), + m_limited = new MyTextCtrl(this, wxID_ANY, wxT("Max 8 ch"), wxPoint(10, 130), wxSize(140, wxDefaultCoord)); m_limited->SetMaxLength(8); // multi line text controls - m_horizontal = new MyTextCtrl( this, wxID_ANY, _T("Multiline text control with a horizontal scrollbar.\n"), + m_horizontal = new MyTextCtrl( this, wxID_ANY, wxT("Multiline text control with a horizontal scrollbar.\n"), wxPoint(10,170), wxSize(140,70), wxTE_MULTILINE | wxHSCROLL); // a little hack to use the command line argument for encoding testing @@ -1069,21 +1069,21 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) { case '2': m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL, - false, _T(""), + false, wxT(""), wxFONTENCODING_ISO8859_2)); - m_horizontal->AppendText(_T("\256lu\273ou\350k\375 k\371\362 zb\354sile \350e\271tina \253\273")); + m_horizontal->AppendText(wxT("\256lu\273ou\350k\375 k\371\362 zb\354sile \350e\271tina \253\273")); break; case '1': m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL, - false, _T(""), + false, wxT(""), wxFONTENCODING_CP1251)); - m_horizontal->AppendText(_T("\317\360\350\342\345\362!")); + m_horizontal->AppendText(wxT("\317\360\350\342\345\362!")); break; case '8': m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL, - false, _T(""), + false, wxT(""), wxFONTENCODING_CP1251)); #if wxUSE_UNICODE m_horizontal->AppendText(L"\x0412\x0430\x0434\x0438\x043c \x0426"); @@ -1094,38 +1094,38 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) } else { - m_horizontal->AppendText(_T("Text in default encoding")); + m_horizontal->AppendText(wxT("Text in default encoding")); } m_multitext = new MyTextCtrl( this, wxID_ANY, - _T("Multi line without vertical scrollbar."), + wxT("Multi line without vertical scrollbar."), wxPoint(180,10), wxSize(200,70), wxTE_MULTILINE | wxTE_NO_VSCROLL ); m_multitext->SetFont(*wxITALIC_FONT); - (*m_multitext) << _T(" Appended."); + (*m_multitext) << wxT(" Appended."); m_multitext->SetInsertionPoint(0); - m_multitext->WriteText( _T("Prepended. ") ); + m_multitext->WriteText( wxT("Prepended. ") ); m_multitext->SetForegroundColour(*wxYELLOW); m_multitext->SetBackgroundColour(*wxLIGHT_GREY); #if wxUSE_TOOLTIPS - m_multitext->SetToolTip(_T("Press Fn function keys here")); + m_multitext->SetToolTip(wxT("Press Fn function keys here")); #endif - m_tab = new MyTextCtrl( this, 100, _T("Multiline, allow processing."), + m_tab = new MyTextCtrl( this, 100, wxT("Multiline, allow processing."), wxPoint(180,90), wxSize(200,70), wxTE_MULTILINE | wxTE_PROCESS_TAB ); - m_tab->SetClientData((void *)_T("tab")); + m_tab->SetClientData((void *)wxT("tab")); - m_enter = new MyTextCtrl( this, 100, _T("Multiline, allow processing."), + m_enter = new MyTextCtrl( this, 100, wxT("Multiline, allow processing."), wxPoint(180,170), wxSize(200,70), wxTE_MULTILINE); - m_enter->SetClientData((void *)_T("enter")); - - m_textrich = new MyTextCtrl(this, wxID_ANY, _T("Allows more than 30Kb of text\n") - _T("(even under broken Win9x)\n") - _T("and a very very very very very ") - _T("very very very long line to test ") - _T("wxHSCROLL style\n") - _T("\nAnd here is a link in quotation marks to ") - _T("test wxTE_AUTO_URL: \"http://www.wxwidgets.org\""), + m_enter->SetClientData((void *)wxT("enter")); + + m_textrich = new MyTextCtrl(this, wxID_ANY, wxT("Allows more than 30Kb of text\n") + wxT("(even under broken Win9x)\n") + wxT("and a very very very very very ") + wxT("very very very long line to test ") + wxT("wxHSCROLL style\n") + wxT("\nAnd here is a link in quotation marks to ") + wxT("test wxTE_AUTO_URL: \"http://www.wxwidgets.org\""), wxPoint(450, 10), wxSize(200, 230), wxTE_RICH | wxTE_MULTILINE | wxTE_AUTO_URL); m_textrich->SetStyle(0, 10, *wxRED); @@ -1133,15 +1133,15 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_textrich->SetStyle(30, 40, wxTextAttr(*wxGREEN, wxNullColour, *wxITALIC_FONT)); m_textrich->SetDefaultStyle(wxTextAttr()); - m_textrich->AppendText(_T("\n\nFirst 10 characters should be in red\n")); - m_textrich->AppendText(_T("Next 10 characters should be in blue\n")); - m_textrich->AppendText(_T("Next 10 characters should be normal\n")); - m_textrich->AppendText(_T("And the next 10 characters should be green and italic\n")); + m_textrich->AppendText(wxT("\n\nFirst 10 characters should be in red\n")); + m_textrich->AppendText(wxT("Next 10 characters should be in blue\n")); + m_textrich->AppendText(wxT("Next 10 characters should be normal\n")); + m_textrich->AppendText(wxT("And the next 10 characters should be green and italic\n")); m_textrich->SetDefaultStyle(wxTextAttr(*wxCYAN, *wxBLUE)); - m_textrich->AppendText(_T("This text should be cyan on blue\n")); + m_textrich->AppendText(wxT("This text should be cyan on blue\n")); m_textrich->SetDefaultStyle(wxTextAttr(*wxBLUE, *wxWHITE)); - m_textrich->AppendText(_T("And this should be in blue and the text you ") - _T("type should be in blue as well")); + m_textrich->AppendText(wxT("And this should be in blue and the text you ") + wxT("type should be in blue as well")); // lay out the controls @@ -1191,14 +1191,14 @@ void MyPanel::DoPasteFromClipboard() if (!wxTheClipboard->Open()) { #if wxUSE_LOG - *m_log << _T("Error opening the clipboard.\n"); + *m_log << wxT("Error opening the clipboard.\n"); #endif // wxUSE_LOG return; } else { #if wxUSE_LOG - *m_log << _T("Successfully opened the clipboard.\n"); + *m_log << wxT("Successfully opened the clipboard.\n"); #endif // wxUSE_LOG } @@ -1207,34 +1207,34 @@ void MyPanel::DoPasteFromClipboard() if (wxTheClipboard->IsSupported( data.GetFormat() )) { #if wxUSE_LOG - *m_log << _T("Clipboard supports requested format.\n"); + *m_log << wxT("Clipboard supports requested format.\n"); #endif // wxUSE_LOG if (wxTheClipboard->GetData( data )) { #if wxUSE_LOG - *m_log << _T("Successfully retrieved data from the clipboard.\n"); + *m_log << wxT("Successfully retrieved data from the clipboard.\n"); #endif // wxUSE_LOG GetFocusedText()->AppendText(data.GetText()); } else { #if wxUSE_LOG - *m_log << _T("Error getting data from the clipboard.\n"); + *m_log << wxT("Error getting data from the clipboard.\n"); #endif // wxUSE_LOG } } else { #if wxUSE_LOG - *m_log << _T("Clipboard doesn't support requested format.\n"); + *m_log << wxT("Clipboard doesn't support requested format.\n"); #endif // wxUSE_LOG } wxTheClipboard->Close(); #if wxUSE_LOG - *m_log << _T("Closed the clipboard.\n"); + *m_log << wxT("Closed the clipboard.\n"); #endif // wxUSE_LOG } @@ -1250,7 +1250,7 @@ void MyPanel::DoCopyToClipboard() if (text.IsEmpty()) { #if wxUSE_LOG - *m_log << _T("No text to copy.\n"); + *m_log << wxT("No text to copy.\n"); #endif // wxUSE_LOG return; @@ -1259,7 +1259,7 @@ void MyPanel::DoCopyToClipboard() if (!wxTheClipboard->Open()) { #if wxUSE_LOG - *m_log << _T("Error opening the clipboard.\n"); + *m_log << wxT("Error opening the clipboard.\n"); #endif // wxUSE_LOG return; @@ -1267,7 +1267,7 @@ void MyPanel::DoCopyToClipboard() else { #if wxUSE_LOG - *m_log << _T("Successfully opened the clipboard.\n"); + *m_log << wxT("Successfully opened the clipboard.\n"); #endif // wxUSE_LOG } @@ -1276,20 +1276,20 @@ void MyPanel::DoCopyToClipboard() if (!wxTheClipboard->SetData( data )) { #if wxUSE_LOG - *m_log << _T("Error while copying to the clipboard.\n"); + *m_log << wxT("Error while copying to the clipboard.\n"); #endif // wxUSE_LOG } else { #if wxUSE_LOG - *m_log << _T("Successfully copied data to the clipboard.\n"); + *m_log << wxT("Successfully copied data to the clipboard.\n"); #endif // wxUSE_LOG } wxTheClipboard->Close(); #if wxUSE_LOG - *m_log << _T("Closed the clipboard.\n"); + *m_log << wxT("Closed the clipboard.\n"); #endif // wxUSE_LOG } @@ -1314,7 +1314,7 @@ void MyPanel::DoRemoveText() void MyPanel::DoReplaceText() { - GetFocusedText()->Replace(3, 8, _T("ABC")); + GetFocusedText()->Replace(3, 8, wxT("ABC")); } void MyPanel::DoSelectText() @@ -1404,12 +1404,12 @@ void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) wxBeginBusyCursor(); wxMessageDialog dialog(this, - _T("This is a text control sample. It demonstrates the many different\n") - _T("text control styles, the use of the clipboard, setting and handling\n") - _T("tooltips and intercepting key and char events.\n") - _T("\n") - _T("Copyright (c) 1999, Robert Roebling, Julian Smart, Vadim Zeitlin"), - _T("About wxTextCtrl Sample"), + wxT("This is a text control sample. It demonstrates the many different\n") + wxT("text control styles, the use of the clipboard, setting and handling\n") + wxT("tooltips and intercepting key and char events.\n") + wxT("\n") + wxT("Copyright (c) 1999, Robert Roebling, Julian Smart, Vadim Zeitlin"), + wxT("About wxTextCtrl Sample"), wxOK | wxICON_INFORMATION); dialog.ShowModal(); @@ -1424,20 +1424,20 @@ void MyFrame::OnSetTooltipDelay(wxCommandEvent& WXUNUSED(event)) static long s_delay = 5000; wxString delay; - delay.Printf( _T("%ld"), s_delay); + delay.Printf( wxT("%ld"), s_delay); - delay = wxGetTextFromUser(_T("Enter delay (in milliseconds)"), - _T("Set tooltip delay"), + delay = wxGetTextFromUser(wxT("Enter delay (in milliseconds)"), + wxT("Set tooltip delay"), delay, this); if ( !delay ) return; // cancelled - wxSscanf(delay, _T("%ld"), &s_delay); + wxSscanf(delay, wxT("%ld"), &s_delay); wxToolTip::SetDelay(s_delay); - wxLogStatus(this, _T("Tooltip delay set to %ld milliseconds"), s_delay); + wxLogStatus(this, wxT("Tooltip delay set to %ld milliseconds"), s_delay); } void MyFrame::OnToggleTooltips(wxCommandEvent& WXUNUSED(event)) @@ -1448,7 +1448,7 @@ void MyFrame::OnToggleTooltips(wxCommandEvent& WXUNUSED(event)) wxToolTip::Enable(s_enabled); - wxLogStatus(this, _T("Tooltips %sabled"), s_enabled ? _T("en") : _T("dis") ); + wxLogStatus(this, wxT("Tooltips %sabled"), s_enabled ? wxT("en") : wxT("dis") ); } #endif // tooltips @@ -1485,36 +1485,36 @@ void MyFrame::OnSetEnabled(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnFileSave(wxCommandEvent& WXUNUSED(event)) { - if ( m_panel->m_textrich->SaveFile(_T("dummy.txt")) ) + if ( m_panel->m_textrich->SaveFile(wxT("dummy.txt")) ) { #if wxUSE_FILE // verify that the fil length is correct (it wasn't under Win95) wxFile file(wxT("dummy.txt")); wxLogStatus(this, - _T("Successfully saved file (text len = %lu, file size = %ld)"), + wxT("Successfully saved file (text len = %lu, file size = %ld)"), (unsigned long)m_panel->m_textrich->GetValue().length(), (long) file.Length()); #endif } else - wxLogStatus(this, _T("Couldn't save the file")); + wxLogStatus(this, wxT("Couldn't save the file")); } void MyFrame::OnFileLoad(wxCommandEvent& WXUNUSED(event)) { - if ( m_panel->m_textrich->LoadFile(_T("dummy.txt")) ) + if ( m_panel->m_textrich->LoadFile(wxT("dummy.txt")) ) { - wxLogStatus(this, _T("Successfully loaded file")); + wxLogStatus(this, wxT("Successfully loaded file")); } else { - wxLogStatus(this, _T("Couldn't load the file")); + wxLogStatus(this, wxT("Couldn't load the file")); } } void MyFrame::OnRichTextTest(wxCommandEvent& WXUNUSED(event)) { - RichTextFrame* frame = new RichTextFrame(this, _T("Rich Text Editor")); + RichTextFrame* frame = new RichTextFrame(this, wxT("Rich Text Editor")); frame->Show(true); } @@ -1530,9 +1530,9 @@ void MyFrame::OnIdle( wxIdleEvent& event ) wxString msg; msg.Printf( #ifdef __WXMSW__ - _T("Focus: wxWindow = %p, HWND = %p"), + wxT("Focus: wxWindow = %p, HWND = %p"), #else - _T("Focus: wxWindow = %p"), + wxT("Focus: wxWindow = %p"), #endif s_windowFocus #ifdef __WXMSW__ @@ -1716,7 +1716,7 @@ void RichTextFrame::OnChangeTextColour(wxCommandEvent& WXUNUSED(event)) } wxColourDialog dialog(this, &data); - dialog.SetTitle(_T("Choose the text colour")); + dialog.SetTitle(wxT("Choose the text colour")); if (dialog.ShowModal() == wxID_OK) { wxColourData retData = dialog.GetColourData(); @@ -1745,7 +1745,7 @@ void RichTextFrame::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) } wxColourDialog dialog(this, &data); - dialog.SetTitle(_T("Choose the text background colour")); + dialog.SetTitle(wxT("Choose the text background colour")); if (dialog.ShowModal() == wxID_OK) { wxColourData retData = dialog.GetColourData(); @@ -1822,7 +1822,7 @@ void RichTextFrame::OnTabStops(wxCommandEvent& WXUNUSED(event)) wxArrayInt tabs; - wxStringTokenizer tokens(tabsStr, _T(" ")); + wxStringTokenizer tokens(tabsStr, wxT(" ")); while (tokens.HasMoreTokens()) { wxString token = tokens.GetNextToken(); diff --git a/samples/thread/thread.cpp b/samples/thread/thread.cpp index d8d10716c0..da8acbdc54 100644 --- a/samples/thread/thread.cpp +++ b/samples/thread/thread.cpp @@ -357,29 +357,29 @@ MyFrame::MyFrame(const wxString& title) wxMenuBar *menuBar = new wxMenuBar; wxMenu *menuFile = new wxMenu; - menuFile->Append(THREAD_CLEAR, _T("&Clear log\tCtrl-L")); + menuFile->Append(THREAD_CLEAR, wxT("&Clear log\tCtrl-L")); menuFile->AppendSeparator(); - menuFile->Append(THREAD_QUIT, _T("E&xit\tAlt-X")); - menuBar->Append(menuFile, _T("&File")); + menuFile->Append(THREAD_QUIT, wxT("E&xit\tAlt-X")); + menuBar->Append(menuFile, wxT("&File")); wxMenu *menuThread = new wxMenu; - menuThread->Append(THREAD_START_THREAD, _T("&Start a new thread\tCtrl-N")); - menuThread->Append(THREAD_START_THREADS, _T("Start &many threads at once")); - menuThread->Append(THREAD_STOP_THREAD, _T("S&top the last spawned thread\tCtrl-S")); + menuThread->Append(THREAD_START_THREAD, wxT("&Start a new thread\tCtrl-N")); + menuThread->Append(THREAD_START_THREADS, wxT("Start &many threads at once")); + menuThread->Append(THREAD_STOP_THREAD, wxT("S&top the last spawned thread\tCtrl-S")); menuThread->AppendSeparator(); - menuThread->Append(THREAD_PAUSE_THREAD, _T("&Pause the last spawned running thread\tCtrl-P")); - menuThread->Append(THREAD_RESUME_THREAD, _T("&Resume the first suspended thread\tCtrl-R")); + menuThread->Append(THREAD_PAUSE_THREAD, wxT("&Pause the last spawned running thread\tCtrl-P")); + menuThread->Append(THREAD_RESUME_THREAD, wxT("&Resume the first suspended thread\tCtrl-R")); menuThread->AppendSeparator(); - menuThread->Append(THREAD_START_WORKER, _T("Start a &worker thread\tCtrl-W")); - menuThread->Append(THREAD_EXEC_MAIN, _T("&Launch a program from main thread\tF5")); - menuThread->Append(THREAD_START_GUI_THREAD, _T("Launch a &GUI thread\tF6")); - menuBar->Append(menuThread, _T("&Thread")); + menuThread->Append(THREAD_START_WORKER, wxT("Start a &worker thread\tCtrl-W")); + menuThread->Append(THREAD_EXEC_MAIN, wxT("&Launch a program from main thread\tF5")); + menuThread->Append(THREAD_START_GUI_THREAD, wxT("Launch a &GUI thread\tF6")); + menuBar->Append(menuThread, wxT("&Thread")); wxMenu *menuHelp = new wxMenu; - menuHelp->Append(THREAD_SHOWCPUS, _T("&Show CPU count")); + menuHelp->Append(THREAD_SHOWCPUS, wxT("&Show CPU count")); menuHelp->AppendSeparator(); - menuHelp->Append(THREAD_ABOUT, _T("&About...")); - menuBar->Append(menuHelp, _T("&Help")); + menuHelp->Append(THREAD_ABOUT, wxT("&About...")); + menuBar->Append(menuHelp, wxT("&Help")); SetMenuBar(menuBar); @@ -537,8 +537,8 @@ void MyFrame::OnStartThreads(wxCommandEvent& WXUNUSED(event) ) { static long s_num; - s_num = wxGetNumberFromUser(_T("How many threads to start: "), _T(""), - _T("wxThread sample"), s_num, 1, 10000, this); + s_num = wxGetNumberFromUser(wxT("How many threads to start: "), wxT(""), + wxT("wxThread sample"), s_num, 1, 10000, this); if ( s_num == -1 ) { s_num = 10; @@ -591,7 +591,7 @@ void MyFrame::OnStartThread(wxCommandEvent& WXUNUSED(event) ) } #if wxUSE_STATUSBAR - SetStatusText(_T("New thread started."), 1); + SetStatusText(wxT("New thread started."), 1); #endif // wxUSE_STATUSBAR } @@ -609,7 +609,7 @@ void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) ) wxGetApp().m_threads.Last()->Delete(); #if wxUSE_STATUSBAR - SetStatusText(_T("Last thread stopped."), 1); + SetStatusText(wxT("Last thread stopped."), 1); #endif // wxUSE_STATUSBAR } } @@ -632,7 +632,7 @@ void MyFrame::OnResumeThread(wxCommandEvent& WXUNUSED(event) ) wxGetApp().m_threads[n]->Resume(); #if wxUSE_STATUSBAR - SetStatusText(_T("Thread resumed."), 1); + SetStatusText(wxT("Thread resumed."), 1); #endif // wxUSE_STATUSBAR } } @@ -655,7 +655,7 @@ void MyFrame::OnPauseThread(wxCommandEvent& WXUNUSED(event) ) wxGetApp().m_threads[n]->Pause(); #if wxUSE_STATUSBAR - SetStatusText(_T("Thread paused."), 1); + SetStatusText(wxT("Thread paused."), 1); #endif // wxUSE_STATUSBAR } } @@ -697,15 +697,15 @@ void MyFrame::OnShowCPUs(wxCommandEvent& WXUNUSED(event)) switch ( nCPUs ) { case -1: - msg = _T("Unknown number of CPUs"); + msg = wxT("Unknown number of CPUs"); break; case 0: - msg = _T("WARNING: you're running without any CPUs!"); + msg = wxT("WARNING: you're running without any CPUs!"); break; case 1: - msg = _T("This system only has one CPU."); + msg = wxT("This system only has one CPU."); break; default: @@ -718,11 +718,11 @@ void MyFrame::OnShowCPUs(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) { wxMessageDialog dialog(this, - _T("wxWidgets multithreaded application sample\n") - _T("(c) 1998 Julian Smart, Guilhem Lavaux\n") - _T("(c) 2000 Robert Roebling\n") - _T("(c) 1999,2009 Vadim Zeitlin"), - _T("About wxThread sample"), + wxT("wxWidgets multithreaded application sample\n") + wxT("(c) 1998 Julian Smart, Guilhem Lavaux\n") + wxT("(c) 2000 Robert Roebling\n") + wxT("(c) 1999,2009 Vadim Zeitlin"), + wxT("About wxThread sample"), wxOK | wxICON_INFORMATION); dialog.ShowModal(); @@ -750,8 +750,8 @@ void MyFrame::OnStartWorker(wxCommandEvent& WXUNUSED(event)) m_dlgProgress = new wxProgressDialog ( - _T("Progress dialog"), - _T("Wait until the thread terminates or press [Cancel]"), + wxT("Progress dialog"), + wxT("Wait until the thread terminates or press [Cancel]"), 100, this, wxPD_CAN_ABORT | diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index 06f3ddd559..7629206d39 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -100,7 +100,7 @@ class MyFrame: public wxFrame public: MyFrame(wxFrame *parent, wxWindowID id = wxID_ANY, - const wxString& title = _T("wxToolBar Sample"), + const wxString& title = wxT("wxToolBar Sample"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE); @@ -304,13 +304,13 @@ bool MyApp::OnInit() // Create the main frame window MyFrame* frame = new MyFrame((wxFrame *) NULL, wxID_ANY, - _T("wxToolBar Sample"), + wxT("wxToolBar Sample"), wxPoint(100, 100), wxSize(550, 300)); frame->Show(true); #if wxUSE_STATUSBAR - frame->SetStatusText(_T("Hello, wxWidgets")); + frame->SetStatusText(wxT("Hello, wxWidgets")); #endif wxInitAllImageHandlers(); @@ -428,39 +428,39 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar) // size to fit the biggest icon used anyhow but it doesn't hurt neither toolBar->SetToolBitmapSize(wxSize(w, h)); - toolBar->AddTool(wxID_NEW, _T("New"), + toolBar->AddTool(wxID_NEW, wxT("New"), toolBarBitmaps[Tool_new], wxNullBitmap, wxITEM_DROPDOWN, - _T("New file"), _T("This is help for new file tool")); + wxT("New file"), wxT("This is help for new file tool")); wxMenu* menu = new wxMenu; - menu->Append(wxID_ANY, _T("&First dummy item")); - menu->Append(wxID_ANY, _T("&Second dummy item")); + menu->Append(wxID_ANY, wxT("&First dummy item")); + menu->Append(wxID_ANY, wxT("&Second dummy item")); menu->AppendSeparator(); - menu->Append(wxID_EXIT, _T("Exit")); + menu->Append(wxID_EXIT, wxT("Exit")); toolBar->SetDropdownMenu(wxID_NEW, menu); - toolBar->AddTool(wxID_OPEN, _T("Open"), + toolBar->AddTool(wxID_OPEN, wxT("Open"), toolBarBitmaps[Tool_open], wxNullBitmap, wxITEM_NORMAL, - _T("Open file"), _T("This is help for open file tool")); + wxT("Open file"), wxT("This is help for open file tool")); #if USE_CONTROLS_IN_TOOLBAR // adding a combo to a vertical toolbar is not very smart if ( !toolBar->IsVertical() ) { wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, wxEmptyString, wxDefaultPosition, wxSize(100,-1) ); - combo->Append(_T("This")); - combo->Append(_T("is a")); - combo->Append(_T("combobox")); - combo->Append(_T("in a")); - combo->Append(_T("toolbar")); - toolBar->AddControl(combo, _T("Combo Label")); + combo->Append(wxT("This")); + combo->Append(wxT("is a")); + combo->Append(wxT("combobox")); + combo->Append(wxT("in a")); + combo->Append(wxT("toolbar")); + toolBar->AddControl(combo, wxT("Combo Label")); } #endif // USE_CONTROLS_IN_TOOLBAR - toolBar->AddTool(wxID_SAVE, _T("Save"), toolBarBitmaps[Tool_save], _T("Toggle button 1"), wxITEM_CHECK); - toolBar->AddTool(wxID_COPY, _T("Copy"), toolBarBitmaps[Tool_copy], _T("Toggle button 2"), wxITEM_CHECK); - toolBar->AddTool(wxID_CUT, _T("Cut"), toolBarBitmaps[Tool_cut], _T("Toggle/Untoggle help button")); - toolBar->AddTool(wxID_PASTE, _T("Paste"), toolBarBitmaps[Tool_paste], _T("Paste")); + toolBar->AddTool(wxID_SAVE, wxT("Save"), toolBarBitmaps[Tool_save], wxT("Toggle button 1"), wxITEM_CHECK); + toolBar->AddTool(wxID_COPY, wxT("Copy"), toolBarBitmaps[Tool_copy], wxT("Toggle button 2"), wxITEM_CHECK); + toolBar->AddTool(wxID_CUT, wxT("Cut"), toolBarBitmaps[Tool_cut], wxT("Toggle/Untoggle help button")); + toolBar->AddTool(wxID_PASTE, wxT("Paste"), toolBarBitmaps[Tool_paste], wxT("Paste")); if ( m_useCustomDisabled ) { @@ -475,17 +475,17 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar) dc.DrawLine(0, 0, w, h); } - toolBar->AddTool(wxID_PRINT, _T("Print"), toolBarBitmaps[Tool_print], + toolBar->AddTool(wxID_PRINT, wxT("Print"), toolBarBitmaps[Tool_print], bmpDisabled); } else { - toolBar->AddTool(wxID_PRINT, _T("Print"), toolBarBitmaps[Tool_print], - _T("Delete this tool. This is a very long tooltip to test whether it does the right thing when the tooltip is more than Windows can cope with.")); + toolBar->AddTool(wxID_PRINT, wxT("Print"), toolBarBitmaps[Tool_print], + wxT("Delete this tool. This is a very long tooltip to test whether it does the right thing when the tooltip is more than Windows can cope with.")); } toolBar->AddSeparator(); - toolBar->AddTool(wxID_HELP, _T("Help"), toolBarBitmaps[Tool_help], _T("Help button"), wxITEM_CHECK); + toolBar->AddTool(wxID_HELP, wxT("Help"), toolBarBitmaps[Tool_help], wxT("Help button"), wxITEM_CHECK); if ( !m_pathBmp.empty() ) { @@ -497,7 +497,7 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar) img = img.GetSubImage(wxRect(0, 0, w, h)); toolBar->AddSeparator(); - toolBar->AddTool(wxID_ANY, _T("Custom"), img); + toolBar->AddTool(wxID_ANY, wxT("Custom"), img); } } @@ -543,81 +543,81 @@ MyFrame::MyFrame(wxFrame* parent, // Make a menubar wxMenu *tbarMenu = new wxMenu; tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLE_TOOLBAR, - _T("Toggle &toolbar\tCtrl-Z"), - _T("Show or hide the toolbar")); + wxT("Toggle &toolbar\tCtrl-Z"), + wxT("Show or hide the toolbar")); tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLE_ANOTHER_TOOLBAR, - _T("Toggle &another toolbar\tCtrl-A"), - _T("Show/hide another test toolbar")); + wxT("Toggle &another toolbar\tCtrl-A"), + wxT("Show/hide another test toolbar")); tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLE_HORIZONTAL_TEXT, - _T("Toggle hori&zontal text\tCtrl-H"), - _T("Show text under/alongside the icon")); + wxT("Toggle hori&zontal text\tCtrl-H"), + wxT("Show text under/alongside the icon")); tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLETOOLBARSIZE, - _T("&Toggle toolbar size\tCtrl-S"), - _T("Toggle between big/small toolbar")); + wxT("&Toggle toolbar size\tCtrl-S"), + wxT("Toggle between big/small toolbar")); tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLETOOLBARROWS, - _T("Toggle number of &rows\tCtrl-R"), - _T("Toggle number of toolbar rows between 1 and 2")); + wxT("Toggle number of &rows\tCtrl-R"), + wxT("Toggle number of toolbar rows between 1 and 2")); tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLETOOLTIPS, - _T("Show &tooltips\tCtrl-L"), - _T("Show tooltips for the toolbar tools")); + wxT("Show &tooltips\tCtrl-L"), + wxT("Show tooltips for the toolbar tools")); tbarMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLECUSTOMDISABLED, - _T("Use c&ustom disabled images\tCtrl-U"), - _T("Switch between using system-generated and custom disabled images")); + wxT("Use c&ustom disabled images\tCtrl-U"), + wxT("Switch between using system-generated and custom disabled images")); tbarMenu->AppendSeparator(); tbarMenu->AppendRadioItem(IDM_TOOLBAR_TOP_ORIENTATION, - _T("Set toolbar at the top of the window"), - _T("Set toolbar at the top of the window")); + wxT("Set toolbar at the top of the window"), + wxT("Set toolbar at the top of the window")); tbarMenu->AppendRadioItem(IDM_TOOLBAR_LEFT_ORIENTATION, - _T("Set toolbar at the left of the window"), - _T("Set toolbar at the left of the window")); + wxT("Set toolbar at the left of the window"), + wxT("Set toolbar at the left of the window")); tbarMenu->AppendRadioItem(IDM_TOOLBAR_BOTTOM_ORIENTATION, - _T("Set toolbar at the bottom of the window"), - _T("Set toolbar at the bottom of the window")); + wxT("Set toolbar at the bottom of the window"), + wxT("Set toolbar at the bottom of the window")); tbarMenu->AppendRadioItem(IDM_TOOLBAR_RIGHT_ORIENTATION, - _T("Set toolbar at the right edge of the window"), - _T("Set toolbar at the right edge of the window")); + wxT("Set toolbar at the right edge of the window"), + wxT("Set toolbar at the right edge of the window")); tbarMenu->AppendSeparator(); - tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_TEXT, _T("Show &text\tCtrl-Alt-T")); - tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_ICONS, _T("Show &icons\tCtrl-Alt-I")); - tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_BOTH, _T("Show &both\tCtrl-Alt-B")); + tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_TEXT, wxT("Show &text\tCtrl-Alt-T")); + tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_ICONS, wxT("Show &icons\tCtrl-Alt-I")); + tbarMenu->AppendRadioItem(IDM_TOOLBAR_SHOW_BOTH, wxT("Show &both\tCtrl-Alt-B")); tbarMenu->AppendSeparator(); - tbarMenu->Append(IDM_TOOLBAR_BG_COL, _T("Choose bac&kground colour...")); - tbarMenu->Append(IDM_TOOLBAR_CUSTOM_PATH, _T("Custom &bitmap...\tCtrl-B")); + tbarMenu->Append(IDM_TOOLBAR_BG_COL, wxT("Choose bac&kground colour...")); + tbarMenu->Append(IDM_TOOLBAR_CUSTOM_PATH, wxT("Custom &bitmap...\tCtrl-B")); wxMenu *toolMenu = new wxMenu; - toolMenu->Append(IDM_TOOLBAR_ENABLEPRINT, _T("&Enable print button\tCtrl-E")); - toolMenu->Append(IDM_TOOLBAR_DELETEPRINT, _T("&Delete print button\tCtrl-D")); - toolMenu->Append(IDM_TOOLBAR_INSERTPRINT, _T("&Insert print button\tCtrl-I")); - toolMenu->Append(IDM_TOOLBAR_TOGGLEHELP, _T("Toggle &help button\tCtrl-T")); - toolMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLESEARCH, _T("Toggle &search field\tCtrl-F")); + toolMenu->Append(IDM_TOOLBAR_ENABLEPRINT, wxT("&Enable print button\tCtrl-E")); + toolMenu->Append(IDM_TOOLBAR_DELETEPRINT, wxT("&Delete print button\tCtrl-D")); + toolMenu->Append(IDM_TOOLBAR_INSERTPRINT, wxT("&Insert print button\tCtrl-I")); + toolMenu->Append(IDM_TOOLBAR_TOGGLEHELP, wxT("Toggle &help button\tCtrl-T")); + toolMenu->AppendCheckItem(IDM_TOOLBAR_TOGGLESEARCH, wxT("Toggle &search field\tCtrl-F")); toolMenu->AppendSeparator(); - toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN1, _T("Toggle &1st radio button\tCtrl-1")); - toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, _T("Toggle &2nd radio button\tCtrl-2")); - toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, _T("Toggle &3rd radio button\tCtrl-3")); + toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN1, wxT("Toggle &1st radio button\tCtrl-1")); + toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN2, wxT("Toggle &2nd radio button\tCtrl-2")); + toolMenu->Append(IDM_TOOLBAR_TOGGLERADIOBTN3, wxT("Toggle &3rd radio button\tCtrl-3")); toolMenu->AppendSeparator(); - toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, _T("Change tooltip of \"New\"")); + toolMenu->Append(IDM_TOOLBAR_CHANGE_TOOLTIP, wxT("Change tooltip of \"New\"")); wxMenu *fileMenu = new wxMenu; - fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt-X"), _T("Quit toolbar sample") ); + fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt-X"), wxT("Quit toolbar sample") ); wxMenu *helpMenu = new wxMenu; - helpMenu->Append(wxID_HELP, _T("&About"), _T("About toolbar sample")); + helpMenu->Append(wxID_HELP, wxT("&About"), wxT("About toolbar sample")); wxMenuBar* menuBar = new wxMenuBar( wxMB_DOCKABLE ); - menuBar->Append(fileMenu, _T("&File")); - menuBar->Append(tbarMenu, _T("&Toolbar")); - menuBar->Append(toolMenu, _T("Tool&s")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(fileMenu, wxT("&File")); + menuBar->Append(tbarMenu, wxT("&Toolbar")); + menuBar->Append(toolMenu, wxT("Tool&s")); + menuBar->Append(helpMenu, wxT("&Help")); // Associate the menu bar with the frame SetMenuBar(menuBar); @@ -733,11 +733,11 @@ void MyFrame::OnToggleAnotherToolbar(wxCommandEvent& WXUNUSED(event)) m_tbar->SetMargins(4, 4); - m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_1, _T("First"), wxBITMAP(new)); - m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_2, _T("Second"), wxBITMAP(open)); - m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_3, _T("Third"), wxBITMAP(save)); + m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_1, wxT("First"), wxBITMAP(new)); + m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_2, wxT("Second"), wxBITMAP(open)); + m_tbar->AddRadioTool(IDM_TOOLBAR_OTHER_3, wxT("Third"), wxBITMAP(save)); m_tbar->AddSeparator(); - m_tbar->AddTool(wxID_HELP, _T("Help"), wxBITMAP(help)); + m_tbar->AddTool(wxID_HELP, wxT("Help"), wxBITMAP(help)); m_tbar->Realize(); } @@ -804,17 +804,17 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& event) { if ( event.IsChecked() ) - m_textWindow->WriteText( _T("Help button down now.\n") ); + m_textWindow->WriteText( wxT("Help button down now.\n") ); else - m_textWindow->WriteText( _T("Help button up now.\n") ); + m_textWindow->WriteText( wxT("Help button up now.\n") ); - (void)wxMessageBox(_T("wxWidgets toolbar sample"), _T("About wxToolBar")); + (void)wxMessageBox(wxT("wxWidgets toolbar sample"), wxT("About wxToolBar")); } void MyFrame::OnToolLeftClick(wxCommandEvent& event) { wxString str; - str.Printf( _T("Clicked on tool %d\n"), event.GetId()); + str.Printf( wxT("Clicked on tool %d\n"), event.GetId()); m_textWindow->WriteText( str ); if (event.GetId() == wxID_COPY) @@ -836,13 +836,13 @@ void MyFrame::OnToolLeftClick(wxCommandEvent& event) void MyFrame::OnToolRightClick(wxCommandEvent& event) { m_textWindow->AppendText( - wxString::Format(_T("Tool %d right clicked.\n"), + wxString::Format(wxT("Tool %d right clicked.\n"), (int) event.GetInt())); } void MyFrame::OnCombo(wxCommandEvent& event) { - wxLogStatus(_T("Combobox string '%s' selected"), event.GetString().c_str()); + wxLogStatus(wxT("Combobox string '%s' selected"), event.GetString().c_str()); } void MyFrame::DoEnablePrint() @@ -916,7 +916,7 @@ void MyFrame::OnUpdateToggleHorzText(wxUpdateUIEvent& event) void MyFrame::OnChangeToolTip(wxCommandEvent& WXUNUSED(event)) { - GetToolBar()->SetToolShortHelp(wxID_NEW, _T("New toolbar button")); + GetToolBar()->SetToolShortHelp(wxID_NEW, wxT("New toolbar button")); } void MyFrame::OnToolbarStyle(wxCommandEvent& event) @@ -968,11 +968,11 @@ void MyFrame::OnInsertPrint(wxCommandEvent& WXUNUSED(event)) m_nPrint++; wxToolBarBase *tb = GetToolBar(); - tb->InsertTool(0, wxID_PRINT, _T("New print"), + tb->InsertTool(0, wxID_PRINT, wxT("New print"), wxBITMAP(print), wxNullBitmap, wxITEM_NORMAL, - _T("Delete this tool"), - _T("This button was inserted into the toolbar")); + wxT("Delete this tool"), + wxT("This button was inserted into the toolbar")); // must call Realize() after adding a new button tb->Realize(); @@ -990,7 +990,7 @@ void MyFrame::OnToggleRadioBtn(wxCommandEvent& event) void MyFrame::OnToolDropdown(wxCommandEvent& event) { wxString str; - str.Printf( _T("Dropdown on tool %d\n"), event.GetId()); + str.Printf( wxT("Dropdown on tool %d\n"), event.GetId()); m_textWindow->WriteText( str ); event.Skip(); diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index facaf2ce88..41a86c466c 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -419,13 +419,13 @@ void MyFrame::OnIdle(wxIdleEvent& event) { wxTreeItemId idLast = m_treeCtrl->GetLastChild(idRoot); status = wxString::Format( - _T("Root/last item is %svisible/%svisible"), - m_treeCtrl->IsVisible(idRoot) ? _T("") : _T("not "), + wxT("Root/last item is %svisible/%svisible"), + m_treeCtrl->IsVisible(idRoot) ? wxT("") : wxT("not "), idLast.IsOk() && m_treeCtrl->IsVisible(idLast) - ? _T("") : _T("not ")); + ? wxT("") : wxT("not ")); } else - status = _T("No root item"); + status = wxT("No root item"); SetStatusText(status, 1); } @@ -538,7 +538,7 @@ void MyFrame::OnHighlight(wxCommandEvent& WXUNUSED(event)) wxRect r; if ( !m_treeCtrl->GetBoundingRect(id, r, true /* text, not full row */) ) { - wxLogMessage(_T("Failed to get bounding item rect")); + wxLogMessage(wxT("Failed to get bounding item rect")); return; } @@ -1228,9 +1228,9 @@ void MyTreeCtrl::LogEvent(const wxChar *name, const wxTreeEvent& event) wxTreeItemId item = event.GetItem(); wxString text; if ( item.IsOk() ) - text << _T('"') << GetItemText(item).c_str() << _T('"'); + text << wxT('"') << GetItemText(item).c_str() << wxT('"'); else - text = _T("invalid item"); + text = wxT("invalid item"); wxLogMessage(wxT("%s(%s)"), name, text.c_str()); } @@ -1238,7 +1238,7 @@ void MyTreeCtrl::LogEvent(const wxChar *name, const wxTreeEvent& event) #define TREE_EVENT_HANDLER(name) \ void MyTreeCtrl::name(wxTreeEvent& event) \ { \ - LogEvent(_T(#name), event); \ + LogEvent(wxT(#name), event); \ SetLastItem(wxTreeItemId()); \ event.Skip(); \ } @@ -1464,7 +1464,7 @@ void MyTreeCtrl::OnBeginLabelEdit(wxTreeEvent& event) else if ( itemId == GetRootItem() ) { // test that it is possible to change the text of the item being edited - SetItemText(itemId, _T("Editing root item")); + SetItemText(itemId, wxT("Editing root item")); } } @@ -1528,7 +1528,7 @@ void MyTreeCtrl::OnItemMenu(wxTreeEvent& event) wxPoint screenpt = ClientToScreen(clientpt); wxLogMessage(wxT("OnItemMenu for item \"%s\" at screen coords (%i, %i)"), - item ? item->GetDesc() : _T(""), screenpt.x, screenpt.y); + item ? item->GetDesc() : wxT(""), screenpt.x, screenpt.y); ShowMenu(itemId, clientpt); event.Skip(); @@ -1573,7 +1573,7 @@ void MyTreeCtrl::OnItemRClick(wxTreeEvent& event) : NULL; wxLogMessage(wxT("Item \"%s\" right clicked"), item ? item->GetDesc() - : _T("")); + : wxT("")); event.Skip(); } diff --git a/samples/typetest/typetest.cpp b/samples/typetest/typetest.cpp index 617c6d74ca..b71edda8e5 100644 --- a/samples/typetest/typetest.cpp +++ b/samples/typetest/typetest.cpp @@ -67,8 +67,8 @@ BEGIN_EVENT_TABLE(MyApp, wxApp) EVT_MENU(TYPES_MIME, MyApp::DoMIMEDemo) END_EVENT_TABLE() -wxString file_name = _T("test_wx.dat"); -wxString file_name2 = wxString(_T("test_wx2.dat")); +wxString file_name = wxT("test_wx.dat"); +wxString file_name2 = wxString(wxT("test_wx2.dat")); bool MyApp::OnInit() { @@ -76,7 +76,7 @@ bool MyApp::OnInit() return false; // Create the main frame window - MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWidgets Types Demo"), + MyFrame *frame = new MyFrame((wxFrame *) NULL, wxT("wxWidgets Types Demo"), wxPoint(50, 50), wxSize(450, 340)); // Give it an icon @@ -85,29 +85,29 @@ bool MyApp::OnInit() // Make a menubar wxMenu *file_menu = new wxMenu; - file_menu->Append(TYPES_ABOUT, _T("&About")); + file_menu->Append(TYPES_ABOUT, wxT("&About")); file_menu->AppendSeparator(); - file_menu->Append(TYPES_QUIT, _T("E&xit\tAlt-X")); + file_menu->Append(TYPES_QUIT, wxT("E&xit\tAlt-X")); wxMenu *test_menu = new wxMenu; - test_menu->Append(TYPES_VARIANT, _T("&Variant test")); - test_menu->Append(TYPES_BYTEORDER, _T("&Byteorder test")); + test_menu->Append(TYPES_VARIANT, wxT("&Variant test")); + test_menu->Append(TYPES_BYTEORDER, wxT("&Byteorder test")); #if wxUSE_UNICODE - test_menu->Append(TYPES_UNICODE, _T("&Unicode test")); + test_menu->Append(TYPES_UNICODE, wxT("&Unicode test")); #endif // wxUSE_UNICODE - test_menu->Append(TYPES_STREAM, _T("&Stream test")); - test_menu->Append(TYPES_STREAM2, _T("&Stream seek test")); - test_menu->Append(TYPES_STREAM3, _T("&Stream error test")); - test_menu->Append(TYPES_STREAM4, _T("&Stream buffer test")); - test_menu->Append(TYPES_STREAM5, _T("&Stream peek test")); - test_menu->Append(TYPES_STREAM6, _T("&Stream ungetch test")); - test_menu->Append(TYPES_STREAM7, _T("&Stream ungetch test for a buffered stream")); + test_menu->Append(TYPES_STREAM, wxT("&Stream test")); + test_menu->Append(TYPES_STREAM2, wxT("&Stream seek test")); + test_menu->Append(TYPES_STREAM3, wxT("&Stream error test")); + test_menu->Append(TYPES_STREAM4, wxT("&Stream buffer test")); + test_menu->Append(TYPES_STREAM5, wxT("&Stream peek test")); + test_menu->Append(TYPES_STREAM6, wxT("&Stream ungetch test")); + test_menu->Append(TYPES_STREAM7, wxT("&Stream ungetch test for a buffered stream")); test_menu->AppendSeparator(); - test_menu->Append(TYPES_MIME, _T("&MIME database test")); + test_menu->Append(TYPES_MIME, wxT("&MIME database test")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, _T("&File")); - menu_bar->Append(test_menu, _T("&Tests")); + menu_bar->Append(file_menu, wxT("&File")); + menu_bar->Append(test_menu, wxT("&Tests")); frame->SetMenuBar(menu_bar); m_textCtrl = new wxTextCtrl(frame, wxID_ANY, wxEmptyString, @@ -126,9 +126,9 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) wxTextCtrl& textCtrl = * GetTextCtrl(); textCtrl.Clear(); - textCtrl << _T("\nTest fstream vs. wxFileStream:\n\n"); + textCtrl << wxT("\nTest fstream vs. wxFileStream:\n\n"); - textCtrl.WriteText( _T("Writing to ofstream and wxFileOutputStream:\n") ); + textCtrl.WriteText( wxT("Writing to ofstream and wxFileOutputStream:\n") ); wxSTD ofstream std_file_output( "test_std.dat" ); wxFileOutputStream file_output( file_name ); @@ -137,64 +137,64 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) wxString tmp; signed int si = 0xFFFFFFFF; - tmp.Printf( _T("Signed int: %d\n"), si ); + tmp.Printf( wxT("Signed int: %d\n"), si ); textCtrl.WriteText( tmp ); - text_output << si << _T("\n"); + text_output << si << wxT("\n"); std_file_output << si << "\n"; unsigned int ui = 0xFFFFFFFF; - tmp.Printf( _T("Unsigned int: %u\n"), ui ); + tmp.Printf( wxT("Unsigned int: %u\n"), ui ); textCtrl.WriteText( tmp ); - text_output << ui << _T("\n"); + text_output << ui << wxT("\n"); std_file_output << ui << "\n"; double d = 2.01234567890123456789; - tmp.Printf( _T("Double: %f\n"), d ); + tmp.Printf( wxT("Double: %f\n"), d ); textCtrl.WriteText( tmp ); - text_output << d << _T("\n"); + text_output << d << wxT("\n"); std_file_output << d << "\n"; float f = (float)0.00001; - tmp.Printf( _T("Float: %f\n"), f ); + tmp.Printf( wxT("Float: %f\n"), f ); textCtrl.WriteText( tmp ); - text_output << f << _T("\n"); + text_output << f << wxT("\n"); std_file_output << f << "\n"; - wxString str( _T("Hello!") ); - tmp.Printf( _T("String: %s\n"), str.c_str() ); + wxString str( wxT("Hello!") ); + tmp.Printf( wxT("String: %s\n"), str.c_str() ); textCtrl.WriteText( tmp ); - text_output << str << _T("\n"); + text_output << str << wxT("\n"); std_file_output << str.ToAscii() << "\n"; std_file_output.close(); - textCtrl.WriteText( _T("\nReading from ifstream:\n") ); + textCtrl.WriteText( wxT("\nReading from ifstream:\n") ); wxSTD ifstream std_file_input( "test_std.dat" ); std_file_input >> si; - tmp.Printf( _T("Signed int: %d\n"), si ); + tmp.Printf( wxT("Signed int: %d\n"), si ); textCtrl.WriteText( tmp ); std_file_input >> ui; - tmp.Printf( _T("Unsigned int: %u\n"), ui ); + tmp.Printf( wxT("Unsigned int: %u\n"), ui ); textCtrl.WriteText( tmp ); std_file_input >> d; - tmp.Printf( _T("Double: %f\n"), d ); + tmp.Printf( wxT("Double: %f\n"), d ); textCtrl.WriteText( tmp ); std_file_input >> f; - tmp.Printf( _T("Float: %f\n"), f ); + tmp.Printf( wxT("Float: %f\n"), f ); textCtrl.WriteText( tmp ); char std_buf[200]; std_file_input >> std_buf; str = wxString::FromAscii(std_buf); - tmp.Printf( _T("String: %s\n"), str.c_str() ); + tmp.Printf( wxT("String: %s\n"), str.c_str() ); textCtrl.WriteText( tmp ); - textCtrl.WriteText( _T("\nReading from wxFileInputStream:\n") ); + textCtrl.WriteText( wxT("\nReading from wxFileInputStream:\n") ); buf_output.Sync(); @@ -203,75 +203,75 @@ void MyApp::DoStreamDemo(wxCommandEvent& WXUNUSED(event)) wxTextInputStream text_input( file_input ); text_input >> si; - tmp.Printf( _T("Signed int: %d\n"), si ); + tmp.Printf( wxT("Signed int: %d\n"), si ); textCtrl.WriteText( tmp ); text_input >> ui; - tmp.Printf( _T("Unsigned int: %u\n"), ui ); + tmp.Printf( wxT("Unsigned int: %u\n"), ui ); textCtrl.WriteText( tmp ); text_input >> d; - tmp.Printf( _T("Double: %f\n"), d ); + tmp.Printf( wxT("Double: %f\n"), d ); textCtrl.WriteText( tmp ); text_input >> f; - tmp.Printf( _T("Float: %f\n"), f ); + tmp.Printf( wxT("Float: %f\n"), f ); textCtrl.WriteText( tmp ); text_input >> str; - tmp.Printf( _T("String: %s\n"), str.c_str() ); + tmp.Printf( wxT("String: %s\n"), str.c_str() ); textCtrl.WriteText( tmp ); - textCtrl << _T("\nTest for wxDataStream:\n\n"); + textCtrl << wxT("\nTest for wxDataStream:\n\n"); - textCtrl.WriteText( _T("Writing to wxDataOutputStream:\n") ); + textCtrl.WriteText( wxT("Writing to wxDataOutputStream:\n") ); file_output.SeekO( 0 ); wxDataOutputStream data_output( buf_output ); wxInt16 i16 = (unsigned short)0xFFFF; - tmp.Printf( _T("Signed int16: %d\n"), (int)i16 ); + tmp.Printf( wxT("Signed int16: %d\n"), (int)i16 ); textCtrl.WriteText( tmp ); data_output.Write16( i16 ); wxUint16 ui16 = 0xFFFF; - tmp.Printf( _T("Unsigned int16: %u\n"), (unsigned int) ui16 ); + tmp.Printf( wxT("Unsigned int16: %u\n"), (unsigned int) ui16 ); textCtrl.WriteText( tmp ); data_output.Write16( ui16 ); d = 2.01234567890123456789; - tmp.Printf( _T("Double: %f\n"), d ); + tmp.Printf( wxT("Double: %f\n"), d ); textCtrl.WriteText( tmp ); data_output.WriteDouble( d ); - str = _T("Hello!"); - tmp.Printf( _T("String: %s\n"), str.c_str() ); + str = wxT("Hello!"); + tmp.Printf( wxT("String: %s\n"), str.c_str() ); textCtrl.WriteText( tmp ); data_output.WriteString( str ); buf_output.Sync(); - textCtrl.WriteText( _T("\nReading from wxDataInputStream:\n") ); + textCtrl.WriteText( wxT("\nReading from wxDataInputStream:\n") ); file_input.SeekI( 0 ); wxDataInputStream data_input( buf_input ); i16 = data_input.Read16(); - tmp.Printf( _T("Signed int16: %d\n"), (int)i16 ); + tmp.Printf( wxT("Signed int16: %d\n"), (int)i16 ); textCtrl.WriteText( tmp ); ui16 = data_input.Read16(); - tmp.Printf( _T("Unsigned int16: %u\n"), (unsigned int) ui16 ); + tmp.Printf( wxT("Unsigned int16: %u\n"), (unsigned int) ui16 ); textCtrl.WriteText( tmp ); d = data_input.ReadDouble(); - tmp.Printf( _T("Double: %f\n"), d ); + tmp.Printf( wxT("Double: %f\n"), d ); textCtrl.WriteText( tmp ); str = data_input.ReadString(); - tmp.Printf( _T("String: %s\n"), str.c_str() ); + tmp.Printf( wxT("String: %s\n"), str.c_str() ); textCtrl.WriteText( tmp ); } @@ -280,11 +280,11 @@ void MyApp::DoStreamDemo2(wxCommandEvent& WXUNUSED(event)) wxTextCtrl& textCtrl = * GetTextCtrl(); textCtrl.Clear(); - textCtrl << _T("\nTesting wxBufferedStream:\n\n"); + textCtrl << wxT("\nTesting wxBufferedStream:\n\n"); char ch,ch2; - textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream:\n\n") ); + textCtrl.WriteText( wxT("Writing number 0 to 9 to buffered wxFileOutputStream:\n\n") ); wxFileOutputStream file_output( file_name ); wxBufferedOutputStream buf_output( file_output ); @@ -296,12 +296,12 @@ void MyApp::DoStreamDemo2(wxCommandEvent& WXUNUSED(event)) for (ch2 = 0; ch2 < 10; ch2++) { file_input.Read( &ch, 1 ); - textCtrl.WriteText( (wxChar)(ch + _T('0')) ); + textCtrl.WriteText( (wxChar)(ch + wxT('0')) ); } - textCtrl.WriteText( _T("\n\n\n") ); + textCtrl.WriteText( wxT("\n\n\n") ); - textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream, then\n") ); - textCtrl.WriteText( _T("seeking back to #3 and writing 0:\n\n") ); + textCtrl.WriteText( wxT("Writing number 0 to 9 to buffered wxFileOutputStream, then\n") ); + textCtrl.WriteText( wxT("seeking back to #3 and writing 0:\n\n") ); wxFileOutputStream file_output2( file_name2 ); wxBufferedOutputStream buf_output2( file_output2 ); @@ -316,9 +316,9 @@ void MyApp::DoStreamDemo2(wxCommandEvent& WXUNUSED(event)) for (ch2 = 0; ch2 < 10; ch2++) { file_input2.Read( &ch, 1 ); - textCtrl.WriteText( (wxChar)(ch + _T('0')) ); + textCtrl.WriteText( (wxChar)(ch + wxT('0')) ); } - textCtrl.WriteText( _T("\n\n\n") ); + textCtrl.WriteText( wxT("\n\n\n") ); // now append 2000 bytes to file (bigger than buffer) buf_output2.SeekO( 0, wxFromEnd ); @@ -327,23 +327,23 @@ void MyApp::DoStreamDemo2(wxCommandEvent& WXUNUSED(event)) buf_output2.Write( &ch, 1 ); buf_output2.Sync(); - textCtrl.WriteText( _T("Reading number 0 to 9 from buffered wxFileInputStream, then\n") ); - textCtrl.WriteText( _T("seeking back to #3 and reading the 0:\n\n") ); + textCtrl.WriteText( wxT("Reading number 0 to 9 from buffered wxFileInputStream, then\n") ); + textCtrl.WriteText( wxT("seeking back to #3 and reading the 0:\n\n") ); wxFileInputStream file_input3( file_name2 ); wxBufferedInputStream buf_input3( file_input3 ); for (ch2 = 0; ch2 < 10; ch2++) { buf_input3.Read( &ch, 1 ); - textCtrl.WriteText( (wxChar)(ch + _T('0')) ); + textCtrl.WriteText( (wxChar)(ch + wxT('0')) ); } for (int j = 0; j < 2000; j++) buf_input3.Read( &ch, 1 ); - textCtrl.WriteText( _T("\n") ); + textCtrl.WriteText( wxT("\n") ); buf_input3.SeekI( 3 ); buf_input3.Read( &ch, 1 ); - textCtrl.WriteText( (wxChar)(ch + _T('0')) ); - textCtrl.WriteText( _T("\n\n\n") ); + textCtrl.WriteText( (wxChar)(ch + wxT('0')) ); + textCtrl.WriteText( wxT("\n\n\n") ); } @@ -352,11 +352,11 @@ void MyApp::DoStreamDemo3(wxCommandEvent& WXUNUSED(event)) wxTextCtrl& textCtrl = * GetTextCtrl(); textCtrl.Clear(); - textCtrl << _T("\nTesting wxFileInputStream's and wxFFileInputStream's error handling:\n\n"); + textCtrl << wxT("\nTesting wxFileInputStream's and wxFFileInputStream's error handling:\n\n"); char ch,ch2; - textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") ); + textCtrl.WriteText( wxT("Writing number 0 to 9 to wxFileOutputStream:\n\n") ); wxFileOutputStream file_output( file_name ); for (ch = 0; ch < 10; ch++) @@ -364,147 +364,147 @@ void MyApp::DoStreamDemo3(wxCommandEvent& WXUNUSED(event)) // Testing wxFileInputStream - textCtrl.WriteText( _T("Reading 0 to 10 to wxFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading 0 to 10 to wxFileInputStream:\n\n") ); wxFileInputStream file_input( file_name ); for (ch2 = 0; ch2 < 11; ch2++) { file_input.Read( &ch, 1 ); - textCtrl.WriteText( _T("Value read: ") ); + textCtrl.WriteText( wxT("Value read: ") ); textCtrl.WriteText( (wxChar)(ch + '0') ); - textCtrl.WriteText( _T("; stream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") ); switch (file_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } } - textCtrl.WriteText( _T("\n") ); + textCtrl.WriteText( wxT("\n") ); - textCtrl.WriteText( _T("Seeking to 0; stream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("Seeking to 0; stream.GetLastError() returns: ") ); file_input.SeekI( 0 ); switch (file_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } - textCtrl.WriteText( _T("\n") ); + textCtrl.WriteText( wxT("\n") ); file_input.Read( &ch, 1 ); - textCtrl.WriteText( _T("Value read: ") ); - textCtrl.WriteText( (wxChar)(ch + _T('0')) ); - textCtrl.WriteText( _T("; stream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("Value read: ") ); + textCtrl.WriteText( (wxChar)(ch + wxT('0')) ); + textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") ); switch (file_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } - textCtrl.WriteText( _T("\n\n") ); + textCtrl.WriteText( wxT("\n\n") ); // Testing wxFFileInputStream - textCtrl.WriteText( _T("Reading 0 to 10 to wxFFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading 0 to 10 to wxFFileInputStream:\n\n") ); wxFFileInputStream ffile_input( file_name ); for (ch2 = 0; ch2 < 11; ch2++) { ffile_input.Read( &ch, 1 ); - textCtrl.WriteText( _T("Value read: ") ); + textCtrl.WriteText( wxT("Value read: ") ); textCtrl.WriteText( (wxChar)(ch + '0') ); - textCtrl.WriteText( _T("; stream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") ); switch (ffile_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } } - textCtrl.WriteText( _T("\n") ); + textCtrl.WriteText( wxT("\n") ); - textCtrl.WriteText( _T("Seeking to 0; stream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("Seeking to 0; stream.GetLastError() returns: ") ); ffile_input.SeekI( 0 ); switch (ffile_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } - textCtrl.WriteText( _T("\n") ); + textCtrl.WriteText( wxT("\n") ); ffile_input.Read( &ch, 1 ); - textCtrl.WriteText( _T("Value read: ") ); + textCtrl.WriteText( wxT("Value read: ") ); textCtrl.WriteText( (wxChar)(ch + '0') ); - textCtrl.WriteText( _T("; stream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") ); switch (ffile_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } - textCtrl.WriteText( _T("\n\n") ); + textCtrl.WriteText( wxT("\n\n") ); // Testing wxFFileInputStream - textCtrl.WriteText( _T("Reading 0 to 10 to buffered wxFFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading 0 to 10 to buffered wxFFileInputStream:\n\n") ); wxFFileInputStream ffile_input2( file_name ); wxBufferedInputStream buf_input( ffile_input2 ); for (ch2 = 0; ch2 < 11; ch2++) { buf_input.Read( &ch, 1 ); - textCtrl.WriteText( _T("Value read: ") ); + textCtrl.WriteText( wxT("Value read: ") ); textCtrl.WriteText( (wxChar)(ch + '0') ); - textCtrl.WriteText( _T("; stream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") ); switch (buf_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } } - textCtrl.WriteText( _T("\n") ); + textCtrl.WriteText( wxT("\n") ); - textCtrl.WriteText( _T("Seeking to 0; stream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("Seeking to 0; stream.GetLastError() returns: ") ); buf_input.SeekI( 0 ); switch (buf_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } - textCtrl.WriteText( _T("\n") ); + textCtrl.WriteText( wxT("\n") ); buf_input.Read( &ch, 1 ); - textCtrl.WriteText( _T("Value read: ") ); + textCtrl.WriteText( wxT("Value read: ") ); textCtrl.WriteText( (wxChar)(ch + '0') ); - textCtrl.WriteText( _T("; stream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("; stream.GetLastError() returns: ") ); switch (buf_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } } @@ -515,10 +515,10 @@ void MyApp::DoStreamDemo4(wxCommandEvent& WXUNUSED(event)) wxString msg; textCtrl.Clear(); - textCtrl << _T("\nTesting wxStreamBuffer:\n\n"); + textCtrl << wxT("\nTesting wxStreamBuffer:\n\n"); // bigger than buffer - textCtrl.WriteText( _T("Writing 2000x 1 to wxFileOutputStream.\n\n") ); + textCtrl.WriteText( wxT("Writing 2000x 1 to wxFileOutputStream.\n\n") ); wxFileOutputStream file_output( file_name ); for (int i = 0; i < 2000; i++) @@ -527,124 +527,124 @@ void MyApp::DoStreamDemo4(wxCommandEvent& WXUNUSED(event)) file_output.Write( &ch, 1 ); } - textCtrl.WriteText( _T("Opening with a buffered wxFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Opening with a buffered wxFileInputStream:\n\n") ); wxFileInputStream file_input( file_name ); wxBufferedInputStream buf_input( file_input ); - textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") ); switch (buf_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() ); textCtrl.WriteText( msg ); msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() ); textCtrl.WriteText( msg ); - textCtrl.WriteText( _T("\n\n") ); + textCtrl.WriteText( wxT("\n\n") ); - textCtrl.WriteText( _T("Seeking to position 300:\n\n") ); + textCtrl.WriteText( wxT("Seeking to position 300:\n\n") ); buf_input.SeekI( 300 ); - textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") ); switch (buf_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() ); textCtrl.WriteText( msg ); msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() ); textCtrl.WriteText( msg ); - textCtrl.WriteText( _T("\n\n") ); + textCtrl.WriteText( wxT("\n\n") ); char buf[2000]; - textCtrl.WriteText( _T("Reading 500 bytes:\n\n") ); + textCtrl.WriteText( wxT("Reading 500 bytes:\n\n") ); buf_input.Read( buf, 500 ); - textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") ); switch (buf_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() ); textCtrl.WriteText( msg ); msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() ); textCtrl.WriteText( msg ); - textCtrl.WriteText( _T("\n\n") ); + textCtrl.WriteText( wxT("\n\n") ); - textCtrl.WriteText( _T("Reading another 500 bytes:\n\n") ); + textCtrl.WriteText( wxT("Reading another 500 bytes:\n\n") ); buf_input.Read( buf, 500 ); - textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") ); switch (buf_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() ); textCtrl.WriteText( msg ); msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() ); textCtrl.WriteText( msg ); - textCtrl.WriteText( _T("\n\n") ); + textCtrl.WriteText( wxT("\n\n") ); - textCtrl.WriteText( _T("Reading another 500 bytes:\n\n") ); + textCtrl.WriteText( wxT("Reading another 500 bytes:\n\n") ); buf_input.Read( buf, 500 ); - textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") ); switch (buf_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() ); textCtrl.WriteText( msg ); msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() ); textCtrl.WriteText( msg ); - textCtrl.WriteText( _T("\n\n") ); + textCtrl.WriteText( wxT("\n\n") ); - textCtrl.WriteText( _T("Reading another 500 bytes:\n\n") ); + textCtrl.WriteText( wxT("Reading another 500 bytes:\n\n") ); buf_input.Read( buf, 500 ); - textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") ); + textCtrl.WriteText( wxT("wxBufferedInputStream.GetLastError() returns: ") ); switch (buf_input.GetLastError()) { - case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break; - case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break; - case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break; - case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break; - default: textCtrl.WriteText( _T("Huh?\n") ); break; + case wxSTREAM_NO_ERROR: textCtrl.WriteText( wxT("wxSTREAM_NO_ERROR\n") ); break; + case wxSTREAM_EOF: textCtrl.WriteText( wxT("wxSTREAM_EOF\n") ); break; + case wxSTREAM_READ_ERROR: textCtrl.WriteText( wxT("wxSTREAM_READ_ERROR\n") ); break; + case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( wxT("wxSTREAM_WRITE_ERROR\n") ); break; + default: textCtrl.WriteText( wxT("Huh?\n") ); break; } msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() ); textCtrl.WriteText( msg ); msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() ); textCtrl.WriteText( msg ); - textCtrl.WriteText( _T("\n\n") ); + textCtrl.WriteText( wxT("\n\n") ); } void MyApp::DoStreamDemo5(wxCommandEvent& WXUNUSED(event)) @@ -652,12 +652,12 @@ void MyApp::DoStreamDemo5(wxCommandEvent& WXUNUSED(event)) wxTextCtrl& textCtrl = * GetTextCtrl(); textCtrl.Clear(); - textCtrl << _T("\nTesting wxFileInputStream's Peek():\n\n"); + textCtrl << wxT("\nTesting wxFileInputStream's Peek():\n\n"); char ch; wxString str; - textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") ); + textCtrl.WriteText( wxT("Writing number 0 to 9 to wxFileOutputStream:\n\n") ); wxFileOutputStream file_output( file_name ); for (ch = 0; ch < 10; ch++) @@ -692,7 +692,7 @@ void MyApp::DoStreamDemo5(wxCommandEvent& WXUNUSED(event)) textCtrl.WriteText( str ); - textCtrl << _T("\n\n\nTesting wxMemoryInputStream's Peek():\n\n"); + textCtrl << wxT("\n\n\nTesting wxMemoryInputStream's Peek():\n\n"); char buf[] = { 0,1,2,3,4,5,6,7,8,9,10 }; wxMemoryInputStream input( buf, 10 ); @@ -727,12 +727,12 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event)) wxTextCtrl& textCtrl = * GetTextCtrl(); textCtrl.Clear(); - textCtrl.WriteText( _T("\nTesting Ungetch():\n\n") ); + textCtrl.WriteText( wxT("\nTesting Ungetch():\n\n") ); char ch = 0; wxString str; - textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") ); + textCtrl.WriteText( wxT("Writing number 0 to 9 to wxFileOutputStream...\n\n") ); wxFileOutputStream file_output( file_name ); for (ch = 0; ch < 10; ch++) @@ -740,7 +740,7 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event)) file_output.Sync(); - textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading char from wxFileInputStream:\n\n") ); wxFileInputStream file_input( file_name ); @@ -749,49 +749,49 @@ void MyApp::DoStreamDemo6(wxCommandEvent& WXUNUSED(event)) str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading another char from wxFileInputStream:\n\n") ); ch = file_input.GetC(); pos = (size_t)file_input.TellI(); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Reading yet another char from wxFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading yet another char from wxFileInputStream:\n\n") ); ch = file_input.GetC(); pos = (size_t)file_input.TellI(); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") ); + textCtrl.WriteText( wxT("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") ); file_input.Ungetch( 5 ); pos = (size_t)file_input.TellI(); str.Printf( wxT("Now at position %d\n\n"), (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading char from wxFileInputStream:\n\n") ); ch = file_input.GetC(); pos = (size_t)file_input.TellI(); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading another char from wxFileInputStream:\n\n") ); ch = file_input.GetC(); pos = (size_t)file_input.TellI(); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") ); + textCtrl.WriteText( wxT("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") ); file_input.Ungetch( 5 ); pos = (size_t)file_input.TellI(); str.Printf( wxT("Now at position %d\n\n"), (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Seeking to pos 3 in wxFileInputStream. This invalidates the writeback buffer.\n\n") ); + textCtrl.WriteText( wxT("Seeking to pos 3 in wxFileInputStream. This invalidates the writeback buffer.\n\n") ); file_input.SeekI( 3 ); @@ -806,12 +806,12 @@ void MyApp::DoStreamDemo7(wxCommandEvent& WXUNUSED(event)) wxTextCtrl& textCtrl = * GetTextCtrl(); textCtrl.Clear(); - textCtrl.WriteText( _T("\nTesting Ungetch() in buffered input stream:\n\n") ); + textCtrl.WriteText( wxT("\nTesting Ungetch() in buffered input stream:\n\n") ); char ch = 0; wxString str; - textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") ); + textCtrl.WriteText( wxT("Writing number 0 to 9 to wxFileOutputStream...\n\n") ); wxFileOutputStream file_output( file_name ); for (ch = 0; ch < 10; ch++) @@ -819,7 +819,7 @@ void MyApp::DoStreamDemo7(wxCommandEvent& WXUNUSED(event)) file_output.Sync(); - textCtrl.WriteText( _T("Reading char from wxBufferedInputStream via wxFileInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading char from wxBufferedInputStream via wxFileInputStream:\n\n") ); wxFileInputStream file_input( file_name ); wxBufferedInputStream buf_input( file_input ); @@ -829,49 +829,49 @@ void MyApp::DoStreamDemo7(wxCommandEvent& WXUNUSED(event)) str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading another char from wxBufferedInputStream:\n\n") ); ch = buf_input.GetC(); pos = (size_t)buf_input.TellI(); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Reading yet another char from wxBufferedInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading yet another char from wxBufferedInputStream:\n\n") ); ch = buf_input.GetC(); pos = (size_t)buf_input.TellI(); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") ); + textCtrl.WriteText( wxT("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") ); buf_input.Ungetch( 5 ); pos = (size_t)buf_input.TellI(); str.Printf( wxT("Now at position %d\n\n"), (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Reading char from wxBufferedInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading char from wxBufferedInputStream:\n\n") ); ch = buf_input.GetC(); pos = (size_t)buf_input.TellI(); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") ); + textCtrl.WriteText( wxT("Reading another char from wxBufferedInputStream:\n\n") ); ch = buf_input.GetC(); pos = (size_t)buf_input.TellI(); str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") ); + textCtrl.WriteText( wxT("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") ); buf_input.Ungetch( 5 ); pos = (size_t)buf_input.TellI(); str.Printf( wxT("Now at position %d\n\n"), (int) pos ); textCtrl.WriteText( str ); - textCtrl.WriteText( _T("Seeking to pos 3 in wxBufferedInputStream. This invalidates the writeback buffer.\n\n") ); + textCtrl.WriteText( wxT("Seeking to pos 3 in wxBufferedInputStream. This invalidates the writeback buffer.\n\n") ); buf_input.SeekI( 3 ); @@ -887,10 +887,10 @@ void MyApp::DoUnicodeDemo(wxCommandEvent& WXUNUSED(event)) wxTextCtrl& textCtrl = * GetTextCtrl(); textCtrl.Clear(); - textCtrl << _T("\nTest wchar_t to char (Unicode to ANSI/Multibyte) converions:"); + textCtrl << wxT("\nTest wchar_t to char (Unicode to ANSI/Multibyte) converions:"); wxString str; - str = _T("Robert R\366bling\n"); + str = wxT("Robert R\366bling\n"); printf( "\n\nConversion with wxConvLocal:\n" ); wxConvCurrent = &wxConvLocal; @@ -904,10 +904,10 @@ void MyApp::DoUnicodeDemo(wxCommandEvent& WXUNUSED(event)) void MyApp::DoMIMEDemo(wxCommandEvent& WXUNUSED(event)) { - static wxString s_defaultExt = _T("xyz"); + static wxString s_defaultExt = wxT("xyz"); - wxString ext = wxGetTextFromUser(_T("Enter a file extension: "), - _T("MIME database test"), + wxString ext = wxGetTextFromUser(wxT("Enter a file extension: "), + wxT("MIME database test"), s_defaultExt); if ( !!ext ) { @@ -920,16 +920,16 @@ void MyApp::DoMIMEDemo(wxCommandEvent& WXUNUSED(event)) static const wxFileTypeInfo fallbacks[] = { - wxFileTypeInfo(_T("application/xyz"), - _T("XyZ %s"), - _T("XyZ -p %s"), - _T("The one and only XYZ format file"), - _T("xyz"), _T("123"), wxNullPtr), - wxFileTypeInfo(_T("text/html"), - _T("lynx %s"), - _T("lynx -dump %s | lpr"), - _T("HTML document (from fallback)"), - _T("htm"), _T("html"), wxNullPtr), + wxFileTypeInfo(wxT("application/xyz"), + wxT("XyZ %s"), + wxT("XyZ -p %s"), + wxT("The one and only XYZ format file"), + wxT("xyz"), wxT("123"), wxNullPtr), + wxFileTypeInfo(wxT("text/html"), + wxT("lynx %s"), + wxT("lynx -dump %s | lpr"), + wxT("HTML document (from fallback)"), + wxT("htm"), wxT("html"), wxNullPtr), // must terminate the table with this! wxFileTypeInfo() @@ -943,7 +943,7 @@ void MyApp::DoMIMEDemo(wxCommandEvent& WXUNUSED(event)) wxFileType *filetype = m_mimeDatabase->GetFileTypeFromExtension(ext); if ( !filetype ) { - textCtrl << _T("Unknown extension '") << ext << _T("'\n"); + textCtrl << wxT("Unknown extension '") << ext << wxT("'\n"); } else { @@ -951,17 +951,17 @@ void MyApp::DoMIMEDemo(wxCommandEvent& WXUNUSED(event)) filetype->GetMimeType(&type); filetype->GetDescription(&desc); - wxString filename = _T("filename"); - filename << _T(".") << ext; + wxString filename = wxT("filename"); + filename << wxT(".") << ext; wxFileType::MessageParameters params(filename, type); filetype->GetOpenCommand(&open, params); - textCtrl << _T("MIME information about extension '") << ext << _T('\n') - << _T("\tMIME type: ") << ( !type ? wxString("unknown") : type ) << _T('\n') - << _T("\tDescription: ") << ( !desc ? wxString(wxEmptyString) : desc ) - << _T('\n') - << _T("\tCommand to open: ") << ( !open ? wxString("no") : open ) - << _T('\n'); + textCtrl << wxT("MIME information about extension '") << ext << wxT('\n') + << wxT("\tMIME type: ") << ( !type ? wxString("unknown") : type ) << wxT('\n') + << wxT("\tDescription: ") << ( !desc ? wxString(wxEmptyString) : desc ) + << wxT('\n') + << wxT("\tCommand to open: ") << ( !open ? wxString("no") : open ) + << wxT('\n'); delete filetype; } @@ -974,31 +974,31 @@ void MyApp::DoByteOrderDemo(wxCommandEvent& WXUNUSED(event)) wxTextCtrl& textCtrl = * GetTextCtrl(); textCtrl.Clear(); - textCtrl << _T("\nTest byte order macros:\n\n"); + textCtrl << wxT("\nTest byte order macros:\n\n"); #if wxBYTE_ORDER == wxLITTLE_ENDIAN - textCtrl << _T("This is a little endian system.\n\n"); + textCtrl << wxT("This is a little endian system.\n\n"); #else - textCtrl << _T("This is a big endian system.\n\n"); + textCtrl << wxT("This is a big endian system.\n\n"); #endif wxString text; wxInt32 var = 0xF1F2F3F4; text = wxEmptyString; - text.Printf( _T("Value of wxInt32 is now: %#x.\n\n"), var ); + text.Printf( wxT("Value of wxInt32 is now: %#x.\n\n"), var ); textCtrl.WriteText( text ); text = wxEmptyString; - text.Printf( _T("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) ); + text.Printf( wxT("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) ); textCtrl.WriteText( text ); text = wxEmptyString; - text.Printf( _T("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) ); + text.Printf( wxT("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) ); textCtrl.WriteText( text ); text = wxEmptyString; - text.Printf( _T("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) ); + text.Printf( wxT("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) ); textCtrl.WriteText( text ); } @@ -1006,20 +1006,20 @@ void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) ) { wxTextCtrl& textCtrl = * GetTextCtrl(); - wxVariant var1 = _T("String value"); - textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n"); + wxVariant var1 = wxT("String value"); + textCtrl << wxT("var1 = ") << var1.MakeString() << wxT("\n"); // Conversion wxString str = var1.MakeString(); var1 = 123.456; - textCtrl << _T("var1 = ") << var1.GetReal() << _T("\n"); + textCtrl << wxT("var1 = ") << var1.GetReal() << wxT("\n"); // Implicit conversion double v = var1; var1 = 9876L; - textCtrl << _T("var1 = ") << var1.GetLong() << _T("\n"); + textCtrl << wxT("var1 = ") << var1.GetLong() << wxT("\n"); // Implicit conversion long l = var1; @@ -1029,34 +1029,34 @@ void MyApp::DoVariantDemo(wxCommandEvent& WXUNUSED(event) ) wxUnusedVar(v); wxArrayString stringArray; - stringArray.Add(_T("one")); stringArray.Add(_T("two")); stringArray.Add(_T("three")); + stringArray.Add(wxT("one")); stringArray.Add(wxT("two")); stringArray.Add(wxT("three")); var1 = stringArray; - textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n"); + textCtrl << wxT("var1 = ") << var1.MakeString() << wxT("\n"); var1.ClearList(); var1.Append(wxVariant(1.2345)); - var1.Append(wxVariant(_T("hello"))); + var1.Append(wxVariant(wxT("hello"))); var1.Append(wxVariant(54321L)); - textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n"); + textCtrl << wxT("var1 = ") << var1.MakeString() << wxT("\n"); size_t n = var1.GetCount(); size_t i; for (i = (size_t) 0; i < n; i++) { - textCtrl << _T("var1[") << (int) i << _T("] (type ") << var1[i].GetType() << _T(") = ") << var1[i].MakeString() << _T("\n"); + textCtrl << wxT("var1[") << (int) i << wxT("] (type ") << var1[i].GetType() << wxT(") = ") << var1[i].MakeString() << wxT("\n"); } var1 = wxVariant(new wxFont(wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT))); - textCtrl << _T("var1 = (wxfont)\""); + textCtrl << wxT("var1 = (wxfont)\""); wxFont* font = wxGetVariantCast(var1,wxFont); if (font) { - textCtrl << font->GetNativeFontInfoDesc() << _T("\"\n"); + textCtrl << font->GetNativeFontInfoDesc() << wxT("\"\n"); } else { - textCtrl << _T("(null)\"\n"); + textCtrl << wxT("(null)\"\n"); } } @@ -1078,8 +1078,8 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) ) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) ) { - wxMessageDialog dialog(this, _T("Tests various wxWidgets types"), - _T("About Types"), wxYES_NO|wxCANCEL); + wxMessageDialog dialog(this, wxT("Tests various wxWidgets types"), + wxT("About Types"), wxYES_NO|wxCANCEL); dialog.ShowModal(); } diff --git a/samples/validate/validate.cpp b/samples/validate/validate.cpp index f6ff23cb41..4840a7d6a3 100644 --- a/samples/validate/validate.cpp +++ b/samples/validate/validate.cpp @@ -158,7 +158,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString&title, int x, int y, int w, int // Create a listbox to display the validated data. m_listbox = new wxListBox(this, wxID_ANY); - m_listbox->Append(wxString(_T("Try 'File|Test' to see how validators work."))); + m_listbox->Append(wxString(wxT("Try 'File|Test' to see how validators work."))); wxMenu *file_menu = new wxMenu; @@ -202,19 +202,19 @@ void MyFrame::OnTestDialog(wxCommandEvent& WXUNUSED(event)) // automatically transferred to the variables we specified // when we created the validators. m_listbox->Clear(); - m_listbox->Append(wxString(_T("string: ")) + g_data.m_string); - m_listbox->Append(wxString(_T("string #2: ")) + g_data.m_string2); + m_listbox->Append(wxString(wxT("string: ")) + g_data.m_string); + m_listbox->Append(wxString(wxT("string #2: ")) + g_data.m_string2); for(unsigned int i = 0; i < g_data.m_listbox_choices.GetCount(); ++i) { int j = g_data.m_listbox_choices[i]; - m_listbox->Append(wxString(_T("listbox choice(s): ")) + g_listbox_choices[j]); + m_listbox->Append(wxString(wxT("listbox choice(s): ")) + g_listbox_choices[j]); } - wxString checkbox_state(g_data.m_checkbox_state ? _T("checked") : _T("unchecked")); - m_listbox->Append(wxString(_T("checkbox: ")) + checkbox_state); - m_listbox->Append(wxString(_T("combobox: ")) + g_data.m_combobox_choice); - m_listbox->Append(wxString(_T("radiobox: ")) + g_radiobox_choices[g_data.m_radiobox_choice]); + wxString checkbox_state(g_data.m_checkbox_state ? wxT("checked") : wxT("unchecked")); + m_listbox->Append(wxString(wxT("checkbox: ")) + checkbox_state); + m_listbox->Append(wxString(wxT("combobox: ")) + g_data.m_combobox_choice); + m_listbox->Append(wxString(wxT("radiobox: ")) + g_radiobox_choices[g_data.m_radiobox_choice]); } } diff --git a/samples/vscroll/vstest.cpp b/samples/vscroll/vstest.cpp index c8af46184e..344fc0e850 100644 --- a/samples/vscroll/vstest.cpp +++ b/samples/vscroll/vstest.cpp @@ -83,7 +83,7 @@ public: if ( m_frameStatusBar ) { wxSize sz = GetClientSize(); - SetStatusText(wxString::Format(_T("%dx%d"), sz.x, sz.y), 1); + SetStatusText(wxString::Format(wxT("%dx%d"), sz.x, sz.y), 1); } #endif // wxUSE_STATUSBAR @@ -119,7 +119,7 @@ public: #if wxUSE_STATUSBAR m_frame->SetStatusText(wxString::Format ( - _T("Page size = %d, pos = %d, max = %d"), + wxT("Page size = %d, pos = %d, max = %d"), GetScrollThumb(wxVERTICAL), GetScrollPos(wxVERTICAL), GetScrollRange(wxVERTICAL) @@ -147,7 +147,7 @@ public: dc.DrawLine(0, y, clientSize.GetWidth(), y); wxCoord hLine = OnGetRowHeight(line); - dc.DrawText(wxString::Format(_T("Line %lu"), (unsigned long)line), + dc.DrawText(wxString::Format(wxT("Line %lu"), (unsigned long)line), 2, y + (hLine - hText) / 2); y += hLine; @@ -216,7 +216,7 @@ public: #if wxUSE_STATUSBAR m_frame->SetStatusText(wxString::Format ( - _T("Page size = %d, pos = %d, max = %d"), + wxT("Page size = %d, pos = %d, max = %d"), GetScrollThumb(wxVERTICAL), GetScrollPos(wxVERTICAL), GetScrollRange(wxVERTICAL) @@ -244,7 +244,7 @@ public: dc.DrawLine(x, 0, x, clientSize.GetHeight()); wxCoord wLine = OnGetColumnWidth(line); - dc.DrawRotatedText(wxString::Format(_T("Line %lu"), (unsigned long)line), + dc.DrawRotatedText(wxString::Format(wxT("Line %lu"), (unsigned long)line), x + (wLine - hText) / 2, clientSize.GetHeight() - 5, 90); x += wLine; @@ -316,7 +316,7 @@ public: #if wxUSE_STATUSBAR m_frame->SetStatusText(wxString::Format ( - _T("Page size = %d rows %d columns; pos = row: %d, column: %d; max = %d rows, %d columns"), + wxT("Page size = %d rows %d columns; pos = row: %d, column: %d; max = %d rows, %d columns"), GetScrollThumb(wxVERTICAL), GetScrollThumb(wxHORIZONTAL), GetScrollPos(wxVERTICAL), @@ -358,9 +358,9 @@ public: if ( row == rowFirst ) dc.DrawLine(x, 0, x, clientSize.GetHeight()); - dc.DrawText(wxString::Format(_T("Row %lu"), (unsigned long)row), + dc.DrawText(wxString::Format(wxT("Row %lu"), (unsigned long)row), x + 2, y + rowHeight / 2 - hText); - dc.DrawText(wxString::Format(_T("Col %lu"), (unsigned long)col), + dc.DrawText(wxString::Format(wxT("Col %lu"), (unsigned long)col), x + 2, y + rowHeight / 2); x += colWidth; @@ -497,7 +497,7 @@ bool VarScrollApp::OnInit() VarScrollFrame::VarScrollFrame() : wxFrame(NULL, wxID_ANY, - _T("VScroll wxWidgets Sample"), + wxT("VScroll wxWidgets Sample"), wxDefaultPosition, wxSize(400, 350)), m_scrollWindow(NULL) @@ -513,33 +513,33 @@ VarScrollFrame::VarScrollFrame() // the "About" item should be in the help menu wxMenu *menuHelp = new wxMenu; - menuHelp->Append(VScroll_About, _T("&About...\tF1"), _T("Show about dialog")); + menuHelp->Append(VScroll_About, wxT("&About...\tF1"), wxT("Show about dialog")); #ifdef wxHAS_RADIO_MENU_ITEMS - menuMode->AppendRadioItem(VScroll_VScrollMode, _T("&Vertical\tAlt-V"), - _T("Vertical scrolling only")); - menuMode->AppendRadioItem(VScroll_HScrollMode, _T("&Horizontal\tAlt-H"), - _T("Horizontal scrolling only")); + menuMode->AppendRadioItem(VScroll_VScrollMode, wxT("&Vertical\tAlt-V"), + wxT("Vertical scrolling only")); + menuMode->AppendRadioItem(VScroll_HScrollMode, wxT("&Horizontal\tAlt-H"), + wxT("Horizontal scrolling only")); menuMode->AppendRadioItem(VScroll_HVScrollMode, - _T("Hori&zontal/Vertical\tAlt-Z"), - _T("Horizontal and vertical scrolling")); + wxT("Hori&zontal/Vertical\tAlt-Z"), + wxT("Horizontal and vertical scrolling")); menuMode->Check(VScroll_VScrollMode, true); #else - menuMode->Append(VScroll_VScrollMode, _T("&Vertical\tAlt-V"), - _T("Vertical scrolling only")); - menuMode->Append(VScroll_HScrollMode, _T("&Horizontal\tAlt-H"), - _T("Horizontal scrolling only")); - menuMode->Append(VScroll_HVScrollMode, _T("Hori&zontal/Vertical\tAlt-Z"), - _T("Horizontal and vertical scrolling")); + menuMode->Append(VScroll_VScrollMode, wxT("&Vertical\tAlt-V"), + wxT("Vertical scrolling only")); + menuMode->Append(VScroll_HScrollMode, wxT("&Horizontal\tAlt-H"), + wxT("Horizontal scrolling only")); + menuMode->Append(VScroll_HVScrollMode, wxT("Hori&zontal/Vertical\tAlt-Z"), + wxT("Horizontal and vertical scrolling")); #endif - menuFile->Append(VScroll_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(VScroll_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(menuMode, _T("&Mode")); - menuBar->Append(menuHelp, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(menuMode, wxT("&Mode")); + menuBar->Append(menuHelp, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -548,7 +548,7 @@ VarScrollFrame::VarScrollFrame() #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); - SetStatusText(_T("Welcome to wxWidgets!")); + SetStatusText(wxT("Welcome to wxWidgets!")); int widths[2]; widths[0] = -1; widths[1] = 100; @@ -603,10 +603,10 @@ void VarScrollFrame::OnModeHVScroll(wxCommandEvent& WXUNUSED(event)) void VarScrollFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("VScroll shows how to implement scrolling with\n") - _T("variable line widths and heights.\n") - _T("(c) 2003 Vadim Zeitlin"), - _T("About VScroll"), + wxMessageBox(wxT("VScroll shows how to implement scrolling with\n") + wxT("variable line widths and heights.\n") + wxT("(c) 2003 Vadim Zeitlin"), + wxT("About VScroll"), wxOK | wxICON_INFORMATION, this); } diff --git a/samples/widgets/bmpcombobox.cpp b/samples/widgets/bmpcombobox.cpp index 6e6f4fd71e..fb29fa2f5c 100644 --- a/samples/widgets/bmpcombobox.cpp +++ b/samples/widgets/bmpcombobox.cpp @@ -243,7 +243,7 @@ END_EVENT_TABLE() #define NATIVE_OR_GENERIC_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, _T("BitmapCombobox"), +IMPLEMENT_WIDGETS_PAGE(BitmapComboBoxWidgetsPage, wxT("BitmapCombobox"), NATIVE_OR_GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS ); @@ -299,39 +299,39 @@ void BitmapComboBoxWidgetsPage::CreateContent() wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL); // left pane - style box - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); // should be in sync with ComboKind_XXX values static const wxString kinds[] = { - _T("default"), - _T("simple"), - _T("drop down"), + wxT("default"), + wxT("simple"), + wxT("drop down"), }; - m_radioKind = new wxRadioBox(this, wxID_ANY, _T("Combobox &kind:"), + m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1, wxRA_SPECIFY_COLS); wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Sort items")); - m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Read only")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items")); + m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only")); - wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, BitmapComboBoxPage_Reset, wxT("&Reset")); sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3); sizerLeft->Add(sizerStyle, 0, wxGROW | wxALIGN_CENTRE_HORIZONTAL); sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); // left pane - other options box - box = new wxStaticBox(this, wxID_ANY, _T("Demo options")); + box = new wxStaticBox(this, wxID_ANY, wxT("Demo options")); wxSizer *sizerOptions = new wxStaticBoxSizer(box, wxVERTICAL); - sizerRow = CreateSizerWithSmallTextAndLabel(_T("Control &height:"), + sizerRow = CreateSizerWithSmallTextAndLabel(wxT("Control &height:"), BitmapComboBoxPage_ChangeHeight, &m_textChangeHeight); m_textChangeHeight->SetSize(20, wxDefaultCoord); @@ -341,42 +341,42 @@ void BitmapComboBoxWidgetsPage::CreateContent() // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - _T("&Change wxBitmapComboBox contents")); + wxT("&Change wxBitmapComboBox contents")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, _T("Run &tests")); + btn = new wxButton(this, BitmapComboBoxPage_ContainerTests, wxT("Run &tests")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); #if wxUSE_IMAGE - btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, _T("Add &widget icons")); + btn = new wxButton(this, BitmapComboBoxPage_AddWidgetIcons, wxT("Add &widget icons")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, _T("Insert image from &file")); + btn = new wxButton(this, BitmapComboBoxPage_LoadFromFile, wxT("Insert image from &file")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, _T("&Set image from file")); + btn = new wxButton(this, BitmapComboBoxPage_SetFromFile, wxT("&Set image from file")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); #endif - btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, _T("A&ppend a few strings with images")); + btn = new wxButton(this, BitmapComboBoxPage_AddSeveralWithImages, wxT("A&ppend a few strings with images")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, _T("Append a &few strings")); + btn = new wxButton(this, BitmapComboBoxPage_AddSeveral, wxT("Append a &few strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_AddMany, _T("Append &many strings")); + btn = new wxButton(this, BitmapComboBoxPage_AddMany, wxT("Append &many strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BitmapComboBoxPage_Delete, - _T("&Delete this item"), + wxT("&Delete this item"), BitmapComboBoxPage_DeleteText, &m_textDelete); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, _T("Delete &selection")); + btn = new wxButton(this, BitmapComboBoxPage_DeleteSel, wxT("Delete &selection")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BitmapComboBoxPage_Clear, _T("&Clear")); + btn = new wxButton(this, BitmapComboBoxPage_Clear, wxT("&Clear")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); #if wxUSE_IMAGE @@ -433,7 +433,7 @@ void BitmapComboBoxWidgetsPage::CreateCombo() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG( _T("unknown combo kind") ); + wxFAIL_MSG( wxT("unknown combo kind") ); // fall through case ComboKind_Default: @@ -512,7 +512,7 @@ void BitmapComboBoxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event)) #ifndef __WXGTK__ m_combobox->SetString(sel, m_textChange->GetValue()); #else - wxLogMessage(_T("Not implemented in wxGTK")); + wxLogMessage(wxT("Not implemented in wxGTK")); #endif } } @@ -551,7 +551,7 @@ void BitmapComboBoxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) if ( !m_textInsert->IsModified() ) { // update the default string - m_textInsert->SetValue(wxString::Format(_T("test item %u"), ++s_item)); + m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); } int sel = m_combobox->GetSelection(); @@ -595,15 +595,15 @@ void BitmapComboBoxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_combobox->Append(wxString::Format(_T("item #%u"), n)); + m_combobox->Append(wxString::Format(wxT("item #%u"), n)); } } void BitmapComboBoxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { - m_combobox->Append(_T("First")); - m_combobox->Append(_T("another one")); - m_combobox->Append(_T("and the last (very very very very very very very very very very long) one")); + m_combobox->Append(wxT("First")); + m_combobox->Append(wxT("another one")); + m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one")); } void BitmapComboBoxWidgetsPage::OnButtonAddSeveralWithImages(wxCommandEvent& WXUNUSED(event)) @@ -800,26 +800,26 @@ void BitmapComboBoxWidgetsPage::OnComboText(wxCommandEvent& event) wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), - _T("event and combobox values should be the same") ); + wxT("event and combobox values should be the same") ); if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) { - wxLogMessage(_T("BitmapCombobox enter pressed (now '%s')"), s.c_str()); + wxLogMessage(wxT("BitmapCombobox enter pressed (now '%s')"), s.c_str()); } else { - wxLogMessage(_T("BitmapCombobox text changed (now '%s')"), s.c_str()); + wxLogMessage(wxT("BitmapCombobox text changed (now '%s')"), s.c_str()); } } void BitmapComboBoxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); - m_textDelete->SetValue(wxString::Format(_T("%ld"), sel)); + m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); - wxLogMessage(_T("BitmapCombobox item %ld selected"), sel); + wxLogMessage(wxT("BitmapCombobox item %ld selected"), sel); - wxLogMessage(_T("BitmapCombobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + wxLogMessage(wxT("BitmapCombobox GetValue(): %s"), m_combobox->GetValue().c_str() ); } void BitmapComboBoxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) @@ -934,12 +934,12 @@ wxBitmap BitmapComboBoxWidgetsPage::CreateBitmap(const wxColour& colour) void BitmapComboBoxWidgetsPage::OnDropDown(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Combobox dropped down")); + wxLogMessage(wxT("Combobox dropped down")); } void BitmapComboBoxWidgetsPage::OnCloseUp(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Combobox closed up")); + wxLogMessage(wxT("Combobox closed up")); } #endif // wxUSE_BITMAPCOMBOBOX diff --git a/samples/widgets/button.cpp b/samples/widgets/button.cpp index b8e87e9f8d..61b118ae0e 100644 --- a/samples/widgets/button.cpp +++ b/samples/widgets/button.cpp @@ -174,7 +174,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, _T("Button"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(ButtonWidgetsPage, wxT("Button"), FAMILY_CTRLS ); ButtonWidgetsPage::ButtonWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -205,14 +205,14 @@ void ButtonWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); m_chkBitmapOnly = CreateCheckBoxAndAddToSizer(sizerLeft, "&Bitmap only"); m_chkTextAndBitmap = CreateCheckBoxAndAddToSizer(sizerLeft, "Text &and &bitmap"); - m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Fit exactly")); - m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Default")); + m_chkFit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Fit exactly")); + m_chkDefault = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Default")); sizerLeft->AddSpacer(5); @@ -244,22 +244,22 @@ void ButtonWidgetsPage::CreateContent() // should be in sync with enums Button[HV]Align! static const wxString halign[] = { - _T("left"), - _T("centre"), - _T("right"), + wxT("left"), + wxT("centre"), + wxT("right"), }; static const wxString valign[] = { - _T("top"), - _T("centre"), - _T("bottom"), + wxT("top"), + wxT("centre"), + wxT("bottom"), }; - m_radioHAlign = new wxRadioBox(this, wxID_ANY, _T("&Horz alignment"), + m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign); - m_radioVAlign = new wxRadioBox(this, wxID_ANY, _T("&Vert alignment"), + m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign); @@ -268,18 +268,18 @@ void ButtonWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, ButtonPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, ButtonPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Operations")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = CreateSizerWithTextAndButton(ButtonPage_ChangeLabel, - _T("Change label"), + wxT("Change label"), wxID_ANY, &m_textLabel); - m_textLabel->SetValue(_T("&Press me!")); + m_textLabel->SetValue(wxT("&Press me!")); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); @@ -351,7 +351,7 @@ void ButtonWidgetsPage::CreateButton() break; default: - wxFAIL_MSG(_T("unexpected radiobox selection")); + wxFAIL_MSG(wxT("unexpected radiobox selection")); // fall through case ButtonHAlign_Centre: @@ -369,7 +369,7 @@ void ButtonWidgetsPage::CreateButton() break; default: - wxFAIL_MSG(_T("unexpected radiobox selection")); + wxFAIL_MSG(wxT("unexpected radiobox selection")); // fall through case ButtonVAlign_Centre: @@ -387,15 +387,15 @@ void ButtonWidgetsPage::CreateButton() showsBitmap = true; wxBitmapButton *bbtn = new wxBitmapButton(this, ButtonPage_Button, - CreateBitmap(_T("normal"))); + CreateBitmap(wxT("normal"))); if ( m_chkUsePressed->GetValue() ) - bbtn->SetBitmapPressed(CreateBitmap(_T("pushed"))); + bbtn->SetBitmapPressed(CreateBitmap(wxT("pushed"))); if ( m_chkUseFocused->GetValue() ) - bbtn->SetBitmapFocus(CreateBitmap(_T("focused"))); + bbtn->SetBitmapFocus(CreateBitmap(wxT("focused"))); if ( m_chkUseCurrent->GetValue() ) - bbtn->SetBitmapCurrent(CreateBitmap(_T("hover"))); + bbtn->SetBitmapCurrent(CreateBitmap(wxT("hover"))); if ( m_chkUseDisabled->GetValue() ) - bbtn->SetBitmapDisabled(CreateBitmap(_T("disabled"))); + bbtn->SetBitmapDisabled(CreateBitmap(wxT("disabled"))); m_button = bbtn; } else // normal button @@ -481,7 +481,7 @@ void ButtonWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event)) void ButtonWidgetsPage::OnButton(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Test button clicked.")); + wxLogMessage(wxT("Test button clicked.")); } // ---------------------------------------------------------------------------- @@ -496,8 +496,8 @@ wxBitmap ButtonWidgetsPage::CreateBitmap(const wxString& label) dc.SetBackground(wxBrush(*wxCYAN)); dc.Clear(); dc.SetTextForeground(*wxBLACK); - dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + _T("\n") - _T("(") + label + _T(" state)"), + dc.DrawLabel(wxStripMenuCodes(m_textLabel->GetValue()) + wxT("\n") + wxT("(") + label + wxT(" state)"), wxArtProvider::GetBitmap(wxART_INFORMATION), wxRect(10, 10, bmp.GetWidth() - 20, bmp.GetHeight() - 20), wxALIGN_CENTRE); diff --git a/samples/widgets/checkbox.cpp b/samples/widgets/checkbox.cpp index 6ecbfd872a..17e65ffc43 100644 --- a/samples/widgets/checkbox.cpp +++ b/samples/widgets/checkbox.cpp @@ -170,14 +170,14 @@ void CheckBoxWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); m_chkRight = CreateCheckBoxAndAddToSizer ( sizerLeft, - _T("&Right aligned"), + wxT("&Right aligned"), CheckboxPage_ChkRight ); @@ -185,39 +185,39 @@ void CheckBoxWidgetsPage::CreateContent() static const wxString kinds[] = { - _T("usual &2-state checkbox"), - _T("&3rd state settable by program"), - _T("&user-settable 3rd state"), + wxT("usual &2-state checkbox"), + wxT("&3rd state settable by program"), + wxT("&user-settable 3rd state"), }; - m_radioKind = new wxRadioBox(this, wxID_ANY, _T("&Kind"), + m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("&Kind"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1); sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, CheckboxPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, CheckboxPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Operations")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); sizerMiddle->Add(CreateSizerWithTextAndButton(CheckboxPage_ChangeLabel, - _T("Change label"), + wxT("Change label"), wxID_ANY, &m_textLabel), 0, wxALL | wxGROW, 5); - sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, _T("&Check it")), + sizerMiddle->Add(new wxButton(this, CheckboxPage_Check, wxT("&Check it")), 0, wxALL | wxGROW, 5); - sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, _T("&Uncheck it")), + sizerMiddle->Add(new wxButton(this, CheckboxPage_Uncheck, wxT("&Uncheck it")), 0, wxALL | wxGROW, 5); sizerMiddle->Add(new wxButton(this, CheckboxPage_PartCheck, - _T("Put in &3rd state")), + wxT("Put in &3rd state")), 0, wxALL | wxGROW, 5); // right pane wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); - m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, _T("&Check me!")); + m_checkbox = new wxCheckBox(this, CheckboxPage_Checkbox, wxT("&Check me!")); sizerRight->Add(0, 0, 1, wxCENTRE); sizerRight->Add(m_checkbox, 1, wxCENTRE); sizerRight->Add(0, 0, 1, wxCENTRE); @@ -260,7 +260,7 @@ void CheckBoxWidgetsPage::CreateCheckbox() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG(_T("unexpected radiobox selection")); + wxFAIL_MSG(wxT("unexpected radiobox selection")); // fall through case CheckboxKind_2State: @@ -309,8 +309,8 @@ void CheckBoxWidgetsPage::OnButtonChangeLabel(wxCommandEvent& WXUNUSED(event)) void CheckBoxWidgetsPage::OnCheckBox(wxCommandEvent& event) { - wxLogMessage(_T("Test checkbox %schecked (value = %d)."), - event.IsChecked() ? _T("") : _T("un"), + wxLogMessage(wxT("Test checkbox %schecked (value = %d)."), + event.IsChecked() ? wxT("") : wxT("un"), (int)m_checkbox->Get3StateValue()); } diff --git a/samples/widgets/choice.cpp b/samples/widgets/choice.cpp index 9ea271d3d5..8daa1b3aa7 100644 --- a/samples/widgets/choice.cpp +++ b/samples/widgets/choice.cpp @@ -184,7 +184,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, _T("Choice"), +IMPLEMENT_WIDGETS_PAGE(ChoiceWidgetsPage, wxT("Choice"), FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -213,60 +213,60 @@ void ChoiceWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - _T("&Set choice parameters")); + wxT("&Set choice parameters")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); static const wxString modes[] = { - _T("single"), - _T("extended"), - _T("multiple"), + wxT("single"), + wxT("extended"), + wxT("multiple"), }; - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Sort items")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items")); - wxButton *btn = new wxButton(this, ChoicePage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, ChoicePage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - _T("&Change choice contents")); + wxT("&Change choice contents")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Add, _T("&Add this string")); - m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, _T("test item 0")); + btn = new wxButton(this, ChoicePage_Add, wxT("&Add this string")); + m_textAdd = new wxTextCtrl(this, ChoicePage_AddText, wxT("test item 0")); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textAdd, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_AddSeveral, _T("&Insert a few strings")); + btn = new wxButton(this, ChoicePage_AddSeveral, wxT("&Insert a few strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_AddMany, _T("Add &many strings")); + btn = new wxButton(this, ChoicePage_AddMany, wxT("Add &many strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Change, _T("C&hange current")); + btn = new wxButton(this, ChoicePage_Change, wxT("C&hange current")); m_textChange = new wxTextCtrl(this, ChoicePage_ChangeText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textChange, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ChoicePage_Delete, _T("&Delete this item")); + btn = new wxButton(this, ChoicePage_Delete, wxT("&Delete this item")); m_textDelete = new wxTextCtrl(this, ChoicePage_DeleteText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textDelete, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_DeleteSel, _T("Delete &selection")); + btn = new wxButton(this, ChoicePage_DeleteSel, wxT("Delete &selection")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_Clear, _T("&Clear")); + btn = new wxButton(this, ChoicePage_Clear, wxT("&Clear")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ChoicePage_ContainerTests, _T("Run &tests")); + btn = new wxButton(this, ChoicePage_ContainerTests, wxT("Run &tests")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -380,7 +380,7 @@ void ChoiceWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(_T("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); } m_choice->Append(s); @@ -392,7 +392,7 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) wxArrayString strings; for ( unsigned int n = 0; n < 1000; n++ ) { - strings.Add(wxString::Format(_T("item #%u"), n)); + strings.Add(wxString::Format(wxT("item #%u"), n)); } m_choice->Append(strings); } @@ -400,9 +400,9 @@ void ChoiceWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) void ChoiceWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { wxArrayString items; - items.Add(_T("First")); - items.Add(_T("another one")); - items.Add(_T("and the last (very very very very very very very very very very long) one")); + items.Add(wxT("First")); + items.Add(wxT("another one")); + items.Add(wxT("and the last (very very very very very very very very very very long) one")); m_choice->Insert(items, 0); } @@ -437,9 +437,9 @@ void ChoiceWidgetsPage::OnUpdateUIAddSeveral(wxUpdateUIEvent& event) void ChoiceWidgetsPage::OnChoice(wxCommandEvent& event) { long sel = event.GetSelection(); - m_textDelete->SetValue(wxString::Format(_T("%ld"), sel)); + m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); - wxLogMessage(_T("Choice item %ld selected"), sel); + wxLogMessage(wxT("Choice item %ld selected"), sel); } void ChoiceWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/widgets/clrpicker.cpp b/samples/widgets/clrpicker.cpp index 346a5ce263..1f463889d3 100644 --- a/samples/widgets/clrpicker.cpp +++ b/samples/widgets/clrpicker.cpp @@ -129,7 +129,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, _T("ColourPicker"), +IMPLEMENT_WIDGETS_PAGE(ColourPickerWidgetsPage, wxT("ColourPicker"), PICKER_CTRLS | FAMILY_CTRLS); ColourPickerWidgetsPage::ColourPickerWidgetsPage(WidgetsBookCtrl *book, @@ -143,12 +143,12 @@ void ColourPickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&ColourPicker style")); - m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, _T("With textctrl"), false); - m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, _T("With label"), false); + wxStaticBoxSizer *clrbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&ColourPicker style")); + m_chkColourTextCtrl = CreateCheckBoxAndAddToSizer(clrbox, wxT("With textctrl"), false); + m_chkColourShowLabel = CreateCheckBoxAndAddToSizer(clrbox, wxT("With label"), false); boxleft->Add(clrbox, 0, wxALL|wxGROW, 5); - boxleft->Add(new wxButton(this, PickerPage_Reset, _T("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state diff --git a/samples/widgets/combobox.cpp b/samples/widgets/combobox.cpp index 275292fde2..58bcf7ce4d 100644 --- a/samples/widgets/combobox.cpp +++ b/samples/widgets/combobox.cpp @@ -220,7 +220,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, _T("Combobox"), +IMPLEMENT_WIDGETS_PAGE(ComboboxWidgetsPage, wxT("Combobox"), FAMILY_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS ); @@ -248,50 +248,50 @@ void ComboboxWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); // should be in sync with ComboKind_XXX values static const wxString kinds[] = { - _T("default"), - _T("simple"), - _T("drop down"), + wxT("default"), + wxT("simple"), + wxT("drop down"), }; - m_radioKind = new wxRadioBox(this, wxID_ANY, _T("Combobox &kind:"), + m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Combobox &kind:"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1, wxRA_SPECIFY_COLS); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Sort items")); - m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Read only")); - m_chkFilename = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&File name")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items")); + m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Read only")); + m_chkFilename = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&File name")); m_chkFilename->Disable(); // not implemented yet sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, ComboPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, ComboPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - _T("&Change combobox contents")); + wxT("&Change combobox contents")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow; sizerRow = CreateSizerWithTextAndButton(ComboPage_SetCurrent, - _T("Current &selection"), + wxT("Current &selection"), ComboPage_CurText, &m_textCur); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); wxTextCtrl *text; - sizerRow = CreateSizerWithTextAndLabel(_T("Insertion Point"), + sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"), ComboPage_InsertionPointText, &text); text->SetEditable(false); @@ -299,48 +299,48 @@ void ComboboxWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Insert, - _T("&Insert this string"), + wxT("&Insert this string"), ComboPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Add, - _T("&Add this string"), + wxT("&Add this string"), ComboPage_AddText, &m_textAdd); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_AddSeveral, _T("&Append a few strings")); + btn = new wxButton(this, ComboPage_AddSeveral, wxT("&Append a few strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_AddMany, _T("Append &many strings")); + btn = new wxButton(this, ComboPage_AddMany, wxT("Append &many strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Change, - _T("C&hange current"), + wxT("C&hange current"), ComboPage_ChangeText, &m_textChange); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_Delete, - _T("&Delete this item"), + wxT("&Delete this item"), ComboPage_DeleteText, &m_textDelete); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_DeleteSel, _T("Delete &selection")); + btn = new wxButton(this, ComboPage_DeleteSel, wxT("Delete &selection")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_Clear, _T("&Clear")); + btn = new wxButton(this, ComboPage_Clear, wxT("&Clear")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ComboPage_SetValue, - _T("SetValue"), + wxT("SetValue"), ComboPage_SetValueText, &m_textSetValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ComboPage_ContainerTests, _T("Run &tests")); + btn = new wxButton(this, ComboPage_ContainerTests, wxT("Run &tests")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); @@ -389,7 +389,7 @@ void ComboboxWidgetsPage::CreateCombo() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG( _T("unknown combo kind") ); + wxFAIL_MSG( wxT("unknown combo kind") ); // fall through case ComboKind_Default: @@ -456,7 +456,7 @@ void ComboboxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event)) #ifndef __WXGTK__ m_combobox->SetString(sel, m_textChange->GetValue()); #else - wxLogMessage(_T("Not implemented in wxGTK")); + wxLogMessage(wxT("Not implemented in wxGTK")); #endif } } @@ -501,7 +501,7 @@ void ComboboxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) if ( !m_textInsert->IsModified() ) { // update the default string - m_textInsert->SetValue(wxString::Format(_T("test item %u"), ++s_item)); + m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); } if (m_combobox->GetSelection() >= 0) @@ -516,7 +516,7 @@ void ComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(_T("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); } m_combobox->Append(s); @@ -527,7 +527,7 @@ void ComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_combobox->Append(wxString::Format(_T("item #%u"), n)); + m_combobox->Append(wxString::Format(wxT("item #%u"), n)); } } @@ -542,15 +542,15 @@ void ComboboxWidgetsPage::OnButtonSetCurrent(wxCommandEvent& WXUNUSED(event)) void ComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { - m_combobox->Append(_T("First")); - m_combobox->Append(_T("another one")); - m_combobox->Append(_T("and the last (very very very very very very very very very very long) one")); + m_combobox->Append(wxT("First")); + m_combobox->Append(wxT("another one")); + m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one")); } void ComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event) { if (m_combobox) - event.SetText( wxString::Format(_T("%ld"), m_combobox->GetInsertionPoint()) ); + event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) ); } void ComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) @@ -615,28 +615,28 @@ void ComboboxWidgetsPage::OnComboText(wxCommandEvent& event) wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), - _T("event and combobox values should be the same") ); + wxT("event and combobox values should be the same") ); if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) { - wxLogMessage(_T("Combobox enter pressed (now '%s')"), s.c_str()); + wxLogMessage(wxT("Combobox enter pressed (now '%s')"), s.c_str()); } else { - wxLogMessage(_T("Combobox text changed (now '%s')"), s.c_str()); + wxLogMessage(wxT("Combobox text changed (now '%s')"), s.c_str()); } } void ComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); - const wxString selstr = wxString::Format(_T("%ld"), sel); + const wxString selstr = wxString::Format(wxT("%ld"), sel); m_textDelete->SetValue(selstr); m_textCur->SetValue(selstr); - wxLogMessage(_T("Combobox item %ld selected"), sel); + wxLogMessage(wxT("Combobox item %ld selected"), sel); - wxLogMessage(_T("Combobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + wxLogMessage(wxT("Combobox GetValue(): %s"), m_combobox->GetValue().c_str() ); } void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) @@ -646,12 +646,12 @@ void ComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void ComboboxWidgetsPage::OnDropdown(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Combobox dropped down")); + wxLogMessage(wxT("Combobox dropped down")); } void ComboboxWidgetsPage::OnCloseup(wxCommandEvent& WXUNUSED(event)) { - wxLogMessage(_T("Combobox closed up")); + wxLogMessage(wxT("Combobox closed up")); } #endif //wxUSE_COMBOBOX diff --git a/samples/widgets/datepick.cpp b/samples/widgets/datepick.cpp index e553c3581f..80261da8f5 100644 --- a/samples/widgets/datepick.cpp +++ b/samples/widgets/datepick.cpp @@ -185,9 +185,9 @@ void DatePickerWidgetsPage::Reset() const wxDateTime today = wxDateTime::Today(); m_datePicker->SetValue(today); - m_day->SetValue(wxString::Format(_T("%d"), today.GetDay())); - m_month->SetValue(wxString::Format(_T("%d"), today.GetMonth())); - m_year->SetValue(wxString::Format(_T("%d"), today.GetYear())); + m_day->SetValue(wxString::Format(wxT("%d"), today.GetDay())); + m_month->SetValue(wxString::Format(wxT("%d"), today.GetMonth())); + m_year->SetValue(wxString::Format(wxT("%d"), today.GetYear())); } void DatePickerWidgetsPage::CreateDatePicker() @@ -237,12 +237,12 @@ void DatePickerWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event)) } else { - wxLogError(_T("Date is invalid")); + wxLogError(wxT("Date is invalid")); } } else { - wxLogError(_T("One of inputs is not number")); + wxLogError(wxT("One of inputs is not number")); } } diff --git a/samples/widgets/dirctrl.cpp b/samples/widgets/dirctrl.cpp index 1d8ad59cbd..b88d8df6ba 100644 --- a/samples/widgets/dirctrl.cpp +++ b/samples/widgets/dirctrl.cpp @@ -61,16 +61,16 @@ enum static const wxString stdPaths[] = { - _T("&none"), - _T("&config"), - _T("&data"), - _T("&documents"), - _T("&local data"), - _T("&plugins"), - _T("&resources"), - _T("&user config"), - _T("&user data"), - _T("&user local data") + wxT("&none"), + wxT("&config"), + wxT("&data"), + wxT("&documents"), + wxT("&local data"), + wxT("&plugins"), + wxT("&resources"), + wxT("&user config"), + wxT("&user data"), + wxT("&user local data") }; enum @@ -182,30 +182,30 @@ void DirCtrlWidgetsPage::CreateContent() 0, wxALL | wxALIGN_RIGHT , 5 ); wxSizer *sizerUseFlags = - new wxStaticBoxSizer(wxVERTICAL, this, _T("&Flags")); - m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_DIR_ONLY")); - m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_3D_INTERNAL")); - m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_SELECT_FIRST")); - m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_EDIT_LABELS")); - m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, _T("wxDIRCTRL_MULTIPLE")); + new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Flags")); + m_chkDirOnly = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_DIR_ONLY")); + m_chk3D = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_3D_INTERNAL")); + m_chkFirst = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_SELECT_FIRST")); + m_chkLabels = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_EDIT_LABELS")); + m_chkMulti = CreateCheckBoxAndAddToSizer(sizerUseFlags, wxT("wxDIRCTRL_MULTIPLE")); sizerLeft->Add(sizerUseFlags, wxSizerFlags().Expand().Border()); wxSizer *sizerFilters = - new wxStaticBoxSizer(wxVERTICAL, this, _T("&Filters")); + new wxStaticBoxSizer(wxVERTICAL, this, wxT("&Filters")); m_fltr[0] = CreateCheckBoxAndAddToSizer(sizerFilters, wxString::Format(wxT("all files (%s)|%s"), wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr)); m_fltr[1] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("C++ files (*.cpp; *.h)|*.cpp;*.h")); m_fltr[2] = CreateCheckBoxAndAddToSizer(sizerFilters, wxT("PNG images (*.png)|*.png")); sizerLeft->Add(sizerFilters, wxSizerFlags().Expand().Border()); - wxButton *btn = new wxButton(this, DirCtrlPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, DirCtrlPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // keep consistency between enum and labels of radiobox wxCOMPILE_TIME_ASSERT( stdPathMax == WXSIZEOF(stdPaths), EnumForRadioBoxMismatch); // middle pane - m_radioStdPath = new wxRadioBox(this, wxID_ANY, _T("Standard path"), + m_radioStdPath = new wxRadioBox(this, wxID_ANY, wxT("Standard path"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(stdPaths), stdPaths, 1); @@ -300,7 +300,7 @@ void DirCtrlWidgetsPage::OnRadioBox(wxCommandEvent& WXUNUSED(event)) { wxString path; - wxTheApp->SetAppName(_T("widgets")); + wxTheApp->SetAppName(wxT("widgets")); wxStandardPathsBase& stdp = wxStandardPaths::Get(); switch ( m_radioStdPath->GetSelection() ) @@ -351,7 +351,7 @@ void DirCtrlWidgetsPage::OnRadioBox(wxCommandEvent& WXUNUSED(event)) m_dirCtrl->SetPath(path); if(!m_dirCtrl->GetPath().IsSameAs(path)) { - wxLogMessage(_T("Selected standard path and path from control do not match!")); + wxLogMessage(wxT("Selected standard path and path from control do not match!")); m_radioStdPath->SetSelection(stdPathUnknown); } } diff --git a/samples/widgets/dirpicker.cpp b/samples/widgets/dirpicker.cpp index d9b97c967b..69bd544c5c 100644 --- a/samples/widgets/dirpicker.cpp +++ b/samples/widgets/dirpicker.cpp @@ -130,7 +130,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, _T("DirPicker"), +IMPLEMENT_WIDGETS_PAGE(DirPickerWidgetsPage, wxT("DirPicker"), PICKER_CTRLS | FAMILY_CTRLS); DirPickerWidgetsPage::DirPickerWidgetsPage(WidgetsBookCtrl *book, @@ -144,13 +144,13 @@ void DirPickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&DirPicker style")); - m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, _T("With textctrl"), false); - m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, _T("Dir must exist"), false); - m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, _T("Change working dir"), false); + wxStaticBoxSizer *dirbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&DirPicker style")); + m_chkDirTextCtrl = CreateCheckBoxAndAddToSizer(dirbox, wxT("With textctrl"), false); + m_chkDirMustExist = CreateCheckBoxAndAddToSizer(dirbox, wxT("Dir must exist"), false); + m_chkDirChangeDir = CreateCheckBoxAndAddToSizer(dirbox, wxT("Change working dir"), false); boxleft->Add(dirbox, 0, wxALL|wxGROW, 5); - boxleft->Add(new wxButton(this, PickerPage_Reset, _T("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state diff --git a/samples/widgets/editlbox.cpp b/samples/widgets/editlbox.cpp index eca528c662..dbc22d0db9 100644 --- a/samples/widgets/editlbox.cpp +++ b/samples/widgets/editlbox.cpp @@ -116,7 +116,7 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, _T("EditableListbox"), GENERIC_CTRLS); +IMPLEMENT_WIDGETS_PAGE(EditableListboxWidgetsPage, wxT("EditableListbox"), GENERIC_CTRLS); EditableListboxWidgetsPage::EditableListboxWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -135,15 +135,15 @@ void EditableListboxWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - _T("&Set listbox parameters")); + wxT("&Set listbox parameters")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Allow new items")); - m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Allow editing items")); - m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Allow deleting items")); - m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Block user reordering")); + m_chkAllowNew = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow new items")); + m_chkAllowEdit = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow editing items")); + m_chkAllowDelete = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Allow deleting items")); + m_chkAllowNoReorder = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Block user reordering")); - wxButton *btn = new wxButton(this, EditableListboxPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, EditableListboxPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // right pane diff --git a/samples/widgets/filectrl.cpp b/samples/widgets/filectrl.cpp index 773e11803e..a27367db31 100644 --- a/samples/widgets/filectrl.cpp +++ b/samples/widgets/filectrl.cpp @@ -177,21 +177,21 @@ void FileCtrlWidgetsPage::CreateContent() 0, wxALL | wxEXPAND , 5 ); wxSizer *sizerUseFlags = - new wxStaticBoxSizer( wxVERTICAL, this, _T( "&Flags" ) ); + new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Flags" ) ); - m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, _T( "wxFC_MULTIPLE" ) ); - m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, _T( "wxFC_NOSHOWHIDDEN" ) ); + m_chkMultiple = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_MULTIPLE" ) ); + m_chkNoShowHidden = CreateCheckBoxAndAddToSizer( sizerUseFlags, wxT( "wxFC_NOSHOWHIDDEN" ) ); sizerLeft->Add( sizerUseFlags, wxSizerFlags().Expand().Border() ); wxSizer *sizerFilters = - new wxStaticBoxSizer( wxVERTICAL, this, _T( "&Filters" ) ); + new wxStaticBoxSizer( wxVERTICAL, this, wxT( "&Filters" ) ); m_fltr[0] = CreateCheckBoxAndAddToSizer( sizerFilters, wxString::Format( wxT( "all files (%s)|%s" ), wxFileSelectorDefaultWildcardStr, wxFileSelectorDefaultWildcardStr ) ); m_fltr[1] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "C++ files (*.cpp; *.h)|*.cpp;*.h" ) ); m_fltr[2] = CreateCheckBoxAndAddToSizer( sizerFilters, wxT( "PNG images (*.png)|*.png" ) ); sizerLeft->Add( sizerFilters, wxSizerFlags().Expand().Border() ); - wxButton *btn = new wxButton( this, FileCtrlPage_Reset, _T( "&Reset" ) ); + wxButton *btn = new wxButton( this, FileCtrlPage_Reset, wxT( "&Reset" ) ); sizerLeft->Add( btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15 ); // right pane diff --git a/samples/widgets/filepicker.cpp b/samples/widgets/filepicker.cpp index 1246f2a5c5..ec6f48f014 100644 --- a/samples/widgets/filepicker.cpp +++ b/samples/widgets/filepicker.cpp @@ -144,7 +144,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, _T("FilePicker"), +IMPLEMENT_WIDGETS_PAGE(FilePickerWidgetsPage, wxT("FilePicker"), PICKER_CTRLS | FAMILY_CTRLS); FilePickerWidgetsPage::FilePickerWidgetsPage(WidgetsBookCtrl *book, @@ -158,20 +158,20 @@ void FilePickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - static const wxString mode[] = { _T("open"), _T("save") }; - m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, _T("wxFilePicker mode"), + static const wxString mode[] = { wxT("open"), wxT("save") }; + m_radioFilePickerMode = new wxRadioBox(this, wxID_ANY, wxT("wxFilePicker mode"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(mode), mode); boxleft->Add(m_radioFilePickerMode, 0, wxALL|wxGROW, 5); - wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&FilePicker style")); - m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, _T("With textctrl"), false); - m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, _T("Overwrite prompt"), false); - m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, _T("File must exist"), false); - m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, _T("Change working dir"), false); + wxStaticBoxSizer *filebox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FilePicker style")); + m_chkFileTextCtrl = CreateCheckBoxAndAddToSizer(filebox, wxT("With textctrl"), false); + m_chkFileOverwritePrompt = CreateCheckBoxAndAddToSizer(filebox, wxT("Overwrite prompt"), false); + m_chkFileMustExist = CreateCheckBoxAndAddToSizer(filebox, wxT("File must exist"), false); + m_chkFileChangeDir = CreateCheckBoxAndAddToSizer(filebox, wxT("Change working dir"), false); boxleft->Add(filebox, 0, wxALL|wxGROW, 5); - boxleft->Add(new wxButton(this, PickerPage_Reset, _T("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state diff --git a/samples/widgets/fontpicker.cpp b/samples/widgets/fontpicker.cpp index d26fac62dc..6bfb69ca6b 100644 --- a/samples/widgets/fontpicker.cpp +++ b/samples/widgets/fontpicker.cpp @@ -130,7 +130,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, _T("FontPicker"), +IMPLEMENT_WIDGETS_PAGE(FontPickerWidgetsPage, wxT("FontPicker"), PICKER_CTRLS | FAMILY_CTRLS); FontPickerWidgetsPage::FontPickerWidgetsPage(WidgetsBookCtrl *book, @@ -144,13 +144,13 @@ void FontPickerWidgetsPage::CreateContent() // left pane wxSizer *boxleft = new wxBoxSizer(wxVERTICAL); - wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, _T("&FontPicker style")); - m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, _T("With textctrl")); - m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, _T("Font desc as btn label")); - m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, _T("Use font for label"), false); + wxStaticBoxSizer *fontbox = new wxStaticBoxSizer(wxVERTICAL, this, wxT("&FontPicker style")); + m_chkFontTextCtrl = CreateCheckBoxAndAddToSizer(fontbox, wxT("With textctrl")); + m_chkFontDescAsLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Font desc as btn label")); + m_chkFontUseFontForLabel = CreateCheckBoxAndAddToSizer(fontbox, wxT("Use font for label"), false); boxleft->Add(fontbox, 0, wxALL|wxGROW, 5); - boxleft->Add(new wxButton(this, PickerPage_Reset, _T("&Reset")), + boxleft->Add(new wxButton(this, PickerPage_Reset, wxT("&Reset")), 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); Reset(); // set checkboxes state diff --git a/samples/widgets/gauge.cpp b/samples/widgets/gauge.cpp index a60f55312c..011702d0c3 100644 --- a/samples/widgets/gauge.cpp +++ b/samples/widgets/gauge.cpp @@ -175,7 +175,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, _T("Gauge"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(GaugeWidgetsPage, wxT("Gauge"), FAMILY_CTRLS ); GaugeWidgetsPage::GaugeWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -198,24 +198,24 @@ void GaugeWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Vertical")); - m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Smooth")); + m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical")); + m_chkSmooth = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Smooth")); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, GaugePage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, GaugePage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change gauge value")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change gauge value")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"), + wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"), GaugePage_CurValueText, &text); text->SetEditable(false); @@ -223,26 +223,26 @@ void GaugeWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(GaugePage_SetValue, - _T("Set &value"), + wxT("Set &value"), GaugePage_ValueText, &m_textValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(GaugePage_SetRange, - _T("Set &range"), + wxT("Set &range"), GaugePage_RangeText, &m_textRange); - m_textRange->SetValue( wxString::Format(_T("%lu"), m_range) ); + m_textRange->SetValue( wxString::Format(wxT("%lu"), m_range) ); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, GaugePage_Progress, _T("Simulate &progress")); + btn = new wxButton(this, GaugePage_Progress, wxT("Simulate &progress")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); btn = new wxButton(this, GaugePage_IndeterminateProgress, - _T("Simulate &indeterminate job")); + wxT("Simulate &indeterminate job")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, GaugePage_Clear, _T("&Clear")); + btn = new wxButton(this, GaugePage_Clear, wxT("&Clear")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -316,13 +316,13 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked) { static const int INTERVAL = 300; - wxLogMessage(_T("Launched progress timer (interval = %d ms)"), INTERVAL); + wxLogMessage(wxT("Launched progress timer (interval = %d ms)"), INTERVAL); m_timer = new wxTimer(this, clicked->GetId() == GaugePage_Progress ? GaugePage_Timer : GaugePage_IndeterminateTimer); m_timer->Start(INTERVAL); - clicked->SetLabel(_T("&Stop timer")); + clicked->SetLabel(wxT("&Stop timer")); if (clicked->GetId() == GaugePage_Progress) FindWindow(GaugePage_IndeterminateProgress)->Disable(); @@ -332,7 +332,7 @@ void GaugeWidgetsPage::StartTimer(wxButton *clicked) void GaugeWidgetsPage::StopTimer(wxButton *clicked) { - wxCHECK_RET( m_timer, _T("shouldn't be called") ); + wxCHECK_RET( m_timer, wxT("shouldn't be called") ); m_timer->Stop(); delete m_timer; @@ -340,16 +340,16 @@ void GaugeWidgetsPage::StopTimer(wxButton *clicked) if (clicked->GetId() == GaugePage_Progress) { - clicked->SetLabel(_T("Simulate &progress")); + clicked->SetLabel(wxT("Simulate &progress")); FindWindow(GaugePage_IndeterminateProgress)->Enable(); } else { - clicked->SetLabel(_T("Simulate indeterminate job")); + clicked->SetLabel(wxT("Simulate indeterminate job")); FindWindow(GaugePage_Progress)->Enable(); } - wxLogMessage(_T("Progress finished.")); + wxLogMessage(wxT("Progress finished.")); } // ---------------------------------------------------------------------------- @@ -374,7 +374,7 @@ void GaugeWidgetsPage::OnButtonProgress(wxCommandEvent& event) { StopTimer(b); - wxLogMessage(_T("Stopped the timer.")); + wxLogMessage(wxT("Stopped the timer.")); } } @@ -389,7 +389,7 @@ void GaugeWidgetsPage::OnButtonIndeterminateProgress(wxCommandEvent& event) { StopTimer(b); - wxLogMessage(_T("Stopped the timer.")); + wxLogMessage(wxT("Stopped the timer.")); } } @@ -449,7 +449,7 @@ void GaugeWidgetsPage::OnProgressTimer(wxTimerEvent& WXUNUSED(event)) else // reached the end { wxButton *btn = (wxButton *)FindWindow(GaugePage_Progress); - wxCHECK_RET( btn, _T("no progress button?") ); + wxCHECK_RET( btn, wxT("no progress button?") ); StopTimer(btn); } @@ -462,7 +462,7 @@ void GaugeWidgetsPage::OnIndeterminateProgressTimer(wxTimerEvent& WXUNUSED(event void GaugeWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(_T("%d"), m_gauge->GetValue())); + event.SetText( wxString::Format(wxT("%d"), m_gauge->GetValue())); } #endif diff --git a/samples/widgets/hyperlnk.cpp b/samples/widgets/hyperlnk.cpp index f93cc97acd..0cb43720b1 100644 --- a/samples/widgets/hyperlnk.cpp +++ b/samples/widgets/hyperlnk.cpp @@ -167,14 +167,14 @@ void HyperlinkWidgetsPage::CreateContent() static const wxString alignments[] = { - _T("&left"), - _T("¢re"), - _T("&right") + wxT("&left"), + wxT("¢re"), + wxT("&right") }; wxCOMPILE_TIME_ASSERT( WXSIZEOF(alignments) == Align_Max, AlignMismatch ); - m_radioAlignMode = new wxRadioBox(this, wxID_ANY, _T("alignment"), + m_radioAlignMode = new wxRadioBox(this, wxID_ANY, wxT("alignment"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(alignments), alignments); m_radioAlignMode->SetSelection(1); // start with "centre" selected since @@ -304,7 +304,7 @@ void HyperlinkWidgetsPage::OnAlignment(wxCommandEvent& WXUNUSED(event)) { default: case Align_Max: - wxFAIL_MSG( _T("unknown alignment") ); + wxFAIL_MSG( wxT("unknown alignment") ); // fall through case Align_Left: diff --git a/samples/widgets/itemcontainer.cpp b/samples/widgets/itemcontainer.cpp index 5b70076292..3cd02fc9b9 100644 --- a/samples/widgets/itemcontainer.cpp +++ b/samples/widgets/itemcontainer.cpp @@ -71,12 +71,12 @@ ItemContainerWidgetsPage::ItemContainerWidgetsPage(WidgetsBookCtrl *book, const char *const icon[]) : WidgetsPage(book, image_list, icon), m_trackedDataObjects(0) { - m_items.Add(_T("This")); - m_items.Add(_T("is")); - m_items.Add(_T("a")); - m_items.Add(_T("List")); - m_items.Add(_T("of")); - m_items.Add(_T("strings")); + m_items.Add(wxT("This")); + m_items.Add(wxT("is")); + m_items.Add(wxT("a")); + m_items.Add(wxT("List")); + m_items.Add(wxT("of")); + m_items.Add(wxT("strings")); m_itemsSorted = m_items; } @@ -103,11 +103,11 @@ bool ItemContainerWidgetsPage::VerifyAllClientDataDestroyed() { if ( m_trackedDataObjects ) { - wxString message = _T("Bug in managing wxClientData: "); + wxString message = wxT("Bug in managing wxClientData: "); if ( m_trackedDataObjects > 0 ) - message << m_trackedDataObjects << _T(" lost objects"); + message << m_trackedDataObjects << wxT(" lost objects"); else - message << (-m_trackedDataObjects) << _T(" extra deletes"); + message << (-m_trackedDataObjects) << wxT(" extra deletes"); wxFAIL_MSG(message); return false; } @@ -118,7 +118,7 @@ bool ItemContainerWidgetsPage::VerifyAllClientDataDestroyed() void ItemContainerWidgetsPage::StartTest(const wxString& label) { m_container->Clear(); - wxLogMessage(_T("Test - %s:"), label.c_str()); + wxLogMessage(wxT("Test - %s:"), label.c_str()); } void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) @@ -128,7 +128,7 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) bool ok = count == items.GetCount(); if ( !ok ) { - wxFAIL_MSG(_T("Item count does not match.")); + wxFAIL_MSG(wxT("Item count does not match.")); } else { @@ -138,7 +138,7 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) if ( str != items[i] ) { wxFAIL_MSG(wxString::Format( - _T("Wrong string \"%s\" at position %d (expected \"%s\")"), + wxT("Wrong string \"%s\" at position %d (expected \"%s\")"), str.c_str(), i, items[i].c_str())); ok = false; break; @@ -173,19 +173,19 @@ void ItemContainerWidgetsPage::EndTest(const wxArrayString& items) m_container->Clear(); ok &= VerifyAllClientDataDestroyed(); - wxLogMessage(_T("...%s"), ok ? _T("passed") : _T("failed")); + wxLogMessage(wxT("...%s"), ok ? wxT("passed") : wxT("failed")); } wxString ItemContainerWidgetsPage::DumpContainerData(const wxArrayString& expected) const { wxString str; - str << _T("Current content:\n"); + str << wxT("Current content:\n"); unsigned i; for ( i = 0; i < m_container->GetCount(); ++i ) { - str << _T(" - ") << m_container->GetString(i) << _T(" ["); + str << wxT(" - ") << m_container->GetString(i) << wxT(" ["); if ( m_container->HasClientObjectData() ) { TrackedClientData * @@ -199,20 +199,20 @@ ItemContainerWidgetsPage::DumpContainerData(const wxArrayString& expected) const if ( data ) str << (wxUIntPtr)data; } - str << _T("]\n"); + str << wxT("]\n"); } - str << _T("Expected content:\n"); + str << wxT("Expected content:\n"); for ( i = 0; i < expected.GetCount(); ++i ) { const wxString& item = expected[i]; - str << _T(" - ") << item << _T("["); + str << wxT(" - ") << item << wxT("["); for( unsigned j = 0; j < m_items.GetCount(); ++j ) { if ( m_items[j] == item ) str << j; } - str << _T("]\n"); + str << wxT("]\n"); } return str; @@ -222,7 +222,7 @@ bool ItemContainerWidgetsPage::VerifyClientData(wxUIntPtr i, const wxString& str { if ( i > m_items.GetCount() || m_items[i] != str ) { - wxLogMessage(_T("Client data for '%s' does not match."), str.c_str()); + wxLogMessage(wxT("Client data for '%s' does not match."), str.c_str()); return false; } @@ -246,9 +246,9 @@ ItemContainerWidgetsPage::MakeArray(const wxSortedArrayString& sorted) void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) { m_container = GetContainer(); - wxASSERT_MSG(m_container, _T("Widget must have a test widget")); + wxASSERT_MSG(m_container, wxT("Widget must have a test widget")); - wxLogMessage(_T("wxItemContainer test for %s, %s:"), + wxLogMessage(wxT("wxItemContainer test for %s, %s:"), GetWidget()->GetClassInfo()->GetClassName(), (m_container->IsSorted() ? "Sorted" : "Unsorted")); @@ -256,16 +256,16 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) expected_result = m_container->IsSorted() ? MakeArray(m_itemsSorted) : m_items; - StartTest(_T("Append one item")); + StartTest(wxT("Append one item")); wxString item = m_items[0]; m_container->Append(item); EndTest(wxArrayString(1, &item)); - StartTest(_T("Append some items")); + StartTest(wxT("Append some items")); m_container->Append(m_items); EndTest(expected_result); - StartTest(_T("Append some items with data objects")); + StartTest(wxT("Append some items with data objects")); wxClientData **objects = new wxClientData *[m_items.GetCount()]; unsigned i; for ( i = 0; i < m_items.GetCount(); ++i ) @@ -274,7 +274,7 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) EndTest(expected_result); delete[] objects; - StartTest(_T("Append some items with data")); + StartTest(wxT("Append some items with data")); void **data = new void *[m_items.GetCount()]; for ( i = 0; i < m_items.GetCount(); ++i ) data[i] = wxUIntToPtr(i); @@ -282,19 +282,19 @@ void ItemContainerWidgetsPage::OnButtonTestItemContainer(wxCommandEvent&) EndTest(expected_result); delete[] data; - StartTest(_T("Append some items with data, one by one")); + StartTest(wxT("Append some items with data, one by one")); for ( i = 0; i < m_items.GetCount(); ++i ) m_container->Append(m_items[i], wxUIntToPtr(i)); EndTest(expected_result); - StartTest(_T("Append some items with data objects, one by one")); + StartTest(wxT("Append some items with data objects, one by one")); for ( i = 0; i < m_items.GetCount(); ++i ) m_container->Append(m_items[i], CreateClientData(i)); EndTest(expected_result); if ( !m_container->IsSorted() ) { - StartTest(_T("Insert in reverse order with data, one by one")); + StartTest(wxT("Insert in reverse order with data, one by one")); for ( unsigned i = m_items.GetCount(); i; --i ) m_container->Insert(m_items[i - 1], 0, wxUIntToPtr(i - 1)); EndTest(expected_result); diff --git a/samples/widgets/listbox.cpp b/samples/widgets/listbox.cpp index f02c97491e..83bc720e51 100644 --- a/samples/widgets/listbox.cpp +++ b/samples/widgets/listbox.cpp @@ -225,7 +225,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, _T("Listbox"), +IMPLEMENT_WIDGETS_PAGE(ListboxWidgetsPage, wxT("Listbox"), FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -259,17 +259,17 @@ void ListboxWidgetsPage::CreateContent() // left pane wxStaticBox *box = new wxStaticBox(this, wxID_ANY, - _T("&Set listbox parameters")); + wxT("&Set listbox parameters")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); static const wxString modes[] = { - _T("single"), - _T("extended"), - _T("multiple"), + wxT("single"), + wxT("extended"), + wxT("multiple"), }; - m_radioSelMode = new wxRadioBox(this, wxID_ANY, _T("Selection &mode:"), + m_radioSelMode = new wxRadioBox(this, wxID_ANY, wxT("Selection &mode:"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(modes), modes, 1, wxRA_SPECIFY_COLS); @@ -277,69 +277,69 @@ void ListboxWidgetsPage::CreateContent() m_chkVScroll = CreateCheckBoxAndAddToSizer ( sizerLeft, - _T("Always show &vertical scrollbar") + wxT("Always show &vertical scrollbar") ); m_chkHScroll = CreateCheckBoxAndAddToSizer ( sizerLeft, - _T("Show &horizontal scrollbar") + wxT("Show &horizontal scrollbar") ); - m_chkCheck = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Check list box")); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Sort items")); - m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Owner drawn")); + m_chkCheck = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Check list box")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Sort items")); + m_chkOwnerDraw = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Owner drawn")); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioSelMode, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, ListboxPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, ListboxPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - _T("&Change listbox contents")); + wxT("&Change listbox contents")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_Add, _T("&Add this string")); - m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, _T("test item 0")); + btn = new wxButton(this, ListboxPage_Add, wxT("&Add this string")); + m_textAdd = new wxTextCtrl(this, ListboxPage_AddText, wxT("test item 0")); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textAdd, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_AddSeveral, _T("&Insert a few strings")); + btn = new wxButton(this, ListboxPage_AddSeveral, wxT("&Insert a few strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_AddMany, _T("Add &many strings")); + btn = new wxButton(this, ListboxPage_AddMany, wxT("Add &many strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_Change, _T("C&hange current")); + btn = new wxButton(this, ListboxPage_Change, wxT("C&hange current")); m_textChange = new wxTextCtrl(this, ListboxPage_ChangeText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textChange, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_EnsureVisible, _T("Make item &visible")); + btn = new wxButton(this, ListboxPage_EnsureVisible, wxT("Make item &visible")); m_textEnsureVisible = new wxTextCtrl(this, ListboxPage_EnsureVisibleText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textEnsureVisible, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = new wxBoxSizer(wxHORIZONTAL); - btn = new wxButton(this, ListboxPage_Delete, _T("&Delete this item")); + btn = new wxButton(this, ListboxPage_Delete, wxT("&Delete this item")); m_textDelete = new wxTextCtrl(this, ListboxPage_DeleteText, wxEmptyString); sizerRow->Add(btn, 0, wxRIGHT, 5); sizerRow->Add(m_textDelete, 1, wxLEFT, 5); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_DeleteSel, _T("Delete &selection")); + btn = new wxButton(this, ListboxPage_DeleteSel, wxT("Delete &selection")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_Clear, _T("&Clear")); + btn = new wxButton(this, ListboxPage_Clear, wxT("&Clear")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ListboxPage_ContainerTests, _T("Run &tests")); + btn = new wxButton(this, ListboxPage_ContainerTests, wxT("Run &tests")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -383,7 +383,7 @@ void ListboxWidgetsPage::CreateLbox() switch ( m_radioSelMode->GetSelection() ) { default: - wxFAIL_MSG( _T("unexpected radio box selection") ); + wxFAIL_MSG( wxT("unexpected radio box selection") ); case LboxSel_Single: flags |= wxLB_SINGLE; break; case LboxSel_Extended: flags |= wxLB_EXTENDED; break; @@ -528,7 +528,7 @@ void ListboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(_T("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); } m_lbox->Append(s); @@ -539,16 +539,16 @@ void ListboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_lbox->Append(wxString::Format(_T("item #%u"), n)); + m_lbox->Append(wxString::Format(wxT("item #%u"), n)); } } void ListboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { wxArrayString items; - items.Add(_T("First")); - items.Add(_T("another one")); - items.Add(_T("and the last (very very very very very very very very very very long) one")); + items.Add(wxT("First")); + items.Add(wxT("another one")); + items.Add(wxT("and the last (very very very very very very very very very very long) one")); m_lbox->InsertItems(items, 0); } @@ -590,26 +590,26 @@ void ListboxWidgetsPage::OnUpdateUIAddSeveral(wxUpdateUIEvent& event) void ListboxWidgetsPage::OnListbox(wxCommandEvent& event) { long sel = event.GetSelection(); - m_textDelete->SetValue(wxString::Format(_T("%ld"), sel)); + m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); if (event.IsSelection()) { - wxLogMessage(_T("Listbox item %ld selected"), sel); + wxLogMessage(wxT("Listbox item %ld selected"), sel); } else { - wxLogMessage(_T("Listbox item %ld deselected"), sel); + wxLogMessage(wxT("Listbox item %ld deselected"), sel); } } void ListboxWidgetsPage::OnListboxDClick(wxCommandEvent& event) { - wxLogMessage( _T("Listbox item %d double clicked"), event.GetInt() ); + wxLogMessage( wxT("Listbox item %d double clicked"), event.GetInt() ); } void ListboxWidgetsPage::OnCheckListbox(wxCommandEvent& event) { - wxLogMessage( _T("Listbox item %d toggled"), event.GetInt() ); + wxLogMessage( wxT("Listbox item %d toggled"), event.GetInt() ); } void ListboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/widgets/notebook.cpp b/samples/widgets/notebook.cpp index 7c9e94a8a8..ded5de3900 100644 --- a/samples/widgets/notebook.cpp +++ b/samples/widgets/notebook.cpp @@ -211,20 +211,20 @@ void BookWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); // must be in sync with Orient enum wxArrayString orientations; - orientations.Add(_T("&top")); - orientations.Add(_T("&bottom")); - orientations.Add(_T("&left")); - orientations.Add(_T("&right")); + orientations.Add(wxT("&top")); + orientations.Add(wxT("&bottom")); + orientations.Add(wxT("&left")); + orientations.Add(wxT("&right")); wxASSERT_MSG( orientations.GetCount() == Orient_Max, - _T("forgot to update something") ); + wxT("forgot to update something") ); - m_chkImages = new wxCheckBox(this, wxID_ANY, _T("Show &images")); - m_radioOrient = new wxRadioBox(this, wxID_ANY, _T("&Tab orientation"), + m_chkImages = new wxCheckBox(this, wxID_ANY, wxT("Show &images")); + m_radioOrient = new wxRadioBox(this, wxID_ANY, wxT("&Tab orientation"), wxDefaultPosition, wxDefaultSize, orientations, 1, wxRA_SPECIFY_COLS); @@ -234,48 +234,48 @@ void BookWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer sizerLeft->Add(m_radioOrient, 0, wxALL, 5); - wxButton *btn = new wxButton(this, BookPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, BookPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Contents")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Contents")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Number of pages: "), + wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Number of pages: "), BookPage_NumPagesText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(_T("Current selection: "), + sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection: "), BookPage_CurSelectText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BookPage_SelectPage, - _T("&Select page"), + wxT("&Select page"), BookPage_SelectText, &m_textSelect); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BookPage_AddPage, _T("&Add page")); + btn = new wxButton(this, BookPage_AddPage, wxT("&Add page")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BookPage_InsertPage, - _T("&Insert page at"), + wxT("&Insert page at"), BookPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(BookPage_RemovePage, - _T("&Remove page"), + wxT("&Remove page"), BookPage_RemoveText, &m_textRemove); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, BookPage_DeleteAll, _T("&Delete All")); + btn = new wxButton(this, BookPage_DeleteAll, wxT("&Delete All")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -359,7 +359,7 @@ void BookWidgetsPage::RecreateBook() switch ( m_radioOrient->GetSelection() ) { default: - wxFAIL_MSG( _T("unknown orientation") ); + wxFAIL_MSG( wxT("unknown orientation") ); // fall through case Orient_Top: @@ -450,7 +450,7 @@ int BookWidgetsPage::GetIconIndex() const wxWindow *BookWidgetsPage::CreateNewPage() { - return new wxTextCtrl(m_book, wxID_ANY, _T("I'm a book page")); + return new wxTextCtrl(m_book, wxID_ANY, wxT("I'm a book page")); } // ---------------------------------------------------------------------------- @@ -472,30 +472,30 @@ void BookWidgetsPage::OnButtonDeleteAll(wxCommandEvent& WXUNUSED(event)) void BookWidgetsPage::OnButtonSelectPage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textSelect); - wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") ); + wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") ); m_book->SetSelection(pos); } void BookWidgetsPage::OnButtonAddPage(wxCommandEvent& WXUNUSED(event)) { - m_book->AddPage(CreateNewPage(), _T("Added page"), false, + m_book->AddPage(CreateNewPage(), wxT("Added page"), false, GetIconIndex()); } void BookWidgetsPage::OnButtonInsertPage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textInsert); - wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") ); + wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") ); - m_book->InsertPage(pos, CreateNewPage(), _T("Inserted page"), false, + m_book->InsertPage(pos, CreateNewPage(), wxT("Inserted page"), false, GetIconIndex()); } void BookWidgetsPage::OnButtonRemovePage(wxCommandEvent& WXUNUSED(event)) { int pos = GetTextValue(m_textRemove); - wxCHECK_RET( IsValidValue(pos), _T("button should be disabled") ); + wxCHECK_RET( IsValidValue(pos), wxT("button should be disabled") ); m_book->DeletePage(pos); } @@ -525,13 +525,13 @@ void BookWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) void BookWidgetsPage::OnUpdateUINumPagesText(wxUpdateUIEvent& event) { if(m_book) - event.SetText( wxString::Format(_T("%u"), unsigned(m_book->GetPageCount())) ); + event.SetText( wxString::Format(wxT("%u"), unsigned(m_book->GetPageCount())) ); } void BookWidgetsPage::OnUpdateUICurSelectText(wxUpdateUIEvent& event) { if(m_book) - event.SetText( wxString::Format(_T("%d"), m_book->GetSelection()) ); + event.SetText( wxString::Format(wxT("%d"), m_book->GetSelection()) ); } void BookWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) @@ -594,13 +594,13 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, _T("Notebook"), +IMPLEMENT_WIDGETS_PAGE(NotebookWidgetsPage, wxT("Notebook"), FAMILY_CTRLS | BOOK_CTRLS ); void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event) { - wxLogMessage(_T("Notebook page changing from %d to %d (currently %d)."), + wxLogMessage(wxT("Notebook page changing from %d to %d (currently %d)."), event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -610,7 +610,7 @@ void NotebookWidgetsPage::OnPageChanging(wxNotebookEvent& event) void NotebookWidgetsPage::OnPageChanged(wxNotebookEvent& event) { - wxLogMessage(_T("Notebook page changed from %d to %d (currently %d)."), + wxLogMessage(wxT("Notebook page changed from %d to %d (currently %d)."), event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -667,13 +667,13 @@ BEGIN_EVENT_TABLE(ListbookWidgetsPage, BookWidgetsPage) EVT_LISTBOOK_PAGE_CHANGED(wxID_ANY, ListbookWidgetsPage::OnPageChanged) END_EVENT_TABLE() -IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, _T("Listbook"), +IMPLEMENT_WIDGETS_PAGE(ListbookWidgetsPage, wxT("Listbook"), GENERIC_CTRLS | BOOK_CTRLS ); void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event) { - wxLogMessage(_T("Listbook page changing from %d to %d (currently %d)."), + wxLogMessage(wxT("Listbook page changing from %d to %d (currently %d)."), event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -683,7 +683,7 @@ void ListbookWidgetsPage::OnPageChanging(wxListbookEvent& event) void ListbookWidgetsPage::OnPageChanged(wxListbookEvent& event) { - wxLogMessage(_T("Listbook page changed from %d to %d (currently %d)."), + wxLogMessage(wxT("Listbook page changed from %d to %d (currently %d)."), event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -740,13 +740,13 @@ BEGIN_EVENT_TABLE(ChoicebookWidgetsPage, BookWidgetsPage) EVT_CHOICEBOOK_PAGE_CHANGED(wxID_ANY, ChoicebookWidgetsPage::OnPageChanged) END_EVENT_TABLE() -IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, _T("Choicebook"), +IMPLEMENT_WIDGETS_PAGE(ChoicebookWidgetsPage, wxT("Choicebook"), GENERIC_CTRLS | BOOK_CTRLS ); void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event) { - wxLogMessage(_T("Choicebook page changing from %d to %d (currently %d)."), + wxLogMessage(wxT("Choicebook page changing from %d to %d (currently %d)."), event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); @@ -756,7 +756,7 @@ void ChoicebookWidgetsPage::OnPageChanging(wxChoicebookEvent& event) void ChoicebookWidgetsPage::OnPageChanged(wxChoicebookEvent& event) { - wxLogMessage(_T("Choicebook page changed from %d to %d (currently %d)."), + wxLogMessage(wxT("Choicebook page changed from %d to %d (currently %d)."), event.GetOldSelection(), event.GetSelection(), m_book->GetSelection()); diff --git a/samples/widgets/odcombobox.cpp b/samples/widgets/odcombobox.cpp index ae8cd2b9eb..ae95eab5ac 100644 --- a/samples/widgets/odcombobox.cpp +++ b/samples/widgets/odcombobox.cpp @@ -296,7 +296,7 @@ public: }; -IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, _T("OwnerDrawnCombobox"), +IMPLEMENT_WIDGETS_PAGE(ODComboboxWidgetsPage, wxT("OwnerDrawnCombobox"), GENERIC_CTRLS | WITH_ITEMS_CTRLS | COMBO_CTRLS ); @@ -329,88 +329,88 @@ void ODComboboxWidgetsPage::CreateContent() wxSizer *sizerLeft = new wxBoxSizer(wxVERTICAL); // left pane - style box - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); wxSizer *sizerStyle = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Sort items")); - m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Read only")); - m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Double-click Cycles")); + m_chkSort = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Sort items")); + m_chkReadonly = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Read only")); + m_chkDclickcycles = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Double-click Cycles")); sizerStyle->AddSpacer(4); - m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, _T("&Bitmap button")); - m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, _T("B&lank button background")); + m_chkBitmapbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("&Bitmap button")); + m_chkStdbutton = CreateCheckBoxAndAddToSizer(sizerStyle, wxT("B&lank button background")); - wxButton *btn = new wxButton(this, ODComboPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, ODComboPage_Reset, wxT("&Reset")); sizerStyle->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 3); sizerLeft->Add(sizerStyle, 0, wxGROW | wxALIGN_CENTRE_HORIZONTAL); // left pane - popup adjustment box - box = new wxStaticBox(this, wxID_ANY, _T("Adjust &popup")); + box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &popup")); wxSizer *sizerPopupPos = new wxStaticBoxSizer(box, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(_T("Min. Width:"), + sizerRow = CreateSizerWithTextAndLabel(wxT("Min. Width:"), ODComboPage_PopupMinWidth, &m_textPopupMinWidth); m_textPopupMinWidth->SetValue(wxT("-1")); sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(_T("Max. Height:"), + sizerRow = CreateSizerWithTextAndLabel(wxT("Max. Height:"), ODComboPage_PopupHeight, &m_textPopupHeight); m_textPopupHeight->SetValue(wxT("-1")); sizerPopupPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, _T("Align Right")); + m_chkAlignpopupright = CreateCheckBoxAndAddToSizer(sizerPopupPos, wxT("Align Right")); sizerLeft->Add(sizerPopupPos, 0, wxGROW | wxALIGN_CENTRE_HORIZONTAL | wxTOP, 2); // left pane - button adjustment box - box = new wxStaticBox(this, wxID_ANY, _T("Adjust &button")); + box = new wxStaticBox(this, wxID_ANY, wxT("Adjust &button")); wxSizer *sizerButtonPos = new wxStaticBoxSizer(box, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(_T("Width:"), + sizerRow = CreateSizerWithTextAndLabel(wxT("Width:"), ODComboPage_ButtonWidth, &m_textButtonWidth); m_textButtonWidth->SetValue(wxT("-1")); sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(_T("VSpacing:"), + sizerRow = CreateSizerWithTextAndLabel(wxT("VSpacing:"), ODComboPage_ButtonSpacing, &m_textButtonSpacing); m_textButtonSpacing->SetValue(wxT("0")); sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(_T("Height:"), + sizerRow = CreateSizerWithTextAndLabel(wxT("Height:"), ODComboPage_ButtonHeight, &m_textButtonHeight); m_textButtonHeight->SetValue(wxT("-1")); sizerButtonPos->Add(sizerRow, 0, wxALL | wxGROW, 5); - m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, _T("Align Left")); + m_chkAlignbutleft = CreateCheckBoxAndAddToSizer(sizerButtonPos, wxT("Align Left")); sizerLeft->Add(sizerButtonPos, 0, wxGROW | wxALIGN_CENTRE_HORIZONTAL | wxTOP, 2); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - _T("&Change combobox contents")); + wxT("&Change combobox contents")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - btn = new wxButton(this, ODComboPage_ContainerTests, _T("Run &tests")); + btn = new wxButton(this, ODComboPage_ContainerTests, wxT("Run &tests")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(_T("Current selection"), + sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection"), ODComboPage_CurText, &text); text->SetEditable(false); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - sizerRow = CreateSizerWithTextAndLabel(_T("Insertion Point"), + sizerRow = CreateSizerWithTextAndLabel(wxT("Insertion Point"), ODComboPage_InsertionPointText, &text); text->SetEditable(false); @@ -418,39 +418,39 @@ void ODComboboxWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Insert, - _T("&Insert this string"), + wxT("&Insert this string"), ODComboPage_InsertText, &m_textInsert); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Add, - _T("&Add this string"), + wxT("&Add this string"), ODComboPage_AddText, &m_textAdd); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_AddSeveral, _T("&Append a few strings")); + btn = new wxButton(this, ODComboPage_AddSeveral, wxT("&Append a few strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_AddMany, _T("Append &many strings")); + btn = new wxButton(this, ODComboPage_AddMany, wxT("Append &many strings")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Change, - _T("C&hange current"), + wxT("C&hange current"), ODComboPage_ChangeText, &m_textChange); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(ODComboPage_Delete, - _T("&Delete this item"), + wxT("&Delete this item"), ODComboPage_DeleteText, &m_textDelete); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_DeleteSel, _T("Delete &selection")); + btn = new wxButton(this, ODComboPage_DeleteSel, wxT("Delete &selection")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); - btn = new wxButton(this, ODComboPage_Clear, _T("&Clear")); + btn = new wxButton(this, ODComboPage_Clear, wxT("&Clear")); sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5); // right pane @@ -566,7 +566,7 @@ void ODComboboxWidgetsPage::OnButtonChange(wxCommandEvent& WXUNUSED(event)) #ifndef __WXGTK__ m_combobox->SetString(sel, m_textChange->GetValue()); #else - wxLogMessage(_T("Not implemented in wxGTK")); + wxLogMessage(wxT("Not implemented in wxGTK")); #endif } } @@ -605,7 +605,7 @@ void ODComboboxWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) if ( !m_textInsert->IsModified() ) { // update the default string - m_textInsert->SetValue(wxString::Format(_T("test item %u"), ++s_item)); + m_textInsert->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); } if (m_combobox->GetSelection() >= 0) @@ -620,7 +620,7 @@ void ODComboboxWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) if ( !m_textAdd->IsModified() ) { // update the default string - m_textAdd->SetValue(wxString::Format(_T("test item %u"), ++s_item)); + m_textAdd->SetValue(wxString::Format(wxT("test item %u"), ++s_item)); } m_combobox->Append(s); @@ -631,15 +631,15 @@ void ODComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event)) // "many" means 1000 here for ( unsigned int n = 0; n < 1000; n++ ) { - m_combobox->Append(wxString::Format(_T("item #%u"), n)); + m_combobox->Append(wxString::Format(wxT("item #%u"), n)); } } void ODComboboxWidgetsPage::OnButtonAddSeveral(wxCommandEvent& WXUNUSED(event)) { - m_combobox->Append(_T("First")); - m_combobox->Append(_T("another one")); - m_combobox->Append(_T("and the last (very very very very very very very very very very long) one")); + m_combobox->Append(wxT("First")); + m_combobox->Append(wxT("another one")); + m_combobox->Append(wxT("and the last (very very very very very very very very very very long) one")); } void ODComboboxWidgetsPage::OnTextPopupWidth(wxCommandEvent& WXUNUSED(event)) @@ -695,13 +695,13 @@ void ODComboboxWidgetsPage::OnTextButtonAll(wxCommandEvent& WXUNUSED(event)) void ODComboboxWidgetsPage::OnUpdateUICurText(wxUpdateUIEvent& event) { if (m_combobox) - event.SetText( wxString::Format(_T("%d"), m_combobox->GetSelection()) ); + event.SetText( wxString::Format(wxT("%d"), m_combobox->GetSelection()) ); } void ODComboboxWidgetsPage::OnUpdateUIInsertionPointText(wxUpdateUIEvent& event) { if (m_combobox) - event.SetText( wxString::Format(_T("%ld"), m_combobox->GetInsertionPoint()) ); + event.SetText( wxString::Format(wxT("%ld"), m_combobox->GetInsertionPoint()) ); } void ODComboboxWidgetsPage::OnUpdateUIResetButton(wxUpdateUIEvent& event) @@ -758,26 +758,26 @@ void ODComboboxWidgetsPage::OnComboText(wxCommandEvent& event) wxString s = event.GetString(); wxASSERT_MSG( s == m_combobox->GetValue(), - _T("event and combobox values should be the same") ); + wxT("event and combobox values should be the same") ); if (event.GetEventType() == wxEVT_COMMAND_TEXT_ENTER) { - wxLogMessage(_T("OwnerDrawnCombobox enter pressed (now '%s')"), s.c_str()); + wxLogMessage(wxT("OwnerDrawnCombobox enter pressed (now '%s')"), s.c_str()); } else { - wxLogMessage(_T("OwnerDrawnCombobox text changed (now '%s')"), s.c_str()); + wxLogMessage(wxT("OwnerDrawnCombobox text changed (now '%s')"), s.c_str()); } } void ODComboboxWidgetsPage::OnComboBox(wxCommandEvent& event) { long sel = event.GetInt(); - m_textDelete->SetValue(wxString::Format(_T("%ld"), sel)); + m_textDelete->SetValue(wxString::Format(wxT("%ld"), sel)); - wxLogMessage(_T("OwnerDrawnCombobox item %ld selected"), sel); + wxLogMessage(wxT("OwnerDrawnCombobox item %ld selected"), sel); - wxLogMessage(_T("OwnerDrawnCombobox GetValue(): %s"), m_combobox->GetValue().c_str() ); + wxLogMessage(wxT("OwnerDrawnCombobox GetValue(): %s"), m_combobox->GetValue().c_str() ); } void ODComboboxWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& event) diff --git a/samples/widgets/radiobox.cpp b/samples/widgets/radiobox.cpp index ae54443838..46e165ec15 100644 --- a/samples/widgets/radiobox.cpp +++ b/samples/widgets/radiobox.cpp @@ -182,7 +182,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, _T("Radio"), +IMPLEMENT_WIDGETS_PAGE(RadioWidgetsPage, wxT("Radio"), FAMILY_CTRLS | WITH_ITEMS_CTRLS ); @@ -209,7 +209,7 @@ void RadioWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); @@ -221,12 +221,12 @@ void RadioWidgetsPage::CreateContent() static const wxString layoutDir[] = { - _T("default"), - _T("left to right"), - _T("top to bottom") + wxT("default"), + wxT("left to right"), + wxT("top to bottom") }; - m_radioDir = new wxRadioBox(this, wxID_ANY, _T("Numbering:"), + m_radioDir = new wxRadioBox(this, wxID_ANY, wxT("Numbering:"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(layoutDir), layoutDir, 1, wxRA_SPECIFY_COLS); @@ -238,57 +238,57 @@ void RadioWidgetsPage::CreateContent() #endif // wxRA_LEFTTORIGHT wxSizer *sizerRow; - sizerRow = CreateSizerWithTextAndLabel(_T("&Major dimension:"), + sizerRow = CreateSizerWithTextAndLabel(wxT("&Major dimension:"), wxID_ANY, &m_textMajorDim); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); - sizerRow = CreateSizerWithTextAndLabel(_T("&Number of buttons:"), + sizerRow = CreateSizerWithTextAndLabel(wxT("&Number of buttons:"), wxID_ANY, &m_textNumBtns); sizerLeft->Add(sizerRow, 0, wxGROW | wxALL, 5); wxButton *btn; - btn = new wxButton(this, RadioPage_Update, _T("&Update")); + btn = new wxButton(this, RadioPage_Update, wxT("&Update")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 5); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - btn = new wxButton(this, RadioPage_Reset, _T("&Reset")); + btn = new wxButton(this, RadioPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change parameters")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change parameters")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); - sizerRow = CreateSizerWithTextAndLabel(_T("Current selection:"), + sizerRow = CreateSizerWithTextAndLabel(wxT("Current selection:"), wxID_ANY, &m_textCurSel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_Selection, - _T("&Change selection:"), + wxT("&Change selection:"), wxID_ANY, &m_textSel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_Label, - _T("&Label for box:"), + wxT("&Label for box:"), wxID_ANY, &m_textLabel); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); sizerRow = CreateSizerWithTextAndButton(RadioPage_LabelBtn, - _T("&Label for buttons:"), + wxT("&Label for buttons:"), wxID_ANY, &m_textLabelBtns); sizerMiddle->Add(sizerRow, 0, wxGROW | wxALL, 5); m_chkEnableItem = CreateCheckBoxAndAddToSizer(sizerMiddle, - _T("Disable &2nd item"), + wxT("Disable &2nd item"), RadioPage_EnableItem); m_chkShowItem = CreateCheckBoxAndAddToSizer(sizerMiddle, - _T("Hide 2nd &item"), + wxT("Hide 2nd &item"), RadioPage_ShowItem); // right pane @@ -314,10 +314,10 @@ void RadioWidgetsPage::CreateContent() void RadioWidgetsPage::Reset() { - m_textMajorDim->SetValue(wxString::Format(_T("%u"), DEFAULT_MAJOR_DIM)); - m_textNumBtns->SetValue(wxString::Format(_T("%u"), DEFAULT_NUM_ENTRIES)); - m_textLabel->SetValue(_T("I'm a radiobox")); - m_textLabelBtns->SetValue(_T("item")); + m_textMajorDim->SetValue(wxString::Format(wxT("%u"), DEFAULT_MAJOR_DIM)); + m_textNumBtns->SetValue(wxString::Format(wxT("%u"), DEFAULT_NUM_ENTRIES)); + m_textLabel->SetValue(wxT("I'm a radiobox")); + m_textLabelBtns->SetValue(wxT("item")); m_chkSpecifyRows->SetValue(false); m_chkEnableItem->SetValue(true); @@ -344,7 +344,7 @@ void RadioWidgetsPage::CreateRadio() unsigned long count; if ( !m_textNumBtns->GetValue().ToULong(&count) ) { - wxLogWarning(_T("Should have a valid number for number of items.")); + wxLogWarning(wxT("Should have a valid number for number of items.")); // fall back to default count = DEFAULT_NUM_ENTRIES; @@ -353,7 +353,7 @@ void RadioWidgetsPage::CreateRadio() unsigned long majorDim; if ( !m_textMajorDim->GetValue().ToULong(&majorDim) ) { - wxLogWarning(_T("Should have a valid major dimension number.")); + wxLogWarning(wxT("Should have a valid major dimension number.")); // fall back to default majorDim = DEFAULT_MAJOR_DIM; @@ -364,7 +364,7 @@ void RadioWidgetsPage::CreateRadio() wxString labelBtn = m_textLabelBtns->GetValue(); for ( size_t n = 0; n < count; n++ ) { - items[n] = wxString::Format(_T("%s %lu"), + items[n] = wxString::Format(wxT("%s %lu"), labelBtn.c_str(), (unsigned long)n + 1); } @@ -377,7 +377,7 @@ void RadioWidgetsPage::CreateRadio() switch ( m_radioDir->GetSelection() ) { default: - wxFAIL_MSG( _T("unexpected wxRadioBox layout direction") ); + wxFAIL_MSG( wxT("unexpected wxRadioBox layout direction") ); // fall through case RadioDir_Default: @@ -436,12 +436,12 @@ void RadioWidgetsPage::OnRadioBox(wxCommandEvent& event) int event_sel = event.GetSelection(); wxUnusedVar(event_sel); - wxLogMessage(_T("Radiobox selection changed, now %d"), sel); + wxLogMessage(wxT("Radiobox selection changed, now %d"), sel); wxASSERT_MSG( sel == event_sel, - _T("selection should be the same in event and radiobox") ); + wxT("selection should be the same in event and radiobox") ); - m_textCurSel->SetValue(wxString::Format(_T("%d"), sel)); + m_textCurSel->SetValue(wxString::Format(wxT("%d"), sel)); } void RadioWidgetsPage::OnButtonRecreate(wxCommandEvent& WXUNUSED(event)) @@ -460,7 +460,7 @@ void RadioWidgetsPage::OnButtonSelection(wxCommandEvent& WXUNUSED(event)) if ( !m_textSel->GetValue().ToULong(&sel) || (sel >= (size_t)m_radio->GetCount()) ) { - wxLogWarning(_T("Invalid number specified as new selection.")); + wxLogWarning(wxT("Invalid number specified as new selection.")); } else { @@ -518,14 +518,14 @@ void RadioWidgetsPage::OnUpdateUIReset(wxUpdateUIEvent& event) void RadioWidgetsPage::OnUpdateUIEnableItem(wxUpdateUIEvent& event) { - event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? _T("Disable &2nd item") - : _T("Enable &2nd item")); + event.SetText(m_radio->IsItemEnabled(TEST_BUTTON) ? wxT("Disable &2nd item") + : wxT("Enable &2nd item")); } void RadioWidgetsPage::OnUpdateUIShowItem(wxUpdateUIEvent& event) { - event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? _T("Hide 2nd &item") - : _T("Show 2nd &item")); + event.SetText(m_radio->IsItemShown(TEST_BUTTON) ? wxT("Hide 2nd &item") + : wxT("Show 2nd &item")); } #endif // wxUSE_RADIOBOX diff --git a/samples/widgets/searchctrl.cpp b/samples/widgets/searchctrl.cpp index e87c599f08..3c5bb3956a 100644 --- a/samples/widgets/searchctrl.cpp +++ b/samples/widgets/searchctrl.cpp @@ -123,7 +123,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS GENERIC_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, _T("SearchCtrl"), +IMPLEMENT_WIDGETS_PAGE(SearchCtrlWidgetsPage, wxT("SearchCtrl"), FAMILY_CTRLS | EDITABLE_CTRLS | ALL_CTRLS); SearchCtrlWidgetsPage::SearchCtrlWidgetsPage(WidgetsBookCtrl *book, @@ -181,7 +181,7 @@ wxMenu* SearchCtrlWidgetsPage::CreateTestMenu() { wxMenu* menu = new wxMenu; const int SEARCH_MENU_SIZE = 5; - wxMenuItem* menuItem = menu->Append(wxID_ANY, _T("Recent Searches"), wxT(""), wxITEM_NORMAL); + wxMenuItem* menuItem = menu->Append(wxID_ANY, wxT("Recent Searches"), wxT(""), wxITEM_NORMAL); menuItem->Enable(false); for ( int i = 0; i < SEARCH_MENU_SIZE; i++ ) { diff --git a/samples/widgets/slider.cpp b/samples/widgets/slider.cpp index cf2af01598..a30bacfa73 100644 --- a/samples/widgets/slider.cpp +++ b/samples/widgets/slider.cpp @@ -226,7 +226,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, _T("Slider"), FAMILY_CTRLS ); +IMPLEMENT_WIDGETS_PAGE(SliderWidgetsPage, wxT("Slider"), FAMILY_CTRLS ); SliderWidgetsPage::SliderWidgetsPage(WidgetsBookCtrl *book, wxImageList *imaglist) @@ -252,41 +252,41 @@ void SliderWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Inverse")); - m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Show &ticks")); - m_chkLabels = CreateCheckBoxAndAddToSizer(sizerLeft, _T("Show &labels")); + m_chkInverse = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Inverse")); + m_chkTicks = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &ticks")); + m_chkLabels = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("Show &labels")); static const wxString sides[] = { - _T("top"), - _T("bottom"), - _T("left"), - _T("right"), + wxT("top"), + wxT("bottom"), + wxT("left"), + wxT("right"), }; - m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, _T("&Ticks/Labels"), + m_radioSides = new wxRadioBox(this, SliderPage_RadioSides, wxT("&Ticks/Labels"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(sides), sides, 1, wxRA_SPECIFY_COLS); sizerLeft->Add(m_radioSides, 0, wxGROW | wxALL, 5); m_chkBothSides = CreateCheckBoxAndAddToSizer - (sizerLeft, _T("&Both sides"), SliderPage_BothSides); + (sizerLeft, wxT("&Both sides"), SliderPage_BothSides); #if wxUSE_TOOLTIPS - m_chkBothSides->SetToolTip( _T("\"Both sides\" is only supported \nin Win95 and Universal") ); + m_chkBothSides->SetToolTip( wxT("\"Both sides\" is only supported \nin Win95 and Universal") ); #endif // wxUSE_TOOLTIPS sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, SliderPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, SliderPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change slider value")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change slider value")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"), + wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"), SliderPage_CurValueText, &text); text->SetEditable(false); @@ -294,49 +294,49 @@ void SliderWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetValue, - _T("Set &value"), + wxT("Set &value"), SliderPage_ValueText, &m_textValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetMinAndMax, - _T("&Min and max"), + wxT("&Min and max"), SliderPage_MinText, &m_textMin); m_textMax = new wxTextCtrl(this, SliderPage_MaxText, wxEmptyString); sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5); - m_textMin->SetValue( wxString::Format(_T("%d"), m_min) ); - m_textMax->SetValue( wxString::Format(_T("%d"), m_max) ); + m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) ); + m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) ); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetLineSize, - _T("Li&ne size"), + wxT("Li&ne size"), SliderPage_LineSizeText, &m_textLineSize); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetPageSize, - _T("P&age size"), + wxT("P&age size"), SliderPage_PageSizeText, &m_textPageSize); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetTickFreq, - _T("Tick &frequency"), + wxT("Tick &frequency"), SliderPage_TickFreqText, &m_textTickFreq); - m_textTickFreq->SetValue(_T("10")); + m_textTickFreq->SetValue(wxT("10")); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SliderPage_SetThumbLen, - _T("Thumb &length"), + wxT("Thumb &length"), SliderPage_ThumbLenText, &m_textThumbLen); @@ -350,8 +350,8 @@ void SliderWidgetsPage::CreateContent() Reset(); CreateSlider(); - m_textLineSize->SetValue(wxString::Format(_T("%d"), m_slider->GetLineSize())); - m_textPageSize->SetValue(wxString::Format(_T("%d"), m_slider->GetPageSize())); + m_textLineSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetLineSize())); + m_textPageSize->SetValue(wxString::Format(wxT("%d"), m_slider->GetPageSize())); // the 3 panes panes compose the window sizerTop->Add(sizerLeft, 0, wxGROW | (wxALL & ~wxLEFT), 10); @@ -414,7 +414,7 @@ void SliderWidgetsPage::CreateSlider() break; default: - wxFAIL_MSG(_T("unexpected radiobox selection")); + wxFAIL_MSG(wxT("unexpected radiobox selection")); // fall through } @@ -473,7 +473,7 @@ void SliderWidgetsPage::DoSetLineSize() long lineSize; if ( !m_textLineSize->GetValue().ToLong(&lineSize) ) { - wxLogWarning(_T("Invalid slider line size")); + wxLogWarning(wxT("Invalid slider line size")); return; } @@ -482,7 +482,7 @@ void SliderWidgetsPage::DoSetLineSize() if ( m_slider->GetLineSize() != lineSize ) { - wxLogWarning(_T("Invalid line size in slider.")); + wxLogWarning(wxT("Invalid line size in slider.")); } } @@ -491,7 +491,7 @@ void SliderWidgetsPage::DoSetPageSize() long pageSize; if ( !m_textPageSize->GetValue().ToLong(&pageSize) ) { - wxLogWarning(_T("Invalid slider page size")); + wxLogWarning(wxT("Invalid slider page size")); return; } @@ -500,7 +500,7 @@ void SliderWidgetsPage::DoSetPageSize() if ( m_slider->GetPageSize() != pageSize ) { - wxLogWarning(_T("Invalid page size in slider.")); + wxLogWarning(wxT("Invalid page size in slider.")); } } @@ -509,7 +509,7 @@ void SliderWidgetsPage::DoSetTickFreq() long freq; if ( !m_textTickFreq->GetValue().ToLong(&freq) ) { - wxLogWarning(_T("Invalid slider tick frequency")); + wxLogWarning(wxT("Invalid slider tick frequency")); return; } @@ -522,7 +522,7 @@ void SliderWidgetsPage::DoSetThumbLen() long len; if ( !m_textThumbLen->GetValue().ToLong(&len) ) { - wxLogWarning(_T("Invalid slider thumb length")); + wxLogWarning(wxT("Invalid slider thumb length")); return; } @@ -569,7 +569,7 @@ void SliderWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event)) !m_textMax->GetValue().ToLong(&maxNew) || minNew >= maxNew ) { - wxLogWarning(_T("Invalid min/max values for the slider.")); + wxLogWarning(wxT("Invalid min/max values for the slider.")); return; } @@ -582,7 +582,7 @@ void SliderWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event)) if ( m_slider->GetMin() != m_min || m_slider->GetMax() != m_max ) { - wxLogWarning(_T("Invalid range in slider.")); + wxLogWarning(wxT("Invalid range in slider.")); } } @@ -591,7 +591,7 @@ void SliderWidgetsPage::OnButtonSetValue(wxCommandEvent& WXUNUSED(event)) long val; if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) ) { - wxLogWarning(_T("Invalid slider value.")); + wxLogWarning(wxT("Invalid slider value.")); return; } @@ -657,7 +657,7 @@ void SliderWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void SliderWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(_T("%d"), m_slider->GetValue()) ); + event.SetText( wxString::Format(wxT("%d"), m_slider->GetValue()) ); } void SliderWidgetsPage::OnUpdateUIRadioSides(wxUpdateUIEvent& event) diff --git a/samples/widgets/spinbtn.cpp b/samples/widgets/spinbtn.cpp index ec4b310301..347b1039c1 100644 --- a/samples/widgets/spinbtn.cpp +++ b/samples/widgets/spinbtn.cpp @@ -196,7 +196,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, _T("Spin"), +IMPLEMENT_WIDGETS_PAGE(SpinBtnWidgetsPage, wxT("Spin"), FAMILY_CTRLS | EDITABLE_CTRLS ); @@ -227,25 +227,25 @@ void SpinBtnWidgetsPage::CreateContent() wxSizer *sizerTop = new wxBoxSizer(wxHORIZONTAL); // left pane - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set style")); + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set style")); wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); - m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Vertical")); - m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Arrow Keys")); - m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Wrap")); + m_chkVert = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Vertical")); + m_chkArrowKeys = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Arrow Keys")); + m_chkWrap = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Wrap")); m_chkProcessEnter = CreateCheckBoxAndAddToSizer(sizerLeft, - _T("Process &Enter")); + wxT("Process &Enter")); sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer static const wxString halign[] = { - _T("left"), - _T("centre"), - _T("right"), + wxT("left"), + wxT("centre"), + wxT("right"), }; - m_radioAlign = new wxRadioBox(this, wxID_ANY, _T("&Text alignment"), + m_radioAlign = new wxRadioBox(this, wxID_ANY, wxT("&Text alignment"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign, 1); @@ -253,17 +253,17 @@ void SpinBtnWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - wxButton *btn = new wxButton(this, SpinBtnPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, SpinBtnPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, - _T("&Change spinbtn value")); + wxT("&Change spinbtn value")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxTextCtrl *text; - wxSizer *sizerRow = CreateSizerWithTextAndLabel(_T("Current value"), + wxSizer *sizerRow = CreateSizerWithTextAndLabel(wxT("Current value"), SpinBtnPage_CurValueText, &text); text->SetEditable(false); @@ -271,21 +271,21 @@ void SpinBtnWidgetsPage::CreateContent() sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetValue, - _T("Set &value"), + wxT("Set &value"), SpinBtnPage_ValueText, &m_textValue); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); sizerRow = CreateSizerWithTextAndButton(SpinBtnPage_SetMinAndMax, - _T("&Min and max"), + wxT("&Min and max"), SpinBtnPage_MinText, &m_textMin); m_textMax = new wxTextCtrl(this, SpinBtnPage_MaxText, wxEmptyString); sizerRow->Add(m_textMax, 1, wxLEFT | wxALIGN_CENTRE_VERTICAL, 5); - m_textMin->SetValue( wxString::Format(_T("%d"), m_min) ); - m_textMax->SetValue( wxString::Format(_T("%d"), m_max) ); + m_textMin->SetValue( wxString::Format(wxT("%d"), m_min) ); + m_textMax->SetValue( wxString::Format(wxT("%d"), m_max) ); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); @@ -342,7 +342,7 @@ void SpinBtnWidgetsPage::CreateSpin() switch ( m_radioAlign->GetSelection() ) { default: - wxFAIL_MSG(_T("unexpected radiobox selection")); + wxFAIL_MSG(wxT("unexpected radiobox selection")); // fall through case Align_Left: @@ -378,13 +378,13 @@ void SpinBtnWidgetsPage::CreateSpin() m_spinbtn->SetRange(m_min, m_max); m_spinctrl = new wxSpinCtrl(this, SpinBtnPage_SpinCtrl, - wxString::Format(_T("%d"), val), + wxString::Format(wxT("%d"), val), wxDefaultPosition, wxDefaultSize, flags | textFlags, m_min, m_max, val); m_spinctrldbl = new wxSpinCtrlDouble(this, SpinBtnPage_SpinCtrlDouble, - wxString::Format(_T("%d"), val), + wxString::Format(wxT("%d"), val), wxDefaultPosition, wxDefaultSize, flags | textFlags, m_min, m_max, val, 0.1); @@ -426,7 +426,7 @@ void SpinBtnWidgetsPage::OnButtonSetMinAndMax(wxCommandEvent& WXUNUSED(event)) !m_textMax->GetValue().ToLong(&maxNew) || minNew > maxNew ) { - wxLogWarning(_T("Invalid min/max values for the spinbtn.")); + wxLogWarning(wxT("Invalid min/max values for the spinbtn.")); return; } @@ -444,7 +444,7 @@ void SpinBtnWidgetsPage::OnButtonSetValue(wxCommandEvent& WXUNUSED(event)) long val; if ( !m_textValue->GetValue().ToLong(&val) || !IsValidValue(val) ) { - wxLogWarning(_T("Invalid spinbtn value.")); + wxLogWarning(wxT("Invalid spinbtn value.")); return; } @@ -482,7 +482,7 @@ void SpinBtnWidgetsPage::OnCheckOrRadioBox(wxCommandEvent& WXUNUSED(event)) void SpinBtnWidgetsPage::OnUpdateUICurValueText(wxUpdateUIEvent& event) { - event.SetText( wxString::Format(_T("%d"), m_spinbtn->GetValue())); + event.SetText( wxString::Format(wxT("%d"), m_spinbtn->GetValue())); } void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event) @@ -490,20 +490,20 @@ void SpinBtnWidgetsPage::OnSpinBtn(wxSpinEvent& event) int value = event.GetInt(); wxASSERT_MSG( value == m_spinbtn->GetValue(), - _T("spinbtn value should be the same") ); + wxT("spinbtn value should be the same") ); - wxLogMessage(_T("Spin button value changed, now %d"), value); + wxLogMessage(wxT("Spin button value changed, now %d"), value); } void SpinBtnWidgetsPage::OnSpinBtnUp(wxSpinEvent& event) { - wxLogMessage( _T("Spin button value incremented, will be %d (was %d)"), + wxLogMessage( wxT("Spin button value incremented, will be %d (was %d)"), event.GetInt(), m_spinbtn->GetValue() ); } void SpinBtnWidgetsPage::OnSpinBtnDown(wxSpinEvent& event) { - wxLogMessage( _T("Spin button value decremented, will be %d (was %d)"), + wxLogMessage( wxT("Spin button value decremented, will be %d (was %d)"), event.GetInt(), m_spinbtn->GetValue() ); } @@ -512,21 +512,21 @@ void SpinBtnWidgetsPage::OnSpinCtrl(wxSpinEvent& event) int value = event.GetInt(); wxASSERT_MSG( value == m_spinctrl->GetValue(), - _T("spinctrl value should be the same") ); + wxT("spinctrl value should be the same") ); - wxLogMessage(_T("Spin control value changed, now %d"), value); + wxLogMessage(wxT("Spin control value changed, now %d"), value); } void SpinBtnWidgetsPage::OnSpinCtrlDouble(wxSpinDoubleEvent& event) { double value = event.GetValue(); - wxLogMessage(_T("Spin control value changed, now %g"), value); + wxLogMessage(wxT("Spin control value changed, now %g"), value); } void SpinBtnWidgetsPage::OnSpinText(wxCommandEvent& event) { - wxLogMessage(_T("Text changed in spin control, now \"%s\""), + wxLogMessage(wxT("Text changed in spin control, now \"%s\""), event.GetString().c_str()); } diff --git a/samples/widgets/static.cpp b/samples/widgets/static.cpp index ba433d749b..62cf99b561 100644 --- a/samples/widgets/static.cpp +++ b/samples/widgets/static.cpp @@ -167,7 +167,7 @@ END_EVENT_TABLE() // implementation // ============================================================================ -IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, _T("Static"), +IMPLEMENT_WIDGETS_PAGE(StaticWidgetsPage, wxT("Static"), (int)wxPlatform(GENERIC_CTRLS).If(wxOS_WINDOWS,NATIVE_CTRLS) ); @@ -211,22 +211,22 @@ void StaticWidgetsPage::CreateContent() static const wxString halign[] = { - _T("left"), - _T("centre"), - _T("right"), + wxT("left"), + wxT("centre"), + wxT("right"), }; static const wxString valign[] = { - _T("top"), - _T("centre"), - _T("bottom"), + wxT("top"), + wxT("centre"), + wxT("bottom"), }; - m_radioHAlign = new wxRadioBox(this, wxID_ANY, _T("&Horz alignment"), + m_radioHAlign = new wxRadioBox(this, wxID_ANY, wxT("&Horz alignment"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(halign), halign, 3); - m_radioVAlign = new wxRadioBox(this, wxID_ANY, _T("&Vert alignment"), + m_radioVAlign = new wxRadioBox(this, wxID_ANY, wxT("&Vert alignment"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(valign), valign, 3); @@ -236,23 +236,23 @@ void StaticWidgetsPage::CreateContent() sizerLeft->Add(5, 5, 0, wxGROW | wxALL, 5); // spacer - m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, _T("&Ellipsize")); + m_chkEllipsize = CreateCheckBoxAndAddToSizer(sizerLeft, wxT("&Ellipsize")); static const wxString ellipsizeMode[] = { - _T("&start"), - _T("&middle"), - _T("&end"), + wxT("&start"), + wxT("&middle"), + wxT("&end"), }; - m_radioEllipsize = new wxRadioBox(this, wxID_ANY, _T("&Ellipsize mode"), + m_radioEllipsize = new wxRadioBox(this, wxID_ANY, wxT("&Ellipsize mode"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(ellipsizeMode), ellipsizeMode, 3); sizerLeft->Add(m_radioEllipsize, 0, wxGROW | wxALL, 5); - wxButton *btn = new wxButton(this, StaticPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, StaticPage_Reset, wxT("&Reset")); sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane @@ -296,13 +296,13 @@ void StaticWidgetsPage::CreateContent() // NB: must be done _before_ calling CreateStatic() Reset(); - m_textBox->SetValue(_T("This is a box")); - m_textLabel->SetValue(_T("And this is a\n\tlabel inside the box with a &mnemonic.\n") - _T("Only this text is affected by the ellipsize settings.")); - m_textLabelWithMarkup->SetValue(_T("Another label, this time decorated ") - _T("with markup; here you need entities ") - _T("for the symbols: < > & ' " ") - _T(" but you can still place &mnemonics...")); + m_textBox->SetValue(wxT("This is a box")); + m_textLabel->SetValue(wxT("And this is a\n\tlabel inside the box with a &mnemonic.\n") + wxT("Only this text is affected by the ellipsize settings.")); + m_textLabelWithMarkup->SetValue(wxT("Another label, this time decorated ") + wxT("with markup; here you need entities ") + wxT("for the symbols: < > & ' " ") + wxT(" but you can still place &mnemonics...")); // right pane wxSizer *sizerRight = new wxBoxSizer(wxHORIZONTAL); @@ -370,7 +370,7 @@ void StaticWidgetsPage::CreateStatic() switch ( m_radioHAlign->GetSelection() ) { default: - wxFAIL_MSG(_T("unexpected radiobox selection")); + wxFAIL_MSG(wxT("unexpected radiobox selection")); // fall through case StaticHAlign_Left: @@ -389,7 +389,7 @@ void StaticWidgetsPage::CreateStatic() switch ( m_radioVAlign->GetSelection() ) { default: - wxFAIL_MSG(_T("unexpected radiobox selection")); + wxFAIL_MSG(wxT("unexpected radiobox selection")); // fall through case StaticVAlign_Top: @@ -410,7 +410,7 @@ void StaticWidgetsPage::CreateStatic() switch ( m_radioEllipsize->GetSelection() ) { default: - wxFAIL_MSG(_T("unexpected radiobox selection")); + wxFAIL_MSG(wxT("unexpected radiobox selection")); // fall through case StaticEllipsize_Start: diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index f0ad274d1b..4a7c0dd659 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -263,32 +263,32 @@ protected: switch ( HitTest(event.GetPosition(), &x, &y) ) { default: - wxFAIL_MSG( _T("unexpected HitTest() result") ); + wxFAIL_MSG( wxT("unexpected HitTest() result") ); // fall through case wxTE_HT_UNKNOWN: x = y = -1; - where = _T("nowhere near"); + where = wxT("nowhere near"); break; case wxTE_HT_BEFORE: - where = _T("before"); + where = wxT("before"); break; case wxTE_HT_BELOW: - where = _T("below"); + where = wxT("below"); break; case wxTE_HT_BEYOND: - where = _T("beyond"); + where = wxT("beyond"); break; case wxTE_HT_ON_TEXT: - where = _T("at"); + where = wxT("at"); break; } - wxLogMessage(_T("Mouse is %s (%ld, %ld)"), where.c_str(), x, y); + wxLogMessage(wxT("Mouse is %s (%ld, %ld)"), where.c_str(), x, y); event.Skip(); } @@ -344,7 +344,7 @@ END_EVENT_TABLE() #define FAMILY_CTRLS NATIVE_CTRLS #endif -IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, _T("Text"), +IMPLEMENT_WIDGETS_PAGE(TextWidgetsPage, wxT("Text"), FAMILY_CTRLS | EDITABLE_CTRLS ); @@ -389,12 +389,12 @@ void TextWidgetsPage::CreateContent() // left pane static const wxString modes[] = { - _T("single line"), - _T("multi line"), + wxT("single line"), + wxT("multi line"), }; - wxStaticBox *box = new wxStaticBox(this, wxID_ANY, _T("&Set textctrl parameters")); - m_radioTextLines = new wxRadioBox(this, wxID_ANY, _T("&Number of lines:"), + wxStaticBox *box = new wxStaticBox(this, wxID_ANY, wxT("&Set textctrl parameters")); + m_radioTextLines = new wxRadioBox(this, wxID_ANY, wxT("&Number of lines:"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(modes), modes, 1, wxRA_SPECIFY_COLS); @@ -405,26 +405,26 @@ void TextWidgetsPage::CreateContent() sizerLeft->AddSpacer(5); m_chkPassword = CreateCheckBoxAndAddToSizer( - sizerLeft, _T("&Password control"), TextPage_Password + sizerLeft, wxT("&Password control"), TextPage_Password ); m_chkReadonly = CreateCheckBoxAndAddToSizer( - sizerLeft, _T("&Read-only mode") + sizerLeft, wxT("&Read-only mode") ); m_chkFilename = CreateCheckBoxAndAddToSizer( - sizerLeft, _T("&Filename control") + sizerLeft, wxT("&Filename control") ); m_chkFilename->Disable(); // not implemented yet sizerLeft->AddSpacer(5); static const wxString wrap[] = { - _T("no wrap"), - _T("word wrap"), - _T("char wrap"), - _T("best wrap"), + wxT("no wrap"), + wxT("word wrap"), + wxT("char wrap"), + wxT("best wrap"), }; - m_radioWrap = new wxRadioBox(this, wxID_ANY, _T("&Wrap style:"), + m_radioWrap = new wxRadioBox(this, wxID_ANY, wxT("&Wrap style:"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(wrap), wrap, 1, wxRA_SPECIFY_COLS); @@ -433,12 +433,12 @@ void TextWidgetsPage::CreateContent() #ifdef __WXMSW__ static const wxString kinds[] = { - _T("plain edit"), - _T("rich edit"), - _T("rich edit 2.0"), + wxT("plain edit"), + wxT("rich edit"), + wxT("rich edit 2.0"), }; - m_radioKind = new wxRadioBox(this, wxID_ANY, _T("Control &kind"), + m_radioKind = new wxRadioBox(this, wxID_ANY, wxT("Control &kind"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(kinds), kinds, 1, wxRA_SPECIFY_COLS); @@ -447,33 +447,33 @@ void TextWidgetsPage::CreateContent() sizerLeft->Add(m_radioKind, 0, wxGROW | wxALL, 5); #endif // __WXMSW__ - wxButton *btn = new wxButton(this, TextPage_Reset, _T("&Reset")); + wxButton *btn = new wxButton(this, TextPage_Reset, wxT("&Reset")); sizerLeft->Add(2, 2, 0, wxGROW | wxALL, 1); // spacer sizerLeft->Add(btn, 0, wxALIGN_CENTRE_HORIZONTAL | wxALL, 15); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Change contents:")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Change contents:")); wxSizer *sizerMiddleUp = new wxStaticBoxSizer(box2, wxVERTICAL); - btn = new wxButton(this, TextPage_Set, _T("&Set text value")); + btn = new wxButton(this, TextPage_Set, wxT("&Set text value")); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Add, _T("&Append text")); + btn = new wxButton(this, TextPage_Add, wxT("&Append text")); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Insert, _T("&Insert text")); + btn = new wxButton(this, TextPage_Insert, wxT("&Insert text")); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Load, _T("&Load file")); + btn = new wxButton(this, TextPage_Load, wxT("&Load file")); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_Clear, _T("&Clear")); + btn = new wxButton(this, TextPage_Clear, wxT("&Clear")); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - btn = new wxButton(this, TextPage_StreamRedirector, _T("St&ream redirection")); + btn = new wxButton(this, TextPage_StreamRedirector, wxT("St&ream redirection")); sizerMiddleUp->Add(btn, 0, wxALL | wxGROW, 1); - wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, _T("&Info:")); + wxStaticBox *box4 = new wxStaticBox(this, wxID_ANY, wxT("&Info:")); wxSizer *sizerMiddleDown = new wxStaticBoxSizer(box4, wxVERTICAL); m_textPosCur = CreateInfoText(); @@ -483,19 +483,19 @@ void TextWidgetsPage::CreateContent() wxSizer *sizerRow = new wxBoxSizer(wxHORIZONTAL); sizerRow->Add(CreateTextWithLabelSizer ( - _T("Current pos:"), + wxT("Current pos:"), m_textPosCur ), 0, wxRIGHT, 5); sizerRow->Add(CreateTextWithLabelSizer ( - _T("Col:"), + wxT("Col:"), m_textColCur ), 0, wxLEFT | wxRIGHT, 5); sizerRow->Add(CreateTextWithLabelSizer ( - _T("Row:"), + wxT("Row:"), m_textRowCur ), 0, wxLEFT, 5); @@ -507,9 +507,9 @@ void TextWidgetsPage::CreateContent() ( CreateTextWithLabelSizer ( - _T("Number of lines:"), + wxT("Number of lines:"), m_textLineLast, - _T("Last position:"), + wxT("Last position:"), m_textPosLast ), 0, wxALL, 5 @@ -521,9 +521,9 @@ void TextWidgetsPage::CreateContent() ( CreateTextWithLabelSizer ( - _T("Selection: from"), + wxT("Selection: from"), m_textSelFrom, - _T("to"), + wxT("to"), m_textSelTo ), 0, wxALL, 5 @@ -536,7 +536,7 @@ void TextWidgetsPage::CreateContent() ( CreateTextWithLabelSizer ( - _T("Range 10..20:"), + wxT("Range 10..20:"), m_textRange ), 0, wxALL, 5 @@ -547,7 +547,7 @@ void TextWidgetsPage::CreateContent() sizerMiddle->Add(sizerMiddleDown, 1, wxGROW | wxTOP, 5); // right pane - wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, _T("&Text:")); + wxStaticBox *box3 = new wxStaticBox(this, wxID_ANY, wxT("&Text:")); m_sizerText = new wxStaticBoxSizer(box3, wxHORIZONTAL); Reset(); CreateText(); @@ -572,7 +572,7 @@ wxTextCtrl *TextWidgetsPage::CreateInfoText() if ( !s_maxWidth ) { // calc it once only - GetTextExtent(_T("9999999"), &s_maxWidth, NULL); + GetTextExtent(wxT("9999999"), &s_maxWidth, NULL); } wxTextCtrl *text = new wxTextCtrl(this, wxID_ANY, wxEmptyString, @@ -626,7 +626,7 @@ void TextWidgetsPage::CreateText() switch ( m_radioTextLines->GetSelection() ) { default: - wxFAIL_MSG( _T("unexpected lines radio box selection") ); + wxFAIL_MSG( wxT("unexpected lines radio box selection") ); case TextLines_Single: break; @@ -645,7 +645,7 @@ void TextWidgetsPage::CreateText() switch ( m_radioWrap->GetSelection() ) { default: - wxFAIL_MSG( _T("unexpected wrap style radio box selection") ); + wxFAIL_MSG( wxT("unexpected wrap style radio box selection") ); case WrapStyle_None: flags |= wxTE_DONTWRAP; // same as wxHSCROLL @@ -669,7 +669,7 @@ void TextWidgetsPage::CreateText() switch ( m_radioKind->GetSelection() ) { default: - wxFAIL_MSG( _T("unexpected kind radio box selection") ); + wxFAIL_MSG( wxT("unexpected kind radio box selection") ); case TextKind_Plain: break; @@ -694,7 +694,7 @@ void TextWidgetsPage::CreateText() } else { - valueOld = _T("Hello, Universe!"); + valueOld = wxT("Hello, Universe!"); } m_text = new WidgetsTextCtrl(this, TextPage_Textctrl, valueOld, flags); @@ -754,7 +754,7 @@ void TextWidgetsPage::OnIdle(wxIdleEvent& WXUNUSED(event)) if ( m_textLineLast ) { m_textLineLast->SetValue( - wxString::Format(_T("%d"), m_text->GetNumberOfLines()) ); + wxString::Format(wxT("%d"), m_text->GetNumberOfLines()) ); } if ( m_textSelFrom && m_textSelTo ) @@ -799,8 +799,8 @@ void TextWidgetsPage::OnButtonReset(wxCommandEvent& WXUNUSED(event)) void TextWidgetsPage::OnButtonSet(wxCommandEvent& WXUNUSED(event)) { m_text->SetValue(m_text->GetWindowStyle() & wxTE_MULTILINE - ? _T("Here,\nthere and\neverywhere") - : _T("Yellow submarine")); + ? wxT("Here,\nthere and\neverywhere") + : wxT("Yellow submarine")); m_text->SetFocus(); } @@ -809,18 +809,18 @@ void TextWidgetsPage::OnButtonAdd(wxCommandEvent& WXUNUSED(event)) { if ( m_text->GetWindowStyle() & wxTE_MULTILINE ) { - m_text->AppendText(_T("We all live in a\n")); + m_text->AppendText(wxT("We all live in a\n")); } - m_text->AppendText(_T("Yellow submarine")); + m_text->AppendText(wxT("Yellow submarine")); } void TextWidgetsPage::OnButtonInsert(wxCommandEvent& WXUNUSED(event)) { - m_text->WriteText(_T("Is there anybody going to listen to my story")); + m_text->WriteText(wxT("Is there anybody going to listen to my story")); if ( m_text->GetWindowStyle() & wxTE_MULTILINE ) { - m_text->WriteText(_T("\nall about the girl who came to stay")); + m_text->WriteText(wxT("\nall about the girl who came to stay")); } } @@ -834,14 +834,14 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event)) { // search for the file in several dirs where it's likely to be wxPathList pathlist; - pathlist.Add(_T(".")); - pathlist.Add(_T("..")); - pathlist.Add(_T("../../../samples/widgets")); + pathlist.Add(wxT(".")); + pathlist.Add(wxT("..")); + pathlist.Add(wxT("../../../samples/widgets")); - wxString filename = pathlist.FindValidPath(_T("textctrl.cpp")); + wxString filename = pathlist.FindValidPath(wxT("textctrl.cpp")); if ( !filename ) { - wxLogError(_T("File textctrl.cpp not found.")); + wxLogError(wxT("File textctrl.cpp not found.")); } else // load it { @@ -849,12 +849,12 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event)) if ( !m_text->LoadFile(filename) ) { // this is not supposed to happen ... - wxLogError(_T("Error loading file.")); + wxLogError(wxT("Error loading file.")); } else { long elapsed = sw.Time(); - wxLogMessage(_T("Loaded file '%s' in %lu.%us"), + wxLogMessage(wxT("Loaded file '%s' in %lu.%us"), filename.c_str(), elapsed / 1000, (unsigned int) elapsed % 1000); } @@ -901,12 +901,12 @@ void TextWidgetsPage::OnText(wxCommandEvent& WXUNUSED(event)) return; } - wxLogMessage(_T("Text ctrl value changed")); + wxLogMessage(wxT("Text ctrl value changed")); } void TextWidgetsPage::OnTextEnter(wxCommandEvent& event) { - wxLogMessage(_T("Text entered: '%s'"), event.GetString().c_str()); + wxLogMessage(wxT("Text entered: '%s'"), event.GetString().c_str()); event.Skip(); } @@ -919,9 +919,9 @@ void TextWidgetsPage::OnStreamRedirector(wxCommandEvent& WXUNUSED(event)) { #if wxHAS_TEXT_WINDOW_STREAM wxStreamToTextRedirector redirect(m_text); - wxString str( _T("Outputed to cout, appears in wxTextCtrl!") ); + wxString str( wxT("Outputed to cout, appears in wxTextCtrl!") ); wxSTD cout << str << wxSTD endl; #else - wxMessageBox(_T("This wxWidgets build does not support wxStreamToTextRedirector")); + wxMessageBox(wxT("This wxWidgets build does not support wxStreamToTextRedirector")); #endif } diff --git a/samples/widgets/toggle.cpp b/samples/widgets/toggle.cpp index a44b1ff900..8f4f9f8b75 100644 --- a/samples/widgets/toggle.cpp +++ b/samples/widgets/toggle.cpp @@ -132,14 +132,14 @@ void ToggleWidgetsPage::CreateContent() // wxSizer *sizerLeft = new wxStaticBoxSizer(box, wxVERTICAL); // middle pane - wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, _T("&Operations")); + wxStaticBox *box2 = new wxStaticBox(this, wxID_ANY, wxT("&Operations")); wxSizer *sizerMiddle = new wxStaticBoxSizer(box2, wxVERTICAL); wxSizer *sizerRow = CreateSizerWithTextAndButton(TogglePage_ChangeLabel, - _T("Change label"), + wxT("Change label"), wxID_ANY, &m_textLabel); - m_textLabel->SetValue(_T("&Toggle me!")); + m_textLabel->SetValue(wxT("&Toggle me!")); sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5); diff --git a/samples/widgets/widgets.cpp b/samples/widgets/widgets.cpp index 0551340bdd..eeb9041ff7 100644 --- a/samples/widgets/widgets.cpp +++ b/samples/widgets/widgets.cpp @@ -326,26 +326,26 @@ bool WidgetsApp::OnInit() // this sample side by side and it is useful to see which one is which wxString title; #if defined(__WXUNIVERSAL__) - title = _T("wxUniv/"); + title = wxT("wxUniv/"); #endif #if defined(__WXMSW__) - title += _T("wxMSW"); + title += wxT("wxMSW"); #elif defined(__WXGTK__) - title += _T("wxGTK"); + title += wxT("wxGTK"); #elif defined(__WXMAC__) - title += _T("wxMAC"); + title += wxT("wxMAC"); #elif defined(__WXMOTIF__) - title += _T("wxMOTIF"); + title += wxT("wxMOTIF"); #elif __WXPALMOS5__ - title += _T("wxPALMOS5"); + title += wxT("wxPALMOS5"); #elif __WXPALMOS6__ - title += _T("wxPALMOS6"); + title += wxT("wxPALMOS6"); #else - title += _T("wxWidgets"); + title += wxT("wxWidgets"); #endif - wxFrame *frame = new WidgetsFrame(title + _T(" widgets demo")); + wxFrame *frame = new WidgetsFrame(title + wxT(" widgets demo")); frame->Show(); return true; @@ -376,45 +376,45 @@ WidgetsFrame::WidgetsFrame(const wxString& title) wxMenuBar *mbar = new wxMenuBar; wxMenu *menuWidget = new wxMenu; #if wxUSE_TOOLTIPS - menuWidget->Append(Widgets_SetTooltip, _T("Set &tooltip...\tCtrl-T")); + menuWidget->Append(Widgets_SetTooltip, wxT("Set &tooltip...\tCtrl-T")); menuWidget->AppendSeparator(); #endif // wxUSE_TOOLTIPS - menuWidget->Append(Widgets_SetFgColour, _T("Set &foreground...\tCtrl-F")); - menuWidget->Append(Widgets_SetBgColour, _T("Set &background...\tCtrl-B")); - menuWidget->Append(Widgets_SetFont, _T("Set f&ont...\tCtrl-O")); - menuWidget->AppendCheckItem(Widgets_Enable, _T("&Enable/disable\tCtrl-E")); + menuWidget->Append(Widgets_SetFgColour, wxT("Set &foreground...\tCtrl-F")); + menuWidget->Append(Widgets_SetBgColour, wxT("Set &background...\tCtrl-B")); + menuWidget->Append(Widgets_SetFont, wxT("Set f&ont...\tCtrl-O")); + menuWidget->AppendCheckItem(Widgets_Enable, wxT("&Enable/disable\tCtrl-E")); wxMenu *menuBorders = new wxMenu; - menuBorders->AppendRadioItem(Widgets_BorderDefault, _T("De&fault\tCtrl-Shift-9")); - menuBorders->AppendRadioItem(Widgets_BorderNone, _T("&None\tCtrl-Shift-0")); - menuBorders->AppendRadioItem(Widgets_BorderSimple, _T("&Simple\tCtrl-Shift-1")); - menuBorders->AppendRadioItem(Widgets_BorderDouble, _T("&Double\tCtrl-Shift-2")); - menuBorders->AppendRadioItem(Widgets_BorderStatic, _T("Stati&c\tCtrl-Shift-3")); - menuBorders->AppendRadioItem(Widgets_BorderRaised, _T("&Raised\tCtrl-Shift-4")); - menuBorders->AppendRadioItem(Widgets_BorderSunken, _T("S&unken\tCtrl-Shift-5")); - menuWidget->AppendSubMenu(menuBorders, _T("Set &border")); + menuBorders->AppendRadioItem(Widgets_BorderDefault, wxT("De&fault\tCtrl-Shift-9")); + menuBorders->AppendRadioItem(Widgets_BorderNone, wxT("&None\tCtrl-Shift-0")); + menuBorders->AppendRadioItem(Widgets_BorderSimple, wxT("&Simple\tCtrl-Shift-1")); + menuBorders->AppendRadioItem(Widgets_BorderDouble, wxT("&Double\tCtrl-Shift-2")); + menuBorders->AppendRadioItem(Widgets_BorderStatic, wxT("Stati&c\tCtrl-Shift-3")); + menuBorders->AppendRadioItem(Widgets_BorderRaised, wxT("&Raised\tCtrl-Shift-4")); + menuBorders->AppendRadioItem(Widgets_BorderSunken, wxT("S&unken\tCtrl-Shift-5")); + menuWidget->AppendSubMenu(menuBorders, wxT("Set &border")); menuWidget->AppendSeparator(); menuWidget->AppendCheckItem(Widgets_GlobalBusyCursor, - _T("Toggle &global busy cursor\tCtrl-Shift-U")); + wxT("Toggle &global busy cursor\tCtrl-Shift-U")); menuWidget->AppendCheckItem(Widgets_BusyCursor, - _T("Toggle b&usy cursor\tCtrl-U")); + wxT("Toggle b&usy cursor\tCtrl-U")); menuWidget->AppendSeparator(); - menuWidget->Append(wxID_EXIT, _T("&Quit\tCtrl-Q")); - mbar->Append(menuWidget, _T("&Widget")); + menuWidget->Append(wxID_EXIT, wxT("&Quit\tCtrl-Q")); + mbar->Append(menuWidget, wxT("&Widget")); wxMenu *menuTextEntry = new wxMenu; menuTextEntry->AppendRadioItem(TextEntry_DisableAutoComplete, - _T("&Disable auto-completion")); + wxT("&Disable auto-completion")); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFixed, - _T("Fixed-&list auto-completion")); + wxT("Fixed-&list auto-completion")); menuTextEntry->AppendRadioItem(TextEntry_AutoCompleteFilenames, - _T("&Files names auto-completion")); + wxT("&Files names auto-completion")); menuTextEntry->AppendSeparator(); menuTextEntry->Append(TextEntry_SetHint, "Set help &hint"); - mbar->Append(menuTextEntry, _T("&Text")); + mbar->Append(menuTextEntry, wxT("&Text")); SetMenuBar(mbar); @@ -443,7 +443,7 @@ WidgetsFrame::WidgetsFrame(const wxString& title) // the lower one only has the log listbox and a button to clear it #if USE_LOG wxSizer *sizerDown = new wxStaticBoxSizer( - new wxStaticBox( m_panel, wxID_ANY, _T("&Log window") ), + new wxStaticBox( m_panel, wxID_ANY, wxT("&Log window") ), wxVERTICAL); m_lboxLog = new wxListBox(m_panel, wxID_ANY); @@ -456,11 +456,11 @@ WidgetsFrame::WidgetsFrame(const wxString& title) wxBoxSizer *sizerBtns = new wxBoxSizer(wxHORIZONTAL); wxButton *btn; #if USE_LOG - btn = new wxButton(m_panel, Widgets_ClearLog, _T("Clear &log")); + btn = new wxButton(m_panel, Widgets_ClearLog, wxT("Clear &log")); sizerBtns->Add(btn); sizerBtns->Add(10, 0); // spacer #endif // USE_LOG - btn = new wxButton(m_panel, Widgets_Quit, _T("E&xit")); + btn = new wxButton(m_panel, Widgets_Quit, wxT("E&xit")); sizerBtns->Add(btn); sizerDown->Add(sizerBtns, 0, wxALL | wxALIGN_RIGHT, 5); @@ -572,7 +572,7 @@ void WidgetsFrame::InitBook() } } - GetMenuBar()->Append(menuPages, _T("&Page")); + GetMenuBar()->Append(menuPages, wxT("&Page")); #if USE_ICONS_IN_BOOK m_book->AssignImageList(imageList); @@ -641,7 +641,7 @@ WidgetsPage *WidgetsFrame::CurrentPage() #if !USE_TREEBOOK WidgetsBookCtrl *subBook = wxStaticCast(page, WidgetsBookCtrl); - wxCHECK_MSG( subBook, NULL, _T("no WidgetsBookCtrl?") ); + wxCHECK_MSG( subBook, NULL, wxT("no WidgetsBookCtrl?") ); page = subBook->GetCurrentPage(); #endif // !USE_TREEBOOK @@ -737,13 +737,13 @@ void WidgetsFrame::OnGoToPage(wxCommandEvent& event) void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event)) { - static wxString s_tip = _T("This is a tooltip"); + static wxString s_tip = wxT("This is a tooltip"); wxTextEntryDialog dialog ( this, - _T("Tooltip text (may use \\n, leave empty to remove): "), - _T("Widgets sample"), + wxT("Tooltip text (may use \\n, leave empty to remove): "), + wxT("Widgets sample"), s_tip ); @@ -751,7 +751,7 @@ void WidgetsFrame::OnSetTooltip(wxCommandEvent& WXUNUSED(event)) return; s_tip = dialog.GetValue(); - s_tip.Replace(_T("\\n"), _T("\n")); + s_tip.Replace(wxT("\\n"), wxT("\n")); WidgetsPage *page = CurrentPage(); @@ -789,7 +789,7 @@ void WidgetsFrame::OnSetFgCol(wxCommandEvent& WXUNUSED(event)) ctrl2->Refresh(); } #else - wxLogMessage(_T("Colour selection dialog not available in current build.")); + wxLogMessage(wxT("Colour selection dialog not available in current build.")); #endif } @@ -817,7 +817,7 @@ void WidgetsFrame::OnSetBgCol(wxCommandEvent& WXUNUSED(event)) ctrl2->Refresh(); } #else - wxLogMessage(_T("Colour selection dialog not available in current build.")); + wxLogMessage(wxT("Colour selection dialog not available in current build.")); #endif } @@ -845,7 +845,7 @@ void WidgetsFrame::OnSetFont(wxCommandEvent& WXUNUSED(event)) ctrl2->Refresh(); } #else - wxLogMessage(_T("Font selection dialog not available in current build.")); + wxLogMessage(wxT("Font selection dialog not available in current build.")); #endif } @@ -869,7 +869,7 @@ void WidgetsFrame::OnSetBorder(wxCommandEvent& event) case Widgets_BorderDouble: border = wxBORDER_DOUBLE; break; default: - wxFAIL_MSG( _T("unknown border style") ); + wxFAIL_MSG( wxT("unknown border style") ); // fall through case Widgets_BorderDefault: border = wxBORDER_DEFAULT; break; diff --git a/samples/wizard/wizard.cpp b/samples/wizard/wizard.cpp index d253471f7d..216324d25c 100644 --- a/samples/wizard/wizard.cpp +++ b/samples/wizard/wizard.cpp @@ -128,13 +128,13 @@ public: { m_bitmap = wxBitmap(wiztest2_xpm); - m_checkbox = new wxCheckBox(this, wxID_ANY, _T("&Check me")); + m_checkbox = new wxCheckBox(this, wxID_ANY, wxT("&Check me")); wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); mainSizer->Add( new wxStaticText(this, wxID_ANY, - _T("You need to check the checkbox\n") - _T("below before going to the next page\n")), + wxT("You need to check the checkbox\n") + wxT("below before going to the next page\n")), 0, wxALL, 5 @@ -153,7 +153,7 @@ public: { if ( !m_checkbox->GetValue() ) { - wxMessageBox(_T("Check the checkbox first!"), _T("No way"), + wxMessageBox(wxT("Check the checkbox first!"), wxT("No way"), wxICON_WARNING | wxOK, this); return false; @@ -184,12 +184,12 @@ public: // static wxString choices[] = { "forward", "backward", "both", "neither" }; // The above syntax can cause an internal compiler error with gcc. wxString choices[4]; - choices[0] = _T("forward"); - choices[1] = _T("backward"); - choices[2] = _T("both"); - choices[3] = _T("neither"); + choices[0] = wxT("forward"); + choices[1] = wxT("backward"); + choices[2] = wxT("both"); + choices[3] = wxT("neither"); - m_radio = new wxRadioBox(this, wxID_ANY, _T("Allow to proceed:"), + m_radio = new wxRadioBox(this, wxID_ANY, wxT("Allow to proceed:"), wxDefaultPosition, wxDefaultSize, WXSIZEOF(choices), choices, 1, wxRA_SPECIFY_COLS); @@ -209,7 +209,7 @@ public: // wizard event handlers void OnWizardCancel(wxWizardEvent& event) { - if ( wxMessageBox(_T("Do you really want to cancel?"), _T("Question"), + if ( wxMessageBox(wxT("Do you really want to cancel?"), wxT("Question"), wxICON_QUESTION | wxYES_NO, this) != wxYES ) { // not confirmed @@ -230,7 +230,7 @@ public: if ( !event.GetDirection() && sel == Backward ) return; - wxMessageBox(_T("You can't go there"), _T("Not allowed"), + wxMessageBox(wxT("You can't go there"), wxT("Not allowed"), wxICON_WARNING | wxOK, this); event.Veto(); @@ -257,14 +257,14 @@ public: wxBoxSizer *mainSizer = new wxBoxSizer(wxVERTICAL); mainSizer->Add( - new wxStaticText(this, wxID_ANY, _T("Try checking the box below and\n") - _T("then going back and clearing it")), + new wxStaticText(this, wxID_ANY, wxT("Try checking the box below and\n") + wxT("then going back and clearing it")), 0, // No vertical stretching wxALL, 5 // Border width ); - m_checkbox = new wxCheckBox(this, wxID_ANY, _T("&Skip the next page")); + m_checkbox = new wxCheckBox(this, wxID_ANY, wxT("&Skip the next page")); mainSizer->Add( m_checkbox, 0, // No vertical stretching @@ -275,16 +275,16 @@ public: #if wxUSE_CHECKLISTBOX static const wxChar *aszChoices[] = { - _T("Zeroth"), - _T("First"), - _T("Second"), - _T("Third"), - _T("Fourth"), - _T("Fifth"), - _T("Sixth"), - _T("Seventh"), - _T("Eighth"), - _T("Nineth") + wxT("Zeroth"), + wxT("First"), + wxT("Second"), + wxT("Third"), + wxT("Fourth"), + wxT("Fifth"), + wxT("Sixth"), + wxT("Seventh"), + wxT("Eighth"), + wxT("Nineth") }; m_checklistbox = new wxCheckListBox @@ -368,7 +368,7 @@ bool MyApp::OnInit() if ( !wxApp::OnInit() ) return false; - MyFrame *frame = new MyFrame(_T("wxWizard Sample")); + MyFrame *frame = new MyFrame(wxT("wxWizard Sample")); // and show it (the frames, unlike simple controls, are not shown when // created initially) @@ -383,7 +383,7 @@ bool MyApp::OnInit() // ---------------------------------------------------------------------------- MyWizard::MyWizard(wxFrame *frame, bool useSizer) - : wxWizard(frame,wxID_ANY,_T("Absolutely Useless Wizard"), + : wxWizard(frame,wxID_ANY,wxT("Absolutely Useless Wizard"), wxBitmap(wiztest_xpm),wxDefaultPosition, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { @@ -401,9 +401,9 @@ MyWizard::MyWizard(wxFrame *frame, bool useSizer) m_page1 = new wxWizardPageSimple(this); /* wxStaticText *text = */ new wxStaticText(m_page1, wxID_ANY, - _T("This wizard doesn't help you\nto do anything at all.\n") - _T("\n") - _T("The next pages will present you\nwith more useless controls."), + wxT("This wizard doesn't help you\nto do anything at all.\n") + wxT("\n") + wxT("The next pages will present you\nwith more useless controls."), wxPoint(5,5) ); @@ -437,24 +437,24 @@ MyFrame::MyFrame(const wxString& title) wxDefaultPosition, wxSize(250, 150)) // small frame { wxMenu *menuFile = new wxMenu; - menuFile->Append(Wizard_RunModal, _T("&Run wizard modal...\tCtrl-R")); - menuFile->Append(Wizard_RunNoSizer, _T("Run wizard &without sizer...")); - menuFile->Append(Wizard_RunModeless, _T("Run wizard &modeless...")); + menuFile->Append(Wizard_RunModal, wxT("&Run wizard modal...\tCtrl-R")); + menuFile->Append(Wizard_RunNoSizer, wxT("Run wizard &without sizer...")); + menuFile->Append(Wizard_RunModeless, wxT("Run wizard &modeless...")); menuFile->AppendSeparator(); - menuFile->Append(Wizard_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Wizard_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenu *menuOptions = new wxMenu; - menuOptions->AppendCheckItem(Wizard_LargeWizard, _T("&Scroll Wizard Pages")); - menuOptions->AppendCheckItem(Wizard_ExpandBitmap, _T("Si&ze Bitmap To Page")); + menuOptions->AppendCheckItem(Wizard_LargeWizard, wxT("&Scroll Wizard Pages")); + menuOptions->AppendCheckItem(Wizard_ExpandBitmap, wxT("Si&ze Bitmap To Page")); wxMenu *helpMenu = new wxMenu; - helpMenu->Append(Wizard_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(Wizard_About, wxT("&About...\tF1"), wxT("Show about dialog")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(menuOptions, _T("&Options")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(menuOptions, wxT("&Options")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -473,9 +473,9 @@ void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - wxMessageBox(_T("Demo of wxWizard class\n") - _T("(c) 1999, 2000 Vadim Zeitlin"), - _T("About wxWizard sample"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(wxT("Demo of wxWizard class\n") + wxT("(c) 1999, 2000 Vadim Zeitlin"), + wxT("About wxWizard sample"), wxOK | wxICON_INFORMATION, this); } void MyFrame::OnRunWizard(wxCommandEvent& WXUNUSED(event)) diff --git a/samples/xrc/myframe.cpp b/samples/xrc/myframe.cpp index f27d1d0470..50797d3a91 100644 --- a/samples/xrc/myframe.cpp +++ b/samples/xrc/myframe.cpp @@ -137,12 +137,12 @@ void MyFrame::OnUnloadResourceMenuCommand(wxCommandEvent& WXUNUSED(event)) { if ( wxXmlResource::Get()->Unload(wxT("rc/basicdlg.xrc")) ) { - wxLogMessage(_T("Basic dialog resource has now been unloaded, you ") - _T("won't be able to use it before loading it again")); + wxLogMessage(wxT("Basic dialog resource has now been unloaded, you ") + wxT("won't be able to use it before loading it again")); } else { - wxLogWarning(_T("Failed to unload basic dialog resource")); + wxLogWarning(wxT("Failed to unload basic dialog resource")); } } @@ -150,11 +150,11 @@ void MyFrame::OnReloadResourceMenuCommand(wxCommandEvent& WXUNUSED(event)) { if ( wxXmlResource::Get()->Load(wxT("rc/basicdlg.xrc")) ) { - wxLogStatus(_T("Basic dialog resource has been loaded.")); + wxLogStatus(wxT("Basic dialog resource has been loaded.")); } else { - wxLogError(_T("Failed to load basic dialog resource")); + wxLogError(wxT("Failed to load basic dialog resource")); } } @@ -315,8 +315,8 @@ void MyFrame::OnVariableExpansionToolOrMenuCommand(wxCommandEvent& WXUNUSED(even void MyFrame::OnAboutToolOrMenuCommand(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("This is the about dialog of XML resources demo.\n") - _T("Welcome to %s"), wxVERSION_STRING); + msg.Printf( wxT("This is the about dialog of XML resources demo.\n") + wxT("Welcome to %s"), wxVERSION_STRING); wxMessageBox(msg, _("About XML resources demo"), wxOK | wxICON_INFORMATION, this); } diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index cfeaa264a6..f9cb18352d 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -3438,7 +3438,7 @@ size_t wxAuiNotebook::SetSelection(size_t new_page) void wxAuiNotebook::SetSelectionToWindow(wxWindow *win) { const int idx = m_tabs.GetIdxFromWindow(win); - wxCHECK_RET( idx != wxNOT_FOUND, _T("invalid notebook page") ); + wxCHECK_RET( idx != wxNOT_FOUND, wxT("invalid notebook page") ); // since a tab was clicked, let the parent know that we received @@ -3844,7 +3844,7 @@ void wxAuiNotebook::OnTabEndDrag(wxAuiNotebookEvent& evt) wxAuiTabCtrl* src_tabs = (wxAuiTabCtrl*)evt.GetEventObject(); - wxCHECK_RET( src_tabs, _T("no source object?") ); + wxCHECK_RET( src_tabs, wxT("no source object?") ); src_tabs->SetCursor(wxCursor(wxCURSOR_ARROW)); @@ -3907,7 +3907,7 @@ void wxAuiNotebook::OnTabEndDrag(wxAuiNotebookEvent& evt) // get main index of the page int main_idx = m_tabs.GetIdxFromWindow(src_page); - wxCHECK_RET( main_idx != wxNOT_FOUND, _T("no source page?") ); + wxCHECK_RET( main_idx != wxNOT_FOUND, wxT("no source page?") ); // make a copy of the page info @@ -4305,7 +4305,7 @@ void wxAuiNotebook::OnTabButton(wxAuiNotebookEvent& evt) #endif { int main_idx = m_tabs.GetIdxFromWindow(close_wnd); - wxCHECK_RET( main_idx != wxNOT_FOUND, _T("no page to delete?") ); + wxCHECK_RET( main_idx != wxNOT_FOUND, wxT("no page to delete?") ); DeletePage(main_idx); } diff --git a/src/cocoa/app.mm b/src/cocoa/app.mm index 0f30885ea9..bc8af99d71 100644 --- a/src/cocoa/app.mm +++ b/src/cocoa/app.mm @@ -116,7 +116,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // application (otherwise applications would need to handle it) if ( argc > 1 ) { - static const wxChar *ARG_PSN = _T("-psn_"); + static const wxChar *ARG_PSN = wxT("-psn_"); if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 ) { // remove this argument diff --git a/src/cocoa/bitmap.mm b/src/cocoa/bitmap.mm index b2569b0104..51cbe0fee7 100644 --- a/src/cocoa/bitmap.mm +++ b/src/cocoa/bitmap.mm @@ -520,7 +520,7 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) if([bitmapRep bitsPerPixel]!=bpp) { - wxFAIL_MSG( _T("incorrect bitmap type in wxBitmap::GetRawData()") ); + wxFAIL_MSG( wxT("incorrect bitmap type in wxBitmap::GetRawData()") ); return NULL; } data.m_width = [bitmapRep pixelsWide]; diff --git a/src/cocoa/brush.mm b/src/cocoa/brush.mm index cb0e0330b4..b5934f26c4 100644 --- a/src/cocoa/brush.mm +++ b/src/cocoa/brush.mm @@ -202,19 +202,19 @@ void wxBrush::SetStipple(const wxBitmap& stipple) wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->GetColour(); } wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->GetStyle(); } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), 0, _T("invalid brush") ); + wxCHECK_MSG( Ok(), 0, wxT("invalid brush") ); return M_BRUSHDATA->GetStipple(); } diff --git a/src/cocoa/evtloop.mm b/src/cocoa/evtloop.mm index de848b00e3..0957eb764b 100644 --- a/src/cocoa/evtloop.mm +++ b/src/cocoa/evtloop.mm @@ -33,7 +33,7 @@ int wxGUIEventLoop::Run() { // event loops are not recursive, you need to create another loop! - wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); + wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") ); wxEventLoopActivator activate(this); @@ -46,7 +46,7 @@ int wxGUIEventLoop::Run() void wxGUIEventLoop::Exit(int rc) { - wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); + wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") ); m_exitcode = rc; @@ -86,7 +86,7 @@ bool wxGUIEventLoop::Dispatch() { // This check is required by wxGTK but probably not really for wxCocoa // Keep it here to encourage developers to write cross-platform code - wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") ); + wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") ); NSApplication *cocoaApp = [NSApplication sharedApplication]; // Block to retrieve an event then send it if(NSEvent *event = [cocoaApp diff --git a/src/cocoa/filedlg.mm b/src/cocoa/filedlg.mm index d3d988c215..576ed6920c 100644 --- a/src/cocoa/filedlg.mm +++ b/src/cocoa/filedlg.mm @@ -168,8 +168,8 @@ void wxFileDialog::GetPaths(wxArrayString& paths) const paths.Empty(); wxString dir(m_dir); - if ( m_dir.Last() != _T('\\') ) - dir += _T('\\'); + if ( m_dir.Last() != wxT('\\') ) + dir += wxT('\\'); size_t count = m_fileNames.GetCount(); for ( size_t n = 0; n < count; n++ ) @@ -191,7 +191,7 @@ void wxFileDialog::SetPath(const wxString& path) wxString ext; wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext); if ( !ext.empty() ) - m_fileName << _T('.') << ext; + m_fileName << wxT('.') << ext; } int wxFileDialog::ShowModal() diff --git a/src/common/accelcmn.cpp b/src/common/accelcmn.cpp index 9d5898177b..611fdfd97f 100644 --- a/src/common/accelcmn.cpp +++ b/src/common/accelcmn.cpp @@ -145,7 +145,7 @@ static int IsNumberedAccelKey(const wxString& str, { // this must be a mistake, chances that this is a valid name of another // key are vanishingly small - wxLogDebug(_T("Invalid key string \"%s\""), str.c_str()); + wxLogDebug(wxT("Invalid key string \"%s\""), str.c_str()); return 0; } @@ -259,7 +259,7 @@ wxAcceleratorEntry::ParseAccel(const wxString& text, int *flagsOut, int *keyOut) } - wxASSERT_MSG( keyCode, _T("logic error: should have key code here") ); + wxASSERT_MSG( keyCode, wxT("logic error: should have key code here") ); if ( flagsOut ) *flagsOut = accelFlags; diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 0ca0620db1..4851b5ac80 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -266,7 +266,7 @@ wxAppTraits *wxAppConsoleBase::GetTraits() { m_traits = CreateTraits(); - wxASSERT_MSG( m_traits, _T("wxApp::CreateTraits() failed?") ); + wxASSERT_MSG( m_traits, wxT("wxApp::CreateTraits() failed?") ); } return m_traits; @@ -706,7 +706,7 @@ bool wxAppConsoleBase::CheckBuildOptions(const char *optionsSignature, wxString progName = wxString::FromAscii(componentName); wxString msg; - msg.Printf(_T("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."), + msg.Printf(wxT("Mismatch between the program and library build versions detected.\nThe library used %s,\nand %s used %s."), lib.c_str(), progName.c_str(), prog.c_str()); wxLogFatalError(msg.c_str()); @@ -850,7 +850,7 @@ bool wxAppTraitsBase::ShowAssertDialog(const wxString& msgOriginal) const wxString stackTrace = GetAssertStackTrace(); if ( !stackTrace.empty() ) - msg << _T("\n\nCall stack:\n") << stackTrace; + msg << wxT("\n\nCall stack:\n") << stackTrace; #endif // wxUSE_STACKWALKER return DoShowAssertDialog(msg); @@ -879,29 +879,29 @@ wxString wxAppTraitsBase::GetAssertStackTrace() { m_stackTrace << wxString::Format ( - _T("[%02d] "), + wxT("[%02d] "), wx_truncate_cast(int, frame.GetLevel()) ); wxString name = frame.GetName(); if ( !name.empty() ) { - m_stackTrace << wxString::Format(_T("%-40s"), name.c_str()); + m_stackTrace << wxString::Format(wxT("%-40s"), name.c_str()); } else { - m_stackTrace << wxString::Format(_T("%p"), frame.GetAddress()); + m_stackTrace << wxString::Format(wxT("%p"), frame.GetAddress()); } if ( frame.HasSourceLocation() ) { - m_stackTrace << _T('\t') + m_stackTrace << wxT('\t') << frame.GetFileName() - << _T(':') + << wxT(':') << frame.GetLine(); } - m_stackTrace << _T('\n'); + m_stackTrace << wxT('\n'); } private: @@ -1133,7 +1133,7 @@ bool DoShowAssertDialog(const wxString& msg) wxT("You can also choose [Cancel] to suppress ") wxT("further warnings."); - switch ( ::MessageBox(NULL, msgDlg.wx_str(), _T("wxWidgets Debug Alert"), + switch ( ::MessageBox(NULL, msgDlg.wx_str(), wxT("wxWidgets Debug Alert"), MB_YESNOCANCEL | MB_ICONSTOP ) ) { case IDYES: @@ -1180,16 +1180,16 @@ void ShowAssertDialog(const wxString& file, // add the function name, if any if ( !func.empty() ) - msg << _T(" in ") << func << _T("()"); + msg << wxT(" in ") << func << wxT("()"); // and the message itself if ( !msgUser.empty() ) { - msg << _T(": ") << msgUser; + msg << wxT(": ") << msgUser; } else // no message given { - msg << _T('.'); + msg << wxT('.'); } #if wxUSE_THREADS @@ -1216,7 +1216,7 @@ void ShowAssertDialog(const wxString& file, if ( !s_bNoAsserts ) { // send it to the normal log destination - wxLogDebug(_T("%s"), msg.c_str()); + wxLogDebug(wxT("%s"), msg.c_str()); if ( traits ) { diff --git a/src/common/appcmn.cpp b/src/common/appcmn.cpp index c6ce33e993..61930ed1f5 100644 --- a/src/common/appcmn.cpp +++ b/src/common/appcmn.cpp @@ -242,7 +242,7 @@ bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser) if ( parser.Found(OPTION_MODE, &modeDesc) ) { unsigned w, h, bpp; - if ( wxSscanf(modeDesc.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3 ) + if ( wxSscanf(modeDesc.c_str(), wxT("%ux%u-%u"), &w, &h, &bpp) != 3 ) { wxLogError(_("Invalid display mode specification '%s'."), modeDesc.c_str()); return false; @@ -474,7 +474,7 @@ bool wxGUIAppTraitsBase::ShowAssertDialog(const wxString& msg) const wxString stackTrace = GetAssertStackTrace(); if ( !stackTrace.empty() ) - msgDlg << _T("\n\nCall stack:\n") << stackTrace; + msgDlg << wxT("\n\nCall stack:\n") << stackTrace; #endif // wxUSE_STACKWALKER // this message is intentionally not translated -- it is for diff --git a/src/common/artprov.cpp b/src/common/artprov.cpp index fb19f1ebbf..ff278ac39f 100644 --- a/src/common/artprov.cpp +++ b/src/common/artprov.cpp @@ -108,7 +108,7 @@ void wxArtProviderCache::Clear() wxArtProviderCache::ConstructHashID(const wxArtID& id, const wxArtClient& client) { - return id + _T('-') + client; + return id + wxT('-') + client; } @@ -117,8 +117,8 @@ wxArtProviderCache::ConstructHashID(const wxArtID& id, const wxArtClient& client, const wxSize& size) { - return ConstructHashID(id, client) + _T('-') + - wxString::Format(_T("%d-%d"), size.x, size.y); + return ConstructHashID(id, client) + wxT('-') + + wxString::Format(wxT("%d-%d"), size.x, size.y); } // ============================================================================ @@ -168,8 +168,8 @@ wxArtProvider::~wxArtProvider() /*static*/ bool wxArtProvider::Pop() { - wxCHECK_MSG( sm_providers, false, _T("no wxArtProvider exists") ); - wxCHECK_MSG( !sm_providers->empty(), false, _T("wxArtProviders stack is empty") ); + wxCHECK_MSG( sm_providers, false, wxT("no wxArtProvider exists") ); + wxCHECK_MSG( !sm_providers->empty(), false, wxT("wxArtProviders stack is empty") ); delete sm_providers->GetFirst()->GetData(); sm_cache->Clear(); @@ -178,7 +178,7 @@ wxArtProvider::~wxArtProvider() /*static*/ bool wxArtProvider::Remove(wxArtProvider *provider) { - wxCHECK_MSG( sm_providers, false, _T("no wxArtProvider exists") ); + wxCHECK_MSG( sm_providers, false, wxT("no wxArtProvider exists") ); if ( sm_providers->DeleteObject(provider) ) { @@ -221,9 +221,9 @@ wxArtProvider::~wxArtProvider() const wxSize& size) { // safety-check against writing client,id,size instead of id,client,size: - wxASSERT_MSG( client.Last() == _T('C'), _T("invalid 'client' parameter") ); + wxASSERT_MSG( client.Last() == wxT('C'), wxT("invalid 'client' parameter") ); - wxCHECK_MSG( sm_providers, wxNullBitmap, _T("no wxArtProvider exists") ); + wxCHECK_MSG( sm_providers, wxNullBitmap, wxT("no wxArtProvider exists") ); wxString hashId = wxArtProviderCache::ConstructHashID(id, client, size); @@ -294,9 +294,9 @@ wxIconBundle wxArtProvider::GetIconBundle(const wxArtID& id, const wxArtClient& wxIconBundle wxArtProvider::DoGetIconBundle(const wxArtID& id, const wxArtClient& client) { // safety-check against writing client,id,size instead of id,client,size: - wxASSERT_MSG( client.Last() == _T('C'), _T("invalid 'client' parameter") ); + wxASSERT_MSG( client.Last() == wxT('C'), wxT("invalid 'client' parameter") ); - wxCHECK_MSG( sm_providers, wxNullIconBundle, _T("no wxArtProvider exists") ); + wxCHECK_MSG( sm_providers, wxNullIconBundle, wxT("no wxArtProvider exists") ); wxString hashId = wxArtProviderCache::ConstructHashID(id, client); @@ -338,7 +338,7 @@ wxIcon wxArtProvider::GetMessageBoxIcon(int flags) switch ( flags & wxICON_MASK ) { default: - wxFAIL_MSG(_T("incorrect message box icon flags")); + wxFAIL_MSG(wxT("incorrect message box icon flags")); // fall through case wxICON_ERROR: diff --git a/src/common/base64.cpp b/src/common/base64.cpp index 8ac4ebcadf..bf5a613dff 100644 --- a/src/common/base64.cpp +++ b/src/common/base64.cpp @@ -20,7 +20,7 @@ size_t wxBase64Encode(char *dst, size_t dstLen, const void *src_, size_t srcLen) { - wxCHECK_MSG( src_, wxCONV_FAILED, _T("NULL input buffer") ); + wxCHECK_MSG( src_, wxCONV_FAILED, wxT("NULL input buffer") ); const unsigned char *src = static_cast(src_); @@ -73,7 +73,7 @@ wxBase64Decode(void *dst_, size_t dstLen, wxBase64DecodeMode mode, size_t *posErr) { - wxCHECK_MSG( src, wxCONV_FAILED, _T("NULL input buffer") ); + wxCHECK_MSG( src, wxCONV_FAILED, wxT("NULL input buffer") ); unsigned char *dst = static_cast(dst_); @@ -216,7 +216,7 @@ wxMemoryBuffer wxBase64Decode(const char *src, size_t *posErr) { wxMemoryBuffer buf; - wxCHECK_MSG( src, buf, _T("NULL input buffer") ); + wxCHECK_MSG( src, buf, wxT("NULL input buffer") ); if ( srcLen == wxNO_LEN ) srcLen = strlen(src); diff --git a/src/common/bmpbase.cpp b/src/common/bmpbase.cpp index 88e77178e9..e80091dada 100644 --- a/src/common/bmpbase.cpp +++ b/src/common/bmpbase.cpp @@ -155,7 +155,7 @@ wxBitmap::wxBitmap(const char* const* bits) *this = wxBitmap(image); #else - wxFAIL_MSG(_T("creating bitmaps from XPMs not supported")); + wxFAIL_MSG(wxT("creating bitmaps from XPMs not supported")); #endif // wxUSE_IMAGE && wxUSE_XPM } #endif // !(defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__)) diff --git a/src/common/bookctrl.cpp b/src/common/bookctrl.cpp index d45ff84f7d..2ca683a7c2 100644 --- a/src/common/bookctrl.cpp +++ b/src/common/bookctrl.cpp @@ -183,7 +183,7 @@ wxRect wxBookCtrlBase::GetPageRect() const switch ( GetWindowStyle() & wxBK_ALIGN_MASK ) { default: - wxFAIL_MSG( _T("unexpected alignment") ); + wxFAIL_MSG( wxT("unexpected alignment") ); // fall through case wxBK_TOP: @@ -242,7 +242,7 @@ void wxBookCtrlBase::DoSize() switch ( GetWindowStyle() & wxBK_ALIGN_MASK ) { default: - wxFAIL_MSG( _T("unexpected alignment") ); + wxFAIL_MSG( wxT("unexpected alignment") ); // fall through case wxBK_TOP: @@ -272,7 +272,7 @@ void wxBookCtrlBase::DoSize() if ( !page ) { wxASSERT_MSG( AllowNullPage(), - _T("Null page in a control that does not allow null pages?") ); + wxT("Null page in a control that does not allow null pages?") ); continue; } @@ -386,9 +386,9 @@ wxBookCtrlBase::InsertPage(size_t nPage, int WXUNUSED(imageId)) { wxCHECK_MSG( page || AllowNullPage(), false, - _T("NULL page in wxBookCtrlBase::InsertPage()") ); + wxT("NULL page in wxBookCtrlBase::InsertPage()") ); wxCHECK_MSG( nPage <= m_pages.size(), false, - _T("invalid page index in wxBookCtrlBase::InsertPage()") ); + wxT("invalid page index in wxBookCtrlBase::InsertPage()") ); m_pages.Insert(page, nPage); if ( page ) @@ -414,7 +414,7 @@ bool wxBookCtrlBase::DeletePage(size_t nPage) wxWindow *wxBookCtrlBase::DoRemovePage(size_t nPage) { wxCHECK_MSG( nPage < m_pages.size(), NULL, - _T("invalid page index in wxBookCtrlBase::DoRemovePage()") ); + wxT("invalid page index in wxBookCtrlBase::DoRemovePage()") ); wxWindow *pageRemoved = m_pages[nPage]; m_pages.RemoveAt(nPage); diff --git a/src/common/btncmn.cpp b/src/common/btncmn.cpp index 670dceacdf..c0a943189b 100644 --- a/src/common/btncmn.cpp +++ b/src/common/btncmn.cpp @@ -39,7 +39,7 @@ wxWindow *wxButtonBase::SetDefault() wxTopLevelWindow * const tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); - wxCHECK_MSG( tlw, NULL, _T("button without top level window?") ); + wxCHECK_MSG( tlw, NULL, wxT("button without top level window?") ); return tlw->SetDefaultItem(this); } diff --git a/src/common/cmdline.cpp b/src/common/cmdline.cpp index dec8be85fc..e8058e2979 100644 --- a/src/common/cmdline.cpp +++ b/src/common/cmdline.cpp @@ -114,7 +114,7 @@ struct wxCmdLineOption void Check(wxCmdLineParamType WXUNUSED_UNLESS_DEBUG(typ)) const { - wxASSERT_MSG( type == typ, _T("type mismatch in wxCmdLineOption") ); + wxASSERT_MSG( type == typ, wxT("type mismatch in wxCmdLineOption") ); } double GetDoubleVal() const @@ -224,9 +224,9 @@ wxCmdLineParserData::wxCmdLineParserData() { m_enableLongOptions = true; #ifdef __UNIX_LIKE__ - m_switchChars = _T("-"); + m_switchChars = wxT("-"); #else // !Unix - m_switchChars = _T("/-"); + m_switchChars = wxT("/-"); #endif } @@ -401,7 +401,7 @@ void wxCmdLineParser::SetDesc(const wxCmdLineEntryDesc *desc) break; default: - wxFAIL_MSG( _T("unknown command line entry type") ); + wxFAIL_MSG( wxT("unknown command line entry type") ); // still fall through case wxCMD_LINE_NONE: @@ -416,7 +416,7 @@ void wxCmdLineParser::AddSwitch(const wxString& shortName, int flags) { wxASSERT_MSG( m_data->FindOption(shortName) == wxNOT_FOUND, - _T("duplicate switch") ); + wxT("duplicate switch") ); wxCmdLineOption *option = new wxCmdLineOption(wxCMD_LINE_SWITCH, shortName, longName, desc, @@ -432,7 +432,7 @@ void wxCmdLineParser::AddOption(const wxString& shortName, int flags) { wxASSERT_MSG( m_data->FindOption(shortName) == wxNOT_FOUND, - _T("duplicate option") ); + wxT("duplicate option") ); wxCmdLineOption *option = new wxCmdLineOption(wxCMD_LINE_OPTION, shortName, longName, desc, @@ -453,12 +453,12 @@ void wxCmdLineParser::AddParam(const wxString& desc, wxCmdLineParam& param = m_data->m_paramDesc.Last(); wxASSERT_MSG( !(param.flags & wxCMD_LINE_PARAM_MULTIPLE), - _T("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style will be ignored") ); + wxT("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style will be ignored") ); if ( !(flags & wxCMD_LINE_PARAM_OPTIONAL) ) { wxASSERT_MSG( !(param.flags & wxCMD_LINE_PARAM_OPTIONAL), - _T("a required parameter can't follow an optional one") ); + wxT("a required parameter can't follow an optional one") ); } } #endif // wxDEBUG_LEVEL @@ -489,7 +489,7 @@ bool wxCmdLineParser::Found(const wxString& name) const if ( i == wxNOT_FOUND ) i = m_data->FindOptionByLongName(name); - wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown switch") ); + wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown switch") ); wxCmdLineOption& opt = m_data->m_options[(size_t)i]; if ( !opt.HasValue() ) @@ -504,13 +504,13 @@ bool wxCmdLineParser::Found(const wxString& name, wxString *value) const if ( i == wxNOT_FOUND ) i = m_data->FindOptionByLongName(name); - wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") ); + wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown option") ); wxCmdLineOption& opt = m_data->m_options[(size_t)i]; if ( !opt.HasValue() ) return false; - wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") ); + wxCHECK_MSG( value, false, wxT("NULL pointer in wxCmdLineOption::Found") ); *value = opt.GetStrVal(); @@ -523,13 +523,13 @@ bool wxCmdLineParser::Found(const wxString& name, long *value) const if ( i == wxNOT_FOUND ) i = m_data->FindOptionByLongName(name); - wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") ); + wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown option") ); wxCmdLineOption& opt = m_data->m_options[(size_t)i]; if ( !opt.HasValue() ) return false; - wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") ); + wxCHECK_MSG( value, false, wxT("NULL pointer in wxCmdLineOption::Found") ); *value = opt.GetLongVal(); @@ -542,13 +542,13 @@ bool wxCmdLineParser::Found(const wxString& name, double *value) const if ( i == wxNOT_FOUND ) i = m_data->FindOptionByLongName(name); - wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") ); + wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown option") ); wxCmdLineOption& opt = m_data->m_options[(size_t)i]; if ( !opt.HasValue() ) return false; - wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") ); + wxCHECK_MSG( value, false, wxT("NULL pointer in wxCmdLineOption::Found") ); *value = opt.GetDoubleVal(); @@ -562,13 +562,13 @@ bool wxCmdLineParser::Found(const wxString& name, wxDateTime *value) const if ( i == wxNOT_FOUND ) i = m_data->FindOptionByLongName(name); - wxCHECK_MSG( i != wxNOT_FOUND, false, _T("unknown option") ); + wxCHECK_MSG( i != wxNOT_FOUND, false, wxT("unknown option") ); wxCmdLineOption& opt = m_data->m_options[(size_t)i]; if ( !opt.HasValue() ) return false; - wxCHECK_MSG( value, false, _T("NULL pointer in wxCmdLineOption::Found") ); + wxCHECK_MSG( value, false, wxT("NULL pointer in wxCmdLineOption::Found") ); *value = opt.GetDateVal(); @@ -583,7 +583,7 @@ size_t wxCmdLineParser::GetParamCount() const wxString wxCmdLineParser::GetParam(size_t n) const { - wxCHECK_MSG( n < GetParamCount(), wxEmptyString, _T("invalid param index") ); + wxCHECK_MSG( n < GetParamCount(), wxEmptyString, wxT("invalid param index") ); return m_data->m_parameters[n]; } @@ -627,7 +627,7 @@ int wxCmdLineParser::Parse(bool showUsage) // special case: "--" should be discarded and all following arguments // should be considered as parameters, even if they start with '-' and // not like options (this is POSIX-like) - if ( arg == _T("--") ) + if ( arg == wxT("--") ) { maybeOption = false; @@ -644,7 +644,7 @@ int wxCmdLineParser::Parse(bool showUsage) int optInd = wxNOT_FOUND; // init to suppress warnings // an option or a switch: find whether it's a long or a short one - if ( arg.length() >= 3 && arg[0u] == _T('-') && arg[1u] == _T('-') ) + if ( arg.length() >= 3 && arg[0u] == wxT('-') && arg[1u] == wxT('-') ) { // a long one isLong = true; @@ -662,7 +662,7 @@ int wxCmdLineParser::Parse(bool showUsage) if ( optInd == wxNOT_FOUND ) { errorMsg << wxString::Format(_("Unknown long option '%s'"), name.c_str()) - << _T('\n'); + << wxT('\n'); } } else @@ -672,7 +672,7 @@ int wxCmdLineParser::Parse(bool showUsage) // Print the argument including leading "--" name.Prepend( wxT("--") ); errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str()) - << _T('\n'); + << wxT('\n'); } } @@ -694,7 +694,7 @@ int wxCmdLineParser::Parse(bool showUsage) // we couldn't find a valid option name in the // beginning of this string errorMsg << wxString::Format(_("Unknown option '%s'"), name.c_str()) - << _T('\n'); + << wxT('\n'); break; } @@ -757,7 +757,7 @@ int wxCmdLineParser::Parse(bool showUsage) if ( p != arg.end() ) { errorMsg << wxString::Format(_("Unexpected characters following option '%s'."), name.c_str()) - << _T('\n'); + << wxT('\n'); ok = false; } else // no value, as expected @@ -791,7 +791,7 @@ int wxCmdLineParser::Parse(bool showUsage) // ... but there is none errorMsg << wxString::Format(_("Option '%s' requires a value."), name.c_str()) - << _T('\n'); + << wxT('\n'); ok = false; } @@ -810,7 +810,7 @@ int wxCmdLineParser::Parse(bool showUsage) { errorMsg << wxString::Format(_("Separator expected after the option '%s'."), name.c_str()) - << _T('\n'); + << wxT('\n'); ok = false; } @@ -822,7 +822,7 @@ int wxCmdLineParser::Parse(bool showUsage) switch ( opt.type ) { default: - wxFAIL_MSG( _T("unknown option type") ); + wxFAIL_MSG( wxT("unknown option type") ); // still fall through case wxCMD_LINE_VAL_STRING: @@ -840,7 +840,7 @@ int wxCmdLineParser::Parse(bool showUsage) { errorMsg << wxString::Format(_("'%s' is not a correct numeric value for option '%s'."), value.c_str(), name.c_str()) - << _T('\n'); + << wxT('\n'); ok = false; } @@ -858,7 +858,7 @@ int wxCmdLineParser::Parse(bool showUsage) { errorMsg << wxString::Format(_("'%s' is not a correct numeric value for option '%s'."), value.c_str(), name.c_str()) - << _T('\n'); + << wxT('\n'); ok = false; } @@ -874,7 +874,7 @@ int wxCmdLineParser::Parse(bool showUsage) { errorMsg << wxString::Format(_("Option '%s': '%s' cannot be converted to a date."), name.c_str(), value.c_str()) - << _T('\n'); + << wxT('\n'); ok = false; } @@ -906,7 +906,7 @@ int wxCmdLineParser::Parse(bool showUsage) else { wxASSERT_MSG( currentParam == countParam - 1, - _T("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style are ignored") ); + wxT("all parameters after the one with wxCMD_LINE_PARAM_MULTIPLE style are ignored") ); // remember that we did have this last repeatable parameter hadRepeatableParam = true; @@ -915,7 +915,7 @@ int wxCmdLineParser::Parse(bool showUsage) else { errorMsg << wxString::Format(_("Unexpected parameter '%s'"), arg.c_str()) - << _T('\n'); + << wxT('\n'); ok = false; } @@ -953,7 +953,7 @@ int wxCmdLineParser::Parse(bool showUsage) errorMsg << wxString::Format(_("The value for the option '%s' must be specified."), optName.c_str()) - << _T('\n'); + << wxT('\n'); ok = false; } @@ -975,7 +975,7 @@ int wxCmdLineParser::Parse(bool showUsage) { errorMsg << wxString::Format(_("The required parameter '%s' was not specified."), param.description.c_str()) - << _T('\n'); + << wxT('\n'); ok = false; } @@ -997,7 +997,7 @@ int wxCmdLineParser::Parse(bool showUsage) } else { - wxFAIL_MSG( _T("no wxMessageOutput object?") ); + wxFAIL_MSG( wxT("no wxMessageOutput object?") ); } } @@ -1017,7 +1017,7 @@ void wxCmdLineParser::Usage() const } else { - wxFAIL_MSG( _T("no wxMessageOutput object?") ); + wxFAIL_MSG( wxT("no wxMessageOutput object?") ); } } @@ -1042,14 +1042,14 @@ wxString wxCmdLineParser::GetUsageString() const if ( !m_data->m_logo.empty() ) { - usage << m_data->m_logo << _T('\n'); + usage << m_data->m_logo << wxT('\n'); } usage << wxString::Format(_("Usage: %s"), appname.c_str()); // the switch char is usually '-' but this can be changed with // SetSwitchChars() and then the first one of possible chars is used - wxChar chSwitch = !m_data->m_switchChars ? _T('-') + wxChar chSwitch = !m_data->m_switchChars ? wxT('-') : m_data->m_switchChars[0u]; bool areLongOptionsEnabled = AreLongOptionsEnabled(); @@ -1061,10 +1061,10 @@ wxString wxCmdLineParser::GetUsageString() const if ( opt.kind != wxCMD_LINE_USAGE_TEXT ) { - usage << _T(' '); + usage << wxT(' '); if ( !(opt.flags & wxCMD_LINE_OPTION_MANDATORY) ) { - usage << _T('['); + usage << wxT('['); } if ( !opt.shortName.empty() ) @@ -1073,7 +1073,7 @@ wxString wxCmdLineParser::GetUsageString() const } else if ( areLongOptionsEnabled && !opt.longName.empty() ) { - usage << _T("--") << opt.longName; + usage << wxT("--") << opt.longName; } else { @@ -1084,32 +1084,32 @@ wxString wxCmdLineParser::GetUsageString() const } else { - wxFAIL_MSG( _T("option without neither short nor long name") ); + wxFAIL_MSG( wxT("option without neither short nor long name") ); } } if ( !opt.shortName.empty() ) { - option << _T(" ") << chSwitch << opt.shortName; + option << wxT(" ") << chSwitch << opt.shortName; } if ( areLongOptionsEnabled && !opt.longName.empty() ) { - option << (option.empty() ? _T(" ") : _T(", ")) - << _T("--") << opt.longName; + option << (option.empty() ? wxT(" ") : wxT(", ")) + << wxT("--") << opt.longName; } if ( opt.kind != wxCMD_LINE_SWITCH ) { wxString val; - val << _T('<') << GetTypeName(opt.type) << _T('>'); - usage << _T(' ') << val; - option << (!opt.longName ? _T(':') : _T('=')) << val; + val << wxT('<') << GetTypeName(opt.type) << wxT('>'); + usage << wxT(' ') << val; + option << (!opt.longName ? wxT(':') : wxT('=')) << val; } if ( !(opt.flags & wxCMD_LINE_OPTION_MANDATORY) ) { - usage << _T(']'); + usage << wxT(']'); } } @@ -1122,26 +1122,26 @@ wxString wxCmdLineParser::GetUsageString() const { wxCmdLineParam& param = m_data->m_paramDesc[n]; - usage << _T(' '); + usage << wxT(' '); if ( param.flags & wxCMD_LINE_PARAM_OPTIONAL ) { - usage << _T('['); + usage << wxT('['); } usage << param.description; if ( param.flags & wxCMD_LINE_PARAM_MULTIPLE ) { - usage << _T("..."); + usage << wxT("..."); } if ( param.flags & wxCMD_LINE_PARAM_OPTIONAL ) { - usage << _T(']'); + usage << wxT(']'); } } - usage << _T('\n'); + usage << wxT('\n'); // set to number of our own options, not counting the standard ones count = namesOptions.size(); @@ -1164,20 +1164,20 @@ wxString wxCmdLineParser::GetUsageString() const for ( n = 0; n < namesOptions.size(); n++ ) { if ( n == count ) - usage << _T('\n') << stdDesc; + usage << wxT('\n') << stdDesc; len = namesOptions[n].length(); // desc contains text if name is empty if (len == 0) { - usage << descOptions[n] << _T('\n'); + usage << descOptions[n] << wxT('\n'); } else { usage << namesOptions[n] - << wxString(_T(' '), lenMax - len) << _T('\t') + << wxString(wxT(' '), lenMax - len) << wxT('\t') << descOptions[n] - << _T('\n'); + << wxT('\n'); } } @@ -1194,7 +1194,7 @@ static wxString GetTypeName(wxCmdLineParamType type) switch ( type ) { default: - wxFAIL_MSG( _T("unknown option type") ); + wxFAIL_MSG( wxT("unknown option type") ); // still fall through case wxCMD_LINE_VAL_STRING: diff --git a/src/common/cmdproc.cpp b/src/common/cmdproc.cpp index a5ddc7bed1..5ece41e787 100644 --- a/src/common/cmdproc.cpp +++ b/src/common/cmdproc.cpp @@ -86,7 +86,7 @@ bool wxCommandProcessor::UndoCommand(wxCommand& cmd) // storeIt is false. bool wxCommandProcessor::Submit(wxCommand *command, bool storeIt) { - wxCHECK_MSG( command, false, _T("no command in wxCommandProcessor::Submit") ); + wxCHECK_MSG( command, false, wxT("no command in wxCommandProcessor::Submit") ); if ( !DoCommand(*command) ) { @@ -106,7 +106,7 @@ bool wxCommandProcessor::Submit(wxCommand *command, bool storeIt) void wxCommandProcessor::Store(wxCommand *command) { - wxCHECK_RET( command, _T("no command in wxCommandProcessor::Store") ); + wxCHECK_RET( command, wxT("no command in wxCommandProcessor::Store") ); if ( (int)m_commands.GetCount() == m_maxNoCommands ) { diff --git a/src/common/cmndata.cpp b/src/common/cmndata.cpp index 0a55186a49..d8cc2b03a8 100644 --- a/src/common/cmndata.cpp +++ b/src/common/cmndata.cpp @@ -87,7 +87,7 @@ wxColourData::~wxColourData() void wxColourData::SetCustomColour(int i, const wxColour& colour) { - wxCHECK_RET( i >= 0 && i < NUM_CUSTOM, _T("custom colour index out of range") ); + wxCHECK_RET( i >= 0 && i < NUM_CUSTOM, wxT("custom colour index out of range") ); m_custColours[i] = colour; } @@ -95,7 +95,7 @@ void wxColourData::SetCustomColour(int i, const wxColour& colour) wxColour wxColourData::GetCustomColour(int i) const { wxCHECK_MSG( i >= 0 && i < NUM_CUSTOM, wxColour(0,0,0), - _T("custom colour index out of range") ); + wxT("custom colour index out of range") ); return m_custColours[i]; } diff --git a/src/common/colourcmn.cpp b/src/common/colourcmn.cpp index a03efa7942..8fa9c927c2 100644 --- a/src/common/colourcmn.cpp +++ b/src/common/colourcmn.cpp @@ -173,7 +173,7 @@ wxString wxToString(const wxColourBase& col) bool wxFromString(const wxString& str, wxColourBase *col) { - wxCHECK_MSG( col, false, _T("NULL output parameter") ); + wxCHECK_MSG( col, false, wxT("NULL output parameter") ); if ( str.empty() ) { diff --git a/src/common/config.cpp b/src/common/config.cpp index 8b1fdf83f0..c3a5e8b8ce 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -105,7 +105,7 @@ wxConfigBase *wxConfigBase::Create() { if ( ms_bAutoCreate && ms_pConfig == NULL ) { wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - wxCHECK_MSG( traits, NULL, _T("create wxApp before calling this") ); + wxCHECK_MSG( traits, NULL, wxT("create wxApp before calling this") ); ms_pConfig = traits->CreateConfig(); } @@ -121,7 +121,7 @@ wxConfigBase *wxConfigBase::Create() #define IMPLEMENT_READ_FOR_TYPE(name, type, deftype, extra) \ bool wxConfigBase::Read(const wxString& key, type *val) const \ { \ - wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); \ + wxCHECK_MSG( val, false, wxT("wxConfig::Read(): NULL parameter") ); \ \ if ( !DoRead##name(key, val) ) \ return false; \ @@ -135,7 +135,7 @@ wxConfigBase *wxConfigBase::Create() type *val, \ deftype defVal) const \ { \ - wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); \ + wxCHECK_MSG( val, false, wxT("wxConfig::Read(): NULL parameter") ); \ \ bool read = DoRead##name(key, val); \ if ( !read ) \ @@ -166,7 +166,7 @@ bool wxConfigBase::Read(const wxString& key, int *pi) const { long l = *pi; bool r = Read(key, &l); - wxASSERT_MSG( l < INT_MAX, _T("int overflow in wxConfig::Read") ); + wxASSERT_MSG( l < INT_MAX, wxT("int overflow in wxConfig::Read") ); *pi = (int)l; return r; } @@ -175,7 +175,7 @@ bool wxConfigBase::Read(const wxString& key, int *pi, int defVal) const { long l = *pi; bool r = Read(key, &l, defVal); - wxASSERT_MSG( l < INT_MAX, _T("int overflow in wxConfig::Read") ); + wxASSERT_MSG( l < INT_MAX, wxT("int overflow in wxConfig::Read") ); *pi = (int)l; return r; } @@ -184,13 +184,13 @@ bool wxConfigBase::Read(const wxString& key, int *pi, int defVal) const // but can be overridden in the derived ones bool wxConfigBase::DoReadBool(const wxString& key, bool* val) const { - wxCHECK_MSG( val, false, _T("wxConfig::Read(): NULL parameter") ); + wxCHECK_MSG( val, false, wxT("wxConfig::Read(): NULL parameter") ); long l; if ( !DoReadLong(key, &l) ) return false; - wxASSERT_MSG( l == 0 || l == 1, _T("bad bool value in wxConfig::DoReadInt") ); + wxASSERT_MSG( l == 0 || l == 1, wxT("bad bool value in wxConfig::DoReadInt") ); *val = l != 0; @@ -225,7 +225,7 @@ wxString wxConfigBase::ExpandEnvVars(const wxString& str) const bool wxConfigBase::DoWriteDouble(const wxString& key, double val) { - return DoWriteString(key, wxString::Format(_T("%g"), val)); + return DoWriteString(key, wxString::Format(wxT("%g"), val)); } bool wxConfigBase::DoWriteBool(const wxString& key, bool value) @@ -269,7 +269,7 @@ wxConfigPathChanger::wxConfigPathChanger(const wxConfigBase *pContainer, pConfig->SetPath(wxT("MySettings")); pConfig->SetPath(wxT("..")); int value; - pConfig->Read(_T("MainWindowX"), & value); + pConfig->Read(wxT("MainWindowX"), & value); */ m_strOldPath = m_pContainer->GetPath().wc_str(); if ( *m_strOldPath.c_str() != wxCONFIG_PATH_SEPARATOR ) diff --git a/src/common/containr.cpp b/src/common/containr.cpp index b79bf180b1..d542503216 100644 --- a/src/common/containr.cpp +++ b/src/common/containr.cpp @@ -37,7 +37,7 @@ #endif //WX_PRECOMP // trace mask for focus messages -#define TRACE_FOCUS _T("focus") +#define TRACE_FOCUS wxT("focus") // ============================================================================ // implementation @@ -79,7 +79,7 @@ bool wxControlContainerBase::HasAnyFocusableChildren() const bool wxControlContainerBase::DoSetFocus() { - wxLogTrace(TRACE_FOCUS, _T("SetFocus on wxPanel 0x%p."), + wxLogTrace(TRACE_FOCUS, wxT("SetFocus on wxPanel 0x%p."), m_winParent->GetHandle()); if (m_inSetFocus) @@ -157,7 +157,7 @@ void wxControlContainer::SetLastFocus(wxWindow *win) // (under wxGTK) wxASSERT_MSG( winParent, - _T("Setting last focus for a window that is not our child?") ); + wxT("Setting last focus for a window that is not our child?") ); } } @@ -165,13 +165,13 @@ void wxControlContainer::SetLastFocus(wxWindow *win) if ( win ) { - wxLogTrace(TRACE_FOCUS, _T("Set last focus to %s(%s)"), + wxLogTrace(TRACE_FOCUS, wxT("Set last focus to %s(%s)"), win->GetClassInfo()->GetClassName(), win->GetLabel().c_str()); } else { - wxLogTrace(TRACE_FOCUS, _T("No more last focus")); + wxLogTrace(TRACE_FOCUS, wxT("No more last focus")); } } @@ -203,7 +203,7 @@ wxRadioButton* wxGetPreviousButtonInGroup(wxRadioButton *btn) const wxWindowList& siblings = btn->GetParent()->GetChildren(); wxWindowList::compatibility_iterator nodeThis = siblings.Find(btn); - wxCHECK_MSG( nodeThis, NULL, _T("radio button not a child of its parent?") ); + wxCHECK_MSG( nodeThis, NULL, wxT("radio button not a child of its parent?") ); // Iterate over all previous siblings until we find the next radio button wxWindowList::compatibility_iterator nodeBefore = nodeThis->GetPrevious(); @@ -233,7 +233,7 @@ wxRadioButton* wxGetNextButtonInGroup(wxRadioButton *btn) const wxWindowList& siblings = btn->GetParent()->GetChildren(); wxWindowList::compatibility_iterator nodeThis = siblings.Find(btn); - wxCHECK_MSG( nodeThis, NULL, _T("radio button not a child of its parent?") ); + wxCHECK_MSG( nodeThis, NULL, wxT("radio button not a child of its parent?") ); // Iterate over all previous siblings until we find the next radio button wxWindowList::compatibility_iterator nodeNext = nodeThis->GetNext(); @@ -613,7 +613,7 @@ void wxControlContainer::HandleOnWindowDestroy(wxWindowBase *child) void wxControlContainer::HandleOnFocus(wxFocusEvent& event) { - wxLogTrace(TRACE_FOCUS, _T("OnFocus on wxPanel 0x%p, name: %s"), + wxLogTrace(TRACE_FOCUS, wxT("OnFocus on wxPanel 0x%p, name: %s"), m_winParent->GetHandle(), m_winParent->GetName().c_str() ); @@ -641,9 +641,9 @@ bool wxControlContainer::SetFocusToChild() bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) { - wxCHECK_MSG( win, false, _T("wxSetFocusToChild(): invalid window") ); + wxCHECK_MSG( win, false, wxT("wxSetFocusToChild(): invalid window") ); // wxCHECK_MSG( childLastFocused, false, - // _T("wxSetFocusToChild(): NULL child poonter") ); + // wxT("wxSetFocusToChild(): NULL child poonter") ); if ( childLastFocused && *childLastFocused ) { @@ -651,7 +651,7 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) if ( (*childLastFocused)->GetParent() == win ) { wxLogTrace(TRACE_FOCUS, - _T("SetFocusToChild() => last child (0x%p)."), + wxT("SetFocusToChild() => last child (0x%p)."), (*childLastFocused)->GetHandle()); // not SetFocusFromKbd(): we're restoring focus back to the old @@ -692,7 +692,7 @@ bool wxSetFocusToChild(wxWindow *win, wxWindow **childLastFocused) #endif // __WXMSW__ wxLogTrace(TRACE_FOCUS, - _T("SetFocusToChild() => first child (0x%p)."), + wxT("SetFocusToChild() => first child (0x%p)."), child->GetHandle()); if (childLastFocused) diff --git a/src/common/convauto.cpp b/src/common/convauto.cpp index 9d5818333d..f4e394d04d 100644 --- a/src/common/convauto.cpp +++ b/src/common/convauto.cpp @@ -44,7 +44,7 @@ wxFontEncoding wxConvAuto::ms_defaultMBEncoding = wxFONTENCODING_ISO8859_1; void wxConvAuto::SetFallbackEncoding(wxFontEncoding enc) { wxASSERT_MSG( enc != wxFONTENCODING_DEFAULT, - _T("wxFONTENCODING_DEFAULT doesn't make sense here") ); + wxT("wxFONTENCODING_DEFAULT doesn't make sense here") ); ms_defaultMBEncoding = enc; } @@ -137,7 +137,7 @@ void wxConvAuto::InitFromBOM(BOMType bomType) break; default: - wxFAIL_MSG( _T("unexpected BOM type") ); + wxFAIL_MSG( wxT("unexpected BOM type") ); // fall through: still need to create something case BOM_None: @@ -166,7 +166,7 @@ void wxConvAuto::SkipBOM(const char **src, size_t *len) const break; default: - wxFAIL_MSG( _T("unexpected BOM type") ); + wxFAIL_MSG( wxT("unexpected BOM type") ); // fall through: still need to create something case BOM_None: diff --git a/src/common/cshelp.cpp b/src/common/cshelp.cpp index 60b613b8a6..5bbdd65f52 100644 --- a/src/common/cshelp.cpp +++ b/src/common/cshelp.cpp @@ -232,7 +232,7 @@ bool wxContextHelpEvtHandler::ProcessEvent(wxEvent& event) // Dispatch the help event to the relevant window bool wxContextHelp::DispatchEvent(wxWindow* win, const wxPoint& pt) { - wxCHECK_MSG( win, false, _T("win parameter can't be NULL") ); + wxCHECK_MSG( win, false, wxT("win parameter can't be NULL") ); wxHelpEvent helpEvent(wxEVT_HELP, win->GetId(), pt, wxHelpEvent::Origin_HelpButton); @@ -332,7 +332,7 @@ wxString wxHelpProvider::GetHelpTextMaybeAtPoint(wxWindowBase *window) if ( m_helptextAtPoint != wxDefaultPosition || m_helptextOrigin != wxHelpEvent::Origin_Unknown ) { - wxCHECK_MSG( window, wxEmptyString, _T("window must not be NULL") ); + wxCHECK_MSG( window, wxEmptyString, wxT("window must not be NULL") ); wxPoint pt = m_helptextAtPoint; wxHelpEvent::Origin origin = m_helptextOrigin; @@ -472,7 +472,7 @@ bool wxHelpControllerHelpProvider::ShowHelp(wxWindowBase *window) // Convenience function for turning context id into wxString wxString wxContextId(int id) { - return wxString::Format(_T("%d"), id); + return wxString::Format(wxT("%d"), id); } // ---------------------------------------------------------------------------- diff --git a/src/common/ctrlcmn.cpp b/src/common/ctrlcmn.cpp index 5e8b9ef8b3..374d2d49a3 100644 --- a/src/common/ctrlcmn.cpp +++ b/src/common/ctrlcmn.cpp @@ -173,7 +173,7 @@ int wxControlBase::FindAccelIndex(const wxString& label, wxString *labelOnly) // the character following MNEMONIC_PREFIX is the accelerator for this // control unless it is MNEMONIC_PREFIX too - this allows to insert // literal MNEMONIC_PREFIX chars into the label - static const wxChar MNEMONIC_PREFIX = _T('&'); + static const wxChar MNEMONIC_PREFIX = wxT('&'); if ( labelOnly ) { @@ -198,7 +198,7 @@ int wxControlBase::FindAccelIndex(const wxString& label, wxString *labelOnly) } else { - wxFAIL_MSG(_T("duplicate accel char in control label")); + wxFAIL_MSG(wxT("duplicate accel char in control label")); } } } diff --git a/src/common/ctrlsub.cpp b/src/common/ctrlsub.cpp index e9d0dfa064..d668d66503 100644 --- a/src/common/ctrlsub.cpp +++ b/src/common/ctrlsub.cpp @@ -109,7 +109,7 @@ void wxItemContainer::Clear() void wxItemContainer::Delete(unsigned int pos) { - wxCHECK_RET( pos < GetCount(), _T("invalid index") ); + wxCHECK_RET( pos < GetCount(), wxT("invalid index") ); if ( HasClientObjectData() ) ResetItemClientObject(pos); @@ -150,7 +150,7 @@ int wxItemContainer::DoInsertOneItem(const wxString& WXUNUSED(item), unsigned int WXUNUSED(pos)) { - wxFAIL_MSG( _T("Must be overridden if DoInsertItemsInLoop() is used") ); + wxFAIL_MSG( wxT("Must be overridden if DoInsertItemsInLoop() is used") ); return wxNOT_FOUND; } @@ -233,7 +233,7 @@ void wxItemContainer::AssignNewItemClientData(unsigned int pos, break; default: - wxFAIL_MSG( _T("unknown client data type") ); + wxFAIL_MSG( wxT("unknown client data type") ); // fall through case wxClientData_None: diff --git a/src/common/datetime.cpp b/src/common/datetime.cpp index e13ac2e808..5de52dd01e 100644 --- a/src/common/datetime.cpp +++ b/src/common/datetime.cpp @@ -427,7 +427,7 @@ static long GetTruncatedJDN(wxDateTime::wxDateTime_t day, (year > JDN_0_YEAR) || ((year == JDN_0_YEAR) && (mon > JDN_0_MONTH)) || ((year == JDN_0_YEAR) && (mon == JDN_0_MONTH) && (day >= JDN_0_DAY)), - _T("date out of range - can't convert to JDN") + wxT("date out of range - can't convert to JDN") ); // make the year positive to avoid problems with negative numbers division @@ -467,7 +467,7 @@ wxString CallStrftime(const wxString& format, const tm* tm) if ( !wxStrftime(buf, WXSIZEOF(buf), format, tm) ) { // if the format is valid, buffer must be too small? - wxFAIL_MSG(_T("strftime() failed")); + wxFAIL_MSG(wxT("strftime() failed")); buf[0] = '\0'; } @@ -580,7 +580,7 @@ void wxDateTime::Tm::AddMonths(int monDiff) mon = (wxDateTime::Month)(mon + monDiff); - wxASSERT_MSG( mon >= 0 && mon < MONTHS_IN_YEAR, _T("logic error") ); + wxASSERT_MSG( mon >= 0 && mon < MONTHS_IN_YEAR, wxT("logic error") ); // NB: we don't check here that the resulting date is valid, this function // is private and the caller must check it if needed @@ -605,7 +605,7 @@ void wxDateTime::Tm::AddDays(int dayDiff) } wxASSERT_MSG( mday > 0 && mday <= GetNumOfDaysInMonth(year, mon), - _T("logic error") ); + wxT("logic error") ); } // ---------------------------------------------------------------------------- @@ -660,7 +660,7 @@ wxDateTime::TimeZone::TimeZone(wxDateTime::TZ tz) break; default: - wxFAIL_MSG( _T("unknown time zone") ); + wxFAIL_MSG( wxT("unknown time zone") ); } } @@ -696,7 +696,7 @@ bool wxDateTime::IsLeapYear(int year, wxDateTime::Calendar cal) } else { - wxFAIL_MSG(_T("unknown calendar")); + wxFAIL_MSG(wxT("unknown calendar")); return false; } @@ -724,11 +724,11 @@ int wxDateTime::GetCurrentYear(wxDateTime::Calendar cal) return Now().GetYear(); case Julian: - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); break; default: - wxFAIL_MSG(_T("unsupported calendar")); + wxFAIL_MSG(wxT("unsupported calendar")); break; } @@ -744,11 +744,11 @@ wxDateTime::Month wxDateTime::GetCurrentMonth(wxDateTime::Calendar cal) return Now().GetMonth(); case Julian: - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); break; default: - wxFAIL_MSG(_T("unsupported calendar")); + wxFAIL_MSG(wxT("unsupported calendar")); break; } @@ -771,7 +771,7 @@ wxDateTime::wxDateTime_t wxDateTime::GetNumberOfDays(int year, Calendar cal) return IsLeapYear(year) ? 366 : 365; default: - wxFAIL_MSG(_T("unsupported calendar")); + wxFAIL_MSG(wxT("unsupported calendar")); break; } @@ -783,7 +783,7 @@ wxDateTime::wxDateTime_t wxDateTime::GetNumberOfDays(wxDateTime::Month month, int year, wxDateTime::Calendar cal) { - wxCHECK_MSG( month < MONTHS_IN_YEAR, 0, _T("invalid month") ); + wxCHECK_MSG( month < MONTHS_IN_YEAR, 0, wxT("invalid month") ); if ( cal == Gregorian || cal == Julian ) { @@ -797,7 +797,7 @@ wxDateTime::wxDateTime_t wxDateTime::GetNumberOfDays(wxDateTime::Month month, } else { - wxFAIL_MSG(_T("unsupported calendar")); + wxFAIL_MSG(wxT("unsupported calendar")); return 0; } @@ -856,7 +856,7 @@ wxString wxDateTime::GetMonthName(wxDateTime::Month month, wxDateTime::NameFlags flags) { #ifdef wxHAS_STRFTIME - wxCHECK_MSG( month != Inv_Month, wxEmptyString, _T("invalid month") ); + wxCHECK_MSG( month != Inv_Month, wxEmptyString, wxT("invalid month") ); // notice that we must set all the fields to avoid confusing libc (GNU one // gets confused to a crash if we don't do this) @@ -864,7 +864,7 @@ wxString wxDateTime::GetMonthName(wxDateTime::Month month, InitTm(tm); tm.tm_mon = month; - return CallStrftime(flags == Name_Abbr ? _T("%b") : _T("%B"), &tm); + return CallStrftime(flags == Name_Abbr ? wxT("%b") : wxT("%B"), &tm); #else // !wxHAS_STRFTIME return GetEnglishMonthName(month, flags); #endif // wxHAS_STRFTIME/!wxHAS_STRFTIME @@ -873,7 +873,7 @@ wxString wxDateTime::GetMonthName(wxDateTime::Month month, /* static */ wxString wxDateTime::GetEnglishWeekDayName(WeekDay wday, NameFlags flags) { - wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") ); + wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, wxT("invalid weekday") ); static const char *weekdayNames[2][DAYS_PER_400_YEARS] = { @@ -894,7 +894,7 @@ wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday, wxDateTime::NameFlags flags) { #ifdef wxHAS_STRFTIME - wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, _T("invalid weekday") ); + wxCHECK_MSG( wday != Inv_WeekDay, wxEmptyString, wxT("invalid weekday") ); // take some arbitrary Sunday (but notice that the day should be such that // after adding wday to it below we still have a valid date, e.g. don't @@ -912,7 +912,7 @@ wxString wxDateTime::GetWeekDayName(wxDateTime::WeekDay wday, (void)mktime(&tm); // ... and call strftime() - return CallStrftime(flags == Name_Abbr ? _T("%a") : _T("%A"), &tm); + return CallStrftime(flags == Name_Abbr ? wxT("%a") : wxT("%A"), &tm); #else // !wxHAS_STRFTIME return GetEnglishWeekDayName(wday, flags); #endif // wxHAS_STRFTIME/!wxHAS_STRFTIME @@ -934,7 +934,7 @@ void wxDateTime::GetAmPmStrings(wxString *am, wxString *pm) // assert, even though it is a perfectly legal use. if ( am ) { - if (wxStrftime(buffer, WXSIZEOF(buffer), _T("%p"), &tm) > 0) + if (wxStrftime(buffer, WXSIZEOF(buffer), wxT("%p"), &tm) > 0) *am = wxString(buffer); else *am = wxString(); @@ -942,7 +942,7 @@ void wxDateTime::GetAmPmStrings(wxString *am, wxString *pm) if ( pm ) { tm.tm_hour = 13; - if (wxStrftime(buffer, WXSIZEOF(buffer), _T("%p"), &tm) > 0) + if (wxStrftime(buffer, WXSIZEOF(buffer), wxT("%p"), &tm) > 0) *pm = wxString(buffer); else *pm = wxString(); @@ -967,24 +967,24 @@ wxDateTime::Country wxDateTime::GetCountry() struct tm tmstruct; struct tm *tm = wxLocaltime_r(&t, &tmstruct); - wxString tz = CallStrftime(_T("%Z"), tm); - if ( tz == _T("WET") || tz == _T("WEST") ) + wxString tz = CallStrftime(wxT("%Z"), tm); + if ( tz == wxT("WET") || tz == wxT("WEST") ) { ms_country = UK; } - else if ( tz == _T("CET") || tz == _T("CEST") ) + else if ( tz == wxT("CET") || tz == wxT("CEST") ) { ms_country = Country_EEC; } - else if ( tz == _T("MSK") || tz == _T("MSD") ) + else if ( tz == wxT("MSK") || tz == wxT("MSD") ) { ms_country = Russia; } - else if ( tz == _T("AST") || tz == _T("ADT") || - tz == _T("EST") || tz == _T("EDT") || - tz == _T("CST") || tz == _T("CDT") || - tz == _T("MST") || tz == _T("MDT") || - tz == _T("PST") || tz == _T("PDT") ) + else if ( tz == wxT("AST") || tz == wxT("ADT") || + tz == wxT("EST") || tz == wxT("EDT") || + tz == wxT("CST") || tz == wxT("CDT") || + tz == wxT("MST") || tz == wxT("MDT") || + tz == wxT("PST") || tz == wxT("PDT") ) { ms_country = USA; } @@ -1083,7 +1083,7 @@ wxDateTime wxDateTime::GetBeginDST(int year, Country country) if ( !dt.SetToLastWeekDay(Sun, Mar, year) ) { // weird... - wxFAIL_MSG( _T("no last Sunday in March?") ); + wxFAIL_MSG( wxT("no last Sunday in March?") ); } dt += wxTimeSpan::Hours(1); @@ -1126,7 +1126,7 @@ wxDateTime wxDateTime::GetBeginDST(int year, Country country) if ( !dt.SetToLastWeekDay(Sun, Apr, year) ) { // weird... - wxFAIL_MSG( _T("no first Sunday in April?") ); + wxFAIL_MSG( wxT("no first Sunday in April?") ); } } else if ( year > 2006 ) @@ -1137,7 +1137,7 @@ wxDateTime wxDateTime::GetBeginDST(int year, Country country) if ( !dt.SetToWeekDay(Sun, 2, Mar, year) ) { // weird... - wxFAIL_MSG( _T("no second Sunday in March?") ); + wxFAIL_MSG( wxT("no second Sunday in March?") ); } } else @@ -1145,7 +1145,7 @@ wxDateTime wxDateTime::GetBeginDST(int year, Country country) if ( !dt.SetToWeekDay(Sun, 1, Apr, year) ) { // weird... - wxFAIL_MSG( _T("no first Sunday in April?") ); + wxFAIL_MSG( wxT("no first Sunday in April?") ); } } @@ -1192,7 +1192,7 @@ wxDateTime wxDateTime::GetEndDST(int year, Country country) if ( !dt.SetToLastWeekDay(Sun, Oct, year) ) { // weirder and weirder... - wxFAIL_MSG( _T("no last Sunday in October?") ); + wxFAIL_MSG( wxT("no last Sunday in October?") ); } dt += wxTimeSpan::Hours(1); @@ -1225,7 +1225,7 @@ wxDateTime wxDateTime::GetEndDST(int year, Country country) if ( !dt.SetToWeekDay(Sun, 1, Nov, year) ) { // weird... - wxFAIL_MSG( _T("no first Sunday in November?") ); + wxFAIL_MSG( wxT("no first Sunday in November?") ); } } else @@ -1235,7 +1235,7 @@ wxDateTime wxDateTime::GetEndDST(int year, Country country) if ( !dt.SetToLastWeekDay(Sun, Oct, year) ) { // weirder and weirder... - wxFAIL_MSG( _T("no last Sunday in October?") ); + wxFAIL_MSG( wxT("no last Sunday in October?") ); } } @@ -1282,7 +1282,7 @@ wxDateTime& wxDateTime::Set(const struct tm& tm) tm2.tm_sec)); } - wxFAIL_MSG( _T("mktime() failed") ); + wxFAIL_MSG( wxT("mktime() failed") ); *this = wxInvalidDateTime; @@ -1305,13 +1305,13 @@ wxDateTime& wxDateTime::Set(wxDateTime_t hour, second < 62 && minute < 60 && millisec < 1000, - _T("Invalid time in wxDateTime::Set()") ); + wxT("Invalid time in wxDateTime::Set()") ); // get the current date from system struct tm tmstruct; struct tm *tm = GetTmNow(&tmstruct); - wxDATETIME_CHECK( tm, _T("wxLocaltime_r() failed") ); + wxDATETIME_CHECK( tm, wxT("wxLocaltime_r() failed") ); // make a copy so it isn't clobbered by the call to mktime() below struct tm tm1(*tm); @@ -1345,12 +1345,12 @@ wxDateTime& wxDateTime::Set(wxDateTime_t day, second < 62 && minute < 60 && millisec < 1000, - _T("Invalid time in wxDateTime::Set()") ); + wxT("Invalid time in wxDateTime::Set()") ); ReplaceDefaultYearMonthWithCurrent(&year, &month); wxDATETIME_CHECK( (0 < day) && (day <= GetNumberOfDays(month, year)), - _T("Invalid date in wxDateTime::Set()") ); + wxT("Invalid date in wxDateTime::Set()") ); // the range of time_t type (inclusive) static const int yearMinInRange = 1970; @@ -1489,7 +1489,7 @@ unsigned long wxDateTime::GetAsDOS() const time_t ticks = GetTicks(); struct tm tmstruct; struct tm *tm = wxLocaltime_r(&ticks, &tmstruct); - wxCHECK_MSG( tm, ULONG_MAX, _T("time can't be represented in DOS format") ); + wxCHECK_MSG( tm, ULONG_MAX, wxT("time can't be represented in DOS format") ); long year = tm->tm_year; year -= 80; @@ -1521,7 +1521,7 @@ unsigned long wxDateTime::GetAsDOS() const wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") ); time_t time = GetTicks(); if ( time != (time_t)-1 ) @@ -1535,7 +1535,7 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const tm = wxLocaltime_r(&time, &tmstruct); // should never happen - wxCHECK_MSG( tm, Tm(), _T("wxLocaltime_r() failed") ); + wxCHECK_MSG( tm, Tm(), wxT("wxLocaltime_r() failed") ); } else { @@ -1550,7 +1550,7 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const tm = wxGmtime_r(&time, &tmstruct); // should never happen - wxCHECK_MSG( tm, Tm(), _T("wxGmtime_r() failed") ); + wxCHECK_MSG( tm, Tm(), wxT("wxGmtime_r() failed") ); } else { @@ -1593,7 +1593,7 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const // CREDIT: code below is by Scott E. Lee (but bugs are mine) - wxASSERT_MSG( jdn > -2, _T("JDN out of range") ); + wxASSERT_MSG( jdn > -2, wxT("JDN out of range") ); // calculate the century long temp = (jdn + JDN_OFFSET) * 4 - 1; @@ -1624,8 +1624,8 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const year -= 4800; // check that the algorithm gave us something reasonable - wxASSERT_MSG( (0 < month) && (month <= 12), _T("invalid month") ); - wxASSERT_MSG( (1 <= day) && (day < 32), _T("invalid day") ); + wxASSERT_MSG( (0 < month) && (month <= 12), wxT("invalid month") ); + wxASSERT_MSG( (1 <= day) && (day < 32), wxT("invalid day") ); // construct Tm from these values Tm tm; @@ -1650,7 +1650,7 @@ wxDateTime::Tm wxDateTime::GetTm(const TimeZone& tz) const wxDateTime& wxDateTime::SetYear(int year) { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") ); Tm tm(GetTm()); tm.year = year; @@ -1661,7 +1661,7 @@ wxDateTime& wxDateTime::SetYear(int year) wxDateTime& wxDateTime::SetMonth(Month month) { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") ); Tm tm(GetTm()); tm.mon = month; @@ -1672,7 +1672,7 @@ wxDateTime& wxDateTime::SetMonth(Month month) wxDateTime& wxDateTime::SetDay(wxDateTime_t mday) { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") ); Tm tm(GetTm()); tm.mday = mday; @@ -1683,7 +1683,7 @@ wxDateTime& wxDateTime::SetDay(wxDateTime_t mday) wxDateTime& wxDateTime::SetHour(wxDateTime_t hour) { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") ); Tm tm(GetTm()); tm.hour = hour; @@ -1694,7 +1694,7 @@ wxDateTime& wxDateTime::SetHour(wxDateTime_t hour) wxDateTime& wxDateTime::SetMinute(wxDateTime_t min) { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") ); Tm tm(GetTm()); tm.min = min; @@ -1705,7 +1705,7 @@ wxDateTime& wxDateTime::SetMinute(wxDateTime_t min) wxDateTime& wxDateTime::SetSecond(wxDateTime_t sec) { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") ); Tm tm(GetTm()); tm.sec = sec; @@ -1716,7 +1716,7 @@ wxDateTime& wxDateTime::SetSecond(wxDateTime_t sec) wxDateTime& wxDateTime::SetMillisecond(wxDateTime_t millisecond) { - wxASSERT_MSG( IsValid(), _T("invalid wxDateTime") ); + wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime") ); // we don't need to use GetTm() for this one m_time -= m_time % 1000l; @@ -1754,7 +1754,7 @@ wxDateTime& wxDateTime::Add(const wxDateSpan& diff) Set(tm); wxASSERT_MSG( IsSameTime(tm), - _T("Add(wxDateSpan) shouldn't modify time") ); + wxT("Add(wxDateSpan) shouldn't modify time") ); return *this; } @@ -1774,7 +1774,7 @@ wxDateTime wxDateTime::SetToWeekOfYear(int year, wxDateTime_t numWeek, WeekDay wd) { wxASSERT_MSG( numWeek > 0, - _T("invalid week number: weeks are counted from 1") ); + wxT("invalid week number: weeks are counted from 1") ); // Jan 4 always lies in the 1st week of the year wxDateTime dt(4, Jan, year); @@ -1838,7 +1838,7 @@ wxDateTime& wxDateTime::SetToLastMonthDay(Month month, wxDateTime& wxDateTime::SetToWeekDayInSameWeek(WeekDay weekday, WeekFlags flags) { - wxDATETIME_CHECK( weekday != Inv_WeekDay, _T("invalid weekday") ); + wxDATETIME_CHECK( weekday != Inv_WeekDay, wxT("invalid weekday") ); int wdayDst = weekday, wdayThis = GetWeekDay(); @@ -1878,7 +1878,7 @@ wxDateTime& wxDateTime::SetToWeekDayInSameWeek(WeekDay weekday, WeekFlags flags) wxDateTime& wxDateTime::SetToNextWeekDay(WeekDay weekday) { - wxDATETIME_CHECK( weekday != Inv_WeekDay, _T("invalid weekday") ); + wxDATETIME_CHECK( weekday != Inv_WeekDay, wxT("invalid weekday") ); int diff; WeekDay wdayThis = GetWeekDay(); @@ -1902,7 +1902,7 @@ wxDateTime& wxDateTime::SetToNextWeekDay(WeekDay weekday) wxDateTime& wxDateTime::SetToPrevWeekDay(WeekDay weekday) { - wxDATETIME_CHECK( weekday != Inv_WeekDay, _T("invalid weekday") ); + wxDATETIME_CHECK( weekday != Inv_WeekDay, wxT("invalid weekday") ); int diff; WeekDay wdayThis = GetWeekDay(); @@ -1929,7 +1929,7 @@ bool wxDateTime::SetToWeekDay(WeekDay weekday, Month month, int year) { - wxCHECK_MSG( weekday != Inv_WeekDay, false, _T("invalid weekday") ); + wxCHECK_MSG( weekday != Inv_WeekDay, false, wxT("invalid weekday") ); // we don't check explicitly that -5 <= n <= 5 because we will return false // anyhow in such case - but may be should still give an assert for it? @@ -2086,7 +2086,7 @@ wxDateTime& wxDateTime::SetToYearDay(wxDateTime::wxDateTime_t yday) { int year = GetYear(); wxDATETIME_CHECK( (0 < yday) && (yday <= GetNumberOfDays(year)), - _T("invalid year day") ); + wxT("invalid year day") ); bool isLeap = IsLeapYear(year); for ( Month mon = Jan; mon < Inv_Month; wxNextMonth(mon) ) @@ -2127,7 +2127,7 @@ double wxDateTime::GetRataDie() const int wxDateTime::IsDST(wxDateTime::Country country) const { wxCHECK_MSG( country == Country_Default, -1, - _T("country support not implemented") ); + wxT("country support not implemented") ); // use the C RTL for the dates in the standard range time_t timet = GetTicks(); @@ -2136,7 +2136,7 @@ int wxDateTime::IsDST(wxDateTime::Country country) const struct tm tmstruct; tm *tm = wxLocaltime_r(&timet, &tmstruct); - wxCHECK_MSG( tm, -1, _T("wxLocaltime_r() failed") ); + wxCHECK_MSG( tm, -1, wxT("wxLocaltime_r() failed") ); return tm->tm_isdst; } @@ -2279,7 +2279,7 @@ size_t wxDateTimeWorkDays::DoGetHolidaysInRange(const wxDateTime& dtStart, { if ( dtStart > dtEnd ) { - wxFAIL_MSG( _T("invalid date range in GetHolidaysInRange") ); + wxFAIL_MSG( wxT("invalid date range in GetHolidaysInRange") ); return 0u; } @@ -2319,7 +2319,7 @@ size_t wxDateTimeWorkDays::DoGetHolidaysInRange(const wxDateTime& dtStart, WXDLLIMPEXP_BASE void wxNextMonth(wxDateTime::Month& m) { - wxASSERT_MSG( m < wxDateTime::Inv_Month, _T("invalid month") ); + wxASSERT_MSG( m < wxDateTime::Inv_Month, wxT("invalid month") ); // no wrapping or the for loop above would never end! m = (wxDateTime::Month)(m + 1); @@ -2327,7 +2327,7 @@ WXDLLIMPEXP_BASE void wxNextMonth(wxDateTime::Month& m) WXDLLIMPEXP_BASE void wxPrevMonth(wxDateTime::Month& m) { - wxASSERT_MSG( m < wxDateTime::Inv_Month, _T("invalid month") ); + wxASSERT_MSG( m < wxDateTime::Inv_Month, wxT("invalid month") ); m = m == wxDateTime::Jan ? wxDateTime::Inv_Month : (wxDateTime::Month)(m - 1); @@ -2335,7 +2335,7 @@ WXDLLIMPEXP_BASE void wxPrevMonth(wxDateTime::Month& m) WXDLLIMPEXP_BASE void wxNextWDay(wxDateTime::WeekDay& wd) { - wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, _T("invalid week day") ); + wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, wxT("invalid week day") ); // no wrapping or the for loop above would never end! wd = (wxDateTime::WeekDay)(wd + 1); @@ -2343,7 +2343,7 @@ WXDLLIMPEXP_BASE void wxNextWDay(wxDateTime::WeekDay& wd) WXDLLIMPEXP_BASE void wxPrevWDay(wxDateTime::WeekDay& wd) { - wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, _T("invalid week day") ); + wxASSERT_MSG( wd < wxDateTime::Inv_WeekDay, wxT("invalid week day") ); wd = wd == wxDateTime::Sun ? wxDateTime::Inv_WeekDay : (wxDateTime::WeekDay)(wd - 1); diff --git a/src/common/datetimefmt.cpp b/src/common/datetimefmt.cpp index 72746ff37c..516d9a3347 100644 --- a/src/common/datetimefmt.cpp +++ b/src/common/datetimefmt.cpp @@ -311,7 +311,7 @@ ParseFormatAt(wxString::const_iterator& p, wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const { wxCHECK_MSG( !formatp.empty(), wxEmptyString, - _T("NULL format in wxDateTime::Format") ); + wxT("NULL format in wxDateTime::Format") ); wxString format = formatp; #ifdef __WXOSX__ @@ -324,7 +324,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const #ifdef wxHAS_STRFTIME time_t time = GetTicks(); - if ( (time != (time_t)-1) && !wxStrstr(format, _T("%l")) ) + if ( (time != (time_t)-1) && !wxStrstr(format, wxT("%l")) ) { // use strftime() struct tm tmstruct; @@ -335,7 +335,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const tm = wxLocaltime_r(&time, &tmstruct); // should never happen - wxCHECK_MSG( tm, wxEmptyString, _T("wxLocaltime_r() failed") ); + wxCHECK_MSG( tm, wxEmptyString, wxT("wxLocaltime_r() failed") ); } else { @@ -351,7 +351,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const tm = wxGmtime_r(&time, &tmstruct); // should never happen - wxCHECK_MSG( tm, wxEmptyString, _T("wxGmtime_r() failed") ); + wxCHECK_MSG( tm, wxEmptyString, wxT("wxGmtime_r() failed") ); } else { @@ -387,7 +387,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const wxString tmp, res, fmt; for ( wxString::const_iterator p = format.begin(); p != format.end(); ++p ) { - if ( *p != _T('%') ) + if ( *p != wxT('%') ) { // copy as is res += *p; @@ -398,17 +398,17 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const // set the default format switch ( (*++p).GetValue() ) { - case _T('Y'): // year has 4 digits - fmt = _T("%04d"); + case wxT('Y'): // year has 4 digits + fmt = wxT("%04d"); break; - case _T('j'): // day of year has 3 digits - case _T('l'): // milliseconds have 3 digits - fmt = _T("%03d"); + case wxT('j'): // day of year has 3 digits + case wxT('l'): // milliseconds have 3 digits + fmt = wxT("%03d"); break; - case _T('w'): // week day as number has only one - fmt = _T("%d"); + case wxT('w'): // week day as number has only one + fmt = wxT("%d"); break; default: @@ -416,7 +416,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const // the format is "%02d" (for all the rest) or we have the // field width preceding the format in which case it will // override the default format anyhow - fmt = _T("%02d"); + fmt = wxT("%02d"); } bool restart = true; @@ -427,21 +427,21 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const // start of the format specification switch ( (*p).GetValue() ) { - case _T('a'): // a weekday name - case _T('A'): + case wxT('a'): // a weekday name + case wxT('A'): // second parameter should be true for abbreviated names res += GetWeekDayName(tm.GetWeekDay(), - *p == _T('a') ? Name_Abbr : Name_Full); + *p == wxT('a') ? Name_Abbr : Name_Full); break; - case _T('b'): // a month name - case _T('B'): + case wxT('b'): // a month name + case wxT('B'): res += GetMonthName(tm.mon, - *p == _T('b') ? Name_Abbr : Name_Full); + *p == wxT('b') ? Name_Abbr : Name_Full); break; - case _T('c'): // locale default date and time representation - case _T('x'): // locale default date representation + case wxT('c'): // locale default date and time representation + case wxT('x'): // locale default date representation #ifdef wxHAS_STRFTIME // // the problem: there is no way to know what do these format @@ -513,7 +513,7 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const year -= 28; wxASSERT_MSG( year >= 1970 && year < 2000, - _T("logic error in wxDateTime::Format") ); + wxT("logic error in wxDateTime::Format") ); // use strftime() to format the same date but in supported @@ -534,8 +534,8 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const tmAdjusted.tm_mon = tm.mon; tmAdjusted.tm_year = year - 1900; tmAdjusted.tm_isdst = 0; // no DST, already adjusted - wxString str = CallStrftime(*p == _T('c') ? _T("%c") - : _T("%x"), + wxString str = CallStrftime(*p == wxT('c') ? wxT("%c") + : wxT("%x"), &tmAdjusted); // now replace the replacement year with the real year: @@ -565,15 +565,15 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const #endif // wxHAS_STRFTIME/!wxHAS_STRFTIME break; - case _T('d'): // day of a month (01-31) + case wxT('d'): // day of a month (01-31) res += wxString::Format(fmt, tm.mday); break; - case _T('H'): // hour in 24h format (00-23) + case wxT('H'): // hour in 24h format (00-23) res += wxString::Format(fmt, tm.hour); break; - case _T('I'): // hour in 12h format (01-12) + case wxT('I'): // hour in 12h format (01-12) { // 24h -> 12h, 0h -> 12h too int hour12 = tm.hour > 12 ? tm.hour - 12 @@ -582,76 +582,76 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const } break; - case _T('j'): // day of the year + case wxT('j'): // day of the year res += wxString::Format(fmt, GetDayOfYear(tz)); break; - case _T('l'): // milliseconds (NOT STANDARD) + case wxT('l'): // milliseconds (NOT STANDARD) res += wxString::Format(fmt, GetMillisecond(tz)); break; - case _T('m'): // month as a number (01-12) + case wxT('m'): // month as a number (01-12) res += wxString::Format(fmt, tm.mon + 1); break; - case _T('M'): // minute as a decimal number (00-59) + case wxT('M'): // minute as a decimal number (00-59) res += wxString::Format(fmt, tm.min); break; - case _T('p'): // AM or PM string + case wxT('p'): // AM or PM string #ifdef wxHAS_STRFTIME - res += CallStrftime(_T("%p"), &tmTimeOnly); + res += CallStrftime(wxT("%p"), &tmTimeOnly); #else // !wxHAS_STRFTIME res += (tmTimeOnly.tm_hour > 12) ? wxT("pm") : wxT("am"); #endif // wxHAS_STRFTIME/!wxHAS_STRFTIME break; - case _T('S'): // second as a decimal number (00-61) + case wxT('S'): // second as a decimal number (00-61) res += wxString::Format(fmt, tm.sec); break; - case _T('U'): // week number in the year (Sunday 1st week day) + case wxT('U'): // week number in the year (Sunday 1st week day) res += wxString::Format(fmt, GetWeekOfYear(Sunday_First, tz)); break; - case _T('W'): // week number in the year (Monday 1st week day) + case wxT('W'): // week number in the year (Monday 1st week day) res += wxString::Format(fmt, GetWeekOfYear(Monday_First, tz)); break; - case _T('w'): // weekday as a number (0-6), Sunday = 0 + case wxT('w'): // weekday as a number (0-6), Sunday = 0 res += wxString::Format(fmt, tm.GetWeekDay()); break; - // case _T('x'): -- handled with "%c" + // case wxT('x'): -- handled with "%c" - case _T('X'): // locale default time representation + case wxT('X'): // locale default time representation // just use strftime() to format the time for us #ifdef wxHAS_STRFTIME - res += CallStrftime(_T("%X"), &tmTimeOnly); + res += CallStrftime(wxT("%X"), &tmTimeOnly); #else // !wxHAS_STRFTIME res += wxString::Format(wxT("%02d:%02d:%02d"),tm.hour, tm.min, tm.sec); #endif // wxHAS_STRFTIME/!wxHAS_STRFTIME break; - case _T('y'): // year without century (00-99) + case wxT('y'): // year without century (00-99) res += wxString::Format(fmt, tm.year % 100); break; - case _T('Y'): // year with century + case wxT('Y'): // year with century res += wxString::Format(fmt, tm.year); break; - case _T('Z'): // timezone name + case wxT('Z'): // timezone name #ifdef wxHAS_STRFTIME - res += CallStrftime(_T("%Z"), &tmTimeOnly); + res += CallStrftime(wxT("%Z"), &tmTimeOnly); #endif break; default: // is it the format width? fmt.Empty(); - while ( *p == _T('-') || *p == _T('+') || - *p == _T(' ') || wxIsdigit(*p) ) + while ( *p == wxT('-') || *p == wxT('+') || + *p == wxT(' ') || wxIsdigit(*p) ) { fmt += *p; } @@ -659,8 +659,8 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const if ( !fmt.empty() ) { // we've only got the flags and width so far in fmt - fmt.Prepend(_T('%')); - fmt.Append(_T('d')); + fmt.Prepend(wxT('%')); + fmt.Append(wxT('d')); restart = true; @@ -668,19 +668,19 @@ wxString wxDateTime::Format(const wxString& formatp, const TimeZone& tz) const } // no, it wasn't the width - wxFAIL_MSG(_T("unknown format specificator")); + wxFAIL_MSG(wxT("unknown format specificator")); // fall through and just copy it nevertheless - case _T('%'): // a percent sign + case wxT('%'): // a percent sign res += *p; break; case 0: // the end of string - wxFAIL_MSG(_T("missing format at the end of string")); + wxFAIL_MSG(wxT("missing format at the end of string")); // just put the '%' which was the last char in format - res += _T('%'); + res += wxT('%'); break; } } @@ -852,7 +852,7 @@ wxDateTime::ParseRfc822Date(const wxString& date, wxString::const_iterator *end) +1, +2, +3, +4, +5, +6, +7, +8, +9, +10, +11, +12, 0 }; - if ( *p < _T('A') || *p > _T('Z') || *p == _T('J') ) + if ( *p < wxT('A') || *p > wxT('Z') || *p == wxT('J') ) return false; offset = offsets[*p++ - 'A']; @@ -861,27 +861,27 @@ wxDateTime::ParseRfc822Date(const wxString& date, wxString::const_iterator *end) { // abbreviation const wxString tz(p, date.end()); - if ( tz == _T("UT") || tz == _T("UTC") || tz == _T("GMT") ) + if ( tz == wxT("UT") || tz == wxT("UTC") || tz == wxT("GMT") ) offset = 0; - else if ( tz == _T("AST") ) + else if ( tz == wxT("AST") ) offset = AST - GMT0; - else if ( tz == _T("ADT") ) + else if ( tz == wxT("ADT") ) offset = ADT - GMT0; - else if ( tz == _T("EST") ) + else if ( tz == wxT("EST") ) offset = EST - GMT0; - else if ( tz == _T("EDT") ) + else if ( tz == wxT("EDT") ) offset = EDT - GMT0; - else if ( tz == _T("CST") ) + else if ( tz == wxT("CST") ) offset = CST - GMT0; - else if ( tz == _T("CDT") ) + else if ( tz == wxT("CDT") ) offset = CDT - GMT0; - else if ( tz == _T("MST") ) + else if ( tz == wxT("MST") ) offset = MST - GMT0; - else if ( tz == _T("MDT") ) + else if ( tz == wxT("MDT") ) offset = MDT - GMT0; - else if ( tz == _T("PST") ) + else if ( tz == wxT("PST") ) offset = PST - GMT0; - else if ( tz == _T("PDT") ) + else if ( tz == wxT("PDT") ) offset = PDT - GMT0; else return false; @@ -945,7 +945,7 @@ wxDateTime::ParseFormat(const wxString& date, const wxString::const_iterator end = date.end(); for ( wxString::const_iterator fmt = format.begin(); fmt != format.end(); ++fmt ) { - if ( *fmt != _T('%') ) + if ( *fmt != wxT('%') ) { if ( wxIsspace(*fmt) ) { @@ -986,16 +986,16 @@ wxDateTime::ParseFormat(const wxString& date, { switch ( (*fmt).GetValue() ) { - case _T('Y'): // year has 4 digits + case wxT('Y'): // year has 4 digits width = 4; break; - case _T('j'): // day of year has 3 digits - case _T('l'): // milliseconds have 3 digits + case wxT('j'): // day of year has 3 digits + case wxT('l'): // milliseconds have 3 digits width = 3; break; - case _T('w'): // week day as number has only one + case wxT('w'): // week day as number has only one width = 1; break; @@ -1008,8 +1008,8 @@ wxDateTime::ParseFormat(const wxString& date, // then the format itself switch ( (*fmt).GetValue() ) { - case _T('a'): // a weekday name - case _T('A'): + case wxT('a'): // a weekday name + case wxT('A'): { wday = GetWeekDayFromName ( @@ -1026,8 +1026,8 @@ wxDateTime::ParseFormat(const wxString& date, haveWDay = true; break; - case _T('b'): // a month name - case _T('B'): + case wxT('b'): // a month name + case wxT('B'): { mon = GetMonthFromName ( @@ -1044,7 +1044,7 @@ wxDateTime::ParseFormat(const wxString& date, haveMon = true; break; - case _T('c'): // locale default date and time representation + case wxT('c'): // locale default date and time representation { wxDateTime dt; @@ -1084,7 +1084,7 @@ wxDateTime::ParseFormat(const wxString& date, } break; - case _T('d'): // day of a month (01-31) + case wxT('d'): // day of a month (01-31) case 'e': // day of a month (1-31) (GNU extension) if ( !GetNumericToken(width, input, end, &num) || (num > 31) || (num < 1) ) @@ -1099,7 +1099,7 @@ wxDateTime::ParseFormat(const wxString& date, mday = (wxDateTime_t)num; break; - case _T('H'): // hour in 24h format (00-23) + case wxT('H'): // hour in 24h format (00-23) if ( !GetNumericToken(width, input, end, &num) || (num > 23) ) { // no match @@ -1110,7 +1110,7 @@ wxDateTime::ParseFormat(const wxString& date, hour = (wxDateTime_t)num; break; - case _T('I'): // hour in 12h format (01-12) + case wxT('I'): // hour in 12h format (01-12) if ( !GetNumericToken(width, input, end, &num) || !num || (num > 12) ) { @@ -1123,7 +1123,7 @@ wxDateTime::ParseFormat(const wxString& date, hour = (wxDateTime_t)(num % 12); // 12 should be 0 break; - case _T('j'): // day of the year + case wxT('j'): // day of the year if ( !GetNumericToken(width, input, end, &num) || !num || (num > 366) ) { @@ -1135,7 +1135,7 @@ wxDateTime::ParseFormat(const wxString& date, yday = (wxDateTime_t)num; break; - case _T('l'): // milliseconds (0-999) + case wxT('l'): // milliseconds (0-999) if ( !GetNumericToken(width, input, end, &num) ) return false; @@ -1143,7 +1143,7 @@ wxDateTime::ParseFormat(const wxString& date, msec = (wxDateTime_t)num; break; - case _T('m'): // month as a number (01-12) + case wxT('m'): // month as a number (01-12) if ( !GetNumericToken(width, input, end, &num) || !num || (num > 12) ) { @@ -1155,7 +1155,7 @@ wxDateTime::ParseFormat(const wxString& date, mon = (Month)(num - 1); break; - case _T('M'): // minute as a decimal number (00-59) + case wxT('M'): // minute as a decimal number (00-59) if ( !GetNumericToken(width, input, end, &num) || (num > 59) ) { @@ -1167,7 +1167,7 @@ wxDateTime::ParseFormat(const wxString& date, min = (wxDateTime_t)num; break; - case _T('p'): // AM or PM string + case wxT('p'): // AM or PM string { wxString am, pm; GetAmPmStrings(&am, &pm); @@ -1193,7 +1193,7 @@ wxDateTime::ParseFormat(const wxString& date, } break; - case _T('r'): // time as %I:%M:%S %p + case wxT('r'): // time as %I:%M:%S %p { wxDateTime dt; if ( !dt.ParseFormat(wxString(input, end), @@ -1209,7 +1209,7 @@ wxDateTime::ParseFormat(const wxString& date, } break; - case _T('R'): // time as %H:%M + case wxT('R'): // time as %H:%M { const wxDateTime dt = ParseFormatAt(input, end, wxS("%H:%M")); @@ -1225,7 +1225,7 @@ wxDateTime::ParseFormat(const wxString& date, } break; - case _T('S'): // second as a decimal number (00-61) + case wxT('S'): // second as a decimal number (00-61) if ( !GetNumericToken(width, input, end, &num) || (num > 61) ) { @@ -1237,7 +1237,7 @@ wxDateTime::ParseFormat(const wxString& date, sec = (wxDateTime_t)num; break; - case _T('T'): // time as %H:%M:%S + case wxT('T'): // time as %H:%M:%S { const wxDateTime dt = ParseFormatAt(input, end, wxS("%H:%M:%S")); @@ -1255,7 +1255,7 @@ wxDateTime::ParseFormat(const wxString& date, } break; - case _T('w'): // weekday as a number (0-6), Sunday = 0 + case wxT('w'): // weekday as a number (0-6), Sunday = 0 if ( !GetNumericToken(width, input, end, &num) || (wday > 6) ) { @@ -1267,7 +1267,7 @@ wxDateTime::ParseFormat(const wxString& date, wday = (WeekDay)num; break; - case _T('x'): // locale default date representation + case wxT('x'): // locale default date representation { wxString fmtDate = wxLocale::GetInfo(wxLOCALE_SHORT_DATE_FMT), @@ -1315,7 +1315,7 @@ wxDateTime::ParseFormat(const wxString& date, break; - case _T('X'): // locale default time representation + case wxT('X'): // locale default time representation { wxString fmtTime = wxLocale::GetInfo(wxLOCALE_TIME_FMT), fmtTimeAlt; @@ -1345,7 +1345,7 @@ wxDateTime::ParseFormat(const wxString& date, } break; - case _T('y'): // year without century (00-99) + case wxT('y'): // year without century (00-99) if ( !GetNumericToken(width, input, end, &num) || (num > 99) ) { @@ -1360,7 +1360,7 @@ wxDateTime::ParseFormat(const wxString& date, year = (num > 30 ? 1900 : 2000) + (wxDateTime_t)num; break; - case _T('Y'): // year with century + case wxT('Y'): // year with century if ( !GetNumericToken(width, input, end, &num) ) { // no match @@ -1371,14 +1371,14 @@ wxDateTime::ParseFormat(const wxString& date, year = (wxDateTime_t)num; break; - case _T('Z'): // timezone name + case wxT('Z'): // timezone name // FIXME: currently we just ignore everything that looks like a // time zone here GetAlphaToken(input, end); break; - case _T('%'): // a percent sign - if ( *input++ != _T('%') ) + case wxT('%'): // a percent sign + if ( *input++ != wxT('%') ) { // no match return false; @@ -1386,7 +1386,7 @@ wxDateTime::ParseFormat(const wxString& date, break; case 0: // the end of string - wxFAIL_MSG(_T("unexpected format end")); + wxFAIL_MSG(wxT("unexpected format end")); // fall through @@ -2019,7 +2019,7 @@ wxString wxTimeSpan::Format(const wxString& format) const } wxCHECK_MSG( !format.empty(), wxEmptyString, - _T("NULL format in wxTimeSpan::Format") ); + wxT("NULL format in wxTimeSpan::Format") ); wxString str; str.Alloc(format.length()); @@ -2044,10 +2044,10 @@ wxString wxTimeSpan::Format(const wxString& format) const { wxChar ch = *pch; - if ( ch == _T('%') ) + if ( ch == wxT('%') ) { // the start of the format specification of the printf() below - wxString fmtPrefix(_T('%')); + wxString fmtPrefix(wxT('%')); // the number long n; @@ -2059,16 +2059,16 @@ wxString wxTimeSpan::Format(const wxString& format) const switch ( ch ) { default: - wxFAIL_MSG( _T("invalid format character") ); + wxFAIL_MSG( wxT("invalid format character") ); // fall through - case _T('%'): + case wxT('%'): str += ch; // skip the part below switch continue; - case _T('D'): + case wxT('D'): n = GetDays(); if ( partBiggest < Part_Day ) { @@ -2080,12 +2080,12 @@ wxString wxTimeSpan::Format(const wxString& format) const } break; - case _T('E'): + case wxT('E'): partBiggest = Part_Week; n = GetWeeks(); break; - case _T('H'): + case wxT('H'): n = GetHours(); if ( partBiggest < Part_Hour ) { @@ -2099,7 +2099,7 @@ wxString wxTimeSpan::Format(const wxString& format) const digits = 2; break; - case _T('l'): + case wxT('l'): n = GetMilliseconds().ToLong(); if ( partBiggest < Part_MSec ) { @@ -2111,7 +2111,7 @@ wxString wxTimeSpan::Format(const wxString& format) const digits = 3; break; - case _T('M'): + case wxT('M'): n = GetMinutes(); if ( partBiggest < Part_Min ) { @@ -2125,7 +2125,7 @@ wxString wxTimeSpan::Format(const wxString& format) const digits = 2; break; - case _T('S'): + case wxT('S'): n = GetSeconds().ToLong(); if ( partBiggest < Part_Sec ) { @@ -2142,10 +2142,10 @@ wxString wxTimeSpan::Format(const wxString& format) const if ( digits ) { - fmtPrefix << _T("0") << digits; + fmtPrefix << wxT("0") << digits; } - str += wxString::Format(fmtPrefix + _T("ld"), n); + str += wxString::Format(fmtPrefix + wxT("ld"), n); } else { diff --git a/src/common/dcbase.cpp b/src/common/dcbase.cpp index 3427fe362e..d698009c31 100644 --- a/src/common/dcbase.cpp +++ b/src/common/dcbase.cpp @@ -569,7 +569,7 @@ void wxDCImpl::GetMultiLineTextExtent(const wxString& text, wxString curLine; for ( wxString::const_iterator pc = text.begin(); ; ++pc ) { - if ( pc == text.end() || *pc == _T('\n') ) + if ( pc == text.end() || *pc == wxT('\n') ) { if ( curLine.empty() ) { @@ -585,7 +585,7 @@ void wxDCImpl::GetMultiLineTextExtent(const wxString& text, if ( !heightLineDefault ) { // but we don't know it yet - choose something reasonable - DoGetTextExtent(_T("W"), NULL, &heightLineDefault, + DoGetTextExtent(wxT("W"), NULL, &heightLineDefault, NULL, NULL, font); } @@ -656,7 +656,7 @@ wxDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, wxCoord ysrcMask) { wxCHECK_MSG( srcWidth && srcHeight && dstWidth && dstHeight, false, - _T("invalid blit size") ); + wxT("invalid blit size") ); // emulate the stretching by modifying the DC scale double xscale = (double)srcWidth/dstWidth, diff --git a/src/common/dcbufcmn.cpp b/src/common/dcbufcmn.cpp index 58d40b5f9b..1d339f8ba0 100644 --- a/src/common/dcbufcmn.cpp +++ b/src/common/dcbufcmn.cpp @@ -124,8 +124,8 @@ void wxBufferedDC::UseBuffer(wxCoord w, wxCoord h) void wxBufferedDC::UnMask() { - wxCHECK_RET( m_dc, _T("no underlying wxDC?") ); - wxASSERT_MSG( m_buffer && m_buffer->IsOk(), _T("invalid backing store") ); + wxCHECK_RET( m_dc, wxT("no underlying wxDC?") ); + wxASSERT_MSG( m_buffer && m_buffer->IsOk(), wxT("invalid backing store") ); wxCoord x = 0, y = 0; diff --git a/src/common/debugrpt.cpp b/src/common/debugrpt.cpp index e9044154a7..85a8a2f6c8 100644 --- a/src/common/debugrpt.cpp +++ b/src/common/debugrpt.cpp @@ -87,13 +87,13 @@ protected: static inline void HexProperty(wxXmlNode *node, const wxChar *name, unsigned long value) { - node->AddAttribute(name, wxString::Format(_T("%08lx"), value)); + node->AddAttribute(name, wxString::Format(wxT("%08lx"), value)); } static inline void NumProperty(wxXmlNode *node, const wxChar *name, unsigned long value) { - node->AddAttribute(name, wxString::Format(_T("%lu"), value)); + node->AddAttribute(name, wxString::Format(wxT("%lu"), value)); } static inline void @@ -109,7 +109,7 @@ TextElement(wxXmlNode *node, const wxChar *name, const wxString& value) static inline void HexElement(wxXmlNode *node, const wxChar *name, unsigned long value) { - TextElement(node, name, wxString::Format(_T("%08lx"), value)); + TextElement(node, name, wxString::Format(wxT("%08lx"), value)); } #endif // wxUSE_CRASHREPORT @@ -122,49 +122,49 @@ void XmlStackWalker::OnStackFrame(const wxStackFrame& frame) { m_isOk = true; - wxXmlNode *nodeFrame = new wxXmlNode(wxXML_ELEMENT_NODE, _T("frame")); + wxXmlNode *nodeFrame = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("frame")); m_nodeStack->AddChild(nodeFrame); - NumProperty(nodeFrame, _T("level"), frame.GetLevel()); + NumProperty(nodeFrame, wxT("level"), frame.GetLevel()); wxString func = frame.GetName(); if ( !func.empty() ) { - nodeFrame->AddAttribute(_T("function"), func); - HexProperty(nodeFrame, _T("offset"), frame.GetOffset()); + nodeFrame->AddAttribute(wxT("function"), func); + HexProperty(nodeFrame, wxT("offset"), frame.GetOffset()); } if ( frame.HasSourceLocation() ) { - nodeFrame->AddAttribute(_T("file"), frame.GetFileName()); - NumProperty(nodeFrame, _T("line"), frame.GetLine()); + nodeFrame->AddAttribute(wxT("file"), frame.GetFileName()); + NumProperty(nodeFrame, wxT("line"), frame.GetLine()); } const size_t nParams = frame.GetParamCount(); if ( nParams ) { - wxXmlNode *nodeParams = new wxXmlNode(wxXML_ELEMENT_NODE, _T("parameters")); + wxXmlNode *nodeParams = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("parameters")); nodeFrame->AddChild(nodeParams); for ( size_t n = 0; n < nParams; n++ ) { wxXmlNode * - nodeParam = new wxXmlNode(wxXML_ELEMENT_NODE, _T("parameter")); + nodeParam = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("parameter")); nodeParams->AddChild(nodeParam); - NumProperty(nodeParam, _T("number"), n); + NumProperty(nodeParam, wxT("number"), n); wxString type, name, value; if ( !frame.GetParam(n, &type, &name, &value) ) continue; if ( !type.empty() ) - TextElement(nodeParam, _T("type"), type); + TextElement(nodeParam, wxT("type"), type); if ( !name.empty() ) - TextElement(nodeParam, _T("name"), name); + TextElement(nodeParam, wxT("name"), name); if ( !value.empty() ) - TextElement(nodeParam, _T("value"), value); + TextElement(nodeParam, wxT("value"), value); } } } @@ -191,12 +191,12 @@ wxDebugReport::wxDebugReport() wxFileName fn; fn.AssignTempFileName(appname); #if wxUSE_DATETIME - m_dir.Printf(_T("%s%c%s_dbgrpt-%lu-%s"), + m_dir.Printf(wxT("%s%c%s_dbgrpt-%lu-%s"), fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(), wxGetProcessId(), - wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str()); + wxDateTime::Now().Format(wxT("%Y%m%dT%H%M%S")).c_str()); #else - m_dir.Printf(_T("%s%c%s_dbgrpt-%lu"), + m_dir.Printf(wxT("%s%c%s_dbgrpt-%lu"), fn.GetPath().c_str(), wxFILE_SEP_PATH, appname.c_str(), wxGetProcessId()); #endif @@ -255,7 +255,7 @@ wxString wxDebugReport::GetReportName() const if(wxTheApp) return wxTheApp->GetAppDisplayName(); - return _T("wx"); + return wxT("wx"); } void @@ -276,7 +276,7 @@ wxDebugReport::AddFile(const wxString& filename, const wxString& description) name = filename; wxASSERT_MSG( wxFileName(GetDirectory(), name).FileExists(), - _T("file should exist in debug report directory") ); + wxT("file should exist in debug report directory") ); } m_files.Add(name); @@ -289,10 +289,10 @@ wxDebugReport::AddText(const wxString& filename, const wxString& description) { wxASSERT_MSG( !wxFileName(filename).IsAbsolute(), - _T("filename should be relative to debug report directory") ); + wxT("filename should be relative to debug report directory") ); wxFileName fn(GetDirectory(), filename); - wxFFile file(fn.GetFullPath(), _T("w")); + wxFFile file(fn.GetFullPath(), wxT("w")); if ( !file.IsOpened() || !file.Write(text) ) return false; @@ -304,7 +304,7 @@ wxDebugReport::AddText(const wxString& filename, void wxDebugReport::RemoveFile(const wxString& name) { const int n = m_files.Index(name); - wxCHECK_RET( n != wxNOT_FOUND, _T("No such file in wxDebugReport") ); + wxCHECK_RET( n != wxNOT_FOUND, wxT("No such file in wxDebugReport") ); m_files.RemoveAt(n); m_descriptions.RemoveAt(n); @@ -348,7 +348,7 @@ void wxDebugReport::AddAll(Context context) bool wxDebugReport::DoAddSystemInfo(wxXmlNode *nodeSystemInfo) { - nodeSystemInfo->AddAttribute(_T("description"), wxGetOsDescription()); + nodeSystemInfo->AddAttribute(wxT("description"), wxGetOsDescription()); return true; } @@ -364,27 +364,27 @@ bool wxDebugReport::DoAddLoadedModules(wxXmlNode *nodeModules) { const wxDynamicLibraryDetails& info = modules[n]; - wxXmlNode *nodeModule = new wxXmlNode(wxXML_ELEMENT_NODE, _T("module")); + wxXmlNode *nodeModule = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("module")); nodeModules->AddChild(nodeModule); wxString path = info.GetPath(); if ( path.empty() ) path = info.GetName(); if ( !path.empty() ) - nodeModule->AddAttribute(_T("path"), path); + nodeModule->AddAttribute(wxT("path"), path); void *addr = NULL; size_t len = 0; if ( info.GetAddress(&addr, &len) ) { - HexProperty(nodeModule, _T("address"), wxPtrToUInt(addr)); - HexProperty(nodeModule, _T("size"), len); + HexProperty(nodeModule, wxT("address"), wxPtrToUInt(addr)); + HexProperty(nodeModule, wxT("size"), len); } wxString ver = info.GetVersion(); if ( !ver.empty() ) { - nodeModule->AddAttribute(_T("version"), ver); + nodeModule->AddAttribute(wxT("version"), ver); } } @@ -398,35 +398,35 @@ bool wxDebugReport::DoAddExceptionInfo(wxXmlNode *nodeContext) if ( !c.code ) return false; - wxXmlNode *nodeExc = new wxXmlNode(wxXML_ELEMENT_NODE, _T("exception")); + wxXmlNode *nodeExc = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("exception")); nodeContext->AddChild(nodeExc); - HexProperty(nodeExc, _T("code"), c.code); - nodeExc->AddAttribute(_T("name"), c.GetExceptionString()); - HexProperty(nodeExc, _T("address"), wxPtrToUInt(c.addr)); + HexProperty(nodeExc, wxT("code"), c.code); + nodeExc->AddAttribute(wxT("name"), c.GetExceptionString()); + HexProperty(nodeExc, wxT("address"), wxPtrToUInt(c.addr)); #ifdef __INTEL__ - wxXmlNode *nodeRegs = new wxXmlNode(wxXML_ELEMENT_NODE, _T("registers")); + wxXmlNode *nodeRegs = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("registers")); nodeContext->AddChild(nodeRegs); - HexElement(nodeRegs, _T("eax"), c.regs.eax); - HexElement(nodeRegs, _T("ebx"), c.regs.ebx); - HexElement(nodeRegs, _T("ecx"), c.regs.edx); - HexElement(nodeRegs, _T("edx"), c.regs.edx); - HexElement(nodeRegs, _T("esi"), c.regs.esi); - HexElement(nodeRegs, _T("edi"), c.regs.edi); - - HexElement(nodeRegs, _T("ebp"), c.regs.ebp); - HexElement(nodeRegs, _T("esp"), c.regs.esp); - HexElement(nodeRegs, _T("eip"), c.regs.eip); - - HexElement(nodeRegs, _T("cs"), c.regs.cs); - HexElement(nodeRegs, _T("ds"), c.regs.ds); - HexElement(nodeRegs, _T("es"), c.regs.es); - HexElement(nodeRegs, _T("fs"), c.regs.fs); - HexElement(nodeRegs, _T("gs"), c.regs.gs); - HexElement(nodeRegs, _T("ss"), c.regs.ss); - - HexElement(nodeRegs, _T("flags"), c.regs.flags); + HexElement(nodeRegs, wxT("eax"), c.regs.eax); + HexElement(nodeRegs, wxT("ebx"), c.regs.ebx); + HexElement(nodeRegs, wxT("ecx"), c.regs.edx); + HexElement(nodeRegs, wxT("edx"), c.regs.edx); + HexElement(nodeRegs, wxT("esi"), c.regs.esi); + HexElement(nodeRegs, wxT("edi"), c.regs.edi); + + HexElement(nodeRegs, wxT("ebp"), c.regs.ebp); + HexElement(nodeRegs, wxT("esp"), c.regs.esp); + HexElement(nodeRegs, wxT("eip"), c.regs.eip); + + HexElement(nodeRegs, wxT("cs"), c.regs.cs); + HexElement(nodeRegs, wxT("ds"), c.regs.ds); + HexElement(nodeRegs, wxT("es"), c.regs.es); + HexElement(nodeRegs, wxT("fs"), c.regs.fs); + HexElement(nodeRegs, wxT("gs"), c.regs.gs); + HexElement(nodeRegs, wxT("ss"), c.regs.ss); + + HexElement(nodeRegs, wxT("flags"), c.regs.flags); #endif // __INTEL__ return true; @@ -439,25 +439,25 @@ bool wxDebugReport::DoAddExceptionInfo(wxXmlNode *nodeContext) bool wxDebugReport::AddContext(wxDebugReport::Context ctx) { - wxCHECK_MSG( IsOk(), false, _T("use IsOk() first") ); + wxCHECK_MSG( IsOk(), false, wxT("use IsOk() first") ); // create XML dump of current context wxXmlDocument xmldoc; - wxXmlNode *nodeRoot = new wxXmlNode(wxXML_ELEMENT_NODE, _T("report")); + wxXmlNode *nodeRoot = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("report")); xmldoc.SetRoot(nodeRoot); - nodeRoot->AddAttribute(_T("version"), _T("1.0")); - nodeRoot->AddAttribute(_T("kind"), ctx == Context_Current ? _T("user") - : _T("exception")); + nodeRoot->AddAttribute(wxT("version"), wxT("1.0")); + nodeRoot->AddAttribute(wxT("kind"), ctx == Context_Current ? wxT("user") + : wxT("exception")); // add system information - wxXmlNode *nodeSystemInfo = new wxXmlNode(wxXML_ELEMENT_NODE, _T("system")); + wxXmlNode *nodeSystemInfo = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("system")); if ( DoAddSystemInfo(nodeSystemInfo) ) nodeRoot->AddChild(nodeSystemInfo); else delete nodeSystemInfo; // add information about the loaded modules - wxXmlNode *nodeModules = new wxXmlNode(wxXML_ELEMENT_NODE, _T("modules")); + wxXmlNode *nodeModules = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("modules")); if ( DoAddLoadedModules(nodeModules) ) nodeRoot->AddChild(nodeModules); else @@ -467,7 +467,7 @@ bool wxDebugReport::AddContext(wxDebugReport::Context ctx) // current context is not very interesting otherwise if ( ctx == Context_Exception ) { - wxXmlNode *nodeContext = new wxXmlNode(wxXML_ELEMENT_NODE, _T("context")); + wxXmlNode *nodeContext = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("context")); if ( DoAddExceptionInfo(nodeContext) ) nodeRoot->AddChild(nodeContext); else @@ -476,7 +476,7 @@ bool wxDebugReport::AddContext(wxDebugReport::Context ctx) // add stack traceback #if wxUSE_STACKWALKER - wxXmlNode *nodeStack = new wxXmlNode(wxXML_ELEMENT_NODE, _T("stack")); + wxXmlNode *nodeStack = new wxXmlNode(wxXML_ELEMENT_NODE, wxT("stack")); XmlStackWalker sw(nodeStack); #if wxUSE_ON_FATAL_EXCEPTION if ( ctx == Context_Exception ) @@ -500,7 +500,7 @@ bool wxDebugReport::AddContext(wxDebugReport::Context ctx) // save the entire context dump in a file - wxFileName fn(m_dir, GetReportName(), _T("xml")); + wxFileName fn(m_dir, GetReportName(), wxT("xml")); if ( !xmldoc.Save(fn.GetFullPath()) ) return false; @@ -520,9 +520,9 @@ bool wxDebugReport::AddContext(wxDebugReport::Context ctx) bool wxDebugReport::AddDump(Context ctx) { - wxCHECK_MSG( IsOk(), false, _T("use IsOk() first") ); + wxCHECK_MSG( IsOk(), false, wxT("use IsOk() first") ); - wxFileName fn(m_dir, GetReportName(), _T("dmp")); + wxFileName fn(m_dir, GetReportName(), wxT("dmp")); wxCrashReport::SetFileName(fn.GetFullPath()); if ( !(ctx == Context_Exception ? wxCrashReport::Generate() @@ -565,8 +565,8 @@ bool wxDebugReport::Process() bool wxDebugReport::DoProcess() { wxString msg(_("A debug report has been generated. It can be found in")); - msg << _T("\n") - _T("\t") << GetDirectory() << _T("\n\n") + msg << wxT("\n") + wxT("\t") << GetDirectory() << wxT("\n\n") << _("And includes the following files:\n"); wxString name, desc; @@ -579,7 +579,7 @@ bool wxDebugReport::DoProcess() msg += _("\nPlease send this report to the program maintainer, thank you!\n"); - wxLogMessage(_T("%s"), msg.c_str()); + wxLogMessage(wxT("%s"), msg.c_str()); // we have to do this or the report would be deleted, and we don't even // have any way to ask the user if he wants to keep it from here @@ -605,8 +605,8 @@ bool wxDebugReportCompress::DoProcess() return false; // create the streams - wxFileName fn(GetDirectory(), GetReportName(), _T("zip")); - wxFFileOutputStream os(fn.GetFullPath(), _T("wb")); + wxFileName fn(GetDirectory(), GetReportName(), wxT("zip")); + wxFFileOutputStream os(fn.GetFullPath(), wxT("wb")); wxZipOutputStream zos(os, 9); // add all files to the ZIP one @@ -647,8 +647,8 @@ wxDebugReportUpload::wxDebugReportUpload(const wxString& url, m_inputField(input), m_curlCmd(curl) { - if ( m_uploadURL.Last() != _T('/') ) - m_uploadURL += _T('/'); + if ( m_uploadURL.Last() != wxT('/') ) + m_uploadURL += wxT('/'); m_uploadURL += action; } @@ -661,7 +661,7 @@ bool wxDebugReportUpload::DoProcess() wxArrayString output, errors; int rc = wxExecute(wxString::Format ( - _T("%s -F %s=@\"%s\" %s"), + wxT("%s -F %s=@\"%s\" %s"), m_curlCmd.c_str(), m_inputField.c_str(), GetCompressedFileName().c_str(), @@ -680,7 +680,7 @@ bool wxDebugReportUpload::DoProcess() { for ( size_t n = 0; n < count; n++ ) { - wxLogWarning(_T("%s"), errors[n].c_str()); + wxLogWarning(wxT("%s"), errors[n].c_str()); } } diff --git a/src/common/dircmn.cpp b/src/common/dircmn.cpp index eab16e5bd8..a3862feb9d 100644 --- a/src/common/dircmn.cpp +++ b/src/common/dircmn.cpp @@ -81,7 +81,7 @@ size_t wxDir::Traverse(wxDirTraverser& sink, int flags) const { wxCHECK_MSG( IsOpened(), (size_t)-1, - _T("dir must be opened before traversing it") ); + wxT("dir must be opened before traversing it") ); // the total number of files found size_t nFiles = 0; @@ -103,7 +103,7 @@ size_t wxDir::Traverse(wxDirTraverser& sink, switch ( sink.OnDir(fulldirname) ) { default: - wxFAIL_MSG(_T("unexpected OnDir() return value") ); + wxFAIL_MSG(wxT("unexpected OnDir() return value") ); // fall through case wxDIR_STOP: @@ -131,7 +131,7 @@ size_t wxDir::Traverse(wxDirTraverser& sink, switch ( sink.OnOpenError(fulldirname) ) { default: - wxFAIL_MSG(_T("unexpected OnOpenError() return value") ); + wxFAIL_MSG(wxT("unexpected OnOpenError() return value") ); // fall through case wxDIR_STOP: @@ -180,7 +180,7 @@ size_t wxDir::Traverse(wxDirTraverser& sink, break; wxASSERT_MSG( res == wxDIR_CONTINUE, - _T("unexpected OnFile() return value") ); + wxT("unexpected OnFile() return value") ); nFiles++; @@ -223,7 +223,7 @@ size_t wxDir::GetAllFiles(const wxString& dirname, const wxString& filespec, int flags) { - wxCHECK_MSG( files, (size_t)-1, _T("NULL pointer in wxDir::GetAllFiles") ); + wxCHECK_MSG( files, (size_t)-1, wxT("NULL pointer in wxDir::GetAllFiles") ); size_t nFiles = 0; diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index 7c5ef85837..d152896a54 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -195,7 +195,7 @@ wxSizer *wxDialogBase::CreateTextSizer(const wxString& message) // the static messages created by CreateTextSizer() (used by wxMessageBox, // for example), we don't want this special meaning, so we need to quote it wxString text(message); - text.Replace(_T("&"), _T("&&")); + text.Replace(wxT("&"), wxT("&&")); wxTextSizerWrapper wrapper(this); diff --git a/src/common/docview.cpp b/src/common/docview.cpp index 51c55bcaf3..8936703547 100644 --- a/src/common/docview.cpp +++ b/src/common/docview.cpp @@ -2235,7 +2235,7 @@ void wxFileHistory::AddFilesToMenu(wxMenu* menu) bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream) { - wxFFile file(filename, _T("rb")); + wxFFile file(filename, wxT("rb")); if ( !file.IsOpened() ) return false; @@ -2259,7 +2259,7 @@ bool wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream) bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename) { - wxFFile file(filename, _T("wb")); + wxFFile file(filename, wxT("wb")); if ( !file.IsOpened() ) return false; @@ -2282,7 +2282,7 @@ bool wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename) bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream) { - wxFFile file(filename, _T("rb")); + wxFFile file(filename, wxT("rb")); if ( !file.IsOpened() ) return false; @@ -2306,7 +2306,7 @@ bool wxTransferFileToStream(const wxString& filename, wxOutputStream& stream) bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename) { - wxFFile file(filename, _T("wb")); + wxFFile file(filename, wxT("wb")); if ( !file.IsOpened() ) return false; diff --git a/src/common/dpycmn.cpp b/src/common/dpycmn.cpp index 3c337d10bb..aa4f5e0533 100644 --- a/src/common/dpycmn.cpp +++ b/src/common/dpycmn.cpp @@ -147,7 +147,7 @@ wxDisplay::~wxDisplay() /* static */ int wxDisplay::GetFromWindow(const wxWindow *window) { - wxCHECK_MSG( window, wxNOT_FOUND, _T("invalid window") ); + wxCHECK_MSG( window, wxNOT_FOUND, wxT("invalid window") ); return Factory().GetFromWindow(window); } @@ -158,21 +158,21 @@ wxDisplay::~wxDisplay() wxRect wxDisplay::GetGeometry() const { - wxCHECK_MSG( IsOk(), wxRect(), _T("invalid wxDisplay object") ); + wxCHECK_MSG( IsOk(), wxRect(), wxT("invalid wxDisplay object") ); return m_impl->GetGeometry(); } wxRect wxDisplay::GetClientArea() const { - wxCHECK_MSG( IsOk(), wxRect(), _T("invalid wxDisplay object") ); + wxCHECK_MSG( IsOk(), wxRect(), wxT("invalid wxDisplay object") ); return m_impl->GetClientArea(); } wxString wxDisplay::GetName() const { - wxCHECK_MSG( IsOk(), wxString(), _T("invalid wxDisplay object") ); + wxCHECK_MSG( IsOk(), wxString(), wxT("invalid wxDisplay object") ); return m_impl->GetName(); } @@ -186,21 +186,21 @@ bool wxDisplay::IsPrimary() const wxArrayVideoModes wxDisplay::GetModes(const wxVideoMode& mode) const { - wxCHECK_MSG( IsOk(), wxArrayVideoModes(), _T("invalid wxDisplay object") ); + wxCHECK_MSG( IsOk(), wxArrayVideoModes(), wxT("invalid wxDisplay object") ); return m_impl->GetModes(mode); } wxVideoMode wxDisplay::GetCurrentMode() const { - wxCHECK_MSG( IsOk(), wxVideoMode(), _T("invalid wxDisplay object") ); + wxCHECK_MSG( IsOk(), wxVideoMode(), wxT("invalid wxDisplay object") ); return m_impl->GetCurrentMode(); } bool wxDisplay::ChangeMode(const wxVideoMode& mode) { - wxCHECK_MSG( IsOk(), false, _T("invalid wxDisplay object") ); + wxCHECK_MSG( IsOk(), false, wxT("invalid wxDisplay object") ); return m_impl->ChangeMode(mode); } diff --git a/src/common/dynlib.cpp b/src/common/dynlib.cpp index 69d5bc700e..d8ab264fb4 100644 --- a/src/common/dynlib.cpp +++ b/src/common/dynlib.cpp @@ -55,7 +55,7 @@ WX_DEFINE_USER_EXPORTED_OBJARRAY(wxDynamicLibraryDetailsArray) // --------------------------------------------------------------------------- #if defined(__WXPM__) || defined(__EMX__) - const wxString wxDynamicLibrary::ms_dllext(_T(".dll")); + const wxString wxDynamicLibrary::ms_dllext(wxT(".dll")); #endif // for MSW/Unix it is defined in platform-specific file @@ -72,7 +72,7 @@ wxDllType wxDynamicLibrary::GetProgramHandle() bool wxDynamicLibrary::Load(const wxString& libnameOrig, int flags) { - wxASSERT_MSG(m_handle == 0, _T("Library already loaded.")); + wxASSERT_MSG(m_handle == 0, wxT("Library already loaded.")); // add the proper extension for the DLL ourselves unless told not to wxString libname = libnameOrig; @@ -129,7 +129,7 @@ void wxDynamicLibrary::Unload(wxDllType handle) void *wxDynamicLibrary::DoGetSymbol(const wxString &name, bool *success) const { wxCHECK_MSG( IsLoaded(), NULL, - _T("Can't load symbol from unloaded library") ); + wxT("Can't load symbol from unloaded library") ); void *symbol = 0; @@ -178,7 +178,7 @@ wxDynamicLibrary::CanonicalizeName(const wxString& name, switch ( cat ) { default: - wxFAIL_MSG( _T("unknown wxDynamicLibraryCategory value") ); + wxFAIL_MSG( wxT("unknown wxDynamicLibraryCategory value") ); // fall through case wxDL_MODULE: @@ -187,7 +187,7 @@ wxDynamicLibrary::CanonicalizeName(const wxString& name, case wxDL_LIBRARY: // library names should start with "lib" under Unix - nameCanonic = _T("lib"); + nameCanonic = wxT("lib"); break; } #else // !__UNIX__ @@ -208,14 +208,14 @@ wxString wxDynamicLibrary::CanonicalizePluginName(const wxString& name, suffix = wxPlatformInfo::Get().GetPortIdShortName(); } #if wxUSE_UNICODE - suffix << _T('u'); + suffix << wxT('u'); #endif #ifdef __WXDEBUG__ - suffix << _T('d'); + suffix << wxT('d'); #endif if ( !suffix.empty() ) - suffix = wxString(_T("_")) + suffix; + suffix = wxString(wxT("_")) + suffix; #define WXSTRINGIZE(x) #x #if defined(__UNIX__) && !defined(__EMX__) @@ -240,13 +240,13 @@ wxString wxDynamicLibrary::CanonicalizePluginName(const wxString& name, #ifdef __WINDOWS__ // Add compiler identification: #if defined(__GNUG__) - suffix << _T("_gcc"); + suffix << wxT("_gcc"); #elif defined(__VISUALC__) - suffix << _T("_vc"); + suffix << wxT("_vc"); #elif defined(__WATCOMC__) - suffix << _T("_wat"); + suffix << wxT("_wat"); #elif defined(__BORLANDC__) - suffix << _T("_bcc"); + suffix << wxT("_bcc"); #endif #endif diff --git a/src/common/dynload.cpp b/src/common/dynload.cpp index ffb80f1af6..1b28e9b47c 100644 --- a/src/common/dynload.cpp +++ b/src/common/dynload.cpp @@ -105,7 +105,7 @@ wxPluginLibrary::~wxPluginLibrary() wxPluginLibrary *wxPluginLibrary::RefLib() { wxCHECK_MSG( m_linkcount > 0, NULL, - _T("Library had been already deleted!") ); + wxT("Library had been already deleted!") ); ++m_linkcount; return this; @@ -114,7 +114,7 @@ wxPluginLibrary *wxPluginLibrary::RefLib() bool wxPluginLibrary::UnrefLib() { wxASSERT_MSG( m_objcount == 0, - _T("Library unloaded before all objects were destroyed") ); + wxT("Library unloaded before all objects were destroyed") ); if ( m_linkcount == 0 || --m_linkcount == 0 ) { @@ -165,7 +165,7 @@ void wxPluginLibrary::RegisterModules() // though, as there is currently no way to Unregister it without it. wxASSERT_MSG( m_linkcount == 1, - _T("RegisterModules should only be called for the first load") ); + wxT("RegisterModules should only be called for the first load") ); for ( const wxClassInfo *info = m_after; info != m_before; info = info->GetNext()) { @@ -173,7 +173,7 @@ void wxPluginLibrary::RegisterModules() { wxModule *m = wxDynamicCast(info->CreateObject(), wxModule); - wxASSERT_MSG( m, _T("wxDynamicCast of wxModule failed") ); + wxASSERT_MSG( m, wxT("wxDynamicCast of wxModule failed") ); m_wxmodules.push_back(m); wxModule::RegisterModule(m); @@ -188,7 +188,7 @@ void wxPluginLibrary::RegisterModules() { if( !(*it)->Init() ) { - wxLogDebug(_T("wxModule::Init() failed for wxPluginLibrary")); + wxLogDebug(wxT("wxModule::Init() failed for wxPluginLibrary")); // XXX: Watch this, a different hash implementation might break it, // a good hash implementation would let us fix it though. @@ -258,8 +258,8 @@ wxPluginManager::LoadLibrary(const wxString &libname, int flags) if ( entry ) { - wxLogTrace(_T("dll"), - _T("LoadLibrary(%s): already loaded."), realname.c_str()); + wxLogTrace(wxT("dll"), + wxT("LoadLibrary(%s): already loaded."), realname.c_str()); entry->RefLib(); } @@ -271,20 +271,20 @@ wxPluginManager::LoadLibrary(const wxString &libname, int flags) { (*ms_manifest)[realname] = entry; - wxLogTrace(_T("dll"), - _T("LoadLibrary(%s): loaded ok."), realname.c_str()); + wxLogTrace(wxT("dll"), + wxT("LoadLibrary(%s): loaded ok."), realname.c_str()); } else { - wxLogTrace(_T("dll"), - _T("LoadLibrary(%s): failed to load."), realname.c_str()); + wxLogTrace(wxT("dll"), + wxT("LoadLibrary(%s): failed to load."), realname.c_str()); // we have created entry just above if ( !entry->UnrefLib() ) { // ... so UnrefLib() is supposed to delete it - wxFAIL_MSG( _T("Currently linked library is not loaded?") ); + wxFAIL_MSG( wxT("Currently linked library is not loaded?") ); } entry = NULL; @@ -309,13 +309,13 @@ bool wxPluginManager::UnloadLibrary(const wxString& libname) if ( !entry ) { - wxLogDebug(_T("Attempt to unload library '%s' which is not loaded."), + wxLogDebug(wxT("Attempt to unload library '%s' which is not loaded."), libname.c_str()); return false; } - wxLogTrace(_T("dll"), _T("UnloadLibrary(%s)"), realname.c_str()); + wxLogTrace(wxT("dll"), wxT("UnloadLibrary(%s)"), realname.c_str()); if ( !entry->UnrefLib() ) { @@ -341,7 +341,7 @@ bool wxPluginManager::Load(const wxString &libname, int flags) void wxPluginManager::Unload() { - wxCHECK_RET( m_entry, _T("unloading an invalid wxPluginManager?") ); + wxCHECK_RET( m_entry, wxT("unloading an invalid wxPluginManager?") ); for ( wxDLManifest::iterator i = ms_manifest->begin(); i != ms_manifest->end(); diff --git a/src/common/evtloopcmn.cpp b/src/common/evtloopcmn.cpp index a7ce28dc6c..5f9894d125 100644 --- a/src/common/evtloopcmn.cpp +++ b/src/common/evtloopcmn.cpp @@ -112,7 +112,7 @@ bool wxEventLoopManual::ProcessEvents() int wxEventLoopManual::Run() { // event loops are not recursive, you need to create another loop! - wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); + wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") ); // ProcessIdle() and ProcessEvents() below may throw so the code here should // be exception-safe, hence we must use local objects for all actions we @@ -195,7 +195,7 @@ int wxEventLoopManual::Run() void wxEventLoopManual::Exit(int rc) { - wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); + wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") ); m_exitcode = rc; m_shouldExit = true; diff --git a/src/common/ffile.cpp b/src/common/ffile.cpp index 4ea59377b9..c9210559aa 100644 --- a/src/common/ffile.cpp +++ b/src/common/ffile.cpp @@ -239,7 +239,7 @@ bool wxFFile::Seek(wxFileOffset ofs, wxSeekMode mode) wxFileOffset wxFFile::Tell() const { wxCHECK_MSG( IsOpened(), wxInvalidOffset, - _T("wxFFile::Tell(): file is closed!") ); + wxT("wxFFile::Tell(): file is closed!") ); wxFileOffset rc = wxFtell(m_fp); if ( rc == wxInvalidOffset ) @@ -254,7 +254,7 @@ wxFileOffset wxFFile::Tell() const wxFileOffset wxFFile::Length() const { wxCHECK_MSG( IsOpened(), wxInvalidOffset, - _T("wxFFile::Length(): file is closed!") ); + wxT("wxFFile::Length(): file is closed!") ); wxFFile& self = *(wxFFile *)this; // const_cast diff --git a/src/common/file.cpp b/src/common/file.cpp index 1a34a9991a..1063e45293 100644 --- a/src/common/file.cpp +++ b/src/common/file.cpp @@ -342,15 +342,15 @@ bool wxFile::Flush() // seek wxFileOffset wxFile::Seek(wxFileOffset ofs, wxSeekMode mode) { - wxASSERT_MSG( IsOpened(), _T("can't seek on closed file") ); + wxASSERT_MSG( IsOpened(), wxT("can't seek on closed file") ); wxCHECK_MSG( ofs != wxInvalidOffset || mode != wxFromStart, wxInvalidOffset, - _T("invalid absolute file offset") ); + wxT("invalid absolute file offset") ); int origin; switch ( mode ) { default: - wxFAIL_MSG(_T("unknown seek origin")); + wxFAIL_MSG(wxT("unknown seek origin")); case wxFromStart: origin = SEEK_SET; @@ -459,7 +459,7 @@ bool wxFile::Eof() const } else if ( iRc != 1 ) { - wxFAIL_MSG(_T("invalid eof() return value.")); + wxFAIL_MSG(wxT("invalid eof() return value.")); } return true; diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index af20d35358..c016465535 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -70,7 +70,7 @@ #define MAX_PATH 512 #endif -#define FILECONF_TRACE_MASK _T("fileconf") +#define FILECONF_TRACE_MASK wxT("fileconf") // ---------------------------------------------------------------------------- // global functions declarations @@ -915,7 +915,7 @@ bool wxFileConfig::DoReadLong(const wxString& key, long *pl) const bool wxFileConfig::DoReadBinary(const wxString& key, wxMemoryBuffer* buf) const { - wxCHECK_MSG( buf, false, _T("NULL buffer") ); + wxCHECK_MSG( buf, false, wxT("NULL buffer") ); wxString str; if ( !Read(key, &str) ) @@ -933,7 +933,7 @@ bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue) wxString strName = path.Name(); wxLogTrace( FILECONF_TRACE_MASK, - _T(" Writing String '%s' = '%s' to Group '%s'"), + wxT(" Writing String '%s' = '%s' to Group '%s'"), strName.c_str(), szValue.c_str(), GetPath().c_str() ); @@ -947,7 +947,7 @@ bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue) // ... except if it's empty in which case it's a way to force it's creation wxLogTrace( FILECONF_TRACE_MASK, - _T(" Creating group %s"), + wxT(" Creating group %s"), m_pCurrentGroup->Name().c_str() ); SetDirty(); @@ -971,13 +971,13 @@ bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue) if ( pEntry == 0 ) { wxLogTrace( FILECONF_TRACE_MASK, - _T(" Adding Entry %s"), + wxT(" Adding Entry %s"), strName.c_str() ); pEntry = m_pCurrentGroup->AddEntry(strName); } wxLogTrace( FILECONF_TRACE_MASK, - _T(" Setting value %s"), + wxT(" Setting value %s"), szValue.c_str() ); pEntry->SetValue(szValue); @@ -989,7 +989,7 @@ bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue) bool wxFileConfig::DoWriteLong(const wxString& key, long lValue) { - return Write(key, wxString::Format(_T("%ld"), lValue)); + return Write(key, wxString::Format(wxT("%ld"), lValue)); } #if wxUSE_BASE64 @@ -1081,7 +1081,7 @@ bool wxFileConfig::RenameEntry(const wxString& oldName, const wxString& newName) { wxASSERT_MSG( oldName.find(wxCONFIG_PATH_SEPARATOR) == wxString::npos, - _T("RenameEntry(): paths are not supported") ); + wxT("RenameEntry(): paths are not supported") ); // check that the entry exists wxFileConfigEntry *oldEntry = m_pCurrentGroup->FindEntry(oldName); @@ -1192,14 +1192,14 @@ bool wxFileConfig::DeleteAll() wxFileConfigLineList *wxFileConfig::LineListAppend(const wxString& str) { wxLogTrace( FILECONF_TRACE_MASK, - _T(" ** Adding Line '%s'"), + wxT(" ** Adding Line '%s'"), str.c_str() ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), + wxT(" head: %s"), ((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str() : wxEmptyString) ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), + wxT(" tail: %s"), ((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str() : wxEmptyString) ); @@ -1220,11 +1220,11 @@ wxFileConfigLineList *wxFileConfig::LineListAppend(const wxString& str) m_linesTail = pLine; wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), + wxT(" head: %s"), ((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str() : wxEmptyString) ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), + wxT(" tail: %s"), ((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str() : wxEmptyString) ); @@ -1236,16 +1236,16 @@ wxFileConfigLineList *wxFileConfig::LineListInsert(const wxString& str, wxFileConfigLineList *pLine) { wxLogTrace( FILECONF_TRACE_MASK, - _T(" ** Inserting Line '%s' after '%s'"), + wxT(" ** Inserting Line '%s' after '%s'"), str.c_str(), ((pLine) ? (const wxChar*)pLine->Text().c_str() : wxEmptyString) ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), + wxT(" head: %s"), ((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str() : wxEmptyString) ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), + wxT(" tail: %s"), ((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str() : wxEmptyString) ); @@ -1271,11 +1271,11 @@ wxFileConfigLineList *wxFileConfig::LineListInsert(const wxString& str, } wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), + wxT(" head: %s"), ((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str() : wxEmptyString) ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), + wxT(" tail: %s"), ((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str() : wxEmptyString) ); @@ -1285,14 +1285,14 @@ wxFileConfigLineList *wxFileConfig::LineListInsert(const wxString& str, void wxFileConfig::LineListRemove(wxFileConfigLineList *pLine) { wxLogTrace( FILECONF_TRACE_MASK, - _T(" ** Removing Line '%s'"), + wxT(" ** Removing Line '%s'"), pLine->Text().c_str() ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), + wxT(" head: %s"), ((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str() : wxEmptyString) ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), + wxT(" tail: %s"), ((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str() : wxEmptyString) ); @@ -1314,11 +1314,11 @@ void wxFileConfig::LineListRemove(wxFileConfigLineList *pLine) pNext->SetPrev(pPrev); wxLogTrace( FILECONF_TRACE_MASK, - _T(" head: %s"), + wxT(" head: %s"), ((m_linesHead) ? (const wxChar*)m_linesHead->Text().c_str() : wxEmptyString) ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" tail: %s"), + wxT(" tail: %s"), ((m_linesTail) ? (const wxChar*)m_linesTail->Text().c_str() : wxEmptyString) ); @@ -1377,7 +1377,7 @@ void wxFileConfigGroup::SetLine(wxFileConfigLineList *pLine) // for a normal (i.e. not root) group this method shouldn't be called twice // unless we are resetting the line wxASSERT_MSG( !m_pParent || !m_pLine || !pLine, - _T("changing line for a non-root group?") ); + wxT("changing line for a non-root group?") ); m_pLine = pLine; } @@ -1419,13 +1419,13 @@ void wxFileConfigGroup::SetLine(wxFileConfigLineList *pLine) wxFileConfigLineList *wxFileConfigGroup::GetGroupLine() { wxLogTrace( FILECONF_TRACE_MASK, - _T(" GetGroupLine() for Group '%s'"), + wxT(" GetGroupLine() for Group '%s'"), Name().c_str() ); if ( !m_pLine ) { wxLogTrace( FILECONF_TRACE_MASK, - _T(" Getting Line item pointer") ); + wxT(" Getting Line item pointer") ); wxFileConfigGroup *pParent = Parent(); @@ -1433,7 +1433,7 @@ wxFileConfigLineList *wxFileConfigGroup::GetGroupLine() if ( pParent ) { wxLogTrace( FILECONF_TRACE_MASK, - _T(" checking parent '%s'"), + wxT(" checking parent '%s'"), pParent->Name().c_str() ); wxString strFullName; @@ -1464,7 +1464,7 @@ wxFileConfigLineList *wxFileConfigGroup::GetLastGroupLine() { wxFileConfigLineList *pLine = m_pLastGroup->GetLastGroupLine(); - wxASSERT_MSG( pLine, _T("last group must have !NULL associated line") ); + wxASSERT_MSG( pLine, wxT("last group must have !NULL associated line") ); return pLine; } @@ -1479,14 +1479,14 @@ wxFileConfigLineList *wxFileConfigGroup::GetLastGroupLine() wxFileConfigLineList *wxFileConfigGroup::GetLastEntryLine() { wxLogTrace( FILECONF_TRACE_MASK, - _T(" GetLastEntryLine() for Group '%s'"), + wxT(" GetLastEntryLine() for Group '%s'"), Name().c_str() ); if ( m_pLastEntry ) { wxFileConfigLineList *pLine = m_pLastEntry->GetLine(); - wxASSERT_MSG( pLine, _T("last entry must have !NULL associated line") ); + wxASSERT_MSG( pLine, wxT("last entry must have !NULL associated line") ); return pLine; } @@ -1504,7 +1504,7 @@ void wxFileConfigGroup::SetLastEntry(wxFileConfigEntry *pEntry) // the only situation in which a group without its own line can have // an entry is when the first entry is added to the initially empty // root pseudo-group - wxASSERT_MSG( !m_pParent, _T("unexpected for non root group") ); + wxASSERT_MSG( !m_pParent, wxT("unexpected for non root group") ); // let the group know that it does have a line in the file now m_pLine = pEntry->GetLine(); @@ -1519,10 +1519,10 @@ void wxFileConfigGroup::UpdateGroupAndSubgroupsLines() { // update the line of this group wxFileConfigLineList *line = GetGroupLine(); - wxCHECK_RET( line, _T("a non root group must have a corresponding line!") ); + wxCHECK_RET( line, wxT("a non root group must have a corresponding line!") ); // +1: skip the leading '/' - line->SetText(wxString::Format(_T("[%s]"), GetFullName().c_str() + 1)); + line->SetText(wxString::Format(wxT("[%s]"), GetFullName().c_str() + 1)); // also update all subgroups as they have this groups name in their lines @@ -1535,7 +1535,7 @@ void wxFileConfigGroup::UpdateGroupAndSubgroupsLines() void wxFileConfigGroup::Rename(const wxString& newName) { - wxCHECK_RET( m_pParent, _T("the root group can't be renamed") ); + wxCHECK_RET( m_pParent, wxT("the root group can't be renamed") ); if ( newName == m_strName ) return; @@ -1674,20 +1674,20 @@ bool wxFileConfigGroup::DeleteSubgroupByName(const wxString& name) // other data structures. bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) { - wxCHECK_MSG( pGroup, false, _T("deleting non existing group?") ); + wxCHECK_MSG( pGroup, false, wxT("deleting non existing group?") ); wxLogTrace( FILECONF_TRACE_MASK, - _T("Deleting group '%s' from '%s'"), + wxT("Deleting group '%s' from '%s'"), pGroup->Name().c_str(), Name().c_str() ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" (m_pLine) = prev: %p, this %p, next %p"), + wxT(" (m_pLine) = prev: %p, this %p, next %p"), m_pLine ? static_cast(m_pLine->Prev()) : 0, static_cast(m_pLine), m_pLine ? static_cast(m_pLine->Next()) : 0 ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" text: '%s'"), + wxT(" text: '%s'"), m_pLine ? (const wxChar*)m_pLine->Text().c_str() : wxEmptyString ); @@ -1695,7 +1695,7 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) size_t nCount = pGroup->m_aEntries.GetCount(); wxLogTrace(FILECONF_TRACE_MASK, - _T("Removing %lu entries"), (unsigned long)nCount ); + wxT("Removing %lu entries"), (unsigned long)nCount ); for ( size_t nEntry = 0; nEntry < nCount; nEntry++ ) { @@ -1704,7 +1704,7 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) if ( pLine ) { wxLogTrace( FILECONF_TRACE_MASK, - _T(" '%s'"), + wxT(" '%s'"), pLine->Text().c_str() ); m_pConfig->LineListRemove(pLine); } @@ -1714,7 +1714,7 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) nCount = pGroup->m_aSubgroups.GetCount(); wxLogTrace( FILECONF_TRACE_MASK, - _T("Removing %lu subgroups"), (unsigned long)nCount ); + wxT("Removing %lu subgroups"), (unsigned long)nCount ); for ( size_t nGroup = 0; nGroup < nCount; nGroup++ ) { @@ -1726,11 +1726,11 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) if ( pLine ) { wxLogTrace( FILECONF_TRACE_MASK, - _T(" Removing line for group '%s' : '%s'"), + wxT(" Removing line for group '%s' : '%s'"), pGroup->Name().c_str(), pLine->Text().c_str() ); wxLogTrace( FILECONF_TRACE_MASK, - _T(" Removing from group '%s' : '%s'"), + wxT(" Removing from group '%s' : '%s'"), Name().c_str(), ((m_pLine) ? (const wxChar*)m_pLine->Text().c_str() : wxEmptyString) ); @@ -1740,7 +1740,7 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) if ( pGroup == m_pLastGroup ) { wxLogTrace( FILECONF_TRACE_MASK, - _T(" Removing last group") ); + wxT(" Removing last group") ); // our last entry is being deleted, so find the last one which // stays by going back until we find a subgroup or reach the @@ -1774,7 +1774,7 @@ bool wxFileConfigGroup::DeleteSubgroup(wxFileConfigGroup *pGroup) else { wxLogTrace( FILECONF_TRACE_MASK, - _T(" No line entry for Group '%s'?"), + wxT(" No line entry for Group '%s'?"), pGroup->Name().c_str() ); } @@ -2080,7 +2080,7 @@ static wxString FilterInEntryName(const wxString& str) for ( const wxChar *pc = str.c_str(); *pc != '\0'; pc++ ) { if ( *pc == wxT('\\') ) { // we need to test it here or we'd skip past the NUL in the loop line - if ( *++pc == _T('\0') ) + if ( *++pc == wxT('\0') ) break; } diff --git a/src/common/filefn.cpp b/src/common/filefn.cpp index cc9f2c89b0..6d9401b4a3 100644 --- a/src/common/filefn.cpp +++ b/src/common/filefn.cpp @@ -955,8 +955,8 @@ static void wxDoDos2UnixFilename(T *s) if (s) while (*s) { - if (*s == _T('\\')) - *s = _T('/'); + if (*s == wxT('\\')) + *s = wxT('/'); #ifdef __WXMSW__ else *s = wxTolower(*s); // Case INDEPENDENT @@ -1329,7 +1329,7 @@ bool wxDirExists(const wxString& pathName) while ( wxEndsWithPathSeparator(strPath) ) { size_t len = strPath.length(); - if ( len == 1 || (len == 3 && strPath[len - 2] == _T(':')) ) + if ( len == 1 || (len == 3 && strPath[len - 2] == wxT(':')) ) break; strPath.Truncate(len - 1); @@ -1338,8 +1338,8 @@ bool wxDirExists(const wxString& pathName) #ifdef __OS2__ // OS/2 can't handle "d:", it wants either "d:\" or "d:." - if (strPath.length() == 2 && strPath[1u] == _T(':')) - strPath << _T('.'); + if (strPath.length() == 2 && strPath[1u] == wxT(':')) + strPath << wxT('.'); #endif #if defined(__WXPALMOS__) @@ -1477,11 +1477,11 @@ wxChar *wxDoGetCwd(wxChar *buf, int sz) { #if defined(__WXPALMOS__) // TODO - if(buf && sz>0) buf[0] = _T('\0'); + if(buf && sz>0) buf[0] = wxT('\0'); return buf; #elif defined(__WXWINCE__) // TODO - if(buf && sz>0) buf[0] = _T('\0'); + if(buf && sz>0) buf[0] = wxT('\0'); return buf; #else if ( !buf ) @@ -1555,7 +1555,7 @@ wxChar *wxDoGetCwd(wxChar *buf, int sz) // sense at all to me - empty string is a better error indicator // (NULL might be even better but I'm afraid this could lead to // problems with the old code assuming the return is never NULL) - buf[0] = _T('\0'); + buf[0] = wxT('\0'); } else // ok, but we might need to massage the path into the right format { @@ -1613,7 +1613,7 @@ bool wxSetWorkingDirectory(const wxString& d) #if defined(__OS2__) if (d[1] == ':') { - ::DosSetDefaultDisk(wxToupper(d[0]) - _T('A') + 1); + ::DosSetDefaultDisk(wxToupper(d[0]) - wxT('A') + 1); // do not call DosSetCurrentDir when just changing drive, // since it requires e.g. "d:." instead of "d:"! if (d.length() == 2) @@ -1686,7 +1686,7 @@ bool wxFindFileInPath(wxString *pStr, const wxString& szPath, const wxString& sz { // we assume that it's not empty wxCHECK_MSG( !szFile.empty(), false, - _T("empty file name in wxFindFileInPath")); + wxT("empty file name in wxFindFileInPath")); // skip path separator in the beginning of the file name if present wxString szFile2; @@ -1767,7 +1767,7 @@ int WXDLLIMPEXP_BASE wxParseCommonDialogsFilter(const wxString& filterStr, } else { - wxFAIL_MSG( _T("missing '|' in the wildcard string!") ); + wxFAIL_MSG( wxT("missing '|' in the wildcard string!") ); } break; @@ -1818,13 +1818,13 @@ int WXDLLIMPEXP_BASE wxParseCommonDialogsFilter(const wxString& filterStr, { wxString before = descriptions[k].Left(pos); wxString after = descriptions[k].Mid(pos+filters[k].Len()); - pos = before.Find(_T('('),true); - if (pos>before.Find(_T(')'),true)) + pos = before.Find(wxT('('),true); + if (pos>before.Find(wxT(')'),true)) { before = before.Left(pos+1); before << filters[k]; - pos = after.Find(_T(')')); - int pos1 = after.Find(_T('(')); + pos = after.Find(wxT(')')); + int pos1 = after.Find(wxT('(')); if (pos != wxNOT_FOUND && (posSet(st.wDay, wxDateTime::Month(st.wMonth - 1), st.wYear, @@ -257,12 +257,12 @@ static void ConvertWxToFileTime(FILETIME *ft, const wxDateTime& dt) FILETIME ftLocal; if ( !::SystemTimeToFileTime(&st, &ftLocal) ) { - wxLogLastError(_T("SystemTimeToFileTime")); + wxLogLastError(wxT("SystemTimeToFileTime")); } if ( !::LocalFileTimeToFileTime(&ftLocal, ft) ) { - wxLogLastError(_T("LocalFileTimeToFileTime")); + wxLogLastError(wxT("LocalFileTimeToFileTime")); } } @@ -412,7 +412,7 @@ void wxFileName::SetPath( const wxString& pathOrig, wxPathFormat format ) break; default: - wxFAIL_MSG( _T("Unknown path format") ); + wxFAIL_MSG( wxT("Unknown path format") ); // !! Fall through !! case wxPATH_UNIX: @@ -482,12 +482,12 @@ void wxFileName::Assign(const wxString& fullpathOrig, SplitPath(fullname, &volDummy, &pathDummy, &name, &ext, &hasExt, format); wxASSERT_MSG( volDummy.empty() && pathDummy.empty(), - _T("the file name shouldn't contain the path") ); + wxT("the file name shouldn't contain the path") ); SplitPath(fullpath, &volume, &path, &nameDummy, &extDummy, format); wxASSERT_MSG( nameDummy.empty() && extDummy.empty(), - _T("the path shouldn't contain file name nor extension") ); + wxT("the path shouldn't contain file name nor extension") ); Assign(volume, path, name, ext, hasExt, format); } @@ -679,7 +679,7 @@ static bool wxTempOpen(wxFFile *file, const wxString& path, bool *deleteOnClose) { #ifndef wx_fdopen *deleteOnClose = false; - return file->Open(path, _T("w+b")); + return file->Open(path, wxT("w+b")); #else // wx_fdopen int fd = wxTempOpen(path, deleteOnClose); if (fd == -1) @@ -747,7 +747,7 @@ static wxString wxCreateTempImpl( if ( !::GetTempFileName(dir.fn_str(), name.fn_str(), 0, wxStringBuffer(path, MAX_PATH + 1)) ) { - wxLogLastError(_T("GetTempFileName")); + wxLogLastError(wxT("GetTempFileName")); path.clear(); } @@ -765,7 +765,7 @@ static wxString wxCreateTempImpl( #if defined(HAVE_MKSTEMP) // scratch space for mkstemp() - path += _T("XXXXXX"); + path += wxT("XXXXXX"); // we need to copy the path to the buffer in which mkstemp() can modify it wxCharBuffer buf(path.fn_str()); @@ -797,7 +797,7 @@ static wxString wxCreateTempImpl( #ifdef wx_fdopen ffileTemp->Attach(wx_fdopen(fdTemp, "r+b")); #else - ffileTemp->Open(path, _T("r+b")); + ffileTemp->Open(path, wxT("r+b")); close(fdTemp); #endif } @@ -812,7 +812,7 @@ static wxString wxCreateTempImpl( #ifdef HAVE_MKTEMP // same as above - path += _T("XXXXXX"); + path += wxT("XXXXXX"); wxCharBuffer buf = wxConvFile.cWX2MB( path ); if ( !mktemp( (char*)(const char*) buf ) ) @@ -835,7 +835,7 @@ static wxString wxCreateTempImpl( for ( size_t n = 0; n < numTries; n++ ) { // 3 hex digits is enough for numTries == 1000 < 4096 - pathTry = path + wxString::Format(_T("%.03x"), (unsigned int) n); + pathTry = path + wxString::Format(wxT("%.03x"), (unsigned int) n); if ( !wxFileName::FileExists(pathTry) ) { break; @@ -1056,7 +1056,7 @@ wxString wxFileName::GetTempDir() #elif defined(__WINDOWS__) && !defined(__WXMICROWIN__) if ( !::GetTempPath(MAX_PATH, wxStringBuffer(dir, MAX_PATH + 1)) ) { - wxLogLastError(_T("GetTempPath")); + wxLogLastError(wxT("GetTempPath")); } #elif defined(__WXMAC__) && wxOSX_USE_CARBON dir = wxMacFindFolder(short(kOnSystemDisk), kTemporaryFolderType, kCreateFolder); @@ -1135,7 +1135,7 @@ bool wxFileName::Rmdir(const wxString& dir, int flags) wxString path(dir); if ( path.Last() == wxFILE_SEP_PATH ) path.RemoveLast(); - path += _T('\0'); + path += wxT('\0'); SHFILEOPSTRUCT fileop; wxZeroMemory(fileop); @@ -1152,7 +1152,7 @@ bool wxFileName::Rmdir(const wxString& dir, int flags) { // SHFileOperation may return non-Win32 error codes, so the error // message can be incorrect - wxLogApiError(_T("SHFileOperation"), ret); + wxLogApiError(wxT("SHFileOperation"), ret); return false; } @@ -1245,7 +1245,7 @@ bool wxFileName::Normalize(int flags, if ( !dirs.IsEmpty() ) { wxString dir = dirs[0u]; - if ( !dir.empty() && dir[0u] == _T('~') ) + if ( !dir.empty() && dir[0u] == wxT('~') ) { // to make the path absolute use the home directory curDir.AssignDir(wxGetUserHome(dir.c_str() + 1)); @@ -1499,7 +1499,7 @@ bool wxFileName::IsAbsolute(wxPathFormat format) const { wxString dir = m_dirs[0u]; - if (!dir.empty() && dir[0u] == _T('~')) + if (!dir.empty() && dir[0u] == wxT('~')) return true; } } @@ -1563,7 +1563,7 @@ bool wxFileName::MakeRelativeTo(const wxString& pathBase, wxPathFormat format) // files) if ( m_dirs.IsEmpty() && IsDir() ) { - m_dirs.Add(_T('.')); + m_dirs.Add(wxT('.')); } } @@ -1670,7 +1670,7 @@ wxString wxFileName::GetPathSeparators(wxPathFormat format) break; default: - wxFAIL_MSG( _T("Unknown wxPATH_XXX style") ); + wxFAIL_MSG( wxT("Unknown wxPATH_XXX style") ); // fall through case wxPATH_UNIX: @@ -1696,7 +1696,7 @@ wxString wxFileName::GetPathTerminators(wxPathFormat format) // under VMS the end of the path is ']', not the path separator used to // separate the components - return format == wxPATH_VMS ? wxString(_T(']')) : GetPathSeparators(format); + return format == wxPATH_VMS ? wxString(wxT(']')) : GetPathSeparators(format); } /* static */ @@ -1704,7 +1704,7 @@ bool wxFileName::IsPathSeparator(wxChar ch, wxPathFormat format) { // wxString::Find() doesn't work as expected with NUL - it will always find // it, so test for it separately - return ch != _T('\0') && GetPathSeparators(format).Find(ch) != wxNOT_FOUND; + return ch != wxT('\0') && GetPathSeparators(format).Find(ch) != wxNOT_FOUND; } // ---------------------------------------------------------------------------- @@ -1715,7 +1715,7 @@ bool wxFileName::IsPathSeparator(wxChar ch, wxPathFormat format) { if ( dir.empty() ) { - wxFAIL_MSG( _T("empty directory passed to wxFileName::InsertDir()") ); + wxFAIL_MSG( wxT("empty directory passed to wxFileName::InsertDir()") ); return false; } @@ -1725,7 +1725,7 @@ bool wxFileName::IsPathSeparator(wxChar ch, wxPathFormat format) { if ( dir[n] == GetVolumeSeparator() || IsPathSeparator(dir[n]) ) { - wxFAIL_MSG( _T("invalid directory component in wxFileName") ); + wxFAIL_MSG( wxT("invalid directory component in wxFileName") ); return false; } @@ -1940,13 +1940,13 @@ wxString wxFileName::GetLongPath() const { s_triedToLoad = true; - wxDynamicLibrary dllKernel(_T("kernel32")); + wxDynamicLibrary dllKernel(wxT("kernel32")); - const wxChar* GetLongPathName = _T("GetLongPathName") + const wxChar* GetLongPathName = wxT("GetLongPathName") #if wxUSE_UNICODE - _T("W"); + wxT("W"); #else // ANSI - _T("A"); + wxT("A"); #endif // Unicode/ANSI if ( dllKernel.HasSymbol(GetLongPathName) ) @@ -2151,7 +2151,7 @@ void wxFileName::SplitPath(const wxString& fullpathWithVolume, if ( (posLastDot != wxString::npos) && (posLastDot == 0 || IsPathSeparator(fullpath[posLastDot - 1]) || - (format == wxPATH_VMS && fullpath[posLastDot - 1] == _T(']'))) ) + (format == wxPATH_VMS && fullpath[posLastDot - 1] == wxT(']'))) ) { // dot may be (and commonly -- at least under Unix -- is) the first // character of the filename, don't treat the entire filename as @@ -2193,7 +2193,7 @@ void wxFileName::SplitPath(const wxString& fullpathWithVolume, // special VMS hack: remove the initial bracket if ( format == wxPATH_VMS ) { - if ( (*pstrPath)[0u] == _T('[') ) + if ( (*pstrPath)[0u] == wxT('[') ) pstrPath->erase(0, 1); } } diff --git a/src/common/filepickercmn.cpp b/src/common/filepickercmn.cpp index e1ff02ea92..9236761eed 100644 --- a/src/common/filepickercmn.cpp +++ b/src/common/filepickercmn.cpp @@ -74,13 +74,13 @@ bool wxFileDirPickerCtrlBase::CreateBase(wxWindow *parent, // check that the styles are not contradictory wxASSERT_MSG( !(HasFlag(wxFLP_SAVE) && HasFlag(wxFLP_OPEN)), - _T("can't specify both wxFLP_SAVE and wxFLP_OPEN at once") ); + wxT("can't specify both wxFLP_SAVE and wxFLP_OPEN at once") ); wxASSERT_MSG( !HasFlag(wxFLP_SAVE) || !HasFlag(wxFLP_FILE_MUST_EXIST), - _T("wxFLP_FILE_MUST_EXIST can't be used with wxFLP_SAVE" ) ); + wxT("wxFLP_FILE_MUST_EXIST can't be used with wxFLP_SAVE" ) ); wxASSERT_MSG( !HasFlag(wxFLP_OPEN) || !HasFlag(wxFLP_OVERWRITE_PROMPT), - _T("wxFLP_OVERWRITE_PROMPT can't be used with wxFLP_OPEN") ); + wxT("wxFLP_OVERWRITE_PROMPT can't be used with wxFLP_OPEN") ); // create a wxFilePickerWidget or a wxDirPickerWidget... m_pickerIface = CreatePicker(this, path, message, wildcard); diff --git a/src/common/filesys.cpp b/src/common/filesys.cpp index 003ff698b8..2ae9c2dfd3 100644 --- a/src/common/filesys.cpp +++ b/src/common/filesys.cpp @@ -89,31 +89,31 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location) { static const wxFileTypeInfo fallbacks[] = { - wxFileTypeInfo(_T("image/jpeg"), + wxFileTypeInfo(wxT("image/jpeg"), wxEmptyString, wxEmptyString, - _T("JPEG image (from fallback)"), - _T("jpg"), _T("jpeg"), _T("JPG"), _T("JPEG"), wxNullPtr), - wxFileTypeInfo(_T("image/gif"), + wxT("JPEG image (from fallback)"), + wxT("jpg"), wxT("jpeg"), wxT("JPG"), wxT("JPEG"), wxNullPtr), + wxFileTypeInfo(wxT("image/gif"), wxEmptyString, wxEmptyString, - _T("GIF image (from fallback)"), - _T("gif"), _T("GIF"), wxNullPtr), - wxFileTypeInfo(_T("image/png"), + wxT("GIF image (from fallback)"), + wxT("gif"), wxT("GIF"), wxNullPtr), + wxFileTypeInfo(wxT("image/png"), wxEmptyString, wxEmptyString, - _T("PNG image (from fallback)"), - _T("png"), _T("PNG"), wxNullPtr), - wxFileTypeInfo(_T("image/bmp"), + wxT("PNG image (from fallback)"), + wxT("png"), wxT("PNG"), wxNullPtr), + wxFileTypeInfo(wxT("image/bmp"), wxEmptyString, wxEmptyString, - _T("windows bitmap image (from fallback)"), - _T("bmp"), _T("BMP"), wxNullPtr), - wxFileTypeInfo(_T("text/html"), + wxT("windows bitmap image (from fallback)"), + wxT("bmp"), wxT("BMP"), wxNullPtr), + wxFileTypeInfo(wxT("text/html"), wxEmptyString, wxEmptyString, - _T("HTML document (from fallback)"), - _T("htm"), _T("html"), _T("HTM"), _T("HTML"), wxNullPtr), + wxT("HTML document (from fallback)"), + wxT("htm"), wxT("html"), wxT("HTM"), wxT("HTML"), wxNullPtr), // must terminate the table with this! wxFileTypeInfo() }; @@ -134,9 +134,9 @@ wxString wxFileSystemHandler::GetMimeTypeFromExt(const wxString& location) else #endif { - if ( ext.IsSameAs(wxT("htm"), false) || ext.IsSameAs(_T("html"), false) ) + if ( ext.IsSameAs(wxT("htm"), false) || ext.IsSameAs(wxT("html"), false) ) return wxT("text/html"); - if ( ext.IsSameAs(wxT("jpg"), false) || ext.IsSameAs(_T("jpeg"), false) ) + if ( ext.IsSameAs(wxT("jpg"), false) || ext.IsSameAs(wxT("jpeg"), false) ) return wxT("image/jpeg"); if ( ext.IsSameAs(wxT("gif"), false) ) return wxT("image/gif"); @@ -543,7 +543,7 @@ bool wxFileSystem::FindFileInPath(wxString *pStr, { // we assume that it's not empty wxCHECK_MSG( !basename.empty(), false, - _T("empty file name in wxFileSystem::FindFileInPath")); + wxT("empty file name in wxFileSystem::FindFileInPath")); wxString name; // skip path separator in the beginning of the file name if present diff --git a/src/common/fldlgcmn.cpp b/src/common/fldlgcmn.cpp index b621b6a07f..1d68284280 100644 --- a/src/common/fldlgcmn.cpp +++ b/src/common/fldlgcmn.cpp @@ -65,14 +65,14 @@ bool wxFileDialogBase::Create(wxWindow *parent, // check that the styles are not contradictory wxASSERT_MSG( !(HasFdFlag(wxFD_SAVE) && HasFdFlag(wxFD_OPEN)), - _T("can't specify both wxFD_SAVE and wxFD_OPEN at once") ); + wxT("can't specify both wxFD_SAVE and wxFD_OPEN at once") ); wxASSERT_MSG( !HasFdFlag(wxFD_SAVE) || (!HasFdFlag(wxFD_MULTIPLE) && !HasFdFlag(wxFD_FILE_MUST_EXIST)), - _T("wxFD_MULTIPLE or wxFD_FILE_MUST_EXIST can't be used with wxFD_SAVE" ) ); + wxT("wxFD_MULTIPLE or wxFD_FILE_MUST_EXIST can't be used with wxFD_SAVE" ) ); wxASSERT_MSG( !HasFdFlag(wxFD_OPEN) || !HasFdFlag(wxFD_OVERWRITE_PROMPT), - _T("wxFD_OVERWRITE_PROMPT can't be used with wxFD_OPEN") ); + wxT("wxFD_OVERWRITE_PROMPT can't be used with wxFD_OPEN") ); if ( wildCard.empty() || wildCard == wxFileSelectorDefaultWildcardStr ) { @@ -85,7 +85,7 @@ bool wxFileDialogBase::Create(wxWindow *parent, // convert m_wildCard from "*.bar" to "bar files (*.bar)|*.bar" if ( m_wildCard.Find(wxT('|')) == wxNOT_FOUND ) { - wxString::size_type nDot = m_wildCard.find(_T("*.")); + wxString::size_type nDot = m_wildCard.find(wxT("*.")); if ( nDot != wxString::npos ) nDot++; else @@ -300,7 +300,7 @@ static wxString wxDefaultFileSelector(bool load, wxString ext; if ( !extension.empty() ) { - if ( extension[0u] == _T('.') ) + if ( extension[0u] == wxT('.') ) ext = extension.substr(1); else ext = extension; diff --git a/src/common/fmapbase.cpp b/src/common/fmapbase.cpp index 0cd013c634..34cbea0d21 100644 --- a/src/common/fmapbase.cpp +++ b/src/common/fmapbase.cpp @@ -244,21 +244,21 @@ static const wxChar* gs_encodingNames[WXSIZEOF(gs_encodingDescs)][9] = { // names from the columns correspond to these OS: // Linux Solaris and IRIX HP-UX AIX - { _T("ISO-8859-1"), _T("ISO8859-1"), _T("iso88591"), _T("8859-1"), wxT("iso_8859_1"), NULL }, - { _T("ISO-8859-2"), _T("ISO8859-2"), _T("iso88592"), _T("8859-2"), NULL }, - { _T("ISO-8859-3"), _T("ISO8859-3"), _T("iso88593"), _T("8859-3"), NULL }, - { _T("ISO-8859-4"), _T("ISO8859-4"), _T("iso88594"), _T("8859-4"), NULL }, - { _T("ISO-8859-5"), _T("ISO8859-5"), _T("iso88595"), _T("8859-5"), NULL }, - { _T("ISO-8859-6"), _T("ISO8859-6"), _T("iso88596"), _T("8859-6"), NULL }, - { _T("ISO-8859-7"), _T("ISO8859-7"), _T("iso88597"), _T("8859-7"), NULL }, - { _T("ISO-8859-8"), _T("ISO8859-8"), _T("iso88598"), _T("8859-8"), NULL }, - { _T("ISO-8859-9"), _T("ISO8859-9"), _T("iso88599"), _T("8859-9"), NULL }, - { _T("ISO-8859-10"), _T("ISO8859-10"), _T("iso885910"), _T("8859-10"), NULL }, - { _T("ISO-8859-11"), _T("ISO8859-11"), _T("iso885911"), _T("8859-11"), NULL }, - { _T("ISO-8859-12"), _T("ISO8859-12"), _T("iso885912"), _T("8859-12"), NULL }, - { _T("ISO-8859-13"), _T("ISO8859-13"), _T("iso885913"), _T("8859-13"), NULL }, - { _T("ISO-8859-14"), _T("ISO8859-14"), _T("iso885914"), _T("8859-14"), NULL }, - { _T("ISO-8859-15"), _T("ISO8859-15"), _T("iso885915"), _T("8859-15"), NULL }, + { wxT("ISO-8859-1"), wxT("ISO8859-1"), wxT("iso88591"), wxT("8859-1"), wxT("iso_8859_1"), NULL }, + { wxT("ISO-8859-2"), wxT("ISO8859-2"), wxT("iso88592"), wxT("8859-2"), NULL }, + { wxT("ISO-8859-3"), wxT("ISO8859-3"), wxT("iso88593"), wxT("8859-3"), NULL }, + { wxT("ISO-8859-4"), wxT("ISO8859-4"), wxT("iso88594"), wxT("8859-4"), NULL }, + { wxT("ISO-8859-5"), wxT("ISO8859-5"), wxT("iso88595"), wxT("8859-5"), NULL }, + { wxT("ISO-8859-6"), wxT("ISO8859-6"), wxT("iso88596"), wxT("8859-6"), NULL }, + { wxT("ISO-8859-7"), wxT("ISO8859-7"), wxT("iso88597"), wxT("8859-7"), NULL }, + { wxT("ISO-8859-8"), wxT("ISO8859-8"), wxT("iso88598"), wxT("8859-8"), NULL }, + { wxT("ISO-8859-9"), wxT("ISO8859-9"), wxT("iso88599"), wxT("8859-9"), NULL }, + { wxT("ISO-8859-10"), wxT("ISO8859-10"), wxT("iso885910"), wxT("8859-10"), NULL }, + { wxT("ISO-8859-11"), wxT("ISO8859-11"), wxT("iso885911"), wxT("8859-11"), NULL }, + { wxT("ISO-8859-12"), wxT("ISO8859-12"), wxT("iso885912"), wxT("8859-12"), NULL }, + { wxT("ISO-8859-13"), wxT("ISO8859-13"), wxT("iso885913"), wxT("8859-13"), NULL }, + { wxT("ISO-8859-14"), wxT("ISO8859-14"), wxT("iso885914"), wxT("8859-14"), NULL }, + { wxT("ISO-8859-15"), wxT("ISO8859-15"), wxT("iso885915"), wxT("8859-15"), NULL }, // although koi8-ru is not strictly speaking the same as koi8-r, // they are similar enough to make mapping it to koi8 better than @@ -423,7 +423,7 @@ wxFontMapperBase *wxFontMapperBase::Get() sm_instance = traits->CreateFontMapper(); wxASSERT_MSG( sm_instance, - _T("wxAppTraits::CreateFontMapper() failed") ); + wxT("wxAppTraits::CreateFontMapper() failed") ); } if ( !sm_instance ) @@ -634,7 +634,7 @@ wxFontMapperBase::NonInteractiveCharsetToEncoding(const wxString& charset) // discard the optional quotes if ( !cs.empty() ) { - if ( cs[0u] == _T('"') && cs.Last() == _T('"') ) + if ( cs[0u] == wxT('"') && cs.Last() == wxT('"') ) { cs = wxString(cs.c_str(), cs.length() - 1); } @@ -775,7 +775,7 @@ size_t wxFontMapperBase::GetSupportedEncodingsCount() wxFontEncoding wxFontMapperBase::GetEncoding(size_t n) { wxCHECK_MSG( n < WXSIZEOF(gs_encodings), wxFONTENCODING_SYSTEM, - _T("wxFontMapper::GetEncoding(): invalid index") ); + wxT("wxFontMapper::GetEncoding(): invalid index") ); return gs_encodings[n]; } diff --git a/src/common/fontcmn.cpp b/src/common/fontcmn.cpp index 86d4e874c4..4010d6b7bc 100644 --- a/src/common/fontcmn.cpp +++ b/src/common/fontcmn.cpp @@ -57,13 +57,13 @@ extern const char *wxDumpFont(const wxFont *font) s.Printf(wxS("%s-%s-%s-%d-%d"), font->GetFaceName(), weight == wxFONTWEIGHT_NORMAL - ? _T("normal") + ? wxT("normal") : weight == wxFONTWEIGHT_BOLD - ? _T("bold") - : _T("light"), + ? wxT("bold") + : wxT("light"), font->GetStyle() == wxFONTSTYLE_NORMAL - ? _T("regular") - : _T("italic"), + ? wxT("regular") + : wxT("italic"), font->GetPointSize(), font->GetEncoding()); @@ -114,7 +114,7 @@ void wxFontBase::SetDefaultEncoding(wxFontEncoding encoding) // GetDefaultEncoding() should return something != wxFONTENCODING_DEFAULT // and, besides, using this value here doesn't make any sense wxCHECK_RET( encoding != wxFONTENCODING_DEFAULT, - _T("can't set default encoding to wxFONTENCODING_DEFAULT") ); + wxT("can't set default encoding to wxFONTENCODING_DEFAULT") ); ms_encodingDefault = encoding; } @@ -498,7 +498,7 @@ bool wxNativeFontInfo::FromString(const wxString& s) { long l; - wxStringTokenizer tokenizer(s, _T(";")); + wxStringTokenizer tokenizer(s, wxT(";")); wxString token = tokenizer.GetNextToken(); // @@ -549,7 +549,7 @@ wxString wxNativeFontInfo::ToString() const { wxString s; - s.Printf(_T("%d;%d;%d;%d;%d;%d;%s;%d"), + s.Printf(wxT("%d;%d;%d;%d;%d;%d;%s;%d"), 0, // version pointSize, family, @@ -667,7 +667,7 @@ wxString wxNativeFontInfo::ToUserString() const switch ( GetWeight() ) { default: - wxFAIL_MSG( _T("unknown font weight") ); + wxFAIL_MSG( wxT("unknown font weight") ); // fall through case wxFONTWEIGHT_NORMAL: @@ -685,7 +685,7 @@ wxString wxNativeFontInfo::ToUserString() const switch ( GetStyle() ) { default: - wxFAIL_MSG( _T("unknown font style") ); + wxFAIL_MSG( wxT("unknown font style") ); // fall through case wxFONTSTYLE_NORMAL: @@ -711,10 +711,10 @@ wxString wxNativeFontInfo::ToUserString() const // that the different words which compose this facename are // not different adjectives or other data but rather all parts // of the facename - desc << _T(" '") << face << _("'"); + desc << wxT(" '") << face << _("'"); } else - desc << _T(' ') << face; + desc << wxT(' ') << face; } else // no face name specified { @@ -761,14 +761,14 @@ wxString wxNativeFontInfo::ToUserString() const int size = GetPointSize(); if ( size != wxNORMAL_FONT->GetPointSize() ) { - desc << _T(' ') << size; + desc << wxT(' ') << size; } #if wxUSE_FONTMAP wxFontEncoding enc = GetEncoding(); if ( enc != wxFONTENCODING_DEFAULT && enc != wxFONTENCODING_SYSTEM ) { - desc << _T(' ') << wxFontMapper::GetEncodingName(enc); + desc << wxT(' ') << wxFontMapper::GetEncodingName(enc); } #endif // wxUSE_FONTMAP @@ -786,7 +786,7 @@ bool wxNativeFontInfo::FromUserString(const wxString& s) wxString toparse(s); // parse a more or less free form string - wxStringTokenizer tokenizer(toparse, _T(";, "), wxTOKEN_STRTOK); + wxStringTokenizer tokenizer(toparse, wxT(";, "), wxTOKEN_STRTOK); wxString face; unsigned long size; @@ -832,21 +832,21 @@ bool wxNativeFontInfo::FromUserString(const wxString& s) face += " " + token; continue; } - if ( token == _T("underlined") || token == _("underlined") ) + if ( token == wxT("underlined") || token == _("underlined") ) { SetUnderlined(true); } - else if ( token == _T("light") || token == _("light") ) + else if ( token == wxT("light") || token == _("light") ) { SetWeight(wxFONTWEIGHT_LIGHT); weightfound = true; } - else if ( token == _T("bold") || token == _("bold") ) + else if ( token == wxT("bold") || token == _("bold") ) { SetWeight(wxFONTWEIGHT_BOLD); weightfound = true; } - else if ( token == _T("italic") || token == _("italic") ) + else if ( token == wxT("italic") || token == _("italic") ) { SetStyle(wxFONTSTYLE_ITALIC); } @@ -873,7 +873,7 @@ bool wxNativeFontInfo::FromUserString(const wxString& s) // assume it is the face name if ( !face.empty() ) { - face += _T(' '); + face += wxT(' '); } face += token; @@ -974,7 +974,7 @@ wxString wxToString(const wxFontBase& font) bool wxFromString(const wxString& str, wxFontBase *font) { - wxCHECK_MSG( font, false, _T("NULL output parameter") ); + wxCHECK_MSG( font, false, wxT("NULL output parameter") ); if ( str.empty() ) { diff --git a/src/common/fontenumcmn.cpp b/src/common/fontenumcmn.cpp index 40e8eb95d2..b555500710 100644 --- a/src/common/fontenumcmn.cpp +++ b/src/common/fontenumcmn.cpp @@ -107,7 +107,7 @@ bool wxFontEnumerator::EnumerateEncodingsUTF8(const wxString& facename) { // name of UTF-8 encoding: no need to use wxFontMapper for it as it's // unlikely to change - const wxString utf8(_T("UTF-8")); + const wxString utf8(wxT("UTF-8")); // all fonts are in UTF-8 only if this code is used if ( !facename.empty() ) diff --git a/src/common/fontmap.cpp b/src/common/fontmap.cpp index 0dee4cb1f1..c1c8cb1e80 100644 --- a/src/common/fontmap.cpp +++ b/src/common/fontmap.cpp @@ -329,7 +329,7 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding, encName = GetEncodingName(encoding); if ( !facename.empty() ) { - configEntry = facename + _T("_"); + configEntry = facename + wxT("_"); } configEntry += encName; @@ -494,7 +494,7 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding, bool interactive) { wxCHECK_MSG( encodingAlt, false, - _T("wxFontEncoding::GetAltForEncoding(): NULL pointer") ); + wxT("wxFontEncoding::GetAltForEncoding(): NULL pointer") ); wxNativeEncodingInfo info; if ( !GetAltForEncoding(encoding, &info, facename, interactive) ) diff --git a/src/common/fontmgrcmn.cpp b/src/common/fontmgrcmn.cpp index 86c88d8be2..f942d736e8 100644 --- a/src/common/fontmgrcmn.cpp +++ b/src/common/fontmgrcmn.cpp @@ -69,7 +69,7 @@ void wxFontFaceBase::Release() wxFontInstance *wxFontFaceBase::GetFontInstance(float ptSize, bool aa) { - wxASSERT_MSG( m_refCnt > 0, _T("font library not loaded!") ); + wxASSERT_MSG( m_refCnt > 0, wxT("font library not loaded!") ); for ( wxFontInstanceList::const_iterator i = m_instances->begin(); i != m_instances->end(); ++i ) @@ -103,7 +103,7 @@ wxFontFace *wxFontBundleBase::GetFace(FaceType type) const { wxFontFace *f = m_faces[type]; - wxCHECK_MSG( f, NULL, _T("no such face in font bundle") ); + wxCHECK_MSG( f, NULL, wxT("no such face in font bundle") ); f->Acquire(); @@ -115,7 +115,7 @@ wxFontBundleBase::GetFaceForFont(const wxFontMgrFontRefData& font) const { wxASSERT_MSG( font.GetFaceName().empty() || GetName().CmpNoCase(font.GetFaceName()) == 0, - _T("calling GetFaceForFont for incompatible font") ); + wxT("calling GetFaceForFont for incompatible font") ); int type = FaceType_Regular; @@ -141,7 +141,7 @@ wxFontBundleBase::GetFaceForFont(const wxFontMgrFontRefData& font) const return GetFace((FaceType)i); } - wxFAIL_MSG( _T("no face") ); + wxFAIL_MSG( wxT("no face") ); return NULL; } diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index df7261eefc..9e9de0ac28 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -415,7 +415,7 @@ void wxFrameBase::DoGiveHelp(const wxString& help, bool show) if ( m_oldStatusText.empty() ) { // use special value to prevent us from doing this the next time - m_oldStatusText += _T('\0'); + m_oldStatusText += wxT('\0'); } } diff --git a/src/common/ftp.cpp b/src/common/ftp.cpp index 235a29d3db..519d7c5618 100644 --- a/src/common/ftp.cpp +++ b/src/common/ftp.cpp @@ -177,7 +177,7 @@ bool wxFTP::Close() if ( !CheckCommand(wxT("QUIT"), '2') ) { m_lastError = wxPROTO_CONNERR; - wxLogDebug(_T("Failed to close connection gracefully.")); + wxLogDebug(wxT("Failed to close connection gracefully.")); } } @@ -247,9 +247,9 @@ char wxFTP::SendCommand(const wxString& command) // don't show the passwords in the logs (even in debug ones) wxString cmd, password; - if ( command.Upper().StartsWith(_T("PASS "), &password) ) + if ( command.Upper().StartsWith(wxT("PASS "), &password) ) { - cmd << _T("PASS ") << wxString(_T('*'), password.length()); + cmd << wxT("PASS ") << wxString(wxT('*'), password.length()); } else { @@ -304,7 +304,7 @@ char wxFTP::GetResult() if ( !m_lastResult.empty() ) { // separate from last line - m_lastResult += _T('\n'); + m_lastResult += wxT('\n'); } m_lastResult += line; @@ -329,11 +329,11 @@ char wxFTP::GetResult() switch ( chMarker ) { - case _T(' '): + case wxT(' '): endOfReply = true; break; - case _T('-'): + case wxT('-'): firstLine = false; break; @@ -346,7 +346,7 @@ char wxFTP::GetResult() { if ( line.compare(0, LEN_CODE, code) == 0 ) { - if ( chMarker == _T(' ') ) + if ( chMarker == wxT(' ') ) { endOfReply = true; } @@ -357,7 +357,7 @@ char wxFTP::GetResult() if ( badReply ) { - wxLogDebug(_T("Broken FTP server: '%s' is not a valid reply."), + wxLogDebug(wxT("Broken FTP server: '%s' is not a valid reply."), m_lastResult.c_str()); m_lastError = wxPROTO_PROTERR; @@ -387,19 +387,19 @@ bool wxFTP::SetTransferMode(TransferMode transferMode) switch ( transferMode ) { default: - wxFAIL_MSG(_T("unknown FTP transfer mode")); + wxFAIL_MSG(wxT("unknown FTP transfer mode")); // fall through case BINARY: - mode = _T('I'); + mode = wxT('I'); break; case ASCII: - mode = _T('A'); + mode = wxT('A'); break; } - if ( !DoSimpleCommand(_T("TYPE"), mode) ) + if ( !DoSimpleCommand(wxT("TYPE"), mode) ) { wxLogError(_("Failed to set FTP transfer mode to %s."), (transferMode == ASCII ? _("ASCII") : _("binary"))); @@ -419,12 +419,12 @@ bool wxFTP::DoSimpleCommand(const wxChar *command, const wxString& arg) wxString fullcmd = command; if ( !arg.empty() ) { - fullcmd << _T(' ') << arg; + fullcmd << wxT(' ') << arg; } if ( !CheckCommand(fullcmd, '2') ) { - wxLogDebug(_T("FTP command '%s' failed."), fullcmd.c_str()); + wxLogDebug(wxT("FTP command '%s' failed."), fullcmd.c_str()); m_lastError = wxPROTO_NETERR; return false; @@ -440,17 +440,17 @@ bool wxFTP::ChDir(const wxString& dir) // tree conventions, but they always understand CDUP - should we use it if // dir == ".."? OTOH, do such servers (still) exist? - return DoSimpleCommand(_T("CWD"), dir); + return DoSimpleCommand(wxT("CWD"), dir); } bool wxFTP::MkDir(const wxString& dir) { - return DoSimpleCommand(_T("MKD"), dir); + return DoSimpleCommand(wxT("MKD"), dir); } bool wxFTP::RmDir(const wxString& dir) { - return DoSimpleCommand(_T("RMD"), dir); + return DoSimpleCommand(wxT("RMD"), dir); } wxString wxFTP::Pwd() @@ -461,20 +461,20 @@ wxString wxFTP::Pwd() { // the result is at least that long if CheckCommand() succeeded wxString::const_iterator p = m_lastResult.begin() + LEN_CODE + 1; - if ( *p != _T('"') ) + if ( *p != wxT('"') ) { - wxLogDebug(_T("Missing starting quote in reply for PWD: %s"), + wxLogDebug(wxT("Missing starting quote in reply for PWD: %s"), wxString(p, m_lastResult.end())); } else { for ( ++p; (bool)*p; ++p ) // FIXME-DMARS { - if ( *p == _T('"') ) + if ( *p == wxT('"') ) { // check if the quote is doubled ++p; - if ( !*p || *p != _T('"') ) + if ( !*p || *p != wxT('"') ) { // no, this is the end break; @@ -488,7 +488,7 @@ wxString wxFTP::Pwd() if ( !*p ) { - wxLogDebug(_T("Missing ending quote in reply for PWD: %s"), + wxLogDebug(wxT("Missing ending quote in reply for PWD: %s"), m_lastResult.c_str() + LEN_CODE + 1); } } @@ -496,7 +496,7 @@ wxString wxFTP::Pwd() else { m_lastError = wxPROTO_PROTERR; - wxLogDebug(_T("FTP PWD command failed.")); + wxLogDebug(wxT("FTP PWD command failed.")); } return path; @@ -566,10 +566,10 @@ wxString wxFTP::GetPortCmdArgument(const wxIPV4address& addrLocal, int portNew = addrNew.Service(); // We need to break the PORT number in bytes - addrIP.Replace(_T("."), _T(",")); - addrIP << _T(',') - << wxString::Format(_T("%d"), portNew >> 8) << _T(',') - << wxString::Format(_T("%d"), portNew & 0xff); + addrIP.Replace(wxT("."), wxT(",")); + addrIP << wxT(',') + << wxString::Format(wxT("%d"), portNew >> 8) << wxT(',') + << wxString::Format(wxT("%d"), portNew & 0xff); // Now we have a value like "10,0,0,1,5,23" return addrIP; @@ -599,7 +599,7 @@ wxSocketBase *wxFTP::GetActivePort() // addresses because the addrNew has an IP of "0.0.0.0", so we need the // value in addrLocal wxString port = GetPortCmdArgument(addrLocal, addrNew); - if ( !DoSimpleCommand(_T("PORT"), port) ) + if ( !DoSimpleCommand(wxT("PORT"), port) ) { m_lastError = wxPROTO_PROTERR; delete sockSrv; @@ -614,17 +614,17 @@ wxSocketBase *wxFTP::GetActivePort() wxSocketBase *wxFTP::GetPassivePort() { - if ( !DoSimpleCommand(_T("PASV")) ) + if ( !DoSimpleCommand(wxT("PASV")) ) { m_lastError = wxPROTO_PROTERR; wxLogError(_("The FTP server doesn't support passive mode.")); return NULL; } - size_t addrStart = m_lastResult.find(_T('(')); + size_t addrStart = m_lastResult.find(wxT('(')); size_t addrEnd = (addrStart == wxString::npos) ? wxString::npos - : m_lastResult.find(_T(')'), addrStart); + : m_lastResult.find(wxT(')'), addrStart); if ( addrEnd == wxString::npos ) { @@ -829,16 +829,16 @@ bool wxFTP::GetList(wxArrayString& files, // - Unix : result like "ls" command // - Windows : like "dir" command // - others : ? - wxString line(details ? _T("LIST") : _T("NLST")); + wxString line(details ? wxT("LIST") : wxT("NLST")); if ( !wildcard.empty() ) { - line << _T(' ') << wildcard; + line << wxT(' ') << wildcard; } if ( !CheckCommand(line, '1') ) { m_lastError = wxPROTO_PROTERR; - wxLogDebug(_T("FTP 'LIST' command returned unexpected result from server")); + wxLogDebug(wxT("FTP 'LIST' command returned unexpected result from server")); delete sock; return false; } @@ -911,7 +911,7 @@ int wxFTP::GetFileSize(const wxString& fileName) // will we need to hold this file? TransferMode oldTransfermode = m_currentTransfermode; SetTransferMode(BINARY); - command << _T("SIZE ") << fileName; + command << wxT("SIZE ") << fileName; bool ok = CheckCommand(command, '2'); @@ -921,7 +921,7 @@ int wxFTP::GetFileSize(const wxString& fileName) // 213 is File Status (STD9) // "SIZE" is not described anywhere..? It works on most servers int statuscode; - if ( wxSscanf(GetLastResult().c_str(), _T("%i %i"), + if ( wxSscanf(GetLastResult().c_str(), wxT("%i %i"), &statuscode, &filesize) == 2 ) { // We've gotten a good reply. @@ -984,11 +984,11 @@ int wxFTP::GetFileSize(const wxString& fileName) // check if the first character is '-'. This would // indicate Unix-style (this also limits this function // to searching for files, not directories) - if ( fileList[i].Mid(0, 1) == _T("-") ) + if ( fileList[i].Mid(0, 1) == wxT("-") ) { if ( wxSscanf(fileList[i].c_str(), - _T("%*s %*s %*s %*s %i %*s %*s %*s %*s"), + wxT("%*s %*s %*s %*s %i %*s %*s %*s %*s"), &filesize) != 9 ) { // Hmm... Invalid response @@ -998,7 +998,7 @@ int wxFTP::GetFileSize(const wxString& fileName) else // Windows-style response (?) { if ( wxSscanf(fileList[i].c_str(), - _T("%*s %*s %i %*s"), + wxT("%*s %*s %i %*s"), &filesize) != 4 ) { // something bad happened..? diff --git a/src/common/gbsizer.cpp b/src/common/gbsizer.cpp index 3a14dd4aa7..7369b1b145 100644 --- a/src/common/gbsizer.cpp +++ b/src/common/gbsizer.cpp @@ -278,7 +278,7 @@ wxGBPosition wxGridBagSizer::GetItemPosition(size_t index) { wxGBPosition badpos(-1,-1); wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, badpos, _T("Failed to find item.") ); + wxCHECK_MSG( node, badpos, wxT("Failed to find item.") ); wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); return item->GetPos(); } @@ -304,7 +304,7 @@ bool wxGridBagSizer::SetItemPosition(wxSizer *sizer, const wxGBPosition& pos) bool wxGridBagSizer::SetItemPosition(size_t index, const wxGBPosition& pos) { wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, false, _T("Failed to find item.") ); + wxCHECK_MSG( node, false, wxT("Failed to find item.") ); wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); return item->SetPos(pos); } @@ -315,7 +315,7 @@ wxGBSpan wxGridBagSizer::GetItemSpan(wxWindow *window) { wxGBSpan badspan(-1,-1); wxGBSizerItem* item = FindItem(window); - wxCHECK_MSG( item, badspan, _T("Failed to find item.") ); + wxCHECK_MSG( item, badspan, wxT("Failed to find item.") ); return item->GetSpan(); } @@ -324,7 +324,7 @@ wxGBSpan wxGridBagSizer::GetItemSpan(wxSizer *sizer) { wxGBSpan badspan(-1,-1); wxGBSizerItem* item = FindItem(sizer); - wxCHECK_MSG( item, badspan, _T("Failed to find item.") ); + wxCHECK_MSG( item, badspan, wxT("Failed to find item.") ); return item->GetSpan(); } @@ -333,7 +333,7 @@ wxGBSpan wxGridBagSizer::GetItemSpan(size_t index) { wxGBSpan badspan(-1,-1); wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, badspan, _T("Failed to find item.") ); + wxCHECK_MSG( node, badspan, wxT("Failed to find item.") ); wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); return item->GetSpan(); } @@ -359,7 +359,7 @@ bool wxGridBagSizer::SetItemSpan(wxSizer *sizer, const wxGBSpan& span) bool wxGridBagSizer::SetItemSpan(size_t index, const wxGBSpan& span) { wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, false, _T("Failed to find item.") ); + wxCHECK_MSG( node, false, wxT("Failed to find item.") ); wxGBSizerItem* item = (wxGBSizerItem*)node->GetData(); return item->SetSpan(span); } diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp index 3685bb54c6..06117b98c2 100644 --- a/src/common/gdicmn.cpp +++ b/src/common/gdicmn.cpp @@ -405,7 +405,7 @@ void wxColourDatabase::AddColour(const wxString& name, const wxColour& colour) // ... and we also allow both grey/gray wxString colNameAlt = colName; - if ( !colNameAlt.Replace(_T("GRAY"), _T("GREY")) ) + if ( !colNameAlt.Replace(wxT("GRAY"), wxT("GREY")) ) { // but in this case it is not necessary so avoid extra search below colNameAlt.clear(); @@ -433,7 +433,7 @@ wxColour wxColourDatabase::Find(const wxString& colour) const wxString colName = colour; colName.MakeUpper(); wxString colNameAlt = colName; - if ( !colNameAlt.Replace(_T("GRAY"), _T("GREY")) ) + if ( !colNameAlt.Replace(wxT("GRAY"), wxT("GREY")) ) colNameAlt.clear(); wxStringToColourHashMap::iterator it = m_map->find(colName); diff --git a/src/common/glcmn.cpp b/src/common/glcmn.cpp index ff3aa28601..e7dc25865c 100644 --- a/src/common/glcmn.cpp +++ b/src/common/glcmn.cpp @@ -57,7 +57,7 @@ bool wxGLCanvasBase::SetCurrent(const wxGLContext& context) const // although on MSW it works even if the window is still hidden, it doesn't // work in other ports (notably X11-based ones) and documentation mentions // that SetCurrent() can only be called for a shown window, so check for it - wxASSERT_MSG( IsShownOnScreen(), _T("can't make hidden GL canvas current") ); + wxASSERT_MSG( IsShownOnScreen(), wxT("can't make hidden GL canvas current") ); return context.SetCurrent(*static_cast(this)); } diff --git a/src/common/hashmap.cpp b/src/common/hashmap.cpp index cf0343ed38..66f14e5815 100644 --- a/src/common/hashmap.cpp +++ b/src/common/hashmap.cpp @@ -70,7 +70,7 @@ unsigned long _wxHashTableBase2::GetNextPrime( unsigned long n ) } /* someone might try to alloc a 2^32-element hash table */ - wxFAIL_MSG( _T("hash table too big?") ); + wxFAIL_MSG( wxT("hash table too big?") ); /* quiet warning */ return 0; diff --git a/src/common/iconbndl.cpp b/src/common/iconbndl.cpp index 26073476f3..5d509c0158 100644 --- a/src/common/iconbndl.cpp +++ b/src/common/iconbndl.cpp @@ -235,7 +235,7 @@ wxIcon wxIconBundle::GetIconOfExactSize(const wxSize& size) const void wxIconBundle::AddIcon(const wxIcon& icon) { - wxCHECK_RET( icon.IsOk(), _T("invalid icon") ); + wxCHECK_RET( icon.IsOk(), wxT("invalid icon") ); AllocExclusive(); @@ -266,7 +266,7 @@ size_t wxIconBundle::GetIconCount() const wxIcon wxIconBundle::GetIconByIndex(size_t n) const { - wxCHECK_MSG( n < GetIconCount(), wxNullIcon, _T("invalid index") ); + wxCHECK_MSG( n < GetIconCount(), wxNullIcon, wxT("invalid index") ); return M_ICONBUNDLEDATA->m_icons[n]; } diff --git a/src/common/imagbmp.cpp b/src/common/imagbmp.cpp index cc963bc7d2..bf232cd51a 100644 --- a/src/common/imagbmp.cpp +++ b/src/common/imagbmp.cpp @@ -79,7 +79,7 @@ bool wxBMPHandler::SaveDib(wxImage *image, bool IsMask) { - wxCHECK_MSG( image, false, _T("invalid pointer in wxBMPHandler::SaveFile") ); + wxCHECK_MSG( image, false, wxT("invalid pointer in wxBMPHandler::SaveFile") ); if ( !image->Ok() ) { @@ -188,7 +188,7 @@ bool wxBMPHandler::SaveDib(wxImage *image, switch ( GetResolutionFromOptions(*image, &hres, &vres) ) { default: - wxFAIL_MSG( _T("unexpected image resolution units") ); + wxFAIL_MSG( wxT("unexpected image resolution units") ); // fall through case wxIMAGE_RESOLUTION_NONE: diff --git a/src/common/image.cpp b/src/common/image.cpp index d8cbaa2cfd..5ae109c97a 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -175,7 +175,7 @@ bool wxImage::Create( int width, int height, unsigned char* data, bool static_da { UnRef(); - wxCHECK_MSG( data, false, _T("NULL data in wxImage::Create") ); + wxCHECK_MSG( data, false, wxT("NULL data in wxImage::Create") ); m_refData = new wxImageRefData(); @@ -192,7 +192,7 @@ bool wxImage::Create( int width, int height, unsigned char* data, unsigned char* { UnRef(); - wxCHECK_MSG( data, false, _T("NULL data in wxImage::Create") ); + wxCHECK_MSG( data, false, wxT("NULL data in wxImage::Create") ); m_refData = new wxImageRefData(); @@ -2348,7 +2348,7 @@ void wxImage::AddHandler( wxImageHandler *handler ) // may) we should probably refcount the duplicates. // also an issue in InsertHandler below. - wxLogDebug( _T("Adding duplicate image handler for '%s'"), + wxLogDebug( wxT("Adding duplicate image handler for '%s'"), handler->GetName().c_str() ); delete handler; } @@ -2364,7 +2364,7 @@ void wxImage::InsertHandler( wxImageHandler *handler ) else { // see AddHandler for additional comments. - wxLogDebug( _T("Inserting duplicate image handler for '%s'"), + wxLogDebug( wxT("Inserting duplicate image handler for '%s'"), handler->GetName().c_str() ); delete handler; } @@ -2672,7 +2672,7 @@ int wxImageHandler::GetImageCount( wxInputStream& stream ) // restore the old position to be able to test other formats and so on if ( stream.SeekI(posOld) == wxInvalidOffset ) { - wxLogDebug(_T("Failed to rewind the stream in wxImageHandler!")); + wxLogDebug(wxT("Failed to rewind the stream in wxImageHandler!")); // reading would fail anyhow as we're not at the right position return false; @@ -2708,7 +2708,7 @@ bool wxImageHandler::CallDoCanRead(wxInputStream& stream) // restore the old position to be able to test other formats and so on if ( stream.SeekI(posOld) == wxInvalidOffset ) { - wxLogDebug(_T("Failed to rewind the stream in wxImageHandler!")); + wxLogDebug(wxT("Failed to rewind the stream in wxImageHandler!")); // reading would fail anyhow as we're not at the right position return false; @@ -2723,7 +2723,7 @@ bool wxImageHandler::CallDoCanRead(wxInputStream& stream) wxImageResolution wxImageHandler::GetResolutionFromOptions(const wxImage& image, int *x, int *y) { - wxCHECK_MSG( x && y, wxIMAGE_RESOLUTION_NONE, _T("NULL pointer") ); + wxCHECK_MSG( x && y, wxIMAGE_RESOLUTION_NONE, wxT("NULL pointer") ); if ( image.HasOption(wxIMAGE_OPTION_RESOLUTIONX) && image.HasOption(wxIMAGE_OPTION_RESOLUTIONY) ) diff --git a/src/common/imagiff.cpp b/src/common/imagiff.cpp index 2c7dd95454..3dd0f7f392 100644 --- a/src/common/imagiff.cpp +++ b/src/common/imagiff.cpp @@ -379,7 +379,7 @@ int wxIFFDecoder::ReadIFF() return wxIFF_INVFORMAT; } - wxLogTrace(_T("iff"), _T("IFF ILBM file recognized")); + wxLogTrace(wxT("iff"), wxT("IFF ILBM file recognized")); dataptr = dataptr + 4; // skip ID @@ -438,7 +438,7 @@ int wxIFFDecoder::ReadIFF() } } - wxLogTrace(_T("iff"), _T("Read %d colors from IFF file."), + wxLogTrace(wxT("iff"), wxT("Read %d colors from IFF file."), colors); dataptr += 8 + chunkLen; // to next chunk @@ -501,8 +501,8 @@ int wxIFFDecoder::ReadIFF() } } - wxLogTrace(_T("iff"), - _T("LoadIFF: %s %dx%d, planes=%d (%d cols), comp=%d"), + wxLogTrace(wxT("iff"), + wxT("LoadIFF: %s %dx%d, planes=%d (%d cols), comp=%d"), (fmt==ILBM_NORMAL) ? "Normal ILBM" : (fmt==ILBM_HAM) ? "HAM ILBM" : (fmt==ILBM_HAM8) ? "HAM8 ILBM" : @@ -512,8 +512,8 @@ int wxIFFDecoder::ReadIFF() 1<> 1; @@ -704,12 +704,12 @@ int wxIFFDecoder::ReadIFF() m_image->h = height; m_image->transparent = bmhd_transcol; - wxLogTrace(_T("iff"), _T("Loaded IFF picture %s"), + wxLogTrace(wxT("iff"), wxT("Loaded IFF picture %s"), truncated? "truncated" : "completely"); return (truncated? wxIFF_TRUNCATED : wxIFF_OK); } else { - wxLogTrace(_T("iff"), _T("Skipping unknown chunk '%c%c%c%c'"), + wxLogTrace(wxT("iff"), wxT("Skipping unknown chunk '%c%c%c%c'"), *dataptr, *(dataptr+1), *(dataptr+2), *(dataptr+3)); dataptr = dataptr + 8 + chunkLen; // skip unknown chunk diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index abe155c880..14fd9eddb1 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -387,7 +387,7 @@ void CopyDataFromPNG(wxImage *image, // must be opaque then as otherwise we shouldn't be // using the mask at all - wxASSERT_MSG( IsOpaque(a), _T("logic error") ); + wxASSERT_MSG( IsOpaque(a), wxT("logic error") ); // fall through @@ -455,7 +455,7 @@ void CopyDataFromPNG(wxImage *image, { // must be opaque then as otherwise we shouldn't be // using the mask at all - wxASSERT_MSG( IsOpaque(a), _T("logic error") ); + wxASSERT_MSG( IsOpaque(a), wxT("logic error") ); // if we couldn't find a unique colour for the // mask, we can have real pixels with the same @@ -781,7 +781,7 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos break; default: - wxFAIL_MSG( _T("unsupported image resolution units") ); + wxFAIL_MSG( wxT("unsupported image resolution units") ); } if ( resX && resY ) @@ -828,7 +828,7 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos switch ( iColorType ) { default: - wxFAIL_MSG( _T("unknown wxPNG_TYPE_XXX") ); + wxFAIL_MSG( wxT("unknown wxPNG_TYPE_XXX") ); // fall through case wxPNG_TYPE_COLOUR: diff --git a/src/common/imagtiff.cpp b/src/common/imagtiff.cpp index 13606aeffe..68bfd86c0f 100644 --- a/src/common/imagtiff.cpp +++ b/src/common/imagtiff.cpp @@ -126,7 +126,7 @@ static toff_t wxFileOffsetToTIFF(wxFileOffset ofs) toff_t tofs = wx_truncate_cast(toff_t, ofs); wxCHECK_MSG( (wxFileOffset)tofs == ofs, (toff_t)-1, - _T("TIFF library doesn't support large files") ); + wxT("TIFF library doesn't support large files") ); return tofs; } @@ -482,7 +482,7 @@ bool wxTIFFHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbo switch ( res ) { default: - wxFAIL_MSG( _T("unknown image resolution units") ); + wxFAIL_MSG( wxT("unknown image resolution units") ); // fall through case wxIMAGE_RESOLUTION_NONE: diff --git a/src/common/init.cpp b/src/common/init.cpp index cac8abde3c..90afc70ac8 100644 --- a/src/common/init.cpp +++ b/src/common/init.cpp @@ -64,7 +64,7 @@ class wxDummyConsoleApp : public wxAppConsole public: wxDummyConsoleApp() { } - virtual int OnRun() { wxFAIL_MSG( _T("unreachable code") ); return 0; } + virtual int OnRun() { wxFAIL_MSG( wxT("unreachable code") ); return 0; } virtual bool DoYield(bool, long) { return true; } wxDECLARE_NO_COPY_CLASS(wxDummyConsoleApp); diff --git a/src/common/intl.cpp b/src/common/intl.cpp index f5fe1b49cd..e031315b21 100644 --- a/src/common/intl.cpp +++ b/src/common/intl.cpp @@ -1005,7 +1005,7 @@ static wxString wxGetANSICodePageForLocale(LCID lcid) if ( ::GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE, buffer, WXSIZEOF(buffer)) > 0 ) { - if ( buffer[0] != _T('0') || buffer[1] != _T('\0') ) + if ( buffer[0] != wxT('0') || buffer[1] != wxT('\0') ) cp = buffer; //else: this locale doesn't use ANSI code page } @@ -1025,10 +1025,10 @@ wxString wxLanguageInfo::GetLocaleName() const const LCID lcid = GetLCID(); wxChar buffer[256]; - buffer[0] = _T('\0'); + buffer[0] = wxT('\0'); if ( !::GetLocaleInfo(lcid, LOCALE_SENGLANGUAGE, buffer, WXSIZEOF(buffer)) ) { - wxLogLastError(_T("GetLocaleInfo(LOCALE_SENGLANGUAGE)")); + wxLogLastError(wxT("GetLocaleInfo(LOCALE_SENGLANGUAGE)")); return locale; } @@ -1036,13 +1036,13 @@ wxString wxLanguageInfo::GetLocaleName() const if ( ::GetLocaleInfo(lcid, LOCALE_SENGCOUNTRY, buffer, WXSIZEOF(buffer)) > 0 ) { - locale << _T('_') << buffer; + locale << wxT('_') << buffer; } const wxString cp = wxGetANSICodePageForLocale(lcid); if ( !cp.empty() ) { - locale << _T('.') << cp; + locale << wxT('.') << cp; } return locale; @@ -2844,10 +2844,10 @@ static wxString TranslateFromUnicodeFormat(const wxString& fmt) break; // not a special character so must be just a separator, treat as is - if ( *p == _T('%') ) + if ( *p == wxT('%') ) { // this one needs to be escaped - fmtWX += _T('%'); + fmtWX += wxT('%'); } fmtWX += *p; diff --git a/src/common/ipcbase.cpp b/src/common/ipcbase.cpp index 64c6c1f760..2f6a30ab75 100644 --- a/src/common/ipcbase.cpp +++ b/src/common/ipcbase.cpp @@ -55,7 +55,7 @@ wxConnectionBase::wxConnectionBase(const wxConnectionBase& copy) { // copy constructor would require ref-counted pointer to buffer - wxFAIL_MSG( _T("Copy constructor of wxConnectionBase not implemented") ); + wxFAIL_MSG( wxT("Copy constructor of wxConnectionBase not implemented") ); } diff --git a/src/common/list.cpp b/src/common/list.cpp index 4bdefdba20..60703f48c9 100644 --- a/src/common/list.cpp +++ b/src/common/list.cpp @@ -201,7 +201,7 @@ void wxListBase::DoCopy(const wxListBase& list) } } - wxASSERT_MSG( m_count == list.m_count, _T("logic error in wxList::DoCopy") ); + wxASSERT_MSG( m_count == list.m_count, wxT("logic error in wxList::DoCopy") ); } wxListBase::~wxListBase() diff --git a/src/common/longlong.cpp b/src/common/longlong.cpp index 85591bb67c..27e771096d 100644 --- a/src/common/longlong.cpp +++ b/src/common/longlong.cpp @@ -1172,7 +1172,7 @@ void *wxULongLongWx::asArray(void) const while ( ll != 0 ) \ { \ long digit = (ll % 10).ToLong(); \ - result.Prepend((wxChar)(_T('0') - digit)); \ + result.Prepend((wxChar)(wxT('0') - digit)); \ ll /= 10; \ } \ } \ @@ -1181,15 +1181,15 @@ void *wxULongLongWx::asArray(void) const while ( ll != 0 ) \ { \ long digit = (ll % 10).ToLong(); \ - result.Prepend((wxChar)(_T('0') + digit)); \ + result.Prepend((wxChar)(wxT('0') + digit)); \ ll /= 10; \ } \ } \ \ if ( result.empty() ) \ - result = _T('0'); \ + result = wxT('0'); \ else if ( neg ) \ - result.Prepend(_T('-')); \ + result.Prepend(wxT('-')); \ \ return result; \ } @@ -1204,12 +1204,12 @@ void *wxULongLongWx::asArray(void) const \ while ( ll != 0 ) \ { \ - result.Prepend((wxChar)(_T('0') + (ll % 10).ToULong())); \ + result.Prepend((wxChar)(wxT('0') + (ll % 10).ToULong())); \ ll /= 10; \ } \ \ if ( result.empty() ) \ - result = _T('0'); \ + result = wxT('0'); \ \ return result; \ } @@ -1263,7 +1263,7 @@ WXDLLIMPEXP_BASE wxTextOutputStream& operator<< (wxTextOutputStream& o, const wx return o << ll.ToString(); } -#define READ_STRING_CHAR(s, idx, len) ((idx!=len) ? (wxChar)s[idx++] : _T('\0')) +#define READ_STRING_CHAR(s, idx, len) ((idx!=len) ? (wxChar)s[idx++] : wxT('\0')) WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &o, wxULongLong &ll) { diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 71658b74db..8855c9d3de 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -831,16 +831,16 @@ void wxDebugContext::OutputDumpLine(const wxChar *szFormat, ...) int count; va_list argptr; va_start(argptr, szFormat); - buf[WXSIZEOF(buf)-1] = _T('\0'); + buf[WXSIZEOF(buf)-1] = wxT('\0'); // keep 3 bytes for a \r\n\0 count = wxVsnprintf(buf, WXSIZEOF(buf)-3, szFormat, argptr); if ( count < 0 ) count = WXSIZEOF(buf)-3; - buf[count]=_T('\r'); - buf[count+1]=_T('\n'); - buf[count+2]=_T('\0'); + buf[count]=wxT('\r'); + buf[count+1]=wxT('\n'); + buf[count+2]=wxT('\0'); wxMessageOutputDebug dbgout; dbgout.Printf(buf); diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 9e5d1e8715..65adec344f 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -168,7 +168,7 @@ wxMenuBase::~wxMenuBase() void wxMenuBase::AddSubMenu(wxMenu *submenu) { - wxCHECK_RET( submenu, _T("can't add a NULL submenu") ); + wxCHECK_RET( submenu, wxT("can't add a NULL submenu") ); submenu->SetParent((wxMenu *)this); } @@ -384,7 +384,7 @@ wxMenuItem *wxMenuBase::FindChildItem(int id, size_t *ppos) const wxMenuItem* wxMenuBase::FindItemByPosition(size_t position) const { wxCHECK_MSG( position < m_items.GetCount(), NULL, - _T("wxMenu::FindItemByPosition(): invalid menu index") ); + wxT("wxMenu::FindItemByPosition(): invalid menu index") ); return m_items.Item( position )->GetData(); } @@ -496,10 +496,10 @@ wxMenuBar* wxMenuBase::GetMenuBar() const void wxMenuBase::Attach(wxMenuBarBase *menubar) { // use Detach() instead! - wxASSERT_MSG( menubar, _T("menu can't be attached to NULL menubar") ); + wxASSERT_MSG( menubar, wxT("menu can't be attached to NULL menubar") ); // use IsAttached() to prevent this from happening - wxASSERT_MSG( !m_menuBar, _T("attaching menu twice?") ); + wxASSERT_MSG( !m_menuBar, wxT("attaching menu twice?") ); m_menuBar = (wxMenuBar *)menubar; } @@ -507,7 +507,7 @@ void wxMenuBase::Attach(wxMenuBarBase *menubar) void wxMenuBase::Detach() { // use IsAttached() to prevent this from happening - wxASSERT_MSG( m_menuBar, _T("detaching unattached menu?") ); + wxASSERT_MSG( m_menuBar, wxT("detaching unattached menu?") ); m_menuBar = NULL; } diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index 1121e348a7..32430d97d2 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -262,7 +262,7 @@ wxString wxFileType::ExpandCommand(const wxString& command, // test now carried out on reading file so test should never get here if ( !hasFilename && !str.empty() #ifdef __UNIX__ - && !str.StartsWith(_T("test ")) + && !str.StartsWith(wxT("test ")) #endif // Unix ) { str << wxT(" < '") << params.GetFileName() << wxT('\''); @@ -302,7 +302,7 @@ bool wxFileType::GetExtensions(wxArrayString& extensions) bool wxFileType::GetMimeType(wxString *mimeType) const { - wxCHECK_MSG( mimeType, false, _T("invalid parameter in GetMimeType") ); + wxCHECK_MSG( mimeType, false, wxT("invalid parameter in GetMimeType") ); if ( m_info ) { @@ -366,7 +366,7 @@ wxFileType::GetIcon(wxIconLocation *iconloc, bool wxFileType::GetDescription(wxString *desc) const { - wxCHECK_MSG( desc, false, _T("invalid parameter in GetDescription") ); + wxCHECK_MSG( desc, false, wxT("invalid parameter in GetDescription") ); if ( m_info ) { @@ -382,7 +382,7 @@ bool wxFileType::GetOpenCommand(wxString *openCmd, const wxFileType::MessageParameters& params) const { - wxCHECK_MSG( openCmd, false, _T("invalid parameter in GetOpenCommand") ); + wxCHECK_MSG( openCmd, false, wxT("invalid parameter in GetOpenCommand") ); if ( m_info ) { @@ -410,7 +410,7 @@ bool wxFileType::GetPrintCommand(wxString *printCmd, const wxFileType::MessageParameters& params) const { - wxCHECK_MSG( printCmd, false, _T("invalid parameter in GetPrintCommand") ); + wxCHECK_MSG( printCmd, false, wxT("invalid parameter in GetPrintCommand") ); if ( m_info ) { @@ -442,7 +442,7 @@ size_t wxFileType::GetAllCommands(wxArrayString *verbs, if ( GetOpenCommand(&cmd, params) ) { if ( verbs ) - verbs->Add(_T("Open")); + verbs->Add(wxT("Open")); if ( commands ) commands->Add(cmd); count++; @@ -451,7 +451,7 @@ size_t wxFileType::GetAllCommands(wxArrayString *verbs, if ( GetPrintCommand(&cmd, params) ) { if ( verbs ) - verbs->Add(_T("Print")); + verbs->Add(wxT("Print")); if ( commands ) commands->Add(cmd); @@ -469,7 +469,7 @@ bool wxFileType::Unassociate() #elif defined(__UNIX__) return m_impl->Unassociate(this); #else - wxFAIL_MSG( _T("not implemented") ); // TODO + wxFAIL_MSG( wxT("not implemented") ); // TODO return false; #endif } @@ -484,7 +484,7 @@ bool wxFileType::SetCommand(const wxString& cmd, wxUnusedVar(cmd); wxUnusedVar(verb); wxUnusedVar(overwriteprompt); - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(wxT("not implemented")); return false; #endif } @@ -498,13 +498,13 @@ bool wxFileType::SetDefaultIcon(const wxString& cmd, int index) if ( sTmp.empty() ) GetOpenCommand(&sTmp, wxFileType::MessageParameters(wxEmptyString, wxEmptyString)); #endif - wxCHECK_MSG( !sTmp.empty(), false, _T("need the icon file") ); + wxCHECK_MSG( !sTmp.empty(), false, wxT("need the icon file") ); #if defined (__WXMSW__) || defined(__UNIX__) return m_impl->SetDefaultIcon (cmd, index); #else wxUnusedVar(index); - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(wxT("not implemented")); return false; #endif } @@ -602,7 +602,7 @@ wxMimeTypesManager::Associate(const wxFileTypeInfo& ftInfo) return m_impl->Associate(ftInfo); #else // other platforms wxUnusedVar(ftInfo); - wxFAIL_MSG( _T("not implemented") ); // TODO + wxFAIL_MSG( wxT("not implemented") ); // TODO return NULL; #endif // platforms } @@ -620,7 +620,7 @@ wxMimeTypesManager::GetFileTypeFromExtension(const wxString& ext) else extWithoutDot = ext; - wxCHECK_MSG( !ext.empty(), NULL, _T("extension can't be empty") ); + wxCHECK_MSG( !ext.empty(), NULL, wxT("extension can't be empty") ); wxFileType *ft = m_impl->GetFileTypeFromExtension(extWithoutDot); diff --git a/src/common/module.cpp b/src/common/module.cpp index 230b8aa577..4f61711b48 100644 --- a/src/common/module.cpp +++ b/src/common/module.cpp @@ -26,7 +26,7 @@ #include "wx/listimpl.cpp" -#define TRACE_MODULE _T("module") +#define TRACE_MODULE wxT("module") WX_DEFINE_LIST(wxModuleList) @@ -192,7 +192,7 @@ void wxModule::DoCleanUpModules(const wxModuleList& modules) wxModule * module = node->GetData(); wxASSERT_MSG( module->m_state == State_Initialized, - _T("not initialized module being cleaned up") ); + wxT("not initialized module being cleaned up") ); module->Exit(); module->m_state = State_Registered; diff --git a/src/common/mstream.cpp b/src/common/mstream.cpp index 24252d273c..5ecc10f704 100644 --- a/src/common/mstream.cpp +++ b/src/common/mstream.cpp @@ -65,7 +65,7 @@ wxMemoryInputStream::wxMemoryInputStream(const wxMemoryOutputStream& stream) } const size_t len = wx_truncate_cast(size_t, lenFile); - wxASSERT_MSG( len == lenFile + size_t(0), _T("huge files not supported") ); + wxASSERT_MSG( len == lenFile + size_t(0), wxT("huge files not supported") ); m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read); m_i_streambuf->SetBufferIO(len); // create buffer @@ -89,7 +89,7 @@ wxMemoryInputStream::InitFromStream(wxInputStream& stream, wxFileOffset lenFile) } const size_t len = wx_truncate_cast(size_t, lenFile); - wxASSERT_MSG( (wxFileOffset)len == lenFile, _T("huge files not supported") ); + wxASSERT_MSG( (wxFileOffset)len == lenFile, wxT("huge files not supported") ); m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read); m_i_streambuf->SetBufferIO(len); // create buffer @@ -194,7 +194,7 @@ wxFileOffset wxMemoryOutputStream::OnSysTell() const size_t wxMemoryOutputStream::CopyTo(void *buffer, size_t len) const { - wxCHECK_MSG( buffer, 0, _T("must have buffer to CopyTo") ); + wxCHECK_MSG( buffer, 0, wxT("must have buffer to CopyTo") ); if ( len > GetSize() ) len = GetSize(); diff --git a/src/common/object.cpp b/src/common/object.cpp index 622aa2f2eb..57825a52c5 100644 --- a/src/common/object.cpp +++ b/src/common/object.cpp @@ -235,7 +235,7 @@ void wxClassInfo::Register() else { // guard againt reentrance once the global has been created - wxASSERT_MSG(++entry == 1, _T("wxClassInfo::Register() reentrance")); + wxASSERT_MSG(++entry == 1, wxT("wxClassInfo::Register() reentrance")); classTable = sm_classTable; } @@ -247,7 +247,7 @@ void wxClassInfo::Register() wxASSERT_MSG( classTable->Get(m_className) == NULL, wxString::Format ( - _T("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"), + wxT("Class \"%s\" already in RTTI table - have you used IMPLEMENT_DYNAMIC_CLASS() multiple times or linked some object file twice)?"), m_className ) ); @@ -411,13 +411,13 @@ void wxObject::AllocExclusive() //else: ref count is 1, we are exclusive owners of m_refData anyhow wxASSERT_MSG( m_refData && m_refData->GetRefCount() == 1, - _T("wxObject::AllocExclusive() failed.") ); + wxT("wxObject::AllocExclusive() failed.") ); } wxObjectRefData *wxObject::CreateRefData() const { // if you use AllocExclusive() you must override this method - wxFAIL_MSG( _T("CreateRefData() must be overridden if called!") ); + wxFAIL_MSG( wxT("CreateRefData() must be overridden if called!") ); return NULL; } @@ -426,7 +426,7 @@ wxObjectRefData * wxObject::CloneRefData(const wxObjectRefData * WXUNUSED(data)) const { // if you use AllocExclusive() you must override this method - wxFAIL_MSG( _T("CloneRefData() must be overridden if called!") ); + wxFAIL_MSG( wxT("CloneRefData() must be overridden if called!") ); return NULL; } diff --git a/src/common/platinfo.cpp b/src/common/platinfo.cpp index a687a47862..a1baeb1017 100644 --- a/src/common/platinfo.cpp +++ b/src/common/platinfo.cpp @@ -45,60 +45,60 @@ static wxPlatformInfo gs_platInfo(wxPORT_UNKNOWN); static const wxChar* const wxOperatingSystemIdNames[] = { - _T("Apple Mac OS"), - _T("Apple Mac OS X"), + wxT("Apple Mac OS"), + wxT("Apple Mac OS X"), - _T("Microsoft Windows 9X"), - _T("Microsoft Windows NT"), - _T("Microsoft Windows Micro"), - _T("Microsoft Windows CE"), + wxT("Microsoft Windows 9X"), + wxT("Microsoft Windows NT"), + wxT("Microsoft Windows Micro"), + wxT("Microsoft Windows CE"), - _T("Linux"), - _T("FreeBSD"), - _T("OpenBSD"), - _T("NetBSD"), + wxT("Linux"), + wxT("FreeBSD"), + wxT("OpenBSD"), + wxT("NetBSD"), - _T("SunOS"), - _T("AIX"), - _T("HPUX"), + wxT("SunOS"), + wxT("AIX"), + wxT("HPUX"), - _T("Other Unix"), - _T("Other Unix"), + wxT("Other Unix"), + wxT("Other Unix"), - _T("DOS"), - _T("OS/2"), + wxT("DOS"), + wxT("OS/2"), - _T("PalmOS"), - _T("PalmOS(Over Linux)"), + wxT("PalmOS"), + wxT("PalmOS(Over Linux)"), }; static const wxChar* const wxPortIdNames[] = { - _T("wxBase"), - _T("wxMSW"), - _T("wxMotif"), - _T("wxGTK"), - _T("wxMGL"), - _T("wxX11"), - _T("wxOS2"), - _T("wxMac"), - _T("wxCocoa"), - _T("wxWinCE"), - _T("wxPalmOS"), - _T("wxDFB") + wxT("wxBase"), + wxT("wxMSW"), + wxT("wxMotif"), + wxT("wxGTK"), + wxT("wxMGL"), + wxT("wxX11"), + wxT("wxOS2"), + wxT("wxMac"), + wxT("wxCocoa"), + wxT("wxWinCE"), + wxT("wxPalmOS"), + wxT("wxDFB") }; static const wxChar* const wxArchitectureNames[] = { - _T("32 bit"), - _T("64 bit") + wxT("32 bit"), + wxT("64 bit") }; static const wxChar* const wxEndiannessNames[] = { - _T("Big endian"), - _T("Little endian"), - _T("PDP endian") + wxT("Big endian"), + wxT("Little endian"), + wxT("PDP endian") }; // ---------------------------------------------------------------------------- @@ -109,7 +109,7 @@ static const wxChar* const wxEndiannessNames[] = // corresponding indexes of the string arrays above static unsigned wxGetIndexFromEnumValue(int value) { - wxCHECK_MSG( value, (unsigned)-1, _T("invalid enum value") ); + wxCHECK_MSG( value, (unsigned)-1, wxT("invalid enum value") ); int n = 0; while ( !(value & 1) ) @@ -118,7 +118,7 @@ static unsigned wxGetIndexFromEnumValue(int value) n++; } - wxASSERT_MSG( value == 1, _T("more than one bit set in enum value") ); + wxASSERT_MSG( value == 1, wxT("more than one bit set in enum value") ); return n; } @@ -174,7 +174,7 @@ void wxPlatformInfo::InitForCurrentPlatform() const wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL; if ( !traits ) { - wxFAIL_MSG( _T("failed to initialize wxPlatformInfo") ); + wxFAIL_MSG( wxT("failed to initialize wxPlatformInfo") ); m_port = wxPORT_UNKNOWN; m_usingUniversal = false; @@ -226,17 +226,17 @@ wxString wxPlatformInfo::GetOperatingSystemDirectory() wxString wxPlatformInfo::GetOperatingSystemFamilyName(wxOperatingSystemId os) { - const wxChar* string = _T("Unknown"); + const wxChar* string = wxT("Unknown"); if ( os & wxOS_MAC ) - string = _T("Macintosh"); + string = wxT("Macintosh"); else if ( os & wxOS_WINDOWS ) - string = _T("Windows"); + string = wxT("Windows"); else if ( os & wxOS_UNIX ) - string = _T("Unix"); + string = wxT("Unix"); else if ( os == wxOS_DOS ) - string = _T("DOS"); + string = wxT("DOS"); else if ( os == wxOS_OS2 ) - string = _T("OS/2"); + string = wxT("OS/2"); return string; } @@ -246,7 +246,7 @@ wxString wxPlatformInfo::GetOperatingSystemIdName(wxOperatingSystemId os) const unsigned idx = wxGetIndexFromEnumValue(os); wxCHECK_MSG( idx < WXSIZEOF(wxOperatingSystemIdNames), wxEmptyString, - _T("invalid OS id") ); + wxT("invalid OS id") ); return wxOperatingSystemIdNames[idx]; } @@ -256,7 +256,7 @@ wxString wxPlatformInfo::GetPortIdName(wxPortId port, bool usingUniversal) const unsigned idx = wxGetIndexFromEnumValue(port); wxCHECK_MSG( idx < WXSIZEOF(wxPortIdNames), wxEmptyString, - _T("invalid port id") ); + wxT("invalid port id") ); wxString ret = wxPortIdNames[idx]; @@ -271,7 +271,7 @@ wxString wxPlatformInfo::GetPortIdShortName(wxPortId port, bool usingUniversal) const unsigned idx = wxGetIndexFromEnumValue(port); wxCHECK_MSG( idx < WXSIZEOF(wxPortIdNames), wxEmptyString, - _T("invalid port id") ); + wxT("invalid port id") ); wxString ret = wxPortIdNames[idx]; ret = ret.Mid(2).Lower(); // remove 'wx' prefix diff --git a/src/common/popupcmn.cpp b/src/common/popupcmn.cpp index 5b1a49504b..d837d7b0c4 100644 --- a/src/common/popupcmn.cpp +++ b/src/common/popupcmn.cpp @@ -552,7 +552,7 @@ void wxPopupWindowHandler::OnLeftDown(wxMouseEvent& event) default: // forgot to update the switch after adding a new hit test code? - wxFAIL_MSG( _T("unexpected HitTest() return value") ); + wxFAIL_MSG( wxT("unexpected HitTest() return value") ); // fall through case wxHT_WINDOW_CORNER: diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index d4aa30278a..fcab021603 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -1583,7 +1583,7 @@ bool wxPrintPreviewBase::RenderPage(int pageNum) if (!m_previewCanvas) { - wxFAIL_MSG(_T("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!")); + wxFAIL_MSG(wxT("wxPrintPreviewBase::RenderPage: must use wxPrintPreviewBase::SetCanvas to let me know about the canvas!")); return false; } diff --git a/src/common/process.cpp b/src/common/process.cpp index 26e14c560e..ec9686c965 100644 --- a/src/common/process.cpp +++ b/src/common/process.cpp @@ -168,7 +168,7 @@ bool wxProcess::Exists(int pid) default: case wxKILL_ERROR: case wxKILL_BAD_SIGNAL: - wxFAIL_MSG( _T("unexpected wxProcess::Kill() return code") ); + wxFAIL_MSG( wxT("unexpected wxProcess::Kill() return code") ); // fall through case wxKILL_NO_PROCESS: diff --git a/src/common/protocol.cpp b/src/common/protocol.cpp index 1f508709eb..110afc760c 100644 --- a/src/common/protocol.cpp +++ b/src/common/protocol.cpp @@ -137,7 +137,7 @@ wxProtocolError wxProtocol::ReadLine(wxSocketBase *sock, wxString& result) if ( eol == pBuf ) { // check for case of "\r\n" being split - if ( result.empty() || result.Last() != _T('\r') ) + if ( result.empty() || result.Last() != wxT('\r') ) { // ignore the stray '\n' eol = NULL; diff --git a/src/common/radiocmn.cpp b/src/common/radiocmn.cpp index f1fec65ad5..766bd52109 100644 --- a/src/common/radiocmn.cpp +++ b/src/common/radiocmn.cpp @@ -44,7 +44,7 @@ void wxRadioBoxBase::SetMajorDim(unsigned int majorDim, long style) { - wxCHECK_RET( majorDim != 0, _T("major radiobox dimension can't be 0") ); + wxCHECK_RET( majorDim != 0, wxT("major radiobox dimension can't be 0") ); m_majorDim = majorDim; @@ -125,7 +125,7 @@ int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const break; default: - wxFAIL_MSG( _T("unexpected wxDirection value") ); + wxFAIL_MSG( wxT("unexpected wxDirection value") ); return wxNOT_FOUND; } @@ -158,7 +158,7 @@ int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const } wxASSERT_MSG( item < count && item >= 0, - _T("logic error in wxRadioBox::GetNextItem()") ); + wxT("logic error in wxRadioBox::GetNextItem()") ); } // we shouldn't select the non-active items, continue looking for a // visible and shown one unless we came back to the item we started from in @@ -172,7 +172,7 @@ int wxRadioBoxBase::GetNextItem(int item, wxDirection dir, long style) const void wxRadioBoxBase::SetItemToolTip(unsigned int item, const wxString& text) { - wxASSERT_MSG( item < GetCount(), _T("Invalid item index") ); + wxASSERT_MSG( item < GetCount(), wxT("Invalid item index") ); // extend the array to have entries for all our items on first use if ( !m_itemsTooltips ) @@ -247,7 +247,7 @@ wxRadioBoxBase::~wxRadioBoxBase() // set helptext for a particular item void wxRadioBoxBase::SetItemHelpText(unsigned int n, const wxString& helpText) { - wxCHECK_RET( n < GetCount(), _T("Invalid item index") ); + wxCHECK_RET( n < GetCount(), wxT("Invalid item index") ); if ( m_itemsHelpTexts.empty() ) { @@ -261,7 +261,7 @@ void wxRadioBoxBase::SetItemHelpText(unsigned int n, const wxString& helpText) // retrieve helptext for a particular item wxString wxRadioBoxBase::GetItemHelpText( unsigned int n ) const { - wxCHECK_MSG( n < GetCount(), wxEmptyString, _T("Invalid item index") ); + wxCHECK_MSG( n < GetCount(), wxEmptyString, wxT("Invalid item index") ); return m_itemsHelpTexts.empty() ? wxString() : m_itemsHelpTexts[n]; } diff --git a/src/common/regex.cpp b/src/common/regex.cpp index 30dddf3804..f97d0727bc 100644 --- a/src/common/regex.cpp +++ b/src/common/regex.cpp @@ -274,10 +274,10 @@ bool wxRegExImpl::Compile(const wxString& expr, int flags) #else # define FLAVORS (wxRE_ADVANCED | wxRE_BASIC) wxASSERT_MSG( (flags & FLAVORS) != FLAVORS, - _T("incompatible flags in wxRegEx::Compile") ); + wxT("incompatible flags in wxRegEx::Compile") ); #endif wxASSERT_MSG( !(flags & ~(FLAVORS | wxRE_ICASE | wxRE_NOSUB | wxRE_NEWLINE)), - _T("unrecognized flags in wxRegEx::Compile") ); + wxT("unrecognized flags in wxRegEx::Compile") ); // translate our flags to regcomp() ones int flagsRE = 0; @@ -335,15 +335,15 @@ bool wxRegExImpl::Compile(const wxString& expr, int flags) // and some more for bracketed subexperessions for ( const wxChar *cptr = expr.c_str(); *cptr; cptr++ ) { - if ( *cptr == _T('\\') ) + if ( *cptr == wxT('\\') ) { // in basic RE syntax groups are inside \(...\) - if ( *++cptr == _T('(') && (flags & wxRE_BASIC) ) + if ( *++cptr == wxT('(') && (flags & wxRE_BASIC) ) { m_nMatches++; } } - else if ( *cptr == _T('(') && !(flags & wxRE_BASIC) ) + else if ( *cptr == wxT('(') && !(flags & wxRE_BASIC) ) { // we know that the previous character is not an unquoted // backslash because it would have been eaten above, so we @@ -351,7 +351,7 @@ bool wxRegExImpl::Compile(const wxString& expr, int flags) // extended syntax. '(?' is used for extensions by perl- // like REs (e.g. advanced), and is not valid for POSIX // extended, so ignore them always. - if ( cptr[1] != _T('?') ) + if ( cptr[1] != wxT('?') ) m_nMatches++; } } @@ -394,11 +394,11 @@ bool wxRegExImpl::Matches(const wxRegChar *str, int flags WXREGEX_IF_NEED_LEN(size_t len)) const { - wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") ); + wxCHECK_MSG( IsValid(), false, wxT("must successfully Compile() first") ); // translate our flags to regexec() ones wxASSERT_MSG( !(flags & ~(wxRE_NOTBOL | wxRE_NOTEOL)), - _T("unrecognized flags in wxRegEx::Matches") ); + wxT("unrecognized flags in wxRegEx::Matches") ); int flagsRE = 0; if ( flags & wxRE_NOTBOL ) @@ -444,10 +444,10 @@ bool wxRegExImpl::Matches(const wxRegChar *str, bool wxRegExImpl::GetMatch(size_t *start, size_t *len, size_t index) const { - wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") ); - wxCHECK_MSG( m_nMatches, false, _T("can't use with wxRE_NOSUB") ); - wxCHECK_MSG( m_Matches, false, _T("must call Matches() first") ); - wxCHECK_MSG( index < m_nMatches, false, _T("invalid match index") ); + wxCHECK_MSG( IsValid(), false, wxT("must successfully Compile() first") ); + wxCHECK_MSG( m_nMatches, false, wxT("can't use with wxRE_NOSUB") ); + wxCHECK_MSG( m_Matches, false, wxT("must call Matches() first") ); + wxCHECK_MSG( index < m_nMatches, false, wxT("invalid match index") ); if ( start ) *start = m_Matches->Start(index); @@ -459,8 +459,8 @@ bool wxRegExImpl::GetMatch(size_t *start, size_t *len, size_t index) const size_t wxRegExImpl::GetMatchCount() const { - wxCHECK_MSG( IsValid(), 0, _T("must successfully Compile() first") ); - wxCHECK_MSG( m_nMatches, 0, _T("can't use with wxRE_NOSUB") ); + wxCHECK_MSG( IsValid(), 0, wxT("must successfully Compile() first") ); + wxCHECK_MSG( m_nMatches, 0, wxT("can't use with wxRE_NOSUB") ); return m_nMatches; } @@ -469,8 +469,8 @@ int wxRegExImpl::Replace(wxString *text, const wxString& replacement, size_t maxMatches) const { - wxCHECK_MSG( text, wxNOT_FOUND, _T("NULL text in wxRegEx::Replace") ); - wxCHECK_MSG( IsValid(), wxNOT_FOUND, _T("must successfully Compile() first") ); + wxCHECK_MSG( text, wxNOT_FOUND, wxT("NULL text in wxRegEx::Replace") ); + wxCHECK_MSG( IsValid(), wxNOT_FOUND, wxT("must successfully Compile() first") ); // the input string #ifndef WXREGEX_CONVERT_TO_MB @@ -498,7 +498,7 @@ int wxRegExImpl::Replace(wxString *text, // attempt at optimization: don't iterate over the string if it doesn't // contain back references at all bool mayHaveBackrefs = - replacement.find_first_of(_T("\\&")) != wxString::npos; + replacement.find_first_of(wxT("\\&")) != wxString::npos; if ( !mayHaveBackrefs ) { @@ -536,7 +536,7 @@ int wxRegExImpl::Replace(wxString *text, { size_t index = (size_t)-1; - if ( *p == _T('\\') ) + if ( *p == wxT('\\') ) { if ( wxIsdigit(*++p) ) { @@ -547,7 +547,7 @@ int wxRegExImpl::Replace(wxString *text, } //else: backslash used as escape character } - else if ( *p == _T('&') ) + else if ( *p == wxT('&') ) { // treat this as "\0" for compatbility with ed and such index = 0; @@ -560,7 +560,7 @@ int wxRegExImpl::Replace(wxString *text, size_t start, len; if ( !GetMatch(&start, &len, index) ) { - wxFAIL_MSG( _T("invalid back reference") ); + wxFAIL_MSG( wxT("invalid back reference") ); // just eat it... } @@ -588,7 +588,7 @@ int wxRegExImpl::Replace(wxString *text, if ( !GetMatch(&start, &len) ) { // we did have match as Matches() returned true above! - wxFAIL_MSG( _T("internal logic error in wxRegEx::Replace") ); + wxFAIL_MSG( wxT("internal logic error in wxRegEx::Replace") ); return wxNOT_FOUND; } @@ -657,7 +657,7 @@ bool wxRegEx::Compile(const wxString& expr, int flags) bool wxRegEx::Matches(const wxString& str, int flags) const { - wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") ); + wxCHECK_MSG( IsValid(), false, wxT("must successfully Compile() first") ); return m_impl->Matches(WXREGEX_CHAR(str), flags WXREGEX_IF_NEED_LEN(str.length())); @@ -665,7 +665,7 @@ bool wxRegEx::Matches(const wxString& str, int flags) const bool wxRegEx::GetMatch(size_t *start, size_t *len, size_t index) const { - wxCHECK_MSG( IsValid(), false, _T("must successfully Compile() first") ); + wxCHECK_MSG( IsValid(), false, wxT("must successfully Compile() first") ); return m_impl->GetMatch(start, len, index); } @@ -681,7 +681,7 @@ wxString wxRegEx::GetMatch(const wxString& text, size_t index) const size_t wxRegEx::GetMatchCount() const { - wxCHECK_MSG( IsValid(), 0, _T("must successfully Compile() first") ); + wxCHECK_MSG( IsValid(), 0, wxT("must successfully Compile() first") ); return m_impl->GetMatchCount(); } @@ -690,7 +690,7 @@ int wxRegEx::Replace(wxString *pattern, const wxString& replacement, size_t maxMatches) const { - wxCHECK_MSG( IsValid(), wxNOT_FOUND, _T("must successfully Compile() first") ); + wxCHECK_MSG( IsValid(), wxNOT_FOUND, wxT("must successfully Compile() first") ); return m_impl->Replace(pattern, replacement, maxMatches); } diff --git a/src/common/rgncmn.cpp b/src/common/rgncmn.cpp index f16024cbb7..bd8281850b 100644 --- a/src/common/rgncmn.cpp +++ b/src/common/rgncmn.cpp @@ -131,7 +131,7 @@ bool wxRegionBase::Union(const wxBitmap& bmp) if (bmp.GetMask()) { wxImage image = bmp.ConvertToImage(); - wxASSERT_MSG( image.HasMask(), _T("wxBitmap::ConvertToImage doesn't preserve mask?") ); + wxASSERT_MSG( image.HasMask(), wxT("wxBitmap::ConvertToImage doesn't preserve mask?") ); return DoRegionUnion(*this, image, image.GetMaskRed(), image.GetMaskGreen(), diff --git a/src/common/sckipc.cpp b/src/common/sckipc.cpp index 66d6a06b88..0f1173baa6 100644 --- a/src/common/sckipc.cpp +++ b/src/common/sckipc.cpp @@ -92,7 +92,7 @@ GetAddressFromName(const wxString& serverName, #if defined(__UNIX__) && !defined(__WINDOWS__) && !defined(__WINE__) // under Unix, if the server name looks like a path, create a AF_UNIX // socket instead of AF_INET one - if ( serverName.Find(_T('/')) != wxNOT_FOUND ) + if ( serverName.Find(wxT('/')) != wxNOT_FOUND ) { wxUNIXaddress *addr = new wxUNIXaddress; addr->Filename(serverName); @@ -528,7 +528,7 @@ wxTCPServer::~wxTCPServer() { if ( remove(m_filename.fn_str()) != 0 ) { - wxLogDebug(_T("Stale AF_UNIX file '%s' left."), m_filename.c_str()); + wxLogDebug(wxT("Stale AF_UNIX file '%s' left."), m_filename.c_str()); } } #endif // __UNIX_LIKE__ diff --git a/src/common/selectdispatcher.cpp b/src/common/selectdispatcher.cpp index 1d3a1d600a..579de5c887 100644 --- a/src/common/selectdispatcher.cpp +++ b/src/common/selectdispatcher.cpp @@ -93,7 +93,7 @@ bool wxSelectSets::HasFD(int fd) const bool wxSelectSets::SetFD(int fd, int flags) { - wxCHECK_MSG( fd >= 0, false, _T("invalid descriptor") ); + wxCHECK_MSG( fd >= 0, false, wxT("invalid descriptor") ); for ( int n = 0; n < Max; n++ ) { @@ -122,7 +122,7 @@ bool wxSelectSets::Handle(int fd, wxFDIOHandler& handler) const if ( wxFD_ISSET(fd, (fd_set*) &m_fds[n]) ) { wxLogTrace(wxSelectDispatcher_Trace, - _T("Got %s event on fd %d"), ms_names[n], fd); + wxT("Got %s event on fd %d"), ms_names[n], fd); (handler.*ms_handlers[n])(); // callback can modify sets and destroy handler // this forces that one event can be processed at one time @@ -149,7 +149,7 @@ bool wxSelectDispatcher::RegisterFD(int fd, wxFDIOHandler *handler, int flags) m_maxFD = fd; wxLogTrace(wxSelectDispatcher_Trace, - _T("Registered fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT), (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION); + wxT("Registered fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT), (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION); return true; } @@ -158,10 +158,10 @@ bool wxSelectDispatcher::ModifyFD(int fd, wxFDIOHandler *handler, int flags) if ( !wxMappedFDIODispatcher::ModifyFD(fd, handler, flags) ) return false; - wxASSERT_MSG( fd <= m_maxFD, _T("logic error: registered fd > m_maxFD?") ); + wxASSERT_MSG( fd <= m_maxFD, wxT("logic error: registered fd > m_maxFD?") ); wxLogTrace(wxSelectDispatcher_Trace, - _T("Modified fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT) == wxFDIO_OUTPUT, (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION); + wxT("Modified fd %d: input:%d, output:%d, exceptional:%d"), fd, (flags & wxFDIO_INPUT) == wxFDIO_INPUT, (flags & wxFDIO_OUTPUT) == wxFDIO_OUTPUT, (flags & wxFDIO_EXCEPTION) == wxFDIO_EXCEPTION); return m_sets.SetFD(fd, flags); } @@ -192,7 +192,7 @@ bool wxSelectDispatcher::UnregisterFD(int fd) } wxLogTrace(wxSelectDispatcher_Trace, - _T("Removed fd %d, current max: %d"), fd, m_maxFD); + wxT("Removed fd %d, current max: %d"), fd, m_maxFD); return true; } @@ -207,7 +207,7 @@ int wxSelectDispatcher::ProcessSets(const wxSelectSets& sets) wxFDIOHandler * const handler = FindHandler(fd); if ( !handler ) { - wxFAIL_MSG( _T("NULL handler in wxSelectDispatcher?") ); + wxFAIL_MSG( wxT("NULL handler in wxSelectDispatcher?") ); continue; } diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index ad5f899c8c..ab0531b5f9 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -137,7 +137,7 @@ wxSizerItem::wxSizerItem() // window item void wxSizerItem::DoSetWindow(wxWindow *window) { - wxCHECK_RET( window, _T("NULL window in wxSizerItem::SetWindow()") ); + wxCHECK_RET( window, wxT("NULL window in wxSizerItem::SetWindow()") ); m_kind = Item_Window; m_window = window; @@ -253,7 +253,7 @@ void wxSizerItem::Free() case Item_Max: default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); + wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") ); } m_kind = Item_None; @@ -291,7 +291,7 @@ wxSize wxSizerItem::GetSize() const case Item_Max: default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); + wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") ); } if (m_flag & wxWEST) @@ -350,7 +350,7 @@ bool wxSizerItem::InformFirstDirection(int direction, int size, int availableOth { if( !wxIsNullDouble(m_ratio) ) { - wxCHECK_MSG( (m_proportion==0), false, _T("Shaped item, non-zero proportion in wxSizerItem::InformFirstDirection()") ); + wxCHECK_MSG( (m_proportion==0), false, wxT("Shaped item, non-zero proportion in wxSizerItem::InformFirstDirection()") ); if( direction==wxHORIZONTAL && !wxIsNullDouble(m_ratio) ) { // Clip size so that we don't take too much @@ -476,7 +476,7 @@ void wxSizerItem::SetDimension( const wxPoint& pos_, const wxSize& size_ ) switch ( m_kind ) { case Item_None: - wxFAIL_MSG( _T("can't set size of uninitialized sizer item") ); + wxFAIL_MSG( wxT("can't set size of uninitialized sizer item") ); break; case Item_Window: @@ -505,7 +505,7 @@ void wxSizerItem::SetDimension( const wxPoint& pos_, const wxSize& size_ ) case Item_Max: default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); + wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") ); } } @@ -534,7 +534,7 @@ void wxSizerItem::DeleteWindows() case Item_Max: default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); + wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") ); } } @@ -544,7 +544,7 @@ void wxSizerItem::Show( bool show ) switch ( m_kind ) { case Item_None: - wxFAIL_MSG( _T("can't show uninitialized sizer item") ); + wxFAIL_MSG( wxT("can't show uninitialized sizer item") ); break; case Item_Window: @@ -561,7 +561,7 @@ void wxSizerItem::Show( bool show ) case Item_Max: default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); + wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") ); } } @@ -606,7 +606,7 @@ bool wxSizerItem::IsShown() const case Item_Max: default: - wxFAIL_MSG( _T("unexpected wxSizerItem::m_kind") ); + wxFAIL_MSG( wxT("unexpected wxSizerItem::m_kind") ); } return false; @@ -679,7 +679,7 @@ bool wxSizer::Remove( wxWindow *window ) bool wxSizer::Remove( wxSizer *sizer ) { - wxASSERT_MSG( sizer, _T("Removing NULL sizer") ); + wxASSERT_MSG( sizer, wxT("Removing NULL sizer") ); wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); while (node) @@ -703,11 +703,11 @@ bool wxSizer::Remove( int index ) { wxCHECK_MSG( index >= 0 && (size_t)index < m_children.GetCount(), false, - _T("Remove index is out of range") ); + wxT("Remove index is out of range") ); wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, false, _T("Failed to find child node") ); + wxCHECK_MSG( node, false, wxT("Failed to find child node") ); delete node->GetData(); m_children.Erase( node ); @@ -717,7 +717,7 @@ bool wxSizer::Remove( int index ) bool wxSizer::Detach( wxSizer *sizer ) { - wxASSERT_MSG( sizer, _T("Detaching NULL sizer") ); + wxASSERT_MSG( sizer, wxT("Detaching NULL sizer") ); wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); while (node) @@ -739,7 +739,7 @@ bool wxSizer::Detach( wxSizer *sizer ) bool wxSizer::Detach( wxWindow *window ) { - wxASSERT_MSG( window, _T("Detaching NULL window") ); + wxASSERT_MSG( window, wxT("Detaching NULL window") ); wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); while (node) @@ -762,11 +762,11 @@ bool wxSizer::Detach( int index ) { wxCHECK_MSG( index >= 0 && (size_t)index < m_children.GetCount(), false, - _T("Detach index is out of range") ); + wxT("Detach index is out of range") ); wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, false, _T("Failed to find child node") ); + wxCHECK_MSG( node, false, wxT("Failed to find child node") ); wxSizerItem *item = node->GetData(); @@ -780,8 +780,8 @@ bool wxSizer::Detach( int index ) bool wxSizer::Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive ) { - wxASSERT_MSG( oldwin, _T("Replacing NULL window") ); - wxASSERT_MSG( newwin, _T("Replacing with NULL window") ); + wxASSERT_MSG( oldwin, wxT("Replacing NULL window") ); + wxASSERT_MSG( newwin, wxT("Replacing with NULL window") ); wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); while (node) @@ -808,8 +808,8 @@ bool wxSizer::Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive ) bool wxSizer::Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive ) { - wxASSERT_MSG( oldsz, _T("Replacing NULL sizer") ); - wxASSERT_MSG( newsz, _T("Replacing with NULL sizer") ); + wxASSERT_MSG( oldsz, wxT("Replacing NULL sizer") ); + wxASSERT_MSG( newsz, wxT("Replacing with NULL sizer") ); wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); while (node) @@ -835,12 +835,12 @@ bool wxSizer::Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive ) bool wxSizer::Replace( size_t old, wxSizerItem *newitem ) { - wxCHECK_MSG( old < m_children.GetCount(), false, _T("Replace index is out of range") ); - wxASSERT_MSG( newitem, _T("Replacing with NULL item") ); + wxCHECK_MSG( old < m_children.GetCount(), false, wxT("Replace index is out of range") ); + wxASSERT_MSG( newitem, wxT("Replacing with NULL item") ); wxSizerItemList::compatibility_iterator node = m_children.Item( old ); - wxCHECK_MSG( node, false, _T("Failed to find child node") ); + wxCHECK_MSG( node, false, wxT("Failed to find child node") ); wxSizerItem *item = node->GetData(); node->SetData(newitem); @@ -1032,7 +1032,7 @@ void wxSizer::DoSetMinSize( int width, int height ) bool wxSizer::DoSetItemMinSize( wxWindow *window, int width, int height ) { - wxASSERT_MSG( window, _T("SetMinSize for NULL window") ); + wxASSERT_MSG( window, wxT("SetMinSize for NULL window") ); // Is it our immediate child? @@ -1070,7 +1070,7 @@ bool wxSizer::DoSetItemMinSize( wxWindow *window, int width, int height ) bool wxSizer::DoSetItemMinSize( wxSizer *sizer, int width, int height ) { - wxASSERT_MSG( sizer, _T("SetMinSize for NULL sizer") ); + wxASSERT_MSG( sizer, wxT("SetMinSize for NULL sizer") ); // Is it our immediate child? @@ -1110,7 +1110,7 @@ bool wxSizer::DoSetItemMinSize( size_t index, int width, int height ) { wxSizerItemList::compatibility_iterator node = m_children.Item( index ); - wxCHECK_MSG( node, false, _T("Failed to find child node") ); + wxCHECK_MSG( node, false, wxT("Failed to find child node") ); wxSizerItem *item = node->GetData(); @@ -1130,7 +1130,7 @@ bool wxSizer::DoSetItemMinSize( size_t index, int width, int height ) wxSizerItem* wxSizer::GetItem( wxWindow *window, bool recursive ) { - wxASSERT_MSG( window, _T("GetItem for NULL window") ); + wxASSERT_MSG( window, wxT("GetItem for NULL window") ); wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); while (node) @@ -1156,7 +1156,7 @@ wxSizerItem* wxSizer::GetItem( wxWindow *window, bool recursive ) wxSizerItem* wxSizer::GetItem( wxSizer *sizer, bool recursive ) { - wxASSERT_MSG( sizer, _T("GetItem for NULL sizer") ); + wxASSERT_MSG( sizer, wxT("GetItem for NULL sizer") ); wxSizerItemList::compatibility_iterator node = m_children.GetFirst(); while (node) @@ -1184,7 +1184,7 @@ wxSizerItem* wxSizer::GetItem( size_t index ) { wxCHECK_MSG( index < m_children.GetCount(), NULL, - _T("GetItem index is out of range") ); + wxT("GetItem index is out of range") ); return m_children.Item( index )->GetData(); } @@ -1279,7 +1279,7 @@ bool wxSizer::IsShown( wxWindow *window ) const node = node->GetNext(); } - wxFAIL_MSG( _T("IsShown failed to find sizer item") ); + wxFAIL_MSG( wxT("IsShown failed to find sizer item") ); return false; } @@ -1298,7 +1298,7 @@ bool wxSizer::IsShown( wxSizer *sizer ) const node = node->GetNext(); } - wxFAIL_MSG( _T("IsShown failed to find sizer item") ); + wxFAIL_MSG( wxT("IsShown failed to find sizer item") ); return false; } @@ -1307,7 +1307,7 @@ bool wxSizer::IsShown( size_t index ) const { wxCHECK_MSG( index < m_children.GetCount(), false, - _T("IsShown index is out of range") ); + wxT("IsShown index is out of range") ); return m_children.Item( index )->GetData()->IsShown(); } @@ -1390,7 +1390,7 @@ int wxGridSizer::CalcRowsCols(int& nrows, int& ncols) const } else // 0 columns, 0 rows? { - wxFAIL_MSG( _T("grid sizer must have either rows or columns fixed") ); + wxFAIL_MSG( wxT("grid sizer must have either rows or columns fixed") ); nrows = ncols = 0; @@ -1422,7 +1422,7 @@ void wxGridSizer::RecalcSizes() { wxSizerItemList::compatibility_iterator node = m_children.Item( i ); - wxASSERT_MSG( node, _T("Failed to find SizerItemList node") ); + wxASSERT_MSG( node, wxT("Failed to find SizerItemList node") ); SetItemBounds( node->GetData(), x, y, w, h); } @@ -1959,7 +1959,7 @@ DoRemoveFromArrays(size_t idx, wxArrayInt& items, wxArrayInt& proportions) } } - wxFAIL_MSG( _T("column/row is already not growable") ); + wxFAIL_MSG( wxT("column/row is already not growable") ); } void wxFlexGridSizer::RemoveGrowableCol( size_t idx ) diff --git a/src/common/socket.cpp b/src/common/socket.cpp index a0bfba143b..09324181ae 100644 --- a/src/common/socket.cpp +++ b/src/common/socket.cpp @@ -115,7 +115,7 @@ wxDEFINE_EVENT(wxEVT_SOCKET, wxSocketEvent); // discard buffer #define MAX_DISCARD_SIZE (10 * 1024) -#define wxTRACE_Socket _T("wxSocket") +#define wxTRACE_Socket wxT("wxSocket") // -------------------------------------------------------------------------- // wxWin macros @@ -771,7 +771,7 @@ bool wxSocketBase::Initialize() void wxSocketBase::Shutdown() { // we should be initialized - wxASSERT_MSG( m_countInit > 0, _T("extra call to Shutdown()") ); + wxASSERT_MSG( m_countInit > 0, wxT("extra call to Shutdown()") ); if ( --m_countInit == 0 ) { wxSocketManager * const manager = wxSocketManager::Get(); @@ -1737,13 +1737,13 @@ wxSocketServer::wxSocketServer(const wxSockAddress& addr, wxSocketFlags flags) : wxSocketBase(flags, wxSOCKET_SERVER) { - wxLogTrace( wxTRACE_Socket, _T("Opening wxSocketServer") ); + wxLogTrace( wxTRACE_Socket, wxT("Opening wxSocketServer") ); m_impl = wxSocketImpl::Create(*this); if (!m_impl) { - wxLogTrace( wxTRACE_Socket, _T("*** Failed to create m_impl") ); + wxLogTrace( wxTRACE_Socket, wxT("*** Failed to create m_impl") ); return; } @@ -1765,11 +1765,11 @@ wxSocketServer::wxSocketServer(const wxSockAddress& addr, delete m_impl; m_impl = NULL; - wxLogTrace( wxTRACE_Socket, _T("*** CreateServer() failed") ); + wxLogTrace( wxTRACE_Socket, wxT("*** CreateServer() failed") ); return; } - wxLogTrace( wxTRACE_Socket, _T("wxSocketServer on fd %d"), m_impl->m_fd ); + wxLogTrace( wxTRACE_Socket, wxT("wxSocketServer on fd %d"), m_impl->m_fd ); } // -------------------------------------------------------------------------- @@ -1835,7 +1835,7 @@ bool wxSocketServer::WaitForAccept(long seconds, long milliseconds) bool wxSocketBase::GetOption(int level, int optname, void *optval, int *optlen) { - wxASSERT_MSG( m_impl, _T("Socket not initialised") ); + wxASSERT_MSG( m_impl, wxT("Socket not initialised") ); SOCKOPTLEN_T lenreal = *optlen; if ( getsockopt(m_impl->m_fd, level, optname, @@ -1850,7 +1850,7 @@ bool wxSocketBase::GetOption(int level, int optname, void *optval, int *optlen) bool wxSocketBase::SetOption(int level, int optname, const void *optval, int optlen) { - wxASSERT_MSG( m_impl, _T("Socket not initialised") ); + wxASSERT_MSG( m_impl, wxT("Socket not initialised") ); return setsockopt(m_impl->m_fd, level, optname, static_cast(optval), optlen) == 0; @@ -2024,7 +2024,7 @@ wxDatagramSocket& wxDatagramSocket::SendTo( const wxSockAddress& addr, const void* buf, wxUint32 nBytes ) { - wxASSERT_MSG( m_impl, _T("Socket not initialised") ); + wxASSERT_MSG( m_impl, wxT("Socket not initialised") ); m_impl->SetPeer(addr.GetAddress()); Write(buf, nBytes); diff --git a/src/common/sstream.cpp b/src/common/sstream.cpp index 740ebbf551..24e09f1be3 100644 --- a/src/common/sstream.cpp +++ b/src/common/sstream.cpp @@ -47,7 +47,7 @@ wxStringInputStream::wxStringInputStream(const wxString& s) #endif { #if wxUSE_UNICODE - wxASSERT_MSG(m_buf.data() != NULL, _T("Could not convert string to UTF8!")); + wxASSERT_MSG(m_buf.data() != NULL, wxT("Could not convert string to UTF8!")); #endif m_pos = 0; } @@ -82,7 +82,7 @@ wxFileOffset wxStringInputStream::OnSysSeek(wxFileOffset ofs, wxSeekMode mode) break; default: - wxFAIL_MSG( _T("invalid seek mode") ); + wxFAIL_MSG( wxT("invalid seek mode") ); return wxInvalidOffset; } diff --git a/src/common/statbar.cpp b/src/common/statbar.cpp index c8e47cec57..cfbe9c9364 100644 --- a/src/common/statbar.cpp +++ b/src/common/statbar.cpp @@ -69,7 +69,7 @@ wxStatusBarBase::~wxStatusBarBase() void wxStatusBarBase::SetFieldsCount(int number, const int *widths) { - wxCHECK_RET( number > 0, _T("invalid field number in SetFieldsCount") ); + wxCHECK_RET( number > 0, wxT("invalid field number in SetFieldsCount") ); if ( (size_t)number > m_panes.GetCount() ) { @@ -93,7 +93,7 @@ void wxStatusBarBase::SetFieldsCount(int number, const int *widths) void wxStatusBarBase::SetStatusWidths(int WXUNUSED_UNLESS_DEBUG(n), const int widths[]) { - wxASSERT_MSG( (size_t)n == m_panes.GetCount(), _T("field number mismatch") ); + wxASSERT_MSG( (size_t)n == m_panes.GetCount(), wxT("field number mismatch") ); if (widths == NULL) { @@ -116,9 +116,9 @@ void wxStatusBarBase::SetStatusWidths(int WXUNUSED_UNLESS_DEBUG(n), void wxStatusBarBase::SetStatusStyles(int WXUNUSED_UNLESS_DEBUG(n), const int styles[]) { - wxCHECK_RET( styles, _T("NULL pointer in SetStatusStyles") ); + wxCHECK_RET( styles, wxT("NULL pointer in SetStatusStyles") ); - wxASSERT_MSG( (size_t)n == m_panes.GetCount(), _T("field number mismatch") ); + wxASSERT_MSG( (size_t)n == m_panes.GetCount(), wxT("field number mismatch") ); for ( size_t i = 0; i < m_panes.GetCount(); i++ ) m_panes[i].m_nStyle = styles[i]; diff --git a/src/common/stattextcmn.cpp b/src/common/stattextcmn.cpp index 89d7eb03f2..e9a22fd8f5 100644 --- a/src/common/stattextcmn.cpp +++ b/src/common/stattextcmn.cpp @@ -69,7 +69,7 @@ void wxTextWrapper::Wrap(wxWindow *win, const wxString& text, int widthMax) lineStart = p; } - if ( p == text.end() || *p == _T('\n') ) + if ( p == text.end() || *p == wxT('\n') ) { DoOutputLine(line); @@ -78,7 +78,7 @@ void wxTextWrapper::Wrap(wxWindow *win, const wxString& text, int widthMax) } else // not EOL { - if ( *p == _T(' ') ) + if ( *p == wxT(' ') ) lastSpace = p; line += *p; @@ -127,7 +127,7 @@ protected: virtual void OnNewLine() { - m_text += _T('\n'); + m_text += wxT('\n'); } private: diff --git a/src/common/stdpbase.cpp b/src/common/stdpbase.cpp index 6cf9b8a32a..8df8c13843 100644 --- a/src/common/stdpbase.cpp +++ b/src/common/stdpbase.cpp @@ -46,7 +46,7 @@ static wxStandardPaths gs_stdPaths; wxStandardPaths& wxStandardPathsBase::Get() { wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - wxCHECK_MSG( traits, gs_stdPaths, _T("create wxApp before calling this") ); + wxCHECK_MSG( traits, gs_stdPaths, wxT("create wxApp before calling this") ); return traits->GetStandardPaths(); } @@ -133,7 +133,7 @@ wxStandardPathsBase::AppendPathComponent(const wxString& dir, if ( !component.empty() ) { const wxChar ch = *(subdir.end() - 1); - if ( !wxFileName::IsPathSeparator(ch) && ch != _T('.') ) + if ( !wxFileName::IsPathSeparator(ch) && ch != wxT('.') ) subdir += wxFileName::GetPathSeparator(); subdir += component; diff --git a/src/common/stockitem.cpp b/src/common/stockitem.cpp index 927fa245ef..f9f3fc049e 100644 --- a/src/common/stockitem.cpp +++ b/src/common/stockitem.cpp @@ -199,7 +199,7 @@ wxString wxGetStockLabel(wxWindowID id, long flags) STOCKITEM(wxID_ZOOM_OUT, _("Zoom &Out")) default: - wxFAIL_MSG( _T("invalid stock item ID") ); + wxFAIL_MSG( wxT("invalid stock item ID") ); break; }; @@ -215,7 +215,7 @@ wxString wxGetStockLabel(wxWindowID id, long flags) { wxAcceleratorEntry accel = wxGetStockAccelerator(id); if (accel.IsOk()) - stockLabel << _T('\t') << accel.ToString(); + stockLabel << wxT('\t') << accel.ToString(); } #endif // wxUSE_ACCEL @@ -308,7 +308,7 @@ bool wxIsStockLabel(wxWindowID id, const wxString& label) if (label == stock) return true; - stock.Replace(_T("&"), wxEmptyString); + stock.Replace(wxT("&"), wxEmptyString); if (label == stock) return true; diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 41ca712cdf..bf207f880b 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -57,7 +57,7 @@ #endif //def __DARWIN__ -#define TRACE_STRCONV _T("strconv") +#define TRACE_STRCONV wxT("strconv") // WC_UTF16 is defined only if sizeof(wchar_t) == 2, otherwise it's supposed to // be 4 bytes @@ -512,8 +512,8 @@ size_t wxMBConvLibc::WC2MB(char *buf, const wchar_t *psz, size_t n) const wxConvBrokenFileNames::wxConvBrokenFileNames(const wxString& charset) { - if ( wxStricmp(charset, _T("UTF-8")) == 0 || - wxStricmp(charset, _T("UTF8")) == 0 ) + if ( wxStricmp(charset, wxT("UTF-8")) == 0 || + wxStricmp(charset, wxT("UTF8")) == 0 ) m_conv = new wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA); else m_conv = new wxCSConv(charset); @@ -1137,7 +1137,7 @@ wxMBConvStrictUTF8::FromWChar(char *dst, size_t dstLen, } else { - wxFAIL_MSG( _T("trying to encode undefined Unicode character") ); + wxFAIL_MSG( wxT("trying to encode undefined Unicode character") ); break; } @@ -2106,7 +2106,7 @@ wxMBConv_iconv::wxMBConv_iconv(const char *name) // check for charset that represents wchar_t: if ( ms_wcCharsetName.empty() ) { - wxLogTrace(TRACE_STRCONV, _T("Looking for wide char codeset:")); + wxLogTrace(TRACE_STRCONV, wxT("Looking for wide char codeset:")); #if wxUSE_FONTMAP const wxChar **names = wxFontMapperBase::GetAllEncodingNames(WC_ENC); @@ -2114,9 +2114,9 @@ wxMBConv_iconv::wxMBConv_iconv(const char *name) static const wxChar *names_static[] = { #if SIZEOF_WCHAR_T == 4 - _T("UCS-4"), + wxT("UCS-4"), #elif SIZEOF_WCHAR_T = 2 - _T("UCS-2"), + wxT("UCS-2"), #endif NULL }; @@ -2131,19 +2131,19 @@ wxMBConv_iconv::wxMBConv_iconv(const char *name) wxString nameXE(nameCS); #ifdef WORDS_BIGENDIAN - nameXE += _T("BE"); + nameXE += wxT("BE"); #else // little endian - nameXE += _T("LE"); + nameXE += wxT("LE"); #endif - wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""), + wxLogTrace(TRACE_STRCONV, wxT(" trying charset \"%s\""), nameXE.c_str()); m2w = iconv_open(nameXE.ToAscii(), name); if ( m2w == ICONV_T_INVALID ) { // try charset w/o bytesex info (e.g. "UCS4") - wxLogTrace(TRACE_STRCONV, _T(" trying charset \"%s\""), + wxLogTrace(TRACE_STRCONV, wxT(" trying charset \"%s\""), nameCS.c_str()); m2w = iconv_open(nameCS.ToAscii(), name); @@ -2190,8 +2190,8 @@ wxMBConv_iconv::wxMBConv_iconv(const char *name) wxT("iconv wchar_t charset is \"%s\"%s"), ms_wcCharsetName.empty() ? wxString("") : ms_wcCharsetName, - ms_wcNeedsSwap ? _T(" (needs swap)") - : _T("")); + ms_wcNeedsSwap ? wxT(" (needs swap)") + : wxT("")); } else // we already have ms_wcCharsetName { @@ -2667,7 +2667,7 @@ public: switch ( len ) { default: - wxLogDebug(_T("Unexpected NUL length %d"), len); + wxLogDebug(wxT("Unexpected NUL length %d"), len); self->m_minMBCharWidth = (size_t)-1; break; @@ -2714,7 +2714,7 @@ private: break; } - wxASSERT_MSG( s_isWin98Or2k != -1, _T("should be set above") ); + wxASSERT_MSG( s_isWin98Or2k != -1, wxT("should be set above") ); } return s_isWin98Or2k == 1; @@ -2908,7 +2908,7 @@ wxCSConv::wxCSConv(wxFontEncoding encoding) { if ( encoding == wxFONTENCODING_MAX || encoding == wxFONTENCODING_DEFAULT ) { - wxFAIL_MSG( _T("invalid encoding value in wxCSConv ctor") ); + wxFAIL_MSG( wxT("invalid encoding value in wxCSConv ctor") ); encoding = wxFONTENCODING_SYSTEM; } @@ -3056,7 +3056,7 @@ wxMBConv *wxCSConv::DoCreate() const delete conv; } - gs_nameCache[encoding] = _T(""); // cache the failure + gs_nameCache[encoding] = wxT(""); // cache the failure } } #endif // wxUSE_FONTMAP diff --git a/src/common/stream.cpp b/src/common/stream.cpp index 357499b047..a3142a2843 100644 --- a/src/common/stream.cpp +++ b/src/common/stream.cpp @@ -100,7 +100,7 @@ wxStreamBuffer::wxStreamBuffer(const wxStreamBuffer& buffer) // doing this has big chances to lead to a crash when the source buffer is // destroyed (otherwise assume the caller knows what he does) wxASSERT_MSG( !buffer.m_destroybuf, - _T("it's a bad idea to copy this buffer") ); + wxT("it's a bad idea to copy this buffer") ); m_buffer_start = buffer.m_buffer_start; m_buffer_end = buffer.m_buffer_end; @@ -202,7 +202,7 @@ void wxStreamBuffer::Truncate() } char *new_start = (char *)realloc(m_buffer_start, new_size); - wxCHECK_RET( new_size, _T("shrinking buffer shouldn't fail") ); + wxCHECK_RET( new_size, wxT("shrinking buffer shouldn't fail") ); m_buffer_start = new_start; m_buffer_end = m_buffer_start + new_size; @@ -231,7 +231,7 @@ bool wxStreamBuffer::FillBuffer() // write the buffer contents to the stream (only for write buffers) bool wxStreamBuffer::FlushBuffer() { - wxCHECK_MSG( m_flushable, false, _T("can't flush this buffer") ); + wxCHECK_MSG( m_flushable, false, wxT("can't flush this buffer") ); // FIXME: what is this check for? (VZ) if ( m_buffer_pos == m_buffer_start ) @@ -239,7 +239,7 @@ bool wxStreamBuffer::FlushBuffer() wxOutputStream *outStream = GetOutputStream(); - wxCHECK_MSG( outStream, false, _T("should have a stream in wxStreamBuffer") ); + wxCHECK_MSG( outStream, false, wxT("should have a stream in wxStreamBuffer") ); size_t current = m_buffer_pos - m_buffer_start; size_t count = outStream->OnSysWrite(m_buffer_start, current); @@ -319,7 +319,7 @@ void wxStreamBuffer::PutChar(char c) { wxOutputStream *outStream = GetOutputStream(); - wxCHECK_RET( outStream, _T("should have a stream in wxStreamBuffer") ); + wxCHECK_RET( outStream, wxT("should have a stream in wxStreamBuffer") ); // if we don't have buffer at all, just forward this call to the stream, if ( !HasBuffer() ) @@ -345,7 +345,7 @@ void wxStreamBuffer::PutChar(char c) char wxStreamBuffer::Peek() { wxCHECK_MSG( m_stream && HasBuffer(), 0, - _T("should have the stream and the buffer in wxStreamBuffer") ); + wxT("should have the stream and the buffer in wxStreamBuffer") ); if ( !GetDataLeft() ) { @@ -364,7 +364,7 @@ char wxStreamBuffer::GetChar() { wxInputStream *inStream = GetInputStream(); - wxCHECK_MSG( inStream, 0, _T("should have a stream in wxStreamBuffer") ); + wxCHECK_MSG( inStream, 0, wxT("should have a stream in wxStreamBuffer") ); char c; if ( !HasBuffer() ) @@ -390,7 +390,7 @@ char wxStreamBuffer::GetChar() size_t wxStreamBuffer::Read(void *buffer, size_t size) { - wxASSERT_MSG( buffer, _T("Warning: Null pointer is about to be used") ); + wxASSERT_MSG( buffer, wxT("Warning: Null pointer is about to be used") ); /* Clear buffer first */ memset(buffer, 0x00, size); @@ -404,7 +404,7 @@ size_t wxStreamBuffer::Read(void *buffer, size_t size) { wxInputStream *inStream = GetInputStream(); - wxCHECK_MSG( inStream, 0, _T("should have a stream in wxStreamBuffer") ); + wxCHECK_MSG( inStream, 0, wxT("should have a stream in wxStreamBuffer") ); readBytes = inStream->OnSysRead(buffer, size); } @@ -449,7 +449,7 @@ size_t wxStreamBuffer::Read(void *buffer, size_t size) // this should really be called "Copy()" size_t wxStreamBuffer::Read(wxStreamBuffer *dbuf) { - wxCHECK_MSG( m_mode != write, 0, _T("can't read from this buffer") ); + wxCHECK_MSG( m_mode != write, 0, wxT("can't read from this buffer") ); char buf[BUF_TEMP_SIZE]; size_t nRead, @@ -471,7 +471,7 @@ size_t wxStreamBuffer::Read(wxStreamBuffer *dbuf) size_t wxStreamBuffer::Write(const void *buffer, size_t size) { - wxASSERT_MSG( buffer, _T("Warning: Null pointer is about to be send") ); + wxASSERT_MSG( buffer, wxT("Warning: Null pointer is about to be send") ); if (m_stream) { @@ -485,7 +485,7 @@ size_t wxStreamBuffer::Write(const void *buffer, size_t size) { wxOutputStream *outStream = GetOutputStream(); - wxCHECK_MSG( outStream, 0, _T("should have a stream in wxStreamBuffer") ); + wxCHECK_MSG( outStream, 0, wxT("should have a stream in wxStreamBuffer") ); // no buffer, just forward the call to the stream ret = outStream->OnSysWrite(buffer, size); @@ -543,8 +543,8 @@ size_t wxStreamBuffer::Write(const void *buffer, size_t size) size_t wxStreamBuffer::Write(wxStreamBuffer *sbuf) { - wxCHECK_MSG( m_mode != read, 0, _T("can't write to this buffer") ); - wxCHECK_MSG( sbuf->m_mode != write, 0, _T("can't read from that buffer") ); + wxCHECK_MSG( m_mode != read, 0, wxT("can't write to this buffer") ); + wxCHECK_MSG( sbuf->m_mode != write, 0, wxT("can't read from that buffer") ); char buf[BUF_TEMP_SIZE]; size_t nWrite, @@ -599,7 +599,7 @@ wxFileOffset wxStreamBuffer::Seek(wxFileOffset pos, wxSeekMode mode) break; default: - wxFAIL_MSG( _T("invalid seek mode") ); + wxFAIL_MSG( wxT("invalid seek mode") ); return wxInvalidOffset; } @@ -695,7 +695,7 @@ size_t wxStreamBase::GetSize() const return 0; const size_t len = wx_truncate_cast(size_t, length); - wxASSERT_MSG( len == length + size_t(0), _T("large files not supported") ); + wxASSERT_MSG( len == length + size_t(0), wxT("large files not supported") ); return len; } @@ -771,7 +771,7 @@ char *wxInputStream::AllocSpaceWBack(size_t needed_size) size_t wxInputStream::GetWBack(void *buf, size_t size) { - wxASSERT_MSG( buf, _T("Warning: Null pointer is about to be used") ); + wxASSERT_MSG( buf, wxT("Warning: Null pointer is about to be used") ); /* Clear buffer first */ memset(buf, 0x00, size); @@ -807,7 +807,7 @@ size_t wxInputStream::GetWBack(void *buf, size_t size) size_t wxInputStream::Ungetch(const void *buf, size_t bufsize) { - wxASSERT_MSG( buf, _T("Warning: Null pointer is about to be used in Ungetch()") ); + wxASSERT_MSG( buf, wxT("Warning: Null pointer is about to be used in Ungetch()") ); if ( m_lasterror != wxSTREAM_NO_ERROR && m_lasterror != wxSTREAM_EOF ) { @@ -841,7 +841,7 @@ int wxInputStream::GetC() wxInputStream& wxInputStream::Read(void *buf, size_t size) { - wxASSERT_MSG( buf, _T("Warning: Null pointer is about to be read") ); + wxASSERT_MSG( buf, wxT("Warning: Null pointer is about to be read") ); char *p = (char *)buf; m_lastcount = 0; @@ -1091,7 +1091,7 @@ wxFileOffset wxCountingOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode break; default: - wxFAIL_MSG( _T("invalid seek mode") ); + wxFAIL_MSG( wxT("invalid seek mode") ); return wxInvalidOffset; } @@ -1357,7 +1357,7 @@ wxFileOffset wxBufferedInputStream::OnSysTell() const void wxBufferedInputStream::SetInputStreamBuffer(wxStreamBuffer *buffer) { - wxCHECK_RET( buffer, _T("wxBufferedInputStream needs buffer") ); + wxCHECK_RET( buffer, wxT("wxBufferedInputStream needs buffer") ); delete m_i_streambuf; m_i_streambuf = buffer; @@ -1440,7 +1440,7 @@ wxFileOffset wxBufferedOutputStream::GetLength() const void wxBufferedOutputStream::SetOutputStreamBuffer(wxStreamBuffer *buffer) { - wxCHECK_RET( buffer, _T("wxBufferedOutputStream needs buffer") ); + wxCHECK_RET( buffer, wxT("wxBufferedOutputStream needs buffer") ); delete m_o_streambuf; m_o_streambuf = buffer; diff --git a/src/common/string.cpp b/src/common/string.cpp index 511068e101..f5a46007a8 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -433,7 +433,7 @@ wxString::SubstrBufFromMB wxString::ConvertStr(const char *psz, size_t nLength, // and then to UTF-8: SubstrBufFromMB buf(ConvertStr(wcBuf, wcLen, wxMBConvStrictUTF8())); // widechar -> UTF-8 conversion isn't supposed to ever fail: - wxASSERT_MSG( buf.data, _T("conversion to UTF-8 failed") ); + wxASSERT_MSG( buf.data, wxT("conversion to UTF-8 failed") ); return buf; } @@ -641,7 +641,7 @@ wxString operator+(const wxString& str, const char *psz) wxString s; if ( !s.Alloc(strlen(psz) + str.length()) ) { - wxFAIL_MSG( _T("out of memory in wxString::operator+") ); + wxFAIL_MSG( wxT("out of memory in wxString::operator+") ); } s += str; s += psz; @@ -657,7 +657,7 @@ wxString operator+(const wxString& str, const wchar_t *pwz) wxString s; if ( !s.Alloc(wxWcslen(pwz) + str.length()) ) { - wxFAIL_MSG( _T("out of memory in wxString::operator+") ); + wxFAIL_MSG( wxT("out of memory in wxString::operator+") ); } s += str; s += pwz; @@ -673,7 +673,7 @@ wxString operator+(const char *psz, const wxString& str) wxString s; if ( !s.Alloc(strlen(psz) + str.length()) ) { - wxFAIL_MSG( _T("out of memory in wxString::operator+") ); + wxFAIL_MSG( wxT("out of memory in wxString::operator+") ); } s = psz; s += str; @@ -689,7 +689,7 @@ wxString operator+(const wchar_t *pwz, const wxString& str) wxString s; if ( !s.Alloc(wxWcslen(pwz) + str.length()) ) { - wxFAIL_MSG( _T("out of memory in wxString::operator+") ); + wxFAIL_MSG( wxT("out of memory in wxString::operator+") ); } s = pwz; s += str; @@ -907,7 +907,7 @@ size_t wxString::find_first_not_of(const wxChar* sz, size_t nStart) const size_t wxString::find_first_of(const wxChar* sz, size_t nStart, size_t n) const { - wxASSERT_MSG( nStart <= length(), _T("invalid index") ); + wxASSERT_MSG( nStart <= length(), wxT("invalid index") ); size_t idx = nStart; for ( const_iterator i = begin() + nStart; i != end(); ++idx, ++i ) @@ -921,7 +921,7 @@ size_t wxString::find_first_of(const wxChar* sz, size_t nStart, size_t n) const size_t wxString::find_first_not_of(const wxChar* sz, size_t nStart, size_t n) const { - wxASSERT_MSG( nStart <= length(), _T("invalid index") ); + wxASSERT_MSG( nStart <= length(), wxT("invalid index") ); size_t idx = nStart; for ( const_iterator i = begin() + nStart; i != end(); ++idx, ++i ) @@ -954,7 +954,7 @@ size_t wxString::find_last_of(const wxChar* sz, size_t nStart, size_t n) const } else { - wxASSERT_MSG( nStart <= len, _T("invalid index") ); + wxASSERT_MSG( nStart <= len, wxT("invalid index") ); } size_t idx = nStart; @@ -978,7 +978,7 @@ size_t wxString::find_last_not_of(const wxChar* sz, size_t nStart, size_t n) con } else { - wxASSERT_MSG( nStart <= len, _T("invalid index") ); + wxASSERT_MSG( nStart <= len, wxT("invalid index") ); } size_t idx = nStart; @@ -994,7 +994,7 @@ size_t wxString::find_last_not_of(const wxChar* sz, size_t nStart, size_t n) con size_t wxString::find_first_not_of(wxUniChar ch, size_t nStart) const { - wxASSERT_MSG( nStart <= length(), _T("invalid index") ); + wxASSERT_MSG( nStart <= length(), wxT("invalid index") ); size_t idx = nStart; for ( const_iterator i = begin() + nStart; i != end(); ++idx, ++i ) @@ -1016,7 +1016,7 @@ size_t wxString::find_last_not_of(wxUniChar ch, size_t nStart) const } else { - wxASSERT_MSG( nStart <= len, _T("invalid index") ); + wxASSERT_MSG( nStart <= len, wxT("invalid index") ); } size_t idx = nStart; @@ -1151,7 +1151,7 @@ wxString wxString::FromAscii(const char *ascii, size_t len) { unsigned char c = (unsigned char)*ascii++; wxASSERT_MSG( c < 0x80, - _T("Non-ASCII value passed to FromAscii().") ); + wxT("Non-ASCII value passed to FromAscii().") ); *dest++ = (wchar_t)c; } @@ -1171,7 +1171,7 @@ wxString wxString::FromAscii(char ascii) unsigned char c = (unsigned char)ascii; - wxASSERT_MSG( c < 0x80, _T("Non-ASCII value passed to FromAscii().") ); + wxASSERT_MSG( c < 0x80, wxT("Non-ASCII value passed to FromAscii().") ); // NB: the cast to wchar_t causes interpretation of 'ascii' as Latin1 value return wxString(wxUniChar((wchar_t)c)); @@ -1226,7 +1226,7 @@ wxString wxString::Mid(size_t nFirst, size_t nCount) const wxString dest(*this, nFirst, nCount); if ( dest.length() != nCount ) { - wxFAIL_MSG( _T("out of memory in wxString::Mid") ); + wxFAIL_MSG( wxT("out of memory in wxString::Mid") ); } return dest; @@ -1276,7 +1276,7 @@ wxString wxString::Right(size_t nCount) const wxString dest(*this, length() - nCount, nCount); if ( dest.length() != nCount ) { - wxFAIL_MSG( _T("out of memory in wxString::Right") ); + wxFAIL_MSG( wxT("out of memory in wxString::Right") ); } return dest; } @@ -1303,7 +1303,7 @@ wxString wxString::Left(size_t nCount) const wxString dest(*this, 0, nCount); if ( dest.length() != nCount ) { - wxFAIL_MSG( _T("out of memory in wxString::Left") ); + wxFAIL_MSG( wxT("out of memory in wxString::Left") ); } return dest; } @@ -1348,7 +1348,7 @@ size_t wxString::Replace(const wxString& strOld, { // if we tried to replace an empty string we'd enter an infinite loop below wxCHECK_MSG( !strOld.empty(), 0, - _T("wxString::Replace(): invalid parameter") ); + wxT("wxString::Replace(): invalid parameter") ); wxSTRING_INVALIDATE_CACHE(); @@ -1470,7 +1470,7 @@ bool wxString::IsNumber() const const_iterator i = begin(); - if ( *i == _T('-') || *i == _T('+') ) + if ( *i == wxT('-') || *i == wxT('+') ) ++i; for ( ; i != end(); ++i ) @@ -1627,7 +1627,7 @@ int wxString::Find(wxUniChar ch, bool bFromEnd) const #endif #define WX_STRING_TO_X_TYPE_START \ - wxCHECK_MSG( pVal, false, _T("NULL output pointer") ); \ + wxCHECK_MSG( pVal, false, wxT("NULL output pointer") ); \ DO_IF_NOT_WINCE( errno = 0; ) \ const wxStringCharType *start = wx_str(); \ wxStringCharType *end; @@ -1643,7 +1643,7 @@ int wxString::Find(wxUniChar ch, bool bFromEnd) const bool wxString::ToLong(long *pVal, int base) const { - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); + wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") ); WX_STRING_TO_X_TYPE_START long val = wxStrtol(start, &end, base); @@ -1652,7 +1652,7 @@ bool wxString::ToLong(long *pVal, int base) const bool wxString::ToULong(unsigned long *pVal, int base) const { - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); + wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") ); WX_STRING_TO_X_TYPE_START unsigned long val = wxStrtoul(start, &end, base); @@ -1661,7 +1661,7 @@ bool wxString::ToULong(unsigned long *pVal, int base) const bool wxString::ToLongLong(wxLongLong_t *pVal, int base) const { - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); + wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") ); WX_STRING_TO_X_TYPE_START wxLongLong_t val = wxStrtoll(start, &end, base); @@ -1670,7 +1670,7 @@ bool wxString::ToLongLong(wxLongLong_t *pVal, int base) const bool wxString::ToULongLong(wxULongLong_t *pVal, int base) const { - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); + wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") ); WX_STRING_TO_X_TYPE_START wxULongLong_t val = wxStrtoull(start, &end, base); @@ -1688,7 +1688,7 @@ bool wxString::ToDouble(double *pVal) const bool wxString::ToCLong(long *pVal, int base) const { - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); + wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") ); WX_STRING_TO_X_TYPE_START #if (wxUSE_UNICODE_UTF8 || !wxUSE_UNICODE) && defined(wxHAS_XLOCALE_SUPPORT) @@ -1701,7 +1701,7 @@ bool wxString::ToCLong(long *pVal, int base) const bool wxString::ToCULong(unsigned long *pVal, int base) const { - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); + wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") ); WX_STRING_TO_X_TYPE_START #if (wxUSE_UNICODE_UTF8 || !wxUSE_UNICODE) && defined(wxHAS_XLOCALE_SUPPORT) @@ -1918,7 +1918,7 @@ static int DoStringPrintfV(wxString& str, // always do it manually // FIXME: This really seems to be the wrong and would be an off-by-one // bug except the code above allocates an extra character. - buf[size] = _T('\0'); + buf[size] = wxT('\0'); // vsnprintf() may return either -1 (traditional Unix behaviour) or the // total number of characters which would have been written if the @@ -2024,31 +2024,31 @@ bool wxString::Matches(const wxString& mask) const wxString pattern; pattern.reserve(wxStrlen(pszMask)); - pattern += _T('^'); + pattern += wxT('^'); while ( *pszMask ) { switch ( *pszMask ) { - case _T('?'): - pattern += _T('.'); + case wxT('?'): + pattern += wxT('.'); break; - case _T('*'): - pattern += _T(".*"); + case wxT('*'): + pattern += wxT(".*"); break; - case _T('^'): - case _T('.'): - case _T('$'): - case _T('('): - case _T(')'): - case _T('|'): - case _T('+'): - case _T('\\'): + case wxT('^'): + case wxT('.'): + case wxT('$'): + case wxT('('): + case wxT(')'): + case wxT('|'): + case wxT('+'): + case wxT('\\'): // these characters are special in a RE, quote them // (however note that we don't quote '[' and ']' to allow // using them for Unix shell like matching) - pattern += _T('\\'); + pattern += wxT('\\'); // fall through default: @@ -2057,7 +2057,7 @@ bool wxString::Matches(const wxString& mask) const pszMask++; } - pattern += _T('$'); + pattern += wxT('$'); // and now use it return wxRegEx(pattern, wxRE_NOSUB | wxRE_EXTENDED).Matches(c_str()); diff --git a/src/common/stringimpl.cpp b/src/common/stringimpl.cpp index 2a30e687df..429f3843bd 100644 --- a/src/common/stringimpl.cpp +++ b/src/common/stringimpl.cpp @@ -79,7 +79,7 @@ const size_t wxStringImpl::npos = (size_t) -1; #if wxUSE_UNICODE_UTF8 const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyStringImpl = ""; #endif -const wxChar WXDLLIMPEXP_BASE *wxEmptyString = _T(""); +const wxChar WXDLLIMPEXP_BASE *wxEmptyString = wxT(""); #else @@ -96,7 +96,7 @@ static const struct #if wxUSE_UNICODE_UTF8 // FIXME-UTF8: get rid of this, have only one wxEmptyString const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyStringImpl = &g_strEmpty.dummy; -const wxChar WXDLLIMPEXP_BASE *wxEmptyString = _T(""); +const wxChar WXDLLIMPEXP_BASE *wxEmptyString = wxT(""); #else const wxStringCharType WXDLLIMPEXP_BASE *wxEmptyString = &g_strEmpty.dummy; #endif @@ -166,7 +166,7 @@ void wxStringImpl::InitWith(const wxStringCharType *psz, // if the length is not given, assume the string to be NUL terminated if ( nLength == npos ) { - wxASSERT_MSG( nPos <= wxStrlen(psz), _T("index out of bounds") ); + wxASSERT_MSG( nPos <= wxStrlen(psz), wxT("index out of bounds") ); nLength = wxStrlen(psz + nPos); } @@ -176,7 +176,7 @@ void wxStringImpl::InitWith(const wxStringCharType *psz, if ( nLength > 0 ) { // trailing '\0' is written in AllocBuffer() if ( !AllocBuffer(nLength) ) { - wxFAIL_MSG( _T("out of memory in wxStringImpl::InitWith") ); + wxFAIL_MSG( wxT("out of memory in wxStringImpl::InitWith") ); return; } wxStringMemcpy(m_pchData, psz + nPos, nLength); @@ -191,7 +191,7 @@ wxStringImpl::wxStringImpl(const_iterator first, const_iterator last) } else { - wxFAIL_MSG( _T("first must be before last") ); + wxFAIL_MSG( wxT("first must be before last") ); Init(); } } @@ -311,7 +311,7 @@ wxStringImpl& wxStringImpl::append(size_t n, wxStringCharType ch) size_type len = length(); if ( !Alloc(len + n) || !CopyBeforeWrite() ) { - wxFAIL_MSG( _T("out of memory in wxStringImpl::append") ); + wxFAIL_MSG( wxT("out of memory in wxStringImpl::append") ); return *this; } GetStringData()->nDataLength = len + n; @@ -436,7 +436,7 @@ wxStringImpl& wxStringImpl::insert(size_t nPos, if ( n == 0 ) return *this; if ( !Alloc(length() + n) || !CopyBeforeWrite() ) { - wxFAIL_MSG( _T("out of memory in wxStringImpl::insert") ); + wxFAIL_MSG( wxT("out of memory in wxStringImpl::insert") ); return *this; } @@ -587,7 +587,7 @@ wxStringImpl& wxStringImpl::replace(size_t nStart, size_t nLen, const size_t lenOld = length(); wxASSERT_MSG( nStart <= lenOld, - _T("index out of bounds in wxStringImpl::replace") ); + wxT("index out of bounds in wxStringImpl::replace") ); size_t nEnd = nStart + nLen; if ( nLen > lenOld - nStart ) { @@ -655,7 +655,7 @@ wxStringImpl& wxStringImpl::operator=(wxStringCharType ch) { wxStringCharType c(ch); if ( !AssignCopy(1, &c) ) { - wxFAIL_MSG( _T("out of memory in wxStringImpl::operator=(wxStringCharType)") ); + wxFAIL_MSG( wxT("out of memory in wxStringImpl::operator=(wxStringCharType)") ); } return *this; } @@ -664,7 +664,7 @@ wxStringImpl& wxStringImpl::operator=(wxStringCharType ch) wxStringImpl& wxStringImpl::operator=(const wxStringCharType *psz) { if ( !AssignCopy(wxStrlen(psz), psz) ) { - wxFAIL_MSG( _T("out of memory in wxStringImpl::operator=(const wxStringCharType *)") ); + wxFAIL_MSG( wxT("out of memory in wxStringImpl::operator=(const wxStringCharType *)") ); } return *this; } @@ -784,10 +784,10 @@ void wxStringImpl::DoUngetWriteBuf(size_t nLen) { wxStringData * const pData = GetStringData(); - wxASSERT_MSG( nLen < pData->nAllocLength, _T("buffer overrun") ); + wxASSERT_MSG( nLen < pData->nAllocLength, wxT("buffer overrun") ); // the strings we store are always NUL-terminated - pData->data()[nLen] = _T('\0'); + pData->data()[nLen] = wxT('\0'); pData->nDataLength = nLen; pData->Validate(true); } diff --git a/src/common/stringops.cpp b/src/common/stringops.cpp index c69a18774f..599c05c1d0 100644 --- a/src/common/stringops.cpp +++ b/src/common/stringops.cpp @@ -242,7 +242,7 @@ wxUniChar::Utf8CharBuffer wxUniChar::AsUTF8() const } else { - wxFAIL_MSG( _T("trying to encode undefined Unicode character") ); + wxFAIL_MSG( wxT("trying to encode undefined Unicode character") ); out[0] = 0; } @@ -256,7 +256,7 @@ wxStringOperationsUtf8::DecodeNonAsciiChar(wxStringImpl::const_iterator i) wxUniChar::value_type code = 0; size_t len = GetUtf8CharLength(*i); - wxASSERT_MSG( len <= 4, _T("invalid UTF-8 sequence length") ); + wxASSERT_MSG( len <= 4, wxT("invalid UTF-8 sequence length") ); // Char. number range | UTF-8 octet sequence // (hexadecimal) | (binary) @@ -281,7 +281,7 @@ wxStringOperationsUtf8::DecodeNonAsciiChar(wxStringImpl::const_iterator i) // extract the lead byte's value bits: wxASSERT_MSG( ((unsigned char)*i & s_leadMarkerMask[len-1]) == s_leadMarkerVal[len-1], - _T("invalid UTF-8 lead byte") ); + wxT("invalid UTF-8 lead byte") ); code = (unsigned char)*i & s_leadValueMask[len-1]; // all remaining bytes, if any, are handled in the same way regardless of @@ -289,7 +289,7 @@ wxStringOperationsUtf8::DecodeNonAsciiChar(wxStringImpl::const_iterator i) for ( ++i ; len > 1; --len, ++i ) { wxASSERT_MSG( ((unsigned char)*i & 0xC0) == 0x80, - _T("invalid UTF-8 byte") ); + wxT("invalid UTF-8 byte") ); code <<= 6; code |= (unsigned char)*i & 0x3F; diff --git a/src/common/strvararg.cpp b/src/common/strvararg.cpp index e71c060b10..09b8ca0b98 100644 --- a/src/common/strvararg.cpp +++ b/src/common/strvararg.cpp @@ -159,23 +159,23 @@ public: while ( *format ) { - if ( CopyFmtChar(*format++) == _T('%') ) + if ( CopyFmtChar(*format++) == wxT('%') ) { // skip any flags while ( IsFlagChar(*format) ) CopyFmtChar(*format++); // and possible width - if ( *format == _T('*') ) + if ( *format == wxT('*') ) CopyFmtChar(*format++); else SkipDigits(&format); // precision? - if ( *format == _T('.') ) + if ( *format == wxT('.') ) { CopyFmtChar(*format++); - if ( *format == _T('*') ) + if ( *format == wxT('*') ) CopyFmtChar(*format++); else SkipDigits(&format); @@ -211,16 +211,16 @@ public: // and finally we should have the type switch ( *format ) { - case _T('S'): - case _T('s'): + case wxT('S'): + case wxT('s'): // all strings were converted into the same form by // wxArgNormalizer, this form depends on the context // in which the value is used (scanf/printf/wprintf): HandleString(*format, size, outConv, outSize); break; - case _T('C'): - case _T('c'): + case wxT('C'): + case wxT('c'): HandleChar(*format, size, outConv, outSize); break; @@ -240,11 +240,11 @@ public: switch ( outSize ) { case Size_Long: - InsertFmtChar(_T('l')); + InsertFmtChar(wxT('l')); break; case Size_Short: - InsertFmtChar(_T('h')); + InsertFmtChar(wxT('h')); break; case Size_Default: @@ -353,13 +353,13 @@ private: static bool IsFlagChar(CharType ch) { - return ch == _T('-') || ch == _T('+') || - ch == _T('0') || ch == _T(' ') || ch == _T('#'); + return ch == wxT('-') || ch == wxT('+') || + ch == wxT('0') || ch == wxT(' ') || ch == wxT('#'); } void SkipDigits(const CharType **ptpc) { - while ( **ptpc >= _T('0') && **ptpc <= _T('9') ) + while ( **ptpc >= wxT('0') && **ptpc <= wxT('9') ) CopyFmtChar(*(*ptpc)++); } diff --git a/src/common/sysopt.cpp b/src/common/sysopt.cpp index d27f46c726..c9834763be 100644 --- a/src/common/sysopt.cpp +++ b/src/common/sysopt.cpp @@ -82,17 +82,17 @@ wxString wxSystemOptions::GetOption(const wxString& name) // which can be set to affect the behaviour or just this application // and then for "wx_name" which can be set to change the option globally wxString var(name); - var.Replace(_T("."), _T("_")); // '.'s not allowed in env var names + var.Replace(wxT("."), wxT("_")); // '.'s not allowed in env var names wxString appname; if ( wxTheApp ) appname = wxTheApp->GetAppName(); if ( !appname.empty() ) - val = wxGetenv(_T("wx_") + appname + _T('_') + var); + val = wxGetenv(wxT("wx_") + appname + wxT('_') + var); if ( val.empty() ) - val = wxGetenv(_T("wx_") + var); + val = wxGetenv(wxT("wx_") + var); } return val; diff --git a/src/common/tarstrm.cpp b/src/common/tarstrm.cpp index 0942b65236..16f96ecf1b 100644 --- a/src/common/tarstrm.cpp +++ b/src/common/tarstrm.cpp @@ -104,9 +104,9 @@ wxTarClassFactory::wxTarClassFactory() const wxChar * const * wxTarClassFactory::GetProtocols(wxStreamProtocolType type) const { - static const wxChar *protocols[] = { _T("tar"), NULL }; - static const wxChar *mimetypes[] = { _T("application/x-tar"), NULL }; - static const wxChar *fileexts[] = { _T(".tar"), NULL }; + static const wxChar *protocols[] = { wxT("tar"), NULL }; + static const wxChar *mimetypes[] = { wxT("application/x-tar"), NULL }; + static const wxChar *fileexts[] = { wxT(".tar"), NULL }; static const wxChar *empty[] = { NULL }; switch (type) { @@ -161,23 +161,23 @@ wxDEFINE_SCOPED_PTR_TYPE(wxTarHeaderBlock) // A table giving the field names and offsets in a tar header block const wxTarField wxTarHeaderBlock::fields[] = { - { _T("name"), 0 }, // 100 - { _T("mode"), 100 }, // 8 - { _T("uid"), 108 }, // 8 - { _T("gid"), 116 }, // 8 - { _T("size"), 124 }, // 12 - { _T("mtime"), 136 }, // 12 - { _T("chksum"), 148 }, // 8 - { _T("typeflag"), 156 }, // 1 - { _T("linkname"), 157 }, // 100 - { _T("magic"), 257 }, // 6 - { _T("version"), 263 }, // 2 - { _T("uname"), 265 }, // 32 - { _T("gname"), 297 }, // 32 - { _T("devmajor"), 329 }, // 8 - { _T("devminor"), 337 }, // 8 - { _T("prefix"), 345 }, // 155 - { _T("unused"), 500 }, // 12 + { wxT("name"), 0 }, // 100 + { wxT("mode"), 100 }, // 8 + { wxT("uid"), 108 }, // 8 + { wxT("gid"), 116 }, // 8 + { wxT("size"), 124 }, // 12 + { wxT("mtime"), 136 }, // 12 + { wxT("chksum"), 148 }, // 8 + { wxT("typeflag"), 156 }, // 1 + { wxT("linkname"), 157 }, // 100 + { wxT("magic"), 257 }, // 6 + { wxT("version"), 263 }, // 2 + { wxT("uname"), 265 }, // 32 + { wxT("gname"), 297 }, // 32 + { wxT("devmajor"), 329 }, // 8 + { wxT("devminor"), 337 }, // 8 + { wxT("prefix"), 345 }, // 155 + { wxT("unused"), 500 }, // 12 { NULL, TAR_BLOCKSIZE } }; @@ -539,15 +539,15 @@ wxString wxTarEntry::GetName(wxPathFormat format /*=wxPATH_NATIVE*/) const switch (wxFileName::GetFormat(format)) { case wxPATH_DOS: { - wxString name(isDir ? m_Name + _T("\\") : m_Name); + wxString name(isDir ? m_Name + wxT("\\") : m_Name); for (size_t i = 0; i < name.length(); i++) - if (name[i] == _T('/')) - name[i] = _T('\\'); + if (name[i] == wxT('/')) + name[i] = wxT('\\'); return name; } case wxPATH_UNIX: - return isDir ? m_Name + _T("/") : m_Name; + return isDir ? m_Name + wxT("/") : m_Name; default: ; @@ -594,9 +594,9 @@ wxString wxTarEntry::GetInternalName(const wxString& name, while (!internal.empty() && *internal.begin() == '/') internal.erase(0, 1); - while (!internal.empty() && internal.compare(0, 2, _T("./")) == 0) + while (!internal.empty() && internal.compare(0, 2, wxT("./")) == 0) internal.erase(0, 2); - if (internal == _T(".") || internal == _T("..")) + if (internal == wxT(".") || internal == wxT("..")) internal = wxEmptyString; return internal; @@ -695,9 +695,9 @@ wxTarEntry *wxTarInputStream::GetNextEntry() entry->SetOffset(m_offset); - entry->SetDateTime(GetHeaderDate(_T("mtime"))); - entry->SetAccessTime(GetHeaderDate(_T("atime"))); - entry->SetCreateTime(GetHeaderDate(_T("ctime"))); + entry->SetDateTime(GetHeaderDate(wxT("mtime"))); + entry->SetAccessTime(GetHeaderDate(wxT("atime"))); + entry->SetCreateTime(GetHeaderDate(wxT("ctime"))); entry->SetTypeFlag(*m_hdr->Get(TAR_TYPEFLAG)); bool isDir = entry->IsDir(); @@ -868,7 +868,7 @@ wxString wxTarInputStream::GetHeaderPath() const { wxString path; - if ((path = GetExtendedHeader(_T("path"))) != wxEmptyString) + if ((path = GetExtendedHeader(wxT("path"))) != wxEmptyString) return path; path = wxString(m_hdr->Get(TAR_NAME), GetConv()); @@ -876,7 +876,7 @@ wxString wxTarInputStream::GetHeaderPath() const return path; const char *prefix = m_hdr->Get(TAR_PREFIX); - return *prefix ? wxString(prefix, GetConv()) + _T("/") + path : path; + return *prefix ? wxString(prefix, GetConv()) + wxT("/") + path : path; } wxDateTime wxTarInputStream::GetHeaderDate(const wxString& key) const @@ -890,7 +890,7 @@ wxDateTime wxTarInputStream::GetHeaderDate(const wxString& key) const return ll; } - if (key == _T("mtime")) + if (key == wxT("mtime")) return wxLongLong(m_hdr->GetOctal(TAR_MTIME)) * 1000L; return wxDateTime(); @@ -1243,11 +1243,11 @@ bool wxTarOutputStream::WriteHeaders(wxTarEntry& entry) entry.SetSize(0); m_large = !SetHeaderNumber(TAR_SIZE, entry.GetSize()); - SetHeaderDate(_T("mtime"), entry.GetDateTime()); + SetHeaderDate(wxT("mtime"), entry.GetDateTime()); if (entry.GetAccessTime().IsValid()) - SetHeaderDate(_T("atime"), entry.GetAccessTime()); + SetHeaderDate(wxT("atime"), entry.GetAccessTime()); if (entry.GetCreateTime().IsValid()) - SetHeaderDate(_T("ctime"), entry.GetCreateTime()); + SetHeaderDate(wxT("ctime"), entry.GetCreateTime()); *m_hdr->Get(TAR_TYPEFLAG) = char(entry.GetTypeFlag()); @@ -1282,7 +1282,7 @@ bool wxTarOutputStream::WriteHeaders(wxTarEntry& entry) // an old tar that doesn't understand extended headers will // extract it as a file, so give these fields reasonable values // so that the user will have access to read and remove it. - m_hdr2->SetPath(PaxHeaderPath(_T("%d/PaxHeaders.%p/%f"), + m_hdr2->SetPath(PaxHeaderPath(wxT("%d/PaxHeaders.%p/%f"), entry.GetName(wxPATH_UNIX)), GetConv()); m_hdr2->SetOctal(TAR_MODE, 0600); strcpy(m_hdr2->Get(TAR_UID), m_hdr->Get(TAR_UID)); @@ -1327,12 +1327,12 @@ bool wxTarOutputStream::WriteHeaders(wxTarEntry& entry) wxString wxTarOutputStream::PaxHeaderPath(const wxString& format, const wxString& path) { - wxString d = path.BeforeLast(_T('/')); - wxString f = path.AfterLast(_T('/')); + wxString d = path.BeforeLast(wxT('/')); + wxString f = path.AfterLast(wxT('/')); wxString ret; if (d.empty()) - d = _T("."); + d = wxT("."); ret.reserve(format.length() + path.length() + 16); @@ -1348,7 +1348,7 @@ wxString wxTarOutputStream::PaxHeaderPath(const wxString& format, case 'd': ret << d; break; case 'f': ret << f; break; case 'p': ret << wxGetProcessId(); break; - case '%': ret << _T("%"); break; + case '%': ret << wxT("%"); break; } begin = end + 2; } @@ -1393,7 +1393,7 @@ bool wxTarOutputStream::ModifyHeader() void wxTarOutputStream::SetHeaderPath(const wxString& name) { if (!m_hdr->SetPath(name, GetConv()) || (m_pax && !name.IsAscii())) - SetExtendedHeader(_T("path"), name); + SetExtendedHeader(wxT("path"), name); } bool wxTarOutputStream::SetHeaderNumber(int id, wxTarNumber n) @@ -1419,13 +1419,13 @@ void wxTarOutputStream::SetHeaderDate(const wxString& key, wxLongLong ll = datetime.IsValid() ? datetime.GetValue() : wxLongLong(0); wxLongLong secs = ll / 1000L; - if (key != _T("mtime") + if (key != wxT("mtime") || !m_hdr->SetOctal(TAR_MTIME, wxTarNumber(secs.GetValue())) || secs <= 0 || secs >= 0x7fffffff) { wxString str; if (ll >= LONG_MIN && ll <= LONG_MAX) { - str.Printf(_T("%g"), ll.ToLong() / 1000.0); + str.Printf(wxT("%g"), ll.ToLong() / 1000.0); } else { str = ll.ToString(); str.insert(str.end() - 3, '.'); @@ -1487,7 +1487,7 @@ void wxTarOutputStream::SetExtendedHeader(const wxString& key, else { // if not pax then make a list of fields to report as errors if (!m_badfit.empty()) - m_badfit += _T(", "); + m_badfit += wxT(", "); m_badfit += key; } } diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index a43e8a0b1d..abc7670961 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -79,7 +79,7 @@ bool wxToolBarToolBase::Enable(bool enable) bool wxToolBarToolBase::Toggle(bool toggle) { - wxASSERT_MSG( CanBeToggled(), _T("can't toggle this tool") ); + wxASSERT_MSG( CanBeToggled(), wxT("can't toggle this tool") ); if ( m_toggled == toggle ) return false; @@ -178,7 +178,7 @@ wxToolBarToolBase *wxToolBarBase::InsertTool(size_t pos, wxObject *clientData) { wxCHECK_MSG( pos <= GetToolsCount(), NULL, - _T("invalid position in wxToolBar::InsertTool()") ); + wxT("invalid position in wxToolBar::InsertTool()") ); wxToolBarToolBase *tool = CreateTool(id, label, bitmap, bmpDisabled, kind, clientData, shortHelp, longHelp); @@ -202,7 +202,7 @@ wxToolBarToolBase * wxToolBarBase::InsertTool(size_t pos, wxToolBarToolBase *tool) { wxCHECK_MSG( pos <= GetToolsCount(), NULL, - _T("invalid position in wxToolBar::InsertTool()") ); + wxT("invalid position in wxToolBar::InsertTool()") ); if ( !tool || !DoInsertTool(pos, tool) ) { @@ -227,13 +227,13 @@ wxToolBarBase::InsertControl(size_t pos, const wxString& label) { wxCHECK_MSG( control, NULL, - _T("toolbar: can't insert NULL control") ); + wxT("toolbar: can't insert NULL control") ); wxCHECK_MSG( control->GetParent() == this, NULL, - _T("control must have toolbar as parent") ); + wxT("control must have toolbar as parent") ); wxCHECK_MSG( pos <= GetToolsCount(), NULL, - _T("invalid position in wxToolBar::InsertControl()") ); + wxT("invalid position in wxToolBar::InsertControl()") ); wxToolBarToolBase *tool = CreateTool(control, label); @@ -260,7 +260,7 @@ wxControl *wxToolBarBase::FindControl( int id ) if ( !control ) { - wxFAIL_MSG( _T("NULL control in toolbar?") ); + wxFAIL_MSG( wxT("NULL control in toolbar?") ); } else if ( control->GetId() == id ) { @@ -281,7 +281,7 @@ wxToolBarToolBase *wxToolBarBase::AddSeparator() wxToolBarToolBase *wxToolBarBase::InsertSeparator(size_t pos) { wxCHECK_MSG( pos <= GetToolsCount(), NULL, - _T("invalid position in wxToolBar::InsertSeparator()") ); + wxT("invalid position in wxToolBar::InsertSeparator()") ); wxToolBarToolBase *tool = CreateTool(wxID_SEPARATOR, wxEmptyString, @@ -336,7 +336,7 @@ wxToolBarToolBase *wxToolBarBase::RemoveTool(int id) bool wxToolBarBase::DeleteToolByPos(size_t pos) { wxCHECK_MSG( pos < GetToolsCount(), false, - _T("invalid position in wxToolBar::DeleteToolByPos()") ); + wxT("invalid position in wxToolBar::DeleteToolByPos()") ); wxToolBarToolsList::compatibility_iterator node = m_tools.Item(pos); @@ -397,13 +397,13 @@ wxToolBarToolBase *wxToolBarBase::FindById(int id) const void wxToolBarBase::UnToggleRadioGroup(wxToolBarToolBase *tool) { - wxCHECK_RET( tool, _T("NULL tool in wxToolBarTool::UnToggleRadioGroup") ); + wxCHECK_RET( tool, wxT("NULL tool in wxToolBarTool::UnToggleRadioGroup") ); if ( !tool->IsButton() || tool->GetKind() != wxITEM_RADIO ) return; wxToolBarToolsList::compatibility_iterator node = m_tools.Find(tool); - wxCHECK_RET( node, _T("invalid tool in wxToolBarTool::UnToggleRadioGroup") ); + wxCHECK_RET( node, wxT("invalid tool in wxToolBarTool::UnToggleRadioGroup") ); wxToolBarToolsList::compatibility_iterator nodeNext = node->GetNext(); while ( nodeNext ) @@ -561,7 +561,7 @@ void wxToolBarBase::SetToolClientData(int id, wxObject *clientData) { wxToolBarToolBase *tool = FindById(id); - wxCHECK_RET( tool, _T("no such tool in wxToolBar::SetToolClientData") ); + wxCHECK_RET( tool, wxT("no such tool in wxToolBar::SetToolClientData") ); tool->SetClientData(clientData); } @@ -585,7 +585,7 @@ int wxToolBarBase::GetToolPos(int id) const bool wxToolBarBase::GetToolState(int id) const { wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, false, _T("no such tool") ); + wxCHECK_MSG( tool, false, wxT("no such tool") ); return tool->IsToggled(); } @@ -593,7 +593,7 @@ bool wxToolBarBase::GetToolState(int id) const bool wxToolBarBase::GetToolEnabled(int id) const { wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, false, _T("no such tool") ); + wxCHECK_MSG( tool, false, wxT("no such tool") ); return tool->IsEnabled(); } @@ -601,7 +601,7 @@ bool wxToolBarBase::GetToolEnabled(int id) const wxString wxToolBarBase::GetToolShortHelp(int id) const { wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") ); + wxCHECK_MSG( tool, wxEmptyString, wxT("no such tool") ); return tool->GetShortHelp(); } @@ -609,7 +609,7 @@ wxString wxToolBarBase::GetToolShortHelp(int id) const wxString wxToolBarBase::GetToolLongHelp(int id) const { wxToolBarToolBase *tool = FindById(id); - wxCHECK_MSG( tool, wxEmptyString, _T("no such tool") ); + wxCHECK_MSG( tool, wxEmptyString, wxT("no such tool") ); return tool->GetLongHelp(); } @@ -750,10 +750,10 @@ void wxToolBarBase::UpdateWindowUI(long flags) bool wxToolBarBase::SetDropdownMenu(int toolid, wxMenu* menu) { wxToolBarToolBase * const tool = FindById(toolid); - wxCHECK_MSG( tool, false, _T("invalid tool id") ); + wxCHECK_MSG( tool, false, wxT("invalid tool id") ); wxCHECK_MSG( tool->GetKind() == wxITEM_DROPDOWN, false, - _T("menu can be only associated with drop down tools") ); + wxT("menu can be only associated with drop down tools") ); tool->SetDropdownMenu(menu); diff --git a/src/common/textbuf.cpp b/src/common/textbuf.cpp index b6e8362c85..542e19db1e 100644 --- a/src/common/textbuf.cpp +++ b/src/common/textbuf.cpp @@ -89,26 +89,26 @@ wxString wxTextBuffer::Translate(const wxString& text, wxTextFileType type) { wxChar ch = *i; switch ( ch ) { - case _T('\n'): + case wxT('\n'): // Dos/Unix line termination result += eol; chLast = 0; break; - case _T('\r'): - if ( chLast == _T('\r') ) { + case wxT('\r'): + if ( chLast == wxT('\r') ) { // Mac empty line result += eol; } else { // just remember it: we don't know whether it is just "\r" // or "\r\n" yet - chLast = _T('\r'); + chLast = wxT('\r'); } break; default: - if ( chLast == _T('\r') ) { + if ( chLast == wxT('\r') ) { // Mac line termination result += eol; @@ -226,7 +226,7 @@ wxTextFileType wxTextBuffer::GuessType() const case wxTextFileType_Unix: nUnix++; break; \ case wxTextFileType_Dos: nDos++; break; \ case wxTextFileType_Mac: nMac++; break; \ - default: wxFAIL_MSG(_T("unknown line terminator")); \ + default: wxFAIL_MSG(wxT("unknown line terminator")); \ } size_t n; diff --git a/src/common/textcmn.cpp b/src/common/textcmn.cpp index 526f83412d..d620dff1b9 100644 --- a/src/common/textcmn.cpp +++ b/src/common/textcmn.cpp @@ -778,7 +778,7 @@ bool wxTextAreaBase::SaveFile(const wxString& filename, int fileType) bool wxTextCtrlBase::DoSaveFile(const wxString& filename, int WXUNUSED(fileType)) { #if wxUSE_FFILE - wxFFile file(filename, _T("w")); + wxFFile file(filename, wxT("w")); if ( file.IsOpened() && file.Write(GetValue()) ) { // if it worked, save for future calls @@ -859,32 +859,32 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event) case WXK_NUMPAD7: case WXK_NUMPAD8: case WXK_NUMPAD9: - ch = (wxChar)(_T('0') + keycode - WXK_NUMPAD0); + ch = (wxChar)(wxT('0') + keycode - WXK_NUMPAD0); break; case WXK_MULTIPLY: case WXK_NUMPAD_MULTIPLY: - ch = _T('*'); + ch = wxT('*'); break; case WXK_ADD: case WXK_NUMPAD_ADD: - ch = _T('+'); + ch = wxT('+'); break; case WXK_SUBTRACT: case WXK_NUMPAD_SUBTRACT: - ch = _T('-'); + ch = wxT('-'); break; case WXK_DECIMAL: case WXK_NUMPAD_DECIMAL: - ch = _T('.'); + ch = wxT('.'); break; case WXK_DIVIDE: case WXK_NUMPAD_DIVIDE: - ch = _T('/'); + ch = wxT('/'); break; case WXK_DELETE: @@ -926,7 +926,7 @@ bool wxTextCtrlBase::EmulateKeyPress(const wxKeyEvent& event) } else { - ch = _T('\0'); + ch = wxT('\0'); } } diff --git a/src/common/textfile.cpp b/src/common/textfile.cpp index 79d837f631..91a86d5fb4 100644 --- a/src/common/textfile.cpp +++ b/src/common/textfile.cpp @@ -64,7 +64,7 @@ bool wxTextFile::OnOpen(const wxString &strBufferName, wxTextBufferOpenMode Open switch ( OpenMode ) { default: - wxFAIL_MSG( _T("unknown open mode in wxTextFile::Open") ); + wxFAIL_MSG( wxT("unknown open mode in wxTextFile::Open") ); // fall through case ReadAccess : @@ -89,7 +89,7 @@ bool wxTextFile::OnClose() bool wxTextFile::OnRead(const wxMBConv& conv) { // file should be opened - wxASSERT_MSG( m_file.IsOpened(), _T("can't read closed file") ); + wxASSERT_MSG( m_file.IsOpened(), wxT("can't read closed file") ); // read the entire file in memory: this is not the most efficient thing to // do it but there is no good way to avoid it in Unicode build because if @@ -124,7 +124,7 @@ bool wxTextFile::OnRead(const wxMBConv& conv) return false; // if the file is seekable, also check that we're at its beginning - wxASSERT_MSG( m_file.Tell() == 0, _T("should be at start of file") ); + wxASSERT_MSG( m_file.Tell() == 0, wxT("should be at start of file") ); char *dst = buf.data(); for ( size_t nRemaining = bufSize; nRemaining > 0; ) @@ -156,7 +156,7 @@ bool wxTextFile::OnRead(const wxMBConv& conv) } wxASSERT_MSG( dst - buf.data() == (wxFileOffset)bufSize, - _T("logic error") ); + wxT("logic error") ); } else // file is not seekable { diff --git a/src/common/timercmn.cpp b/src/common/timercmn.cpp index defa3b9dd4..e38a50629c 100644 --- a/src/common/timercmn.cpp +++ b/src/common/timercmn.cpp @@ -60,7 +60,7 @@ void wxTimer::Init() m_impl = traits ? traits->CreateTimerImpl(this) : NULL; if ( !m_impl ) { - wxFAIL_MSG( _T("No timer implementation for this platform") ); + wxFAIL_MSG( wxT("No timer implementation for this platform") ); } } @@ -71,28 +71,28 @@ void wxTimer::Init() void wxTimer::SetOwner(wxEvtHandler *owner, int timerid) { - wxCHECK_RET( m_impl, _T("uninitialized timer") ); + wxCHECK_RET( m_impl, wxT("uninitialized timer") ); m_impl->SetOwner(owner, timerid); } wxEvtHandler *wxTimer::GetOwner() const { - wxCHECK_MSG( m_impl, NULL, _T("uninitialized timer") ); + wxCHECK_MSG( m_impl, NULL, wxT("uninitialized timer") ); return m_impl->GetOwner(); } bool wxTimer::Start(int milliseconds, bool oneShot) { - wxCHECK_MSG( m_impl, false, _T("uninitialized timer") ); + wxCHECK_MSG( m_impl, false, wxT("uninitialized timer") ); return m_impl->Start(milliseconds, oneShot); } void wxTimer::Stop() { - wxCHECK_RET( m_impl, _T("uninitialized timer") ); + wxCHECK_RET( m_impl, wxT("uninitialized timer") ); if ( m_impl->IsRunning() ) m_impl->Stop(); @@ -102,35 +102,35 @@ void wxTimer::Notify() { // the base class version generates an event if it has owner - which it // should because otherwise nobody can process timer events - wxCHECK_RET( GetOwner(), _T("wxTimer::Notify() should be overridden.") ); + wxCHECK_RET( GetOwner(), wxT("wxTimer::Notify() should be overridden.") ); m_impl->SendEvent(); } bool wxTimer::IsRunning() const { - wxCHECK_MSG( m_impl, false, _T("uninitialized timer") ); + wxCHECK_MSG( m_impl, false, wxT("uninitialized timer") ); return m_impl->IsRunning(); } int wxTimer::GetId() const { - wxCHECK_MSG( m_impl, wxID_ANY, _T("uninitialized timer") ); + wxCHECK_MSG( m_impl, wxID_ANY, wxT("uninitialized timer") ); return m_impl->GetId(); } int wxTimer::GetInterval() const { - wxCHECK_MSG( m_impl, -1, _T("uninitialized timer") ); + wxCHECK_MSG( m_impl, -1, wxT("uninitialized timer") ); return m_impl->GetInterval(); } bool wxTimer::IsOneShot() const { - wxCHECK_MSG( m_impl, false, _T("uninitialized timer") ); + wxCHECK_MSG( m_impl, false, wxT("uninitialized timer") ); return m_impl->IsOneShot(); } diff --git a/src/common/timerimpl.cpp b/src/common/timerimpl.cpp index c2ac8e8712..5d8548329b 100644 --- a/src/common/timerimpl.cpp +++ b/src/common/timerimpl.cpp @@ -58,7 +58,7 @@ bool wxTimerImpl::Start(int milliseconds, bool oneShot) // let the caller know about it #if wxUSE_THREADS wxASSERT_MSG( wxThread::IsMain(), - _T("timer can only be started from the main thread") ); + wxT("timer can only be started from the main thread") ); #endif // wxUSE_THREADS if ( IsRunning() ) diff --git a/src/common/tokenzr.cpp b/src/common/tokenzr.cpp index 8c29cd7cfa..2822025bb7 100644 --- a/src/common/tokenzr.cpp +++ b/src/common/tokenzr.cpp @@ -47,7 +47,7 @@ find_first_of(const wxChar *delims, size_t len, const wxString::const_iterator& from, const wxString::const_iterator& end) { - wxASSERT_MSG( from <= end, _T("invalid index") ); + wxASSERT_MSG( from <= end, wxT("invalid index") ); for ( wxString::const_iterator i = from; i != end; ++i ) { @@ -63,7 +63,7 @@ find_first_not_of(const wxChar *delims, size_t len, const wxString::const_iterator& from, const wxString::const_iterator& end) { - wxASSERT_MSG( from <= end, _T("invalid index") ); + wxASSERT_MSG( from <= end, wxT("invalid index") ); for ( wxString::const_iterator i = from; i != end; ++i ) { @@ -128,12 +128,12 @@ void wxStringTokenizer::SetString(const wxString& str, void wxStringTokenizer::Reinit(const wxString& str) { - wxASSERT_MSG( IsOk(), _T("you should call SetString() first") ); + wxASSERT_MSG( IsOk(), wxT("you should call SetString() first") ); m_string = str; m_stringEnd = m_string.end(); m_pos = m_string.begin(); - m_lastDelim = _T('\0'); + m_lastDelim = wxT('\0'); m_hasMoreTokens = MoreTokens_Unknown; } @@ -162,7 +162,7 @@ bool wxStringTokenizer::HasMoreTokens() const bool wxStringTokenizer::DoHasMoreTokens() const { - wxCHECK_MSG( IsOk(), false, _T("you should call SetString() first") ); + wxCHECK_MSG( IsOk(), false, wxT("you should call SetString() first") ); if ( find_first_not_of(m_delims, m_delimsLen, m_pos, m_stringEnd) != m_stringEnd ) @@ -186,11 +186,11 @@ bool wxStringTokenizer::DoHasMoreTokens() const // up to the end of the string in GetNextToken(), but if it is not // NUL yet we still have this last token to return even if m_pos is // already at m_string.length() - return m_pos < m_stringEnd || m_lastDelim != _T('\0'); + return m_pos < m_stringEnd || m_lastDelim != wxT('\0'); case wxTOKEN_INVALID: case wxTOKEN_DEFAULT: - wxFAIL_MSG( _T("unexpected tokenizer mode") ); + wxFAIL_MSG( wxT("unexpected tokenizer mode") ); // fall through case wxTOKEN_STRTOK: @@ -204,7 +204,7 @@ bool wxStringTokenizer::DoHasMoreTokens() const // count the number of (remaining) tokens in the string size_t wxStringTokenizer::CountTokens() const { - wxCHECK_MSG( IsOk(), 0, _T("you should call SetString() first") ); + wxCHECK_MSG( IsOk(), 0, wxT("you should call SetString() first") ); // VZ: this function is IMHO not very useful, so it's probably not very // important if its implementation here is not as efficient as it @@ -254,7 +254,7 @@ wxString wxStringTokenizer::GetNextToken() m_pos = m_stringEnd; // it wasn't terminated - m_lastDelim = _T('\0'); + m_lastDelim = wxT('\0'); } else // we found a delimiter at pos { @@ -269,7 +269,7 @@ wxString wxStringTokenizer::GetNextToken() // skip the token and the trailing delimiter m_pos = pos + 1; - m_lastDelim = (pos == m_stringEnd) ? _T('\0') : (wxChar)*pos; + m_lastDelim = (pos == m_stringEnd) ? wxT('\0') : (wxChar)*pos; } } while ( !AllowEmpty() && token.empty() ); diff --git a/src/common/txtstrm.cpp b/src/common/txtstrm.cpp index f7d6c09efd..830bc985ba 100644 --- a/src/common/txtstrm.cpp +++ b/src/common/txtstrm.cpp @@ -125,7 +125,7 @@ bool wxTextInputStream::EatEOL(const wxChar &c) wxUint32 wxTextInputStream::Read32(int base) { - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); + wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") ); if(!m_input) return 0; wxString word = ReadWord(); @@ -146,7 +146,7 @@ wxUint8 wxTextInputStream::Read8(int base) wxInt32 wxTextInputStream::Read32S(int base) { - wxASSERT_MSG( !base || (base > 1 && base <= 36), _T("invalid base") ); + wxASSERT_MSG( !base || (base > 1 && base <= 36), wxT("invalid base") ); if(!m_input) return 0; wxString word = ReadWord(); @@ -387,15 +387,15 @@ void wxTextOutputStream::WriteString(const wxString& string) switch ( m_mode ) { case wxEOL_DOS: - out << _T("\r\n"); + out << wxT("\r\n"); continue; case wxEOL_MAC: - out << _T('\r'); + out << wxT('\r'); continue; default: - wxFAIL_MSG( _T("unknown EOL mode in wxTextOutputStream") ); + wxFAIL_MSG( wxT("unknown EOL mode in wxTextOutputStream") ); // fall through case wxEOL_UNIX: diff --git a/src/common/unichar.cpp b/src/common/unichar.cpp index 163d388744..3684f76d62 100644 --- a/src/common/unichar.cpp +++ b/src/common/unichar.cpp @@ -126,7 +126,7 @@ wxUniCharRef& wxUniCharRef::operator=(const wxUniChar& c) if ( iterNum == STATIC_SIZE ) { - wxLogTrace( _T("utf8"), _T("unexpectedly many iterators") ); + wxLogTrace( wxT("utf8"), wxT("unexpectedly many iterators") ); size_t total = iterNum + 1; for ( wxStringIteratorNode *it2 = it; it2; it2 = it2->m_next ) diff --git a/src/common/url.cpp b/src/common/url.cpp index 7302b06585..4d68232825 100644 --- a/src/common/url.cpp +++ b/src/common/url.cpp @@ -427,7 +427,7 @@ wxURLModule::wxURLModule() { // we must be cleaned up before wxSocketModule as otherwise deleting // ms_proxyDefault from our OnExit() won't work (and can actually crash) - AddDependency(wxClassInfo::FindClass(_T("wxSocketModule"))); + AddDependency(wxClassInfo::FindClass(wxT("wxSocketModule"))); } bool wxURLModule::OnInit() @@ -438,7 +438,7 @@ bool wxURLModule::OnInit() // down the program startup (especially if there is no DNS server // available, in which case it may take up to 1 minute) - if ( wxGetenv(_T("HTTP_PROXY")) ) + if ( wxGetenv(wxT("HTTP_PROXY")) ) { wxURL::ms_useDefaultProxy = true; } diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 2a8dbf931b..6dd39b131d 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -545,7 +545,7 @@ wxString wxGetCurrentDir() { if ( errno != ERANGE ) { - wxLogSysError(_T("Failed to get current directory")); + wxLogSysError(wxT("Failed to get current directory")); return wxEmptyString; } @@ -573,7 +573,7 @@ wxString wxGetCurrentDir() #if wxUSE_STREAMS static bool ReadAll(wxInputStream *is, wxArrayString& output) { - wxCHECK_MSG( is, false, _T("NULL stream in wxExecute()?") ); + wxCHECK_MSG( is, false, wxT("NULL stream in wxExecute()?") ); // the stream could be already at EOF or in wxSTREAM_BROKEN_PIPE state is->Reset(); @@ -959,7 +959,7 @@ bool wxDoLaunchDefaultBrowser(const wxString& url, int flags) wxString cmd; #if wxUSE_MIMETYPE - wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("html")); + wxFileType *ft = wxTheMimeTypesManager->GetFileTypeFromExtension(wxT("html")); if ( ft ) { wxString mt; @@ -974,7 +974,7 @@ bool wxDoLaunchDefaultBrowser(const wxString& url, int flags) { // fallback to checking for the BROWSER environment variable if ( !wxGetEnv(wxT("BROWSER"), &cmd) || cmd.empty() ) - cmd << _T(' ') << url; + cmd << wxT(' ') << url; } ok = ( !cmd.empty() && wxExecute(cmd) ); @@ -1116,7 +1116,7 @@ wxChar *wxStripMenuCodes(const wxChar *in, wxChar *out) wxString wxStripMenuCodes(const wxString& in, int flags) { - wxASSERT_MSG( flags, _T("this is useless to call without any flags") ); + wxASSERT_MSG( flags, wxT("this is useless to call without any flags") ); wxString out; @@ -1126,14 +1126,14 @@ wxString wxStripMenuCodes(const wxString& in, int flags) for ( size_t n = 0; n < len; n++ ) { wxChar ch = in[n]; - if ( (flags & wxStrip_Mnemonics) && ch == _T('&') ) + if ( (flags & wxStrip_Mnemonics) && ch == wxT('&') ) { // skip it, it is used to introduce the accel char (or to quote // itself in which case it should still be skipped): note that it // can't be the last character of the string if ( ++n == len ) { - wxLogDebug(_T("Invalid menu string '%s'"), in.c_str()); + wxLogDebug(wxT("Invalid menu string '%s'"), in.c_str()); } else { @@ -1141,7 +1141,7 @@ wxString wxStripMenuCodes(const wxString& in, int flags) ch = in[n]; } } - else if ( (flags & wxStrip_Accel) && ch == _T('\t') ) + else if ( (flags & wxStrip_Accel) && ch == wxT('\t') ) { // everything after TAB is accel string, exit the loop break; @@ -1305,7 +1305,7 @@ int wxMessageBox(const wxString& message, const wxString& caption, long style, return wxCANCEL; } - wxFAIL_MSG( _T("unexpected return code from wxMessageDialog") ); + wxFAIL_MSG( wxT("unexpected return code from wxMessageDialog") ); return wxCANCEL; } @@ -1314,10 +1314,10 @@ void wxInfoMessageBox(wxWindow* parent) { // don't translate these strings, they're for diagnostics purposes only wxString msg; - msg.Printf(_T("wxWidgets Library (%s port)\n") - _T("Version %d.%d.%d%s%s, compiled at %s %s\n") - _T("Runtime version of toolkit used is %d.%d.%s\n") - _T("Copyright (c) 1995-2009 wxWidgets team"), + msg.Printf(wxT("wxWidgets Library (%s port)\n") + wxT("Version %d.%d.%d%s%s, compiled at %s %s\n") + wxT("Runtime version of toolkit used is %d.%d.%s\n") + wxT("Copyright (c) 1995-2009 wxWidgets team"), wxPlatformInfo::Get().GetPortIdName().c_str(), wxMAJOR_VERSION, wxMINOR_VERSION, @@ -1328,7 +1328,7 @@ void wxInfoMessageBox(wxWindow* parent) wxEmptyString, #endif #ifdef __WXDEBUG__ - _T(" Debug build"), + wxT(" Debug build"), #else wxEmptyString, #endif @@ -1345,7 +1345,7 @@ void wxInfoMessageBox(wxWindow* parent) wxEmptyString #endif ); - wxMessageBox(msg, _T("wxWidgets information"), + wxMessageBox(msg, wxT("wxWidgets information"), wxICON_INFORMATION | wxOK, parent); } diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp index 56998ee14c..48b8bf3e32 100644 --- a/src/common/valtext.cpp +++ b/src/common/valtext.cpp @@ -126,7 +126,7 @@ wxTextEntry *wxTextValidator::GetTextEntry() #endif wxFAIL_MSG( - _T("wxTextValidator can only be used with wxTextCtrl or wxComboBox") + wxT("wxTextValidator can only be used with wxTextCtrl or wxComboBox") ); return NULL; diff --git a/src/common/variant.cpp b/src/common/variant.cpp index 12a9ded6d2..3da37a3a83 100644 --- a/src/common/variant.cpp +++ b/src/common/variant.cpp @@ -1343,7 +1343,7 @@ bool wxVariantDataArrayString::Write(wxString& str) const for ( size_t n = 0; n < count; n++ ) { if ( n ) - str += _T(';'); + str += wxT(';'); str += m_value[n]; } @@ -1363,7 +1363,7 @@ bool wxVariantDataArrayString::Read(wxSTD istream& WXUNUSED(str)) bool wxVariantDataArrayString::Read(wxString& str) { - wxStringTokenizer tk(str, _T(";")); + wxStringTokenizer tk(str, wxT(";")); while ( tk.HasMoreTokens() ) { m_value.Add(tk.GetNextToken()); @@ -1382,7 +1382,7 @@ wxVariant::wxVariant(const wxArrayString& val, const wxString& name) // Strings bool wxVariant::operator==(const wxArrayString& WXUNUSED(value)) const { - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( wxT("TODO") ); return false; } diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 19a474f5be..6eddc7acf4 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -223,7 +223,7 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, // reserved for wxWidgets own usage) wxASSERT_MSG( id == wxID_ANY || (id >= 0 && id < 32767) || (id >= wxID_AUTO_LOWEST && id <= wxID_AUTO_HIGHEST), - _T("invalid id value") ); + wxT("invalid id value") ); // generate a new id if the user doesn't care about it if ( id == wxID_ANY ) @@ -260,7 +260,7 @@ bool wxWindowBase::CreateBase(wxWindowBase *parent, bool wxWindowBase::ToggleWindowStyle(int flag) { - wxASSERT_MSG( flag, _T("flags with 0 value can't be toggled") ); + wxASSERT_MSG( flag, wxT("flags with 0 value can't be toggled") ); bool rc; long style = GetWindowStyleFlag(); @@ -439,7 +439,7 @@ bool wxWindowBase::DestroyChildren() void wxWindowBase::DoCentre(int dir) { wxCHECK_RET( !(dir & wxCENTRE_ON_SCREEN) && GetParent(), - _T("this method only implements centering child windows") ); + wxT("this method only implements centering child windows") ); SetSize(GetRect().CentreIn(GetParent()->GetClientSize(), dir)); } @@ -644,7 +644,7 @@ static int wxGetMetricOrDefault(wxSystemMetric what, const wxWindowBase* win) break; default: - wxFAIL_MSG( _T("unexpected wxGetMetricOrDefault() argument") ); + wxFAIL_MSG( wxT("unexpected wxGetMetricOrDefault() argument") ); rc = 0; } } @@ -684,7 +684,7 @@ wxSize wxWindowBase::GetWindowBorderSize() const break; default: - wxFAIL_MSG(_T("Unknown border style.")); + wxFAIL_MSG(wxT("Unknown border style.")); break; } @@ -812,7 +812,7 @@ void wxWindowBase::DoSetWindowVariant( wxWindowVariant variant ) break; default: - wxFAIL_MSG(_T("unexpected window variant")); + wxFAIL_MSG(wxT("unexpected window variant")); break; } @@ -826,7 +826,7 @@ void wxWindowBase::DoSetSizeHints( int minW, int minH, { wxCHECK_RET( (minW == wxDefaultCoord || maxW == wxDefaultCoord || minW <= maxW) && (minH == wxDefaultCoord || maxH == wxDefaultCoord || minH <= maxH), - _T("min width/height must be less than max width/height!") ); + wxT("min width/height must be less than max width/height!") ); m_minWidth = minW; m_maxWidth = maxW; @@ -1040,7 +1040,7 @@ void wxWindowBase::AddChild(wxWindowBase *child) // this should never happen and it will lead to a crash later if it does // because RemoveChild() will remove only one node from the children list // and the other(s) one(s) will be left with dangling pointers in them - wxASSERT_MSG( !GetChildren().Find((wxWindow*)child), _T("AddChild() called twice") ); + wxASSERT_MSG( !GetChildren().Find((wxWindow*)child), wxT("AddChild() called twice") ); GetChildren().Append((wxWindow*)child); child->SetParent(this); @@ -1234,7 +1234,7 @@ bool wxWindowBase::RemoveEventHandler(wxEvtHandler *handlerToRemove) handlerCur = handlerNext; } - wxFAIL_MSG( _T("where has the event handler gone?") ); + wxFAIL_MSG( wxT("where has the event handler gone?") ); return false; } @@ -1307,7 +1307,7 @@ wxColour wxWindowBase::GetBackgroundColour() const { if ( !m_backgroundColour.IsOk() ) { - wxASSERT_MSG( !m_hasBgCol, _T("we have invalid explicit bg colour?") ); + wxASSERT_MSG( !m_hasBgCol, wxT("we have invalid explicit bg colour?") ); // get our default background colour wxColour colBg = GetDefaultAttributes().colBg; @@ -1387,7 +1387,7 @@ wxFont wxWindowBase::GetFont() const // logic is the same as in GetBackgroundColour() if ( !m_font.IsOk() ) { - wxASSERT_MSG( !m_hasFont, _T("we have invalid explicit font?") ); + wxASSERT_MSG( !m_hasFont, wxT("we have invalid explicit font?") ); wxFont font = GetDefaultAttributes().font; if ( !font.IsOk() ) @@ -2057,7 +2057,7 @@ void wxWindowBase::SetContainingSizer(wxSizer* sizer) // associated wxSizerItem we're going to dereference a dangling // pointer; so try to detect this as early as possible wxASSERT_MSG( !sizer || m_containingSizer != sizer, - _T("Adding a window to the same sizer twice?") ); + wxT("Adding a window to the same sizer twice?") ); m_containingSizer = sizer; } @@ -2751,9 +2751,9 @@ bool wxWindowBase::ms_winCaptureChanging = false; void wxWindowBase::CaptureMouse() { - wxLogTrace(_T("mousecapture"), _T("CaptureMouse(%p)"), static_cast(this)); + wxLogTrace(wxT("mousecapture"), wxT("CaptureMouse(%p)"), static_cast(this)); - wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive CaptureMouse call?") ); + wxASSERT_MSG( !ms_winCaptureChanging, wxT("recursive CaptureMouse call?") ); ms_winCaptureChanging = true; @@ -2778,9 +2778,9 @@ void wxWindowBase::CaptureMouse() void wxWindowBase::ReleaseMouse() { - wxLogTrace(_T("mousecapture"), _T("ReleaseMouse(%p)"), static_cast(this)); + wxLogTrace(wxT("mousecapture"), wxT("ReleaseMouse(%p)"), static_cast(this)); - wxASSERT_MSG( !ms_winCaptureChanging, _T("recursive ReleaseMouse call?") ); + wxASSERT_MSG( !ms_winCaptureChanging, wxT("recursive ReleaseMouse call?") ); wxASSERT_MSG( GetCapture() == this, "attempt to release mouse, but this window hasn't captured it" ); @@ -2805,8 +2805,8 @@ void wxWindowBase::ReleaseMouse() ms_winCaptureChanging = false; - wxLogTrace(_T("mousecapture"), - (const wxChar *) _T("After ReleaseMouse() mouse is captured by %p"), + wxLogTrace(wxT("mousecapture"), + (const wxChar *) wxT("After ReleaseMouse() mouse is captured by %p"), static_cast(GetCapture())); } @@ -2820,7 +2820,7 @@ static void DoNotifyWindowAboutCaptureLost(wxWindow *win) // correctly if it loses capture unexpectedly; see the discussion here: // http://sourceforge.net/tracker/index.php?func=detail&aid=1153662&group_id=9863&atid=109863 // http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/82376 - wxFAIL_MSG( _T("window that captured the mouse didn't process wxEVT_MOUSE_CAPTURE_LOST") ); + wxFAIL_MSG( wxT("window that captured the mouse didn't process wxEVT_MOUSE_CAPTURE_LOST") ); } } @@ -2925,11 +2925,11 @@ bool wxWindowBase::TryAfter(wxEvent& event) wxWindow *wxWindowBase::DoGetSibling(WindowOrder order) const { wxCHECK_MSG( GetParent(), NULL, - _T("GetPrev/NextSibling() don't work for TLWs!") ); + wxT("GetPrev/NextSibling() don't work for TLWs!") ); wxWindowList& siblings = GetParent()->GetChildren(); wxWindowList::compatibility_iterator i = siblings.Find((wxWindow *)this); - wxCHECK_MSG( i, NULL, _T("window not a child of its parent?") ); + wxCHECK_MSG( i, NULL, wxT("window not a child of its parent?") ); if ( order == OrderBefore ) i = i->GetPrevious(); @@ -2983,7 +2983,7 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, WindowOrder move) { // check that we're not a top level window wxCHECK_RET( GetParent(), - _T("MoveBefore/AfterInTabOrder() don't work for TLWs!") ); + wxT("MoveBefore/AfterInTabOrder() don't work for TLWs!") ); // detect the special case when we have nothing to do anyhow and when the // code below wouldn't work @@ -2993,7 +2993,7 @@ void wxWindowBase::DoMoveInTabOrder(wxWindow *win, WindowOrder move) // find the target window in the siblings list wxWindowList& siblings = GetParent()->GetChildren(); wxWindowList::compatibility_iterator i = siblings.Find(win); - wxCHECK_RET( i, _T("MoveBefore/AfterInTabOrder(): win is not a sibling") ); + wxCHECK_RET( i, wxT("MoveBefore/AfterInTabOrder(): win is not a sibling") ); // unfortunately, when wxUSE_STL == 1 DetachNode() is not implemented so we // can't just move the node around diff --git a/src/common/windowid.cpp b/src/common/windowid.cpp index a254d023d7..c4f16f0e82 100644 --- a/src/common/windowid.cpp +++ b/src/common/windowid.cpp @@ -25,7 +25,7 @@ // Not needed, included in defs.h // #include "wx/windowid.h" -#define wxTRACE_WINDOWID _T("windowid") +#define wxTRACE_WINDOWID wxT("windowid") namespace { diff --git a/src/common/wxcrt.cpp b/src/common/wxcrt.cpp index bd30db8770..0362f8f28e 100644 --- a/src/common/wxcrt.cpp +++ b/src/common/wxcrt.cpp @@ -255,14 +255,14 @@ int /* not wint_t */ wxCRT_FputcW(wchar_t wc, FILE *stream) // TODO: implement the scanf() functions static int vwscanf(const wchar_t *format, va_list argptr) { - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( wxT("TODO") ); return -1; } static int vfwscanf(FILE *stream, const wchar_t *format, va_list argptr) { - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( wxT("TODO") ); return -1; } @@ -299,10 +299,10 @@ static int vswscanf(const wchar_t *ws, const wchar_t *format, va_list argptr) // of the function. This doesn't work with %c and %s because of difference // in size of char and wchar_t, though. - wxCHECK_MSG( wxStrstr(format, _T("%s")) == NULL, -1, - _T("incomplete vswscanf implementation doesn't allow %s") ); - wxCHECK_MSG( wxStrstr(format, _T("%c")) == NULL, -1, - _T("incomplete vswscanf implementation doesn't allow %c") ); + wxCHECK_MSG( wxStrstr(format, wxT("%s")) == NULL, -1, + wxT("incomplete vswscanf implementation doesn't allow %s") ); + wxCHECK_MSG( wxStrstr(format, wxT("%c")) == NULL, -1, + wxT("incomplete vswscanf implementation doesn't allow %c") ); return vsscanf(static_cast(wxConvLibc.cWX2MB(ws)), wxConvLibc.cWX2MB(format), argptr); @@ -649,7 +649,7 @@ in DMC 8.49 and 8.50 I don't see it being used in the wxWidgets sources at present (oct 2007) CE */ #pragma message ( "warning ::::: wxVsprintf(wchar_t *str, const wxString& format, va_list argptr) not yet implemented" ) - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( wxT("TODO") ); return -1; #else @@ -1222,7 +1222,7 @@ void wxUpdateLocaleIsUtf8() #if wxUSE_UTF8_LOCALE_ONLY if ( !wxIsLocaleUtf8() ) { - wxLogFatalError(_T("This program requires UTF-8 locale to run.")); + wxLogFatalError(wxT("This program requires UTF-8 locale to run.")); } #else // !wxUSE_UTF8_LOCALE_ONLY wxLocaleIsUtf8 = wxIsLocaleUtf8(); diff --git a/src/common/xti.cpp b/src/common/xti.cpp index 04e166170d..a924d13fda 100644 --- a/src/common/xti.cpp +++ b/src/common/xti.cpp @@ -114,13 +114,13 @@ const wxChar * wxEnumData::GetEnumMemberNameByIndex( int idx ) const template<> void wxStringReadValue(const wxString &s , bool &data ) { int intdata ; - wxSscanf(s, _T("%d"), &intdata ) ; + wxSscanf(s, wxT("%d"), &intdata ) ; data = (bool)intdata ; } template<> void wxStringWriteValue(wxString &s , const bool &data ) { - s = wxString::Format(_T("%d"), data ) ; + s = wxString::Format(wxT("%d"), data ) ; } // char @@ -128,13 +128,13 @@ template<> void wxStringWriteValue(wxString &s , const bool &data ) template<> void wxStringReadValue(const wxString &s , char &data ) { int intdata ; - wxSscanf(s, _T("%d"), &intdata ) ; + wxSscanf(s, wxT("%d"), &intdata ) ; data = char(intdata) ; } template<> void wxStringWriteValue(wxString &s , const char &data ) { - s = wxString::Format(_T("%d"), data ) ; + s = wxString::Format(wxT("%d"), data ) ; } // unsigned char @@ -142,85 +142,85 @@ template<> void wxStringWriteValue(wxString &s , const char &data ) template<> void wxStringReadValue(const wxString &s , unsigned char &data ) { int intdata ; - wxSscanf(s, _T("%d"), &intdata ) ; + wxSscanf(s, wxT("%d"), &intdata ) ; data = (unsigned char)(intdata) ; } template<> void wxStringWriteValue(wxString &s , const unsigned char &data ) { - s = wxString::Format(_T("%d"), data ) ; + s = wxString::Format(wxT("%d"), data ) ; } // int template<> void wxStringReadValue(const wxString &s , int &data ) { - wxSscanf(s, _T("%d"), &data ) ; + wxSscanf(s, wxT("%d"), &data ) ; } template<> void wxStringWriteValue(wxString &s , const int &data ) { - s = wxString::Format(_T("%d"), data ) ; + s = wxString::Format(wxT("%d"), data ) ; } // unsigned int template<> void wxStringReadValue(const wxString &s , unsigned int &data ) { - wxSscanf(s, _T("%d"), &data ) ; + wxSscanf(s, wxT("%d"), &data ) ; } template<> void wxStringWriteValue(wxString &s , const unsigned int &data ) { - s = wxString::Format(_T("%d"), data ) ; + s = wxString::Format(wxT("%d"), data ) ; } // long template<> void wxStringReadValue(const wxString &s , long &data ) { - wxSscanf(s, _T("%ld"), &data ) ; + wxSscanf(s, wxT("%ld"), &data ) ; } template<> void wxStringWriteValue(wxString &s , const long &data ) { - s = wxString::Format(_T("%ld"), data ) ; + s = wxString::Format(wxT("%ld"), data ) ; } // unsigned long template<> void wxStringReadValue(const wxString &s , unsigned long &data ) { - wxSscanf(s, _T("%ld"), &data ) ; + wxSscanf(s, wxT("%ld"), &data ) ; } template<> void wxStringWriteValue(wxString &s , const unsigned long &data ) { - s = wxString::Format(_T("%ld"), data ) ; + s = wxString::Format(wxT("%ld"), data ) ; } // float template<> void wxStringReadValue(const wxString &s , float &data ) { - wxSscanf(s, _T("%f"), &data ) ; + wxSscanf(s, wxT("%f"), &data ) ; } template<> void wxStringWriteValue(wxString &s , const float &data ) { - s = wxString::Format(_T("%f"), data ) ; + s = wxString::Format(wxT("%f"), data ) ; } // double template<> void wxStringReadValue(const wxString &s , double &data ) { - wxSscanf(s, _T("%lf"), &data ) ; + wxSscanf(s, wxT("%lf"), &data ) ; } template<> void wxStringWriteValue(wxString &s , const double &data ) { - s = wxString::Format(_T("%lf"), data ) ; + s = wxString::Format(wxT("%lf"), data ) ; } // wxString diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index ff886b0770..4282806175 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -151,9 +151,9 @@ wxZipClassFactory::wxZipClassFactory() const wxChar * const * wxZipClassFactory::GetProtocols(wxStreamProtocolType type) const { - static const wxChar *protocols[] = { _T("zip"), NULL }; - static const wxChar *mimetypes[] = { _T("application/zip"), NULL }; - static const wxChar *fileexts[] = { _T(".zip"), _T(".htb"), NULL }; + static const wxChar *protocols[] = { wxT("zip"), NULL }; + static const wxChar *mimetypes[] = { wxT("application/zip"), NULL }; + static const wxChar *fileexts[] = { wxT(".zip"), wxT(".htb"), NULL }; static const wxChar *empty[] = { NULL }; switch (type) { @@ -200,7 +200,7 @@ wxZipHeader::wxZipHeader(wxInputStream& stream, size_t size) m_pos(0), m_ok(false) { - wxCHECK_RET(size <= sizeof(m_data), _T("buffer too small")); + wxCHECK_RET(size <= sizeof(m_data), wxT("buffer too small")); m_size = stream.Read(m_data, size).LastRead(); m_ok = m_size == size; } @@ -786,15 +786,15 @@ wxString wxZipEntry::GetName(wxPathFormat format /*=wxPATH_NATIVE*/) const switch (wxFileName::GetFormat(format)) { case wxPATH_DOS: { - wxString name(isDir ? m_Name + _T("\\") : m_Name); + wxString name(isDir ? m_Name + wxT("\\") : m_Name); for (size_t i = 0; i < name.length(); i++) - if (name[i] == _T('/')) - name[i] = _T('\\'); + if (name[i] == wxT('/')) + name[i] = wxT('\\'); return name; } case wxPATH_UNIX: - return isDir ? m_Name + _T("/") : m_Name; + return isDir ? m_Name + wxT("/") : m_Name; default: ; @@ -834,9 +834,9 @@ wxString wxZipEntry::GetInternalName(const wxString& name, while (!internal.empty() && *internal.begin() == '/') internal.erase(0, 1); - while (!internal.empty() && internal.compare(0, 2, _T("./")) == 0) + while (!internal.empty() && internal.compare(0, 2, wxT("./")) == 0) internal.erase(0, 2); - if (internal == _T(".") || internal == _T("..")) + if (internal == wxT(".") || internal == wxT("..")) internal = wxEmptyString; return internal; diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp index 13b29c1782..cb2ba6c4fa 100644 --- a/src/common/zstream.cpp +++ b/src/common/zstream.cpp @@ -60,8 +60,8 @@ wxZlibClassFactory::wxZlibClassFactory() const wxChar * const * wxZlibClassFactory::GetProtocols(wxStreamProtocolType type) const { - static const wxChar *mimes[] = { _T("application/x-deflate"), NULL }; - static const wxChar *encs[] = { _T("deflate"), NULL }; + static const wxChar *mimes[] = { wxT("application/x-deflate"), NULL }; + static const wxChar *encs[] = { wxT("deflate"), NULL }; static const wxChar *empty[] = { NULL }; switch (type) { @@ -89,13 +89,13 @@ const wxChar * const * wxGzipClassFactory::GetProtocols(wxStreamProtocolType type) const { static const wxChar *protos[] = - { _T("gzip"), NULL }; + { wxT("gzip"), NULL }; static const wxChar *mimes[] = - { _T("application/gzip"), _T("application/x-gzip"), NULL }; + { wxT("application/gzip"), wxT("application/x-gzip"), NULL }; static const wxChar *encs[] = - { _T("gzip"), NULL }; + { wxT("gzip"), NULL }; static const wxChar *exts[] = - { _T(".gz"), _T(".gzip"), NULL }; + { wxT(".gz"), wxT(".gzip"), NULL }; static const wxChar *empty[] = { NULL }; diff --git a/src/dfb/brush.cpp b/src/dfb/brush.cpp index e636ecc33e..87ba89e309 100644 --- a/src/dfb/brush.cpp +++ b/src/dfb/brush.cpp @@ -91,14 +91,14 @@ bool wxBrush::operator==(const wxBrush& brush) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } diff --git a/src/dfb/fontmgr.cpp b/src/dfb/fontmgr.cpp index 28f954ac5c..817b4f5572 100644 --- a/src/dfb/fontmgr.cpp +++ b/src/dfb/fontmgr.cpp @@ -143,7 +143,7 @@ void wxFontsManager::AddAllFonts() { wxString path; if ( !wxGetEnv("WXDFB_FONTPATH", &path) ) - path = _T(wxINSTALL_PREFIX "/share/wx/fonts"); + path = wxT(wxINSTALL_PREFIX "/share/wx/fonts"); wxStringTokenizer tkn(path, wxPATH_SEP); while ( tkn.HasMoreTokens() ) diff --git a/src/dfb/window.cpp b/src/dfb/window.cpp index e97567ebe3..6fed4e69f4 100644 --- a/src/dfb/window.cpp +++ b/src/dfb/window.cpp @@ -801,7 +801,7 @@ void wxWindowDFB::RemoveOverlay(wxOverlayImpl *overlay) #define KEY(dfb, wx) \ case dfb: \ wxLogTrace(TRACE_EVENTS, \ - _T("key " #dfb " mapped to " #wx)); \ + wxT("key " #dfb " mapped to " #wx)); \ return wx // returns translated keycode, i.e. the one for KEYUP/KEYDOWN where 'a'..'z' is diff --git a/src/dfb/wrapdfb.cpp b/src/dfb/wrapdfb.cpp index c474b48e2b..eb7f3e8c1c 100644 --- a/src/dfb/wrapdfb.cpp +++ b/src/dfb/wrapdfb.cpp @@ -36,7 +36,7 @@ bool wxDfbCheckReturn(DFBResult code) // these are programming errors, assert: #define DFB_ASSERT(code) \ case code: \ - wxFAIL_MSG( "DirectFB error: " _T(#code) ); \ + wxFAIL_MSG( "DirectFB error: " wxT(#code) ); \ return false \ DFB_ASSERT(DFB_DEAD); diff --git a/src/expat/xmlwf/win32filemap.c b/src/expat/xmlwf/win32filemap.c index 41dc35b614..d1fe3f0d3d 100644 --- a/src/expat/xmlwf/win32filemap.c +++ b/src/expat/xmlwf/win32filemap.c @@ -45,7 +45,7 @@ filemap(const TCHAR *name, return 0; } if (sizeHi) { - _ftprintf(stderr, _T("%s: bigger than 2Gb\n"), name); + _ftprintf(stderr, wxT("%s: bigger than 2Gb\n"), name); return 0; } /* CreateFileMapping barfs on zero length files */ @@ -87,10 +87,10 @@ win32perror(const TCHAR *s) (LPTSTR) &buf, 0, NULL)) { - _ftprintf(stderr, _T("%s: %s"), s, buf); + _ftprintf(stderr, wxT("%s: %s"), s, buf); fflush(stderr); LocalFree(buf); } else - _ftprintf(stderr, _T("%s: unknown Windows error\n"), s); + _ftprintf(stderr, wxT("%s: unknown Windows error\n"), s); } diff --git a/src/expat/xmlwf/xmlwin32url.cxx b/src/expat/xmlwf/xmlwin32url.cxx index bbfcce22c9..b64c33d7e1 100644 --- a/src/expat/xmlwf/xmlwin32url.cxx +++ b/src/expat/xmlwf/xmlwin32url.cxx @@ -127,13 +127,13 @@ reportError(XML_Parser parser) int code = XML_GetErrorCode(parser); const XML_Char *message = XML_ErrorString(code); if (message) - _ftprintf(stderr, _T("%s:%d:%ld: %s\n"), + _ftprintf(stderr, wxT("%s:%d:%ld: %s\n"), XML_GetBase(parser), XML_GetErrorLineNumber(parser), XML_GetErrorColumnNumber(parser), message); else - _ftprintf(stderr, _T("%s: (unknown message %d)\n"), + _ftprintf(stderr, wxT("%s: (unknown message %d)\n"), XML_GetBase(parser), code); } @@ -183,7 +183,7 @@ Callback::OnDataAvailable(DWORD grfBSCF, nToRead = READ_MAX; void *buf = XML_GetBuffer(parser_, nToRead); if (!buf) { - _ftprintf(stderr, _T("out of memory\n")); + _ftprintf(stderr, wxT("out of memory\n")); return E_ABORT; } DWORD nRead; @@ -329,12 +329,12 @@ winPerror(const XML_Char *url, HRESULT hr) 0, NULL)) { /* The system error messages seem to end with a newline. */ - _ftprintf(stderr, _T("%s: %s"), url, buf); + _ftprintf(stderr, wxT("%s: %s"), url, buf); fflush(stderr); LocalFree(buf); } else - _ftprintf(stderr, _T("%s: error %x\n"), url, hr); + _ftprintf(stderr, wxT("%s: error %x\n"), url, hr); } static void diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index 03edc08ab0..60f799b428 100644 --- a/src/generic/aboutdlgg.cpp +++ b/src/generic/aboutdlgg.cpp @@ -51,7 +51,7 @@ static wxString AllAsString(const wxArrayString& a) s.reserve(20*count); for ( size_t n = 0; n < count; n++ ) { - s << a[n] << (n == count - 1 ? _T("\n") : _T(", ")); + s << a[n] << (n == count - 1 ? wxT("\n") : wxT(", ")); } return s; @@ -65,19 +65,19 @@ wxString wxAboutDialogInfo::GetDescriptionAndCredits() const { wxString s = GetDescription(); if ( !s.empty() ) - s << _T('\n'); + s << wxT('\n'); if ( HasDevelopers() ) - s << _T('\n') << _("Developed by ") << AllAsString(GetDevelopers()); + s << wxT('\n') << _("Developed by ") << AllAsString(GetDevelopers()); if ( HasDocWriters() ) - s << _T('\n') << _("Documentation by ") << AllAsString(GetDocWriters()); + s << wxT('\n') << _("Documentation by ") << AllAsString(GetDocWriters()); if ( HasArtists() ) - s << _T('\n') << _("Graphics art by ") << AllAsString(GetArtists()); + s << wxT('\n') << _("Graphics art by ") << AllAsString(GetArtists()); if ( HasTranslators() ) - s << _T('\n') << _("Translations by ") << AllAsString(GetTranslators()); + s << wxT('\n') << _("Translations by ") << AllAsString(GetTranslators()); return s; } @@ -122,7 +122,7 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* paren m_sizerText = new wxBoxSizer(wxVERTICAL); wxString nameAndVersion = info.GetName(); if ( info.HasVersion() ) - nameAndVersion << _T(' ') << info.GetVersion(); + nameAndVersion << wxT(' ') << info.GetVersion(); wxStaticText *label = new wxStaticText(this, wxID_ANY, nameAndVersion); wxFont fontBig(*wxNORMAL_FONT); fontBig.SetPointSize(fontBig.GetPointSize() + 2); @@ -202,8 +202,8 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info, wxWindow* paren void wxGenericAboutDialog::AddControl(wxWindow *win, const wxSizerFlags& flags) { - wxCHECK_RET( m_sizerText, _T("can only be called after Create()") ); - wxASSERT_MSG( win, _T("can't add NULL window to about dialog") ); + wxCHECK_RET( m_sizerText, wxT("can only be called after Create()") ); + wxASSERT_MSG( win, wxT("can't add NULL window to about dialog") ); m_sizerText->Add(win, flags); } diff --git a/src/generic/accel.cpp b/src/generic/accel.cpp index 91c39cd066..29893831fe 100644 --- a/src/generic/accel.cpp +++ b/src/generic/accel.cpp @@ -152,7 +152,7 @@ void wxAcceleratorTable::Remove(const wxAcceleratorEntry& entry) node = node->GetNext(); } - wxFAIL_MSG(_T("deleting inexistent accel from wxAcceleratorTable")); + wxFAIL_MSG(wxT("deleting inexistent accel from wxAcceleratorTable")); } // ---------------------------------------------------------------------------- diff --git a/src/generic/animateg.cpp b/src/generic/animateg.cpp index fe6ee204da..60f79e557c 100644 --- a/src/generic/animateg.cpp +++ b/src/generic/animateg.cpp @@ -186,7 +186,7 @@ void wxAnimation::AddHandler( wxAnimationDecoder *handler ) // a good reason to add and remove duplicate handlers (and they // may) we should probably refcount the duplicates. - wxLogDebug( _T("Adding duplicate animation handler for '%d' type"), + wxLogDebug( wxT("Adding duplicate animation handler for '%d' type"), handler->GetType() ); delete handler; } @@ -202,7 +202,7 @@ void wxAnimation::InsertHandler( wxAnimationDecoder *handler ) else { // see AddHandler for additional comments. - wxLogDebug( _T("Inserting duplicate animation handler for '%d' type"), + wxLogDebug( wxT("Inserting duplicate animation handler for '%d' type"), handler->GetType() ); delete handler; } diff --git a/src/generic/buttonbar.cpp b/src/generic/buttonbar.cpp index c05ef6385b..cf9e0ba75b 100644 --- a/src/generic/buttonbar.cpp +++ b/src/generic/buttonbar.cpp @@ -207,7 +207,7 @@ void wxButtonToolBar::GetRectLimits(const wxRect& rect, wxCoord *start, wxCoord *end) const { - wxCHECK_RET( start && end, _T("NULL pointer in GetRectLimits") ); + wxCHECK_RET( start && end, wxT("NULL pointer in GetRectLimits") ); if ( IsVertical() ) { @@ -226,7 +226,7 @@ void wxButtonToolBar::SetToolShortHelp(int id, const wxString& help) { wxToolBarToolBase *tool = FindById(id); - wxCHECK_RET( tool, _T("SetToolShortHelp: no such tool") ); + wxCHECK_RET( tool, wxT("SetToolShortHelp: no such tool") ); // TODO: set tooltip/short help tool->SetShortHelp(help); @@ -289,7 +289,7 @@ wxRect wxButtonToolBar::GetToolRect(wxToolBarToolBase *toolBase) const wxRect rect; - wxCHECK_MSG( tool, rect, _T("GetToolRect: NULL tool") ); + wxCHECK_MSG( tool, rect, wxT("GetToolRect: NULL tool") ); // ensure that we always have the valid tool position if ( m_needsLayout ) diff --git a/src/generic/calctrlg.cpp b/src/generic/calctrlg.cpp index effd171d21..6d4daae1d7 100644 --- a/src/generic/calctrlg.cpp +++ b/src/generic/calctrlg.cpp @@ -248,11 +248,11 @@ bool wxGenericCalendarCtrl::Create(wxWindow *parent, if ( !HasFlag(wxCAL_SEQUENTIAL_MONTH_SELECTION) ) { CreateYearSpinCtrl(); - m_staticYear = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(_T("%Y")), + m_staticYear = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(wxT("%Y")), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); CreateMonthComboBox(); - m_staticMonth = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(_T("%B")), + m_staticMonth = new wxStaticText(GetParent(), wxID_ANY, m_date.Format(wxT("%B")), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE); } @@ -296,7 +296,7 @@ void wxGenericCalendarCtrl::SetWindowStyleFlag(long style) // created/shown/hidden accordingly wxASSERT_MSG( (style & wxCAL_SEQUENTIAL_MONTH_SELECTION) == (m_windowStyle & wxCAL_SEQUENTIAL_MONTH_SELECTION), - _T("wxCAL_SEQUENTIAL_MONTH_SELECTION can't be changed after creation") ); + wxT("wxCAL_SEQUENTIAL_MONTH_SELECTION can't be changed after creation") ); wxControl::SetWindowStyleFlag(style); } @@ -335,7 +335,7 @@ void wxGenericCalendarCtrl::CreateMonthComboBox() void wxGenericCalendarCtrl::CreateYearSpinCtrl() { m_spinYear = new wxSpinCtrl(GetParent(), wxID_ANY, - GetDate().Format(_T("%Y")), + GetDate().Format(wxT("%Y")), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS | wxCLIP_SIBLINGS, @@ -520,7 +520,7 @@ bool wxGenericCalendarCtrl::SetDate(const wxDateTime& date) if ( AllowYearChange() ) { if ( !m_userChangedYear ) - m_spinYear->SetValue(m_date.Format(_T("%Y"))); + m_spinYear->SetValue(m_date.Format(wxT("%Y"))); } } @@ -1081,7 +1081,7 @@ void wxGenericCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) { // don't use wxDate::Format() which prepends 0s unsigned int day = date.GetDay(); - wxString dayStr = wxString::Format(_T("%u"), day); + wxString dayStr = wxString::Format(wxT("%u"), day); wxCoord width; dc.GetTextExtent(dayStr, &width, NULL); @@ -1176,7 +1176,7 @@ void wxGenericCalendarCtrl::OnPaint(wxPaintEvent& WXUNUSED(event)) break; default: - wxFAIL_MSG(_T("unknown border type")); + wxFAIL_MSG(wxT("unknown border type")); } } @@ -1500,7 +1500,7 @@ void wxGenericCalendarCtrl::OnClick(wxMouseEvent& event) break; default: - wxFAIL_MSG(_T("unknown hittest code")); + wxFAIL_MSG(wxT("unknown hittest code")); // fall through case wxCAL_HITTEST_NOWHERE: @@ -1719,7 +1719,7 @@ void wxGenericCalendarCtrl::OnChar(wxKeyEvent& event) wxDateTime target; switch ( event.GetKeyCode() ) { - case _T('+'): + case wxT('+'): case WXK_ADD: target = m_date + wxDateSpan::Year(); if ( ChangeYear(&target) ) @@ -1728,7 +1728,7 @@ void wxGenericCalendarCtrl::OnChar(wxKeyEvent& event) } break; - case _T('-'): + case wxT('-'): case WXK_SUBTRACT: target = m_date - wxDateSpan::Year(); if ( ChangeYear(&target) ) @@ -1815,7 +1815,7 @@ void wxGenericCalendarCtrl::OnChar(wxKeyEvent& event) void wxGenericCalendarCtrl::SetHoliday(size_t day) { - wxCHECK_RET( day > 0 && day < 32, _T("invalid day in SetHoliday") ); + wxCHECK_RET( day > 0 && day < 32, wxT("invalid day in SetHoliday") ); wxCalendarDateAttr *attr = GetAttr(day); if ( !attr ) @@ -1842,7 +1842,7 @@ void wxGenericCalendarCtrl::ResetHolidayAttrs() void wxGenericCalendarCtrl::Mark(size_t day, bool mark) { - wxCHECK_RET( day > 0 && day < 32, _T("invalid day in Mark") ); + wxCHECK_RET( day > 0 && day < 32, wxT("invalid day in Mark") ); const wxCalendarDateAttr& m = wxCalendarDateAttr::GetMark(); if (mark) { diff --git a/src/generic/choicbkg.cpp b/src/generic/choicbkg.cpp index dc93e2b292..c21023c25b 100644 --- a/src/generic/choicbkg.cpp +++ b/src/generic/choicbkg.cpp @@ -176,14 +176,14 @@ wxString wxChoicebook::GetPageText(size_t n) const int wxChoicebook::GetPageImage(size_t WXUNUSED(n)) const { - wxFAIL_MSG( _T("wxChoicebook::GetPageImage() not implemented") ); + wxFAIL_MSG( wxT("wxChoicebook::GetPageImage() not implemented") ); return wxNOT_FOUND; } bool wxChoicebook::SetPageImage(size_t WXUNUSED(n), int WXUNUSED(imageId)) { - wxFAIL_MSG( _T("wxChoicebook::SetPageImage() not implemented") ); + wxFAIL_MSG( wxT("wxChoicebook::SetPageImage() not implemented") ); return false; } diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 26af4a3b9c..7887465b1c 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -2498,7 +2498,7 @@ void wxDataViewMainWindow::RefreshRowsAfter( unsigned int firstRow ) void wxDataViewMainWindow::OnArrowChar(unsigned int newCurrent, const wxKeyEvent& event) { wxCHECK_RET( newCurrent < GetRowCount(), - _T("invalid item index in OnArrowChar()") ); + wxT("invalid item index in OnArrowChar()") ); // if there is no selection, we cannot move it anywhere if (!HasCurrentRow()) @@ -3398,7 +3398,7 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event ) // don't use m_linesPerPage directly as it might not be computed yet const int pageSize = GetCountPerPage(); - wxCHECK_RET( pageSize, _T("should have non zero page size") ); + wxCHECK_RET( pageSize, wxT("should have non zero page size") ); switch ( event.GetKeyCode() ) { @@ -3845,7 +3845,7 @@ void wxDataViewMainWindow::OnMouse( wxMouseEvent &event ) else // !ctrl, !shift { // test in the enclosing if should make it impossible - wxFAIL_MSG( _T("how did we get here?") ); + wxFAIL_MSG( wxT("how did we get here?") ); } } diff --git a/src/generic/datectlg.cpp b/src/generic/datectlg.cpp index f951b948ea..0d67a6c6ec 100644 --- a/src/generic/datectlg.cpp +++ b/src/generic/datectlg.cpp @@ -110,7 +110,7 @@ public: else // invalid date { wxASSERT_MSG( HasDPFlag(wxDP_ALLOWNONE), - _T("this control must have a valid date") ); + wxT("this control must have a valid date") ); m_combo->SetText(wxEmptyString); } @@ -271,7 +271,7 @@ private: if ( m_combo ) { wxArrayString allowedChars; - for ( wxChar c = _T('0'); c <= _T('9'); c++ ) + for ( wxChar c = wxT('0'); c <= wxT('9'); c++ ) allowedChars.Add(wxString(c, 1)); const wxChar *p2 = m_format.c_str(); @@ -364,7 +364,7 @@ bool wxDatePickerCtrlGeneric::Create(wxWindow *parent, const wxString& name) { wxASSERT_MSG( !(style & wxDP_SPIN), - _T("wxDP_SPIN style not supported, use wxDP_DEFAULT") ); + wxT("wxDP_SPIN style not supported, use wxDP_DEFAULT") ); if ( !wxControl::Create(parent, id, pos, size, style | wxCLIP_CHILDREN | wxWANTS_CHARS | wxBORDER_NONE, diff --git a/src/generic/dbgrptg.cpp b/src/generic/dbgrptg.cpp index d959d0ea4f..4b96e96975 100644 --- a/src/generic/dbgrptg.cpp +++ b/src/generic/dbgrptg.cpp @@ -312,15 +312,15 @@ wxDebugReportDialog::wxDebugReportDialog(wxDebugReport& dbgrpt) debugDir = debugDirFilename.GetPath(); #endif msg << _("A debug report has been generated in the directory\n") - << _T('\n') - << _T(" \"") << debugDir << _T("\"\n") - << _T('\n') + << wxT('\n') + << wxT(" \"") << debugDir << wxT("\"\n") + << wxT('\n') << _("The report contains the files listed below. If any of these files contain private information,\nplease uncheck them and they will be removed from the report.\n") - << _T('\n') + << wxT('\n') << _("If you wish to suppress this debug report completely, please choose the \"Cancel\" button,\nbut be warned that it may hinder improving the program, so if\nat all possible please do continue with the report generation.\n") - << _T('\n') + << wxT('\n') << _(" Thank you and we're sorry for the inconvenience!\n") - << _T("\n\n"); // just some white space to separate from other stuff + << wxT("\n\n"); // just some white space to separate from other stuff const wxSizerFlags flagsFixed(SizerFlags(0)); const wxSizerFlags flagsExpand(SizerFlags(1)); @@ -333,9 +333,9 @@ wxDebugReportDialog::wxDebugReportDialog(wxDebugReport& dbgrpt) // ... and the list of files in this debug report with buttons to view them wxSizer *sizerFileBtns = new wxBoxSizer(wxVERTICAL); sizerFileBtns->AddStretchSpacer(1); - sizerFileBtns->Add(new wxButton(this, wxID_VIEW_DETAILS, _T("&View...")), + sizerFileBtns->Add(new wxButton(this, wxID_VIEW_DETAILS, wxT("&View...")), wxSizerFlags().Border(wxBOTTOM)); - sizerFileBtns->Add(new wxButton(this, wxID_OPEN, _T("&Open...")), + sizerFileBtns->Add(new wxButton(this, wxID_OPEN, wxT("&Open...")), wxSizerFlags().Border(wxTOP)); sizerFileBtns->AddStretchSpacer(1); @@ -386,7 +386,7 @@ bool wxDebugReportDialog::TransferDataToWindow() desc; if ( m_dbgrpt.GetFile(n, &name, &desc) ) { - m_checklst->Append(name + _T(" (") + desc + _T(')')); + m_checklst->Append(name + wxT(" (") + desc + wxT(')')); m_checklst->Check(n); m_files.Add(name); @@ -413,7 +413,7 @@ bool wxDebugReportDialog::TransferDataFromWindow() if ( !notes.empty() ) { // for now filename fixed, could make it configurable in the future... - m_dbgrpt.AddText(_T("notes.txt"), notes, _T("user notes")); + m_dbgrpt.AddText(wxT("notes.txt"), notes, wxT("user notes")); } return true; @@ -426,7 +426,7 @@ bool wxDebugReportDialog::TransferDataFromWindow() void wxDebugReportDialog::OnView(wxCommandEvent& ) { const int sel = m_checklst->GetSelection(); - wxCHECK_RET( sel != wxNOT_FOUND, _T("invalid selection in OnView()") ); + wxCHECK_RET( sel != wxNOT_FOUND, wxT("invalid selection in OnView()") ); wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]); wxString str; @@ -442,7 +442,7 @@ void wxDebugReportDialog::OnView(wxCommandEvent& ) void wxDebugReportDialog::OnOpen(wxCommandEvent& ) { const int sel = m_checklst->GetSelection(); - wxCHECK_RET( sel != wxNOT_FOUND, _T("invalid selection in OnOpen()") ); + wxCHECK_RET( sel != wxNOT_FOUND, wxT("invalid selection in OnOpen()") ); wxFileName fn(m_dbgrpt.GetDirectory(), m_files[sel]); @@ -471,7 +471,7 @@ void wxDebugReportDialog::OnOpen(wxCommandEvent& ) if ( !cmd.empty() ) { #if wxUSE_MIMETYPE - if ( cmd.find(_T('%')) != wxString::npos ) + if ( cmd.find(wxT('%')) != wxString::npos ) { command = wxFileType::ExpandCommand(cmd, fn.GetFullPath()); } @@ -479,7 +479,7 @@ void wxDebugReportDialog::OnOpen(wxCommandEvent& ) #endif // wxUSE_MIMETYPE { // append the file name to the end - command << cmd << _T(" \"") << fn.GetFullPath() << _T('"'); + command << cmd << wxT(" \"") << fn.GetFullPath() << wxT('"'); } } } diff --git a/src/generic/dirctrlg.cpp b/src/generic/dirctrlg.cpp index ee55328f7b..3587660c1c 100644 --- a/src/generic/dirctrlg.cpp +++ b/src/generic/dirctrlg.cpp @@ -1582,14 +1582,14 @@ void wxFileIconsTable::Create() wxART_CMN_DIALOG, wxSize(16, 16))); // executable - if (GetIconID(wxEmptyString, _T("application/x-executable")) == file) + if (GetIconID(wxEmptyString, wxT("application/x-executable")) == file) { m_smallImageList->Add(wxArtProvider::GetBitmap(wxART_EXECUTABLE_FILE, wxART_CMN_DIALOG, wxSize(16, 16))); - delete m_HashTable->Get(_T("exe")); - m_HashTable->Delete(_T("exe")); - m_HashTable->Put(_T("exe"), new wxFileIconEntry(executable)); + delete m_HashTable->Get(wxT("exe")); + m_HashTable->Delete(wxT("exe")); + m_HashTable->Put(wxT("exe"), new wxFileIconEntry(executable)); } /* else put into list by GetIconID (KDE defines application/x-executable for *.exe and has nice icon) diff --git a/src/generic/editlbox.cpp b/src/generic/editlbox.cpp index 204e28908a..f0dc3af9b4 100644 --- a/src/generic/editlbox.cpp +++ b/src/generic/editlbox.cpp @@ -160,7 +160,7 @@ public: void CreateColumns() { - InsertColumn(0, _T("item")); + InsertColumn(0, wxT("item")); SizeColumns(); } diff --git a/src/generic/fdrepdlg.cpp b/src/generic/fdrepdlg.cpp index 157ee8a1b5..f9dd9b24d6 100644 --- a/src/generic/fdrepdlg.cpp +++ b/src/generic/fdrepdlg.cpp @@ -100,7 +100,7 @@ bool wxGenericFindReplaceDialog::Create(wxWindow *parent, SetData(data); wxCHECK_MSG( m_FindReplaceData, false, - _T("can't create dialog without data") ); + wxT("can't create dialog without data") ); bool isPda = (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA); diff --git a/src/generic/filectrlg.cpp b/src/generic/filectrlg.cpp index 4e3730f466..88a7adff68 100644 --- a/src/generic/filectrlg.cpp +++ b/src/generic/filectrlg.cpp @@ -244,25 +244,25 @@ void wxFileData::ReadData() // __WXWINCE__ #if defined(__UNIX__) - m_permissions.Printf(_T("%c%c%c%c%c%c%c%c%c"), - buff.st_mode & wxS_IRUSR ? _T('r') : _T('-'), - buff.st_mode & wxS_IWUSR ? _T('w') : _T('-'), - buff.st_mode & wxS_IXUSR ? _T('x') : _T('-'), - buff.st_mode & wxS_IRGRP ? _T('r') : _T('-'), - buff.st_mode & wxS_IWGRP ? _T('w') : _T('-'), - buff.st_mode & wxS_IXGRP ? _T('x') : _T('-'), - buff.st_mode & wxS_IROTH ? _T('r') : _T('-'), - buff.st_mode & wxS_IWOTH ? _T('w') : _T('-'), - buff.st_mode & wxS_IXOTH ? _T('x') : _T('-')); + m_permissions.Printf(wxT("%c%c%c%c%c%c%c%c%c"), + buff.st_mode & wxS_IRUSR ? wxT('r') : wxT('-'), + buff.st_mode & wxS_IWUSR ? wxT('w') : wxT('-'), + buff.st_mode & wxS_IXUSR ? wxT('x') : wxT('-'), + buff.st_mode & wxS_IRGRP ? wxT('r') : wxT('-'), + buff.st_mode & wxS_IWGRP ? wxT('w') : wxT('-'), + buff.st_mode & wxS_IXGRP ? wxT('x') : wxT('-'), + buff.st_mode & wxS_IROTH ? wxT('r') : wxT('-'), + buff.st_mode & wxS_IWOTH ? wxT('w') : wxT('-'), + buff.st_mode & wxS_IXOTH ? wxT('x') : wxT('-')); #elif defined(__WIN32__) DWORD attribs = ::GetFileAttributes(m_filePath.c_str()); if (attribs != (DWORD)-1) { - m_permissions.Printf(_T("%c%c%c%c"), - attribs & FILE_ATTRIBUTE_ARCHIVE ? _T('A') : _T(' '), - attribs & FILE_ATTRIBUTE_READONLY ? _T('R') : _T(' '), - attribs & FILE_ATTRIBUTE_HIDDEN ? _T('H') : _T(' '), - attribs & FILE_ATTRIBUTE_SYSTEM ? _T('S') : _T(' ')); + m_permissions.Printf(wxT("%c%c%c%c"), + attribs & FILE_ATTRIBUTE_ARCHIVE ? wxT('A') : wxT(' '), + attribs & FILE_ATTRIBUTE_READONLY ? wxT('R') : wxT(' '), + attribs & FILE_ATTRIBUTE_HIDDEN ? wxT('H') : wxT(' '), + attribs & FILE_ATTRIBUTE_SYSTEM ? wxT('S') : wxT(' ')); } #endif @@ -356,7 +356,7 @@ wxString wxFileData::GetEntry( fileListFieldType num ) const #endif // defined(__UNIX__) || defined(__WIN32__) default: - wxFAIL_MSG( _T("unexpected field in wxFileData::GetEntry()") ); + wxFAIL_MSG( wxT("unexpected field in wxFileData::GetEntry()") ); } return s; @@ -381,7 +381,7 @@ void wxFileData::MakeItem( wxListItem &item ) if (IsLink()) { - wxColour dg = wxTheColourDatabase->Find( _T("MEDIUM GREY") ); + wxColour dg = wxTheColourDatabase->Find( wxT("MEDIUM GREY") ); if ( dg.Ok() ) item.SetTextColour(dg); } @@ -1182,7 +1182,7 @@ void wxGenericFileCtrl::DoSetFilterIndex( int filterindex ) if ( str.Left( 2 ) == wxT( "*." ) ) { m_filterExtension = str.Mid( 1 ); - if ( m_filterExtension == _T( ".*" ) ) + if ( m_filterExtension == wxT( ".*" ) ) m_filterExtension.clear(); } else diff --git a/src/generic/fontdlgg.cpp b/src/generic/fontdlgg.cpp index 2fc244125e..12125d5c16 100644 --- a/src/generic/fontdlgg.cpp +++ b/src/generic/fontdlgg.cpp @@ -284,9 +284,9 @@ bool wxGenericFontDialog::DoCreate(wxWindow *parent) { parent = GetParentForModalDialog(parent); - if ( !wxDialog::Create( parent , wxID_ANY , _T("Choose Font") , + if ( !wxDialog::Create( parent , wxID_ANY , wxT("Choose Font") , wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, - _T("fontdialog") ) ) + wxT("fontdialog") ) ) { wxFAIL_MSG( wxT("wxFontDialog creation failed") ); return false; diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index dccf054460..6cd125e280 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -1015,7 +1015,7 @@ wxString wxGridTableBase::GetColLabelValue( int col ) unsigned int i, n; for ( n = 1; ; n++ ) { - s += (wxChar) (_T('A') + (wxChar)(col % 26)); + s += (wxChar) (wxT('A') + (wxChar)(col % 26)); col = col / 26 - 1; if ( col < 0 ) break; @@ -1146,7 +1146,7 @@ wxString wxGridStringTable::GetValue( int row, int col ) { wxCHECK_MSG( (row < GetNumberRows()) && (col < GetNumberCols()), wxEmptyString, - _T("invalid row or column index in wxGridStringTable") ); + wxT("invalid row or column index in wxGridStringTable") ); return m_data[row][col]; } @@ -1154,7 +1154,7 @@ wxString wxGridStringTable::GetValue( int row, int col ) void wxGridStringTable::SetValue( int row, int col, const wxString& value ) { wxCHECK_RET( (row < GetNumberRows()) && (col < GetNumberCols()), - _T("invalid row or column index in wxGridStringTable") ); + wxT("invalid row or column index in wxGridStringTable") ); m_data[row][col] = value; } @@ -1806,7 +1806,7 @@ wxGrid::~wxGrid() #ifdef DEBUG_ATTR_CACHE size_t total = gs_nAttrCacheHits + gs_nAttrCacheMisses; - wxPrintf(_T("wxGrid attribute cache statistics: " + wxPrintf(wxT("wxGrid attribute cache statistics: " "total: %u, hits: %u (%u%%)\n"), total, gs_nAttrCacheHits, total ? (gs_nAttrCacheHits*100) / total : 0); @@ -3456,19 +3456,19 @@ void wxGrid::ChangeCursorMode(CursorMode mode, #if wxUSE_LOG_TRACE static const wxChar *cursorModes[] = { - _T("SELECT_CELL"), - _T("RESIZE_ROW"), - _T("RESIZE_COL"), - _T("SELECT_ROW"), - _T("SELECT_COL"), - _T("MOVE_COL"), + wxT("SELECT_CELL"), + wxT("RESIZE_ROW"), + wxT("RESIZE_COL"), + wxT("SELECT_ROW"), + wxT("SELECT_COL"), + wxT("MOVE_COL"), }; - wxLogTrace(_T("grid"), - _T("wxGrid cursor mode (mouse capture for %s): %s -> %s"), - win == m_colWindow ? _T("colLabelWin") - : win ? _T("rowLabelWin") - : _T("gridWin"), + wxLogTrace(wxT("grid"), + wxT("wxGrid cursor mode (mouse capture for %s): %s -> %s"), + win == m_colWindow ? wxT("colLabelWin") + : win ? wxT("rowLabelWin") + : wxT("gridWin"), cursorModes[m_cursorMode], cursorModes[mode]); #endif // wxUSE_LOG_TRACE @@ -5711,7 +5711,7 @@ void wxGrid::EnableCellEditControl( bool enable ) return; // this should be checked by the caller! - wxASSERT_MSG( CanEnableCellControl(), _T("can't enable editing for this cell!") ); + wxASSERT_MSG( CanEnableCellControl(), wxT("can't enable editing for this cell!") ); // do it before ShowCellEditControl() m_cellEditCtrlEnabled = enable; @@ -6868,7 +6868,7 @@ int wxGrid::GetDefaultRowSize() const int wxGrid::GetRowSize( int row ) const { - wxCHECK_MSG( row >= 0 && row < m_numRows, 0, _T("invalid row index") ); + wxCHECK_MSG( row >= 0 && row < m_numRows, 0, wxT("invalid row index") ); return GetRowHeight(row); } @@ -6880,7 +6880,7 @@ int wxGrid::GetDefaultColSize() const int wxGrid::GetColSize( int col ) const { - wxCHECK_MSG( col >= 0 && col < m_numCols, 0, _T("invalid column index") ); + wxCHECK_MSG( col >= 0 && col < m_numCols, 0, wxT("invalid column index") ); return GetColWidth(col); } @@ -7160,8 +7160,8 @@ wxGridCellAttr *wxGrid::GetOrCreateCellAttr(int row, int col) const wxGridCellAttr *attr = NULL; bool canHave = ((wxGrid*)this)->CanHaveAttributes(); - wxCHECK_MSG( canHave, attr, _T("Cell attributes not allowed")); - wxCHECK_MSG( m_table, attr, _T("must have a table") ); + wxCHECK_MSG( canHave, attr, wxT("Cell attributes not allowed")); + wxCHECK_MSG( m_table, attr, wxT("must have a table") ); attr = m_table->GetAttr(row, col, wxGridCellAttr::Cell); if ( !attr ) @@ -7195,7 +7195,7 @@ void wxGrid::SetColFormatFloat(int col, int width, int precision) wxString typeName = wxGRID_VALUE_FLOAT; if ( (width != -1) || (precision != -1) ) { - typeName << _T(':') << width << _T(',') << precision; + typeName << wxT(':') << width << wxT(',') << precision; } SetColFormatCustom(col, typeName); @@ -7506,7 +7506,7 @@ void wxGrid::SetDefaultRowSize( int height, bool resizeExistingRows ) void wxGrid::SetRowSize( int row, int height ) { - wxCHECK_RET( row >= 0 && row < m_numRows, _T("invalid row index") ); + wxCHECK_RET( row >= 0 && row < m_numRows, wxT("invalid row index") ); // if < 0 then calculate new height from label if ( height < 0 ) @@ -7564,7 +7564,7 @@ void wxGrid::SetDefaultColSize( int width, bool resizeExistingCols ) void wxGrid::SetColSize( int col, int width ) { - wxCHECK_RET( col >= 0 && col < m_numCols, _T("invalid column index") ); + wxCHECK_RET( col >= 0 && col < m_numCols, wxT("invalid column index") ); // if < 0 then calculate new width from label if ( width < 0 ) @@ -8552,7 +8552,7 @@ int wxGridTypeRegistry::FindOrCloneDataType(const wxString& typeName) { // the first part of the typename is the "real" type, anything after ':' // are the parameters for the renderer - index = FindDataType(typeName.BeforeFirst(_T(':'))); + index = FindDataType(typeName.BeforeFirst(wxT(':'))); if ( index == wxNOT_FOUND ) { return wxNOT_FOUND; @@ -8569,7 +8569,7 @@ int wxGridTypeRegistry::FindOrCloneDataType(const wxString& typeName) editorOld->DecRef(); // do it even if there are no parameters to reset them to defaults - wxString params = typeName.AfterFirst(_T(':')); + wxString params = typeName.AfterFirst(wxT(':')); renderer->SetParameters(params); editor->SetParameters(params); diff --git a/src/generic/gridctrl.cpp b/src/generic/gridctrl.cpp index 54a79a9b0d..50a265d8c7 100644 --- a/src/generic/gridctrl.cpp +++ b/src/generic/gridctrl.cpp @@ -198,7 +198,7 @@ wxString wxGridCellEnumRenderer::GetString(const wxGrid& grid, int row, int col) if ( table->CanGetValueAs(row, col, wxGRID_VALUE_NUMBER) ) { int choiceno = table->GetValueAsLong(row, col); - text.Printf(_T("%s"), m_choices[ choiceno ].c_str() ); + text.Printf(wxT("%s"), m_choices[ choiceno ].c_str() ); } else { @@ -250,7 +250,7 @@ void wxGridCellEnumRenderer::SetParameters(const wxString& params) m_choices.Empty(); - wxStringTokenizer tk(params, _T(',')); + wxStringTokenizer tk(params, wxT(',')); while ( tk.HasMoreTokens() ) { m_choices.Add(tk.GetNextToken()); @@ -305,7 +305,7 @@ wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid, wxCoord max_x = rect.GetWidth(); dc.SetFont(attr.GetFont()); - wxStringTokenizer tk(data , _T(" \n\t\r")); + wxStringTokenizer tk(data , wxT(" \n\t\r")); wxString thisline = wxEmptyString; while ( tk.HasMoreTokens() ) @@ -315,7 +315,7 @@ wxGridCellAutoWrapStringRenderer::GetTextLines(wxGrid& grid, // space at the end of the line. But it // is invisible , simplifies the size calculation // and ensures tokens are separated in the display - tok += _T(" "); + tok += wxT(" "); dc.GetTextExtent(tok, &x, &y); if ( curr_x + x > max_x) @@ -425,7 +425,7 @@ wxSize wxGridCellStringRenderer::DoGetBestSize(const wxGridCellAttr& attr, { wxCoord x = 0, y = 0, max_x = 0; dc.SetFont(attr.GetFont()); - wxStringTokenizer tk(text, _T('\n')); + wxStringTokenizer tk(text, wxT('\n')); while ( tk.HasMoreTokens() ) { dc.GetTextExtent(tk.GetNextToken(), &x, &y); @@ -554,7 +554,7 @@ wxString wxGridCellNumberRenderer::GetString(const wxGrid& grid, int row, int co wxString text; if ( table->CanGetValueAs(row, col, wxGRID_VALUE_NUMBER) ) { - text.Printf(_T("%ld"), table->GetValueAsLong(row, col)); + text.Printf(wxT("%ld"), table->GetValueAsLong(row, col)); } else { @@ -641,21 +641,21 @@ wxString wxGridCellFloatRenderer::GetString(const wxGrid& grid, int row, int col if ( m_precision == -1 ) { // default width/precision - m_format = _T("%f"); + m_format = wxT("%f"); } else { - m_format.Printf(_T("%%.%df"), m_precision); + m_format.Printf(wxT("%%.%df"), m_precision); } } else if ( m_precision == -1 ) { // default precision - m_format.Printf(_T("%%%d.f"), m_width); + m_format.Printf(wxT("%%%d.f"), m_width); } else { - m_format.Printf(_T("%%%d.%df"), m_width, m_precision); + m_format.Printf(wxT("%%%d.%df"), m_width, m_precision); } } @@ -707,7 +707,7 @@ void wxGridCellFloatRenderer::SetParameters(const wxString& params) } else { - wxString tmp = params.BeforeFirst(_T(',')); + wxString tmp = params.BeforeFirst(wxT(',')); if ( !tmp.empty() ) { long width; @@ -717,11 +717,11 @@ void wxGridCellFloatRenderer::SetParameters(const wxString& params) } else { - wxLogDebug(_T("Invalid wxGridCellFloatRenderer width parameter string '%s ignored"), params.c_str()); + wxLogDebug(wxT("Invalid wxGridCellFloatRenderer width parameter string '%s ignored"), params.c_str()); } } - tmp = params.AfterFirst(_T(',')); + tmp = params.AfterFirst(wxT(',')); if ( !tmp.empty() ) { long precision; @@ -731,7 +731,7 @@ void wxGridCellFloatRenderer::SetParameters(const wxString& params) } else { - wxLogDebug(_T("Invalid wxGridCellFloatRenderer precision parameter string '%s ignored"), params.c_str()); + wxLogDebug(wxT("Invalid wxGridCellFloatRenderer precision parameter string '%s ignored"), params.c_str()); } } } diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index abd9a3bb59..c07eb13722 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -604,7 +604,7 @@ void wxGridCellTextEditor::SetParameters(const wxString& params) } else { - wxLogDebug( _T("Invalid wxGridCellTextEditor parameter string '%s' ignored"), params.c_str() ); + wxLogDebug( wxT("Invalid wxGridCellTextEditor parameter string '%s' ignored"), params.c_str() ); } } } @@ -666,7 +666,7 @@ void wxGridCellNumberEditor::BeginEdit(int row, int col, wxGrid* grid) wxString sValue = table->GetValue(row, col); if (! sValue.ToLong(&m_value) && ! sValue.empty()) { - wxFAIL_MSG( _T("this cell doesn't have numeric value") ); + wxFAIL_MSG( wxT("this cell doesn't have numeric value") ); return; } } @@ -808,11 +808,11 @@ void wxGridCellNumberEditor::SetParameters(const wxString& params) else { long tmp; - if ( params.BeforeFirst(_T(',')).ToLong(&tmp) ) + if ( params.BeforeFirst(wxT(',')).ToLong(&tmp) ) { m_min = (int)tmp; - if ( params.AfterFirst(_T(',')).ToLong(&tmp) ) + if ( params.AfterFirst(wxT(',')).ToLong(&tmp) ) { m_max = (int)tmp; @@ -821,7 +821,7 @@ void wxGridCellNumberEditor::SetParameters(const wxString& params) } } - wxLogDebug(_T("Invalid wxGridCellNumberEditor parameter string '%s' ignored"), params.c_str()); + wxLogDebug(wxT("Invalid wxGridCellNumberEditor parameter string '%s' ignored"), params.c_str()); } } @@ -883,7 +883,7 @@ void wxGridCellFloatEditor::BeginEdit(int row, int col, wxGrid* grid) { if ( !value.ToDouble(&m_value) ) { - wxFAIL_MSG( _T("this cell doesn't have float value") ); + wxFAIL_MSG( wxT("this cell doesn't have float value") ); return; } } @@ -953,7 +953,7 @@ void wxGridCellFloatEditor::StartingKey(wxKeyEvent& event) bool is_decimal_point = ( strbuf == wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER) ); #else - bool is_decimal_point = ( strbuf == _T(".") ); + bool is_decimal_point = ( strbuf == wxT(".") ); #endif if ( wxIsdigit(keycode) || keycode == '+' || keycode == '-' @@ -979,11 +979,11 @@ void wxGridCellFloatEditor::SetParameters(const wxString& params) else { long tmp; - if ( params.BeforeFirst(_T(',')).ToLong(&tmp) ) + if ( params.BeforeFirst(wxT(',')).ToLong(&tmp) ) { m_width = (int)tmp; - if ( params.AfterFirst(_T(',')).ToLong(&tmp) ) + if ( params.AfterFirst(wxT(',')).ToLong(&tmp) ) { m_precision = (int)tmp; @@ -992,7 +992,7 @@ void wxGridCellFloatEditor::SetParameters(const wxString& params) } } - wxLogDebug(_T("Invalid wxGridCellFloatEditor parameter string '%s' ignored"), params.c_str()); + wxLogDebug(wxT("Invalid wxGridCellFloatEditor parameter string '%s' ignored"), params.c_str()); } } @@ -1002,21 +1002,21 @@ wxString wxGridCellFloatEditor::GetString() const if ( m_precision == -1 && m_width != -1) { // default precision - fmt.Printf(_T("%%%d.f"), m_width); + fmt.Printf(wxT("%%%d.f"), m_width); } else if ( m_precision != -1 && m_width == -1) { // default width - fmt.Printf(_T("%%.%df"), m_precision); + fmt.Printf(wxT("%%.%df"), m_precision); } else if ( m_precision != -1 && m_width != -1 ) { - fmt.Printf(_T("%%%d.%df"), m_width, m_precision); + fmt.Printf(wxT("%%%d.%df"), m_width, m_precision); } else { // default width/precision - fmt = _T("%f"); + fmt = wxT("%f"); } return wxString::Format(fmt, m_value); @@ -1038,7 +1038,7 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event) const wxString decimalPoint = wxLocale::GetInfo(wxLOCALE_DECIMAL_POINT, wxLOCALE_CAT_NUMBER); #else - const wxString decimalPoint(_T('.')); + const wxString decimalPoint(wxT('.')); #endif // accept digits, 'e' as in '1e+6', also '-', '+', and '.' @@ -1065,7 +1065,7 @@ bool wxGridCellFloatEditor::IsAcceptedKey(wxKeyEvent& event) // ---------------------------------------------------------------------------- // the default values for GetValue() -wxString wxGridCellBoolEditor::ms_stringValues[2] = { _T(""), _T("1") }; +wxString wxGridCellBoolEditor::ms_stringValues[2] = { wxT(""), wxT("1") }; void wxGridCellBoolEditor::Create(wxWindow* parent, wxWindowID id, @@ -1183,7 +1183,7 @@ void wxGridCellBoolEditor::BeginEdit(int row, int col, wxGrid* grid) // because we'll still overwrite it with something different and // this risks to be very surprising for the user code, let them // know about it - wxFAIL_MSG( _T("invalid value for a cell with bool editor!") ); + wxFAIL_MSG( wxT("invalid value for a cell with bool editor!") ); } } @@ -1432,7 +1432,7 @@ void wxGridCellChoiceEditor::SetParameters(const wxString& params) m_choices.Empty(); - wxStringTokenizer tk(params, _T(',')); + wxStringTokenizer tk(params, wxT(',')); while ( tk.HasMoreTokens() ) { m_choices.Add(tk.GetNextToken()); diff --git a/src/generic/helpext.cpp b/src/generic/helpext.cpp index 7b0cbc2c17..b6e4b63812 100644 --- a/src/generic/helpext.cpp +++ b/src/generic/helpext.cpp @@ -53,7 +53,7 @@ // ---------------------------------------------------------------------------- // Name for map file. -#define WXEXTHELP_MAPFILE _T("wxhelp.map") +#define WXEXTHELP_MAPFILE wxT("wxhelp.map") // Character introducing comments/documentation field in map file. #define WXEXTHELP_COMMENTCHAR ';' @@ -107,7 +107,7 @@ void wxExtHelpController::SetViewer(const wxString& viewer, long flags) bool wxExtHelpController::DisplayHelp(const wxString &relativeURL) { // construct hte URL to open -- it's just a file - wxString url(_T("file://") + m_helpDir); + wxString url(wxT("file://") + m_helpDir); url << wxFILE_SEP_PATH << relativeURL; // use the explicit browser program if specified @@ -122,7 +122,7 @@ bool wxExtHelpController::DisplayHelp(const wxString &relativeURL) return true; } - if ( wxExecute(m_BrowserName + _T(' ') + url, wxEXEC_SYNC) != -1 ) + if ( wxExecute(m_BrowserName + wxT(' ') + url, wxEXEC_SYNC) != -1 ) return true; } //else: either no browser explicitly specified or we failed to open it @@ -176,7 +176,7 @@ bool wxExtHelpController::ParseMapFileLine(const wxString& line) p++; // skip empty lines and comments - if ( *p == _T('\0') || *p == WXEXTHELP_COMMENTCHAR ) + if ( *p == wxT('\0') || *p == WXEXTHELP_COMMENTCHAR ) return true; // the line is of the form "num url" so we must have an integer now @@ -242,7 +242,7 @@ bool wxExtHelpController::LoadFile(const wxString& file) if ( ! dirExists ) { // try without encoding - const wxString locNameWithoutEncoding = locName.BeforeLast(_T('.')); + const wxString locNameWithoutEncoding = locName.BeforeLast(wxT('.')); if ( !locNameWithoutEncoding.empty() ) { helpDirLoc = helpDir; @@ -254,7 +254,7 @@ bool wxExtHelpController::LoadFile(const wxString& file) if ( !dirExists ) { // try without country part - wxString locNameWithoutCountry = locName.BeforeLast(_T('_')); + wxString locNameWithoutCountry = locName.BeforeLast(wxT('_')); if ( !locNameWithoutCountry.empty() ) { helpDirLoc = helpDir; diff --git a/src/generic/htmllbox.cpp b/src/generic/htmllbox.cpp index 07fbac049b..c684838d5a 100644 --- a/src/generic/htmllbox.cpp +++ b/src/generic/htmllbox.cpp @@ -318,11 +318,11 @@ void wxHtmlListBox::CacheItem(size_t n) const wxHtmlContainerCell *cell = (wxHtmlContainerCell *)m_htmlParser-> Parse(OnGetItemMarkup(n)); - wxCHECK_RET( cell, _T("wxHtmlParser::Parse() returned NULL?") ); + wxCHECK_RET( cell, wxT("wxHtmlParser::Parse() returned NULL?") ); // set the cell's ID to item's index so that CellCoordsToPhysical() // can quickly find the item: - cell->SetId(wxString::Format(_T("%lu"), (unsigned long)n)); + cell->SetId(wxString::Format(wxT("%lu"), (unsigned long)n)); cell->Layout(GetClientSize().x - 2*GetMargins().x); @@ -397,7 +397,7 @@ void wxHtmlListBox::OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const CacheItem(n); wxHtmlCell *cell = m_cache->Get(n); - wxCHECK_RET( cell, _T("this cell should be cached!") ); + wxCHECK_RET( cell, wxT("this cell should be cached!") ); wxHtmlRenderingInfo htmlRendInfo; @@ -430,7 +430,7 @@ wxCoord wxHtmlListBox::OnMeasureItem(size_t n) const CacheItem(n); wxHtmlCell *cell = m_cache->Get(n); - wxCHECK_MSG( cell, 0, _T("this cell should be cached!") ); + wxCHECK_MSG( cell, 0, wxT("this cell should be cached!") ); return cell->GetHeight() + cell->GetDescent() + 4; } @@ -531,17 +531,17 @@ bool wxHtmlListBox::PhysicalCoordsToCell(wxPoint& pos, wxHtmlCell*& cell) const size_t wxHtmlListBox::GetItemForCell(const wxHtmlCell *cell) const { - wxCHECK_MSG( cell, 0, _T("no cell") ); + wxCHECK_MSG( cell, 0, wxT("no cell") ); cell = cell->GetRootCell(); - wxCHECK_MSG( cell, 0, _T("no root cell") ); + wxCHECK_MSG( cell, 0, wxT("no root cell") ); // the cell's ID contains item index, see CacheItem(): unsigned long n; if ( !cell->GetId().ToULong(&n) ) { - wxFAIL_MSG( _T("unexpected root cell's ID") ); + wxFAIL_MSG( wxT("unexpected root cell's ID") ); return 0; } diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 87240c8aa2..8dddab3540 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -65,8 +65,8 @@ int wxGenericImageList::Add( const wxBitmap &bitmap ) { wxASSERT_MSG( (bitmap.GetWidth() >= m_width && bitmap.GetHeight() == m_height) || (m_width == 0 && m_height == 0), - _T("invalid bitmap size in wxImageList: this might work ") - _T("on this platform but definitely won't under Windows.") ); + wxT("invalid bitmap size in wxImageList: this might work ") + wxT("on this platform but definitely won't under Windows.") ); const int index = int(m_images.GetCount()); diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index b62c9cf1f8..b3c3b77564 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -191,7 +191,7 @@ void wxListItemData::SetItem( const wxListItem &info ) void wxListItemData::SetPosition( int x, int y ) { - wxCHECK_RET( m_rect, _T("unexpected SetPosition() call") ); + wxCHECK_RET( m_rect, wxT("unexpected SetPosition() call") ); m_rect->x = x; m_rect->y = y; @@ -199,7 +199,7 @@ void wxListItemData::SetPosition( int x, int y ) void wxListItemData::SetSize( int width, int height ) { - wxCHECK_RET( m_rect, _T("unexpected SetSize() call") ); + wxCHECK_RET( m_rect, wxT("unexpected SetSize() call") ); if ( width != -1 ) m_rect->width = width; @@ -209,35 +209,35 @@ void wxListItemData::SetSize( int width, int height ) bool wxListItemData::IsHit( int x, int y ) const { - wxCHECK_MSG( m_rect, false, _T("can't be called in this mode") ); + wxCHECK_MSG( m_rect, false, wxT("can't be called in this mode") ); return wxRect(GetX(), GetY(), GetWidth(), GetHeight()).Contains(x, y); } int wxListItemData::GetX() const { - wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") ); + wxCHECK_MSG( m_rect, 0, wxT("can't be called in this mode") ); return m_rect->x; } int wxListItemData::GetY() const { - wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") ); + wxCHECK_MSG( m_rect, 0, wxT("can't be called in this mode") ); return m_rect->y; } int wxListItemData::GetWidth() const { - wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") ); + wxCHECK_MSG( m_rect, 0, wxT("can't be called in this mode") ); return m_rect->width; } int wxListItemData::GetHeight() const { - wxCHECK_MSG( m_rect, 0, _T("can't be called in this mode") ); + wxCHECK_MSG( m_rect, 0, wxT("can't be called in this mode") ); return m_rect->height; } @@ -417,7 +417,7 @@ wxListLineData::wxListLineData( wxListMainWindow *owner ) void wxListLineData::CalculateSize( wxDC *dc, int spacing ) { wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_RET( node, _T("no subitems at all??") ); + wxCHECK_RET( node, wxT("no subitems at all??") ); wxListItemData *item = node->GetData(); @@ -507,11 +507,11 @@ void wxListLineData::CalculateSize( wxDC *dc, int spacing ) break; case wxLC_REPORT: - wxFAIL_MSG( _T("unexpected call to SetSize") ); + wxFAIL_MSG( wxT("unexpected call to SetSize") ); break; default: - wxFAIL_MSG( _T("unknown mode") ); + wxFAIL_MSG( wxT("unknown mode") ); break; } } @@ -519,7 +519,7 @@ void wxListLineData::CalculateSize( wxDC *dc, int spacing ) void wxListLineData::SetPosition( int x, int y, int spacing ) { wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_RET( node, _T("no subitems at all??") ); + wxCHECK_RET( node, wxT("no subitems at all??") ); wxListItemData *item = node->GetData(); @@ -575,11 +575,11 @@ void wxListLineData::SetPosition( int x, int y, int spacing ) break; case wxLC_REPORT: - wxFAIL_MSG( _T("unexpected call to SetPosition") ); + wxFAIL_MSG( wxT("unexpected call to SetPosition") ); break; default: - wxFAIL_MSG( _T("unknown mode") ); + wxFAIL_MSG( wxT("unknown mode") ); break; } } @@ -593,7 +593,7 @@ void wxListLineData::InitItems( int num ) void wxListLineData::SetItem( int index, const wxListItem &info ) { wxListItemDataList::compatibility_iterator node = m_items.Item( index ); - wxCHECK_RET( node, _T("invalid column index in SetItem") ); + wxCHECK_RET( node, wxT("invalid column index in SetItem") ); wxListItemData *item = node->GetData(); item->SetItem( info ); @@ -636,7 +636,7 @@ void wxListLineData::SetText( int index, const wxString& s ) void wxListLineData::SetImage( int index, int image ) { wxListItemDataList::compatibility_iterator node = m_items.Item( index ); - wxCHECK_RET( node, _T("invalid column index in SetImage()") ); + wxCHECK_RET( node, wxT("invalid column index in SetImage()") ); wxListItemData *item = node->GetData(); item->SetImage(image); @@ -645,7 +645,7 @@ void wxListLineData::SetImage( int index, int image ) int wxListLineData::GetImage( int index ) const { wxListItemDataList::compatibility_iterator node = m_items.Item( index ); - wxCHECK_MSG( node, -1, _T("invalid column index in GetImage()") ); + wxCHECK_MSG( node, -1, wxT("invalid column index in GetImage()") ); wxListItemData *item = node->GetData(); return item->GetImage(); @@ -654,7 +654,7 @@ int wxListLineData::GetImage( int index ) const wxListItemAttr *wxListLineData::GetAttr() const { wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_MSG( node, NULL, _T("invalid column index in GetAttr()") ); + wxCHECK_MSG( node, NULL, wxT("invalid column index in GetAttr()") ); wxListItemData *item = node->GetData(); return item->GetAttr(); @@ -663,7 +663,7 @@ wxListItemAttr *wxListLineData::GetAttr() const void wxListLineData::SetAttr(wxListItemAttr *attr) { wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_RET( node, _T("invalid column index in SetAttr()") ); + wxCHECK_RET( node, wxT("invalid column index in SetAttr()") ); wxListItemData *item = node->GetData(); item->SetAttr(attr); @@ -732,7 +732,7 @@ bool wxListLineData::SetAttributes(wxDC *dc, void wxListLineData::Draw( wxDC *dc ) { wxListItemDataList::compatibility_iterator node = m_items.GetFirst(); - wxCHECK_RET( node, _T("no subitems at all??") ); + wxCHECK_RET( node, wxT("no subitems at all??") ); bool highlighted = IsHighlighted(); @@ -877,7 +877,7 @@ void wxListLineData::DrawTextFormatted(wxDC *dc, // we don't support displaying multiple lines currently (and neither does // wxMSW FWIW) so just merge all the lines wxString text(textOrig); - text.Replace(_T("\n"), _T(" ")); + text.Replace(wxT("\n"), wxT(" ")); wxCoord w, h; dc->GetTextExtent(text, &w, &h); @@ -907,7 +907,7 @@ void wxListLineData::DrawTextFormatted(wxDC *dc, break; default: - wxFAIL_MSG( _T("unknown list item format") ); + wxFAIL_MSG( wxT("unknown list item format") ); break; } @@ -949,7 +949,7 @@ void wxListLineData::DrawTextFormatted(wxDC *dc, bool wxListLineData::Highlight( bool on ) { - wxCHECK_MSG( !IsVirtual(), false, _T("unexpected call to Highlight") ); + wxCHECK_MSG( !IsVirtual(), false, wxT("unexpected call to Highlight") ); if ( on == m_highlighted ) return false; @@ -1144,7 +1144,7 @@ void wxListHeaderWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) switch ( wLabel < cw ? item.GetAlign() : wxLIST_FORMAT_LEFT ) { default: - wxFAIL_MSG( _T("unknown list item format") ); + wxFAIL_MSG( wxT("unknown list item format") ); // fall through case wxLIST_FORMAT_LEFT: @@ -1526,7 +1526,7 @@ void wxListTextCtrlWrapper::OnKeyUp( wxKeyEvent &event ) wxPoint myPos = m_text->GetPosition(); wxSize mySize = m_text->GetSize(); int sx, sy; - m_text->GetTextExtent(m_text->GetValue() + _T("MM"), &sx, &sy); + m_text->GetTextExtent(m_text->GetValue() + wxT("MM"), &sx, &sy); if (myPos.x + sx > parentSize.x) sx = parentSize.x - myPos.x; if (mySize.x > sx) @@ -1670,8 +1670,8 @@ void wxListMainWindow::CacheLineData(size_t line) wxListLineData *wxListMainWindow::GetDummyLine() const { - wxASSERT_MSG( !IsEmpty(), _T("invalid line index") ); - wxASSERT_MSG( IsVirtual(), _T("GetDummyLine() shouldn't be called") ); + wxASSERT_MSG( !IsEmpty(), wxT("invalid line index") ); + wxASSERT_MSG( IsVirtual(), wxT("GetDummyLine() shouldn't be called") ); wxListMainWindow *self = wxConstCast(this, wxListMainWindow); @@ -1712,7 +1712,7 @@ wxCoord wxListMainWindow::GetLineHeight() const dc.SetFont( GetFont() ); wxCoord y; - dc.GetTextExtent(_T("H"), NULL, &y); + dc.GetTextExtent(wxT("H"), NULL, &y); if ( m_small_image_list && m_small_image_list->GetImageCount() ) { @@ -1730,7 +1730,7 @@ wxCoord wxListMainWindow::GetLineHeight() const wxCoord wxListMainWindow::GetLineY(size_t line) const { - wxASSERT_MSG( InReportView(), _T("only works in report mode") ); + wxASSERT_MSG( InReportView(), wxT("only works in report mode") ); return LINE_SPACING + line * GetLineHeight(); } @@ -1783,7 +1783,7 @@ wxRect wxListMainWindow::GetLineIconRect(size_t line) const return GetLine(line)->m_gi->m_rectIcon; wxListLineData *ld = GetLine(line); - wxASSERT_MSG( ld->HasImage(), _T("should have an image") ); + wxASSERT_MSG( ld->HasImage(), wxT("should have an image") ); wxRect rect; rect.x = HEADER_OFFSET_X; @@ -1801,7 +1801,7 @@ wxRect wxListMainWindow::GetLineHighlightRect(size_t line) const long wxListMainWindow::HitTestLine(size_t line, int x, int y) const { - wxASSERT_MSG( line < GetItemCount(), _T("invalid line in HitTestLine") ); + wxASSERT_MSG( line < GetItemCount(), wxT("invalid line in HitTestLine") ); wxListLineData *ld = GetLine(line); @@ -1836,7 +1836,7 @@ bool wxListMainWindow::IsHighlighted(size_t line) const else // !virtual { wxListLineData *ld = GetLine(line); - wxCHECK_MSG( ld, false, _T("invalid index in IsHighlighted") ); + wxCHECK_MSG( ld, false, wxT("invalid index in IsHighlighted") ); return ld->IsHighlighted(); } @@ -1885,7 +1885,7 @@ bool wxListMainWindow::HighlightLine( size_t line, bool highlight ) else // !virtual { wxListLineData *ld = GetLine(line); - wxCHECK_MSG( ld, false, _T("invalid index in HighlightLine") ); + wxCHECK_MSG( ld, false, wxT("invalid index in HighlightLine") ); changed = ld->Highlight(highlight); } @@ -1919,9 +1919,9 @@ void wxListMainWindow::RefreshLine( size_t line ) void wxListMainWindow::RefreshLines( size_t lineFrom, size_t lineTo ) { // we suppose that they are ordered by caller - wxASSERT_MSG( lineFrom <= lineTo, _T("indices in disorder") ); + wxASSERT_MSG( lineFrom <= lineTo, wxT("indices in disorder") ); - wxASSERT_MSG( lineTo < GetItemCount(), _T("invalid line range") ); + wxASSERT_MSG( lineTo < GetItemCount(), wxT("invalid line range") ); if ( InReportView() ) { @@ -2151,7 +2151,7 @@ void wxListMainWindow::HighlightAll( bool on ) { if ( IsSingleSel() ) { - wxASSERT_MSG( !on, _T("can't do this in a single selection control") ); + wxASSERT_MSG( !on, wxT("can't do this in a single selection control") ); // we just have one item to turn off if ( HasCurrent() && IsHighlighted(m_current) ) @@ -2230,7 +2230,7 @@ wxTextCtrl *wxListMainWindow::EditLabel(long item, wxClassInfo* textControlClass le.SetEventObject( GetParent() ); le.m_itemIndex = item; wxListLineData *data = GetLine(itemEdit); - wxCHECK_MSG( data, NULL, _T("invalid index in EditLabel()") ); + wxCHECK_MSG( data, NULL, wxT("invalid index in EditLabel()") ); data->GetItem( 0, le.m_item ); if ( GetParent()->GetEventHandler()->ProcessEvent( le ) && !le.IsAllowed() ) @@ -2274,7 +2274,7 @@ bool wxListMainWindow::OnRenameAccept(size_t itemEdit, const wxString& value) wxListLineData *data = GetLine(itemEdit); - wxCHECK_MSG( data, false, _T("invalid index in OnRenameAccept()") ); + wxCHECK_MSG( data, false, wxT("invalid index in OnRenameAccept()") ); data->GetItem( 0, le.m_item ); le.m_item.m_text = value; @@ -2293,7 +2293,7 @@ void wxListMainWindow::OnRenameCancelled(size_t itemEdit) le.m_itemIndex = itemEdit; wxListLineData *data = GetLine(itemEdit); - wxCHECK_RET( data, _T("invalid index in OnRenameCancelled()") ); + wxCHECK_RET( data, wxT("invalid index in OnRenameCancelled()") ); data->GetItem( 0, le.m_item ); GetEventHandler()->ProcessEvent( le ); @@ -2559,7 +2559,7 @@ void wxListMainWindow::OnMouse( wxMouseEvent &event ) else // !ctrl, !shift { // test in the enclosing if should make it impossible - wxFAIL_MSG( _T("how did we get here?") ); + wxFAIL_MSG( wxT("how did we get here?") ); } } @@ -2662,7 +2662,7 @@ bool wxListMainWindow::ScrollList(int WXUNUSED(dx), int dy) void wxListMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event) { wxCHECK_RET( newCurrent < (size_t)GetItemCount(), - _T("invalid item index in OnArrowChar()") ); + wxT("invalid item index in OnArrowChar()") ); size_t oldCurrent = m_current; @@ -2774,7 +2774,7 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) // don't use m_linesPerPage directly as it might not be computed yet const int pageSize = GetCountPerPage(); - wxCHECK_RET( pageSize, _T("should have non zero page size") ); + wxCHECK_RET( pageSize, wxT("should have non zero page size") ); if (GetLayoutDirection() == wxLayout_RightToLeft) { @@ -3028,7 +3028,7 @@ void wxListMainWindow::SetColumn( int col, wxListItem &item ) { wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); - wxCHECK_RET( node, _T("invalid column index in SetColumn") ); + wxCHECK_RET( node, wxT("invalid column index in SetColumn") ); if ( item.m_width == wxLIST_AUTOSIZE_USEHEADER ) item.m_width = GetTextLength( item.m_text ); @@ -3049,10 +3049,10 @@ void wxListMainWindow::SetColumn( int col, wxListItem &item ) void wxListMainWindow::SetColumnWidth( int col, int width ) { wxCHECK_RET( col >= 0 && col < GetColumnCount(), - _T("invalid column index") ); + wxT("invalid column index") ); wxCHECK_RET( InReportView(), - _T("SetColumnWidth() can only be called in report mode.") ); + wxT("SetColumnWidth() can only be called in report mode.") ); m_dirty = true; @@ -3061,7 +3061,7 @@ void wxListMainWindow::SetColumnWidth( int col, int width ) headerWin->m_dirty = true; wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); - wxCHECK_RET( node, _T("no column?") ); + wxCHECK_RET( node, wxT("no column?") ); wxListHeaderData *column = node->GetData(); @@ -3106,7 +3106,7 @@ void wxListMainWindow::SetColumnWidth( int col, int width ) wxListLineData *line = GetLine( i ); wxListItemDataList::compatibility_iterator n = line->m_items.Item( col ); - wxCHECK_RET( n, _T("no subitem?") ); + wxCHECK_RET( n, wxT("no subitem?") ); wxListItemData *itemData = n->GetData(); wxListItem item; @@ -3151,7 +3151,7 @@ int wxListMainWindow::GetHeaderWidth() const void wxListMainWindow::GetColumn( int col, wxListItem &item ) const { wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); - wxCHECK_RET( node, _T("invalid column index in GetColumn") ); + wxCHECK_RET( node, wxT("invalid column index in GetColumn") ); wxListHeaderData *column = node->GetData(); column->GetItem( item ); @@ -3160,7 +3160,7 @@ void wxListMainWindow::GetColumn( int col, wxListItem &item ) const int wxListMainWindow::GetColumnWidth( int col ) const { wxListHeaderDataList::compatibility_iterator node = m_columns.Item( col ); - wxCHECK_MSG( node, 0, _T("invalid column index") ); + wxCHECK_MSG( node, 0, wxT("invalid column index") ); wxListHeaderData *column = node->GetData(); return column->GetWidth(); @@ -3174,7 +3174,7 @@ void wxListMainWindow::SetItem( wxListItem &item ) { long id = item.m_itemId; wxCHECK_RET( id >= 0 && (size_t)id < GetItemCount(), - _T("invalid item index in SetItem") ); + wxT("invalid item index in SetItem") ); if ( !IsVirtual() ) { @@ -3254,7 +3254,7 @@ void wxListMainWindow::SetItemState( long litem, long state, long stateMask ) } wxCHECK_RET( litem >= 0 && (size_t)litem < GetItemCount(), - _T("invalid list ctrl item index in SetItem") ); + wxT("invalid list ctrl item index in SetItem") ); size_t oldCurrent = m_current; size_t item = (size_t)litem; // safe because of the check above @@ -3342,7 +3342,7 @@ void wxListMainWindow::SetItemState( long litem, long state, long stateMask ) int wxListMainWindow::GetItemState( long item, long stateMask ) const { wxCHECK_MSG( item >= 0 && (size_t)item < GetItemCount(), 0, - _T("invalid list ctrl item index in GetItemState()") ); + wxT("invalid list ctrl item index in GetItemState()") ); int ret = wxLIST_STATE_DONTCARE; @@ -3364,7 +3364,7 @@ int wxListMainWindow::GetItemState( long item, long stateMask ) const void wxListMainWindow::GetItem( wxListItem &item ) const { wxCHECK_RET( item.m_itemId >= 0 && (size_t)item.m_itemId < GetItemCount(), - _T("invalid item index in GetItem") ); + wxT("invalid item index in GetItem") ); wxListLineData *line = GetLine((size_t)item.m_itemId); line->GetItem( item.m_col, item ); @@ -3466,9 +3466,9 @@ wxListMainWindow::GetSubItemRect(long item, long subItem, wxRect& rect) const { wxCHECK_MSG( subItem == wxLIST_GETSUBITEMRECT_WHOLEITEM || InReportView(), false, - _T("GetSubItemRect only meaningful in report view") ); + wxT("GetSubItemRect only meaningful in report view") ); wxCHECK_MSG( item >= 0 && (size_t)item < GetItemCount(), false, - _T("invalid item in GetSubItemRect") ); + wxT("invalid item in GetSubItemRect") ); // ensure that we're laid out, otherwise we could return nonsense if ( m_dirty ) @@ -3483,7 +3483,7 @@ wxListMainWindow::GetSubItemRect(long item, long subItem, wxRect& rect) const if ( subItem != wxLIST_GETSUBITEMRECT_WHOLEITEM ) { wxCHECK_MSG( subItem >= 0 && subItem < GetColumnCount(), false, - _T("invalid subItem in GetSubItemRect") ); + wxT("invalid subItem in GetSubItemRect") ); for (int i = 0; i < subItem; i++) { @@ -3740,7 +3740,7 @@ long wxListMainWindow::GetNextItem( long item, long ret = item, max = GetItemCount(); wxCHECK_MSG( (ret == -1) || (ret < max), -1, - _T("invalid listctrl index in GetNextItem()") ); + wxT("invalid listctrl index in GetNextItem()") ); // notice that we start with the next item (or the first one if item == -1) // and this is intentional to allow writing a simple loop to iterate over @@ -3777,7 +3777,7 @@ void wxListMainWindow::DeleteItem( long lindex ) size_t count = GetItemCount(); wxCHECK_RET( (lindex >= 0) && ((size_t)lindex < count), - _T("invalid item index in DeleteItem") ); + wxT("invalid item index in DeleteItem") ); size_t index = (size_t)lindex; @@ -3923,7 +3923,7 @@ void wxListMainWindow::DeleteEverything() void wxListMainWindow::EnsureVisible( long index ) { wxCHECK_RET( index >= 0 && (size_t)index < GetItemCount(), - _T("invalid index in EnsureVisible") ); + wxT("invalid index in EnsureVisible") ); // We have to call this here because the label in question might just have // been added and its position is not known yet @@ -4036,10 +4036,10 @@ long wxListMainWindow::HitTest( int x, int y, int &flags ) const void wxListMainWindow::InsertItem( wxListItem &item ) { - wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual control") ); + wxASSERT_MSG( !IsVirtual(), wxT("can't be used with virtual control") ); int count = GetItemCount(); - wxCHECK_RET( item.m_itemId >= 0, _T("invalid item index") ); + wxCHECK_RET( item.m_itemId >= 0, wxT("invalid item index") ); if (item.m_itemId > count) item.m_itemId = count; @@ -4192,7 +4192,7 @@ void wxListMainWindow::OnScroll(wxScrollWinEvent& event) if ( event.GetOrientation() == wxHORIZONTAL && HasHeader() ) { wxGenericListCtrl* lc = GetListCtrl(); - wxCHECK_RET( lc, _T("no listctrl window?") ); + wxCHECK_RET( lc, wxT("no listctrl window?") ); if (lc->m_headerWin) // when we use wxLC_NO_HEADER, m_headerWin==NULL { @@ -4215,7 +4215,7 @@ int wxListMainWindow::GetCountPerPage() const void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to) { - wxASSERT_MSG( InReportView(), _T("this is for report mode only") ); + wxASSERT_MSG( InReportView(), wxT("this is for report mode only") ); if ( m_lineFrom == (size_t)-1 ) { @@ -4243,7 +4243,7 @@ void wxListMainWindow::GetVisibleLinesRange(size_t *from, size_t *to) wxASSERT_MSG( IsEmpty() || (m_lineFrom <= m_lineTo && m_lineTo < GetItemCount()), - _T("GetVisibleLinesRange() returns incorrect result") ); + wxT("GetVisibleLinesRange() returns incorrect result") ); if ( from ) *from = m_lineFrom; @@ -4335,7 +4335,7 @@ bool wxGenericListCtrl::Create(wxWindow *parent, // just like in other ports, an assert will fail if the user doesn't give any type style: wxASSERT_MSG( (style & wxLC_MASK_TYPE), - _T("wxListCtrl style should have exactly one mode bit set") ); + wxT("wxListCtrl style should have exactly one mode bit set") ); if ( !wxControl::Create( parent, id, pos, size, style|wxVSCROLL|wxHSCROLL, validator, name ) ) return false; @@ -4409,7 +4409,7 @@ void wxGenericListCtrl::OnScroll(wxScrollWinEvent& event) void wxGenericListCtrl::SetSingleStyle( long style, bool add ) { wxASSERT_MSG( !(style & wxLC_VIRTUAL), - _T("wxLC_VIRTUAL can't be [un]set") ); + wxT("wxLC_VIRTUAL can't be [un]set") ); long flag = GetWindowStyle(); @@ -4874,7 +4874,7 @@ long wxGenericListCtrl::InsertItem( long index, const wxString &label, int image long wxGenericListCtrl::InsertColumn( long col, wxListItem &item ) { - wxCHECK_MSG( InReportView(), -1, _T("can't add column in non report mode") ); + wxCHECK_MSG( InReportView(), -1, wxT("can't add column in non report mode") ); m_mainWin->InsertColumn( col, item ); @@ -5101,7 +5101,7 @@ wxString wxGenericListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col { // this is a pure virtual function, in fact - which is not really pure // because the controls which are not virtual don't need to implement it - wxFAIL_MSG( _T("wxGenericListCtrl::OnGetItemText not supposed to be called") ); + wxFAIL_MSG( wxT("wxGenericListCtrl::OnGetItemText not supposed to be called") ); return wxEmptyString; } @@ -5126,7 +5126,7 @@ wxListItemAttr * wxGenericListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const { wxASSERT_MSG( item >= 0 && item < GetItemCount(), - _T("invalid item index in OnGetItemAttr()") ); + wxT("invalid item index in OnGetItemAttr()") ); // no attributes by default return NULL; @@ -5134,7 +5134,7 @@ wxGenericListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const void wxGenericListCtrl::SetItemCount(long count) { - wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") ); + wxASSERT_MSG( IsVirtual(), wxT("this is for virtual controls only") ); m_mainWin->SetItemCount(count); } diff --git a/src/generic/logg.cpp b/src/generic/logg.cpp index 88a17cd700..d7eb54290f 100644 --- a/src/generic/logg.cpp +++ b/src/generic/logg.cpp @@ -76,7 +76,7 @@ #include "wx/datetime.h" // the suffix we add to the button to show that the dialog can be expanded -#define EXPAND_SUFFIX _T(" >>") +#define EXPAND_SUFFIX wxT(" >>") #define CAN_SAVE_FILES (wxUSE_FILE && wxUSE_FILEDLG) @@ -96,7 +96,7 @@ static wxString TimeStamp(const wxString& format, time_t t) if ( !wxStrftime(buf, WXSIZEOF(buf), format, wxLocaltime_r(&t, &tm)) ) { // buffer is too small? - wxFAIL_MSG(_T("strftime() failed")); + wxFAIL_MSG(wxT("strftime() failed")); } return wxString(buf); #else // !wxUSE_DATETIME @@ -807,10 +807,10 @@ void wxLogDialog::CreateDetailsControls(wxWindow *parent) // no need to translate these strings as they're not shown to the // user anyhow (we use wxLC_NO_HEADER style) - m_listctrl->InsertColumn(0, _T("Message")); + m_listctrl->InsertColumn(0, wxT("Message")); if (hasTimeStamp) - m_listctrl->InsertColumn(1, _T("Time")); + m_listctrl->InsertColumn(1, wxT("Time")); // prepare the imagelist static const int ICON_SIZE = 16; diff --git a/src/generic/numdlgg.cpp b/src/generic/numdlgg.cpp index 98e5c16734..16a056b257 100644 --- a/src/generic/numdlgg.cpp +++ b/src/generic/numdlgg.cpp @@ -135,7 +135,7 @@ void wxNumberEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { #if !wxUSE_SPINCTRL wxString tmp = m_spinctrl->GetValue(); - if ( wxSscanf(tmp, _T("%ld"), &m_value) != 1 ) + if ( wxSscanf(tmp, wxT("%ld"), &m_value) != 1 ) EndModal(wxID_CANCEL); else #else diff --git a/src/generic/odcombo.cpp b/src/generic/odcombo.cpp index f3cef112d9..8321e400d1 100644 --- a/src/generic/odcombo.cpp +++ b/src/generic/odcombo.cpp @@ -952,7 +952,7 @@ void wxOwnerDrawnComboBox::DoClear() void wxOwnerDrawnComboBox::DoDeleteOneItem(unsigned int n) { - wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Delete") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxOwnerDrawnComboBox::Delete") ); if ( GetSelection() == (int) n ) SetValue(wxEmptyString); @@ -970,7 +970,7 @@ unsigned int wxOwnerDrawnComboBox::GetCount() const wxString wxOwnerDrawnComboBox::GetString(unsigned int n) const { - wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxOwnerDrawnComboBox::GetString") ); + wxCHECK_MSG( IsValid(n), wxEmptyString, wxT("invalid index in wxOwnerDrawnComboBox::GetString") ); if ( !m_popupInterface ) return m_initChs.Item(n); @@ -982,7 +982,7 @@ void wxOwnerDrawnComboBox::SetString(unsigned int n, const wxString& s) { EnsurePopupControl(); - wxCHECK_RET( IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::SetString") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxOwnerDrawnComboBox::SetString") ); GetVListBoxComboPopup()->SetString(n,s); } @@ -999,7 +999,7 @@ void wxOwnerDrawnComboBox::Select(int n) { EnsurePopupControl(); - wxCHECK_RET( (n == wxNOT_FOUND) || IsValid(n), _T("invalid index in wxOwnerDrawnComboBox::Select") ); + wxCHECK_RET( (n == wxNOT_FOUND) || IsValid(n), wxT("invalid index in wxOwnerDrawnComboBox::Select") ); GetVListBoxComboPopup()->SetSelection(n); diff --git a/src/generic/prntdlgg.cpp b/src/generic/prntdlgg.cpp index 9457bffa42..54458cd201 100644 --- a/src/generic/prntdlgg.cpp +++ b/src/generic/prntdlgg.cpp @@ -356,9 +356,9 @@ bool wxGenericPrintDialog::TransferDataToWindow() m_fromText->Enable(true); m_toText->Enable(true); if (m_printDialogData.GetFromPage() > 0) - m_fromText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetFromPage())); + m_fromText->SetValue(wxString::Format(wxT("%d"), m_printDialogData.GetFromPage())); if (m_printDialogData.GetToPage() > 0) - m_toText->SetValue(wxString::Format(_T("%d"), m_printDialogData.GetToPage())); + m_toText->SetValue(wxString::Format(wxT("%d"), m_printDialogData.GetToPage())); if(m_rangeRadioBox) { if (m_printDialogData.GetAllPages() || m_printDialogData.GetFromPage() == 0) @@ -380,7 +380,7 @@ bool wxGenericPrintDialog::TransferDataToWindow() } } m_noCopiesText->SetValue( - wxString::Format(_T("%d"), m_printDialogData.GetNoCopies())); + wxString::Format(wxT("%d"), m_printDialogData.GetNoCopies())); m_printToFileCheckBox->SetValue(m_printDialogData.GetPrintToFile()); m_printToFileCheckBox->Enable(m_printDialogData.GetEnablePrintToFile()); @@ -708,7 +708,7 @@ void wxGenericPrintSetupDialog::OnPrinter(wxListEvent& event) li.SetMask( wxLIST_MASK_TEXT ); li.SetId( event.GetIndex() ); m_printerListCtrl->GetItem( li ); - m_printerCommandText->SetValue( _T("lpr -P") + li.GetText() ); + m_printerCommandText->SetValue( wxT("lpr -P") + li.GetText() ); } } diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index 2f55dc8835..0c91b812fd 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -314,7 +314,7 @@ bool wxScrollHelperEvtHandler::ProcessEvent(wxEvent& event) wxScrollHelperBase::wxScrollHelperBase(wxWindow *win) { - wxASSERT_MSG( win, _T("associated window can't be NULL in wxScrollHelper") ); + wxASSERT_MSG( win, wxT("associated window can't be NULL in wxScrollHelper") ); m_xScrollPixelsPerLine = m_yScrollPixelsPerLine = @@ -990,7 +990,7 @@ void wxScrollHelperBase::HandleOnMouseLeave(wxMouseEvent& event) // but seems to happen sometimes under wxMSW - maybe it's a bug // there but for now just ignore it - //wxFAIL_MSG( _T("can't understand where has mouse gone") ); + //wxFAIL_MSG( wxT("can't understand where has mouse gone") ); return; } diff --git a/src/generic/selstore.cpp b/src/generic/selstore.cpp index 4333aeaeaa..b08f1e9b0a 100644 --- a/src/generic/selstore.cpp +++ b/src/generic/selstore.cpp @@ -84,7 +84,7 @@ bool wxSelectionStore::SelectRange(unsigned itemFrom, unsigned itemTo, // change state static const unsigned MANY_ITEMS = 100; - wxASSERT_MSG( itemFrom <= itemTo, _T("should be in order") ); + wxASSERT_MSG( itemFrom <= itemTo, wxT("should be in order") ); // are we going to have more [un]selected items than the other ones? if ( itemTo - itemFrom > m_count/2 ) @@ -208,7 +208,7 @@ void wxSelectionStore::OnItemDelete(unsigned item) while ( i < count ) { // all following elements must be greater than the one we deleted - wxASSERT_MSG( m_itemsSel[i] > item, _T("logic error") ); + wxASSERT_MSG( m_itemsSel[i] > item, wxT("logic error") ); m_itemsSel[i++]--; } diff --git a/src/generic/spinctlg.cpp b/src/generic/spinctlg.cpp index 8fc9dadc29..84cc154b40 100644 --- a/src/generic/spinctlg.cpp +++ b/src/generic/spinctlg.cpp @@ -437,7 +437,7 @@ void wxSpinCtrlGenericBase::SyncSpinToText() void wxSpinCtrlGenericBase::SetValue(const wxString& text) { - wxCHECK_RET( m_textCtrl, _T("invalid call to wxSpinCtrl::SetValue") ); + wxCHECK_RET( m_textCtrl, wxT("invalid call to wxSpinCtrl::SetValue") ); double val; if ( text.ToDouble(&val) && InRange(val) ) @@ -453,7 +453,7 @@ void wxSpinCtrlGenericBase::SetValue(const wxString& text) bool wxSpinCtrlGenericBase::DoSetValue(double val) { - wxCHECK_MSG( m_textCtrl, false, _T("invalid call to wxSpinCtrl::SetValue") ); + wxCHECK_MSG( m_textCtrl, false, wxT("invalid call to wxSpinCtrl::SetValue") ); if (!InRange(val)) return false; @@ -514,7 +514,7 @@ void wxSpinCtrlGenericBase::SetSnapToTicks(bool snap_to_ticks) void wxSpinCtrlGenericBase::SetSelection(long from, long to) { - wxCHECK_RET( m_textCtrl, _T("invalid call to wxSpinCtrl::SetSelection") ); + wxCHECK_RET( m_textCtrl, wxT("invalid call to wxSpinCtrl::SetSelection") ); m_textCtrl->SetSelection(from, to); } diff --git a/src/generic/splitter.cpp b/src/generic/splitter.cpp index 411595f88f..3b967a86b0 100644 --- a/src/generic/splitter.cpp +++ b/src/generic/splitter.cpp @@ -465,7 +465,7 @@ void wxSplitterWindow::OnSize(wxSizeEvent& event) void wxSplitterWindow::SetSashGravity(double gravity) { wxCHECK_RET( gravity >= 0. && gravity <= 1., - _T("invalid gravity value") ); + wxT("invalid gravity value") ); m_sashGravity = gravity; } @@ -732,7 +732,7 @@ void wxSplitterWindow::SizeWindows() void wxSplitterWindow::Initialize(wxWindow *window) { wxASSERT_MSG( (!window || window->GetParent() == this), - _T("windows in the splitter should have it as parent!") ); + wxT("windows in the splitter should have it as parent!") ); if (window && !window->IsShown()) window->Show(); @@ -753,10 +753,10 @@ bool wxSplitterWindow::DoSplit(wxSplitMode mode, return false; wxCHECK_MSG( window1 && window2, false, - _T("can not split with NULL window(s)") ); + wxT("can not split with NULL window(s)") ); wxCHECK_MSG( window1->GetParent() == this && window2->GetParent() == this, false, - _T("windows in the splitter should have it as parent!") ); + wxT("windows in the splitter should have it as parent!") ); if (! window1->IsShown()) window1->Show(); diff --git a/src/generic/statusbr.cpp b/src/generic/statusbr.cpp index e1717d26db..e41f988488 100644 --- a/src/generic/statusbr.cpp +++ b/src/generic/statusbr.cpp @@ -162,7 +162,7 @@ wxSize wxStatusBarGeneric::DoGetBestSize() const void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths) { - wxASSERT_MSG( number >= 0, _T("negative number of fields in wxStatusBar?") ); + wxASSERT_MSG( number >= 0, wxT("negative number of fields in wxStatusBar?") ); // this will result in a call to SetStatusWidths() and thus an update to our // m_widthsAbs cache @@ -172,7 +172,7 @@ void wxStatusBarGeneric::SetFieldsCount(int number, const int *widths) void wxStatusBarGeneric::SetStatusText(const wxString& text, int number) { wxCHECK_RET( (number >= 0) && ((size_t)number < m_panes.GetCount()), - _T("invalid status bar field index") ); + wxT("invalid status bar field index") ); wxString oldText = GetStatusText(number); if (oldText != text) @@ -194,7 +194,7 @@ void wxStatusBarGeneric::SetStatusText(const wxString& text, int number) void wxStatusBarGeneric::SetStatusWidths(int n, const int widths_field[]) { // only set status widths when n == number of statuswindows - wxCHECK_RET( (size_t)n == m_panes.GetCount(), _T("status bar field count mismatch") ); + wxCHECK_RET( (size_t)n == m_panes.GetCount(), wxT("status bar field count mismatch") ); wxStatusBarBase::SetStatusWidths(n, widths_field); @@ -341,7 +341,7 @@ void wxStatusBarGeneric::DrawField(wxDC& dc, int i, int textHeight) bool wxStatusBarGeneric::GetFieldRect(int n, wxRect& rect) const { wxCHECK_MSG( (n >= 0) && ((size_t)n < m_panes.GetCount()), false, - _T("invalid status bar field index") ); + wxT("invalid status bar field index") ); if (m_widthsAbs.IsEmpty()) return false; diff --git a/src/generic/timer.cpp b/src/generic/timer.cpp index 4f7ebe8bf1..00713f32b2 100644 --- a/src/generic/timer.cpp +++ b/src/generic/timer.cpp @@ -44,7 +44,7 @@ typedef ulong wxTimerTick_t; - #define wxTimerTickFmtSpec _T("lu") + #define wxTimerTickFmtSpec wxT("lu") #define wxTimerTickPrintfArg(tt) (tt) #ifdef __DOS__ @@ -74,10 +74,10 @@ typedef wxLongLong wxTimerTick_t; #if wxUSE_LONGLONG_WX - #define wxTimerTickFmtSpec wxLongLongFmtSpec _T("d") + #define wxTimerTickFmtSpec wxLongLongFmtSpec wxT("d") #define wxTimerTickPrintfArg(tt) (tt.GetValue()) #else // using native wxLongLong - #define wxTimerTickFmtSpec _T("s") + #define wxTimerTickFmtSpec wxT("s") #define wxTimerTickPrintfArg(tt) (tt.ToString().c_str()) #endif // wx/native long long diff --git a/src/generic/tipwin.cpp b/src/generic/tipwin.cpp index 8238cd83c4..dfc01cff0d 100644 --- a/src/generic/tipwin.cpp +++ b/src/generic/tipwin.cpp @@ -267,7 +267,7 @@ void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength) bool breakLine = false; for ( const wxChar *p = text.c_str(); ; p++ ) { - if ( *p == _T('\n') || *p == _T('\0') ) + if ( *p == wxT('\n') || *p == wxT('\0') ) { dc.GetTextExtent(current, &width, &height); if ( width > widthMax ) @@ -287,7 +287,7 @@ void wxTipWindowView::Adjust(const wxString& text, wxCoord maxLength) current.clear(); breakLine = false; } - else if ( breakLine && (*p == _T(' ') || *p == _T('\t')) ) + else if ( breakLine && (*p == wxT(' ') || *p == wxT('\t')) ) { // word boundary - break the line here m_parent->m_textLines.Add(current); diff --git a/src/generic/toolbkg.cpp b/src/generic/toolbkg.cpp index 638fe2f86a..cfe93d59fb 100644 --- a/src/generic/toolbkg.cpp +++ b/src/generic/toolbkg.cpp @@ -205,7 +205,7 @@ wxString wxToolbook::GetPageText(size_t n) const int wxToolbook::GetPageImage(size_t WXUNUSED(n)) const { - wxFAIL_MSG( _T("wxToolbook::GetPageImage() not implemented") ); + wxFAIL_MSG( wxT("wxToolbook::GetPageImage() not implemented") ); return wxNOT_FOUND; } diff --git a/src/generic/treebkg.cpp b/src/generic/treebkg.cpp index 908f64cced..ab44d27257 100644 --- a/src/generic/treebkg.cpp +++ b/src/generic/treebkg.cpp @@ -217,7 +217,7 @@ bool wxTreebook::DoAddSubPage(wxWindow *page, const wxString& text, bool bSelect wxTreeItemId lastNodeId = tree->GetLastChild(rootId); wxCHECK_MSG( lastNodeId.IsOk(), false, - _T("Can't insert sub page when there are no pages") ); + wxT("Can't insert sub page when there are no pages") ); // now calculate its position (should we save/update it too?) size_t newPos = tree->GetCount() - diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 3f4ec3c7de..7f0dc649c6 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -541,7 +541,7 @@ void wxTreeTextCtrl::OnKeyUp( wxKeyEvent &event ) wxPoint myPos = GetPosition(); wxSize mySize = GetSize(); int sx, sy; - GetTextExtent(GetValue() + _T("M"), &sx, &sy); + GetTextExtent(GetValue() + wxT("M"), &sx, &sy); if (myPos.x + sx > parentSize.x) sx = parentSize.x - myPos.x; if (mySize.x > sx) @@ -1854,9 +1854,9 @@ void wxGenericTreeCtrl::Expand(const wxTreeItemId& itemId) { wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; - wxCHECK_RET( item, _T("invalid item in wxGenericTreeCtrl::Expand") ); + wxCHECK_RET( item, wxT("invalid item in wxGenericTreeCtrl::Expand") ); wxCHECK_RET( !HasFlag(wxTR_HIDE_ROOT) || itemId != GetRootItem(), - _T("can't expand hidden root") ); + wxT("can't expand hidden root") ); if ( !item->HasPlus() ) return; @@ -1891,7 +1891,7 @@ void wxGenericTreeCtrl::Expand(const wxTreeItemId& itemId) void wxGenericTreeCtrl::Collapse(const wxTreeItemId& itemId) { wxCHECK_RET( !HasFlag(wxTR_HIDE_ROOT) || itemId != GetRootItem(), - _T("can't collapse hidden root") ); + wxT("can't collapse hidden root") ); wxGenericTreeItem *item = (wxGenericTreeItem*) itemId.m_pItem; @@ -3356,7 +3356,7 @@ bool wxGenericTreeCtrl::GetBoundingRect(const wxTreeItemId& item, wxTextCtrl *wxGenericTreeCtrl::EditLabel(const wxTreeItemId& item, wxClassInfo * WXUNUSED(textCtrlClass)) { - wxCHECK_MSG( item.IsOk(), NULL, _T("can't edit an invalid item") ); + wxCHECK_MSG( item.IsOk(), NULL, wxT("can't edit an invalid item") ); wxGenericTreeItem *itemEdit = (wxGenericTreeItem *)item.m_pItem; @@ -3396,7 +3396,7 @@ wxTextCtrl* wxGenericTreeCtrl::GetEditControl() const void wxGenericTreeCtrl::EndEditLabel(const wxTreeItemId& WXUNUSED(item), bool discardChanges) { - wxCHECK_RET( m_textCtrl, _T("not editing label") ); + wxCHECK_RET( m_textCtrl, wxT("not editing label") ); m_textCtrl->EndEdit(discardChanges); } diff --git a/src/generic/vlbox.cpp b/src/generic/vlbox.cpp index 13ce1b6278..551177def5 100644 --- a/src/generic/vlbox.cpp +++ b/src/generic/vlbox.cpp @@ -138,10 +138,10 @@ bool wxVListBox::IsSelected(size_t line) const bool wxVListBox::Select(size_t item, bool select) { wxCHECK_MSG( m_selStore, false, - _T("Select() may only be used with multiselection listbox") ); + wxT("Select() may only be used with multiselection listbox") ); wxCHECK_MSG( item < GetItemCount(), false, - _T("Select(): invalid item index") ); + wxT("Select(): invalid item index") ); bool changed = m_selStore->SelectItem(item, select); if ( changed ) @@ -158,7 +158,7 @@ bool wxVListBox::Select(size_t item, bool select) bool wxVListBox::SelectRange(size_t from, size_t to) { wxCHECK_MSG( m_selStore, false, - _T("SelectRange() may only be used with multiselection listbox") ); + wxT("SelectRange() may only be used with multiselection listbox") ); // make sure items are in correct order if ( from > to ) @@ -169,7 +169,7 @@ bool wxVListBox::SelectRange(size_t from, size_t to) } wxCHECK_MSG( to < GetItemCount(), false, - _T("SelectRange(): invalid item index") ); + wxT("SelectRange(): invalid item index") ); wxArrayInt changed; if ( !m_selStore->SelectRange(from, to, true, &changed) ) @@ -201,7 +201,7 @@ bool wxVListBox::SelectRange(size_t from, size_t to) bool wxVListBox::DoSelectAll(bool select) { wxCHECK_MSG( m_selStore, false, - _T("SelectAll may only be used with multiselection listbox") ); + wxT("SelectAll may only be used with multiselection listbox") ); size_t count = GetItemCount(); if ( count ) @@ -224,7 +224,7 @@ bool wxVListBox::DoSetCurrent(int current) { wxASSERT_MSG( current == wxNOT_FOUND || (current >= 0 && (size_t)current < GetItemCount()), - _T("wxVListBox::DoSetCurrent(): invalid item index") ); + wxT("wxVListBox::DoSetCurrent(): invalid item index") ); if ( current == m_current ) { @@ -270,7 +270,7 @@ void wxVListBox::InitEvent(wxCommandEvent& event, int n) void wxVListBox::SendSelectedEvent() { wxASSERT_MSG( m_current != wxNOT_FOUND, - _T("SendSelectedEvent() shouldn't be called") ); + wxT("SendSelectedEvent() shouldn't be called") ); wxCommandEvent event(wxEVT_COMMAND_LISTBOX_SELECTED, GetId()); InitEvent(event, m_current); @@ -281,7 +281,7 @@ void wxVListBox::SetSelection(int selection) { wxCHECK_RET( selection == wxNOT_FOUND || (selection >= 0 && (size_t)selection < GetItemCount()), - _T("wxVListBox::SetSelection(): invalid item index") ); + wxT("wxVListBox::SetSelection(): invalid item index") ); if ( HasMultipleSelection() ) { @@ -311,7 +311,7 @@ int wxVListBox::GetFirstSelected(unsigned long& cookie) const int wxVListBox::GetNextSelected(unsigned long& cookie) const { wxCHECK_MSG( m_selStore, wxNOT_FOUND, - _T("GetFirst/NextSelected() may only be used with multiselection listboxes") ); + wxT("GetFirst/NextSelected() may only be used with multiselection listboxes") ); while ( cookie < GetItemCount() ) { diff --git a/src/generic/vscroll.cpp b/src/generic/vscroll.cpp index a4256ef804..a98c29da79 100644 --- a/src/generic/vscroll.cpp +++ b/src/generic/vscroll.cpp @@ -144,7 +144,7 @@ bool wxVarScrollHelperEvtHandler::ProcessEvent(wxEvent& event) wxVarScrollHelperBase::wxVarScrollHelperBase(wxWindow *win) { - wxASSERT_MSG( win, _T("associated window can't be NULL in wxVarScrollHelperBase") ); + wxASSERT_MSG( win, wxT("associated window can't be NULL in wxVarScrollHelperBase") ); #if wxUSE_MOUSEWHEEL m_sumWheelRotation = 0; @@ -332,7 +332,7 @@ size_t wxVarScrollHelperBase::GetNewScrollPosition(wxScrollWinEvent& event) cons } // unknown scroll event? - wxFAIL_MSG( _T("unknown scroll event type?") ); + wxFAIL_MSG( wxT("unknown scroll event type?") ); return 0; } @@ -476,7 +476,7 @@ void wxVarScrollHelperBase::RefreshUnit(size_t unit) void wxVarScrollHelperBase::RefreshUnits(size_t from, size_t to) { - wxASSERT_MSG( from <= to, _T("RefreshUnits(): empty range") ); + wxASSERT_MSG( from <= to, wxT("RefreshUnits(): empty range") ); // clump the range to just the visible units -- it is useless to refresh // the other ones @@ -817,7 +817,7 @@ void wxVarHVScrollHelper::RefreshRowsColumns(size_t fromRow, size_t toRow, size_t fromColumn, size_t toColumn) { wxASSERT_MSG( fromRow <= toRow || fromColumn <= toColumn, - _T("RefreshRowsColumns(): empty range") ); + wxT("RefreshRowsColumns(): empty range") ); // clump the range to just the visible units -- it is useless to refresh // the other ones @@ -965,7 +965,7 @@ bool wxVarVScrollLegacyAdaptor::ScrollPages(int pages) wxCoord wxVarVScrollLegacyAdaptor::OnGetLineHeight(size_t WXUNUSED(n)) const { - wxFAIL_MSG( _T("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") ); + wxFAIL_MSG( wxT("OnGetLineHeight() must be overridden if OnGetRowHeight() isn't!") ); return -1; } diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 1ad3a17c6f..e7b62f581f 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -369,8 +369,8 @@ void wxWizard::AddStaticLine(wxBoxSizer *mainColumn) void wxWizard::AddBackNextPair(wxBoxSizer *buttonRow) { wxASSERT_MSG( m_btnNext && m_btnPrev, - _T("You must create the buttons before calling ") - _T("wxWizard::AddBackNextPair") ); + wxT("You must create the buttons before calling ") + wxT("wxWizard::AddBackNextPair") ); // margin between Back and Next buttons #ifdef __WXMAC__ @@ -778,7 +778,7 @@ void wxWizard::OnBackOrNext(wxCommandEvent& event) (event.GetEventObject() == m_btnPrev), wxT("unknown button") ); - wxCHECK_RET( m_page, _T("should have a valid current page") ); + wxCHECK_RET( m_page, wxT("should have a valid current page") ); // ask the current page first: notice that we do it before calling // GetNext/Prev() because the data transfered from the controls of the page diff --git a/src/gtk/aboutdlg.cpp b/src/gtk/aboutdlg.cpp index 1cc3136bf6..b2da06fe52 100644 --- a/src/gtk/aboutdlg.cpp +++ b/src/gtk/aboutdlg.cpp @@ -189,7 +189,7 @@ void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* WXUNUSED(parent)) const size_t count = translators.size(); for ( size_t n = 0; n < count; n++ ) { - transCredits << translators[n] << _T('\n'); + transCredits << translators[n] << wxT('\n'); } } else // no translators explicitely specified diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index c510079d6e..a627c8ee22 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -311,9 +311,9 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_) // (1) this variable exists for the sole purpose of specifying the encoding // of the filenames for GTK+ programs, so use it if it is set - wxString encName(wxGetenv(_T("G_FILENAME_ENCODING"))); - encName = encName.BeforeFirst(_T(',')); - if (encName.CmpNoCase(_T("@locale")) == 0) + wxString encName(wxGetenv(wxT("G_FILENAME_ENCODING"))); + encName = encName.BeforeFirst(wxT(',')); + if (encName.CmpNoCase(wxT("@locale")) == 0) encName.clear(); encName.MakeUpper(); #if wxUSE_INTL @@ -323,13 +323,13 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_) // filenames in this locale too encName = wxLocale::GetSystemEncodingName().Upper(); // (3) finally use UTF-8 by default - if (encName.empty() || encName == _T("US-ASCII")) - encName = _T("UTF-8"); - wxSetEnv(_T("G_FILENAME_ENCODING"), encName); + if (encName.empty() || encName == wxT("US-ASCII")) + encName = wxT("UTF-8"); + wxSetEnv(wxT("G_FILENAME_ENCODING"), encName); } #else if (encName.empty()) - encName = _T("UTF-8"); + encName = wxT("UTF-8"); // if wxUSE_INTL==0 it probably indicates that only "C" locale is supported // by the program anyhow so prevent GTK+ from calling setlocale(LC_ALL, "") diff --git a/src/gtk/brush.cpp b/src/gtk/brush.cpp index c0d8490553..e7ba31b30d 100644 --- a/src/gtk/brush.cpp +++ b/src/gtk/brush.cpp @@ -104,21 +104,21 @@ bool wxBrush::operator==(const wxBrush& brush) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, _T("invalid brush") ); + wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } diff --git a/src/gtk/checkbox.cpp b/src/gtk/checkbox.cpp index 17c3ff9548..b4043d6030 100644 --- a/src/gtk/checkbox.cpp +++ b/src/gtk/checkbox.cpp @@ -67,7 +67,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb) } else { - wxFAIL_MSG(_T("3state wxCheckBox in unexpected state!")); + wxFAIL_MSG(wxT("3state wxCheckBox in unexpected state!")); } cb->GTKEnableEvents(); diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index fa6221e50a..759985b65b 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -129,7 +129,7 @@ int wxChoice::DoInsertItems(const wxArrayStringsAdapter & items, wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid control") ); wxASSERT_MSG( !IsSorted() || (pos == GetCount()), - _T("In a sorted choice data could only be appended")); + wxT("In a sorted choice data could only be appended")); const int count = items.GetCount(); @@ -187,7 +187,7 @@ void wxChoice::DoClear() void wxChoice::DoDeleteOneItem(unsigned int n) { wxCHECK_RET( m_widget != NULL, wxT("invalid control") ); - wxCHECK_RET( IsValid(n), _T("invalid index in wxChoice::Delete") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxChoice::Delete") ); GtkComboBox* combobox = GTK_COMBO_BOX( m_widget ); GtkTreeModel* model = gtk_combo_box_get_model( combobox ); diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 538a80e7af..d812143ab5 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -53,7 +53,7 @@ extern GdkAtom g_altTextAtom; // the trace mask we use with wxLogTrace() - call // wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here // (there will be a *lot* of them!) -#define TRACE_CLIPBOARD _T("clipboard") +#define TRACE_CLIPBOARD wxT("clipboard") // ---------------------------------------------------------------------------- // wxClipboardSync: used to perform clipboard operations synchronously @@ -69,7 +69,7 @@ class wxClipboardSync public: wxClipboardSync(wxClipboard& clipboard) { - wxASSERT_MSG( !ms_clipboard, _T("reentrancy in clipboard code") ); + wxASSERT_MSG( !ms_clipboard, wxT("reentrancy in clipboard code") ); ms_clipboard = &clipboard; } @@ -84,7 +84,7 @@ public: static void OnDone(wxClipboard * WXUNUSED_UNLESS_DEBUG(clipboard)) { wxASSERT_MSG( clipboard == ms_clipboard, - _T("got notification for alien clipboard") ); + wxT("got notification for alien clipboard") ); ms_clipboard = NULL; } @@ -138,7 +138,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget), if ( strcmp(wxGtkString(gdk_atom_name(type)), "TARGETS") != 0 ) { wxLogTrace( TRACE_CLIPBOARD, - _T("got unsupported clipboard target") ); + wxT("got unsupported clipboard target") ); return; } @@ -274,7 +274,7 @@ selection_handler( GtkWidget *WXUNUSED(widget), (guchar*)&(timestamp), sizeof(timestamp)); wxLogTrace(TRACE_CLIPBOARD, - _T("Clipboard TIMESTAMP requested, returning timestamp=%u"), + wxT("Clipboard TIMESTAMP requested, returning timestamp=%u"), timestamp); return; } @@ -282,7 +282,7 @@ selection_handler( GtkWidget *WXUNUSED(widget), wxDataFormat format( selection_data->target ); wxLogTrace(TRACE_CLIPBOARD, - _T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"), + wxT("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"), format.GetId().c_str(), wxString::FromAscii(wxGtkString(gdk_atom_name(selection_data->target))).c_str(), wxString::FromAscii(wxGtkString(gdk_atom_name(selection_data->type))).c_str(), @@ -328,10 +328,10 @@ selection_handler( GtkWidget *WXUNUSED(widget), void wxClipboard::GTKOnSelectionReceived(const GtkSelectionData& sel) { - wxCHECK_RET( m_receivedData, _T("should be inside GetData()") ); + wxCHECK_RET( m_receivedData, wxT("should be inside GetData()") ); const wxDataFormat format(sel.target); - wxLogTrace(TRACE_CLIPBOARD, _T("Received selection %s"), + wxLogTrace(TRACE_CLIPBOARD, wxT("Received selection %s"), format.GetId().c_str()); if ( !m_receivedData->IsSupportedFormat(format) ) @@ -375,7 +375,7 @@ async_targets_selection_received( GtkWidget *WXUNUSED(widget), if ( strcmp(wxGtkString(gdk_atom_name(type)), "TARGETS") != 0 ) { wxLogTrace( TRACE_CLIPBOARD, - _T("got unsupported clipboard target") ); + wxT("got unsupported clipboard target") ); clipboard->m_sink->QueueEvent( event ); clipboard->m_sink.Release(); @@ -499,8 +499,8 @@ bool wxClipboard::SetSelectionOwner(bool set) if ( !rc ) { - wxLogTrace(TRACE_CLIPBOARD, _T("Failed to %sset selection owner"), - set ? _T("") : _T("un")); + wxLogTrace(TRACE_CLIPBOARD, wxT("Failed to %sset selection owner"), + set ? wxT("") : wxT("un")); } return rc; diff --git a/src/gtk/colordlg.cpp b/src/gtk/colordlg.cpp index 8eaca8bc78..7ffd6045f2 100644 --- a/src/gtk/colordlg.cpp +++ b/src/gtk/colordlg.cpp @@ -77,7 +77,7 @@ int wxColourDialog::ShowModal() switch (result) { default: - wxFAIL_MSG(_T("unexpected GtkColorSelectionDialog return code")); + wxFAIL_MSG(wxT("unexpected GtkColorSelectionDialog return code")); // fall through case GTK_RESPONSE_CANCEL: diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index 60974b785a..85fcee3185 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -540,7 +540,7 @@ wxgtk_tree_model_get_column_type (GtkTreeModel *tree_model, else { gtype = G_TYPE_STRING; - // wxFAIL_MSG( _T("non-string columns not supported yet") ); + // wxFAIL_MSG( wxT("non-string columns not supported yet") ); } return gtype; @@ -591,7 +591,7 @@ wxgtk_tree_model_get_value (GtkTreeModel *tree_model, } else { - wxFAIL_MSG( _T("non-string columns not supported yet") ); + wxFAIL_MSG( wxT("non-string columns not supported yet") ); } } diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 234a38f278..2ab02fcdaa 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -419,7 +419,7 @@ void wxWindowDCImpl::SetUpDC( bool isMemDC ) void wxWindowDCImpl::DoGetSize( int* width, int* height ) const { - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); + wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") ); m_window->GetSize(width, height); } @@ -1778,7 +1778,7 @@ wxCoord wxWindowDCImpl::GetCharWidth() const wxCoord wxWindowDCImpl::GetCharHeight() const { PangoFontMetrics *metrics = pango_context_get_metrics (m_context, m_fontdesc, pango_context_get_language(m_context)); - wxCHECK_MSG( metrics, -1, _T("failed to get pango font metrics") ); + wxCHECK_MSG( metrics, -1, wxT("failed to get pango font metrics") ); wxCoord h = PANGO_PIXELS (pango_font_metrics_get_descent (metrics) + pango_font_metrics_get_ascent (metrics)); @@ -2299,7 +2299,7 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner ) wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *win ) : wxWindowDCImpl( owner, win ) { - wxCHECK_RET( win, _T("NULL window in wxClientDCImpl::wxClientDC") ); + wxCHECK_RET( win, wxT("NULL window in wxClientDCImpl::wxClientDC") ); #ifdef __WXUNIVERSAL__ wxPoint ptOrigin = win->GetClientAreaOrigin(); @@ -2312,7 +2312,7 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *win ) void wxClientDCImpl::DoGetSize(int *width, int *height) const { - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); + wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") ); m_window->GetClientSize( width, height ); } diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index c20ffea62d..360a255a0a 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -351,7 +351,7 @@ static gboolean target_drag_drop( GtkWidget *widget, GdkAtom format = drop_target->GtkGetMatchingPair(); // this does happen somehow, see bug 555111 - wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") ); + wxCHECK_MSG( format, FALSE, wxT("no matching GdkAtom for format?") ); /* GdkDragAction action = GDK_ACTION_MOVE; diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index 838ddec1aa..c54fa804d2 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -98,7 +98,7 @@ bool wxGUIEventLoop::Pending() const bool wxGUIEventLoop::Dispatch() { - wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") ); + wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") ); // gtk_main_iteration() returns TRUE only if gtk_main_quit() was called return !gtk_main_iteration(); diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp index a1df8d00e5..83b7c23ff1 100644 --- a/src/gtk/fontdlg.cpp +++ b/src/gtk/fontdlg.cpp @@ -129,7 +129,7 @@ bool wxFontDialog::DoCreate(wxWindow *parent) else { // this is not supposed to happen! - wxFAIL_MSG(_T("font is ok but no native font info?")); + wxFAIL_MSG(wxT("font is ok but no native font info?")); } } diff --git a/src/gtk/gauge.cpp b/src/gtk/gauge.cpp index 2d29922938..91ab64a351 100644 --- a/src/gtk/gauge.cpp +++ b/src/gtk/gauge.cpp @@ -62,7 +62,7 @@ bool wxGauge::Create( wxWindow *parent, void wxGauge::DoSetGauge() { wxASSERT_MSG( 0 <= m_gaugePos && m_gaugePos <= m_rangeMax, - _T("invalid gauge position in DoSetGauge()") ); + wxT("invalid gauge position in DoSetGauge()") ); gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (m_widget), m_rangeMax ? ((double)m_gaugePos)/m_rangeMax : 0.0); @@ -90,7 +90,7 @@ void wxGauge::SetRange( int range ) void wxGauge::SetValue( int pos ) { - wxCHECK_RET( pos <= m_rangeMax, _T("invalid value in wxGauge::SetValue()") ); + wxCHECK_RET( pos <= m_rangeMax, wxT("invalid value in wxGauge::SetValue()") ); m_gaugePos = pos; diff --git a/src/gtk/glcanvas.cpp b/src/gtk/glcanvas.cpp index c8b805cc00..2525acf3e9 100644 --- a/src/gtk/glcanvas.cpp +++ b/src/gtk/glcanvas.cpp @@ -205,7 +205,7 @@ bool wxGLCanvas::Create(wxWindow *parent, const int *attribList, const wxPalette& WXUNUSED_UNLESS_DEBUG(palette)) { - wxASSERT_MSG( !palette.IsOk(), _T("palettes not supported") ); + wxASSERT_MSG( !palette.IsOk(), wxT("palettes not supported") ); m_exposed = false; m_noExpose = true; diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index 842f157f5c..2d56e77d82 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -620,7 +620,7 @@ int wxListBox::GtkGetIndexFor(GtkTreeIter& iter) const gint* pIntPath = gtk_tree_path_get_indices(path); - wxCHECK_MSG( pIntPath, wxNOT_FOUND, _T("failed to get iterator path") ); + wxCHECK_MSG( pIntPath, wxNOT_FOUND, wxT("failed to get iterator path") ); int idx = pIntPath[0]; @@ -707,7 +707,7 @@ void wxListBox::SetString(unsigned int n, const wxString& label) // and update the model which will refresh the tree too GtkTreeIter iter; - wxCHECK_RET( GtkGetIteratorFor(n, &iter), _T("failed to get iterator") ); + wxCHECK_RET( GtkGetIteratorFor(n, &iter), wxT("failed to get iterator") ); // FIXME: this resets the checked status of a wxCheckListBox item diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index a0a65e89c2..9d8c346e33 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -652,7 +652,7 @@ void wxMenuItem::Check( bool check ) break; default: - wxFAIL_MSG( _T("can't check this item") ); + wxFAIL_MSG( wxT("can't check this item") ); } } diff --git a/src/gtk/msgdlg.cpp b/src/gtk/msgdlg.cpp index cca4971b6e..3b94755b95 100644 --- a/src/gtk/msgdlg.cpp +++ b/src/gtk/msgdlg.cpp @@ -255,7 +255,7 @@ int wxMessageDialog::ShowModal() { GTKCreateMsgDialog(); wxCHECK_MSG( m_widget, wxID_CANCEL, - _T("failed to create GtkMessageDialog") ); + wxT("failed to create GtkMessageDialog") ); } // This should be necessary, but otherwise the @@ -271,7 +271,7 @@ int wxMessageDialog::ShowModal() switch (result) { default: - wxFAIL_MSG(_T("unexpected GtkMessageDialog return code")); + wxFAIL_MSG(wxT("unexpected GtkMessageDialog return code")); // fall through case GTK_RESPONSE_CANCEL: diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index 1ace65dc16..d2920aff50 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -373,7 +373,7 @@ bool wxNotebook::InsertPage( size_t position, wxT("Can't add a page whose parent is not the notebook!") ); wxCHECK_MSG( position <= GetPageCount(), false, - _T("invalid page index in wxNotebookPage::InsertPage()") ); + wxT("invalid page index in wxNotebookPage::InsertPage()") ); // Hack Alert! (Part II): See above in wxNotebook::AddChildGTK // why this has to be done. diff --git a/src/gtk/region.cpp b/src/gtk/region.cpp index e58d23498d..50f0ab0a5d 100644 --- a/src/gtk/region.cpp +++ b/src/gtk/region.cpp @@ -179,7 +179,7 @@ bool wxRegion::DoUnionWithRect(const wxRect& r) bool wxRegion::DoUnionWithRegion( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -198,7 +198,7 @@ bool wxRegion::DoUnionWithRegion( const wxRegion& region ) bool wxRegion::DoIntersect( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -215,7 +215,7 @@ bool wxRegion::DoIntersect( const wxRegion& region ) bool wxRegion::DoSubtract( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -232,7 +232,7 @@ bool wxRegion::DoSubtract( const wxRegion& region ) bool wxRegion::DoXor( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -422,28 +422,28 @@ wxRegionIterator wxRegionIterator::operator ++ (int) wxCoord wxRegionIterator::GetX() const { - wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") ); return m_rects[m_current].x; } wxCoord wxRegionIterator::GetY() const { - wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") ); return m_rects[m_current].y; } wxCoord wxRegionIterator::GetW() const { - wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") ); return m_rects[m_current].width; } wxCoord wxRegionIterator::GetH() const { - wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") ); return m_rects[m_current].height; } diff --git a/src/gtk/scrolwin.cpp b/src/gtk/scrolwin.cpp index 245ecc7200..b13658fd23 100644 --- a/src/gtk/scrolwin.cpp +++ b/src/gtk/scrolwin.cpp @@ -141,7 +141,7 @@ void wxScrollHelper::DoScrollOneDir(int orient, void wxScrollHelper::DoScroll( int x_pos, int y_pos ) { - wxCHECK_RET( m_targetWindow != 0, _T("No target window") ); + wxCHECK_RET( m_targetWindow != 0, wxT("No target window") ); DoScrollOneDir(wxHORIZONTAL, x_pos, m_xScrollPixelsPerLine, &m_xScrollPosition); DoScrollOneDir(wxVERTICAL, y_pos, m_yScrollPixelsPerLine, &m_yScrollPosition); diff --git a/src/gtk/settings.cpp b/src/gtk/settings.cpp index 89cb46dbad..c1e14c9464 100644 --- a/src/gtk/settings.cpp +++ b/src/gtk/settings.cpp @@ -228,7 +228,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) case wxSYS_COLOUR_MAX: default: - wxFAIL_MSG( _T("unknown system colour index") ); + wxFAIL_MSG( wxT("unknown system colour index") ); color = *wxWHITE; break; } diff --git a/src/gtk/slider.cpp b/src/gtk/slider.cpp index e620468043..52e12014c7 100644 --- a/src/gtk/slider.cpp +++ b/src/gtk/slider.cpp @@ -100,7 +100,7 @@ static inline wxEventType GtkScrollTypeToWx(int scrollType) eventType = wxEVT_SCROLL_THUMBTRACK; break; default: - wxFAIL_MSG(_T("Unknown GtkScrollType")); + wxFAIL_MSG(wxT("Unknown GtkScrollType")); eventType = wxEVT_NULL; break; } diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index 179f2aecf9..5a675ea8d0 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -622,7 +622,7 @@ void wxToolBar::DoSetToggle(wxToolBarToolBase * WXUNUSED(tool), bool WXUNUSED(toggle)) { // VZ: absolutely no idea about how to do it - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); } // ---------------------------------------------------------------------------- @@ -646,7 +646,7 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) const { // VZ: GTK+ doesn't seem to have such thing - wxFAIL_MSG( _T("wxToolBar::FindToolForPosition() not implemented") ); + wxFAIL_MSG( wxT("wxToolBar::FindToolForPosition() not implemented") ); return NULL; } diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index 25186c9d1e..81a1502eb4 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -243,10 +243,10 @@ static void wxGtkTextApplyTagsFromAttr(GtkWidget *text, const wxArrayInt& tabs = attr.GetTabs(); - wxString tagname = _T("WXTABS"); + wxString tagname = wxT("WXTABS"); g_snprintf(buf, sizeof(buf), "WXTABS"); for (size_t i = 0; i < tabs.GetCount(); i++) - tagname += wxString::Format(_T(" %d"), tabs[i]); + tagname += wxString::Format(wxT(" %d"), tabs[i]); const wxWX2MBbuf buftag = tagname.utf8_str(); @@ -1613,7 +1613,7 @@ void wxTextCtrl::ChangeFontGlobally() // // TODO: it can be implemented much more efficiently for GTK2 wxASSERT_MSG( IsMultiLine(), - _T("shouldn't be called for single line controls") ); + wxT("shouldn't be called for single line controls") ); wxString value = GetValue(); if ( !value.empty() ) @@ -1665,7 +1665,7 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style ) gint l = gtk_text_buffer_get_char_count( m_buffer ); wxCHECK_MSG( start >= 0 && end <= l, false, - _T("invalid range in wxTextCtrl::SetStyle") ); + wxT("invalid range in wxTextCtrl::SetStyle") ); GtkTextIter starti, endi; gtk_text_buffer_get_iter_at_offset( m_buffer, &starti, start ); diff --git a/src/gtk/textentry.cpp b/src/gtk/textentry.cpp index 20abc5559b..1e0bd52389 100644 --- a/src/gtk/textentry.cpp +++ b/src/gtk/textentry.cpp @@ -52,7 +52,7 @@ wx_gtk_insert_text_callback(GtkEditable *editable, // we should only be called if we have a max len limit at all GtkEntry *entry = GTK_ENTRY (editable); - wxCHECK_RET( entry->text_max_length, _T("shouldn't be called") ); + wxCHECK_RET( entry->text_max_length, wxT("shouldn't be called") ); // check that we don't overflow the max length limit // diff --git a/src/gtk/timer.cpp b/src/gtk/timer.cpp index 228e3e1f6e..86d5395f58 100644 --- a/src/gtk/timer.cpp +++ b/src/gtk/timer.cpp @@ -55,7 +55,7 @@ bool wxGTKTimerImpl::Start(int millisecs, bool oneShot) if ( !wxTimerImpl::Start(millisecs, oneShot) ) return false; - wxASSERT_MSG( !m_sourceId, _T("shouldn't be still running") ); + wxASSERT_MSG( !m_sourceId, wxT("shouldn't be still running") ); m_sourceId = g_timeout_add(m_milli, timeout_callback, this); @@ -64,7 +64,7 @@ bool wxGTKTimerImpl::Start(int millisecs, bool oneShot) void wxGTKTimerImpl::Stop() { - wxASSERT_MSG( m_sourceId, _T("should be running") ); + wxASSERT_MSG( m_sourceId, wxT("should be running") ); g_source_remove(m_sourceId); m_sourceId = 0; diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 5400a73d6a..3bac808b96 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -662,7 +662,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK() if (m_grabbed) { - wxFAIL_MSG(_T("Window still grabbed")); + wxFAIL_MSG(wxT("Window still grabbed")); RemoveGrab(); } @@ -1230,7 +1230,7 @@ static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region) bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) { wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, - _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); + wxT("Shaped windows must be created with the wxFRAME_SHAPED style.")); if ( GTK_WIDGET_REALIZED(m_widget) ) { diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index 73d152d248..a2abf1d037 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -421,7 +421,7 @@ bool wxGUIAppTraits::ShowAssertDialog(const wxString& msg) break; default: - wxFAIL_MSG( _T("unexpected return code from GtkAssertDialog") ); + wxFAIL_MSG( wxT("unexpected return code from GtkAssertDialog") ); } gtk_widget_destroy(dialog); @@ -435,7 +435,7 @@ bool wxGUIAppTraits::ShowAssertDialog(const wxString& msg) wxString wxGUIAppTraits::GetDesktopEnvironment() const { - wxString de = wxSystemOptions::GetOption(_T("gtk.desktop")); + wxString de = wxSystemOptions::GetOption(wxT("gtk.desktop")); #if wxUSE_DETECT_SM if ( de.empty() ) { @@ -484,18 +484,18 @@ wxString wxGetNameFromGtkOptionEntry(const GOptionEntry *opt) wxString ret; if (opt->short_name) - ret << _T("-") << opt->short_name; + ret << wxT("-") << opt->short_name; if (opt->long_name) { if (!ret.empty()) - ret << _T(", "); - ret << _T("--") << opt->long_name; + ret << wxT(", "); + ret << wxT("--") << opt->long_name; if (opt->arg_description) - ret << _T("=") << opt->arg_description; + ret << wxT("=") << opt->arg_description; } - return _T(" ") + ret; + return wxT(" ") + ret; } #endif // __WXGTK26__ diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index b72018c1df..99b012592d 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -228,7 +228,7 @@ int g_lastButtonNumber = 0; //----------------------------------------------------------------------------- // the trace mask used for the focus debugging messages -#define TRACE_FOCUS _T("focus") +#define TRACE_FOCUS wxT("focus") //----------------------------------------------------------------------------- // missing gdk functions @@ -383,7 +383,7 @@ inline bool wxIsUpperChar(int code) // set WXTRACE to this to see the key event codes on the console -#define TRACE_KEYS _T("keyevent") +#define TRACE_KEYS wxT("keyevent") // translates an X key symbol to WXK_XXX value // @@ -714,9 +714,9 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, KeySym keysym = gdk_event->keyval; - wxLogTrace(TRACE_KEYS, _T("Key %s event: keysym = %ld"), - event.GetEventType() == wxEVT_KEY_UP ? _T("release") - : _T("press"), + wxLogTrace(TRACE_KEYS, wxT("Key %s event: keysym = %ld"), + event.GetEventType() == wxEVT_KEY_UP ? wxT("release") + : wxT("press"), keysym); long key_code = wxTranslateKeySymToWXKey(keysym, false /* !isChar */); @@ -745,7 +745,7 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, Display *dpy = (Display *)wxGetDisplay(); KeyCode keycode = XKeysymToKeycode(dpy, keysym); - wxLogTrace(TRACE_KEYS, _T("\t-> keycode %d"), keycode); + wxLogTrace(TRACE_KEYS, wxT("\t-> keycode %d"), keycode); KeySym keysymNormalized = XKeycodeToKeysym(dpy, keycode, 0); @@ -784,7 +784,7 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, } } - wxLogTrace(TRACE_KEYS, _T("\t-> wxKeyCode %ld"), key_code); + wxLogTrace(TRACE_KEYS, wxT("\t-> wxKeyCode %ld"), key_code); // sending unknown key events doesn't really make sense if ( !key_code ) @@ -857,7 +857,7 @@ gtk_window_key_press_callback( GtkWidget *WXUNUSED(widget), win->m_imData->lastKeyEvent = NULL; if (intercepted_by_IM) { - wxLogTrace(TRACE_KEYS, _T("Key event intercepted by IM")); + wxLogTrace(TRACE_KEYS, wxT("Key event intercepted by IM")); return TRUE; } } @@ -919,7 +919,7 @@ gtk_window_key_press_callback( GtkWidget *WXUNUSED(widget), if ( key_code ) { - wxLogTrace(TRACE_KEYS, _T("Char event: %ld"), key_code); + wxLogTrace(TRACE_KEYS, wxT("Char event: %ld"), key_code); event.m_keyCode = key_code; @@ -996,7 +996,7 @@ gtk_wxwindow_commit_cb (GtkIMContext * WXUNUSED(context), event.m_uniChar = *pstr; // Backward compatible for ISO-8859-1 event.m_keyCode = *pstr < 256 ? event.m_uniChar : 0; - wxLogTrace(TRACE_KEYS, _T("IM sent character '%c'"), event.m_uniChar); + wxLogTrace(TRACE_KEYS, wxT("IM sent character '%c'"), event.m_uniChar); #else event.m_keyCode = (char)*pstr; #endif // wxUSE_UNICODE @@ -3170,14 +3170,14 @@ void wxWindowGTK::SetFocus() !GTK_WIDGET_CAN_FOCUS(widget) ) { wxLogTrace(TRACE_FOCUS, - _T("Setting focus to a child of %s(%p, %s)"), + wxT("Setting focus to a child of %s(%p, %s)"), GetClassInfo()->GetClassName(), this, GetLabel().c_str()); gtk_widget_child_focus(widget, GTK_DIR_TAB_FORWARD); } else { wxLogTrace(TRACE_FOCUS, - _T("Setting focus to %s(%p, %s)"), + wxT("Setting focus to %s(%p, %s)"), GetClassInfo()->GetClassName(), this, GetLabel().c_str()); gtk_widget_grab_focus(widget); } @@ -3271,7 +3271,7 @@ wxLayoutDirection wxWindowGTK::GTKGetLayout(GtkWidget *widget) /* static */ void wxWindowGTK::GTKSetLayout(GtkWidget *widget, wxLayoutDirection dir) { - wxASSERT_MSG( dir != wxLayout_Default, _T("invalid layout direction") ); + wxASSERT_MSG( dir != wxLayout_Default, wxT("invalid layout direction") ); gtk_widget_set_direction(widget, dir == wxLayout_RightToLeft ? GTK_TEXT_DIR_RTL @@ -3328,14 +3328,14 @@ bool wxWindowGTK::DoNavigateIn(int flags) { if ( flags & wxNavigationKeyEvent::WinChange ) { - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); return false; } else // navigate inside the container { wxWindow *parent = wxGetTopLevelParent((wxWindow *)this); - wxCHECK_MSG( parent, false, _T("every window must have a TLW parent") ); + wxCHECK_MSG( parent, false, wxT("every window must have a TLW parent") ); GtkDirectionType dir; dir = flags & wxNavigationKeyEvent::IsForward ? GTK_DIR_TAB_FORWARD @@ -3477,7 +3477,7 @@ void wxWindowGTK::GTKUpdateCursor() GdkWindow *win = windowsThis[n]; if ( !win ) { - wxFAIL_MSG(_T("NULL window returned by GTKGetWindow()?")); + wxFAIL_MSG(wxT("NULL window returned by GTKGetWindow()?")); continue; } @@ -3513,7 +3513,7 @@ wxWindowGTK::ScrollDir wxWindowGTK::ScrollDirFromRange(GtkRange *range) const return (ScrollDir)dir; } - wxFAIL_MSG( _T("event from unknown scrollbar received") ); + wxFAIL_MSG( wxT("event from unknown scrollbar received") ); return ScrollDir_Max; } @@ -4113,7 +4113,7 @@ void wxWindowGTK::DoCaptureMouse() else window = GetConnectWidget()->window; - wxCHECK_RET( window, _T("CaptureMouse() failed") ); + wxCHECK_RET( window, wxT("CaptureMouse() failed") ); const wxCursor* cursor = &m_cursor; if (!cursor->Ok()) @@ -4179,7 +4179,7 @@ void wxWindowGTK::SetScrollbar(int orient, { const int dir = ScrollDirFromOrient(orient); GtkRange* const sb = m_scrollBar[dir]; - wxCHECK_RET( sb, _T("this window is not scrollable") ); + wxCHECK_RET( sb, wxT("this window is not scrollable") ); if (range <= 0) { @@ -4208,7 +4208,7 @@ void wxWindowGTK::SetScrollPos(int orient, int pos, bool WXUNUSED(refresh)) { const int dir = ScrollDirFromOrient(orient); GtkRange * const sb = m_scrollBar[dir]; - wxCHECK_RET( sb, _T("this window is not scrollable") ); + wxCHECK_RET( sb, wxT("this window is not scrollable") ); // This check is more than an optimization. Without it, the slider // will not move smoothly while tracking when using wxScrollHelper. @@ -4228,7 +4228,7 @@ void wxWindowGTK::SetScrollPos(int orient, int pos, bool WXUNUSED(refresh)) int wxWindowGTK::GetScrollThumb(int orient) const { GtkRange * const sb = m_scrollBar[ScrollDirFromOrient(orient)]; - wxCHECK_MSG( sb, 0, _T("this window is not scrollable") ); + wxCHECK_MSG( sb, 0, wxT("this window is not scrollable") ); return wxRound(sb->adjustment->page_size); } @@ -4236,7 +4236,7 @@ int wxWindowGTK::GetScrollThumb(int orient) const int wxWindowGTK::GetScrollPos( int orient ) const { GtkRange * const sb = m_scrollBar[ScrollDirFromOrient(orient)]; - wxCHECK_MSG( sb, 0, _T("this window is not scrollable") ); + wxCHECK_MSG( sb, 0, wxT("this window is not scrollable") ); return wxRound(sb->adjustment->value); } @@ -4244,7 +4244,7 @@ int wxWindowGTK::GetScrollPos( int orient ) const int wxWindowGTK::GetScrollRange( int orient ) const { GtkRange * const sb = m_scrollBar[ScrollDirFromOrient(orient)]; - wxCHECK_MSG( sb, 0, _T("this window is not scrollable") ); + wxCHECK_MSG( sb, 0, wxT("this window is not scrollable") ); return wxRound(sb->adjustment->upper); } diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 81632fb1a1..66fced32c3 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -246,7 +246,7 @@ int wxPoll(wxPollFd *ufds, unsigned int nfds, int timeout) unsigned int i; for ( i = 0; i < nfds; i++ ) { - wxASSERT_MSG( ufds[i].fd < FD_SETSIZE, _T("fd out of range") ); + wxASSERT_MSG( ufds[i].fd < FD_SETSIZE, wxT("fd out of range") ); if ( ufds[i].events & G_IO_IN ) wxFD_SET(ufds[i].fd, &readfds); diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index dba5a517fb..109450dc55 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -267,7 +267,7 @@ wxBitmapRefData::wxBitmapRefData(const wxBitmapRefData& data) #if wxUSE_PALETTE wxASSERT_MSG( !data.m_palette, - _T("copying bitmaps palette not implemented") ); + wxT("copying bitmaps palette not implemented") ); #endif // wxUSE_PALETTE diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp index eb5606cfea..d38da098ab 100644 --- a/src/gtk1/brush.cpp +++ b/src/gtk1/brush.cpp @@ -111,21 +111,21 @@ bool wxBrush::operator == ( const wxBrush& brush ) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, _T("invalid brush") ); + wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index fad9868841..5c29d0930c 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -228,7 +228,7 @@ void wxChoice::DoDeleteOneItem(unsigned int n) { wxCHECK_RET( m_widget != NULL, wxT("invalid choice") ); - wxCHECK_RET( IsValid(n), _T("invalid index in wxChoice::Delete") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxChoice::Delete") ); // if the item to delete is before the selection, and the selection is valid if (((int)n < m_selection_hack) && (m_selection_hack != wxNOT_FOUND)) diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp index 320b335854..6ff7ed1192 100644 --- a/src/gtk1/clipbrd.cpp +++ b/src/gtk1/clipbrd.cpp @@ -83,7 +83,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget), if ( strcmp(atom_name, "TARGETS") ) { wxLogTrace( TRACE_CLIPBOARD, - _T("got unsupported clipboard target") ); + wxT("got unsupported clipboard target") ); clipboard->m_waiting = false; g_free(atom_name); @@ -257,7 +257,7 @@ selection_handler( GtkWidget *WXUNUSED(widget), (guchar*)&(timestamp), sizeof(timestamp)); wxLogTrace(TRACE_CLIPBOARD, - _T("Clipboard TIMESTAMP requested, returning timestamp=%u"), + wxT("Clipboard TIMESTAMP requested, returning timestamp=%u"), timestamp); return; } @@ -265,7 +265,7 @@ selection_handler( GtkWidget *WXUNUSED(widget), wxDataFormat format( selection_data->target ); wxLogTrace(TRACE_CLIPBOARD, - _T("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"), + wxT("clipboard data in format %s, GtkSelectionData is target=%s type=%s selection=%s timestamp=%u"), format.GetId().c_str(), wxString::FromAscii(gdk_atom_name(selection_data->target)).c_str(), wxString::FromAscii(gdk_atom_name(selection_data->type)).c_str(), diff --git a/src/gtk1/control.cpp b/src/gtk1/control.cpp index 4e0db419e6..4216708175 100644 --- a/src/gtk1/control.cpp +++ b/src/gtk1/control.cpp @@ -134,7 +134,7 @@ wxString wxControl::GTKRemoveMnemonics(const wxString& label) { wxChar ch = label[i]; - if ( ch == _T('&') ) + if ( ch == wxT('&') ) { if ( i == len - 1 ) { @@ -144,7 +144,7 @@ wxString wxControl::GTKRemoveMnemonics(const wxString& label) } ch = label[++i]; // skip '&' itself - if ( ch == _T('&') ) + if ( ch == wxT('&') ) { // special case: "&&" is not a mnemonic at all but just an // escaped "&" diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp index 927d7e14da..7fc4bb83dc 100644 --- a/src/gtk1/dataobj.cpp +++ b/src/gtk1/dataobj.cpp @@ -251,12 +251,12 @@ bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf) if ( (*p == '\r' && *(p+1) == '\n') || !*p ) { size_t lenPrefix = 5; // strlen("file:") - if ( filename.Left(lenPrefix).MakeLower() == _T("file:") ) + if ( filename.Left(lenPrefix).MakeLower() == wxT("file:") ) { // sometimes the syntax is "file:filename", sometimes it's // URL-like: "file://filename" - deal with both - if ( filename[lenPrefix] == _T('/') && - filename[lenPrefix + 1] == _T('/') ) + if ( filename[lenPrefix] == wxT('/') && + filename[lenPrefix + 1] == wxT('/') ) { // skip the slashes lenPrefix += 2; @@ -267,7 +267,7 @@ bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf) } else { - wxLogDebug(_T("Unsupported URI '%s' in wxFileDataObject"), + wxLogDebug(wxT("Unsupported URI '%s' in wxFileDataObject"), filename.c_str()); } diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 73f7c3e9d8..5b5774bbab 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -90,9 +90,9 @@ void gdk_wx_draw_bitmap(GdkDrawable *drawable, gint width, gint height) { - wxCHECK_RET( drawable, _T("NULL drawable in gdk_wx_draw_bitmap") ); - wxCHECK_RET( src, _T("NULL src in gdk_wx_draw_bitmap") ); - wxCHECK_RET( gc, _T("NULL gc in gdk_wx_draw_bitmap") ); + wxCHECK_RET( drawable, wxT("NULL drawable in gdk_wx_draw_bitmap") ); + wxCHECK_RET( src, wxT("NULL src in gdk_wx_draw_bitmap") ); + wxCHECK_RET( gc, wxT("NULL gc in gdk_wx_draw_bitmap") ); GdkWindowPrivate *drawable_private; GdkWindowPrivate *src_private; @@ -423,7 +423,7 @@ void wxWindowDCImpl::SetUpDC() void wxWindowDCImpl::DoGetSize( int* width, int* height ) const { - wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") ); + wxCHECK_RET( m_owner, wxT("GetSize() doesn't work without window") ); m_owner->GetSize(width, height); } @@ -2189,7 +2189,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxClientDCImpl, wxWindowDCImpl) wxClientDCImpl::wxClientDCImpl(wxDC *owner, wxWindow *win) : wxWindowDCImpl(owner, win) { - wxCHECK_RET( win, _T("NULL window in wxClientDCImpl::wxClientDCImpl") ); + wxCHECK_RET( win, wxT("NULL window in wxClientDCImpl::wxClientDCImpl") ); #ifdef __WXUNIVERSAL__ wxPoint ptOrigin = win->GetClientAreaOrigin(); @@ -2201,7 +2201,7 @@ wxClientDCImpl::wxClientDCImpl(wxDC *owner, wxWindow *win) void wxClientDCImpl::DoGetSize(int *width, int *height) const { - wxCHECK_RET( m_owner, _T("GetSize() doesn't work without window") ); + wxCHECK_RET( m_owner, wxT("GetSize() doesn't work without window") ); m_owner->GetClientSize( width, height ); } diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index ade45b2cfc..5f3b30f9fa 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -49,7 +49,7 @@ static long gs_flagsForDrag = 0; // the trace mask we use with wxLogTrace() - call // wxLog::AddTraceMask(TRACE_DND) to enable the trace messages from here // (there are quite a few of them, so don't enable this by default) -#define TRACE_DND _T("dnd") +#define TRACE_DND wxT("dnd") // global variables because GTK+ DnD want to have the // mouse event that caused it @@ -358,7 +358,7 @@ static gboolean target_drag_drop( GtkWidget *widget, GdkAtom format = drop_target->GetMatchingPair(); // this does happen somehow, see bug 555111 - wxCHECK_MSG( format, FALSE, _T("no matching GdkAtom for format?") ); + wxCHECK_MSG( format, FALSE, wxT("no matching GdkAtom for format?") ); /* GdkDragAction action = GDK_ACTION_MOVE; diff --git a/src/gtk1/evtloop.cpp b/src/gtk1/evtloop.cpp index 9ada3a18c9..194e553bed 100644 --- a/src/gtk1/evtloop.cpp +++ b/src/gtk1/evtloop.cpp @@ -62,13 +62,13 @@ private: wxGUIEventLoop::~wxGUIEventLoop() { - wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") ); + wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") ); } int wxGUIEventLoop::Run() { // event loops are not recursive, you need to create another loop! - wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); + wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") ); wxEventLoopActivator activate(this); @@ -87,7 +87,7 @@ int wxGUIEventLoop::Run() void wxGUIEventLoop::Exit(int rc) { - wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); + wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") ); m_impl->SetExitCode(rc); @@ -112,7 +112,7 @@ bool wxGUIEventLoop::Pending() const bool wxGUIEventLoop::Dispatch() { - wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") ); + wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") ); gtk_main_iteration(); diff --git a/src/gtk1/font.cpp b/src/gtk1/font.cpp index 9bce28f617..d04f27e413 100644 --- a/src/gtk1/font.cpp +++ b/src/gtk1/font.cpp @@ -179,17 +179,17 @@ void wxFontRefData::InitFromNative() m_weight = wxFONTWEIGHT_NORMAL; wxString w = m_nativeFontInfo.GetXFontComponent(wxXLFD_WEIGHT).Upper(); - if ( !w.empty() && w != _T('*') ) + if ( !w.empty() && w != wxT('*') ) { // the test below catches all of BOLD, EXTRABOLD, DEMIBOLD, ULTRABOLD // and BLACK - if ( ((w[0u] == _T('B') && (!wxStrcmp(w.c_str() + 1, wxT("OLD")) || + if ( ((w[0u] == wxT('B') && (!wxStrcmp(w.c_str() + 1, wxT("OLD")) || !wxStrcmp(w.c_str() + 1, wxT("LACK"))))) || - wxStrstr(w.c_str() + 1, _T("BOLD")) ) + wxStrstr(w.c_str() + 1, wxT("BOLD")) ) { m_weight = wxFONTWEIGHT_BOLD; } - else if ( w == _T("LIGHT") || w == _T("THIN") ) + else if ( w == wxT("LIGHT") || w == wxT("THIN") ) { m_weight = wxFONTWEIGHT_LIGHT; } @@ -198,11 +198,11 @@ void wxFontRefData::InitFromNative() switch ( wxToupper(m_nativeFontInfo. GetXFontComponent(wxXLFD_SLANT)[0u]).GetValue() ) { - case _T('I'): // italique + case wxT('I'): // italique m_style = wxFONTSTYLE_ITALIC; break; - case _T('O'): // oblique + case wxT('O'): // oblique m_style = wxFONTSTYLE_SLANT; break; @@ -224,7 +224,7 @@ void wxFontRefData::InitFromNative() // examine the spacing: if the font is monospaced, assume wxTELETYPE // family for compatibility with the old code which used it instead of // IsFixedWidth() - if ( m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING).Upper() == _T('M') ) + if ( m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING).Upper() == wxT('M') ) { m_family = wxFONTFAMILY_TELETYPE; } @@ -243,7 +243,7 @@ void wxFontRefData::InitFromNative() registry = m_nativeFontInfo.GetXFontComponent(wxXLFD_REGISTRY).Upper(), encoding = m_nativeFontInfo.GetXFontComponent(wxXLFD_ENCODING).Upper(); - if ( registry == _T("ISO8859") ) + if ( registry == wxT("ISO8859") ) { int cp; if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 ) @@ -251,7 +251,7 @@ void wxFontRefData::InitFromNative() m_encoding = (wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1); } } - else if ( registry == _T("MICROSOFT") ) + else if ( registry == wxT("MICROSOFT") ) { int cp; if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 ) @@ -259,7 +259,7 @@ void wxFontRefData::InitFromNative() m_encoding = (wxFontEncoding)(wxFONTENCODING_CP1250 + cp); } } - else if ( registry == _T("KOI8") ) + else if ( registry == wxT("KOI8") ) { m_encoding = wxFONTENCODING_KOI8; } @@ -337,9 +337,9 @@ void wxFontRefData::SetPointSize(int pointSize) { wxString size; if ( pointSize == -1 ) - size = _T('*'); + size = wxT('*'); else - size.Printf(_T("%d"), 10*pointSize); + size.Printf(wxT("%d"), 10*pointSize); m_nativeFontInfo.SetXFontComponent(wxXLFD_POINTSIZE, size); } @@ -362,19 +362,19 @@ void wxFontRefData::SetStyle(wxFontStyle style) switch ( style ) { case wxFONTSTYLE_ITALIC: - slant = _T('i'); + slant = wxT('i'); break; case wxFONTSTYLE_SLANT: - slant = _T('o'); + slant = wxT('o'); break; default: - wxFAIL_MSG( _T("unknown font style") ); + wxFAIL_MSG( wxT("unknown font style") ); // fall through case wxFONTSTYLE_NORMAL: - slant = _T('r'); + slant = wxT('r'); } m_nativeFontInfo.SetXFontComponent(wxXLFD_SLANT, slant); @@ -391,20 +391,20 @@ void wxFontRefData::SetWeight(wxFontWeight weight) switch ( weight ) { case wxFONTWEIGHT_BOLD: - boldness = _T("bold"); + boldness = wxT("bold"); break; case wxFONTWEIGHT_LIGHT: - boldness = _T("light"); + boldness = wxT("light"); break; default: - wxFAIL_MSG( _T("unknown font weight") ); + wxFAIL_MSG( wxT("unknown font weight") ); // fall through case wxFONTWEIGHT_NORMAL: // unspecified - boldness = _T("medium"); + boldness = wxT("medium"); } m_nativeFontInfo.SetXFontComponent(wxXLFD_WEIGHT, boldness); @@ -612,7 +612,7 @@ bool wxFont::IsFixedWidth() const wxString spacing = M_FONTDATA-> m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING); - return spacing.Upper() == _T('M'); + return spacing.Upper() == wxT('M'); } return wxFontBase::IsFixedWidth(); diff --git a/src/gtk1/fontdlg.cpp b/src/gtk1/fontdlg.cpp index 03d12f1e9f..4a26646450 100644 --- a/src/gtk1/fontdlg.cpp +++ b/src/gtk1/fontdlg.cpp @@ -164,7 +164,7 @@ bool wxFontDialog::DoCreate(wxWindow *parent) else { // this is not supposed to happen! - wxFAIL_MSG(_T("font is ok but no native font info?")); + wxFAIL_MSG(wxT("font is ok but no native font info?")); } } diff --git a/src/gtk1/gauge.cpp b/src/gtk1/gauge.cpp index a68d74215f..4c6fcb5278 100644 --- a/src/gtk1/gauge.cpp +++ b/src/gtk1/gauge.cpp @@ -60,7 +60,7 @@ bool wxGauge::Create( wxWindow *parent, void wxGauge::DoSetGauge() { wxASSERT_MSG( 0 <= m_gaugePos && m_gaugePos <= m_rangeMax, - _T("invalid gauge position in DoSetGauge()") ); + wxT("invalid gauge position in DoSetGauge()") ); gtk_progress_bar_update( GTK_PROGRESS_BAR(m_widget), m_rangeMax ? ((float)m_gaugePos)/m_rangeMax : 0.); @@ -88,7 +88,7 @@ void wxGauge::SetRange( int range ) void wxGauge::SetValue( int pos ) { - wxCHECK_RET( pos <= m_rangeMax, _T("invalid value in wxGauge::SetValue()") ); + wxCHECK_RET( pos <= m_rangeMax, wxT("invalid value in wxGauge::SetValue()") ); m_gaugePos = pos; diff --git a/src/gtk1/mdi.cpp b/src/gtk1/mdi.cpp index 250bd2dd1b..5e83afe2c2 100644 --- a/src/gtk1/mdi.cpp +++ b/src/gtk1/mdi.cpp @@ -267,7 +267,7 @@ wxMDIChildFrame *wxMDIParentFrame::GetActiveChild() const { wxMDIChildFrame *child_frame = wxDynamicCast( node->GetData(), wxMDIChildFrame ); - wxASSERT_MSG( child_frame, _T("child is not a wxMDIChildFrame") ); + wxASSERT_MSG( child_frame, wxT("child is not a wxMDIChildFrame") ); if (child_frame->m_page == page) return child_frame; diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 5d65aa257d..a14e6b063a 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -579,7 +579,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu ) /* should find it for normal (not popup) menu */ wxASSERT_MSG( (id != -1) || (menu->GetInvokingWindow() != NULL), - _T("menu item not found in gtk_menu_clicked_callback") ); + wxT("menu item not found in gtk_menu_clicked_callback") ); if (!menu->IsEnabled(id)) return; @@ -902,7 +902,7 @@ void wxMenuItem::Check( bool check ) break; default: - wxFAIL_MSG( _T("can't check this item") ); + wxFAIL_MSG( wxT("can't check this item") ); } } @@ -1037,7 +1037,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos) } default: - wxFAIL_MSG( _T("unexpected menu item kind") ); + wxFAIL_MSG( wxT("unexpected menu item kind") ); // fall through case wxITEM_NORMAL: diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 22e96ee172..1b821aad1e 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -90,7 +90,7 @@ static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget), // are you trying to call SetSelection() from a notebook event handler? // you shouldn't! wxCHECK_RET( !notebook->m_inSwitchPage, - _T("gtk_notebook_page_change_callback reentered") ); + wxT("gtk_notebook_page_change_callback reentered") ); notebook->m_inSwitchPage = true; if (g_isIdle) @@ -230,7 +230,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk if (sel == -1) return TRUE; wxGtkNotebookPage *nb_page = notebook->GetNotebookPage(sel); - wxCHECK_MSG( nb_page, FALSE, _T("invalid selection in wxNotebook") ); + wxCHECK_MSG( nb_page, FALSE, wxT("invalid selection in wxNotebook") ); wxNavigationKeyEvent event; event.SetEventObject( notebook ); @@ -589,7 +589,7 @@ bool wxNotebook::DeleteAllPages() while (m_pagesData.GetCount() > 0) DeletePage( m_pagesData.GetCount()-1 ); - wxASSERT_MSG( GetPageCount() == 0, _T("all pages must have been deleted") ); + wxASSERT_MSG( GetPageCount() == 0, wxT("all pages must have been deleted") ); InvalidateBestSize(); return wxNotebookBase::DeleteAllPages(); @@ -641,7 +641,7 @@ bool wxNotebook::InsertPage( size_t position, wxT("Can't add a page whose parent is not the notebook!") ); wxCHECK_MSG( position <= GetPageCount(), FALSE, - _T("invalid page index in wxNotebookPage::InsertPage()") ); + wxT("invalid page index in wxNotebookPage::InsertPage()") ); // Hack Alert! (Part II): See above in wxInsertChildInNotebook callback // why this has to be done. NOTE: using gtk_widget_unparent here does not diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index 1a5c86feec..1c576da328 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -145,10 +145,10 @@ static gint gtk_radiobutton_focus_out( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxRadioBox *win ) { - // wxASSERT_MSG( win->m_hasFocus, _T("got focus out without any focus in?") ); + // wxASSERT_MSG( win->m_hasFocus, wxT("got focus out without any focus in?") ); // Replace with a warning, else we dump core a lot! // if (!win->m_hasFocus) - // wxLogWarning(_T("Radiobox got focus out without any focus in.") ); + // wxLogWarning(wxT("Radiobox got focus out without any focus in.") ); // we might have lost the focus, but may be not - it may have just gone to // another button in the same radiobox, so we'll check for it in the next diff --git a/src/gtk1/region.cpp b/src/gtk1/region.cpp index ab656a06db..d128d9f973 100644 --- a/src/gtk1/region.cpp +++ b/src/gtk1/region.cpp @@ -219,7 +219,7 @@ bool wxRegion::DoUnionWithRegion( const wxRegion& region ) bool wxRegion::DoIntersect( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -238,7 +238,7 @@ bool wxRegion::DoIntersect( const wxRegion& region ) bool wxRegion::DoSubtract( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -257,7 +257,7 @@ bool wxRegion::DoSubtract( const wxRegion& region ) bool wxRegion::DoXor( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -474,28 +474,28 @@ wxRegionIterator wxRegionIterator::operator ++ (int) wxCoord wxRegionIterator::GetX() const { - wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") ); return ((wxRIRefData*)m_refData)->m_rects[m_current].x; } wxCoord wxRegionIterator::GetY() const { - wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") ); return ((wxRIRefData*)m_refData)->m_rects[m_current].y; } wxCoord wxRegionIterator::GetW() const { - wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") ); return ((wxRIRefData*)m_refData)->m_rects[m_current].width; } wxCoord wxRegionIterator::GetH() const { - wxCHECK_MSG( HaveRects(), 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( HaveRects(), 0, wxT("invalid wxRegionIterator") ); return ((wxRIRefData*)m_refData)->m_rects[m_current].height; } diff --git a/src/gtk1/scrolwin.cpp b/src/gtk1/scrolwin.cpp index 3cfc31fd0b..e771fd7f0f 100644 --- a/src/gtk1/scrolwin.cpp +++ b/src/gtk1/scrolwin.cpp @@ -171,7 +171,7 @@ void wxScrollHelper::DoScrollOneDir(int orient, void wxScrollHelper::DoScroll( int x_pos, int y_pos ) { - wxCHECK_RET( m_targetWindow != 0, _T("No target window") ); + wxCHECK_RET( m_targetWindow != 0, wxT("No target window") ); DoScrollOneDir(wxHORIZONTAL, m_win->m_hAdjust, x_pos, m_xScrollPixelsPerLine, &m_xScrollPosition); diff --git a/src/gtk1/settings.cpp b/src/gtk1/settings.cpp index 34887192ba..00222f1de6 100644 --- a/src/gtk1/settings.cpp +++ b/src/gtk1/settings.cpp @@ -82,7 +82,7 @@ static bool GetColourFromGTKWidget(int& red, int& green, int& blue, switch ( type ) { default: - wxFAIL_MSG( _T("unexpected GTK widget type") ); + wxFAIL_MSG( wxT("unexpected GTK widget type") ); // fall through case wxGTK_BUTTON: @@ -108,7 +108,7 @@ static bool GetColourFromGTKWidget(int& red, int& green, int& blue, switch ( colour ) { default: - wxFAIL_MSG( _T("unexpected GTK colour type") ); + wxFAIL_MSG( wxT("unexpected GTK colour type") ); // fall through case wxGTK_FG: @@ -325,7 +325,7 @@ wxColour wxSystemSettingsNative::GetColour( wxSystemColour index ) case wxSYS_COLOUR_MAX: default: - wxFAIL_MSG( _T("unknown system colour index") ); + wxFAIL_MSG( wxT("unknown system colour index") ); } return *wxWHITE; diff --git a/src/gtk1/tbargtk.cpp b/src/gtk1/tbargtk.cpp index 9924462303..be2f5ff3c6 100644 --- a/src/gtk1/tbargtk.cpp +++ b/src/gtk1/tbargtk.cpp @@ -112,7 +112,7 @@ public: return GTK_TOOLBAR_CHILD_RADIOBUTTON; default: - wxFAIL_MSG( _T("unknown toolbar child type") ); + wxFAIL_MSG( wxT("unknown toolbar child type") ); // fall through case wxITEM_NORMAL: @@ -439,7 +439,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) if ( !tool->m_item ) { - wxFAIL_MSG( _T("gtk_toolbar_insert_element() failed") ); + wxFAIL_MSG( wxT("gtk_toolbar_insert_element() failed") ); return false; } @@ -543,7 +543,7 @@ void wxToolBar::DoSetToggle(wxToolBarToolBase * WXUNUSED(tool), bool WXUNUSED(toggle)) { // VZ: absolutely no idea about how to do it - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); } // ---------------------------------------------------------------------------- @@ -554,7 +554,7 @@ wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) const { // VZ: GTK+ doesn't seem to have such thing - wxFAIL_MSG( _T("wxToolBar::FindToolForPosition() not implemented") ); + wxFAIL_MSG( wxT("wxToolBar::FindToolForPosition() not implemented") ); return NULL; } diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 547c804242..41caee9f64 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -102,7 +102,7 @@ gtk_insert_text_callback(GtkEditable *editable, // we should only be called if we have a max len limit at all GtkEntry *entry = GTK_ENTRY (editable); - wxCHECK_RET( entry->text_max_length, _T("shouldn't be called") ); + wxCHECK_RET( entry->text_max_length, wxT("shouldn't be called") ); // check that we don't overflow the max length limit // @@ -190,7 +190,7 @@ static void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect) if ( loop && !loop->IsYielding() ) { wxCHECK_RET( gs_gtk_text_draw != wxgtk_text_draw, - _T("infinite recursion in wxgtk_text_draw aborted") ); + wxT("infinite recursion in wxgtk_text_draw aborted") ); gs_gtk_text_draw(widget, rect); } @@ -818,7 +818,7 @@ void wxTextCtrl::SetSelection( long from, long to ) !GTK_TEXT(m_text)->line_start_cache ) { // tell the programmer that it didn't work - wxLogDebug(_T("Can't call SetSelection() before realizing the control")); + wxLogDebug(wxT("Can't call SetSelection() before realizing the control")); return; } @@ -1073,7 +1073,7 @@ void wxTextCtrl::ChangeFontGlobally() // possible! wxASSERT_MSG( (m_windowStyle & wxTE_MULTILINE) && m_updateFont, - _T("shouldn't be called for single line controls") ); + wxT("shouldn't be called for single line controls") ); wxString value = GetValue(); if ( !value.empty() ) @@ -1147,7 +1147,7 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style ) gint l = gtk_text_get_length( GTK_TEXT(m_text) ); wxCHECK_MSG( start >= 0 && end <= l, false, - _T("invalid range in wxTextCtrl::SetStyle") ); + wxT("invalid range in wxTextCtrl::SetStyle") ); gint old_pos = gtk_editable_get_position( GTK_EDITABLE(m_text) ); char *text = gtk_editable_get_chars( GTK_EDITABLE(m_text), start, end ); diff --git a/src/gtk1/timer.cpp b/src/gtk1/timer.cpp index b90de7064c..f099957c69 100644 --- a/src/gtk1/timer.cpp +++ b/src/gtk1/timer.cpp @@ -47,7 +47,7 @@ bool wxGTKTimerImpl::Start(int millisecs, bool oneShot) if ( !wxTimerImpl::Start(millisecs, oneShot) ) return false; - wxASSERT_MSG( m_tag == -1, _T("shouldn't be still running") ); + wxASSERT_MSG( m_tag == -1, wxT("shouldn't be still running") ); m_tag = gtk_timeout_add( m_milli, timeout_callback, this ); @@ -56,7 +56,7 @@ bool wxGTKTimerImpl::Start(int millisecs, bool oneShot) void wxGTKTimerImpl::Stop() { - wxASSERT_MSG( m_tag != -1, _T("should be running") ); + wxASSERT_MSG( m_tag != -1, wxT("should be running") ); gtk_timeout_remove( m_tag ); m_tag = -1; diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 370903718b..19067668d0 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -656,7 +656,7 @@ wxTopLevelWindowGTK::~wxTopLevelWindowGTK() { if (m_grabbed) { - wxASSERT_MSG( false, _T("Window still grabbed")); + wxASSERT_MSG( false, wxT("Window still grabbed")); RemoveGrab(); } @@ -1043,8 +1043,8 @@ void wxTopLevelWindowGTK::OnInternalIdle() if ( g_delayedFocus && wxGetTopLevelParent((wxWindow*)g_delayedFocus) == this ) { - wxLogTrace(_T("focus"), - _T("Setting focus from wxTLW::OnIdle() to %s(%s)"), + wxLogTrace(wxT("focus"), + wxT("Setting focus from wxTLW::OnIdle() to %s(%s)"), g_delayedFocus->GetClassInfo()->GetClassName(), g_delayedFocus->GetLabel().c_str()); @@ -1119,12 +1119,12 @@ void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons ) void wxTopLevelWindowGTK::Maximize(bool WXUNUSED(maximize)) { - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); } bool wxTopLevelWindowGTK::IsMaximized() const { - // wxFAIL_MSG( _T("not implemented") ); + // wxFAIL_MSG( wxT("not implemented") ); // This is an approximation return false; @@ -1132,7 +1132,7 @@ bool wxTopLevelWindowGTK::IsMaximized() const void wxTopLevelWindowGTK::Restore() { - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); } void wxTopLevelWindowGTK::Iconize( bool iconize ) @@ -1142,7 +1142,7 @@ void wxTopLevelWindowGTK::Iconize( bool iconize ) GdkWindow *window = m_widget->window; // you should do it later, for example from OnCreate() handler - wxCHECK_RET( window, _T("frame not created yet - can't iconize") ); + wxCHECK_RET( window, wxT("frame not created yet - can't iconize") ); XIconifyWindow( GDK_WINDOW_XDISPLAY( window ), GDK_WINDOW_XWINDOW( window ), @@ -1210,7 +1210,7 @@ static bool do_shape_combine_region(GdkWindow* window, const wxRegion& region) bool wxTopLevelWindowGTK::SetShape(const wxRegion& region) { wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, - _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); + wxT("Shaped windows must be created with the wxFRAME_SHAPED style.")); GdkWindow *window = NULL; if (m_wxwindow) diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 48d7db1927..2618e11b8c 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -245,7 +245,7 @@ extern bool g_mainThreadLocked; #endif // the trace mask used for the focus debugging messages -#define TRACE_FOCUS _T("focus") +#define TRACE_FOCUS wxT("focus") //----------------------------------------------------------------------------- // missing gdk functions @@ -620,7 +620,7 @@ static void gtk_window_draw_callback( GtkWidget *widget, //----------------------------------------------------------------------------- // set WXTRACE to this to see the key event codes on the console -#define TRACE_KEYS _T("keyevent") +#define TRACE_KEYS wxT("keyevent") // translates an X key symbol to WXK_XXX value // @@ -954,9 +954,9 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, KeySym keysym = gdk_event->keyval; - wxLogTrace(TRACE_KEYS, _T("Key %s event: keysym = %ld"), - event.GetEventType() == wxEVT_KEY_UP ? _T("release") - : _T("press"), + wxLogTrace(TRACE_KEYS, wxT("Key %s event: keysym = %ld"), + event.GetEventType() == wxEVT_KEY_UP ? wxT("release") + : wxT("press"), keysym); long key_code = wxTranslateKeySymToWXKey(keysym, false /* !isChar */); @@ -985,7 +985,7 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, Display *dpy = (Display *)wxGetDisplay(); KeyCode keycode = XKeysymToKeycode(dpy, keysym); - wxLogTrace(TRACE_KEYS, _T("\t-> keycode %d"), keycode); + wxLogTrace(TRACE_KEYS, wxT("\t-> keycode %d"), keycode); KeySym keysymNormalized = XKeycodeToKeysym(dpy, keycode, 0); @@ -1024,7 +1024,7 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, } } - wxLogTrace(TRACE_KEYS, _T("\t-> wxKeyCode %ld"), key_code); + wxLogTrace(TRACE_KEYS, wxT("\t-> wxKeyCode %ld"), key_code); // sending unknown key events doesn't really make sense if ( !key_code ) @@ -1176,7 +1176,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget, if ( key_code ) { - wxLogTrace(TRACE_KEYS, _T("Char event: %ld"), key_code); + wxLogTrace(TRACE_KEYS, wxT("Char event: %ld"), key_code); event.m_keyCode = key_code; @@ -1820,7 +1820,7 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, g_focusWindow = win; wxLogTrace(TRACE_FOCUS, - _T("%s: focus in"), win->GetName().c_str()); + wxT("%s: focus in"), win->GetName().c_str()); #ifdef HAVE_XIM if (win->m_ic) @@ -1868,7 +1868,7 @@ static gint gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget), wxapp_install_idle_handler(); wxLogTrace( TRACE_FOCUS, - _T("%s: focus out"), win->GetName().c_str() ); + wxT("%s: focus out"), win->GetName().c_str() ); wxWindowGTK *winFocus = wxFindFocusedChild(win); @@ -3292,7 +3292,7 @@ void wxWindowGTK::SetFocus() // it should be focused and will do it later, during the idle // time, as soon as we can wxLogTrace(TRACE_FOCUS, - _T("Delaying setting focus to %s(%s)"), + wxT("Delaying setting focus to %s(%s)"), GetClassInfo()->GetClassName(), GetLabel().c_str()); g_delayedFocus = this; @@ -3300,7 +3300,7 @@ void wxWindowGTK::SetFocus() else { wxLogTrace(TRACE_FOCUS, - _T("Setting focus to %s(%s)"), + wxT("Setting focus to %s(%s)"), GetClassInfo()->GetClassName(), GetLabel().c_str()); gtk_widget_grab_focus (m_widget); @@ -3314,7 +3314,7 @@ void wxWindowGTK::SetFocus() else { wxLogTrace(TRACE_FOCUS, - _T("Can't set focus to %s(%s)"), + wxT("Can't set focus to %s(%s)"), GetClassInfo()->GetClassName(), GetLabel().c_str()); } } @@ -3913,7 +3913,7 @@ void wxWindowGTK::DoCaptureMouse() else window = GetConnectWidget()->window; - wxCHECK_RET( window, _T("CaptureMouse() failed") ); + wxCHECK_RET( window, wxT("CaptureMouse() failed") ); const wxCursor* cursor = &m_cursor; if (!cursor->Ok()) diff --git a/src/html/chm.cpp b/src/html/chm.cpp index 584f7fb2cc..6eb0e21dac 100644 --- a/src/html/chm.cpp +++ b/src/html/chm.cpp @@ -103,7 +103,7 @@ wxChmTools::wxChmTools(const wxFileName &archive) { m_chmFileName = archive.GetFullPath(); - wxASSERT_MSG( !m_chmFileName.empty(), _T("empty archive name") ); + wxASSERT_MSG( !m_chmFileName.empty(), wxT("empty archive name") ); m_archive = NULL; m_decompressor = NULL; @@ -435,7 +435,7 @@ wxChmInputStream::wxChmInputStream(const wxString& archive, // if the file could not be located, but was *.hhp, than we create // the content of the hhp-file on the fly and store it for reading // by the application - if ( m_fileName.Find(_T(".hhp")) != wxNOT_FOUND && m_simulateHHP ) + if ( m_fileName.Find(wxT(".hhp")) != wxNOT_FOUND && m_simulateHHP ) { // now we open an hhp-file CreateHHPStream(); @@ -572,7 +572,7 @@ wxChmInputStream::CreateHHPStream() // Try to open the #SYSTEM-File and create the HHP File out of it // see http://bonedaddy.net/pabs3/chmspec/0.1.2/Internal.html#SYSTEM - if ( ! m_chm->Contains(_T("/#SYSTEM")) ) + if ( ! m_chm->Contains(wxT("/#SYSTEM")) ) { #ifdef DEBUG wxLogDebug("Archive doesn't contain #SYSTEM file"); @@ -581,10 +581,10 @@ wxChmInputStream::CreateHHPStream() } else { - file = wxFileName(_T("/#SYSTEM")); + file = wxFileName(wxT("/#SYSTEM")); } - if ( CreateFileStream(_T("/#SYSTEM")) ) + if ( CreateFileStream(wxT("/#SYSTEM")) ) { // New stream for writing a memory area to simulate the // .hhp-file @@ -650,7 +650,7 @@ wxChmInputStream::CreateHHPStream() wxUint32 dummy = *((wxUint32 *)(structptr+0)) ; wxUint32 lcid = wxUINT32_SWAP_ON_BE( dummy ) ; wxString msg ; - msg.Printf(_T("Language=0x%X\r\n"),lcid) ; + msg.Printf(wxT("Language=0x%X\r\n"),lcid) ; out->Write(msg.c_str() , msg.length() ) ; } break ; @@ -676,13 +676,13 @@ wxChmInputStream::CreateHHPStream() free (m_content); // Now add entries which are missing - if ( !hhc && m_chm->Contains(_T("*.hhc")) ) + if ( !hhc && m_chm->Contains(wxT("*.hhc")) ) { tmp = "Contents File=*.hhc\r\n"; out->Write((const void *) tmp, strlen(tmp)); } - if ( !hhk && m_chm->Contains(_T("*.hhk")) ) + if ( !hhk && m_chm->Contains(wxT("*.hhk")) ) { tmp = "Index File=*.hhk\r\n"; out->Write((const void *) tmp, strlen(tmp)); @@ -710,7 +710,7 @@ wxChmInputStream::CreateHHPStream() bool wxChmInputStream::CreateFileStream(const wxString& pattern) { wxFileInputStream * fin; - wxString tmpfile = wxFileName::CreateTempFileName(_T("chmstrm")); + wxString tmpfile = wxFileName::CreateTempFileName(wxT("chmstrm")); if ( tmpfile.empty() ) { @@ -795,8 +795,8 @@ wxChmFSHandler::~wxChmFSHandler() bool wxChmFSHandler::CanOpen(const wxString& location) { wxString p = GetProtocol(location); - return (p == _T("chm")) && - (GetProtocol(GetLeftLocation(location)) == _T("file")); + return (p == wxT("chm")) && + (GetProtocol(GetLeftLocation(location)) == wxT("file")); } wxFSFile* wxChmFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), @@ -809,7 +809,7 @@ wxFSFile* wxChmFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), int index; - if ( GetProtocol(left) != _T("file") ) + if ( GetProtocol(left) != wxT("file") ) { wxLogError(_("CHM handler currently supports only local files!")); return NULL; @@ -817,21 +817,21 @@ wxFSFile* wxChmFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), // Work around javascript wxString tmp = wxString(right); - if ( tmp.MakeLower().Contains(_T("javascipt")) && tmp.Contains(_T("\'")) ) + if ( tmp.MakeLower().Contains(wxT("javascipt")) && tmp.Contains(wxT("\'")) ) { - right = right.AfterFirst(_T('\'')).BeforeLast(_T('\'')); + right = right.AfterFirst(wxT('\'')).BeforeLast(wxT('\'')); } // now work on the right location - if (right.Contains(_T(".."))) + if (right.Contains(wxT(".."))) { wxFileName abs(right); - abs.MakeAbsolute(_T("/")); + abs.MakeAbsolute(wxT("/")); right = abs.GetFullPath(); } // a workaround for absolute links to root - if ( (index=right.Index(_T("//"))) != wxNOT_FOUND ) + if ( (index=right.Index(wxT("//"))) != wxNOT_FOUND ) { right=wxString(right.Mid(index+1)); wxLogWarning(_("Link contained '//', converted to absolute link.")); @@ -845,7 +845,7 @@ wxFSFile* wxChmFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), if ( s ) { return new wxFSFile(s, - left + _T("#chm:") + right, + left + wxT("#chm:") + right, wxEmptyString, GetAnchor(location), wxDateTime(wxFileModificationTime(left))); @@ -866,24 +866,24 @@ wxString wxChmFSHandler::FindFirst(const wxString& spec, int flags) wxString left = GetLeftLocation(spec); wxString nativename = wxFileSystem::URLToFileName(left).GetFullPath(); - if ( GetProtocol(left) != _T("file") ) + if ( GetProtocol(left) != wxT("file") ) { wxLogError(_("CHM handler currently supports only local files!")); return wxEmptyString; } m_chm = new wxChmTools(wxFileName(nativename)); - m_pattern = right.AfterLast(_T('/')); + m_pattern = right.AfterLast(wxT('/')); wxString m_found = m_chm->Find(m_pattern); // now fake around hhp-files which are not existing in projects... if (m_found.empty() && - m_pattern.Contains(_T(".hhp")) && - !m_pattern.Contains(_T(".hhp.cached"))) + m_pattern.Contains(wxT(".hhp")) && + !m_pattern.Contains(wxT(".hhp.cached"))) { - m_found.Printf(_T("%s#chm:%s.hhp"), - left.c_str(), m_pattern.BeforeLast(_T('.')).c_str()); + m_found.Printf(wxT("%s#chm:%s.hhp"), + left.c_str(), m_pattern.BeforeLast(wxT('.')).c_str()); } return m_found; diff --git a/src/html/helpctrl.cpp b/src/html/helpctrl.cpp index c70f5f24aa..d1d37b3801 100644 --- a/src/html/helpctrl.cpp +++ b/src/html/helpctrl.cpp @@ -184,7 +184,7 @@ wxWindow* wxHtmlHelpController::CreateHelpWindow() { m_Config = wxConfigBase::Get(false); if (m_Config != NULL) - m_ConfigRoot = _T("wxWindows/wxHtmlHelpController"); + m_ConfigRoot = wxT("wxWindows/wxHtmlHelpController"); } if (m_FrameStyle & wxHF_DIALOG) diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index 506fc99d8f..5155113810 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -51,11 +51,11 @@ static const wxChar* ReadLine(const wxChar *line, wxChar *buf, size_t bufsize) wxChar *endptr = buf + bufsize - 1; const wxChar *readptr = line; - while (*readptr != 0 && *readptr != _T('\r') && *readptr != _T('\n') && + while (*readptr != 0 && *readptr != wxT('\r') && *readptr != wxT('\n') && writeptr != endptr) *(writeptr++) = *(readptr++); *writeptr = 0; - while (*readptr == _T('\r') || *readptr == _T('\n')) + while (*readptr == wxT('\r') || *readptr == wxT('\n')) readptr++; if (*readptr == 0) return NULL; @@ -255,7 +255,7 @@ wxString wxHtmlHelpDataItem::GetIndentedName() const { wxString s; for (int i = 1; i < level; i++) - s << _T(" "); + s << wxT(" "); s << name; return s; } @@ -476,10 +476,10 @@ void wxHtmlHelpData::SetTempDir(const wxString& path) else { if (wxIsAbsolutePath(path)) m_tempPath = path; - else m_tempPath = wxGetCwd() + _T("/") + path; + else m_tempPath = wxGetCwd() + wxT("/") + path; - if (m_tempPath[m_tempPath.length() - 1] != _T('/')) - m_tempPath << _T('/'); + if (m_tempPath[m_tempPath.length() - 1] != wxT('/')) + m_tempPath << wxT('/'); } } @@ -674,16 +674,16 @@ bool wxHtmlHelpData::AddBook(const wxString& book) for (wxChar *ch = linebuf; *ch != wxT('\0') && *ch != wxT('='); ch++) *ch = (wxChar)wxTolower(*ch); - if (wxStrstr(linebuf, _T("title=")) == linebuf) - title = linebuf + wxStrlen(_T("title=")); - if (wxStrstr(linebuf, _T("default topic=")) == linebuf) - start = linebuf + wxStrlen(_T("default topic=")); - if (wxStrstr(linebuf, _T("index file=")) == linebuf) - index = linebuf + wxStrlen(_T("index file=")); - if (wxStrstr(linebuf, _T("contents file=")) == linebuf) - contents = linebuf + wxStrlen(_T("contents file=")); - if (wxStrstr(linebuf, _T("charset=")) == linebuf) - charset = linebuf + wxStrlen(_T("charset=")); + if (wxStrstr(linebuf, wxT("title=")) == linebuf) + title = linebuf + wxStrlen(wxT("title=")); + if (wxStrstr(linebuf, wxT("default topic=")) == linebuf) + start = linebuf + wxStrlen(wxT("default topic=")); + if (wxStrstr(linebuf, wxT("index file=")) == linebuf) + index = linebuf + wxStrlen(wxT("index file=")); + if (wxStrstr(linebuf, wxT("contents file=")) == linebuf) + contents = linebuf + wxStrlen(wxT("contents file=")); + if (wxStrstr(linebuf, wxT("charset=")) == linebuf) + charset = linebuf + wxStrlen(wxT("charset=")); } while (lineptr != NULL); wxFontEncoding enc = wxFONTENCODING_SYSTEM; @@ -844,11 +844,11 @@ bool wxHtmlSearchStatus::Search() { const wxChar *p1, *p2; for (p1 = thepage.c_str(), p2 = m_LastPage.c_str(); - *p1 != 0 && *p1 != _T('#') && *p1 == *p2; p1++, p2++) {} + *p1 != 0 && *p1 != wxT('#') && *p1 == *p2; p1++, p2++) {} m_LastPage = thepage; - if (*p1 == 0 || *p1 == _T('#')) + if (*p1 == 0 || *p1 == wxT('#')) return false; } else m_LastPage = thepage; @@ -892,7 +892,7 @@ void wxHtmlSearchEngine::LookFor(const wxString& keyword, bool case_sensitive, b static inline bool WHITESPACE(wxChar c) { - return c == _T(' ') || c == _T('\n') || c == _T('\r') || c == _T('\t'); + return c == wxT(' ') || c == wxT('\n') || c == wxT('\r') || c == wxT('\t'); } // replace continuous spaces by one single space @@ -911,7 +911,7 @@ static inline wxString CompressSpaces(const wxString & str) { continue; } - ch = _T(' '); + ch = wxT(' '); space_counted = true; } else @@ -943,19 +943,19 @@ bool wxHtmlSearchEngine::Scan(const wxFSFile& file) wxChar c = *pBufStr; if (insideTag) { - if (c == _T('>')) + if (c == wxT('>')) { insideTag = false; // replace the tag by an empty space - c = _T(' '); + c = wxT(' '); } else continue; } - else if (c == _T('<')) + else if (c == wxT('<')) { wxChar nextCh = *(pBufStr + 1); - if (nextCh == _T('/') || !WHITESPACE(nextCh)) + if (nextCh == wxT('/') || !WHITESPACE(nextCh)) { insideTag = true; continue; @@ -971,10 +971,10 @@ bool wxHtmlSearchEngine::Scan(const wxFSFile& file) if (m_WholeWords) { // insert ' ' at the beginning and at the end - keyword.insert( 0, _T(" ") ); - keyword.append( _T(" ") ); - bufStr.insert( 0, _T(" ") ); - bufStr.append( _T(" ") ); + keyword.insert( 0, wxT(" ") ); + keyword.append( wxT(" ") ); + bufStr.insert( 0, wxT(" ") ); + bufStr.append( wxT(" ") ); } // remove continuous spaces diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp index 2c225df7c0..1bce8024ef 100644 --- a/src/html/helpwnd.cpp +++ b/src/html/helpwnd.cpp @@ -184,7 +184,7 @@ void wxHtmlHelpWindow::UpdateMergedIndex() for (size_t i = 0; i < len; i++) { const wxHtmlHelpDataItem& item = items[i]; - wxASSERT_MSG( item.level < 128, _T("nested index entries too deep") ); + wxASSERT_MSG( item.level < 128, wxT("nested index entries too deep") ); if (history[item.level] && history[item.level]->items[0]->name == item.name) @@ -910,7 +910,7 @@ bool wxHtmlHelpWindow::KeywordSearch(const wxString& keyword, switch ( mode ) { default: - wxFAIL_MSG( _T("unknown help search mode") ); + wxFAIL_MSG( wxT("unknown help search mode") ); // fall back case wxHELP_SEARCH_ALL: @@ -1077,7 +1077,7 @@ void wxHtmlHelpWindow::ReadCustomization(wxConfigBase *cfg, const wxString& path if (path != wxEmptyString) { oldpath = cfg->GetPath(); - cfg->SetPath(_T("/") + path); + cfg->SetPath(wxT("/") + path); } m_Cfg.navig_on = cfg->Read(wxT("hcNavigPanel"), m_Cfg.navig_on) != 0; @@ -1135,7 +1135,7 @@ void wxHtmlHelpWindow::WriteCustomization(wxConfigBase *cfg, const wxString& pat if (path != wxEmptyString) { oldpath = cfg->GetPath(); - cfg->SetPath(_T("/") + path); + cfg->SetPath(wxT("/") + path); } cfg->Write(wxT("hcNavigPanel"), m_Cfg.navig_on); @@ -1215,7 +1215,7 @@ public: 0, NULL, wxCB_DROPDOWN | wxCB_READONLY)); sizer->Add(FontSize = new wxSpinCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, - wxDefaultSize, wxSP_ARROW_KEYS, 2, 100, 2, _T("wxSpinCtrl"))); + wxDefaultSize, wxSP_ARROW_KEYS, 2, 100, 2, wxT("wxSpinCtrl"))); topsizer->Add(sizer, 0, wxLEFT|wxRIGHT|wxTOP, 10); @@ -1251,25 +1251,25 @@ public: wxString content(_("font size")); - content = _T("") + content + _T(" -2
") - _T("") + content + _T(" -1
") - _T("") + content + _T(" +0
") - _T("") + content + _T(" +1
") - _T("") + content + _T(" +2
") - _T("") + content + _T(" +3
") - _T("") + content + _T(" +4
") ; + content = wxT("") + content + wxT(" -2
") + wxT("") + content + wxT(" -1
") + wxT("") + content + wxT(" +0
") + wxT("") + content + wxT(" +1
") + wxT("") + content + wxT(" +2
") + wxT("") + content + wxT(" +3
") + wxT("") + content + wxT(" +4
") ; - content = wxString( _T("
") ) + + content = wxString( wxT("
") ) + _("Normal face
and underlined. ") + _("Italic face. ") + _("Bold face. ") + _("Bold italic face.
") + content + - wxString( _T("
") ) + + wxString( wxT("") ) + _("Fixed size face.
bold italic ") + _("bold italic underlined
") + content + - _T("
"); + wxT("
"); TestWin->SetPage( content ); } @@ -1560,11 +1560,11 @@ void wxHtmlHelpWindow::OnToolbar(wxCommandEvent& event) if (!s.empty()) { wxString ext = s.Right(4).Lower(); - if (ext == _T(".zip") || ext == _T(".htb") || + if (ext == wxT(".zip") || ext == wxT(".htb") || #if wxUSE_LIBMSPACK - ext == _T(".chm") || + ext == wxT(".chm") || #endif - ext == _T(".hhp")) + ext == wxT(".hhp")) { wxBusyCursor bcur; m_Data->AddBook(s); diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index ac6f92f93f..a661db2cc5 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -150,7 +150,7 @@ bool wxHtmlCell::ProcessMouseClick(wxHtmlWindowInterface *window, const wxPoint& pos, const wxMouseEvent& event) { - wxCHECK_MSG( window, false, _T("window interface must be provided") ); + wxCHECK_MSG( window, false, wxT("window interface must be provided") ); #if WXWIN_COMPATIBILITY_2_6 // NB: this hack puts the body of ProcessMouseClick() into OnMouseClick() @@ -164,7 +164,7 @@ bool wxHtmlCell::ProcessMouseClick(wxHtmlWindowInterface *window, void wxHtmlCell::OnMouseClick(wxWindow *, int, int, const wxMouseEvent& event) { - wxCHECK_RET( gs_helperOnMouseClick, _T("unexpected call to OnMouseClick") ); + wxCHECK_RET( gs_helperOnMouseClick, wxT("unexpected call to OnMouseClick") ); wxHtmlWindowInterface *window = gs_helperOnMouseClick->window; const wxPoint& pos = gs_helperOnMouseClick->pos; #endif // WXWIN_COMPATIBILITY_2_6 @@ -342,7 +342,7 @@ bool wxHtmlCell::IsBefore(wxHtmlCell *cell) const } } - wxFAIL_MSG(_T("Cells are in different trees")); + wxFAIL_MSG(wxT("Cells are in different trees")); return false; } @@ -1392,7 +1392,7 @@ bool wxHtmlContainerCell::ProcessMouseClick(wxHtmlWindowInterface *window, void wxHtmlContainerCell::OnMouseClick(wxWindow*, int, int, const wxMouseEvent& event) { - wxCHECK_RET( gs_helperOnMouseClick, _T("unexpected call to OnMouseClick") ); + wxCHECK_RET( gs_helperOnMouseClick, wxT("unexpected call to OnMouseClick") ); wxHtmlWindowInterface *window = gs_helperOnMouseClick->window; const wxPoint& pos = gs_helperOnMouseClick->pos; #endif // WXWIN_COMPATIBILITY_2_6 @@ -1639,7 +1639,7 @@ void wxHtmlWidgetCell::Draw(wxDC& WXUNUSED(dc), wxScrolledWindow *scrolwin = wxDynamicCast(m_Wnd->GetParent(), wxScrolledWindow); wxCHECK_RET( scrolwin, - _T("widget cells can only be placed in wxHtmlWindow") ); + wxT("widget cells can only be placed in wxHtmlWindow") ); scrolwin->GetViewStart(&stx, &sty); m_Wnd->SetSize(absx - wxHTML_SCROLL_STEP * stx, diff --git a/src/html/htmlfilt.cpp b/src/html/htmlfilt.cpp index 9aaa86d4eb..f564086ae4 100644 --- a/src/html/htmlfilt.cpp +++ b/src/html/htmlfilt.cpp @@ -145,7 +145,7 @@ wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const // tag if we used Content-Type header). #if wxUSE_UNICODE int charsetPos; - if ((charsetPos = file.GetMimeType().Find(_T("; charset="))) != wxNOT_FOUND) + if ((charsetPos = file.GetMimeType().Find(wxT("; charset="))) != wxNOT_FOUND) { wxString charset = file.GetMimeType().Mid(charsetPos + 10); wxCSConv conv(charset); @@ -175,7 +175,7 @@ wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const { wxString hdr; wxString mime = file.GetMimeType(); - hdr.Printf(_T(""), mime.c_str()); + hdr.Printf(wxT(""), mime.c_str()); return hdr+doc; } #endif diff --git a/src/html/htmlfilter.cpp b/src/html/htmlfilter.cpp index 218ba79030..87a104c37d 100644 --- a/src/html/htmlfilter.cpp +++ b/src/html/htmlfilter.cpp @@ -61,9 +61,9 @@ wxString wxHtmlFilterPlainText::ReadFile(const wxFSFile& file) const doc = src; delete [] src; - doc.Replace(_T("<"), _T("<"), TRUE); - doc.Replace(_T(">"), _T(">"), TRUE); - doc2 = _T("
\n") + doc + _T("\n
"); + doc.Replace(wxT("<"), wxT("<"), TRUE); + doc.Replace(wxT(">"), wxT(">"), TRUE); + doc2 = wxT("
\n") + doc + wxT("\n
"); return doc2; } @@ -127,7 +127,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(wxT("text/html")) == 0); } diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index 75c98b5147..3f0d762d42 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -38,7 +38,7 @@ // DLL options compatibility check: WX_CHECK_BUILD_OPTIONS("wxHTML") -const wxChar *wxTRACE_HTML_DEBUG = _T("htmldebug"); +const wxChar *wxTRACE_HTML_DEBUG = wxT("htmldebug"); //----------------------------------------------------------------------------- // wxHtmlParser helpers @@ -915,18 +915,18 @@ private: bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag) { - if (tag.GetName() == _T("BODY")) + if (tag.GetName() == wxT("BODY")) { m_Parser->StopParsing(); return false; } - if (tag.HasParam(_T("HTTP-EQUIV")) && - tag.GetParam(_T("HTTP-EQUIV")).IsSameAs(_T("Content-Type"), false) && - tag.HasParam(_T("CONTENT"))) + if (tag.HasParam(wxT("HTTP-EQUIV")) && + tag.GetParam(wxT("HTTP-EQUIV")).IsSameAs(wxT("Content-Type"), false) && + tag.HasParam(wxT("CONTENT"))) { - wxString content = tag.GetParam(_T("CONTENT")).Lower(); - if (content.Left(19) == _T("text/html; charset=")) + wxString content = tag.GetParam(wxT("CONTENT")).Lower(); + if (content.Left(19) == wxT("text/html; charset=")) { *m_retval = content.Mid(19); m_Parser->StopParsing(); @@ -955,7 +955,7 @@ bool wxHtmlParser::SkipCommentTag(wxString::const_iterator& start, wxString::const_iterator end) { - wxASSERT_MSG( *start == '<', _T("should be called on the tag start") ); + wxASSERT_MSG( *start == '<', wxT("should be called on the tag start") ); wxString::const_iterator p = start; diff --git a/src/html/htmltag.cpp b/src/html/htmltag.cpp index 0ad22af893..4cd0412e95 100644 --- a/src/html/htmltag.cpp +++ b/src/html/htmltag.cpp @@ -63,8 +63,8 @@ class wxHtmlTagsCacheData : public wxVector bool wxIsCDATAElement(const wxChar *tag) { - return (wxStrcmp(tag, _T("SCRIPT")) == 0) || - (wxStrcmp(tag, _T("STYLE")) == 0); + return (wxStrcmp(tag, wxT("SCRIPT")) == 0) || + (wxStrcmp(tag, wxT("STYLE")) == 0); } bool wxIsCDATAElement(const wxString& tag) @@ -103,7 +103,7 @@ wxHtmlTagsCache::wxHtmlTagsCache(const wxString& source) { tagBuffer[i] = (wxChar)wxToupper(*pos); } - tagBuffer[i] = _T('\0'); + tagBuffer[i] = wxT('\0'); Cache()[tg].Name = new wxChar[i+1]; memcpy(Cache()[tg].Name, tagBuffer, (i+1)*sizeof(wxChar)); @@ -483,12 +483,12 @@ int wxHtmlTag::ScanParam(const wxString& par, bool wxHtmlTag::GetParamAsColour(const wxString& par, wxColour *clr) const { - wxCHECK_MSG( clr, false, _T("invalid colour argument") ); + wxCHECK_MSG( clr, false, wxT("invalid colour argument") ); wxString str = GetParam(par); // handle colours defined in HTML 4.0 first: - if (str.length() > 1 && str[0] != _T('#')) + if (str.length() > 1 && str[0] != wxT('#')) { #define HTML_COLOUR(name, r, g, b) \ if (str.IsSameAs(wxS(name), false)) \ diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 058804ae6d..f62f6a9353 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -247,7 +247,7 @@ bool wxHtmlWindowMouseHelper::OnCellClicked(wxHtmlCell *cell, { // if the event wasn't handled, do the default processing here: - wxASSERT_MSG( cell, _T("can't be called with NULL cell") ); + wxASSERT_MSG( cell, wxT("can't be called with NULL cell") ); cell->ProcessMouseClick(m_interface, ev.GetPoint(), ev.GetMouseEvent()); } @@ -964,7 +964,7 @@ bool wxHtmlWindow::CopySelection(ClipboardType t) const wxString txt(SelectionToText()); wxTheClipboard->SetData(new wxTextDataObject(txt)); wxTheClipboard->Close(); - wxLogTrace(_T("wxhtmlselection"), + wxLogTrace(wxT("wxhtmlselection"), _("Copied to clipboard:\"%s\""), txt.c_str()); return true; @@ -1403,7 +1403,7 @@ void wxHtmlWindow::OnMouseLeave(wxMouseEvent& event) // but seems to happen sometimes under wxMSW - maybe it's a bug // there but for now just ignore it - //wxFAIL_MSG( _T("can't understand where has mouse gone") ); + //wxFAIL_MSG( wxT("can't understand where has mouse gone") ); return; } diff --git a/src/mgl/app.cpp b/src/mgl/app.cpp index fc87f16acb..113516fe71 100644 --- a/src/mgl/app.cpp +++ b/src/mgl/app.cpp @@ -166,7 +166,7 @@ wxVideoMode wxGetDefaultDisplayMode() unsigned w, h, bpp; if ( !wxGetEnv(wxT("WXMODE"), &mode) || - (wxSscanf(mode.c_str(), _T("%ux%u-%u"), &w, &h, &bpp) != 3) ) + (wxSscanf(mode.c_str(), wxT("%ux%u-%u"), &w, &h, &bpp) != 3) ) { w = 640, h = 480, bpp = 16; } diff --git a/src/mgl/brush.cpp b/src/mgl/brush.cpp index c5f2b03cc0..a03abbfb1c 100644 --- a/src/mgl/brush.cpp +++ b/src/mgl/brush.cpp @@ -144,9 +144,9 @@ wxBrush::wxBrush(const wxColour& col, int style) wxBrush::wxBrush(const wxBitmap &stippleBitmap) { - wxCHECK_RET( stippleBitmap.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( stippleBitmap.Ok(), wxT("invalid bitmap") ); wxCHECK_RET( stippleBitmap.GetWidth() == 8 && stippleBitmap.GetHeight() == 8, - _T("stipple bitmap must be 8x8") ); + wxT("stipple bitmap must be 8x8") ); m_refData = new wxBrushRefData(); M_BRUSHDATA->m_colour = *wxBLACK; @@ -177,21 +177,21 @@ bool wxBrush::operator != (const wxBrush& brush) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, _T("invalid brush") ); + wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } @@ -232,9 +232,9 @@ void wxBrush::SetStipple(const wxBitmap& stipple) { AllocExclusive(); - wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") ); wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, - _T("stipple bitmap must be 8x8") ); + wxT("stipple bitmap must be 8x8") ); M_BRUSHDATA->m_stipple = stipple; wxBitmapToPixPattern(stipple, &(M_BRUSHDATA->m_pixPattern), diff --git a/src/mgl/cursor.cpp b/src/mgl/cursor.cpp index eedb0085dc..7f99c1e987 100644 --- a/src/mgl/cursor.cpp +++ b/src/mgl/cursor.cpp @@ -72,7 +72,7 @@ void wxCursor::InitFromStock(wxStockCursor cursorId) if ( gs_cursorsHash->find(cursorId) != gs_cursorsHash->end() ) { - wxLogTrace(_T("mglcursor"), _T("cursor id %i fetched from cache"), cursorId); + wxLogTrace(wxT("mglcursor"), wxT("cursor id %i fetched from cache"), cursorId); *this = (*gs_cursorsHash)[cursorId]; return; } @@ -135,7 +135,7 @@ void wxCursor::InitFromStock(wxStockCursor cursorId) else { (*gs_cursorsHash)[cursorId] = *this; - wxLogTrace(_T("mglcursor"), _T("cursor id %i added to cache (%s)"), + wxLogTrace(wxT("mglcursor"), wxT("cursor id %i added to cache (%s)"), cursorId, cursorname); } } diff --git a/src/mgl/dc.cpp b/src/mgl/dc.cpp index 7e78af7887..5af342f8b7 100644 --- a/src/mgl/dc.cpp +++ b/src/mgl/dc.cpp @@ -329,7 +329,7 @@ bool wxDC::DoFloodFill(wxCoord x, wxCoord y, bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const { - wxCHECK_MSG( col, false, _T("NULL colour parameter in wxDC::GetPixel")); + wxCHECK_MSG( col, false, wxT("NULL colour parameter in wxDC::GetPixel")); uchar r, g, b; m_MGLDC->unpackColorFast(m_MGLDC->getPixel(XLOG2DEV(x), YLOG2DEV(y)), @@ -983,7 +983,7 @@ void wxDC::SelectMGLFatPen(int style, int flag) pixPattern->p[x][y][2]); break; default: - wxFAIL_MSG(_T("invalid DC depth")); + wxFAIL_MSG(wxT("invalid DC depth")); break; } m_MGLDC->setPenPixmapPattern(slot, &pix); diff --git a/src/mgl/dirmgl.cpp b/src/mgl/dirmgl.cpp index bd6e21b38a..cc28a6aa59 100644 --- a/src/mgl/dirmgl.cpp +++ b/src/mgl/dirmgl.cpp @@ -87,7 +87,7 @@ wxDirData::wxDirData(const wxString& dirname) // throw away the trailing slashes size_t n = m_dirname.length(); - wxCHECK_RET( n, _T("empty dir name in wxDir") ); + wxCHECK_RET( n, wxT("empty dir name in wxDir") ); while ( n > 0 && m_dirname[--n] == wxFILE_SEP_PATH ) {} @@ -104,7 +104,7 @@ void wxDirData::SetFileSpec(const wxString& filespec) { #ifdef __DOS__ if ( filespec.empty() ) - m_filespec = _T("*.*"); + m_filespec = wxT("*.*"); else #endif m_filespec = filespec; @@ -250,7 +250,7 @@ bool wxDir::GetFirst(wxString *filename, const wxString& filespec, int flags) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); M_DIR->Rewind(); @@ -262,9 +262,9 @@ bool wxDir::GetFirst(wxString *filename, bool wxDir::GetNext(wxString *filename) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); - wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") ); + wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") ); return M_DIR->Read(filename); } diff --git a/src/mgl/evtloop.cpp b/src/mgl/evtloop.cpp index 452dbb4e0c..861fc56014 100644 --- a/src/mgl/evtloop.cpp +++ b/src/mgl/evtloop.cpp @@ -109,13 +109,13 @@ bool wxEventLoopImpl::SendIdleEvent() wxGUIEventLoop::~wxGUIEventLoop() { - wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") ); + wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") ); } int wxGUIEventLoop::Run() { // event loops are not recursive, you need to create another loop! - wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); + wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") ); m_impl = new wxEventLoopImpl; @@ -151,7 +151,7 @@ int wxGUIEventLoop::Run() void wxGUIEventLoop::Exit(int rc) { - wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); + wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") ); m_impl->SetExitCode(rc); m_impl->SetKeepLooping(false); @@ -178,7 +178,7 @@ bool wxGUIEventLoop::Pending() const bool wxGUIEventLoop::Dispatch() { - wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") ); + wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") ); m_impl->Dispatch(); return m_impl->GetKeepLooping(); diff --git a/src/mgl/fontmgr.cpp b/src/mgl/fontmgr.cpp index 0f9c957c10..4098d667af 100644 --- a/src/mgl/fontmgr.cpp +++ b/src/mgl/fontmgr.cpp @@ -40,7 +40,7 @@ wxFontInstance::wxFontInstance(float ptSize, bool aa, font_lib_t *fontLib) { m_font = MGL_loadFontInstance(fontLib, ptSize, 0.0, 0.0, aa); - wxASSERT_MSG( m_font, _T("cannot create font instance") ); + wxASSERT_MSG( m_font, wxT("cannot create font instance") ); } wxFontInstance::~wxFontInstance() @@ -59,7 +59,7 @@ void wxFontFace::Acquire() if ( m_refCnt == 1 ) { - wxCHECK_RET( m_fontLib == NULL, _T("font lib already created") ); + wxCHECK_RET( m_fontLib == NULL, wxT("font lib already created") ); wxLogTrace("mgl_font", "opening library '%s'", m_fileName.mb_str()); m_fontLib = MGL_openFontLib(m_fileName.fn_str()); @@ -72,7 +72,7 @@ void wxFontFace::Release() if ( m_refCnt == 0 ) { - wxCHECK_RET( m_fontLib != NULL, _T("font lib not created") ); + wxCHECK_RET( m_fontLib != NULL, wxT("font lib not created") ); wxLogTrace("mgl_font", "closing library '%s'", m_fileName.mb_str()); MGL_closeFontLib(m_fontLib); @@ -107,7 +107,7 @@ wxFontInstance *wxFontFace::GetFontInstance(float ptSize, bool aa) wxFontInstance *wxFontFace::CreateFontInstance(float ptSize, bool aa) { - wxASSERT_MSG( m_fontLib, _T("font library not loaded!") ); + wxASSERT_MSG( m_fontLib, wxT("font library not loaded!") ); return new wxFontInstance(ptSize, aa, m_fontLib); } @@ -156,14 +156,14 @@ wxString wxFontsManager::GetDefaultFacename(wxFontFamily family) const switch ( family ) { case wxSCRIPT: - return _T("Script"); + return wxT("Script"); case wxDECORATIVE: - return _T("Charter"); + return wxT("Charter"); case wxROMAN: - return _T("Times"); + return wxT("Times"); case wxTELETYPE: case wxMODERN: - return _T("Courier"); + return wxT("Courier"); case wxSWISS: case wxDEFAULT: default: diff --git a/src/mgl/fontutil.cpp b/src/mgl/fontutil.cpp index 16a7f0dabc..f58bcc6be6 100644 --- a/src/mgl/fontutil.cpp +++ b/src/mgl/fontutil.cpp @@ -44,7 +44,7 @@ // encoding[;facename] bool wxNativeEncodingInfo::FromString(const wxString& s) { - wxStringTokenizer tokenizer(s, _T(";")); + wxStringTokenizer tokenizer(s, wxT(";")); wxString encid = tokenizer.GetNextToken(); long enc; @@ -64,7 +64,7 @@ wxString wxNativeEncodingInfo::ToString() const s << (long)encoding; if ( !facename.empty() ) { - s << _T(';') << facename; + s << wxT(';') << facename; } return s; @@ -77,7 +77,7 @@ wxString wxNativeEncodingInfo::ToString() const bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info) { - wxCHECK_MSG( info, false, _T("bad pointer in wxGetNativeFontEncoding") ); + wxCHECK_MSG( info, false, wxT("bad pointer in wxGetNativeFontEncoding") ); if ( encoding == wxFONTENCODING_DEFAULT ) { diff --git a/src/mgl/pen.cpp b/src/mgl/pen.cpp index 2f1e42feec..3eff4b729c 100644 --- a/src/mgl/pen.cpp +++ b/src/mgl/pen.cpp @@ -122,9 +122,9 @@ wxPen::wxPen(const wxColour& colour, int width, int style) wxPen::wxPen(const wxBitmap& stipple, int width) { - wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") ); wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, - _T("stipple bitmap must be 8x8") ); + wxT("stipple bitmap must be 8x8") ); m_refData = new wxPenRefData(); M_PENDATA->m_width = width; @@ -186,9 +186,9 @@ void wxPen::SetStyle(wxPenStyle style) void wxPen::SetStipple(const wxBitmap& stipple) { - wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") ); + wxCHECK_RET( stipple.Ok(), wxT("invalid bitmap") ); wxCHECK_RET( stipple.GetWidth() == 8 && stipple.GetHeight() == 8, - _T("stipple bitmap must be 8x8") ); + wxT("stipple bitmap must be 8x8") ); AllocExclusive(); M_PENDATA->m_stipple = stipple; diff --git a/src/mgl/region.cpp b/src/mgl/region.cpp index 6245737375..7a93ccce57 100644 --- a/src/mgl/region.cpp +++ b/src/mgl/region.cpp @@ -147,7 +147,7 @@ void wxRegion::Clear() bool wxRegion::DoIsEqual(const wxRegion& WXUNUSED(region)) const { - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); return false; } diff --git a/src/mgl/settings.cpp b/src/mgl/settings.cpp index 9b2d8621b4..3f3b871660 100644 --- a/src/mgl/settings.cpp +++ b/src/mgl/settings.cpp @@ -109,7 +109,7 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) return false; default: - wxFAIL_MSG( _T("unknown feature") ); + wxFAIL_MSG( wxT("unknown feature") ); } return false; diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index 3bac7640e0..d46081e8b1 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -106,9 +106,9 @@ static wxWindowMGL* wxGetTopLevelParent(wxWindowMGL *win) static void wxCaptureScreenshot(bool activeWindowOnly) { #ifdef __DOS__ - #define SCREENSHOT_FILENAME _T("sshot%03i.png") + #define SCREENSHOT_FILENAME wxT("sshot%03i.png") #else - #define SCREENSHOT_FILENAME _T("screenshot-%03i.png") + #define SCREENSHOT_FILENAME wxT("screenshot-%03i.png") #endif static int screenshot_num = 0; wxString screenshot; @@ -128,7 +128,7 @@ static void wxCaptureScreenshot(bool activeWindowOnly) g_displayDC->savePNGFromDC(screenshot.mb_str(), r.x, r. y, r.x+r.width, r.y+r.height); - wxMessageBox(wxString::Format(_T("Screenshot captured: %s"), + wxMessageBox(wxString::Format(wxT("Screenshot captured: %s"), screenshot.c_str())); } @@ -288,8 +288,8 @@ static long wxScanToKeyCode(event_t *event, bool translate) #ifdef __WXDEBUG__ #define KEY(mgl_key,wx_key) \ case mgl_key: \ - wxLogTrace(_T("keyevents"), \ - _T("key " #mgl_key ", mapped to " #wx_key)); \ + wxLogTrace(wxT("keyevents"), \ + wxT("key " #mgl_key ", mapped to " #wx_key)); \ key = wx_key; \ break; #else diff --git a/src/motif/app.cpp b/src/motif/app.cpp index 5d1c8cad69..e9fbf1b7d2 100644 --- a/src/motif/app.cpp +++ b/src/motif/app.cpp @@ -124,7 +124,7 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_) strcmp(loc, "POSIX") == 0 ) { // we're using C locale, "fix" it - wxLogDebug(_T("HP-UX fontset hack: forcing locale to en_US.iso88591")); + wxLogDebug(wxT("HP-UX fontset hack: forcing locale to en_US.iso88591")); putenv(fixAll ? "LC_ALL=en_US.iso88591" : "LC_CTYPE=en_US.iso88591"); } #endif // __HPUX__ @@ -162,10 +162,10 @@ bool wxApp::Initialize(int& argc_, wxChar **argv_) // immediate crash inside XOpenIM() (if XIM is used) under IRIX wxString appname = wxTheApp->GetAppName(); if ( appname.empty() ) - appname = _T("wxapp"); + appname = wxT("wxapp"); wxString clsname = wxTheApp->GetClassName(); if ( clsname.empty() ) - clsname = _T("wx"); + clsname = wxT("wx"); // FIXME-UTF8: This code is taken from wxGTK and duplicated here. This // is just a temporary fix to make wxX11 compile in Unicode diff --git a/src/motif/bmpmotif.cpp b/src/motif/bmpmotif.cpp index 9b75f1c8d4..51caa8e009 100644 --- a/src/motif/bmpmotif.cpp +++ b/src/motif/bmpmotif.cpp @@ -36,7 +36,7 @@ Pixmap XCreateInsensitivePixmap( Display *display, Pixmap pixmap ); static inline wxCharBuffer GetCacheImageName(WXImage image) { - return wxString::Format(_T("wxBitmap_%p"), image).ToAscii(); + return wxString::Format(wxT("wxBitmap_%p"), image).ToAscii(); } wxBitmapCache::~wxBitmapCache() diff --git a/src/motif/evtloop.cpp b/src/motif/evtloop.cpp index a3994827f8..7fd2475e66 100644 --- a/src/motif/evtloop.cpp +++ b/src/motif/evtloop.cpp @@ -99,13 +99,13 @@ bool wxEventLoopImpl::SendIdleMessage() wxGUIEventLoop::~wxGUIEventLoop() { - wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") ); + wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") ); } int wxGUIEventLoop::Run() { // event loops are not recursive, you need to create another loop! - wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); + wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") ); wxEventLoopActivator activate(this); @@ -129,7 +129,7 @@ int wxGUIEventLoop::Run() void wxGUIEventLoop::Exit(int rc) { - wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); + wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") ); m_impl->SetExitCode(rc); m_impl->SetKeepGoing( false ); diff --git a/src/motif/filedlg.cpp b/src/motif/filedlg.cpp index 004930c565..87d267cbd9 100644 --- a/src/motif/filedlg.cpp +++ b/src/motif/filedlg.cpp @@ -97,11 +97,11 @@ static wxString ParseWildCard( const wxString& wild ) const size_t count = wxParseCommonDialogsFilter(wild, wildDescriptions, wildFilters); - wxCHECK_MSG( count, _T("*.*"), wxT("wxFileDialog: bad wildcard string") ); - wxCHECK_MSG( count == 1, _T("*.*"), msg ); + wxCHECK_MSG( count, wxT("*.*"), wxT("wxFileDialog: bad wildcard string") ); + wxCHECK_MSG( count == 1, wxT("*.*"), msg ); // check for *.txt;*.rtf - wxStringTokenizer tok2( wildFilters[0], _T(";") ); + wxStringTokenizer tok2( wildFilters[0], wxT(";") ); wxString wildcard = tok2.GetNextToken(); wxCHECK_MSG( tok2.CountTokens() <= 1, wildcard, msg ); diff --git a/src/motif/font.cpp b/src/motif/font.cpp index df62b908ba..2969f829be 100644 --- a/src/motif/font.cpp +++ b/src/motif/font.cpp @@ -311,7 +311,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) wxString registry = tn.GetNextToken().MakeUpper(), encoding = tn.GetNextToken().MakeUpper(); - if ( registry == _T("ISO8859") ) + if ( registry == wxT("ISO8859") ) { int cp; if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 ) @@ -320,7 +320,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) (wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1); } } - else if ( registry == _T("MICROSOFT") ) + else if ( registry == wxT("MICROSOFT") ) { int cp; if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 ) @@ -329,7 +329,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) (wxFontEncoding)(wxFONTENCODING_CP1250 + cp); } } - else if ( registry == _T("KOI8") ) + else if ( registry == wxT("KOI8") ) { M_FONTDATA->m_encoding = wxFONTENCODING_KOI8; } diff --git a/src/motif/scrolbar.cpp b/src/motif/scrolbar.cpp index 587be3ca89..f12accfcf8 100644 --- a/src/motif/scrolbar.cpp +++ b/src/motif/scrolbar.cpp @@ -125,7 +125,7 @@ static void wxScrollBarCallback(Widget widget, XtPointer clientData, XmScaleCallbackStruct *cbs) { wxScrollBar *scrollBar = (wxScrollBar*)wxGetWindowFromTable(widget); - wxCHECK_RET( scrollBar, _T("invalid widget in scrollbar callback") ); + wxCHECK_RET( scrollBar, wxT("invalid widget in scrollbar callback") ); wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData); wxEventType eventType = wxEVT_NULL; diff --git a/src/motif/settings.cpp b/src/motif/settings.cpp index 87ade0a057..9b5b083422 100644 --- a/src/motif/settings.cpp +++ b/src/motif/settings.cpp @@ -159,7 +159,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) default: case wxSYS_COLOUR_MAX: - wxFAIL_MSG( _T("unknown colour") ); + wxFAIL_MSG( wxT("unknown colour") ); } return *wxWHITE; } diff --git a/src/motif/spinbutt.cpp b/src/motif/spinbutt.cpp index 9b978d0e14..fe8e6257b9 100644 --- a/src/motif/spinbutt.cpp +++ b/src/motif/spinbutt.cpp @@ -189,7 +189,7 @@ bool wxArrowButton::Create( wxSpinButton* parent, ArrowDirection d, const wxPoint& pos, const wxSize& size ) { - wxCHECK_MSG( parent, false, _T("must have a valid parent") ); + wxCHECK_MSG( parent, false, wxT("must have a valid parent") ); int arrow_dir = XmARROW_UP; diff --git a/src/motif/toolbar.cpp b/src/motif/toolbar.cpp index 75f4c0fbed..6cc0576b55 100644 --- a/src/motif/toolbar.cpp +++ b/src/motif/toolbar.cpp @@ -478,7 +478,7 @@ bool wxToolBar::Realize() wxToolBarToolBase *wxToolBar::FindToolForPosition(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) const { - wxFAIL_MSG( _T("TODO") ); + wxFAIL_MSG( wxT("TODO") ); return NULL; } diff --git a/src/motif/window.cpp b/src/motif/window.cpp index 2d8b65b31b..0d3e0b548e 100644 --- a/src/motif/window.cpp +++ b/src/motif/window.cpp @@ -2098,7 +2098,7 @@ static void wxScrollBarCallback(Widget scrollbar, XmScrollBarCallbackStruct *cbs) { wxWindow *win = wxGetWindowFromTable(scrollbar); - wxCHECK_RET( win, _T("invalid widget in scrollbar callback") ); + wxCHECK_RET( win, wxT("invalid widget in scrollbar callback") ); wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData); diff --git a/src/msdos/mimetype.cpp b/src/msdos/mimetype.cpp index 0be46cd73d..a2b49913d2 100644 --- a/src/msdos/mimetype.cpp +++ b/src/msdos/mimetype.cpp @@ -104,7 +104,7 @@ wxFileTypeImpl::GetAllCommands(wxArrayString * WXUNUSED(verbs), wxArrayString * WXUNUSED(commands), const wxFileType::MessageParameters& WXUNUSED(params)) const { - wxFAIL_MSG( _T("wxFileTypeImpl::GetAllCommands() not yet implemented") ); + wxFAIL_MSG( wxT("wxFileTypeImpl::GetAllCommands() not yet implemented") ); return 0; } @@ -112,13 +112,13 @@ void wxMimeTypesManagerImpl::Initialize(int WXUNUSED(mailcapStyles), const wxString& WXUNUSED(extraDir)) { - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Initialize() not yet implemented") ); + wxFAIL_MSG( wxT("wxMimeTypesManagerImpl::Initialize() not yet implemented") ); } void wxMimeTypesManagerImpl::ClearData() { - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::ClearData() not yet implemented") ); + wxFAIL_MSG( wxT("wxMimeTypesManagerImpl::ClearData() not yet implemented") ); } // extension -> file type @@ -205,7 +205,7 @@ wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& WXUNUSED(mimeTyp size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& WXUNUSED(mimetypes)) { // VZ: don't know anything about this for Mac - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::EnumAllFileTypes() not yet implemented") ); + wxFAIL_MSG( wxT("wxMimeTypesManagerImpl::EnumAllFileTypes() not yet implemented") ); return 0; } @@ -213,7 +213,7 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& WXUNUSED(mimetype wxFileType * wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& WXUNUSED(ftInfo)) { - wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Associate() not yet implemented") ); + wxFAIL_MSG( wxT("wxMimeTypesManagerImpl::Associate() not yet implemented") ); return NULL; } diff --git a/src/msdos/utilsdos.cpp b/src/msdos/utilsdos.cpp index 0752049157..3d1095cf59 100644 --- a/src/msdos/utilsdos.cpp +++ b/src/msdos/utilsdos.cpp @@ -100,7 +100,7 @@ static bool wxDoSetEnv(const wxString& variable, const char *value) { wxString s = variable; if ( value ) - s << _T('=') << value; + s << wxT('=') << value; // transform to ANSI const char *p = s.mb_str(); @@ -179,7 +179,7 @@ const wxChar* wxGetHomeDir(wxString *home) { strDir = szHome; // when msys sets %HOME% it uses '/' (cygwin uses '\\') - strDir.Replace(_T("/"), _T("\\")); + strDir.Replace(wxT("/"), wxT("\\")); } } @@ -196,15 +196,15 @@ const wxChar* wxGetHomeDir(wxString *home) wxString prog(wxTheApp->argv[0]); #ifdef __DJGPP__ // djgpp startup code switches the slashes around, so restore them - prog.Replace(_T("/"), _T("\\")); + prog.Replace(wxT("/"), wxT("\\")); #endif // it needs to be a full path to be usable - if ( prog.compare(1, 2, _T(":\\")) == 0 ) + if ( prog.compare(1, 2, wxT(":\\")) == 0 ) wxFileName::SplitPath(prog, &strDir, NULL, NULL); } if ( strDir.empty() ) { - strDir = _T("."); + strDir = wxT("."); } } @@ -225,13 +225,13 @@ wxString wxGetUserHome(const wxString& user) // bool wxGetUserId(wxChar *buf, int n) { - const wxChar *user = wxGetenv(_T("UserName")); + const wxChar *user = wxGetenv(wxT("UserName")); if (!user) - user = wxGetenv(_T("USER")); + user = wxGetenv(wxT("USER")); if (!user) - user = _T("user"); + user = wxT("user"); wxStrlcpy(buf, user, n); return true; @@ -246,13 +246,13 @@ bool wxGetUserName(wxChar *buf, int n) // bool wxGetHostName(wxChar *buf, int n) { - const wxChar *host = wxGetenv(_T("ComputerName")); + const wxChar *host = wxGetenv(wxT("ComputerName")); if (!host) - host = wxGetenv(_T("HOSTNAME")); + host = wxGetenv(wxT("HOSTNAME")); if (!host) - host = _T("host"); + host = wxT("host"); wxStrlcpy(buf, host, n); return true; @@ -264,10 +264,10 @@ bool wxGetFullHostName(wxChar *buf, int n) { wxGetHostName(buf, n); - const wxChar *domain = wxGetenv(_T("UserDnsDomain")); + const wxChar *domain = wxGetenv(wxT("UserDnsDomain")); if (domain) - wxStrncat(wxStrncat(buf, _T("."), n), domain, n); + wxStrncat(wxStrncat(buf, wxT("."), n), domain, n); return true; } @@ -293,7 +293,7 @@ int wxKill(long pid, wxSignal sig, wxKillError *rc, int WXUNUSED(flags)) } else { - wxLogDebug(_T("wxKill can only send signals to the current process under MSDOS")); + wxLogDebug(wxT("wxKill can only send signals to the current process under MSDOS")); if (rc) *rc = wxKILL_NO_PROCESS; } @@ -339,7 +339,7 @@ class wxTempFileInStream : public wxFFileInputStream { public: wxTempFileInStream(const wxString& name) - : wxFFileInputStream(name, _T("rt")) + : wxFFileInputStream(name, wxT("rt")) { } virtual ~wxTempFileInStream() @@ -452,14 +452,14 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process) if (redirect) { // close stdin/out/err and reopen them as files - if (!in.Reopen(_T("NUL"), O_RDONLY | O_TEXT)) + if (!in.Reopen(wxT("NUL"), O_RDONLY | O_TEXT)) return -1; - if (!out.Reopen(wxFileName::CreateTempFileName(_T("out")), + if (!out.Reopen(wxFileName::CreateTempFileName(wxT("out")), O_CREAT | O_WRONLY | O_TRUNC | O_TEXT)) return -1; - if (!err.Reopen(wxFileName::CreateTempFileName(_T("err")), + if (!err.Reopen(wxFileName::CreateTempFileName(wxT("err")), O_CREAT | O_WRONLY | O_TRUNC | O_TEXT)) return -1; } @@ -477,7 +477,7 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process) #if wxUSE_STREAMS if (redirect) process->SetPipeStreams(new wxTempFileInStream(out.Release()), - new wxFFileOutputStream(_T("NUL"), _T("wt")), + new wxFFileOutputStream(wxT("NUL"), wxT("wt")), new wxTempFileInStream(err.Release())); #endif // wxUSE_STREAMS @@ -491,7 +491,7 @@ long wxExecute(wxChar **argv, int flags, wxProcess *process) wxString wxGetOsDescription() { - wxString osname(_T("DOS")); + wxString osname(wxT("DOS")); return osname; } diff --git a/src/msw/aboutdlg.cpp b/src/msw/aboutdlg.cpp index 123e9823e0..526552fd89 100644 --- a/src/msw/aboutdlg.cpp +++ b/src/msw/aboutdlg.cpp @@ -50,14 +50,14 @@ void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent) msg << name; if ( info.HasVersion() ) { - msg << _T('\n'); + msg << wxT('\n'); msg << wxString::Format(_("Version %s"), info.GetVersion()); } - msg << _T("\n\n"); + msg << wxT("\n\n"); if ( info.HasCopyright() ) - msg << info.GetCopyrightToDisplay() << _T('\n'); + msg << info.GetCopyrightToDisplay() << wxT('\n'); // add everything remaining msg << info.GetDescriptionAndCredits(); diff --git a/src/msw/app.cpp b/src/msw/app.cpp index a4f6edfec4..e8718ccdd9 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -332,7 +332,7 @@ public: { if ( !::FreeConsole() ) { - wxLogLastError(_T("FreeConsole")); + wxLogLastError(wxT("FreeConsole")); } } } @@ -401,7 +401,7 @@ bool wxConsoleStderr::DoInit() if ( hStderr == INVALID_HANDLE_VALUE || !hStderr ) return false; - if ( !m_dllKernel32.Load(_T("kernel32.dll")) ) + if ( !m_dllKernel32.Load(wxT("kernel32.dll")) ) return false; typedef BOOL (WINAPI *AttachConsole_t)(DWORD dwProcessId); @@ -434,7 +434,7 @@ bool wxConsoleStderr::DoInit() if ( !::GetConsoleScreenBufferInfo(m_hStderr, &csbi) ) { - wxLogLastError(_T("GetConsoleScreenBufferInfo")); + wxLogLastError(wxT("GetConsoleScreenBufferInfo")); return false; } @@ -451,7 +451,7 @@ bool wxConsoleStderr::DoInit() if ( !::ReadConsoleOutputCharacterA(m_hStderr, buf, WXSIZEOF(buf), pos, &ret) ) { - wxLogLastError(_T("ReadConsoleOutputCharacterA")); + wxLogLastError(wxT("ReadConsoleOutputCharacterA")); return false; } } while ( wxStrncmp(" ", buf, WXSIZEOF(buf)) != 0 ); @@ -466,7 +466,7 @@ bool wxConsoleStderr::DoInit() if ( !::ReadConsoleOutputCharacterA(m_hStderr, m_data.data(), m_dataLen, pos, &ret) ) { - wxLogLastError(_T("ReadConsoleOutputCharacterA")); + wxLogLastError(wxT("ReadConsoleOutputCharacterA")); return false; } } @@ -477,7 +477,7 @@ bool wxConsoleStderr::DoInit() int wxConsoleStderr::GetCommandHistory(wxWxCharBuffer& buf) const { // these functions are internal and may only be called by cmd.exe - static const wxChar *CMD_EXE = _T("cmd.exe"); + static const wxChar *CMD_EXE = wxT("cmd.exe"); const int len = m_pfnGetConsoleCommandHistoryLength(CMD_EXE); if ( len ) @@ -494,7 +494,7 @@ int wxConsoleStderr::GetCommandHistory(wxWxCharBuffer& buf) const if ( len2 != len ) { - wxFAIL_MSG( _T("failed getting history?") ); + wxFAIL_MSG( wxT("failed getting history?") ); } } @@ -503,7 +503,7 @@ int wxConsoleStderr::GetCommandHistory(wxWxCharBuffer& buf) const bool wxConsoleStderr::IsHistoryUnchanged() const { - wxASSERT_MSG( m_ok == 1, _T("shouldn't be called if not initialized") ); + wxASSERT_MSG( m_ok == 1, wxT("shouldn't be called if not initialized") ); // get (possibly changed) command history wxWxCharBuffer history; @@ -517,13 +517,13 @@ bool wxConsoleStderr::IsHistoryUnchanged() const bool wxConsoleStderr::Write(const wxString& text) { wxASSERT_MSG( m_hStderr != INVALID_HANDLE_VALUE, - _T("should only be called if Init() returned true") ); + wxT("should only be called if Init() returned true") ); // get current position CONSOLE_SCREEN_BUFFER_INFO csbi; if ( !::GetConsoleScreenBufferInfo(m_hStderr, &csbi) ) { - wxLogLastError(_T("GetConsoleScreenBufferInfo")); + wxLogLastError(wxT("GetConsoleScreenBufferInfo")); return false; } @@ -533,21 +533,21 @@ bool wxConsoleStderr::Write(const wxString& text) if ( !::SetConsoleCursorPosition(m_hStderr, csbi.dwCursorPosition) ) { - wxLogLastError(_T("SetConsoleCursorPosition")); + wxLogLastError(wxT("SetConsoleCursorPosition")); return false; } DWORD ret; - if ( !::FillConsoleOutputCharacter(m_hStderr, _T(' '), m_dataLen, + if ( !::FillConsoleOutputCharacter(m_hStderr, wxT(' '), m_dataLen, csbi.dwCursorPosition, &ret) ) { - wxLogLastError(_T("FillConsoleOutputCharacter")); + wxLogLastError(wxT("FillConsoleOutputCharacter")); return false; } if ( !::WriteConsole(m_hStderr, text.wx_str(), text.length(), &ret, NULL) ) { - wxLogLastError(_T("WriteConsole")); + wxLogLastError(wxT("WriteConsole")); return false; } @@ -886,7 +886,7 @@ int CallDllGetVersion(wxDynamicLibrary& dll) HRESULT hr = (*pfnDllGetVersion)(&dvi); if ( FAILED(hr) ) { - wxLogApiError(_T("DllGetVersion"), hr); + wxLogApiError(wxT("DllGetVersion"), hr); return 0; } @@ -914,7 +914,7 @@ int wxApp::GetComCtl32Version() // depending on the OS version and the presence of the manifest, it can // be either v5 or v6 and instead of trying to guess it just get the // handle of the already loaded version - wxLoadedDLL dllComCtl32(_T("comctl32.dll")); + wxLoadedDLL dllComCtl32(wxT("comctl32.dll")); if ( !dllComCtl32.IsLoaded() ) { s_verComCtl32 = 0; @@ -929,7 +929,7 @@ int wxApp::GetComCtl32Version() if ( !s_verComCtl32 ) { // InitCommonControlsEx is unique to 4.70 and later - void *pfn = dllComCtl32.GetSymbol(_T("InitCommonControlsEx")); + void *pfn = dllComCtl32.GetSymbol(wxT("InitCommonControlsEx")); if ( !pfn ) { // not found, must be 4.00 @@ -939,7 +939,7 @@ int wxApp::GetComCtl32Version() { // many symbols appeared in comctl32 4.71, could use any of // them except may be DllInstall() - pfn = dllComCtl32.GetSymbol(_T("InitializeFlatSB")); + pfn = dllComCtl32.GetSymbol(wxT("InitializeFlatSB")); if ( !pfn ) { // not found, must be 4.70 @@ -966,7 +966,7 @@ int wxApp::GetShell32Version() // we're prepared to handle the errors wxLogNull noLog; - wxDynamicLibrary dllShell32(_T("shell32.dll"), wxDL_VERBATIM); + wxDynamicLibrary dllShell32(wxT("shell32.dll"), wxDL_VERBATIM); if ( dllShell32.IsLoaded() ) { s_verShell32 = CallDllGetVersion(dllShell32); @@ -1020,10 +1020,10 @@ bool wxApp::OnExceptionInMainLoop() ::MessageBox ( NULL, - _T("An unhandled exception occurred. Press \"Abort\" to \ + wxT("An unhandled exception occurred. Press \"Abort\" to \ terminate the program,\r\n\ \"Retry\" to exit the program normally and \"Ignore\" to try to continue."), - _T("Unhandled exception"), + wxT("Unhandled exception"), MB_ABORTRETRYIGNORE | MB_ICONERROR| MB_TASKMODAL @@ -1034,7 +1034,7 @@ terminate the program,\r\n\ throw; default: - wxFAIL_MSG( _T("unexpected MessageBox() return code") ); + wxFAIL_MSG( wxT("unexpected MessageBox() return code") ); // fall through case IDRETRY: diff --git a/src/msw/bitmap.cpp b/src/msw/bitmap.cpp index ca1456ec66..349bc1641c 100644 --- a/src/msw/bitmap.cpp +++ b/src/msw/bitmap.cpp @@ -215,7 +215,7 @@ wxBitmapRefData::wxBitmapRefData(const wxBitmapRefData& data) // CloneGDIRefData() wxASSERT_MSG( !data.m_isDIB, - _T("can't copy bitmap locked for raw access!") ); + wxT("can't copy bitmap locked for raw access!") ); m_isDIB = false; m_hasAlpha = data.m_hasAlpha; @@ -227,7 +227,7 @@ void wxBitmapRefData::Free() wxT("deleting bitmap still selected into wxMemoryDC") ); #if wxUSE_WXDIB - wxASSERT_MSG( !m_dib, _T("forgot to call wxBitmap::UngetRawData()!") ); + wxASSERT_MSG( !m_dib, wxT("forgot to call wxBitmap::UngetRawData()!") ); #endif if ( m_hBitmap) @@ -323,7 +323,7 @@ bool wxBitmap::CopyFromIconOrCursor(const wxGDIImage& icon, switch ( transp ) { default: - wxFAIL_MSG( _T("unknown wxBitmapTransparency value") ); + wxFAIL_MSG( wxT("unknown wxBitmapTransparency value") ); case wxBitmapTransparency_None: // nothing to do, refData->m_hasAlpha is false by default @@ -408,7 +408,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon, wxBitmapTransparency transp) bool wxBitmap::CopyFromDIB(const wxDIB& dib) { - wxCHECK_MSG( dib.IsOk(), false, _T("invalid DIB in CopyFromDIB") ); + wxCHECK_MSG( dib.IsOk(), false, wxT("invalid DIB in CopyFromDIB") ); #ifdef SOMETIMES_USE_DIB HBITMAP hbitmap = dib.CreateDDB(); @@ -534,7 +534,7 @@ bool wxBitmap::Create(int width, int height, int depth) bool wxBitmap::Create(int width, int height, const wxDC& dc) { - wxCHECK_MSG( dc.IsOk(), false, _T("invalid HDC in wxBitmap::Create()") ); + wxCHECK_MSG( dc.IsOk(), false, wxT("invalid HDC in wxBitmap::Create()") ); const wxMSWDCImpl *impl = wxDynamicCast( dc.GetImpl(), wxMSWDCImpl ); @@ -810,7 +810,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth) bool wxBitmap::CreateFromImage(const wxImage& image, const wxDC& dc) { wxCHECK_MSG( dc.IsOk(), false, - _T("invalid HDC in wxBitmap::CreateFromImage()") ); + wxT("invalid HDC in wxBitmap::CreateFromImage()") ); const wxMSWDCImpl *impl = wxDynamicCast( dc.GetImpl(), wxMSWDCImpl ); @@ -905,7 +905,7 @@ bool wxBitmap::CreateFromImage(const wxImage& image, int depth, WXHDC hdc) hbitmap = ::CreateBitmap(w, h, 1, 1, data); if ( !hbitmap ) { - wxLogLastError(_T("CreateBitmap(mask)")); + wxLogLastError(wxT("CreateBitmap(mask)")); } else { @@ -1130,13 +1130,13 @@ wxBitmap wxBitmap::GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const if ( !selectDst ) { - wxLogLastError(_T("SelectObject(destBitmap)")); + wxLogLastError(wxT("SelectObject(destBitmap)")); } if ( !::BitBlt(dcDst, 0, 0, rect.width, rect.height, (HDC)hdc, rect.x, rect.y, SRCCOPY) ) { - wxLogLastError(_T("BitBlt")); + wxLogLastError(wxT("BitBlt")); } } @@ -1151,7 +1151,7 @@ wxBitmap wxBitmap::GetSubBitmapOfHDC( const wxRect& rect, WXHDC hdc ) const if ( !::BitBlt(dcDst, 0, 0, rect.width, rect.height, dcSrc, rect.x, rect.y, SRCCOPY) ) { - wxLogLastError(_T("BitBlt")); + wxLogLastError(wxT("BitBlt")); } wxMask *mask = new wxMask((WXHBITMAP) hbmpMask); @@ -1262,7 +1262,7 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) if ( !GetBitmapData()->m_isDIB ) { wxCHECK_MSG( !GetBitmapData()->m_dib, NULL, - _T("GetRawData() may be called only once") ); + wxT("GetRawData() may be called only once") ); wxDIB *dib = new wxDIB(*this); if ( !dib->IsOk() ) @@ -1285,7 +1285,7 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) DIBSECTION ds; if ( ::GetObject(hDIB, sizeof(ds), &ds) != sizeof(DIBSECTION) ) { - wxFAIL_MSG( _T("failed to get DIBSECTION from a DIB?") ); + wxFAIL_MSG( wxT("failed to get DIBSECTION from a DIB?") ); return NULL; } @@ -1293,7 +1293,7 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) // check that the bitmap is in correct format if ( ds.dsBm.bmBitsPixel != bpp ) { - wxFAIL_MSG( _T("incorrect bitmap type in wxBitmap::GetRawData()") ); + wxFAIL_MSG( wxT("incorrect bitmap type in wxBitmap::GetRawData()") ); return NULL; } @@ -1429,7 +1429,7 @@ bool wxMask::Create(const wxBitmap& bitmap) { #ifndef __WXMICROWIN__ wxCHECK_MSG( bitmap.Ok() && bitmap.GetDepth() == 1, false, - _T("can't create mask from invalid or not monochrome bitmap") ); + wxT("can't create mask from invalid or not monochrome bitmap") ); if ( m_maskBitmap ) { @@ -1488,7 +1488,7 @@ bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex) bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) { #ifndef __WXMICROWIN__ - wxCHECK_MSG( bitmap.Ok(), false, _T("invalid bitmap in wxMask::Create") ); + wxCHECK_MSG( bitmap.Ok(), false, wxT("invalid bitmap in wxMask::Create") ); if ( m_maskBitmap ) { @@ -1515,7 +1515,7 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour) // SelectObject() will fail wxASSERT_MSG( !bitmap.GetSelectedInto(), - _T("bitmap can't be selected in another DC") ); + wxT("bitmap can't be selected in another DC") ); HGDIOBJ hbmpSrcOld = ::SelectObject(srcDC, GetHbitmapOf(bitmap)); if ( !hbmpSrcOld ) @@ -1689,7 +1689,7 @@ HICON wxBitmapToIconOrCursor(const wxBitmap& bmp, if ( !::BitBlt(dcDst, 0, 0, bmp.GetWidth(), bmp.GetHeight(), dcSrc, 0, 0, SRCAND) ) { - wxLogLastError(_T("BitBlt")); + wxLogLastError(wxT("BitBlt")); } } @@ -1720,7 +1720,7 @@ HCURSOR wxBitmapToHCURSOR(const wxBitmap& bmp, int hotSpotX, int hotSpotY) HBITMAP wxInvertMask(HBITMAP hbmpMask, int w, int h) { #ifndef __WXMICROWIN__ - wxCHECK_MSG( hbmpMask, 0, _T("invalid bitmap in wxInvertMask") ); + wxCHECK_MSG( hbmpMask, 0, wxT("invalid bitmap in wxInvertMask") ); // get width/height from the bitmap if not given if ( !w || !h ) diff --git a/src/msw/brush.cpp b/src/msw/brush.cpp index f71e16746e..09f346bcdd 100644 --- a/src/msw/brush.cpp +++ b/src/msw/brush.cpp @@ -192,7 +192,7 @@ HBRUSH wxBrushRefData::GetHBRUSH() break; default: - wxFAIL_MSG( _T("unknown brush style") ); + wxFAIL_MSG( wxT("unknown brush style") ); // fall through case wxBRUSHSTYLE_SOLID: @@ -209,7 +209,7 @@ HBRUSH wxBrushRefData::GetHBRUSH() if ( !m_hBrush ) { - wxLogLastError(_T("CreateXXXBrush()")); + wxLogLastError(wxT("CreateXXXBrush()")); } } @@ -277,28 +277,28 @@ wxGDIRefData *wxBrush::CloneGDIRefData(const wxGDIRefData *data) const wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->GetColour(); } wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->GetStyle(); } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, _T("invalid brush") ); + wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); return M_BRUSHDATA->GetStipple(); } WXHANDLE wxBrush::GetResourceHandle() const { - wxCHECK_MSG( Ok(), FALSE, _T("invalid brush") ); + wxCHECK_MSG( Ok(), FALSE, wxT("invalid brush") ); return (WXHANDLE)M_BRUSHDATA->GetHBRUSH(); } diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 39845f6cbf..49b84f2849 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -423,7 +423,7 @@ void wxMSWButton::UpdateMultilineStyle(HWND hwnd, const wxString& label) // the control unless it already has new lines in its label) long styleOld = ::GetWindowLong(hwnd, GWL_STYLE), styleNew; - if ( label.find(_T('\n')) != wxString::npos ) + if ( label.find(wxT('\n')) != wxString::npos ) styleNew = styleOld | BS_MULTILINE; else styleNew = styleOld & ~BS_MULTILINE; @@ -509,7 +509,7 @@ bool wxButton::Create(wxWindow *parent, // value and the label is not set yet when MSWGetStyle() is called msStyle |= wxMSWButton::GetMultilineStyle(label); - return MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, exstyle); + return MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, exstyle); } wxButton::~wxButton() @@ -743,10 +743,10 @@ static wxTopLevelWindow *GetTLWParentIfNotBeingDeleted(wxWindow *win) win = parent; } - wxASSERT_MSG( win, _T("button without top level parent?") ); + wxASSERT_MSG( win, wxT("button without top level parent?") ); wxTopLevelWindow * const tlw = wxDynamicCast(win, wxTopLevelWindow); - wxASSERT_MSG( tlw, _T("logic error in GetTLWParentIfNotBeingDeleted()") ); + wxASSERT_MSG( tlw, wxT("logic error in GetTLWParentIfNotBeingDeleted()") ); return tlw; } @@ -798,7 +798,7 @@ wxButton::SetDefaultStyle(wxButton *btn, bool on) return; wxWindow * const tlw = wxGetTopLevelParent(btn); - wxCHECK_RET( tlw, _T("button without top level window?") ); + wxCHECK_RET( tlw, wxT("button without top level window?") ); ::SendMessage(GetHwndOf(tlw), DM_SETDEFID, btn->GetId(), 0L); @@ -1030,7 +1030,7 @@ void DrawButtonText(HDC hdc, // center text horizontally in any case flags |= DT_CENTER; - if ( text.find(_T('\n')) != wxString::npos ) + if ( text.find(wxT('\n')) != wxString::npos ) { // draw multiline label diff --git a/src/msw/calctrl.cpp b/src/msw/calctrl.cpp index 842efa50c6..b97433d431 100644 --- a/src/msw/calctrl.cpp +++ b/src/msw/calctrl.cpp @@ -85,7 +85,7 @@ wxCalendarCtrl::Create(wxWindow *parent, } else { - wxLogLastError(_T("GetClassInfoEx(SysMonthCal32)")); + wxLogLastError(wxT("GetClassInfoEx(SysMonthCal32)")); } } @@ -218,7 +218,7 @@ bool wxCalendarCtrl::SetDate(const wxDateTime& dt) dt.GetAsMSWSysTime(&st); if ( !MonthCal_SetCurSel(GetHwnd(), &st) ) { - wxLogDebug(_T("DateTime_SetSystemtime() failed")); + wxLogDebug(wxT("DateTime_SetSystemtime() failed")); return false; } @@ -266,7 +266,7 @@ bool wxCalendarCtrl::SetDateRange(const wxDateTime& dt1, const wxDateTime& dt2) if ( !MonthCal_SetRange(GetHwnd(), flags, st) ) { - wxLogDebug(_T("MonthCal_SetRange() failed")); + wxLogDebug(wxT("MonthCal_SetRange() failed")); } return flags != 0; @@ -361,7 +361,7 @@ void wxCalendarCtrl::UpdateMarks() if ( !MonthCal_SetDayState(GetHwnd(), nMonths, states) ) { - wxLogLastError(_T("MonthCal_SetDayState")); + wxLogLastError(wxT("MonthCal_SetDayState")); } } diff --git a/src/msw/caret.cpp b/src/msw/caret.cpp index 8574c2acc7..63ca6a8de3 100644 --- a/src/msw/caret.cpp +++ b/src/msw/caret.cpp @@ -41,7 +41,7 @@ #define CALL_CARET_API(api, args) \ if ( !api args ) \ - wxLogLastError(_T(#api)) + wxLogLastError(wxT(#api)) // =========================================================================== // implementation diff --git a/src/msw/checkbox.cpp b/src/msw/checkbox.cpp index bc59d8ad1a..38a41092c9 100644 --- a/src/msw/checkbox.cpp +++ b/src/msw/checkbox.cpp @@ -460,7 +460,7 @@ bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) break; default: - wxFAIL_MSG( _T("unexpected Get3StateValue() return value") ); + wxFAIL_MSG( wxT("unexpected Get3StateValue() return value") ); // fall through case wxCHK_UNCHECKED: @@ -495,7 +495,7 @@ bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) if ( !::DrawText(hdc, label.wx_str(), label.length(), &rectLabel, fmt | DT_CALCRECT) ) { - wxLogLastError(_T("DrawText(DT_CALCRECT)")); + wxLogLastError(wxT("DrawText(DT_CALCRECT)")); } } @@ -506,7 +506,7 @@ bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) if ( !::DrawText(hdc, label.wx_str(), label.length(), &rectLabel, fmt) ) { - wxLogLastError(_T("DrawText()")); + wxLogLastError(wxT("DrawText()")); } // finally draw the focus @@ -516,7 +516,7 @@ bool wxCheckBox::MSWOnDraw(WXDRAWITEMSTRUCT *item) rectLabel.right++; if ( !::DrawFocusRect(hdc, &rectLabel) ) { - wxLogLastError(_T("DrawFocusRect()")); + wxLogLastError(wxT("DrawFocusRect()")); } } diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index b06c404120..0769cb2f34 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -380,14 +380,14 @@ bool wxCheckListBox::MSWOnMeasure(WXMEASUREITEMSTRUCT *item) bool wxCheckListBox::IsChecked(unsigned int uiIndex) const { - wxCHECK_MSG( IsValid(uiIndex), false, _T("bad wxCheckListBox index") ); + wxCHECK_MSG( IsValid(uiIndex), false, wxT("bad wxCheckListBox index") ); return GetItem(uiIndex)->IsChecked(); } void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck) { - wxCHECK_RET( IsValid(uiIndex), _T("bad wxCheckListBox index") ); + wxCHECK_RET( IsValid(uiIndex), wxT("bad wxCheckListBox index") ); GetItem(uiIndex)->Check(bCheck); } @@ -449,7 +449,7 @@ void wxCheckListBox::OnKeyDown(wxKeyEvent& event) wxCheckListBoxItem *item = GetItem(selections[i]); if ( !item ) { - wxFAIL_MSG( _T("no wxCheckListBoxItem?") ); + wxFAIL_MSG( wxT("no wxCheckListBoxItem?") ); continue; } @@ -465,7 +465,7 @@ void wxCheckListBox::OnKeyDown(wxKeyEvent& event) break; default: - wxFAIL_MSG( _T("what should this key do?") ); + wxFAIL_MSG( wxT("what should this key do?") ); } // we should send an event as this has been done by the user and diff --git a/src/msw/choice.cpp b/src/msw/choice.cpp index 44f08b6985..55f5106096 100644 --- a/src/msw/choice.cpp +++ b/src/msw/choice.cpp @@ -117,8 +117,8 @@ 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("probably want to use a wxComboBox") ); + wxT("this style flag is ignored by wxChoice, you ") + wxT("probably want to use a wxComboBox") ); return CreateAndInit(parent, id, pos, size, n, choices, style, validator, name); diff --git a/src/msw/combo.cpp b/src/msw/combo.cpp index a37257ae65..9ee04ced0a 100644 --- a/src/msw/combo.cpp +++ b/src/msw/combo.cpp @@ -252,7 +252,7 @@ void wxComboCtrl::OnThemeChange() return; } - wxLogApiError(_T("GetThemeColor(EDIT, ETS_NORMAL, TMT_FILLCOLOR)"), hr); + wxLogApiError(wxT("GetThemeColor(EDIT, ETS_NORMAL, TMT_FILLCOLOR)"), hr); } #endif diff --git a/src/msw/combobox.cpp b/src/msw/combobox.cpp index bc36474d1a..8fbcce2237 100644 --- a/src/msw/combobox.cpp +++ b/src/msw/combobox.cpp @@ -188,7 +188,7 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd, // longer, check for it to avoid bogus assert failures if ( !win->IsBeingDeleted() ) { - wxFAIL_MSG( _T("should have combo as parent") ); + wxFAIL_MSG( wxT("should have combo as parent") ); } } else if ( combo->MSWProcessEditMsg(message, wParam, lParam) ) @@ -201,7 +201,7 @@ LRESULT APIENTRY _EXPORT wxComboEditWndProc(HWND hWnd, case WM_GETDLGCODE: { - wxCHECK_MSG( win, 0, _T("should have a parent") ); + wxCHECK_MSG( win, 0, wxT("should have a parent") ); if ( win->GetWindowStyle() & wxTE_PROCESS_ENTER ) { @@ -452,10 +452,10 @@ WXHWND wxComboBox::GetEditHWND() const // this function should not be called for wxCB_READONLY controls, it is // the callers responsibility to check this wxASSERT_MSG( !HasFlag(wxCB_READONLY), - _T("read-only combobox doesn't have any edit control") ); + wxT("read-only combobox doesn't have any edit control") ); WXHWND hWndEdit = GetEditHWNDIfAvailable(); - wxASSERT_MSG( hWndEdit, _T("combobox without edit control?") ); + wxASSERT_MSG( hWndEdit, wxT("combobox without edit control?") ); return hWndEdit; } @@ -463,7 +463,7 @@ WXHWND wxComboBox::GetEditHWND() const wxWindow *wxComboBox::GetEditableWindow() { wxASSERT_MSG( !HasFlag(wxCB_READONLY), - _T("read-only combobox doesn't have any edit control") ); + wxT("read-only combobox doesn't have any edit control") ); return this; } diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 06d75a9921..1fac8d1ed2 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -145,7 +145,7 @@ bool wxControl::MSWCreateControl(const wxChar *classname, { wxLogLastError(wxString::Format ( - _T("CreateWindowEx(\"%s\", flags=%08lx, ex=%08lx)"), + wxT("CreateWindowEx(\"%s\", flags=%08lx, ex=%08lx)"), classname, style, exstyle )); diff --git a/src/msw/crashrpt.cpp b/src/msw/crashrpt.cpp index 2b0e276cef..d57eac2f54 100644 --- a/src/msw/crashrpt.cpp +++ b/src/msw/crashrpt.cpp @@ -81,7 +81,7 @@ private: void Output(const wxChar *format, ...); // output end of line - void OutputEndl() { Output(_T("\r\n")); } + void OutputEndl() { Output(wxT("\r\n")); } // the handle of the report file HANDLE m_hFile; @@ -148,7 +148,7 @@ bool wxCrashReportImpl::Generate(int flags, EXCEPTION_POINTERS *ep) if ( !ep ) { - Output(_T("Context for crash report generation not available.")); + Output(wxT("Context for crash report generation not available.")); return false; } @@ -160,14 +160,14 @@ bool wxCrashReportImpl::Generate(int flags, EXCEPTION_POINTERS *ep) TCHAR envFlags[64]; DWORD dwLen = ::GetEnvironmentVariable ( - _T("WX_CRASH_FLAGS"), + wxT("WX_CRASH_FLAGS"), envFlags, WXSIZEOF(envFlags) ); int flagsEnv; if ( dwLen && dwLen < WXSIZEOF(envFlags) && - wxSscanf(envFlags, _T("%d"), &flagsEnv) == 1 ) + wxSscanf(envFlags, wxT("%d"), &flagsEnv) == 1 ) { flags = flagsEnv; } @@ -218,7 +218,7 @@ bool wxCrashReportImpl::Generate(int flags, EXCEPTION_POINTERS *ep) NULL // no callbacks ) ) { - Output(_T("MiniDumpWriteDump() failed.")); + Output(wxT("MiniDumpWriteDump() failed.")); return false; } @@ -227,14 +227,14 @@ bool wxCrashReportImpl::Generate(int flags, EXCEPTION_POINTERS *ep) } else // dbghelp.dll couldn't be loaded { - Output(_T("%s"), wxDbgHelpDLL::GetErrorMessage().c_str()); + Output(wxT("%s"), wxDbgHelpDLL::GetErrorMessage().c_str()); } #else // !wxUSE_DBGHELP wxUnusedVar(flags); wxUnusedVar(ep); - Output(_T("Support for crash report generation was not included ") - _T("in this wxWidgets version.")); + Output(wxT("Support for crash report generation was not included ") + wxT("in this wxWidgets version.")); #endif // wxUSE_DBGHELP/!wxUSE_DBGHELP return false; @@ -292,7 +292,7 @@ wxCrashContext::wxCrashContext(_EXCEPTION_POINTERS *ep) if ( !ep ) { - wxCHECK_RET( wxGlobalSEInformation, _T("no exception info available") ); + wxCHECK_RET( wxGlobalSEInformation, wxT("no exception info available") ); ep = wxGlobalSEInformation; } @@ -330,7 +330,7 @@ wxString wxCrashContext::GetExceptionString() const { wxString s; - #define CASE_EXCEPTION( x ) case EXCEPTION_##x: s = _T(#x); break + #define CASE_EXCEPTION( x ) case EXCEPTION_##x: s = wxT(#x); break switch ( code ) { @@ -363,7 +363,7 @@ wxString wxCrashContext::GetExceptionString() const ( FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE, - ::GetModuleHandle(_T("NTDLL.DLL")), + ::GetModuleHandle(wxT("NTDLL.DLL")), code, 0, wxStringBuffer(s, 1024), @@ -371,7 +371,7 @@ wxString wxCrashContext::GetExceptionString() const 0 ) ) { - s.Printf(_T("UNKNOWN_EXCEPTION(%d)"), code); + s.Printf(wxT("UNKNOWN_EXCEPTION(%d)"), code); } } diff --git a/src/msw/cursor.cpp b/src/msw/cursor.cpp index ec25d16d04..fbcf62dd75 100644 --- a/src/msw/cursor.cpp +++ b/src/msw/cursor.cpp @@ -185,7 +185,7 @@ wxCursor::wxCursor(const wxImage& image) wxASSERT_MSG( hotSpotX >= 0 && hotSpotX < image_w && hotSpotY >= 0 && hotSpotY < image_h, - _T("invalid cursor hot spot coordinates") ); + wxT("invalid cursor hot spot coordinates") ); wxImage imageSized(image); // final image of correct size @@ -265,7 +265,7 @@ wxCursor::wxCursor(const wxString& filename, break; default: - wxLogError( _T("unknown cursor resource type '%d'"), kind ); + wxLogError( wxT("unknown cursor resource type '%d'"), kind ); hcursor = NULL; } @@ -291,27 +291,27 @@ void wxCursor::InitFromStock(wxStockCursor idCursor) { { true, NULL }, // wxCURSOR_NONE { true, IDC_ARROW }, // wxCURSOR_ARROW - { false, _T("WXCURSOR_RIGHT_ARROW") }, // wxCURSOR_RIGHT_ARROW - { false, _T("WXCURSOR_BULLSEYE") }, // wxCURSOR_BULLSEYE + { false, wxT("WXCURSOR_RIGHT_ARROW") }, // wxCURSOR_RIGHT_ARROW + { false, wxT("WXCURSOR_BULLSEYE") }, // wxCURSOR_BULLSEYE { true, IDC_ARROW }, // WXCURSOR_CHAR // Displays as an I-beam on XP, so use a cursor file // { true, IDC_CROSS }, // WXCURSOR_CROSS - { false, _T("WXCURSOR_CROSS") }, // WXCURSOR_CROSS + { false, wxT("WXCURSOR_CROSS") }, // WXCURSOR_CROSS // See special handling below for wxCURSOR_HAND -// { false, _T("WXCURSOR_HAND") }, // wxCURSOR_HAND +// { false, wxT("WXCURSOR_HAND") }, // wxCURSOR_HAND { true, IDC_HAND }, // wxCURSOR_HAND { true, IDC_IBEAM }, // WXCURSOR_IBEAM { true, IDC_ARROW }, // WXCURSOR_LEFT_BUTTON - { false, _T("WXCURSOR_MAGNIFIER") }, // wxCURSOR_MAGNIFIER + { false, wxT("WXCURSOR_MAGNIFIER") }, // wxCURSOR_MAGNIFIER { true, IDC_ARROW }, // WXCURSOR_MIDDLE_BUTTON { true, IDC_NO }, // WXCURSOR_NO_ENTRY - { false, _T("WXCURSOR_PBRUSH") }, // wxCURSOR_PAINT_BRUSH - { false, _T("WXCURSOR_PENCIL") }, // wxCURSOR_PENCIL - { false, _T("WXCURSOR_PLEFT") }, // wxCURSOR_POINT_LEFT - { false, _T("WXCURSOR_PRIGHT") }, // wxCURSOR_POINT_RIGHT + { false, wxT("WXCURSOR_PBRUSH") }, // wxCURSOR_PAINT_BRUSH + { false, wxT("WXCURSOR_PENCIL") }, // wxCURSOR_PENCIL + { false, wxT("WXCURSOR_PLEFT") }, // wxCURSOR_POINT_LEFT + { false, wxT("WXCURSOR_PRIGHT") }, // wxCURSOR_POINT_RIGHT { true, IDC_HELP }, // WXCURSOR_QUESTION_ARROW { true, IDC_ARROW }, // WXCURSOR_RIGHT_BUTTON { true, IDC_SIZENESW }, // WXCURSOR_SIZENESW @@ -319,10 +319,10 @@ void wxCursor::InitFromStock(wxStockCursor idCursor) { true, IDC_SIZENWSE }, // WXCURSOR_SIZENWSE { true, IDC_SIZEWE }, // WXCURSOR_SIZEWE { true, IDC_SIZEALL }, // WXCURSOR_SIZING - { false, _T("WXCURSOR_PBRUSH") }, // wxCURSOR_SPRAYCAN + { false, wxT("WXCURSOR_PBRUSH") }, // wxCURSOR_SPRAYCAN { true, IDC_WAIT }, // WXCURSOR_WAIT { true, IDC_WAIT }, // WXCURSOR_WATCH - { false, _T("WXCURSOR_BLANK") }, // wxCURSOR_BLANK + { false, wxT("WXCURSOR_BLANK") }, // wxCURSOR_BLANK { true, IDC_APPSTARTING }, // wxCURSOR_ARROWWAIT // no entry for wxCURSOR_MAX @@ -332,7 +332,7 @@ void wxCursor::InitFromStock(wxStockCursor idCursor) CursorsIdArrayMismatch ); wxCHECK_RET( idCursor > 0 && (size_t)idCursor < WXSIZEOF(stdCursors), - _T("invalid cursor id in wxCursor() ctor") ); + wxT("invalid cursor id in wxCursor() ctor") ); const StdCursor& stdCursor = stdCursors[idCursor]; bool deleteLater = !stdCursor.isStd; @@ -343,13 +343,13 @@ void wxCursor::InitFromStock(wxStockCursor idCursor) // IDC_HAND may not be available on some versions of Windows. if ( !hcursor && idCursor == wxCURSOR_HAND) { - hcursor = ::LoadCursor(wxGetInstance(), _T("WXCURSOR_HAND")); + hcursor = ::LoadCursor(wxGetInstance(), wxT("WXCURSOR_HAND")); deleteLater = true; } if ( !hcursor ) { - wxLogLastError(_T("LoadCursor")); + wxLogLastError(wxT("LoadCursor")); } else { diff --git a/src/msw/datecontrols.cpp b/src/msw/datecontrols.cpp index 9e71c5f8fc..10e69f55b0 100644 --- a/src/msw/datecontrols.cpp +++ b/src/msw/datecontrols.cpp @@ -69,7 +69,7 @@ bool wxMSWDateControls::CheckInitialization() // see comment in wxApp::GetComCtl32Version() explaining the // use of wxLoadedDLL - wxLoadedDLL dllComCtl32(_T("comctl32.dll")); + wxLoadedDLL dllComCtl32(wxT("comctl32.dll")); if ( dllComCtl32.IsLoaded() ) { wxLogNull noLog; diff --git a/src/msw/datectrl.cpp b/src/msw/datectrl.cpp index 176d095f7c..9551d86b92 100644 --- a/src/msw/datectrl.cpp +++ b/src/msw/datectrl.cpp @@ -148,7 +148,7 @@ wxSize wxDatePickerCtrl::DoGetBestSize() const const DWORD rc = ::GetLastError(); if ( rc != ERROR_INSUFFICIENT_BUFFER ) { - wxLogApiError(_T("GetDateFormat"), rc); + wxLogApiError(wxT("GetDateFormat"), rc); // fall back on wxDateTime, what else to do? s = wxDateTime::Today().FormatDate(); @@ -160,7 +160,7 @@ wxSize wxDatePickerCtrl::DoGetBestSize() const // representation of todays date because the control must accommodate any // date and while the widths of all digits are usually about the same, the // width of the month string varies a lot, so try to account for it - s += _T("WW"); + s += wxT("WW"); int x, y; dc.GetTextExtent(s, &x, &y); @@ -184,7 +184,7 @@ wxSize wxDatePickerCtrl::DoGetBestSize() const void wxDatePickerCtrl::SetValue(const wxDateTime& dt) { wxCHECK_RET( dt.IsValid() || HasFlag(wxDP_ALLOWNONE), - _T("this control requires a valid date") ); + wxT("this control requires a valid date") ); SYSTEMTIME st; if ( dt.IsValid() ) @@ -193,7 +193,7 @@ void wxDatePickerCtrl::SetValue(const wxDateTime& dt) dt.IsValid() ? GDT_VALID : GDT_NONE, &st) ) { - wxLogDebug(_T("DateTime_SetSystemtime() failed")); + wxLogDebug(wxT("DateTime_SetSystemtime() failed")); } // we need to keep only the date part, times don't make sense for this @@ -215,7 +215,7 @@ wxDateTime wxDatePickerCtrl::GetValue() const wxASSERT_MSG( m_date.IsValid() == dt.IsValid() && (!dt.IsValid() || dt == m_date), - _T("bug in wxDatePickerCtrl: m_date not in sync") ); + wxT("bug in wxDatePickerCtrl: m_date not in sync") ); #endif // wxDEBUG_LEVEL return m_date; @@ -240,7 +240,7 @@ void wxDatePickerCtrl::SetRange(const wxDateTime& dt1, const wxDateTime& dt2) if ( !DateTime_SetRange(GetHwnd(), flags, st) ) { - wxLogDebug(_T("DateTime_SetRange() failed")); + wxLogDebug(wxT("DateTime_SetRange() failed")); } } diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 223715ccb9..d25954bd32 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -184,7 +184,7 @@ public: m_modeOld = ::SetStretchBltMode(m_hdc, COLORONCOLOR); if ( !m_modeOld ) { - wxLogLastError(_T("SetStretchBltMode")); + wxLogLastError(wxT("SetStretchBltMode")); } } @@ -192,7 +192,7 @@ public: { if ( !::SetStretchBltMode(m_hdc, m_modeOld) ) { - wxLogLastError(_T("SetStretchBltMode")); + wxLogLastError(wxT("SetStretchBltMode")); } } @@ -255,7 +255,7 @@ private: const wxChar *m_dllName; }; -static wxOnceOnlyDLLLoader wxMSIMG32DLL(_T("msimg32")); +static wxOnceOnlyDLLLoader wxMSIMG32DLL(wxT("msimg32")); // we must ensure that DLLs are unloaded before the static objects cleanup time // because we may hit the notorious DllMain() dead lock in this case if wx is @@ -468,7 +468,7 @@ void wxMSWDCImpl::SetClippingHrgn(WXHRGN hrgn) #else // !WinCE if ( ::ExtSelectClipRgn(GetHdc(), (HRGN)hrgn, RGN_AND) == ERROR ) { - wxLogLastError(_T("ExtSelectClipRgn")); + wxLogLastError(wxT("ExtSelectClipRgn")); return; } @@ -491,7 +491,7 @@ void wxMSWDCImpl::DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h LogicalToDeviceY(y + h)); if ( !hrgn ) { - wxLogLastError(_T("CreateRectRgn")); + wxLogLastError(wxT("CreateRectRgn")); } else { @@ -641,7 +641,7 @@ bool wxMSWDCImpl::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const { WXMICROWIN_CHECK_HDC_RET(false) - wxCHECK_MSG( col, false, _T("NULL colour parameter in wxMSWDCImpl::GetPixel") ); + wxCHECK_MSG( col, false, wxT("NULL colour parameter in wxMSWDCImpl::GetPixel") ); // get the color of the pixel COLORREF pixelcolor = ::GetPixel(GetHdc(), XLOG2DEV(x), YLOG2DEV(y)); @@ -1174,7 +1174,7 @@ void wxMSWDCImpl::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool { WXMICROWIN_CHECK_HDC - wxCHECK_RET( bmp.IsOk(), _T("invalid bitmap in wxMSWDCImpl::DrawBitmap") ); + wxCHECK_RET( bmp.IsOk(), wxT("invalid bitmap in wxMSWDCImpl::DrawBitmap") ); int width = bmp.GetWidth(), height = bmp.GetHeight(); @@ -1469,7 +1469,7 @@ void wxMSWDCImpl::SetFont(const wxFont& font) HGDIOBJ hfont = ::SelectObject(GetHdc(), GetHfontOf(font)); if ( hfont == HGDI_ERROR ) { - wxLogLastError(_T("SelectObject(font)")); + wxLogLastError(wxT("SelectObject(font)")); } else // selected ok { @@ -1485,7 +1485,7 @@ void wxMSWDCImpl::SetFont(const wxFont& font) { if ( ::SelectObject(GetHdc(), (HPEN) m_oldFont) == HGDI_ERROR ) { - wxLogLastError(_T("SelectObject(old font)")); + wxLogLastError(wxT("SelectObject(old font)")); } m_oldFont = 0; @@ -1507,7 +1507,7 @@ void wxMSWDCImpl::SetPen(const wxPen& pen) HGDIOBJ hpen = ::SelectObject(GetHdc(), GetHpenOf(pen)); if ( hpen == HGDI_ERROR ) { - wxLogLastError(_T("SelectObject(pen)")); + wxLogLastError(wxT("SelectObject(pen)")); } else // selected ok { @@ -1523,7 +1523,7 @@ void wxMSWDCImpl::SetPen(const wxPen& pen) { if ( ::SelectObject(GetHdc(), (HPEN) m_oldPen) == HGDI_ERROR ) { - wxLogLastError(_T("SelectObject(old pen)")); + wxLogLastError(wxT("SelectObject(old pen)")); } m_oldPen = 0; @@ -1555,14 +1555,14 @@ void wxMSWDCImpl::SetBrush(const wxBrush& brush) NULL // [out] previous brush origin ) ) { - wxLogLastError(_T("SetBrushOrgEx()")); + wxLogLastError(wxT("SetBrushOrgEx()")); } } HGDIOBJ hbrush = ::SelectObject(GetHdc(), GetHbrushOf(brush)); if ( hbrush == HGDI_ERROR ) { - wxLogLastError(_T("SelectObject(brush)")); + wxLogLastError(wxT("SelectObject(brush)")); } else // selected ok { @@ -1578,7 +1578,7 @@ void wxMSWDCImpl::SetBrush(const wxBrush& brush) { if ( ::SelectObject(GetHdc(), (HPEN) m_oldBrush) == HGDI_ERROR ) { - wxLogLastError(_T("SelectObject(old brush)")); + wxLogLastError(wxT("SelectObject(old brush)")); } m_oldBrush = 0; @@ -1714,7 +1714,7 @@ void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y HFONT hfontOld; if ( font ) { - wxASSERT_MSG( font->IsOk(), _T("invalid font in wxMSWDCImpl::GetTextExtent") ); + wxASSERT_MSG( font->IsOk(), wxT("invalid font in wxMSWDCImpl::GetTextExtent") ); hfontOld = (HFONT)::SelectObject(GetHdc(), GetHfontOf(*font)); } @@ -1727,7 +1727,7 @@ void wxMSWDCImpl::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y const size_t len = string.length(); if ( !::GetTextExtentPoint32(GetHdc(), string.wx_str(), len, &sizeRect) ) { - wxLogLastError(_T("GetTextExtentPoint32()")); + wxLogLastError(wxT("GetTextExtentPoint32()")); } #if !defined(_WIN32_WCE) || (_WIN32_WCE >= 400) @@ -1887,7 +1887,7 @@ void wxMSWDCImpl::SetMapMode(wxMappingMode mode) break; default: - wxFAIL_MSG( _T("unknown mapping mode in SetMapMode") ); + wxFAIL_MSG( wxT("unknown mapping mode in SetMapMode") ); } } @@ -1978,7 +1978,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, wxRasterOperationMode rop, bool useMask, wxCoord xsrcMask, wxCoord ysrcMask) { - wxCHECK_MSG( source, false, _T("wxMSWDCImpl::Blit(): NULL wxDC pointer") ); + wxCHECK_MSG( source, false, wxT("wxMSWDCImpl::Blit(): NULL wxDC pointer") ); WXMICROWIN_CHECK_HDC_RET(false) @@ -2232,7 +2232,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, dwRop ) ) { - wxLogLastError(_T("StretchBlt")); + wxLogLastError(wxT("StretchBlt")); } else { @@ -2245,7 +2245,7 @@ bool wxMSWDCImpl::DoStretchBlit(wxCoord xdest, wxCoord ydest, if ( !::BitBlt(GetHdc(), xdest, ydest, dstWidth, dstHeight, hdcSrc, xsrc, ysrc, dwRop) ) { - wxLogLastError(_T("BitBlt")); + wxLogLastError(wxT("BitBlt")); } else { @@ -2282,7 +2282,7 @@ void wxMSWDCImpl::DoGetSizeMM(int *w, int *h) const { int wTotal = ::GetDeviceCaps(GetHdc(), HORZRES); - wxCHECK_RET( wTotal, _T("0 width device?") ); + wxCHECK_RET( wTotal, wxT("0 width device?") ); *w = (wPixels * ::GetDeviceCaps(GetHdc(), HORZSIZE)) / wTotal; } @@ -2291,7 +2291,7 @@ void wxMSWDCImpl::DoGetSizeMM(int *w, int *h) const { int hTotal = ::GetDeviceCaps(GetHdc(), VERTRES); - wxCHECK_RET( hTotal, _T("0 height device?") ); + wxCHECK_RET( hTotal, wxT("0 height device?") ); *h = (hPixels * ::GetDeviceCaps(GetHdc(), VERTSIZE)) / hTotal; } @@ -2455,8 +2455,8 @@ static bool AlphaBlt(HDC hdcDst, HDC hdcSrc, const wxBitmap& bmp) { - wxASSERT_MSG( bmp.IsOk() && bmp.HasAlpha(), _T("AlphaBlt(): invalid bitmap") ); - wxASSERT_MSG( hdcDst && hdcSrc, _T("AlphaBlt(): invalid HDC") ); + wxASSERT_MSG( bmp.IsOk() && bmp.HasAlpha(), wxT("AlphaBlt(): invalid bitmap") ); + wxASSERT_MSG( hdcDst && hdcSrc, wxT("AlphaBlt(): invalid HDC") ); // do we have AlphaBlend() and company in the headers? #if defined(AC_SRC_OVER) && wxUSE_DYNLIB_CLASS @@ -2466,7 +2466,7 @@ static bool AlphaBlt(HDC hdcDst, BLENDFUNCTION); static AlphaBlend_t - pfnAlphaBlend = (AlphaBlend_t)wxMSIMG32DLL.GetSymbol(_T("AlphaBlend")); + pfnAlphaBlend = (AlphaBlend_t)wxMSIMG32DLL.GetSymbol(wxT("AlphaBlend")); if ( pfnAlphaBlend ) { BLENDFUNCTION bf; @@ -2483,7 +2483,7 @@ static bool AlphaBlt(HDC hdcDst, return true; } - wxLogLastError(_T("AlphaBlend")); + wxLogLastError(wxT("AlphaBlend")); } #else wxUnusedVar(hdcSrc); @@ -2521,7 +2521,7 @@ wxAlphaBlend(HDC hdcDst, int xDst, int yDst, if ( !::BitBlt(hdcMem, 0, 0, dstWidth, dstHeight, hdcDst, xDst, yDst, SRCCOPY) ) { - wxLogLastError(_T("BitBlt")); + wxLogLastError(wxT("BitBlt")); } // combine them with the source bitmap using alpha @@ -2529,7 +2529,7 @@ wxAlphaBlend(HDC hdcDst, int xDst, int yDst, dataSrc((wxBitmap &)bmpSrc); wxCHECK_RET( dataDst && dataSrc, - _T("failed to get raw data in wxAlphaBlend") ); + wxT("failed to get raw data in wxAlphaBlend") ); wxAlphaPixelData::Iterator pDst(dataDst), pSrc(dataSrc); @@ -2563,7 +2563,7 @@ wxAlphaBlend(HDC hdcDst, int xDst, int yDst, // and finally blit them back to the destination DC if ( !::BitBlt(hdcDst, xDst, yDst, dstWidth, dstHeight, hdcMem, 0, 0, SRCCOPY) ) { - wxLogLastError(_T("BitBlt")); + wxLogLastError(wxT("BitBlt")); } } @@ -2581,7 +2581,7 @@ void wxMSWDCImpl::DoGradientFillLinear (const wxRect& rect, typedef BOOL (WINAPI *GradientFill_t)(HDC, PTRIVERTEX, ULONG, PVOID, ULONG, ULONG); static GradientFill_t pfnGradientFill = - (GradientFill_t)wxMSIMG32DLL.GetSymbol(_T("GradientFill")); + (GradientFill_t)wxMSIMG32DLL.GetSymbol(wxT("GradientFill")); if ( pfnGradientFill ) { @@ -2626,7 +2626,7 @@ void wxMSWDCImpl::DoGradientFillLinear (const wxRect& rect, return; } - wxLogLastError(_T("GradientFill")); + wxLogLastError(wxT("GradientFill")); } #endif // wxUSE_DYNLIB_CLASS @@ -2639,7 +2639,7 @@ static DWORD wxGetDCLayout(HDC hdc) { typedef DWORD (WINAPI *GetLayout_t)(HDC); static GetLayout_t - wxDL_INIT_FUNC(s_pfn, GetLayout, wxDynamicLibrary(_T("gdi32.dll"))); + wxDL_INIT_FUNC(s_pfn, GetLayout, wxDynamicLibrary(wxT("gdi32.dll"))); return s_pfnGetLayout ? s_pfnGetLayout(hdc) : (DWORD)-1; } @@ -2658,7 +2658,7 @@ void wxMSWDCImpl::SetLayoutDirection(wxLayoutDirection dir) { typedef DWORD (WINAPI *SetLayout_t)(HDC, DWORD); static SetLayout_t - wxDL_INIT_FUNC(s_pfn, SetLayout, wxDynamicLibrary(_T("gdi32.dll"))); + wxDL_INIT_FUNC(s_pfn, SetLayout, wxDynamicLibrary(wxT("gdi32.dll"))); if ( !s_pfnSetLayout ) return; diff --git a/src/msw/dcclient.cpp b/src/msw/dcclient.cpp index 50ec2dca2a..b64aee8c82 100644 --- a/src/msw/dcclient.cpp +++ b/src/msw/dcclient.cpp @@ -93,7 +93,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner ) : wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : wxMSWDCImpl( owner ) { - wxCHECK_RET( window, _T("invalid window in wxWindowDCImpl") ); + wxCHECK_RET( window, wxT("invalid window in wxWindowDCImpl") ); m_window = window; m_hDC = (WXHDC) ::GetWindowDC(GetHwndOf(m_window)); @@ -117,7 +117,7 @@ void wxWindowDCImpl::InitDC() void wxWindowDCImpl::DoGetSize(int *width, int *height) const { - wxCHECK_RET( m_window, _T("wxWindowDCImpl without a window?") ); + wxCHECK_RET( m_window, wxT("wxWindowDCImpl without a window?") ); m_window->GetSize(width, height); } @@ -136,7 +136,7 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner ) : wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) : wxWindowDCImpl( owner ) { - wxCHECK_RET( window, _T("invalid window in wxClientDCImpl") ); + wxCHECK_RET( window, wxT("invalid window in wxClientDCImpl") ); m_window = window; m_hDC = (WXHDC)::GetDC(GetHwndOf(window)); @@ -177,7 +177,7 @@ wxClientDCImpl::~wxClientDCImpl() void wxClientDCImpl::DoGetSize(int *width, int *height) const { - wxCHECK_RET( m_window, _T("wxClientDCImpl without a window?") ); + wxCHECK_RET( m_window, wxT("wxClientDCImpl without a window?") ); m_window->GetClientSize(width, height); } diff --git a/src/msw/dcmemory.cpp b/src/msw/dcmemory.cpp index d399b5157b..75e28e8b32 100644 --- a/src/msw/dcmemory.cpp +++ b/src/msw/dcmemory.cpp @@ -58,7 +58,7 @@ wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ) wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc ) : wxMSWDCImpl( owner ) { - wxCHECK_RET( dc, _T("NULL dc in wxMemoryDC ctor") ); + wxCHECK_RET( dc, wxT("NULL dc in wxMemoryDC ctor") ); CreateCompatible(dc); diff --git a/src/msw/dcprint.cpp b/src/msw/dcprint.cpp index c41e222d7b..16402f760e 100644 --- a/src/msw/dcprint.cpp +++ b/src/msw/dcprint.cpp @@ -341,7 +341,7 @@ WXHDC WXDLLEXPORT wxGetPrinterDC(const wxPrintData& printDataConst) ); if ( !hDC ) { - wxLogLastError(_T("CreateDC(printer)")); + wxLogLastError(wxT("CreateDC(printer)")); } return (WXHDC) hDC; @@ -367,7 +367,7 @@ bool DrawBitmapUsingStretchDIBits(HDC hdc, DIBSECTION ds; if ( !::GetObject(dib.GetHandle(), sizeof(ds), &ds) ) { - wxLogLastError(_T("GetObject(DIBSECTION)")); + wxLogLastError(wxT("GetObject(DIBSECTION)")); return false; } @@ -401,7 +401,7 @@ void wxPrinterDCImpl::DoDrawBitmap(const wxBitmap& bmp, wxCoord x, wxCoord y, bool useMask) { - wxCHECK_RET( bmp.Ok(), _T("invalid bitmap in wxPrinterDC::DrawBitmap") ); + wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") ); int width = bmp.GetWidth(), height = bmp.GetHeight(); diff --git a/src/msw/dde.cpp b/src/msw/dde.cpp index 20bbe4bb23..330ffa077d 100644 --- a/src/msw/dde.cpp +++ b/src/msw/dde.cpp @@ -160,7 +160,7 @@ extern void wxDDEInitialize() UINT rc = DdeInitialize(&DDEIdInst, callback, APPCLASS_STANDARD, 0L); if ( rc != DMLERR_NO_ERROR ) { - DDELogError(_T("Failed to initialize DDE"), rc); + DDELogError(wxT("Failed to initialize DDE"), rc); } else { @@ -174,7 +174,7 @@ void wxDDECleanUp() // deleting them later won't work as DDE won't be initialized any more wxASSERT_MSG( wxDDEServerObjects.empty() && wxDDEClientObjects.empty(), - _T("all DDE objects should be deleted by now") ); + wxT("all DDE objects should be deleted by now") ); wxAtomTable.clear(); @@ -539,7 +539,7 @@ bool wxDDEConnection::Disconnect() bool ok = DdeDisconnect(GetHConv()) != 0; if ( !ok ) { - DDELogError(_T("Failed to disconnect from DDE server gracefully")); + DDELogError(wxT("Failed to disconnect from DDE server gracefully")); } SetConnected( false ); // so we don't try and disconnect again @@ -554,7 +554,7 @@ wxDDEConnection::DoExecute(const void *data, size_t size, wxIPCFormat format) format == wxIPC_UTF8TEXT || format == wxIPC_UNICODETEXT, false, - _T("wxDDEServer::Execute() supports only text data") ); + wxT("wxDDEServer::Execute() supports only text data") ); wxMemoryBuffer buffer; LPBYTE realData = NULL; @@ -605,7 +605,7 @@ wxDDEConnection::DoExecute(const void *data, size_t size, wxIPCFormat format) // we could implement this in theory but it's not obvious how to pass // the format information and, basically, why bother -- just use // Unicode build - wxFAIL_MSG( _T("UTF-8 text not supported in ANSI build") ); + wxFAIL_MSG( wxT("UTF-8 text not supported in ANSI build") ); return false; } @@ -649,7 +649,7 @@ wxDDEConnection::DoExecute(const void *data, size_t size, wxIPCFormat format) if ( !ok ) { - DDELogError(_T("DDE execute request failed")); + DDELogError(wxT("DDE execute request failed")); } return ok; @@ -669,7 +669,7 @@ const void *wxDDEConnection::Request(const wxString& item, size_t *size, wxIPCFo &result); if ( !returned_data ) { - DDELogError(_T("DDE data request failed")); + DDELogError(wxT("DDE data request failed")); return NULL; } @@ -678,7 +678,7 @@ const void *wxDDEConnection::Request(const wxString& item, size_t *size, wxIPCFo void *data = GetBufferAtLeast(len); wxASSERT_MSG(data != NULL, - _T("Buffer too small in wxDDEConnection::Request") ); + wxT("Buffer too small in wxDDEConnection::Request") ); (void) DdeGetData(returned_data, (LPBYTE)data, len, 0); (void) DdeFreeDataHandle(returned_data); @@ -845,7 +845,7 @@ _DDECallback(WORD wType, void *data = connection->GetBufferAtLeast(len); wxASSERT_MSG(data != NULL, - _T("Buffer too small in _DDECallback (XTYP_EXECUTE)") ); + wxT("Buffer too small in _DDECallback (XTYP_EXECUTE)") ); DdeGetData(hData, (LPBYTE)data, len, 0); @@ -926,7 +926,7 @@ _DDECallback(WORD wType, void *data = connection->GetBufferAtLeast(len); wxASSERT_MSG(data != NULL, - _T("Buffer too small in _DDECallback (XTYP_POKE)") ); + wxT("Buffer too small in _DDECallback (XTYP_POKE)") ); DdeGetData(hData, (LPBYTE)data, len, 0); @@ -1013,7 +1013,7 @@ _DDECallback(WORD wType, void *data = connection->GetBufferAtLeast(len); wxASSERT_MSG(data != NULL, - _T("Buffer too small in _DDECallback (XTYP_ADVDATA)") ); + wxT("Buffer too small in _DDECallback (XTYP_ADVDATA)") ); DdeGetData(hData, (LPBYTE)data, len, 0); @@ -1063,7 +1063,7 @@ The returned handle has to be freed by the caller (using */ static HSZ DDEAtomFromString(const wxString& s) { - wxASSERT_MSG( DDEIdInst, _T("DDE not initialized") ); + wxASSERT_MSG( DDEIdInst, wxT("DDE not initialized") ); HSZ hsz = DdeCreateStringHandle(DDEIdInst, (wxChar*)s.wx_str(), DDE_CP); if ( !hsz ) @@ -1105,7 +1105,7 @@ static void DDELogError(const wxString& s, UINT error) error = DdeGetLastError(DDEIdInst); } - wxLogError(s + _T(": ") + DDEGetErrorMsg(error)); + wxLogError(s + wxT(": ") + DDEGetErrorMsg(error)); } static wxString DDEGetErrorMsg(UINT error) diff --git a/src/msw/debughlp.cpp b/src/msw/debughlp.cpp index d2ddec0146..c0a0a560d9 100644 --- a/src/msw/debughlp.cpp +++ b/src/msw/debughlp.cpp @@ -66,10 +66,10 @@ static bool BindDbgHelpFunctions(const wxDynamicLibrary& dllDbgHelp) { #define LOAD_SYM_FUNCTION(name) \ wxDbgHelpDLL::name = (wxDbgHelpDLL::name ## _t) \ - dllDbgHelp.GetSymbol(_T(#name)); \ + dllDbgHelp.GetSymbol(wxT(#name)); \ if ( !wxDbgHelpDLL::name ) \ { \ - gs_errMsg += _T("Function ") _T(#name) _T("() not found.\n"); \ + gs_errMsg += wxT("Function ") wxT(#name) wxT("() not found.\n"); \ return false; \ } @@ -83,7 +83,7 @@ static bool BindDbgHelpFunctions(const wxDynamicLibrary& dllDbgHelp) // called by Init() if we hadn't done this before static bool DoInit() { - wxDynamicLibrary dllDbgHelp(_T("dbghelp.dll"), wxDL_VERBATIM); + wxDynamicLibrary dllDbgHelp(wxT("dbghelp.dll"), wxDL_VERBATIM); if ( dllDbgHelp.IsLoaded() ) { if ( BindDbgHelpFunctions(dllDbgHelp) ) @@ -99,19 +99,19 @@ static bool DoInit() return true; } - gs_errMsg += _T("\nPlease update your dbghelp.dll version, ") - _T("at least version 5.1 is needed!\n") - _T("(if you already have a new version, please ") - _T("put it in the same directory where the program is.)\n"); + gs_errMsg += wxT("\nPlease update your dbghelp.dll version, ") + wxT("at least version 5.1 is needed!\n") + wxT("(if you already have a new version, please ") + wxT("put it in the same directory where the program is.)\n"); } else // failed to load dbghelp.dll { - gs_errMsg += _T("Please install dbghelp.dll available free of charge ") - _T("from Microsoft to get more detailed crash information!"); + gs_errMsg += wxT("Please install dbghelp.dll available free of charge ") + wxT("from Microsoft to get more detailed crash information!"); } - gs_errMsg += _T("\nLatest dbghelp.dll is available at ") - _T("http://www.microsoft.com/whdc/ddk/debugging/\n"); + gs_errMsg += wxT("\nLatest dbghelp.dll is available at ") + wxT("http://www.microsoft.com/whdc/ddk/debugging/\n"); return false; } @@ -144,7 +144,7 @@ const wxString& wxDbgHelpDLL::GetErrorMessage() /* static */ void wxDbgHelpDLL::LogError(const wxChar *func) { - ::OutputDebugString(wxString::Format(_T("dbghelp: %s() failed: %s\r\n"), + ::OutputDebugString(wxString::Format(wxT("dbghelp: %s() failed: %s\r\n"), func, wxSysErrorMsg(::GetLastError())).wx_str()); } @@ -212,12 +212,12 @@ wxDbgHelpDLL::DumpBaseType(BasicType bt, DWORD64 length, PVOID pAddress) { if ( !pAddress ) { - return _T("null"); + return wxT("null"); } if ( ::IsBadReadPtr(pAddress, length) != 0 ) { - return _T("BAD"); + return wxT("BAD"); } @@ -229,13 +229,13 @@ wxDbgHelpDLL::DumpBaseType(BasicType bt, DWORD64 length, PVOID pAddress) const BYTE b = *(PBYTE)pAddress; if ( bt == BASICTYPE_BOOL ) - s = b ? _T("true") : _T("false"); + s = b ? wxT("true") : wxT("false"); else - s.Printf(_T("%#04x"), b); + s.Printf(wxT("%#04x"), b); } else if ( length == 2 ) { - s.Printf(bt == BASICTYPE_UINT ? _T("%#06x") : _T("%d"), + s.Printf(bt == BASICTYPE_UINT ? wxT("%#06x") : wxT("%d"), *(PWORD)pAddress); } else if ( length == 4 ) @@ -244,7 +244,7 @@ wxDbgHelpDLL::DumpBaseType(BasicType bt, DWORD64 length, PVOID pAddress) if ( bt == BASICTYPE_FLOAT ) { - s.Printf(_T("%f"), *(PFLOAT)pAddress); + s.Printf(wxT("%f"), *(PFLOAT)pAddress); handled = true; } @@ -256,12 +256,12 @@ wxDbgHelpDLL::DumpBaseType(BasicType bt, DWORD64 length, PVOID pAddress) const char *pc = *(PSTR *)pAddress; if ( ::IsBadStringPtrA(pc, NUM_CHARS) == 0 ) { - s += _T('"'); + s += wxT('"'); for ( size_t n = 0; n < NUM_CHARS && *pc; n++, pc++ ) { s += *pc; } - s += _T('"'); + s += wxT('"'); handled = true; } @@ -270,18 +270,18 @@ wxDbgHelpDLL::DumpBaseType(BasicType bt, DWORD64 length, PVOID pAddress) if ( !handled ) { // treat just as an opaque DWORD - s.Printf(_T("%#x"), *(PDWORD)pAddress); + s.Printf(wxT("%#x"), *(PDWORD)pAddress); } } else if ( length == 8 ) { if ( bt == BASICTYPE_FLOAT ) { - s.Printf(_T("%lf"), *(double *)pAddress); + s.Printf(wxT("%lf"), *(double *)pAddress); } else // opaque 64 bit value { - s.Printf(_T("%#" wxLongLongFmtSpec _T("x")), *(PDWORD *)pAddress); + s.Printf(wxT("%#" wxLongLongFmtSpec wxT("x")), *(PDWORD *)pAddress); } } @@ -315,7 +315,7 @@ wxDbgHelpDLL::DumpField(PSYMBOL_INFO pSym, void *pVariable, unsigned level) case SYMBOL_TAG_DATA: if ( !pVariable ) { - s = _T("NULL"); + s = wxT("NULL"); } else // valid location { @@ -364,14 +364,14 @@ wxDbgHelpDLL::DumpField(PSYMBOL_INFO pSym, void *pVariable, unsigned level) if ( !s.empty() ) { - s = GetSymbolName(pSym) + _T(" = ") + s; + s = GetSymbolName(pSym) + wxT(" = ") + s; } break; } if ( !s.empty() ) { - s = wxString(_T('\t'), level + 1) + s + _T('\n'); + s = wxString(wxT('\t'), level + 1) + s + wxT('\n'); } return s; @@ -395,7 +395,7 @@ wxDbgHelpDLL::DumpUDT(PSYMBOL_INFO pSym, void *pVariable, unsigned level) // special handling for ubiquitous wxString: although the code below works // for it as well, it shows the wxStringBase class and takes 4 lines // instead of only one as this branch - if ( s == _T("wxString") ) + if ( s == wxT("wxString") ) { wxString *ps = (wxString *)pVariable; @@ -416,7 +416,7 @@ wxDbgHelpDLL::DumpUDT(PSYMBOL_INFO pSym, void *pVariable, unsigned level) } } - s << _T("(\"") << (p ? p : _T("???")) << _T(")\""); + s << wxT("(\"") << (p ? p : wxT("???")) << wxT(")\""); } else // any other UDT #endif // !wxUSE_STD_STRING @@ -442,7 +442,7 @@ wxDbgHelpDLL::DumpUDT(PSYMBOL_INFO pSym, void *pVariable, unsigned level) return s; } - s << _T(" {\n"); + s << wxT(" {\n"); // Iterate through all children SYMBOL_INFO sym; @@ -469,7 +469,7 @@ wxDbgHelpDLL::DumpUDT(PSYMBOL_INFO pSym, void *pVariable, unsigned level) free(children); - s << wxString(_T('\t'), level + 1) << _T('}'); + s << wxString(wxT('\t'), level + 1) << wxT('}'); } return s; @@ -550,37 +550,37 @@ static wxString TagString(wxDbgHelpDLL::SymbolTag tag) { static const wxChar *tags[] = { - _T("null"), - _T("exe"), - _T("compiland"), - _T("compiland details"), - _T("compiland env"), - _T("function"), - _T("block"), - _T("data"), - _T("annotation"), - _T("label"), - _T("public symbol"), - _T("udt"), - _T("enum"), - _T("function type"), - _T("pointer type"), - _T("array type"), - _T("base type"), - _T("typedef"), - _T("base class"), - _T("friend"), - _T("function arg type"), - _T("func debug start"), - _T("func debug end"), - _T("using namespace"), - _T("vtable shape"), - _T("vtable"), - _T("custom"), - _T("thunk"), - _T("custom type"), - _T("managed type"), - _T("dimension"), + wxT("null"), + wxT("exe"), + wxT("compiland"), + wxT("compiland details"), + wxT("compiland env"), + wxT("function"), + wxT("block"), + wxT("data"), + wxT("annotation"), + wxT("label"), + wxT("public symbol"), + wxT("udt"), + wxT("enum"), + wxT("function type"), + wxT("pointer type"), + wxT("array type"), + wxT("base type"), + wxT("typedef"), + wxT("base class"), + wxT("friend"), + wxT("function arg type"), + wxT("func debug start"), + wxT("func debug end"), + wxT("using namespace"), + wxT("vtable shape"), + wxT("vtable"), + wxT("custom"), + wxT("thunk"), + wxT("custom type"), + wxT("managed type"), + wxT("dimension"), }; wxCOMPILE_TIME_ASSERT( WXSIZEOF(tags) == wxDbgHelpDLL::SYMBOL_TAG_MAX, @@ -590,7 +590,7 @@ static wxString TagString(wxDbgHelpDLL::SymbolTag tag) if ( tag < WXSIZEOF(tags) ) s = tags[tag]; else - s.Printf(_T("unrecognized tag (%d)"), tag); + s.Printf(wxT("unrecognized tag (%d)"), tag); return s; } @@ -599,16 +599,16 @@ static wxString KindString(wxDbgHelpDLL::DataKind kind) { static const wxChar *kinds[] = { - _T("unknown"), - _T("local"), - _T("static local"), - _T("param"), - _T("object ptr"), - _T("file static"), - _T("global"), - _T("member"), - _T("static member"), - _T("constant"), + wxT("unknown"), + wxT("local"), + wxT("static local"), + wxT("param"), + wxT("object ptr"), + wxT("file static"), + wxT("global"), + wxT("member"), + wxT("static member"), + wxT("constant"), }; wxCOMPILE_TIME_ASSERT( WXSIZEOF(kinds) == wxDbgHelpDLL::DATA_MAX, @@ -618,7 +618,7 @@ static wxString KindString(wxDbgHelpDLL::DataKind kind) if ( kind < WXSIZEOF(kinds) ) s = kinds[kind]; else - s.Printf(_T("unrecognized kind (%d)"), kind); + s.Printf(wxT("unrecognized kind (%d)"), kind); return s; } @@ -627,9 +627,9 @@ static wxString UdtKindString(wxDbgHelpDLL::UdtKind kind) { static const wxChar *kinds[] = { - _T("struct"), - _T("class"), - _T("union"), + wxT("struct"), + wxT("class"), + wxT("union"), }; wxCOMPILE_TIME_ASSERT( WXSIZEOF(kinds) == wxDbgHelpDLL::UDT_MAX, @@ -639,7 +639,7 @@ static wxString UdtKindString(wxDbgHelpDLL::UdtKind kind) if ( kind < WXSIZEOF(kinds) ) s = kinds[kind]; else - s.Printf(_T("unrecognized UDT (%d)"), kind); + s.Printf(wxT("unrecognized UDT (%d)"), kind); return s; } @@ -648,38 +648,38 @@ static wxString TypeString(wxDbgHelpDLL::BasicType bt) { static const wxChar *types[] = { - _T("no type"), - _T("void"), - _T("char"), - _T("wchar"), - _T(""), - _T(""), - _T("int"), - _T("uint"), - _T("float"), - _T("bcd"), - _T("bool"), - _T(""), - _T(""), - _T("long"), - _T("ulong"), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T(""), - _T("CURRENCY"), - _T("DATE"), - _T("VARIANT"), - _T("complex"), - _T("bit"), - _T("BSTR"), - _T("HRESULT"), + wxT("no type"), + wxT("void"), + wxT("char"), + wxT("wchar"), + wxT(""), + wxT(""), + wxT("int"), + wxT("uint"), + wxT("float"), + wxT("bcd"), + wxT("bool"), + wxT(""), + wxT(""), + wxT("long"), + wxT("ulong"), + wxT(""), + wxT(""), + wxT(""), + wxT(""), + wxT(""), + wxT(""), + wxT(""), + wxT(""), + wxT(""), + wxT(""), + wxT("CURRENCY"), + wxT("DATE"), + wxT("VARIANT"), + wxT("complex"), + wxT("bit"), + wxT("BSTR"), + wxT("HRESULT"), }; wxCOMPILE_TIME_ASSERT( WXSIZEOF(types) == wxDbgHelpDLL::BASICTYPE_MAX, @@ -690,7 +690,7 @@ static wxString TypeString(wxDbgHelpDLL::BasicType bt) s = types[bt]; if ( s.empty() ) - s.Printf(_T("unrecognized type (%d)"), bt); + s.Printf(wxT("unrecognized type (%d)"), bt); return s; } @@ -707,11 +707,11 @@ extern "C" void DumpTI(ULONG ti) DoGetTypeInfo(&sym, TI_GET_SYMTAG, &tag); DoGetTypeInfo(&sym, TI_GET_TYPEID, &ti); - OutputDebugString(wxString::Format(_T("Type 0x%x: "), sym.TypeIndex)); + OutputDebugString(wxString::Format(wxT("Type 0x%x: "), sym.TypeIndex)); wxString name = wxDbgHelpDLL::GetSymbolName(&sym); if ( !name.empty() ) { - OutputDebugString(wxString::Format(_T("name=\"%s\", "), name.c_str())); + OutputDebugString(wxString::Format(wxT("name=\"%s\", "), name.c_str())); } DWORD nested; @@ -720,15 +720,15 @@ extern "C" void DumpTI(ULONG ti) nested = FALSE; } - OutputDebugString(wxString::Format(_T("tag=%s%s"), - nested ? _T("nested ") : wxEmptyString, + OutputDebugString(wxString::Format(wxT("tag=%s%s"), + nested ? wxT("nested ") : wxEmptyString, TagString(tag).c_str())); if ( tag == wxDbgHelpDLL::SYMBOL_TAG_UDT ) { wxDbgHelpDLL::UdtKind udtKind; if ( DoGetTypeInfo(&sym, TI_GET_UDTKIND, &udtKind) ) { - OutputDebugString(_T(" (") + UdtKindString(udtKind) + _T(')')); + OutputDebugString(wxT(" (") + UdtKindString(udtKind) + wxT(')')); } } @@ -736,13 +736,13 @@ extern "C" void DumpTI(ULONG ti) if ( DoGetTypeInfo(&sym, TI_GET_DATAKIND, &kind) ) { OutputDebugString(wxString::Format( - _T(", kind=%s"), KindString(kind).c_str())); + wxT(", kind=%s"), KindString(kind).c_str())); if ( kind == wxDbgHelpDLL::DATA_MEMBER ) { DWORD ofs = 0; if ( DoGetTypeInfo(&sym, TI_GET_OFFSET, &ofs) ) { - OutputDebugString(wxString::Format(_T(" (ofs=0x%x)"), ofs)); + OutputDebugString(wxString::Format(wxT(" (ofs=0x%x)"), ofs)); } } } @@ -750,16 +750,16 @@ extern "C" void DumpTI(ULONG ti) wxDbgHelpDLL::BasicType bt = GetBasicType(&sym); if ( bt ) { - OutputDebugString(wxString::Format(_T(", type=%s"), + OutputDebugString(wxString::Format(wxT(", type=%s"), TypeString(bt).c_str())); } if ( ti != sym.TypeIndex ) { - OutputDebugString(wxString::Format(_T(", next ti=0x%x"), ti)); + OutputDebugString(wxString::Format(wxT(", next ti=0x%x"), ti)); } - OutputDebugString(_T("\r\n")); + OutputDebugString(wxT("\r\n")); } #endif // NDEBUG diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index cc22686d7f..592c23a9bc 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -260,7 +260,7 @@ void wxDialog::Raise() // show dialog modally int wxDialog::ShowModal() { - wxASSERT_MSG( !IsModal(), _T("ShowModal() can't be called twice") ); + wxASSERT_MSG( !IsModal(), wxT("ShowModal() can't be called twice") ); Show(); @@ -279,7 +279,7 @@ int wxDialog::ShowModal() void wxDialog::EndModal(int retCode) { - wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") ); + wxASSERT_MSG( IsModal(), wxT("EndModal() called for non modal dialog") ); SetReturnCode(retCode); @@ -336,7 +336,7 @@ void wxDialog::DestroyGripper() // have been called yet) wxASSERT_MSG( !IsShown() || ::GetWindow((HWND)m_hGripper, GW_HWNDNEXT) == 0, - _T("Bug in wxWidgets: gripper should be at the bottom of Z-order") ); + wxT("Bug in wxWidgets: gripper should be at the bottom of Z-order") ); ::DestroyWindow((HWND) m_hGripper); m_hGripper = 0; } @@ -344,7 +344,7 @@ void wxDialog::DestroyGripper() void wxDialog::ShowGripper(bool show) { - wxASSERT_MSG( m_hGripper, _T("shouldn't be called if we have no gripper") ); + wxASSERT_MSG( m_hGripper, wxT("shouldn't be called if we have no gripper") ); if ( show ) ResizeGripper(); @@ -354,7 +354,7 @@ void wxDialog::ShowGripper(bool show) void wxDialog::ResizeGripper() { - wxASSERT_MSG( m_hGripper, _T("shouldn't be called if we have no gripper") ); + wxASSERT_MSG( m_hGripper, wxT("shouldn't be called if we have no gripper") ); HWND hwndGripper = (HWND)m_hGripper; diff --git a/src/msw/dialup.cpp b/src/msw/dialup.cpp index ddc42b8e2d..24c13f4da6 100644 --- a/src/msw/dialup.cpp +++ b/src/msw/dialup.cpp @@ -111,7 +111,7 @@ static const wxChar *gs_classForDialUpWindow = NULL; typedef DWORD (APIENTRY * RASVALIDATEENTRYNAME)( LPCSTR, LPCSTR ); typedef DWORD (APIENTRY * RASCONNECTIONNOTIFICATION)( HRASCONN, HANDLE, DWORD ); - static const wxChar gs_funcSuffix = _T('A'); + static const wxChar gs_funcSuffix = wxT('A'); #else // Unicode typedef DWORD (APIENTRY * RASDIAL)( LPRASDIALEXTENSIONS, LPCWSTR, LPRASDIALPARAMSW, DWORD, LPVOID, LPHRASCONN ); typedef DWORD (APIENTRY * RASENUMCONNECTIONS)( LPRASCONNW, LPDWORD, LPDWORD ); @@ -133,7 +133,7 @@ static const wxChar *gs_classForDialUpWindow = NULL; typedef DWORD (APIENTRY * RASVALIDATEENTRYNAME)( LPCWSTR, LPCWSTR ); typedef DWORD (APIENTRY * RASCONNECTIONNOTIFICATION)( HRASCONN, HANDLE, DWORD ); - static const wxChar gs_funcSuffix = _T('W'); + static const wxChar gs_funcSuffix = wxT('W'); #endif // ASCII/Unicode // structure passed to the secondary thread @@ -384,7 +384,7 @@ wxDialUpManager *wxDialUpManager::Create() wxDialUpManagerMSW::wxDialUpManagerMSW() : m_timerStatusPolling(this), - m_dllRas(_T("RASAPI32")) + m_dllRas(wxT("RASAPI32")) { // initialize our data m_autoCheckLevel = 0; @@ -405,7 +405,7 @@ wxDialUpManagerMSW::wxDialUpManagerMSW() // get the function from rasapi32.dll and abort if it's not found #define RESOLVE_RAS_FUNCTION(type, name) \ - ms_pfn##name = (type)m_dllRas.GetSymbol( wxString(_T(#name)) \ + ms_pfn##name = (type)m_dllRas.GetSymbol( wxString(wxT(#name)) \ + gs_funcSuffix); \ if ( !ms_pfn##name ) \ { \ @@ -416,7 +416,7 @@ wxDialUpManagerMSW::wxDialUpManagerMSW() // a variant of above macro which doesn't abort if the function is // not found in the DLL #define RESOLVE_OPTIONAL_RAS_FUNCTION(type, name) \ - ms_pfn##name = (type)m_dllRas.GetSymbol( wxString(_T(#name)) \ + ms_pfn##name = (type)m_dllRas.GetSymbol( wxString(wxT(#name)) \ + gs_funcSuffix); RESOLVE_RAS_FUNCTION(RASDIAL, RasDial); @@ -582,7 +582,7 @@ void wxDialUpManagerMSW::CleanUpThreadData() { if ( !SetEvent(m_data->hEventQuit) ) { - wxLogLastError(_T("SetEvent(RasThreadQuit)")); + wxLogLastError(wxT("SetEvent(RasThreadQuit)")); } else // sent quit request to the background thread { @@ -984,14 +984,14 @@ bool wxDialUpManagerMSW::IsAlwaysOnline() const // but we allow multiple instances of wxDialUpManagerMSW so // we might as well use the ref counted version here too. - wxDynamicLibrary hDll(_T("WININET")); + wxDynamicLibrary hDll(wxT("WININET")); if ( hDll.IsLoaded() ) { typedef BOOL (WINAPI *INTERNETGETCONNECTEDSTATE)(LPDWORD, DWORD); INTERNETGETCONNECTEDSTATE pfnInternetGetConnectedState; #define RESOLVE_FUNCTION(type, name) \ - pfn##name = (type)hDll.GetSymbol(_T(#name)) + pfn##name = (type)hDll.GetSymbol(wxT(#name)) RESOLVE_FUNCTION(INTERNETGETCONNECTEDSTATE, InternetGetConnectedState); @@ -1269,7 +1269,7 @@ static DWORD wxRasMonitorThread(wxRasThreadData *data) break; default: - wxFAIL_MSG( _T("unexpected return of WaitForMultipleObjects()") ); + wxFAIL_MSG( wxT("unexpected return of WaitForMultipleObjects()") ); // fall through case WAIT_FAILED: diff --git a/src/msw/dib.cpp b/src/msw/dib.cpp index 16bc7178b3..41964e89ed 100644 --- a/src/msw/dib.cpp +++ b/src/msw/dib.cpp @@ -91,7 +91,7 @@ bool wxDIB::Create(int width, int height, int depth) { // we don't support formats using palettes right now so we only create // either 24bpp (RGB) or 32bpp (RGBA) bitmaps - wxASSERT_MSG( depth, _T("invalid image depth in wxDIB::Create()") ); + wxASSERT_MSG( depth, wxT("invalid image depth in wxDIB::Create()") ); if ( depth < 24 ) depth = 24; @@ -139,7 +139,7 @@ bool wxDIB::Create(int width, int height, int depth) bool wxDIB::Create(const wxBitmap& bmp) { - wxCHECK_MSG( bmp.Ok(), false, _T("wxDIB::Create(): invalid bitmap") ); + wxCHECK_MSG( bmp.Ok(), false, wxT("wxDIB::Create(): invalid bitmap") ); if ( !Create(GetHbitmapOf(bmp)) ) return false; @@ -226,7 +226,7 @@ bool wxDIB::CopyFromDDB(HBITMAP hbmp) SRCCOPY ) ) { - wxLogLastError(_T("BitBlt(DDB -> DIB)")); + wxLogLastError(wxT("BitBlt(DDB -> DIB)")); return false; } @@ -242,7 +242,7 @@ bool wxDIB::CopyFromDDB(HBITMAP hbmp) if ( !GetDIBSection(m_handle, &ds) ) { // we're sure that our handle is a DIB section, so this should work - wxFAIL_MSG( _T("GetObject(DIBSECTION) unexpectedly failed") ); + wxFAIL_MSG( wxT("GetObject(DIBSECTION) unexpectedly failed") ); return false; } @@ -289,7 +289,7 @@ bool wxDIB::Load(const wxString& filename) if ( !m_handle ) { - wxLogLastError(_T("Loading DIB from file")); + wxLogLastError(wxT("Loading DIB from file")); return false; } @@ -299,7 +299,7 @@ bool wxDIB::Load(const wxString& filename) bool wxDIB::Save(const wxString& filename) { - wxCHECK_MSG( m_handle, false, _T("wxDIB::Save(): invalid object") ); + wxCHECK_MSG( m_handle, false, wxT("wxDIB::Save(): invalid object") ); #if wxUSE_FILE wxFile file(filename, wxFile::write); @@ -309,7 +309,7 @@ bool wxDIB::Save(const wxString& filename) DIBSECTION ds; if ( !GetDIBSection(m_handle, &ds) ) { - wxLogLastError(_T("GetObject(hDIB)")); + wxLogLastError(wxT("GetObject(hDIB)")); } else { @@ -361,7 +361,7 @@ void wxDIB::DoGetObject() const DIBSECTION ds; if ( !GetDIBSection(m_handle, &ds) ) { - wxLogLastError(_T("GetObject(hDIB)")); + wxLogLastError(wxT("GetObject(hDIB)")); return; } @@ -382,12 +382,12 @@ void wxDIB::DoGetObject() const HBITMAP wxDIB::CreateDDB(HDC hdc) const { - wxCHECK_MSG( m_handle, 0, _T("wxDIB::CreateDDB(): invalid object") ); + wxCHECK_MSG( m_handle, 0, wxT("wxDIB::CreateDDB(): invalid object") ); DIBSECTION ds; if ( !GetDIBSection(m_handle, &ds) ) { - wxLogLastError(_T("GetObject(hDIB)")); + wxLogLastError(wxT("GetObject(hDIB)")); return 0; } @@ -422,7 +422,7 @@ HBITMAP wxDIB::CreateDDB(HDC hdc) const /* static */ HBITMAP wxDIB::ConvertToBitmap(const BITMAPINFO *pbmi, HDC hdc, void *bits) { - wxCHECK_MSG( pbmi, 0, _T("invalid DIB in ConvertToBitmap") ); + wxCHECK_MSG( pbmi, 0, wxT("invalid DIB in ConvertToBitmap") ); // here we get BITMAPINFO struct followed by the actual bitmap bits and // BITMAPINFO starts with BITMAPINFOHEADER followed by colour info @@ -568,7 +568,7 @@ HGLOBAL wxDIB::ConvertFromBitmap(HBITMAP hbmp) { // this really shouldn't happen... it worked the first time, why not // now? - wxFAIL_MSG( _T("wxDIB::ConvertFromBitmap() unexpectedly failed") ); + wxFAIL_MSG( wxT("wxDIB::ConvertFromBitmap() unexpectedly failed") ); return NULL; } @@ -590,12 +590,12 @@ wxPalette *wxDIB::CreatePalette() const #if defined(_WIN32_WCE) && _WIN32_WCE < 400 return NULL; #else - wxCHECK_MSG( m_handle, NULL, _T("wxDIB::CreatePalette(): invalid object") ); + wxCHECK_MSG( m_handle, NULL, wxT("wxDIB::CreatePalette(): invalid object") ); DIBSECTION ds; if ( !GetDIBSection(m_handle, &ds) ) { - wxLogLastError(_T("GetObject(hDIB)")); + wxLogLastError(wxT("GetObject(hDIB)")); return 0; } @@ -623,7 +623,7 @@ wxPalette *wxDIB::CreatePalette() const // going to have biClrUsed of them so add necessary space LOGPALETTE *pPalette = (LOGPALETTE *) malloc(sizeof(LOGPALETTE) + (biClrUsed - 1)*sizeof(PALETTEENTRY)); - wxCHECK_MSG( pPalette, NULL, _T("out of memory") ); + wxCHECK_MSG( pPalette, NULL, wxT("out of memory") ); // initialize the palette header pPalette->palVersion = 0x300; // magic number, not in docs but works @@ -648,7 +648,7 @@ wxPalette *wxDIB::CreatePalette() const if ( !hPalette ) { - wxLogLastError(_T("CreatePalette")); + wxLogLastError(wxT("CreatePalette")); return NULL; } @@ -670,7 +670,7 @@ wxPalette *wxDIB::CreatePalette() const bool wxDIB::Create(const wxImage& image) { - wxCHECK_MSG( image.Ok(), false, _T("invalid wxImage in wxDIB ctor") ); + wxCHECK_MSG( image.Ok(), false, wxT("invalid wxImage in wxDIB ctor") ); const int h = image.GetHeight(); const int w = image.GetWidth(); diff --git a/src/msw/dir.cpp b/src/msw/dir.cpp index 71657292de..5404038be8 100644 --- a/src/msw/dir.cpp +++ b/src/msw/dir.cpp @@ -61,7 +61,7 @@ inline void FreeFindData(FIND_DATA fd) { if ( !::FindClose(fd) ) { - wxLogLastError(_T("FindClose")); + wxLogLastError(wxT("FindClose")); } } @@ -190,10 +190,10 @@ bool wxDirData::Read(wxString *filename) wxString filespec = m_dirname; if ( !wxEndsWithPathSeparator(filespec) ) { - filespec += _T('\\'); + filespec += wxT('\\'); } if ( !m_filespec ) - filespec += _T("*.*"); + filespec += wxT("*.*"); else filespec += m_filespec; @@ -236,7 +236,7 @@ bool wxDirData::Read(wxString *filename) if ( err != ERROR_NO_MORE_FILES ) { - wxLogLastError(_T("FindNext")); + wxLogLastError(wxT("FindNext")); } #endif // __WIN32__ //else: not an error, just no more (such) files @@ -249,9 +249,9 @@ bool wxDirData::Read(wxString *filename) attr = GetAttrFromFindData(PTR_TO_FINDDATA); // don't return "." and ".." unless asked for - if ( name[0] == _T('.') && - ((name[1] == _T('.') && name[2] == _T('\0')) || - (name[1] == _T('\0'))) ) + if ( name[0] == wxT('.') && + ((name[1] == wxT('.') && name[2] == wxT('\0')) || + (name[1] == wxT('\0'))) ) { if ( !(m_flags & wxDIR_DOTDOT) ) continue; @@ -341,9 +341,9 @@ wxString wxDir::GetName() const if ( !name.empty() ) { // bring to canonical Windows form - name.Replace(_T("/"), _T("\\")); + name.Replace(wxT("/"), wxT("\\")); - if ( name.Last() == _T('\\') ) + if ( name.Last() == wxT('\\') ) { // chop off the last (back)slash name.Truncate(name.length() - 1); @@ -367,7 +367,7 @@ bool wxDir::GetFirst(wxString *filename, const wxString& filespec, int flags) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); M_DIR->Rewind(); @@ -379,9 +379,9 @@ bool wxDir::GetFirst(wxString *filename, bool wxDir::GetNext(wxString *filename) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); - wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") ); + wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") ); return M_DIR->Read(filename); } @@ -399,11 +399,11 @@ wxGetDirectoryTimes(const wxString& dirname, #ifdef __WXWINCE__ // FindFirst() is going to fail wxASSERT_MSG( !dirname.empty(), - _T("incorrect directory name format in wxGetDirectoryTimes") ); + wxT("incorrect directory name format in wxGetDirectoryTimes") ); #else // FindFirst() is going to fail - wxASSERT_MSG( !dirname.empty() && dirname.Last() != _T('\\'), - _T("incorrect directory name format in wxGetDirectoryTimes") ); + wxASSERT_MSG( !dirname.empty() && dirname.Last() != wxT('\\'), + wxT("incorrect directory name format in wxGetDirectoryTimes") ); #endif FIND_STRUCT fs; diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index d483be374e..1885114647 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -100,19 +100,19 @@ void wxDirDialog::SetPath(const wxString& path) m_path = path; // SHBrowseForFolder doesn't like '/'s nor the trailing backslashes - m_path.Replace(_T("/"), _T("\\")); + m_path.Replace(wxT("/"), wxT("\\")); if ( !m_path.empty() ) { - while ( *(m_path.end() - 1) == _T('\\') ) + while ( *(m_path.end() - 1) == wxT('\\') ) { m_path.erase(m_path.length() - 1); } // but the root drive should have a trailing slash (again, this is just // the way the native dialog works) - if ( *(m_path.end() - 1) == _T(':') ) + if ( *(m_path.end() - 1) == wxT(':') ) { - m_path += _T('\\'); + m_path += wxT('\\'); } } } diff --git a/src/msw/display.cpp b/src/msw/display.cpp index 93c673b3ea..d64dc163fb 100644 --- a/src/msw/display.cpp +++ b/src/msw/display.cpp @@ -88,9 +88,9 @@ // display functions are found in different DLLs under WinCE and normal Win32 #ifdef __WXWINCE__ -static const wxChar displayDllName[] = _T("coredll.dll"); +static const wxChar displayDllName[] = wxT("coredll.dll"); #else -static const wxChar displayDllName[] = _T("user32.dll"); +static const wxChar displayDllName[] = wxT("user32.dll"); #endif // ---------------------------------------------------------------------------- @@ -401,7 +401,7 @@ private: // system option #if wxUSE_DIRECTDRAW - if ( wxSystemOptions::GetOptionInt(_T("msw.display.directdraw")) ) + if ( wxSystemOptions::GetOptionInt(wxT("msw.display.directdraw")) ) { wxDisplayFactoryDirectDraw *factoryDD = new wxDisplayFactoryDirectDraw; if ( factoryDD->IsOk() ) @@ -433,7 +433,7 @@ void wxDisplayInfo::Initialize() WinStruct monInfo; if ( !gs_GetMonitorInfo(m_hmon, (LPMONITORINFO)&monInfo) ) { - wxLogLastError(_T("GetMonitorInfo")); + wxLogLastError(wxT("GetMonitorInfo")); m_flags = 0; return; } @@ -498,7 +498,7 @@ wxVideoMode wxDisplayImplWin32Base::GetCurrentMode() const dm.dmDriverExtra = 0; if ( !::EnumDisplaySettings(deviceName, ENUM_CURRENT_SETTINGS, &dm) ) { - wxLogLastError(_T("EnumDisplaySettings(ENUM_CURRENT_SETTINGS)")); + wxLogLastError(wxT("EnumDisplaySettings(ENUM_CURRENT_SETTINGS)")); } else { @@ -644,7 +644,7 @@ void wxDisplayFactoryMultimon::AddDisplay(HMONITOR hMonitor, LPRECT lprcMonitor) wxDisplayImpl *wxDisplayFactoryMultimon::CreateDisplay(unsigned n) { - wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") ); + wxCHECK_MSG( n < m_displays.size(), NULL, wxT("invalid display index") ); return new wxDisplayImplMultimon(n, *(m_displays[n])); } @@ -700,7 +700,7 @@ bool wxDisplayImplMultimon::ChangeMode(const wxVideoMode& mode) else // change to the given mode { wxCHECK_MSG( mode.GetWidth() && mode.GetHeight(), false, - _T("at least the width and height must be specified") ); + wxT("at least the width and height must be specified") ); wxZeroMemory(dm); dm.dmSize = sizeof(dm); @@ -786,7 +786,7 @@ bool wxDisplayImplMultimon::ChangeMode(const wxVideoMode& mode) break; default: - wxFAIL_MSG( _T("unexpected ChangeDisplaySettingsEx() return value") ); + wxFAIL_MSG( wxT("unexpected ChangeDisplaySettingsEx() return value") ); } return false; @@ -808,7 +808,7 @@ wxDisplayFactoryDirectDraw::wxDisplayFactoryDirectDraw() if ( !ms_supportsMultimon ) return; - m_dllDDraw.Load(_T("ddraw.dll"), wxDL_VERBATIM | wxDL_QUIET); + m_dllDDraw.Load(wxT("ddraw.dll"), wxDL_VERBATIM | wxDL_QUIET); if ( !m_dllDDraw.IsLoaded() ) return; @@ -827,7 +827,7 @@ wxDisplayFactoryDirectDraw::wxDisplayFactoryDirectDraw() this, DDENUM_ATTACHEDSECONDARYDEVICES) != DD_OK ) { - wxLogLastError(_T("DirectDrawEnumerateEx")); + wxLogLastError(wxT("DirectDrawEnumerateEx")); } } @@ -878,7 +878,7 @@ void wxDisplayFactoryDirectDraw::AddDisplay(const GUID& guid, wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(unsigned n) { - wxCHECK_MSG( n < m_displays.size(), NULL, _T("invalid display index") ); + wxCHECK_MSG( n < m_displays.size(), NULL, wxT("invalid display index") ); wxDisplayInfoDirectDraw * info = static_cast(m_displays[n]); @@ -892,7 +892,7 @@ wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(unsigned n) if ( FAILED(hr) || !pDD ) { // what to do?? - wxLogApiError(_T("DirectDrawCreate"), hr); + wxLogApiError(wxT("DirectDrawCreate"), hr); return NULL; } @@ -902,7 +902,7 @@ wxDisplayImpl *wxDisplayFactoryDirectDraw::CreateDisplay(unsigned n) if ( FAILED(hr) || !info->m_pDD2 ) { - wxLogApiError(_T("IDirectDraw::QueryInterface(IDD2)"), hr); + wxLogApiError(wxT("IDirectDraw::QueryInterface(IDD2)"), hr); return NULL; } @@ -983,7 +983,7 @@ wxDisplayImplDirectDraw::GetModes(const wxVideoMode& modeMatch) const if ( FAILED(hr) ) { - wxLogApiError(_T("IDirectDraw::EnumDisplayModes"), hr); + wxLogApiError(wxT("IDirectDraw::EnumDisplayModes"), hr); } return modes; @@ -996,7 +996,7 @@ wxDisplayImplDirectDraw::GetModes(const wxVideoMode& modeMatch) const bool wxDisplayImplDirectDraw::ChangeMode(const wxVideoMode& mode) { wxWindow *winTop = wxTheApp->GetTopWindow(); - wxCHECK_MSG( winTop, false, _T("top level window required for DirectX") ); + wxCHECK_MSG( winTop, false, wxT("top level window required for DirectX") ); HRESULT hr = m_pDD2->SetCooperativeLevel ( @@ -1005,7 +1005,7 @@ bool wxDisplayImplDirectDraw::ChangeMode(const wxVideoMode& mode) ); if ( FAILED(hr) ) { - wxLogApiError(_T("IDirectDraw2::SetCooperativeLevel"), hr); + wxLogApiError(wxT("IDirectDraw2::SetCooperativeLevel"), hr); return false; } @@ -1013,7 +1013,7 @@ bool wxDisplayImplDirectDraw::ChangeMode(const wxVideoMode& mode) hr = m_pDD2->SetDisplayMode(mode.w, mode.h, mode.bpp, mode.refresh, 0); if ( FAILED(hr) ) { - wxLogApiError(_T("IDirectDraw2::SetDisplayMode"), hr); + wxLogApiError(wxT("IDirectDraw2::SetDisplayMode"), hr); return false; } diff --git a/src/msw/dlmsw.cpp b/src/msw/dlmsw.cpp index 9b1e7428fb..25700c5cdb 100644 --- a/src/msw/dlmsw.cpp +++ b/src/msw/dlmsw.cpp @@ -28,7 +28,7 @@ #include "wx/msw/private.h" #include "wx/msw/debughlp.h" -const wxString wxDynamicLibrary::ms_dllext(_T(".dll")); +const wxString wxDynamicLibrary::ms_dllext(wxT(".dll")); // ---------------------------------------------------------------------------- // private classes @@ -121,9 +121,9 @@ HMODULE wxGetModuleHandle(const char *name, void *addr) static GetModuleHandleEx_t s_pfnGetModuleHandleEx = INVALID_FUNC_PTR; if ( s_pfnGetModuleHandleEx == INVALID_FUNC_PTR ) { - wxDynamicLibrary dll(_T("kernel32.dll"), wxDL_VERBATIM); + wxDynamicLibrary dll(wxT("kernel32.dll"), wxDL_VERBATIM); s_pfnGetModuleHandleEx = - (GetModuleHandleEx_t)dll.RawGetSymbol(_T("GetModuleHandleExA")); + (GetModuleHandleEx_t)dll.RawGetSymbol(wxT("GetModuleHandleExA")); // dll object can be destroyed, kernel32.dll won't be unloaded anyhow } @@ -161,7 +161,7 @@ wxVersionDLL::wxVersionDLL() // handle it wxLogNull noLog; - if ( m_dll.Load(_T("version.dll"), wxDL_VERBATIM) ) + if ( m_dll.Load(wxT("version.dll"), wxDL_VERBATIM) ) { // the functions we load have either 'A' or 'W' suffix depending on // whether we're in ANSI or Unicode build @@ -172,7 +172,7 @@ wxVersionDLL::wxVersionDLL() #endif // UNICODE/ANSI #define LOAD_VER_FUNCTION(name) \ - m_pfn ## name = (name ## _t)m_dll.GetSymbol(_T(#name SUFFIX)); \ + m_pfn ## name = (name ## _t)m_dll.GetSymbol(wxT(#name SUFFIX)); \ if ( !m_pfn ## name ) \ { \ m_dll.Unload(); \ @@ -206,12 +206,12 @@ wxString wxVersionDLL::GetFileVersion(const wxString& filename) const void *pVer; UINT sizeInfo; if ( m_pfnVerQueryValue(buf.data(), - const_cast(_T("\\")), + const_cast(wxT("\\")), &pVer, &sizeInfo) ) { VS_FIXEDFILEINFO *info = (VS_FIXEDFILEINFO *)pVer; - ver.Printf(_T("%d.%d.%d.%d"), + ver.Printf(wxT("%d.%d.%d.%d"), HIWORD(info->dwFileVersionMS), LOWORD(info->dwFileVersionMS), HIWORD(info->dwFileVersionLS), @@ -333,7 +333,7 @@ wxDynamicLibraryDetailsArray wxDynamicLibrary::ListLoaded() ¶ms ) ) { - wxLogLastError(_T("EnumerateLoadedModules")); + wxLogLastError(wxT("EnumerateLoadedModules")); } } #endif // wxUSE_DBGHELP diff --git a/src/msw/dragimag.cpp b/src/msw/dragimag.cpp index d3c7c649e9..bed8aea3fe 100644 --- a/src/msw/dragimag.cpp +++ b/src/msw/dragimag.cpp @@ -281,7 +281,7 @@ bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* window, bool fullS if (!ret) { - wxFAIL_MSG( _T("BeginDrag failed.") ); + wxFAIL_MSG( wxT("BeginDrag failed.") ); return false; } diff --git a/src/msw/enhmeta.cpp b/src/msw/enhmeta.cpp index e73efeb15d..a59f622acc 100644 --- a/src/msw/enhmeta.cpp +++ b/src/msw/enhmeta.cpp @@ -71,7 +71,7 @@ static inline const wxChar *GetMetaFileName(const wxString& fn) wxGDIRefData *wxEnhMetaFile::CreateGDIRefData() const { - wxFAIL_MSG( _T("must be implemented if used") ); + wxFAIL_MSG( wxT("must be implemented if used") ); return NULL; } @@ -79,7 +79,7 @@ wxGDIRefData *wxEnhMetaFile::CreateGDIRefData() const wxGDIRefData * wxEnhMetaFile::CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const { - wxFAIL_MSG( _T("must be implemented if used") ); + wxFAIL_MSG( wxT("must be implemented if used") ); return NULL; } @@ -112,7 +112,7 @@ void wxEnhMetaFile::Assign(const wxEnhMetaFile& mf) GetMetaFileName(m_filename)); if ( !m_hMF ) { - wxLogLastError(_T("CopyEnhMetaFile")); + wxLogLastError(wxT("CopyEnhMetaFile")); } } else @@ -127,15 +127,15 @@ void wxEnhMetaFile::Free() { if ( !::DeleteEnhMetaFile(GetEMF()) ) { - wxLogLastError(_T("DeleteEnhMetaFile")); + wxLogLastError(wxT("DeleteEnhMetaFile")); } } } bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound) { - wxCHECK_MSG( Ok(), false, _T("can't play invalid enhanced metafile") ); - wxCHECK_MSG( dc, false, _T("invalid wxDC in wxEnhMetaFile::Play") ); + wxCHECK_MSG( Ok(), false, wxT("can't play invalid enhanced metafile") ); + wxCHECK_MSG( dc, false, wxT("invalid wxDC in wxEnhMetaFile::Play") ); RECT rect; if ( rectBound ) @@ -162,7 +162,7 @@ bool wxEnhMetaFile::Play(wxDC *dc, wxRect *rectBound) if ( !::PlayEnhMetaFile(GetHdcOf(*msw_impl), GetEMF(), &rect) ) { - wxLogLastError(_T("PlayEnhMetaFile")); + wxLogLastError(wxT("PlayEnhMetaFile")); return false; } @@ -179,7 +179,7 @@ wxSize wxEnhMetaFile::GetSize() const ENHMETAHEADER hdr; if ( !::GetEnhMetaFileHeader(GetEMF(), sizeof(hdr), &hdr) ) { - wxLogLastError(_T("GetEnhMetaFileHeader")); + wxLogLastError(wxT("GetEnhMetaFileHeader")); } else { @@ -201,11 +201,11 @@ wxSize wxEnhMetaFile::GetSize() const bool wxEnhMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height)) { #if wxUSE_DRAG_AND_DROP && wxUSE_CLIPBOARD - wxCHECK_MSG( m_hMF, false, _T("can't copy invalid metafile to clipboard") ); + wxCHECK_MSG( m_hMF, false, wxT("can't copy invalid metafile to clipboard") ); return wxTheClipboard->AddData(new wxEnhMetaFileDataObject(*this)); #else // !wxUSE_DRAG_AND_DROP - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(wxT("not implemented")); return false; #endif // wxUSE_DRAG_AND_DROP/!wxUSE_DRAG_AND_DROP } @@ -294,7 +294,7 @@ void wxEnhMetaFileDCImpl::Create(HDC hdcRef, pRect, description.wx_str()); if ( !m_hDC ) { - wxLogLastError(_T("CreateEnhMetaFile")); + wxLogLastError(wxT("CreateEnhMetaFile")); } } @@ -308,12 +308,12 @@ void wxEnhMetaFileDCImpl::DoGetSize(int *width, int *height) const wxEnhMetaFile *wxEnhMetaFileDCImpl::Close() { - wxCHECK_MSG( IsOk(), NULL, _T("invalid wxEnhMetaFileDC") ); + wxCHECK_MSG( IsOk(), NULL, wxT("invalid wxEnhMetaFileDC") ); HENHMETAFILE hMF = ::CloseEnhMetaFile(GetHdc()); if ( !hMF ) { - wxLogLastError(_T("CloseEnhMetaFile")); + wxLogLastError(wxT("CloseEnhMetaFile")); return NULL; } @@ -361,7 +361,7 @@ wxEnhMetaFile *wxEnhMetaFileDC::Close() { wxEnhMetaFileDCImpl * const impl = static_cast(GetImpl()); - wxCHECK_MSG( impl, NULL, _T("no wxEnhMetaFileDC implementation") ); + wxCHECK_MSG( impl, NULL, wxT("no wxEnhMetaFileDC implementation") ); return impl->Close(); } @@ -400,7 +400,7 @@ size_t wxEnhMetaFileDataObject::GetDataSize(const wxDataFormat& format) const } else { - wxASSERT_MSG( format == wxDF_METAFILE, _T("unsupported format") ); + wxASSERT_MSG( format == wxDF_METAFILE, wxT("unsupported format") ); return sizeof(METAFILEPICT); } @@ -408,7 +408,7 @@ size_t wxEnhMetaFileDataObject::GetDataSize(const wxDataFormat& format) const bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) const { - wxCHECK_MSG( m_metafile.Ok(), false, _T("copying invalid enh metafile") ); + wxCHECK_MSG( m_metafile.Ok(), false, wxT("copying invalid enh metafile") ); HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE(); @@ -417,7 +417,7 @@ bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) HENHMETAFILE hEMFCopy = ::CopyEnhMetaFile(hEMF, NULL); if ( !hEMFCopy ) { - wxLogLastError(_T("CopyEnhMetaFile")); + wxLogLastError(wxT("CopyEnhMetaFile")); return false; } @@ -426,7 +426,7 @@ bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) } else { - wxASSERT_MSG( format == wxDF_METAFILE, _T("unsupported format") ); + wxASSERT_MSG( format == wxDF_METAFILE, wxT("unsupported format") ); // convert to WMF @@ -434,14 +434,14 @@ bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) // first get the buffer size and alloc memory size_t size = ::GetWinMetaFileBits(hEMF, 0, NULL, MM_ANISOTROPIC, hdc); - wxCHECK_MSG( size, false, _T("GetWinMetaFileBits() failed") ); + wxCHECK_MSG( size, false, wxT("GetWinMetaFileBits() failed") ); BYTE *bits = (BYTE *)malloc(size); // then get the enh metafile bits if ( !::GetWinMetaFileBits(hEMF, size, bits, MM_ANISOTROPIC, hdc) ) { - wxLogLastError(_T("GetWinMetaFileBits")); + wxLogLastError(wxT("GetWinMetaFileBits")); free(bits); @@ -453,7 +453,7 @@ bool wxEnhMetaFileDataObject::GetDataHere(const wxDataFormat& format, void *buf) free(bits); if ( !hMF ) { - wxLogLastError(_T("SetMetaFileBitsEx")); + wxLogLastError(wxT("SetMetaFileBitsEx")); return false; } @@ -482,24 +482,24 @@ bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format, { hEMF = *(HENHMETAFILE *)buf; - wxCHECK_MSG( hEMF, false, _T("pasting invalid enh metafile") ); + wxCHECK_MSG( hEMF, false, wxT("pasting invalid enh metafile") ); } else { - wxASSERT_MSG( format == wxDF_METAFILE, _T("unsupported format") ); + wxASSERT_MSG( format == wxDF_METAFILE, wxT("unsupported format") ); // convert from WMF const METAFILEPICT *mfpict = (const METAFILEPICT *)buf; // first get the buffer size size_t size = ::GetMetaFileBitsEx(mfpict->hMF, 0, NULL); - wxCHECK_MSG( size, false, _T("GetMetaFileBitsEx() failed") ); + wxCHECK_MSG( size, false, wxT("GetMetaFileBitsEx() failed") ); // then get metafile bits BYTE *bits = (BYTE *)malloc(size); if ( !::GetMetaFileBitsEx(mfpict->hMF, size, bits) ) { - wxLogLastError(_T("GetMetaFileBitsEx")); + wxLogLastError(wxT("GetMetaFileBitsEx")); free(bits); @@ -513,7 +513,7 @@ bool wxEnhMetaFileDataObject::SetData(const wxDataFormat& format, free(bits); if ( !hEMF ) { - wxLogLastError(_T("SetWinMetaFileBits")); + wxLogLastError(wxT("SetWinMetaFileBits")); return false; } @@ -536,14 +536,14 @@ size_t wxEnhMetaFileSimpleDataObject::GetDataSize() const bool wxEnhMetaFileSimpleDataObject::GetDataHere(void *buf) const { - wxCHECK_MSG( m_metafile.Ok(), false, _T("copying invalid enh metafile") ); + wxCHECK_MSG( m_metafile.Ok(), false, wxT("copying invalid enh metafile") ); HENHMETAFILE hEMF = (HENHMETAFILE)m_metafile.GetHENHMETAFILE(); HENHMETAFILE hEMFCopy = ::CopyEnhMetaFile(hEMF, NULL); if ( !hEMFCopy ) { - wxLogLastError(_T("CopyEnhMetaFile")); + wxLogLastError(wxT("CopyEnhMetaFile")); return false; } @@ -557,7 +557,7 @@ bool wxEnhMetaFileSimpleDataObject::SetData(size_t WXUNUSED(len), { HENHMETAFILE hEMF = *(HENHMETAFILE *)buf; - wxCHECK_MSG( hEMF, false, _T("pasting invalid enh metafile") ); + wxCHECK_MSG( hEMF, false, wxT("pasting invalid enh metafile") ); m_metafile.SetHENHMETAFILE((WXHANDLE)hEMF); return true; diff --git a/src/msw/fdrepdlg.cpp b/src/msw/fdrepdlg.cpp index 8ea315b657..78b7f27dc2 100644 --- a/src/msw/fdrepdlg.cpp +++ b/src/msw/fdrepdlg.cpp @@ -114,7 +114,7 @@ wxFindReplaceDialogImpl::wxFindReplaceDialogImpl(wxFindReplaceDialog *dialog, if ( !ms_msgFindDialog ) { - wxLogLastError(_T("RegisterWindowMessage(FINDMSGSTRING)")); + wxLogLastError(wxT("RegisterWindowMessage(FINDMSGSTRING)")); } wxWindow::MSWRegisterMessageHandler @@ -210,7 +210,7 @@ wxFindReplaceDialogImpl::FindMessageHandler(wxWindow * WXUNUSED(win), static bool s_blockMsg = false; #endif // wxUSE_UNICODE_MSLU - wxASSERT_MSG( nMsg == ms_msgFindDialog, _T("unexpected message received") ); + wxASSERT_MSG( nMsg == ms_msgFindDialog, wxT("unexpected message received") ); FINDREPLACE *pFR = (FINDREPLACE *)lParam; @@ -260,7 +260,7 @@ wxFindReplaceDialogImpl::FindMessageHandler(wxWindow * WXUNUSED(win), } else { - wxFAIL_MSG( _T("unknown find dialog event") ); + wxFAIL_MSG( wxT("unknown find dialog event") ); return 0; } @@ -359,7 +359,7 @@ wxFindReplaceDialog::~wxFindReplaceDialog() // if it wasn't, delete the dialog ourselves if ( !::DestroyWindow(GetHwnd()) ) { - wxLogLastError(_T("DestroyWindow(find dialog)")); + wxLogLastError(wxT("DestroyWindow(find dialog)")); } } @@ -416,9 +416,9 @@ bool wxFindReplaceDialog::Show(bool show) return true; } - wxCHECK_MSG( m_FindReplaceData, false, _T("call Create() first!") ); + wxCHECK_MSG( m_FindReplaceData, false, wxT("call Create() first!") ); - wxASSERT_MSG( !m_impl, _T("why don't we have the window then?") ); + wxASSERT_MSG( !m_impl, wxT("why don't we have the window then?") ); m_impl = new wxFindReplaceDialogImpl(this, m_FindReplaceData->GetFlags()); @@ -451,7 +451,7 @@ bool wxFindReplaceDialog::Show(bool show) if ( !::ShowWindow(hwnd, SW_SHOW) ) { - wxLogLastError(_T("ShowWindow(find dialog)")); + wxLogLastError(wxT("ShowWindow(find dialog)")); } m_hWnd = (WXHWND)hwnd; diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index c553328fb4..8aae8b46b1 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -156,8 +156,8 @@ void wxFileDialog::GetPaths(wxArrayString& paths) const paths.Empty(); wxString dir(m_dir); - if ( m_dir.Last() != _T('\\') ) - dir += _T('\\'); + if ( m_dir.Last() != wxT('\\') ) + dir += wxT('\\'); size_t count = m_fileNames.GetCount(); for ( size_t n = 0; n < count; n++ ) @@ -179,7 +179,7 @@ void wxFileDialog::SetPath(const wxString& path) wxString ext; wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext); if ( !ext.empty() ) - m_fileName << _T('.') << ext; + m_fileName << wxT('.') << ext; } void wxFileDialog::DoGetPosition(int *x, int *y) const @@ -351,7 +351,7 @@ static bool ShowCommFileDialog(OPENFILENAME *of, long style) { // this can happen if the default file name is invalid, try without it // now - of->lpstrFile[0] = _T('\0'); + of->lpstrFile[0] = wxT('\0'); success = DoShowCommFileDialog(of, style, &errCode); } @@ -484,17 +484,17 @@ int wxFileDialog::ShowModal() wxChar ch = m_dir[i]; switch ( ch ) { - case _T('/'): + case wxT('/'): // convert to backslash - ch = _T('\\'); + ch = wxT('\\'); // fall through - case _T('\\'): + case wxT('\\'): while ( i < len - 1 ) { wxChar chNext = m_dir[i + 1]; - if ( chNext != _T('\\') && chNext != _T('/') ) + if ( chNext != wxT('\\') && chNext != wxT('/') ) break; // ignore the next one, unless it is at the start of a UNC path @@ -521,7 +521,7 @@ int wxFileDialog::ShowModal() size_t items = wxParseCommonDialogsFilter(m_wildCard, wildDescriptions, wildFilters); - wxASSERT_MSG( items > 0 , _T("empty wildcard list") ); + wxASSERT_MSG( items > 0 , wxT("empty wildcard list") ); wxString filterBuffer; @@ -613,7 +613,7 @@ int wxFileDialog::ShowModal() i += wxStrlen(&fileNameBuffer[i]) + 1; } #else - wxStringTokenizer toke(fileNameBuffer, _T(" \t\r\n")); + wxStringTokenizer toke(fileNameBuffer, wxT(" \t\r\n")); m_dir = toke.GetNextToken(); m_fileName = toke.GetNextToken(); m_fileNames.Add(m_fileName); @@ -623,8 +623,8 @@ int wxFileDialog::ShowModal() #endif // OFN_EXPLORER wxString dir(m_dir); - if ( m_dir.Last() != _T('\\') ) - dir += _T('\\'); + if ( m_dir.Last() != wxT('\\') ) + dir += wxT('\\'); m_path = dir + m_fileName; m_filterIndex = (int)of.nFilterIndex - 1; diff --git a/src/msw/fontutil.cpp b/src/msw/fontutil.cpp index 22b4a62101..5bacd8241e 100644 --- a/src/msw/fontutil.cpp +++ b/src/msw/fontutil.cpp @@ -57,7 +57,7 @@ bool wxNativeEncodingInfo::FromString(const wxString& s) { - wxStringTokenizer tokenizer(s, _T(";")); + wxStringTokenizer tokenizer(s, wxT(";")); wxString encid = tokenizer.GetNextToken(); @@ -96,7 +96,7 @@ bool wxNativeEncodingInfo::FromString(const wxString& s) } else { - if ( wxSscanf(tmp, _T("%u"), &charset) != 1 ) + if ( wxSscanf(tmp, wxT("%u"), &charset) != 1 ) { // should be a number! return false; @@ -120,12 +120,12 @@ wxString wxNativeEncodingInfo::ToString() const // we don't have any choice but to use the raw value << (long)encoding #endif // wxUSE_FONTMAP/!wxUSE_FONTMAP - << _T(';') << facename; + << wxT(';') << facename; // ANSI_CHARSET is assumed anyhow if ( charset != ANSI_CHARSET ) { - s << _T(';') << charset; + s << wxT(';') << charset; } return s; @@ -138,7 +138,7 @@ wxString wxNativeEncodingInfo::ToString() const bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info) { - wxCHECK_MSG( info, false, _T("bad pointer in wxGetNativeFontEncoding") ); + wxCHECK_MSG( info, false, wxT("bad pointer in wxGetNativeFontEncoding") ); if ( encoding == wxFONTENCODING_DEFAULT ) { @@ -187,7 +187,7 @@ wxFontEncoding wxGetFontEncFromCharSet(int cs) switch ( cs ) { default: - wxFAIL_MSG( _T("unexpected Win32 charset") ); + wxFAIL_MSG( wxT("unexpected Win32 charset") ); // fall through and assume the system charset case DEFAULT_CHARSET: diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index f81b58b4f2..db4b37bd17 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -477,7 +477,7 @@ void wxFrame::AttachMenuBar(wxMenuBar *menubar) if ( !m_hMenu ) { - wxFAIL_MSG( _T("failed to create menu bar") ); + wxFAIL_MSG( wxT("failed to create menu bar") ); return; } } diff --git a/src/msw/gdiimage.cpp b/src/msw/gdiimage.cpp index e7aaa0c36f..5b4c3d6b13 100644 --- a/src/msw/gdiimage.cpp +++ b/src/msw/gdiimage.cpp @@ -61,7 +61,7 @@ WX_DEFINE_LIST(wxGDIImageHandlerList) class WXDLLEXPORT wxBMPFileHandler : public wxBitmapHandler { public: - wxBMPFileHandler() : wxBitmapHandler(_T("Windows bitmap file"), _T("bmp"), + wxBMPFileHandler() : wxBitmapHandler(wxT("Windows bitmap file"), wxT("bmp"), wxBITMAP_TYPE_BMP) { } @@ -80,7 +80,7 @@ private: class WXDLLEXPORT wxBMPResourceHandler: public wxBitmapHandler { public: - wxBMPResourceHandler() : wxBitmapHandler(_T("Windows bitmap resource"), + wxBMPResourceHandler() : wxBitmapHandler(wxT("Windows bitmap resource"), wxEmptyString, wxBITMAP_TYPE_BMP_RESOURCE) { @@ -126,7 +126,7 @@ public: int desiredWidth, int desiredHeight) { wxIcon *icon = wxDynamicCast(image, wxIcon); - wxCHECK_MSG( icon, false, _T("wxIconHandler only works with icons") ); + wxCHECK_MSG( icon, false, wxT("wxIconHandler only works with icons") ); return LoadIcon(icon, name, flags, desiredWidth, desiredHeight); } @@ -140,8 +140,8 @@ protected: class WXDLLEXPORT wxICOFileHandler : public wxIconHandler { public: - wxICOFileHandler() : wxIconHandler(_T("ICO icon file"), - _T("ico"), + wxICOFileHandler() : wxIconHandler(wxT("ICO icon file"), + wxT("ico"), wxBITMAP_TYPE_ICO) { } @@ -158,8 +158,8 @@ private: class WXDLLEXPORT wxICOResourceHandler: public wxIconHandler { public: - wxICOResourceHandler() : wxIconHandler(_T("ICO resource"), - _T("ico"), + wxICOResourceHandler() : wxIconHandler(wxT("ICO resource"), + wxT("ico"), wxBITMAP_TYPE_ICO_RESOURCE) { } @@ -356,7 +356,7 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, int WXUNUSED(desiredHeight)) { #if wxUSE_WXDIB - wxCHECK_MSG( bitmap, false, _T("NULL bitmap in LoadFile") ); + wxCHECK_MSG( bitmap, false, wxT("NULL bitmap in LoadFile") ); wxDIB dib(name); @@ -372,7 +372,7 @@ bool wxBMPFileHandler::SaveFile(const wxBitmap *bitmap, const wxPalette * WXUNUSED(pal)) const { #if wxUSE_WXDIB - wxCHECK_MSG( bitmap, false, _T("NULL bitmap in SaveFile") ); + wxCHECK_MSG( bitmap, false, wxT("NULL bitmap in SaveFile") ); wxDIB dib(*bitmap); @@ -442,8 +442,8 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, { // it is not an error, but it might still be useful to be informed // about it optionally - wxLogTrace(_T("iconload"), - _T("No large icons found in the file '%s'."), + wxLogTrace(wxT("iconload"), + wxT("No large icons found in the file '%s'."), name.c_str()); } } @@ -453,8 +453,8 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, // get the specified small icon from file if ( !::ExtractIconEx(nameReal.wx_str(), iconIndex, NULL, &hicon, 1) ) { - wxLogTrace(_T("iconload"), - _T("No small icons found in the file '%s'."), + wxLogTrace(wxT("iconload"), + wxT("No small icons found in the file '%s'."), name.c_str()); } } @@ -470,7 +470,7 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, if ( !hicon ) { - wxLogSysError(_T("Failed to load icon from the file '%s'"), + wxLogSysError(wxT("Failed to load icon from the file '%s'"), name.c_str()); return false; @@ -481,8 +481,8 @@ bool wxICOFileHandler::LoadIcon(wxIcon *icon, if ( (desiredWidth != -1 && desiredWidth != size.x) || (desiredHeight != -1 && desiredHeight != size.y) ) { - wxLogTrace(_T("iconload"), - _T("Returning false from wxICOFileHandler::Load because of the size mismatch: actual (%d, %d), requested (%d, %d)"), + wxLogTrace(wxT("iconload"), + wxT("Returning false from wxICOFileHandler::Load because of the size mismatch: actual (%d, %d), requested (%d, %d)"), size.x, size.y, desiredWidth, desiredHeight); @@ -508,7 +508,7 @@ bool wxICOResourceHandler::LoadIcon(wxIcon *icon, bool hasSize = desiredWidth != -1 || desiredHeight != -1; wxASSERT_MSG( !hasSize || (desiredWidth != -1 && desiredHeight != -1), - _T("width and height should be either both -1 or not") ); + wxT("width and height should be either both -1 or not") ); // try to load the icon from this program first to allow overriding the // standard icons (although why one would want to do it considering that diff --git a/src/msw/gdiplus.cpp b/src/msw/gdiplus.cpp index afdfc003ed..6aca8143bd 100644 --- a/src/msw/gdiplus.cpp +++ b/src/msw/gdiplus.cpp @@ -806,7 +806,7 @@ bool wxGdiPlus::DoInit() // we're prepared to handler errors so suppress log messages about them wxLogNull noLog; - wxDynamicLibrary dllGdip(_T("gdiplus.dll"), wxDL_VERBATIM); + wxDynamicLibrary dllGdip(wxT("gdiplus.dll"), wxDL_VERBATIM); if ( !dllGdip.IsLoaded() ) return false; @@ -817,14 +817,14 @@ bool wxGdiPlus::DoInit() return false; #define wxLOAD_GDIPLUS_FUNC(name, params, args) \ - wxDO_LOAD_FUNC(name, _T("Gdiplus") wxSTRINGIZE_T(name)) + wxDO_LOAD_FUNC(name, wxT("Gdiplus") wxSTRINGIZE_T(name)) wxFOR_ALL_GDIPLUS_FUNCNAMES(wxLOAD_GDIPLUS_FUNC) #undef wxLOAD_GDIPLUS_FUNC #define wxLOAD_GDIP_FUNC(name, params, args) \ - wxDO_LOAD_FUNC(name, _T("Gdip") wxSTRINGIZE_T(name)) + wxDO_LOAD_FUNC(name, wxT("Gdip") wxSTRINGIZE_T(name)) wxFOR_ALL_GDIP_FUNCNAMES(wxLOAD_GDIP_FUNC) diff --git a/src/msw/glcanvas.cpp b/src/msw/glcanvas.cpp index 8c9273b8a4..15ad41545b 100644 --- a/src/msw/glcanvas.cpp +++ b/src/msw/glcanvas.cpp @@ -118,7 +118,7 @@ wxGLContext::wxGLContext(wxGLCanvas *win, const wxGLContext* other) { if ( !wglShareLists(other->m_glContext, m_glContext) ) { - wxLogLastError(_T("wglShareLists")); + wxLogLastError(wxT("wglShareLists")); } } } @@ -133,7 +133,7 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const { if ( !wglMakeCurrent(win.GetHDC(), m_glContext) ) { - wxLogLastError(_T("wglMakeCurrent")); + wxLogLastError(wxT("wglMakeCurrent")); return false; } return true; @@ -209,7 +209,7 @@ bool wxGLCanvas::CreateWindow(wxWindow *parent, DWORD msflags = WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; msflags |= MSWGetStyle(style, &exStyle); - if ( !MSWCreate(wxApp::GetRegisteredClassName(_T("wxGLCanvas"), -1, CS_OWNDC), + if ( !MSWCreate(wxApp::GetRegisteredClassName(wxT("wxGLCanvas"), -1, CS_OWNDC), NULL, pos, size, msflags, exStyle) ) return false; @@ -277,7 +277,7 @@ bool wxGLCanvas::Create(wxWindow *parent, if ( !::SetPixelFormat(m_hDC, pixelFormat, &pfd) ) { - wxLogLastError(_T("SetPixelFormat")); + wxLogLastError(wxT("SetPixelFormat")); return false; } } @@ -301,7 +301,7 @@ bool wxGLCanvas::SwapBuffers() { if ( !::SwapBuffers(m_hDC) ) { - wxLogLastError(_T("SwapBuffers")); + wxLogLastError(wxT("SwapBuffers")); return false; } @@ -495,7 +495,7 @@ static int ChoosePixelFormatARB(HDC hdc, const int *attribList) UINT numFormats = 0; if ( !wglChoosePixelFormatARB(hdc, iAttributes, NULL, 1, &pf, &numFormats) ) { - wxLogLastError(_T("wglChoosePixelFormatARB")); + wxLogLastError(wxT("wglChoosePixelFormatARB")); return 0; } @@ -683,13 +683,13 @@ int wxGLCanvas::DoSetup(PIXELFORMATDESCRIPTOR &pfd, const int *attribList) if ( !pixelFormat ) { - wxLogLastError(_T("ChoosePixelFormat")); + wxLogLastError(wxT("ChoosePixelFormat")); return 0; } if ( !::SetPixelFormat(m_hDC, pixelFormat, &pfd) ) { - wxLogLastError(_T("SetPixelFormat")); + wxLogLastError(wxT("SetPixelFormat")); return 0; } @@ -707,14 +707,14 @@ bool wxGLCanvas::SetupPalette(const wxPalette& palette) const int pixelFormat = ::GetPixelFormat(m_hDC); if ( !pixelFormat ) { - wxLogLastError(_T("GetPixelFormat")); + wxLogLastError(wxT("GetPixelFormat")); return false; } PIXELFORMATDESCRIPTOR pfd; if ( !::DescribePixelFormat(m_hDC, pixelFormat, sizeof(pfd), &pfd) ) { - wxLogLastError(_T("DescribePixelFormat")); + wxLogLastError(wxT("DescribePixelFormat")); return false; } @@ -732,13 +732,13 @@ bool wxGLCanvas::SetupPalette(const wxPalette& palette) if ( !::SelectPalette(m_hDC, GetHpaletteOf(m_palette), FALSE) ) { - wxLogLastError(_T("SelectPalette")); + wxLogLastError(wxT("SelectPalette")); return false; } if ( ::RealizePalette(m_hDC) == GDI_ERROR ) { - wxLogLastError(_T("RealizePalette")); + wxLogLastError(wxT("RealizePalette")); return false; } diff --git a/src/msw/headerctrl.cpp b/src/msw/headerctrl.cpp index 5ed300c44a..921a97d1ca 100644 --- a/src/msw/headerctrl.cpp +++ b/src/msw/headerctrl.cpp @@ -80,7 +80,7 @@ bool wxHeaderCtrl::Create(wxWindow *parent, if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) return false; - if ( !MSWCreateControl(WC_HEADER, _T(""), pos, size) ) + if ( !MSWCreateControl(WC_HEADER, wxT(""), pos, size) ) return false; // special hack for margins when using comctl32.dll v6 or later: the @@ -156,7 +156,7 @@ wxSize wxHeaderCtrl::DoGetBestSize() const HDLAYOUT layout = { &rc, &wpos }; if ( !Header_Layout(GetHwnd(), &layout) ) { - wxLogLastError(_T("Header_Layout")); + wxLogLastError(wxT("Header_Layout")); return wxControl::DoGetBestSize(); } @@ -196,7 +196,7 @@ void wxHeaderCtrl::DoSetCount(unsigned int count) { if ( !Header_DeleteItem(GetHwnd(), 0) ) { - wxLogLastError(_T("Header_DeleteItem")); + wxLogLastError(wxT("Header_DeleteItem")); } } @@ -348,7 +348,7 @@ void wxHeaderCtrl::DoInsertItem(const wxHeaderColumn& col, unsigned int idx) if ( ::SendMessage(GetHwnd(), HDM_INSERTITEM, MSWToNativeIdx(idx), (LPARAM)&hdi) == -1 ) { - wxLogLastError(_T("Header_InsertItem()")); + wxLogLastError(wxT("Header_InsertItem()")); } } @@ -366,7 +366,7 @@ void wxHeaderCtrl::DoSetColumnsOrder(const wxArrayInt& order) if ( !Header_SetOrderArray(GetHwnd(), orderShown.size(), &orderShown[0]) ) { - wxLogLastError(_T("Header_GetOrderArray")); + wxLogLastError(wxT("Header_GetOrderArray")); } m_colIndices = order; diff --git a/src/msw/helpchm.cpp b/src/msw/helpchm.cpp index b41a59626d..cdb46e21af 100644 --- a/src/msw/helpchm.cpp +++ b/src/msw/helpchm.cpp @@ -50,7 +50,7 @@ HTMLHELP GetHtmlHelpFunction() if ( !s_htmlHelp ) { - static wxDynamicLibrary s_dllHtmlHelp(_T("HHCTRL.OCX"), wxDL_VERBATIM); + static wxDynamicLibrary s_dllHtmlHelp(wxT("HHCTRL.OCX"), wxDL_VERBATIM); if ( !s_dllHtmlHelp.IsLoaded() ) { diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp index 778aace5f3..fdd9d501c3 100644 --- a/src/msw/icon.cpp +++ b/src/msw/icon.cpp @@ -86,7 +86,7 @@ wxIcon::wxIcon(const wxIconLocation& loc) wxString fullname = loc.GetFileName(); if ( loc.GetIndex() ) { - fullname << _T(';') << loc.GetIndex(); + fullname << wxT(';') << loc.GetIndex(); } //else: 0 is default diff --git a/src/msw/imaglist.cpp b/src/msw/imaglist.cpp index 4fb0fbb83d..a9108a1b39 100644 --- a/src/msw/imaglist.cpp +++ b/src/msw/imaglist.cpp @@ -119,7 +119,7 @@ wxImageList::~wxImageList() // Returns the number of images in the image list. int wxImageList::GetImageCount() const { - wxASSERT_MSG( m_hImageList, _T("invalid image list") ); + wxASSERT_MSG( m_hImageList, wxT("invalid image list") ); return ImageList_GetImageCount(GetHImageList()); } @@ -127,7 +127,7 @@ int wxImageList::GetImageCount() const // Returns the size (same for all images) of the images in the list bool wxImageList::GetSize(int WXUNUSED(index), int &width, int &height) const { - wxASSERT_MSG( m_hImageList, _T("invalid image list") ); + wxASSERT_MSG( m_hImageList, wxT("invalid image list") ); return ImageList_GetIconSize(GetHImageList(), &width, &height) != 0; } @@ -249,7 +249,7 @@ bool wxImageList::Draw(int index, return false; HDC hDC = GetHdcOf(*msw_impl); - wxCHECK_MSG( hDC, false, _T("invalid wxDC in wxImageList::Draw") ); + wxCHECK_MSG( hDC, false, wxT("invalid wxDC in wxImageList::Draw") ); COLORREF clr = CLR_NONE; // transparent by default if ( solidBackground ) diff --git a/src/msw/iniconf.cpp b/src/msw/iniconf.cpp index 87dd3b1053..604a452962 100644 --- a/src/msw/iniconf.cpp +++ b/src/msw/iniconf.cpp @@ -257,13 +257,13 @@ bool wxIniConfig::IsEmpty() const { wxChar szBuf[1024]; - GetPrivateProfileString(m_strGroup.wx_str(), NULL, _T(""), + GetPrivateProfileString(m_strGroup.wx_str(), NULL, wxT(""), szBuf, WXSIZEOF(szBuf), m_strLocalFilename.wx_str()); if ( !wxIsEmpty(szBuf) ) return false; - GetProfileString(m_strGroup.wx_str(), NULL, _T(""), szBuf, WXSIZEOF(szBuf)); + GetProfileString(m_strGroup.wx_str(), NULL, wxT(""), szBuf, WXSIZEOF(szBuf)); if ( !wxIsEmpty(szBuf) ) return false; @@ -284,14 +284,14 @@ bool wxIniConfig::DoReadString(const wxString& szKey, wxString *pstr) const // first look in the private INI file // NB: the lpDefault param to GetPrivateProfileString can't be NULL - GetPrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(), _T(""), + GetPrivateProfileString(m_strGroup.wx_str(), strKey.wx_str(), wxT(""), szBuf, WXSIZEOF(szBuf), m_strLocalFilename.wx_str()); if ( wxIsEmpty(szBuf) ) { // now look in win.ini wxString strKey = GetKeyName(path.Name()); GetProfileString(m_strGroup.wx_str(), strKey.wx_str(), - _T(""), szBuf, WXSIZEOF(szBuf)); + wxT(""), szBuf, WXSIZEOF(szBuf)); } if ( wxIsEmpty(szBuf) ) @@ -359,7 +359,7 @@ bool wxIniConfig::DoWriteString(const wxString& szKey, const wxString& szValue) bool wxIniConfig::DoWriteLong(const wxString& szKey, long lValue) { - return Write(szKey, wxString::Format(_T("%ld"), lValue)); + return Write(szKey, wxString::Format(wxT("%ld"), lValue)); } bool wxIniConfig::DoReadBinary(const wxString& WXUNUSED(key), diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 03a5c497ca..37189a7e65 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -166,7 +166,7 @@ bool wxListBox::Create(wxWindow *parent, return false; // create the native control - if ( !MSWCreateControl(_T("LISTBOX"), wxEmptyString, pos, size) ) + if ( !MSWCreateControl(wxT("LISTBOX"), wxEmptyString, pos, size) ) { // control creation failed return false; @@ -216,7 +216,7 @@ WXDWORD wxListBox::MSWGetStyle(long style, WXDWORD *exstyle) const msStyle |= LBS_NOINTEGRALHEIGHT; wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED), - _T("only one of listbox selection modes can be specified") ); + wxT("only one of listbox selection modes can be specified") ); if ( style & wxLB_MULTIPLE ) msStyle |= LBS_MULTIPLESEL; @@ -224,7 +224,7 @@ WXDWORD wxListBox::MSWGetStyle(long style, WXDWORD *exstyle) const msStyle |= LBS_EXTENDEDSEL; wxASSERT_MSG( !(style & wxLB_ALWAYS_SB) || !(style & wxLB_NO_SB), - _T( "Conflicting styles wxLB_ALWAYS_SB and wxLB_NO_SB." ) ); + wxT( "Conflicting styles wxLB_ALWAYS_SB and wxLB_NO_SB." ) ); if ( !(style & wxLB_NO_SB) ) { @@ -377,7 +377,7 @@ int wxListBox::GetSelections(wxArrayInt& aSelections) const int countSel = ListBox_GetSelCount(GetHwnd()); if ( countSel == LB_ERR ) { - wxLogDebug(_T("ListBox_GetSelCount failed")); + wxLogDebug(wxT("ListBox_GetSelCount failed")); } else if ( countSel != 0 ) { diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp index 615d64f8b5..49204c2a05 100644 --- a/src/msw/listctrl.cpp +++ b/src/msw/listctrl.cpp @@ -142,7 +142,7 @@ public: // init without conversion void Init(LV_ITEM_NATIVE& item) { - wxASSERT_MSG( !m_pItem, _T("Init() called twice?") ); + wxASSERT_MSG( !m_pItem, wxT("Init() called twice?") ); m_pItem = &item; } @@ -404,7 +404,7 @@ WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const MAP_MODE_STYLE(wxLC_REPORT, LVS_REPORT) wxASSERT_MSG( nModes == 1, - _T("wxListCtrl style should have exactly one mode bit set") ); + wxT("wxListCtrl style should have exactly one mode bit set") ); #undef MAP_MODE_STYLE @@ -434,7 +434,7 @@ WXDWORD wxListCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const wstyle |= LVS_SORTASCENDING; wxASSERT_MSG( !(style & wxLC_SORT_DESCENDING), - _T("can't sort in ascending and descending orders at once") ); + wxT("can't sort in ascending and descending orders at once") ); } else if ( style & wxLC_SORT_DESCENDING ) wstyle |= LVS_SORTDESCENDING; @@ -708,7 +708,7 @@ int wxListCtrl::GetColumnIndexFromOrder(int order) const { const int numCols = GetColumnCount(); wxCHECK_MSG( order >= 0 && order < numCols, -1, - _T("Column position out of bounds") ); + wxT("Column position out of bounds") ); wxArrayInt indexArray(numCols); if ( !ListView_GetColumnOrderArray(GetHwnd(), numCols, &indexArray[0]) ) @@ -720,7 +720,7 @@ int wxListCtrl::GetColumnIndexFromOrder(int order) const int wxListCtrl::GetColumnOrder(int col) const { const int numCols = GetColumnCount(); - wxASSERT_MSG( col >= 0 && col < numCols, _T("Column index out of bounds") ); + wxASSERT_MSG( col >= 0 && col < numCols, wxT("Column index out of bounds") ); wxArrayInt indexArray(numCols); if ( !ListView_GetColumnOrderArray(GetHwnd(), numCols, &indexArray[0]) ) @@ -732,7 +732,7 @@ int wxListCtrl::GetColumnOrder(int col) const return pos; } - wxFAIL_MSG( _T("no column with with given order?") ); + wxFAIL_MSG( wxT("no column with with given order?") ); return -1; } @@ -755,7 +755,7 @@ bool wxListCtrl::SetColumnsOrder(const wxArrayInt& orders) const int numCols = GetColumnCount(); wxCHECK_MSG( orders.size() == (size_t)numCols, false, - _T("wrong number of elements in column orders array") ); + wxT("wrong number of elements in column orders array") ); return ListView_SetColumnOrderArray(GetHwnd(), numCols, &orders[0]) != 0; } @@ -850,7 +850,7 @@ bool wxListCtrl::SetItem(wxListItem& info) { const long id = info.GetId(); wxCHECK_MSG( id >= 0 && id < GetItemCount(), false, - _T("invalid item index in SetItem") ); + wxT("invalid item index in SetItem") ); LV_ITEM item; wxConvertToMSWListItem(this, info, item); @@ -899,7 +899,7 @@ bool wxListCtrl::SetItem(wxListItem& info) { if ( !ListView_SetItem(GetHwnd(), &item) ) { - wxLogDebug(_T("ListView_SetItem() failed")); + wxLogDebug(wxT("ListView_SetItem() failed")); return false; } @@ -987,7 +987,7 @@ bool wxListCtrl::SetItemState(long item, long state, long stateMask) if ( !::SendMessage(GetHwnd(), LVM_SETITEMSTATE, (WPARAM)item, (LPARAM)&lvItem) ) { - wxLogLastError(_T("ListView_SetItemState")); + wxLogLastError(wxT("ListView_SetItemState")); return false; } @@ -1110,7 +1110,7 @@ wxRect wxListCtrl::GetViewRect() const RECT rc; if ( !ListView_GetViewRect(GetHwnd(), &rc) ) { - wxLogDebug(_T("ListView_GetViewRect() failed.")); + wxLogDebug(wxT("ListView_GetViewRect() failed.")); wxZeroMemory(rc); } @@ -1132,7 +1132,7 @@ wxRect wxListCtrl::GetViewRect() const } else { - wxFAIL_MSG( _T("not implemented in this mode") ); + wxFAIL_MSG( wxT("not implemented in this mode") ); } return rect; @@ -1151,11 +1151,11 @@ bool wxListCtrl::GetSubItemRect(long item, long subItem, wxRect& rect, int code) // completely bogus in this case), so we check item validity ourselves wxCHECK_MSG( subItem == wxLIST_GETSUBITEMRECT_WHOLEITEM || (subItem >= 0 && subItem < GetColumnCount()), - false, _T("invalid sub item index") ); + false, wxT("invalid sub item index") ); // use wxCHECK_MSG against "item" too, for coherency with the generic implementation: wxCHECK_MSG( item >= 0 && item < GetItemCount(), false, - _T("invalid item in GetSubItemRect") ); + wxT("invalid item in GetSubItemRect") ); int codeWin; if ( code == wxLIST_RECT_BOUNDS ) @@ -1166,7 +1166,7 @@ bool wxListCtrl::GetSubItemRect(long item, long subItem, wxRect& rect, int code) codeWin = LVIR_LABEL; else { - wxFAIL_MSG( _T("incorrect code in GetItemRect() / GetSubItemRect()") ); + wxFAIL_MSG( wxT("incorrect code in GetItemRect() / GetSubItemRect()") ); codeWin = LVIR_BOUNDS; } @@ -1433,7 +1433,7 @@ bool wxListCtrl::DeleteItem(long item) { if ( !ListView_DeleteItem(GetHwnd(), (int) item) ) { - wxLogLastError(_T("ListView_DeleteItem")); + wxLogLastError(wxT("ListView_DeleteItem")); return false; } @@ -1727,7 +1727,7 @@ wxListCtrl::HitTest(const wxPoint& point, int& flags, long *ptrSubItem) const // -1 otherwise. long wxListCtrl::InsertItem(const wxListItem& info) { - wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual controls") ); + wxASSERT_MSG( !IsVirtual(), wxT("can't be used with virtual controls") ); LV_ITEM item; wxConvertToMSWListItem(this, info, item); @@ -1849,7 +1849,7 @@ bool wxListCtrl::ScrollList(int dx, int dy) { if ( !ListView_Scroll(GetHwnd(), dx, dy) ) { - wxLogDebug(_T("ListView_Scroll(%d, %d) failed"), dx, dy); + wxLogDebug(wxT("ListView_Scroll(%d, %d) failed"), dx, dy); return false; } @@ -1904,7 +1904,7 @@ bool wxListCtrl::SortItems(wxListCtrlCompare fn, wxIntPtr data) wxInternalDataCompareFunc, (WPARAM) &internalData) ) { - wxLogDebug(_T("ListView_SortItems() failed")); + wxLogDebug(wxT("ListView_SortItems() failed")); return false; } @@ -1970,7 +1970,7 @@ int WXDLLIMPEXP_CORE wxMSWGetColumnClicked(NMHDR *nmhdr, POINT *ptClick) #endif //__WXWINCE__ if ( !::GetCursorPos(ptClick) ) { - wxLogLastError(_T("GetCursorPos")); + wxLogLastError(wxT("GetCursorPos")); } // we need to use listctrl coordinates for the event point so this is what @@ -1979,12 +1979,12 @@ int WXDLLIMPEXP_CORE wxMSWGetColumnClicked(NMHDR *nmhdr, POINT *ptClick) POINT ptClickHeader = *ptClick; if ( !::ScreenToClient(nmhdr->hwndFrom, &ptClickHeader) ) { - wxLogLastError(_T("ScreenToClient(listctrl header)")); + wxLogLastError(wxT("ScreenToClient(listctrl header)")); } if ( !::ScreenToClient(::GetParent(nmhdr->hwndFrom), ptClick) ) { - wxLogLastError(_T("ScreenToClient(listctrl)")); + wxLogLastError(wxT("ScreenToClient(listctrl)")); } const int colCount = Header_GetItemCount(nmhdr->hwndFrom); @@ -2448,7 +2448,7 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) const int startPos = pFindInfo->iStart; const int maxPos = GetItemCount(); wxCHECK_MSG( startPos <= maxPos, false, - _T("bad starting position in LVN_ODFINDITEM") ); + wxT("bad starting position in LVN_ODFINDITEM") ); int currentPos = startPos; do @@ -2953,7 +2953,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event) numCols, &indexArray[0]) ) { - wxFAIL_MSG( _T("invalid column index array in OnPaint()") ); + wxFAIL_MSG( wxT("invalid column index array in OnPaint()") ); return; } @@ -3003,7 +3003,7 @@ wxString wxListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col)) cons { // this is a pure virtual function, in fact - which is not really pure // because the controls which are not virtual don't need to implement it - wxFAIL_MSG( _T("wxListCtrl::OnGetItemText not supposed to be called") ); + wxFAIL_MSG( wxT("wxListCtrl::OnGetItemText not supposed to be called") ); return wxEmptyString; } @@ -3027,7 +3027,7 @@ int wxListCtrl::OnGetItemColumnImage(long item, long column) const wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const { wxASSERT_MSG( item >= 0 && item < GetItemCount(), - _T("invalid item index in OnGetItemAttr()") ); + wxT("invalid item index in OnGetItemAttr()") ); // no attributes by default return NULL; @@ -3044,12 +3044,12 @@ wxListItemAttr *wxListCtrl::DoGetItemColumnAttr(long item, long column) const void wxListCtrl::SetItemCount(long count) { - wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") ); + wxASSERT_MSG( IsVirtual(), wxT("this is for virtual controls only") ); if ( !::SendMessage(GetHwnd(), LVM_SETITEMCOUNT, (WPARAM)count, LVSICF_NOSCROLL | LVSICF_NOINVALIDATEALL) ) { - wxLogLastError(_T("ListView_SetItemCount")); + wxLogLastError(wxT("ListView_SetItemCount")); } m_count = count; wxASSERT_MSG( m_count == ListView_GetItemCount(GetHwnd()), diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 17b5c1c88a..190786e1e1 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -120,7 +120,7 @@ void wxSETranslator(unsigned int WXUNUSED(code), EXCEPTION_POINTERS *ep) switch ( wxGlobalSEHandler(ep) ) { default: - wxFAIL_MSG( _T("unexpected wxGlobalSEHandler() return value") ); + wxFAIL_MSG( wxT("unexpected wxGlobalSEHandler() return value") ); // fall through case EXCEPTION_EXECUTE_HANDLER: @@ -154,19 +154,19 @@ bool wxHandleFatalExceptions(bool doit) wxChar fullname[MAX_PATH]; if ( !::GetTempPath(WXSIZEOF(fullname), fullname) ) { - wxLogLastError(_T("GetTempPath")); + wxLogLastError(wxT("GetTempPath")); // when all else fails... - wxStrcpy(fullname, _T("c:\\")); + wxStrcpy(fullname, wxT("c:\\")); } // use PID and date to make the report file name more unique wxString name = wxString::Format ( - _T("%s_%s_%lu.dmp"), + wxT("%s_%s_%lu.dmp"), wxTheApp ? (const wxChar*)wxTheApp->GetAppDisplayName().c_str() - : _T("wxwindows"), - wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str(), + : wxT("wxwindows"), + wxDateTime::Now().Format(wxT("%Y%m%dT%H%M%S")).c_str(), ::GetCurrentProcessId() ); diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index 9c28b56f13..55078de4c0 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -186,7 +186,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent, msflags &= ~WS_VSCROLL; msflags &= ~WS_HSCROLL; - if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(_T("wxMDIFrame")), + if ( !wxWindow::MSWCreate(wxApp::GetRegisteredClassName(wxT("wxMDIFrame")), title.wx_str(), pos, size, msflags, @@ -495,7 +495,7 @@ void wxMDIParentFrame::Cascade() void wxMDIParentFrame::Tile(wxOrientation orient) { wxASSERT_MSG( orient == wxHORIZONTAL || orient == wxVERTICAL, - _T("invalid orientation value") ); + wxT("invalid orientation value") ); ::SendMessage(GetWinHwnd(GetClientWindow()), WM_MDITILE, orient == wxHORIZONTAL ? MDITILE_HORIZONTAL @@ -792,7 +792,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, MDICREATESTRUCT mcs; wxString className = - wxApp::GetRegisteredClassName(_T("wxMDIChildFrame"), COLOR_WINDOW); + wxApp::GetRegisteredClassName(wxT("wxMDIChildFrame"), COLOR_WINDOW); if ( !(style & wxFULL_REPAINT_ON_RESIZE) ) className += wxApp::GetNoRedrawClassSuffix(); @@ -846,7 +846,7 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, if ( !m_hWnd ) { - wxLogLastError(_T("WM_MDICREATE")); + wxLogLastError(wxT("WM_MDICREATE")); return false; } @@ -1435,7 +1435,7 @@ void MDISetMenu(wxWindow *win, HMENU hmenuFrame, HMENU hmenuWindow) DWORD err = ::GetLastError(); if ( err ) { - wxLogApiError(_T("SendMessage(WM_MDISETMENU)"), err); + wxLogApiError(wxT("SendMessage(WM_MDISETMENU)"), err); } } } diff --git a/src/msw/mediactrl.cpp b/src/msw/mediactrl.cpp index d45c50056c..e161a5a03d 100644 --- a/src/msw/mediactrl.cpp +++ b/src/msw/mediactrl.cpp @@ -2214,7 +2214,7 @@ bool wxAMMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, // First get the AMGetErrorText procedure in // debug mode for more meaningful messages #if wxDEBUG_LEVEL - if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) ) + if ( m_dllQuartz.Load(wxT("quartz.dll"), wxDL_VERBATIM) ) { m_lpAMGetErrorText = (LPAMGETERRORTEXT) m_dllQuartz.GetSymbolAorW(wxT("AMGetErrorText")); @@ -2786,7 +2786,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMCIMediaBackend, wxMediaBackend) { \ TCHAR sz[5000]; \ mciGetErrorString(nRet, sz, 5000); \ - wxFAIL_MSG(wxString::Format(_T("MCI Error:%s"), sz)); \ + wxFAIL_MSG(wxString::Format(wxT("MCI Error:%s"), sz)); \ } \ } #else diff --git a/src/msw/mediactrl_am.cpp b/src/msw/mediactrl_am.cpp index 3088d51ab9..66db8cf30a 100644 --- a/src/msw/mediactrl_am.cpp +++ b/src/msw/mediactrl_am.cpp @@ -1616,7 +1616,7 @@ bool wxAMMediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, // First get the AMGetErrorText procedure in debug // mode for more meaningful messages #if wxDEBUG_LEVEL - if ( m_dllQuartz.Load(_T("quartz.dll"), wxDL_VERBATIM) ) + if ( m_dllQuartz.Load(wxT("quartz.dll"), wxDL_VERBATIM) ) { m_lpAMGetErrorText = (LPAMGETERRORTEXT) m_dllQuartz.GetSymbolAorW(wxT("AMGetErrorText")); diff --git a/src/msw/mediactrl_wmp10.cpp b/src/msw/mediactrl_wmp10.cpp index 24145bbd88..01a10d5740 100644 --- a/src/msw/mediactrl_wmp10.cpp +++ b/src/msw/mediactrl_wmp10.cpp @@ -830,7 +830,7 @@ bool wxWMP10MediaBackend::CreateControl(wxControl* ctrl, wxWindow* parent, ::GetClientRect((HWND)ctrl->GetHandle(), &rcClient); m_wndView.Create((HWND)ctrl->GetHandle(), rcClient, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE); hr = m_wndView.QueryHost(&spHost); - hr = spHost->CreateControl(CComBSTR(_T("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")), m_wndView, 0); + hr = spHost->CreateControl(CComBSTR(wxT("{6BF52A52-394A-11d3-B153-00C04F79FAA6}")), m_wndView, 0); hr = m_wndView.QueryControl(&m_pWMPPlayer); if( m_pWMPPlayer->get_settings(&m_pWMPSettings) != 0) @@ -1477,7 +1477,7 @@ bool wxWinCEExecute(const wxString& path, int nShowStyle = SW_SHOWNORMAL) { WinStruct sei; sei.lpFile = path.c_str(); - sei.lpVerb = _T("open"); + sei.lpVerb = wxT("open"); sei.nShow = nShowStyle; ::ShellExecuteEx(&sei); diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 8bbe72a03b..657a3fb3c3 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -564,7 +564,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) // the app from starting up under Windows 95/NT 4 typedef BOOL (WINAPI *SetMenuInfo_t)(HMENU, MENUINFO *); - wxDynamicLibrary dllUser(_T("user32")); + wxDynamicLibrary dllUser(wxT("user32")); wxDYNLIB_FUNCTION(SetMenuInfo_t, SetMenuInfo, dllUser); if ( pfnSetMenuInfo ) { @@ -572,7 +572,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) mi.dwStyle = MNS_CHECKORBMP; if ( !(*pfnSetMenuInfo)(GetHmenu(), &mi) ) { - wxLogLastError(_T("SetMenuInfo(MNS_NOCHECK)")); + wxLogLastError(wxT("SetMenuInfo(MNS_NOCHECK)")); } } @@ -639,7 +639,7 @@ void wxMenu::EndRadioGroup() wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) { - wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") ); + wxCHECK_MSG( item, NULL, wxT("NULL item in wxMenu::DoAppend") ); bool check = false; @@ -671,7 +671,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) } else { - wxFAIL_MSG( _T("where is the radio group start item?") ); + wxFAIL_MSG( wxT("where is the radio group start item?") ); } } } diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index 2eb256b619..d1815b969d 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -176,7 +176,7 @@ void wxMenuItem::Init() SetMarginWidth(GetMarginWidth()); // tell the owner drawing code to show the accel string as well - SetAccelString(m_text.AfterFirst(_T('\t'))); + SetAccelString(m_text.AfterFirst(wxT('\t'))); #endif // wxUSE_OWNER_DRAWN } @@ -232,7 +232,7 @@ void wxMenuItem::SetAsRadioGroupStart() void wxMenuItem::SetRadioGroupStart(int start) { wxASSERT_MSG( !m_isRadioGroupStart, - _T("should only be called for the next radio items") ); + wxT("should only be called for the next radio items") ); m_radioGroup.start = start; } @@ -240,7 +240,7 @@ void wxMenuItem::SetRadioGroupStart(int start) void wxMenuItem::SetRadioGroupEnd(int end) { wxASSERT_MSG( m_isRadioGroupStart, - _T("should only be called for the first radio item") ); + wxT("should only be called for the first radio item") ); m_radioGroup.end = end; } @@ -292,7 +292,7 @@ void wxMenuItem::Check(bool check) const wxMenuItemList& items = m_parentMenu->GetMenuItems(); int pos = items.IndexOf(this); wxCHECK_RET( pos != wxNOT_FOUND, - _T("menuitem not found in the menu items list?") ); + wxT("menuitem not found in the menu items list?") ); // get the radio group range int start, @@ -316,7 +316,7 @@ void wxMenuItem::Check(bool check) // (NT4 SP6) and I suspect this could happen to the others as well, // so don't do it! wxCHECK_RET( start != -1 && end != -1, - _T("invalid ::CheckMenuRadioItem() parameter(s)") ); + wxT("invalid ::CheckMenuRadioItem() parameter(s)") ); if ( !::CheckMenuRadioItem(hmenu, start, // the first radio group item @@ -324,7 +324,7 @@ void wxMenuItem::Check(bool check) pos, // the one to check MF_BYPOSITION) ) { - wxLogLastError(_T("CheckMenuRadioItem")); + wxLogLastError(wxT("CheckMenuRadioItem")); } #endif // __WIN32__ @@ -346,7 +346,7 @@ void wxMenuItem::Check(bool check) GetMSWId(), MF_BYCOMMAND | flags) == (DWORD)-1 ) { - wxFAIL_MSG(_T("CheckMenuItem() failed, item not in the menu?")); + wxFAIL_MSG(wxT("CheckMenuItem() failed, item not in the menu?")); } } } @@ -371,7 +371,7 @@ void wxMenuItem::SetItemLabel(const wxString& txt) OWNER_DRAWN_ONLY( wxOwnerDrawn::SetName(m_text) ); #if wxUSE_OWNER_DRAWN // tell the owner drawing code to to show the accel string as well - SetAccelString(m_text.AfterFirst(_T('\t'))); + SetAccelString(m_text.AfterFirst(wxT('\t'))); #endif // the item can be not attached to any menu yet and SetItemLabel() is still diff --git a/src/msw/metafile.cpp b/src/msw/metafile.cpp index e66cef4a80..e20f24a5b4 100644 --- a/src/msw/metafile.cpp +++ b/src/msw/metafile.cpp @@ -138,7 +138,7 @@ bool wxMetafile::Play(wxDC *dc) if ( !::PlayMetaFile(GetHdcOf(*dc), (HMETAFILE) M_METAFILEDATA->m_metafile) ) { - wxLogLastError(_T("PlayMetaFile")); + wxLogLastError(wxT("PlayMetaFile")); } } @@ -252,7 +252,7 @@ void wxMetafileDCImpl::DoGetTextExtent(const wxString& string, void wxMetafileDCImpl::DoGetSize(int *width, int *height) const { - wxCHECK_RET( m_refData, _T("invalid wxMetafileDC") ); + wxCHECK_RET( m_refData, wxT("invalid wxMetafileDC") ); if ( width ) *width = M_METAFILEDATA->m_width; @@ -390,14 +390,14 @@ bool wxMakeMetafilePlaceable(const wxString& filename, int x1, int y1, int x2, i p < (WORD *)&pMFHead ->checksum; ++p) pMFHead ->checksum ^= *p; - FILE *fd = wxFopen(filename.fn_str(), _T("rb")); + FILE *fd = wxFopen(filename.fn_str(), wxT("rb")); if (!fd) return false; wxString tempFileBuf = wxFileName::CreateTempFileName(wxT("mf")); if (tempFileBuf.empty()) return false; - FILE *fHandle = wxFopen(tempFileBuf.fn_str(), _T("wb")); + FILE *fHandle = wxFopen(tempFileBuf.fn_str(), wxT("wb")); if (!fHandle) return false; fwrite((void *)&header, sizeof(unsigned char), sizeof(mfPLACEABLEHEADER), fHandle); @@ -484,7 +484,7 @@ bool wxMetafileDataObject::GetDataHere(void *buf) const METAFILEPICT *mfpict = (METAFILEPICT *)buf; const wxMetafile& mf = GetMetafile(); - wxCHECK_MSG( mf.GetHMETAFILE(), false, _T("copying invalid metafile") ); + wxCHECK_MSG( mf.GetHMETAFILE(), false, wxT("copying invalid metafile") ); // doesn't seem to work with any other mapping mode... mfpict->mm = MM_ANISOTROPIC; //mf.GetWindowsMappingMode(); @@ -520,7 +520,7 @@ bool wxMetafileDataObject::SetData(size_t WXUNUSED(len), const void *buf) mf.SetHeight(h); mf.SetHMETAFILE((WXHANDLE)mfpict->hMF); - wxCHECK_MSG( mfpict->hMF, false, _T("pasting invalid metafile") ); + wxCHECK_MSG( mfpict->hMF, false, wxT("pasting invalid metafile") ); SetMetafile(mf); diff --git a/src/msw/mimetype.cpp b/src/msw/mimetype.cpp index a7d29114c9..dae42f9ddf 100644 --- a/src/msw/mimetype.cpp +++ b/src/msw/mimetype.cpp @@ -101,7 +101,7 @@ static bool CanonicalizeParams(wxString& command) void wxFileTypeImpl::Init(const wxString& strFileType, const wxString& ext) { // VZ: does it? (FIXME) - wxCHECK_RET( !ext.empty(), _T("needs an extension") ); + wxCHECK_RET( !ext.empty(), wxT("needs an extension") ); if ( ext[0u] != wxT('.') ) { m_ext = wxT('.'); @@ -110,14 +110,14 @@ void wxFileTypeImpl::Init(const wxString& strFileType, const wxString& ext) m_strFileType = strFileType; if ( !strFileType ) { - m_strFileType = m_ext.AfterFirst('.') + _T("_auto_file"); + m_strFileType = m_ext.AfterFirst('.') + wxT("_auto_file"); } } wxString wxFileTypeImpl::GetVerbPath(const wxString& verb) const { wxString path; - path << m_strFileType << _T("\\shell\\") << verb << _T("\\command"); + path << m_strFileType << wxT("\\shell\\") << verb << wxT("\\command"); return path; } @@ -125,7 +125,7 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs, wxArrayString *commands, const wxFileType::MessageParameters& params) const { - wxCHECK_MSG( !m_ext.empty(), 0, _T("GetAllCommands() needs an extension") ); + wxCHECK_MSG( !m_ext.empty(), 0, wxT("GetAllCommands() needs an extension") ); if ( m_strFileType.empty() ) { @@ -134,7 +134,7 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs, wxRegKey rkey(wxRegKey::HKCR, m_ext); if ( !rkey.Exists() || !rkey.QueryValue(wxEmptyString, self->m_strFileType) ) { - wxLogDebug(_T("Can't get the filetype for extension '%s'."), + wxLogDebug(wxT("Can't get the filetype for extension '%s'."), m_ext.c_str()); return 0; @@ -143,7 +143,7 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs, // enum all subkeys of HKCR\filetype\shell size_t count = 0; - wxRegKey rkey(wxRegKey::HKCR, m_strFileType + _T("\\shell")); + wxRegKey rkey(wxRegKey::HKCR, m_strFileType + wxT("\\shell")); long dummy; wxString verb; bool ok = rkey.GetFirstKey(verb, dummy); @@ -153,7 +153,7 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs, // we want the open bverb to eb always the first - if ( verb.CmpNoCase(_T("open")) == 0 ) + if ( verb.CmpNoCase(wxT("open")) == 0 ) { if ( verbs ) verbs->Insert(verb, 0); @@ -232,13 +232,13 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const } } - if (!strKey && wxRegKey(wxRegKey::HKCR, m_ext + _T("\\shell")).Exists()) + if (!strKey && wxRegKey(wxRegKey::HKCR, m_ext + wxT("\\shell")).Exists()) strKey = m_ext; if ( !strKey && !m_strFileType.empty()) { wxString fileType = wxFileTypeImplGetCurVer(m_strFileType); - if (wxRegKey(wxRegKey::HKCR, fileType + _T("\\shell")).Exists()) + if (wxRegKey(wxRegKey::HKCR, fileType + wxT("\\shell")).Exists()) strKey = fileType; } @@ -249,7 +249,7 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const } strKey << wxT("\\shell\\") << verb; - wxRegKey key(wxRegKey::HKCR, strKey + _T("\\command")); + wxRegKey key(wxRegKey::HKCR, strKey + wxT("\\command")); wxString command; if ( key.Open(wxRegKey::Read) ) { // it's the default value of the key @@ -259,16 +259,16 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const #if wxUSE_IPC // look whether we must issue some DDE requests to the application // (and not just launch it) - strKey += _T("\\DDEExec"); + strKey += wxT("\\DDEExec"); wxRegKey keyDDE(wxRegKey::HKCR, strKey); if ( keyDDE.Open(wxRegKey::Read) ) { wxString ddeCommand, ddeServer, ddeTopic; keyDDE.QueryValue(wxEmptyString, ddeCommand); - ddeCommand.Replace(_T("%1"), _T("%s")); + ddeCommand.Replace(wxT("%1"), wxT("%s")); - wxRegKey keyServer(wxRegKey::HKCR, strKey + _T("\\Application")); + wxRegKey keyServer(wxRegKey::HKCR, strKey + wxT("\\Application")); keyServer.QueryValue(wxEmptyString, ddeServer); - wxRegKey keyTopic(wxRegKey::HKCR, strKey + _T("\\Topic")); + wxRegKey keyTopic(wxRegKey::HKCR, strKey + wxT("\\Topic")); keyTopic.QueryValue(wxEmptyString, ddeTopic); if (ddeTopic.empty()) @@ -277,10 +277,10 @@ wxString wxFileTypeImpl::GetCommand(const wxString& verb) const // HACK: we use a special feature of wxExecute which exists // just because we need it here: it will establish DDE // conversation with the program it just launched - command.Prepend(_T("WX_DDE#")); - command << _T('#') << ddeServer - << _T('#') << ddeTopic - << _T('#') << ddeCommand; + command.Prepend(wxT("WX_DDE#")); + command << wxT('#') << ddeServer + << wxT('#') << ddeTopic + << wxT('#') << ddeCommand; } else #endif // wxUSE_IPC @@ -538,7 +538,7 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) { wxCHECK_MSG( !ftInfo.GetExtensions().empty(), NULL, - _T("Associate() needs extension") ); + wxT("Associate() needs extension") ); bool ok; size_t iExtCount = 0; @@ -548,10 +548,10 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) wxString ext = ftInfo.GetExtensions()[iExtCount]; wxCHECK_MSG( !ext.empty(), NULL, - _T("Associate() needs non empty extension") ); + wxT("Associate() needs non empty extension") ); - if ( ext[0u] != _T('.') ) - extWithDot = _T('.'); + if ( ext[0u] != wxT('.') ) + extWithDot = wxT('.'); extWithDot += ext; // start by setting the HKCR\\.ext entries @@ -569,7 +569,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) if ( filetypeOrig.empty() ) { // make it up from the extension - filetype << extWithDot.c_str() + 1 << _T("_file"); + filetype << extWithDot.c_str() + 1 << wxT("_file"); } else { @@ -599,7 +599,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) if ( !mimetype.empty() ) { // set the MIME type - ok = key.SetValue(_T("Content Type"), mimetype); + ok = key.SetValue(wxT("Content Type"), mimetype); if ( ok ) { @@ -612,7 +612,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) if ( ok ) { // and provide a back link to the extension - keyMIME.SetValue(_T("Extension"), extWithDot); + keyMIME.SetValue(wxT("Extension"), extWithDot); } } } @@ -623,8 +623,8 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) for (iExtCount=1; iExtCount < ftInfo.GetExtensionsCount(); iExtCount++ ) { ext = ftInfo.GetExtensions()[iExtCount]; - if ( ext[0u] != _T('.') ) - extWithDot = _T('.'); + if ( ext[0u] != wxT('.') ) + extWithDot = wxT('.'); extWithDot += ext; wxRegKey key(wxRegKey::HKCR, extWithDot); @@ -636,7 +636,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) if ( !mimetype.empty() ) { // set the MIME type - ok = key.SetValue(_T("Content Type"), mimetype); + ok = key.SetValue(wxT("Content Type"), mimetype); if ( ok ) { @@ -649,7 +649,7 @@ wxFileType *wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) if ( ok ) { // and provide a back link to the extension - keyMIME.SetValue(_T("Extension"), extWithDot); + keyMIME.SetValue(wxT("Extension"), extWithDot); } } } @@ -681,7 +681,7 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, bool WXUNUSED(overwriteprompt)) { wxCHECK_MSG( !m_ext.empty() && !verb.empty(), false, - _T("SetCommand() needs an extension and a verb") ); + wxT("SetCommand() needs an extension and a verb") ); if ( !EnsureExtKeyExists() ) return false; @@ -716,13 +716,13 @@ bool wxFileTypeImpl::SetCommand(const wxString& cmd, // TODO: // 1. translate '%s' to '%1' instead of always adding it // 2. create DDEExec value if needed (undo GetCommand) - return rkey.Create() && rkey.SetValue(wxEmptyString, cmd + _T(" \"%1\"") ); + return rkey.Create() && rkey.SetValue(wxEmptyString, cmd + wxT(" \"%1\"") ); } /* // no longer used bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig) { - wxCHECK_MSG( !m_ext.empty(), false, _T("SetMimeType() needs extension") ); + wxCHECK_MSG( !m_ext.empty(), false, wxT("SetMimeType() needs extension") ); if ( !EnsureExtKeyExists() ) return false; @@ -733,8 +733,8 @@ bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig) { // make up a default value for it wxString cmd; - wxFileName::SplitPath(GetCommand(_T("open")), NULL, &cmd, NULL); - mimeType << _T("application/x-") << cmd; + wxFileName::SplitPath(GetCommand(wxT("open")), NULL, &cmd, NULL); + mimeType << wxT("application/x-") << cmd; } else { @@ -742,31 +742,31 @@ bool wxFileTypeImpl::SetMimeType(const wxString& mimeTypeOrig) } wxRegKey rkey(wxRegKey::HKCR, m_ext); - return rkey.Create() && rkey.SetValue(_T("Content Type"), mimeType); + return rkey.Create() && rkey.SetValue(wxT("Content Type"), mimeType); } */ bool wxFileTypeImpl::SetDefaultIcon(const wxString& cmd, int index) { - wxCHECK_MSG( !m_ext.empty(), false, _T("SetDefaultIcon() needs extension") ); - wxCHECK_MSG( !m_strFileType.empty(), false, _T("File key not found") ); + wxCHECK_MSG( !m_ext.empty(), false, wxT("SetDefaultIcon() needs extension") ); + wxCHECK_MSG( !m_strFileType.empty(), false, wxT("File key not found") ); // the next line fails on a SMBshare, I think because it is case mangled -// wxCHECK_MSG( !wxFileExists(cmd), false, _T("Icon file not found.") ); +// wxCHECK_MSG( !wxFileExists(cmd), false, wxT("Icon file not found.") ); if ( !EnsureExtKeyExists() ) return false; - wxRegKey rkey(wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon")); + wxRegKey rkey(wxRegKey::HKCR, m_strFileType + wxT("\\DefaultIcon")); return rkey.Create() && rkey.SetValue(wxEmptyString, - wxString::Format(_T("%s,%d"), cmd.c_str(), index)); + wxString::Format(wxT("%s,%d"), cmd.c_str(), index)); } bool wxFileTypeImpl::SetDescription (const wxString& desc) { - wxCHECK_MSG( !m_strFileType.empty(), false, _T("File key not found") ); - wxCHECK_MSG( !desc.empty(), false, _T("No file description supplied") ); + wxCHECK_MSG( !m_strFileType.empty(), false, wxT("File key not found") ); + wxCHECK_MSG( !desc.empty(), false, wxT("No file description supplied") ); if ( !EnsureExtKeyExists() ) return false; @@ -808,13 +808,13 @@ bool wxFileTypeImpl::Unassociate() bool wxFileTypeImpl::RemoveOpenCommand() { - return RemoveCommand(_T("open")); + return RemoveCommand(wxT("open")); } bool wxFileTypeImpl::RemoveCommand(const wxString& verb) { wxCHECK_MSG( !m_ext.empty() && !verb.empty(), false, - _T("RemoveCommand() needs an extension and a verb") ); + wxT("RemoveCommand() needs an extension and a verb") ); wxRegKey rkey(wxRegKey::HKCR, GetVerbPath(verb)); @@ -824,7 +824,7 @@ bool wxFileTypeImpl::RemoveCommand(const wxString& verb) bool wxFileTypeImpl::RemoveMimeType() { - wxCHECK_MSG( !m_ext.empty(), false, _T("RemoveMimeType() needs extension") ); + wxCHECK_MSG( !m_ext.empty(), false, wxT("RemoveMimeType() needs extension") ); wxRegKey rkey(wxRegKey::HKCR, m_ext); return !rkey.Exists() || rkey.DeleteSelf(); @@ -833,16 +833,16 @@ bool wxFileTypeImpl::RemoveMimeType() bool wxFileTypeImpl::RemoveDefaultIcon() { wxCHECK_MSG( !m_ext.empty(), false, - _T("RemoveDefaultIcon() needs extension") ); + wxT("RemoveDefaultIcon() needs extension") ); - wxRegKey rkey (wxRegKey::HKCR, m_strFileType + _T("\\DefaultIcon")); + wxRegKey rkey (wxRegKey::HKCR, m_strFileType + wxT("\\DefaultIcon")); return !rkey.Exists() || rkey.DeleteSelf(); } bool wxFileTypeImpl::RemoveDescription() { wxCHECK_MSG( !m_ext.empty(), false, - _T("RemoveDescription() needs extension") ); + wxT("RemoveDescription() needs extension") ); wxRegKey rkey (wxRegKey::HKCR, m_strFileType ); return !rkey.Exists() || rkey.DeleteSelf(); diff --git a/src/msw/msgdlg.cpp b/src/msw/msgdlg.cpp index 829b4a855e..108beb7d1b 100644 --- a/src/msw/msgdlg.cpp +++ b/src/msw/msgdlg.cpp @@ -201,9 +201,9 @@ void wxMessageDialog::ReplaceStaticWithEdit() // find the static control to replace: normally there are two of them, the // icon and the text itself so search for all of them and ignore the icon // ones - HWND hwndStatic = ::FindWindowEx(GetHwnd(), NULL, _T("STATIC"), NULL); + HWND hwndStatic = ::FindWindowEx(GetHwnd(), NULL, wxT("STATIC"), NULL); if ( ::GetWindowLong(hwndStatic, GWL_STYLE) & SS_ICON ) - hwndStatic = ::FindWindowEx(GetHwnd(), hwndStatic, _T("STATIC"), NULL); + hwndStatic = ::FindWindowEx(GetHwnd(), hwndStatic, wxT("STATIC"), NULL); if ( !hwndStatic ) { @@ -258,7 +258,7 @@ void wxMessageDialog::ReplaceStaticWithEdit() // do create the new control HWND hwndEdit = ::CreateWindow ( - _T("EDIT"), + wxT("EDIT"), wxTextBuffer::Translate(text).wx_str(), WS_CHILD | WS_VSCROLL | WS_VISIBLE | ES_MULTILINE | ES_READONLY | ES_AUTOVSCROLL, @@ -557,7 +557,7 @@ int wxMessageDialog::ShowModal() switch (msAns) { default: - wxFAIL_MSG(_T("unexpected ::MessageBox() return code")); + wxFAIL_MSG(wxT("unexpected ::MessageBox() return code")); // fall through case IDCANCEL: diff --git a/src/msw/nativdlg.cpp b/src/msw/nativdlg.cpp index b7ba64f613..d5cce1f1e5 100644 --- a/src/msw/nativdlg.cpp +++ b/src/msw/nativdlg.cpp @@ -162,7 +162,7 @@ wxWindow* wxWindow::GetWindowChild(wxWindowID id) wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd) { - wxCHECK_MSG( parent, NULL, _T("must have valid parent for a control") ); + wxCHECK_MSG( parent, NULL, wxT("must have valid parent for a control") ); wxString str(wxGetWindowClass(hWnd)); str.UpperCase(); diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 03b371c629..82304be269 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -334,7 +334,7 @@ bool wxNotebook::Create(wxWindow *parent, } else { - wxLogLastError(_T("GetClassInfoEx(SysTabCtl32)")); + wxLogLastError(wxT("GetClassInfoEx(SysTabCtl32)")); } } @@ -665,7 +665,7 @@ wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const void wxNotebook::AdjustPageSize(wxNotebookPage *page) { - wxCHECK_RET( page, _T("NULL page in wxNotebook::AdjustPageSize") ); + wxCHECK_RET( page, wxT("NULL page in wxNotebook::AdjustPageSize") ); const wxRect r = GetPageSize(); if ( !r.IsEmpty() ) @@ -753,12 +753,12 @@ bool wxNotebook::InsertPage(size_t nPage, bool bSelect, int imageId) { - wxCHECK_MSG( pPage != NULL, false, _T("NULL page in wxNotebook::InsertPage") ); + wxCHECK_MSG( pPage != NULL, false, wxT("NULL page in wxNotebook::InsertPage") ); wxCHECK_MSG( IS_VALID_PAGE(nPage) || nPage == GetPageCount(), false, - _T("invalid index in wxNotebook::InsertPage") ); + wxT("invalid index in wxNotebook::InsertPage") ); wxASSERT_MSG( pPage->GetParent() == this, - _T("notebook pages must have notebook as parent") ); + wxT("notebook pages must have notebook as parent") ); // add a new tab to the control // ---------------------------- @@ -1261,7 +1261,7 @@ WXHBRUSH wxNotebook::MSWGetBgBrushForChild(WXHDC hDC, WXHWND hWnd) if ( !::SetBrushOrgEx((HDC)hDC, -rc.left, -rc.top, NULL) ) { - wxLogLastError(_T("SetBrushOrgEx(notebook bg brush)")); + wxLogLastError(wxT("SetBrushOrgEx(notebook bg brush)")); } return m_hbrBackground; diff --git a/src/msw/notifmsg.cpp b/src/msw/notifmsg.cpp index 31a4472be4..a864e76371 100644 --- a/src/msw/notifmsg.cpp +++ b/src/msw/notifmsg.cpp @@ -280,7 +280,7 @@ void wxBalloonNotifMsgImpl::SetUpIcon(wxWindow *win) if ( !icon.IsOk() ) { // we really must have some icon - icon = wxIcon(_T("wxICON_AAA")); + icon = wxIcon(wxT("wxICON_AAA")); } m_icon->SetIcon(icon); @@ -321,7 +321,7 @@ wxManualNotifMsgImpl::DoShow(const wxString& title, int flags) { wxASSERT_MSG( timeout == wxNotificationMessage::Timeout_Never, - _T("shouldn't be used") ); + wxT("shouldn't be used") ); // base class creates the icon for us initially but we could have destroyed // it in DoClose(), recreate it if this was the case @@ -368,7 +368,7 @@ wxAutoNotifMsgImpl::DoShow(const wxString& title, int flags) { wxASSERT_MSG( timeout != wxNotificationMessage::Timeout_Never, - _T("shouldn't be used") ); + wxT("shouldn't be used") ); if ( timeout == wxNotificationMessage::Timeout_Auto ) { diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 4580beea95..31348b791a 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -731,7 +731,7 @@ wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant) break; default: - wxLogDebug(_T("unhandled VT_ARRAY type %x in wxConvertOleToVariant"), + wxLogDebug(wxT("unhandled VT_ARRAY type %x in wxConvertOleToVariant"), oleVariant.vt & VT_TYPEMASK); variant = wxVariant(); ok = false; diff --git a/src/msw/ole/dataobj.cpp b/src/msw/ole/dataobj.cpp index e112f436e8..fde08cbcd0 100644 --- a/src/msw/ole/dataobj.cpp +++ b/src/msw/ole/dataobj.cpp @@ -54,7 +54,7 @@ #include "wx/msw/dib.h" #ifndef CFSTR_SHELLURL -#define CFSTR_SHELLURL _T("UniformResourceLocator") +#define CFSTR_SHELLURL wxT("UniformResourceLocator") #endif // ---------------------------------------------------------------------------- @@ -1154,7 +1154,7 @@ bool wxFileDataObject::GetDataHere(void *WXUNUSED_IN_WINCE(pData)) const // Work around bug in Wine headers #if defined(__WINE__) && defined(CFSTR_SHELLURL) && wxUSE_UNICODE #undef CFSTR_SHELLURL -#define CFSTR_SHELLURL _T("CFSTR_SHELLURL") +#define CFSTR_SHELLURL wxT("CFSTR_SHELLURL") #endif class CFSTR_SHELLURLDataObject : public wxCustomDataObject @@ -1234,7 +1234,7 @@ bool wxURLDataObject::SetData(const wxDataFormat& format, wxString wxURLDataObject::GetURL() const { wxString url; - wxCHECK_MSG( m_dataObjectLast, url, _T("no data in wxURLDataObject") ); + wxCHECK_MSG( m_dataObjectLast, url, wxT("no data in wxURLDataObject") ); size_t len = m_dataObjectLast->GetDataSize(); diff --git a/src/msw/ole/droptgt.cpp b/src/msw/ole/droptgt.cpp index 2e65f600b1..4b978f8695 100644 --- a/src/msw/ole/droptgt.cpp +++ b/src/msw/ole/droptgt.cpp @@ -169,7 +169,7 @@ STDMETHODIMP wxIDropTarget::DragEnter(IDataObject *pIDataSource, wxLogTrace(wxTRACE_OleCalls, wxT("IDropTarget::DragEnter")); wxASSERT_MSG( m_pIDataObject == NULL, - _T("drop target must have data object") ); + wxT("drop target must have data object") ); // show the list of formats supported by the source data object for the // debugging purposes, this is quite useful sometimes - please don't remove @@ -180,7 +180,7 @@ STDMETHODIMP wxIDropTarget::DragEnter(IDataObject *pIDataSource, FORMATETC fmt; while ( penumFmt->Next(1, &fmt, NULL) == S_OK ) { - wxLogDebug(_T("Drop source supports format %s"), + wxLogDebug(wxT("Drop source supports format %s"), wxDataObject::GetFormatName(fmt.cfFormat)); } @@ -188,7 +188,7 @@ STDMETHODIMP wxIDropTarget::DragEnter(IDataObject *pIDataSource, } else { - wxLogLastError(_T("IDataObject::EnumFormatEtc")); + wxLogLastError(wxT("IDataObject::EnumFormatEtc")); } #endif // 0 diff --git a/src/msw/ole/oleutils.cpp b/src/msw/ole/oleutils.cpp index 3932c8d9ec..cd7dd75edc 100644 --- a/src/msw/ole/oleutils.cpp +++ b/src/msw/ole/oleutils.cpp @@ -140,7 +140,7 @@ static wxString GetIidName(REFIID riid) }; // construct the table containing all known interfaces - #define ADD_KNOWN_IID(name) { &IID_I##name, _T(#name) } + #define ADD_KNOWN_IID(name) { &IID_I##name, wxT(#name) } static const KNOWN_IID aKnownIids[] = { ADD_KNOWN_IID(AdviseSink), diff --git a/src/msw/ownerdrw.cpp b/src/msw/ownerdrw.cpp index cce295c617..29467f8417 100644 --- a/src/msw/ownerdrw.cpp +++ b/src/msw/ownerdrw.cpp @@ -572,7 +572,7 @@ BOOL wxDrawStateBitmap(HDC hDC, HBITMAP hBitmap, int x, int y, UINT uState) break; default: - wxFAIL_MSG( _T("DrawStateBitmap: unknown wxDSBStates value") ); + wxFAIL_MSG( wxT("DrawStateBitmap: unknown wxDSBStates value") ); result = FALSE; } diff --git a/src/msw/pen.cpp b/src/msw/pen.cpp index 5daea9b6cd..fd0e4c622e 100644 --- a/src/msw/pen.cpp +++ b/src/msw/pen.cpp @@ -218,7 +218,7 @@ static int ConvertPenStyle(wxPenStyle style) return PS_NULL; default: - wxFAIL_MSG( _T("unknown pen style") ); + wxFAIL_MSG( wxT("unknown pen style") ); // fall through #ifdef wxHAVE_EXT_CREATE_PEN @@ -258,7 +258,7 @@ static int ConvertJoinStyle(wxPenJoin join) return PS_JOIN_MITER; default: - wxFAIL_MSG( _T("unknown pen join style") ); + wxFAIL_MSG( wxT("unknown pen join style") ); // fall through case wxJOIN_ROUND: @@ -277,7 +277,7 @@ static int ConvertCapStyle(wxPenCap cap) return PS_ENDCAP_FLAT; default: - wxFAIL_MSG( _T("unknown pen cap style") ); + wxFAIL_MSG( wxT("unknown pen cap style") ); // fall through case wxCAP_ROUND: diff --git a/src/msw/popupwin.cpp b/src/msw/popupwin.cpp index d28e3cdfa6..75e2c70f82 100644 --- a/src/msw/popupwin.cpp +++ b/src/msw/popupwin.cpp @@ -100,7 +100,7 @@ bool wxPopupWindow::Show(bool show) // raise to top of z order if (!::SetWindowPos(GetHwnd(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)) { - wxLogLastError(_T("SetWindowPos")); + wxLogLastError(wxT("SetWindowPos")); } // and set it as the foreground window so the mouse can be captured diff --git a/src/msw/power.cpp b/src/msw/power.cpp index e6b74936a2..9b147e17dd 100644 --- a/src/msw/power.cpp +++ b/src/msw/power.cpp @@ -48,7 +48,7 @@ static inline bool wxGetPowerStatus(SYSTEM_POWER_STATUS *sps) { if ( !::GetSystemPowerStatus(sps) ) { - wxLogLastError(_T("GetSystemPowerStatus()")); + wxLogLastError(wxT("GetSystemPowerStatus()")); return false; } @@ -76,7 +76,7 @@ wxPowerType wxGetPowerType() return wxPOWER_SOCKET; default: - wxLogDebug(_T("Unknown ACLineStatus=%u"), sps.ACLineStatus); + wxLogDebug(wxT("Unknown ACLineStatus=%u"), sps.ACLineStatus); case 255: break; } diff --git a/src/msw/radiobox.cpp b/src/msw/radiobox.cpp index 800e82adf9..8c8b204158 100644 --- a/src/msw/radiobox.cpp +++ b/src/msw/radiobox.cpp @@ -180,7 +180,7 @@ bool wxRadioBox::Create(wxWindow *parent, wxWindowIDRef subid = NewControlId(); - HWND hwndBtn = ::CreateWindow(_T("BUTTON"), + HWND hwndBtn = ::CreateWindow(wxT("BUTTON"), choices[i].wx_str(), styleBtn, 0, 0, 0, 0, // will be set in SetSize() @@ -208,7 +208,7 @@ bool wxRadioBox::Create(wxWindow *parent, // Create a dummy radio control to end the group. m_dummyId = NewControlId(); - m_dummyHwnd = (WXHWND)::CreateWindow(_T("BUTTON"), + m_dummyHwnd = (WXHWND)::CreateWindow(wxT("BUTTON"), wxEmptyString, WS_GROUP | BS_AUTORADIOBUTTON | WS_CHILD, 0, 0, 0, 0, GetHwndOf(parent), diff --git a/src/msw/radiobut.cpp b/src/msw/radiobut.cpp index 719616e29c..01e5fd8dbb 100644 --- a/src/msw/radiobut.cpp +++ b/src/msw/radiobut.cpp @@ -135,7 +135,7 @@ bool wxRadioButton::Create(wxWindow *parent, if ( HasFlag(wxALIGN_RIGHT) ) msStyle |= BS_LEFTTEXT | BS_RIGHT; - if ( !MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, 0) ) + if ( !MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, 0) ) return false; // for compatibility with wxGTK, the first radio button in a group is @@ -172,12 +172,12 @@ void wxRadioButton::SetValue(bool value) wxWindow * const focus = FindFocus(); wxTopLevelWindow * const tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); - wxCHECK_RET( tlw, _T("radio button outside of TLW?") ); + wxCHECK_RET( tlw, wxT("radio button outside of TLW?") ); wxWindow * const focusInTLW = tlw->GetLastFocus(); const wxWindowList& siblings = GetParent()->GetChildren(); wxWindowList::compatibility_iterator nodeThis = siblings.Find(this); - wxCHECK_RET( nodeThis, _T("radio button not a child of its parent?") ); + wxCHECK_RET( nodeThis, wxT("radio button not a child of its parent?") ); // this will be set to true in the code below if the focus is in our TLW // and belongs to one of the other buttons in the same group @@ -262,7 +262,7 @@ bool wxRadioButton::GetValue() const { wxASSERT_MSG( m_isChecked == (::SendMessage(GetHwnd(), BM_GETCHECK, 0, 0L) != 0), - _T("wxRadioButton::m_isChecked is out of sync?") ); + wxT("wxRadioButton::m_isChecked is out of sync?") ); return m_isChecked; } diff --git a/src/msw/regconf.cpp b/src/msw/regconf.cpp index 363987830b..27c1e7e82b 100644 --- a/src/msw/regconf.cpp +++ b/src/msw/regconf.cpp @@ -251,7 +251,7 @@ void wxRegConfig::SetPath(const wxString& strPath) // note that we don't have to check for src < end here as // *end == 0 so can't be '.' - if ( src[1] == _T('.') && src[2] == _T('.') && + if ( src[1] == wxT('.') && src[2] == wxT('.') && (src + 3 == end || src[3] == wxCONFIG_PATH_SEPARATOR) ) { if ( !totalSlashes ) @@ -286,7 +286,7 @@ void wxRegConfig::SetPath(const wxString& strPath) // we must have found a slash one way or another! wxASSERT_MSG( *dst == wxCONFIG_PATH_SEPARATOR, - _T("error in wxRegConfig::SetPath") ); + wxT("error in wxRegConfig::SetPath") ); // stay at the same position dst--; @@ -331,7 +331,7 @@ void wxRegConfig::SetPath(const wxString& strPath) dst--; } - *dst = _T('\0'); + *dst = wxT('\0'); buf.SetLength(dst - start); } @@ -356,7 +356,7 @@ void wxRegConfig::SetPath(const wxString& strPath) for ( ; src < end; src++, dst++ ) { if ( *src == wxCONFIG_PATH_SEPARATOR ) - *dst = _T('\\'); + *dst = wxT('\\'); else *dst = *src; } @@ -556,7 +556,7 @@ wxConfigBase::EntryType wxRegConfig::GetEntryType(const wxString& key) const bool wxRegConfig::DoReadString(const wxString& key, wxString *pStr) const { - wxCHECK_MSG( pStr, false, _T("wxRegConfig::Read(): NULL param") ); + wxCHECK_MSG( pStr, false, wxT("wxRegConfig::Read(): NULL param") ); wxConfigPathChanger path(this, key); @@ -593,7 +593,7 @@ bool wxRegConfig::DoReadString(const wxString& key, wxString *pStr) const bool wxRegConfig::DoReadLong(const wxString& key, long *plResult) const { - wxCHECK_MSG( plResult, false, _T("wxRegConfig::Read(): NULL param") ); + wxCHECK_MSG( plResult, false, wxT("wxRegConfig::Read(): NULL param") ); wxConfigPathChanger path(this, key); @@ -627,7 +627,7 @@ bool wxRegConfig::DoReadLong(const wxString& key, long *plResult) const bool wxRegConfig::DoReadBinary(const wxString& key, wxMemoryBuffer *buf) const { - wxCHECK_MSG( buf, false, _T("wxRegConfig::Read(): NULL param") ); + wxCHECK_MSG( buf, false, wxT("wxRegConfig::Read(): NULL param") ); wxConfigPathChanger path(this, key); @@ -739,7 +739,7 @@ bool wxRegConfig::DeleteEntry(const wxString& value, bool bGroupIfEmptyAlso) if ( bGroupIfEmptyAlso && m_keyLocal.IsEmpty() ) { wxString strKey = GetPath().AfterLast(wxCONFIG_PATH_SEPARATOR); - SetPath(_T("..")); // changes m_keyLocal + SetPath(wxT("..")); // changes m_keyLocal return LocalKey().DeleteKey(strKey); } } diff --git a/src/msw/region.cpp b/src/msw/region.cpp index 3083a5a635..73d983df89 100644 --- a/src/msw/region.cpp +++ b/src/msw/region.cpp @@ -165,7 +165,7 @@ void wxRegion::Clear() bool wxRegion::DoOffset(wxCoord x, wxCoord y) { - wxCHECK_MSG( M_REGION, false, _T("invalid wxRegion") ); + wxCHECK_MSG( M_REGION, false, wxT("invalid wxRegion") ); if ( !x && !y ) { @@ -177,7 +177,7 @@ bool wxRegion::DoOffset(wxCoord x, wxCoord y) if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR ) { - wxLogLastError(_T("OffsetRgn")); + wxLogLastError(wxT("OffsetRgn")); return false; } @@ -202,7 +202,7 @@ bool wxRegion::DoCombine(const wxRegion& rgn, wxRegionOp op) break; default: - wxFAIL_MSG( _T("unknown region operation") ); + wxFAIL_MSG( wxT("unknown region operation") ); // fall through case wxRGN_AND: @@ -235,7 +235,7 @@ bool wxRegion::DoCombine(const wxRegion& rgn, wxRegionOp op) break; default: - wxFAIL_MSG( _T("unknown region operation") ); + wxFAIL_MSG( wxT("unknown region operation") ); // fall through case wxRGN_COPY: @@ -245,7 +245,7 @@ bool wxRegion::DoCombine(const wxRegion& rgn, wxRegionOp op) if ( ::CombineRgn(M_REGION, M_REGION, M_REGION_OF(rgn), mode) == ERROR ) { - wxLogLastError(_T("CombineRgn")); + wxLogLastError(wxT("CombineRgn")); return false; } @@ -441,28 +441,28 @@ wxRegionIterator wxRegionIterator::operator ++ (int) wxCoord wxRegionIterator::GetX() const { - wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") ); return m_rects[m_current].x; } wxCoord wxRegionIterator::GetY() const { - wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") ); return m_rects[m_current].y; } wxCoord wxRegionIterator::GetW() const { - wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") ); return m_rects[m_current].width; } wxCoord wxRegionIterator::GetH() const { - wxCHECK_MSG( m_current < m_numRects, 0, _T("invalid wxRegionIterator") ); + wxCHECK_MSG( m_current < m_numRects, 0, wxT("invalid wxRegionIterator") ); return m_rects[m_current].height; } diff --git a/src/msw/registry.cpp b/src/msw/registry.cpp index 4067064673..dbfb079c8c 100644 --- a/src/msw/registry.cpp +++ b/src/msw/registry.cpp @@ -314,7 +314,7 @@ wxString wxRegKey::GetName(bool bShortPrefix) const wxString str = bShortPrefix ? aStdKeys[key].szShortName : aStdKeys[key].szName; if ( !m_strKey.empty() ) - str << _T("\\") << m_strKey; + str << wxT("\\") << m_strKey; return str; } @@ -332,7 +332,7 @@ bool wxRegKey::GetKeyInfo(size_t *pnSubKeys, #endif // it might be unexpected to some that this function doesn't open the key - wxASSERT_MSG( IsOpened(), _T("key should be opened in GetKeyInfo") ); + wxASSERT_MSG( IsOpened(), wxT("key should be opened in GetKeyInfo") ); m_dwLastError = ::RegQueryInfoKey ( @@ -534,7 +534,7 @@ bool wxRegKey::CopyValue(const wxString& szValue, bool wxRegKey::Rename(const wxString& szNewName) { - wxCHECK_MSG( !m_strKey.empty(), false, _T("registry hives can't be renamed") ); + wxCHECK_MSG( !m_strKey.empty(), false, wxT("registry hives can't be renamed") ); if ( !Exists() ) { wxLogError(_("Registry key '%s' does not exist, cannot rename it."), @@ -956,7 +956,7 @@ bool wxRegKey::QueryValue(const wxString& szValue, if ( !ok ) { - wxLogLastError(_T("ExpandEnvironmentStrings")); + wxLogLastError(wxT("ExpandEnvironmentStrings")); } } #endif @@ -1161,7 +1161,7 @@ bool wxRegKey::Export(const wxString& filename) const return false; } - wxFFileOutputStream ostr(filename, _T("w")); + wxFFileOutputStream ostr(filename, wxT("w")); return ostr.Ok() && Export(ostr); #else @@ -1187,13 +1187,13 @@ FormatAsHex(const void *data, size_t size, wxRegKey::ValueType type = wxRegKey::Type_Binary) { - wxString value(_T("hex")); + wxString value(wxT("hex")); // binary values use just "hex:" prefix while the other ones must indicate // the real type if ( type != wxRegKey::Type_Binary ) - value << _T('(') << type << _T(')'); - value << _T(':'); + value << wxT('(') << type << wxT(')'); + value << wxT(':'); // write all the rest as comma-separated bytes value.reserve(3*size + 10); @@ -1204,9 +1204,9 @@ FormatAsHex(const void *data, // the generated files easier to read and compare with the files // produced by regedit if ( n ) - value << _T(','); + value << wxT(','); - value << wxString::Format(_T("%02x"), (unsigned char)p[n]); + value << wxString::Format(wxT("%02x"), (unsigned char)p[n]); } return value; @@ -1233,7 +1233,7 @@ wxString wxRegKey::FormatValue(const wxString& name) const // quotes and backslashes must be quoted, linefeeds are not // allowed in string values rhs.reserve(value.length() + 2); - rhs = _T('"'); + rhs = wxT('"'); // there can be no NULs here bool useHex = false; @@ -1242,15 +1242,15 @@ wxString wxRegKey::FormatValue(const wxString& name) const { switch ( (*p).GetValue() ) { - case _T('\n'): + case wxT('\n'): // we can only represent this string in hex useHex = true; break; - case _T('"'): - case _T('\\'): + case wxT('"'): + case wxT('\\'): // escape special symbol - rhs += _T('\\'); + rhs += wxT('\\'); // fall through default: @@ -1261,7 +1261,7 @@ wxString wxRegKey::FormatValue(const wxString& name) const if ( useHex ) rhs = FormatAsHex(value, Type_String); else - rhs += _T('"'); + rhs += wxT('"'); } break; @@ -1272,7 +1272,7 @@ wxString wxRegKey::FormatValue(const wxString& name) const if ( !QueryValue(name, &value) ) break; - rhs.Printf(_T("dword:%08x"), (unsigned int)value); + rhs.Printf(wxT("dword:%08x"), (unsigned int)value); } break; diff --git a/src/msw/scrolbar.cpp b/src/msw/scrolbar.cpp index a3868bbb02..c9830b7754 100644 --- a/src/msw/scrolbar.cpp +++ b/src/msw/scrolbar.cpp @@ -131,7 +131,7 @@ bool wxScrollBar::MSWOnScroll(int WXUNUSED(orientation), WXWORD wParam, if ( !::GetScrollInfo(GetHwnd(), SB_CTL, &scrollInfo) ) { - wxLogLastError(_T("GetScrollInfo")); + wxLogLastError(wxT("GetScrollInfo")); } trackPos = scrollInfo.nTrackPos; @@ -255,7 +255,7 @@ int wxScrollBar::GetThumbPosition(void) const if ( !::GetScrollInfo(GetHwnd(), SB_CTL, &scrollInfo) ) { - wxLogLastError(_T("GetScrollInfo")); + wxLogLastError(wxT("GetScrollInfo")); } return scrollInfo.nPos; // return ::GetScrollPos((HWND)m_hWnd, SB_CTL); diff --git a/src/msw/settings.cpp b/src/msw/settings.cpp index e627033416..9925692052 100644 --- a/src/msw/settings.cpp +++ b/src/msw/settings.cpp @@ -192,7 +192,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) unsigned int n = index - wxSYS_COLOUR_BTNHIGHLIGHT; wxASSERT_MSG( n < WXSIZEOF(s_defaultSysColors), - _T("forgot tp update the default colours array") ); + wxT("forgot tp update the default colours array") ); colSys = s_defaultSysColors[n]; hasCol = true; @@ -248,12 +248,12 @@ wxFont wxCreateFontFromStockObject(int index) } else { - wxFAIL_MSG( _T("failed to get LOGFONT") ); + wxFAIL_MSG( wxT("failed to get LOGFONT") ); } } else // GetStockObject() failed { - wxFAIL_MSG( _T("stock font not found") ); + wxFAIL_MSG( wxT("stock font not found") ); } return font; @@ -406,7 +406,7 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w return 0; #else // !__WXMICROWIN__ wxCHECK_MSG( index > 0 && (size_t)index < WXSIZEOF(gs_metricsMap), 0, - _T("invalid metric") ); + wxT("invalid metric") ); if ( index == wxSYS_DCLICK_MSEC ) { @@ -444,7 +444,7 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) return ::GetSystemMetrics(SM_TABLETPC) != 0; default: - wxFAIL_MSG( _T("unknown system feature") ); + wxFAIL_MSG( wxT("unknown system feature") ); return false; } @@ -496,7 +496,7 @@ extern wxFont wxGetCCDefaultFont() } else { - wxLogLastError(_T("SystemParametersInfo(SPI_GETICONTITLELOGFONT")); + wxLogLastError(wxT("SystemParametersInfo(SPI_GETICONTITLELOGFONT")); } } #endif // __WXWINCE__ diff --git a/src/msw/slider.cpp b/src/msw/slider.cpp index 5eabd63b7d..275f2bb909 100644 --- a/src/msw/slider.cpp +++ b/src/msw/slider.cpp @@ -183,7 +183,7 @@ wxSlider::Create(wxWindow *parent, }; wxASSERT_MSG( !(style & wxSL_VERTICAL) || !(style & wxSL_HORIZONTAL), - _T("incompatible slider direction and orientation") ); + wxT("incompatible slider direction and orientation") ); // initialize everything diff --git a/src/msw/snglinst.cpp b/src/msw/snglinst.cpp index d1e8490ede..8f69ec5698 100644 --- a/src/msw/snglinst.cpp +++ b/src/msw/snglinst.cpp @@ -55,7 +55,7 @@ public: m_hMutex = ::CreateMutex(NULL, FALSE, name.t_str()); if ( !m_hMutex ) { - wxLogLastError(_T("CreateMutex")); + wxLogLastError(wxT("CreateMutex")); return false; } @@ -69,7 +69,7 @@ public: bool WasOpened() const { wxCHECK_MSG( m_hMutex, false, - _T("can't be called if mutex creation failed") ); + wxT("can't be called if mutex creation failed") ); return m_wasOpened; } @@ -80,7 +80,7 @@ public: { if ( !::CloseHandle(m_hMutex) ) { - wxLogLastError(_T("CloseHandle(mutex)")); + wxLogLastError(wxT("CloseHandle(mutex)")); } } } @@ -103,10 +103,10 @@ bool wxSingleInstanceChecker::Create(const wxString& name, const wxString& WXUNUSED(path)) { wxASSERT_MSG( !m_impl, - _T("calling wxSingleInstanceChecker::Create() twice?") ); + wxT("calling wxSingleInstanceChecker::Create() twice?") ); // creating unnamed mutex doesn't have the same semantics! - wxASSERT_MSG( !name.empty(), _T("mutex name can't be empty") ); + wxASSERT_MSG( !name.empty(), wxT("mutex name can't be empty") ); m_impl = new wxSingleInstanceCheckerImpl; @@ -115,7 +115,7 @@ bool wxSingleInstanceChecker::Create(const wxString& name, bool wxSingleInstanceChecker::IsAnotherRunning() const { - wxCHECK_MSG( m_impl, false, _T("must call Create() first") ); + wxCHECK_MSG( m_impl, false, wxT("must call Create() first") ); // if the mutex had been opened, another instance is running - otherwise we // would have created it diff --git a/src/msw/sockmsw.cpp b/src/msw/sockmsw.cpp index bfac07191c..96b354fa30 100644 --- a/src/msw/sockmsw.cpp +++ b/src/msw/sockmsw.cpp @@ -211,9 +211,9 @@ bool wxSocketMSWManager::OnInit() // dependencies on it for all the application using wx even if they don't use // sockets #ifdef __WXWINCE__ - #define WINSOCK_DLL_NAME _T("ws2.dll") + #define WINSOCK_DLL_NAME wxT("ws2.dll") #else - #define WINSOCK_DLL_NAME _T("wsock32.dll") + #define WINSOCK_DLL_NAME wxT("wsock32.dll") #endif gs_wsock32dll.Load(WINSOCK_DLL_NAME, wxDL_VERBATIM | wxDL_QUIET); diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index 4ca50327cc..60238bdf76 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -207,7 +207,7 @@ wxSpinCtrl *wxSpinCtrl::GetSpinForTextCtrl(WXHWND hwndBuddy) // sanity check wxASSERT_MSG( spin->m_hwndBuddy == hwndBuddy, - _T("wxSpinCtrl has incorrect buddy HWND!") ); + wxT("wxSpinCtrl has incorrect buddy HWND!") ); return spin; } @@ -359,7 +359,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, sizeText.x -= sizeBtn.x + MARGIN_BETWEEN; if ( sizeText.x <= 0 ) { - wxLogDebug(_T("not enough space for wxSpinCtrl!")); + wxLogDebug(wxT("not enough space for wxSpinCtrl!")); } wxPoint posBtn(pos); @@ -376,7 +376,7 @@ bool wxSpinCtrl::Create(wxWindow *parent, m_hwndBuddy = (WXHWND)::CreateWindowEx ( exStyle, // sunken border - _T("EDIT"), // window class + wxT("EDIT"), // window class NULL, // no window title msStyle, // style (will be shown later) pos.x, pos.y, // position @@ -493,7 +493,7 @@ void wxSpinCtrl::SetValue(int val) // to leave it like this, while we really want to always show the // current value in the control, so do it manually ::SetWindowText(GetBuddyHwnd(), - wxString::Format(_T("%d"), val).wx_str()); + wxString::Format(wxT("%d"), val).wx_str()); } m_oldValue = GetValue(); @@ -709,7 +709,7 @@ void wxSpinCtrl::DoMoveWindow(int x, int y, int width, int height) int widthText = width - widthBtn - MARGIN_BETWEEN; if ( widthText <= 0 ) { - wxLogDebug(_T("not enough space for wxSpinCtrl!")); + wxLogDebug(wxT("not enough space for wxSpinCtrl!")); } // 1) The buddy window diff --git a/src/msw/stackwalk.cpp b/src/msw/stackwalk.cpp index 1b96e364d2..54802e4c24 100644 --- a/src/msw/stackwalk.cpp +++ b/src/msw/stackwalk.cpp @@ -68,7 +68,7 @@ void wxStackFrame::OnGetName() pSymbol ) ) { - wxDbgHelpDLL::LogError(_T("SymFromAddr")); + wxDbgHelpDLL::LogError(wxT("SymFromAddr")); return; } @@ -96,7 +96,7 @@ void wxStackFrame::OnGetLocation() { // it is normal that we don't have source info for some symbols, // notably all the ones from the system DLLs... - //wxDbgHelpDLL::LogError(_T("SymGetLineFromAddr")); + //wxDbgHelpDLL::LogError(wxT("SymGetLineFromAddr")); return; } @@ -190,7 +190,7 @@ void wxStackFrame::OnGetParam() // address, this is not a real error if ( ::GetLastError() != ERROR_INVALID_ADDRESS ) { - wxDbgHelpDLL::LogError(_T("SymSetContext")); + wxDbgHelpDLL::LogError(wxT("SymSetContext")); } return; @@ -205,7 +205,7 @@ void wxStackFrame::OnGetParam() this // data to pass to it ) ) { - wxDbgHelpDLL::LogError(_T("SymEnumSymbols")); + wxDbgHelpDLL::LogError(wxT("SymEnumSymbols")); } } @@ -221,7 +221,7 @@ void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip, size_t maxDepth) // don't log a user-visible error message here because the stack trace // is only needed for debugging/diagnostics anyhow and we shouldn't // confuse the user by complaining that we couldn't generate it - wxLogDebug(_T("Failed to get stack backtrace: %s"), + wxLogDebug(wxT("Failed to get stack backtrace: %s"), wxDbgHelpDLL::GetErrorMessage().c_str()); return; } @@ -240,7 +240,7 @@ void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip, size_t maxDepth) TRUE // load symbols for all loaded modules ) ) { - wxDbgHelpDLL::LogError(_T("SymInitialize")); + wxDbgHelpDLL::LogError(wxT("SymInitialize")); return; } @@ -284,7 +284,7 @@ void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip, size_t maxDepth) ) ) { if ( ::GetLastError() ) - wxDbgHelpDLL::LogError(_T("StackWalk")); + wxDbgHelpDLL::LogError(wxT("StackWalk")); break; } @@ -305,7 +305,7 @@ void wxStackWalker::WalkFrom(const CONTEXT *pCtx, size_t skip, size_t maxDepth) #if 0 if ( !wxDbgHelpDLL::SymCleanup(hProcess) ) { - wxDbgHelpDLL::LogError(_T("SymCleanup")); + wxDbgHelpDLL::LogError(wxT("SymCleanup")); } #endif } @@ -322,7 +322,7 @@ void wxStackWalker::WalkFromException(size_t maxDepth) extern EXCEPTION_POINTERS *wxGlobalSEInformation; wxCHECK_RET( wxGlobalSEInformation, - _T("wxStackWalker::WalkFromException() can only be called from wxApp::OnFatalException()") ); + wxT("wxStackWalker::WalkFromException() can only be called from wxApp::OnFatalException()") ); // don't skip any frames, the first one is where we crashed WalkFrom(wxGlobalSEInformation, 0, maxDepth); diff --git a/src/msw/statbmp.cpp b/src/msw/statbmp.cpp index 418541bfd9..4a460f8816 100644 --- a/src/msw/statbmp.cpp +++ b/src/msw/statbmp.cpp @@ -119,7 +119,7 @@ static wxGDIImage* ConvertImage( const wxGDIImage& bitmap ) if( !isIcon ) { wxASSERT_MSG( wxDynamicCast(&bitmap, wxBitmap), - _T("not an icon and not a bitmap?") ); + wxT("not an icon and not a bitmap?") ); const wxBitmap& bmp = (const wxBitmap&)bitmap; wxMask *mask = bmp.GetMask(); @@ -158,7 +158,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, m_isIcon = image->IsKindOf( CLASSINFO(wxIcon) ); // create the native control - if ( !MSWCreateControl(_T("STATIC"), wxEmptyString, pos, size) ) + if ( !MSWCreateControl(wxT("STATIC"), wxEmptyString, pos, size) ) { // control creation failed return false; @@ -211,10 +211,10 @@ bool wxStaticBitmap::ImageIsOk() const wxIcon wxStaticBitmap::GetIcon() const { - wxCHECK_MSG( m_image, wxIcon(), _T("no image in wxStaticBitmap") ); + wxCHECK_MSG( m_image, wxIcon(), wxT("no image in wxStaticBitmap") ); // we can't ask for an icon if all we have is a bitmap - wxCHECK_MSG( m_isIcon, wxIcon(), _T("no icon in this wxStaticBitmap") ); + wxCHECK_MSG( m_isIcon, wxIcon(), wxT("no icon in this wxStaticBitmap") ); return *(wxIcon *)m_image; } @@ -231,7 +231,7 @@ wxBitmap wxStaticBitmap::GetBitmap() const } else // we have a bitmap { - wxCHECK_MSG( m_image, wxBitmap(), _T("no image in wxStaticBitmap") ); + wxCHECK_MSG( m_image, wxBitmap(), wxT("no image in wxStaticBitmap") ); return *(wxBitmap *)m_image; } diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index 14cb7674eb..18abded044 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -259,7 +259,7 @@ SubtractRectFromRgn(HRGN hrgn, int left, int top, int right, int bottom) AutoHRGN hrgnRect(::CreateRectRgn(left, top, right, bottom)); if ( !hrgnRect ) { - wxLogLastError(_T("CreateRectRgn()")); + wxLogLastError(wxT("CreateRectRgn()")); return; } diff --git a/src/msw/statline.cpp b/src/msw/statline.cpp index 4c902f5398..24cd55c91c 100644 --- a/src/msw/statline.cpp +++ b/src/msw/statline.cpp @@ -108,7 +108,7 @@ bool wxStaticLine::Create(wxWindow *parent, if ( !CreateControl(parent, id, pos, size, style, wxDefaultValidator, name) ) return false; - return MSWCreateControl(_T("STATIC"), wxEmptyString, pos, size); + return MSWCreateControl(wxT("STATIC"), wxEmptyString, pos, size); } WXDWORD wxStaticLine::MSWGetStyle(long style, WXDWORD *exstyle) const diff --git a/src/msw/statusbar.cpp b/src/msw/statusbar.cpp index cf1d0e7bf1..72da7d9980 100644 --- a/src/msw/statusbar.cpp +++ b/src/msw/statusbar.cpp @@ -108,7 +108,7 @@ bool wxStatusBar::Create(wxWindow *parent, m_hWnd = CreateWindow ( STATUSCLASSNAME, - _T(""), + wxT(""), wstyle, 0, 0, 0, 0, GetHwndOf(parent), diff --git a/src/msw/stdpaths.cpp b/src/msw/stdpaths.cpp index 4f2cfd65c5..579844fad0 100644 --- a/src/msw/stdpaths.cpp +++ b/src/msw/stdpaths.cpp @@ -50,7 +50,7 @@ typedef HRESULT (WINAPI *SHGetSpecialFolderPath_t)(HWND, LPTSTR, int, BOOL); // ---------------------------------------------------------------------------- // used in our wxLogTrace messages -#define TRACE_MASK _T("stdpaths") +#define TRACE_MASK wxT("stdpaths") #ifndef CSIDL_APPDATA #define CSIDL_APPDATA 0x001a @@ -117,16 +117,16 @@ void ResolveShellFunctions() // start with the newest functions, fall back to the oldest ones #ifdef __WXWINCE__ - wxString shellDllName(_T("coredll")); + wxString shellDllName(wxT("coredll")); #else // first check for SHGetFolderPath (shell32.dll 5.0) - wxString shellDllName(_T("shell32")); + wxString shellDllName(wxT("shell32")); #endif wxDynamicLibrary dllShellFunctions( shellDllName ); if ( !dllShellFunctions.IsLoaded() ) { - wxLogTrace(TRACE_MASK, _T("Failed to load %s.dll"), shellDllName.c_str() ); + wxLogTrace(TRACE_MASK, wxT("Failed to load %s.dll"), shellDllName.c_str() ); } // don't give errors if the functions are unavailable, we're ready to deal @@ -143,14 +143,14 @@ void ResolveShellFunctions() static const char UNICODE_SUFFIX = 'A'; #endif // Unicode/!Unicode - wxString funcname(_T("SHGetFolderPath")); + wxString funcname(wxT("SHGetFolderPath")); gs_shellFuncs.pSHGetFolderPath = (SHGetFolderPath_t)dllShellFunctions.GetSymbol(funcname + UNICODE_SUFFIX); // then for SHGetSpecialFolderPath (shell32.dll 4.71) if ( !gs_shellFuncs.pSHGetFolderPath ) { - funcname = _T("SHGetSpecialFolderPath"); + funcname = wxT("SHGetSpecialFolderPath"); gs_shellFuncs.pSHGetSpecialFolderPath = (SHGetSpecialFolderPath_t) dllShellFunctions.GetSymbol(funcname + UNICODE_SUFFIX); } @@ -385,7 +385,7 @@ wxString wxStandardPathsWin16::GetConfigDir() const #ifndef __WXWINCE__ if ( !::GetWindowsDirectory(wxStringBuffer(dir, MAX_PATH), MAX_PATH) ) { - wxLogLastError(_T("GetWindowsDirectory")); + wxLogLastError(wxT("GetWindowsDirectory")); } #else // TODO: use CSIDL_WINDOWS (eVC4, possibly not eVC3) diff --git a/src/msw/taskbar.cpp b/src/msw/taskbar.cpp index 0d7dd2a119..a064e5df9e 100644 --- a/src/msw/taskbar.cpp +++ b/src/msw/taskbar.cpp @@ -223,7 +223,7 @@ wxTaskBarIcon::ShowBalloon(const wxString& title, int flags) { wxCHECK_MSG( m_iconAdded, false, - _T("can't be used before the icon is created") ); + wxT("can't be used before the icon is created") ); const HWND hwnd = GetHwndOf(m_win); @@ -285,7 +285,7 @@ bool wxTaskBarIcon::RemoveIcon() #if wxUSE_MENUS bool wxTaskBarIcon::PopupMenu(wxMenu *menu) { - wxASSERT_MSG( m_win != NULL, _T("taskbar icon not initialized") ); + wxASSERT_MSG( m_win != NULL, wxT("taskbar icon not initialized") ); static bool s_inPopup = false; diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index e6a2500f05..6839a70425 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -147,7 +147,7 @@ public: : m_count(count) { wxASSERT_MSG( m_count == -1 || m_count == -2, - _T("wrong initial m_updatesCount value") ); + wxT("wrong initial m_updatesCount value") ); if (m_count != -2) m_count = 0; @@ -433,15 +433,15 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, if ( wxRichEditModule::Load(wxRichEditModule::Version_41) ) { // yes, class name for version 4.1 really is 5.0 - windowClass = _T("RICHEDIT50W"); + windowClass = wxT("RICHEDIT50W"); } else if ( wxRichEditModule::Load(wxRichEditModule::Version_2or3) ) { - windowClass = _T("RichEdit20") + windowClass = wxT("RichEdit20") #if wxUSE_UNICODE - _T("W"); + wxT("W"); #else // ANSI - _T("A"); + wxT("A"); #endif // Unicode/ANSI } else // failed to load msftedit.dll and riched20.dll @@ -454,7 +454,7 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, { if ( wxRichEditModule::Load(wxRichEditModule::Version_1) ) { - windowClass = _T("RICHEDIT"); + windowClass = wxT("RICHEDIT"); } else // failed to load any richedit control DLL { @@ -569,16 +569,16 @@ void wxTextCtrl::AdoptAttributesFromHWND() #if wxUSE_RICHEDIT wxString classname = wxGetWindowClass(GetHWND()); - if ( classname.IsSameAs(_T("EDIT"), false /* no case */) ) + if ( classname.IsSameAs(wxT("EDIT"), false /* no case */) ) { m_verRichEdit = 0; } else // rich edit? { wxChar c; - if ( wxSscanf(classname, _T("RichEdit%d0%c"), &m_verRichEdit, &c) != 2 ) + if ( wxSscanf(classname, wxT("RichEdit%d0%c"), &m_verRichEdit, &c) != 2 ) { - wxLogDebug(_T("Unknown edit control '%s'."), classname.c_str()); + wxLogDebug(wxT("Unknown edit control '%s'."), classname.c_str()); m_verRichEdit = 0; } @@ -843,8 +843,8 @@ wxString wxTextCtrl::GetRange(long from, long to) const // style - convert it to something reasonable for ( ; *p; p++ ) { - if ( *p == _T('\r') ) - *p = _T('\n'); + if ( *p == wxT('\r') ) + *p = wxT('\n'); } } } @@ -1018,11 +1018,11 @@ wxTextCtrl::StreamIn(const wxString& value, // It's okay for EN_UPDATE to not be sent if the selection is empty and // the text is empty, otherwise warn the programmer about it. wxASSERT_MSG( ucf.GotUpdate() || ( !HasSelection() && value.empty() ), - _T("EM_STREAMIN didn't send EN_UPDATE?") ); + wxT("EM_STREAMIN didn't send EN_UPDATE?") ); if ( eds.dwError ) { - wxLogLastError(_T("EM_STREAMIN")); + wxLogLastError(wxT("EM_STREAMIN")); } #if !wxUSE_WCHAR_T @@ -1068,7 +1068,7 @@ wxTextCtrl::StreamOut(wxFontEncoding encoding, bool selectionOnly) const if ( eds.dwError ) { - wxLogLastError(_T("EM_STREAMOUT")); + wxLogLastError(wxT("EM_STREAMOUT")); } else // streamed out ok { @@ -1621,24 +1621,24 @@ wxString wxTextCtrl::GetLineText(long lineNo) const { // remove the '\r' returned by the rich edit control, the user code // should never see it - if ( buf[len - 2] == _T('\r') && buf[len - 1] == _T('\n') ) + if ( buf[len - 2] == wxT('\r') && buf[len - 1] == wxT('\n') ) { // richedit 1.0 uses "\r\n" as line terminator, so remove "\r" // here and "\n" below - buf[len - 2] = _T('\n'); + buf[len - 2] = wxT('\n'); len--; } - else if ( buf[len - 1] == _T('\r') ) + else if ( buf[len - 1] == wxT('\r') ) { // richedit 2.0+ uses only "\r", replace it with "\n" - buf[len - 1] = _T('\n'); + buf[len - 1] = wxT('\n'); } } #endif // wxUSE_RICHEDIT // remove the '\n' at the end, if any (this is how this function is // supposed to work according to the docs) - if ( buf[len - 1] == _T('\n') ) + if ( buf[len - 1] == wxT('\n') ) { len--; } @@ -1759,7 +1759,7 @@ bool wxTextCtrl::MSWShouldPreProcessMessage(WXMSG* msg) switch ( ctrl + shift ) { default: - wxFAIL_MSG( _T("how many modifiers have we got?") ); + wxFAIL_MSG( wxT("how many modifiers have we got?") ); // fall through case 0: @@ -1951,7 +1951,7 @@ bool wxTextCtrl::SendUpdateEvent() return false; default: - wxFAIL_MSG( _T("unexpected wxTextCtrl::m_updatesCount value") ); + wxFAIL_MSG( wxT("unexpected wxTextCtrl::m_updatesCount value") ); // fall through case -1: @@ -2492,7 +2492,7 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) SCF_SELECTION, (LPARAM)&cf) != 0; if ( !ok ) { - wxLogDebug(_T("SendMessage(EM_SETCHARFORMAT, SCF_SELECTION) failed")); + wxLogDebug(wxT("SendMessage(EM_SETCHARFORMAT, SCF_SELECTION) failed")); } // now do the paragraph formatting @@ -2577,7 +2577,7 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) 0, (LPARAM) &pf) != 0; if ( !ok ) { - wxLogDebug(_T("SendMessage(EM_SETPARAFORMAT, 0) failed")); + wxLogDebug(wxT("SendMessage(EM_SETPARAFORMAT, 0) failed")); } } @@ -2798,9 +2798,9 @@ bool wxRichEditModule::Load(Version version) static const wxChar *dllnames[] = { - _T("riched32"), - _T("riched20"), - _T("msftedit"), + wxT("riched32"), + wxT("riched20"), + wxT("msftedit"), }; wxCOMPILE_TIME_ASSERT( WXSIZEOF(dllnames) == Version_Max, diff --git a/src/msw/textentry.cpp b/src/msw/textentry.cpp index a204d577f4..672058b8fd 100644 --- a/src/msw/textentry.cpp +++ b/src/msw/textentry.cpp @@ -311,7 +311,7 @@ bool wxTextEntry::AutoCompleteFileNames() static wxDynamicLibrary s_dllShlwapi; if ( s_pfnSHAutoComplete == (SHAutoComplete_t)-1 ) { - if ( !s_dllShlwapi.Load(_T("shlwapi.dll"), wxDL_VERBATIM | wxDL_QUIET) ) + if ( !s_dllShlwapi.Load(wxT("shlwapi.dll"), wxDL_VERBATIM | wxDL_QUIET) ) { s_pfnSHAutoComplete = NULL; } @@ -327,7 +327,7 @@ bool wxTextEntry::AutoCompleteFileNames() HRESULT hr = (*s_pfnSHAutoComplete)(GetEditHwnd(), SHACF_FILESYS_ONLY); if ( FAILED(hr) ) { - wxLogApiError(_T("SHAutoComplete()"), hr); + wxLogApiError(wxT("SHAutoComplete()"), hr); return false; } @@ -363,7 +363,7 @@ bool wxTextEntry::AutoComplete(const wxArrayString& choices) ); if ( FAILED(hr) ) { - wxLogApiError(_T("CoCreateInstance(CLSID_AutoComplete)"), hr); + wxLogApiError(wxT("CoCreateInstance(CLSID_AutoComplete)"), hr); return false; } @@ -374,7 +374,7 @@ bool wxTextEntry::AutoComplete(const wxArrayString& choices) m_enumStrings->Release(); if ( FAILED(hr) ) { - wxLogApiError(_T("IAutoComplete::Init"), hr); + wxLogApiError(wxT("IAutoComplete::Init"), hr); return false; } diff --git a/src/msw/tglbtn.cpp b/src/msw/tglbtn.cpp index 41a518ba0e..0ae12ccdf3 100644 --- a/src/msw/tglbtn.cpp +++ b/src/msw/tglbtn.cpp @@ -273,7 +273,7 @@ bool wxToggleButton::Create(wxWindow *parent, WXDWORD msStyle = MSWGetStyle(style, &exstyle); msStyle |= wxMSWButton::GetMultilineStyle(label); - return MSWCreateControl(_T("BUTTON"), msStyle, pos, size, label, exstyle); + return MSWCreateControl(wxT("BUTTON"), msStyle, pos, size, label, exstyle); } WXDWORD wxToggleButton::MSWGetStyle(long style, WXDWORD *exstyle) const diff --git a/src/msw/thread.cpp b/src/msw/thread.cpp index 36fbedc4c5..75c4854bac 100644 --- a/src/msw/thread.cpp +++ b/src/msw/thread.cpp @@ -212,7 +212,7 @@ wxMutexInternal::wxMutexInternal(wxMutexType mutexType) if ( !m_mutex ) { - wxLogLastError(_T("CreateMutex()")); + wxLogLastError(wxT("CreateMutex()")); } } @@ -223,7 +223,7 @@ wxMutexInternal::~wxMutexInternal() { if ( !::CloseHandle(m_mutex) ) { - wxLogLastError(_T("CloseHandle(mutex)")); + wxLogLastError(wxT("CloseHandle(mutex)")); } } } @@ -254,7 +254,7 @@ wxMutexError wxMutexInternal::LockTimeout(DWORD milliseconds) case WAIT_ABANDONED: // the previous caller died without releasing the mutex, so even // though we did get it, log a message about this - wxLogDebug(_T("WaitForSingleObject() returned WAIT_ABANDONED")); + wxLogDebug(wxT("WaitForSingleObject() returned WAIT_ABANDONED")); // fall through case WAIT_OBJECT_0: @@ -269,7 +269,7 @@ wxMutexError wxMutexInternal::LockTimeout(DWORD milliseconds) // fall through case WAIT_FAILED: - wxLogLastError(_T("WaitForSingleObject(mutex)")); + wxLogLastError(wxT("WaitForSingleObject(mutex)")); return wxMUTEX_MISC_ERROR; } @@ -289,7 +289,7 @@ wxMutexError wxMutexInternal::Unlock() if ( !::ReleaseMutex(m_mutex) ) { - wxLogLastError(_T("ReleaseMutex()")); + wxLogLastError(wxT("ReleaseMutex()")); return wxMUTEX_MISC_ERROR; } @@ -350,7 +350,7 @@ wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount) #endif if ( !m_semaphore ) { - wxLogLastError(_T("CreateSemaphore()")); + wxLogLastError(wxT("CreateSemaphore()")); } } @@ -360,7 +360,7 @@ wxSemaphoreInternal::~wxSemaphoreInternal() { if ( !::CloseHandle(m_semaphore) ) { - wxLogLastError(_T("CloseHandle(semaphore)")); + wxLogLastError(wxT("CloseHandle(semaphore)")); } } } @@ -378,7 +378,7 @@ wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long milliseconds) return wxSEMA_TIMEOUT; default: - wxLogLastError(_T("WaitForSingleObject(semaphore)")); + wxLogLastError(wxT("WaitForSingleObject(semaphore)")); } return wxSEMA_MISC_ERROR; @@ -395,7 +395,7 @@ wxSemaError wxSemaphoreInternal::Post() } else { - wxLogLastError(_T("ReleaseSemaphore")); + wxLogLastError(wxT("ReleaseSemaphore")); return wxSEMA_MISC_ERROR; } } @@ -634,7 +634,7 @@ void wxThreadInternal::SetPriority(unsigned int priority) bool wxThreadInternal::Create(wxThread *thread, unsigned int stackSize) { wxASSERT_MSG( m_state == STATE_NEW && !m_hThread, - _T("Create()ing thread twice?") ); + wxT("Create()ing thread twice?") ); // for compilers which have it, we should use C RTL function for thread // creation instead of Win32 API one because otherwise we will have memory @@ -951,7 +951,7 @@ bool wxThread::SetConcurrency(size_t WXUNUSED_IN_WINCE(level)) #ifdef __WXWINCE__ return false; #else - wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") ); + wxASSERT_MSG( IsMain(), wxT("should only be called from the main thread") ); // ok only for the default one if ( level == 0 ) @@ -962,7 +962,7 @@ bool wxThread::SetConcurrency(size_t WXUNUSED_IN_WINCE(level)) DWORD_PTR dwProcMask, dwSysMask; if ( ::GetProcessAffinityMask(hProcess, &dwProcMask, &dwSysMask) == 0 ) { - wxLogLastError(_T("GetProcessAffinityMask")); + wxLogLastError(wxT("GetProcessAffinityMask")); return false; } @@ -1001,7 +1001,7 @@ bool wxThread::SetConcurrency(size_t WXUNUSED_IN_WINCE(level)) // could we set all bits? if ( level != 0 ) { - wxLogDebug(_T("bad level %u in wxThread::SetConcurrency()"), level); + wxLogDebug(wxT("bad level %u in wxThread::SetConcurrency()"), level); return false; } @@ -1016,7 +1016,7 @@ bool wxThread::SetConcurrency(size_t WXUNUSED_IN_WINCE(level)) if ( !pfnSetProcessAffinityMask ) { - HMODULE hModKernel = ::LoadLibrary(_T("kernel32")); + HMODULE hModKernel = ::LoadLibrary(wxT("kernel32")); if ( hModKernel ) { pfnSetProcessAffinityMask = (SETPROCESSAFFINITYMASK) @@ -1025,7 +1025,7 @@ bool wxThread::SetConcurrency(size_t WXUNUSED_IN_WINCE(level)) // we've discovered a MT version of Win9x! wxASSERT_MSG( pfnSetProcessAffinityMask, - _T("this system has several CPUs but no SetProcessAffinityMask function?") ); + wxT("this system has several CPUs but no SetProcessAffinityMask function?") ); } if ( !pfnSetProcessAffinityMask ) @@ -1036,7 +1036,7 @@ bool wxThread::SetConcurrency(size_t WXUNUSED_IN_WINCE(level)) if ( pfnSetProcessAffinityMask(hProcess, dwProcMask) == 0 ) { - wxLogLastError(_T("SetProcessAffinityMask")); + wxLogLastError(wxT("SetProcessAffinityMask")); return false; } @@ -1114,7 +1114,7 @@ wxThread::ExitCode wxThread::Wait() // although under Windows we can wait for any thread, it's an error to // wait for a detached one in wxWin API wxCHECK_MSG( !IsDetached(), rc, - _T("wxThread::Wait(): can't wait for detached thread") ); + wxT("wxThread::Wait(): can't wait for detached thread") ); (void)m_internal->WaitForTerminate(m_critsect, &rc); diff --git a/src/msw/timer.cpp b/src/msw/timer.cpp index 9442d09a5b..0db65998b1 100644 --- a/src/msw/timer.cpp +++ b/src/msw/timer.cpp @@ -144,7 +144,7 @@ bool wxMSWTimerImpl::Start(int milliseconds, bool oneShot) void wxMSWTimerImpl::Stop() { - wxASSERT_MSG( m_id, _T("should be running") ); + wxASSERT_MSG( m_id, wxT("should be running") ); ::KillTimer(wxTimerHiddenWindowModule::GetHWND(), m_id); @@ -159,7 +159,7 @@ void wxMSWTimerImpl::Stop() void wxProcessTimer(wxMSWTimerImpl& timer) { - wxASSERT_MSG( timer.IsRunning(), _T("bogus timer id") ); + wxASSERT_MSG( timer.IsRunning(), wxT("bogus timer id") ); if ( timer.IsOneShot() ) timer.Stop(); @@ -211,7 +211,7 @@ void wxTimerHiddenWindowModule::OnExit() { if ( !::DestroyWindow(ms_hwnd) ) { - wxLogLastError(_T("DestroyWindow(wxTimerHiddenWindow)")); + wxLogLastError(wxT("DestroyWindow(wxTimerHiddenWindow)")); } ms_hwnd = NULL; @@ -221,7 +221,7 @@ void wxTimerHiddenWindowModule::OnExit() { if ( !::UnregisterClass(ms_className, wxGetInstance()) ) { - wxLogLastError(_T("UnregisterClass(\"wxTimerHiddenWindow\")")); + wxLogLastError(wxT("UnregisterClass(\"wxTimerHiddenWindow\")")); } ms_className = NULL; @@ -231,7 +231,7 @@ void wxTimerHiddenWindowModule::OnExit() /* static */ HWND wxTimerHiddenWindowModule::GetHWND() { - static const wxChar *HIDDEN_WINDOW_CLASS = _T("wxTimerHiddenWindow"); + static const wxChar *HIDDEN_WINDOW_CLASS = wxT("wxTimerHiddenWindow"); if ( !ms_hwnd ) { ms_hwnd = wxCreateHiddenWindow(&ms_className, HIDDEN_WINDOW_CLASS, diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 2f5abfd6d2..ba4638e445 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -200,7 +200,7 @@ public: wxStaticText* GetStaticText() { wxASSERT_MSG( IsControl(), - _T("only makes sense for embedded control tools") ); + wxT("only makes sense for embedded control tools") ); return m_staticText; } @@ -361,7 +361,7 @@ void wxToolBar::Recreate() if ( !MSWCreateToolbar(pos, size) ) { // what can we do? - wxFAIL_MSG( _T("recreating the toolbar failed") ); + wxFAIL_MSG( wxT("recreating the toolbar failed") ); return; } @@ -752,7 +752,7 @@ bool wxToolBar::Realize() } else { - wxFAIL_MSG( _T("invalid tool button bitmap") ); + wxFAIL_MSG( wxT("invalid tool button bitmap") ); } // also deal with disabled bitmap if we want to use them @@ -997,7 +997,7 @@ bool wxToolBar::Realize() break; default: - wxFAIL_MSG( _T("unexpected toolbar button kind") ); + wxFAIL_MSG( wxT("unexpected toolbar button kind") ); button.fsStyle = TBSTYLE_BUTTON; break; } @@ -1277,7 +1277,7 @@ bool wxToolBar::MSWOnNotify(int WXUNUSED(idCtrl), } const wxToolBarToolBase * const tool = FindById(tbhdr->iItem); - wxCHECK_MSG( tool, false, _T("drop down message for unknown tool") ); + wxCHECK_MSG( tool, false, wxT("drop down message for unknown tool") ); wxMenu * const menu = tool->GetDropdownMenu(); if ( !menu ) @@ -1490,7 +1490,7 @@ void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(tog { // VZ: AFAIK, the button has to be created either with TBSTYLE_CHECK or // without, so we really need to delete the button and recreate it here - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); } void wxToolBar::SetToolNormalBitmap( int id, const wxBitmap& bitmap ) @@ -1601,7 +1601,7 @@ void wxToolBar::OnEraseBackground(wxEraseEvent& event) // didn't draw anything but no error really occurred if ( FAILED(hr) ) { - wxLogApiError(_T("DrawThemeParentBackground(toolbar)"), hr); + wxLogApiError(wxT("DrawThemeParentBackground(toolbar)"), hr); } } } @@ -1626,7 +1626,7 @@ void wxToolBar::OnEraseBackground(wxEraseEvent& event) // didn't draw anything but no error really occurred if ( FAILED(hr) ) { - wxLogApiError(_T("DrawThemeParentBackground(toolbar)"), hr); + wxLogApiError(wxT("DrawThemeParentBackground(toolbar)"), hr); } } } @@ -1773,7 +1773,7 @@ bool wxToolBar::HandlePaint(WXWPARAM wParam, WXLPARAM lParam) if ( !::SendMessage(GetHwnd(), TB_GETBUTTON, n, (LPARAM)&tbb) ) { - wxLogDebug(_T("TB_GETBUTTON failed?")); + wxLogDebug(wxT("TB_GETBUTTON failed?")); continue; } @@ -1905,7 +1905,7 @@ WXHBITMAP wxToolBar::MapBitmap(WXHBITMAP bitmap, int width, int height) if ( !hdcMem ) { - wxLogLastError(_T("CreateCompatibleDC")); + wxLogLastError(wxT("CreateCompatibleDC")); return bitmap; } @@ -1914,7 +1914,7 @@ WXHBITMAP wxToolBar::MapBitmap(WXHBITMAP bitmap, int width, int height) if ( !bmpInHDC ) { - wxLogLastError(_T("SelectObject")); + wxLogLastError(wxT("SelectObject")); return bitmap; } diff --git a/src/msw/tooltip.cpp b/src/msw/tooltip.cpp index 9f99bec5c8..5f8221238b 100644 --- a/src/msw/tooltip.cpp +++ b/src/msw/tooltip.cpp @@ -244,7 +244,7 @@ void wxToolTip::SetReshow(long milliseconds) void wxToolTip::SetMaxWidth(int width) { - wxASSERT_MSG( width == -1 || width >= 0, _T("invalid width value") ); + wxASSERT_MSG( width == -1 || width >= 0, wxT("invalid width value") ); ms_maxWidth = width; } @@ -370,7 +370,7 @@ void wxToolTip::Add(WXHWND hWnd) if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) ) { - wxLogDebug(_T("Failed to create the tooltip '%s'"), m_text.c_str()); + wxLogDebug(wxT("Failed to create the tooltip '%s'"), m_text.c_str()); return; } @@ -405,7 +405,7 @@ void wxToolTip::Add(WXHWND hWnd) // find the width of the widest line int maxWidth = 0; - wxStringTokenizer tokenizer(m_text, _T("\n")); + wxStringTokenizer tokenizer(m_text, wxT("\n")); while ( tokenizer.HasMoreTokens() ) { const wxString token = tokenizer.GetNextToken(); @@ -452,12 +452,12 @@ void wxToolTip::Add(WXHWND hWnd) { // replace the '\n's with spaces because otherwise they appear as // unprintable characters in the tooltip string - m_text.Replace(_T("\n"), _T(" ")); + m_text.Replace(wxT("\n"), wxT(" ")); ti.lpszText = const_cast(m_text.wx_str()); if ( !SendTooltipMessage(GetToolTipCtrl(), TTM_ADDTOOL, &ti) ) { - wxLogDebug(_T("Failed to create the tooltip '%s'"), m_text.c_str()); + wxLogDebug(wxT("Failed to create the tooltip '%s'"), m_text.c_str()); } } } @@ -493,7 +493,7 @@ void wxToolTip::SetWindow(wxWindow *win) } // must have it by now! - wxASSERT_MSG( hwnd, _T("no hwnd for subcontrol?") ); + wxASSERT_MSG( hwnd, wxT("no hwnd for subcontrol?") ); Add((WXHWND)hwnd); } @@ -524,7 +524,7 @@ void wxToolTip::SetTip(const wxString& tip) // for some reason, changing the tooltip text directly results in // repaint of the controls under it, see #10520 -- but this doesn't // happen if we reset it first - ti.lpszText = const_cast(_T("")); + ti.lpszText = const_cast(wxT("")); (void)SendTooltipMessage(GetToolTipCtrl(), TTM_UPDATETIPTEXT, &ti); ti.lpszText = const_cast(m_text.wx_str()); diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 6407ca753f..274bc888c9 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -288,7 +288,7 @@ WXHWND wxTopLevelWindowMSW::MSWGetParent() const if ( !parent ) { // this flag doesn't make sense then and will be ignored - wxFAIL_MSG( _T("wxFRAME_FLOAT_ON_PARENT but no parent?") ); + wxFAIL_MSG( wxT("wxFRAME_FLOAT_ON_PARENT but no parent?") ); } else { @@ -804,7 +804,7 @@ void wxTopLevelWindowMSW::DoGetPosition(int *x, int *y) const return; } - wxLogLastError(_T("GetWindowPlacement")); + wxLogLastError(wxT("GetWindowPlacement")); } //else: normal case @@ -829,7 +829,7 @@ void wxTopLevelWindowMSW::DoGetSize(int *width, int *height) const return; } - wxLogLastError(_T("GetWindowPlacement")); + wxLogLastError(wxT("GetWindowPlacement")); } //else: normal case @@ -1021,7 +1021,7 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable) MF_BYCOMMAND | (enable ? MF_ENABLED : MF_GRAYED)) == -1 ) { - wxLogLastError(_T("EnableMenuItem(SC_CLOSE)")); + wxLogLastError(wxT("EnableMenuItem(SC_CLOSE)")); return false; } @@ -1029,7 +1029,7 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable) // update appearance immediately if ( !::DrawMenuBar(GetHwnd()) ) { - wxLogLastError(_T("DrawMenuBar")); + wxLogLastError(wxT("DrawMenuBar")); } #endif #endif // !__WXMICROWIN__ @@ -1042,7 +1042,7 @@ bool wxTopLevelWindowMSW::EnableCloseButton(bool enable) bool wxTopLevelWindowMSW::SetShape(const wxRegion& region) { wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, - _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); + wxT("Shaped windows must be created with the wxFRAME_SHAPED style.")); // The empty region signifies that the shape should be removed from the // window. @@ -1050,7 +1050,7 @@ bool wxTopLevelWindowMSW::SetShape(const wxRegion& region) { if (::SetWindowRgn(GetHwnd(), NULL, TRUE) == 0) { - wxLogLastError(_T("SetWindowRgn")); + wxLogLastError(wxT("SetWindowRgn")); return false; } return true; @@ -1077,7 +1077,7 @@ bool wxTopLevelWindowMSW::SetShape(const wxRegion& region) // Now call the shape API with the new region. if (::SetWindowRgn(GetHwnd(), hrgn, TRUE) == 0) { - wxLogLastError(_T("SetWindowRgn")); + wxLogLastError(wxT("SetWindowRgn")); return false; } return true; @@ -1098,9 +1098,9 @@ void wxTopLevelWindowMSW::RequestUserAttention(int flags) static FlashWindowEx_t s_pfnFlashWindowEx = NULL; if ( !s_pfnFlashWindowEx ) { - wxDynamicLibrary dllUser32(_T("user32.dll")); + wxDynamicLibrary dllUser32(wxT("user32.dll")); s_pfnFlashWindowEx = (FlashWindowEx_t) - dllUser32.GetSymbol(_T("FlashWindowEx")); + dllUser32.GetSymbol(wxT("FlashWindowEx")); // we can safely unload user32.dll here, it's going to remain loaded as // long as the program is running anyhow @@ -1145,7 +1145,7 @@ bool wxTopLevelWindowMSW::SetTransparent(wxByte alpha) if ( pSetLayeredWindowAttributes == (PSETLAYEREDWINDOWATTR)-1 ) { - wxDynamicLibrary dllUser32(_T("user32.dll")); + wxDynamicLibrary dllUser32(wxT("user32.dll")); // use RawGetSymbol() and not GetSymbol() to avoid error messages under // Windows 95: there is nothing the user can do about this anyhow @@ -1221,7 +1221,7 @@ void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event) { // restore focus to the child which was last focused unless we already // have it - wxLogTrace(_T("focus"), _T("wxTLW %p activated."), m_hWnd); + wxLogTrace(wxT("focus"), wxT("wxTLW %p activated."), m_hWnd); wxWindow *winFocus = FindFocus(); if ( !winFocus || wxGetTopLevelParent(winFocus) != this ) @@ -1255,8 +1255,8 @@ void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event) } } - wxLogTrace(_T("focus"), - _T("wxTLW %p deactivated, last focused: %p."), + wxLogTrace(wxT("focus"), + wxT("wxTLW %p deactivated, last focused: %p."), m_hWnd, m_winLastFocused ? GetHwndOf(m_winLastFocused) : NULL); @@ -1330,7 +1330,7 @@ void wxTLWHiddenParentModule::OnExit() { if ( !::DestroyWindow(ms_hwnd) ) { - wxLogLastError(_T("DestroyWindow(hidden TLW parent)")); + wxLogLastError(wxT("DestroyWindow(hidden TLW parent)")); } ms_hwnd = NULL; @@ -1340,7 +1340,7 @@ void wxTLWHiddenParentModule::OnExit() { if ( !::UnregisterClass(ms_className, wxGetInstance()) ) { - wxLogLastError(_T("UnregisterClass(\"wxTLWHiddenParent\")")); + wxLogLastError(wxT("UnregisterClass(\"wxTLWHiddenParent\")")); } ms_className = NULL; @@ -1354,7 +1354,7 @@ HWND wxTLWHiddenParentModule::GetHWND() { if ( !ms_className ) { - static const wxChar *HIDDEN_PARENT_CLASS = _T("wxTLWHiddenParent"); + static const wxChar *HIDDEN_PARENT_CLASS = wxT("wxTLWHiddenParent"); WNDCLASS wndclass; wxZeroMemory(wndclass); @@ -1365,7 +1365,7 @@ HWND wxTLWHiddenParentModule::GetHWND() if ( !::RegisterClass(&wndclass) ) { - wxLogLastError(_T("RegisterClass(\"wxTLWHiddenParent\")")); + wxLogLastError(wxT("RegisterClass(\"wxTLWHiddenParent\")")); } else { @@ -1377,7 +1377,7 @@ HWND wxTLWHiddenParentModule::GetHWND() (HMENU)NULL, wxGetInstance(), NULL); if ( !ms_hwnd ) { - wxLogLastError(_T("CreateWindow(hidden TLW parent)")); + wxLogLastError(wxT("CreateWindow(hidden TLW parent)")); } } diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp index cb95300361..776740fa1c 100644 --- a/src/msw/treectrl.cpp +++ b/src/msw/treectrl.cpp @@ -431,7 +431,7 @@ public: break; default: - wxFAIL_MSG( _T("unsupported wxTreeItemIcon value") ); + wxFAIL_MSG( wxT("unsupported wxTreeItemIcon value") ); } } @@ -866,7 +866,7 @@ wxTreeCtrl::GetClassDefaultAttributes(wxWindowVariant variant) bool wxTreeCtrl::DoGetItem(wxTreeViewItem *tvItem) const { wxCHECK_MSG( tvItem->hItem != TVI_ROOT, false, - _T("can't retrieve virtual root item") ); + wxT("can't retrieve virtual root item") ); if ( !TreeView_GetItem(GetHwnd(), tvItem) ) { @@ -1503,7 +1503,7 @@ wxTreeItemId wxTreeCtrl::DoInsertAfter(const wxTreeItemId& parent, { wxCHECK_MSG( parent.IsOk() || !TreeView_GetRoot(GetHwnd()), wxTreeItemId(), - _T("can't have more than one root in the tree") ); + wxT("can't have more than one root in the tree") ); TV_INSERTSTRUCT tvIns; tvIns.hParent = HITEM(parent); @@ -1584,7 +1584,7 @@ wxTreeItemId wxTreeCtrl::AddRoot(const wxString& text, { if ( HasFlag(wxTR_HIDE_ROOT) ) { - wxASSERT_MSG( !m_pVirtualRoot, _T("tree can have only a single root") ); + wxASSERT_MSG( !m_pVirtualRoot, wxT("tree can have only a single root") ); // create a virtual root item, the parent for all the others wxTreeItemParam *param = new wxTreeItemParam; @@ -1625,7 +1625,7 @@ wxTreeItemId wxTreeCtrl::DoInsertItem(const wxTreeItemId& parent, // assert, not check: if the index is invalid, we will append the item // to the end - wxASSERT_MSG( index == 0, _T("bad index in wxTreeCtrl::InsertItem") ); + wxASSERT_MSG( index == 0, wxT("bad index in wxTreeCtrl::InsertItem") ); } return DoInsertAfter(parent, idPrev, text, image, selectedImage, data); @@ -1881,7 +1881,7 @@ void wxTreeCtrl::DoSelectItem(const wxTreeItemId& item, bool select) void wxTreeCtrl::SelectItem(const wxTreeItemId& item, bool select) { - wxCHECK_RET( !IsHiddenRoot(item), _T("can't select hidden root item") ); + wxCHECK_RET( !IsHiddenRoot(item), wxT("can't select hidden root item") ); if ( select == IsSelected(item) ) { @@ -1952,7 +1952,7 @@ void wxTreeCtrl::SelectItem(const wxTreeItemId& item, bool select) void wxTreeCtrl::EnsureVisible(const wxTreeItemId& item) { - wxCHECK_RET( !IsHiddenRoot(item), _T("can't show hidden root item") ); + wxCHECK_RET( !IsHiddenRoot(item), wxT("can't show hidden root item") ); // no error return TreeView_EnsureVisible(GetHwnd(), HITEM(item)); @@ -3499,7 +3499,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) if ( !loaded ) { - wxLoadedDLL dllComCtl32(_T("comctl32.dll")); + wxLoadedDLL dllComCtl32(wxT("comctl32.dll")); if ( dllComCtl32.IsLoaded() ) wxDL_INIT_FUNC(s_pfn, ImageList_Copy, dllComCtl32); } @@ -3701,7 +3701,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) { // normally this is impossible because the m_dragImage is // deleted once the drag operation is over - wxASSERT_MSG( !m_dragImage, _T("starting to drag once again?") ); + wxASSERT_MSG( !m_dragImage, wxT("starting to drag once again?") ); m_dragImage = new wxDragImage(*this, event.m_item); m_dragImage->BeginDrag(wxPoint(0,0), this); diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index 8ad2280a50..fd36d634b1 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -163,7 +163,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) // missing, we handle this) wxLogNull noLog; - wxDynamicLibrary dllWinsock(_T("ws2_32.dll"), wxDL_VERBATIM); + wxDynamicLibrary dllWinsock(wxT("ws2_32.dll"), wxDL_VERBATIM); if ( dllWinsock.IsLoaded() ) { typedef int (PASCAL *WSAStartup_t)(WORD, WSADATA *); @@ -174,7 +174,7 @@ bool wxGetFullHostName(wxChar *buf, int maxSize) #define LOAD_WINSOCK_FUNC(func) \ func ## _t \ - pfn ## func = (func ## _t)dllWinsock.GetSymbol(_T(#func)) + pfn ## func = (func ## _t)dllWinsock.GetSymbol(wxT(#func)) LOAD_WINSOCK_FUNC(WSAStartup); @@ -264,7 +264,7 @@ bool wxGetUserId(wxChar *WXUNUSED_IN_WINCE(buf), bool wxGetUserName(wxChar *buf, int maxSize) { wxCHECK_MSG( buf && ( maxSize > 0 ), false, - _T("empty buffer in wxGetUserName") ); + wxT("empty buffer in wxGetUserName") ); #if defined(__WXWINCE__) && wxUSE_REGKEY wxLogNull noLog; wxRegKey key(wxRegKey::HKCU, wxT("ControlPanel\\Owner")); @@ -479,7 +479,7 @@ bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path), GetDiskFreeSpaceEx_t pGetDiskFreeSpaceEx = (GetDiskFreeSpaceEx_t)::GetProcAddress ( - ::GetModuleHandle(_T("kernel32.dll")), + ::GetModuleHandle(wxT("kernel32.dll")), #if wxUSE_UNICODE "GetDiskFreeSpaceExW" #else @@ -497,7 +497,7 @@ bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path), &bytesTotal, NULL) ) { - wxLogLastError(_T("GetDiskFreeSpaceEx")); + wxLogLastError(wxT("GetDiskFreeSpaceEx")); return false; } @@ -548,7 +548,7 @@ bool wxGetDiskSpace(const wxString& WXUNUSED_IN_WINCE(path), &lNumberOfFreeClusters, &lTotalNumberOfClusters) ) { - wxLogLastError(_T("GetDiskFreeSpace")); + wxLogLastError(wxT("GetDiskFreeSpace")); return false; } @@ -633,7 +633,7 @@ bool wxDoSetEnv(const wxString& var, const wxChar *value) #else // other compiler if ( !::SetEnvironmentVariable(var.t_str(), value) ) { - wxLogLastError(_T("SetEnvironmentVariable")); + wxLogLastError(wxT("SetEnvironmentVariable")); return false; } @@ -770,12 +770,12 @@ int wxKill(long pid, wxSignal sig, wxKillError *krc, int flags) // can also use SendMesageTimeout(WM_CLOSE) if ( !::PostMessage(params.hwnd, WM_QUIT, 0, 0) ) { - wxLogLastError(_T("PostMessage(WM_QUIT)")); + wxLogLastError(wxT("PostMessage(WM_QUIT)")); } } else // it was an error then { - wxLogLastError(_T("EnumWindows")); + wxLogLastError(wxT("EnumWindows")); ok = false; } @@ -802,16 +802,16 @@ int wxKill(long pid, wxSignal sig, wxKillError *krc, int flags) // process terminated if ( !::GetExitCodeProcess(hProcess, &rc) ) { - wxLogLastError(_T("GetExitCodeProcess")); + wxLogLastError(wxT("GetExitCodeProcess")); } break; default: - wxFAIL_MSG( _T("unexpected WaitForSingleObject() return") ); + wxFAIL_MSG( wxT("unexpected WaitForSingleObject() return") ); // fall through case WAIT_FAILED: - wxLogLastError(_T("WaitForSingleObject")); + wxLogLastError(wxT("WaitForSingleObject")); // fall through case WAIT_TIMEOUT: @@ -856,7 +856,7 @@ static void InitToolHelp32() #if wxUSE_DYNLIB_CLASS - wxDynamicLibrary dllKernel(_T("kernel32.dll"), wxDL_VERBATIM); + wxDynamicLibrary dllKernel(wxT("kernel32.dll"), wxDL_VERBATIM); // Get procedure addresses. // We are linking to these functions of Kernel32 @@ -865,13 +865,13 @@ static void InitToolHelp32() // which does not have the Toolhelp32 // functions in the Kernel 32. lpfCreateToolhelp32Snapshot = - (CreateToolhelp32Snapshot_t)dllKernel.RawGetSymbol(_T("CreateToolhelp32Snapshot")); + (CreateToolhelp32Snapshot_t)dllKernel.RawGetSymbol(wxT("CreateToolhelp32Snapshot")); lpfProcess32First = - (Process32_t)dllKernel.RawGetSymbol(_T("Process32First")); + (Process32_t)dllKernel.RawGetSymbol(wxT("Process32First")); lpfProcess32Next = - (Process32_t)dllKernel.RawGetSymbol(_T("Process32Next")); + (Process32_t)dllKernel.RawGetSymbol(wxT("Process32Next")); #endif // wxUSE_DYNLIB_CLASS } @@ -1014,7 +1014,7 @@ bool wxShutdown(int WXUNUSED_IN_WINCE(flags)) break; default: - wxFAIL_MSG( _T("unknown wxShutdown() flag") ); + wxFAIL_MSG( wxT("unknown wxShutdown() flag") ); return false; } @@ -1060,16 +1060,16 @@ bool wxIsDebuggerRunning() { #if wxUSE_DYNLIB_CLASS // IsDebuggerPresent() is not available under Win95, so load it dynamically - wxDynamicLibrary dll(_T("kernel32.dll"), wxDL_VERBATIM); + wxDynamicLibrary dll(wxT("kernel32.dll"), wxDL_VERBATIM); typedef BOOL (WINAPI *IsDebuggerPresent_t)(); - if ( !dll.HasSymbol(_T("IsDebuggerPresent")) ) + if ( !dll.HasSymbol(wxT("IsDebuggerPresent")) ) { // no way to know, assume no return false; } - return (*(IsDebuggerPresent_t)dll.GetSymbol(_T("IsDebuggerPresent")))() != 0; + return (*(IsDebuggerPresent_t)dll.GetSymbol(wxT("IsDebuggerPresent")))() != 0; #else return false; #endif @@ -1173,7 +1173,7 @@ wxString wxGetOsDescription() } if ( !wxIsEmpty(info.szCSDVersion) ) { - str << _T(" (") << info.szCSDVersion << _T(')'); + str << wxT(" (") << info.szCSDVersion << wxT(')'); } break; @@ -1226,9 +1226,9 @@ wxString wxGetOsDescription() if ( !wxIsEmpty(info.szCSDVersion) ) { - str << _T(", ") << info.szCSDVersion; + str << wxT(", ") << info.szCSDVersion; } - str << _T(')'); + str << wxT(')'); if ( wxIsPlatform64Bit() ) str << _(", 64-bit edition"); @@ -1237,7 +1237,7 @@ wxString wxGetOsDescription() } else { - wxFAIL_MSG( _T("GetVersionEx() failed") ); // should never happen + wxFAIL_MSG( wxT("GetVersionEx() failed") ); // should never happen } return str; @@ -1251,9 +1251,9 @@ bool wxIsPlatform64Bit() // 32-bit programs run on both 32-bit and 64-bit Windows so check typedef BOOL (WINAPI *IsWow64Process_t)(HANDLE, BOOL *); - wxDynamicLibrary dllKernel32(_T("kernel32.dll")); + wxDynamicLibrary dllKernel32(wxT("kernel32.dll")); IsWow64Process_t pfnIsWow64Process = - (IsWow64Process_t)dllKernel32.RawGetSymbol(_T("IsWow64Process")); + (IsWow64Process_t)dllKernel32.RawGetSymbol(wxT("IsWow64Process")); BOOL wow64 = FALSE; if ( pfnIsWow64Process ) @@ -1643,7 +1643,7 @@ extern "C" WXDLLIMPEXP_BASE HWND wxCreateHiddenWindow(LPCTSTR *pclassname, LPCTSTR classname, WNDPROC wndproc) { wxCHECK_MSG( classname && pclassname && wndproc, NULL, - _T("NULL parameter in wxCreateHiddenWindow") ); + wxT("NULL parameter in wxCreateHiddenWindow") ); // register the class fi we need to first if ( *pclassname == NULL ) diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index f5e70e2d91..8e86fb663c 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -146,7 +146,7 @@ public: // running processes if ( !::SetEvent(gs_heventShutdown) ) { - wxLogDebug(_T("Failed to set shutdown event in wxExecuteModule")); + wxLogDebug(wxT("Failed to set shutdown event in wxExecuteModule")); } ::CloseHandle(gs_heventShutdown); @@ -165,7 +165,7 @@ public: 3000 // long but finite value ) == WAIT_TIMEOUT ) { - wxLogDebug(_T("Failed to stop all wxExecute monitor threads")); + wxLogDebug(wxT("Failed to stop all wxExecute monitor threads")); } for ( size_t n = 0; n < numThreads; n++ ) @@ -181,7 +181,7 @@ public: { if ( !::UnregisterClass(wxMSWEXEC_WNDCLASSNAME, wxGetInstance()) ) { - wxLogLastError(_T("UnregisterClass(wxExecClass)")); + wxLogLastError(wxT("UnregisterClass(wxExecClass)")); } gs_classForHiddenWindow = NULL; @@ -336,7 +336,7 @@ static DWORD __stdcall wxExecuteThread(void *arg) gs_heventShutdown = ::CreateEvent(NULL, TRUE, FALSE, NULL); if ( !gs_heventShutdown ) { - wxLogDebug(_T("CreateEvent() in wxExecuteThread failed")); + wxLogDebug(wxT("CreateEvent() in wxExecuteThread failed")); } } @@ -369,7 +369,7 @@ static DWORD __stdcall wxExecuteThread(void *arg) break; default: - wxLogDebug(_T("Waiting for the process termination failed!")); + wxLogDebug(wxT("Waiting for the process termination failed!")); } return 0; @@ -465,7 +465,7 @@ bool wxPipeInputStream::CanRead() const if ( ::GetLastError() != ERROR_BROKEN_PIPE ) { // unexpected error - wxLogLastError(_T("PeekNamedPipe")); + wxLogLastError(wxT("PeekNamedPipe")); } // don't try to continue reading from a pipe if an error occurred or if @@ -522,7 +522,7 @@ wxPipeOutputStream::wxPipeOutputStream(HANDLE hOutput) NULL // timeout (we don't set it neither) ) ) { - wxLogLastError(_T("SetNamedPipeHandleState(PIPE_NOWAIT)")); + wxLogLastError(wxT("SetNamedPipeHandleState(PIPE_NOWAIT)")); } } @@ -619,7 +619,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) // thread -- this could be fixed, but as Unix versions don't support this // neither I don't want to waste time on this now wxASSERT_MSG( wxThread::IsMain(), - _T("wxExecute() can be called only from the main thread") ); + wxT("wxExecute() can be called only from the main thread") ); #endif // wxUSE_THREADS wxString command; @@ -635,7 +635,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) // case we execute just and process the rest below wxString ddeServer, ddeTopic, ddeCommand; static const size_t lenDdePrefix = 7; // strlen("WX_DDE:") - if ( cmd.Left(lenDdePrefix) == _T("WX_DDE#") ) + if ( cmd.Left(lenDdePrefix) == wxT("WX_DDE#") ) { // speed up the concatenations below ddeServer.reserve(256); @@ -643,7 +643,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) ddeCommand.reserve(256); const wxChar *p = cmd.c_str() + 7; - while ( *p && *p != _T('#') ) + while ( *p && *p != wxT('#') ) { command += *p++; } @@ -655,10 +655,10 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) } else { - wxFAIL_MSG(_T("invalid WX_DDE command in wxExecute")); + wxFAIL_MSG(wxT("invalid WX_DDE command in wxExecute")); } - while ( *p && *p != _T('#') ) + while ( *p && *p != wxT('#') ) { ddeServer += *p++; } @@ -670,10 +670,10 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) } else { - wxFAIL_MSG(_T("invalid WX_DDE command in wxExecute")); + wxFAIL_MSG(wxT("invalid WX_DDE command in wxExecute")); } - while ( *p && *p != _T('#') ) + while ( *p && *p != wxT('#') ) { ddeTopic += *p++; } @@ -685,7 +685,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) } else { - wxFAIL_MSG(_T("invalid WX_DDE command in wxExecute")); + wxFAIL_MSG(wxT("invalid WX_DDE command in wxExecute")); } while ( *p ) @@ -782,7 +782,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) DUPLICATE_SAME_ACCESS // same access as for src handle ) ) { - wxLogLastError(_T("DuplicateHandle")); + wxLogLastError(wxT("DuplicateHandle")); } ::CloseHandle(pipeInWrite); @@ -955,14 +955,14 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) switch ( ::WaitForInputIdle(pi.hProcess, 10000 /* 10 seconds */) ) { default: - wxFAIL_MSG( _T("unexpected WaitForInputIdle() return code") ); + wxFAIL_MSG( wxT("unexpected WaitForInputIdle() return code") ); // fall through case -1: - wxLogLastError(_T("WaitForInputIdle() in wxExecute")); + wxLogLastError(wxT("WaitForInputIdle() in wxExecute")); case WAIT_TIMEOUT: - wxLogDebug(_T("Timeout too small in WaitForInputIdle")); + wxLogDebug(wxT("Timeout too small in WaitForInputIdle")); ok = false; break; @@ -974,7 +974,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) if ( !ok ) { - wxLogDebug(_T("Failed to send DDE request to the process \"%s\"."), + wxLogDebug(wxT("Failed to send DDE request to the process \"%s\"."), cmd.c_str()); } } @@ -989,7 +989,7 @@ long wxExecute(const wxString& cmd, int flags, wxProcess *handler) } wxAppTraits *traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - wxCHECK_MSG( traits, -1, _T("no wxAppTraits in wxExecute()?") ); + wxCHECK_MSG( traits, -1, wxT("no wxAppTraits in wxExecute()?") ); void *cookie = NULL; if ( !(flags & wxEXEC_NODISABLE) ) diff --git a/src/msw/utilsgui.cpp b/src/msw/utilsgui.cpp index 1ee21a2026..f016cd3a7b 100644 --- a/src/msw/utilsgui.cpp +++ b/src/msw/utilsgui.cpp @@ -372,11 +372,11 @@ extern bool wxEnableFileNameAutoComplete(HWND hwnd) s_initialized = true; wxLogNull nolog; - wxDynamicLibrary dll(_T("shlwapi.dll")); + wxDynamicLibrary dll(wxT("shlwapi.dll")); if ( dll.IsLoaded() ) { s_pfnSHAutoComplete = - (SHAutoComplete_t)dll.GetSymbol(_T("SHAutoComplete")); + (SHAutoComplete_t)dll.GetSymbol(wxT("SHAutoComplete")); if ( s_pfnSHAutoComplete ) { // won't be unloaded until the process termination, no big deal @@ -391,7 +391,7 @@ extern bool wxEnableFileNameAutoComplete(HWND hwnd) HRESULT hr = s_pfnSHAutoComplete(hwnd, 0x10 /* SHACF_FILESYS_ONLY */); if ( FAILED(hr) ) { - wxLogApiError(_T("SHAutoComplete"), hr); + wxLogApiError(wxT("SHAutoComplete"), hr); return false; } @@ -412,7 +412,7 @@ bool wxLaunchDefaultApplication(const wxString& document, int flags) WinStruct sei; sei.lpFile = document.wx_str(); - sei.lpVerb = _T("open"); + sei.lpVerb = wxT("open"); #ifdef __WXWINCE__ sei.nShow = SW_SHOWNORMAL; // SW_SHOWDEFAULT not defined under CE (#10216) #else @@ -443,11 +443,11 @@ bool wxDoLaunchDefaultBrowser(const wxString& url, const wxString& scheme, int f { // ShellExecuteEx() opens the URL in an existing window by default so // we can't use it if we need a new window - wxRegKey key(wxRegKey::HKCR, scheme + _T("\\shell\\open")); + wxRegKey key(wxRegKey::HKCR, scheme + wxT("\\shell\\open")); if ( !key.Exists() ) { // try the default browser, it must be registered at least for http URLs - key.SetName(wxRegKey::HKCR, _T("http\\shell\\open")); + key.SetName(wxRegKey::HKCR, wxT("http\\shell\\open")); } if ( key.Exists() ) @@ -507,7 +507,7 @@ bool wxDoLaunchDefaultBrowser(const wxString& url, const wxString& scheme, int f WinStruct sei; sei.lpFile = url.c_str(); - sei.lpVerb = _T("open"); + sei.lpVerb = wxT("open"); sei.nShow = SW_SHOWNORMAL; sei.fMask = SEE_MASK_FLAG_NO_UI; // we give error message ourselves diff --git a/src/msw/uxtheme.cpp b/src/msw/uxtheme.cpp index f850095db2..841b5156bb 100644 --- a/src/msw/uxtheme.cpp +++ b/src/msw/uxtheme.cpp @@ -113,11 +113,11 @@ bool wxUxThemeEngine::Initialize() // we're prepared to handle the errors wxLogNull noLog; - if ( !m_dllUxTheme.Load(_T("uxtheme.dll")) ) + if ( !m_dllUxTheme.Load(wxT("uxtheme.dll")) ) return false; #define RESOLVE_UXTHEME_FUNCTION(type, funcname) \ - funcname = (type)m_dllUxTheme.GetSymbol(_T(#funcname)); \ + funcname = (type)m_dllUxTheme.GetSymbol(wxT(#funcname)); \ if ( !funcname ) \ return false diff --git a/src/msw/volume.cpp b/src/msw/volume.cpp index f92083976f..35c487da01 100644 --- a/src/msw/volume.cpp +++ b/src/msw/volume.cpp @@ -158,7 +158,7 @@ static unsigned GetBasicFlags(const wxChar* filename) // this error is not fatal, so don't show a message to the user about // it, otherwise it would appear every time a generic directory picker // dialog is used and there is a connected network drive - wxLogLastError(_T("SHGetFileInfo")); + wxLogLastError(wxT("SHGetFileInfo")); } else { @@ -395,16 +395,16 @@ wxArrayString wxFSVolumeBase::GetVolumes(int flagsSet, int flagsUnset) ::InterlockedExchange(&s_cancelSearch, FALSE); // reset #if wxUSE_DYNLIB_CLASS - if (!s_mprLib.IsLoaded() && s_mprLib.Load(_T("mpr.dll"))) + if (!s_mprLib.IsLoaded() && s_mprLib.Load(wxT("mpr.dll"))) { #ifdef UNICODE - s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(_T("WNetOpenEnumW")); - s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(_T("WNetEnumResourceW")); + s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(wxT("WNetOpenEnumW")); + s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(wxT("WNetEnumResourceW")); #else - s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(_T("WNetOpenEnumA")); - s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(_T("WNetEnumResourceA")); + s_pWNetOpenEnum = (WNetOpenEnumPtr)s_mprLib.GetSymbol(wxT("WNetOpenEnumA")); + s_pWNetEnumResource = (WNetEnumResourcePtr)s_mprLib.GetSymbol(wxT("WNetEnumResourceA")); #endif - s_pWNetCloseEnum = (WNetCloseEnumPtr)s_mprLib.GetSymbol(_T("WNetCloseEnum")); + s_pWNetCloseEnum = (WNetCloseEnumPtr)s_mprLib.GetSymbol(wxT("WNetCloseEnum")); } #endif @@ -578,7 +578,7 @@ void wxFSVolume::InitIcons() wxIcon wxFSVolume::GetIcon(wxFSIconType type) const { wxCHECK_MSG( type >= 0 && (size_t)type < m_icons.GetCount(), wxNullIcon, - _T("wxFSIconType::GetIcon(): invalid icon index") ); + wxT("wxFSIconType::GetIcon(): invalid icon index") ); // Load on demand. if (m_icons[type].IsNull()) @@ -603,7 +603,7 @@ wxIcon wxFSVolume::GetIcon(wxFSIconType type) const break; case wxFS_VOL_ICO_MAX: - wxFAIL_MSG(_T("wxFS_VOL_ICO_MAX is not valid icon type")); + wxFAIL_MSG(wxT("wxFS_VOL_ICO_MAX is not valid icon type")); break; } diff --git a/src/msw/wince/checklst.cpp b/src/msw/wince/checklst.cpp index 334f86fd51..75b50ac813 100644 --- a/src/msw/wince/checklst.cpp +++ b/src/msw/wince/checklst.cpp @@ -154,11 +154,11 @@ void wxCheckListBox::OnSize(wxSizeEvent& event) void wxCheckListBox::DoDeleteOneItem(unsigned int n) { - wxCHECK_RET( IsValid( n ), _T("invalid index in wxCheckListBox::Delete") ); + wxCHECK_RET( IsValid( n ), wxT("invalid index in wxCheckListBox::Delete") ); if ( !ListView_DeleteItem(GetHwnd(), n) ) { - wxLogLastError(_T("ListView_DeleteItem")); + wxLogLastError(wxT("ListView_DeleteItem")); } m_itemsClientData.RemoveAt(n); } @@ -169,7 +169,7 @@ void wxCheckListBox::DoDeleteOneItem(unsigned int n) bool wxCheckListBox::IsChecked(unsigned int uiIndex) const { wxCHECK_MSG( IsValid( uiIndex ), false, - _T("invalid index in wxCheckListBox::IsChecked") ); + wxT("invalid index in wxCheckListBox::IsChecked") ); return (ListView_GetCheckState(((HWND)GetHWND()), uiIndex) != 0); } @@ -177,7 +177,7 @@ bool wxCheckListBox::IsChecked(unsigned int uiIndex) const void wxCheckListBox::Check(unsigned int uiIndex, bool bCheck) { wxCHECK_RET( IsValid( uiIndex ), - _T("invalid index in wxCheckListBox::Check") ); + wxT("invalid index in wxCheckListBox::Check") ); ListView_SetCheckState(((HWND)GetHWND()), uiIndex, bCheck) } @@ -195,7 +195,7 @@ void wxCheckListBox::DoClear() DoDeleteOneItem(n); } - wxASSERT_MSG( IsEmpty(), _T("logic error in DoClear()") ); + wxASSERT_MSG( IsEmpty(), wxT("logic error in DoClear()") ); } unsigned int wxCheckListBox::GetCount() const @@ -234,7 +234,7 @@ wxString wxCheckListBox::GetString(unsigned int n) const const int bufSize = 513; wxChar buf[bufSize]; ListView_GetItemText( (HWND)GetHWND(), n, 0, buf, bufSize - 1 ); - buf[bufSize-1] = _T('\0'); + buf[bufSize-1] = wxT('\0'); wxString str(buf); return str; } @@ -248,7 +248,7 @@ bool wxCheckListBox::IsSelected(int n) const void wxCheckListBox::SetString(unsigned int n, const wxString& s) { wxCHECK_RET( IsValid( n ), - _T("invalid index in wxCheckListBox::SetString") ); + wxT("invalid index in wxCheckListBox::SetString") ); wxChar *buf = new wxChar[s.length()+1]; wxStrcpy(buf, s.c_str()); ListView_SetItemText( (HWND)GetHWND(), n, 0, buf ); @@ -276,7 +276,7 @@ int wxCheckListBox::DoInsertItems(const wxArrayStringsAdapter & items, wxZeroMemory(newItem); newItem.iItem = pos + i; n = ListView_InsertItem( (HWND)GetHWND(), & newItem ); - wxCHECK_MSG( n != -1, -1, _T("Item not added") ); + wxCHECK_MSG( n != -1, -1, wxT("Item not added") ); SetString( n, items[i] ); m_itemsClientData.Insert(NULL, n); @@ -292,7 +292,7 @@ void wxCheckListBox::DoSetFirstItem(int n) if(pos == n) return; POINT ppt; BOOL ret = ListView_GetItemPosition( (HWND)GetHWND(), n, &ppt ); - wxCHECK_RET( ret == TRUE, _T("Broken DoSetFirstItem") ); + wxCHECK_RET( ret == TRUE, wxT("Broken DoSetFirstItem") ); ListView_Scroll( (HWND)GetHWND(), 0, 0 ); ListView_Scroll( (HWND)GetHWND(), 0, ppt.y ); } diff --git a/src/msw/wince/choicece.cpp b/src/msw/wince/choicece.cpp index 0966c4276a..a1b548e125 100644 --- a/src/msw/wince/choicece.cpp +++ b/src/msw/wince/choicece.cpp @@ -113,7 +113,7 @@ wxChoice *wxChoice::GetChoiceForListBox(WXHWND hwndBuddy) // sanity check wxASSERT_MSG( choice->m_hwndBuddy == hwndBuddy, - _T("wxChoice has incorrect buddy HWND!") ); + wxT("wxChoice has incorrect buddy HWND!") ); return choice; } @@ -169,7 +169,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent, sizeText.x -= sizeBtn.x + MARGIN_BETWEEN; if ( sizeText.x <= 0 ) { - wxLogDebug(_T("not enough space for wxSpinCtrl!")); + wxLogDebug(wxT("not enough space for wxSpinCtrl!")); } wxPoint posBtn(pos); @@ -186,7 +186,7 @@ bool wxChoice::CreateAndInit(wxWindow *parent, m_hwndBuddy = (WXHWND)::CreateWindowEx ( exStyle, // sunken border - _T("LISTBOX"), // window class + wxT("LISTBOX"), // window class NULL, // no window title msStyle, // style (will be shown later) pos.x, pos.y, // position @@ -517,7 +517,7 @@ void wxChoice::DoMoveWindow(int x, int y, int width, int height) int widthText = width - widthBtn - MARGIN_BETWEEN; if ( widthText <= 0 ) { - wxLogDebug(_T("not enough space for wxSpinCtrl!")); + wxLogDebug(wxT("not enough space for wxSpinCtrl!")); } if ( !::MoveWindow(GetBuddyHwnd(), x, y, widthText, height, TRUE) ) diff --git a/src/msw/wince/filedlgwce.cpp b/src/msw/wince/filedlgwce.cpp index e5c59407a6..6ad061639e 100644 --- a/src/msw/wince/filedlgwce.cpp +++ b/src/msw/wince/filedlgwce.cpp @@ -89,8 +89,8 @@ void wxFileDialog::GetPaths(wxArrayString& paths) const paths.Empty(); wxString dir(m_dir); - if ( m_dir.Last() != _T('\\') ) - dir += _T('\\'); + if ( m_dir.Last() != wxT('\\') ) + dir += wxT('\\'); size_t count = m_fileNames.GetCount(); for ( size_t n = 0; n < count; n++ ) @@ -107,7 +107,7 @@ void wxFileDialog::SetPath(const wxString& path) wxString ext; wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext); if ( !ext.empty() ) - m_fileName << _T('.') << ext; + m_fileName << wxT('.') << ext; } int wxFileDialog::ShowModal() diff --git a/src/msw/wince/menuce.cpp b/src/msw/wince/menuce.cpp index 238e2f0f95..4b8c400570 100644 --- a/src/msw/wince/menuce.cpp +++ b/src/msw/wince/menuce.cpp @@ -225,7 +225,7 @@ void wxTopLevelWindowMSW::ReloadAllButtons() if (!SHCreateMenuBar(&menu_bar)) { - wxFAIL_MSG( _T("SHCreateMenuBar failed") ); + wxFAIL_MSG( wxT("SHCreateMenuBar failed") ); return; } diff --git a/src/msw/wince/tbarwce.cpp b/src/msw/wince/tbarwce.cpp index 580e11d626..1e49fa48fd 100644 --- a/src/msw/wince/tbarwce.cpp +++ b/src/msw/wince/tbarwce.cpp @@ -202,7 +202,7 @@ bool wxToolMenuBar::MSWCreateToolbar(const wxPoint& WXUNUSED(pos), m_menuBar->SetToolBar(this); HWND hwndParent = GetHwndOf(GetParent()); - wxCHECK_MSG( hwndParent, false, _T("should have valid parent HWND") ); + wxCHECK_MSG( hwndParent, false, wxT("should have valid parent HWND") ); #if defined(WINCE_WITHOUT_COMMANDBAR) // create the menubar. @@ -214,7 +214,7 @@ bool wxToolMenuBar::MSWCreateToolbar(const wxPoint& WXUNUSED(pos), if ( !SHCreateMenuBar(&mbi) ) { - wxFAIL_MSG( _T("SHCreateMenuBar failed") ); + wxFAIL_MSG( wxT("SHCreateMenuBar failed") ); return false; } @@ -308,7 +308,7 @@ bool wxToolMenuBar::DoDeleteTool(size_t pos, wxToolBarToolBase *tool) RECT r; if ( !::SendMessage(GetHwnd(), TB_GETITEMRECT, pos, (LPARAM)&r) ) { - wxLogLastError(_T("TB_GETITEMRECT")); + wxLogLastError(wxT("TB_GETITEMRECT")); } int width = r.right - r.left; @@ -466,7 +466,7 @@ bool wxToolMenuBar::Realize() break; default: - wxFAIL_MSG( _T("unexpected toolbar button kind") ); + wxFAIL_MSG( wxT("unexpected toolbar button kind") ); // fall through case wxITEM_NORMAL: @@ -644,7 +644,7 @@ void wxToolBar::DoToggleTool(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(to void wxToolBar::DoSetToggle(wxToolBarToolBase *WXUNUSED(tool), bool WXUNUSED(toggle)) { - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); } #endif diff --git a/src/msw/wince/textctrlce.cpp b/src/msw/wince/textctrlce.cpp index a9d97de8cc..71d62846ec 100644 --- a/src/msw/wince/textctrlce.cpp +++ b/src/msw/wince/textctrlce.cpp @@ -171,7 +171,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, sizeText.x -= sizeBtn.x + MARGIN_BETWEEN; if ( sizeText.x <= 0 ) { - wxLogDebug(_T("not enough space for wxSpinCtrl!")); + wxLogDebug(wxT("not enough space for wxSpinCtrl!")); } wxPoint posBtn(pos); @@ -199,7 +199,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, m_hwndBuddy = (WXHWND)::CreateWindowEx ( exStyle, // sunken border - _T("EDIT"), // window class + wxT("EDIT"), // window class valueWin, // no window title msStyle, // style (will be shown later) pos.x, pos.y, // position @@ -233,7 +233,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id, if ( style & wxSP_WRAP ) spiner_style |= UDS_WRAP; - if ( !MSWCreateControl(UPDOWN_CLASS, spiner_style, posBtn, sizeBtn, _T(""), 0) ) + if ( !MSWCreateControl(UPDOWN_CLASS, spiner_style, posBtn, sizeBtn, wxT(""), 0) ) return false; // subclass the text ctrl to be able to intercept some events @@ -807,7 +807,7 @@ wxString wxTextCtrl::GetLineText(long lineNo) const // remove the '\n' at the end, if any (this is how this function is // supposed to work according to the docs) - if ( buf[len - 1] == _T('\n') ) + if ( buf[len - 1] == wxT('\n') ) { len--; } @@ -1087,7 +1087,7 @@ void wxTextCtrl::DoMoveWindow(int x, int y, int width, int height) int widthText = width - widthBtn - MARGIN_BETWEEN; if ( widthText <= 0 ) { - wxLogDebug(_T("not enough space for wxSpinCtrl!")); + wxLogDebug(wxT("not enough space for wxSpinCtrl!")); } if ( !::MoveWindow(GetBuddyHwnd(), x, y, widthText, height, TRUE) ) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index f38ff5e4e2..84c0e32811 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -241,7 +241,7 @@ static inline void wxBringWindowToTop(HWND hwnd) // raise top level parent to top of z order if (!::SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)) { - wxLogLastError(_T("SetWindowPos")); + wxLogLastError(wxT("SetWindowPos")); } } @@ -578,7 +578,7 @@ wxWindowMSW::~wxWindowMSW() /* static */ const wxChar *wxWindowMSW::MSWGetRegisteredClassName() { - return wxApp::GetRegisteredClassName(_T("wxWindow"), COLOR_BTNFACE); + return wxApp::GetRegisteredClassName(wxT("wxWindow"), COLOR_BTNFACE); } // real construction (Init() must have been called before!) @@ -629,7 +629,7 @@ bool wxWindowMSW::Create(wxWindow *parent, void wxWindowMSW::SetFocus() { HWND hWnd = GetHwnd(); - wxCHECK_RET( hWnd, _T("can't set focus to invalid window") ); + wxCHECK_RET( hWnd, wxT("can't set focus to invalid window") ); #if !defined(__WXWINCE__) ::SetLastError(0); @@ -644,7 +644,7 @@ void wxWindowMSW::SetFocus() HWND hwndFocus = ::GetFocus(); if ( hwndFocus != hWnd ) { - wxLogApiError(_T("SetFocus"), dwRes); + wxLogApiError(wxT("SetFocus"), dwRes); } } } @@ -733,7 +733,7 @@ wxWindowMSW::MSWShowWithEffect(bool show, static bool s_initDone = false; if ( !s_initDone ) { - wxDynamicLibrary dllUser32(_T("user32.dll"), wxDL_VERBATIM | wxDL_QUIET); + wxDynamicLibrary dllUser32(wxT("user32.dll"), wxDL_VERBATIM | wxDL_QUIET); wxDL_INIT_FUNC(s_pfn, AnimateWindow, dllUser32); s_initDone = true; @@ -801,17 +801,17 @@ wxWindowMSW::MSWShowWithEffect(bool show, case wxSHOW_EFFECT_MAX: - wxFAIL_MSG( _T("invalid window show effect") ); + wxFAIL_MSG( wxT("invalid window show effect") ); return false; default: - wxFAIL_MSG( _T("unknown window show effect") ); + wxFAIL_MSG( wxT("unknown window show effect") ); return false; } if ( !(*s_pfnAnimateWindow)(GetHwnd(), timeout, dwFlags) ) { - wxLogLastError(_T("AnimateWindow")); + wxLogLastError(wxT("AnimateWindow")); return false; } @@ -845,7 +845,7 @@ void wxWindowMSW::DoReleaseMouse() { if ( !::ReleaseCapture() ) { - wxLogLastError(_T("ReleaseCapture")); + wxLogLastError(wxT("ReleaseCapture")); } } @@ -925,7 +925,7 @@ void wxWindowMSW::WarpPointer(int x, int y) if ( !::SetCursorPos(x, y) ) { - wxLogLastError(_T("SetCursorPos")); + wxLogLastError(wxT("SetCursorPos")); } } @@ -981,7 +981,7 @@ inline UINT WXOrientToSB(int orient) int wxWindowMSW::GetScrollPos(int orient) const { HWND hWnd = GetHwnd(); - wxCHECK_MSG( hWnd, 0, _T("no HWND in GetScrollPos") ); + wxCHECK_MSG( hWnd, 0, wxT("no HWND in GetScrollPos") ); return GetScrollPosition(hWnd, WXOrientToSB(orient)); } @@ -1000,7 +1000,7 @@ int wxWindowMSW::GetScrollRange(int orient) const { // Most of the time this is not really an error, since the return // value can also be zero when there is no scrollbar yet. - // wxLogLastError(_T("GetScrollInfo")); + // wxLogLastError(wxT("GetScrollInfo")); } maxPos = scrollInfo.nMax; @@ -1016,7 +1016,7 @@ int wxWindowMSW::GetScrollThumb(int orient) const void wxWindowMSW::SetScrollPos(int orient, int pos, bool refresh) { HWND hWnd = GetHwnd(); - wxCHECK_RET( hWnd, _T("SetScrollPos: no HWND") ); + wxCHECK_RET( hWnd, wxT("SetScrollPos: no HWND") ); WinStruct info; info.nPage = 0; @@ -1145,7 +1145,7 @@ void wxWindowMSW::SetLayoutDirection(wxLayoutDirection dir) wxUnusedVar(dir); #else wxCHECK_RET( GetHwnd(), - _T("layout direction must be set after window creation") ); + wxT("layout direction must be set after window creation") ); LONG styleOld = wxGetWindowExStyle(this); @@ -1161,7 +1161,7 @@ void wxWindowMSW::SetLayoutDirection(wxLayoutDirection dir) break; default: - wxFAIL_MSG(_T("unsupported layout direction")); + wxFAIL_MSG(wxT("unsupported layout direction")); break; } @@ -1177,7 +1177,7 @@ wxLayoutDirection wxWindowMSW::GetLayoutDirection() const #ifdef __WXWINCE__ return wxLayout_Default; #else - wxCHECK_MSG( GetHwnd(), wxLayout_Default, _T("invalid window") ); + wxCHECK_MSG( GetHwnd(), wxLayout_Default, wxT("invalid window") ); return wxHasWindowExStyle(this, WS_EX_LAYOUTRTL) ? wxLayout_RightToLeft : wxLayout_LeftToRight; @@ -1286,7 +1286,7 @@ bool wxCheckWindowWndProc(WXHWND hWnd, // TODO: get rid of wxTLWHiddenParent special case (currently it's not // registered by wxApp but using ad hoc code in msw/toplevel.cpp); // there is also a hidden window class used by sockets &c - return wxApp::IsRegisteredClassName(str) || str == _T("wxTLWHiddenParent"); + return wxApp::IsRegisteredClassName(str) || str == wxT("wxTLWHiddenParent"); } // ---------------------------------------------------------------------------- @@ -1393,7 +1393,7 @@ void wxWindowMSW::MSWUpdateStyle(long flagsOld, long exflagsOld) 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED) ) { - wxLogLastError(_T("SetWindowPos")); + wxLogLastError(wxT("SetWindowPos")); } } } @@ -1487,7 +1487,7 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const { default: case wxBORDER_DEFAULT: - wxFAIL_MSG( _T("unknown border style") ); + wxFAIL_MSG( wxT("unknown border style") ); // fall through case wxBORDER_NONE: @@ -1654,7 +1654,7 @@ void wxWindowMSW::Update() { if ( !::UpdateWindow(GetHwnd()) ) { - wxLogLastError(_T("UpdateWindow")); + wxLogLastError(wxT("UpdateWindow")); } #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) @@ -1925,7 +1925,7 @@ wxWindowMSW::DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height) SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); if ( !hdwp ) { - wxLogLastError(_T("DeferWindowPos")); + wxLogLastError(wxT("DeferWindowPos")); } } @@ -2111,7 +2111,7 @@ void wxWindowMSW::DoSetClientSize(int width, int height) height + heightWin - rectClient.bottom, TRUE) ) { - wxLogLastError(_T("MoveWindow")); + wxLogLastError(wxT("MoveWindow")); } } } @@ -2136,7 +2136,7 @@ wxSize wxWindowMSW::DoGetBorderSize() const break; default: - wxFAIL_MSG( _T("unknown border style") ); + wxFAIL_MSG( wxT("unknown border style") ); // fall through case wxBORDER_NONE: @@ -2173,7 +2173,7 @@ void wxWindowMSW::DoGetTextExtent(const wxString& string, const wxFont *fontToUse) const { wxASSERT_MSG( !fontToUse || fontToUse->Ok(), - _T("invalid font in GetTextExtent()") ); + wxT("invalid font in GetTextExtent()") ); HFONT hfontToUse; if ( fontToUse ) @@ -2949,7 +2949,7 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l // this should never happen wxCHECK_MSG( win, 0, - _T("FindWindowForMouseEvent() returned NULL") ); + wxT("FindWindowForMouseEvent() returned NULL") ); } #ifdef __POCKETPC__ if (IsContextMenuEnabled() && message == WM_LBUTTONDOWN) @@ -3865,7 +3865,7 @@ bool wxWindowMSW::HandleTooltipNotify(WXUINT code, if ( !len ) { - wxLogLastError(_T("MultiByteToWideChar()")); + wxLogLastError(wxT("MultiByteToWideChar()")); } buf[len] = L'\0'; @@ -4256,7 +4256,7 @@ bool wxWindowMSW::HandlePower(WXWPARAM WXUNUSED_IN_WINCE(wParam), break; default: - wxLogDebug(_T("Unknown WM_POWERBROADCAST(%d) event"), wParam); + wxLogDebug(wxT("Unknown WM_POWERBROADCAST(%d) event"), wParam); // fall through // these messages are currently not mapped to wx events @@ -4349,7 +4349,7 @@ wxWindowMSW::MSWOnDrawItem(int WXUNUSED_UNLESS_ODRAWN(id), return false; wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem), - false, _T("MSWOnDrawItem: bad wxMenuItem pointer") ); + false, wxT("MSWOnDrawItem: bad wxMenuItem pointer") ); // prepare to call OnDrawItem(): notice using of wxDCTemp to prevent // the DC from being released @@ -4415,7 +4415,7 @@ wxWindowMSW::MSWOnMeasureItem(int id, WXMEASUREITEMSTRUCT *itemStruct) return false; wxCHECK_MSG( wxDynamicCast(pMenuItem, wxMenuItem), - false, _T("MSWOnMeasureItem: bad wxMenuItem pointer") ); + false, wxT("MSWOnMeasureItem: bad wxMenuItem pointer") ); size_t w, h; bool rc = pMenuItem->OnMeasureItem(&w, &h); @@ -4642,12 +4642,12 @@ extern wxCOLORMAP *wxGetStdColourMap() // reference bitmap which can tell us what the RGB values change // to. wxLogNull logNo; // suppress error if we couldn't load the bitmap - wxBitmap stdColourBitmap(_T("wxBITMAP_STD_COLOURS")); + wxBitmap stdColourBitmap(wxT("wxBITMAP_STD_COLOURS")); if ( stdColourBitmap.Ok() ) { // the pixels in the bitmap must correspond to wxSTD_COL_XXX! wxASSERT_MSG( stdColourBitmap.GetWidth() == wxSTD_COL_MAX, - _T("forgot to update wxBITMAP_STD_COLOURS!") ); + wxT("forgot to update wxBITMAP_STD_COLOURS!") ); wxMemoryDC memDC; memDC.SelectObject(stdColourBitmap); @@ -4972,7 +4972,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam) m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren); if ( !m_hDWP ) { - wxLogLastError(_T("BeginDeferWindowPos")); + wxLogLastError(wxT("BeginDeferWindowPos")); } if (m_hDWP) useDefer = true; @@ -4985,7 +4985,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam) switch ( wParam ) { default: - wxFAIL_MSG( _T("unexpected WM_SIZE parameter") ); + wxFAIL_MSG( wxT("unexpected WM_SIZE parameter") ); // fall through nevertheless case SIZE_MAXHIDE: @@ -5025,7 +5025,7 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam) // do put all child controls in place at once if ( !::EndDeferWindowPos(hDWP) ) { - wxLogLastError(_T("EndDeferWindowPos")); + wxLogLastError(wxT("EndDeferWindowPos")); } // Reset our children's pending pos/size values. @@ -5220,7 +5220,7 @@ void wxWindowMSW::InitMouseEvent(wxMouseEvent& event, // still don't get move, enter nor leave events. static wxWindowMSW *FindWindowForMouseEvent(wxWindowMSW *win, int *x, int *y) { - wxCHECK_MSG( x && y, win, _T("NULL pointer in FindWindowForMouseEvent") ); + wxCHECK_MSG( x && y, win, wxT("NULL pointer in FindWindowForMouseEvent") ); // first try to find a non transparent child: this allows us to send events // to a static text which is inside a static box, for example @@ -5344,11 +5344,11 @@ bool wxWindowMSW::HandleMouseMove(int x, int y, WXUINT flags) { // see comment in wxApp::GetComCtl32Version() explaining the // use of wxLoadedDLL - wxLoadedDLL dllComCtl32(_T("comctl32.dll")); + wxLoadedDLL dllComCtl32(wxT("comctl32.dll")); if ( dllComCtl32.IsLoaded() ) { s_pfn_TrackMouseEvent = (_TrackMouseEvent_t) - dllComCtl32.RawGetSymbol(_T("_TrackMouseEvent")); + dllComCtl32.RawGetSymbol(wxT("_TrackMouseEvent")); } s_initDone = true; @@ -5430,7 +5430,7 @@ bool wxWindowMSW::HandleMouseWheel(WXWPARAM wParam, WXLPARAM lParam) &s_linesPerRotation, 0)) { // this is not supposed to happen - wxLogLastError(_T("SystemParametersInfo(GETWHEELSCROLLLINES)")); + wxLogLastError(wxT("SystemParametersInfo(GETWHEELSCROLLLINES)")); // the default is 3, so use it if SystemParametersInfo() failed s_linesPerRotation = 3; @@ -5473,7 +5473,7 @@ void wxWindowMSW::GenerateMouseLeave() if ( !::GetCursorPos(&pt) ) #endif { - wxLogLastError(_T("GetCursorPos")); + wxLogLastError(wxT("GetCursorPos")); } // we need to have client coordinates here for symmetry with @@ -5638,13 +5638,13 @@ int wxWindowMSW::HandleMenuChar(int WXUNUSED_IN_WINCE(chAccel), // menu creation code wxMenuItem *item = (wxMenuItem*)mii.dwItemData; - const wxChar *p = wxStrchr(item->GetItemLabel().wx_str(), _T('&')); + const wxChar *p = wxStrchr(item->GetItemLabel().wx_str(), wxT('&')); while ( p++ ) { - if ( *p == _T('&') ) + if ( *p == wxT('&') ) { // this is not the accel char, find the real one - p = wxStrchr(p + 1, _T('&')); + p = wxStrchr(p + 1, wxT('&')); } else // got the accel char { @@ -5667,7 +5667,7 @@ int wxWindowMSW::HandleMenuChar(int WXUNUSED_IN_WINCE(chAccel), else // failed to get the menu text? { // it's not fatal, so don't show error, but still log it - wxLogLastError(_T("GetMenuItemInfo")); + wxLogLastError(wxT("GetMenuItemInfo")); } } #endif @@ -5841,7 +5841,7 @@ bool wxWindowMSW::MSWOnScroll(int orientation, WXWORD wParam, &scrollInfo) ) { // Not necessarily an error, if there are no scrollbars yet. - // wxLogLastError(_T("GetScrollInfo")); + // wxLogLastError(wxT("GetScrollInfo")); } event.SetPosition(scrollInfo.nTrackPos); @@ -5867,7 +5867,7 @@ bool wxWindowMSW::MSWOnScroll(int orientation, WXWORD wParam, wxWindowMSW::MSWRegisterMessageHandler(int msg, MSWMessageHandler handler) { wxCHECK_MSG( gs_messageHandlers.find(msg) == gs_messageHandlers.end(), - false, _T("registering handler for the same message twice") ); + false, wxT("registering handler for the same message twice") ); gs_messageHandlers[msg] = handler; return true; @@ -5878,7 +5878,7 @@ wxWindowMSW::MSWUnregisterMessageHandler(int msg, MSWMessageHandler handler) { const MSWMessageHandlers::iterator i = gs_messageHandlers.find(msg); wxCHECK_RET( i != gs_messageHandlers.end() && i->second == handler, - _T("unregistering non-registered handler?") ); + wxT("unregistering non-registered handler?") ); gs_messageHandlers.erase(i); } @@ -6384,7 +6384,7 @@ void wxSetKeyboardHook(bool doIt) ); if ( !wxTheKeyboardHook ) { - wxLogLastError(_T("SetWindowsHookEx(wxKeyboardHook)")); + wxLogLastError(wxT("SetWindowsHookEx(wxKeyboardHook)")); } } else // uninstall @@ -6945,10 +6945,10 @@ static void WinCEUnregisterHotKey(int modifiers, int id) typedef BOOL (WINAPI *UnregisterFunc1Proc)(UINT, UINT); UnregisterFunc1Proc procUnregisterFunc; - hCoreDll = LoadLibrary(_T("coredll.dll")); + hCoreDll = LoadLibrary(wxT("coredll.dll")); if (hCoreDll) { - procUnregisterFunc = (UnregisterFunc1Proc)GetProcAddress(hCoreDll, _T("UnregisterFunc1")); + procUnregisterFunc = (UnregisterFunc1Proc)GetProcAddress(hCoreDll, wxT("UnregisterFunc1")); if (procUnregisterFunc) procUnregisterFunc(modifiers, id); FreeLibrary(hCoreDll); @@ -6976,7 +6976,7 @@ bool wxWindowMSW::RegisterHotKey(int hotkeyId, int modifiers, int keycode) if ( !::RegisterHotKey(GetHwnd(), hotkeyId, win_modifiers, keycode) ) { - wxLogLastError(_T("RegisterHotKey")); + wxLogLastError(wxT("RegisterHotKey")); return false; } @@ -6992,7 +6992,7 @@ bool wxWindowMSW::UnregisterHotKey(int hotkeyId) if ( !::UnregisterHotKey(GetHwnd(), hotkeyId) ) { - wxLogLastError(_T("UnregisterHotKey")); + wxLogLastError(wxT("UnregisterHotKey")); return false; } @@ -7045,7 +7045,7 @@ public: if ( !ms_hMsgHookProc ) { - wxLogLastError(_T("SetWindowsHookEx(WH_GETMESSAGE)")); + wxLogLastError(wxT("SetWindowsHookEx(WH_GETMESSAGE)")); return false; } diff --git a/src/os2/bitmap.cpp b/src/os2/bitmap.cpp index 6f9f968eb1..48f804ef1e 100644 --- a/src/os2/bitmap.cpp +++ b/src/os2/bitmap.cpp @@ -1553,7 +1553,7 @@ HBITMAP wxInvertMask( { HBITMAP hBmpInvMask = 0; - wxCHECK_MSG( hBmpMask, 0, _T("invalid bitmap in wxInvertMask") ); + wxCHECK_MSG( hBmpMask, 0, wxT("invalid bitmap in wxInvertMask") ); // // Get width/height from the bitmap if not given @@ -1615,7 +1615,7 @@ HBITMAP wxInvertMask( HBITMAP wxCopyBmp( HBITMAP hBmp, bool flip, int nWidth, int nHeight ) { - wxCHECK_MSG( hBmp, 0, _T("invalid bitmap in wxCopyBmp") ); + wxCHECK_MSG( hBmp, 0, wxT("invalid bitmap in wxCopyBmp") ); // // Get width/height from the bitmap if not given diff --git a/src/os2/brush.cpp b/src/os2/brush.cpp index 116b68264a..c5f951fff7 100644 --- a/src/os2/brush.cpp +++ b/src/os2/brush.cpp @@ -171,7 +171,7 @@ bool wxBrush::RealizeResource() { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str()); return false; } @@ -253,7 +253,7 @@ bool wxBrush::RealizeResource() { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str()); } return bOk; } @@ -266,35 +266,35 @@ bool wxBrush::RealizeResource() wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_vColour; } wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_nStyle; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, _T("invalid brush") ); + wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); return &(M_BRUSHDATA->m_vStipple); } int wxBrush::GetPS() const { - wxCHECK_MSG( Ok(), 0, _T("invalid brush") ); + wxCHECK_MSG( Ok(), 0, wxT("invalid brush") ); return M_BRUSHDATA->m_hBrush; } WXHANDLE wxBrush::GetResourceHandle() const { - wxCHECK_MSG( Ok(), 0, _T("invalid brush") ); + wxCHECK_MSG( Ok(), 0, wxT("invalid brush") ); return (WXHANDLE)M_BRUSHDATA->m_hBrush; } // end of wxBrush::GetResourceHandle diff --git a/src/os2/button.cpp b/src/os2/button.cpp index 41fa9c9cbc..0dfafaa3b3 100644 --- a/src/os2/button.cpp +++ b/src/os2/button.cpp @@ -248,7 +248,7 @@ void wxButton::SetTmpDefault() { wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); - wxCHECK_RET( tlw, _T("button without top level window?") ); + wxCHECK_RET( tlw, wxT("button without top level window?") ); wxWindow* pWinOldDefault = tlw->GetDefaultItem(); @@ -261,7 +261,7 @@ void wxButton::UnsetTmpDefault() { wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow); - wxCHECK_RET( tlw, _T("button without top level window?") ); + wxCHECK_RET( tlw, wxT("button without top level window?") ); tlw->SetTmpDefaultItem(NULL); diff --git a/src/os2/combobox.cpp b/src/os2/combobox.cpp index 8900b0ef18..002ea2015c 100644 --- a/src/os2/combobox.cpp +++ b/src/os2/combobox.cpp @@ -140,7 +140,7 @@ bool wxComboBox::Create( lSstyle |= CBS_DROPDOWN; - if (!OS2CreateControl( _T("COMBOBOX") + if (!OS2CreateControl( wxT("COMBOBOX") ,lSstyle )) return false; diff --git a/src/os2/control.cpp b/src/os2/control.cpp index e490804a2f..4b4ecbb55c 100644 --- a/src/os2/control.cpp +++ b/src/os2/control.cpp @@ -106,15 +106,15 @@ bool wxControl::OS2CreateControl( const wxChar* zClassname, if (!pParent) return false; - if ((wxStrcmp(zClassname, _T("COMBOBOX"))) == 0) + if ((wxStrcmp(zClassname, wxT("COMBOBOX"))) == 0) zClass = WC_COMBOBOX; - else if ((wxStrcmp(zClassname, _T("STATIC"))) == 0) + else if ((wxStrcmp(zClassname, wxT("STATIC"))) == 0) zClass = WC_STATIC; - else if ((wxStrcmp(zClassname, _T("BUTTON"))) == 0) + else if ((wxStrcmp(zClassname, wxT("BUTTON"))) == 0) zClass = WC_BUTTON; - else if ((wxStrcmp(zClassname, _T("NOTEBOOK"))) == 0) + else if ((wxStrcmp(zClassname, wxT("NOTEBOOK"))) == 0) zClass = WC_NOTEBOOK; - else if ((wxStrcmp(zClassname, _T("CONTAINER"))) == 0) + else if ((wxStrcmp(zClassname, wxT("CONTAINER"))) == 0) zClass = WC_CONTAINER; if ((zClass == WC_STATIC) || (zClass == WC_BUTTON)) dwStyle |= DT_MNEMONIC; diff --git a/src/os2/dc.cpp b/src/os2/dc.cpp index 9988736141..0b8cd600b5 100644 --- a/src/os2/dc.cpp +++ b/src/os2/dc.cpp @@ -2160,7 +2160,7 @@ void wxPMDCImpl::DoGetTextExtent( // if (!m_hPS) { - (void)wxMessageBox( _T("wxWidgets core library") + (void)wxMessageBox( wxT("wxWidgets core library") ,"Using uninitialized DC for measuring text!\n" ,wxICON_INFORMATION ); @@ -2177,8 +2177,8 @@ void wxPMDCImpl::DoGetTextExtent( vErrorCode = ::WinGetLastError(wxGetInstance()); sError = wxPMErrorToStr(vErrorCode); // DEBUG - wxSprintf(zMsg, _T("GpiQueryTextBox for %s: failed with Error: %lx - %s"), rsString.c_str(), vErrorCode, sError.c_str()); - (void)wxMessageBox( _T("wxWidgets core library") + wxSprintf(zMsg, wxT("GpiQueryTextBox for %s: failed with Error: %lx - %s"), rsString.c_str(), vErrorCode, sError.c_str()); + (void)wxMessageBox( wxT("wxWidgets core library") ,zMsg ,wxICON_INFORMATION ); diff --git a/src/os2/dcclient.cpp b/src/os2/dcclient.cpp index 60e225b6b6..ce890dab9e 100644 --- a/src/os2/dcclient.cpp +++ b/src/os2/dcclient.cpp @@ -114,7 +114,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow* pTheCanvas) : { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Unable to create presentation space. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Unable to create presentation space. Error: %s\n"), sError.c_str()); } ::GpiAssociate(m_hPS, NULLHANDLE); ::GpiAssociate(m_hPS, m_hDC); @@ -132,7 +132,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow* pTheCanvas) : { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Unable to set current color table (3). Error: %s\n"), sError.c_str()); + wxLogError(wxT("Unable to set current color table (3). Error: %s\n"), sError.c_str()); } ::GpiCreateLogColorTable( m_hPS ,0L @@ -182,7 +182,7 @@ void wxWindowDCImpl::DoGetSize( , int* pnHeight ) const { - wxCHECK_RET( m_pCanvas, _T("wxWindowDC without a window?") ); + wxCHECK_RET( m_pCanvas, wxT("wxWindowDC without a window?") ); m_pCanvas->GetSize( pnWidth ,pnHeight ); @@ -236,7 +236,7 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *pTheCanvas) : { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Unable to set current color table (4). Error: %s\n"), sError.c_str()); + wxLogError(wxT("Unable to set current color table (4). Error: %s\n"), sError.c_str()); } ::GpiCreateLogColorTable( m_hPS ,0L @@ -282,7 +282,7 @@ void wxClientDCImpl::DoGetSize( , int* pnHeight ) const { - wxCHECK_RET( m_pCanvas, _T("wxWindowDC without a window?") ); + wxCHECK_RET( m_pCanvas, wxT("wxWindowDC without a window?") ); m_pCanvas->GetClientSize( pnWidth ,pnHeight ); diff --git a/src/os2/dcmemory.cpp b/src/os2/dcmemory.cpp index d4d5ec937c..88bda87c90 100644 --- a/src/os2/dcmemory.cpp +++ b/src/os2/dcmemory.cpp @@ -47,7 +47,7 @@ wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ) wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *pOldDC) : wxPMDCImpl( owner ) { - wxCHECK_RET( pOldDC, _T("NULL dc in wxMemoryDC ctor") ); + wxCHECK_RET( pOldDC, wxT("NULL dc in wxMemoryDC ctor") ); CreateCompatible(pOldDC); Init(); diff --git a/src/os2/dcprint.cpp b/src/os2/dcprint.cpp index 0ee065231e..918ff77c9c 100644 --- a/src/os2/dcprint.cpp +++ b/src/os2/dcprint.cpp @@ -261,7 +261,7 @@ void wxPrinterDCImpl::DoDrawBitmap( const wxBitmap& rBmp, wxCoord WXUNUSED(vY), bool WXUNUSED(bUseMask)) { - wxCHECK_RET( rBmp.Ok(), _T("invalid bitmap in wxPrinterDC::DrawBitmap") ); + wxCHECK_RET( rBmp.Ok(), wxT("invalid bitmap in wxPrinterDC::DrawBitmap") ); // int nWidth = rBmp.GetWidth(); // int nHeight = rBmp.GetHeight(); diff --git a/src/os2/dialog.cpp b/src/os2/dialog.cpp index 2e5ff9f96f..a8f0d6f9d1 100644 --- a/src/os2/dialog.cpp +++ b/src/os2/dialog.cpp @@ -224,7 +224,7 @@ bool wxDialog::Show( bool bShow ) // int wxDialog::ShowModal() { - wxASSERT_MSG( !IsModal(), _T("wxDialog::ShowModal() reentered?") ); + wxASSERT_MSG( !IsModal(), wxT("wxDialog::ShowModal() reentered?") ); m_endModalCalled = false; @@ -288,7 +288,7 @@ void wxDialog::EndModal( int nRetCode ) { - wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") ); + wxASSERT_MSG( IsModal(), wxT("EndModal() called for non modal dialog") ); m_endModalCalled = true; SetReturnCode(nRetCode); diff --git a/src/os2/dir.cpp b/src/os2/dir.cpp index fef52b91b3..f0ec71d670 100644 --- a/src/os2/dir.cpp +++ b/src/os2/dir.cpp @@ -62,7 +62,7 @@ static inline void FreeFindData( { if (!::DosFindClose(vFd)) { - wxLogLastError(_T("DosFindClose")); + wxLogLastError(wxT("DosFindClose")); } } @@ -223,9 +223,9 @@ bool wxDirData::Read( if ( !wxEndsWithPathSeparator(sFilespec) ) { - sFilespec += _T('\\'); + sFilespec += wxT('\\'); } - sFilespec += (!m_sFilespec ? _T("*.*") : m_sFilespec.c_str()); + sFilespec += (!m_sFilespec ? wxT("*.*") : m_sFilespec.c_str()); m_vFinddata = FindFirst( sFilespec ,PTR_TO_FINDDATA @@ -263,9 +263,9 @@ bool wxDirData::Read( // // Don't return "." and ".." unless asked for // - if ( zName[0] == _T('.') && - ((zName[1] == _T('.') && zName[2] == _T('\0')) || - (zName[1] == _T('\0'))) ) + if ( zName[0] == wxT('.') && + ((zName[1] == wxT('.') && zName[2] == wxT('\0')) || + (zName[1] == wxT('\0'))) ) { if (!(m_nFlags & wxDIR_DOTDOT)) continue; @@ -356,9 +356,9 @@ wxString wxDir::GetName() const if ( !name.empty() ) { // bring to canonical Windows form - name.Replace(_T("/"), _T("\\")); + name.Replace(wxT("/"), wxT("\\")); - if ( name.Last() == _T('\\') ) + if ( name.Last() == wxT('\\') ) { // chop off the last (back)slash name.Truncate(name.length() - 1); @@ -384,7 +384,7 @@ bool wxDir::GetFirst( , int nFlags ) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); M_DIR->Rewind(); M_DIR->SetFileSpec(rsFilespec); M_DIR->SetFlags(nFlags); @@ -395,8 +395,8 @@ bool wxDir::GetNext( wxString* psFilename ) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); - wxCHECK_MSG( psFilename, false, _T("bad pointer in wxDir::GetNext()") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); + wxCHECK_MSG( psFilename, false, wxT("bad pointer in wxDir::GetNext()") ); return M_DIR->Read(psFilename); } // end of wxDir::GetNext diff --git a/src/os2/dnd.cpp b/src/os2/dnd.cpp index 3a968d3586..636484e397 100644 --- a/src/os2/dnd.cpp +++ b/src/os2/dnd.cpp @@ -329,44 +329,44 @@ wxDataFormat wxDropTarget::GetSupportedFormat ( case wxDF_TEXT: case wxDF_FILENAME: case wxDF_HTML: - sMechanism = _T("DRM_OS2FILE"); - sFormat = _T("DRF_TEXT"); + sMechanism = wxT("DRM_OS2FILE"); + sFormat = wxT("DRF_TEXT"); break; case wxDF_OEMTEXT: - sMechanism = _T("DRM_OS2FILE"); - sFormat = _T("DRF_OEMTEXT"); + sMechanism = wxT("DRM_OS2FILE"); + sFormat = wxT("DRF_OEMTEXT"); break; case wxDF_BITMAP: - sMechanism = _T("DRM_OS2FILE"); - sFormat = _T("DRF_BITMAP"); + sMechanism = wxT("DRM_OS2FILE"); + sFormat = wxT("DRF_BITMAP"); break; case wxDF_METAFILE: case wxDF_ENHMETAFILE: - sMechanism = _T("DRM_OS2FILE"); - sFormat = _T("DRF_METAFILE"); + sMechanism = wxT("DRM_OS2FILE"); + sFormat = wxT("DRF_METAFILE"); break; case wxDF_TIFF: - sMechanism = _T("DRM_OS2FILE"); - sFormat = _T("DRF_TIFF"); + sMechanism = wxT("DRM_OS2FILE"); + sFormat = wxT("DRF_TIFF"); break; case wxDF_SYLK: - sMechanism = _T("DRM_OS2FILE"); - sFormat = _T("DRF_SYLK"); + sMechanism = wxT("DRM_OS2FILE"); + sFormat = wxT("DRF_SYLK"); break; case wxDF_DIF: - sMechanism = _T("DRM_OS2FILE"); - sFormat = _T("DRF_DIF"); + sMechanism = wxT("DRM_OS2FILE"); + sFormat = wxT("DRF_DIF"); break; case wxDF_DIB: - sMechanism = _T("DRM_OS2FILE"); - sFormat = _T("DRF_DIB"); + sMechanism = wxT("DRM_OS2FILE"); + sFormat = wxT("DRF_DIB"); break; case wxDF_PALETTE: @@ -375,13 +375,13 @@ wxDataFormat wxDropTarget::GetSupportedFormat ( case wxDF_WAVE: case wxDF_UNICODETEXT: case wxDF_LOCALE: - sMechanism = _T("DRM_OS2FILE"); - sFormat = _T("DRF_UNKNOWN"); + sMechanism = wxT("DRM_OS2FILE"); + sFormat = wxT("DRF_UNKNOWN"); break; case wxDF_PRIVATE: - sMechanism = _T("DRM_OBJECT"); - sFormat = _T("DRF_UNKNOWN"); + sMechanism = wxT("DRM_OBJECT"); + sFormat = wxT("DRF_UNKNOWN"); break; } for (i = 0; i < ulItems; i++) @@ -560,7 +560,7 @@ void wxDropSource::Init () ,(void*)pzBuffer ); - wxStrcpy(zFormats, _T("")); + wxStrcpy(zFormats, wxT("")); wxStrcpy(zContainer, GetDataObject()->GetPreferredFormat().GetId()); hStrRMF = ::DrgAddStrHandle((PSZ)zFormats); diff --git a/src/os2/evtloop.cpp b/src/os2/evtloop.cpp index 4525143553..01916125ea 100644 --- a/src/os2/evtloop.cpp +++ b/src/os2/evtloop.cpp @@ -206,7 +206,7 @@ bool wxEventLoopImpl::SendIdleMessage() wxGUIEventLoop::~wxGUIEventLoop() { - wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") ); + wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") ); } ////////////////////////////////////////////////////////////////////////////// @@ -241,7 +241,7 @@ private: int wxGUIEventLoop::Run() { // event loops are not recursive, you need to create another loop! - wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); + wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") ); // SendIdleMessage() and Dispatch() below may throw so the code here should // be exception-safe, hence we must use local objects for all actions we @@ -285,7 +285,7 @@ int wxGUIEventLoop::Run() void wxGUIEventLoop::Exit(int rc) { - wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); + wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") ); m_impl->SetExitCode(rc); @@ -304,7 +304,7 @@ bool wxGUIEventLoop::Pending() const bool wxGUIEventLoop::Dispatch() { - wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") ); + wxCHECK_MSG( IsRunning(), false, wxT("can't call Dispatch() if not running") ); QMSG msg; BOOL bRc = ::WinGetMsg(vHabmain, &msg, (HWND) NULL, 0, 0); diff --git a/src/os2/filedlg.cpp b/src/os2/filedlg.cpp index 8fc737333e..f4fc9da6f1 100644 --- a/src/os2/filedlg.cpp +++ b/src/os2/filedlg.cpp @@ -93,8 +93,8 @@ void wxFileDialog::GetPaths ( size_t nCount = m_fileNames.GetCount(); rasPaths.Empty(); - if (m_dir.Last() != _T('\\')) - sDir += _T('\\'); + if (m_dir.Last() != wxT('\\')) + sDir += wxT('\\'); for ( size_t n = 0; n < nCount; n++ ) { @@ -153,21 +153,21 @@ int wxFileDialog::ShowModal() switch (ch) { - case _T('/'): + case wxT('/'): // // Convert to backslash // - ch = _T('\\'); + ch = wxT('\\'); // // Fall through // - case _T('\\'): + case wxT('\\'): while (i < nLen - 1) { wxChar chNext = m_dir[i + 1]; - if (chNext != _T('\\') && chNext != _T('/')) + if (chNext != wxT('\\') && chNext != wxT('/')) break; // diff --git a/src/os2/font.cpp b/src/os2/font.cpp index ca09caefc3..d4be5633cb 100644 --- a/src/os2/font.cpp +++ b/src/os2/font.cpp @@ -648,7 +648,7 @@ void wxNativeFontInfo::SetStyle( switch (eStyle) { default: - wxFAIL_MSG( _T("unknown font style") ); + wxFAIL_MSG( wxT("unknown font style") ); // fall through case wxFONTSTYLE_NORMAL: @@ -668,7 +668,7 @@ void wxNativeFontInfo::SetWeight( switch (eWeight) { default: - wxFAIL_MSG( _T("unknown font weight") ); + wxFAIL_MSG( wxT("unknown font weight") ); // fall through case wxFONTWEIGHT_NORMAL: @@ -779,14 +779,14 @@ bool wxNativeFontInfo::FromString( const wxString& rsStr ) { long lVal; - wxStringTokenizer vTokenizer(rsStr, _T(";")); + wxStringTokenizer vTokenizer(rsStr, wxT(";")); // // First the version // wxString sToken = vTokenizer.GetNextToken(); - if (sToken != _T('0')) + if (sToken != wxT('0')) return false; sToken = vTokenizer.GetNextToken(); @@ -845,7 +845,7 @@ wxString wxNativeFontInfo::ToString() const { wxString sStr; - sStr.Printf(_T("%d;%ld;%ld;%ld;%d;%d;%d;%d;%d;%ld;%d;%s"), + sStr.Printf(wxT("%d;%ld;%ld;%ld;%d;%d;%d;%d;%d;%ld;%d;%s"), 0, // version, in case we want to change the format later fm.lEmHeight, fa.lAveCharWidth, diff --git a/src/os2/fontutil.cpp b/src/os2/fontutil.cpp index 8883b7305c..ad94caff32 100644 --- a/src/os2/fontutil.cpp +++ b/src/os2/fontutil.cpp @@ -55,7 +55,7 @@ bool wxNativeEncodingInfo::FromString( const wxString& rsStr ) { - wxStringTokenizer vTokenizer(rsStr, _T(";")); + wxStringTokenizer vTokenizer(rsStr, wxT(";")); wxString sEncid = vTokenizer.GetNextToken(); long lEnc; @@ -74,7 +74,7 @@ bool wxNativeEncodingInfo::FromString( const wxString& rsStr ) } else { - if ( wxSscanf(sTmp, _T("%u"), &charset) != 1 ) + if ( wxSscanf(sTmp, wxT("%u"), &charset) != 1 ) { // should be a number! return FALSE; @@ -87,11 +87,11 @@ wxString wxNativeEncodingInfo::ToString() const { wxString sStr; - sStr << (long)encoding << _T(';') << facename; + sStr << (long)encoding << wxT(';') << facename; if (charset != 850) { - sStr << _T(';') << charset; + sStr << wxT(';') << charset; } return sStr; } // end of wxNativeEncodingInfo::ToString @@ -103,7 +103,7 @@ wxString wxNativeEncodingInfo::ToString() const bool wxGetNativeFontEncoding( wxFontEncoding vEncoding, wxNativeEncodingInfo* pInfo ) { - wxCHECK_MSG(pInfo, FALSE, _T("bad pointer in wxGetNativeFontEncoding") ); + wxCHECK_MSG(pInfo, FALSE, wxT("bad pointer in wxGetNativeFontEncoding") ); if (vEncoding == wxFONTENCODING_DEFAULT) { vEncoding = wxFont::GetDefaultEncoding(); @@ -509,7 +509,7 @@ void wxOS2SelectMatchingFontByName( switch (pFont->GetWeight()) { default: - wxFAIL_MSG(_T("unknown font weight")); + wxFAIL_MSG(wxT("unknown font weight")); // fall through usWeightClass = FWEIGHT_DONT_CARE; break; diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index cc78c86abe..bfa1f560b8 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -281,7 +281,7 @@ void wxFrame::PositionStatusBar() { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Error setting parent for StatusBar. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Error setting parent for StatusBar. Error: %s\n"), sError.c_str()); return; } } @@ -405,14 +405,14 @@ void wxFrame::InternalSetMenuBar() { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Error setting parent for submenu. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Error setting parent for submenu. Error: %s\n"), sError.c_str()); } if (!::WinSetOwner(m_hMenu, m_hFrame)) { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Error setting parent for submenu. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Error setting parent for submenu. Error: %s\n"), sError.c_str()); } ::WinSendMsg(m_hFrame, WM_UPDATEFRAME, (MPARAM)FCF_MENU, (MPARAM)0); } // end of wxFrame::InternalSetMenuBar diff --git a/src/os2/gdiimage.cpp b/src/os2/gdiimage.cpp index 06f1951f63..c149132d88 100644 --- a/src/os2/gdiimage.cpp +++ b/src/os2/gdiimage.cpp @@ -42,7 +42,7 @@ WX_DEFINE_LIST(wxGDIImageHandlerList) class WXDLLEXPORT wxBMPFileHandler : public wxBitmapHandler { public: - wxBMPFileHandler() : wxBitmapHandler(_T("Windows bitmap file"), _T("bmp"), + wxBMPFileHandler() : wxBitmapHandler(wxT("Windows bitmap file"), wxT("bmp"), wxBITMAP_TYPE_BMP) { } @@ -81,7 +81,7 @@ private: class WXDLLEXPORT wxBMPResourceHandler: public wxBitmapHandler { public: - wxBMPResourceHandler() : wxBitmapHandler(_T("Windows bitmap resource"), + wxBMPResourceHandler() : wxBitmapHandler(wxT("Windows bitmap resource"), wxEmptyString, wxBITMAP_TYPE_BMP_RESOURCE) { @@ -139,7 +139,7 @@ public: ) { wxIcon* pIcon = wxDynamicCast(pImage, wxIcon); - wxCHECK_MSG(pIcon, false, _T("wxIconHandler only works with icons")); + wxCHECK_MSG(pIcon, false, wxT("wxIconHandler only works with icons")); return LoadIcon( pIcon ,rName @@ -172,8 +172,8 @@ private: class WXDLLEXPORT wxICOFileHandler : public wxIconHandler { public: - wxICOFileHandler() : wxIconHandler(_T("ICO icon file"), - _T("ico"), + wxICOFileHandler() : wxIconHandler(wxT("ICO icon file"), + wxT("ico"), wxBITMAP_TYPE_ICO) { } @@ -193,8 +193,8 @@ private: class WXDLLEXPORT wxICOResourceHandler: public wxIconHandler { public: - wxICOResourceHandler() : wxIconHandler(_T("ICO resource"), - _T("ico"), + wxICOResourceHandler() : wxIconHandler(wxT("ICO resource"), + wxT("ico"), wxBITMAP_TYPE_ICO_RESOURCE) { } diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index 688ccfbf51..51af18eca3 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -294,7 +294,7 @@ int wxListBox::DoInsertItems(const wxArrayStringsAdapter & items, n = (int)::WinSendMsg(GetHwnd(), LM_INSERTITEM, (MPARAM)lIndexType, (MPARAM)items[i].wx_str()); if (n < 0) { - wxLogLastError(_T("WinSendMsg(LM_INSERTITEM)")); + wxLogLastError(wxT("WinSendMsg(LM_INSERTITEM)")); n = wxNOT_FOUND; break; } diff --git a/src/os2/listctrl.cpp b/src/os2/listctrl.cpp index e51c44e271..9439f87459 100644 --- a/src/os2/listctrl.cpp +++ b/src/os2/listctrl.cpp @@ -702,7 +702,7 @@ void ConvertToOS2ListItem ( break; default: - wxFAIL_MSG( _T("wxOS2 does not support more than 10 columns in REPORT view") ); + wxFAIL_MSG( wxT("wxOS2 does not support more than 10 columns in REPORT view") ); break; } } @@ -2220,7 +2220,7 @@ long wxListCtrl::InsertItem ( wxListItem& rInfo ) { - wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual controls") ); + wxASSERT_MSG( !IsVirtual(), wxT("can't be used with virtual controls") ); PFIELDINFO pFieldInfo = FindOS2ListFieldByColNum ( GetHWND() ,rInfo.GetColumn() @@ -2440,7 +2440,7 @@ bool wxListCtrl::SortItems ( wxListCtrlCompare fn, long lData ) ,(PVOID)&vInternalData )) { - wxLogDebug(_T("CM_SORTRECORD failed")); + wxLogDebug(wxT("CM_SORTRECORD failed")); return false; } return true; @@ -2573,7 +2573,7 @@ wxString wxListCtrl::OnGetItemText ( { // this is a pure virtual function, in fact - which is not really pure // because the controls which are not virtual don't need to implement it - wxFAIL_MSG( _T("not supposed to be called") ); + wxFAIL_MSG( wxT("not supposed to be called") ); return wxEmptyString; } // end of wxListCtrl::OnGetItemText @@ -2582,7 +2582,7 @@ int wxListCtrl::OnGetItemImage ( ) const { // same as above - wxFAIL_MSG( _T("not supposed to be called") ); + wxFAIL_MSG( wxT("not supposed to be called") ); return -1; } // end of wxListCtrl::OnGetItemImage @@ -2602,7 +2602,7 @@ wxListItemAttr* wxListCtrl::OnGetItemAttr ( ) const { wxASSERT_MSG( lItem >= 0 && lItem < GetItemCount(), - _T("invalid item index in OnGetItemAttr()") ); + wxT("invalid item index in OnGetItemAttr()") ); // // No attributes by default @@ -2614,7 +2614,7 @@ void wxListCtrl::SetItemCount ( long lCount ) { - wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") ); + wxASSERT_MSG( IsVirtual(), wxT("this is for virtual controls only") ); // // Cannot explicitly set the record count in OS/2 diff --git a/src/os2/menu.cpp b/src/os2/menu.cpp index a2654c5419..065a8a7dc0 100644 --- a/src/os2/menu.cpp +++ b/src/os2/menu.cpp @@ -387,7 +387,7 @@ void wxMenu::EndRadioGroup() wxMenuItem* wxMenu::DoAppend( wxMenuItem* pItem ) { - wxCHECK_MSG( pItem, NULL, _T("NULL item in wxMenu::DoAppend") ); + wxCHECK_MSG( pItem, NULL, wxT("NULL item in wxMenu::DoAppend") ); bool bCheck = false; @@ -428,7 +428,7 @@ wxMenuItem* wxMenu::DoAppend( wxMenuItem* pItem ) } else { - wxFAIL_MSG( _T("where is the radio group start item?") ); + wxFAIL_MSG( wxT("where is the radio group start item?") ); } } } diff --git a/src/os2/menuitem.cpp b/src/os2/menuitem.cpp index 193a679348..bffbf97258 100644 --- a/src/os2/menuitem.cpp +++ b/src/os2/menuitem.cpp @@ -146,7 +146,7 @@ void wxMenuItem::Init() // // Tell the owner drawing code to to show the accel string as well // - SetAccelString(m_text.AfterFirst(_T('\t'))); + SetAccelString(m_text.AfterFirst(wxT('\t'))); #endif // wxUSE_OWNER_DRAWN } // end of wxMenuItem::Init @@ -215,7 +215,7 @@ void wxMenuItem::SetRadioGroupStart( ) { wxASSERT_MSG( !m_bIsRadioGroupStart - ,_T("should only be called for the next radio items") + ,wxT("should only be called for the next radio items") ); m_vRadioGroup.m_nStart = nStart; @@ -226,7 +226,7 @@ void wxMenuItem::SetRadioGroupEnd( ) { wxASSERT_MSG( m_bIsRadioGroupStart - ,_T("should only be called for the first radio item") + ,wxT("should only be called for the first radio item") ); m_vRadioGroup.m_nEnd = nEnd; } // end of wxMenuItem::SetRadioGroupEnd @@ -288,7 +288,7 @@ void wxMenuItem::Check( int nPos = rItems.IndexOf(this); wxCHECK_RET( nPos != wxNOT_FOUND - ,_T("menuitem not found in the menu items list?") + ,wxT("menuitem not found in the menu items list?") ); // @@ -382,9 +382,9 @@ void wxMenuItem::SetItemLabel( const wxString& rText ) OWNER_DRAWN_ONLY(wxOwnerDrawn::SetName(m_text)); #if wxUSE_OWNER_DRAWN if (rText.IsEmpty()) - SetAccelString(m_text.AfterFirst(_T('\t'))); + SetAccelString(m_text.AfterFirst(wxT('\t'))); else - SetAccelString(rText.AfterFirst(_T('\t'))); + SetAccelString(rText.AfterFirst(wxT('\t'))); #endif // wxUSE_OWNER_DRAWN HWND hMenu = GetHmenuOf(m_parentMenu); diff --git a/src/os2/mimetype.cpp b/src/os2/mimetype.cpp index 69cec9db89..1da8b9cbfe 100644 --- a/src/os2/mimetype.cpp +++ b/src/os2/mimetype.cpp @@ -73,9 +73,9 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *WXUNUSED(verb)) const wxLogNull nolog; wxString strKey; - if ( wxRegKey(wxRegKey::HKCR, m_ext + _T("\\shell")).Exists() ) + if ( wxRegKey(wxRegKey::HKCR, m_ext + wxT("\\shell")).Exists() ) strKey = m_ext; - if ( wxRegKey(wxRegKey::HKCR, m_strFileType + _T("\\shell")).Exists() ) + if ( wxRegKey(wxRegKey::HKCR, m_strFileType + wxT("\\shell")).Exists() ) strKey = m_strFileType; if ( !strKey ) @@ -85,7 +85,7 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *WXUNUSED(verb)) const } strKey << wxT("\\shell\\") << verb; - wxRegKey key(wxRegKey::HKCR, strKey + _T("\\command")); + wxRegKey key(wxRegKey::HKCR, strKey + wxT("\\command")); wxString command; if ( key.Open() ) { // it's the default value of the key @@ -114,25 +114,25 @@ wxString wxFileTypeImpl::GetCommand(const wxChar *WXUNUSED(verb)) const #if wxUSE_DDE // look whether we must issue some DDE requests to the application // (and not just launch it) - strKey += _T("\\DDEExec"); + strKey += wxT("\\DDEExec"); wxRegKey keyDDE(wxRegKey::HKCR, strKey); if ( keyDDE.Open() ) { wxString ddeCommand, ddeServer, ddeTopic; - keyDDE.QueryValue(_T(""), ddeCommand); - ddeCommand.Replace(_T("%1"), _T("%s")); + keyDDE.QueryValue(wxT(""), ddeCommand); + ddeCommand.Replace(wxT("%1"), wxT("%s")); - wxRegKey(wxRegKey::HKCR, strKey + _T("\\Application")). - QueryValue(_T(""), ddeServer); - wxRegKey(wxRegKey::HKCR, strKey + _T("\\Topic")). - QueryValue(_T(""), ddeTopic); + wxRegKey(wxRegKey::HKCR, strKey + wxT("\\Application")). + QueryValue(wxT(""), ddeServer); + wxRegKey(wxRegKey::HKCR, strKey + wxT("\\Topic")). + QueryValue(wxT(""), ddeTopic); // HACK: we use a special feature of wxExecute which exists // just because we need it here: it will establish DDE // conversation with the program it just launched - command.Prepend(_T("WX_DDE#")); - command << _T('#') << ddeServer - << _T('#') << ddeTopic - << _T('#') << ddeCommand; + command.Prepend(wxT("WX_DDE#")); + command << wxT('#') << ddeServer + << wxT('#') << ddeTopic + << wxT('#') << ddeCommand; } else #endif // wxUSE_DDE diff --git a/src/os2/pen.cpp b/src/os2/pen.cpp index fbc5e3da21..5c35af15c8 100644 --- a/src/os2/pen.cpp +++ b/src/os2/pen.cpp @@ -219,7 +219,7 @@ bool wxPen::RealizeResource() { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Unable to set current color table to RGB mode. Error: %s\n"), sError.c_str()); return false; } if (M_PENDATA->m_nStyle == wxPENSTYLE_TRANSPARENT) @@ -285,7 +285,7 @@ bool wxPen::RealizeResource() { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Can't set Gpi attributes for a LINEBUNDLE. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Can't set Gpi attributes for a LINEBUNDLE. Error: %s\n"), sError.c_str()); return false; } @@ -370,7 +370,7 @@ bool wxPen::RealizeResource() { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Can't set Gpi attributes for an AREABUNDLE. Error: %s\n"), sError.c_str()); } return (bool)bOk; diff --git a/src/os2/radiobut.cpp b/src/os2/radiobut.cpp index 81d6d46344..677b804d7a 100644 --- a/src/os2/radiobut.cpp +++ b/src/os2/radiobut.cpp @@ -83,7 +83,7 @@ bool wxRadioButton::Create( wxWindow* pParent, if (HasFlag(wxCLIP_SIBLINGS)) lSstyle |= WS_CLIPSIBLINGS; - if (!OS2CreateControl( _T("BUTTON") + if (!OS2CreateControl( wxT("BUTTON") ,lSstyle ,rPos ,rSize @@ -202,7 +202,7 @@ void wxRadioButton::SetValue( bool bValue ) const wxWindowList& rSiblings = GetParent()->GetChildren(); wxWindowList::compatibility_iterator nodeThis = rSiblings.Find(this); - wxCHECK_RET(nodeThis, _T("radio button not a child of its parent?")); + wxCHECK_RET(nodeThis, wxT("radio button not a child of its parent?")); // // If it's not the first item of the group ... diff --git a/src/os2/region.cpp b/src/os2/region.cpp index f84c63dde2..90c7306c8d 100644 --- a/src/os2/region.cpp +++ b/src/os2/region.cpp @@ -260,7 +260,7 @@ bool wxRegion::DoOffset( wxCoord x, wxCoord y ) #if 0 if ( ::OffsetRgn(GetHrgn(), x, y) == ERROR ) { - wxLogLastError(_T("OffsetRgn")); + wxLogLastError(wxT("OffsetRgn")); return false; } @@ -297,7 +297,7 @@ bool wxRegion::DoCombine( const wxRegion& rRegion, wxRegionOp eOp ) break; default: - wxFAIL_MSG( _T("unknown region operation") ); + wxFAIL_MSG( wxT("unknown region operation") ); // fall through case wxRGN_AND: diff --git a/src/os2/settings.cpp b/src/os2/settings.cpp index b384ebb034..89f7710bdc 100644 --- a/src/os2/settings.cpp +++ b/src/os2/settings.cpp @@ -248,7 +248,7 @@ wxFont wxSystemSettingsNative::GetFont( wxFONTWEIGHT_NORMAL ); break; default: - wxFAIL_MSG( _T("stock font not found") ); + wxFAIL_MSG( wxT("stock font not found") ); return GetFont(wxSYS_ANSI_VAR_FONT); } diff --git a/src/os2/snglinst.cpp b/src/os2/snglinst.cpp index eb95aa3c39..f1c4b184b1 100644 --- a/src/os2/snglinst.cpp +++ b/src/os2/snglinst.cpp @@ -67,7 +67,7 @@ public: return true; } else { m_anotherRunning = false; // we don't know for sure in this case - wxLogLastError(_T("DosCreateMutexSem")); + wxLogLastError(wxT("DosCreateMutexSem")); return false; } } @@ -83,7 +83,7 @@ public: { if ( !::DosCloseMutexSem(m_hMutex) ) { - wxLogLastError(_T("DosCloseMutexSem")); + wxLogLastError(wxT("DosCloseMutexSem")); } } } @@ -107,10 +107,10 @@ bool wxSingleInstanceChecker::Create(const wxString& name, const wxString& WXUNUSED(path)) { wxASSERT_MSG( !m_impl, - _T("calling wxSingleInstanceChecker::Create() twice?") ); + wxT("calling wxSingleInstanceChecker::Create() twice?") ); // creating unnamed mutex doesn't have the same semantics! - wxASSERT_MSG( !name.empty(), _T("mutex name can't be empty") ); + wxASSERT_MSG( !name.empty(), wxT("mutex name can't be empty") ); m_impl = new wxSingleInstanceCheckerImpl; @@ -119,7 +119,7 @@ bool wxSingleInstanceChecker::Create(const wxString& name, bool wxSingleInstanceChecker::IsAnotherRunning() const { - wxCHECK_MSG( m_impl, false, _T("must call Create() first") ); + wxCHECK_MSG( m_impl, false, wxT("must call Create() first") ); return m_impl->IsAnotherRunning(); } diff --git a/src/os2/spinctrl.cpp b/src/os2/spinctrl.cpp index 1777cda78b..72d677a720 100644 --- a/src/os2/spinctrl.cpp +++ b/src/os2/spinctrl.cpp @@ -296,7 +296,7 @@ wxSpinCtrl* wxSpinCtrl::GetSpinForTextCtrl( // sanity check wxASSERT_MSG( pSpin->m_hWndBuddy == hWndBuddy, - _T("wxSpinCtrl has incorrect buddy HWND!") ); + wxT("wxSpinCtrl has incorrect buddy HWND!") ); return pSpin; } // end of wxSpinCtrl::GetSpinForTextCtrl diff --git a/src/os2/statbmp.cpp b/src/os2/statbmp.cpp index dd3aff2163..52ba6af126 100644 --- a/src/os2/statbmp.cpp +++ b/src/os2/statbmp.cpp @@ -43,7 +43,7 @@ static wxGDIImage* ConvertImage( if(!bIsIcon ) { wxASSERT_MSG( wxDynamicCast(&rBitmap, wxBitmap), - _T("not an icon and not a bitmap?") ); + wxT("not an icon and not a bitmap?") ); const wxBitmap& rBmp = (const wxBitmap&)rBitmap; wxMask* pMask = rBmp.GetMask(); diff --git a/src/os2/stattext.cpp b/src/os2/stattext.cpp index 1ee58a4b8c..6285c011da 100644 --- a/src/os2/stattext.cpp +++ b/src/os2/stattext.cpp @@ -131,7 +131,7 @@ wxSize wxStaticText::DoGetBestSize() const if (!nHeightLineDefault) nHeightLineDefault = nHeightLine; if (!nHeightLineDefault) - GetTextExtent(_T("W"), NULL, &nHeightLineDefault); + GetTextExtent(wxT("W"), NULL, &nHeightLineDefault); nHeightTextTotal += nHeightLineDefault; } else @@ -162,7 +162,7 @@ wxSize wxStaticText::DoGetBestSize() const // when it is preceded by another '~' in which case it stands for a // literal tilde // - if (*pc == _T('~')) + if (*pc == wxT('~')) { if (!bLastWasTilde) { diff --git a/src/os2/stdpaths.cpp b/src/os2/stdpaths.cpp index f7ba58488b..230297cbab 100644 --- a/src/os2/stdpaths.cpp +++ b/src/os2/stdpaths.cpp @@ -56,7 +56,7 @@ wxString wxStandardPaths::GetInstallPrefix() const { wxStandardPaths *self = const_cast(this); - self->m_prefix = _T("/usr/local"); + self->m_prefix = wxT("/usr/local"); } return m_prefix; } @@ -77,12 +77,12 @@ wxString wxStandardPaths::GetUserConfigDir() const wxString wxStandardPaths::GetDataDir() const { - return GetInstallPrefix() + _T("\\data"); + return GetInstallPrefix() + wxT("\\data"); } wxString wxStandardPaths::GetUserDataDir() const { - return AppendAppInfo(wxFileName::GetHomeDir() + _T("\\.")); + return AppendAppInfo(wxFileName::GetHomeDir() + wxT("\\.")); } wxString wxStandardPaths::GetPluginsDir() const diff --git a/src/os2/textctrl.cpp b/src/os2/textctrl.cpp index 88178bf957..a3ae1dcb3e 100644 --- a/src/os2/textctrl.cpp +++ b/src/os2/textctrl.cpp @@ -718,7 +718,7 @@ void wxTextCtrl::MarkDirty() ::WinSendMsg(GetHwnd(), MLM_SETCHANGED, MPFROMLONG(TRUE), 0); else // EM controls do not have a SETCHANGED, what can we do?? - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); } // diff --git a/src/os2/thread.cpp b/src/os2/thread.cpp index e83ecc0ca9..e4d1387488 100644 --- a/src/os2/thread.cpp +++ b/src/os2/thread.cpp @@ -125,7 +125,7 @@ wxMutexInternal::~wxMutexInternal() { if (::DosCloseMutexSem(m_vMutex)) { - wxLogLastError(_T("DosCloseMutexSem(mutex)")); + wxLogLastError(wxT("DosCloseMutexSem(mutex)")); } } } @@ -221,7 +221,7 @@ wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount) ulrc = ::DosCreateMutexSem(NULL, &m_vMutex, 0L, FALSE); if (ulrc != 0) { - wxLogLastError(_T("DosCreateMutexSem()")); + wxLogLastError(wxT("DosCreateMutexSem()")); m_vMutex = NULL; m_vEvent = NULL; return; @@ -229,7 +229,7 @@ wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount) ulrc = ::DosCreateEventSem(NULL, &m_vEvent, 0L, FALSE); if ( ulrc != 0) { - wxLogLastError(_T("DosCreateEventSem()")); + wxLogLastError(wxT("DosCreateEventSem()")); ::DosCloseMutexSem(m_vMutex); m_vMutex = NULL; m_vEvent = NULL; @@ -244,11 +244,11 @@ wxSemaphoreInternal::~wxSemaphoreInternal() { if ( ::DosCloseEventSem(m_vEvent) ) { - wxLogLastError(_T("DosCloseEventSem(semaphore)")); + wxLogLastError(wxT("DosCloseEventSem(semaphore)")); } if ( ::DosCloseMutexSem(m_vMutex) ) { - wxLogLastError(_T("DosCloseMutexSem(semaphore)")); + wxLogLastError(wxT("DosCloseMutexSem(semaphore)")); } else m_vEvent = NULL; @@ -272,7 +272,7 @@ wxSemaError wxSemaphoreInternal::WaitTimeout(unsigned long ulMilliseconds) return wxSEMA_TIMEOUT; default: - wxLogLastError(_T("DosWaitEventSem(semaphore)")); + wxLogLastError(wxT("DosWaitEventSem(semaphore)")); return wxSEMA_MISC_ERROR; } ulrc = :: DosRequestMutexSem(m_vMutex, ulMilliseconds); @@ -332,7 +332,7 @@ wxSemaError wxSemaphoreInternal::Post() return wxSEMA_OVERFLOW; if ( ulrc != NO_ERROR && ulrc != ERROR_ALREADY_POSTED ) { - wxLogLastError(_T("DosPostEventSem(semaphore)")); + wxLogLastError(wxT("DosPostEventSem(semaphore)")); return wxSEMA_MISC_ERROR; } @@ -582,7 +582,7 @@ wxThreadIdType wxThread::GetCurrentId() bool wxThread::SetConcurrency(size_t level) { - wxASSERT_MSG( IsMain(), _T("should only be called from the main thread") ); + wxASSERT_MSG( IsMain(), wxT("should only be called from the main thread") ); // ok only for the default one if ( level == 0 ) @@ -666,7 +666,7 @@ wxThread::ExitCode wxThread::Wait() // although under Windows we can wait for any thread, it's an error to // wait for a detached one in wxWin API wxCHECK_MSG( !IsDetached(), (ExitCode)-1, - _T("can't wait for detached thread") ); + wxT("can't wait for detached thread") ); ExitCode rc = (ExitCode)-1; (void)Delete(&rc); return(rc); diff --git a/src/os2/toolbar.cpp b/src/os2/toolbar.cpp index ebceb00abb..8ebc9a0f3e 100644 --- a/src/os2/toolbar.cpp +++ b/src/os2/toolbar.cpp @@ -935,7 +935,7 @@ void wxToolBar::SetRows( int nRows ) { - wxCHECK_RET( nRows != 0, _T("max number of rows must be > 0") ); + wxCHECK_RET( nRows != 0, wxT("max number of rows must be > 0") ); m_maxCols = (GetToolsCount() + nRows - 1) / nRows; Refresh(); diff --git a/src/os2/tooltip.cpp b/src/os2/tooltip.cpp index 39481333bb..685cf02339 100644 --- a/src/os2/tooltip.cpp +++ b/src/os2/tooltip.cpp @@ -72,7 +72,7 @@ void wxToolTip::Create( ); if (!m_hWnd) { - wxLogError(_T("Unable to create tooltip window")); + wxLogError(wxT("Unable to create tooltip window")); } wxColour vColor( wxT("YELLOW") ); diff --git a/src/os2/toplevel.cpp b/src/os2/toplevel.cpp index 38d204d14b..cdde443bac 100644 --- a/src/os2/toplevel.cpp +++ b/src/os2/toplevel.cpp @@ -162,7 +162,7 @@ void wxTopLevelWindowOS2::OnActivate( // // Restore focus to the child which was last focused // - wxLogTrace(_T("focus"), _T("wxTLW %08lx activated."), m_hWnd); + wxLogTrace(wxT("focus"), wxT("wxTLW %08lx activated."), m_hWnd); wxWindow* pParent = m_pWinLastFocused ? m_pWinLastFocused->GetParent() : NULL; @@ -200,8 +200,8 @@ void wxTopLevelWindowOS2::OnActivate( pWin = pWin->GetParent(); } - wxLogTrace(_T("focus"), - _T("wxTLW %08lx deactivated, last focused: %08lx."), + wxLogTrace(wxT("focus"), + wxT("wxTLW %08lx deactivated, last focused: %08lx."), m_hWnd, m_pWinLastFocused ? GetHwndOf(m_pWinLastFocused) : NULL); @@ -281,7 +281,7 @@ WXHWND wxTopLevelWindowOS2::OS2GetParent() const // // This flag doesn't make sense then and will be ignored // - wxFAIL_MSG( _T("wxFRAME_FLOAT_ON_PARENT but no parent?") ); + wxFAIL_MSG( wxT("wxFRAME_FLOAT_ON_PARENT but no parent?") ); } else { @@ -495,7 +495,7 @@ bool wxTopLevelWindowOS2::CreateFrame( const wxString& rsTitle, { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Error creating frame. Error: %s\n"), sError.c_str()); return false; } @@ -519,7 +519,7 @@ bool wxTopLevelWindowOS2::CreateFrame( const wxString& rsTitle, { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Error creating frame. Error: %s\n"), sError.c_str()); return false; } @@ -588,7 +588,7 @@ bool wxTopLevelWindowOS2::CreateFrame( const wxString& rsTitle, { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Error sizing frame. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Error sizing frame. Error: %s\n"), sError.c_str()); return false; } lStyle = ::WinQueryWindowULong( m_hWnd @@ -1041,7 +1041,7 @@ bool wxTopLevelWindowOS2::EnableCloseButton( bool bEnable ) if (!hMenu) { - wxLogLastError(_T("GetSystemMenu")); + wxLogLastError(wxT("GetSystemMenu")); return false; } @@ -1093,7 +1093,7 @@ void wxTLWHiddenParentModule::OnExit() { if (!::WinDestroyWindow(m_shWnd)) { - wxLogLastError(_T("DestroyWindow(hidden TLW parent)")); + wxLogLastError(wxT("DestroyWindow(hidden TLW parent)")); } m_shWnd = NULL; } @@ -1108,7 +1108,7 @@ HWND wxTLWHiddenParentModule::GetHWND() { if (!m_szClassName) { - static const wxChar* zHIDDEN_PARENT_CLASS = _T("wxTLWHiddenParent"); + static const wxChar* zHIDDEN_PARENT_CLASS = wxT("wxTLWHiddenParent"); if (!::WinRegisterClass( wxGetInstance() ,(PSZ)zHIDDEN_PARENT_CLASS @@ -1117,7 +1117,7 @@ HWND wxTLWHiddenParentModule::GetHWND() ,sizeof(ULONG) )) { - wxLogLastError(_T("RegisterClass(\"wxTLWHiddenParent\")")); + wxLogLastError(wxT("RegisterClass(\"wxTLWHiddenParent\")")); } else { @@ -1139,7 +1139,7 @@ HWND wxTLWHiddenParentModule::GetHWND() NULL ); if (!m_shWnd) { - wxLogLastError(_T("CreateWindow(hidden TLW parent)")); + wxLogLastError(wxT("CreateWindow(hidden TLW parent)")); } } return m_shWnd; diff --git a/src/os2/utils.cpp b/src/os2/utils.cpp index 5a03ba30f3..093e192362 100644 --- a/src/os2/utils.cpp +++ b/src/os2/utils.cpp @@ -50,8 +50,8 @@ extern "C" #include #endif -static const wxChar WX_SECTION[] = _T("wxWidgets"); -static const wxChar eHOSTNAME[] = _T("HostName"); +static const wxChar WX_SECTION[] = wxT("wxWidgets"); +static const wxChar eHOSTNAME[] = wxT("HostName"); // For the following functions we SHOULD fill in support // for Windows-NT (which I don't know) as I assume it begin @@ -81,10 +81,10 @@ bool wxGetHostName( wxChar* zBuf, int nMaxSize ) strcpy(zBuf, zServer); #else wxChar* zSysname; - const wxChar* zDefaultHost = _T("noname"); + const wxChar* zDefaultHost = wxT("noname"); - if ((zSysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL && - (zSysname = wxGetenv(_T("HOSTNAME"))) == NULL) + if ((zSysname = wxGetenv(wxT("SYSTEM_NAME"))) == NULL && + (zSysname = wxGetenv(wxT("HOSTNAME"))) == NULL) { ::PrfQueryProfileString( HINI_PROFILE ,(PSZ)WX_SECTION @@ -93,7 +93,7 @@ bool wxGetHostName( wxChar* zBuf, int nMaxSize ) ,(void*)zBuf ,(ULONG)nMaxSize - 1 ); - zBuf[nMaxSize] = _T('\0'); + zBuf[nMaxSize] = wxT('\0'); } else { @@ -120,7 +120,7 @@ bool wxGetUserName( wxChar* zBuf, int nMaxSize ) #ifdef USE_NET_API wxGetUserId( zBuf, nMaxSize ); #else - wxStrlcpy(zBuf, _T("Unknown User"), nMaxSize); + wxStrlcpy(zBuf, wxT("Unknown User"), nMaxSize); #endif return true; } @@ -138,7 +138,7 @@ int wxKill(long lPid, // bool wxShell( const wxString& rCommand ) { - wxChar* zShell = _T("CMD.EXE"); + wxChar* zShell = wxT("CMD.EXE"); wxString sInputs; STARTDATA SData = {0}; PSZ PgmTitle = "Command Shell"; @@ -155,7 +155,7 @@ bool wxShell( const wxString& rCommand ) SData.PgmTitle = PgmTitle; SData.PgmName = (char*)zShell; - sInputs = _T("/C ") + rCommand; + sInputs = wxT("/C ") + rCommand; SData.PgmInputs = (BYTE*)sInputs.wx_str(); SData.TermQ = 0; SData.Environment = 0; @@ -245,14 +245,14 @@ static bool wxDoSetEnv(const wxString& variable, const char *value) #ifdef HAVE_UNSETENV return unsetenv(variable.mb_str()) == 0; #else - value = _T(""); // mustn't pass NULL to setenv() + value = wxT(""); // mustn't pass NULL to setenv() #endif } return setenv(variable.mb_str(), value, 1 /* overwrite */) == 0; #elif defined(HAVE_PUTENV) wxString s = variable; if ( value ) - s << _T('=') << value; + s << wxT('=') << value; // transform to ANSI const char *p = s.mb_str(); @@ -314,7 +314,7 @@ void wxBell() wxString wxGetOsDescription() { - wxString strVer(_T("OS/2")); + wxString strVer(wxT("OS/2")); ULONG ulSysInfo = 0; if (::DosQuerySysInfo( QSV_VERSION_MINOR, @@ -324,7 +324,7 @@ wxString wxGetOsDescription() ) == 0L ) { wxString ver; - ver.Printf( _T(" ver. %d.%d"), + ver.Printf( wxT(" ver. %d.%d"), int(ulSysInfo / 10), int(ulSysInfo % 10) ); @@ -416,11 +416,11 @@ wxString wxGetUserHome ( const wxString &rUser ) // Guests belong in the temp dir if ( currentUser == "annonymous" ) { - zHome = wxGetenv(_T("TMP")); + zHome = wxGetenv(wxT("TMP")); if ( !zHome ) - zHome = wxGetenv(_T("TMPDIR")); + zHome = wxGetenv(wxT("TMPDIR")); if ( !zHome ) - zHome = wxGetenv(_T("TEMP")); + zHome = wxGetenv(wxT("TEMP")); if ( zHome && *zHome ) return zHome; @@ -432,7 +432,7 @@ wxString wxGetUserHome ( const wxString &rUser ) #endif if (sUser.empty()) { - if ((zHome = wxGetenv(_T("HOME"))) != NULL) + if ((zHome = wxGetenv(wxT("HOME"))) != NULL) { home = zHome; home.Replace("/", "\\"); @@ -459,7 +459,7 @@ bool wxGetDiskSpace(const wxString& path, if (wxDirExists(fn.GetFullPath()) == false) return false; - disknum = wxToupper(fn.GetVolume().GetChar(0)) - _T('A') + 1; + disknum = wxToupper(fn.GetVolume().GetChar(0)) - wxT('A') + 1; rc = ::DosQueryFSInfo(disknum, // 1 = A, 2 = B, 3 = C, ... FSIL_ALLOC, // allocation info diff --git a/src/os2/utilsgui.cpp b/src/os2/utilsgui.cpp index 79b584d217..3dd1537208 100644 --- a/src/os2/utilsgui.cpp +++ b/src/os2/utilsgui.cpp @@ -82,7 +82,7 @@ void wxBeginBusyCursor(const wxCursor* pCursor) void wxEndBusyCursor() { wxCHECK_RET( gs_wxBusyCursorCount > 0 - ,_T("no matching wxBeginBusyCursor() for wxEndBusyCursor()") + ,wxT("no matching wxBeginBusyCursor() for wxEndBusyCursor()") ); if (--gs_wxBusyCursorCount == 0) @@ -116,7 +116,7 @@ bool wxCheckForInterrupt( wxWindow* pWnd ) } else { - wxFAIL_MSG(_T("pWnd==NULL !!!")); + wxFAIL_MSG(wxT("pWnd==NULL !!!")); return false;//*** temporary? } } diff --git a/src/os2/window.cpp b/src/os2/window.cpp index 4d3522e857..240666554d 100644 --- a/src/os2/window.cpp +++ b/src/os2/window.cpp @@ -386,7 +386,7 @@ bool wxWindowOS2::Create( wxWindow* pParent, // static box // wxASSERT_MSG( !wxDynamicCast(pParent, wxStaticBox), - _T("wxStaticBox can't be used as a window parent!") ); + wxT("wxStaticBox can't be used as a window parent!") ); #endif // wxUSE_STATBOX // Ensure groupbox backgrounds are painted @@ -456,7 +456,7 @@ bool wxWindowOS2::Create( wxWindow* pParent, void wxWindowOS2::SetFocus() { HWND hWnd = GetHwnd(); - wxCHECK_RET( hWnd, _T("can't set focus to invalid window") ); + wxCHECK_RET( hWnd, wxT("can't set focus to invalid window") ); if (hWnd) ::WinSetFocus(HWND_DESKTOP, hWnd); @@ -2855,7 +2855,7 @@ void wxAssociateWinWithHandle( { wxString Newstr(pWin->GetClassInfo()->GetClassName()); wxString Oldstr(pOldWin->GetClassInfo()->GetClassName()); - wxLogError( _T("Bug! New window of class %s has same HWND %X as old window of class %s"), + wxLogError( wxT("Bug! New window of class %s has same HWND %X as old window of class %s"), Newstr.c_str(), (int)hWnd, Oldstr.c_str() @@ -3001,7 +3001,7 @@ bool wxWindowOS2::OS2Create( PSZ zClass, { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Error creating frame. Error: %s\n"), sError.c_str()); + wxLogError(wxT("Error creating frame. Error: %s\n"), sError.c_str()); return false; } SetSize( nX @@ -3240,7 +3240,7 @@ bool wxWindowOS2::OS2OnDrawItem( int vId, { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Unable to set current color table (1). Error: %s\n"), sError.c_str()); + wxLogError(wxT("Unable to set current color table (1). Error: %s\n"), sError.c_str()); } // // Set the color table to RGB mode @@ -3255,7 +3255,7 @@ bool wxWindowOS2::OS2OnDrawItem( int vId, { vError = ::WinGetLastError(vHabmain); sError = wxPMErrorToStr(vError); - wxLogError(_T("Unable to set current color table (2). Error: %s\n"), sError.c_str()); + wxLogError(wxT("Unable to set current color table (2). Error: %s\n"), sError.c_str()); } wxCHECK( pMenuItem->IsKindOf(CLASSINFO(wxMenuItem)), FALSE ); diff --git a/src/osx/artmac.cpp b/src/osx/artmac.cpp index 9142c143e8..8320c6f6a2 100644 --- a/src/osx/artmac.cpp +++ b/src/osx/artmac.cpp @@ -49,7 +49,7 @@ protected: #define CREATE_STD_ICON(iconId, xpmRc) \ { \ - wxIconBundle icon(_T(iconId), wxBITMAP_TYPE_ICON_RESOURCE); \ + wxIconBundle icon(wxT(iconId), wxBITMAP_TYPE_ICON_RESOURCE); \ return icon; \ } diff --git a/src/osx/brush.cpp b/src/osx/brush.cpp index aa05b6bd90..4d14ee0eec 100644 --- a/src/osx/brush.cpp +++ b/src/osx/brush.cpp @@ -140,21 +140,21 @@ wxGDIRefData *wxBrush::CloneGDIRefData(const wxGDIRefData *data) const wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->GetColour(); } wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->GetStyle(); } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, _T("invalid brush") ); + wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); return M_BRUSHDATA->GetStipple(); } diff --git a/src/osx/carbon/app.cpp b/src/osx/carbon/app.cpp index 8b8345022c..b831bc2bc3 100644 --- a/src/osx/carbon/app.cpp +++ b/src/osx/carbon/app.cpp @@ -799,7 +799,7 @@ bool wxApp::Initialize(int& argc, wxChar **argv) // application (otherwise applications would need to handle it) if ( argc > 1 ) { - static const wxChar *ARG_PSN = _T("-psn_"); + static const wxChar *ARG_PSN = wxT("-psn_"); if ( wxStrncmp(argv[1], ARG_PSN, wxStrlen(ARG_PSN)) == 0 ) { // remove this argument diff --git a/src/osx/carbon/clipbrd.cpp b/src/osx/carbon/clipbrd.cpp index 8bc1f65703..a534352a9c 100644 --- a/src/osx/carbon/clipbrd.cpp +++ b/src/osx/carbon/clipbrd.cpp @@ -36,7 +36,7 @@ // the trace mask we use with wxLogTrace() - call // wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here // (there will be a *lot* of them!) -#define TRACE_CLIPBOARD _T("clipboard") +#define TRACE_CLIPBOARD wxT("clipboard") IMPLEMENT_DYNAMIC_CLASS(wxClipboard, wxObject) diff --git a/src/osx/carbon/dcclient.cpp b/src/osx/carbon/dcclient.cpp index 9c165badcb..6d3d5de47b 100644 --- a/src/osx/carbon/dcclient.cpp +++ b/src/osx/carbon/dcclient.cpp @@ -150,7 +150,7 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner ) wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) : wxWindowDCImpl( owner, window ) { - wxCHECK_RET( window, _T("invalid window in wxClientDCImpl") ); + wxCHECK_RET( window, wxT("invalid window in wxClientDCImpl") ); wxPoint origin = window->GetClientAreaOrigin() ; m_window->GetClientSize( &m_width , &m_height); if ( !m_window->IsShownOnScreen() ) @@ -177,7 +177,7 @@ wxPaintDCImpl::wxPaintDCImpl( wxDC *owner ) wxPaintDCImpl::wxPaintDCImpl( wxDC *owner, wxWindow *window ) : wxWindowDCImpl( owner, window ) { - wxASSERT_MSG( window->MacGetCGContextRef() != NULL, _T("using wxPaintDC without being in a native paint event") ); + wxASSERT_MSG( window->MacGetCGContextRef() != NULL, wxT("using wxPaintDC without being in a native paint event") ); wxPoint origin = window->GetClientAreaOrigin() ; m_window->GetClientSize( &m_width , &m_height); SetDeviceOrigin( origin.x, origin.y ); diff --git a/src/osx/carbon/dcprint.cpp b/src/osx/carbon/dcprint.cpp index 08033ff558..40b1543e60 100644 --- a/src/osx/carbon/dcprint.cpp +++ b/src/osx/carbon/dcprint.cpp @@ -391,7 +391,7 @@ void wxPrinterDCImpl::EndPage() void wxPrinterDCImpl::DoGetSize(int *width, int *height) const { - wxCHECK_RET( m_ok , _T("GetSize() doesn't work without a valid wxPrinterDC") ); + wxCHECK_RET( m_ok , wxT("GetSize() doesn't work without a valid wxPrinterDC") ); m_nativePrinterDC->GetSize(width, height ) ; } diff --git a/src/osx/carbon/dirmac.cpp b/src/osx/carbon/dirmac.cpp index 06ccef1960..1fabdec5cd 100644 --- a/src/osx/carbon/dirmac.cpp +++ b/src/osx/carbon/dirmac.cpp @@ -77,7 +77,7 @@ wxDirData::wxDirData(const wxString& dirname) { // throw away the trailing slashes size_t n = m_dirname.length(); - wxCHECK_RET( n, _T("empty dir name in wxDir") ); + wxCHECK_RET( n, wxT("empty dir name in wxDir") ); while ( n > 0 && wxIsPathSeparator(m_dirname[--n]) ) ; @@ -225,7 +225,7 @@ wxString wxDir::GetName() const if ( m_data ) { name = m_data->GetName(); - if ( !name.empty() && (name.Last() == _T('/')) ) + if ( !name.empty() && (name.Last() == wxT('/')) ) { // chop off the last (back)slash name.Truncate(name.length() - 1); @@ -249,7 +249,7 @@ bool wxDir::GetFirst(wxString *filename, const wxString& filespec, int flags) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); m_data->Rewind(); @@ -261,9 +261,9 @@ bool wxDir::GetFirst(wxString *filename, bool wxDir::GetNext(wxString *filename) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); - wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") ); + wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") ); return m_data->Read(filename); } diff --git a/src/osx/carbon/font.cpp b/src/osx/carbon/font.cpp index 3295417d81..c37e0c8f1e 100644 --- a/src/osx/carbon/font.cpp +++ b/src/osx/carbon/font.cpp @@ -1147,7 +1147,7 @@ bool wxNativeFontInfo::FromString(const wxString& s) { long l; - wxStringTokenizer tokenizer(s, _T(";")); + wxStringTokenizer tokenizer(s, wxT(";")); wxString token = tokenizer.GetNextToken(); // @@ -1198,7 +1198,7 @@ wxString wxNativeFontInfo::ToString() const { wxString s; - s.Printf(_T("%d;%d;%d;%d;%d;%d;%s;%d"), + s.Printf(wxT("%d;%d;%d;%d;%d;%d;%s;%d"), 0, // version m_pointSize, m_family, diff --git a/src/osx/carbon/fontdlg.cpp b/src/osx/carbon/fontdlg.cpp index 54f7971d0f..1e83fe0ee2 100644 --- a/src/osx/carbon/fontdlg.cpp +++ b/src/osx/carbon/fontdlg.cpp @@ -512,7 +512,7 @@ void wxFontDialog::CreateControls() wxStaticText* itemStaticText8 = new wxStaticText( itemDialog1, wxID_STATIC, _("Size:"), wxDefaultPosition, wxDefaultSize, 0 ); itemFlexGridSizer4->Add(itemStaticText8, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_sizeCtrl = new wxSpinCtrl( itemDialog1, wxID_FONTDIALOG_FONTSIZE, _T("12"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 300, 12 ); + m_sizeCtrl = new wxSpinCtrl( itemDialog1, wxID_FONTDIALOG_FONTSIZE, wxT("12"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 300, 12 ); m_sizeCtrl->SetHelpText(_("The font size in points.")); if (ShowToolTips()) m_sizeCtrl->SetToolTip(_("The font size in points.")); diff --git a/src/osx/carbon/graphics.cpp b/src/osx/carbon/graphics.cpp index b446fc502c..b3fc827537 100644 --- a/src/osx/carbon/graphics.cpp +++ b/src/osx/carbon/graphics.cpp @@ -1602,7 +1602,7 @@ bool wxMacCoreGraphicsContext::EnsureIsValid() if ( wxOSXLockFocus(m_view) ) { m_cgContext = wxOSXGetContextFromCurrentContext(); - wxASSERT_MSG( m_cgContext != NULL, _T("Unable to retrieve drawing context from View")); + wxASSERT_MSG( m_cgContext != NULL, wxT("Unable to retrieve drawing context from View")); } else { diff --git a/src/osx/carbon/listctrl_mac.cpp b/src/osx/carbon/listctrl_mac.cpp index 668d141a0a..97ecc4ffe6 100644 --- a/src/osx/carbon/listctrl_mac.cpp +++ b/src/osx/carbon/listctrl_mac.cpp @@ -495,7 +495,7 @@ void wxListCtrlTextCtrlWrapper::OnKeyUp( wxKeyEvent &event ) wxPoint myPos = m_text->GetPosition(); wxSize mySize = m_text->GetSize(); int sx, sy; - m_text->GetTextExtent(m_text->GetValue() + _T("MM"), &sx, &sy); + m_text->GetTextExtent(m_text->GetValue() + wxT("MM"), &sx, &sy); if (myPos.x + sx > parentSize.x) sx = parentSize.x - myPos.x; if (mySize.x > sx) @@ -933,7 +933,7 @@ bool wxListCtrl::GetColumn(int col, wxListItem& item) const if (m_dbImpl) { wxColumnList::compatibility_iterator node = m_colsInfo.Item( col ); - wxASSERT_MSG( node, _T("invalid column index in wxMacListCtrlItem") ); + wxASSERT_MSG( node, wxT("invalid column index in wxMacListCtrlItem") ); wxListItem* column = node->GetData(); long mask = column->GetMask(); @@ -962,7 +962,7 @@ bool wxListCtrl::SetColumn(int col, wxListItem& item) if (m_dbImpl) { - wxASSERT_MSG( col < (int)m_colsInfo.GetCount(), _T("invalid column index in wxMacListCtrlItem") ); + wxASSERT_MSG( col < (int)m_colsInfo.GetCount(), wxT("invalid column index in wxMacListCtrlItem") ); long mask = item.GetMask(); { @@ -1392,7 +1392,7 @@ bool wxListCtrl::SetItemPtrData(long item, wxUIntPtr data) wxRect wxListCtrl::GetViewRect() const { wxASSERT_MSG( !HasFlag(wxLC_REPORT | wxLC_LIST), - _T("wxListCtrl::GetViewRect() only works in icon mode") ); + wxT("wxListCtrl::GetViewRect() only works in icon mode") ); if (m_genericImpl) return m_genericImpl->GetViewRect(); @@ -2076,7 +2076,7 @@ int wxListCtrl::GetScrollPos(int orient) const // -1 otherwise. long wxListCtrl::InsertItem(wxListItem& info) { - wxASSERT_MSG( !IsVirtual(), _T("can't be used with virtual controls") ); + wxASSERT_MSG( !IsVirtual(), wxT("can't be used with virtual controls") ); if (m_genericImpl) return m_genericImpl->InsertItem(info); @@ -2289,7 +2289,7 @@ wxString wxListCtrl::OnGetItemText(long WXUNUSED(item), long WXUNUSED(col)) cons { // this is a pure virtual function, in fact - which is not really pure // because the controls which are not virtual don't need to implement it - wxFAIL_MSG( _T("wxListCtrl::OnGetItemText not supposed to be called") ); + wxFAIL_MSG( wxT("wxListCtrl::OnGetItemText not supposed to be called") ); return wxEmptyString; } @@ -2313,7 +2313,7 @@ int wxListCtrl::OnGetItemColumnImage(long item, long column) const wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) const { wxASSERT_MSG( item >= 0 && item < GetItemCount(), - _T("invalid item index in OnGetItemAttr()") ); + wxT("invalid item index in OnGetItemAttr()") ); // no attributes by default return NULL; @@ -2321,7 +2321,7 @@ wxListItemAttr *wxListCtrl::OnGetItemAttr(long WXUNUSED_UNLESS_DEBUG(item)) cons void wxListCtrl::SetItemCount(long count) { - wxASSERT_MSG( IsVirtual(), _T("this is for virtual controls only") ); + wxASSERT_MSG( IsVirtual(), wxT("this is for virtual controls only") ); if (m_genericImpl) { @@ -3210,7 +3210,7 @@ wxMacDataBrowserListCtrlControl::~wxMacDataBrowserListCtrlControl() void wxMacDataBrowserListCtrlControl::MacSetColumnInfo( unsigned int row, unsigned int column, wxListItem* item ) { wxMacDataItem* dataItem = GetItemFromLine(row); - wxASSERT_MSG( dataItem, _T("could not obtain wxMacDataItem for row in MacSetColumnInfo. Is row a valid wxListCtrl row?") ); + wxASSERT_MSG( dataItem, wxT("could not obtain wxMacDataItem for row in MacSetColumnInfo. Is row a valid wxListCtrl row?") ); if (item) { wxMacListCtrlItem* listItem = static_cast(dataItem); @@ -3256,7 +3256,7 @@ void wxMacDataBrowserListCtrlControl::UpdateState(wxMacDataItem* dataItem, wxLis void wxMacDataBrowserListCtrlControl::MacGetColumnInfo( unsigned int row, unsigned int column, wxListItem& item ) { wxMacDataItem* dataItem = GetItemFromLine(row); - wxASSERT_MSG( dataItem, _T("could not obtain wxMacDataItem in MacGetColumnInfo. Is row a valid wxListCtrl row?") ); + wxASSERT_MSG( dataItem, wxT("could not obtain wxMacDataItem in MacGetColumnInfo. Is row a valid wxListCtrl row?") ); // CS should this guard against dataItem = 0 ? , as item is not a pointer if (item) is not appropriate //if (item) { @@ -3346,7 +3346,7 @@ void wxMacListCtrlItem::SetColumnTextValue( unsigned int column, const wxString& wxListItem* wxMacListCtrlItem::GetColumnInfo( unsigned int column ) { - wxASSERT_MSG( HasColumnInfo(column), _T("invalid column index in wxMacListCtrlItem") ); + wxASSERT_MSG( HasColumnInfo(column), wxT("invalid column index in wxMacListCtrlItem") ); return m_rowItems[column]; } diff --git a/src/osx/carbon/region.cpp b/src/osx/carbon/region.cpp index ef66179aa0..8a4b131db8 100644 --- a/src/osx/carbon/region.cpp +++ b/src/osx/carbon/region.cpp @@ -183,7 +183,7 @@ void wxRegion::Clear() // Move the region bool wxRegion::DoOffset(wxCoord x, wxCoord y) { - wxCHECK_MSG( M_REGION, false, _T("invalid wxRegion") ); + wxCHECK_MSG( M_REGION, false, wxT("invalid wxRegion") ); if ( !x && !y ) // nothing to do @@ -198,7 +198,7 @@ bool wxRegion::DoOffset(wxCoord x, wxCoord y) //! Union /e region with this. bool wxRegion::DoCombine(const wxRegion& region, wxRegionOp op) { - wxCHECK_MSG( region.Ok(), false, _T("invalid wxRegion") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid wxRegion") ); // Don't change shared data if (!m_refData) @@ -250,7 +250,7 @@ bool wxRegion::DoCombine(const wxRegion& region, wxRegionOp op) bool wxRegion::DoIsEqual(const wxRegion& WXUNUSED(region)) const { - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); return false; } diff --git a/src/osx/carbon/settings.cpp b/src/osx/carbon/settings.cpp index b7608a7e25..37421f5904 100644 --- a/src/osx/carbon/settings.cpp +++ b/src/osx/carbon/settings.cpp @@ -143,7 +143,7 @@ wxColour wxSystemSettingsNative::GetColour(wxSystemColour index) // case wxSYS_COLOUR_MAX: default: resultColor = *wxWHITE; - // wxCHECK_MSG( index >= wxSYS_COLOUR_MAX, false, _T("unknown system colour index") ); + // wxCHECK_MSG( index >= wxSYS_COLOUR_MAX, false, wxT("unknown system colour index") ); break ; } diff --git a/src/osx/carbon/textctrl.cpp b/src/osx/carbon/textctrl.cpp index e0089b8859..0d71b376f6 100644 --- a/src/osx/carbon/textctrl.cpp +++ b/src/osx/carbon/textctrl.cpp @@ -744,11 +744,11 @@ wxString wxMacMLTEControl::GetStringValue() const (((UniChar*)*theText)[actualSize]) = 0 ; wxMBConvUTF16 converter ; size_t noChars = converter.MB2WC( NULL , (const char*)*theText , 0 ) ; - wxASSERT_MSG( noChars != wxCONV_FAILED, _T("Unable to count the number of characters in this string!") ); + wxASSERT_MSG( noChars != wxCONV_FAILED, wxT("Unable to count the number of characters in this string!") ); ptr = new wxChar[noChars + 1] ; noChars = converter.MB2WC( ptr , (const char*)*theText , noChars + 1 ) ; - wxASSERT_MSG( noChars != wxCONV_FAILED, _T("Conversion of string failed!") ); + wxASSERT_MSG( noChars != wxCONV_FAILED, wxT("Conversion of string failed!") ); ptr[noChars] = 0 ; HUnlock( theText ) ; #endif @@ -1371,7 +1371,7 @@ void wxMacMLTEControl::ShowPosition( long pos ) // there will be an error returned for classic MLTE implementation when the control is // invisible, but HITextView works correctly, so we don't assert that one - // wxASSERT_MSG( theErr == noErr, _T("TXNScroll returned an error!") ); + // wxASSERT_MSG( theErr == noErr, wxT("TXNScroll returned an error!") ); } void wxMacMLTEControl::SetTXNData( const wxString& st, TXNOffset start, TXNOffset end ) @@ -1384,7 +1384,7 @@ void wxMacMLTEControl::SetTXNData( const wxString& st, TXNOffset start, TXNOffse wxMBConvUTF16 converter ; ByteCount byteBufferLen = converter.WC2MB( NULL, st.wc_str(), 0 ) ; wxASSERT_MSG( byteBufferLen != wxCONV_FAILED, - _T("Conversion to UTF-16 unexpectedly failed") ); + wxT("Conversion to UTF-16 unexpectedly failed") ); UniChar *unibuf = (UniChar*)malloc( byteBufferLen + 2 ) ; // 2 for NUL in UTF-16 converter.WC2MB( (char*)unibuf, st.wc_str(), byteBufferLen + 2 ) ; TXNSetData( m_txn, kTXNUnicodeTextData, (void*)unibuf, byteBufferLen, start, end ) ; diff --git a/src/osx/carbon/thread.cpp b/src/osx/carbon/thread.cpp index 51ebef71ee..492b45ab46 100644 --- a/src/osx/carbon/thread.cpp +++ b/src/osx/carbon/thread.cpp @@ -893,7 +893,7 @@ wxThreadError wxThread::Run() wxThreadError wxThread::Pause() { wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR, - _T("a thread can't pause itself") ); + wxT("a thread can't pause itself") ); wxCriticalSectionLocker lock(m_critsect); diff --git a/src/osx/carbon/toolbar.cpp b/src/osx/carbon/toolbar.cpp index bccc29b4e7..9f969bea5c 100644 --- a/src/osx/carbon/toolbar.cpp +++ b/src/osx/carbon/toolbar.cpp @@ -1653,7 +1653,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) #if wxOSX_USE_NATIVE_TOOLBAR if (m_macToolbar != NULL) { - wxCHECK_MSG( tool->GetControl(), false, _T("control must be non-NULL") ); + wxCHECK_MSG( tool->GetControl(), false, wxT("control must be non-NULL") ); HIToolbarItemRef item; HIViewRef viewRef = (HIViewRef) tool->GetControl()->GetHandle() ; CFDataRef data = CFDataCreate( kCFAllocatorDefault , (UInt8*) &viewRef , sizeof(viewRef) ) ; diff --git a/src/osx/carbon/window.cpp b/src/osx/carbon/window.cpp index 6fdc1d132b..09f448a83c 100644 --- a/src/osx/carbon/window.cpp +++ b/src/osx/carbon/window.cpp @@ -309,7 +309,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl thisWindow->GetCaret()->OnKillFocus(); #endif - wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast(thisWindow)); // remove this as soon as posting the synthesized event works properly static bool inKillFocusEvent = false ; @@ -329,7 +329,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl { // set focus // panel wants to track the window which was the last to have focus in it - wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus set(%p)"), static_cast(thisWindow)); wxChildFocusEvent eventFocus((wxWindow*)thisWindow); thisWindow->HandleWindowEvent(eventFocus); @@ -357,12 +357,12 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl if ( controlPart != kControlFocusNoPart ) { targetFocusWindow = thisWindow; - wxLogTrace(_T("Focus"), _T("focus to be set(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus to be set(%p)"), static_cast(thisWindow)); } else { formerFocusWindow = thisWindow; - wxLogTrace(_T("Focus"), _T("focus to be lost(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus to be lost(%p)"), static_cast(thisWindow)); } ControlPartCode previousControlPart = 0; @@ -415,7 +415,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl thisWindow->GetCaret()->OnKillFocus(); #endif - wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast(thisWindow)); static bool inKillFocusEvent = false ; @@ -431,7 +431,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl else { // panel wants to track the window which was the last to have focus in it - wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus set(%p)"), static_cast(thisWindow)); wxChildFocusEvent eventFocus((wxWindow*)thisWindow); thisWindow->HandleWindowEvent(eventFocus); @@ -1007,7 +1007,7 @@ void wxMacControl::SetControlSize( wxWindowVariant variant ) break ; default: - wxFAIL_MSG(_T("unexpected window variant")); + wxFAIL_MSG(wxT("unexpected window variant")); break ; } diff --git a/src/osx/checklst_osx.cpp b/src/osx/checklst_osx.cpp index c177a21b72..98a9b96cb5 100644 --- a/src/osx/checklst_osx.cpp +++ b/src/osx/checklst_osx.cpp @@ -85,7 +85,7 @@ bool wxCheckListBox::Create( bool wxCheckListBox::IsChecked(unsigned int n) const { wxCHECK_MSG( IsValid(n), false, - _T("invalid index in wxCheckListBox::IsChecked") ); + wxT("invalid index in wxCheckListBox::IsChecked") ); return m_checks[n] != 0; } @@ -93,7 +93,7 @@ bool wxCheckListBox::IsChecked(unsigned int n) const void wxCheckListBox::Check(unsigned int n, bool check) { wxCHECK_RET( IsValid(n), - _T("invalid index in wxCheckListBox::Check") ); + wxT("invalid index in wxCheckListBox::Check") ); // intermediate var is needed to avoid compiler warning with VC++ bool isChecked = m_checks[n] != 0; diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index f29cb78781..c37765cd5c 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -512,11 +512,11 @@ void wxNonOwnedWindowCocoaImpl::SetExtraStyle( long exStyle ) int windowStyle = [ m_macWindow styleMask]; if ( metal && !(windowStyle & NSTexturedBackgroundWindowMask) ) { - wxFAIL_MSG( _T("Metal Style cannot be changed after creation") ); + wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") ); } else if ( !metal && (windowStyle & NSTexturedBackgroundWindowMask ) ) { - wxFAIL_MSG( _T("Metal Style cannot be changed after creation") ); + wxFAIL_MSG( wxT("Metal Style cannot be changed after creation") ); } } } diff --git a/src/osx/cocoa/toolbar.mm b/src/osx/cocoa/toolbar.mm index 8c1c416088..70b6de32d0 100644 --- a/src/osx/cocoa/toolbar.mm +++ b/src/osx/cocoa/toolbar.mm @@ -1271,7 +1271,7 @@ bool wxToolBar::DoInsertTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) if (m_macToolbar != NULL) { WXWidget view = (WXWidget) tool->GetControl()->GetHandle() ; - wxCHECK_MSG( view, false, _T("control must be non-NULL") ); + wxCHECK_MSG( view, false, wxT("control must be non-NULL") ); wxString identifier = wxString::Format(wxT("%ld"), (long) tool); wxCFStringRef cfidentifier( identifier, wxFont::GetDefaultEncoding() ); diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm index b26f59df7b..69f702827f 100644 --- a/src/osx/cocoa/window.mm +++ b/src/osx/cocoa/window.mm @@ -1506,7 +1506,7 @@ void wxWidgetCocoaImpl::SetControlSize( wxWindowVariant variant ) break ; default: - wxFAIL_MSG(_T("unexpected window variant")); + wxFAIL_MSG(wxT("unexpected window variant")); break ; } if ( [m_osxView respondsToSelector:@selector(setControlSize:)] ) @@ -1592,7 +1592,7 @@ void wxWidgetCocoaImpl::DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* oth if ( receivedFocus ) { - wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus set(%p)"), static_cast(thisWindow)); wxChildFocusEvent eventFocus((wxWindow*)thisWindow); thisWindow->HandleWindowEvent(eventFocus); @@ -1614,7 +1614,7 @@ void wxWidgetCocoaImpl::DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* oth thisWindow->GetCaret()->OnKillFocus(); #endif - wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast(thisWindow)); wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId()); event.SetEventObject(thisWindow); diff --git a/src/osx/core/hid.cpp b/src/osx/core/hid.cpp index 746c5e27d1..2a35960274 100644 --- a/src/osx/core/hid.cpp +++ b/src/osx/core/hid.cpp @@ -78,7 +78,7 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) CFMutableDictionaryRef pDictionary = IOServiceMatching(kIOHIDDeviceKey); if(pDictionary == NULL) { - wxLogSysError( _T("IOServiceMatching(kIOHIDDeviceKey) failed") ); + wxLogSysError( wxT("IOServiceMatching(kIOHIDDeviceKey) failed") ); return false; } @@ -103,7 +103,7 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) if( IOServiceGetMatchingServices(m_pPort, pDictionary, &pIterator) != kIOReturnSuccess ) { - wxLogSysError(_T("No Matching HID Services")); + wxLogSysError(wxT("No Matching HID Services")); return false; } @@ -129,7 +129,7 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) kNilOptions ) != KERN_SUCCESS ) { - wxLogDebug(_T("IORegistryEntryCreateCFProperties failed")); + wxLogDebug(wxT("IORegistryEntryCreateCFProperties failed")); } // @@ -194,7 +194,7 @@ bool wxHIDDevice::Create (int nClass, int nType, int nDev) //open the HID interface... if ( (*m_ppDevice)->open(m_ppDevice, 0) != S_OK ) { - wxLogDebug(_T("HID device: open failed")); + wxLogDebug(wxT("HID device: open failed")); } // @@ -242,7 +242,7 @@ size_t wxHIDDevice::GetCount (int nClass, int nType) CFMutableDictionaryRef pDictionary = IOServiceMatching(kIOHIDDeviceKey); if(pDictionary == NULL) { - wxLogSysError( _T("IOServiceMatching(kIOHIDDeviceKey) failed") ); + wxLogSysError( wxT("IOServiceMatching(kIOHIDDeviceKey) failed") ); return false; } @@ -267,7 +267,7 @@ size_t wxHIDDevice::GetCount (int nClass, int nType) if( IOServiceGetMatchingServices(pPort, pDictionary, &pIterator) != kIOReturnSuccess ) { - wxLogSysError(_T("No Matching HID Services")); + wxLogSysError(wxT("No Matching HID Services")); return false; } @@ -319,7 +319,7 @@ void wxHIDDevice::AddCookieInQueue(CFTypeRef Data, int i) AddCookie(Data, i); if ( (*m_ppQueue)->addElement(m_ppQueue, m_pCookies[i], 0) != S_OK ) { - wxLogDebug(_T("HID device: adding element failed")); + wxLogDebug(wxT("HID device: adding element failed")); } } @@ -337,14 +337,14 @@ void wxHIDDevice::InitCookies(size_t dwSize, bool bQueue) m_ppQueue = (*m_ppDevice)->allocQueue(m_ppDevice); if ( !m_ppQueue ) { - wxLogDebug(_T("HID device: allocQueue failed")); + wxLogDebug(wxT("HID device: allocQueue failed")); return; } //Param 2, flags, none yet if ( (*m_ppQueue)->create(m_ppQueue, 0, 512) != S_OK ) { - wxLogDebug(_T("HID device: create failed")); + wxLogDebug(wxT("HID device: create failed")); } } diff --git a/src/osx/core/printmac.cpp b/src/osx/core/printmac.cpp index f9ee5197cd..3e14c848dc 100644 --- a/src/osx/core/printmac.cpp +++ b/src/osx/core/printmac.cpp @@ -125,8 +125,8 @@ bool wxOSXPrintData::TransferFrom( const wxPrintData &data ) if ( bestPaper == kPMNoData ) { const PMPaperMargins margins = { 0.0, 0.0, 0.0, 0.0 }; - wxString id, name(_T("Custom paper")); - id.Printf(_T("wxPaperCustom%dx%d"), papersize.x, papersize.y); + wxString id, name(wxT("Custom paper")); + id.Printf(wxT("wxPaperCustom%dx%d"), papersize.x, papersize.y); #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 if ( PMPaperCreateCustom != NULL) diff --git a/src/osx/core/stdpaths_cf.cpp b/src/osx/core/stdpaths_cf.cpp index 3c80821371..041b819495 100644 --- a/src/osx/core/stdpaths_cf.cpp +++ b/src/osx/core/stdpaths_cf.cpp @@ -192,7 +192,7 @@ wxString wxStandardPathsCF::GetUserDataDir() const #if defined( __WXMAC__ ) && wxOSX_USE_CARBON return AppendAppInfo(wxMacFindFolder((short)kUserDomain, kApplicationSupportFolderType, kCreateFolder)); #else - return AppendAppInfo(wxFileName::GetHomeDir() + _T("/Library/Application Support")); + return AppendAppInfo(wxFileName::GetHomeDir() + wxT("/Library/Application Support")); #endif } @@ -211,7 +211,7 @@ wxStandardPathsCF::GetLocalizedResourcesDir(const wxString& lang, ResourceCat category) const { return wxStandardPathsBase:: - GetLocalizedResourcesDir(lang, category) + _T(".lproj"); + GetLocalizedResourcesDir(lang, category) + wxT(".lproj"); } #endif // wxUSE_STDPATHS diff --git a/src/osx/core/utilsexc_base.cpp b/src/osx/core/utilsexc_base.cpp index 38fe12a12d..2720f704aa 100644 --- a/src/osx/core/utilsexc_base.cpp +++ b/src/osx/core/utilsexc_base.cpp @@ -86,7 +86,7 @@ wxString wxGetOsDescription() { struct utsname name; uname(&name); - return wxString::Format(_T("Mac OS X (%s %s %s)"), + return wxString::Format(wxT("Mac OS X (%s %s %s)"), wxString::FromAscii(name.sysname).c_str(), wxString::FromAscii(name.release).c_str(), wxString::FromAscii(name.machine).c_str()); diff --git a/src/osx/glcanvas_osx.cpp b/src/osx/glcanvas_osx.cpp index 465e0d06db..d571089709 100644 --- a/src/osx/glcanvas_osx.cpp +++ b/src/osx/glcanvas_osx.cpp @@ -150,7 +150,7 @@ bool wxGLCanvasBase::IsDisplaySupported(const int *attribList) bool wxGLCanvas::SwapBuffers() { WXGLContext context = WXGLGetCurrentContext(); - wxCHECK_MSG(context, false, _T("should have current context")); + wxCHECK_MSG(context, false, wxT("should have current context")); WXGLSwapBuffers(context); return true; diff --git a/src/osx/imaglist.cpp b/src/osx/imaglist.cpp index 7c16b41359..0a5cc0c742 100644 --- a/src/osx/imaglist.cpp +++ b/src/osx/imaglist.cpp @@ -58,8 +58,8 @@ int wxImageList::Add( const wxIcon &bitmap ) { wxASSERT_MSG( (bitmap.GetWidth() == m_width && bitmap.GetHeight() == m_height) || (m_width == 0 && m_height == 0), - _T("invalid bitmap size in wxImageList: this might work ") - _T("on this platform but definitely won't under Windows.") ); + wxT("invalid bitmap size in wxImageList: this might work ") + wxT("on this platform but definitely won't under Windows.") ); m_images.Append( new wxIcon( bitmap ) ); @@ -76,8 +76,8 @@ int wxImageList::Add( const wxBitmap &bitmap ) { wxASSERT_MSG( (bitmap.GetWidth() >= m_width && bitmap.GetHeight() == m_height) || (m_width == 0 && m_height == 0), - _T("invalid bitmap size in wxImageList: this might work ") - _T("on this platform but definitely won't under Windows.") ); + wxT("invalid bitmap size in wxImageList: this might work ") + wxT("on this platform but definitely won't under Windows.") ); // Mimic behavior of Windows ImageList_Add that automatically breaks up the added // bitmap into sub-images of the correct size diff --git a/src/osx/iphone/window.mm b/src/osx/iphone/window.mm index 28aa413c65..bcb8bc4365 100644 --- a/src/osx/iphone/window.mm +++ b/src/osx/iphone/window.mm @@ -611,7 +611,7 @@ void wxWidgetIPhoneImpl::DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* ot if ( receivedFocus ) { - wxLogTrace(_T("Focus"), _T("focus set(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus set(%p)"), static_cast(thisWindow)); wxChildFocusEvent eventFocus((wxWindow*)thisWindow); thisWindow->HandleWindowEvent(eventFocus); @@ -633,7 +633,7 @@ void wxWidgetIPhoneImpl::DoNotifyFocusEvent(bool receivedFocus, wxWidgetImpl* ot thisWindow->GetCaret()->OnKillFocus(); #endif - wxLogTrace(_T("Focus"), _T("focus lost(%p)"), static_cast(thisWindow)); + wxLogTrace(wxT("Focus"), wxT("focus lost(%p)"), static_cast(thisWindow)); wxFocusEvent event( wxEVT_KILL_FOCUS, thisWindow->GetId()); event.SetEventObject(thisWindow); diff --git a/src/osx/listbox_osx.cpp b/src/osx/listbox_osx.cpp index 1c3e28a5bf..43d0bdb331 100644 --- a/src/osx/listbox_osx.cpp +++ b/src/osx/listbox_osx.cpp @@ -359,7 +359,7 @@ int wxListBox::DoInsertItems(const wxArrayStringsAdapter& items, void wxListBox::SetString(unsigned int n, const wxString& s) { - wxCHECK_RET( !IsSorted(), _T("can't set string in sorted listbox") ); + wxCHECK_RET( !IsSorted(), wxT("can't set string in sorted listbox") ); if ( IsSorted() ) (*m_strings.sorted)[n] = s; diff --git a/src/osx/menu_osx.cpp b/src/osx/menu_osx.cpp index d5b042ec52..3ba608e8a6 100644 --- a/src/osx/menu_osx.cpp +++ b/src/osx/menu_osx.cpp @@ -165,7 +165,7 @@ void wxMenu::EndRadioGroup() wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) { - wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") ); + wxCHECK_MSG( item, NULL, wxT("NULL item in wxMenu::DoAppend") ); bool check = false; @@ -197,7 +197,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) } else { - wxFAIL_MSG( _T("where is the radio group start item?") ); + wxFAIL_MSG( wxT("where is the radio group start item?") ); } } } @@ -331,7 +331,7 @@ void wxMenu::DoRearrange() { // next (i.e. second as we must be first) item is // the separator to hide - wxASSERT_MSG( pos == 0, _T("should be the menu start") ); + wxASSERT_MSG( pos == 0, wxT("should be the menu start") ); sepToHide = next; } else if ( GetMenuItems().GetCount() == pos + 1 && diff --git a/src/osx/menuitem_osx.cpp b/src/osx/menuitem_osx.cpp index 51fc4e457b..657e3d2447 100644 --- a/src/osx/menuitem_osx.cpp +++ b/src/osx/menuitem_osx.cpp @@ -123,7 +123,7 @@ void wxMenuItem::Check(bool bDoCheck) const wxMenuItemList& items = m_parentMenu->GetMenuItems(); int pos = items.IndexOf(this); wxCHECK_RET( pos != wxNOT_FOUND, - _T("menuitem not found in the menu items list?") ); + wxT("menuitem not found in the menu items list?") ); // get the radio group range int start, end; diff --git a/src/osx/nonownedwnd_osx.cpp b/src/osx/nonownedwnd_osx.cpp index 674c4d9968..c2f36dd487 100644 --- a/src/osx/nonownedwnd_osx.cpp +++ b/src/osx/nonownedwnd_osx.cpp @@ -422,7 +422,7 @@ WXWindow wxNonOwnedWindow::GetWXWindow() const bool wxNonOwnedWindow::DoSetShape(const wxRegion& region) { wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), false, - _T("Shaped windows must be created with the wxFRAME_SHAPED style.")); + wxT("Shaped windows must be created with the wxFRAME_SHAPED style.")); // The empty region signifies that the shape // should be removed from the window. diff --git a/src/osx/spinctrl_osx.cpp b/src/osx/spinctrl_osx.cpp index 1a582d7f6c..1e56099b01 100644 --- a/src/osx/spinctrl_osx.cpp +++ b/src/osx/spinctrl_osx.cpp @@ -388,9 +388,9 @@ int wxSpinCtrl::GetMax() const void wxSpinCtrl::SetTextValue(int val) { - wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetTextValue") ); + wxCHECK_RET( m_text, wxT("invalid call to wxSpinCtrl::SetTextValue") ); - m_text->SetValue(wxString::Format(_T("%d"), val)); + m_text->SetValue(wxString::Format(wxT("%d"), val)); // select all text m_text->SetSelection(0, -1); @@ -401,7 +401,7 @@ void wxSpinCtrl::SetTextValue(int val) void wxSpinCtrl::SetValue(int val) { - wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetValue") ); + wxCHECK_RET( m_btn, wxT("invalid call to wxSpinCtrl::SetValue") ); SetTextValue(val); @@ -411,7 +411,7 @@ void wxSpinCtrl::SetValue(int val) void wxSpinCtrl::SetValue(const wxString& text) { - wxCHECK_RET( m_text, _T("invalid call to wxSpinCtrl::SetValue") ); + wxCHECK_RET( m_text, wxT("invalid call to wxSpinCtrl::SetValue") ); long val; if ( text.ToLong(&val) && ((val > INT_MIN) && (val < INT_MAX)) ) @@ -427,7 +427,7 @@ void wxSpinCtrl::SetValue(const wxString& text) void wxSpinCtrl::SetRange(int min, int max) { - wxCHECK_RET( m_btn, _T("invalid call to wxSpinCtrl::SetRange") ); + wxCHECK_RET( m_btn, wxT("invalid call to wxSpinCtrl::SetRange") ); m_btn->SetRange(min, max); } diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 135718cbdf..42c94ae660 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -333,7 +333,7 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant ) break ; default: - wxFAIL_MSG(_T("unexpected window variant")); + wxFAIL_MSG(wxT("unexpected window variant")); break ; } m_peer->SetData(kControlEntireControl, kControlSizeTag, &size ) ; @@ -362,7 +362,7 @@ void wxWindowMac::DoSetWindowVariant( wxWindowVariant variant ) break ; default: - wxFAIL_MSG(_T("unexpected window variant")); + wxFAIL_MSG(wxT("unexpected window variant")); break ; } diff --git a/src/palmos/caret.cpp b/src/palmos/caret.cpp index b558635819..5f5615cd60 100644 --- a/src/palmos/caret.cpp +++ b/src/palmos/caret.cpp @@ -41,7 +41,7 @@ #define CALL_CARET_API(api, args) \ if ( !api args ) \ - wxLogLastError(_T(#api)) + wxLogLastError(wxT(#api)) // =========================================================================== // implementation diff --git a/src/palmos/datectrl.cpp b/src/palmos/datectrl.cpp index a351bb2777..e58d714900 100644 --- a/src/palmos/datectrl.cpp +++ b/src/palmos/datectrl.cpp @@ -122,7 +122,7 @@ bool wxDatePickerCtrl::SendClickEvent() int16_t day = m_dt.GetDay(); int16_t year = m_dt.GetYear(); - //if(!SelectDay(selectDayByDay,&month,&day,&year,_T("Pick date"))) + //if(!SelectDay(selectDayByDay,&month,&day,&year,wxT("Pick date"))) if(!SelectDay(selectDayByDay,&month,&day,&year, "Pick date")) return false; wxDateTime dt(m_dt); diff --git a/src/palmos/dcclient.cpp b/src/palmos/dcclient.cpp index a3ff792c66..b6313e826a 100644 --- a/src/palmos/dcclient.cpp +++ b/src/palmos/dcclient.cpp @@ -73,7 +73,7 @@ wxWindowDCImpl::wxWindowDCImpl( wxDC *owner ) : wxWindowDCImpl::wxWindowDCImpl( wxDC *owner, wxWindow *window ) : wxPalmDCImpl( owner ) { - wxCHECK_RET( window, _T("invalid window in wxWindowDCImpl") ); + wxCHECK_RET( window, wxT("invalid window in wxWindowDCImpl") ); } void wxWindowDCImpl::InitDC() @@ -87,7 +87,7 @@ void wxWindowDCImpl::InitDC() void wxWindowDCImpl::DoGetSize(int *width, int *height) const { - wxCHECK_RET( m_window, _T("wxWindowDCImpl without a window?") ); + wxCHECK_RET( m_window, wxT("wxWindowDCImpl without a window?") ); m_window->GetSize(width, height); } @@ -137,7 +137,7 @@ wxClientDCImpl::~wxClientDCImpl() void wxClientDCImpl::DoGetSize(int *width, int *height) const { - wxCHECK_RET( m_window, _T("wxClientDCImpl without a window?") ); + wxCHECK_RET( m_window, wxT("wxClientDCImpl without a window?") ); m_window->GetClientSize(width, height); } diff --git a/src/palmos/dcmemory.cpp b/src/palmos/dcmemory.cpp index 827aaddea2..ebe91b08fc 100644 --- a/src/palmos/dcmemory.cpp +++ b/src/palmos/dcmemory.cpp @@ -56,7 +56,7 @@ wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxBitmap& bitmap ) wxMemoryDCImpl::wxMemoryDCImpl( wxMemoryDC *owner, wxDC *dc ) : wxPalmDCImpl( owner ) { - wxCHECK_RET( dc, _T("NULL dc in wxMemoryDC ctor") ); + wxCHECK_RET( dc, wxT("NULL dc in wxMemoryDC ctor") ); CreateCompatible(dc); diff --git a/src/palmos/dir.cpp b/src/palmos/dir.cpp index 2883ef2649..0ad3719cec 100644 --- a/src/palmos/dir.cpp +++ b/src/palmos/dir.cpp @@ -97,7 +97,7 @@ wxDirData::wxDirData(const wxString& dirname) // throw away the trailing slashes size_t n = m_dirname.length(); - wxCHECK_RET( n, _T("empty dir name in wxDir") ); + wxCHECK_RET( n, wxT("empty dir name in wxDir") ); while ( n > 0 && m_dirname[--n] == '/' ) ; @@ -119,7 +119,7 @@ void wxDirData::Close() { if ( svfs_dir_endfind (m_dir) != 0 ) { - wxLogLastError(_T("svfs_dir_endfind")); + wxLogLastError(wxT("svfs_dir_endfind")); } m_dir = NULL; } @@ -135,7 +135,7 @@ bool wxDirData::Read(wxString *filename) // speed up string concatenation in the loop a bit wxString path = m_dirname; - path += _T('/'); + path += wxT('/'); path.reserve(path.length() + 255); wxString de_d_name; @@ -237,7 +237,7 @@ wxString wxDir::GetName() const if ( m_data ) { name = M_DIR->GetName(); - if ( !name.empty() && (name.Last() == _T('/')) ) + if ( !name.empty() && (name.Last() == wxT('/')) ) { // chop off the last (back)slash name.Truncate(name.length() - 1); @@ -260,7 +260,7 @@ bool wxDir::GetFirst(wxString *filename, const wxString& filespec, int flags) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); M_DIR->Close(); M_DIR->SetFileSpec(filespec); M_DIR->SetFlags(flags); @@ -269,8 +269,8 @@ bool wxDir::GetFirst(wxString *filename, bool wxDir::GetNext(wxString *filename) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); - wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); + wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") ); return M_DIR->Read(filename); } diff --git a/src/palmos/menu.cpp b/src/palmos/menu.cpp index 2725ce1448..8e66121de3 100644 --- a/src/palmos/menu.cpp +++ b/src/palmos/menu.cpp @@ -217,7 +217,7 @@ void wxMenu::EndRadioGroup() wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) { - wxCHECK_MSG( item, NULL, _T("NULL item in wxMenu::DoAppend") ); + wxCHECK_MSG( item, NULL, wxT("NULL item in wxMenu::DoAppend") ); if(!wxMenuBase::DoAppend(item) || !DoInsertOrAppend(item)) { diff --git a/src/palmos/slider.cpp b/src/palmos/slider.cpp index ed0f238bd9..9caf2d290d 100644 --- a/src/palmos/slider.cpp +++ b/src/palmos/slider.cpp @@ -117,7 +117,7 @@ bool wxSlider::Create(wxWindow *parent, wxWindowID id, // wxSL_TOP is ignored - always off // wxSL_SELRANGE is ignored - always off // wxSL_VERTICAL is impossible in native form - wxCHECK_MSG(!(style & wxSL_VERTICAL), false, _T("non vertical slider on PalmOS")); + wxCHECK_MSG(!(style & wxSL_VERTICAL), false, wxT("non vertical slider on PalmOS")); if(!wxControl::Create(parent, id, pos, size, style, validator, name)) return false; diff --git a/src/palmos/statbrpalm.cpp b/src/palmos/statbrpalm.cpp index 62c8d6615e..8c0b2f03cb 100644 --- a/src/palmos/statbrpalm.cpp +++ b/src/palmos/statbrpalm.cpp @@ -107,7 +107,7 @@ bool wxStatusBarPalm::Show( bool show ) void wxStatusBarPalm::SetFieldsCount(int nFields, const int *widths) { // this is a Windows limitation - wxASSERT_MSG( (nFields > 0) && (nFields < 255), _T("too many fields") ); + wxASSERT_MSG( (nFields > 0) && (nFields < 255), wxT("too many fields") ); wxStatusBarBase::SetFieldsCount(nFields, widths); @@ -130,7 +130,7 @@ void wxStatusBarPalm::SetFieldsWidth() void wxStatusBarPalm::SetStatusText(const wxString& strText, int nField) { wxCHECK_RET( (nField >= 0) && (nField < m_nFields), - _T("invalid statusbar field index") ); + wxT("invalid statusbar field index") ); SetStatusBufferText(strText,nField); DrawStatusBar(); @@ -139,7 +139,7 @@ void wxStatusBarPalm::SetStatusText(const wxString& strText, int nField) wxString wxStatusBarPalm::GetStatusText(int nField) const { wxCHECK_MSG( (nField >= 0) && (nField < m_nFields), wxEmptyString, - _T("invalid statusbar field index") ); + wxT("invalid statusbar field index") ); wxString text; return text; diff --git a/src/palmos/utils.cpp b/src/palmos/utils.cpp index a03694b0dc..d52e90fb35 100644 --- a/src/palmos/utils.cpp +++ b/src/palmos/utils.cpp @@ -251,7 +251,7 @@ bool wxIsPlatform64Bit() wxString wxGetOsDescription() { - wxString strOS = _T("PalmOS"); + wxString strOS = wxT("PalmOS"); //err = FtrGet(sysFtrCreator, sysFtrNumROMVersion, &romVersion); //if (romVersion >= 0x02000000) v20 = true; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 351c1ca287..62459e6476 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -2599,7 +2599,7 @@ void wxPropertyGrid::DoShowPropertyError( wxPGProperty* WXUNUSED(property), cons } #endif - ::wxMessageBox(msg, _T("Property Error")); + ::wxMessageBox(msg, wxT("Property Error")); } // ----------------------------------------------------------------------- @@ -2674,7 +2674,7 @@ bool wxPropertyGrid::DoOnValidationFailure( wxPGProperty* property, wxVariant& W wxString msg = m_validationInfo.m_failureMessage; if ( !msg.length() ) - msg = _T("You have entered invalid value. Press ESC to cancel editing."); + msg = wxT("You have entered invalid value. Press ESC to cancel editing."); DoShowPropertyError(property, msg); } diff --git a/src/regex/regc_locale.c b/src/regex/regc_locale.c index 7370318b84..7428515054 100644 --- a/src/regex/regc_locale.c +++ b/src/regex/regc_locale.c @@ -24,101 +24,101 @@ static struct cname { chr *name; char code; } cnames[] = { - {_T("NUL"), '\0'}, - {_T("SOH"), '\001'}, - {_T("STX"), '\002'}, - {_T("ETX"), '\003'}, - {_T("EOT"), '\004'}, - {_T("ENQ"), '\005'}, - {_T("ACK"), '\006'}, - {_T("BEL"), '\007'}, - {_T("alert"), '\007'}, - {_T("BS"), '\010'}, - {_T("backspace"), '\b'}, - {_T("HT"), '\011'}, - {_T("tab"), '\t'}, - {_T("LF"), '\012'}, - {_T("newline"), '\n'}, - {_T("VT"), '\013'}, - {_T("vertical-tab"), '\v'}, - {_T("FF"), '\014'}, - {_T("form-feed"), '\f'}, - {_T("CR"), '\015'}, - {_T("carriage-return"), '\r'}, - {_T("SO"), '\016'}, - {_T("SI"), '\017'}, - {_T("DLE"), '\020'}, - {_T("DC1"), '\021'}, - {_T("DC2"), '\022'}, - {_T("DC3"), '\023'}, - {_T("DC4"), '\024'}, - {_T("NAK"), '\025'}, - {_T("SYN"), '\026'}, - {_T("ETB"), '\027'}, - {_T("CAN"), '\030'}, - {_T("EM"), '\031'}, - {_T("SUB"), '\032'}, - {_T("ESC"), '\033'}, - {_T("IS4"), '\034'}, - {_T("FS"), '\034'}, - {_T("IS3"), '\035'}, - {_T("GS"), '\035'}, - {_T("IS2"), '\036'}, - {_T("RS"), '\036'}, - {_T("IS1"), '\037'}, - {_T("US"), '\037'}, - {_T("space"), ' '}, - {_T("exclamation-mark"), '!'}, - {_T("quotation-mark"), '"'}, - {_T("number-sign"), '#'}, - {_T("dollar-sign"), '$'}, - {_T("percent-sign"), '%'}, - {_T("ampersand"), '&'}, - {_T("apostrophe"), '\''}, - {_T("left-parenthesis"), '('}, - {_T("right-parenthesis"), ')'}, - {_T("asterisk"), '*'}, - {_T("plus-sign"), '+'}, - {_T("comma"), ','}, - {_T("hyphen"), '-'}, - {_T("hyphen-minus"), '-'}, - {_T("period"), '.'}, - {_T("full-stop"), '.'}, - {_T("slash"), '/'}, - {_T("solidus"), '/'}, - {_T("zero"), '0'}, - {_T("one"), '1'}, - {_T("two"), '2'}, - {_T("three"), '3'}, - {_T("four"), '4'}, - {_T("five"), '5'}, - {_T("six"), '6'}, - {_T("seven"), '7'}, - {_T("eight"), '8'}, - {_T("nine"), '9'}, - {_T("colon"), ':'}, - {_T("semicolon"), ';'}, - {_T("less-than-sign"), '<'}, - {_T("equals-sign"), '='}, - {_T("greater-than-sign"), '>'}, - {_T("question-mark"), '?'}, - {_T("commercial-at"), '@'}, - {_T("left-square-bracket"), '['}, - {_T("backslash"), '\\'}, - {_T("reverse-solidus"), '\\'}, - {_T("right-square-bracket"), ']'}, - {_T("circumflex"), '^'}, - {_T("circumflex-accent"), '^'}, - {_T("underscore"), '_'}, - {_T("low-line"), '_'}, - {_T("grave-accent"), '`'}, - {_T("left-brace"), '{'}, - {_T("left-curly-bracket"), '{'}, - {_T("vertical-line"), '|'}, - {_T("right-brace"), '}'}, - {_T("right-curly-bracket"), '}'}, - {_T("tilde"), '~'}, - {_T("DEL"), '\177'}, + {wxT("NUL"), '\0'}, + {wxT("SOH"), '\001'}, + {wxT("STX"), '\002'}, + {wxT("ETX"), '\003'}, + {wxT("EOT"), '\004'}, + {wxT("ENQ"), '\005'}, + {wxT("ACK"), '\006'}, + {wxT("BEL"), '\007'}, + {wxT("alert"), '\007'}, + {wxT("BS"), '\010'}, + {wxT("backspace"), '\b'}, + {wxT("HT"), '\011'}, + {wxT("tab"), '\t'}, + {wxT("LF"), '\012'}, + {wxT("newline"), '\n'}, + {wxT("VT"), '\013'}, + {wxT("vertical-tab"), '\v'}, + {wxT("FF"), '\014'}, + {wxT("form-feed"), '\f'}, + {wxT("CR"), '\015'}, + {wxT("carriage-return"), '\r'}, + {wxT("SO"), '\016'}, + {wxT("SI"), '\017'}, + {wxT("DLE"), '\020'}, + {wxT("DC1"), '\021'}, + {wxT("DC2"), '\022'}, + {wxT("DC3"), '\023'}, + {wxT("DC4"), '\024'}, + {wxT("NAK"), '\025'}, + {wxT("SYN"), '\026'}, + {wxT("ETB"), '\027'}, + {wxT("CAN"), '\030'}, + {wxT("EM"), '\031'}, + {wxT("SUB"), '\032'}, + {wxT("ESC"), '\033'}, + {wxT("IS4"), '\034'}, + {wxT("FS"), '\034'}, + {wxT("IS3"), '\035'}, + {wxT("GS"), '\035'}, + {wxT("IS2"), '\036'}, + {wxT("RS"), '\036'}, + {wxT("IS1"), '\037'}, + {wxT("US"), '\037'}, + {wxT("space"), ' '}, + {wxT("exclamation-mark"), '!'}, + {wxT("quotation-mark"), '"'}, + {wxT("number-sign"), '#'}, + {wxT("dollar-sign"), '$'}, + {wxT("percent-sign"), '%'}, + {wxT("ampersand"), '&'}, + {wxT("apostrophe"), '\''}, + {wxT("left-parenthesis"), '('}, + {wxT("right-parenthesis"), ')'}, + {wxT("asterisk"), '*'}, + {wxT("plus-sign"), '+'}, + {wxT("comma"), ','}, + {wxT("hyphen"), '-'}, + {wxT("hyphen-minus"), '-'}, + {wxT("period"), '.'}, + {wxT("full-stop"), '.'}, + {wxT("slash"), '/'}, + {wxT("solidus"), '/'}, + {wxT("zero"), '0'}, + {wxT("one"), '1'}, + {wxT("two"), '2'}, + {wxT("three"), '3'}, + {wxT("four"), '4'}, + {wxT("five"), '5'}, + {wxT("six"), '6'}, + {wxT("seven"), '7'}, + {wxT("eight"), '8'}, + {wxT("nine"), '9'}, + {wxT("colon"), ':'}, + {wxT("semicolon"), ';'}, + {wxT("less-than-sign"), '<'}, + {wxT("equals-sign"), '='}, + {wxT("greater-than-sign"), '>'}, + {wxT("question-mark"), '?'}, + {wxT("commercial-at"), '@'}, + {wxT("left-square-bracket"), '['}, + {wxT("backslash"), '\\'}, + {wxT("reverse-solidus"), '\\'}, + {wxT("right-square-bracket"), ']'}, + {wxT("circumflex"), '^'}, + {wxT("circumflex-accent"), '^'}, + {wxT("underscore"), '_'}, + {wxT("low-line"), '_'}, + {wxT("grave-accent"), '`'}, + {wxT("left-brace"), '{'}, + {wxT("left-curly-bracket"), '{'}, + {wxT("vertical-line"), '|'}, + {wxT("right-brace"), '}'}, + {wxT("right-curly-bracket"), '}'}, + {wxT("tilde"), '~'}, + {wxT("DEL"), '\177'}, {NULL, 0} }; @@ -850,8 +850,8 @@ cclass(v, startp, endp, cases) */ static chr *classNames[] = { - _T("alnum"), _T("alpha"), _T("ascii"), _T("blank"), _T("cntrl"), _T("digit"), _T("graph"), - _T("lower"), _T("print"), _T("punct"), _T("space"), _T("upper"), _T("xdigit"), NULL + wxT("alnum"), wxT("alpha"), wxT("ascii"), wxT("blank"), wxT("cntrl"), wxT("digit"), wxT("graph"), + wxT("lower"), wxT("print"), wxT("punct"), wxT("space"), wxT("upper"), wxT("xdigit"), NULL }; enum classes { @@ -871,9 +871,9 @@ cclass(v, startp, endp, cases) * Remap lower and upper to alpha if the match is case insensitive. */ - if (cases && len == 5 && (wxCRT_StrncmpNative(_T("lower"), np, 5) == 0 - || wxCRT_StrncmpNative(_T("upper"), np, 5) == 0)) { - np = _T("alpha"); + if (cases && len == 5 && (wxCRT_StrncmpNative(wxT("lower"), np, 5) == 0 + || wxCRT_StrncmpNative(wxT("upper"), np, 5) == 0)) { + np = wxT("alpha"); } /* @@ -1057,9 +1057,9 @@ int cases; /* case-independent? */ /* find the name */ len = endp - startp; np = startp; - if (cases && len == 5 && (wxCRT_StrncmpNative(_T("lower"), np, 5) == 0 || - wxCRT_StrncmpNative(_T("upper"), np, 5) == 0)) - np = _T("alpha"); + if (cases && len == 5 && (wxCRT_StrncmpNative(wxT("lower"), np, 5) == 0 || + wxCRT_StrncmpNative(wxT("upper"), np, 5) == 0)) + np = wxT("alpha"); for (cc = cclasses; cc->name != NULL; cc++) if (wxCRT_StrlenNative(cc->name) == len && wxCRT_StrncmpNative(cc->name, np, len) == 0) break; /* NOTE BREAK OUT */ diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index 782856d81d..6601fa34ad 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -683,7 +683,7 @@ bool wxRichTextParagraphLayoutBox::Layout(wxDC& dc, const wxRect& rect, int styl // Assume this box only contains paragraphs wxRichTextParagraph* child = wxDynamicCast(node->GetData(), wxRichTextParagraph); - wxCHECK_MSG( child, false, _T("Unknown object in layout") ); + wxCHECK_MSG( child, false, wxT("Unknown object in layout") ); // TODO: what if the child hasn't been laid out (e.g. involved in Undo) but still has 'old' lines if ( !forceQuickLayout && diff --git a/src/richtext/richtextbulletspage.cpp b/src/richtext/richtextbulletspage.cpp index e8a1ff6101..34dde8e2d2 100644 --- a/src/richtext/richtextbulletspage.cpp +++ b/src/richtext/richtextbulletspage.cpp @@ -220,7 +220,7 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer19->Add(itemStaticText20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxArrayString m_symbolCtrlStrings; - m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN ); + m_symbolCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLCTRL, wxT(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN ); m_symbolCtrl->SetHelpText(_("The bullet character.")); if (wxRichTextBulletsPage::ShowToolTips()) m_symbolCtrl->SetToolTip(_("The bullet character.")); @@ -238,7 +238,7 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer18->Add(itemStaticText24, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_symbolFontCtrlStrings; - m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN ); + m_symbolFontCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_SYMBOLFONTCTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN ); m_symbolFontCtrl->SetHelpText(_("Available fonts.")); if (wxRichTextBulletsPage::ShowToolTips()) m_symbolFontCtrl->SetToolTip(_("Available fonts.")); @@ -250,7 +250,7 @@ void wxRichTextBulletsPage::CreateControls() itemBoxSizer18->Add(itemStaticText27, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_bulletNameCtrlStrings; - m_bulletNameCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN ); + m_bulletNameCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTBULLETSPAGE_NAMECTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN ); m_bulletNameCtrl->SetHelpText(_("A standard bullet name.")); if (wxRichTextBulletsPage::ShowToolTips()) m_bulletNameCtrl->SetToolTip(_("A standard bullet name.")); @@ -261,7 +261,7 @@ void wxRichTextBulletsPage::CreateControls() wxStaticText* itemStaticText30 = new wxStaticText( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERSTATIC, _("&Number:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer18->Add(itemStaticText30, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, _T("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 ); + m_numberCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTBULLETSPAGE_NUMBERCTRL, wxT("0"), wxDefaultPosition, wxSize(50, -1), wxSP_ARROW_KEYS, 0, 100000, 0 ); m_numberCtrl->SetHelpText(_("The list item number.")); if (wxRichTextBulletsPage::ShowToolTips()) m_numberCtrl->SetToolTip(_("The list item number.")); diff --git a/src/richtext/richtextfontpage.cpp b/src/richtext/richtextfontpage.cpp index 7cc12800a4..91c7bdec27 100644 --- a/src/richtext/richtextfontpage.cpp +++ b/src/richtext/richtextfontpage.cpp @@ -137,7 +137,7 @@ void wxRichTextFontPage::CreateControls() wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Font:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_faceTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_FACETEXTCTRL, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); m_faceTextCtrl->SetHelpText(_("Type a font name.")); if (wxRichTextFontPage::ShowToolTips()) m_faceTextCtrl->SetToolTip(_("Type a font name.")); @@ -155,7 +155,7 @@ void wxRichTextFontPage::CreateControls() wxStaticText* itemStaticText10 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Size:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer9->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_sizeTextCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTFONTPAGE_SIZETEXTCTRL, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_sizeTextCtrl->SetHelpText(_("Type a size in points.")); if (wxRichTextFontPage::ShowToolTips()) m_sizeTextCtrl->SetToolTip(_("Type a size in points.")); @@ -178,7 +178,7 @@ void wxRichTextFontPage::CreateControls() itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_styleCtrlStrings; - m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_styleCtrlStrings, wxCB_READONLY ); + m_styleCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_STYLECTRL, wxT(""), wxDefaultPosition, wxSize(110, -1), m_styleCtrlStrings, wxCB_READONLY ); m_styleCtrl->SetHelpText(_("Select regular or italic style.")); if (wxRichTextFontPage::ShowToolTips()) m_styleCtrl->SetToolTip(_("Select regular or italic style.")); @@ -191,7 +191,7 @@ void wxRichTextFontPage::CreateControls() itemBoxSizer17->Add(itemStaticText18, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_weightCtrlStrings; - m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_weightCtrlStrings, wxCB_READONLY ); + m_weightCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_WEIGHTCTRL, wxT(""), wxDefaultPosition, wxSize(110, -1), m_weightCtrlStrings, wxCB_READONLY ); m_weightCtrl->SetHelpText(_("Select regular or bold.")); if (wxRichTextFontPage::ShowToolTips()) m_weightCtrl->SetToolTip(_("Select regular or bold.")); @@ -204,7 +204,7 @@ void wxRichTextFontPage::CreateControls() itemBoxSizer20->Add(itemStaticText21, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_underliningCtrlStrings; - m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, _T(""), wxDefaultPosition, wxSize(110, -1), m_underliningCtrlStrings, wxCB_READONLY ); + m_underliningCtrl = new wxComboBox( itemPanel1, ID_RICHTEXTFONTPAGE_UNDERLINING_CTRL, wxT(""), wxDefaultPosition, wxSize(110, -1), m_underliningCtrlStrings, wxCB_READONLY ); m_underliningCtrl->SetHelpText(_("Select underlining or no underlining.")); if (wxRichTextFontPage::ShowToolTips()) m_underliningCtrl->SetToolTip(_("Select underlining or no underlining.")); diff --git a/src/richtext/richtextindentspage.cpp b/src/richtext/richtextindentspage.cpp index 49dbe87f44..b993ce2cef 100644 --- a/src/richtext/richtextindentspage.cpp +++ b/src/richtext/richtextindentspage.cpp @@ -208,7 +208,7 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer24 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer22->Add(itemBoxSizer24, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - m_indentLeft = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_indentLeft = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_indentLeft->SetHelpText(_("The left indent.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_indentLeft->SetToolTip(_("The left indent.")); @@ -220,7 +220,7 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer27 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer22->Add(itemBoxSizer27, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - m_indentLeftFirst = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_indentLeftFirst = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_LEFT_FIRST, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_indentLeftFirst->SetHelpText(_("The first line indent.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_indentLeftFirst->SetToolTip(_("The first line indent.")); @@ -232,7 +232,7 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer30 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer22->Add(itemBoxSizer30, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - m_indentRight = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_indentRight = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_INDENT_RIGHT, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_indentRight->SetHelpText(_("The right indent.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_indentRight->SetToolTip(_("The right indent.")); @@ -287,7 +287,7 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer43 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer41->Add(itemBoxSizer43, 0, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - m_spacingBefore = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_spacingBefore = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_BEFORE, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_spacingBefore->SetHelpText(_("The spacing before the paragraph.")); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_spacingBefore->SetToolTip(_("The spacing before the paragraph.")); @@ -299,7 +299,7 @@ void wxRichTextIndentsSpacingPage::CreateControls() wxBoxSizer* itemBoxSizer46 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer41->Add(itemBoxSizer46, 1, wxGROW|wxALIGN_CENTER_VERTICAL, 5); - m_spacingAfter = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_spacingAfter = new wxTextCtrl( itemPanel1, ID_RICHTEXTINDENTSSPACINGPAGE_SPACING_AFTER, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); if (wxRichTextIndentsSpacingPage::ShowToolTips()) m_spacingAfter->SetToolTip(_("The spacing after the paragraph.")); itemBoxSizer46->Add(m_spacingAfter, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); diff --git a/src/richtext/richtextliststylepage.cpp b/src/richtext/richtextliststylepage.cpp index 684b6492bd..374a352025 100644 --- a/src/richtext/richtextliststylepage.cpp +++ b/src/richtext/richtextliststylepage.cpp @@ -182,7 +182,7 @@ void wxRichTextListStylePage::CreateControls() wxStaticText* itemStaticText5 = new wxStaticText( itemPanel1, wxID_STATIC, _("&List level:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_levelCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_LEVEL, _T("1"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 10, 1 ); + m_levelCtrl = new wxSpinCtrl( itemPanel1, ID_RICHTEXTLISTSTYLEPAGE_LEVEL, wxT("1"), wxDefaultPosition, wxSize(60, -1), wxSP_ARROW_KEYS, 1, 10, 1 ); m_levelCtrl->SetHelpText(_("Selects the list level to edit.")); if (wxRichTextListStylePage::ShowToolTips()) m_levelCtrl->SetToolTip(_("Selects the list level to edit.")); @@ -270,7 +270,7 @@ void wxRichTextListStylePage::CreateControls() wxBoxSizer* itemBoxSizer28 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer26->Add(itemBoxSizer28, 0, wxGROW, 5); wxArrayString m_symbolCtrlStrings; - m_symbolCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, _T(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN ); + m_symbolCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLCTRL, wxT(""), wxDefaultPosition, wxSize(60, -1), m_symbolCtrlStrings, wxCB_DROPDOWN ); m_symbolCtrl->SetHelpText(_("The bullet character.")); if (wxRichTextListStylePage::ShowToolTips()) m_symbolCtrl->SetToolTip(_("The bullet character.")); @@ -288,7 +288,7 @@ void wxRichTextListStylePage::CreateControls() itemBoxSizer26->Add(itemStaticText32, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_symbolFontCtrlStrings; - m_symbolFontCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN ); + m_symbolFontCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_SYMBOLFONTCTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_symbolFontCtrlStrings, wxCB_DROPDOWN ); if (wxRichTextListStylePage::ShowToolTips()) m_symbolFontCtrl->SetToolTip(_("Available fonts.")); itemBoxSizer26->Add(m_symbolFontCtrl, 0, wxGROW|wxALL, 5); @@ -299,7 +299,7 @@ void wxRichTextListStylePage::CreateControls() itemBoxSizer26->Add(itemStaticText35, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_bulletNameCtrlStrings; - m_bulletNameCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, _T(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN ); + m_bulletNameCtrl = new wxComboBox( itemPanel10, ID_RICHTEXTLISTSTYLEPAGE_NAMECTRL, wxT(""), wxDefaultPosition, wxDefaultSize, m_bulletNameCtrlStrings, wxCB_DROPDOWN ); m_bulletNameCtrl->SetHelpText(_("A standard bullet name.")); if (wxRichTextListStylePage::ShowToolTips()) m_bulletNameCtrl->SetToolTip(_("A standard bullet name.")); @@ -382,7 +382,7 @@ void wxRichTextListStylePage::CreateControls() wxBoxSizer* itemBoxSizer59 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer57->Add(itemBoxSizer59, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_indentLeft = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_indentLeft = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTLEFT, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_indentLeft->SetHelpText(_("The left indent.")); if (wxRichTextListStylePage::ShowToolTips()) m_indentLeft->SetToolTip(_("The left indent.")); @@ -393,7 +393,7 @@ void wxRichTextListStylePage::CreateControls() wxBoxSizer* itemBoxSizer62 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer57->Add(itemBoxSizer62, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_indentLeftFirst = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_indentLeftFirst = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTFIRSTLINE, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_indentLeftFirst->SetHelpText(_("The first line indent.")); if (wxRichTextListStylePage::ShowToolTips()) m_indentLeftFirst->SetToolTip(_("The first line indent.")); @@ -404,7 +404,7 @@ void wxRichTextListStylePage::CreateControls() wxBoxSizer* itemBoxSizer65 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer57->Add(itemBoxSizer65, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_indentRight = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_indentRight = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_INDENTRIGHT, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_indentRight->SetHelpText(_("The right indent.")); if (wxRichTextListStylePage::ShowToolTips()) m_indentRight->SetToolTip(_("The right indent.")); @@ -433,7 +433,7 @@ void wxRichTextListStylePage::CreateControls() wxBoxSizer* itemBoxSizer76 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer74->Add(itemBoxSizer76, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_spacingBefore = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_spacingBefore = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGBEFORE, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_spacingBefore->SetHelpText(_("The spacing before the paragraph.")); if (wxRichTextListStylePage::ShowToolTips()) m_spacingBefore->SetToolTip(_("The spacing before the paragraph.")); @@ -444,7 +444,7 @@ void wxRichTextListStylePage::CreateControls() wxBoxSizer* itemBoxSizer79 = new wxBoxSizer(wxHORIZONTAL); itemFlexGridSizer74->Add(itemBoxSizer79, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5); - m_spacingAfter = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, _T(""), wxDefaultPosition, wxSize(50, -1), 0 ); + m_spacingAfter = new wxTextCtrl( itemPanel37, ID_RICHTEXTLISTSTYLEPAGE_SPACINGAFTER, wxT(""), wxDefaultPosition, wxSize(50, -1), 0 ); m_spacingAfter->SetHelpText(_("The spacing after the paragraph.")); if (wxRichTextListStylePage::ShowToolTips()) m_spacingAfter->SetToolTip(_("The spacing after the paragraph.")); diff --git a/src/richtext/richtextstylepage.cpp b/src/richtext/richtextstylepage.cpp index 704b8e10b6..c761fa60bf 100644 --- a/src/richtext/richtextstylepage.cpp +++ b/src/richtext/richtextstylepage.cpp @@ -103,7 +103,7 @@ void wxRichTextStylePage::CreateControls() wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Style:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - m_styleName = new wxTextCtrl( itemPanel1, ID_RICHTEXTSTYLEPAGE_STYLE_NAME, _T(""), wxDefaultPosition, wxSize(300, -1), wxTE_READONLY ); + m_styleName = new wxTextCtrl( itemPanel1, ID_RICHTEXTSTYLEPAGE_STYLE_NAME, wxT(""), wxDefaultPosition, wxSize(300, -1), wxTE_READONLY ); m_styleName->SetHelpText(_("The style name.")); if (wxRichTextStylePage::ShowToolTips()) m_styleName->SetToolTip(_("The style name.")); @@ -113,7 +113,7 @@ void wxRichTextStylePage::CreateControls() itemBoxSizer5->Add(itemStaticText8, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_basedOnStrings; - m_basedOn = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_BASED_ON, _T(""), wxDefaultPosition, wxDefaultSize, m_basedOnStrings, wxCB_DROPDOWN ); + m_basedOn = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_BASED_ON, wxT(""), wxDefaultPosition, wxDefaultSize, m_basedOnStrings, wxCB_DROPDOWN ); m_basedOn->SetHelpText(_("The style on which this style is based.")); if (wxRichTextStylePage::ShowToolTips()) m_basedOn->SetToolTip(_("The style on which this style is based.")); @@ -123,7 +123,7 @@ void wxRichTextStylePage::CreateControls() itemBoxSizer5->Add(itemStaticText10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); wxArrayString m_nextStyleStrings; - m_nextStyle = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_NEXT_STYLE, _T(""), wxDefaultPosition, wxDefaultSize, m_nextStyleStrings, wxCB_DROPDOWN ); + m_nextStyle = new wxComboBox( itemPanel1, ID_RICHTEXTSTYLEPAGE_NEXT_STYLE, wxT(""), wxDefaultPosition, wxDefaultSize, m_nextStyleStrings, wxCB_DROPDOWN ); m_nextStyle->SetHelpText(_("The default style for the next paragraph.")); if (wxRichTextStylePage::ShowToolTips()) m_nextStyle->SetToolTip(_("The default style for the next paragraph.")); diff --git a/src/richtext/richtextsymboldlg.cpp b/src/richtext/richtextsymboldlg.cpp index d455090b8d..2a4b08507e 100644 --- a/src/richtext/richtextsymboldlg.cpp +++ b/src/richtext/richtextsymboldlg.cpp @@ -394,7 +394,7 @@ void wxSymbolPickerDialog::CreateControls() itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxArrayString m_fontCtrlStrings; - m_fontCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FONT, _T(""), wxDefaultPosition, wxSize(240, -1), m_fontCtrlStrings, wxCB_READONLY ); + m_fontCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_FONT, wxT(""), wxDefaultPosition, wxSize(240, -1), m_fontCtrlStrings, wxCB_READONLY ); m_fontCtrl->SetHelpText(_("The font from which to take the symbol.")); if (wxSymbolPickerDialog::ShowToolTips()) m_fontCtrl->SetToolTip(_("The font from which to take the symbol.")); @@ -410,7 +410,7 @@ void wxSymbolPickerDialog::CreateControls() #if defined(__UNICODE__) wxArrayString m_subsetCtrlStrings; - m_subsetCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_SUBSET, _T(""), wxDefaultPosition, wxDefaultSize, m_subsetCtrlStrings, wxCB_READONLY ); + m_subsetCtrl = new wxComboBox( itemDialog1, ID_SYMBOLPICKERDIALOG_SUBSET, wxT(""), wxDefaultPosition, wxDefaultSize, m_subsetCtrlStrings, wxCB_READONLY ); m_subsetCtrl->SetHelpText(_("Shows a Unicode subset.")); if (wxSymbolPickerDialog::ShowToolTips()) m_subsetCtrl->SetToolTip(_("Shows a Unicode subset.")); @@ -432,7 +432,7 @@ void wxSymbolPickerDialog::CreateControls() wxStaticText* itemStaticText15 = new wxStaticText( itemDialog1, wxID_STATIC, _("&Character code:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer12->Add(itemStaticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - m_characterCodeCtrl = new wxTextCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_CHARACTERCODE, _T(""), wxDefaultPosition, wxSize(140, -1), wxTE_READONLY|wxTE_CENTRE ); + m_characterCodeCtrl = new wxTextCtrl( itemDialog1, ID_SYMBOLPICKERDIALOG_CHARACTERCODE, wxT(""), wxDefaultPosition, wxSize(140, -1), wxTE_READONLY|wxTE_CENTRE ); m_characterCodeCtrl->SetHelpText(_("The character code.")); if (wxSymbolPickerDialog::ShowToolTips()) m_characterCodeCtrl->SetToolTip(_("The character code.")); @@ -801,7 +801,7 @@ bool wxSymbolListCtrl::DoSetCurrent(int current) { wxASSERT_MSG( current == wxNOT_FOUND || (current >= m_minSymbolValue && current <= m_maxSymbolValue), - _T("wxSymbolListCtrl::DoSetCurrent(): invalid symbol value") ); + wxT("wxSymbolListCtrl::DoSetCurrent(): invalid symbol value") ); if ( current == m_current ) { @@ -854,7 +854,7 @@ void wxSymbolListCtrl::SetSelection(int selection) { wxCHECK_RET( selection == wxNOT_FOUND || (selection >= m_minSymbolValue && selection < m_maxSymbolValue), - _T("wxSymbolListCtrl::SetSelection(): invalid symbol value") ); + wxT("wxSymbolListCtrl::SetSelection(): invalid symbol value") ); DoSetCurrent(selection); } diff --git a/src/richtext/richtexttabspage.cpp b/src/richtext/richtexttabspage.cpp index 9ce1f54f7b..2285d3fa93 100644 --- a/src/richtext/richtexttabspage.cpp +++ b/src/richtext/richtexttabspage.cpp @@ -113,7 +113,7 @@ void wxRichTextTabsPage::CreateControls() wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("&Position (tenths of a mm):"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxTOP, 5); - m_tabEditCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTTABSPAGE_TABEDIT, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); + m_tabEditCtrl = new wxTextCtrl( itemPanel1, ID_RICHTEXTTABSPAGE_TABEDIT, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); m_tabEditCtrl->SetHelpText(_("The tab position.")); if (wxRichTextTabsPage::ShowToolTips()) m_tabEditCtrl->SetToolTip(_("The tab position.")); @@ -129,7 +129,7 @@ void wxRichTextTabsPage::CreateControls() wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxVERTICAL); itemBoxSizer4->Add(itemBoxSizer10, 0, wxGROW, 5); - wxStaticText* itemStaticText11 = new wxStaticText( itemPanel1, wxID_STATIC, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); + wxStaticText* itemStaticText11 = new wxStaticText( itemPanel1, wxID_STATIC, wxT(""), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer10->Add(itemStaticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5); wxButton* itemButton12 = new wxButton( itemPanel1, ID_RICHTEXTTABSPAGE_NEW_TAB, _("&New"), wxDefaultPosition, wxDefaultSize, 0 ); diff --git a/src/univ/checkbox.cpp b/src/univ/checkbox.cpp index 520a2edf05..b1f443903f 100644 --- a/src/univ/checkbox.cpp +++ b/src/univ/checkbox.cpp @@ -217,7 +217,7 @@ void wxCheckBox::DoSet3StateValue(wxCheckBoxState state) { case wxCHK_UNCHECKED: status = Status_Unchecked; break; case wxCHK_CHECKED: status = Status_Checked; break; - default: wxFAIL_MSG(_T("Unknown checkbox state")); + default: wxFAIL_MSG(wxT("Unknown checkbox state")); case wxCHK_UNDETERMINED: status = Status_3rdState; break; } if ( status != m_status ) diff --git a/src/univ/checklst.cpp b/src/univ/checklst.cpp index 3a85960386..134e30b9b3 100644 --- a/src/univ/checklst.cpp +++ b/src/univ/checklst.cpp @@ -122,7 +122,7 @@ bool wxCheckListBox::Create(wxWindow *parent, bool wxCheckListBox::IsChecked(unsigned int item) const { wxCHECK_MSG( IsValid(item), false, - _T("invalid index in wxCheckListBox::IsChecked") ); + wxT("invalid index in wxCheckListBox::IsChecked") ); return m_checks[item] != 0; } @@ -130,7 +130,7 @@ bool wxCheckListBox::IsChecked(unsigned int item) const void wxCheckListBox::Check(unsigned int item, bool check) { wxCHECK_RET( IsValid(item), - _T("invalid index in wxCheckListBox::Check") ); + wxT("invalid index in wxCheckListBox::Check") ); // intermediate var is needed to avoid compiler warning with VC++ bool isChecked = m_checks[item] != 0; diff --git a/src/univ/combobox.cpp b/src/univ/combobox.cpp index 9d8033a7d8..2a23793d7e 100644 --- a/src/univ/combobox.cpp +++ b/src/univ/combobox.cpp @@ -364,7 +364,7 @@ void wxComboBox::DoClear() void wxComboBox::DoDeleteOneItem(unsigned int n) { - wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::Delete") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::Delete") ); if (GetSelection() == (int)n) if ( GetTextCtrl() ) GetTextCtrl()->SetValue(wxEmptyString); @@ -379,14 +379,14 @@ unsigned int wxComboBox::GetCount() const wxString wxComboBox::GetString(unsigned int n) const { - wxCHECK_MSG( IsValid(n), wxEmptyString, _T("invalid index in wxComboBox::GetString") ); + wxCHECK_MSG( IsValid(n), wxEmptyString, wxT("invalid index in wxComboBox::GetString") ); return GetLBox()->GetString(n); } void wxComboBox::SetString(unsigned int n, const wxString& s) { - wxCHECK_RET( IsValid(n), _T("invalid index in wxComboBox::SetString") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxComboBox::SetString") ); GetLBox()->SetString(n, s); } @@ -398,7 +398,7 @@ int wxComboBox::FindString(const wxString& s, bool bCase) const void wxComboBox::SetSelection(int n) { - wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), _T("invalid index in wxComboBox::Select") ); + wxCHECK_RET( (n == wxNOT_FOUND || IsValid(n)), wxT("invalid index in wxComboBox::Select") ); GetLBox()->SetSelection(n); diff --git a/src/univ/ctrlrend.cpp b/src/univ/ctrlrend.cpp index 765144be01..60d561ea24 100644 --- a/src/univ/ctrlrend.cpp +++ b/src/univ/ctrlrend.cpp @@ -208,9 +208,9 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, { wxRect rectUpdate = rgnUpdate.GetBox(); - wxLogTrace(_T("scrollbar"), - _T("%s redraw: update box is (%d, %d)-(%d, %d)"), - scrollbar->IsVertical() ? _T("vert") : _T("horz"), + wxLogTrace(wxT("scrollbar"), + wxT("%s redraw: update box is (%d, %d)-(%d, %d)"), + scrollbar->IsVertical() ? wxT("vert") : wxT("horz"), rectUpdate.GetLeft(), rectUpdate.GetTop(), rectUpdate.GetRight(), @@ -247,8 +247,8 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, if ( rgnUpdate.Contains(rectBar) ) { - wxLogTrace(_T("scrollbar"), - _T("drawing bar part %d at (%d, %d)-(%d, %d)"), + wxLogTrace(wxT("scrollbar"), + wxT("drawing bar part %d at (%d, %d)-(%d, %d)"), nBar + 1, rectBar.GetLeft(), rectBar.GetTop(), @@ -271,8 +271,8 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, wxRect rectArrow = scrollbar->GetScrollbarRect(elem); if ( rgnUpdate.Contains(rectArrow) ) { - wxLogTrace(_T("scrollbar"), - _T("drawing arrow %d at (%d, %d)-(%d, %d)"), + wxLogTrace(wxT("scrollbar"), + wxT("drawing arrow %d at (%d, %d)-(%d, %d)"), nArrow + 1, rectArrow.GetLeft(), rectArrow.GetTop(), @@ -296,8 +296,8 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, wxRect rectThumb = scrollbar->GetScrollbarRect(elem); if ( rectThumb.width && rectThumb.height && rgnUpdate.Contains(rectThumb) ) { - wxLogTrace(_T("scrollbar"), - _T("drawing thumb at (%d, %d)-(%d, %d)"), + wxLogTrace(wxT("scrollbar"), + wxT("drawing thumb at (%d, %d)-(%d, %d)"), rectThumb.GetLeft(), rectThumb.GetTop(), rectThumb.GetRight(), @@ -315,7 +315,7 @@ void wxControlRenderer::DrawScrollbar(const wxScrollBar *scrollbar, void wxControlRenderer::DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) { wxASSERT_MSG( x1 == x2 || y1 == y2, - _T("line must be either horizontal or vertical") ); + wxT("line must be either horizontal or vertical") ); if ( x1 == x2 ) m_renderer->DrawVerticalLine(m_dc, x1, y1, y2); @@ -465,7 +465,7 @@ void wxControlRenderer::DrawProgressBar(const wxGauge *gauge) int step = gauge->IsVertical() ? sizeStep.y : sizeStep.x; // we divide by it below! - wxCHECK_RET( step, _T("invalid wxGauge step") ); + wxCHECK_RET( step, wxT("invalid wxGauge step") ); // round up to make the progress appear to start faster int lenTotal = gauge->IsVertical() ? rect.height : rect.width; diff --git a/src/univ/dialog.cpp b/src/univ/dialog.cpp index 3faf2f7800..f0f3d659c2 100644 --- a/src/univ/dialog.cpp +++ b/src/univ/dialog.cpp @@ -192,7 +192,7 @@ int wxDialog::ShowModal() m_isShowingModal = true; - wxASSERT_MSG( !m_windowDisabler, _T("disabling windows twice?") ); + wxASSERT_MSG( !m_windowDisabler, wxT("disabling windows twice?") ); #if defined(__WXGTK__) || defined(__WXMGL__) wxBusyCursorSuspender suspender; @@ -210,7 +210,7 @@ int wxDialog::ShowModal() void wxDialog::EndModal(int retCode) { - wxASSERT_MSG( m_eventLoop, _T("wxDialog is not modal") ); + wxASSERT_MSG( m_eventLoop, wxT("wxDialog is not modal") ); SetReturnCode(retCode); diff --git a/src/univ/listbox.cpp b/src/univ/listbox.cpp index baa5f5924e..520ae86b20 100644 --- a/src/univ/listbox.cpp +++ b/src/univ/listbox.cpp @@ -283,7 +283,7 @@ int wxListBox::DoInsertItems(const wxArrayStringsAdapter& items, void wxListBox::SetString(unsigned int n, const wxString& s) { - wxCHECK_RET( !IsSorted(), _T("can't set string in sorted listbox") ); + wxCHECK_RET( !IsSorted(), wxT("can't set string in sorted listbox") ); if ( IsSorted() ) (*m_strings.sorted)[n] = s; @@ -341,7 +341,7 @@ void wxListBox::DoClear() void wxListBox::DoDeleteOneItem(unsigned int n) { wxCHECK_RET( IsValid(n), - _T("invalid index in wxListBox::Delete") ); + wxT("invalid index in wxListBox::Delete") ); // do it before removing the index as otherwise the last item will not be // refreshed (as GetCount() will be decremented) @@ -460,7 +460,7 @@ void wxListBox::DoSetSelection(int n, bool select) // sanity check: a single selection listbox can't have more than one item // selected wxASSERT_MSG( HasMultipleSelection() || (m_selections.GetCount() < 2), - _T("multiple selected items in single selection lbox?") ); + wxT("multiple selected items in single selection lbox?") ); if ( select ) { @@ -472,7 +472,7 @@ void wxListBox::DoSetSelection(int n, bool select) int wxListBox::GetSelection() const { wxCHECK_MSG( !HasMultipleSelection(), wxNOT_FOUND, - _T("use wxListBox::GetSelections for ths listbox") ); + wxT("use wxListBox::GetSelections for ths listbox") ); return m_selections.IsEmpty() ? wxNOT_FOUND : m_selections[0]; } @@ -639,7 +639,7 @@ void wxListBox::UpdateItems() if ( m_updateCount == -1 ) { // refresh all - wxLogTrace(_T("listbox"), _T("Refreshing all")); + wxLogTrace(wxT("listbox"), wxT("Refreshing all")); Refresh(); } @@ -656,7 +656,7 @@ void wxListBox::UpdateItems() // entire line(s) CalcScrolledPosition(0, rect.y, NULL, &rect.y); - wxLogTrace(_T("listbox"), _T("Refreshing items %d..%d (%d-%d)"), + wxLogTrace(wxT("listbox"), wxT("Refreshing items %d..%d (%d-%d)"), m_updateFrom, m_updateFrom + m_updateCount - 1, rect.GetTop(), rect.GetBottom()); @@ -726,7 +726,7 @@ void wxListBox::DoDraw(wxControlRenderer *renderer) itemLast = itemMax; // do draw them - wxLogTrace(_T("listbox"), _T("Repainting items %d..%d"), + wxLogTrace(wxT("listbox"), wxT("Repainting items %d..%d"), itemFirst, itemLast); DoDrawRange(renderer, itemFirst, itemLast); @@ -947,7 +947,7 @@ bool wxListBox::FindItem(const wxString& prefix, bool strictlyAfter) int last = first == 0 ? count - 1 : first - 1; // if this is not true we'd never exit from the loop below! - wxASSERT_MSG( first < (int)count && last < (int)count, _T("logic error") ); + wxASSERT_MSG( first < (int)count && last < (int)count, wxT("logic error") ); // precompute it outside the loop size_t len = prefix.length(); @@ -1193,7 +1193,7 @@ bool wxListBox::PerformAction(const wxControlAction& action, AnchorSelection(item == -1 ? m_current : item); else if ( action == wxACTION_LISTBOX_SELECTALL || action == wxACTION_LISTBOX_SELTOGGLE ) - wxFAIL_MSG(_T("unimplemented yet")); + wxFAIL_MSG(wxT("unimplemented yet")); else return wxControl::PerformAction(action, numArg, strArg); @@ -1504,7 +1504,7 @@ bool wxStdListboxInputHandler::HandleMouseMove(wxInputConsumer *consumer, { // pass something into strArg to tell the listbox that it shouldn't // send the notification message: see PerformAction() above - lbox->PerformAction(m_actionMouse, item, _T("no")); + lbox->PerformAction(m_actionMouse, item, wxT("no")); } // else: don't pass invalid index to the listbox } diff --git a/src/univ/menu.cpp b/src/univ/menu.cpp index 9e23137767..eaf34b8f9e 100644 --- a/src/univ/menu.cpp +++ b/src/univ/menu.cpp @@ -360,7 +360,7 @@ void wxPopupMenuWindow::ChangeCurrent(wxMenuItemIter node) if ( nodeOldCurrent ) { wxMenuItem *item = nodeOldCurrent->GetData(); - wxCHECK_RET( item, _T("no current item?") ); + wxCHECK_RET( item, wxT("no current item?") ); // if it was the currently opened menu, close it if ( item->IsSubMenu() && item->GetSubMenu()->IsShown() ) @@ -432,7 +432,7 @@ void wxPopupMenuWindow::Popup(wxWindow *focus) // check that the current item had been properly reset before wxASSERT_MSG( !m_nodeCurrent || m_nodeCurrent == m_menu->GetMenuItems().GetFirst(), - _T("menu current item preselected incorrectly") ); + wxT("menu current item preselected incorrectly") ); wxPopupTransientWindow::Popup(focus); @@ -451,13 +451,13 @@ void wxPopupMenuWindow::Popup(wxWindow *focus) wxPopupMenuWindow *win = menuParent->m_popupMenu; // if we're shown, the parent menu must be also shown - wxCHECK_RET( win, _T("parent menu is not shown?") ); + wxCHECK_RET( win, wxT("parent menu is not shown?") ); if ( !::SetWindowPos(GetHwndOf(win), GetHwnd(), 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW) ) { - wxLogLastError(_T("SetWindowPos(HWND_TOP)")); + wxLogLastError(wxT("SetWindowPos(HWND_TOP)")); } Refresh(); @@ -470,10 +470,10 @@ void wxPopupMenuWindow::Dismiss() if ( HasOpenSubmenu() ) { wxMenuItem *item = GetCurrentItem(); - wxCHECK_RET( item && item->IsSubMenu(), _T("where is our open submenu?") ); + wxCHECK_RET( item && item->IsSubMenu(), wxT("where is our open submenu?") ); wxPopupMenuWindow *win = item->GetSubMenu()->m_popupMenu; - wxCHECK_RET( win, _T("opened submenu is not opened?") ); + wxCHECK_RET( win, wxT("opened submenu is not opened?") ); win->Dismiss(); OnSubmenuDismiss( false ); @@ -542,9 +542,9 @@ wxPopupMenuWindow::GetMenuItemFromPoint(const wxPoint& pt) const void wxPopupMenuWindow::RefreshItem(wxMenuItem *item) { - wxCHECK_RET( item, _T("can't refresh NULL item") ); + wxCHECK_RET( item, wxT("can't refresh NULL item") ); - wxASSERT_MSG( IsShown(), _T("can't refresh menu which is not shown") ); + wxASSERT_MSG( IsShown(), wxT("can't refresh menu which is not shown") ); // FIXME: -1 here because of SetLogicalOrigin(1, 1) in DoDraw() RefreshRect(wxRect(0, item->GetPosition() - 1, @@ -637,10 +637,10 @@ void wxPopupMenuWindow::DoDraw(wxControlRenderer *renderer) void wxPopupMenuWindow::ClickItem(wxMenuItem *item) { - wxCHECK_RET( item, _T("can't click NULL item") ); + wxCHECK_RET( item, wxT("can't click NULL item") ); wxASSERT_MSG( !item->IsSeparator() && !item->IsSubMenu(), - _T("can't click this item") ); + wxT("can't click this item") ); wxMenu* menu = m_menu; @@ -652,10 +652,10 @@ void wxPopupMenuWindow::ClickItem(wxMenuItem *item) void wxPopupMenuWindow::OpenSubmenu(wxMenuItem *item, InputMethod how) { - wxCHECK_RET( item, _T("can't open NULL submenu") ); + wxCHECK_RET( item, wxT("can't open NULL submenu") ); wxMenu *submenu = item->GetSubMenu(); - wxCHECK_RET( submenu, _T("can only open submenus!") ); + wxCHECK_RET( submenu, wxT("can only open submenus!") ); // FIXME: should take into account the border width submenu->Popup(ClientToScreen(wxPoint(0, item->GetPosition())), @@ -710,7 +710,7 @@ bool wxPopupMenuWindow::ProcessLeftDown(wxMouseEvent& event) { wxPopupMenuWindow *win = menu->m_popupMenu; - wxCHECK_MSG( win, false, _T("parent menu not shown?") ); + wxCHECK_MSG( win, false, wxT("parent menu not shown?") ); pos = ClientToScreen(pos); if ( win->GetMenuItemFromPoint(win->ScreenToClient(pos)) ) @@ -799,7 +799,7 @@ void wxPopupMenuWindow::ProcessMouseMove(const wxPoint& pt) wxPopupMenuWindow *win = menuParent->m_popupMenu; // if we're shown, the parent menu must be also shown - wxCHECK_RET( win, _T("parent menu is not shown?") ); + wxCHECK_RET( win, wxT("parent menu is not shown?") ); win->ProcessMouseMove(win->ScreenToClient(ptScreen)); } @@ -834,10 +834,10 @@ void wxPopupMenuWindow::OnMouseLeave(wxMouseEvent& event) if ( HasOpenSubmenu() ) { wxMenuItem *item = GetCurrentItem(); - wxCHECK_RET( CanOpen(item), _T("where is our open submenu?") ); + wxCHECK_RET( CanOpen(item), wxT("where is our open submenu?") ); wxPopupMenuWindow *win = item->GetSubMenu()->m_popupMenu; - wxCHECK_RET( win, _T("submenu is opened but not shown?") ); + wxCHECK_RET( win, wxT("submenu is opened but not shown?") ); // only handle this event if the mouse is not inside the submenu wxPoint pt = ClientToScreen(event.GetPosition()); @@ -883,7 +883,7 @@ bool wxPopupMenuWindow::ProcessKeyDown(int key) if ( HasOpenSubmenu() ) { wxCHECK_MSG( CanOpen(item), false, - _T("has open submenu but another item selected?") ); + wxT("has open submenu but another item selected?") ); if ( item->GetSubMenu()->ProcessKeyDown(key) ) return true; @@ -1087,7 +1087,7 @@ const wxMenuGeometryInfo& wxMenu::GetGeometryInfo() const } else { - wxFAIL_MSG( _T("can't get geometry without window") ); + wxFAIL_MSG( wxT("can't get geometry without window") ); } } @@ -1156,7 +1156,7 @@ wxMenuItem* wxMenu::DoAppend(wxMenuItem *item) } else { - wxFAIL_MSG( _T("where is the radio group start item?") ); + wxFAIL_MSG( wxT("where is the radio group start item?") ); } } } @@ -1207,7 +1207,7 @@ void wxMenu::Attach(wxMenuBarBase *menubar) { wxMenuBase::Attach(menubar); - wxCHECK_RET( m_menuBar, _T("menubar can't be NULL after attaching") ); + wxCHECK_RET( m_menuBar, wxT("menubar can't be NULL after attaching") ); // unfortunately, we can't use m_menuBar->GetEventHandler() here because, // if the menubar is currently showing a menu, its event handler is a @@ -1263,7 +1263,7 @@ wxWindow *wxMenu::GetRootWindow() const // we're probably going to crash in the caller anyhow, but try to detect // this error as soon as possible - wxASSERT_MSG( win, _T("menu without any associated window?") ); + wxASSERT_MSG( win, wxT("menu without any associated window?") ); // also remember it in this menu so that we don't have to search for it the // next time @@ -1275,7 +1275,7 @@ wxWindow *wxMenu::GetRootWindow() const wxRenderer *wxMenu::GetRenderer() const { // we're going to crash without renderer! - wxCHECK_MSG( m_popupMenu, NULL, _T("neither popup nor menubar menu?") ); + wxCHECK_MSG( m_popupMenu, NULL, wxT("neither popup nor menubar menu?") ); return m_popupMenu->GetRenderer(); } @@ -1288,7 +1288,7 @@ void wxMenu::RefreshItem(wxMenuItem *item) if ( IsShown() ) { // this would be a bug in IsShown() - wxCHECK_RET( m_popupMenu, _T("must have popup window if shown!") ); + wxCHECK_RET( m_popupMenu, wxT("must have popup window if shown!") ); // recalc geometry to update the item height and such (void)GetGeometryInfo(); @@ -1318,7 +1318,7 @@ void wxMenu::OnDismiss(bool dismissParent) } else { - wxFAIL_MSG( _T("parent menu not shown?") ); + wxFAIL_MSG( wxT("parent menu not shown?") ); } // and if we dismiss everything, propagate to parent @@ -1338,7 +1338,7 @@ void wxMenu::OnDismiss(bool dismissParent) } else // popup menu { - wxCHECK_RET( m_invokingWindow, _T("what kind of menu is this?") ); + wxCHECK_RET( m_invokingWindow, wxT("what kind of menu is this?") ); m_invokingWindow->DismissPopupMenu(); @@ -1373,7 +1373,7 @@ void wxMenu::Popup(const wxPoint& pos, const wxSize& size, bool selectFirst) // always keep the focus at the originating window wxWindow *focus = GetRootWindow(); - wxASSERT_MSG( focus, _T("no window to keep focus on?") ); + wxASSERT_MSG( focus, wxT("no window to keep focus on?") ); // and show it m_popupMenu->Popup(focus); @@ -1381,7 +1381,7 @@ void wxMenu::Popup(const wxPoint& pos, const wxSize& size, bool selectFirst) void wxMenu::Dismiss() { - wxCHECK_RET( IsShown(), _T("can't dismiss hidden menu") ); + wxCHECK_RET( IsShown(), wxT("can't dismiss hidden menu") ); m_popupMenu->Dismiss(); } @@ -1393,7 +1393,7 @@ void wxMenu::Dismiss() bool wxMenu::ProcessKeyDown(int key) { wxCHECK_MSG( m_popupMenu, false, - _T("can't process key events if not shown") ); + wxT("can't process key events if not shown") ); return m_popupMenu->ProcessKeyDown(key); } @@ -1533,7 +1533,7 @@ void wxMenuItem::UpdateAccelInfo() m_indexAccel = wxControl::FindAccelIndex(m_text); // will be empty if the text contains no TABs - ok - m_strAccel = m_text.AfterFirst(_T('\t')); + m_strAccel = m_text.AfterFirst(wxT('\t')); } void wxMenuItem::SetItemLabel(const wxString& text) @@ -1596,7 +1596,7 @@ void wxMenuItem::Check(bool check) const wxMenuItemList& items = m_parentMenu->GetMenuItems(); int pos = items.IndexOf(this); wxCHECK_RET( pos != wxNOT_FOUND, - _T("menuitem not found in the menu items list?") ); + wxT("menuitem not found in the menu items list?") ); // get the radio group range int start, @@ -1643,7 +1643,7 @@ void wxMenuItem::SetAsRadioGroupStart() void wxMenuItem::SetRadioGroupStart(int start) { wxASSERT_MSG( !m_isRadioGroupStart, - _T("should only be called for the next radio items") ); + wxT("should only be called for the next radio items") ); m_radioGroup.start = start; } @@ -1651,7 +1651,7 @@ void wxMenuItem::SetRadioGroupStart(int start) void wxMenuItem::SetRadioGroupEnd(int end) { wxASSERT_MSG( m_isRadioGroupStart, - _T("should only be called for the first radio item") ); + wxT("should only be called for the first radio item") ); m_radioGroup.end = end; } @@ -1682,7 +1682,7 @@ wxMenuBar::wxMenuBar(size_t n, wxMenu *menus[], const wxString titles[], long WX void wxMenuBar::Attach(wxFrame *frame) { // maybe you really wanted to call Detach()? - wxCHECK_RET( frame, _T("wxMenuBar::Attach(NULL) called") ); + wxCHECK_RET( frame, wxT("wxMenuBar::Attach(NULL) called") ); wxMenuBarBase::Attach(frame); @@ -1800,7 +1800,7 @@ wxCoord wxMenuBar::GetItemWidth(size_t pos) const void wxMenuBar::EnableTop(size_t pos, bool enable) { - wxCHECK_RET( pos < GetCount(), _T("invalid index in EnableTop") ); + wxCHECK_RET( pos < GetCount(), wxT("invalid index in EnableTop") ); if ( enable != m_menuInfos[pos].IsEnabled() ) { @@ -1813,14 +1813,14 @@ void wxMenuBar::EnableTop(size_t pos, bool enable) bool wxMenuBar::IsEnabledTop(size_t pos) const { - wxCHECK_MSG( pos < GetCount(), false, _T("invalid index in IsEnabledTop") ); + wxCHECK_MSG( pos < GetCount(), false, wxT("invalid index in IsEnabledTop") ); return m_menuInfos[pos].IsEnabled(); } void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label) { - wxCHECK_RET( pos < GetCount(), _T("invalid index in SetMenuLabel") ); + wxCHECK_RET( pos < GetCount(), wxT("invalid index in SetMenuLabel") ); if ( label != m_menuInfos[pos].GetOriginalLabel() ) { @@ -1833,7 +1833,7 @@ void wxMenuBar::SetMenuLabel(size_t pos, const wxString& label) wxString wxMenuBar::GetMenuLabel(size_t pos) const { - wxCHECK_MSG( pos < GetCount(), wxEmptyString, _T("invalid index in GetMenuLabel") ); + wxCHECK_MSG( pos < GetCount(), wxEmptyString, wxT("invalid index in GetMenuLabel") ); return m_menuInfos[pos].GetOriginalLabel(); } @@ -1858,7 +1858,7 @@ void wxMenuBar::RefreshAllItemsAfter(size_t pos) void wxMenuBar::RefreshItem(size_t pos) { wxCHECK_RET( pos != (size_t)-1, - _T("invalid item in wxMenuBar::RefreshItem") ); + wxT("invalid item in wxMenuBar::RefreshItem") ); if ( !IsCreated() ) { @@ -1933,8 +1933,8 @@ void wxMenuBar::DoDraw(wxControlRenderer *renderer) wxRect wxMenuBar::GetItemRect(size_t pos) const { - wxASSERT_MSG( pos < GetCount(), _T("invalid menu bar item index") ); - wxASSERT_MSG( IsCreated(), _T("can't call this method yet") ); + wxASSERT_MSG( pos < GetCount(), wxT("invalid menu bar item index") ); + wxASSERT_MSG( IsCreated(), wxT("can't call this method yet") ); wxRect rect; rect.x = @@ -2004,7 +2004,7 @@ int wxMenuBar::GetMenuFromPoint(const wxPoint& pos) const void wxMenuBar::SelectMenu(size_t pos) { SetFocus(); - wxLogTrace(_T("mousecapture"), _T("Capturing mouse from wxMenuBar::SelectMenu")); + wxLogTrace(wxT("mousecapture"), wxT("Capturing mouse from wxMenuBar::SelectMenu")); CaptureMouse(); DoSelectMenu(pos); @@ -2012,7 +2012,7 @@ void wxMenuBar::SelectMenu(size_t pos) void wxMenuBar::DoSelectMenu(size_t pos) { - wxCHECK_RET( pos < GetCount(), _T("invalid menu index in DoSelectMenu") ); + wxCHECK_RET( pos < GetCount(), wxT("invalid menu index in DoSelectMenu") ); int posOld = m_current; @@ -2040,7 +2040,7 @@ void wxMenuBar::DoSelectMenu(size_t pos) void wxMenuBar::PopupMenu(size_t pos) { - wxCHECK_RET( pos < GetCount(), _T("invalid menu index in PopupCurrentMenu") ); + wxCHECK_RET( pos < GetCount(), wxT("invalid menu index in PopupCurrentMenu") ); SetFocus(); DoSelectMenu(pos); @@ -2093,7 +2093,7 @@ void wxMenuBar::OnLeftDown(wxMouseEvent& event) } else // on item { - wxLogTrace(_T("mousecapture"), _T("Capturing mouse from wxMenuBar::OnLeftDown")); + wxLogTrace(wxT("mousecapture"), wxT("Capturing mouse from wxMenuBar::OnLeftDown")); CaptureMouse(); // show it as selected @@ -2168,7 +2168,7 @@ void wxMenuBar::OnKeyDown(wxKeyEvent& event) { // we always maintain a valid current item while we're in modal // state (i.e. have the capture) - wxFAIL_MSG( _T("how did we manage to lose current item?") ); + wxFAIL_MSG( wxT("how did we manage to lose current item?") ); return; } @@ -2399,10 +2399,10 @@ bool wxMenuBar::ProcessAccelEvent(const wxKeyEvent& event) void wxMenuBar::PopupCurrentMenu(bool selectFirst) { - wxCHECK_RET( m_current != -1, _T("no menu to popup") ); + wxCHECK_RET( m_current != -1, wxT("no menu to popup") ); // forgot to call DismissMenu()? - wxASSERT_MSG( !m_menuShown, _T("shouldn't show two menus at once!") ); + wxASSERT_MSG( !m_menuShown, wxT("shouldn't show two menus at once!") ); // in any case, we should show it - even if we won't m_shouldShowMenu = true; @@ -2437,7 +2437,7 @@ void wxMenuBar::PopupCurrentMenu(bool selectFirst) void wxMenuBar::DismissMenu() { - wxCHECK_RET( m_menuShown, _T("can't dismiss menu if none is shown") ); + wxCHECK_RET( m_menuShown, wxT("can't dismiss menu if none is shown") ); m_menuShown->Dismiss(); OnDismissMenu(); @@ -2457,7 +2457,7 @@ void wxMenuBar::OnDismiss() { if ( ReleaseMouseCapture() ) { - wxLogTrace(_T("mousecapture"), _T("Releasing mouse from wxMenuBar::OnDismiss")); + wxLogTrace(wxT("mousecapture"), wxT("Releasing mouse from wxMenuBar::OnDismiss")); } if ( m_current != -1 ) @@ -2521,7 +2521,7 @@ wxEventLoop *wxWindow::ms_evtLoopPopup = NULL; bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) { wxCHECK_MSG( !ms_evtLoopPopup, false, - _T("can't show more than one popup menu at a time") ); + wxT("can't show more than one popup menu at a time") ); #ifdef __WXMSW__ // we need to change the cursor before showing the menu as, apparently, no @@ -2583,7 +2583,7 @@ bool wxWindow::DoPopupMenu(wxMenu *menu, int x, int y) void wxWindow::DismissPopupMenu() { - wxCHECK_RET( ms_evtLoopPopup, _T("no popup menu shown") ); + wxCHECK_RET( ms_evtLoopPopup, wxT("no popup menu shown") ); ms_evtLoopPopup->Exit(); } diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index d219fa2162..1376222d9b 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -162,14 +162,14 @@ bool wxNotebook::Create(wxWindow *parent, wxString wxNotebook::GetPageText(size_t nPage) const { - wxCHECK_MSG( IS_VALID_PAGE(nPage), wxEmptyString, _T("invalid notebook page") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), wxEmptyString, wxT("invalid notebook page") ); return m_titles[nPage]; } bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) { - wxCHECK_MSG( IS_VALID_PAGE(nPage), false, _T("invalid notebook page") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("invalid notebook page") ); if ( strText != m_titles[nPage] ) { @@ -192,17 +192,17 @@ bool wxNotebook::SetPageText(size_t nPage, const wxString& strText) int wxNotebook::GetPageImage(size_t nPage) const { - wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("invalid notebook page") ); return m_images[nPage]; } bool wxNotebook::SetPageImage(size_t nPage, int nImage) { - wxCHECK_MSG( IS_VALID_PAGE(nPage), false, _T("invalid notebook page") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), false, wxT("invalid notebook page") ); wxCHECK_MSG( m_imageList && nImage < m_imageList->GetImageCount(), false, - _T("invalid image index in SetPageImage()") ); + wxT("invalid image index in SetPageImage()") ); if ( nImage != m_images[nPage] ) { @@ -231,7 +231,7 @@ wxNotebook::~wxNotebook() int wxNotebook::DoSetSelection(size_t nPage, int flags) { - wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, _T("invalid notebook page") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), wxNOT_FOUND, wxT("invalid notebook page") ); if ( (size_t)nPage == m_sel ) { @@ -312,7 +312,7 @@ bool wxNotebook::InsertPage(size_t nPage, { size_t nPages = GetPageCount(); wxCHECK_MSG( nPage == nPages || IS_VALID_PAGE(nPage), false, - _T("invalid notebook page in InsertPage()") ); + wxT("invalid notebook page in InsertPage()") ); // modify the data m_pages.Insert(pPage, nPage); @@ -389,7 +389,7 @@ bool wxNotebook::DeleteAllPages() wxNotebookPage *wxNotebook::DoRemovePage(size_t nPage) { - wxCHECK_MSG( IS_VALID_PAGE(nPage), NULL, _T("invalid notebook page") ); + wxCHECK_MSG( IS_VALID_PAGE(nPage), NULL, wxT("invalid notebook page") ); wxNotebookPage *page = m_pages[nPage]; m_pages.RemoveAt(nPage); @@ -450,7 +450,7 @@ void wxNotebook::RefreshCurrent() void wxNotebook::RefreshTab(int page, bool forceSelected) { - wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") ); + wxCHECK_RET( IS_VALID_PAGE(page), wxT("invalid notebook page") ); wxRect rect = GetTabRect(page); if ( forceSelected || ((size_t)page == m_sel) ) @@ -617,7 +617,7 @@ int wxNotebook::HitTest(const wxPoint& pt, long *flags) const switch ( GetTabOrientation() ) { default: - wxFAIL_MSG(_T("unknown tab orientation")); + wxFAIL_MSG(wxT("unknown tab orientation")); // fall through case wxTOP: @@ -690,7 +690,7 @@ wxDirection wxNotebook::GetTabOrientation() const wxRect wxNotebook::GetTabRect(int page) const { wxRect rect; - wxCHECK_MSG( IS_VALID_PAGE(page), rect, _T("invalid notebook page") ); + wxCHECK_MSG( IS_VALID_PAGE(page), rect, wxT("invalid notebook page") ); // calc the size of this tab and of the preceding ones wxCoord widthThis, widthBefore; @@ -793,7 +793,7 @@ wxRect wxNotebook::GetTabsPart() const void wxNotebook::GetTabSize(int page, wxCoord *w, wxCoord *h) const { - wxCHECK_RET( w && h, _T("NULL pointer in GetTabSize") ); + wxCHECK_RET( w && h, wxT("NULL pointer in GetTabSize") ); if ( IsVertical() ) { @@ -812,7 +812,7 @@ void wxNotebook::GetTabSize(int page, wxCoord *w, wxCoord *h) const void wxNotebook::SetTabSize(const wxSize& sz) { - wxCHECK_RET( FixedSizeTabs(), _T("SetTabSize() ignored") ); + wxCHECK_RET( FixedSizeTabs(), wxT("SetTabSize() ignored") ); if ( IsVertical() ) { @@ -833,7 +833,7 @@ wxSize wxNotebook::CalcTabSize(int page) const wxSize size; - wxCHECK_MSG( IS_VALID_PAGE(page), size, _T("invalid notebook page") ); + wxCHECK_MSG( IS_VALID_PAGE(page), size, wxT("invalid notebook page") ); GetTextExtent(m_titles[page], &size.x, &size.y); @@ -1174,7 +1174,7 @@ void wxNotebook::PositionSpinBtn() switch ( GetTabOrientation() ) { default: - wxFAIL_MSG(_T("unknown tab orientation")); + wxFAIL_MSG(wxT("unknown tab orientation")); // fall through case wxTOP: @@ -1207,7 +1207,7 @@ void wxNotebook::PositionSpinBtn() void wxNotebook::ScrollTo(int page) { - wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") ); + wxCHECK_RET( IS_VALID_PAGE(page), wxT("invalid notebook page") ); // set the first visible tab and offset (easy) m_firstVisible = (size_t)page; @@ -1225,7 +1225,7 @@ void wxNotebook::ScrollTo(int page) void wxNotebook::ScrollLastTo(int page) { - wxCHECK_RET( IS_VALID_PAGE(page), _T("invalid notebook page") ); + wxCHECK_RET( IS_VALID_PAGE(page), wxT("invalid notebook page") ); // go backwards until we find the first tab which can be made visible // without hiding the given one @@ -1261,7 +1261,7 @@ void wxNotebook::ScrollLastTo(int page) ScrollTo(m_firstVisible); // consitency check: the page we were asked to show should be shown - wxASSERT_MSG( (size_t)page < m_lastVisible, _T("bug in ScrollLastTo") ); + wxASSERT_MSG( (size_t)page < m_lastVisible, wxT("bug in ScrollLastTo") ); } // ---------------------------------------------------------------------------- diff --git a/src/univ/radiobox.cpp b/src/univ/radiobox.cpp index cff69702fb..ac606d1cd3 100644 --- a/src/univ/radiobox.cpp +++ b/src/univ/radiobox.cpp @@ -157,7 +157,7 @@ bool wxRadioBox::Create(wxWindow *parent, } else { - wxFAIL_MSG( _T("you must specify wxRA_XXX style!") ); + wxFAIL_MSG( wxT("you must specify wxRA_XXX style!") ); // use default style = wxRA_SPECIFY_COLS | wxRA_LEFTTORIGHT; @@ -239,7 +239,7 @@ void wxRadioBox::Append(int count, const wxString *choices) void wxRadioBox::SetSelection(int n) { - wxCHECK_RET( IsValid(n), _T("invalid index in wxRadioBox::SetSelection") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxRadioBox::SetSelection") ); m_selection = n; @@ -259,7 +259,7 @@ int wxRadioBox::GetSelection() const void wxRadioBox::SendRadioEvent() { - wxCHECK_RET( m_selection != -1, _T("no active radio button") ); + wxCHECK_RET( m_selection != -1, wxT("no active radio button") ); wxCommandEvent event(wxEVT_COMMAND_RADIOBOX_SELECTED, GetId()); InitCommandEvent(event); @@ -272,7 +272,7 @@ void wxRadioBox::SendRadioEvent() void wxRadioBox::OnRadioButton(wxEvent& event) { int n = m_buttons.Index((wxRadioButton *)event.GetEventObject()); - wxCHECK_RET( n != wxNOT_FOUND, _T("click from alien radio button") ); + wxCHECK_RET( n != wxNOT_FOUND, wxT("click from alien radio button") ); m_selection = n; @@ -286,42 +286,42 @@ void wxRadioBox::OnRadioButton(wxEvent& event) wxString wxRadioBox::GetString(unsigned int n) const { wxCHECK_MSG( IsValid(n), wxEmptyString, - _T("invalid index in wxRadioBox::GetString") ); + wxT("invalid index in wxRadioBox::GetString") ); return m_buttons[n]->GetLabel(); } void wxRadioBox::SetString(unsigned int n, const wxString& label) { - wxCHECK_RET( IsValid(n), _T("invalid index in wxRadioBox::SetString") ); + wxCHECK_RET( IsValid(n), wxT("invalid index in wxRadioBox::SetString") ); m_buttons[n]->SetLabel(label); } bool wxRadioBox::Enable(unsigned int n, bool enable) { - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::Enable") ); + wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::Enable") ); return m_buttons[n]->Enable(enable); } bool wxRadioBox::IsItemEnabled(unsigned int n) const { - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::IsItemEnabled") ); + wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::IsItemEnabled") ); return m_buttons[n]->IsEnabled(); } bool wxRadioBox::Show(unsigned int n, bool show) { - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::Show") ); + wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::Show") ); return m_buttons[n]->Show(show); } bool wxRadioBox::IsItemShown(unsigned int n) const { - wxCHECK_MSG( IsValid(n), false, _T("invalid index in wxRadioBox::IsItemShown") ); + wxCHECK_MSG( IsValid(n), false, wxT("invalid index in wxRadioBox::IsItemShown") ); return m_buttons[n]->IsShown(); } diff --git a/src/univ/scrarrow.cpp b/src/univ/scrarrow.cpp index 312bdeee1f..988ecbc957 100644 --- a/src/univ/scrarrow.cpp +++ b/src/univ/scrarrow.cpp @@ -123,7 +123,7 @@ wxScrollArrows::wxScrollArrows(wxControlWithArrows *control) wxScrollArrows::~wxScrollArrows() { // it should have been destroyed - wxASSERT_MSG( !m_captureData, _T("memory leak in wxScrollArrows") ); + wxASSERT_MSG( !m_captureData, wxT("memory leak in wxScrollArrows") ); } // ---------------------------------------------------------------------------- diff --git a/src/univ/scrolbar.cpp b/src/univ/scrolbar.cpp index 76a087e935..14e705eb06 100644 --- a/src/univ/scrolbar.cpp +++ b/src/univ/scrolbar.cpp @@ -241,7 +241,7 @@ int wxScrollBar::GetRange() const void wxScrollBar::SetThumbPosition(int pos) { - wxCHECK_RET( pos >= 0 && pos <= m_range, _T("thumb position out of range") ); + wxCHECK_RET( pos >= 0 && pos <= m_range, wxT("thumb position out of range") ); DoSetThumb(pos); } @@ -511,7 +511,7 @@ wxRect wxScrollBar::GetScrollbarRect(wxScrollBar::Element elem, case wxScrollBar::Element_Max: default: - wxFAIL_MSG( _T("unknown scrollbar element") ); + wxFAIL_MSG( wxT("unknown scrollbar element") ); } return rect; @@ -1088,7 +1088,7 @@ bool wxStdScrollBarInputHandler::HandleMouse(wxInputConsumer *consumer, // this is not supposed to happen as the button can't go up // without going down previously and then we'd have // m_winCapture by now - wxFAIL_MSG( _T("logic error in mouse capturing code") ); + wxFAIL_MSG( wxT("logic error in mouse capturing code") ); } } } diff --git a/src/univ/scrthumb.cpp b/src/univ/scrthumb.cpp index a6c0e02284..b5c49719aa 100644 --- a/src/univ/scrthumb.cpp +++ b/src/univ/scrthumb.cpp @@ -101,7 +101,7 @@ public: break; default: - wxFAIL_MSG(_T("unexpected shaft part in wxScrollThumbTimer")); + wxFAIL_MSG(wxT("unexpected shaft part in wxScrollThumbTimer")); // fall through case wxScrollThumb::Shaft_Below: @@ -144,7 +144,7 @@ wxScrollThumb::wxScrollThumb(wxControlWithThumb *control) wxScrollThumb::~wxScrollThumb() { // it should have been destroyed - wxASSERT_MSG( !m_captureData, _T("memory leak in wxScrollThumb") ); + wxASSERT_MSG( !m_captureData, wxT("memory leak in wxScrollThumb") ); } // ---------------------------------------------------------------------------- @@ -284,7 +284,7 @@ wxCoord wxScrollThumb::GetMouseCoord(const wxMouseEvent& event) const int wxScrollThumb::GetThumbPos(const wxMouseEvent& event) const { wxCHECK_MSG( m_captureData && m_captureData->m_shaftPart == Shaft_Thumb, 0, - _T("can't be called when thumb is not dragged") ); + wxT("can't be called when thumb is not dragged") ); int x = GetMouseCoord(event) - m_captureData->m_ofsMouse; return m_control->PixelToThumbPos(x); diff --git a/src/univ/settingsuniv.cpp b/src/univ/settingsuniv.cpp index 24a352a736..ebe9d190d4 100644 --- a/src/univ/settingsuniv.cpp +++ b/src/univ/settingsuniv.cpp @@ -75,7 +75,7 @@ wxColour wxSystemSettings::GetColour(wxSystemColour index) }; wxCHECK_MSG( index < (int)WXSIZEOF(s_mapSysToThemeCol), wxNullColour, - _T("invalid wxSystemColour") ); + wxT("invalid wxSystemColour") ); wxColourScheme::StdColour col = s_mapSysToThemeCol[index]; if ( col == wxColourScheme::MAX ) diff --git a/src/univ/slider.cpp b/src/univ/slider.cpp index 0e29c60806..8dbb9abf00 100644 --- a/src/univ/slider.cpp +++ b/src/univ/slider.cpp @@ -210,7 +210,7 @@ bool wxSlider::ChangeValueTo(int value) // this method is protected and we should only call it with normalized // value! - wxCHECK_MSG( IsInRange(value), false, _T("invalid slider value") ); + wxCHECK_MSG( IsInRange(value), false, wxT("invalid slider value") ); m_value = value; @@ -287,14 +287,14 @@ int wxSlider::GetMax() const void wxSlider::SetLineSize(int lineSize) { - wxCHECK_RET( lineSize >= 0, _T("invalid slider line size") ); + wxCHECK_RET( lineSize >= 0, wxT("invalid slider line size") ); m_lineSize = lineSize; } void wxSlider::SetPageSize(int pageSize) { - wxCHECK_RET( pageSize >= 0, _T("invalid slider page size") ); + wxCHECK_RET( pageSize >= 0, wxT("invalid slider page size") ); m_pageSize = pageSize; } @@ -323,7 +323,7 @@ int wxSlider::GetPageSize() const void wxSlider::SetThumbLength(int lenPixels) { - wxCHECK_RET( lenPixels >= 0, _T("invalid slider thumb size") ); + wxCHECK_RET( lenPixels >= 0, wxT("invalid slider thumb size") ); // use m_thumbSize here directly and not GetThumbLength() to avoid setting // it to the default value as we don't need it @@ -356,7 +356,7 @@ int wxSlider::GetThumbLength() const void wxSlider::SetTickFreq(int n, int WXUNUSED(dummy)) { - wxCHECK_RET (n > 0, _T("invalid slider tick frequency")); + wxCHECK_RET (n > 0, wxT("invalid slider tick frequency")); if ( n != m_tickFreq ) { @@ -376,7 +376,7 @@ wxSize wxSlider::CalcLabelSize() const // there is no sense in trying to calc the labels size if we haven't got // any, the caller must check for it - wxCHECK_MSG( HasLabels(), size, _T("shouldn't be called") ); + wxCHECK_MSG( HasLabels(), size, wxT("shouldn't be called") ); wxCoord w1, h1, w2, h2; GetTextExtent(FormatValue(m_min), &w1, &h1); @@ -690,7 +690,7 @@ void wxSlider::CalcThumbRect(const wxRect *rectShaftIn, wxString wxSlider::FormatValue(int value) const { - return wxString::Format(_T("%d"), value); + return wxString::Format(wxT("%d"), value); } void wxSlider::DoDraw(wxControlRenderer *renderer) diff --git a/src/univ/statusbr.cpp b/src/univ/statusbr.cpp index 0acfa84277..4a1d7203ed 100644 --- a/src/univ/statusbr.cpp +++ b/src/univ/statusbr.cpp @@ -157,7 +157,7 @@ void wxStatusBarUniv::RefreshField(int i) void wxStatusBarUniv::SetStatusText(const wxString& text, int number) { wxCHECK_RET( number >= 0 && (size_t)number < m_panes.GetCount(), - _T("invalid status bar field index in SetStatusText()") ); + wxT("invalid status bar field index in SetStatusText()") ); if ( text == GetStatusText(number) ) { @@ -237,7 +237,7 @@ void wxStatusBarUniv::OnSize(wxSizeEvent& event) bool wxStatusBarUniv::GetFieldRect(int n, wxRect& rect) const { wxCHECK_MSG( n >= 0 && (size_t)n < m_panes.GetCount(), false, - _T("invalid field index in GetFieldRect()") ); + wxT("invalid field index in GetFieldRect()") ); // this is a fix for a bug exhibited by the statbar sample: if // GetFieldRect() is called from the derived class OnSize() handler, then @@ -260,7 +260,7 @@ wxRect wxStatusBarUniv::DoGetFieldRect(int n) const // it's the caller responsability to check this, if unsure - call // GetFieldRect() instead wxCHECK_MSG( !m_widthsAbs.IsEmpty(), rect, - _T("can't be called if we don't have the widths") ); + wxT("can't be called if we don't have the widths") ); for ( int i = 0; i <= n; i++ ) { diff --git a/src/univ/stdrend.cpp b/src/univ/stdrend.cpp index 0159f76d77..ef8af5c391 100644 --- a/src/univ/stdrend.cpp +++ b/src/univ/stdrend.cpp @@ -151,7 +151,7 @@ wxStdRenderer::ArrowDirection wxStdRenderer::GetArrowDirection(wxDirection dir) return Arrow_Down; default: - wxFAIL_MSG(_T("unknown arrow direction")); + wxFAIL_MSG(wxT("unknown arrow direction")); } return Arrow_Max; @@ -438,7 +438,7 @@ void wxStdRenderer::DrawBorder(wxDC& dc, break; default: - wxFAIL_MSG(_T("unknown border type")); + wxFAIL_MSG(wxT("unknown border type")); // fall through case wxBORDER_DEFAULT: @@ -471,7 +471,7 @@ wxRect wxStdRenderer::GetBorderDimensions(wxBorder border) const break; #endif default: - wxFAIL_MSG(_T("unknown border type")); + wxFAIL_MSG(wxT("unknown border type")); // fall through case wxBORDER_DEFAULT: @@ -862,7 +862,7 @@ wxSize wxStdRenderer::GetStatusBarBorders() const wxRect flat = GetBorderDimensions(wxBORDER_STATIC); wxASSERT_MSG( raised.x == raised.width && raised.y == raised.height && flat.x == flat.width && flat.y == flat.height, - _T("this code expects uniform borders, you must override GetStatusBarBorders") ); + wxT("this code expects uniform borders, you must override GetStatusBarBorders") ); // take the larger of flat/raised values: wxSize border(wxMax(raised.x, flat.x), wxMax(raised.y, flat.y)); diff --git a/src/univ/textctrl.cpp b/src/univ/textctrl.cpp index 2edc5b0afe..1c2fa3c814 100644 --- a/src/univ/textctrl.cpp +++ b/src/univ/textctrl.cpp @@ -209,8 +209,8 @@ static inline void OrderPositions(wxTextPos& from, wxTextPos& to) // ---------------------------------------------------------------------------- // names of text ctrl commands -#define wxTEXT_COMMAND_INSERT _T("insert") -#define wxTEXT_COMMAND_REMOVE _T("remove") +#define wxTEXT_COMMAND_INSERT wxT("insert") +#define wxTEXT_COMMAND_REMOVE wxT("remove") // the value which is never used for text position, even not -1 which is // sometimes used for some special meaning @@ -315,7 +315,7 @@ public: // for the first one) wxTextCoord GetRowStart(wxTextCoord row) const { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); + wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") ); return row ? m_rowsStart[row - 1] : 0; } @@ -325,7 +325,7 @@ public: // be given to us) wxTextCoord GetRowLength(wxTextCoord row, wxTextCoord lenLine) const { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); + wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") ); // note that m_rowsStart[row] is the same as GetRowStart(row + 1) (but // slightly more efficient) and lenLine is the same as the start of the @@ -337,7 +337,7 @@ public: // return the width of the row in pixels wxCoord GetRowWidth(wxTextCoord row) const { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); + wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") ); return m_rowsWidth[row]; } @@ -345,7 +345,7 @@ public: // return the number of rows size_t GetRowCount() const { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); + wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") ); return m_rowsStart.GetCount() + 1; } @@ -353,7 +353,7 @@ public: // return the number of additional (i.e. after the first one) rows size_t GetExtraRowCount() const { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); + wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") ); return m_rowsStart.GetCount(); } @@ -361,7 +361,7 @@ public: // return the first row of this line wxTextCoord GetFirstRow() const { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); + wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") ); return m_rowFirst; } @@ -369,7 +369,7 @@ public: // return the first row of the next line wxTextCoord GetNextRow() const { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); + wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") ); return m_rowFirst + m_rowsStart.GetCount() + 1; } @@ -377,7 +377,7 @@ public: // this just provides direct access to m_rowsStart aerray for efficiency wxTextCoord GetExtraRowStart(wxTextCoord row) const { - wxASSERT_MSG( IsValid(), _T("this line hadn't been laid out") ); + wxASSERT_MSG( IsValid(), wxT("this line hadn't been laid out") ); return m_rowsStart[row]; } @@ -408,14 +408,14 @@ public: : GetRowStart(n + 1); wxASSERT_MSG( colRowEnd < colNextRowStart, - _T("this column is not in this row at all!") ); + wxT("this column is not in this row at all!") ); return colRowEnd == colNextRowStart - 1; } } // caller got it wrong - wxFAIL_MSG( _T("this column is not in the start of the row!") ); + wxFAIL_MSG( wxT("this column is not in the start of the row!") ); return false; } @@ -522,8 +522,8 @@ public: // we don't use these methods as they don't make sense for us as we need a // wxTextCtrl to be applied - virtual bool Do() { wxFAIL_MSG(_T("shouldn't be called")); return false; } - virtual bool Undo() { wxFAIL_MSG(_T("shouldn't be called")); return false; } + virtual bool Do() { wxFAIL_MSG(wxT("shouldn't be called")); return false; } + virtual bool Undo() { wxFAIL_MSG(wxT("shouldn't be called")); return false; } // instead, our command processor uses these methods virtual bool Do(wxTextCtrl *text) = 0; @@ -742,7 +742,7 @@ bool wxTextCtrl::Create(wxWindow *parent, // we might support it but it's quite useless and other ports don't // support it anyhow wxASSERT_MSG( !(style & wxTE_PASSWORD), - _T("wxTE_PASSWORD can't be used with multiline ctrls") ); + wxT("wxTE_PASSWORD can't be used with multiline ctrls") ); } RecalcFontMetrics(); @@ -834,7 +834,7 @@ wxString wxTextCtrl::DoGetValue() const size_t count = lines.GetCount(); for ( size_t n = 1; n < count; n++ ) { - self->m_value << _T('\n') << lines[n]; + self->m_value << wxT('\n') << lines[n]; } } @@ -949,7 +949,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) !PositionToXY(from, &colStart, &lineStart) || !PositionToXY(to, &colEnd, &lineEnd) ) { - wxFAIL_MSG(_T("invalid range in wxTextCtrl::Replace")); + wxFAIL_MSG(wxT("invalid range in wxTextCtrl::Replace")); return; } @@ -1036,7 +1036,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) if ( line > lineStart ) { // from the previous line - textOrig += _T('\n'); + textOrig += wxT('\n'); } textOrig += linesOld[line]; @@ -1057,7 +1057,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) if ( (size_t)colStart == linesOld[lineStart].length() ) { // text appended, refresh just enough to show the new text - widthNewText = GetTextWidth(text.BeforeFirst(_T('\n'))); + widthNewText = GetTextWidth(text.BeforeFirst(wxT('\n'))); } else // text inserted, refresh till the end of line { @@ -1083,7 +1083,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) for ( const wxChar *p = textNew.c_str(); ; p++ ) { // end of line/text? - if ( !*p || *p == _T('\n') ) + if ( !*p || *p == wxT('\n') ) { lines.Add(wxString(curLineStart, p)); if ( !*p ) @@ -1096,7 +1096,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) #ifdef WXDEBUG_TEXT_REPLACE // (3a) all empty tokens should be counted as replacing with "foo" and // with "foo\n" should have different effects - wxArrayString lines2 = wxStringTokenize(textNew, _T("\n"), + wxArrayString lines2 = wxStringTokenize(textNew, wxT("\n"), wxTOKEN_RET_EMPTY_ALL); if ( lines2.IsEmpty() ) @@ -1105,10 +1105,10 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) } wxASSERT_MSG( lines.GetCount() == lines2.GetCount(), - _T("Replace() broken") ); + wxT("Replace() broken") ); for ( size_t n = 0; n < lines.GetCount(); n++ ) { - wxASSERT_MSG( lines[n] == lines2[n], _T("Replace() broken") ); + wxASSERT_MSG( lines[n] == lines2[n], wxT("Replace() broken") ); } #endif // WXDEBUG_TEXT_REPLACE @@ -1239,7 +1239,7 @@ void wxTextCtrl::Replace(wxTextPos from, wxTextPos to, const wxString& text) #ifdef WXDEBUG_TEXT_REPLACE // optimized code above should give the same result as straightforward // computation in the beginning - wxASSERT_MSG( GetValue() == textTotalNew, _T("error in Replace()") ); + wxASSERT_MSG( GetValue() == textTotalNew, wxT("error in Replace()") ); #endif // WXDEBUG_TEXT_REPLACE // update the current position: note that we always put the cursor at the @@ -1298,7 +1298,7 @@ void wxTextCtrl::AppendText(const wxString& text) void wxTextCtrl::SetInsertionPoint(wxTextPos pos) { wxCHECK_RET( pos >= 0 && pos <= GetLastPosition(), - _T("insertion point position out of range") ); + wxT("insertion point position out of range") ); // don't do anything if it didn't change if ( pos != m_curPos ) @@ -1328,7 +1328,7 @@ void wxTextCtrl::InitInsertionPoint() void wxTextCtrl::MoveInsertionPoint(wxTextPos pos) { wxASSERT_MSG( pos >= 0 && pos <= GetLastPosition(), - _T("DoSetInsertionPoint() can only be called with valid pos") ); + wxT("DoSetInsertionPoint() can only be called with valid pos") ); m_curPos = pos; PositionToXY(m_curPos, &m_curCol, &m_curRow); @@ -1378,7 +1378,7 @@ wxTextPos wxTextCtrl::GetLastPosition() const } // more probable reason of this would be to forget to update m_posLast - wxASSERT_MSG( pos == m_posLast, _T("bug in GetLastPosition()") ); + wxASSERT_MSG( pos == m_posLast, wxT("bug in GetLastPosition()") ); #endif // WXDEBUG_TEXT pos = m_posLast; @@ -1426,12 +1426,12 @@ wxString wxTextCtrl::GetSelectionText() const { // take the end of the first line sel = GetLines()[lineStart].c_str() + colStart; - sel += _T('\n'); + sel += wxT('\n'); // all intermediate ones for ( wxTextCoord line = lineStart + 1; line < lineEnd; line++ ) { - sel << GetLines()[line] << _T('\n'); + sel << GetLines()[line] << wxT('\n'); } // and the start of the last one @@ -1468,7 +1468,7 @@ void wxTextCtrl::SetSelection(wxTextPos from, wxTextPos to) OrderPositions(from, to); wxCHECK_RET( to <= GetLastPosition(), - _T("invalid range in wxTextCtrl::SetSelection") ); + wxT("invalid range in wxTextCtrl::SetSelection") ); if ( from != m_selStart || to != m_selEnd ) { @@ -1480,7 +1480,7 @@ void wxTextCtrl::SetSelection(wxTextPos from, wxTextPos to) m_selStart = from; m_selEnd = to; - wxLogTrace(_T("text"), _T("Selection range is %ld-%ld"), + wxLogTrace(wxT("text"), wxT("Selection range is %ld-%ld"), m_selStart, m_selEnd); // refresh only the part of text which became (un)selected if @@ -1654,14 +1654,14 @@ int wxTextCtrl::GetLineLength(wxTextCoord line) const { if ( IsSingleLine() ) { - wxASSERT_MSG( line == 0, _T("invalid GetLineLength() parameter") ); + wxASSERT_MSG( line == 0, wxT("invalid GetLineLength() parameter") ); return m_value.length(); } else // multiline { wxCHECK_MSG( (size_t)line < GetLineCount(), -1, - _T("line index out of range") ); + wxT("line index out of range") ); return GetLines()[line].length(); } @@ -1671,7 +1671,7 @@ wxString wxTextCtrl::GetLineText(wxTextCoord line) const { if ( IsSingleLine() ) { - wxASSERT_MSG( line == 0, _T("invalid GetLineLength() parameter") ); + wxASSERT_MSG( line == 0, wxT("invalid GetLineLength() parameter") ); return m_value; } @@ -1681,7 +1681,7 @@ wxString wxTextCtrl::GetLineText(wxTextCoord line) const if (line == 0 && GetLineCount() == 0) return wxEmptyString ; wxCHECK_MSG( (size_t)line < GetLineCount(), wxEmptyString, - _T("line index out of range") ); + wxT("line index out of range") ); return GetLines()[line]; } @@ -1763,7 +1763,7 @@ bool wxTextCtrl::PositionToXY(wxTextPos pos, #ifdef WXDEBUG_TEXT wxASSERT_MSG( XYToPosition(pos - posCur, nLine) == pos, - _T("XYToPosition() or PositionToXY() broken") ); + wxT("XYToPosition() or PositionToXY() broken") ); #endif // WXDEBUG_TEXT return true; @@ -1901,7 +1901,7 @@ wxPoint wxTextCtrl::GetCaretPosition() const wxCoord xCaret, yCaret; if ( !PositionToDeviceXY(m_curPos, &xCaret, &yCaret) ) { - wxFAIL_MSG( _T("Caret can't be beyond the text!") ); + wxFAIL_MSG( wxT("Caret can't be beyond the text!") ); } return wxPoint(xCaret, yCaret); @@ -2282,7 +2282,7 @@ bool wxTextCtrlInsertCommand::Do(wxTextCtrl *text) bool wxTextCtrlInsertCommand::Undo(wxTextCtrl *text) { - wxCHECK_MSG( CanUndo(), false, _T("impossible to undo insert cmd") ); + wxCHECK_MSG( CanUndo(), false, wxT("impossible to undo insert cmd") ); // remove the text from where we inserted it text->Remove(m_from, m_from + m_text.length()); @@ -2319,7 +2319,7 @@ bool wxTextCtrlRemoveCommand::Undo(wxTextCtrl *text) void wxTextCtrl::Undo() { // the caller must check it - wxASSERT_MSG( CanUndo(), _T("can't call Undo() if !CanUndo()") ); + wxASSERT_MSG( CanUndo(), wxT("can't call Undo() if !CanUndo()") ); m_cmdProcessor->Undo(); } @@ -2327,7 +2327,7 @@ void wxTextCtrl::Undo() void wxTextCtrl::Redo() { // the caller must check it - wxASSERT_MSG( CanRedo(), _T("can't call Undo() if !CanUndo()") ); + wxASSERT_MSG( CanRedo(), wxT("can't call Undo() if !CanUndo()") ); m_cmdProcessor->Redo(); } @@ -2458,7 +2458,7 @@ void wxTextCtrl::UpdateLastVisible() case wxTE_HT_BELOW: */ default: - wxFAIL_MSG(_T("unexpected HitTestLine() return value")); + wxFAIL_MSG(wxT("unexpected HitTestLine() return value")); // fall through case wxTE_HT_ON_TEXT: @@ -2494,7 +2494,7 @@ void wxTextCtrl::UpdateLastVisible() // SData().m_colStart, we need an absolute offset into string SData().m_colLastVisible += SData().m_colStart; - wxLogTrace(_T("text"), _T("Last visible column/position is %d/%ld"), + wxLogTrace(wxT("text"), wxT("Last visible column/position is %d/%ld"), (int) SData().m_colLastVisible, (long) SData().m_posLastVisible); } @@ -2566,7 +2566,7 @@ wxTextCoord wxTextCtrl::GetRowInLine(wxTextCoord line, wxTextCoord col, wxTextCoord *colRowStart) const { - wxASSERT_MSG( WrapLines(), _T("shouldn't be called") ); + wxASSERT_MSG( WrapLines(), wxT("shouldn't be called") ); const wxWrappedLineData& lineData = WData().m_linesData[line]; @@ -2594,7 +2594,7 @@ wxTextCoord wxTextCtrl::GetRowInLine(wxTextCoord line, *colRowStart = lineData.GetRowStart(row); // this can't happen, of course - wxASSERT_MSG( *colRowStart <= col, _T("GetRowInLine() is broken") ); + wxASSERT_MSG( *colRowStart <= col, wxT("GetRowInLine() is broken") ); } return row; @@ -2635,12 +2635,12 @@ void wxTextCtrl::LayoutLine(wxTextCoord line, wxWrappedLineData& lineData) const void wxTextCtrl::LayoutLines(wxTextCoord lineLast) const { - wxASSERT_MSG( WrapLines(), _T("should only be used for line wrapping") ); + wxASSERT_MSG( WrapLines(), wxT("should only be used for line wrapping") ); // if we were called, some line was dirty and if it was dirty we must have // had m_rowFirstInvalid set to something too wxTextCoord lineFirst = WData().m_rowFirstInvalid; - wxASSERT_MSG( lineFirst != -1, _T("nothing to layout?") ); + wxASSERT_MSG( lineFirst != -1, wxT("nothing to layout?") ); wxTextCoord rowFirst, rowCur; if ( lineFirst ) @@ -2693,7 +2693,7 @@ size_t wxTextCtrl::GetPartOfWrappedLine(const wxChar* text, wxCoord *widthReal) const { // this function is slow, it shouldn't be called unless really needed - wxASSERT_MSG( WrapLines(), _T("shouldn't be called") ); + wxASSERT_MSG( WrapLines(), wxT("shouldn't be called") ); wxString s(text); wxTextCoord col; @@ -2705,7 +2705,7 @@ size_t wxTextCtrl::GetPartOfWrappedLine(const wxChar* text, case wxTE_HT_BELOW: */ default: - wxFAIL_MSG(_T("unexpected HitTestLine() return value")); + wxFAIL_MSG(wxT("unexpected HitTestLine() return value")); // fall through case wxTE_HT_ON_TEXT: @@ -2945,7 +2945,7 @@ wxTextCtrlHitTestResult wxTextCtrl::HitTestLine(const wxString& line, } // this is not supposed to happen - wxASSERT_MSG( matchDir, _T("logic error in wxTextCtrl::HitTest") ); + wxASSERT_MSG( matchDir, wxT("logic error in wxTextCtrl::HitTest") ); if ( matchDir == Match_Right ) col++; @@ -2969,11 +2969,11 @@ wxTextCtrlHitTestResult wxTextCtrl::HitTestLine(const wxString& line, dc.GetTextExtent(text, &width2, NULL); wxASSERT_MSG( (width1 <= x) && (x < width2), - _T("incorrect HitTestLine() result") ); + wxT("incorrect HitTestLine() result") ); } else // we return last char { - wxASSERT_MSG( x >= width1, _T("incorrect HitTestLine() result") ); + wxASSERT_MSG( x >= width1, wxT("incorrect HitTestLine() result") ); } } #endif // WXDEBUG_TEXT @@ -3278,7 +3278,7 @@ bool wxTextCtrl::GetLineAndRow(wxTextCoord row, void wxTextCtrl::ShowHorzPosition(wxCoord pos) { - wxASSERT_MSG( IsSingleLine(), _T("doesn't work for multiline") ); + wxASSERT_MSG( IsSingleLine(), wxT("doesn't work for multiline") ); // pos is the logical position to show @@ -3317,7 +3317,7 @@ void wxTextCtrl::ShowHorzPosition(wxCoord pos) void wxTextCtrl::ScrollText(wxTextCoord col) { wxASSERT_MSG( IsSingleLine(), - _T("ScrollText() is for single line controls only") ); + wxT("ScrollText() is for single line controls only") ); // never scroll beyond the left border if ( col < 0 ) @@ -3512,7 +3512,7 @@ void wxTextCtrl::RecalcFontMetrics() void wxTextCtrl::RecalcMaxWidth() { - wxASSERT_MSG( !IsSingleLine(), _T("only used for multiline") ); + wxASSERT_MSG( !IsSingleLine(), wxT("only used for multiline") ); MData().m_widthMax = -1; (void)GetMaxWidth(); @@ -3546,14 +3546,14 @@ wxCoord wxTextCtrl::GetMaxWidth() const } } - wxASSERT_MSG( MData().m_widthMax != -1, _T("should have at least 1 line") ); + wxASSERT_MSG( MData().m_widthMax != -1, wxT("should have at least 1 line") ); return MData().m_widthMax; } void wxTextCtrl::UpdateScrollbars() { - wxASSERT_MSG( !IsSingleLine(), _T("only used for multiline") ); + wxASSERT_MSG( !IsSingleLine(), wxT("only used for multiline") ); wxSize size = GetRealTextArea().GetSize(); @@ -3676,7 +3676,7 @@ void wxTextCtrl::RefreshSelection() void wxTextCtrl::RefreshLineRange(wxTextCoord lineFirst, wxTextCoord lineLast) { wxASSERT_MSG( lineFirst <= lineLast || !lineLast, - _T("no lines to refresh") ); + wxT("no lines to refresh") ); wxRect rect; // rect.x is already 0 @@ -3693,7 +3693,7 @@ void wxTextCtrl::RefreshLineRange(wxTextCoord lineFirst, wxTextCoord lineLast) // lineFirst may be beyond the last line only if we refresh till // the end, otherwise it's illegal wxASSERT_MSG( lineFirst == GetNumberOfLines() && !lineLast, - _T("invalid line range") ); + wxT("invalid line range") ); rowFirst = GetRowAfterLine(lineFirst - 1); } @@ -3719,7 +3719,7 @@ void wxTextCtrl::RefreshLineRange(wxTextCoord lineFirst, wxTextCoord lineLast) void wxTextCtrl::RefreshTextRange(wxTextPos start, wxTextPos end) { wxCHECK_RET( start != -1 && end != -1, - _T("invalid RefreshTextRange() arguments") ); + wxT("invalid RefreshTextRange() arguments") ); // accept arguments in any order as it is more conenient for the caller OrderPositions(start, end); @@ -3775,7 +3775,7 @@ void wxTextCtrl::RefreshColRange(wxTextCoord line, wxString text = GetLineText(line); wxASSERT_MSG( (size_t)start <= text.length() && count, - _T("invalid RefreshColRange() parameter") ); + wxT("invalid RefreshColRange() parameter") ); RefreshPixelRange(line, GetTextWidth(text.Left((size_t)start)), @@ -3907,7 +3907,7 @@ void wxTextCtrl::RefreshTextRect(const wxRect& rectClient, bool textOnly) if ( rect.y < m_rectText.y ) rect.y = m_rectText.y; - wxLogTrace(_T("text"), _T("Refreshing (%d, %d)-(%d, %d)"), + wxLogTrace(wxT("text"), wxT("Refreshing (%d, %d)-(%d, %d)"), rect.x, rect.y, rect.x + rect.width, rect.y + rect.height); Refresh(true, &rect); @@ -3957,7 +3957,7 @@ wxString wxTextCtrl::GetTextToShow(const wxString& text) const { wxString textShown; if ( IsPassword() ) - textShown = wxString(_T('*'), text.length()); + textShown = wxString(wxT('*'), text.length()); else textShown = text; @@ -4036,7 +4036,7 @@ void wxTextCtrl::DoDrawTextInRect(wxDC& dc, const wxRect& rectUpdate) if ( (ht == wxTE_HT_BEYOND) || (ht == wxTE_HT_BELOW) ) { - wxASSERT_MSG( line <= lineEnd, _T("how did we get that far?") ); + wxASSERT_MSG( line <= lineEnd, wxT("how did we get that far?") ); if ( line == lineEnd ) { @@ -4117,7 +4117,7 @@ void wxTextCtrl::DoDrawTextInRect(wxDC& dc, const wxRect& rectUpdate) } // calculate the text coords on screen - wxASSERT_MSG( colStart >= colRowStart, _T("invalid string part") ); + wxASSERT_MSG( colStart >= colRowStart, wxT("invalid string part") ); wxCoord ofsStart = GetTextWidth( textLine.Mid(colRowStart, colStart - colRowStart)); @@ -4127,7 +4127,7 @@ void wxTextCtrl::DoDrawTextInRect(wxDC& dc, const wxRect& rectUpdate) // do draw the text renderer->DrawTextLine(dc, text, rectText, selStart, selEnd, GetStateFlags()); - wxLogTrace(_T("text"), _T("Line %ld: positions %ld-%ld redrawn."), + wxLogTrace(wxT("text"), wxT("Line %ld: positions %ld-%ld redrawn."), line, colStart, colEnd); } } @@ -4135,7 +4135,7 @@ void wxTextCtrl::DoDrawTextInRect(wxDC& dc, const wxRect& rectUpdate) void wxTextCtrl::DoDrawLineWrapMarks(wxDC& dc, const wxRect& rectUpdate) { wxASSERT_MSG( WrapLines() && WData().m_widthMark, - _T("shouldn't be called at all") ); + wxT("shouldn't be called at all") ); wxRenderer *renderer = GetRenderer(); @@ -4348,7 +4348,7 @@ size_t wxTextCtrl::GetLinesPerPage() const wxTextPos wxTextCtrl::GetPositionAbove() { wxCHECK_MSG( !IsSingleLine(), INVALID_POS_VALUE, - _T("can't move cursor vertically in a single line control") ); + wxT("can't move cursor vertically in a single line control") ); // move the cursor up by one ROW not by one LINE: this means that // we should really use HitTest() and not just go to the same @@ -4381,7 +4381,7 @@ wxTextPos wxTextCtrl::GetPositionAbove() wxTextPos wxTextCtrl::GetPositionBelow() { wxCHECK_MSG( !IsSingleLine(), INVALID_POS_VALUE, - _T("can't move cursor vertically in a single line control") ); + wxT("can't move cursor vertically in a single line control") ); // see comments for wxACTION_TEXT_UP wxPoint pt = GetCaretPosition() - m_rectText.GetPosition(); @@ -4710,7 +4710,7 @@ bool wxTextCtrl::PerformAction(const wxControlAction& actionOrig, if ( textChanged ) { - wxASSERT_MSG( IsEditable(), _T("non editable control changed?") ); + wxASSERT_MSG( IsEditable(), wxT("non editable control changed?") ); wxCommandEvent event(wxEVT_COMMAND_TEXT_UPDATED, GetId()); InitCommandEvent(event); @@ -4743,7 +4743,7 @@ void wxTextCtrl::OnChar(wxKeyEvent& event) } else // interpret normally: insert new line { - PerformAction(wxACTION_TEXT_INSERT, -1, _T('\n')); + PerformAction(wxACTION_TEXT_INSERT, -1, wxT('\n')); } } else if ( keycode < 255 && isprint(keycode) ) @@ -4936,7 +4936,7 @@ bool wxStdTextCtrlInputHandler::HandleMouse(wxInputConsumer *consumer, { if ( event.LeftDown() ) { - wxASSERT_MSG( !m_winCapture, _T("left button going down twice?") ); + wxASSERT_MSG( !m_winCapture, wxT("left button going down twice?") ); wxTextCtrl *text = wxStaticCast(consumer->GetInputWindow(), wxTextCtrl); diff --git a/src/univ/theme.cpp b/src/univ/theme.cpp index 47fae5820b..28119dd6a9 100644 --- a/src/univ/theme.cpp +++ b/src/univ/theme.cpp @@ -88,7 +88,7 @@ wxThemeInfo::wxThemeInfo(Constructor c, wxString nameDefTheme; // use the environment variable first - const wxChar *p = wxGetenv(_T("WXTHEME")); + const wxChar *p = wxGetenv(wxT("WXTHEME")); if ( p ) { nameDefTheme = p; diff --git a/src/univ/themes/gtk.cpp b/src/univ/themes/gtk.cpp index 1ccb81c552..89d9fd33f1 100644 --- a/src/univ/themes/gtk.cpp +++ b/src/univ/themes/gtk.cpp @@ -716,7 +716,7 @@ wxColour wxGTKColourScheme::Get(wxGTKColourScheme::StdColour col) const case MAX: default: - wxFAIL_MSG(_T("invalid standard colour")); + wxFAIL_MSG(wxT("invalid standard colour")); return *wxBLACK; } } @@ -772,7 +772,7 @@ void wxGTKRenderer::DrawAntiShadedRectSide(wxDC& dc, break; default: - wxFAIL_MSG(_T("unknown rectangle side")); + wxFAIL_MSG(wxT("unknown rectangle side")); } } @@ -1155,7 +1155,7 @@ wxBitmap wxGTKRenderer::GetLineWrapBitmap() const wxBitmap bmpLineWrap(line_wrap_bits, line_wrap_width, line_wrap_height); if ( !bmpLineWrap.Ok() ) { - wxFAIL_MSG( _T("Failed to create line wrap XBM") ); + wxFAIL_MSG( wxT("Failed to create line wrap XBM") ); } else { @@ -1303,7 +1303,7 @@ void wxGTKRenderer::DrawTab(wxDC& dc, switch ( dir ) { default: - wxFAIL_MSG(_T("invaild notebook tab orientation")); + wxFAIL_MSG(wxT("invaild notebook tab orientation")); // fall through case wxTOP: @@ -1703,7 +1703,7 @@ void wxGTKRenderer::DoDrawMenuItem(wxDC& dc, if ( !accel.empty() ) { // menubar items shouldn't have them - wxCHECK_RET( geometryInfo, _T("accel strings only valid for menus") ); + wxCHECK_RET( geometryInfo, wxT("accel strings only valid for menus") ); rect.x = geometryInfo->GetAccelOffset(); rect.SetRight(geometryInfo->GetSize().x); @@ -1715,7 +1715,7 @@ void wxGTKRenderer::DoDrawMenuItem(wxDC& dc, // draw the submenu indicator if ( flags & wxCONTROL_ISSUBMENU ) { - wxCHECK_RET( geometryInfo, _T("wxCONTROL_ISSUBMENU only valid for menus") ); + wxCHECK_RET( geometryInfo, wxT("wxCONTROL_ISSUBMENU only valid for menus") ); rect.x = geometryInfo->GetSize().x - MENU_RIGHT_MARGIN; rect.width = MENU_RIGHT_MARGIN; @@ -1950,7 +1950,7 @@ void wxGTKRenderer::DrawArrowBorder(wxDC& dc, break; default: - wxFAIL_MSG(_T("unknown arrow direction")); + wxFAIL_MSG(wxT("unknown arrow direction")); return; } @@ -2085,7 +2085,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc, break; default: - wxFAIL_MSG(_T("unknown arrow direction")); + wxFAIL_MSG(wxT("unknown arrow direction")); } dc.DrawPolygon(WXSIZEOF(ptArrow), ptArrow); @@ -2162,7 +2162,7 @@ void wxGTKRenderer::DrawArrow(wxDC& dc, break; default: - wxFAIL_MSG(_T("unknown arrow direction")); + wxFAIL_MSG(wxT("unknown arrow direction")); return; } } diff --git a/src/univ/themes/metal.cpp b/src/univ/themes/metal.cpp index a0849274c4..1273d59cd6 100644 --- a/src/univ/themes/metal.cpp +++ b/src/univ/themes/metal.cpp @@ -146,7 +146,7 @@ private: class wxMetalTheme : public wxDelegateTheme { public: - wxMetalTheme() : wxDelegateTheme(_T("win32")), m_renderer(NULL) {} + wxMetalTheme() : wxDelegateTheme(wxT("win32")), m_renderer(NULL) {} ~wxMetalTheme() { delete m_renderer; } protected: @@ -426,7 +426,7 @@ void wxMetalRenderer::DrawArrow(wxDC& dc, case wxDOWN: arrowDir = Arrow_Down; break; default: - wxFAIL_MSG(_T("unknown arrow direction")); + wxFAIL_MSG(wxT("unknown arrow direction")); return; } diff --git a/src/univ/themes/mono.cpp b/src/univ/themes/mono.cpp index 93cf4b94f8..a534269f86 100644 --- a/src/univ/themes/mono.cpp +++ b/src/univ/themes/mono.cpp @@ -606,7 +606,7 @@ wxColour wxMonoColourScheme::Get(wxMonoColourScheme::StdColour col) const case MAX: default: - wxFAIL_MSG(_T("invalid standard colour")); + wxFAIL_MSG(wxT("invalid standard colour")); // fall through case SHADOW_DARK: @@ -660,7 +660,7 @@ wxRect wxMonoRenderer::GetBorderDimensions(wxBorder border) const break; */ default: - wxFAIL_MSG(_T("unknown border type")); + wxFAIL_MSG(wxT("unknown border type")); // fall through case wxBORDER_DEFAULT: @@ -811,19 +811,19 @@ void wxMonoRenderer::DrawToolBarButton(wxDC& WXUNUSED(dc), long WXUNUSED(style), int WXUNUSED(tbarStyle)) { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); } wxSize wxMonoRenderer::GetToolBarButtonSize(wxCoord *WXUNUSED(separator)) const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return wxSize(); } wxSize wxMonoRenderer::GetToolBarMargin() const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return wxSize(); } @@ -844,19 +844,19 @@ void wxMonoRenderer::DrawTab(wxDC& WXUNUSED(dc), int WXUNUSED(flags), int WXUNUSED(indexAccel)) { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); } wxSize wxMonoRenderer::GetTabIndent() const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return wxSize(); } wxSize wxMonoRenderer::GetTabPadding() const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return wxSize(); } @@ -874,7 +874,7 @@ void wxMonoRenderer::GetComboBitmaps(wxBitmap *WXUNUSED(bmpNormal), wxBitmap *WXUNUSED(bmpPressed), wxBitmap *WXUNUSED(bmpDisabled)) { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); } #endif // wxUSE_COMBOBOX @@ -891,7 +891,7 @@ void wxMonoRenderer::DrawMenuBarItem(wxDC& WXUNUSED(dc), int WXUNUSED(flags), int WXUNUSED(indexAccel)) { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); } void wxMonoRenderer::DrawMenuItem(wxDC& WXUNUSED(dc), @@ -903,19 +903,19 @@ void wxMonoRenderer::DrawMenuItem(wxDC& WXUNUSED(dc), int WXUNUSED(flags), int WXUNUSED(indexAccel)) { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); } void wxMonoRenderer::DrawMenuSeparator(wxDC& WXUNUSED(dc), wxCoord WXUNUSED(y), const wxMenuGeometryInfo& WXUNUSED(geomInfo)) { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); } wxSize wxMonoRenderer::GetMenuBarItemSize(const wxSize& WXUNUSED(sizeText)) const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return wxSize(); } @@ -923,7 +923,7 @@ wxSize wxMonoRenderer::GetMenuBarItemSize(const wxSize& WXUNUSED(sizeText)) cons wxMenuGeometryInfo *wxMonoRenderer::GetMenuGeometry(wxWindow *WXUNUSED(win), const wxMenu& WXUNUSED(menu)) const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return NULL; } @@ -944,7 +944,7 @@ void wxMonoRenderer::DrawSliderShaft(wxDC& WXUNUSED(dc), long WXUNUSED(style), wxRect *WXUNUSED(rectShaft)) { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); } @@ -954,7 +954,7 @@ void wxMonoRenderer::DrawSliderThumb(wxDC& WXUNUSED(dc), int WXUNUSED(flags), long WXUNUSED(style)) { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); } void wxMonoRenderer::DrawSliderTicks(wxDC& WXUNUSED(dc), @@ -967,19 +967,19 @@ void wxMonoRenderer::DrawSliderTicks(wxDC& WXUNUSED(dc), int WXUNUSED(flags), long WXUNUSED(style)) { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); } wxCoord wxMonoRenderer::GetSliderDim() const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return 0; } wxCoord wxMonoRenderer::GetSliderTickLen() const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return 0; } @@ -990,7 +990,7 @@ wxRect wxMonoRenderer::GetSliderShaftRect(const wxRect& WXUNUSED(rect), wxOrientation WXUNUSED(orient), long WXUNUSED(style)) const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return wxRect(); } @@ -999,7 +999,7 @@ wxSize wxMonoRenderer::GetSliderThumbSize(const wxRect& WXUNUSED(rect), int WXUNUSED(lenThumb), wxOrientation WXUNUSED(orient)) const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return wxSize(); } @@ -1008,7 +1008,7 @@ wxSize wxMonoRenderer::GetSliderThumbSize(const wxRect& WXUNUSED(rect), wxSize wxMonoRenderer::GetProgressBarStep() const { - wxFAIL_MSG(_T("TODO")); + wxFAIL_MSG(wxT("TODO")); return wxSize(); } @@ -1024,7 +1024,7 @@ void wxMonoRenderer::DrawArrow(wxDC& dc, int WXUNUSED(flags)) { ArrowDirection arrowDir = GetArrowDirection(dir); - wxCHECK_RET( arrowDir != Arrow_Max, _T("invalid arrow direction") ); + wxCHECK_RET( arrowDir != Arrow_Max, wxT("invalid arrow direction") ); wxBitmap& bmp = m_bmpArrows[arrowDir]; if ( !bmp.Ok() ) diff --git a/src/univ/themes/win32.cpp b/src/univ/themes/win32.cpp index 0c22469e90..8e0a742da8 100644 --- a/src/univ/themes/win32.cpp +++ b/src/univ/themes/win32.cpp @@ -1324,7 +1324,7 @@ wxColour wxWin32ColourScheme::Get(wxWin32ColourScheme::StdColour col) const case MAX: default: - wxFAIL_MSG(_T("invalid standard colour")); + wxFAIL_MSG(wxT("invalid standard colour")); return *wxBLACK; } } @@ -1564,7 +1564,7 @@ void wxWin32Renderer::DrawFrameWithLabel(wxDC& dc, int indexAccel) { wxString label2; - label2 << _T(' ') << label << _T(' '); + label2 << wxT(' ') << label << wxT(' '); if ( indexAccel != -1 ) { // adjust it as we prepended a space @@ -1783,7 +1783,7 @@ void wxWin32Renderer::DrawTab(wxDC& dc, switch ( dir ) { default: - wxFAIL_MSG(_T("invaild notebook tab orientation")); + wxFAIL_MSG(wxT("invaild notebook tab orientation")); // fall through case wxTOP: @@ -3502,7 +3502,7 @@ bool wxWin32StatusBarInputHandler::IsOnGrip(wxWindow *statbar, parentTLW = wxDynamicCast(statbar->GetParent(), wxTopLevelWindow); wxCHECK_MSG( parentTLW, false, - _T("the status bar should be a child of a TLW") ); + wxT("the status bar should be a child of a TLW") ); // a maximized window can't be resized anyhow if ( !parentTLW->IsMaximized() ) @@ -3610,7 +3610,7 @@ wxWin32SystemMenuEvtHandler(wxWin32FrameInputHandler *handler) void wxWin32SystemMenuEvtHandler::Attach(wxInputConsumer *consumer) { - wxASSERT_MSG( m_wnd == NULL, _T("can't attach the handler twice!") ); + wxASSERT_MSG( m_wnd == NULL, wxT("can't attach the handler twice!") ); m_wnd = wxStaticCast(consumer->GetInputWindow(), wxTopLevelWindow); m_wnd->PushEventHandler(this); diff --git a/src/univ/toolbar.cpp b/src/univ/toolbar.cpp index 7f81f0daa8..44c188fba3 100644 --- a/src/univ/toolbar.cpp +++ b/src/univ/toolbar.cpp @@ -260,7 +260,7 @@ void wxToolBar::SetToolShortHelp(int id, const wxString& help) { wxToolBarToolBase *tool = FindById(id); - wxCHECK_RET( tool, _T("SetToolShortHelp: no such tool") ); + wxCHECK_RET( tool, wxT("SetToolShortHelp: no such tool") ); tool->SetShortHelp(help); } @@ -344,7 +344,7 @@ wxRect wxToolBar::GetToolRect(wxToolBarToolBase *toolBase) const wxRect rect; - wxCHECK_MSG( tool, rect, _T("GetToolRect: NULL tool") ); + wxCHECK_MSG( tool, rect, wxT("GetToolRect: NULL tool") ); // ensure that we always have the valid tool position if ( m_needsLayout ) @@ -463,7 +463,7 @@ void wxToolBar::SetWindowStyleFlag( long style ) void wxToolBar::DoLayout() { - wxASSERT_MSG( m_needsLayout, _T("why are we called?") ); + wxASSERT_MSG( m_needsLayout, wxT("why are we called?") ); m_needsLayout = false; @@ -604,7 +604,7 @@ void wxToolBar::GetRectLimits(const wxRect& rect, wxCoord *start, wxCoord *end) const { - wxCHECK_RET( start && end, _T("NULL pointer in GetRectLimits") ); + wxCHECK_RET( start && end, wxT("NULL pointer in GetRectLimits") ); if ( IsVertical() ) { @@ -744,7 +744,7 @@ bool wxToolBar::PerformAction(const wxControlAction& action, } else if ( action == wxACTION_TOOLBAR_PRESS ) { - wxLogTrace(_T("toolbar"), _T("Button '%s' pressed."), tool->GetShortHelp().c_str()); + wxLogTrace(wxT("toolbar"), wxT("Button '%s' pressed."), tool->GetShortHelp().c_str()); tool->Invert(); @@ -752,9 +752,9 @@ bool wxToolBar::PerformAction(const wxControlAction& action, } else if ( action == wxACTION_TOOLBAR_RELEASE ) { - wxLogTrace(_T("toolbar"), _T("Button '%s' released."), tool->GetShortHelp().c_str()); + wxLogTrace(wxT("toolbar"), wxT("Button '%s' released."), tool->GetShortHelp().c_str()); - wxASSERT_MSG( tool->IsInverted(), _T("release unpressed button?") ); + wxASSERT_MSG( tool->IsInverted(), wxT("release unpressed button?") ); if(tool->IsInverted()) { @@ -790,7 +790,7 @@ bool wxToolBar::PerformAction(const wxControlAction& action, } else if ( action == wxACTION_TOOLBAR_ENTER ) { - wxCHECK_MSG( tool, false, _T("no tool to enter?") ); + wxCHECK_MSG( tool, false, wxT("no tool to enter?") ); if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() ) { @@ -802,7 +802,7 @@ bool wxToolBar::PerformAction(const wxControlAction& action, } else if ( action == wxACTION_TOOLBAR_LEAVE ) { - wxCHECK_MSG( tool, false, _T("no tool to leave?") ); + wxCHECK_MSG( tool, false, wxT("no tool to leave?") ); if ( HasFlag(wxTB_FLAT) && tool->IsEnabled() ) { diff --git a/src/univ/topluniv.cpp b/src/univ/topluniv.cpp index a93554e73d..cc90efba41 100644 --- a/src/univ/topluniv.cpp +++ b/src/univ/topluniv.cpp @@ -163,7 +163,7 @@ void wxTopLevelWindow::UseNativeDecorationsByDefault(bool native) void wxTopLevelWindow::UseNativeDecorations(bool native) { - wxASSERT_MSG( !m_windowStyle, _T("must be called before Create()") ); + wxASSERT_MSG( !m_windowStyle, wxT("must be called before Create()") ); m_usingNativeDecorations = native; } diff --git a/src/univ/winuniv.cpp b/src/univ/winuniv.cpp index fdcd178c50..ce34052eb8 100644 --- a/src/univ/winuniv.cpp +++ b/src/univ/winuniv.cpp @@ -927,7 +927,7 @@ void wxWindow::SetScrollbar(int orient, { #if wxUSE_SCROLLBAR wxASSERT_MSG( pageSize <= range, - _T("page size can't be greater than range") ); + wxT("page size can't be greater than range") ); bool hasClientSizeChanged = false; wxScrollBar *scrollbar = GetScrollbar(orient); @@ -1145,7 +1145,7 @@ void wxWindow::ScrollWindow(int dx, int dy, const wxRect *rect) wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) { - wxASSERT_MSG( !dx || !dy, _T("can't be used for diag scrolling") ); + wxASSERT_MSG( !dx || !dy, wxT("can't be used for diag scrolling") ); // the rect to refresh (which we will calculate) wxRect rect; @@ -1160,7 +1160,7 @@ wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) // location wxSize sizeTotal = rectTotal ? rectTotal->GetSize() : GetClientSize(); - wxLogTrace(_T("scroll"), _T("rect is %dx%d, scroll by %d, %d"), + wxLogTrace(wxT("scroll"), wxT("rect is %dx%d, scroll by %d, %d"), sizeTotal.x, sizeTotal.y, dx, dy); // the initial and end point of the region we move in client coords @@ -1178,7 +1178,7 @@ wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) if ( size.x <= 0 || size.y <= 0 ) { // just redraw everything as nothing of the displayed image will stay - wxLogTrace(_T("scroll"), _T("refreshing everything")); + wxLogTrace(wxT("scroll"), wxT("refreshing everything")); rect = rectTotal ? *rectTotal : wxRect(0, 0, sizeTotal.x, sizeTotal.y); } @@ -1230,8 +1230,8 @@ wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) ); dc.Blit(ptDest, size, &dcMem, wxPoint(0,0)); - wxLogTrace(_T("scroll"), - _T("Blit: (%d, %d) of size %dx%d -> (%d, %d)"), + wxLogTrace(wxT("scroll"), + wxT("Blit: (%d, %d) of size %dx%d -> (%d, %d)"), ptSource.x, ptSource.y, size.x, size.y, ptDest.x, ptDest.y); @@ -1262,7 +1262,7 @@ wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) rect.height = sizeTotal.y; - wxLogTrace(_T("scroll"), _T("refreshing (%d, %d)-(%d, %d)"), + wxLogTrace(wxT("scroll"), wxT("refreshing (%d, %d)-(%d, %d)"), rect.x, rect.y, rect.GetRight() + 1, rect.GetBottom() + 1); } @@ -1283,7 +1283,7 @@ wxRect wxWindow::ScrollNoRefresh(int dx, int dy, const wxRect *rectTotal) rect.width = sizeTotal.x; - wxLogTrace(_T("scroll"), _T("refreshing (%d, %d)-(%d, %d)"), + wxLogTrace(wxT("scroll"), wxT("refreshing (%d, %d)-(%d, %d)"), rect.x, rect.y, rect.GetRight() + 1, rect.GetBottom() + 1); } diff --git a/src/unix/dialup.cpp b/src/unix/dialup.cpp index 96cf13130b..67e6150ff9 100644 --- a/src/unix/dialup.cpp +++ b/src/unix/dialup.cpp @@ -250,7 +250,7 @@ public: virtual void Notify() { - wxLogTrace(_T("dialup"), wxT("Checking dial up network status.")); + wxLogTrace(wxT("dialup"), wxT("Checking dial up network status.")); m_dupman->CheckStatus(); } @@ -292,15 +292,15 @@ wxDialUpManagerImpl::wxDialUpManagerImpl() m_BeaconPort = 80; #ifdef __SGI__ - m_ConnectCommand = _T("/usr/etc/ppp"); + m_ConnectCommand = wxT("/usr/etc/ppp"); #elif defined(__LINUX__) // default values for Debian/GNU linux - m_ConnectCommand = _T("pon"); - m_HangUpCommand = _T("poff"); + m_ConnectCommand = wxT("pon"); + m_HangUpCommand = wxT("poff"); #endif - wxChar * dial = wxGetenv(_T("WXDIALUP_DIALCMD")); - wxChar * hup = wxGetenv(_T("WXDIALUP_HUPCMD")); + wxChar * dial = wxGetenv(wxT("WXDIALUP_DIALCMD")); + wxChar * hup = wxGetenv(wxT("WXDIALUP_HUPCMD")); SetConnectCommand(dial ? wxString(dial) : m_ConnectCommand, hup ? wxString(hup) : m_HangUpCommand); } @@ -509,7 +509,7 @@ void wxDialUpManagerImpl::CheckStatusInternal() break; default: - wxFAIL_MSG(_T("Unexpected netDeviceType")); + wxFAIL_MSG(wxT("Unexpected netDeviceType")); } } @@ -597,7 +597,7 @@ wxDialUpManagerImpl::CheckProcNet() int netDevice = NetDevice_Unknown; #ifdef __LINUX__ - if (wxFileExists(_T("/proc/net/route"))) + if (wxFileExists(wxT("/proc/net/route"))) { // cannot use wxFile::Length because file doesn't support seeking, so // use stdio directly @@ -647,16 +647,16 @@ wxDialUpManagerImpl::CheckIfconfig() { static const wxChar *ifconfigLocations[] = { - _T("/sbin"), // Linux, FreeBSD, Darwin - _T("/usr/sbin"), // SunOS, Solaris, AIX, HP-UX - _T("/usr/etc"), // IRIX - _T("/etc"), // AIX 5 + wxT("/sbin"), // Linux, FreeBSD, Darwin + wxT("/usr/sbin"), // SunOS, Solaris, AIX, HP-UX + wxT("/usr/etc"), // IRIX + wxT("/etc"), // AIX 5 }; for ( size_t n = 0; n < WXSIZEOF(ifconfigLocations); n++ ) { wxString path(ifconfigLocations[n]); - path << _T("/ifconfig"); + path << wxT("/ifconfig"); if ( wxFileExists(path) ) { @@ -671,7 +671,7 @@ wxDialUpManagerImpl::CheckIfconfig() wxLogNull ln; // suppress all error messages wxASSERT_MSG( m_IfconfigPath.length(), - _T("can't use ifconfig if it wasn't found") ); + wxT("can't use ifconfig if it wasn't found") ); wxString tmpfile = wxFileName::CreateTempFileName( wxT("_wxdialuptest") ); wxString cmd = wxT("/bin/sh -c \'"); @@ -767,9 +767,9 @@ wxDialUpManagerImpl::NetConnection wxDialUpManagerImpl::CheckPing() if (wxFileExists( wxT("SYS$SYSTEM:TCPIP$PING.EXE") )) m_PingPath = wxT("$SYS$SYSTEM:TCPIP$PING"); #elif defined(__AIX__) - m_PingPath = _T("/etc/ping"); + m_PingPath = wxT("/etc/ping"); #elif defined(__SGI__) - m_PingPath = _T("/usr/etc/ping"); + m_PingPath = wxT("/usr/etc/ping"); #else if (wxFileExists( wxT("/bin/ping") )) m_PingPath = wxT("/bin/ping"); diff --git a/src/unix/dir.cpp b/src/unix/dir.cpp index 2581eb1cb9..31270d04a5 100644 --- a/src/unix/dir.cpp +++ b/src/unix/dir.cpp @@ -91,7 +91,7 @@ wxDirData::wxDirData(const wxString& dirname) // throw away the trailing slashes size_t n = m_dirname.length(); - wxCHECK_RET( n, _T("empty dir name in wxDir") ); + wxCHECK_RET( n, wxT("empty dir name in wxDir") ); while ( n > 0 && m_dirname[--n] == '/' ) ; @@ -108,7 +108,7 @@ wxDirData::~wxDirData() { if ( closedir(m_dir) != 0 ) { - wxLogLastError(_T("closedir")); + wxLogLastError(wxT("closedir")); } } } @@ -120,7 +120,7 @@ bool wxDirData::Read(wxString *filename) // speed up string concatenation in the loop a bit wxString path = m_dirname; - path += _T('/'); + path += wxT('/'); path.reserve(path.length() + 255); wxString de_d_name; @@ -183,7 +183,7 @@ bool wxDirData::Read(wxString *filename) wxDirData::wxDirData(const wxString& WXUNUSED(dirname)) { - wxFAIL_MSG(_T("not implemented")); + wxFAIL_MSG(wxT("not implemented")); } wxDirData::~wxDirData() @@ -245,7 +245,7 @@ wxString wxDir::GetName() const if ( m_data ) { name = M_DIR->GetName(); - if ( !name.empty() && (name.Last() == _T('/')) ) + if ( !name.empty() && (name.Last() == wxT('/')) ) { // chop off the last (back)slash name.Truncate(name.length() - 1); @@ -268,7 +268,7 @@ bool wxDir::GetFirst(wxString *filename, const wxString& filespec, int flags) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); M_DIR->Rewind(); @@ -280,16 +280,16 @@ bool wxDir::GetFirst(wxString *filename, bool wxDir::GetNext(wxString *filename) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); - wxCHECK_MSG( filename, false, _T("bad pointer in wxDir::GetNext()") ); + wxCHECK_MSG( filename, false, wxT("bad pointer in wxDir::GetNext()") ); return M_DIR->Read(filename); } bool wxDir::HasSubDirs(const wxString& spec) const { - wxCHECK_MSG( IsOpened(), false, _T("must wxDir::Open() first") ); + wxCHECK_MSG( IsOpened(), false, wxT("must wxDir::Open() first") ); if ( spec.empty() ) { diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index 0aafee0a54..7e0b469080 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -366,7 +366,7 @@ private: void wxClientDisplayRect(int *x, int *y, int *width, int *height) { Display * const dpy = wxGetX11Display(); - wxCHECK_RET( dpy, _T("can't be called before initializing the GUI") ); + wxCHECK_RET( dpy, wxT("can't be called before initializing the GUI") ); const Atom atomWorkArea = XInternAtom(dpy, "_NET_WORKAREA", True); if ( atomWorkArea ) @@ -402,7 +402,7 @@ void wxClientDisplayRect(int *x, int *y, int *width, int *height) format != 32 || numItems != 4 ) { - wxLogDebug(_T("XGetWindowProperty(\"_NET_WORKAREA\") failed")); + wxLogDebug(wxT("XGetWindowProperty(\"_NET_WORKAREA\") failed")); return; } diff --git a/src/unix/dlunix.cpp b/src/unix/dlunix.cpp index 4e2d7553dc..d49cb3977c 100644 --- a/src/unix/dlunix.cpp +++ b/src/unix/dlunix.cpp @@ -256,7 +256,7 @@ wxDllType wxDynamicLibrary::GetProgramHandle() wxDllType wxDynamicLibrary::RawLoad(const wxString& libname, int flags) { wxASSERT_MSG( !(flags & wxDL_NOW) || !(flags & wxDL_LAZY), - _T("wxDL_LAZY and wxDL_NOW are mutually exclusive.") ); + wxT("wxDL_LAZY and wxDL_NOW are mutually exclusive.") ); #ifdef USE_POSIX_DL_FUNCS // we need to use either RTLD_NOW or RTLD_LAZY because if we call dlopen() @@ -354,22 +354,22 @@ public: { wxDynamicLibraryDetails *details = new wxDynamicLibraryDetails; details->m_path = path; - details->m_name = path.AfterLast(_T('/')); + details->m_name = path.AfterLast(wxT('/')); details->m_address = start; details->m_length = (char *)end - (char *)start; // try to extract the library version from its name - const size_t posExt = path.rfind(_T(".so")); + const size_t posExt = path.rfind(wxT(".so")); if ( posExt != wxString::npos ) { - if ( path.c_str()[posExt + 3] == _T('.') ) + if ( path.c_str()[posExt + 3] == wxT('.') ) { // assume "libfoo.so.x.y.z" case details->m_version.assign(path, posExt + 4, wxString::npos); } else { - size_t posDash = path.find_last_of(_T('-'), posExt); + size_t posDash = path.find_last_of(wxT('-'), posExt); if ( posDash != wxString::npos ) { // assume "libbar-x.y.z.so" case @@ -390,7 +390,7 @@ wxDynamicLibraryDetailsArray wxDynamicLibrary::ListLoaded() #ifdef __LINUX__ // examine /proc/self/maps to find out what is loaded in our address space - wxFFile file(_T("/proc/self/maps")); + wxFFile file(wxT("/proc/self/maps")); if ( file.IsOpened() ) { // details of the module currently being parsed @@ -420,13 +420,13 @@ wxDynamicLibraryDetailsArray wxDynamicLibrary::ListLoaded() default: // chop '\n' buf[strlen(buf) - 1] = '\0'; - wxLogDebug(_T("Failed to parse line \"%s\" in /proc/self/maps."), + wxLogDebug(wxT("Failed to parse line \"%s\" in /proc/self/maps."), buf); continue; } wxASSERT_MSG( start >= endCur, - _T("overlapping regions in /proc/self/maps?") ); + wxT("overlapping regions in /proc/self/maps?") ); wxString pathNew = wxString::FromAscii(path); if ( pathCur.empty() ) diff --git a/src/unix/epolldispatcher.cpp b/src/unix/epolldispatcher.cpp index 7d751e8d57..503920d7ce 100644 --- a/src/unix/epolldispatcher.cpp +++ b/src/unix/epolldispatcher.cpp @@ -52,21 +52,21 @@ static uint32_t GetEpollMask(int flags, int fd) { ep |= EPOLLIN; wxLogTrace(wxEpollDispatcher_Trace, - _T("Registered fd %d for input events"), fd); + wxT("Registered fd %d for input events"), fd); } if ( flags & wxFDIO_OUTPUT ) { ep |= EPOLLOUT; wxLogTrace(wxEpollDispatcher_Trace, - _T("Registered fd %d for output events"), fd); + wxT("Registered fd %d for output events"), fd); } if ( flags & wxFDIO_EXCEPTION ) { ep |= EPOLLERR | EPOLLHUP; wxLogTrace(wxEpollDispatcher_Trace, - _T("Registered fd %d for exceptional events"), fd); + wxT("Registered fd %d for exceptional events"), fd); } return ep; @@ -86,13 +86,13 @@ wxEpollDispatcher *wxEpollDispatcher::Create() return NULL; } wxLogTrace(wxEpollDispatcher_Trace, - _T("Epoll fd %d created"), epollDescriptor); + wxT("Epoll fd %d created"), epollDescriptor); return new wxEpollDispatcher(epollDescriptor); } wxEpollDispatcher::wxEpollDispatcher(int epollDescriptor) { - wxASSERT_MSG( epollDescriptor != -1, _T("invalid descriptor") ); + wxASSERT_MSG( epollDescriptor != -1, wxT("invalid descriptor") ); m_epollDescriptor = epollDescriptor; } @@ -120,7 +120,7 @@ bool wxEpollDispatcher::RegisterFD(int fd, wxFDIOHandler* handler, int flags) return false; } wxLogTrace(wxEpollDispatcher_Trace, - _T("Added fd %d (handler %p) to epoll %d"), fd, handler, m_epollDescriptor); + wxT("Added fd %d (handler %p) to epoll %d"), fd, handler, m_epollDescriptor); return true; } @@ -141,7 +141,7 @@ bool wxEpollDispatcher::ModifyFD(int fd, wxFDIOHandler* handler, int flags) } wxLogTrace(wxEpollDispatcher_Trace, - _T("Modified fd %d (handler: %p) on epoll %d"), fd, handler, m_epollDescriptor); + wxT("Modified fd %d (handler: %p) on epoll %d"), fd, handler, m_epollDescriptor); return true; } @@ -157,7 +157,7 @@ bool wxEpollDispatcher::UnregisterFD(int fd) fd, m_epollDescriptor); } wxLogTrace(wxEpollDispatcher_Trace, - _T("removed fd %d from %d"), fd, m_epollDescriptor); + wxT("removed fd %d from %d"), fd, m_epollDescriptor); return true; } @@ -222,7 +222,7 @@ int wxEpollDispatcher::Dispatch(int timeout) wxFDIOHandler * const handler = (wxFDIOHandler *)(p->data.ptr); if ( !handler ) { - wxFAIL_MSG( _T("NULL handler in epoll_event?") ); + wxFAIL_MSG( wxT("NULL handler in epoll_event?") ); continue; } diff --git a/src/unix/evtloopunix.cpp b/src/unix/evtloopunix.cpp index 5797b5eedb..a44933e593 100644 --- a/src/unix/evtloopunix.cpp +++ b/src/unix/evtloopunix.cpp @@ -37,7 +37,7 @@ #include "wx/unix/private/epolldispatcher.h" #include "wx/private/selectdispatcher.h" -#define TRACE_EVENTS _T("events") +#define TRACE_EVENTS wxT("events") // =========================================================================== // wxEventLoop::PipeIOHandler implementation diff --git a/src/unix/fontutil.cpp b/src/unix/fontutil.cpp index 03e3f6dee3..84b4e55790 100644 --- a/src/unix/fontutil.cpp +++ b/src/unix/fontutil.cpp @@ -491,7 +491,7 @@ static wxNativeFont wxLoadQueryFont(int pointSize, bool wxNativeEncodingInfo::FromString(const wxString& s) { // use ";", not "-" because it may be part of encoding name - wxStringTokenizer tokenizer(s, _T(";")); + wxStringTokenizer tokenizer(s, wxT(";")); wxString encid = tokenizer.GetNextToken(); long enc; @@ -516,10 +516,10 @@ bool wxNativeEncodingInfo::FromString(const wxString& s) wxString wxNativeEncodingInfo::ToString() const { wxString s; - s << (long)encoding << _T(';') << xregistry << _T(';') << xencoding; + s << (long)encoding << wxT(';') << xregistry << wxT(';') << xencoding; if ( !facename.empty() ) { - s << _T(';') << facename; + s << wxT(';') << facename; } return s; @@ -536,11 +536,11 @@ void wxNativeFontInfo::Init() bool wxNativeFontInfo::FromString(const wxString& s) { - wxStringTokenizer tokenizer(s, _T(";")); + wxStringTokenizer tokenizer(s, wxT(";")); // check the version wxString token = tokenizer.GetNextToken(); - if ( token != _T('0') ) + if ( token != wxT('0') ) return false; xFontName = tokenizer.GetNextToken(); @@ -555,7 +555,7 @@ bool wxNativeFontInfo::FromString(const wxString& s) wxString wxNativeFontInfo::ToString() const { // 0 is the version - return wxString::Format(_T("%d;%s"), 0, GetXFontName().c_str()); + return wxString::Format(wxT("%d;%s"), 0, GetXFontName().c_str()); } bool wxNativeFontInfo::FromUserString(const wxString& s) @@ -577,7 +577,7 @@ bool wxNativeFontInfo::HasElements() const wxString wxNativeFontInfo::GetXFontComponent(wxXLFDField field) const { - wxCHECK_MSG( field < wxXLFD_MAX, wxEmptyString, _T("invalid XLFD field") ); + wxCHECK_MSG( field < wxXLFD_MAX, wxEmptyString, wxT("invalid XLFD field") ); if ( !HasElements() ) { @@ -592,7 +592,7 @@ wxString wxNativeFontInfo::GetXFontComponent(wxXLFDField field) const bool wxNativeFontInfo::FromXFontName(const wxString& fontname) { // TODO: we should be able to handle the font aliases here, but how? - wxStringTokenizer tokenizer(fontname, _T("-")); + wxStringTokenizer tokenizer(fontname, wxT("-")); // skip the leading, usually empty field (font name registry) if ( !tokenizer.HasMoreTokens() ) @@ -609,7 +609,7 @@ bool wxNativeFontInfo::FromXFontName(const wxString& fontname) } wxString field = tokenizer.GetNextToken(); - if ( !field.empty() && field != _T('*') ) + if ( !field.empty() && field != wxT('*') ) { // we're really initialized now m_isDefault = false; @@ -636,11 +636,11 @@ wxString wxNativeFontInfo::GetXFontName() const wxString elt = fontElements[n]; if ( elt.empty() && n != wxXLFD_ADDSTYLE ) { - elt = _T('*'); + elt = wxT('*'); } // const_cast - ((wxNativeFontInfo *)this)->xFontName << _T('-') << elt; + ((wxNativeFontInfo *)this)->xFontName << wxT('-') << elt; } } @@ -650,18 +650,18 @@ wxString wxNativeFontInfo::GetXFontName() const void wxNativeFontInfo::SetXFontComponent(wxXLFDField field, const wxString& value) { - wxCHECK_RET( field < wxXLFD_MAX, _T("invalid XLFD field") ); + wxCHECK_RET( field < wxXLFD_MAX, wxT("invalid XLFD field") ); // this class should be initialized with a valid font spec first and only // then the fields may be modified! - wxASSERT_MSG( !IsDefault(), _T("can't modify an uninitialized XLFD") ); + wxASSERT_MSG( !IsDefault(), wxT("can't modify an uninitialized XLFD") ); if ( !HasElements() ) { // const_cast if ( !((wxNativeFontInfo *)this)->FromXFontName(xFontName) ) { - wxFAIL_MSG( _T("can't set font element for invalid XLFD") ); + wxFAIL_MSG( wxT("can't set font element for invalid XLFD") ); return; } @@ -708,13 +708,13 @@ wxFontStyle wxNativeFontInfo::GetStyle() const default: // again, unknown but consider normal by default - case _T('r'): + case wxT('r'): return wxFONTSTYLE_NORMAL; - case _T('i'): + case wxT('i'): return wxFONTSTYLE_ITALIC; - case _T('o'): + case wxT('o'): return wxFONTSTYLE_SLANT; } } @@ -722,9 +722,9 @@ wxFontStyle wxNativeFontInfo::GetStyle() const wxFontWeight wxNativeFontInfo::GetWeight() const { const wxString s = GetXFontComponent(wxXLFD_WEIGHT).MakeLower(); - if ( s.find(_T("bold")) != wxString::npos || s == _T("black") ) + if ( s.find(wxT("bold")) != wxString::npos || s == wxT("black") ) return wxFONTWEIGHT_BOLD; - else if ( s == _T("light") ) + else if ( s == wxT("light") ) return wxFONTWEIGHT_LIGHT; return wxFONTWEIGHT_NORMAL; @@ -746,7 +746,7 @@ wxFontFamily wxNativeFontInfo::GetFamily() const { // and wxWidgets family -- to X foundry, but we have to translate it to // wxFontFamily somehow... - wxFAIL_MSG(_T("not implemented")); // GetXFontComponent(wxXLFD_FOUNDRY); + wxFAIL_MSG(wxT("not implemented")); // GetXFontComponent(wxXLFD_FOUNDRY); return wxFONTFAMILY_DEFAULT; } @@ -754,14 +754,14 @@ wxFontFamily wxNativeFontInfo::GetFamily() const wxFontEncoding wxNativeFontInfo::GetEncoding() const { // we already have the code for this but need to refactor it first - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); return wxFONTENCODING_MAX; } void wxNativeFontInfo::SetPointSize(int pointsize) { - SetXFontComponent(wxXLFD_POINTSIZE, wxString::Format(_T("%d"), pointsize)); + SetXFontComponent(wxXLFD_POINTSIZE, wxString::Format(wxT("%d"), pointsize)); } void wxNativeFontInfo::SetStyle(wxFontStyle style) @@ -770,18 +770,18 @@ void wxNativeFontInfo::SetStyle(wxFontStyle style) switch ( style ) { case wxFONTSTYLE_ITALIC: - s = _T('i'); + s = wxT('i'); break; case wxFONTSTYLE_SLANT: - s = _T('o'); + s = wxT('o'); break; case wxFONTSTYLE_NORMAL: - s = _T('r'); + s = wxT('r'); default: - wxFAIL_MSG( _T("unknown wxFontStyle in wxNativeFontInfo::SetStyle") ); + wxFAIL_MSG( wxT("unknown wxFontStyle in wxNativeFontInfo::SetStyle") ); return; } @@ -794,19 +794,19 @@ void wxNativeFontInfo::SetWeight(wxFontWeight weight) switch ( weight ) { case wxFONTWEIGHT_BOLD: - s = _T("bold"); + s = wxT("bold"); break; case wxFONTWEIGHT_LIGHT: - s = _T("light"); + s = wxT("light"); break; case wxFONTWEIGHT_NORMAL: - s = _T("medium"); + s = wxT("medium"); break; default: - wxFAIL_MSG( _T("unknown wxFontWeight in wxNativeFontInfo::SetWeight") ); + wxFAIL_MSG( wxT("unknown wxFontWeight in wxNativeFontInfo::SetWeight") ); return; } @@ -827,7 +827,7 @@ bool wxNativeFontInfo::SetFaceName(const wxString& facename) void wxNativeFontInfo::SetFamily(wxFontFamily WXUNUSED(family)) { // wxFontFamily -> X foundry, anyone? - wxFAIL_MSG( _T("not implemented") ); + wxFAIL_MSG( wxT("not implemented") ); // SetXFontComponent(wxXLFD_FOUNDRY, ...); } @@ -849,7 +849,7 @@ void wxNativeFontInfo::SetEncoding(wxFontEncoding encoding) bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info) { - wxCHECK_MSG( info, false, _T("bad pointer in wxGetNativeFontEncoding") ); + wxCHECK_MSG( info, false, wxT("bad pointer in wxGetNativeFontEncoding") ); if ( encoding == wxFONTENCODING_DEFAULT ) { @@ -937,8 +937,8 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding, bool wxTestFontEncoding(const wxNativeEncodingInfo& info) { wxString fontspec; - fontspec.Printf(_T("-*-%s-*-*-*-*-*-*-*-*-*-*-%s-%s"), - !info.facename ? _T("*") : info.facename.c_str(), + fontspec.Printf(wxT("-*-%s-*-*-*-*-*-*-*-*-*-*-%s-%s"), + !info.facename ? wxT("*") : info.facename.c_str(), info.xregistry.c_str(), info.xencoding.c_str()); @@ -1000,7 +1000,7 @@ wxNativeFont wxLoadQueryNearestFont(int pointSize, // // Make sure point size is correct for scale factor. // - wxStringTokenizer tokenizer(*xFontName, _T("-"), wxTOKEN_RET_DELIMS); + wxStringTokenizer tokenizer(*xFontName, wxT("-"), wxTOKEN_RET_DELIMS); wxString newFontName; for(int i = 0; i < 8; i++) @@ -1118,12 +1118,12 @@ wxNativeFont wxLoadQueryNearestFont(int pointSize, // NULL or we'd crash in wxFont code if ( !font ) { - wxFAIL_MSG( _T("this encoding should be available!") ); + wxFAIL_MSG( wxT("this encoding should be available!") ); font = wxLoadQueryFont(-1, wxDEFAULT, wxNORMAL, wxNORMAL, false, wxEmptyString, - _T("*"), _T("*"), + wxT("*"), wxT("*"), xFontName); } } @@ -1143,7 +1143,7 @@ static bool wxTestFontSpec(const wxString& fontspec) { // some X servers will fail to load this font because there are too many // matches so we must test explicitly for this - if ( fontspec == _T("-*-*-*-*-*-*-*-*-*-*-*-*-*-*") ) + if ( fontspec == wxT("-*-*-*-*-*-*-*-*-*-*-*-*-*-*") ) { return true; } @@ -1312,7 +1312,7 @@ static wxNativeFont wxLoadQueryFont(int pointSize, break; default: - wxFAIL_MSG(_T("unknown font style")); + wxFAIL_MSG(wxT("unknown font style")); // fall back to normal case wxNORMAL: @@ -1420,11 +1420,11 @@ static wxNativeFont wxLoadQueryFont(int pointSize, wxString sizeSpec; if ( pointSize == -1 ) { - sizeSpec = _T('*'); + sizeSpec = wxT('*'); } else { - sizeSpec.Printf(_T("%d"), pointSize); + sizeSpec.Printf(wxT("%d"), pointSize); } // construct the X font spec from our data diff --git a/src/unix/glx11.cpp b/src/unix/glx11.cpp index 9e1c4464c0..c90b1fc3c4 100644 --- a/src/unix/glx11.cpp +++ b/src/unix/glx11.cpp @@ -38,7 +38,7 @@ wxGLContext::wxGLContext(wxGLCanvas *gc, const wxGLContext *other) if ( wxGLCanvas::GetGLXVersion() >= 13 ) { GLXFBConfig *fbc = gc->GetGLXFBConfig(); - wxCHECK_RET( fbc, _T("invalid GLXFBConfig for OpenGL") ); + wxCHECK_RET( fbc, wxT("invalid GLXFBConfig for OpenGL") ); m_glContext = glXCreateNewContext( wxGetX11Display(), fbc[0], GLX_RGBA_TYPE, other ? other->m_glContext : None, @@ -47,14 +47,14 @@ wxGLContext::wxGLContext(wxGLCanvas *gc, const wxGLContext *other) else // GLX <= 1.2 { XVisualInfo *vi = gc->GetXVisualInfo(); - wxCHECK_RET( vi, _T("invalid visual for OpenGL") ); + wxCHECK_RET( vi, wxT("invalid visual for OpenGL") ); m_glContext = glXCreateContext( wxGetX11Display(), vi, other ? other->m_glContext : None, GL_TRUE ); } - wxASSERT_MSG( m_glContext, _T("Couldn't create OpenGL context") ); + wxASSERT_MSG( m_glContext, wxT("Couldn't create OpenGL context") ); } wxGLContext::~wxGLContext() @@ -74,7 +74,7 @@ bool wxGLContext::SetCurrent(const wxGLCanvas& win) const return false; const Window xid = win.GetXWindow(); - wxCHECK2_MSG( xid, return false, _T("window must be shown") ); + wxCHECK2_MSG( xid, return false, wxT("window must be shown") ); return MakeCurrent(xid, m_glContext); } @@ -145,7 +145,7 @@ bool wxGLCanvasX11::IsGLXMultiSampleAvailable() bool wxGLCanvasX11::ConvertWXAttrsToGL(const int *wxattrs, int *glattrs, size_t n) { - wxCHECK_MSG( n >= 16, false, _T("GL attributes buffer too small") ); + wxCHECK_MSG( n >= 16, false, wxT("GL attributes buffer too small") ); /* Different versions of GLX API use rather different attributes lists, see @@ -186,7 +186,7 @@ wxGLCanvasX11::ConvertWXAttrsToGL(const int *wxattrs, int *glattrs, size_t n) glattrs[i] = None; - wxASSERT_MSG( i < n, _T("GL attributes buffer too small") ); + wxASSERT_MSG( i < n, wxT("GL attributes buffer too small") ); } else // have non-default attributes { @@ -304,7 +304,7 @@ wxGLCanvasX11::ConvertWXAttrsToGL(const int *wxattrs, int *glattrs, size_t n) break; default: - wxLogDebug(_T("Unsupported OpenGL attribute %d"), + wxLogDebug(wxT("Unsupported OpenGL attribute %d"), wxattrs[arg - 1]); continue; } @@ -427,7 +427,7 @@ int wxGLCanvasX11::GetGLXVersion() // check the GLX version int glxMajorVer, glxMinorVer; bool ok = glXQueryVersion(wxGetX11Display(), &glxMajorVer, &glxMinorVer); - wxASSERT_MSG( ok, _T("GLX version not found") ); + wxASSERT_MSG( ok, wxT("GLX version not found") ); if (!ok) s_glxVersion = 10; // 1.0 by default else @@ -440,7 +440,7 @@ int wxGLCanvasX11::GetGLXVersion() bool wxGLCanvasX11::SwapBuffers() { const Window xid = GetXWindow(); - wxCHECK2_MSG( xid, return false, _T("window must be shown") ); + wxCHECK2_MSG( xid, return false, wxT("window must be shown") ); glXSwapBuffers(wxGetX11Display(), xid); return true; diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index 52820e306d..2f79104e23 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -161,7 +161,7 @@ void wxMimeTypesManagerImpl::LoadXDGApp(const wxString& filename) #if wxUSE_INTL // try "Name[locale name]" first wxLocale *locale = wxGetLocale(); if ( locale ) - nIndex = file.pIndexOf(_T("Name[")+locale->GetName()+_T("]=")); + nIndex = file.pIndexOf(wxT("Name[")+locale->GetName()+wxT("]=")); #endif // wxUSE_INTL if(nIndex == wxNOT_FOUND) nIndex = file.pIndexOf( wxT("Name=") ); @@ -173,7 +173,7 @@ void wxMimeTypesManagerImpl::LoadXDGApp(const wxString& filename) nIndex = wxNOT_FOUND; #if wxUSE_INTL // try "Icon[locale name]" first if ( locale ) - nIndex = file.pIndexOf(_T("Icon[")+locale->GetName()+_T("]=")); + nIndex = file.pIndexOf(wxT("Icon[")+locale->GetName()+wxT("]=")); #endif // wxUSE_INTL if(nIndex == wxNOT_FOUND) nIndex = file.pIndexOf( wxT("Icon=") ); @@ -198,7 +198,7 @@ void wxMimeTypesManagerImpl::LoadXDGApp(const wxString& filename) sCmd.Replace(wxT("%i"), nameicon); sCmd.Replace(wxT("%m"), namemini); - wxStringTokenizer tokenizer(mimetypes, _T(";")); + wxStringTokenizer tokenizer(mimetypes, wxT(";")); while(tokenizer.HasMoreTokens()) { wxString mimetype = tokenizer.GetNextToken().Lower(); nIndex = m_aTypes.Index(mimetype); @@ -222,7 +222,7 @@ void wxMimeTypesManagerImpl::LoadXDGAppsFilesFromDir(const wxString& dirname) wxString filename; // Look into .desktop files - bool cont = dir.GetFirst(&filename, _T("*.desktop"), wxDIR_FILES); + bool cont = dir.GetFirst(&filename, wxT("*.desktop"), wxDIR_FILES); while (cont) { wxFileName p(dirname, filename); diff --git a/src/unix/snglinst.cpp b/src/unix/snglinst.cpp index 1ce464edfa..43674249af 100644 --- a/src/unix/snglinst.cpp +++ b/src/unix/snglinst.cpp @@ -348,10 +348,10 @@ bool wxSingleInstanceChecker::Create(const wxString& name, const wxString& path) { wxASSERT_MSG( !m_impl, - _T("calling wxSingleInstanceChecker::Create() twice?") ); + wxT("calling wxSingleInstanceChecker::Create() twice?") ); // must have the file name to create a lock file - wxASSERT_MSG( !name.empty(), _T("lock file name can't be empty") ); + wxASSERT_MSG( !name.empty(), wxT("lock file name can't be empty") ); m_impl = new wxSingleInstanceCheckerImpl; @@ -361,9 +361,9 @@ bool wxSingleInstanceChecker::Create(const wxString& name, fullname = wxGetHomeDir(); } - if ( fullname.Last() != _T('/') ) + if ( fullname.Last() != wxT('/') ) { - fullname += _T('/'); + fullname += wxT('/'); } fullname << name; @@ -373,7 +373,7 @@ bool wxSingleInstanceChecker::Create(const wxString& name, bool wxSingleInstanceChecker::IsAnotherRunning() const { - wxCHECK_MSG( m_impl, false, _T("must call Create() first") ); + wxCHECK_MSG( m_impl, false, wxT("must call Create() first") ); const pid_t lockerPid = m_impl->GetLockerPID(); diff --git a/src/unix/sound.cpp b/src/unix/sound.cpp index 0afab5a47b..37b8469aad 100644 --- a/src/unix/sound.cpp +++ b/src/unix/sound.cpp @@ -104,7 +104,7 @@ public: class wxSoundBackendOSS : public wxSoundBackend { public: - wxString GetName() const { return _T("Open Sound System"); } + wxString GetName() const { return wxT("Open Sound System"); } int GetPriority() const { return 10; } bool IsAvailable() const; bool HasNativeAsyncPlayback() const { return false; } @@ -152,7 +152,7 @@ bool wxSoundBackendOSS::Play(wxSoundData *data, unsigned flags, { if (status->m_stopRequested) { - wxLogTrace(_T("sound"), _T("playback stopped")); + wxLogTrace(wxT("sound"), wxT("playback stopped")); close(dev); return true; } @@ -195,7 +195,7 @@ bool wxSoundBackendOSS::InitDSP(int dev, const wxSoundData *data) // Reset the dsp if (ioctl(dev, SNDCTL_DSP_RESET, 0) < 0) { - wxLogTrace(_T("sound"), _T("unable to reset dsp")); + wxLogTrace(wxT("sound"), wxT("unable to reset dsp")); return false; } @@ -204,13 +204,13 @@ bool wxSoundBackendOSS::InitDSP(int dev, const wxSoundData *data) tmp = data->m_bitsPerSample; if (ioctl(dev, SNDCTL_DSP_SAMPLESIZE, &tmp) < 0) { - wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_SAMPLESIZE)")); + wxLogTrace(wxT("sound"), wxT("IOCTL failure (SNDCTL_DSP_SAMPLESIZE)")); return false; } if (tmp != data->m_bitsPerSample) { - wxLogTrace(_T("sound"), - _T("Unable to set DSP sample size to %d (wants %d)"), + wxLogTrace(wxT("sound"), + wxT("Unable to set DSP sample size to %d (wants %d)"), data->m_bitsPerSample, tmp); m_needConversion = true; } @@ -219,19 +219,19 @@ bool wxSoundBackendOSS::InitDSP(int dev, const wxSoundData *data) tmp = stereo; if (ioctl(dev, SNDCTL_DSP_STEREO, &tmp) < 0) { - wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_STEREO)")); + wxLogTrace(wxT("sound"), wxT("IOCTL failure (SNDCTL_DSP_STEREO)")); return false; } if (tmp != stereo) { - wxLogTrace(_T("sound"), _T("Unable to set DSP to %s."), stereo? _T("stereo"):_T("mono")); + wxLogTrace(wxT("sound"), wxT("Unable to set DSP to %s."), stereo? wxT("stereo"):wxT("mono")); m_needConversion = true; } tmp = data->m_samplingRate; if (ioctl(dev, SNDCTL_DSP_SPEED, &tmp) < 0) { - wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_SPEED)")); + wxLogTrace(wxT("sound"), wxT("IOCTL failure (SNDCTL_DSP_SPEED)")); return false; } if (tmp != data->m_samplingRate) @@ -244,8 +244,8 @@ bool wxSoundBackendOSS::InitDSP(int dev, const wxSoundData *data) // file rates for something that we can't hear anyways. if (data->m_samplingRate - tmp > (tmp * .01) || tmp - data->m_samplingRate > (tmp * .01)) { - wxLogTrace(_T("sound"), - _T("Unable to set DSP sampling rate to %d (wants %d)"), + wxLogTrace(wxT("sound"), + wxT("Unable to set DSP sampling rate to %d (wants %d)"), data->m_samplingRate, tmp); m_needConversion = true; } @@ -255,7 +255,7 @@ bool wxSoundBackendOSS::InitDSP(int dev, const wxSoundData *data) // the sampling rate, etc. if (ioctl(dev, SNDCTL_DSP_GETBLKSIZE, &m_DSPblkSize) < 0) { - wxLogTrace(_T("sound"), _T("IOCTL failure (SNDCTL_DSP_GETBLKSIZE)")); + wxLogTrace(wxT("sound"), wxT("IOCTL failure (SNDCTL_DSP_GETBLKSIZE)")); return false; } return true; @@ -344,7 +344,7 @@ wxThread::ExitCode wxSoundAsyncPlaybackThread::Entry() m_data->DecRef(); m_adapt->m_playing = false; m_adapt->m_mutexRightToPlay.Unlock(); - wxLogTrace(_T("sound"), _T("terminated async playback thread")); + wxLogTrace(wxT("sound"), wxT("terminated async playback thread")); return 0; } #endif @@ -363,7 +363,7 @@ bool wxSoundSyncOnlyAdaptor::Play(wxSoundData *data, unsigned flags, wxThread *th = new wxSoundAsyncPlaybackThread(this, data, flags); th->Create(); th->Run(); - wxLogTrace(_T("sound"), _T("launched async playback thread")); + wxLogTrace(wxT("sound"), wxT("launched async playback thread")); return true; #else wxLogError(_("Unable to play sound asynchronously.")); @@ -385,7 +385,7 @@ bool wxSoundSyncOnlyAdaptor::Play(wxSoundData *data, unsigned flags, void wxSoundSyncOnlyAdaptor::Stop() { - wxLogTrace(_T("sound"), _T("asking audio to stop")); + wxLogTrace(wxT("sound"), wxT("asking audio to stop")); #if wxUSE_THREADS // tell the player thread (if running) to stop playback ASAP: @@ -397,7 +397,7 @@ void wxSoundSyncOnlyAdaptor::Stop() // our request to interrupt playback): m_mutexRightToPlay.Lock(); m_mutexRightToPlay.Unlock(); - wxLogTrace(_T("sound"), _T("audio was stopped")); + wxLogTrace(wxT("sound"), wxT("audio was stopped")); #endif } @@ -449,7 +449,7 @@ bool wxSound::Create(const wxString& fileName, bool WXUNUSED_UNLESS_DEBUG(isResource)) { wxASSERT_MSG( !isResource, - _T("Loading sound from resources is only supported on Windows") ); + wxT("Loading sound from resources is only supported on Windows") ); Free(); @@ -509,12 +509,12 @@ bool wxSound::Create(int size, const wxByte* data) ms_backend = wxCreateSoundBackendSDL(); #else wxString dllname; - dllname.Printf(_T("%s/%s"), + dllname.Printf(wxT("%s/%s"), wxDynamicLibrary::GetPluginsDirectory().c_str(), wxDynamicLibrary::CanonicalizePluginName( - _T("sound_sdl"), wxDL_PLUGIN_BASE).c_str()); - wxLogTrace(_T("sound"), - _T("trying to load SDL plugin from '%s'..."), + wxT("sound_sdl"), wxDL_PLUGIN_BASE).c_str()); + wxLogTrace(wxT("sound"), + wxT("trying to load SDL plugin from '%s'..."), dllname.c_str()); wxLogNull null; ms_backendSDL = new wxDynamicLibrary(dllname, wxDL_NOW); @@ -557,8 +557,8 @@ bool wxSound::Create(int size, const wxByte* data) if (!ms_backend->HasNativeAsyncPlayback()) ms_backend = new wxSoundSyncOnlyAdaptor(ms_backend); - wxLogTrace(_T("sound"), - _T("using backend '%s'"), ms_backend->GetName().c_str()); + wxLogTrace(wxT("sound"), + wxT("using backend '%s'"), ms_backend->GetName().c_str()); } } @@ -566,7 +566,7 @@ bool wxSound::Create(int size, const wxByte* data) { if (ms_backend) { - wxLogTrace(_T("sound"), _T("unloading backend")); + wxLogTrace(wxT("sound"), wxT("unloading backend")); Stop(); @@ -580,7 +580,7 @@ bool wxSound::Create(int size, const wxByte* data) bool wxSound::DoPlay(unsigned flags) const { - wxCHECK_MSG( IsOk(), false, _T("Attempt to play invalid wave data") ); + wxCHECK_MSG( IsOk(), false, wxT("Attempt to play invalid wave data") ); EnsureBackend(); wxSoundPlaybackStatus status; diff --git a/src/unix/sound_sdl.cpp b/src/unix/sound_sdl.cpp index 14f45fa7b4..3962e6dc72 100644 --- a/src/unix/sound_sdl.cpp +++ b/src/unix/sound_sdl.cpp @@ -73,7 +73,7 @@ public: m_data(NULL), m_evtHandler(NULL) {} virtual ~wxSoundBackendSDL(); - wxString GetName() const { return _T("Simple DirectMedia Layer"); } + wxString GetName() const { return wxT("Simple DirectMedia Layer"); } int GetPriority() const { return 9; } bool IsAvailable() const; bool HasNativeAsyncPlayback() const { return true; } @@ -109,8 +109,8 @@ public: private: void OnNotify(wxSoundBackendSDLNotification& WXUNUSED(event)) { - wxLogTrace(_T("sound"), - _T("received playback status change notification")); + wxLogTrace(wxT("sound"), + wxT("received playback status change notification")); m_backend->FinishedPlayback(); } wxSoundBackendSDL *m_backend; @@ -139,7 +139,7 @@ bool wxSoundBackendSDL::IsAvailable() const return false; } wxConstCast(this, wxSoundBackendSDL)->m_initialized = true; - wxLogTrace(_T("sound"), _T("initialized SDL audio subsystem")); + wxLogTrace(wxT("sound"), wxT("initialized SDL audio subsystem")); return true; } @@ -208,13 +208,13 @@ bool wxSoundBackendSDL::OpenAudio() m_spec.callback = wx_sdl_audio_callback; m_spec.userdata = (void*)this; - wxLogTrace(_T("sound"), _T("opening SDL audio...")); + wxLogTrace(wxT("sound"), wxT("opening SDL audio...")); if (SDL_OpenAudio(&m_spec, NULL) >= 0) { #if wxUSE_LOG_DEBUG char driver[256]; SDL_AudioDriverName(driver, 256); - wxLogTrace(_T("sound"), _T("opened audio, driver '%s'"), + wxLogTrace(wxT("sound"), wxT("opened audio, driver '%s'"), wxString(driver, wxConvLocal).c_str()); #endif m_audioOpen = true; @@ -235,7 +235,7 @@ void wxSoundBackendSDL::CloseAudio() if (m_audioOpen) { SDL_CloseAudio(); - wxLogTrace(_T("sound"), _T("closed audio")); + wxLogTrace(wxT("sound"), wxT("closed audio")); m_audioOpen = false; } } @@ -278,7 +278,7 @@ bool wxSoundBackendSDL::Play(wxSoundData *data, unsigned flags, } SDL_LockAudio(); - wxLogTrace(_T("sound"), _T("playing new sound")); + wxLogTrace(wxT("sound"), wxT("playing new sound")); m_playing = true; m_pos = 0; m_loop = (flags & wxSOUND_LOOP); @@ -291,7 +291,7 @@ bool wxSoundBackendSDL::Play(wxSoundData *data, unsigned flags, // wait until playback finishes if called in sync mode: if (!(flags & wxSOUND_ASYNC)) { - wxLogTrace(_T("sound"), _T("waiting for sample to finish")); + wxLogTrace(wxT("sound"), wxT("waiting for sample to finish")); while (m_playing && m_data == data) { #if wxUSE_THREADS @@ -306,7 +306,7 @@ bool wxSoundBackendSDL::Play(wxSoundData *data, unsigned flags, wxMutexGuiEnter(); #endif } - wxLogTrace(_T("sound"), _T("sample finished")); + wxLogTrace(wxT("sound"), wxT("sample finished")); } return true; diff --git a/src/unix/stackwalk.cpp b/src/unix/stackwalk.cpp index d65700afa6..ad78765094 100644 --- a/src/unix/stackwalk.cpp +++ b/src/unix/stackwalk.cpp @@ -92,13 +92,13 @@ void wxStackFrame::OnGetName() // format is: "module(funcname+offset) [address]" but the part in // parentheses can be not present wxString syminfo = wxString::FromAscii(m_syminfo); - const size_t posOpen = syminfo.find(_T('(')); + const size_t posOpen = syminfo.find(wxT('(')); if ( posOpen != wxString::npos ) { - const size_t posPlus = syminfo.find(_T('+'), posOpen + 1); + const size_t posPlus = syminfo.find(wxT('+'), posOpen + 1); if ( posPlus != wxString::npos ) { - const size_t posClose = syminfo.find(_T(')'), posPlus + 1); + const size_t posClose = syminfo.find(wxT(')'), posPlus + 1); if ( posClose != wxString::npos ) { if ( m_name.empty() ) @@ -249,12 +249,12 @@ int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, cha name = wxString::FromAscii(g_buf); name.RemoveLast(); // trailing newline - if ( name == _T("??") ) + if ( name == wxT("??") ) name.clear(); } else { - wxLogDebug(_T("cannot read addr2line output for stack frame #%lu"), + wxLogDebug(wxT("cannot read addr2line output for stack frame #%lu"), (unsigned long)i); return false; } @@ -265,7 +265,7 @@ int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, cha filename = wxString::FromAscii(g_buf); filename.RemoveLast(); - const size_t posColon = filename.find(_T(':')); + const size_t posColon = filename.find(wxT(':')); if ( posColon != wxString::npos ) { // parse line number (it's ok if it fails, this will just leave @@ -274,13 +274,13 @@ int wxStackWalker::InitFrames(wxStackFrame *arr, size_t n, void **addresses, cha // remove line number from 'filename' filename.erase(posColon); - if ( filename == _T("??") ) + if ( filename == wxT("??") ) filename.clear(); } else { - wxLogDebug(_T("Unexpected addr2line format: \"%s\" - ") - _T("the semicolon is missing"), + wxLogDebug(wxT("Unexpected addr2line format: \"%s\" - ") + wxT("the semicolon is missing"), filename.c_str()); } } diff --git a/src/unix/stdpaths.cpp b/src/unix/stdpaths.cpp index 3749968cc9..a3ff34dff4 100644 --- a/src/unix/stdpaths.cpp +++ b/src/unix/stdpaths.cpp @@ -74,17 +74,17 @@ wxString wxStandardPaths::GetInstallPrefix() const wxString wxStandardPaths::GetConfigDir() const { - return _T("/sys$manager"); + return wxT("/sys$manager"); } wxString wxStandardPaths::GetDataDir() const { - return AppendAppInfo(GetInstallPrefix() + _T("/sys$share")); + return AppendAppInfo(GetInstallPrefix() + wxT("/sys$share")); } wxString wxStandardPaths::GetLocalDataDir() const { - return AppendAppInfo(_T("/sys$manager")); + return AppendAppInfo(wxT("/sys$manager")); } wxString wxStandardPaths::GetUserDataDir() const @@ -186,27 +186,27 @@ wxString wxStandardPaths::GetInstallPrefix() const wxString wxStandardPaths::GetConfigDir() const { - return _T("/etc"); + return wxT("/etc"); } wxString wxStandardPaths::GetDataDir() const { - return AppendAppInfo(GetInstallPrefix() + _T("/share")); + return AppendAppInfo(GetInstallPrefix() + wxT("/share")); } wxString wxStandardPaths::GetLocalDataDir() const { - return AppendAppInfo(_T("/etc")); + return AppendAppInfo(wxT("/etc")); } wxString wxStandardPaths::GetUserDataDir() const { - return AppendAppInfo(wxFileName::GetHomeDir() + _T("/.")); + return AppendAppInfo(wxFileName::GetHomeDir() + wxT("/.")); } wxString wxStandardPaths::GetPluginsDir() const { - return AppendAppInfo(GetInstallPrefix() + _T("/lib")); + return AppendAppInfo(GetInstallPrefix() + wxT("/lib")); } wxString @@ -216,7 +216,7 @@ wxStandardPaths::GetLocalizedResourcesDir(const wxString& lang, if ( category != ResourceCat_Messages ) return wxStandardPathsBase::GetLocalizedResourcesDir(lang, category); - return GetInstallPrefix() + _T("/share/locale/") + lang + _T("/LC_MESSAGES"); + return GetInstallPrefix() + wxT("/share/locale/") + lang + wxT("/LC_MESSAGES"); } wxString wxStandardPaths::GetDocumentsDir() const diff --git a/src/unix/taskbarx11.cpp b/src/unix/taskbarx11.cpp index 0978d60c1a..3b4ffeea54 100644 --- a/src/unix/taskbarx11.cpp +++ b/src/unix/taskbarx11.cpp @@ -52,7 +52,7 @@ { public: wxTaskBarIconAreaBase() - : wxFrame(NULL, wxID_ANY, _T("systray icon"), + : wxFrame(NULL, wxID_ANY, wxT("systray icon"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxFRAME_NO_TASKBAR | wxSIMPLE_BORDER | wxFRAME_SHAPED) {} @@ -122,8 +122,8 @@ wxTaskBarIconArea::wxTaskBarIconArea(wxTaskBarIcon *icon, const wxBitmap &bmp) if (!IsProtocolSupported()) { - wxLogTrace(_T("systray"), - _T("using legacy KDE1,2 and GNOME 1.2 methods")); + wxLogTrace(wxT("systray"), + wxT("using legacy KDE1,2 and GNOME 1.2 methods")); SetLegacyWMProperties(); } } @@ -190,7 +190,7 @@ void wxTaskBarIconArea::SetLegacyWMProperties() void wxTaskBarIconArea::OnSizeChange(wxSizeEvent& WXUNUSED(event)) { - wxLogTrace(_T("systray"), _T("icon size changed to %i x %i"), + wxLogTrace(wxT("systray"), wxT("icon size changed to %i x %i"), GetSize().x, GetSize().y); // rescale or reposition the icon as needed: wxBitmap bmp(m_bmp); diff --git a/src/unix/threadpsx.cpp b/src/unix/threadpsx.cpp index 1b7248d98a..9c1afb98de 100644 --- a/src/unix/threadpsx.cpp +++ b/src/unix/threadpsx.cpp @@ -84,10 +84,10 @@ enum wxThreadState static const wxThread::ExitCode EXITCODE_CANCELLED = (wxThread::ExitCode)-1; // trace mask for wxThread operations -#define TRACE_THREADS _T("thread") +#define TRACE_THREADS wxT("thread") // you can get additional debugging messages for the semaphore operations -#define TRACE_SEMA _T("semaphore") +#define TRACE_SEMA wxT("semaphore") // ---------------------------------------------------------------------------- // private functions @@ -232,7 +232,7 @@ wxMutexInternal::wxMutexInternal(wxMutexType mutexType) break; default: - wxFAIL_MSG( _T("unknown mutex type") ); + wxFAIL_MSG( wxT("unknown mutex type") ); // fall through case wxMUTEX_DEFAULT: @@ -329,11 +329,11 @@ wxMutexError wxMutexInternal::HandleLockResult(int err) case EDEADLK: // only error checking mutexes return this value and so it's an // unexpected situation -- hence use assert, not wxLogDebug - wxFAIL_MSG( _T("mutex deadlock prevented") ); + wxFAIL_MSG( wxT("mutex deadlock prevented") ); return wxMUTEX_DEAD_LOCK; case EINVAL: - wxLogDebug(_T("pthread_mutex_[timed]lock(): mutex not initialized")); + wxLogDebug(wxT("pthread_mutex_[timed]lock(): mutex not initialized")); break; case ETIMEDOUT: @@ -345,7 +345,7 @@ wxMutexError wxMutexInternal::HandleLockResult(int err) return wxMUTEX_NO_ERROR; default: - wxLogApiError(_T("pthread_mutex_[timed]lock()"), err); + wxLogApiError(wxT("pthread_mutex_[timed]lock()"), err); } return wxMUTEX_MISC_ERROR; @@ -363,7 +363,7 @@ wxMutexError wxMutexInternal::TryLock() return wxMUTEX_BUSY; case EINVAL: - wxLogDebug(_T("pthread_mutex_trylock(): mutex not initialized.")); + wxLogDebug(wxT("pthread_mutex_trylock(): mutex not initialized.")); break; case 0: @@ -372,7 +372,7 @@ wxMutexError wxMutexInternal::TryLock() return wxMUTEX_NO_ERROR; default: - wxLogApiError(_T("pthread_mutex_trylock()"), err); + wxLogApiError(wxT("pthread_mutex_trylock()"), err); } return wxMUTEX_MISC_ERROR; @@ -390,14 +390,14 @@ wxMutexError wxMutexInternal::Unlock() return wxMUTEX_UNLOCKED; case EINVAL: - wxLogDebug(_T("pthread_mutex_unlock(): mutex not initialized.")); + wxLogDebug(wxT("pthread_mutex_unlock(): mutex not initialized.")); break; case 0: return wxMUTEX_NO_ERROR; default: - wxLogApiError(_T("pthread_mutex_unlock()"), err); + wxLogApiError(wxT("pthread_mutex_unlock()"), err); } return wxMUTEX_MISC_ERROR; @@ -446,7 +446,7 @@ wxConditionInternal::wxConditionInternal(wxMutex& mutex) if ( !m_isOk ) { - wxLogApiError(_T("pthread_cond_init()"), err); + wxLogApiError(wxT("pthread_cond_init()"), err); } } @@ -457,7 +457,7 @@ wxConditionInternal::~wxConditionInternal() int err = pthread_cond_destroy(&m_cond); if ( err != 0 ) { - wxLogApiError(_T("pthread_cond_destroy()"), err); + wxLogApiError(wxT("pthread_cond_destroy()"), err); } } } @@ -467,7 +467,7 @@ wxCondError wxConditionInternal::Wait() int err = pthread_cond_wait(&m_cond, GetPMutex()); if ( err != 0 ) { - wxLogApiError(_T("pthread_cond_wait()"), err); + wxLogApiError(wxT("pthread_cond_wait()"), err); return wxCOND_MISC_ERROR; } @@ -500,7 +500,7 @@ wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds) return wxCOND_NO_ERROR; default: - wxLogApiError(_T("pthread_cond_timedwait()"), err); + wxLogApiError(wxT("pthread_cond_timedwait()"), err); } return wxCOND_MISC_ERROR; @@ -511,7 +511,7 @@ wxCondError wxConditionInternal::Signal() int err = pthread_cond_signal(&m_cond); if ( err != 0 ) { - wxLogApiError(_T("pthread_cond_signal()"), err); + wxLogApiError(wxT("pthread_cond_signal()"), err); return wxCOND_MISC_ERROR; } @@ -524,7 +524,7 @@ wxCondError wxConditionInternal::Broadcast() int err = pthread_cond_broadcast(&m_cond); if ( err != 0 ) { - wxLogApiError(_T("pthread_cond_broadcast()"), err); + wxLogApiError(wxT("pthread_cond_broadcast()"), err); return wxCOND_MISC_ERROR; } @@ -573,7 +573,7 @@ wxSemaphoreInternal::wxSemaphoreInternal(int initialcount, int maxcount) if ( (initialcount < 0 || maxcount < 0) || ((maxcount > 0) && (initialcount > maxcount)) ) { - wxFAIL_MSG( _T("wxSemaphore: invalid initial or maximal count") ); + wxFAIL_MSG( wxT("wxSemaphore: invalid initial or maximal count") ); m_isOk = false; } @@ -593,14 +593,14 @@ wxSemaError wxSemaphoreInternal::Wait() while ( m_count == 0 ) { wxLogTrace(TRACE_SEMA, - _T("Thread %p waiting for semaphore to become signalled"), + wxT("Thread %p waiting for semaphore to become signalled"), wxThread::GetCurrentId()); if ( m_cond.Wait() != wxCOND_NO_ERROR ) return wxSEMA_MISC_ERROR; wxLogTrace(TRACE_SEMA, - _T("Thread %p finished waiting for semaphore, count = %lu"), + wxT("Thread %p finished waiting for semaphore, count = %lu"), wxThread::GetCurrentId(), (unsigned long)m_count); } @@ -667,7 +667,7 @@ wxSemaError wxSemaphoreInternal::Post() m_count++; wxLogTrace(TRACE_SEMA, - _T("Thread %p about to signal semaphore, count = %lu"), + wxT("Thread %p about to signal semaphore, count = %lu"), wxThread::GetCurrentId(), (unsigned long)m_count); return m_cond.Signal() == wxCOND_NO_ERROR ? wxSEMA_NO_ERROR @@ -727,13 +727,13 @@ public: #if wxUSE_LOG_TRACE static const wxChar *stateNames[] = { - _T("NEW"), - _T("RUNNING"), - _T("PAUSED"), - _T("EXITED"), + wxT("NEW"), + wxT("RUNNING"), + wxT("PAUSED"), + wxT("EXITED"), }; - wxLogTrace(TRACE_THREADS, _T("Thread %p: %s => %s."), + wxLogTrace(TRACE_THREADS, wxT("Thread %p: %s => %s."), GetId(), stateNames[m_state], stateNames[state]); #endif // wxUSE_LOG_TRACE @@ -810,7 +810,7 @@ void *wxThreadInternal::PthreadStart(wxThread *thread) { wxThreadInternal *pthread = thread->m_internal; - wxLogTrace(TRACE_THREADS, _T("Thread %p started."), THR_ID(pthread)); + wxLogTrace(TRACE_THREADS, wxT("Thread %p started."), THR_ID(pthread)); // associate the thread pointer with the newly created thread so that // wxThread::This() will work @@ -848,7 +848,7 @@ void *wxThreadInternal::PthreadStart(wxThread *thread) { // call the main entry wxLogTrace(TRACE_THREADS, - _T("Thread %p about to enter its Entry()."), + wxT("Thread %p about to enter its Entry()."), THR_ID(pthread)); wxTRY @@ -856,7 +856,7 @@ void *wxThreadInternal::PthreadStart(wxThread *thread) pthread->m_exitcode = thread->Entry(); wxLogTrace(TRACE_THREADS, - _T("Thread %p Entry() returned %lu."), + wxT("Thread %p Entry() returned %lu."), THR_ID(pthread), wxPtrToUInt(pthread->m_exitcode)); } wxCATCH_ALL( wxTheApp->OnUnhandledException(); ) @@ -971,7 +971,7 @@ wxThreadError wxThreadInternal::Run() void wxThreadInternal::Wait() { - wxCHECK_RET( !m_isDetached, _T("can't wait for a detached thread") ); + wxCHECK_RET( !m_isDetached, wxT("can't wait for a detached thread") ); // if the thread we're waiting for is waiting for the GUI mutex, we will // deadlock so make sure we release it temporarily @@ -979,7 +979,7 @@ void wxThreadInternal::Wait() wxMutexGuiLeave(); wxLogTrace(TRACE_THREADS, - _T("Starting to wait for thread %p to exit."), + wxT("Starting to wait for thread %p to exit."), THR_ID(this)); // to avoid memory leaks we should call pthread_join(), but it must only be @@ -1019,7 +1019,7 @@ void wxThreadInternal::Pause() wxT("thread must first be paused with wxThread::Pause().") ); wxLogTrace(TRACE_THREADS, - _T("Thread %p goes to sleep."), THR_ID(this)); + wxT("Thread %p goes to sleep."), THR_ID(this)); // wait until the semaphore is Post()ed from Resume() m_semSuspend.Wait(); @@ -1035,7 +1035,7 @@ void wxThreadInternal::Resume() if ( IsReallyPaused() ) { wxLogTrace(TRACE_THREADS, - _T("Waking up thread %p"), THR_ID(this)); + wxT("Waking up thread %p"), THR_ID(this)); // wake up Pause() m_semSuspend.Post(); @@ -1046,7 +1046,7 @@ void wxThreadInternal::Resume() else { wxLogTrace(TRACE_THREADS, - _T("Thread %p is not yet really paused"), THR_ID(this)); + wxT("Thread %p is not yet really paused"), THR_ID(this)); } SetState(STATE_RUNNING); @@ -1082,7 +1082,7 @@ int wxThread::GetCPUCount() // it has 0 size but still can be read from) wxLogNull nolog; - wxFFile file(_T("/proc/cpuinfo")); + wxFFile file(wxT("/proc/cpuinfo")); if ( file.IsOpened() ) { // slurp the whole file @@ -1090,17 +1090,17 @@ int wxThread::GetCPUCount() if ( file.ReadAll(&s) ) { // (ab)use Replace() to find the number of "processor: num" strings - size_t count = s.Replace(_T("processor\t:"), _T("")); + size_t count = s.Replace(wxT("processor\t:"), wxT("")); if ( count > 0 ) { return count; } - wxLogDebug(_T("failed to parse /proc/cpuinfo")); + wxLogDebug(wxT("failed to parse /proc/cpuinfo")); } else { - wxLogDebug(_T("failed to read /proc/cpuinfo")); + wxLogDebug(wxT("failed to read /proc/cpuinfo")); } } #endif // different ways to get number of CPUs @@ -1121,7 +1121,7 @@ bool wxThread::SetConcurrency(size_t level) int rc = thr_setconcurrency(level); if ( rc != 0 ) { - wxLogSysError(rc, _T("thr_setconcurrency() failed")); + wxLogSysError(rc, wxT("thr_setconcurrency() failed")); } return rc == 0; @@ -1214,14 +1214,14 @@ wxThreadError wxThread::Create(unsigned int WXUNUSED_STACKSIZE(stackSize)) struct sched_param sp; if ( pthread_attr_getschedparam(&attr, &sp) != 0 ) { - wxFAIL_MSG(_T("pthread_attr_getschedparam() failed")); + wxFAIL_MSG(wxT("pthread_attr_getschedparam() failed")); } sp.sched_priority = min_prio + (prio*(max_prio - min_prio))/100; if ( pthread_attr_setschedparam(&attr, &sp) != 0 ) { - wxFAIL_MSG(_T("pthread_attr_setschedparam(priority) failed")); + wxFAIL_MSG(wxT("pthread_attr_setschedparam(priority) failed")); } } #endif // HAVE_THREAD_PRIORITY_FUNCTIONS @@ -1230,7 +1230,7 @@ wxThreadError wxThread::Create(unsigned int WXUNUSED_STACKSIZE(stackSize)) // this will make the threads created by this process really concurrent if ( pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) != 0 ) { - wxFAIL_MSG(_T("pthread_attr_setscope(PTHREAD_SCOPE_SYSTEM) failed")); + wxFAIL_MSG(wxT("pthread_attr_setscope(PTHREAD_SCOPE_SYSTEM) failed")); } #endif // HAVE_PTHREAD_ATTR_SETSCOPE @@ -1241,7 +1241,7 @@ wxThreadError wxThread::Create(unsigned int WXUNUSED_STACKSIZE(stackSize)) { if ( pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED) != 0 ) { - wxFAIL_MSG(_T("pthread_attr_setdetachstate(DETACHED) failed")); + wxFAIL_MSG(wxT("pthread_attr_setdetachstate(DETACHED) failed")); } // never try to join detached threads @@ -1260,7 +1260,7 @@ wxThreadError wxThread::Create(unsigned int WXUNUSED_STACKSIZE(stackSize)) if ( pthread_attr_destroy(&attr) != 0 ) { - wxFAIL_MSG(_T("pthread_attr_destroy() failed")); + wxFAIL_MSG(wxT("pthread_attr_destroy() failed")); } if ( rc != 0 ) @@ -1362,7 +1362,7 @@ wxThreadIdType wxThread::GetId() const wxThreadError wxThread::Pause() { wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR, - _T("a thread can't pause itself") ); + wxT("a thread can't pause itself") ); wxCriticalSectionLocker lock(m_critsect); @@ -1383,7 +1383,7 @@ wxThreadError wxThread::Pause() wxThreadError wxThread::Resume() { wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR, - _T("a thread can't resume itself") ); + wxT("a thread can't resume itself") ); wxCriticalSectionLocker lock(m_critsect); @@ -1392,7 +1392,7 @@ wxThreadError wxThread::Resume() switch ( state ) { case STATE_PAUSED: - wxLogTrace(TRACE_THREADS, _T("Thread %p suspended, resuming."), + wxLogTrace(TRACE_THREADS, wxT("Thread %p suspended, resuming."), GetId()); m_internal->Resume(); @@ -1400,12 +1400,12 @@ wxThreadError wxThread::Resume() return wxTHREAD_NO_ERROR; case STATE_EXITED: - wxLogTrace(TRACE_THREADS, _T("Thread %p exited, won't resume."), + wxLogTrace(TRACE_THREADS, wxT("Thread %p exited, won't resume."), GetId()); return wxTHREAD_NO_ERROR; default: - wxLogDebug(_T("Attempt to resume a thread which is not paused.")); + wxLogDebug(wxT("Attempt to resume a thread which is not paused.")); return wxTHREAD_MISC_ERROR; } @@ -1418,10 +1418,10 @@ wxThreadError wxThread::Resume() wxThread::ExitCode wxThread::Wait() { wxCHECK_MSG( This() != this, (ExitCode)-1, - _T("a thread can't wait for itself") ); + wxT("a thread can't wait for itself") ); wxCHECK_MSG( !m_isDetached, (ExitCode)-1, - _T("can't wait for detached thread") ); + wxT("can't wait for detached thread") ); m_internal->Wait(); @@ -1431,7 +1431,7 @@ wxThread::ExitCode wxThread::Wait() wxThreadError wxThread::Delete(ExitCode *rc) { wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR, - _T("a thread can't delete itself") ); + wxT("a thread can't delete itself") ); bool isDetached = m_isDetached; @@ -1484,7 +1484,7 @@ wxThreadError wxThread::Delete(ExitCode *rc) wxThreadError wxThread::Kill() { wxCHECK_MSG( This() != this, wxTHREAD_MISC_ERROR, - _T("a thread can't kill itself") ); + wxT("a thread can't kill itself") ); switch ( m_internal->GetState() ) { @@ -1535,7 +1535,7 @@ wxThreadError wxThread::Kill() void wxThread::Exit(ExitCode status) { wxASSERT_MSG( This() == this, - _T("wxThread::Exit() can only be called in the context of the same thread") ); + wxT("wxThread::Exit() can only be called in the context of the same thread") ); if ( m_isDetached ) { @@ -1578,14 +1578,14 @@ void wxThread::Exit(ExitCode status) // terminate the thread (pthread_exit() never returns) pthread_exit(status); - wxFAIL_MSG(_T("pthread_exit() failed")); + wxFAIL_MSG(wxT("pthread_exit() failed")); } // also test whether we were paused bool wxThread::TestDestroy() { wxASSERT_MSG( This() == this, - _T("wxThread::TestDestroy() can only be called in the context of the same thread") ); + wxT("wxThread::TestDestroy() can only be called in the context of the same thread") ); m_critsect.Enter(); @@ -1617,7 +1617,7 @@ wxThread::~wxThread() if ( m_internal->GetState() != STATE_EXITED && m_internal->GetState() != STATE_NEW ) { - wxLogDebug(_T("The thread %ld is being destroyed although it is still running! The application may crash."), + wxLogDebug(wxT("The thread %ld is being destroyed although it is still running! The application may crash."), (long)GetId()); } @@ -1719,7 +1719,7 @@ void wxThreadModule::OnExit() if ( nThreadsBeingDeleted > 0 ) { wxLogTrace(TRACE_THREADS, - _T("Waiting for %lu threads to disappear"), + wxT("Waiting for %lu threads to disappear"), (unsigned long)nThreadsBeingDeleted); // have to wait until all of them disappear @@ -1771,9 +1771,9 @@ static void ScheduleThreadForDeletion() gs_nThreadsBeingDeleted++; - wxLogTrace(TRACE_THREADS, _T("%lu thread%s waiting to be deleted"), + wxLogTrace(TRACE_THREADS, wxT("%lu thread%s waiting to be deleted"), (unsigned long)gs_nThreadsBeingDeleted, - gs_nThreadsBeingDeleted == 1 ? _T("") : _T("s")); + gs_nThreadsBeingDeleted == 1 ? wxT("") : wxT("s")); } static void DeleteThread(wxThread *This) @@ -1782,14 +1782,14 @@ static void DeleteThread(wxThread *This) // or wxThreadModule::OnExit() would deadlock wxMutexLocker locker( *gs_mutexDeleteThread ); - wxLogTrace(TRACE_THREADS, _T("Thread %p auto deletes."), This->GetId()); + wxLogTrace(TRACE_THREADS, wxT("Thread %p auto deletes."), This->GetId()); delete This; wxCHECK_RET( gs_nThreadsBeingDeleted > 0, - _T("no threads scheduled for deletion, yet we delete one?") ); + wxT("no threads scheduled for deletion, yet we delete one?") ); - wxLogTrace(TRACE_THREADS, _T("%lu threads remain scheduled for deletion."), + wxLogTrace(TRACE_THREADS, wxT("%lu threads remain scheduled for deletion."), (unsigned long)gs_nThreadsBeingDeleted - 1); if ( !--gs_nThreadsBeingDeleted ) diff --git a/src/unix/timerunx.cpp b/src/unix/timerunx.cpp index bcdebf9167..eb2c4e02b1 100644 --- a/src/unix/timerunx.cpp +++ b/src/unix/timerunx.cpp @@ -54,7 +54,7 @@ static inline wxString wxUsecClockAsString(wxUsecClock_t usec) #if wxUSE_LONGLONG return usec.ToString(); #else // wxUsecClock_t == double - return wxString::Format(_T("%.0f"), usec); + return wxString::Format(wxT("%.0f"), usec); #endif } @@ -86,7 +86,7 @@ void wxTimerScheduler::DoAddTimer(wxTimerSchedule *s) for ( node = m_timers.begin(); node != m_timers.end(); ++node ) { wxASSERT_MSG( (*node)->m_timer != s->m_timer, - _T("adding the same timer twice?") ); + wxT("adding the same timer twice?") ); if ( (*node)->m_expiration > s->m_expiration ) break; @@ -115,7 +115,7 @@ void wxTimerScheduler::RemoveTimer(wxUnixTimerImpl *timer) } } - wxFAIL_MSG( _T("removing inexistent timer?") ); + wxFAIL_MSG( wxT("removing inexistent timer?") ); } bool wxTimerScheduler::GetNext(wxUsecClock_t *remaining) const @@ -123,7 +123,7 @@ bool wxTimerScheduler::GetNext(wxUsecClock_t *remaining) const if ( m_timers.empty() ) return false; - wxCHECK_MSG( remaining, false, _T("NULL pointer") ); + wxCHECK_MSG( remaining, false, wxT("NULL pointer") ); *remaining = (*m_timers.begin())->m_expiration - wxGetLocalTimeUsec(); if ( *remaining < 0 ) @@ -241,7 +241,7 @@ bool wxUnixTimerImpl::IsRunning() const wxUnixTimerImpl::~wxUnixTimerImpl() { - wxASSERT_MSG( !m_isRunning, _T("must have been stopped before") ); + wxASSERT_MSG( !m_isRunning, wxT("must have been stopped before") ); } // ============================================================================ diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 3153216e62..7394cc50e6 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -255,7 +255,7 @@ int wxKill(long pid, wxSignal sig, wxKillError *rc, int flags) default: // this goes against Unix98 docs so log it - wxLogDebug(_T("unexpected kill(2) return value %d"), err); + wxLogDebug(wxT("unexpected kill(2) return value %d"), err); // something else... *rc = wxKILL_ERROR; @@ -274,11 +274,11 @@ bool wxShutdown(int flags) switch ( flags ) { case wxSHUTDOWN_POWEROFF: - level = _T('0'); + level = wxT('0'); break; case wxSHUTDOWN_REBOOT: - level = _T('6'); + level = wxT('6'); break; case wxSHUTDOWN_LOGOFF: @@ -286,7 +286,7 @@ bool wxShutdown(int flags) return false; default: - wxFAIL_MSG( _T("unknown wxShutdown() flag") ); + wxFAIL_MSG( wxT("unknown wxShutdown() flag") ); return false; } @@ -326,7 +326,7 @@ bool wxPipeInputStream::CanRead() const return false; default: - wxFAIL_MSG(_T("unexpected select() return value")); + wxFAIL_MSG(wxT("unexpected select() return value")); // still fall through case 1: @@ -349,12 +349,12 @@ static wxString wxMakeShellCommand(const wxString& command) if ( !command ) { // just an interactive shell - cmd = _T("xterm"); + cmd = wxT("xterm"); } else { // execute command in a shell - cmd << _T("/bin/sh -c '") << command << _T('\''); + cmd << wxT("/bin/sh -c '") << command << wxT('\''); } return cmd; @@ -367,7 +367,7 @@ bool wxShell(const wxString& command) bool wxShell(const wxString& command, wxArrayString& output) { - wxCHECK_MSG( !command.empty(), false, _T("can't exec shell non interactively") ); + wxCHECK_MSG( !command.empty(), false, wxT("can't exec shell non interactively") ); return wxExecute(wxMakeShellCommand(command), output); } @@ -480,7 +480,7 @@ long wxExecute(char **argv, int flags, wxProcess *process) // don't know what yet, so for now just warn the user (this is the least we // can do) about it wxASSERT_MSG( wxThread::IsMain(), - _T("wxExecute() can be called only from the main thread") ); + wxT("wxExecute() can be called only from the main thread") ); #endif // wxUSE_THREADS #if defined(__WXCOCOA__) || ( defined(__WXOSX_MAC__) && wxOSX_USE_COCOA_OR_CARBON ) @@ -722,7 +722,7 @@ static wxString wxGetCommandOutput(const wxString &cmd) FILE *f = popen(cmd.ToAscii(), "r"); if ( !f ) { - wxLogSysError(_T("Executing \"%s\" failed"), cmd.c_str()); + wxLogSysError(wxT("Executing \"%s\" failed"), cmd.c_str()); return wxEmptyString; } @@ -738,7 +738,7 @@ static wxString wxGetCommandOutput(const wxString &cmd) pclose(f); - if ( !s.empty() && s.Last() == _T('\n') ) + if ( !s.empty() && s.Last() == wxT('\n') ) s.RemoveLast(); return s; @@ -1095,7 +1095,7 @@ static bool wxDoSetEnv(const wxString& variable, const char *value) #elif defined(HAVE_PUTENV) wxString s = variable; if ( value ) - s << _T('=') << value; + s << wxT('=') << value; // transform to ANSI const wxWX2MBbuf p = s.mb_str(); @@ -1178,7 +1178,7 @@ bool wxHandleFatalExceptions(bool doit) ok &= sigaction(SIGSEGV, &act, &s_handlerSEGV) == 0; if ( !ok ) { - wxLogDebug(_T("Failed to install our signal handler.")); + wxLogDebug(wxT("Failed to install our signal handler.")); } s_savedHandlers = true; @@ -1192,7 +1192,7 @@ bool wxHandleFatalExceptions(bool doit) ok &= sigaction(SIGSEGV, &s_handlerSEGV, NULL) == 0; if ( !ok ) { - wxLogDebug(_T("Failed to uninstall our signal handler.")); + wxLogDebug(wxT("Failed to uninstall our signal handler.")); } s_savedHandlers = false; diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp index b9b5a4d40e..25f61e1017 100644 --- a/src/unix/utilsx11.cpp +++ b/src/unix/utilsx11.cpp @@ -478,8 +478,8 @@ wxX11FullScreenMethod wxGetFullScreenMethodX11(WXDisplay* display, wxMAKE_ATOM(_NET_WM_STATE_FULLSCREEN, disp); if (wxQueryWMspecSupport(disp, root, _NET_WM_STATE_FULLSCREEN)) { - wxLogTrace(_T("fullscreen"), - _T("detected _NET_WM_STATE_FULLSCREEN support")); + wxLogTrace(wxT("fullscreen"), + wxT("detected _NET_WM_STATE_FULLSCREEN support")); return wxX11_FS_WMSPEC; } @@ -487,12 +487,12 @@ wxX11FullScreenMethod wxGetFullScreenMethodX11(WXDisplay* display, // kwin doesn't understand any other method: if (wxKwinRunning(disp, root)) { - wxLogTrace(_T("fullscreen"), _T("detected kwin")); + wxLogTrace(wxT("fullscreen"), wxT("detected kwin")); return wxX11_FS_KDE; } // finally, fall back to ICCCM heuristic method: - wxLogTrace(_T("fullscreen"), _T("unknown WM, using _WIN_LAYER")); + wxLogTrace(wxT("fullscreen"), wxT("unknown WM, using _WIN_LAYER")); return wxX11_FS_GENERIC; } @@ -823,7 +823,7 @@ bool wxGetKeyState(wxKeyCode key) if ( IsModifierKey(iKey) ) // If iKey is a modifier key, use a different method { XModifierKeymap *map = XGetModifierMapping(pDisplay); - wxCHECK_MSG( map, false, _T("failed to get X11 modifiers map") ); + wxCHECK_MSG( map, false, wxT("failed to get X11 modifiers map") ); for (int i = 0; i < 8; ++i) { @@ -910,7 +910,7 @@ bool wxDoLaunchDefaultBrowser(const wxString& url, int flags) if (res >= 0 && errors.GetCount() == 0) { wxString cmd = output[0]; - cmd << _T(' ') << url; + cmd << wxT(' ') << url; if (wxExecute(cmd)) return true; } diff --git a/src/x11/app.cpp b/src/x11/app.cpp index d89eccaf21..d2b9c0b3bf 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -98,7 +98,7 @@ bool wxApp::Initialize(int& argC, wxChar **argV) int argCOrig = argC; for ( int i = 0; i < argCOrig; i++ ) { - if (wxStrcmp( argV[i], _T("-display") ) == 0) + if (wxStrcmp( argV[i], wxT("-display") ) == 0) { if (i < (argC - 1)) { @@ -110,14 +110,14 @@ bool wxApp::Initialize(int& argC, wxChar **argV) argC -= 2; } } - else if (wxStrcmp( argV[i], _T("-geometry") ) == 0) + else if (wxStrcmp( argV[i], wxT("-geometry") ) == 0) { if (i < (argC - 1)) { argV[i++] = NULL; int w, h; - if (wxSscanf(argV[i], _T("%dx%d"), &w, &h) != 2) + if (wxSscanf(argV[i], wxT("%dx%d"), &w, &h) != 2) { wxLogError( _("Invalid geometry specification '%s'"), wxString(argV[i]).c_str() ); @@ -131,14 +131,14 @@ bool wxApp::Initialize(int& argC, wxChar **argV) argC -= 2; } } - else if (wxStrcmp( argV[i], _T("-sync") ) == 0) + else if (wxStrcmp( argV[i], wxT("-sync") ) == 0) { syncDisplay = true; argV[i] = NULL; argC--; } - else if (wxStrcmp( argV[i], _T("-iconic") ) == 0) + else if (wxStrcmp( argV[i], wxT("-iconic") ) == 0) { g_showIconic = true; @@ -354,7 +354,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) #if !wxUSE_NANOX case GraphicsExpose: { - wxLogTrace( _T("expose"), _T("GraphicsExpose from %s"), win->GetName().c_str()); + wxLogTrace( wxT("expose"), wxT("GraphicsExpose from %s"), win->GetName().c_str()); win->GetUpdateRegion().Union( event->xgraphicsexpose.x, event->xgraphicsexpose.y, event->xgraphicsexpose.width, event->xgraphicsexpose.height); @@ -541,7 +541,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) g_prevFocus = wxWindow::FindFocus(); g_nextFocus = win; - wxLogTrace( _T("focus"), _T("About to call SetFocus on %s of type %s due to button press"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); + wxLogTrace( wxT("focus"), wxT("About to call SetFocus on %s of type %s due to button press"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); // Record the fact that this window is // getting the focus, because we'll need to @@ -572,7 +572,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) (event->xfocus.mode == NotifyNormal)) #endif { - wxLogTrace( _T("focus"), _T("FocusIn from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); + wxLogTrace( wxT("focus"), wxT("FocusIn from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); extern wxWindow* g_GettingFocus; if (g_GettingFocus && g_GettingFocus->GetParent() == win) @@ -580,7 +580,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) // Ignore this, this can be a spurious FocusIn // caused by a child having its focus set. g_GettingFocus = NULL; - wxLogTrace( _T("focus"), _T("FocusIn from %s of type %s being deliberately ignored"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); + wxLogTrace( wxT("focus"), wxT("FocusIn from %s of type %s being deliberately ignored"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); return true; } else @@ -601,7 +601,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) (event->xfocus.mode == NotifyNormal)) #endif { - wxLogTrace( _T("focus"), _T("FocusOut from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); + wxLogTrace( wxT("focus"), wxT("FocusOut from %s of type %s"), win->GetName().c_str(), win->GetClassInfo()->GetClassName() ); wxFocusEvent focusEvent(wxEVT_KILL_FOCUS, win->GetId()); focusEvent.SetEventObject(win); @@ -718,7 +718,7 @@ WXColormap wxApp::GetMainColormap(WXDisplay* display) Window wxGetWindowParent(Window window) { - wxASSERT_MSG( window, _T("invalid window") ); + wxASSERT_MSG( window, wxT("invalid window") ); return (Window) 0; diff --git a/src/x11/brush.cpp b/src/x11/brush.cpp index 71046981e4..25192ebb53 100644 --- a/src/x11/brush.cpp +++ b/src/x11/brush.cpp @@ -112,21 +112,21 @@ bool wxBrush::operator == ( const wxBrush& brush ) const wxBrushStyle wxBrush::GetStyle() const { - wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxBRUSHSTYLE_INVALID, wxT("invalid brush") ); return M_BRUSHDATA->m_style; } wxColour wxBrush::GetColour() const { - wxCHECK_MSG( Ok(), wxNullColour, _T("invalid brush") ); + wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid brush") ); return M_BRUSHDATA->m_colour; } wxBitmap *wxBrush::GetStipple() const { - wxCHECK_MSG( Ok(), NULL, _T("invalid brush") ); + wxCHECK_MSG( Ok(), NULL, wxT("invalid brush") ); return &M_BRUSHDATA->m_stipple; } diff --git a/src/x11/clipbrd.cpp b/src/x11/clipbrd.cpp index f5747e507d..13af47b6e8 100644 --- a/src/x11/clipbrd.cpp +++ b/src/x11/clipbrd.cpp @@ -39,7 +39,7 @@ Atom g_targetsAtom = 0; // the trace mask we use with wxLogTrace() - call // wxLog::AddTraceMask(TRACE_CLIPBOARD) to enable the trace messages from here // (there will be a *lot* of them!) -static const wxChar *TRACE_CLIPBOARD = _T("clipboard"); +static const wxChar *TRACE_CLIPBOARD = wxT("clipboard"); #endif // __WXDEBUG__ @@ -91,7 +91,7 @@ targets_selection_received( GtkWidget *WXUNUSED(widget), if ( strcmp(gdk_atom_name(type), "TARGETS") ) { wxLogTrace( TRACE_CLIPBOARD, - _T("got unsupported clipboard target") ); + wxT("got unsupported clipboard target") ); clipboard->m_waiting = false; return; diff --git a/src/x11/dataobj.cpp b/src/x11/dataobj.cpp index b9b8f7a37d..88de745710 100644 --- a/src/x11/dataobj.cpp +++ b/src/x11/dataobj.cpp @@ -243,12 +243,12 @@ bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf) if ( (*p == '\r' && *(p+1) == '\n') || !*p ) { size_t lenPrefix = 5; // strlen("file:") - if ( filename.Left(lenPrefix).MakeLower() == _T("file:") ) + if ( filename.Left(lenPrefix).MakeLower() == wxT("file:") ) { // sometimes the syntax is "file:filename", sometimes it's // URL-like: "file://filename" - deal with both - if ( filename[lenPrefix] == _T('/') && - filename[lenPrefix + 1] == _T('/') ) + if ( filename[lenPrefix] == wxT('/') && + filename[lenPrefix + 1] == wxT('/') ) { // skip the slashes lenPrefix += 2; @@ -259,7 +259,7 @@ bool wxFileDataObject::SetData(size_t WXUNUSED(size), const void *buf) } else { - wxLogDebug(_T("Unsupported URI '%s' in wxFileDataObject"), + wxLogDebug(wxT("Unsupported URI '%s' in wxFileDataObject"), filename.c_str()); } diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 8f61035cf9..dfe17e7020 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -345,7 +345,7 @@ void wxWindowDCImpl::SetUpDC() void wxWindowDCImpl::DoGetSize( int* width, int* height ) const { - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); + wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") ); m_window->GetSize(width, height); } @@ -2351,7 +2351,7 @@ IMPLEMENT_ABSTRACT_CLASS(wxClientDCImpl, wxWindowDCImpl) wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) : wxWindowDCImpl( owner, window ) { - wxCHECK_RET( window, _T("NULL window in wxClientDC::wxClientDC") ); + wxCHECK_RET( window, wxT("NULL window in wxClientDC::wxClientDC") ); m_x11window = (WXWindow*) window->GetClientAreaWindow(); @@ -2367,7 +2367,7 @@ wxClientDCImpl::wxClientDCImpl( wxDC *owner, wxWindow *window ) void wxClientDCImpl::DoGetSize(int *width, int *height) const { - wxCHECK_RET( m_window, _T("GetSize() doesn't work without window") ); + wxCHECK_RET( m_window, wxT("GetSize() doesn't work without window") ); m_window->GetClientSize( width, height ); } @@ -2410,7 +2410,7 @@ public: // display wxDCModule() { - AddDependency(wxClassInfo::FindClass(_T("wxX11DisplayModule"))); + AddDependency(wxClassInfo::FindClass(wxT("wxX11DisplayModule"))); } bool OnInit() { wxInitGCPool(); return true; } diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index bfcf4917af..5e139fe8cc 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -122,13 +122,13 @@ bool wxEventLoopImpl::SendIdleEvent() wxGUIEventLoop::~wxGUIEventLoop() { - wxASSERT_MSG( !m_impl, _T("should have been deleted in Run()") ); + wxASSERT_MSG( !m_impl, wxT("should have been deleted in Run()") ); } int wxGUIEventLoop::Run() { // event loops are not recursive, you need to create another loop! - wxCHECK_MSG( !IsRunning(), -1, _T("can't reenter a message loop") ); + wxCHECK_MSG( !IsRunning(), -1, wxT("can't reenter a message loop") ); m_impl = new wxEventLoopImpl; @@ -170,7 +170,7 @@ int wxGUIEventLoop::Run() void wxGUIEventLoop::Exit(int rc) { - wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); + wxCHECK_RET( IsRunning(), wxT("can't call Exit() if not running") ); m_impl->SetExitCode(rc); m_impl->m_keepGoing = false; diff --git a/src/x11/font.cpp b/src/x11/font.cpp index 7e3ec5f6dc..a15a76418a 100644 --- a/src/x11/font.cpp +++ b/src/x11/font.cpp @@ -267,7 +267,7 @@ void wxFontRefData::InitFromNative() break; default: - wxFAIL_MSG(_T("unknown Pango font weight")); + wxFAIL_MSG(wxT("unknown Pango font weight")); // fall through case PANGO_WEIGHT_NORMAL: @@ -309,17 +309,17 @@ void wxFontRefData::InitFromNative() m_weight = wxFONTWEIGHT_NORMAL; wxString w = m_nativeFontInfo.GetXFontComponent(wxXLFD_WEIGHT).Upper(); - if ( !w.empty() && w != _T('*') ) + if ( !w.empty() && w != wxT('*') ) { // the test below catches all of BOLD, EXTRABOLD, DEMIBOLD, ULTRABOLD // and BLACK - if ( ((w[0u] == _T('B') && (!wxStrcmp(w.c_str() + 1, wxT("OLD")) || + if ( ((w[0u] == wxT('B') && (!wxStrcmp(w.c_str() + 1, wxT("OLD")) || !wxStrcmp(w.c_str() + 1, wxT("LACK"))))) || - wxStrstr(w.c_str() + 1, _T("BOLD")) ) + wxStrstr(w.c_str() + 1, wxT("BOLD")) ) { m_weight = wxFONTWEIGHT_BOLD; } - else if ( w == _T("LIGHT") || w == _T("THIN") ) + else if ( w == wxT("LIGHT") || w == wxT("THIN") ) { m_weight = wxFONTWEIGHT_LIGHT; } @@ -328,11 +328,11 @@ void wxFontRefData::InitFromNative() switch ( wxToupper( m_nativeFontInfo. GetXFontComponent(wxXLFD_SLANT)[0u]).GetValue() ) { - case _T('I'): // italique + case wxT('I'): // italique m_style = wxFONTSTYLE_ITALIC; break; - case _T('O'): // oblique + case wxT('O'): // oblique m_style = wxFONTSTYLE_SLANT; break; @@ -354,7 +354,7 @@ void wxFontRefData::InitFromNative() // examine the spacing: if the font is monospaced, assume wxTELETYPE // family for compatibility with the old code which used it instead of // IsFixedWidth() - if ( m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING).Upper() == _T('M') ) + if ( m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING).Upper() == wxT('M') ) { m_family = wxFONTFAMILY_TELETYPE; } @@ -373,7 +373,7 @@ void wxFontRefData::InitFromNative() registry = m_nativeFontInfo.GetXFontComponent(wxXLFD_REGISTRY).Upper(), encoding = m_nativeFontInfo.GetXFontComponent(wxXLFD_ENCODING).Upper(); - if ( registry == _T("ISO8859") ) + if ( registry == wxT("ISO8859") ) { int cp; if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 ) @@ -381,7 +381,7 @@ void wxFontRefData::InitFromNative() m_encoding = (wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1); } } - else if ( registry == _T("MICROSOFT") ) + else if ( registry == wxT("MICROSOFT") ) { int cp; if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 ) @@ -389,7 +389,7 @@ void wxFontRefData::InitFromNative() m_encoding = (wxFontEncoding)(wxFONTENCODING_CP1250 + cp); } } - else if ( registry == _T("KOI8") ) + else if ( registry == wxT("KOI8") ) { m_encoding = wxFONTENCODING_KOI8; } @@ -498,7 +498,7 @@ void wxFontRefData::SetStyle(wxFontStyle style) pango_font_description_set_style( desc, PANGO_STYLE_OBLIQUE ); break; default: - wxFAIL_MSG( _T("unknown font style") ); + wxFAIL_MSG( wxT("unknown font style") ); // fall through case wxFONTSTYLE_NORMAL: pango_font_description_set_style( desc, PANGO_STYLE_NORMAL ); @@ -652,7 +652,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) wxString registry = tn.GetNextToken().MakeUpper(), encoding = tn.GetNextToken().MakeUpper(); - if ( registry == _T("ISO8859") ) + if ( registry == wxT("ISO8859") ) { int cp; if ( wxSscanf(encoding, wxT("%d"), &cp) == 1 ) @@ -661,7 +661,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) (wxFontEncoding)(wxFONTENCODING_ISO8859_1 + cp - 1); } } - else if ( registry == _T("MICROSOFT") ) + else if ( registry == wxT("MICROSOFT") ) { int cp; if ( wxSscanf(encoding, wxT("cp125%d"), &cp) == 1 ) @@ -670,7 +670,7 @@ bool wxFont::Create(const wxString& fontname, wxFontEncoding enc) (wxFontEncoding)(wxFONTENCODING_CP1250 + cp); } } - else if ( registry == _T("KOI8") ) + else if ( registry == wxT("KOI8") ) { M_FONTDATA->m_encoding = wxFONTENCODING_KOI8; } @@ -803,7 +803,7 @@ bool wxFont::IsFixedWidth() const wxString spacing = M_FONTDATA-> m_nativeFontInfo.GetXFontComponent(wxXLFD_SPACING); - return spacing.Upper() == _T('M'); + return spacing.Upper() == wxT('M'); } // Unreaceable code for now // return wxFontBase::IsFixedWidth(); diff --git a/src/x11/region.cpp b/src/x11/region.cpp index 74477235de..2abcca5e45 100644 --- a/src/x11/region.cpp +++ b/src/x11/region.cpp @@ -175,7 +175,7 @@ bool wxRegion::DoUnionWithRect(const wxRect& r) bool wxRegion::DoUnionWithRegion( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -196,7 +196,7 @@ bool wxRegion::DoUnionWithRegion( const wxRegion& region ) bool wxRegion::DoIntersect( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -220,7 +220,7 @@ bool wxRegion::DoIntersect( const wxRegion& region ) bool wxRegion::DoSubtract( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { @@ -241,7 +241,7 @@ bool wxRegion::DoSubtract( const wxRegion& region ) bool wxRegion::DoXor( const wxRegion& region ) { - wxCHECK_MSG( region.Ok(), false, _T("invalid region") ); + wxCHECK_MSG( region.Ok(), false, wxT("invalid region") ); if (!m_refData) { diff --git a/src/x11/reparent.cpp b/src/x11/reparent.cpp index 6269a87c78..24baa7b662 100644 --- a/src/x11/reparent.cpp +++ b/src/x11/reparent.cpp @@ -187,13 +187,13 @@ bool wxReparenter::ProcessXEvent(WXEvent* event) { if (xevent->type == MapNotify) { - wxLogDebug(_T("Window was mapped")); + wxLogDebug(wxT("Window was mapped")); } if (xevent->type == MapNotify && !xevent->xmap.override_redirect && (client = (Window) FindAClientWindow((WXWindow) xevent->xmap.window, sm_name))) { - wxLogDebug(_T("Found a client window, about to reparent")); + wxLogDebug(wxT("Found a client window, about to reparent")); wxASSERT(sm_toReparent->GetParent() == NULL); sm_toReparent->SetHandle((WXWindow) client); @@ -204,7 +204,7 @@ bool wxReparenter::ProcessXEvent(WXEvent* event) xevent->xmap.override_redirect && xevent->xmap.window) { - wxLogDebug(_T("Found an override redirect window, about to reparent")); + wxLogDebug(wxT("Found an override redirect window, about to reparent")); sm_toReparent->SetHandle((WXWindow) xevent->xmap.window); sm_newParent->AddChild(sm_toReparent); wxASSERT(sm_toReparent->GetParent() == NULL); diff --git a/src/x11/window.cpp b/src/x11/window.cpp index 184282120b..1857c98868 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -397,7 +397,7 @@ void wxWindowX11::SetFocus() if (wxWindowIsVisible(xwindow)) { - wxLogTrace( _T("focus"), _T("wxWindowX11::SetFocus: %s"), GetClassInfo()->GetClassName()); + wxLogTrace( wxT("focus"), wxT("wxWindowX11::SetFocus: %s"), GetClassInfo()->GetClassName()); // XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToParent, CurrentTime ); XSetInputFocus( wxGlobalDisplay(), xwindow, RevertToNone, CurrentTime ); m_needsInputFocus = false; @@ -1732,7 +1732,7 @@ public: wxWinModule() { // we must be cleaned up before the display is closed - AddDependency(wxClassInfo::FindClass(_T("wxX11DisplayModule"))); + AddDependency(wxClassInfo::FindClass(wxT("wxX11DisplayModule"))); } virtual bool OnInit(); diff --git a/src/xrc/xh_animatctrl.cpp b/src/xrc/xh_animatctrl.cpp index 78e53e09d0..6bded88fdc 100644 --- a/src/xrc/xh_animatctrl.cpp +++ b/src/xrc/xh_animatctrl.cpp @@ -37,7 +37,7 @@ wxObject *wxAnimationCtrlXmlHandler::DoCreateResource() GetID(), GetAnimation(wxT("animation")), GetPosition(), GetSize(), - GetStyle(_T("style"), wxAC_DEFAULT_STYLE), + GetStyle(wxT("style"), wxAC_DEFAULT_STYLE), GetName()); // if no inactive-bitmap has been provided, GetBitmap() will return wxNullBitmap diff --git a/src/xrc/xh_clrpicker.cpp b/src/xrc/xh_clrpicker.cpp index be815f6541..5c458697b0 100644 --- a/src/xrc/xh_clrpicker.cpp +++ b/src/xrc/xh_clrpicker.cpp @@ -38,7 +38,7 @@ wxObject *wxColourPickerCtrlXmlHandler::DoCreateResource() GetID(), GetColour(wxT("value"), *wxBLACK), GetPosition(), GetSize(), - GetStyle(_T("style"), wxCLRP_DEFAULT_STYLE), + GetStyle(wxT("style"), wxCLRP_DEFAULT_STYLE), wxDefaultValidator, GetName()); diff --git a/src/xrc/xh_collpane.cpp b/src/xrc/xh_collpane.cpp index 93ab13c397..06b347c227 100644 --- a/src/xrc/xh_collpane.cpp +++ b/src/xrc/xh_collpane.cpp @@ -73,11 +73,11 @@ wxObject *wxCollapsiblePaneXmlHandler::DoCreateResource() GetID(), label, GetPosition(), GetSize(), - GetStyle(_T("style"), wxCP_DEFAULT_STYLE), + GetStyle(wxT("style"), wxCP_DEFAULT_STYLE), wxDefaultValidator, GetName()); - ctrl->Collapse(GetBool(_T("collapsed"))); + ctrl->Collapse(GetBool(wxT("collapsed"))); SetupWindow(ctrl); wxCollapsiblePane *old_par = m_collpane; diff --git a/src/xrc/xh_datectrl.cpp b/src/xrc/xh_datectrl.cpp index f3e4de97fe..f0426209e3 100644 --- a/src/xrc/xh_datectrl.cpp +++ b/src/xrc/xh_datectrl.cpp @@ -40,7 +40,7 @@ wxObject *wxDateCtrlXmlHandler::DoCreateResource() GetID(), wxDefaultDateTime, GetPosition(), GetSize(), - GetStyle(_T("style"), wxDP_DEFAULT | wxDP_SHOWCENTURY), + GetStyle(wxT("style"), wxDP_DEFAULT | wxDP_SHOWCENTURY), wxDefaultValidator, GetName()); diff --git a/src/xrc/xh_dirpicker.cpp b/src/xrc/xh_dirpicker.cpp index aaf59f963d..e70c44e14a 100644 --- a/src/xrc/xh_dirpicker.cpp +++ b/src/xrc/xh_dirpicker.cpp @@ -40,7 +40,7 @@ wxObject *wxDirPickerCtrlXmlHandler::DoCreateResource() GetParamValue(wxT("value")), GetText(wxT("message")), GetPosition(), GetSize(), - GetStyle(_T("style"), wxDIRP_DEFAULT_STYLE), + GetStyle(wxT("style"), wxDIRP_DEFAULT_STYLE), wxDefaultValidator, GetName()); diff --git a/src/xrc/xh_filectrl.cpp b/src/xrc/xh_filectrl.cpp index be5e0f4d6c..bbb4e8b4ec 100644 --- a/src/xrc/xh_filectrl.cpp +++ b/src/xrc/xh_filectrl.cpp @@ -42,7 +42,7 @@ wxObject *wxFileCtrlXmlHandler::DoCreateResource() GetText(wxT("defaultdirectory")), GetText(wxT("defaultfilename")), GetParamValue(wxT("wildcard")), - GetStyle(_T("style"), wxFC_DEFAULT_STYLE), + GetStyle(wxT("style"), wxFC_DEFAULT_STYLE), GetPosition(), GetSize(), GetName()); diff --git a/src/xrc/xh_filepicker.cpp b/src/xrc/xh_filepicker.cpp index 40e8280551..df544fa0f5 100644 --- a/src/xrc/xh_filepicker.cpp +++ b/src/xrc/xh_filepicker.cpp @@ -44,7 +44,7 @@ wxObject *wxFilePickerCtrlXmlHandler::DoCreateResource() GetText(wxT("message")), GetParamValue(wxT("wildcard")), GetPosition(), GetSize(), - GetStyle(_T("style"), wxFLP_DEFAULT_STYLE), + GetStyle(wxT("style"), wxFLP_DEFAULT_STYLE), wxDefaultValidator, GetName()); diff --git a/src/xrc/xh_fontpicker.cpp b/src/xrc/xh_fontpicker.cpp index 6222b3dfc3..f0436bbccf 100644 --- a/src/xrc/xh_fontpicker.cpp +++ b/src/xrc/xh_fontpicker.cpp @@ -43,7 +43,7 @@ wxObject *wxFontPickerCtrlXmlHandler::DoCreateResource() GetID(), f, GetPosition(), GetSize(), - GetStyle(_T("style"), wxFNTP_DEFAULT_STYLE), + GetStyle(wxT("style"), wxFNTP_DEFAULT_STYLE), wxDefaultValidator, GetName()); diff --git a/src/xrc/xh_htmllbox.cpp b/src/xrc/xh_htmllbox.cpp index f351b04cae..d70fc0d4a8 100644 --- a/src/xrc/xh_htmllbox.cpp +++ b/src/xrc/xh_htmllbox.cpp @@ -50,7 +50,7 @@ wxObject *wxSimpleHtmlListBoxXmlHandler::DoCreateResource() GetID(), GetPosition(), GetSize(), strList, - GetStyle(_T("style"), wxHLB_DEFAULT_STYLE), + GetStyle(wxT("style"), wxHLB_DEFAULT_STYLE), wxDefaultValidator, GetName()); diff --git a/src/xrc/xh_text.cpp b/src/xrc/xh_text.cpp index c9ffadfcc9..33e41604cb 100644 --- a/src/xrc/xh_text.cpp +++ b/src/xrc/xh_text.cpp @@ -51,7 +51,7 @@ wxTextCtrlXmlHandler::wxTextCtrlXmlHandler() : wxXmlResourceHandler() // this style doesn't exist since wx 2.9.0 but we still support it (by // ignoring it silently) in XRC files to avoid unimportant warnings when // using XRC produced by old tools - AddStyle(_T("wxTE_AUTO_SCROLL"), 0); + AddStyle(wxT("wxTE_AUTO_SCROLL"), 0); AddWindowStyles(); } diff --git a/src/xrc/xh_tree.cpp b/src/xrc/xh_tree.cpp index ef66aa4334..dc7e178161 100644 --- a/src/xrc/xh_tree.cpp +++ b/src/xrc/xh_tree.cpp @@ -51,7 +51,7 @@ wxObject *wxTreeCtrlXmlHandler::DoCreateResource() tree->Create(m_parentAsWindow, GetID(), GetPosition(), GetSize(), - GetStyle(_T("style"), wxTR_DEFAULT_STYLE), + GetStyle(wxT("style"), wxTR_DEFAULT_STYLE), wxDefaultValidator, GetName()); diff --git a/src/xrc/xh_unkwn.cpp b/src/xrc/xh_unkwn.cpp index a5e869fb6a..e399ce9205 100644 --- a/src/xrc/xh_unkwn.cpp +++ b/src/xrc/xh_unkwn.cpp @@ -90,7 +90,7 @@ wxUnknownWidgetXmlHandler::wxUnknownWidgetXmlHandler() wxObject *wxUnknownWidgetXmlHandler::DoCreateResource() { wxASSERT_MSG( m_instance == NULL, - _T("'unknown' controls can't be subclassed, use wxXmlResource::AttachUnknownControl") ); + wxT("'unknown' controls can't be subclassed, use wxXmlResource::AttachUnknownControl") ); wxPanel *panel = new wxUnknownControlContainer(m_parentAsWindow, diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index 5b21be5d36..82c3f10a89 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -292,13 +292,13 @@ bool wxXmlResource::Load(const wxString& filemask_) bool wxXmlResource::Unload(const wxString& filename) { wxASSERT_MSG( !wxIsWild(filename), - _T("wildcards not supported by wxXmlResource::Unload()") ); + wxT("wildcards not supported by wxXmlResource::Unload()") ); wxString fnd = ConvertFileNameToURL(filename); #if wxUSE_FILESYSTEM const bool isArchive = IsArchive(fnd); if ( isArchive ) - fnd += _T("#zip:"); + fnd += wxT("#zip:"); #endif // wxUSE_FILESYSTEM bool unloaded = false; @@ -564,7 +564,7 @@ bool wxXmlResource::UpdateResources() if (modif) { - wxLogTrace(_T("xrc"), _T("opening file '%s'"), rec->File); + wxLogTrace(wxT("xrc"), wxT("opening file '%s'"), rec->File); wxInputStream *stream = NULL; @@ -1226,7 +1226,7 @@ static wxColour GetSystemColour(const wxString& name) if (!name.empty()) { #define SYSCLR(clr) \ - if (name == _T(#clr)) return wxSystemSettings::GetColour(clr); + if (name == wxT(#clr)) return wxSystemSettings::GetColour(clr); SYSCLR(wxSYS_COLOUR_SCROLLBAR) SYSCLR(wxSYS_COLOUR_BACKGROUND) SYSCLR(wxSYS_COLOUR_DESKTOP) @@ -1688,7 +1688,7 @@ static wxFont GetSystemFont(const wxString& name) if (!name.empty()) { #define SYSFNT(fnt) \ - if (name == _T(#fnt)) return wxSystemSettings::GetFont(fnt); + if (name == wxT(#fnt)) return wxSystemSettings::GetFont(fnt); SYSFNT(wxSYS_OEM_FIXED_FONT) SYSFNT(wxSYS_ANSI_FIXED_FONT) SYSFNT(wxSYS_ANSI_VAR_FONT) diff --git a/tests/archive/archivetest.cpp b/tests/archive/archivetest.cpp index 0b143950e7..aa843b4e8c 100644 --- a/tests/archive/archivetest.cpp +++ b/tests/archive/archivetest.cpp @@ -335,7 +335,7 @@ private: TempDir::TempDir() { - wxString tmp = wxFileName::CreateTempFileName(_T("arctest-")); + wxString tmp = wxFileName::CreateTempFileName(wxT("arctest-")); if (!tmp.empty()) { wxRemoveFile(tmp); m_original = wxGetCwd(); @@ -356,26 +356,26 @@ TempDir::~TempDir() void TempDir::RemoveDir(wxString& path) { wxCHECK_RET(!m_tmp.empty() && path.substr(0, m_tmp.length()) == m_tmp, - _T("remove '") + path + _T("' fails safety check")); + wxT("remove '") + path + wxT("' fails safety check")); const wxChar *files[] = { - _T("text/empty"), - _T("text/small"), - _T("bin/bin1000"), - _T("bin/bin4095"), - _T("bin/bin4096"), - _T("bin/bin4097"), - _T("bin/bin16384"), - _T("zero/zero5"), - _T("zero/zero1024"), - _T("zero/zero32768"), - _T("zero/zero16385"), - _T("zero/newname"), - _T("newfile"), + wxT("text/empty"), + wxT("text/small"), + wxT("bin/bin1000"), + wxT("bin/bin4095"), + wxT("bin/bin4096"), + wxT("bin/bin4097"), + wxT("bin/bin16384"), + wxT("zero/zero5"), + wxT("zero/zero1024"), + wxT("zero/zero32768"), + wxT("zero/zero16385"), + wxT("zero/newname"), + wxT("newfile"), }; const wxChar *dirs[] = { - _T("text/"), _T("bin/"), _T("zero/"), _T("empty/") + wxT("text/"), wxT("bin/"), wxT("zero/"), wxT("empty/") }; wxString tmp = m_tmp + wxFileName::GetPathSeparator(); @@ -389,7 +389,7 @@ void TempDir::RemoveDir(wxString& path) if (!wxRmdir(m_tmp)) { - wxLogSysError(_T("can't remove temporary dir '%s'"), m_tmp.c_str()); + wxLogSysError(wxT("can't remove temporary dir '%s'"), m_tmp.c_str()); } } @@ -580,13 +580,13 @@ void ArchiveTestCase::CreateArchive(wxOutputStream& out) // It should be possible to create a directory entry just by supplying // a name that looks like a directory, or alternatively any old name // can be identified as a directory using SetIsDir or PutNextDirEntry - bool setIsDir = name.Last() == _T('/') && (choices & 1); + bool setIsDir = name.Last() == wxT('/') && (choices & 1); if (setIsDir) name.erase(name.length() - 1); // provide some context for the error message so that we know which // iteration of the loop we were on - string error_entry((_T(" '") + name + _T("'")).mb_str()); + string error_entry((wxT(" '") + name + wxT("'")).mb_str()); string error_context(" failed for entry" + error_entry); if ((choices & 2) || testEntry.IsText()) { @@ -613,7 +613,7 @@ void ArchiveTestCase::CreateArchive(wxOutputStream& out) testEntry.GetLength())); } - if (it->first.Last() != _T('/')) { + if (it->first.Last() != wxT('/')) { // for non-dirs write the data arc->Write(testEntry.GetData(), testEntry.GetSize()); CPPUNIT_ASSERT_MESSAGE("LastWrite check" + error_context, @@ -671,7 +671,7 @@ void ArchiveTestCase::CreateArchive(wxOutputStream& out, if ((m_options & PipeOut) == 0) { wxFileName fn(tmpdir.GetName()); - fn.SetExt(_T("arc")); + fn.SetExt(wxT("arc")); wxString tmparc = fn.GetPath(wxPATH_GET_SEPARATOR) + fn.GetFullName(); // call the archiver to create an archive file @@ -689,7 +689,7 @@ void ArchiveTestCase::CreateArchive(wxOutputStream& out, else { // for the non-seekable test, have the archiver output to "-" // and read the archive via a pipe - PFileInputStream in(wxString::Format(archiver, _T("-"))); + PFileInputStream in(wxString::Format(archiver, wxT("-"))); if (in.Ok()) out.Write(in); } @@ -706,10 +706,10 @@ void ArchiveTestCase::ModifyArchive(wxInputStream& in, auto_ptr arcOut(m_factory->NewStream(out)); EntryT *pEntry; - const wxString deleteName = _T("bin/bin1000"); - const wxString renameFrom = _T("zero/zero1024"); - const wxString renameTo = _T("zero/newname"); - const wxString newName = _T("newfile"); + const wxString deleteName = wxT("bin/bin1000"); + const wxString renameFrom = wxT("zero/zero1024"); + const wxString renameTo = wxT("zero/newname"); + const wxString newName = wxT("newfile"); const char *newData = "New file added as a test\n"; arcOut->CopyArchiveMetaData(*arcIn); @@ -721,7 +721,7 @@ void ArchiveTestCase::ModifyArchive(wxInputStream& in, // provide some context for the error message so that we know which // iteration of the loop we were on - string error_entry((_T(" '") + name + _T("'")).mb_str()); + string error_entry((wxT(" '") + name + wxT("'")).mb_str()); string error_context(" failed for entry" + error_entry); if (name == deleteName) { @@ -796,7 +796,7 @@ void ArchiveTestCase::ExtractArchive(wxInputStream& in) // provide some context for the error message so that we know which // iteration of the loop we were on - string error_entry((_T(" '") + name + _T("'")).mb_str()); + string error_entry((wxT(" '") + name + wxT("'")).mb_str()); string error_context(" failed for entry" + error_entry); TestEntries::iterator it = m_testEntries.find(name); @@ -824,7 +824,7 @@ void ArchiveTestCase::ExtractArchive(wxInputStream& in) "arc->GetLength() == entry->GetSize()" + error_context, arc->GetLength() == entry->GetSize()); - if (name.Last() != _T('/')) + if (name.Last() != wxT('/')) { CPPUNIT_ASSERT_MESSAGE("!IsDir" + error_context, !entry->IsDir()); @@ -884,7 +884,7 @@ void ArchiveTestCase::ExtractArchive(wxInputStream& in, if ((m_options & PipeIn) == 0) { wxFileName fn(tmpdir.GetName()); - fn.SetExt(_T("arc")); + fn.SetExt(wxT("arc")); wxString tmparc = fn.GetPath(wxPATH_GET_SEPARATOR) + fn.GetFullName(); if (m_options & Stub) @@ -904,7 +904,7 @@ void ArchiveTestCase::ExtractArchive(wxInputStream& in, else { // for the non-seekable test, have the archiver extract "-" and // feed it the archive via a pipe - PFileOutputStream out(wxString::Format(unarchiver, _T("-"))); + PFileOutputStream out(wxString::Format(unarchiver, wxT("-"))); if (out.Ok()) out.Write(in); } @@ -935,11 +935,11 @@ void ArchiveTestCase::VerifyDir(wxString& path, bool isDir = wxDirExists(path); if (isDir) - name += _T("/"); + name += wxT("/"); // provide some context for the error message so that we know which // iteration of the loop we were on - string error_entry((_T(" '") + name + _T("'")).mb_str()); + string error_entry((wxT(" '") + name + wxT("'")).mb_str()); string error_context(" failed for entry" + error_entry); TestEntries::iterator it = m_testEntries.find(name); @@ -1118,8 +1118,8 @@ void ArchiveTestCase::ReadSimultaneous(TestInputStream& in) #endif // the names of two entries to read - const wxChar *name = _T("text/small"); - const wxChar *name2 = _T("bin/bin1000"); + const wxChar *name = wxT("text/small"); + const wxChar *name2 = wxT("bin/bin1000"); // open them typename ArchiveCatalog::iterator j; @@ -1240,9 +1240,9 @@ void CorruptionTestCase::CreateArchive(wxOutputStream& out) { auto_ptr arc(m_factory->NewStream(out)); - arc->PutNextDirEntry(_T("dir")); - arc->PutNextEntry(_T("file")); - arc->Write(_T("foo"), 3); + arc->PutNextDirEntry(wxT("dir")); + arc->PutNextEntry(wxT("file")); + arc->Write(wxT("foo"), 3); } void CorruptionTestCase::ExtractArchive(wxInputStream& in) @@ -1271,7 +1271,7 @@ int TestId::m_seed = 6219; string TestId::MakeId() { m_seed = (m_seed * 171) % 30269; - return string(wxString::Format(_T("%-6d"), m_seed).mb_str()); + return string(wxString::Format(wxT("%-6d"), m_seed).mb_str()); } @@ -1282,10 +1282,10 @@ ArchiveTestSuite::ArchiveTestSuite(string name) : CppUnit::TestSuite("archive/" + name), m_name(name.c_str(), *wxConvCurrent) { - m_name = _T("wx") + m_name.Left(1).Upper() + m_name.Mid(1).Lower(); - m_path.AddEnvList(_T("PATH")); - m_archivers.push_back(_T("")); - m_unarchivers.push_back(_T("")); + m_name = wxT("wx") + m_name.Left(1).Upper() + m_name.Mid(1).Lower(); + m_path.AddEnvList(wxT("PATH")); + m_archivers.push_back(wxT("")); + m_unarchivers.push_back(wxT("")); } // add the command for an external archiver to the list, testing for it in @@ -1299,9 +1299,9 @@ void ArchiveTestSuite::AddCmd(wxArrayString& cmdlist, const wxString& cmd) bool ArchiveTestSuite::IsInPath(const wxString& cmd) { - wxString c = cmd.BeforeFirst(_T(' ')); + wxString c = cmd.BeforeFirst(wxT(' ')); #ifdef __WXMSW__ - c += _T(".exe"); + c += wxT(".exe"); #endif return !m_path.FindValidPath(c).empty(); } @@ -1336,7 +1336,7 @@ ArchiveTestSuite *ArchiveTestSuite::makeSuite() for (int options = 0; options <= PipeIn; options += PipeIn) { - wxObject *pObj = wxCreateDynamicObject(m_name + _T("ClassFactory")); + wxObject *pObj = wxCreateDynamicObject(m_name + wxT("ClassFactory")); wxArchiveClassFactory *factory; factory = wxDynamicCast(pObj, wxArchiveClassFactory); @@ -1375,29 +1375,29 @@ string ArchiveTestSuite::Description(const wxString& type, wxString descr; if (genericInterface) - descr << _T("wxArchive (") << type << _T(")"); + descr << wxT("wxArchive (") << type << wxT(")"); else descr << type; if (!archiver.empty()) { - const wxChar *fn = (options & PipeOut) != 0 ? _T("-") : _T("file"); - descr << _T(" (") << wxString::Format(archiver, fn) << _T(")"); + const wxChar *fn = (options & PipeOut) != 0 ? wxT("-") : wxT("file"); + descr << wxT(" (") << wxString::Format(archiver, fn) << wxT(")"); } if (!unarchiver.empty()) { - const wxChar *fn = (options & PipeIn) != 0 ? _T("-") : _T("file"); - descr << _T(" (") << wxString::Format(unarchiver, fn) << _T(")"); + const wxChar *fn = (options & PipeIn) != 0 ? wxT("-") : wxT("file"); + descr << wxT(" (") << wxString::Format(unarchiver, fn) << wxT(")"); } wxString optstr; if ((options & PipeIn) != 0) - optstr += _T("|PipeIn"); + optstr += wxT("|PipeIn"); if ((options & PipeOut) != 0) - optstr += _T("|PipeOut"); + optstr += wxT("|PipeOut"); if ((options & Stub) != 0) - optstr += _T("|Stub"); + optstr += wxT("|Stub"); if (!optstr.empty()) - optstr = _T(" (") + optstr.substr(1) + _T(")"); + optstr = wxT(" (") + optstr.substr(1) + wxT(")"); descr << optstr; diff --git a/tests/archive/tartest.cpp b/tests/archive/tartest.cpp index d0110526ff..d1d06fe8a5 100644 --- a/tests/archive/tartest.cpp +++ b/tests/archive/tartest.cpp @@ -44,8 +44,8 @@ protected: tartest::tartest() : ArchiveTestSuite("tar") { - AddArchiver(_T("tar cf %s *")); - AddUnArchiver(_T("tar xf %s")); + AddArchiver(wxT("tar cf %s *")); + AddUnArchiver(wxT("tar xf %s")); } CppUnit::Test *tartest::makeTest( diff --git a/tests/archive/ziptest.cpp b/tests/archive/ziptest.cpp index 4204c7dfb7..6976b083bb 100644 --- a/tests/archive/ziptest.cpp +++ b/tests/archive/ziptest.cpp @@ -64,7 +64,7 @@ protected: void ZipTestCase::OnCreateArchive(wxZipOutputStream& zip) { - m_comment << _T("Comment for test ") << m_id; + m_comment << wxT("Comment for test ") << m_id; zip.SetComment(m_comment); } @@ -84,7 +84,7 @@ void ZipTestCase::OnCreateEntry(wxZipOutputStream& zip, switch ((m_id + m_count) % 5) { case 0: { - wxString comment = _T("Comment for ") + entry->GetName(); + wxString comment = wxT("Comment for ") + entry->GetName(); entry->SetComment(comment); // lowercase the expected result, and the notifier should do // the same for the zip entries when ModifyArchive() runs @@ -110,7 +110,7 @@ void ZipTestCase::OnEntryExtracted(wxZipEntry& entry, { // provide some context for the error message so that we know which // iteration of the loop we were on - wxString name = _T(" '") + entry.GetName() + _T("'"); + wxString name = wxT(" '") + entry.GetName() + wxT("'"); string error_entry(name.mb_str()); string error_context(" failed for entry" + error_entry); @@ -175,8 +175,8 @@ void ZipPipeTestCase::runTest() { TestOutputStream out(m_options); - wxString testdata = _T("test data to pipe through zip"); - wxString cmd = _T("echo ") + testdata + _T(" | zip -q - -"); + wxString testdata = wxT("test data to pipe through zip"); + wxString cmd = wxT("echo ") + testdata + wxT(" | zip -q - -"); { PFileInputStream in(cmd); @@ -225,8 +225,8 @@ protected: ziptest::ziptest() : ArchiveTestSuite("zip") { - AddArchiver(_T("zip -qr %s *")); - AddUnArchiver(_T("unzip -q %s")); + AddArchiver(wxT("zip -qr %s *")); + AddUnArchiver(wxT("unzip -q %s")); } ArchiveTestSuite *ziptest::makeSuite() @@ -238,10 +238,10 @@ ArchiveTestSuite *ziptest::makeSuite() // The gnuwin32 build of infozip does work for this, e.g.: // C:\>echo test data to pipe through zip | zip -q > foo.zip // doesn't produce a valid zip, so disabled for now. - if (IsInPath(_T("zip"))) + if (IsInPath(wxT("zip"))) for (int options = 0; options <= PipeIn; options += PipeIn) { - string name = Description(_T("ZipPipeTestCase"), options, - false, _T(""), _T("zip -q - -")); + string name = Description(wxT("ZipPipeTestCase"), options, + false, wxT(""), wxT("zip -q - -")); addTest(new ZipPipeTestCase(name, options)); } #endif diff --git a/tests/arrays/arrays.cpp b/tests/arrays/arrays.cpp index 0913b8ab8e..ed74c94835 100644 --- a/tests/arrays/arrays.cpp +++ b/tests/arrays/arrays.cpp @@ -199,121 +199,121 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( ArraysTestCase, "ArraysTestCase" ); void ArraysTestCase::wxStringArrayTest() { wxArrayString a1; - a1.Add(_T("thermit")); - a1.Add(_T("condor")); - a1.Add(_T("lion"), 3); - a1.Add(_T("dog")); - a1.Add(_T("human")); - a1.Add(_T("alligator")); - - CPPUNIT_ASSERT( COMPARE_8_VALUES( a1 , _T("thermit") , - _T("condor") , - _T("lion") , - _T("lion") , - _T("lion") , - _T("dog") , - _T("human") , - _T("alligator") ) ); + a1.Add(wxT("thermit")); + a1.Add(wxT("condor")); + a1.Add(wxT("lion"), 3); + a1.Add(wxT("dog")); + a1.Add(wxT("human")); + a1.Add(wxT("alligator")); + + CPPUNIT_ASSERT( COMPARE_8_VALUES( a1 , wxT("thermit") , + wxT("condor") , + wxT("lion") , + wxT("lion") , + wxT("lion") , + wxT("dog") , + wxT("human") , + wxT("alligator") ) ); CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 8 ) ); wxArrayString a2(a1); - CPPUNIT_ASSERT( COMPARE_8_VALUES( a2 , _T("thermit") , - _T("condor") , - _T("lion") , - _T("lion") , - _T("lion") , - _T("dog") , - _T("human") , - _T("alligator") ) ); + CPPUNIT_ASSERT( COMPARE_8_VALUES( a2 , wxT("thermit") , + wxT("condor") , + wxT("lion") , + wxT("lion") , + wxT("lion") , + wxT("dog") , + wxT("human") , + wxT("alligator") ) ); CPPUNIT_ASSERT( COMPARE_COUNT( a2 , 8 ) ); wxSortedArrayString a3(a1); - CPPUNIT_ASSERT( COMPARE_8_VALUES( a3 , _T("alligator") , - _T("condor") , - _T("dog") , - _T("human") , - _T("lion") , - _T("lion") , - _T("lion") , - _T("thermit") ) ); + CPPUNIT_ASSERT( COMPARE_8_VALUES( a3 , wxT("alligator") , + wxT("condor") , + wxT("dog") , + wxT("human") , + wxT("lion") , + wxT("lion") , + wxT("lion") , + wxT("thermit") ) ); CPPUNIT_ASSERT( COMPARE_COUNT( a3 , 8 ) ); wxSortedArrayString a4; for (wxArrayString::iterator it = a1.begin(), en = a1.end(); it != en; ++it) a4.Add(*it); - CPPUNIT_ASSERT( COMPARE_8_VALUES( a4 , _T("alligator") , - _T("condor") , - _T("dog") , - _T("human") , - _T("lion") , - _T("lion") , - _T("lion") , - _T("thermit") ) ); + CPPUNIT_ASSERT( COMPARE_8_VALUES( a4 , wxT("alligator") , + wxT("condor") , + wxT("dog") , + wxT("human") , + wxT("lion") , + wxT("lion") , + wxT("lion") , + wxT("thermit") ) ); CPPUNIT_ASSERT( COMPARE_COUNT( a4 , 8 ) ); a1.RemoveAt(2,3); - CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , _T("thermit") , - _T("condor") , - _T("dog") , - _T("human") , - _T("alligator") ) ); + CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , wxT("thermit") , + wxT("condor") , + wxT("dog") , + wxT("human") , + wxT("alligator") ) ); CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 5 ) ); a2 = a1; - CPPUNIT_ASSERT( COMPARE_5_VALUES( a2 , _T("thermit") , - _T("condor") , - _T("dog") , - _T("human") , - _T("alligator") ) ); + CPPUNIT_ASSERT( COMPARE_5_VALUES( a2 , wxT("thermit") , + wxT("condor") , + wxT("dog") , + wxT("human") , + wxT("alligator") ) ); CPPUNIT_ASSERT( COMPARE_COUNT( a2 , 5 ) ); a1.Sort(false); - CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , _T("alligator") , - _T("condor") , - _T("dog") , - _T("human") , - _T("thermit") ) ); + CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , wxT("alligator") , + wxT("condor") , + wxT("dog") , + wxT("human") , + wxT("thermit") ) ); CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 5 ) ); a1.Sort(true); - CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , _T("thermit") , - _T("human") , - _T("dog") , - _T("condor") , - _T("alligator") ) ); + CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , wxT("thermit") , + wxT("human") , + wxT("dog") , + wxT("condor") , + wxT("alligator") ) ); CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 5 ) ); a1.Sort(&StringLenCompare); - CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , _T("dog") , - _T("human") , - _T("condor") , - _T("thermit") , - _T("alligator") ) ); + CPPUNIT_ASSERT( COMPARE_5_VALUES( a1 , wxT("dog") , + wxT("human") , + wxT("condor") , + wxT("thermit") , + wxT("alligator") ) ); CPPUNIT_ASSERT( COMPARE_COUNT( a1 , 5 ) ); - CPPUNIT_ASSERT( a1.Index( _T("dog") ) == 0 ); - CPPUNIT_ASSERT( a1.Index( _T("human") ) == 1 ); - CPPUNIT_ASSERT( a1.Index( _T("humann") ) == wxNOT_FOUND ); - CPPUNIT_ASSERT( a1.Index( _T("condor") ) == 2 ); - CPPUNIT_ASSERT( a1.Index( _T("thermit") ) == 3 ); - CPPUNIT_ASSERT( a1.Index( _T("alligator") ) == 4 ); + CPPUNIT_ASSERT( a1.Index( wxT("dog") ) == 0 ); + CPPUNIT_ASSERT( a1.Index( wxT("human") ) == 1 ); + CPPUNIT_ASSERT( a1.Index( wxT("humann") ) == wxNOT_FOUND ); + CPPUNIT_ASSERT( a1.Index( wxT("condor") ) == 2 ); + CPPUNIT_ASSERT( a1.Index( wxT("thermit") ) == 3 ); + CPPUNIT_ASSERT( a1.Index( wxT("alligator") ) == 4 ); wxArrayString a5; - CPPUNIT_ASSERT( a5.Add( _T("x"), 1 ) == 0 ); - CPPUNIT_ASSERT( a5.Add( _T("a"), 3 ) == 1 ); + CPPUNIT_ASSERT( a5.Add( wxT("x"), 1 ) == 0 ); + CPPUNIT_ASSERT( a5.Add( wxT("a"), 3 ) == 1 ); - CPPUNIT_ASSERT( COMPARE_4_VALUES( a5, _T("x") , - _T("a") , - _T("a") , - _T("a") ) ); + CPPUNIT_ASSERT( COMPARE_4_VALUES( a5, wxT("x") , + wxT("a") , + wxT("a") , + wxT("a") ) ); a5.assign(a1.end(), a1.end()); CPPUNIT_ASSERT( a5.empty() ); @@ -475,24 +475,24 @@ void ArraysTestCase::wxStringArraySplitJoinTest() } wxArrayString emptyArray; - wxString string = wxJoin(emptyArray, _T(';')); + wxString string = wxJoin(emptyArray, wxT(';')); CPPUNIT_ASSERT( string.empty() ); - CPPUNIT_ASSERT( wxSplit(string, _T(';')).empty() ); + CPPUNIT_ASSERT( wxSplit(string, wxT(';')).empty() ); - CPPUNIT_ASSERT_EQUAL( 2, wxSplit(_T(";"), _T(';')).size() ); + CPPUNIT_ASSERT_EQUAL( 2, wxSplit(wxT(";"), wxT(';')).size() ); } void ArraysTestCase::wxObjArrayTest() { { ArrayBars bars; - Bar bar(_T("first bar in general, second bar in array (two copies!)")); + Bar bar(wxT("first bar in general, second bar in array (two copies!)")); CPPUNIT_ASSERT_EQUAL( 0, bars.GetCount() ); CPPUNIT_ASSERT_EQUAL( 1, Bar::GetNumber() ); - bars.Add(new Bar(_T("first bar in array"))); + bars.Add(new Bar(wxT("first bar in array"))); bars.Add(bar, 2); CPPUNIT_ASSERT_EQUAL( 3, bars.GetCount() ); diff --git a/tests/benchmarks/htmlparser/htmlpars.cpp b/tests/benchmarks/htmlparser/htmlpars.cpp index 541fb80650..7d7e5eaed5 100644 --- a/tests/benchmarks/htmlparser/htmlpars.cpp +++ b/tests/benchmarks/htmlparser/htmlpars.cpp @@ -36,7 +36,7 @@ // DLL options compatibility check: WX_CHECK_BUILD_OPTIONS("wxHTML") -const wxChar *wxTRACE_HTML_DEBUG = _T("htmldebug"); +const wxChar *wxTRACE_HTML_DEBUG = wxT("htmldebug"); //----------------------------------------------------------------------------- // wx28HtmlParser helpers @@ -918,18 +918,18 @@ private: bool wxMetaTagHandler::HandleTag(const wx28HtmlTag& tag) { - if (tag.GetName() == _T("BODY")) + if (tag.GetName() == wxT("BODY")) { m_Parser->StopParsing(); return false; } - if (tag.HasParam(_T("HTTP-EQUIV")) && - tag.GetParam(_T("HTTP-EQUIV")).IsSameAs(_T("Content-Type"), false) && - tag.HasParam(_T("CONTENT"))) + if (tag.HasParam(wxT("HTTP-EQUIV")) && + tag.GetParam(wxT("HTTP-EQUIV")).IsSameAs(wxT("Content-Type"), false) && + tag.HasParam(wxT("CONTENT"))) { - wxString content = tag.GetParam(_T("CONTENT")).Lower(); - if (content.Left(19) == _T("text/html; charset=")) + wxString content = tag.GetParam(wxT("CONTENT")).Lower(); + if (content.Left(19) == wxT("text/html; charset=")) { *m_retval = content.Mid(19); m_Parser->StopParsing(); diff --git a/tests/benchmarks/htmlparser/htmltag.cpp b/tests/benchmarks/htmlparser/htmltag.cpp index d8a0a31b21..37f38d0fbf 100644 --- a/tests/benchmarks/htmlparser/htmltag.cpp +++ b/tests/benchmarks/htmlparser/htmltag.cpp @@ -52,8 +52,8 @@ IMPLEMENT_CLASS(wx28HtmlTagsCache,wxObject) bool wxIsCDATAElement(const wxChar *tag) { - return (wxStrcmp(tag, _T("SCRIPT")) == 0) || - (wxStrcmp(tag, _T("STYLE")) == 0); + return (wxStrcmp(tag, wxT("SCRIPT")) == 0) || + (wxStrcmp(tag, wxT("STYLE")) == 0); } wx28HtmlTagsCache::wx28HtmlTagsCache(const wxString& source) @@ -85,7 +85,7 @@ wx28HtmlTagsCache::wx28HtmlTagsCache(const wxString& source) { tagBuffer[i] = (wxChar)wxToupper(src[pos]); } - tagBuffer[i] = _T('\0'); + tagBuffer[i] = wxT('\0'); m_Cache[tg].Name = new wxChar[i+1]; memcpy(m_Cache[tg].Name, tagBuffer, (i+1)*sizeof(wxChar)); @@ -409,12 +409,12 @@ int wx28HtmlTag::ScanParam(const wxString& par, bool wx28HtmlTag::GetParamAsColour(const wxString& par, wxColour *clr) const { - wxCHECK_MSG( clr, false, _T("invalid colour argument") ); + wxCHECK_MSG( clr, false, wxT("invalid colour argument") ); wxString str = GetParam(par); // handle colours defined in HTML 4.0 first: - if (str.length() > 1 && str[0] != _T('#')) + if (str.length() > 1 && str[0] != wxT('#')) { #define HTML_COLOUR(name, r, g, b) \ if (str.IsSameAs(wxT(name), false)) \ diff --git a/tests/config/fileconf.cpp b/tests/config/fileconf.cpp index 65e2e6fbaa..d1cd56b40d 100644 --- a/tests/config/fileconf.cpp +++ b/tests/config/fileconf.cpp @@ -27,13 +27,13 @@ #include "wx/log.h" static const wxChar *testconfig = -_T("[root]\n") -_T("entry=value\n") -_T("[root/group1]\n") -_T("[root/group1/subgroup]\n") -_T("subentry=subvalue\n") -_T("subentry2=subvalue2\n") -_T("[root/group2]\n") +wxT("[root]\n") +wxT("entry=value\n") +wxT("[root/group1]\n") +wxT("[root/group1/subgroup]\n") +wxT("subentry=subvalue\n") +wxT("subentry2=subvalue2\n") +wxT("[root/group2]\n") ; // ---------------------------------------------------------------------------- @@ -135,34 +135,34 @@ void FileConfigTestCase::Path() wxStringInputStream sis(testconfig); wxFileConfig fc(sis); - CPPUNIT_ASSERT( ChangePath(fc, _T("")) == _T("") ); - CPPUNIT_ASSERT( ChangePath(fc, _T("/")) == _T("") ); - CPPUNIT_ASSERT( ChangePath(fc, _T("root")) == _T("/root") ); - CPPUNIT_ASSERT( ChangePath(fc, _T("/root")) == _T("/root") ); - CPPUNIT_ASSERT( ChangePath(fc, _T("/root/group1/subgroup")) == _T("/root/group1/subgroup") ); - CPPUNIT_ASSERT( ChangePath(fc, _T("/root/group2")) == _T("/root/group2") ); + CPPUNIT_ASSERT( ChangePath(fc, wxT("")) == wxT("") ); + CPPUNIT_ASSERT( ChangePath(fc, wxT("/")) == wxT("") ); + CPPUNIT_ASSERT( ChangePath(fc, wxT("root")) == wxT("/root") ); + CPPUNIT_ASSERT( ChangePath(fc, wxT("/root")) == wxT("/root") ); + CPPUNIT_ASSERT( ChangePath(fc, wxT("/root/group1/subgroup")) == wxT("/root/group1/subgroup") ); + CPPUNIT_ASSERT( ChangePath(fc, wxT("/root/group2")) == wxT("/root/group2") ); } void FileConfigTestCase::AddEntries() { wxFileConfig fc; - wxVERIFY_FILECONFIG( _T(""), fc ); + wxVERIFY_FILECONFIG( wxT(""), fc ); - fc.Write(_T("/Foo"), _T("foo")); - wxVERIFY_FILECONFIG( _T("Foo=foo\n"), fc ); + fc.Write(wxT("/Foo"), wxT("foo")); + wxVERIFY_FILECONFIG( wxT("Foo=foo\n"), fc ); - fc.Write(_T("/Bar/Baz"), _T("baz")); - wxVERIFY_FILECONFIG( _T("Foo=foo\n[Bar]\nBaz=baz\n"), fc ); + fc.Write(wxT("/Bar/Baz"), wxT("baz")); + wxVERIFY_FILECONFIG( wxT("Foo=foo\n[Bar]\nBaz=baz\n"), fc ); fc.DeleteAll(); - wxVERIFY_FILECONFIG( _T(""), fc ); + wxVERIFY_FILECONFIG( wxT(""), fc ); - fc.Write(_T("/Bar/Baz"), _T("baz")); - wxVERIFY_FILECONFIG( _T("[Bar]\nBaz=baz\n"), fc ); + fc.Write(wxT("/Bar/Baz"), wxT("baz")); + wxVERIFY_FILECONFIG( wxT("[Bar]\nBaz=baz\n"), fc ); - fc.Write(_T("/Foo"), _T("foo")); - wxVERIFY_FILECONFIG( _T("Foo=foo\n[Bar]\nBaz=baz\n"), fc ); + fc.Write(wxT("/Foo"), wxT("foo")); + wxVERIFY_FILECONFIG( wxT("Foo=foo\n[Bar]\nBaz=baz\n"), fc ); } void @@ -171,7 +171,7 @@ FileConfigTestCase::CheckGroupEntries(const wxFileConfig& fc, size_t nEntries, ...) { - wxConfigPathChanger change(&fc, wxString(path) + _T("/")); + wxConfigPathChanger change(&fc, wxString(path) + wxT("/")); CPPUNIT_ASSERT( fc.GetNumberOfEntries() == nEntries ); @@ -198,7 +198,7 @@ FileConfigTestCase::CheckGroupSubgroups(const wxFileConfig& fc, size_t nGroups, ...) { - wxConfigPathChanger change(&fc, wxString(path) + _T("/")); + wxConfigPathChanger change(&fc, wxString(path) + wxT("/")); CPPUNIT_ASSERT( fc.GetNumberOfGroups() == nGroups ); @@ -224,11 +224,11 @@ void FileConfigTestCase::GetEntries() wxStringInputStream sis(testconfig); wxFileConfig fc(sis); - CheckGroupEntries(fc, _T(""), 0); - CheckGroupEntries(fc, _T("/root"), 1, _T("entry")); - CheckGroupEntries(fc, _T("/root/group1"), 0); - CheckGroupEntries(fc, _T("/root/group1/subgroup"), - 2, _T("subentry"), _T("subentry2")); + CheckGroupEntries(fc, wxT(""), 0); + CheckGroupEntries(fc, wxT("/root"), 1, wxT("entry")); + CheckGroupEntries(fc, wxT("/root/group1"), 0); + CheckGroupEntries(fc, wxT("/root/group1/subgroup"), + 2, wxT("subentry"), wxT("subentry2")); } void FileConfigTestCase::GetGroups() @@ -236,10 +236,10 @@ void FileConfigTestCase::GetGroups() wxStringInputStream sis(testconfig); wxFileConfig fc(sis); - CheckGroupSubgroups(fc, _T(""), 1, _T("root")); - CheckGroupSubgroups(fc, _T("/root"), 2, _T("group1"), _T("group2")); - CheckGroupSubgroups(fc, _T("/root/group1"), 1, _T("subgroup")); - CheckGroupSubgroups(fc, _T("/root/group2"), 0); + CheckGroupSubgroups(fc, wxT(""), 1, wxT("root")); + CheckGroupSubgroups(fc, wxT("/root"), 2, wxT("group1"), wxT("group2")); + CheckGroupSubgroups(fc, wxT("/root/group1"), 1, wxT("subgroup")); + CheckGroupSubgroups(fc, wxT("/root/group2"), 0); } void FileConfigTestCase::HasEntry() @@ -247,15 +247,15 @@ void FileConfigTestCase::HasEntry() wxStringInputStream sis(testconfig); wxFileConfig fc(sis); - CPPUNIT_ASSERT( !fc.HasEntry(_T("root")) ); - CPPUNIT_ASSERT( fc.HasEntry(_T("root/entry")) ); - CPPUNIT_ASSERT( fc.HasEntry(_T("/root/entry")) ); - CPPUNIT_ASSERT( fc.HasEntry(_T("root/group1/subgroup/subentry")) ); - CPPUNIT_ASSERT( !fc.HasEntry(_T("")) ); - CPPUNIT_ASSERT( !fc.HasEntry(_T("root/group1")) ); - CPPUNIT_ASSERT( !fc.HasEntry(_T("subgroup/subentry")) ); - CPPUNIT_ASSERT( !fc.HasEntry(_T("/root/no_such_group/entry")) ); - CPPUNIT_ASSERT( !fc.HasGroup(_T("/root/no_such_group")) ); + CPPUNIT_ASSERT( !fc.HasEntry(wxT("root")) ); + CPPUNIT_ASSERT( fc.HasEntry(wxT("root/entry")) ); + CPPUNIT_ASSERT( fc.HasEntry(wxT("/root/entry")) ); + CPPUNIT_ASSERT( fc.HasEntry(wxT("root/group1/subgroup/subentry")) ); + CPPUNIT_ASSERT( !fc.HasEntry(wxT("")) ); + CPPUNIT_ASSERT( !fc.HasEntry(wxT("root/group1")) ); + CPPUNIT_ASSERT( !fc.HasEntry(wxT("subgroup/subentry")) ); + CPPUNIT_ASSERT( !fc.HasEntry(wxT("/root/no_such_group/entry")) ); + CPPUNIT_ASSERT( !fc.HasGroup(wxT("/root/no_such_group")) ); } void FileConfigTestCase::HasGroup() @@ -263,15 +263,15 @@ void FileConfigTestCase::HasGroup() wxStringInputStream sis(testconfig); wxFileConfig fc(sis); - CPPUNIT_ASSERT( fc.HasGroup(_T("root")) ); - CPPUNIT_ASSERT( fc.HasGroup(_T("root/group1")) ); - CPPUNIT_ASSERT( fc.HasGroup(_T("root/group1/subgroup")) ); - CPPUNIT_ASSERT( fc.HasGroup(_T("root/group2")) ); - CPPUNIT_ASSERT( !fc.HasGroup(_T("")) ); - CPPUNIT_ASSERT( !fc.HasGroup(_T("root/group")) ); - CPPUNIT_ASSERT( !fc.HasGroup(_T("root//subgroup")) ); - CPPUNIT_ASSERT( !fc.HasGroup(_T("foot/subgroup")) ); - CPPUNIT_ASSERT( !fc.HasGroup(_T("foot")) ); + CPPUNIT_ASSERT( fc.HasGroup(wxT("root")) ); + CPPUNIT_ASSERT( fc.HasGroup(wxT("root/group1")) ); + CPPUNIT_ASSERT( fc.HasGroup(wxT("root/group1/subgroup")) ); + CPPUNIT_ASSERT( fc.HasGroup(wxT("root/group2")) ); + CPPUNIT_ASSERT( !fc.HasGroup(wxT("")) ); + CPPUNIT_ASSERT( !fc.HasGroup(wxT("root/group")) ); + CPPUNIT_ASSERT( !fc.HasGroup(wxT("root//subgroup")) ); + CPPUNIT_ASSERT( !fc.HasGroup(wxT("foot/subgroup")) ); + CPPUNIT_ASSERT( !fc.HasGroup(wxT("foot")) ); } void FileConfigTestCase::Binary() @@ -310,24 +310,24 @@ void FileConfigTestCase::DeleteEntry() wxStringInputStream sis(testconfig); wxFileConfig fc(sis); - CPPUNIT_ASSERT( !fc.DeleteEntry(_T("foo")) ); + CPPUNIT_ASSERT( !fc.DeleteEntry(wxT("foo")) ); - CPPUNIT_ASSERT( fc.DeleteEntry(_T("root/group1/subgroup/subentry")) ); - wxVERIFY_FILECONFIG( _T("[root]\n") - _T("entry=value\n") - _T("[root/group1]\n") - _T("[root/group1/subgroup]\n") - _T("subentry2=subvalue2\n") - _T("[root/group2]\n"), + CPPUNIT_ASSERT( fc.DeleteEntry(wxT("root/group1/subgroup/subentry")) ); + wxVERIFY_FILECONFIG( wxT("[root]\n") + wxT("entry=value\n") + wxT("[root/group1]\n") + wxT("[root/group1/subgroup]\n") + wxT("subentry2=subvalue2\n") + wxT("[root/group2]\n"), fc ); // group should be deleted now as well as it became empty - wxConfigPathChanger change(&fc, _T("root/group1/subgroup/subentry2")); - CPPUNIT_ASSERT( fc.DeleteEntry(_T("subentry2")) ); - wxVERIFY_FILECONFIG( _T("[root]\n") - _T("entry=value\n") - _T("[root/group1]\n") - _T("[root/group2]\n"), + wxConfigPathChanger change(&fc, wxT("root/group1/subgroup/subentry2")); + CPPUNIT_ASSERT( fc.DeleteEntry(wxT("subentry2")) ); + wxVERIFY_FILECONFIG( wxT("[root]\n") + wxT("entry=value\n") + wxT("[root/group1]\n") + wxT("[root/group2]\n"), fc ); } @@ -377,21 +377,21 @@ void FileConfigTestCase::DeleteGroup() wxStringInputStream sis(testconfig); wxFileConfig fc(sis); - CPPUNIT_ASSERT( !fc.DeleteGroup(_T("foo")) ); + CPPUNIT_ASSERT( !fc.DeleteGroup(wxT("foo")) ); - CPPUNIT_ASSERT( fc.DeleteGroup(_T("root/group1")) ); - wxVERIFY_FILECONFIG( _T("[root]\n") - _T("entry=value\n") - _T("[root/group2]\n"), + CPPUNIT_ASSERT( fc.DeleteGroup(wxT("root/group1")) ); + wxVERIFY_FILECONFIG( wxT("[root]\n") + wxT("entry=value\n") + wxT("[root/group2]\n"), fc ); // notice trailing slash: it should be ignored - CPPUNIT_ASSERT( fc.DeleteGroup(_T("root/group2/")) ); - wxVERIFY_FILECONFIG( _T("[root]\n") - _T("entry=value\n"), + CPPUNIT_ASSERT( fc.DeleteGroup(wxT("root/group2/")) ); + wxVERIFY_FILECONFIG( wxT("[root]\n") + wxT("entry=value\n"), fc ); - CPPUNIT_ASSERT( fc.DeleteGroup(_T("root")) ); + CPPUNIT_ASSERT( fc.DeleteGroup(wxT("root")) ); CPPUNIT_ASSERT( Dump(fc).empty() ); } @@ -409,29 +409,29 @@ void FileConfigTestCase::RenameEntry() wxStringInputStream sis(testconfig); wxFileConfig fc(sis); - fc.SetPath(_T("root")); - CPPUNIT_ASSERT( fc.RenameEntry(_T("entry"), _T("newname")) ); - wxVERIFY_FILECONFIG( _T("[root]\n") - _T("newname=value\n") - _T("[root/group1]\n") - _T("[root/group1/subgroup]\n") - _T("subentry=subvalue\n") - _T("subentry2=subvalue2\n") - _T("[root/group2]\n"), + fc.SetPath(wxT("root")); + CPPUNIT_ASSERT( fc.RenameEntry(wxT("entry"), wxT("newname")) ); + wxVERIFY_FILECONFIG( wxT("[root]\n") + wxT("newname=value\n") + wxT("[root/group1]\n") + wxT("[root/group1/subgroup]\n") + wxT("subentry=subvalue\n") + wxT("subentry2=subvalue2\n") + wxT("[root/group2]\n"), fc ); - fc.SetPath(_T("group1/subgroup")); - CPPUNIT_ASSERT( !fc.RenameEntry(_T("entry"), _T("newname")) ); - CPPUNIT_ASSERT( !fc.RenameEntry(_T("subentry"), _T("subentry2")) ); - - CPPUNIT_ASSERT( fc.RenameEntry(_T("subentry"), _T("subentry1")) ); - wxVERIFY_FILECONFIG( _T("[root]\n") - _T("newname=value\n") - _T("[root/group1]\n") - _T("[root/group1/subgroup]\n") - _T("subentry2=subvalue2\n") - _T("subentry1=subvalue\n") - _T("[root/group2]\n"), + fc.SetPath(wxT("group1/subgroup")); + CPPUNIT_ASSERT( !fc.RenameEntry(wxT("entry"), wxT("newname")) ); + CPPUNIT_ASSERT( !fc.RenameEntry(wxT("subentry"), wxT("subentry2")) ); + + CPPUNIT_ASSERT( fc.RenameEntry(wxT("subentry"), wxT("subentry1")) ); + wxVERIFY_FILECONFIG( wxT("[root]\n") + wxT("newname=value\n") + wxT("[root/group1]\n") + wxT("[root/group1/subgroup]\n") + wxT("subentry2=subvalue2\n") + wxT("subentry1=subvalue\n") + wxT("[root/group2]\n"), fc ); } @@ -440,118 +440,118 @@ void FileConfigTestCase::RenameGroup() wxStringInputStream sis(testconfig); wxFileConfig fc(sis); - CPPUNIT_ASSERT( fc.RenameGroup(_T("root"), _T("foot")) ); - wxVERIFY_FILECONFIG( _T("[foot]\n") - _T("entry=value\n") - _T("[foot/group1]\n") - _T("[foot/group1/subgroup]\n") - _T("subentry=subvalue\n") - _T("subentry2=subvalue2\n") - _T("[foot/group2]\n"), + CPPUNIT_ASSERT( fc.RenameGroup(wxT("root"), wxT("foot")) ); + wxVERIFY_FILECONFIG( wxT("[foot]\n") + wxT("entry=value\n") + wxT("[foot/group1]\n") + wxT("[foot/group1/subgroup]\n") + wxT("subentry=subvalue\n") + wxT("subentry2=subvalue2\n") + wxT("[foot/group2]\n"), fc ); // renaming a path doesn't work, it must be the immediate group - CPPUNIT_ASSERT( !fc.RenameGroup(_T("foot/group1"), _T("group2")) ); + CPPUNIT_ASSERT( !fc.RenameGroup(wxT("foot/group1"), wxT("group2")) ); - fc.SetPath(_T("foot")); + fc.SetPath(wxT("foot")); // renaming to a name of existing group doesn't work - CPPUNIT_ASSERT( !fc.RenameGroup(_T("group1"), _T("group2")) ); + CPPUNIT_ASSERT( !fc.RenameGroup(wxT("group1"), wxT("group2")) ); // try exchanging the groups names and then restore them back - CPPUNIT_ASSERT( fc.RenameGroup(_T("group1"), _T("groupTmp")) ); - wxVERIFY_FILECONFIG( _T("[foot]\n") - _T("entry=value\n") - _T("[foot/groupTmp]\n") - _T("[foot/groupTmp/subgroup]\n") - _T("subentry=subvalue\n") - _T("subentry2=subvalue2\n") - _T("[foot/group2]\n"), + CPPUNIT_ASSERT( fc.RenameGroup(wxT("group1"), wxT("groupTmp")) ); + wxVERIFY_FILECONFIG( wxT("[foot]\n") + wxT("entry=value\n") + wxT("[foot/groupTmp]\n") + wxT("[foot/groupTmp/subgroup]\n") + wxT("subentry=subvalue\n") + wxT("subentry2=subvalue2\n") + wxT("[foot/group2]\n"), fc ); - CPPUNIT_ASSERT( fc.RenameGroup(_T("group2"), _T("group1")) ); - wxVERIFY_FILECONFIG( _T("[foot]\n") - _T("entry=value\n") - _T("[foot/groupTmp]\n") - _T("[foot/groupTmp/subgroup]\n") - _T("subentry=subvalue\n") - _T("subentry2=subvalue2\n") - _T("[foot/group1]\n"), + CPPUNIT_ASSERT( fc.RenameGroup(wxT("group2"), wxT("group1")) ); + wxVERIFY_FILECONFIG( wxT("[foot]\n") + wxT("entry=value\n") + wxT("[foot/groupTmp]\n") + wxT("[foot/groupTmp/subgroup]\n") + wxT("subentry=subvalue\n") + wxT("subentry2=subvalue2\n") + wxT("[foot/group1]\n"), fc ); - CPPUNIT_ASSERT( fc.RenameGroup(_T("groupTmp"), _T("group2")) ); - wxVERIFY_FILECONFIG( _T("[foot]\n") - _T("entry=value\n") - _T("[foot/group2]\n") - _T("[foot/group2/subgroup]\n") - _T("subentry=subvalue\n") - _T("subentry2=subvalue2\n") - _T("[foot/group1]\n"), + CPPUNIT_ASSERT( fc.RenameGroup(wxT("groupTmp"), wxT("group2")) ); + wxVERIFY_FILECONFIG( wxT("[foot]\n") + wxT("entry=value\n") + wxT("[foot/group2]\n") + wxT("[foot/group2/subgroup]\n") + wxT("subentry=subvalue\n") + wxT("subentry2=subvalue2\n") + wxT("[foot/group1]\n"), fc ); - CPPUNIT_ASSERT( fc.RenameGroup(_T("group1"), _T("groupTmp")) ); - wxVERIFY_FILECONFIG( _T("[foot]\n") - _T("entry=value\n") - _T("[foot/group2]\n") - _T("[foot/group2/subgroup]\n") - _T("subentry=subvalue\n") - _T("subentry2=subvalue2\n") - _T("[foot/groupTmp]\n"), + CPPUNIT_ASSERT( fc.RenameGroup(wxT("group1"), wxT("groupTmp")) ); + wxVERIFY_FILECONFIG( wxT("[foot]\n") + wxT("entry=value\n") + wxT("[foot/group2]\n") + wxT("[foot/group2/subgroup]\n") + wxT("subentry=subvalue\n") + wxT("subentry2=subvalue2\n") + wxT("[foot/groupTmp]\n"), fc ); - CPPUNIT_ASSERT( fc.RenameGroup(_T("group2"), _T("group1")) ); - wxVERIFY_FILECONFIG( _T("[foot]\n") - _T("entry=value\n") - _T("[foot/group1]\n") - _T("[foot/group1/subgroup]\n") - _T("subentry=subvalue\n") - _T("subentry2=subvalue2\n") - _T("[foot/groupTmp]\n"), + CPPUNIT_ASSERT( fc.RenameGroup(wxT("group2"), wxT("group1")) ); + wxVERIFY_FILECONFIG( wxT("[foot]\n") + wxT("entry=value\n") + wxT("[foot/group1]\n") + wxT("[foot/group1/subgroup]\n") + wxT("subentry=subvalue\n") + wxT("subentry2=subvalue2\n") + wxT("[foot/groupTmp]\n"), fc ); - CPPUNIT_ASSERT( fc.RenameGroup(_T("groupTmp"), _T("group2")) ); - wxVERIFY_FILECONFIG( _T("[foot]\n") - _T("entry=value\n") - _T("[foot/group1]\n") - _T("[foot/group1/subgroup]\n") - _T("subentry=subvalue\n") - _T("subentry2=subvalue2\n") - _T("[foot/group2]\n"), + CPPUNIT_ASSERT( fc.RenameGroup(wxT("groupTmp"), wxT("group2")) ); + wxVERIFY_FILECONFIG( wxT("[foot]\n") + wxT("entry=value\n") + wxT("[foot/group1]\n") + wxT("[foot/group1/subgroup]\n") + wxT("subentry=subvalue\n") + wxT("subentry2=subvalue2\n") + wxT("[foot/group2]\n"), fc ); } void FileConfigTestCase::CreateSubgroupAndEntries() { wxFileConfig fc; - fc.Write(_T("sub/sub_first"), _T("sub_one")); - fc.Write(_T("first"), _T("one")); + fc.Write(wxT("sub/sub_first"), wxT("sub_one")); + fc.Write(wxT("first"), wxT("one")); - wxVERIFY_FILECONFIG( _T("first=one\n") - _T("[sub]\n") - _T("sub_first=sub_one\n"), + wxVERIFY_FILECONFIG( wxT("first=one\n") + wxT("[sub]\n") + wxT("sub_first=sub_one\n"), fc ); } void FileConfigTestCase::CreateEntriesAndSubgroup() { wxFileConfig fc; - fc.Write(_T("first"), _T("one")); - fc.Write(_T("second"), _T("two")); - fc.Write(_T("sub/sub_first"), _T("sub_one")); - - wxVERIFY_FILECONFIG( _T("first=one\n") - _T("second=two\n") - _T("[sub]\n") - _T("sub_first=sub_one\n"), + fc.Write(wxT("first"), wxT("one")); + fc.Write(wxT("second"), wxT("two")); + fc.Write(wxT("sub/sub_first"), wxT("sub_one")); + + wxVERIFY_FILECONFIG( wxT("first=one\n") + wxT("second=two\n") + wxT("[sub]\n") + wxT("sub_first=sub_one\n"), fc ); } static void EmptyConfigAndWriteKey() { - wxFileConfig fc(_T("deleteconftest")); + wxFileConfig fc(wxT("deleteconftest")); - const wxString groupPath = _T("/root"); + const wxString groupPath = wxT("/root"); if ( fc.Exists(groupPath) ) { @@ -565,7 +565,7 @@ static void EmptyConfigAndWriteKey() // this crashes on second call of this function - CPPUNIT_ASSERT( fc.Write(groupPath + _T("/entry"), _T("value")) ); + CPPUNIT_ASSERT( fc.Write(groupPath + wxT("/entry"), wxT("value")) ); } void FileConfigTestCase::DeleteLastGroup() @@ -585,47 +585,47 @@ void FileConfigTestCase::DeleteLastGroup() // clean up wxLogNull noLogging; - (void) ::wxRemoveFile(wxFileConfig::GetLocalFileName(_T("deleteconftest"))); + (void) ::wxRemoveFile(wxFileConfig::GetLocalFileName(wxT("deleteconftest"))); } void FileConfigTestCase::DeleteAndRecreateGroup() { static const wxChar *confInitial = - _T("[First]\n") - _T("Value1=Foo\n") - _T("[Second]\n") - _T("Value2=Bar\n"); + wxT("[First]\n") + wxT("Value1=Foo\n") + wxT("[Second]\n") + wxT("Value2=Bar\n"); wxStringInputStream sis(confInitial); wxFileConfig fc(sis); - fc.DeleteGroup(_T("Second")); - wxVERIFY_FILECONFIG( _T("[First]\n") - _T("Value1=Foo\n"), + fc.DeleteGroup(wxT("Second")); + wxVERIFY_FILECONFIG( wxT("[First]\n") + wxT("Value1=Foo\n"), fc ); - fc.Write(_T("Second/Value2"), _T("New")); - wxVERIFY_FILECONFIG( _T("[First]\n") - _T("Value1=Foo\n") - _T("[Second]\n") - _T("Value2=New\n"), + fc.Write(wxT("Second/Value2"), wxT("New")); + wxVERIFY_FILECONFIG( wxT("[First]\n") + wxT("Value1=Foo\n") + wxT("[Second]\n") + wxT("Value2=New\n"), fc ); } void FileConfigTestCase::AddToExistingRoot() { static const wxChar *confInitial = - _T("[Group]\n") - _T("value1=foo\n"); + wxT("[Group]\n") + wxT("value1=foo\n"); wxStringInputStream sis(confInitial); wxFileConfig fc(sis); - fc.Write(_T("/value1"), _T("bar")); + fc.Write(wxT("/value1"), wxT("bar")); wxVERIFY_FILECONFIG( - _T("value1=bar\n") - _T("[Group]\n") - _T("value1=foo\n"), + wxT("value1=bar\n") + wxT("[Group]\n") + wxT("value1=foo\n"), fc ); } diff --git a/tests/datetime/datetimetest.cpp b/tests/datetime/datetimetest.cpp index ad33117471..6cddf64142 100644 --- a/tests/datetime/datetimetest.cpp +++ b/tests/datetime/datetimetest.cpp @@ -175,23 +175,23 @@ struct Date wxString Format() const { wxString s; - s.Printf(_T("%02d:%02d:%02d %10s %02d, %4d%s"), + s.Printf(wxT("%02d:%02d:%02d %10s %02d, %4d%s"), hour, min, sec, wxDateTime::GetMonthName(month).c_str(), day, abs(wxDateTime::ConvertYearToBC(year)), - year > 0 ? _T("AD") : _T("BC")); + year > 0 ? wxT("AD") : wxT("BC")); return s; } wxString FormatDate() const { wxString s; - s.Printf(_T("%02d-%s-%4d%s"), + s.Printf(wxT("%02d-%s-%4d%s"), day, wxDateTime::GetMonthName(month, wxDateTime::Name_Abbr).c_str(), abs(wxDateTime::ConvertYearToBC(year)), - year > 0 ? _T("AD") : _T("BC")); + year > 0 ? wxT("AD") : wxT("BC")); return s; } }; @@ -374,21 +374,21 @@ void DateTimeTestCase::TestTimeWDays() wxString s, which; switch ( nWeek < -1 ? -nWeek : nWeek ) { - case 1: which = _T("first"); break; - case 2: which = _T("second"); break; - case 3: which = _T("third"); break; - case 4: which = _T("fourth"); break; - case 5: which = _T("fifth"); break; + case 1: which = wxT("first"); break; + case 2: which = wxT("second"); break; + case 3: which = wxT("third"); break; + case 4: which = wxT("fourth"); break; + case 5: which = wxT("fifth"); break; - case -1: which = _T("last"); break; + case -1: which = wxT("last"); break; } if ( nWeek < -1 ) { - which += _T(" from end"); + which += wxT(" from end"); } - s.Printf(_T("The %s %s of %s in %d"), + s.Printf(wxT("The %s %s of %s in %d"), which.c_str(), wxDateTime::GetWeekDayName(wday).c_str(), wxDateTime::GetMonthName(month).c_str(), @@ -771,7 +771,7 @@ void DateTimeTestCase::TestTimeFormat() break; case CompareNone: - wxFAIL_MSG( _T("unexpected") ); + wxFAIL_MSG( wxT("unexpected") ); break; } } @@ -983,7 +983,7 @@ void DateTimeTestCase::TestDateParse() // special cases wxDateTime dt; - CPPUNIT_ASSERT( dt.ParseDate(_T("today")) ); + CPPUNIT_ASSERT( dt.ParseDate(wxT("today")) ); CPPUNIT_ASSERT_EQUAL( wxDateTime::Today(), dt ); for ( size_t n = 0; n < WXSIZEOF(parseTestDates); n++ ) diff --git a/tests/filekind/filekind.cpp b/tests/filekind/filekind.cpp index 9cb2abee33..fd4c9af418 100644 --- a/tests/filekind/filekind.cpp +++ b/tests/filekind/filekind.cpp @@ -113,7 +113,7 @@ void FileKindTestCase::File() { TempFile tmp; // put first wxFile file; - tmp.m_name = wxFileName::CreateTempFileName(_T("wxft"), &file); + tmp.m_name = wxFileName::CreateTempFileName(wxT("wxft"), &file); TestFd(file, true); file.Close(); diff --git a/tests/filesys/filesystest.cpp b/tests/filesys/filesystest.cpp index fa928db128..ee39285967 100644 --- a/tests/filesys/filesystest.cpp +++ b/tests/filesys/filesystest.cpp @@ -84,20 +84,20 @@ void FileSystemTestCase::UrlParsing() } data[] = { // simple case: - { _T("http://www.root.cz/index.html"), - _T("http"), _T(""), _T("//www.root.cz/index.html"), _T("")}, + { wxT("http://www.root.cz/index.html"), + wxT("http"), wxT(""), wxT("//www.root.cz/index.html"), wxT("")}, // anchors: - { _T("http://www.root.cz/index.html#lbl"), - _T("http"), _T(""), _T("//www.root.cz/index.html"), _T("lbl")}, + { wxT("http://www.root.cz/index.html#lbl"), + wxT("http"), wxT(""), wxT("//www.root.cz/index.html"), wxT("lbl")}, // file is default protocol: - { _T("testfile.html"), - _T("file"), _T(""), _T("testfile.html"), _T("")}, + { wxT("testfile.html"), + wxT("file"), wxT(""), wxT("testfile.html"), wxT("")}, // stacked protocols: - { _T("file:myzipfile.zip#zip:index.htm"), - _T("zip"), _T("file:myzipfile.zip"), _T("index.htm"), _T("")}, + { wxT("file:myzipfile.zip#zip:index.htm"), + wxT("zip"), wxT("file:myzipfile.zip"), wxT("index.htm"), wxT("")}, // changes to ':' parsing often break things: - { _T("file:a#b:foo"), - _T("b"), _T("file:a"), _T("foo"), _T("")} + { wxT("file:a#b:foo"), + wxT("b"), wxT("file:a"), wxT("foo"), wxT("")} }; UrlTester tst; @@ -114,7 +114,7 @@ void FileSystemTestCase::UrlParsing() void FileSystemTestCase::FileNameToUrlConversion() { #ifdef __WINDOWS__ - wxFileName fn1(_T("\\\\server\\share\\path\\to\\file")); + wxFileName fn1(wxT("\\\\server\\share\\path\\to\\file")); wxString url1 = wxFileSystem::FileNameToURL(fn1); CPPUNIT_ASSERT( fn1.SameAs(wxFileSystem::URLToFileName(url1)) ); diff --git a/tests/fontmap/fontmaptest.cpp b/tests/fontmap/fontmaptest.cpp index 05607a901c..aa5a34d987 100644 --- a/tests/fontmap/fontmaptest.cpp +++ b/tests/fontmap/fontmaptest.cpp @@ -57,55 +57,55 @@ void FontMapperTestCase::NamesAndDesc() static const wxChar *charsets[] = { // some valid charsets - _T("us-ascii" ), - _T("iso8859-1" ), - _T("iso-8859-12" ), - _T("koi8-r" ), - _T("utf-7" ), - _T("cp1250" ), - _T("windows-1252"), + wxT("us-ascii" ), + wxT("iso8859-1" ), + wxT("iso-8859-12" ), + wxT("koi8-r" ), + wxT("utf-7" ), + wxT("cp1250" ), + wxT("windows-1252"), // and now some bogus ones - _T("" ), - _T("cp1249" ), - _T("iso--8859-1" ), - _T("iso-8859-19" ), + wxT("" ), + wxT("cp1249" ), + wxT("iso--8859-1" ), + wxT("iso-8859-19" ), }; static const wxChar *names[] = { // some valid charsets - _T("default" ), - _T("iso-8859-1" ), - _T("iso-8859-12" ), - _T("koi8-r" ), - _T("utf-7" ), - _T("windows-1250"), - _T("windows-1252"), + wxT("default" ), + wxT("iso-8859-1" ), + wxT("iso-8859-12" ), + wxT("koi8-r" ), + wxT("utf-7" ), + wxT("windows-1250"), + wxT("windows-1252"), // and now some bogus ones - _T("default" ), - _T("unknown--1" ), - _T("unknown--1" ), - _T("unknown--1" ), + wxT("default" ), + wxT("unknown--1" ), + wxT("unknown--1" ), + wxT("unknown--1" ), }; static const wxChar *descriptions[] = { // some valid charsets - _T("Default encoding" ), - _T("Western European (ISO-8859-1)" ), - _T("Indian (ISO-8859-12)" ), - _T("KOI8-R" ), - _T("Unicode 7 bit (UTF-7)" ), - _T("Windows Central European (CP 1250)"), - _T("Windows Western European (CP 1252)"), + wxT("Default encoding" ), + wxT("Western European (ISO-8859-1)" ), + wxT("Indian (ISO-8859-12)" ), + wxT("KOI8-R" ), + wxT("Unicode 7 bit (UTF-7)" ), + wxT("Windows Central European (CP 1250)"), + wxT("Windows Western European (CP 1252)"), // and now some bogus ones - _T("Default encoding" ), - _T("Unknown encoding (-1)" ), - _T("Unknown encoding (-1)" ), - _T("Unknown encoding (-1)" ), + wxT("Default encoding" ), + wxT("Unknown encoding (-1)" ), + wxT("Unknown encoding (-1)" ), + wxT("Unknown encoding (-1)" ), }; wxFontMapperBase& fmap = *wxFontMapperBase::Get(); diff --git a/tests/formatconverter/formatconvertertest.cpp b/tests/formatconverter/formatconvertertest.cpp index 5072a0f146..8cc2546e06 100644 --- a/tests/formatconverter/formatconvertertest.cpp +++ b/tests/formatconverter/formatconvertertest.cpp @@ -32,7 +32,7 @@ // I've put in some checks, such as this which will flag up any platforms // where this is not the case: // -// CPPUNIT_ASSERT(wxString::Format(_T("%hs"), "test") == _T("test")); +// CPPUNIT_ASSERT(wxString::Format(wxT("%hs"), "test") == wxT("test")); // // For compilers that support precompilation, includes "wx/wx.h". @@ -110,81 +110,81 @@ class FormatConverterTestCase : public TestCase void FormatConverterTestCase::format_d() { doTest("d", "d", "d", "d", "d"); - CPPUNIT_ASSERT(wxString::Format(_T("%d"), 255) == _T("255")); - CPPUNIT_ASSERT(wxString::Format(_T("%05d"), 255) == _T("00255")); - CPPUNIT_ASSERT(wxString::Format(_T("% 5d"), 255) == _T(" 255")); - CPPUNIT_ASSERT(wxString::Format(_T("% 5d"), -255) == _T(" -255")); - CPPUNIT_ASSERT(wxString::Format(_T("%-5d"), -255) == _T("-255 ")); - CPPUNIT_ASSERT(wxString::Format(_T("%+5d"), 255) == _T(" +255")); - CPPUNIT_ASSERT(wxString::Format(_T("%*d"), 5, 255) == _T(" 255")); + CPPUNIT_ASSERT(wxString::Format(wxT("%d"), 255) == wxT("255")); + CPPUNIT_ASSERT(wxString::Format(wxT("%05d"), 255) == wxT("00255")); + CPPUNIT_ASSERT(wxString::Format(wxT("% 5d"), 255) == wxT(" 255")); + CPPUNIT_ASSERT(wxString::Format(wxT("% 5d"), -255) == wxT(" -255")); + CPPUNIT_ASSERT(wxString::Format(wxT("%-5d"), -255) == wxT("-255 ")); + CPPUNIT_ASSERT(wxString::Format(wxT("%+5d"), 255) == wxT(" +255")); + CPPUNIT_ASSERT(wxString::Format(wxT("%*d"), 5, 255) == wxT(" 255")); } void FormatConverterTestCase::format_hd() { doTest("hd", "hd", "hd", "hd", "hd"); short s = 32767; - CPPUNIT_ASSERT(wxString::Format(_T("%hd"), s) == _T("32767")); + CPPUNIT_ASSERT(wxString::Format(wxT("%hd"), s) == wxT("32767")); } void FormatConverterTestCase::format_ld() { doTest("ld", "ld", "ld", "ld", "ld"); long l = 2147483647L; - CPPUNIT_ASSERT(wxString::Format(_T("%ld"), l) == _T("2147483647")); + CPPUNIT_ASSERT(wxString::Format(wxT("%ld"), l) == wxT("2147483647")); } void FormatConverterTestCase::format_s() { doTest("s", "ls", "s", "ls", "s"); - CPPUNIT_ASSERT(wxString::Format(_T("%s!"), _T("test")) == _T("test!")); - CPPUNIT_ASSERT(wxString::Format(_T("%6s!"), _T("test")) == _T(" test!")); - CPPUNIT_ASSERT(wxString::Format(_T("%-6s!"), _T("test")) == _T("test !")); - CPPUNIT_ASSERT(wxString::Format(_T("%.6s!"), _T("test")) == _T("test!")); - CPPUNIT_ASSERT(wxString::Format(_T("%6.4s!"), _T("testing")) == _T(" test!")); + CPPUNIT_ASSERT(wxString::Format(wxT("%s!"), wxT("test")) == wxT("test!")); + CPPUNIT_ASSERT(wxString::Format(wxT("%6s!"), wxT("test")) == wxT(" test!")); + CPPUNIT_ASSERT(wxString::Format(wxT("%-6s!"), wxT("test")) == wxT("test !")); + CPPUNIT_ASSERT(wxString::Format(wxT("%.6s!"), wxT("test")) == wxT("test!")); + CPPUNIT_ASSERT(wxString::Format(wxT("%6.4s!"), wxT("testing")) == wxT(" test!")); } void FormatConverterTestCase::format_hs() { doTest("hs", "hs", "s", "ls", "s"); - CPPUNIT_ASSERT(wxString::Format(wxString(_T("%hs!")), "test") == _T("test!")); - CPPUNIT_ASSERT(wxString::Format(wxString(_T("%6hs!")), "test") == _T(" test!")); - CPPUNIT_ASSERT(wxString::Format(wxString(_T("%-6hs!")), "test") == _T("test !")); - CPPUNIT_ASSERT(wxString::Format(wxString(_T("%.6hs!")), "test") == _T("test!")); - CPPUNIT_ASSERT(wxString::Format(wxString(_T("%6.4hs!")), "testing") == _T(" test!")); + CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%hs!")), "test") == wxT("test!")); + CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%6hs!")), "test") == wxT(" test!")); + CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%-6hs!")), "test") == wxT("test !")); + CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%.6hs!")), "test") == wxT("test!")); + CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%6.4hs!")), "testing") == wxT(" test!")); } void FormatConverterTestCase::format_ls() { doTest("ls", "ls", "s", "ls", "s"); - CPPUNIT_ASSERT(wxString::Format(_T("%ls!"), L"test") == _T("test!")); - CPPUNIT_ASSERT(wxString::Format(_T("%6ls!"), L"test") == _T(" test!")); - CPPUNIT_ASSERT(wxString::Format(_T("%-6ls!"), L"test") == _T("test !")); - CPPUNIT_ASSERT(wxString::Format(_T("%.6ls!"), L"test") == _T("test!")); - CPPUNIT_ASSERT(wxString::Format(_T("%6.4ls!"), L"testing") == _T(" test!")); + CPPUNIT_ASSERT(wxString::Format(wxT("%ls!"), L"test") == wxT("test!")); + CPPUNIT_ASSERT(wxString::Format(wxT("%6ls!"), L"test") == wxT(" test!")); + CPPUNIT_ASSERT(wxString::Format(wxT("%-6ls!"), L"test") == wxT("test !")); + CPPUNIT_ASSERT(wxString::Format(wxT("%.6ls!"), L"test") == wxT("test!")); + CPPUNIT_ASSERT(wxString::Format(wxT("%6.4ls!"), L"testing") == wxT(" test!")); } void FormatConverterTestCase::format_c() { doTest("c", "lc", "lc", "lc", "c"); - CPPUNIT_ASSERT(wxString::Format(_T("%c"), _T('x')) == _T("x")); - CPPUNIT_ASSERT(wxString::Format(_T("%2c"), _T('x')) == _T(" x")); - CPPUNIT_ASSERT(wxString::Format(_T("%-2c"), _T('x')) == _T("x ")); + CPPUNIT_ASSERT(wxString::Format(wxT("%c"), wxT('x')) == wxT("x")); + CPPUNIT_ASSERT(wxString::Format(wxT("%2c"), wxT('x')) == wxT(" x")); + CPPUNIT_ASSERT(wxString::Format(wxT("%-2c"), wxT('x')) == wxT("x ")); } void FormatConverterTestCase::format_hc() { doTest("hc", "hc", "lc", "lc", "c"); - CPPUNIT_ASSERT(wxString::Format(wxString(_T("%hc")), 'x') == _T("x")); - CPPUNIT_ASSERT(wxString::Format(wxString(_T("%2hc")), 'x') == _T(" x")); - CPPUNIT_ASSERT(wxString::Format(wxString(_T("%-2hc")), 'x') == _T("x ")); + CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%hc")), 'x') == wxT("x")); + CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%2hc")), 'x') == wxT(" x")); + CPPUNIT_ASSERT(wxString::Format(wxString(wxT("%-2hc")), 'x') == wxT("x ")); } void FormatConverterTestCase::format_lc() { doTest("lc", "lc", "lc", "lc", "c"); - CPPUNIT_ASSERT(wxString::Format(_T("%lc"), L'x') == _T("x")); - CPPUNIT_ASSERT(wxString::Format(_T("%2lc"), L'x') == _T(" x")); - CPPUNIT_ASSERT(wxString::Format(_T("%-2lc"), L'x') == _T("x ")); + CPPUNIT_ASSERT(wxString::Format(wxT("%lc"), L'x') == wxT("x")); + CPPUNIT_ASSERT(wxString::Format(wxT("%2lc"), L'x') == wxT(" x")); + CPPUNIT_ASSERT(wxString::Format(wxT("%-2lc"), L'x') == wxT("x ")); } @@ -254,17 +254,17 @@ void FormatConverterTestCase::doTest(const char *input, const char *expectedWcharWindows) { static const wxChar *flag_width[] = - { _T(""), _T("*"), _T("10"), _T("-*"), _T("-10"), NULL }; + { wxT(""), wxT("*"), wxT("10"), wxT("-*"), wxT("-10"), NULL }; static const wxChar *precision[] = - { _T(""), _T(".*"), _T(".10"), NULL }; + { wxT(""), wxT(".*"), wxT(".10"), NULL }; static const wxChar *empty[] = - { _T(""), NULL }; + { wxT(""), NULL }; // no precision for %c or %C - const wxChar **precs = wxTolower(input[wxStrlen(input)-1]) == _T('c') ? + const wxChar **precs = wxTolower(input[wxStrlen(input)-1]) == wxT('c') ? empty : precision; - wxString fmt(_T("%")); + wxString fmt(wxT("%")); // try the test for a variety of combinations of flag, width and precision for (const wxChar **prec = precs; *prec; prec++) @@ -294,18 +294,18 @@ void FormatConverterTestCase::check(const wxString& input, // on windows, wxScanf() string needs no modifications result = wxScanfConvertFormatW(input.wc_str()); - msg = _T("input: '") + input + - _T("', result (scanf): '") + result + - _T("', expected: '") + expectedScanf + _T("'"); + msg = wxT("input: '") + input + + wxT("', result (scanf): '") + result + + wxT("', expected: '") + expectedScanf + wxT("'"); CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expectedScanf); #endif // !__WINDOWS__ #if wxUSE_UNICODE_UTF8 result = (const char*)wxFormatString(input); - msg = _T("input: '") + input + - _T("', result (UTF-8): '") + result + - _T("', expected: '") + expectedUtf8 + _T("'"); + msg = wxT("input: '") + input + + wxT("', result (UTF-8): '") + result + + wxT("', expected: '") + expectedUtf8 + wxT("'"); CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expectedUtf8); #endif // wxUSE_UNICODE_UTF8 @@ -318,9 +318,9 @@ void FormatConverterTestCase::check(const wxString& input, wxString expectedWchar(expectedWcharUnix); #endif - msg = _T("input: '") + input + - _T("', result (wchar_t): '") + result + - _T("', expected: '") + expectedWchar + _T("'"); + msg = wxT("input: '") + input + + wxT("', result (wchar_t): '") + result + + wxT("', expected: '") + expectedWchar + wxT("'"); CPPUNIT_ASSERT_MESSAGE(string(msg.mb_str()), result == expectedWchar); #endif // wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY } diff --git a/tests/hashes/hashes.cpp b/tests/hashes/hashes.cpp index bd62198675..fc2ccc3078 100644 --- a/tests/hashes/hashes.cpp +++ b/tests/hashes/hashes.cpp @@ -162,16 +162,16 @@ void HashesTestCase::wxHashTableTest() for ( i = 0; i < COUNT/2; ++i ) CPPUNIT_ASSERT( hash.Get(i) == NULL); - hash2.Put(_T("foo"), &o + 1); - hash2.Put(_T("bar"), &o + 2); - hash2.Put(_T("baz"), &o + 3); + hash2.Put(wxT("foo"), &o + 1); + hash2.Put(wxT("bar"), &o + 2); + hash2.Put(wxT("baz"), &o + 3); - CPPUNIT_ASSERT(hash2.Get(_T("moo")) == NULL); - CPPUNIT_ASSERT(hash2.Get(_T("bar")) == &o + 2); + CPPUNIT_ASSERT(hash2.Get(wxT("moo")) == NULL); + CPPUNIT_ASSERT(hash2.Get(wxT("bar")) == &o + 2); - hash2.Put(_T("bar"), &o + 0); + hash2.Put(wxT("bar"), &o + 0); - CPPUNIT_ASSERT(hash2.Get(_T("bar")) == &o + 2); + CPPUNIT_ASSERT(hash2.Get(wxT("bar")) == &o + 2); } // and now some corner-case testing; 3 and 13 hash to the same bucket @@ -523,16 +523,16 @@ void HashesTestCase::wxHashSetTest() { wxStringHashSet set1; - set1.insert( _T("abc") ); + set1.insert( wxT("abc") ); CPPUNIT_ASSERT( set1.size() == 1 ); - set1.insert( _T("bbc") ); - set1.insert( _T("cbc") ); + set1.insert( wxT("bbc") ); + set1.insert( wxT("cbc") ); CPPUNIT_ASSERT( set1.size() == 3 ); - set1.insert( _T("abc") ); + set1.insert( wxT("abc") ); CPPUNIT_ASSERT( set1.size() == 3 ); @@ -540,11 +540,11 @@ void HashesTestCase::wxHashSetTest() int dummy; MyStruct tmp; - tmp.ptr = &dummy; tmp.str = _T("ABC"); + tmp.ptr = &dummy; tmp.str = wxT("ABC"); set2.insert( tmp ); tmp.ptr = &dummy + 1; set2.insert( tmp ); - tmp.ptr = &dummy; tmp.str = _T("CDE"); + tmp.ptr = &dummy; tmp.str = wxT("CDE"); set2.insert( tmp ); CPPUNIT_ASSERT( set2.size() == 2 ); @@ -553,5 +553,5 @@ void HashesTestCase::wxHashSetTest() CPPUNIT_ASSERT( it != set2.end() ); CPPUNIT_ASSERT( it->ptr == &dummy ); - CPPUNIT_ASSERT( it->str == _T("ABC") ); + CPPUNIT_ASSERT( it->str == wxT("ABC") ); } diff --git a/tests/lists/lists.cpp b/tests/lists/lists.cpp index 907e87c70a..fb37655b8d 100644 --- a/tests/lists/lists.cpp +++ b/tests/lists/lists.cpp @@ -178,8 +178,8 @@ void ListsTestCase::wxListCtorTest() { { wxListBazs list1; - list1.Append(new Baz(_T("first"))); - list1.Append(new Baz(_T("second"))); + list1.Append(new Baz(wxT("first"))); + list1.Append(new Baz(wxT("second"))); CPPUNIT_ASSERT( list1.GetCount() == 2 ); CPPUNIT_ASSERT( Baz::GetNumber() == 2 ); diff --git a/tests/longlong/longlongtest.cpp b/tests/longlong/longlongtest.cpp index a9142a6fb5..f7790a1658 100644 --- a/tests/longlong/longlongtest.cpp +++ b/tests/longlong/longlongtest.cpp @@ -281,7 +281,7 @@ void LongLongTestCase::ToString() for ( size_t n = 0; n < WXSIZEOF(testLongs); n++ ) { wxLongLong a = testLongs[n]; - s1 = wxString::Format(_T("%ld"), testLongs[n]); + s1 = wxString::Format(wxT("%ld"), testLongs[n]); s2 = a.ToString(); CPPUNIT_ASSERT( s1 == s2 ); @@ -303,25 +303,25 @@ void LongLongTestCase::ToString() } wxLongLong a(0x12345678, 0x87654321); - CPPUNIT_ASSERT( a.ToString() == _T("1311768467139281697") ); + CPPUNIT_ASSERT( a.ToString() == wxT("1311768467139281697") ); a.Negate(); - CPPUNIT_ASSERT( a.ToString() == _T("-1311768467139281697") ); + CPPUNIT_ASSERT( a.ToString() == wxT("-1311768467139281697") ); wxLongLong llMin(-2147483647L - 1L, 0); - CPPUNIT_ASSERT( llMin.ToString() == _T("-9223372036854775808") ); + CPPUNIT_ASSERT( llMin.ToString() == wxT("-9223372036854775808") ); #if wxUSE_LONGLONG_WX wxLongLongWx a1(a.GetHi(), a.GetLo()); - CPPUNIT_ASSERT( a1.ToString() == _T("-1311768467139281697") ); + CPPUNIT_ASSERT( a1.ToString() == wxT("-1311768467139281697") ); a1.Negate(); - CPPUNIT_ASSERT( a1.ToString() == _T("1311768467139281697") ); + CPPUNIT_ASSERT( a1.ToString() == wxT("1311768467139281697") ); #endif #if wxUSE_LONGLONG_NATIVE wxLongLongNative a2(a.GetHi(), a.GetLo()); - CPPUNIT_ASSERT( a2.ToString() == _T("-1311768467139281697") ); + CPPUNIT_ASSERT( a2.ToString() == wxT("-1311768467139281697") ); a2.Negate(); - CPPUNIT_ASSERT( a2.ToString() == _T("1311768467139281697") ); + CPPUNIT_ASSERT( a2.ToString() == wxT("1311768467139281697") ); #endif } diff --git a/tests/mbconv/convautotest.cpp b/tests/mbconv/convautotest.cpp index f3cd098184..fbd7042012 100644 --- a/tests/mbconv/convautotest.cpp +++ b/tests/mbconv/convautotest.cpp @@ -78,37 +78,37 @@ void ConvAutoTestCase::TestFirstChar(const char *src, wchar_t wch) void ConvAutoTestCase::Empty() { - TestFirstChar("", _T('\0')); + TestFirstChar("", wxT('\0')); } void ConvAutoTestCase::Short() { - TestFirstChar("1", _T('1')); + TestFirstChar("1", wxT('1')); } void ConvAutoTestCase::None() { - TestFirstChar("Hello world", _T('H')); + TestFirstChar("Hello world", wxT('H')); } void ConvAutoTestCase::UTF32LE() { - TestFirstChar("\xff\xfe\0\0A\0\0\0", _T('A')); + TestFirstChar("\xff\xfe\0\0A\0\0\0", wxT('A')); } void ConvAutoTestCase::UTF32BE() { - TestFirstChar("\0\0\xfe\xff\0\0\0B", _T('B')); + TestFirstChar("\0\0\xfe\xff\0\0\0B", wxT('B')); } void ConvAutoTestCase::UTF16LE() { - TestFirstChar("\xff\xfeZ\0", _T('Z')); + TestFirstChar("\xff\xfeZ\0", wxT('Z')); } void ConvAutoTestCase::UTF16BE() { - TestFirstChar("\xfe\xff\0Y", _T('Y')); + TestFirstChar("\xfe\xff\0Y", wxT('Y')); } void ConvAutoTestCase::UTF8() diff --git a/tests/mbconv/mbconvtest.cpp b/tests/mbconv/mbconvtest.cpp index 5260887d7c..b91fe5954e 100644 --- a/tests/mbconv/mbconvtest.cpp +++ b/tests/mbconv/mbconvtest.cpp @@ -254,22 +254,22 @@ wxString CByteArrayFormat( const void* data, size_t len, const wxChar* name ) const unsigned char* bytes = (unsigned char*)data; wxString result; - result.Printf( _T("static const unsigned char %s[%i] = \n{"), name, (int)len ); + result.Printf( wxT("static const unsigned char %s[%i] = \n{"), name, (int)len ); for ( size_t i = 0; i < len; i++ ) { if ( i != 0 ) { - result.append( _T(",") ); + result.append( wxT(",") ); } if ((i%16)==0) { - result.append( _T("\n ") ); + result.append( wxT("\n ") ); } - wxString byte = wxString::Format( _T("0x%02x"), bytes[i] ); + wxString byte = wxString::Format( wxT("0x%02x"), bytes[i] ); result.append(byte); } - result.append( _T("\n};\n") ); + result.append( wxT("\n};\n") ); return result; } @@ -815,7 +815,7 @@ void MBConvTestCase::FontmapTests() void MBConvTestCase::BufSize() { - wxCSConv conv1251(_T("CP1251")); + wxCSConv conv1251(wxT("CP1251")); CPPUNIT_ASSERT( conv1251.IsOk() ); const char *cp1251text = "\313\301\326\305\324\323\321 \325\304\301\336\316\331\315"; @@ -842,7 +842,7 @@ void MBConvTestCase::BufSize() // test in the other direction too, using an encoding with multibyte NUL - wxCSConv convUTF16(_T("UTF-16LE")); + wxCSConv convUTF16(wxT("UTF-16LE")); CPPUNIT_ASSERT( convUTF16.IsOk() ); const wchar_t *utf16text = L"Hello"; diff --git a/tests/regex/regextest.cpp b/tests/regex/regextest.cpp index 822012b8e2..b12782a166 100644 --- a/tests/regex/regextest.cpp +++ b/tests/regex/regextest.cpp @@ -85,7 +85,7 @@ private: void parseFlags(const wxString& flags); void doTest(int flavor); static wxString quote(const wxString& arg); - const wxChar *convError() const { return _T(""); } + const wxChar *convError() const { return wxT(""); } // assertions - adds some information about the test that failed void fail(const wxString& msg) const; @@ -140,13 +140,13 @@ RegExTestCase::RegExTestCase( badconv = badconv || *m_expected.rbegin() == convError(); } - failIf(badconv, _T("cannot convert to default character encoding")); + failIf(badconv, wxT("cannot convert to default character encoding")); // the flags need further parsing... parseFlags(m_flags); #ifndef wxHAS_REGEX_ADVANCED - failIf(!m_basic && !m_extended, _T("advanced regexs not available")); + failIf(!m_basic && !m_extended, wxT("advanced regexs not available")); #endif } @@ -210,7 +210,7 @@ void RegExTestCase::parseFlags(const wxString& flags) // anything else we must skip the test default: fail(wxString::Format( - _T("requires unsupported flag '%c'"), *p)); + wxT("requires unsupported flag '%c'"), *p)); } } } @@ -237,29 +237,29 @@ void RegExTestCase::doTest(int flavor) // 'e' - test that the pattern fails to compile if (m_mode == 'e') { - failIf(re.IsValid(), _T("compile succeeded (should fail)")); + failIf(re.IsValid(), wxT("compile succeeded (should fail)")); return; } - failIf(!re.IsValid(), _T("compile failed")); + failIf(!re.IsValid(), wxT("compile failed")); bool matches = re.Matches(m_data, m_matchFlags); // 'f' or 'p' - test that the pattern does not match if (m_mode == 'f' || m_mode == 'p') { - failIf(matches, _T("match succeeded (should fail)")); + failIf(matches, wxT("match succeeded (should fail)")); return; } // otherwise 'm' or 'i' - test the pattern does match - failIf(!matches, _T("match failed")); + failIf(!matches, wxT("match failed")); if (m_compileFlags & wxRE_NOSUB) return; // check wxRegEx has correctly counted the number of subexpressions wxString msg; - msg << _T("GetMatchCount() == ") << re.GetMatchCount() - << _T(", expected ") << m_expected.size(); + msg << wxT("GetMatchCount() == ") << re.GetMatchCount() + << wxT(", expected ") << m_expected.size(); failIf(m_expected.size() != re.GetMatchCount(), msg); for (size_t i = 0; i < m_expected.size(); i++) { @@ -267,7 +267,7 @@ void RegExTestCase::doTest(int flavor) size_t start, len; msg.clear(); - msg << _T("wxRegEx::GetMatch failed for match ") << i; + msg << wxT("wxRegEx::GetMatch failed for match ") << i; failIf(!re.GetMatch(&start, &len, i), msg); // m - check the match returns the strings given @@ -276,23 +276,23 @@ void RegExTestCase::doTest(int flavor) if (start < INT_MAX) result = m_data.substr(start, len); else - result = _T(""); + result = wxT(""); } // i - check the match returns the offsets given else if (m_mode == 'i') { if (start > INT_MAX) - result = _T("-1 -1"); + result = wxT("-1 -1"); else if (start + len > 0) - result << start << _T(" ") << start + len - 1; + result << start << wxT(" ") << start + len - 1; else - result << start << _T(" -1"); + result << start << wxT(" -1"); } msg.clear(); - msg << _T("match(") << i << _T(") == ") << quote(result) - << _T(", expected == ") << quote(m_expected[i]); + msg << wxT("match(") << i << wxT(") == ") << quote(result) + << wxT(", expected == ") << quote(m_expected[i]); failIf(result != m_expected[i], msg); } } @@ -304,16 +304,16 @@ void RegExTestCase::fail(const wxString& msg) const wxString str; wxArrayString::const_iterator it; - str << (wxChar)m_mode << _T(" ") << m_id << _T(" ") << m_flags << _T(" ") - << quote(m_pattern) << _T(" ") << quote(m_data); + str << (wxChar)m_mode << wxT(" ") << m_id << wxT(" ") << m_flags << wxT(" ") + << quote(m_pattern) << wxT(" ") << quote(m_data); for (it = m_expected.begin(); it != m_expected.end(); ++it) - str << _T(" ") << quote(*it); + str << wxT(" ") << quote(*it); if (str.length() > 77) - str = str.substr(0, 74) + _T("..."); + str = str.substr(0, 74) + wxT("..."); - str << _T("\n ") << msg; + str << wxT("\n ") << msg; // no lossy convs so using utf8 CPPUNIT_FAIL(string(str.mb_str(wxConvUTF8))); @@ -323,8 +323,8 @@ void RegExTestCase::fail(const wxString& msg) const // wxString RegExTestCase::quote(const wxString& arg) { - const wxChar *needEscape = _T("\a\b\t\n\v\f\r\"\\"); - const wxChar *escapes = _T("abtnvfr\"\\"); + const wxChar *needEscape = wxT("\a\b\t\n\v\f\r\"\\"); + const wxChar *escapes = wxT("abtnvfr\"\\"); wxString str; for (size_t i = 0; i < arg.length(); i++) { @@ -332,15 +332,15 @@ wxString RegExTestCase::quote(const wxString& arg) const wxChar *p = wxStrchr(needEscape, ch); if (p) - str += wxString::Format(_T("\\%c"), escapes[p - needEscape]); + str += wxString::Format(wxT("\\%c"), escapes[p - needEscape]); else if (wxIscntrl(ch)) - str += wxString::Format(_T("\\%03o"), ch); + str += wxString::Format(wxT("\\%03o"), ch); else str += (wxChar)ch; } return str.length() == arg.length() && str.find(' ') == wxString::npos ? - str : _T("\"") + str + _T("\""); + str : wxT("\"") + str + wxT("\""); } @@ -380,7 +380,7 @@ void RegExTestSuite::add( name, mode, id, flags, pattern, data, expected_results)); } catch (Exception& e) { - wxLogInfo(wxString::Format(_T("skipping: %s\n %s\n"), + wxLogInfo(wxString::Format(wxT("skipping: %s\n %s\n"), wxString(name.c_str(), wxConvUTF8).c_str(), wxString(e.what(), wxConvUTF8).c_str())); } diff --git a/tests/regex/wxregextest.cpp b/tests/regex/wxregextest.cpp index 38286da82c..b88b9421a0 100644 --- a/tests/regex/wxregextest.cpp +++ b/tests/regex/wxregextest.cpp @@ -104,7 +104,7 @@ void RegExMatchTestCase::runTest() CPPUNIT_ASSERT_MESSAGE("match failed", ok); wxStringTokenizer tkz(wxString(m_expected, *wxConvCurrent), - _T("\t"), wxTOKEN_RET_EMPTY); + wxT("\t"), wxTOKEN_RET_EMPTY); size_t i; for (i = 0; i < re.GetMatchCount() && tkz.HasMoreTokens(); i++) { @@ -112,7 +112,7 @@ void RegExMatchTestCase::runTest() wxString result = re.GetMatch(m_text, i); wxString msgstr; - msgstr.Printf(_T("\\%d == '%s' (expected '%s')"), + msgstr.Printf(wxT("\\%d == '%s' (expected '%s')"), (int)i, result.c_str(), expected.c_str()); CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), @@ -166,10 +166,10 @@ void RegExReplaceTestCase::runTest() size_t nRepl = re.Replace(&text, m_repl); wxString msgstr; - msgstr.Printf(_T("returns '%s' (expected '%s')"), text.c_str(), m_expected.c_str()); + msgstr.Printf(wxT("returns '%s' (expected '%s')"), text.c_str(), m_expected.c_str()); CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), text == m_expected); - msgstr.Printf(_T("matches %d times (expected %d)"), (int)nRepl, (int)m_count); + msgstr.Printf(wxT("matches %d times (expected %d)"), (int)nRepl, (int)m_count); CPPUNIT_ASSERT_MESSAGE((const char*)msgstr.mb_str(), nRepl == m_count); } @@ -258,7 +258,7 @@ void wxRegExTestSuite::add( int flags /*=wxRE_DEFAULT*/) { addTest(new RegExCompileTestCase( - (_T("/") + Conv(pattern) + _T("/") + FlagStr(flags)).mb_str(), + (wxT("/") + Conv(pattern) + wxT("/") + FlagStr(flags)).mb_str(), Conv(pattern), correct, flags)); } @@ -272,9 +272,9 @@ void wxRegExTestSuite::add( { wxString name; - name << _T("'") << Conv(text) << _T("' =~ /") << Conv(pattern) << _T("/") + name << wxT("'") << Conv(text) << wxT("' =~ /") << Conv(pattern) << wxT("/") << FlagStr(flags); - name.Replace(_T("\n"), _T("\\n")); + name.Replace(wxT("\n"), wxT("\\n")); addTest(new RegExMatchTestCase(name.mb_str(), Conv(pattern), Conv(text), expected, flags)); @@ -292,9 +292,9 @@ void wxRegExTestSuite::add( { wxString name; - name << _T("'") << Conv(text) << _T("' =~ s/") << Conv(pattern) << _T("/") - << Conv(replacement) << _T("/g") << FlagStr(flags); - name.Replace(_T("\n"), _T("\\n")); + name << wxT("'") << Conv(text) << wxT("' =~ s/") << Conv(pattern) << wxT("/") + << Conv(replacement) << wxT("/g") << FlagStr(flags); + name.Replace(wxT("\n"), wxT("\\n")); addTest(new RegExReplaceTestCase( name.mb_str(), Conv(pattern), Conv(text), @@ -314,19 +314,19 @@ wxString wxRegExTestSuite::FlagStr(int flags) switch (flags & (1 << i)) { case 0: break; #ifdef wxHAS_REGEX_ADVANCED - case wxRE_ADVANCED: str += _T(" | wxRE_ADVANCED"); break; + case wxRE_ADVANCED: str += wxT(" | wxRE_ADVANCED"); break; #endif - case wxRE_BASIC: str += _T(" | wxRE_BASIC"); break; - case wxRE_ICASE: str += _T(" | wxRE_ICASE"); break; - case wxRE_NOSUB: str += _T(" | wxRE_NOSUB"); break; - case wxRE_NEWLINE: str += _T(" | wxRE_NEWLINE"); break; - case wxRE_NOTBOL: str += _T(" | wxRE_NOTBOL"); break; - case wxRE_NOTEOL: str += _T(" | wxRE_NOTEOL"); break; + case wxRE_BASIC: str += wxT(" | wxRE_BASIC"); break; + case wxRE_ICASE: str += wxT(" | wxRE_ICASE"); break; + case wxRE_NOSUB: str += wxT(" | wxRE_NOSUB"); break; + case wxRE_NEWLINE: str += wxT(" | wxRE_NEWLINE"); break; + case wxRE_NOTBOL: str += wxT(" | wxRE_NOTBOL"); break; + case wxRE_NOTEOL: str += wxT(" | wxRE_NOTEOL"); break; default: wxFAIL; break; } } - return _T(" (") + str.Mid(3) + _T(")"); + return wxT(" (") + str.Mid(3) + wxT(")"); } // register in the unnamed registry so that these tests are run by default diff --git a/tests/streams/bstream.h b/tests/streams/bstream.h index 677436b459..f3ae238c33 100644 --- a/tests/streams/bstream.h +++ b/tests/streams/bstream.h @@ -400,7 +400,7 @@ protected: { if (m_pCurrentIn) { - wxFAIL_MSG(_T("Error in test case, the previouse input stream needs to be delete first!")); + wxFAIL_MSG(wxT("Error in test case, the previouse input stream needs to be delete first!")); } m_pCurrentIn = DoCreateInStream(); @@ -411,7 +411,7 @@ protected: { if (m_pCurrentOut) { - wxFAIL_MSG(_T("Error in test case, the previouse output stream needs to be delete first!")); + wxFAIL_MSG(wxT("Error in test case, the previouse output stream needs to be delete first!")); } m_pCurrentOut = DoCreateOutStream(); diff --git a/tests/streams/datastreamtest.cpp b/tests/streams/datastreamtest.cpp index efe700336c..30d90b2396 100644 --- a/tests/streams/datastreamtest.cpp +++ b/tests/streams/datastreamtest.cpp @@ -75,7 +75,7 @@ DataStreamTestCase::DataStreamTestCase() static wxFloat64 TestFloatRW(wxFloat64 fValue) { - wxFileOutputStream* pFileOutput = new wxFileOutputStream( _T("mytext.dat") ); + wxFileOutputStream* pFileOutput = new wxFileOutputStream( wxT("mytext.dat") ); wxDataOutputStream* pDataOutput = new wxDataOutputStream( *pFileOutput ); *pDataOutput << fValue; @@ -83,7 +83,7 @@ wxFloat64 TestFloatRW(wxFloat64 fValue) delete pDataOutput; delete pFileOutput; - wxFileInputStream* pFileInput = new wxFileInputStream( _T("mytext.dat") ); + wxFileInputStream* pFileInput = new wxFileInputStream( wxT("mytext.dat") ); wxDataInputStream* pDataInput = new wxDataInputStream( *pFileInput ); wxFloat64 fInFloat; @@ -115,14 +115,14 @@ private: ValueArray InValues(Size); { - wxFileOutputStream FileOutput( _T("mytext.dat") ); + wxFileOutputStream FileOutput( wxT("mytext.dat") ); wxDataOutputStream DataOutput( FileOutput ); (DataOutput.*pfnWriter)(Values, Size); } { - wxFileInputStream FileInput( _T("mytext.dat") ); + wxFileInputStream FileInput( wxT("mytext.dat") ); wxDataInputStream DataInput( FileInput ); (DataInput.*pfnReader)(&*InValues.begin(), InValues.size()); @@ -165,14 +165,14 @@ T TestRW(const T &Value) T InValue; { - wxFileOutputStream FileOutput( _T("mytext.dat") ); + wxFileOutputStream FileOutput( wxT("mytext.dat") ); wxDataOutputStream DataOutput( FileOutput ); DataOutput << Value; } { - wxFileInputStream FileInput( _T("mytext.dat") ); + wxFileInputStream FileInput( wxT("mytext.dat") ); wxDataInputStream DataInput( FileInput ); DataInput >> InValue; diff --git a/tests/streams/ffilestream.cpp b/tests/streams/ffilestream.cpp index 9714e1cbb0..bbde858570 100644 --- a/tests/streams/ffilestream.cpp +++ b/tests/streams/ffilestream.cpp @@ -26,8 +26,8 @@ #define DATABUFFER_SIZE 1024 -static const wxString FILENAME_FFILEINSTREAM = _T("ffileinstream.test"); -static const wxString FILENAME_FFILEOUTSTREAM = _T("ffileoutstream.test"); +static const wxString FILENAME_FFILEINSTREAM = wxT("ffileinstream.test"); +static const wxString FILENAME_FFILEOUTSTREAM = wxT("ffileoutstream.test"); /////////////////////////////////////////////////////////////////////////////// // The test case diff --git a/tests/streams/filestream.cpp b/tests/streams/filestream.cpp index b0edd46557..e817c8d8d9 100644 --- a/tests/streams/filestream.cpp +++ b/tests/streams/filestream.cpp @@ -26,8 +26,8 @@ #define DATABUFFER_SIZE 1024 -static const wxString FILENAME_FILEINSTREAM = _T("fileinstream.test"); -static const wxString FILENAME_FILEOUTSTREAM = _T("fileoutstream.test"); +static const wxString FILENAME_FILEINSTREAM = wxT("fileinstream.test"); +static const wxString FILENAME_FILEOUTSTREAM = wxT("fileoutstream.test"); /////////////////////////////////////////////////////////////////////////////// // The test case diff --git a/tests/streams/largefile.cpp b/tests/streams/largefile.cpp index 6d6a0f7948..36ddbb04d9 100644 --- a/tests/streams/largefile.cpp +++ b/tests/streams/largefile.cpp @@ -83,7 +83,7 @@ void LargeFileTest::runTest() { // self deleting temp file struct TmpFile { - TmpFile() : m_name(wxFileName::CreateTempFileName(_T("wxlfs-"))) { } + TmpFile() : m_name(wxFileName::CreateTempFileName(wxT("wxlfs-"))) { } ~TmpFile() { if (!m_name.empty()) wxRemoveFile(m_name); } wxString m_name; } tmpfile; @@ -96,12 +96,12 @@ void LargeFileTest::runTest() if (!HasLFS()) { haveLFS = false; wxString n(getName().c_str(), *wxConvCurrent); - wxLogInfo(n + _T(": No large file support, testing up to 2GB only")); + wxLogInfo(n + wxT(": No large file support, testing up to 2GB only")); } else if (IsFAT(tmpfile.m_name)) { fourGigLimit = true; wxString n(getName().c_str(), *wxConvCurrent); - wxLogInfo(n + _T(": FAT volumes are limited to 4GB files")); + wxLogInfo(n + wxT(": FAT volumes are limited to 4GB files")); } // size of the test blocks @@ -258,7 +258,7 @@ wxInputStream *LargeFileTest_wxFFile::MakeInStream(const wxString& name) const wxOutputStream *LargeFileTest_wxFFile::MakeOutStream(const wxString& name) const { - wxFFile file(name, _T("w")); + wxFFile file(name, wxT("w")); CPPUNIT_ASSERT(file.IsOpened()); FILE *fp = file.fp(); file.Detach(); @@ -333,17 +333,17 @@ void GetVolumeInfo(const wxString& path) // extract the volume 'C:\' or '\\tooter\share\' from the path wxString vol; - if (path.substr(1, 2) == _T(":\\")) { + if (path.substr(1, 2) == wxT(":\\")) { vol = path.substr(0, 3); } else { - if (path.substr(0, 2) == _T("\\\\")) { - size_t i = path.find(_T('\\'), 2); + if (path.substr(0, 2) == wxT("\\\\")) { + size_t i = path.find(wxT('\\'), 2); if (i != wxString::npos && i > 2) { - size_t j = path.find(_T('\\'), ++i); + size_t j = path.find(wxT('\\'), ++i); if (j != i) - vol = path.substr(0, j) + _T("\\"); + vol = path.substr(0, j) + wxT("\\"); } } } @@ -357,7 +357,7 @@ void GetVolumeInfo(const wxString& path) volumeType, WXSIZEOF(volumeType))) { - wxLogSysError(_T("GetVolumeInformation() failed")); + wxLogSysError(wxT("GetVolumeInformation() failed")); } volumeInfoInit = true; @@ -367,7 +367,7 @@ bool IsFAT(const wxString& path) { if (!volumeInfoInit) GetVolumeInfo(path); - return wxString(volumeType).Upper().find(_T("FAT")) != wxString::npos; + return wxString(volumeType).Upper().find(wxT("FAT")) != wxString::npos; } void MakeSparse(const wxString& path, int fd) @@ -388,7 +388,7 @@ CppUnit::Test* GetlargeFileSuite() { if (!volumeInfoInit) { wxFile file; - wxString path = wxFileName::CreateTempFileName(_T("wxlfs-"), &file); + wxString path = wxFileName::CreateTempFileName(wxT("wxlfs-"), &file); MakeSparse(path, file.fd()); wxRemoveFile(path); } diff --git a/tests/streams/sstream.cpp b/tests/streams/sstream.cpp index a6d7890183..266360911e 100644 --- a/tests/streams/sstream.cpp +++ b/tests/streams/sstream.cpp @@ -80,7 +80,7 @@ strStream::strStream() m_str.reserve(LEN); for ( size_t n = 0; n < LEN; n++ ) { - m_str += wxChar(_T('A') + n % (_T('Z') - _T('A') + 1)); + m_str += wxChar(wxT('A') + n % (wxT('Z') - wxT('A') + 1)); } } diff --git a/tests/streams/tempfile.cpp b/tests/streams/tempfile.cpp index 9fe28801e2..bd1d3e29ee 100644 --- a/tests/streams/tempfile.cpp +++ b/tests/streams/tempfile.cpp @@ -43,7 +43,7 @@ private: TestFile::TestFile() { wxFile file; - m_name = wxFileName::CreateTempFileName(_T("wxtest"), &file); + m_name = wxFileName::CreateTempFileName(wxT("wxtest"), &file); file.Write("Before", 6); } diff --git a/tests/streams/textstreamtest.cpp b/tests/streams/textstreamtest.cpp index 16cbcdee94..4580a88a34 100644 --- a/tests/streams/textstreamtest.cpp +++ b/tests/streams/textstreamtest.cpp @@ -104,15 +104,15 @@ TextStreamTestCase::TextStreamTestCase() void TextStreamTestCase::Endline() { - wxFileOutputStream* pOutFile = new wxFileOutputStream(_T("test.txt")); + wxFileOutputStream* pOutFile = new wxFileOutputStream(wxT("test.txt")); wxTextOutputStream* pOutText = new wxTextOutputStream(*pOutFile); - *pOutText << _T("Test text") << endl - << _T("More Testing Text (There should be newline before this)"); + *pOutText << wxT("Test text") << endl + << wxT("More Testing Text (There should be newline before this)"); delete pOutText; delete pOutFile; - wxFileInputStream* pInFile = new wxFileInputStream(_T("test.txt")); + wxFileInputStream* pInFile = new wxFileInputStream(wxT("test.txt")); char szIn[9 + NEWLINELEN]; @@ -129,7 +129,7 @@ template static void DoTestRoundTrip(const T *values, size_t numValues) { { - wxFileOutputStream fileOut(_T("test.txt")); + wxFileOutputStream fileOut(wxT("test.txt")); wxTextOutputStream textOut(fileOut); for ( size_t n = 0; n < numValues; n++ ) @@ -139,7 +139,7 @@ static void DoTestRoundTrip(const T *values, size_t numValues) } { - wxFileInputStream fileIn(_T("test.txt")); + wxFileInputStream fileIn(wxT("test.txt")); wxTextInputStream textIn(fileIn); T value; diff --git a/tests/streams/zlibstream.cpp b/tests/streams/zlibstream.cpp index 92ed46edc2..b993a65ef5 100644 --- a/tests/streams/zlibstream.cpp +++ b/tests/streams/zlibstream.cpp @@ -35,7 +35,7 @@ using std::string; #define DATABUFFER_SIZE 1024 -static const wxString FILENAME_GZ = _T("zlibtest.gz"); +static const wxString FILENAME_GZ = wxT("zlibtest.gz"); /////////////////////////////////////////////////////////////////////////////// // The test case @@ -161,7 +161,7 @@ zlibStream::zlibStream() /* Example code on how to produce test data... { - wxFFileOutputStream fstream_out(_T("gentest.cpp")); + wxFFileOutputStream fstream_out(wxT("gentest.cpp")); wxTextOutputStream out( fstream_out ); genExtTestData(out, "zlib data created with wxWidgets 2.5.x [March 27], wxZLIB_NO_HEADER, zlib 1.1.4", wxZLIB_NO_HEADER); @@ -377,10 +377,10 @@ void zlibStream::doTestStreamData(int input_flag, int output_flag, int compress_ if (fail_pos != DATABUFFER_SIZE || !bWasEOF) { wxString msg; - msg << _T("Wrong data item at pos ") << fail_pos - << _T(" (Org_val ") << GetDataBuffer()[fail_pos] - << _T(" != Zlib_val ") << last_value - << _T("), with compression level ") << compress_level; + msg << wxT("Wrong data item at pos ") << fail_pos + << wxT(" (Org_val ") << GetDataBuffer()[fail_pos] + << wxT(" != Zlib_val ") << last_value + << wxT("), with compression level ") << compress_level; CPPUNIT_FAIL(string(msg.mb_str())); } } @@ -401,23 +401,23 @@ void zlibStream::doDecompress_ExternalData(const unsigned char *data, const char case wxZLIB_ZLIB: if (!(data_size >= 1 && data[0] == 0x78)) { - wxLogError(_T("zlib data seems to not be zlib data!")); + wxLogError(wxT("zlib data seems to not be zlib data!")); } break; case wxZLIB_GZIP: if (!(data_size >= 2 && data[0] == 0x1F && data[1] == 0x8B)) { - wxLogError(_T("gzip data seems to not be gzip data!")); + wxLogError(wxT("gzip data seems to not be gzip data!")); } break; case wxZLIB_AUTO: if (!(data_size >= 1 && data[0] == 0x78) || !(data_size >= 2 && data[0] == 0x1F && data[1] == 0x8B)) { - wxLogError(_T("Data seems to not be zlib or gzip data!")); + wxLogError(wxT("Data seems to not be zlib or gzip data!")); } default: - wxLogError(_T("Unknown flag, skipping quick test.")); + wxLogError(wxT("Unknown flag, skipping quick test.")); }; // Creat the needed streams. @@ -528,25 +528,25 @@ void zlibStream::genExtTestData(wxTextOutputStream &out, const char *buf, int fl memstream_out.CopyTo(data, size); } - out << _T("void zlibStream::Decompress_wxXXXData()") << _T("\n"); - out << _T("{") << _T("\n") << _T(" const unsigned char data[] = {"); + out << wxT("void zlibStream::Decompress_wxXXXData()") << wxT("\n"); + out << wxT("{") << wxT("\n") << wxT(" const unsigned char data[] = {"); size_t i; for (i = 0; i < size; i++) { if (i+1 != size) - out << wxString::Format(_T("%d,"), data[i]); + out << wxString::Format(wxT("%d,"), data[i]); else - out << wxString::Format(_T("%d"), data[i]); + out << wxString::Format(wxT("%d"), data[i]); } delete [] data; - out << _T("};") << _T("\n"); - out << _T(" const char *value = \"") << wxString(buf, wxConvUTF8) << _T("\";") << _T("\n"); - out << _T(" const size_t data_size = sizeof(data);") << _T("\n"); - out << _T(" const size_t value_size = strlen(value);") << _T("\n"); - out << _T(" doDecompress_ExternalData(data, value, data_size, value_size);") << _T("\n"); - out << _T("}") << _T("\n"); + out << wxT("};") << wxT("\n"); + out << wxT(" const char *value = \"") << wxString(buf, wxConvUTF8) << wxT("\";") << wxT("\n"); + out << wxT(" const size_t data_size = sizeof(data);") << wxT("\n"); + out << wxT(" const size_t value_size = strlen(value);") << wxT("\n"); + out << wxT(" doDecompress_ExternalData(data, value, data_size, value_size);") << wxT("\n"); + out << wxT("}") << wxT("\n"); } diff --git a/tests/strings/crt.cpp b/tests/strings/crt.cpp index e4e69caa16..c0c6600a2f 100644 --- a/tests/strings/crt.cpp +++ b/tests/strings/crt.cpp @@ -69,15 +69,15 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( CrtTestCase, "CrtTestCase" ); void CrtTestCase::SetGetEnv() { -#define TESTVAR_NAME _T("WXTESTVAR") +#define TESTVAR_NAME wxT("WXTESTVAR") wxString val; - wxSetEnv(TESTVAR_NAME, _T("value")); + wxSetEnv(TESTVAR_NAME, wxT("value")); CPPUNIT_ASSERT( wxGetEnv(TESTVAR_NAME, &val) ); CPPUNIT_ASSERT_EQUAL( "value", val ); CPPUNIT_ASSERT_EQUAL( "value", wxString(wxGetenv(TESTVAR_NAME)) ); - wxSetEnv(TESTVAR_NAME, _T("something else")); + wxSetEnv(TESTVAR_NAME, wxT("something else")); CPPUNIT_ASSERT( wxGetEnv(TESTVAR_NAME, &val) ); CPPUNIT_ASSERT_EQUAL( "something else", val ); CPPUNIT_ASSERT_EQUAL( "something else", wxString(wxGetenv(TESTVAR_NAME)) ); diff --git a/tests/strings/stdstrings.cpp b/tests/strings/stdstrings.cpp index a66a7b7790..294eb923d6 100644 --- a/tests/strings/stdstrings.cpp +++ b/tests/strings/stdstrings.cpp @@ -86,22 +86,22 @@ StdStringTestCase::StdStringTestCase() void StdStringTestCase::StdConstructors() { - wxString s1(_T("abcdefgh")), - s2(_T("abcdefghijklm"), 8), - s3(_T("abcdefghijklm")), - s4(8, _T('a')); + wxString s1(wxT("abcdefgh")), + s2(wxT("abcdefghijklm"), 8), + s3(wxT("abcdefghijklm")), + s4(8, wxT('a')); wxString s5(s1), s6(s3, 0, 8), s7(s3.begin(), s3.begin() + 8); wxString s8(s1, 4, 8); - CPPUNIT_ASSERT_EQUAL( _T("abcdefgh"), s1 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcdefgh"), s1 ); CPPUNIT_ASSERT_EQUAL( s1, s2 ); - CPPUNIT_ASSERT_EQUAL( _T("aaaaaaaa"), s4 ); - CPPUNIT_ASSERT_EQUAL( _T("abcdefgh"), s5 ); + CPPUNIT_ASSERT_EQUAL( wxT("aaaaaaaa"), s4 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcdefgh"), s5 ); CPPUNIT_ASSERT_EQUAL( s1, s6 ); CPPUNIT_ASSERT_EQUAL( s1, s7 ); - CPPUNIT_ASSERT_EQUAL( _T("efgh"), s8 ); + CPPUNIT_ASSERT_EQUAL( wxT("efgh"), s8 ); const char *pc = s1.c_str(); CPPUNIT_ASSERT_EQUAL( "bcd", wxString(pc + 1, pc + 4) ); @@ -123,22 +123,22 @@ void StdStringTestCase::StdAppend() { wxString s1, s2, s3, s4, s5, s6, s7, s8; - s1 = s2 = s3 = s4 = s5 = s6 = _T("abc"); - s1.append(_T("def")); - s2.append(_T("defgh"), 3); - s3.append(wxString(_T("abcdef")), 3, 6); + s1 = s2 = s3 = s4 = s5 = s6 = wxT("abc"); + s1.append(wxT("def")); + s2.append(wxT("defgh"), 3); + s3.append(wxString(wxT("abcdef")), 3, 6); s4.append(s1); - s5.append(3, _T('a')); + s5.append(3, wxT('a')); s5.append(2, 'x'); s5.append(1, (unsigned char)'y'); s6.append(s1.begin() + 3, s1.end()); - CPPUNIT_ASSERT_EQUAL( _T("abcdef"), s1 ); - CPPUNIT_ASSERT_EQUAL( _T("abcdef"), s2 ); - CPPUNIT_ASSERT_EQUAL( _T("abcdef"), s3 ); - CPPUNIT_ASSERT_EQUAL( _T("abcabcdef"), s4 ); - CPPUNIT_ASSERT_EQUAL( _T("abcaaaxxy"), s5 ); - CPPUNIT_ASSERT_EQUAL( _T("abcdef"), s6 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcdef"), s1 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcdef"), s2 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcdef"), s3 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcabcdef"), s4 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcaaaxxy"), s5 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcdef"), s6 ); const char *pc = s1.c_str() + 2; s7.append(pc, pc + 4); @@ -148,33 +148,33 @@ void StdStringTestCase::StdAppend() s8.append(pw, pw + 4); CPPUNIT_ASSERT_EQUAL( "cdef", s8 ); - s7 = s8 = wxString(_T("null\0time"), 9); + s7 = s8 = wxString(wxT("null\0time"), 9); - s7.append(_T("def")); - s8.append(_T("defgh"), 3); + s7.append(wxT("def")); + s8.append(wxT("defgh"), 3); - CPPUNIT_ASSERT_EQUAL( wxString(_T("null\0timedef"), 12), s7 ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("null\0timedef"), 12), s8 ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("null\0timedef"), 12), s7 ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("null\0timedef"), 12), s8 ); } void StdStringTestCase::StdAssign() { wxString s1, s2, s3, s4, s5, s6, s7, s8; - s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = _T("abc"); - s1.assign(_T("def")); - s2.assign(_T("defgh"), 3); - s3.assign(wxString(_T("abcdef")), 3, 6); + s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = wxT("abc"); + s1.assign(wxT("def")); + s2.assign(wxT("defgh"), 3); + s3.assign(wxString(wxT("abcdef")), 3, 6); s4.assign(s1); - s5.assign(3, _T('a')); + s5.assign(3, wxT('a')); s6.assign(s1.begin() + 1, s1.end()); - CPPUNIT_ASSERT_EQUAL( _T("def"), s1 ); - CPPUNIT_ASSERT_EQUAL( _T("def"), s2 ); - CPPUNIT_ASSERT_EQUAL( _T("def"), s3 ); - CPPUNIT_ASSERT_EQUAL( _T("def"), s4 ); - CPPUNIT_ASSERT_EQUAL( _T("aaa"), s5 ); - CPPUNIT_ASSERT_EQUAL( _T("ef"), s6 ); + CPPUNIT_ASSERT_EQUAL( wxT("def"), s1 ); + CPPUNIT_ASSERT_EQUAL( wxT("def"), s2 ); + CPPUNIT_ASSERT_EQUAL( wxT("def"), s3 ); + CPPUNIT_ASSERT_EQUAL( wxT("def"), s4 ); + CPPUNIT_ASSERT_EQUAL( wxT("aaa"), s5 ); + CPPUNIT_ASSERT_EQUAL( wxT("ef"), s6 ); const char *pc = s1.c_str(); s7.assign(pc, pc + 2); @@ -192,12 +192,12 @@ void StdStringTestCase::StdCompare() { wxString s1, s2, s3, s4, s5, s6, s7, s8; - s1 = _T("abcdefgh"); - s2 = _T("abcdefgh"); - s3 = _T("abc"); - s4 = _T("abcdefghi"); - s5 = _T("aaa"); - s6 = _T("zzz"); + s1 = wxT("abcdefgh"); + s2 = wxT("abcdefgh"); + s3 = wxT("abc"); + s4 = wxT("abcdefghi"); + s5 = wxT("aaa"); + s6 = wxT("zzz"); CPPUNIT_ASSERT( s1.compare(s2) == 0 ); CPPUNIT_ASSERT( s1.compare(s3) > 0 ); @@ -205,22 +205,22 @@ void StdStringTestCase::StdCompare() CPPUNIT_ASSERT( s1.compare(s5) > 0 ); CPPUNIT_ASSERT( s1.compare(s6) < 0 ); CPPUNIT_ASSERT( s1.compare(1, 12, s1) > 0); - CPPUNIT_ASSERT( s1.compare(_T("abcdefgh")) == 0); - CPPUNIT_ASSERT( s1.compare(1, 7, _T("bcdefgh")) == 0); - CPPUNIT_ASSERT( s1.compare(1, 7, _T("bcdefgh"), 7) == 0); + CPPUNIT_ASSERT( s1.compare(wxT("abcdefgh")) == 0); + CPPUNIT_ASSERT( s1.compare(1, 7, wxT("bcdefgh")) == 0); + CPPUNIT_ASSERT( s1.compare(1, 7, wxT("bcdefgh"), 7) == 0); } void StdStringTestCase::StdErase() { wxString s1, s2, s3, s4, s5, s6, s7; - s1 = _T("abcdefgh"); - s2 = _T("abcdefgh"); - s3 = _T("abc"); - s4 = _T("abcdefghi"); - s5 = _T("aaa"); - s6 = _T("zzz"); - s7 = _T("zabcdefg"); + s1 = wxT("abcdefgh"); + s2 = wxT("abcdefgh"); + s3 = wxT("abc"); + s4 = wxT("abcdefghi"); + s5 = wxT("aaa"); + s6 = wxT("zzz"); + s7 = wxT("zabcdefg"); s1.erase(1, 1); s2.erase(4, 12); @@ -228,13 +228,13 @@ void StdStringTestCase::StdErase() wxString::iterator it2 = s4.erase(s4.begin() + 4, s4.begin() + 6); wxString::iterator it3 = s7.erase(s7.begin() + 4, s7.begin() + 8); - CPPUNIT_ASSERT_EQUAL( _T("acdefgh"), s1 ); - CPPUNIT_ASSERT_EQUAL( _T("abcd"), s2 ); - CPPUNIT_ASSERT_EQUAL( _T("ac"), s3 ); - CPPUNIT_ASSERT_EQUAL( _T("abcdghi"), s4 ); - CPPUNIT_ASSERT_EQUAL( _T("zabc"), s7 ); - CPPUNIT_ASSERT( *it == _T('c') ); - CPPUNIT_ASSERT( *it2 == _T('g') ); + CPPUNIT_ASSERT_EQUAL( wxT("acdefgh"), s1 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcd"), s2 ); + CPPUNIT_ASSERT_EQUAL( wxT("ac"), s3 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcdghi"), s4 ); + CPPUNIT_ASSERT_EQUAL( wxT("zabc"), s7 ); + CPPUNIT_ASSERT( *it == wxT('c') ); + CPPUNIT_ASSERT( *it2 == wxT('g') ); CPPUNIT_ASSERT( it3 == s7.end() ); } @@ -242,20 +242,20 @@ void StdStringTestCase::StdFind() { // 0 1 2 // 01234567890123456789012345 - wxString s1 = _T("abcdefgABCDEFGabcABCabcABC"); - wxString s2 = _T("gAB"); + wxString s1 = wxT("abcdefgABCDEFGabcABCabcABC"); + wxString s2 = wxT("gAB"); - CPPUNIT_ASSERT( s1.find(_T('A')) == 7u ); - CPPUNIT_ASSERT( s1.find(_T('A'), 7) == 7u ); - CPPUNIT_ASSERT( s1.find(_T('Z')) == wxString::npos ); - CPPUNIT_ASSERT( s1.find(_T('C'), 22) == 25u ); + CPPUNIT_ASSERT( s1.find(wxT('A')) == 7u ); + CPPUNIT_ASSERT( s1.find(wxT('A'), 7) == 7u ); + CPPUNIT_ASSERT( s1.find(wxT('Z')) == wxString::npos ); + CPPUNIT_ASSERT( s1.find(wxT('C'), 22) == 25u ); - CPPUNIT_ASSERT( s1.find(_T("gAB")) == 6u ); - CPPUNIT_ASSERT( s1.find(_T("gAB"), 7) == wxString::npos ); - CPPUNIT_ASSERT( s1.find(_T("gAB"), 6) == 6u ); + CPPUNIT_ASSERT( s1.find(wxT("gAB")) == 6u ); + CPPUNIT_ASSERT( s1.find(wxT("gAB"), 7) == wxString::npos ); + CPPUNIT_ASSERT( s1.find(wxT("gAB"), 6) == 6u ); - CPPUNIT_ASSERT( s1.find(_T("gABZZZ"), 2, 3) == 6u ); - CPPUNIT_ASSERT( s1.find(_T("gABZZZ"), 7, 3) == wxString::npos ); + CPPUNIT_ASSERT( s1.find(wxT("gABZZZ"), 2, 3) == 6u ); + CPPUNIT_ASSERT( s1.find(wxT("gABZZZ"), 7, 3) == wxString::npos ); CPPUNIT_ASSERT( s1.find(s2) == 6u ); CPPUNIT_ASSERT( s1.find(s2, 7) == wxString::npos ); @@ -263,26 +263,26 @@ void StdStringTestCase::StdFind() // 0 1 2 // 0123456 78901234567 8901234567 - //wxString _s1 = _T("abcdefg\0ABCDEFGabc\0ABCabcABC"); - //wxString _s2 = _T("g\0AB"); - wxString _s1 = _T("abcdefgABCDEFGabcABCabcABC"); - wxString _s2 = _T("gAB"); + //wxString _s1 = wxT("abcdefg\0ABCDEFGabc\0ABCabcABC"); + //wxString _s2 = wxT("g\0AB"); + wxString _s1 = wxT("abcdefgABCDEFGabcABCabcABC"); + wxString _s2 = wxT("gAB"); _s1.insert(7, 1, '\0'); _s1.insert(18, 1, '\0'); _s2.insert(1, 1, '\0'); - CPPUNIT_ASSERT( _s1.find(_T('A')) == 8u ); - CPPUNIT_ASSERT( _s1.find(_T('A'), 8) == 8u ); - CPPUNIT_ASSERT( _s1.find(_T('Z')) == wxString::npos ); - CPPUNIT_ASSERT( _s1.find(_T('C'), 22) == 27u ); + CPPUNIT_ASSERT( _s1.find(wxT('A')) == 8u ); + CPPUNIT_ASSERT( _s1.find(wxT('A'), 8) == 8u ); + CPPUNIT_ASSERT( _s1.find(wxT('Z')) == wxString::npos ); + CPPUNIT_ASSERT( _s1.find(wxT('C'), 22) == 27u ); - CPPUNIT_ASSERT( _s1.find(_T("AB")) == 8u ); - CPPUNIT_ASSERT( _s1.find(_T("AB"), 26) == wxString::npos ); - CPPUNIT_ASSERT( _s1.find(_T("AB"), 23) == 25u ); + CPPUNIT_ASSERT( _s1.find(wxT("AB")) == 8u ); + CPPUNIT_ASSERT( _s1.find(wxT("AB"), 26) == wxString::npos ); + CPPUNIT_ASSERT( _s1.find(wxT("AB"), 23) == 25u ); - CPPUNIT_ASSERT( _s1.find(_T("ABZZZ"), 2, 2) == 8u ); - CPPUNIT_ASSERT( _s1.find(_T("ABZZZ"), 26, 2) == wxString::npos ); + CPPUNIT_ASSERT( _s1.find(wxT("ABZZZ"), 2, 2) == 8u ); + CPPUNIT_ASSERT( _s1.find(wxT("ABZZZ"), 26, 2) == wxString::npos ); CPPUNIT_ASSERT( _s1.find(_s2) == 6u ); CPPUNIT_ASSERT( _s1.find(_s2, 7) == wxString::npos ); @@ -293,157 +293,157 @@ void StdStringTestCase::StdFindFirst() { // 0 1 2 3 // 01234567890123456789012345678901234 - wxString s1 = _T("aaaaaabcdefghlkjiaaaaaabcdbcdbcdbcd"); - wxString s2 = _T("aaaaaa"); + wxString s1 = wxT("aaaaaabcdefghlkjiaaaaaabcdbcdbcdbcd"); + wxString s2 = wxT("aaaaaa"); - CPPUNIT_ASSERT( s1.find_first_not_of(_T('a')) == 6u ); - CPPUNIT_ASSERT( s1.find_first_not_of(_T('a'), 7) == 7u ); - CPPUNIT_ASSERT( s2.find_first_not_of(_T('a')) == wxString::npos ); + CPPUNIT_ASSERT( s1.find_first_not_of(wxT('a')) == 6u ); + CPPUNIT_ASSERT( s1.find_first_not_of(wxT('a'), 7) == 7u ); + CPPUNIT_ASSERT( s2.find_first_not_of(wxT('a')) == wxString::npos ); - CPPUNIT_ASSERT( s1.find_first_not_of(_T("abde"), 4) == 7u ); - CPPUNIT_ASSERT( s1.find_first_not_of(_T("abde"), 7) == 7u ); - CPPUNIT_ASSERT( s1.find_first_not_of(_T("abcdefghijkl")) == wxString::npos ); + CPPUNIT_ASSERT( s1.find_first_not_of(wxT("abde"), 4) == 7u ); + CPPUNIT_ASSERT( s1.find_first_not_of(wxT("abde"), 7) == 7u ); + CPPUNIT_ASSERT( s1.find_first_not_of(wxT("abcdefghijkl")) == wxString::npos ); - CPPUNIT_ASSERT( s1.find_first_not_of(_T("abcdefghi"), 0, 4) == 9u ); + CPPUNIT_ASSERT( s1.find_first_not_of(wxT("abcdefghi"), 0, 4) == 9u ); - CPPUNIT_ASSERT( s1.find_first_of(_T('c')) == 7u ); - CPPUNIT_ASSERT( s1.find_first_of(_T('v')) == wxString::npos ); - CPPUNIT_ASSERT( s1.find_first_of(_T('c'), 10) == 24u ); + CPPUNIT_ASSERT( s1.find_first_of(wxT('c')) == 7u ); + CPPUNIT_ASSERT( s1.find_first_of(wxT('v')) == wxString::npos ); + CPPUNIT_ASSERT( s1.find_first_of(wxT('c'), 10) == 24u ); - CPPUNIT_ASSERT( s1.find_first_of(_T("ijkl")) == 13u ); - CPPUNIT_ASSERT( s1.find_first_of(_T("ddcfg"), 17) == 24u ); - CPPUNIT_ASSERT( s1.find_first_of(_T("ddcfga"), 17, 5) == 24u ); + CPPUNIT_ASSERT( s1.find_first_of(wxT("ijkl")) == 13u ); + CPPUNIT_ASSERT( s1.find_first_of(wxT("ddcfg"), 17) == 24u ); + CPPUNIT_ASSERT( s1.find_first_of(wxT("ddcfga"), 17, 5) == 24u ); } void StdStringTestCase::StdFindLast() { // 0 1 2 3 // 01234567890123456789012345678901234 - wxString s1 = _T("aaaaaabcdefghlkjiaaaaaabcdbcdbcdbcd"); - wxString s2 = _T("aaaaaa"); + wxString s1 = wxT("aaaaaabcdefghlkjiaaaaaabcdbcdbcdbcd"); + wxString s2 = wxT("aaaaaa"); - CPPUNIT_ASSERT( s2.find_last_not_of(_T('a')) == wxString::npos ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T('d')) == 33u ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T('d'), 25) == 24u ); + CPPUNIT_ASSERT( s2.find_last_not_of(wxT('a')) == wxString::npos ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT('d')) == 33u ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT('d'), 25) == 24u ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T("bcd")) == 22u ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T("abc"), 24) == 16u ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT("bcd")) == 22u ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT("abc"), 24) == 16u ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T("abcdefghijklmnopqrstuv"), 24, 3) == 16u ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT("abcdefghijklmnopqrstuv"), 24, 3) == 16u ); - CPPUNIT_ASSERT( s2.find_last_of(_T('c')) == wxString::npos ); - CPPUNIT_ASSERT( s1.find_last_of(_T('a')) == 22u ); - CPPUNIT_ASSERT( s1.find_last_of(_T('b'), 24) == 23u ); + CPPUNIT_ASSERT( s2.find_last_of(wxT('c')) == wxString::npos ); + CPPUNIT_ASSERT( s1.find_last_of(wxT('a')) == 22u ); + CPPUNIT_ASSERT( s1.find_last_of(wxT('b'), 24) == 23u ); - CPPUNIT_ASSERT( s1.find_last_of(_T("ijklm")) == 16u ); - CPPUNIT_ASSERT( s1.find_last_of(_T("ijklma"), 33, 4) == 16u ); - CPPUNIT_ASSERT( s1.find_last_of(_T("a"), 17) == 17u ); + CPPUNIT_ASSERT( s1.find_last_of(wxT("ijklm")) == 16u ); + CPPUNIT_ASSERT( s1.find_last_of(wxT("ijklma"), 33, 4) == 16u ); + CPPUNIT_ASSERT( s1.find_last_of(wxT("a"), 17) == 17u ); // 0 1 2 3 // 012345 67890123456789 01234567890123456 -// wxString s1 = _T("aaaaaa\0bcdefghlkjiaa\0aaaabcdbcdbcdbcd"); -// wxString s2 = _T("aaaaaa\0"); +// wxString s1 = wxT("aaaaaa\0bcdefghlkjiaa\0aaaabcdbcdbcdbcd"); +// wxString s2 = wxT("aaaaaa\0"); s1.insert(6,1,'\0'); s1.insert(20,1,'\0'); s2.insert(6,1,'\0'); - CPPUNIT_ASSERT( s2.find_last_not_of(_T('a')) == 6u ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T('d')) == 35u ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T('d'), 27) == 26u ); + CPPUNIT_ASSERT( s2.find_last_not_of(wxT('a')) == 6u ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT('d')) == 35u ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT('d'), 27) == 26u ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T("bcd")) == 24u ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T("abc"), 26) == 20u ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT("bcd")) == 24u ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT("abc"), 26) == 20u ); - CPPUNIT_ASSERT( s1.find_last_not_of(_T("abcdefghijklmnopqrstuv"), 26, 3) == 20u ); + CPPUNIT_ASSERT( s1.find_last_not_of(wxT("abcdefghijklmnopqrstuv"), 26, 3) == 20u ); - CPPUNIT_ASSERT( s2.find_last_of(_T('c')) == wxString::npos ); - CPPUNIT_ASSERT( s1.find_last_of(_T('a')) == 24u ); - CPPUNIT_ASSERT( s1.find_last_of(_T('b'), 26) == 25u ); + CPPUNIT_ASSERT( s2.find_last_of(wxT('c')) == wxString::npos ); + CPPUNIT_ASSERT( s1.find_last_of(wxT('a')) == 24u ); + CPPUNIT_ASSERT( s1.find_last_of(wxT('b'), 26) == 25u ); - CPPUNIT_ASSERT( s1.find_last_of(_T("ijklm")) == 17u ); - CPPUNIT_ASSERT( s1.find_last_of(_T("ijklma"), 35, 4) == 17u ); - CPPUNIT_ASSERT( s1.find_last_of(_T("a"), 18) == 18u ); + CPPUNIT_ASSERT( s1.find_last_of(wxT("ijklm")) == 17u ); + CPPUNIT_ASSERT( s1.find_last_of(wxT("ijklma"), 35, 4) == 17u ); + CPPUNIT_ASSERT( s1.find_last_of(wxT("a"), 18) == 18u ); } void StdStringTestCase::StdInsert() { wxString s1, s2, s3, s4, s5, s6, s7, s8, s9, s10; - s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = _T("aaaa"); - s9 = s10 = _T("cdefg"); + s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = wxT("aaaa"); + s9 = s10 = wxT("cdefg"); - s1.insert(1, _T("cc") ); - s2.insert(2, _T("cdef"), 3); + s1.insert(1, wxT("cc") ); + s2.insert(2, wxT("cdef"), 3); s3.insert(2, s10); s4.insert(2, s10, 3, 7); - s5.insert(1, 2, _T('c')); - s6.insert(s6.begin() + 3, _T('X')); + s5.insert(1, 2, wxT('c')); + s6.insert(s6.begin() + 3, wxT('X')); s7.insert(s7.begin(), s9.begin(), s9.end() - 1); - s8.insert(s8.begin(), 2, _T('c')); - - CPPUNIT_ASSERT_EQUAL( _T("accaaa") , s1 ); - CPPUNIT_ASSERT_EQUAL( _T("aacdeaa") , s2 ); - CPPUNIT_ASSERT_EQUAL( _T("aacdefgaa"), s3 ); - CPPUNIT_ASSERT_EQUAL( _T("aafgaa") , s4 ); - CPPUNIT_ASSERT_EQUAL( _T("accaaa") , s5 ); - CPPUNIT_ASSERT_EQUAL( _T("aaaXa") , s6 ); - CPPUNIT_ASSERT_EQUAL( _T("cdefaaaa") , s7 ); - CPPUNIT_ASSERT_EQUAL( _T("ccaaaa") , s8 ); - - s1 = s2 = s3 = _T("aaaa"); - s1.insert(0, _T("ccc"), 2); - s2.insert(4, _T("ccc"), 2); - - CPPUNIT_ASSERT_EQUAL( _T("ccaaaa"), s1 ); - CPPUNIT_ASSERT_EQUAL( _T("aaaacc"), s2 ); + s8.insert(s8.begin(), 2, wxT('c')); + + CPPUNIT_ASSERT_EQUAL( wxT("accaaa") , s1 ); + CPPUNIT_ASSERT_EQUAL( wxT("aacdeaa") , s2 ); + CPPUNIT_ASSERT_EQUAL( wxT("aacdefgaa"), s3 ); + CPPUNIT_ASSERT_EQUAL( wxT("aafgaa") , s4 ); + CPPUNIT_ASSERT_EQUAL( wxT("accaaa") , s5 ); + CPPUNIT_ASSERT_EQUAL( wxT("aaaXa") , s6 ); + CPPUNIT_ASSERT_EQUAL( wxT("cdefaaaa") , s7 ); + CPPUNIT_ASSERT_EQUAL( wxT("ccaaaa") , s8 ); + + s1 = s2 = s3 = wxT("aaaa"); + s1.insert(0, wxT("ccc"), 2); + s2.insert(4, wxT("ccc"), 2); + + CPPUNIT_ASSERT_EQUAL( wxT("ccaaaa"), s1 ); + CPPUNIT_ASSERT_EQUAL( wxT("aaaacc"), s2 ); } void StdStringTestCase::StdReplace() { wxString s1, s2, s3, s4, s5, s6, s7, s8, s9; - s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = _T("QWERTYUIOP"); - s9 = _T("werty"); + s1 = s2 = s3 = s4 = s5 = s6 = s7 = s8 = wxT("QWERTYUIOP"); + s9 = wxT("werty"); - s1.replace(3, 4, _T("rtyu")); - s1.replace(8, 7, _T("opopop")); - s2.replace(10, 12, _T("WWWW")); + s1.replace(3, 4, wxT("rtyu")); + s1.replace(8, 7, wxT("opopop")); + s2.replace(10, 12, wxT("WWWW")); s3.replace(1, 5, s9); s4.replace(1, 4, s9, 0, 4); s5.replace(1, 2, s9, 1, 12); s6.replace(0, 123, s9, 0, 123); s7.replace(2, 7, s9); - CPPUNIT_ASSERT_EQUAL( _T("QWErtyuIopopop"), s1 ); - CPPUNIT_ASSERT_EQUAL( _T("QWERTYUIOPWWWW"), s2 ); - CPPUNIT_ASSERT_EQUAL( _T("QwertyUIOP") , s3 ); - CPPUNIT_ASSERT_EQUAL( _T("QwertYUIOP") , s4 ); - CPPUNIT_ASSERT_EQUAL( _T("QertyRTYUIOP") , s5 ); + CPPUNIT_ASSERT_EQUAL( wxT("QWErtyuIopopop"), s1 ); + CPPUNIT_ASSERT_EQUAL( wxT("QWERTYUIOPWWWW"), s2 ); + CPPUNIT_ASSERT_EQUAL( wxT("QwertyUIOP") , s3 ); + CPPUNIT_ASSERT_EQUAL( wxT("QwertYUIOP") , s4 ); + CPPUNIT_ASSERT_EQUAL( wxT("QertyRTYUIOP") , s5 ); CPPUNIT_ASSERT_EQUAL( s9, s6 ); - CPPUNIT_ASSERT_EQUAL( _T("QWwertyP"), s7 ); + CPPUNIT_ASSERT_EQUAL( wxT("QWwertyP"), s7 ); } void StdStringTestCase::StdRFind() { // 0 1 2 // 01234567890123456789012345 - wxString s1 = _T("abcdefgABCDEFGabcABCabcABC"); - wxString s2 = _T("gAB"); - wxString s3 = _T("ab"); + wxString s1 = wxT("abcdefgABCDEFGabcABCabcABC"); + wxString s2 = wxT("gAB"); + wxString s3 = wxT("ab"); - CPPUNIT_ASSERT( s1.rfind(_T('A')) == 23u ); - CPPUNIT_ASSERT( s1.rfind(_T('A'), 7) == 7u ); - CPPUNIT_ASSERT( s1.rfind(_T('Z')) == wxString::npos ); - CPPUNIT_ASSERT( s1.rfind(_T('C'), 22) == 19u ); + CPPUNIT_ASSERT( s1.rfind(wxT('A')) == 23u ); + CPPUNIT_ASSERT( s1.rfind(wxT('A'), 7) == 7u ); + CPPUNIT_ASSERT( s1.rfind(wxT('Z')) == wxString::npos ); + CPPUNIT_ASSERT( s1.rfind(wxT('C'), 22) == 19u ); - CPPUNIT_ASSERT( s1.rfind(_T("cAB")) == 22u ); - CPPUNIT_ASSERT( s1.rfind(_T("cAB"), 15) == wxString::npos ); - CPPUNIT_ASSERT( s1.rfind(_T("cAB"), 21) == 16u ); + CPPUNIT_ASSERT( s1.rfind(wxT("cAB")) == 22u ); + CPPUNIT_ASSERT( s1.rfind(wxT("cAB"), 15) == wxString::npos ); + CPPUNIT_ASSERT( s1.rfind(wxT("cAB"), 21) == 16u ); - CPPUNIT_ASSERT( s1.rfind(_T("gABZZZ"), 7, 3) == 6u ); - CPPUNIT_ASSERT( s1.rfind(_T("gABZZZ"), 5, 3) == wxString::npos ); + CPPUNIT_ASSERT( s1.rfind(wxT("gABZZZ"), 7, 3) == 6u ); + CPPUNIT_ASSERT( s1.rfind(wxT("gABZZZ"), 5, 3) == wxString::npos ); CPPUNIT_ASSERT( s1.rfind(s2) == 6u ); CPPUNIT_ASSERT( s1.rfind(s2, 5) == wxString::npos ); @@ -453,41 +453,41 @@ void StdStringTestCase::StdRFind() // 0 1 2 // 01234 56789012 345678901234567 -// wxString s1 = _T("abcde\0fgABCDE\0FGabcABCabcABC"); -// wxString s2 = _T("gAB"); -// wxString s3 = _T("ab"); +// wxString s1 = wxT("abcde\0fgABCDE\0FGabcABCabcABC"); +// wxString s2 = wxT("gAB"); +// wxString s3 = wxT("ab"); s1.insert(5,1,'\0'); s1.insert(13,1,'\0'); - CPPUNIT_ASSERT( s1.rfind(_T('A')) == 25u ); - CPPUNIT_ASSERT( s1.rfind(_T('A'), 8) == 8u ); - CPPUNIT_ASSERT( s1.rfind(_T('Z')) == wxString::npos ); - CPPUNIT_ASSERT( s1.rfind(_T('C'), 22) == 21u ); + CPPUNIT_ASSERT( s1.rfind(wxT('A')) == 25u ); + CPPUNIT_ASSERT( s1.rfind(wxT('A'), 8) == 8u ); + CPPUNIT_ASSERT( s1.rfind(wxT('Z')) == wxString::npos ); + CPPUNIT_ASSERT( s1.rfind(wxT('C'), 22) == 21u ); - CPPUNIT_ASSERT( s1.rfind(_T("cAB")) == 24u ); - CPPUNIT_ASSERT( s1.rfind(_T("cAB"), 15) == wxString::npos ); - CPPUNIT_ASSERT( s1.rfind(_T("cAB"), 21) == 18u ); + CPPUNIT_ASSERT( s1.rfind(wxT("cAB")) == 24u ); + CPPUNIT_ASSERT( s1.rfind(wxT("cAB"), 15) == wxString::npos ); + CPPUNIT_ASSERT( s1.rfind(wxT("cAB"), 21) == 18u ); - CPPUNIT_ASSERT( s1.rfind(_T("gABZZZ"), 8, 3) == 7u ); - CPPUNIT_ASSERT( s1.rfind(_T("gABZZZ"), 5, 3) == wxString::npos ); + CPPUNIT_ASSERT( s1.rfind(wxT("gABZZZ"), 8, 3) == 7u ); + CPPUNIT_ASSERT( s1.rfind(wxT("gABZZZ"), 5, 3) == wxString::npos ); } void StdStringTestCase::StdResize() { wxString s1, s2, s3, s4; - s1 = s2 = s3 = s4 = _T("abcABCdefDEF"); + s1 = s2 = s3 = s4 = wxT("abcABCdefDEF"); s1.resize( 12 ); s2.resize( 10 ); - s3.resize( 14, _T(' ') ); - s4.resize( 14, _T('W') ); + s3.resize( 14, wxT(' ') ); + s4.resize( 14, wxT('W') ); - CPPUNIT_ASSERT_EQUAL( _T("abcABCdefDEF"), s1 ); - CPPUNIT_ASSERT_EQUAL( _T("abcABCdefD"), s2 ); - CPPUNIT_ASSERT_EQUAL( _T("abcABCdefDEF "), s3 ); - CPPUNIT_ASSERT_EQUAL( _T("abcABCdefDEFWW"), s4 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEF"), s1 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefD"), s2 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEF "), s3 ); + CPPUNIT_ASSERT_EQUAL( wxT("abcABCdefDEFWW"), s4 ); wxString s = wxString::FromUTF8("\xd0\x9f\xd1\x80\xd0\xb8\xd0\xb2\xd0\xb5\xd1\x82"); @@ -497,32 +497,32 @@ void StdStringTestCase::StdResize() void StdStringTestCase::StdRiter() { - const wxString s(_T("fozbar")); + const wxString s(wxT("fozbar")); wxString::const_reverse_iterator ri(s.rbegin()); - CPPUNIT_ASSERT( _T('r') == *ri ); - CPPUNIT_ASSERT( _T('a') == *++ri ); - CPPUNIT_ASSERT( _T('r') == *--ri ); + CPPUNIT_ASSERT( wxT('r') == *ri ); + CPPUNIT_ASSERT( wxT('a') == *++ri ); + CPPUNIT_ASSERT( wxT('r') == *--ri ); ri = s.rend(); ri--; - CPPUNIT_ASSERT( _T('f') == *ri ); + CPPUNIT_ASSERT( wxT('f') == *ri ); --ri; - CPPUNIT_ASSERT( _T('o') == *ri ); + CPPUNIT_ASSERT( wxT('o') == *ri ); wxString::const_iterator i = ri.base(); - CPPUNIT_ASSERT( _T('z') == *i ); + CPPUNIT_ASSERT( wxT('z') == *i ); } void StdStringTestCase::StdSubstr() { - wxString s1 = _T("abcdefgABCDEFG"); + wxString s1 = wxT("abcdefgABCDEFG"); CPPUNIT_ASSERT( s1.substr( 0, 14 ) == s1 ); - CPPUNIT_ASSERT( s1.substr( 1, 13 ) == _T("bcdefgABCDEFG") ); - CPPUNIT_ASSERT( s1.substr( 1, 20 ) == _T("bcdefgABCDEFG") ); - CPPUNIT_ASSERT( s1.substr( 14, 30 ) == _T("") ); + CPPUNIT_ASSERT( s1.substr( 1, 13 ) == wxT("bcdefgABCDEFG") ); + CPPUNIT_ASSERT( s1.substr( 1, 20 ) == wxT("bcdefgABCDEFG") ); + CPPUNIT_ASSERT( s1.substr( 14, 30 ) == wxT("") ); s1.insert(3,1,'\0'); s1.insert(8,1,'\0'); @@ -536,7 +536,7 @@ void StdStringTestCase::StdSubstr() CPPUNIT_ASSERT( s1.substr( 0, 17 ) == s1 ); CPPUNIT_ASSERT( s1.substr( 1, 17 ) == s2 ); CPPUNIT_ASSERT( s1.substr( 1, 20 ) == s2 ); - CPPUNIT_ASSERT( s1.substr( 17, 30 ) == _T("") ); + CPPUNIT_ASSERT( s1.substr( 17, 30 ) == wxT("") ); } #if wxUSE_STD_STRING diff --git a/tests/strings/strings.cpp b/tests/strings/strings.cpp index 87956929e2..98b5230666 100644 --- a/tests/strings/strings.cpp +++ b/tests/strings/strings.cpp @@ -119,12 +119,12 @@ void StringTestCase::String() for (int i = 0; i < 2; ++i) { - a = _T("Hello"); - b = _T(" world"); - c = _T("! How'ya doin'?"); + a = wxT("Hello"); + b = wxT(" world"); + c = wxT("! How'ya doin'?"); a += b; a += c; - c = _T("Hello world! What's up?"); + c = wxT("Hello world! What's up?"); CPPUNIT_ASSERT( c != a ); } } @@ -137,12 +137,12 @@ void StringTestCase::PChar() for (int i = 0; i < 2; ++i) { - wxStrcpy (a, _T("Hello")); - wxStrcpy (b, _T(" world")); - wxStrcpy (c, _T("! How'ya doin'?")); + wxStrcpy (a, wxT("Hello")); + wxStrcpy (b, wxT(" world")); + wxStrcpy (c, wxT("! How'ya doin'?")); wxStrcat (a, b); wxStrcat (a, c); - wxStrcpy (c, _T("Hello world! What's up?")); + wxStrcpy (c, wxT("Hello world! What's up?")); CPPUNIT_ASSERT( wxStrcmp (c, a) != 0 ); } } @@ -150,18 +150,18 @@ void StringTestCase::PChar() void StringTestCase::Format() { wxString s1,s2; - s1.Printf(_T("%03d"), 18); - CPPUNIT_ASSERT( s1 == wxString::Format(_T("%03d"), 18) ); - s2.Printf(_T("Number 18: %s\n"), s1.c_str()); - CPPUNIT_ASSERT( s2 == wxString::Format(_T("Number 18: %s\n"), s1.c_str()) ); + s1.Printf(wxT("%03d"), 18); + CPPUNIT_ASSERT( s1 == wxString::Format(wxT("%03d"), 18) ); + s2.Printf(wxT("Number 18: %s\n"), s1.c_str()); + CPPUNIT_ASSERT( s2 == wxString::Format(wxT("Number 18: %s\n"), s1.c_str()) ); static const size_t lengths[] = { 1, 512, 1024, 1025, 2048, 4096, 4097 }; for ( size_t n = 0; n < WXSIZEOF(lengths); n++ ) { const size_t len = lengths[n]; - wxString s(_T('Z'), len); - CPPUNIT_ASSERT_EQUAL( len, wxString::Format(_T("%s"), s.c_str()).length()); + wxString s(wxT('Z'), len); + CPPUNIT_ASSERT_EQUAL( len, wxString::Format(wxT("%s"), s.c_str()).length()); } } @@ -213,15 +213,15 @@ void StringTestCase::StaticConstructors() void StringTestCase::Extraction() { - wxString s(_T("Hello, world!")); + wxString s(wxT("Hello, world!")); - CPPUNIT_ASSERT( wxStrcmp( s.c_str() , _T("Hello, world!") ) == 0 ); - CPPUNIT_ASSERT( wxStrcmp( s.Left(5).c_str() , _T("Hello") ) == 0 ); - CPPUNIT_ASSERT( wxStrcmp( s.Right(6).c_str() , _T("world!") ) == 0 ); - CPPUNIT_ASSERT( wxStrcmp( s(3, 5).c_str() , _T("lo, w") ) == 0 ); - CPPUNIT_ASSERT( wxStrcmp( s.Mid(3).c_str() , _T("lo, world!") ) == 0 ); - CPPUNIT_ASSERT( wxStrcmp( s.substr(3, 5).c_str() , _T("lo, w") ) == 0 ); - CPPUNIT_ASSERT( wxStrcmp( s.substr(3).c_str() , _T("lo, world!") ) == 0 ); + CPPUNIT_ASSERT( wxStrcmp( s.c_str() , wxT("Hello, world!") ) == 0 ); + CPPUNIT_ASSERT( wxStrcmp( s.Left(5).c_str() , wxT("Hello") ) == 0 ); + CPPUNIT_ASSERT( wxStrcmp( s.Right(6).c_str() , wxT("world!") ) == 0 ); + CPPUNIT_ASSERT( wxStrcmp( s(3, 5).c_str() , wxT("lo, w") ) == 0 ); + CPPUNIT_ASSERT( wxStrcmp( s.Mid(3).c_str() , wxT("lo, world!") ) == 0 ); + CPPUNIT_ASSERT( wxStrcmp( s.substr(3, 5).c_str() , wxT("lo, w") ) == 0 ); + CPPUNIT_ASSERT( wxStrcmp( s.substr(3).c_str() , wxT("lo, world!") ) == 0 ); #if wxUSE_UNICODE static const char *germanUTF8 = "Oberfl\303\244che"; @@ -238,13 +238,13 @@ void StringTestCase::Extraction() if ( result ) \ CPPUNIT_ASSERT_EQUAL(correct_rest, rest) - TEST_STARTS_WITH( _T("Hello"), _T(", world!"), true ); - TEST_STARTS_WITH( _T("Hello, "), _T("world!"), true ); - TEST_STARTS_WITH( _T("Hello, world!"), _T(""), true ); - TEST_STARTS_WITH( _T("Hello, world!!!"), _T(""), false ); - TEST_STARTS_WITH( _T(""), _T("Hello, world!"), true ); - TEST_STARTS_WITH( _T("Goodbye"), _T(""), false ); - TEST_STARTS_WITH( _T("Hi"), _T(""), false ); + TEST_STARTS_WITH( wxT("Hello"), wxT(", world!"), true ); + TEST_STARTS_WITH( wxT("Hello, "), wxT("world!"), true ); + TEST_STARTS_WITH( wxT("Hello, world!"), wxT(""), true ); + TEST_STARTS_WITH( wxT("Hello, world!!!"), wxT(""), false ); + TEST_STARTS_WITH( wxT(""), wxT("Hello, world!"), true ); + TEST_STARTS_WITH( wxT("Goodbye"), wxT(""), false ); + TEST_STARTS_WITH( wxT("Hi"), wxT(""), false ); #undef TEST_STARTS_WITH @@ -257,15 +257,15 @@ void StringTestCase::Extraction() if ( result ) \ CPPUNIT_ASSERT_EQUAL(correct_rest, rest) - TEST_ENDS_WITH( _T(""), _T("Hello, world!"), true ); - TEST_ENDS_WITH( _T("!"), _T("Hello, world"), true ); - TEST_ENDS_WITH( _T(", world!"), _T("Hello"), true ); - TEST_ENDS_WITH( _T("ello, world!"), _T("H"), true ); - TEST_ENDS_WITH( _T("Hello, world!"), _T(""), true ); - TEST_ENDS_WITH( _T("very long string"), _T(""), false ); - TEST_ENDS_WITH( _T("?"), _T(""), false ); - TEST_ENDS_WITH( _T("Hello, world"), _T(""), false ); - TEST_ENDS_WITH( _T("Gello, world!"), _T(""), false ); + TEST_ENDS_WITH( wxT(""), wxT("Hello, world!"), true ); + TEST_ENDS_WITH( wxT("!"), wxT("Hello, world"), true ); + TEST_ENDS_WITH( wxT(", world!"), wxT("Hello"), true ); + TEST_ENDS_WITH( wxT("ello, world!"), wxT("H"), true ); + TEST_ENDS_WITH( wxT("Hello, world!"), wxT(""), true ); + TEST_ENDS_WITH( wxT("very long string"), wxT(""), false ); + TEST_ENDS_WITH( wxT("?"), wxT(""), false ); + TEST_ENDS_WITH( wxT("Hello, world"), wxT(""), false ); + TEST_ENDS_WITH( wxT("Gello, world!"), wxT(""), false ); #undef TEST_ENDS_WITH } @@ -275,15 +275,15 @@ void StringTestCase::Trim() #define TEST_TRIM( str , dir , result ) \ CPPUNIT_ASSERT( wxString(str).Trim(dir) == result ) - TEST_TRIM( _T(" Test "), true, _T(" Test") ); - TEST_TRIM( _T(" "), true, _T("") ); - TEST_TRIM( _T(" "), true, _T("") ); - TEST_TRIM( _T(""), true, _T("") ); + TEST_TRIM( wxT(" Test "), true, wxT(" Test") ); + TEST_TRIM( wxT(" "), true, wxT("") ); + TEST_TRIM( wxT(" "), true, wxT("") ); + TEST_TRIM( wxT(""), true, wxT("") ); - TEST_TRIM( _T(" Test "), false, _T("Test ") ); - TEST_TRIM( _T(" "), false, _T("") ); - TEST_TRIM( _T(" "), false, _T("") ); - TEST_TRIM( _T(""), false, _T("") ); + TEST_TRIM( wxT(" Test "), false, wxT("Test ") ); + TEST_TRIM( wxT(" "), false, wxT("") ); + TEST_TRIM( wxT(" "), false, wxT("") ); + TEST_TRIM( wxT(""), false, wxT("") ); #undef TEST_TRIM } @@ -291,11 +291,11 @@ void StringTestCase::Trim() void StringTestCase::Find() { #define TEST_FIND( str , start , result ) \ - CPPUNIT_ASSERT( wxString(str).find(_T("ell"), start) == result ); + CPPUNIT_ASSERT( wxString(str).find(wxT("ell"), start) == result ); - TEST_FIND( _T("Well, hello world"), 0, 1 ); - TEST_FIND( _T("Well, hello world"), 6, 7 ); - TEST_FIND( _T("Well, hello world"), 9, wxString::npos ); + TEST_FIND( wxT("Well, hello world"), 0, 1 ); + TEST_FIND( wxT("Well, hello world"), 6, 7 ); + TEST_FIND( wxT("Well, hello world"), 9, wxString::npos ); #undef TEST_FIND } @@ -309,11 +309,11 @@ void StringTestCase::Replace() CPPUNIT_ASSERT_EQUAL( result, s ); \ } - TEST_REPLACE( _T("012-AWORD-XYZ"), 4, 5, _T("BWORD"), _T("012-BWORD-XYZ") ); - TEST_REPLACE( _T("increase"), 0, 2, _T("de"), _T("decrease") ); - TEST_REPLACE( _T("wxWindow"), 8, 0, _T("s"), _T("wxWindows") ); - TEST_REPLACE( _T("foobar"), 3, 0, _T("-"), _T("foo-bar") ); - TEST_REPLACE( _T("barfoo"), 0, 6, _T("foobar"), _T("foobar") ); + TEST_REPLACE( wxT("012-AWORD-XYZ"), 4, 5, wxT("BWORD"), wxT("012-BWORD-XYZ") ); + TEST_REPLACE( wxT("increase"), 0, 2, wxT("de"), wxT("decrease") ); + TEST_REPLACE( wxT("wxWindow"), 8, 0, wxT("s"), wxT("wxWindows") ); + TEST_REPLACE( wxT("foobar"), 3, 0, wxT("-"), wxT("foo-bar") ); + TEST_REPLACE( wxT("barfoo"), 0, 6, wxT("foobar"), wxT("foobar") ); #define TEST_NULLCHARREPLACE( o , olen, pos , len , replacement , r, rlen ) \ @@ -323,8 +323,8 @@ void StringTestCase::Replace() CPPUNIT_ASSERT_EQUAL( wxString(r,rlen), s ); \ } - TEST_NULLCHARREPLACE( _T("null\0char"), 9, 5, 1, _T("d"), - _T("null\0dhar"), 9 ); + TEST_NULLCHARREPLACE( wxT("null\0char"), 9, 5, 1, wxT("d"), + wxT("null\0dhar"), 9 ); #define TEST_WXREPLACE( o , olen, olds, news, all, r, rlen ) \ { \ @@ -333,11 +333,11 @@ void StringTestCase::Replace() CPPUNIT_ASSERT_EQUAL( wxString(r,rlen), s ); \ } - TEST_WXREPLACE( _T("null\0char"), 9, _T("c"), _T("de"), true, - _T("null\0dehar"), 10 ); + TEST_WXREPLACE( wxT("null\0char"), 9, wxT("c"), wxT("de"), true, + wxT("null\0dehar"), 10 ); - TEST_WXREPLACE( _T("null\0dehar"), 10, _T("de"), _T("c"), true, - _T("null\0char"), 9 ); + TEST_WXREPLACE( wxT("null\0dehar"), 10, wxT("de"), wxT("c"), true, + wxT("null\0char"), 9 ); TEST_WXREPLACE( "life", 4, "f", "", false, "lie", 3 ); TEST_WXREPLACE( "life", 4, "f", "", true, "lie", 3 ); @@ -355,17 +355,17 @@ void StringTestCase::Match() #define TEST_MATCH( s1 , s2 , result ) \ CPPUNIT_ASSERT( wxString(s1).Matches(s2) == result ) - TEST_MATCH( _T("foobar"), _T("foo*"), true ); - TEST_MATCH( _T("foobar"), _T("*oo*"), true ); - TEST_MATCH( _T("foobar"), _T("*bar"), true ); - TEST_MATCH( _T("foobar"), _T("??????"), true ); - TEST_MATCH( _T("foobar"), _T("f??b*"), true ); - TEST_MATCH( _T("foobar"), _T("f?b*"), false ); - TEST_MATCH( _T("foobar"), _T("*goo*"), false ); - TEST_MATCH( _T("foobar"), _T("*foo"), false ); - TEST_MATCH( _T("foobarfoo"), _T("*foo"), true ); - TEST_MATCH( _T(""), _T("*"), true ); - TEST_MATCH( _T(""), _T("?"), false ); + TEST_MATCH( wxT("foobar"), wxT("foo*"), true ); + TEST_MATCH( wxT("foobar"), wxT("*oo*"), true ); + TEST_MATCH( wxT("foobar"), wxT("*bar"), true ); + TEST_MATCH( wxT("foobar"), wxT("??????"), true ); + TEST_MATCH( wxT("foobar"), wxT("f??b*"), true ); + TEST_MATCH( wxT("foobar"), wxT("f?b*"), false ); + TEST_MATCH( wxT("foobar"), wxT("*goo*"), false ); + TEST_MATCH( wxT("foobar"), wxT("*foo"), false ); + TEST_MATCH( wxT("foobarfoo"), wxT("*foo"), true ); + TEST_MATCH( wxT(""), wxT("*"), true ); + TEST_MATCH( wxT(""), wxT("?"), false ); #undef TEST_MATCH } @@ -373,14 +373,14 @@ void StringTestCase::Match() void StringTestCase::CaseChanges() { - wxString s1(_T("Hello!")); + wxString s1(wxT("Hello!")); wxString s1u(s1); wxString s1l(s1); s1u.MakeUpper(); s1l.MakeLower(); - CPPUNIT_ASSERT_EQUAL( _T("HELLO!"), s1u ); - CPPUNIT_ASSERT_EQUAL( _T("hello!"), s1l ); + CPPUNIT_ASSERT_EQUAL( wxT("HELLO!"), s1u ); + CPPUNIT_ASSERT_EQUAL( wxT("hello!"), s1l ); wxString s2u, s2l; s2u.MakeUpper(); @@ -511,15 +511,15 @@ void StringTestCase::Contains() bool contains; } containsData[] = { - { _T(""), _T(""), true }, - { _T(""), _T("foo"), false }, - { _T("foo"), _T(""), true }, - { _T("foo"), _T("f"), true }, - { _T("foo"), _T("o"), true }, - { _T("foo"), _T("oo"), true }, - { _T("foo"), _T("ooo"), false }, - { _T("foo"), _T("oooo"), false }, - { _T("foo"), _T("fooo"), false }, + { wxT(""), wxT(""), true }, + { wxT(""), wxT("foo"), false }, + { wxT("foo"), wxT(""), true }, + { wxT("foo"), wxT("f"), true }, + { wxT("foo"), wxT("o"), true }, + { wxT("foo"), wxT("oo"), true }, + { wxT("foo"), wxT("ooo"), false }, + { wxT("foo"), wxT("oooo"), false }, + { wxT("foo"), wxT("fooo"), false }, }; for ( size_t n = 0; n < WXSIZEOF(containsData); n++ ) @@ -560,23 +560,23 @@ static const struct ToLongData bool IsOk() const { return !(flags & Number_Invalid); } } longData[] = { - { _T("1"), 1, Number_Ok }, - { _T("0"), 0, Number_Ok }, - { _T("a"), 0, Number_Invalid }, - { _T("12345"), 12345, Number_Ok }, - { _T("--1"), 0, Number_Invalid }, + { wxT("1"), 1, Number_Ok }, + { wxT("0"), 0, Number_Ok }, + { wxT("a"), 0, Number_Invalid }, + { wxT("12345"), 12345, Number_Ok }, + { wxT("--1"), 0, Number_Invalid }, - { _T("-1"), -1, Number_Signed | Number_Long }, + { wxT("-1"), -1, Number_Signed | Number_Long }, // this is surprizing but consistent with strtoul() behaviour - { _T("-1"), ULONG_MAX, Number_Unsigned | Number_Long }, + { wxT("-1"), ULONG_MAX, Number_Unsigned | Number_Long }, // this must overflow, even with 64 bit long - { _T("922337203685477580711"), 0, Number_Invalid }, + { wxT("922337203685477580711"), 0, Number_Invalid }, #ifdef wxLongLong_t - { _T("2147483648"), wxLL(2147483648), Number_LongLong }, - { _T("-2147483648"), wxLL(-2147483648), Number_LongLong | Number_Signed }, - { _T("9223372036854775808"), wxULL(9223372036854775808), Number_LongLong | + { wxT("2147483648"), wxLL(2147483648), Number_LongLong }, + { wxT("-2147483648"), wxLL(-2147483648), Number_LongLong | Number_Signed }, + { wxT("9223372036854775808"), wxULL(9223372036854775808), Number_LongLong | Number_Unsigned }, #endif // wxLongLong_t }; @@ -673,18 +673,18 @@ void StringTestCase::ToDouble() bool ok; } doubleData[] = { - { _T("1"), 1, true }, - { _T("1.23"), 1.23, true }, - { _T(".1"), .1, true }, - { _T("1."), 1, true }, - { _T("1.."), 0, false }, - { _T("0"), 0, true }, - { _T("a"), 0, false }, - { _T("12345"), 12345, true }, - { _T("-1"), -1, true }, - { _T("--1"), 0, false }, - { _T("-3E-5"), -3E-5, true }, - { _T("-3E-abcde5"), 0, false }, + { wxT("1"), 1, true }, + { wxT("1.23"), 1.23, true }, + { wxT(".1"), .1, true }, + { wxT("1."), 1, true }, + { wxT("1.."), 0, false }, + { wxT("0"), 0, true }, + { wxT("a"), 0, false }, + { wxT("12345"), 12345, true }, + { wxT("-1"), -1, true }, + { wxT("--1"), 0, false }, + { wxT("-3E-5"), -3E-5, true }, + { wxT("-3E-abcde5"), 0, false }, }; // test ToCDouble() first: @@ -713,18 +713,18 @@ void StringTestCase::ToDouble() static const struct ToDoubleData doubleData2[] = { - { _T("1"), 1, true }, - { _T("1,23"), 1.23, true }, - { _T(",1"), .1, true }, - { _T("1,"), 1, true }, - { _T("1,,"), 0, false }, - { _T("0"), 0, true }, - { _T("a"), 0, false }, - { _T("12345"), 12345, true }, - { _T("-1"), -1, true }, - { _T("--1"), 0, false }, - { _T("-3E-5"), -3E-5, true }, - { _T("-3E-abcde5"), 0, false }, + { wxT("1"), 1, true }, + { wxT("1,23"), 1.23, true }, + { wxT(",1"), .1, true }, + { wxT("1,"), 1, true }, + { wxT("1,,"), 0, false }, + { wxT("0"), 0, true }, + { wxT("a"), 0, false }, + { wxT("12345"), 12345, true }, + { wxT("-1"), -1, true }, + { wxT("--1"), 0, false }, + { wxT("-3E-5"), -3E-5, true }, + { wxT("-3E-abcde5"), 0, false }, }; for ( n = 0; n < WXSIZEOF(doubleData2); n++ ) @@ -742,41 +742,41 @@ void StringTestCase::StringBuf() { // check that buffer can be used to write into the string wxString s; - wxStrcpy(wxStringBuffer(s, 10), _T("foo")); + wxStrcpy(wxStringBuffer(s, 10), wxT("foo")); CPPUNIT_ASSERT_EQUAL(3, s.length()); - CPPUNIT_ASSERT(_T('f') == s[0u]); - CPPUNIT_ASSERT(_T('o') == s[1]); - CPPUNIT_ASSERT(_T('o') == s[2]); + CPPUNIT_ASSERT(wxT('f') == s[0u]); + CPPUNIT_ASSERT(wxT('o') == s[1]); + CPPUNIT_ASSERT(wxT('o') == s[2]); { // also check that the buffer initially contains the original string // contents wxStringBuffer buf(s, 10); - CPPUNIT_ASSERT_EQUAL( _T('f'), buf[0] ); - CPPUNIT_ASSERT_EQUAL( _T('o'), buf[1] ); - CPPUNIT_ASSERT_EQUAL( _T('o'), buf[2] ); - CPPUNIT_ASSERT_EQUAL( _T('\0'), buf[3] ); + CPPUNIT_ASSERT_EQUAL( wxT('f'), buf[0] ); + CPPUNIT_ASSERT_EQUAL( wxT('o'), buf[1] ); + CPPUNIT_ASSERT_EQUAL( wxT('o'), buf[2] ); + CPPUNIT_ASSERT_EQUAL( wxT('\0'), buf[3] ); } { wxStringBufferLength buf(s, 10); - CPPUNIT_ASSERT_EQUAL( _T('f'), buf[0] ); - CPPUNIT_ASSERT_EQUAL( _T('o'), buf[1] ); - CPPUNIT_ASSERT_EQUAL( _T('o'), buf[2] ); - CPPUNIT_ASSERT_EQUAL( _T('\0'), buf[3] ); + CPPUNIT_ASSERT_EQUAL( wxT('f'), buf[0] ); + CPPUNIT_ASSERT_EQUAL( wxT('o'), buf[1] ); + CPPUNIT_ASSERT_EQUAL( wxT('o'), buf[2] ); + CPPUNIT_ASSERT_EQUAL( wxT('\0'), buf[3] ); // and check that it can be used to write only the specified number of // characters to the string - wxStrcpy(buf, _T("barrbaz")); + wxStrcpy(buf, wxT("barrbaz")); buf.SetLength(4); } CPPUNIT_ASSERT_EQUAL(4, s.length()); - CPPUNIT_ASSERT(_T('b') == s[0u]); - CPPUNIT_ASSERT(_T('a') == s[1]); - CPPUNIT_ASSERT(_T('r') == s[2]); - CPPUNIT_ASSERT(_T('r') == s[3]); + CPPUNIT_ASSERT(wxT('b') == s[0u]); + CPPUNIT_ASSERT(wxT('a') == s[1]); + CPPUNIT_ASSERT(wxT('r') == s[2]); + CPPUNIT_ASSERT(wxT('r') == s[3]); // check that creating buffer of length smaller than string works, i.e. at // least doesn't crash (it would if we naively copied the entire original diff --git a/tests/strings/tokenizer.cpp b/tests/strings/tokenizer.cpp index c22c5ba3b5..026202359c 100644 --- a/tests/strings/tokenizer.cpp +++ b/tests/strings/tokenizer.cpp @@ -76,54 +76,54 @@ static const struct TokenizerTestData } gs_testData[] = { - { _T(""), _T(" "), wxTOKEN_DEFAULT, 0 }, - { _T(""), _T(" "), wxTOKEN_RET_EMPTY, 0 }, - { _T(""), _T(" "), wxTOKEN_RET_EMPTY_ALL, 0 }, - { _T(""), _T(" "), wxTOKEN_RET_DELIMS, 0 }, - { _T(":"), _T(":"), wxTOKEN_RET_EMPTY, 1 }, - { _T(":"), _T(":"), wxTOKEN_RET_DELIMS, 1 }, - { _T(":"), _T(":"), wxTOKEN_RET_EMPTY_ALL, 2 }, - { _T("::"), _T(":"), wxTOKEN_RET_EMPTY, 1 }, - { _T("::"), _T(":"), wxTOKEN_RET_DELIMS, 1 }, - { _T("::"), _T(":"), wxTOKEN_RET_EMPTY_ALL, 3 }, - - { _T("Hello, world"), _T(" "), wxTOKEN_DEFAULT, 2 }, - { _T("Hello, world "), _T(" "), wxTOKEN_DEFAULT, 2 }, - { _T("Hello, world"), _T(","), wxTOKEN_DEFAULT, 2 }, - { _T("Hello, world!"), _T(",!"), wxTOKEN_DEFAULT, 2 }, - { _T("Hello,, world!"), _T(",!"), wxTOKEN_DEFAULT, 3 }, - { _T("Hello,, world!"), _T(",!"), wxTOKEN_STRTOK, 2 }, - { _T("Hello, world!"), _T(",!"), wxTOKEN_RET_EMPTY_ALL, 3 }, - - { _T("username:password:uid:gid:gecos:home:shell"), - _T(":"), wxTOKEN_DEFAULT, 7 }, - - { _T("1:2::3:"), _T(":"), wxTOKEN_DEFAULT, 4 }, - { _T("1:2::3:"), _T(":"), wxTOKEN_RET_EMPTY, 4 }, - { _T("1:2::3:"), _T(":"), wxTOKEN_RET_EMPTY_ALL, 5 }, - { _T("1:2::3:"), _T(":"), wxTOKEN_RET_DELIMS, 4 }, - { _T("1:2::3:"), _T(":"), wxTOKEN_STRTOK, 3 }, - - { _T("1:2::3::"), _T(":"), wxTOKEN_DEFAULT, 4 }, - { _T("1:2::3::"), _T(":"), wxTOKEN_RET_EMPTY, 4 }, - { _T("1:2::3::"), _T(":"), wxTOKEN_RET_EMPTY_ALL, 6 }, - { _T("1:2::3::"), _T(":"), wxTOKEN_RET_DELIMS, 4 }, - { _T("1:2::3::"), _T(":"), wxTOKEN_STRTOK, 3 }, - - { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_DEFAULT, 4 }, - { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_STRTOK, 4 }, - { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_RET_EMPTY, 6 }, - { _T("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_RET_EMPTY_ALL, 9 }, - - { _T("01/02/99"), _T("/-"), wxTOKEN_DEFAULT, 3 }, - { _T("01-02/99"), _T("/-"), wxTOKEN_RET_DELIMS, 3 }, + { wxT(""), wxT(" "), wxTOKEN_DEFAULT, 0 }, + { wxT(""), wxT(" "), wxTOKEN_RET_EMPTY, 0 }, + { wxT(""), wxT(" "), wxTOKEN_RET_EMPTY_ALL, 0 }, + { wxT(""), wxT(" "), wxTOKEN_RET_DELIMS, 0 }, + { wxT(":"), wxT(":"), wxTOKEN_RET_EMPTY, 1 }, + { wxT(":"), wxT(":"), wxTOKEN_RET_DELIMS, 1 }, + { wxT(":"), wxT(":"), wxTOKEN_RET_EMPTY_ALL, 2 }, + { wxT("::"), wxT(":"), wxTOKEN_RET_EMPTY, 1 }, + { wxT("::"), wxT(":"), wxTOKEN_RET_DELIMS, 1 }, + { wxT("::"), wxT(":"), wxTOKEN_RET_EMPTY_ALL, 3 }, + + { wxT("Hello, world"), wxT(" "), wxTOKEN_DEFAULT, 2 }, + { wxT("Hello, world "), wxT(" "), wxTOKEN_DEFAULT, 2 }, + { wxT("Hello, world"), wxT(","), wxTOKEN_DEFAULT, 2 }, + { wxT("Hello, world!"), wxT(",!"), wxTOKEN_DEFAULT, 2 }, + { wxT("Hello,, world!"), wxT(",!"), wxTOKEN_DEFAULT, 3 }, + { wxT("Hello,, world!"), wxT(",!"), wxTOKEN_STRTOK, 2 }, + { wxT("Hello, world!"), wxT(",!"), wxTOKEN_RET_EMPTY_ALL, 3 }, + + { wxT("username:password:uid:gid:gecos:home:shell"), + wxT(":"), wxTOKEN_DEFAULT, 7 }, + + { wxT("1:2::3:"), wxT(":"), wxTOKEN_DEFAULT, 4 }, + { wxT("1:2::3:"), wxT(":"), wxTOKEN_RET_EMPTY, 4 }, + { wxT("1:2::3:"), wxT(":"), wxTOKEN_RET_EMPTY_ALL, 5 }, + { wxT("1:2::3:"), wxT(":"), wxTOKEN_RET_DELIMS, 4 }, + { wxT("1:2::3:"), wxT(":"), wxTOKEN_STRTOK, 3 }, + + { wxT("1:2::3::"), wxT(":"), wxTOKEN_DEFAULT, 4 }, + { wxT("1:2::3::"), wxT(":"), wxTOKEN_RET_EMPTY, 4 }, + { wxT("1:2::3::"), wxT(":"), wxTOKEN_RET_EMPTY_ALL, 6 }, + { wxT("1:2::3::"), wxT(":"), wxTOKEN_RET_DELIMS, 4 }, + { wxT("1:2::3::"), wxT(":"), wxTOKEN_STRTOK, 3 }, + + { wxT("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_DEFAULT, 4 }, + { wxT("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_STRTOK, 4 }, + { wxT("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_RET_EMPTY, 6 }, + { wxT("1 \t3\t4 6 "), wxDEFAULT_DELIMITERS, wxTOKEN_RET_EMPTY_ALL, 9 }, + + { wxT("01/02/99"), wxT("/-"), wxTOKEN_DEFAULT, 3 }, + { wxT("01-02/99"), wxT("/-"), wxTOKEN_RET_DELIMS, 3 }, }; // helper function returning the string showing the index for which the test // fails in the diagnostic message static std::string Nth(size_t n) { - return std::string(wxString::Format(_T("for loop index %lu"), + return std::string(wxString::Format(wxT("for loop index %lu"), (unsigned long)n).mb_str()); } @@ -184,9 +184,9 @@ DoTestGetPosition(const wxChar *s, const wxChar *delims, int pos, ...) void TokenizerTestCase::GetPosition() { - DoTestGetPosition(_T("foo"), _T("_"), 3, 0); - DoTestGetPosition(_T("foo_bar"), _T("_"), 4, 7, 0); - DoTestGetPosition(_T("foo_bar_"), _T("_"), 4, 8, 0); + DoTestGetPosition(wxT("foo"), wxT("_"), 3, 0); + DoTestGetPosition(wxT("foo_bar"), wxT("_"), 4, 7, 0); + DoTestGetPosition(wxT("foo_bar_"), wxT("_"), 4, 8, 0); } // helper for GetString(): the parameters are the same as for DoTestGetPosition @@ -221,26 +221,26 @@ DoTestGetString(const wxChar *s, const wxChar *delims, int pos, ...) void TokenizerTestCase::GetString() { - DoTestGetString(_T("foo"), _T("_"), 3, 0); - DoTestGetString(_T("foo_bar"), _T("_"), 4, 7, 0); - DoTestGetString(_T("foo_bar_"), _T("_"), 4, 8, 0); + DoTestGetString(wxT("foo"), wxT("_"), 3, 0); + DoTestGetString(wxT("foo_bar"), wxT("_"), 4, 7, 0); + DoTestGetString(wxT("foo_bar_"), wxT("_"), 4, 8, 0); } void TokenizerTestCase::LastDelimiter() { - wxStringTokenizer tkz(_T("a+-b=c"), _T("+-=")); + wxStringTokenizer tkz(wxT("a+-b=c"), wxT("+-=")); tkz.GetNextToken(); - CPPUNIT_ASSERT_EQUAL( _T('+'), tkz.GetLastDelimiter() ); + CPPUNIT_ASSERT_EQUAL( wxT('+'), tkz.GetLastDelimiter() ); tkz.GetNextToken(); - CPPUNIT_ASSERT_EQUAL( _T('-'), tkz.GetLastDelimiter() ); + CPPUNIT_ASSERT_EQUAL( wxT('-'), tkz.GetLastDelimiter() ); tkz.GetNextToken(); - CPPUNIT_ASSERT_EQUAL( _T('='), tkz.GetLastDelimiter() ); + CPPUNIT_ASSERT_EQUAL( wxT('='), tkz.GetLastDelimiter() ); tkz.GetNextToken(); - CPPUNIT_ASSERT_EQUAL( _T('\0'), tkz.GetLastDelimiter() ); + CPPUNIT_ASSERT_EQUAL( wxT('\0'), tkz.GetLastDelimiter() ); } void TokenizerTestCase::StrtokCompat() diff --git a/tests/strings/unichar.cpp b/tests/strings/unichar.cpp index 9c6613b299..67c03f8d73 100644 --- a/tests/strings/unichar.cpp +++ b/tests/strings/unichar.cpp @@ -62,51 +62,51 @@ void UniCharTestCase::CharCompare() CPPUNIT_ASSERT( a == a ); CPPUNIT_ASSERT( a == 'a' ); - CPPUNIT_ASSERT( a == _T('a') ); + CPPUNIT_ASSERT( a == wxT('a') ); CPPUNIT_ASSERT( a == wxUniChar('a') ); - CPPUNIT_ASSERT( a == wxUniChar(_T('a')) ); + CPPUNIT_ASSERT( a == wxUniChar(wxT('a')) ); CPPUNIT_ASSERT( a != b ); CPPUNIT_ASSERT( a != 'b' ); - CPPUNIT_ASSERT( a != _T('b') ); + CPPUNIT_ASSERT( a != wxT('b') ); CPPUNIT_ASSERT( a != wxUniChar('b') ); - CPPUNIT_ASSERT( a != wxUniChar(_T('b')) ); + CPPUNIT_ASSERT( a != wxUniChar(wxT('b')) ); CPPUNIT_ASSERT( a < b ); CPPUNIT_ASSERT( a < 'b' ); - CPPUNIT_ASSERT( a < _T('b') ); + CPPUNIT_ASSERT( a < wxT('b') ); CPPUNIT_ASSERT( a < wxUniChar('b') ); - CPPUNIT_ASSERT( a < wxUniChar(_T('b')) ); + CPPUNIT_ASSERT( a < wxUniChar(wxT('b')) ); CPPUNIT_ASSERT( a <= b ); CPPUNIT_ASSERT( a <= 'b' ); - CPPUNIT_ASSERT( a <= _T('b') ); + CPPUNIT_ASSERT( a <= wxT('b') ); CPPUNIT_ASSERT( a <= wxUniChar('b') ); - CPPUNIT_ASSERT( a <= wxUniChar(_T('b')) ); + CPPUNIT_ASSERT( a <= wxUniChar(wxT('b')) ); CPPUNIT_ASSERT( a <= a ); CPPUNIT_ASSERT( a <= 'a' ); - CPPUNIT_ASSERT( a <= _T('a') ); + CPPUNIT_ASSERT( a <= wxT('a') ); CPPUNIT_ASSERT( a <= wxUniChar('a') ); - CPPUNIT_ASSERT( a <= wxUniChar(_T('a')) ); + CPPUNIT_ASSERT( a <= wxUniChar(wxT('a')) ); CPPUNIT_ASSERT( b > a ); CPPUNIT_ASSERT( b > 'a' ); - CPPUNIT_ASSERT( b > _T('a') ); + CPPUNIT_ASSERT( b > wxT('a') ); CPPUNIT_ASSERT( b > wxUniChar('a') ); - CPPUNIT_ASSERT( b > wxUniChar(_T('a')) ); + CPPUNIT_ASSERT( b > wxUniChar(wxT('a')) ); CPPUNIT_ASSERT( b >= a ); CPPUNIT_ASSERT( b >= 'a' ); - CPPUNIT_ASSERT( b >= _T('a') ); + CPPUNIT_ASSERT( b >= wxT('a') ); CPPUNIT_ASSERT( b >= wxUniChar('a') ); - CPPUNIT_ASSERT( b >= wxUniChar(_T('a')) ); + CPPUNIT_ASSERT( b >= wxUniChar(wxT('a')) ); CPPUNIT_ASSERT( b >= b ); CPPUNIT_ASSERT( b >= 'b' ); - CPPUNIT_ASSERT( b >= _T('b') ); + CPPUNIT_ASSERT( b >= wxT('b') ); CPPUNIT_ASSERT( b >= wxUniChar('b') ); - CPPUNIT_ASSERT( b >= wxUniChar(_T('b')) ); + CPPUNIT_ASSERT( b >= wxUniChar(wxT('b')) ); CPPUNIT_ASSERT( b - a == 1 ); CPPUNIT_ASSERT( a - b == -1 ); @@ -163,7 +163,7 @@ void UniCharTestCase::StringCompare() wxString sa = "a"; const wxString sb = "b"; char c1 = 'a'; - wchar_t c2 = _T('a'); + wchar_t c2 = wxT('a'); wxUniChar c3 = 'a'; CPPUNIT_ASSERT( sa == 'a'); diff --git a/tests/strings/unicode.cpp b/tests/strings/unicode.cpp index 4dc62d7ebf..35850eac1f 100644 --- a/tests/strings/unicode.cpp +++ b/tests/strings/unicode.cpp @@ -333,7 +333,7 @@ void UnicodeTestCase::ConversionUTF8() StringConversionData("\xc2", NULL), }; - wxCSConv conv(_T("utf-8")); + wxCSConv conv(wxT("utf-8")); for ( size_t n = 0; n < WXSIZEOF(utf8data); n++ ) { const StringConversionData& d = utf8data[n]; diff --git a/tests/strings/vararg.cpp b/tests/strings/vararg.cpp index 1cc62ba3f0..f1a3e54ff6 100644 --- a/tests/strings/vararg.cpp +++ b/tests/strings/vararg.cpp @@ -68,33 +68,33 @@ void VarArgTestCase::StringPrintf() // test passing literals: s.Printf("%s %i", "foo", 42); CPPUNIT_ASSERT( s == "foo 42" ); - s.Printf("%s %s %i", _T("bar"), "=", 11); + s.Printf("%s %s %i", wxT("bar"), "=", 11); // test passing c_str(): CPPUNIT_ASSERT( s == "bar = 11" ); s2.Printf("(%s)", s.c_str()); CPPUNIT_ASSERT( s2 == "(bar = 11)" ); - s2.Printf(_T("[%s](%s)"), s.c_str(), "str"); + s2.Printf(wxT("[%s](%s)"), s.c_str(), "str"); CPPUNIT_ASSERT( s2 == "[bar = 11](str)" ); s2.Printf("%s mailbox", wxString("Opening").c_str()); CPPUNIT_ASSERT( s2 == "Opening mailbox" ); // test passing wxString directly: - s2.Printf(_T("[%s](%s)"), s, "str"); + s2.Printf(wxT("[%s](%s)"), s, "str"); CPPUNIT_ASSERT( s2 == "[bar = 11](str)" ); // test passing wxCharBufferType: s = "FooBar"; - s2.Printf(_T("(%s)"), s.mb_str()); + s2.Printf(wxT("(%s)"), s.mb_str()); CPPUNIT_ASSERT( s2 == "(FooBar)" ); - s2.Printf(_T("value=%s;"), s.wc_str()); + s2.Printf(wxT("value=%s;"), s.wc_str()); CPPUNIT_ASSERT( s2 == "value=FooBar;" ); // this tests correct passing of wxCStrData constructed from string // literal: bool cond = true; - s2.Printf(_T("foo %s"), !cond ? s.c_str() : _T("bar")); + s2.Printf(wxT("foo %s"), !cond ? s.c_str() : wxT("bar")); } void VarArgTestCase::CharPrintf() diff --git a/tests/strings/vsnprintf.cpp b/tests/strings/vsnprintf.cpp index 751f7c5b85..c34f8fa061 100644 --- a/tests/strings/vsnprintf.cpp +++ b/tests/strings/vsnprintf.cpp @@ -257,7 +257,7 @@ void VsnprintfTestCase::N() { int nchar; - wxSnprintf(buf, MAX_TEST_LEN, _T("%d %s%n\n"), 3, _T("bears"), &nchar); + wxSnprintf(buf, MAX_TEST_LEN, wxT("%d %s%n\n"), 3, wxT("bears"), &nchar); CPPUNIT_ASSERT_EQUAL( 7, nchar ); } @@ -497,7 +497,7 @@ void VsnprintfTestCase::DoBigToSmallBuffer(T *buffer, int size) // format and gcc would warn about this otherwise r = wxUnsafeSnprintf(buffer, size, - _T("unicode string/char: %ls/%lc -- ansi string/char: %hs/%hc"), + wxT("unicode string/char: %ls/%lc -- ansi string/char: %hs/%hc"), L"unicode", L'U', "ansi", 'A'); wxString expected = wxString(wxT("unicode string/char: unicode/U -- ansi string/char: ansi/A")).Left(size - 1); @@ -556,10 +556,10 @@ void VsnprintfTestCase::DoMisc( // Prepare messages so that it is possible to see from the error which // test was running. wxString errStr, overflowStr; - errStr << _T("No.: ") << ++count << _T(", expected: ") << expectedLen - << _T(" '") << expectedString << _T("', result: "); - overflowStr << errStr << _T("buffer overflow"); - errStr << n << _T(" '") << buf << _T("'"); + errStr << wxT("No.: ") << ++count << wxT(", expected: ") << expectedLen + << wxT(" '") << expectedString << wxT("', result: "); + overflowStr << errStr << wxT("buffer overflow"); + errStr << n << wxT(" '") << buf << wxT("'"); // turn them into std::strings std::string errMsg(errStr.mb_str()); diff --git a/tests/textfile/textfiletest.cpp b/tests/textfile/textfiletest.cpp index 25d3f830f4..630e12c2f6 100644 --- a/tests/textfile/textfiletest.cpp +++ b/tests/textfile/textfiletest.cpp @@ -117,8 +117,8 @@ void TextFileTestCase::ReadDOS() CPPUNIT_ASSERT_EQUAL( (size_t)3, f.GetLineCount() ); CPPUNIT_ASSERT_EQUAL( wxTextFileType_Dos, f.GetLineType(0) ); CPPUNIT_ASSERT_EQUAL( wxTextFileType_None, f.GetLineType(2) ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("bar")), f.GetLine(1) ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("baz")), f.GetLastLine() ); } void TextFileTestCase::ReadUnix() @@ -131,8 +131,8 @@ void TextFileTestCase::ReadUnix() CPPUNIT_ASSERT_EQUAL( (size_t)3, f.GetLineCount() ); CPPUNIT_ASSERT_EQUAL( wxTextFileType_Unix, f.GetLineType(0) ); CPPUNIT_ASSERT_EQUAL( wxTextFileType_None, f.GetLineType(2) ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("bar")), f.GetLine(1) ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("baz")), f.GetLastLine() ); } void TextFileTestCase::ReadMac() @@ -145,8 +145,8 @@ void TextFileTestCase::ReadMac() CPPUNIT_ASSERT_EQUAL( (size_t)3, f.GetLineCount() ); CPPUNIT_ASSERT_EQUAL( wxTextFileType_Mac, f.GetLineType(0) ); CPPUNIT_ASSERT_EQUAL( wxTextFileType_None, f.GetLineType(2) ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("bar")), f.GetLine(1) ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("baz")), f.GetLastLine() ); } void TextFileTestCase::ReadMixed() @@ -160,9 +160,9 @@ void TextFileTestCase::ReadMixed() CPPUNIT_ASSERT_EQUAL( wxTextFileType_Mac, f.GetLineType(0) ); CPPUNIT_ASSERT_EQUAL( wxTextFileType_Dos, f.GetLineType(1) ); CPPUNIT_ASSERT_EQUAL( wxTextFileType_Unix, f.GetLineType(2) ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("foo")), f.GetFirstLine() ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("bar")), f.GetLine(1) ); - CPPUNIT_ASSERT_EQUAL( wxString(_T("baz")), f.GetLastLine() ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("foo")), f.GetFirstLine() ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("bar")), f.GetLine(1) ); + CPPUNIT_ASSERT_EQUAL( wxString(wxT("baz")), f.GetLastLine() ); } #if wxUSE_UNICODE diff --git a/tests/uris/uris.cpp b/tests/uris/uris.cpp index 66dd225ecb..5b2f04feab 100644 --- a/tests/uris/uris.cpp +++ b/tests/uris/uris.cpp @@ -409,7 +409,7 @@ void URITestCase::URLCompat() wxInputStream* is = urlProblem.GetInputStream(); CPPUNIT_ASSERT(is != NULL); - wxFile fOut(_T("test.html"), wxFile::write); + wxFile fOut(wxT("test.html"), wxFile::write); wxASSERT(fOut.IsOpened()); char buf[1001]; diff --git a/utils/emulator/src/emulator.cpp b/utils/emulator/src/emulator.cpp index 07ccc0cf28..1c05b55bdc 100644 --- a/utils/emulator/src/emulator.cpp +++ b/utils/emulator/src/emulator.cpp @@ -117,10 +117,10 @@ bool wxEmulatorApp::OnInit() // If the development version, go up a directory. #ifdef __WXMSW__ - if ((m_appDir.Right(5).CmpNoCase(_T("DEBUG")) == 0) || - (m_appDir.Right(11).CmpNoCase(_T("DEBUGSTABLE")) == 0) || - (m_appDir.Right(7).CmpNoCase(_T("RELEASE")) == 0) || - (m_appDir.Right(13).CmpNoCase(_T("RELEASESTABLE")) == 0) + if ((m_appDir.Right(5).CmpNoCase(wxT("DEBUG")) == 0) || + (m_appDir.Right(11).CmpNoCase(wxT("DEBUGSTABLE")) == 0) || + (m_appDir.Right(7).CmpNoCase(wxT("RELEASE")) == 0) || + (m_appDir.Right(13).CmpNoCase(wxT("RELEASESTABLE")) == 0) ) m_appDir = wxPathOnly(m_appDir); #endif @@ -176,7 +176,7 @@ bool wxEmulatorApp::OnInit() } // create the main application window - wxEmulatorFrame *frame = new wxEmulatorFrame(_T("wxEmulator"), + wxEmulatorFrame *frame = new wxEmulatorFrame(wxT("wxEmulator"), wxPoint(50, 50), wxSize(450, 340)); #if wxUSE_STATUSBAR @@ -274,14 +274,14 @@ wxEmulatorFrame::wxEmulatorFrame(const wxString& title, // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; - helpMenu->Append(Emulator_About, _T("&About...\tF1"), _T("Show about dialog")); + helpMenu->Append(Emulator_About, wxT("&About...\tF1"), wxT("Show about dialog")); - menuFile->Append(Emulator_Quit, _T("E&xit\tAlt-X"), _T("Quit this program")); + menuFile->Append(Emulator_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); - menuBar->Append(menuFile, _T("&File")); - menuBar->Append(helpMenu, _T("&Help")); + menuBar->Append(menuFile, wxT("&File")); + menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); @@ -305,9 +305,9 @@ void wxEmulatorFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) void wxEmulatorFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { wxString msg; - msg.Printf( _T("wxEmulator is an environment for testing embedded X11 apps.\n")); + msg.Printf( wxT("wxEmulator is an environment for testing embedded X11 apps.\n")); - wxMessageBox(msg, _T("About wxEmulator"), wxOK | wxICON_INFORMATION, this); + wxMessageBox(msg, wxT("About wxEmulator"), wxOK | wxICON_INFORMATION, this); } void wxEmulatorFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) @@ -523,17 +523,17 @@ wxBitmapType wxDetermineImageType(const wxString& filename) wxFileName::SplitPath(filename, & path, & name, & ext); ext.MakeLower(); - if (ext == _T("jpg") || ext == _T("jpeg")) + if (ext == wxT("jpg") || ext == wxT("jpeg")) return wxBITMAP_TYPE_JPEG; - if (ext == _T("gif")) + if (ext == wxT("gif")) return wxBITMAP_TYPE_GIF; - if (ext == _T("bmp")) + if (ext == wxT("bmp")) return wxBITMAP_TYPE_BMP; - if (ext == _T("png")) + if (ext == wxT("png")) return wxBITMAP_TYPE_PNG; - if (ext == _T("pcx")) + if (ext == wxT("pcx")) return wxBITMAP_TYPE_PCX; - if (ext == _T("tif") || ext == _T("tiff")) + if (ext == wxT("tif") || ext == wxT("tiff")) return wxBITMAP_TYPE_TIF; return wxBITMAP_TYPE_INVALID; diff --git a/utils/helpview/src/helpview.cpp b/utils/helpview/src/helpview.cpp index bbb44a061d..c774b628fa 100644 --- a/utils/helpview/src/helpview.cpp +++ b/utils/helpview/src/helpview.cpp @@ -265,7 +265,7 @@ bool hvApp::OpenBook(wxHtmlHelpController* controller) if ( !s.empty() ) { wxString ext = s.Right(4).Lower(); - if (ext == _T(".zip") || ext == _T(".htb") || ext == _T(".hhp")) + if (ext == wxT(".zip") || ext == wxT(".htb") || ext == wxT(".hhp")) { wxBusyCursor bcur; wxFileName fileName(s); @@ -312,7 +312,7 @@ if ( id == artId ) return wxBitmap(xpmRc##_xpm); #else #define CREATE_STD_ICON(iconId, xpmRc) \ { \ - wxIcon icon(_T(iconId)); \ + wxIcon icon(wxT(iconId)); \ wxBitmap bmp; \ bmp.CopyFromIcon(icon); \ return bmp; \ diff --git a/utils/helpview/src/remhelp.cpp b/utils/helpview/src/remhelp.cpp index 0d8a521098..312cd1190a 100644 --- a/utils/helpview/src/remhelp.cpp +++ b/utils/helpview/src/remhelp.cpp @@ -252,7 +252,7 @@ bool wxRemoteHtmlHelpController::Quit() switch ( sig ) { default: - wxFAIL_MSG( _T("unexpected return value") ); + wxFAIL_MSG( wxT("unexpected return value") ); // fall through case -1: @@ -283,11 +283,11 @@ bool wxRemoteHtmlHelpController::Quit() { if ( wxProcess::Exists(m_pid) ) { - wxLogStatus(_T("Process %ld is running."), m_pid); + wxLogStatus(wxT("Process %ld is running."), m_pid); } else { - wxLogStatus(_T("No process with pid = %ld."), m_pid); + wxLogStatus(wxT("No process with pid = %ld."), m_pid); } } else // not SIGNONE @@ -295,23 +295,23 @@ bool wxRemoteHtmlHelpController::Quit() wxKillError rc = wxProcess::Kill(m_pid, (wxSignal)sig); if ( rc == wxKILL_OK ) { - wxLogStatus(_T("Process %ld killed with signal %d."), m_pid, sig); + wxLogStatus(wxT("Process %ld killed with signal %d."), m_pid, sig); } else { static const wxChar *errorText[] = { - _T(""), // no error - _T("signal not supported"), - _T("permission denied"), - _T("no such process"), - _T("unspecified error"), + wxT(""), // no error + wxT("signal not supported"), + wxT("permission denied"), + wxT("no such process"), + wxT("unspecified error"), }; // sig = 3, 6, 9 or 12 all kill server with no apparent problem // but give error message on MSW - timout? // - //wxLogError(_T("Failed to kill process %ld with signal %d: %s"), + //wxLogError(wxT("Failed to kill process %ld with signal %d: %s"), // m_pid, sig, errorText[rc]); } } diff --git a/utils/hhp2cached/hhp2cached.cpp b/utils/hhp2cached/hhp2cached.cpp index 2321d28cb8..ffcd539982 100644 --- a/utils/hhp2cached/hhp2cached.cpp +++ b/utils/hhp2cached/hhp2cached.cpp @@ -33,7 +33,7 @@ bool MyApp::OnInit() for (int i = 1; i < argc; i++) { wxHtmlHelpData data; - wxPrintf(_T("Processing %s...\n"), argv[i]); + wxPrintf(wxT("Processing %s...\n"), argv[i]); data.SetTempDir(wxPathOnly(argv[i])); data.AddBook(argv[i]); } diff --git a/utils/screenshotgen/src/autocapture.cpp b/utils/screenshotgen/src/autocapture.cpp index ba3ec7bdd8..c425010e54 100644 --- a/utils/screenshotgen/src/autocapture.cpp +++ b/utils/screenshotgen/src/autocapture.cpp @@ -44,7 +44,7 @@ AutoCaptureMechanism::AutoCaptureMechanism(wxNotebook *notebook, } /* static */ -wxString AutoCaptureMechanism::default_dir = _T("screenshots"); +wxString AutoCaptureMechanism::default_dir = wxT("screenshots"); /* static */ wxString AutoCaptureMechanism::GetDefaultDirectoryAbsPath() @@ -72,7 +72,7 @@ bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, int x, int y, // Somehow wxScreenDC.Blit() doesn't work under Mac for now. Here is a trick. #ifdef __WXMAC__ - // wxExecute(_T("screencapture -x ") + tempfile, wxEXEC_SYNC); + // wxExecute(wxT("screencapture -x ") + tempfile, wxEXEC_SYNC); char captureCommand[80] =""; // a reasonable max size is 80 sprintf(captureCommand, "sleep %d;%s", delay, "screencapture -x /tmp/wx_screen_capture.png"); @@ -83,7 +83,7 @@ bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, int x, int y, wxBitmap fullscreen; do { - fullscreen = wxBitmap(_T("/tmp/wx_screen_capture.png"), wxBITMAP_TYPE_PNG); + fullscreen = wxBitmap(wxT("/tmp/wx_screen_capture.png"), wxBITMAP_TYPE_PNG); } while(!fullscreen.IsOk()); @@ -199,7 +199,7 @@ bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, Control& ctrl) { // no manual specification for the control name // or name adjustment is disabled globally - if (ctrl.name == _T("") || m_flag & AJ_DisableNameAdjust) + if (ctrl.name == wxT("") || m_flag & AJ_DisableNameAdjust) { // Get its name from wxRTTI ctrl.name = ctrl.ctrl->GetClassInfo()->GetClassName(); @@ -234,7 +234,7 @@ bool AutoCaptureMechanism::Capture(wxBitmap* bitmap, Control& ctrl) // cut off "wx" and change the name into lowercase. // e.g. wxButton will have a name of "button" at the end - ctrl.name.StartsWith(_T("wx"), &(ctrl.name)); + ctrl.name.StartsWith(wxT("wx"), &(ctrl.name)); ctrl.name.MakeLower(); // take the screenshot @@ -307,16 +307,16 @@ wxRect AutoCaptureMechanism::GetRect(wxWindow* ctrl, int flag) wxStaticText* l[4]; for (int i = 0; i < 4; ++i) - l[i] = new wxStaticText(parent, wxID_ANY, _T(" ")); + l[i] = new wxStaticText(parent, wxID_ANY, wxT(" ")); m_grid->Add(l[0]); - m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" "))); + m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" "))); m_grid->Add(l[1]); - m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" "))); + m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" "))); m_grid->Add(ctrl, 1, wxEXPAND); - m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" "))); + m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" "))); m_grid->Add(l[2]); - m_grid->Add(new wxStaticText(parent, wxID_ANY, _T(" "))); + m_grid->Add(new wxStaticText(parent, wxID_ANY, wxT(" "))); m_grid->Add(l[3]); sizer->Add(m_grid); diff --git a/utils/screenshotgen/src/autocapture.h b/utils/screenshotgen/src/autocapture.h index 2f348803c1..20f16415e5 100644 --- a/utils/screenshotgen/src/autocapture.h +++ b/utils/screenshotgen/src/autocapture.h @@ -242,7 +242,7 @@ public: Please read the document of enum AdjustFlags, and notice that this flag could be enabled/ disabled by global flag GlobalAdjustFlags. */ - void RegisterControl(wxWindow * ctrl, wxString name = _T(""), int flag = AJ_Normal) + void RegisterControl(wxWindow * ctrl, wxString name = wxT(""), int flag = AJ_Normal) { m_controlList.push_back(Control(ctrl, name, flag)); } @@ -256,7 +256,7 @@ public: */ void RegisterControl(wxWindow * ctrl, int flag) { - RegisterControl(ctrl, _T(""), flag); + RegisterControl(ctrl, wxT(""), flag); } /** @@ -267,7 +267,7 @@ public: */ void RegisterPageTurn() { - m_controlList.push_back(Control(0, _T(""), AJ_TurnPage)); + m_controlList.push_back(Control(0, wxT(""), AJ_TurnPage)); } /** diff --git a/utils/screenshotgen/src/guiframe.cpp b/utils/screenshotgen/src/guiframe.cpp index f9276a55dc..166a00b706 100644 --- a/utils/screenshotgen/src/guiframe.cpp +++ b/utils/screenshotgen/src/guiframe.cpp @@ -66,13 +66,13 @@ void GUIFrame::AddMenuBar() fileMenu = new wxMenu(); wxMenuItem* m_menuSeeScr; - m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + _T('\t') + _T("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL ); + m_menuSeeScr = new wxMenuItem( fileMenu, wxID_ZOOM_IN, wxString( _("&Open screenshots folder...") ) + wxT('\t') + wxT("Ctrl+O"), _("Opens the directory where the screenshots are saved."), wxITEM_NORMAL ); fileMenu->Append( m_menuSeeScr ); fileMenu->AppendSeparator(); wxMenuItem* m_menuFileQuit; - m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + _T('\t') + _T("Alt+F4"), _("Quits the application."), wxITEM_NORMAL ); + m_menuFileQuit = new wxMenuItem( fileMenu, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("Alt+F4"), _("Quits the application."), wxITEM_NORMAL ); fileMenu->Append( m_menuFileQuit ); mbar->Append( fileMenu, _("&File") ); @@ -81,11 +81,11 @@ void GUIFrame::AddMenuBar() captureMenu = new wxMenu(); wxMenuItem* m_menuCapFullScreen; - m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + _T('\t') + _T("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL ); + m_menuCapFullScreen = new wxMenuItem( captureMenu, idMenuCapFullScreen, wxString( _("&Full Screen") ) + wxT('\t') + wxT("Ctrl+Alt+F"), _("Takes a screenshot of the entire screen."), wxITEM_NORMAL ); captureMenu->Append( m_menuCapFullScreen ); wxMenuItem* m_menuCapAll; - m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + _T('\t') + _T("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL ); + m_menuCapAll = new wxMenuItem( captureMenu, idMenuCapAll, wxString( _("Capture All") ) + wxT('\t') + wxT("Ctrl+Alt+A"), _("Takes screenshots for all controls automatically."), wxITEM_NORMAL ); captureMenu->Append( m_menuCapAll ); mbar->Append( captureMenu, _("&Capture") ); @@ -93,7 +93,7 @@ void GUIFrame::AddMenuBar() //Help Menu helpMenu = new wxMenu(); wxMenuItem* m_menuHelpAbout; - m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + _T('\t') + _T("F1"), _("Shows info about this application."), wxITEM_NORMAL ); + m_menuHelpAbout = new wxMenuItem( helpMenu, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), _("Shows info about this application."), wxITEM_NORMAL ); helpMenu->Append( m_menuHelpAbout ); mbar->Append( helpMenu, _("&Help") ); @@ -147,16 +147,16 @@ void GUIFrame::AddPanel_1() m_radioBtn2->SetToolTip( _("wxRadioButton") ); fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 ); - m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( _T("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); + m_bpButton1 = new wxBitmapButton( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); m_bpButton1->SetToolTip( _("wxBitmapButton") ); m_bpButton1->SetToolTip( _("wxBitmapButton") ); fgSizer1->Add( m_bpButton1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 ); - m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( _T("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmap1 = new wxStaticBitmap( m_panel1, wxID_ANY, wxBitmap( wxT("bitmaps/wxwin32x32.png"), wxBITMAP_TYPE_ANY ), wxDefaultPosition, wxDefaultSize, 0 ); m_bitmap1->SetToolTip( _("wxStaticBitmap") ); fgSizer1->Add( m_bitmap1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 ); - m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, _T("_Gauge") ); + m_gauge1 = new wxGauge( m_panel1, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL, wxDefaultValidator, wxT("_Gauge") ); m_gauge1->SetValue( 50 ); m_gauge1->SetToolTip( _("wxGauge") ); fgSizer1->Add( m_gauge1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 ); @@ -174,11 +174,11 @@ void GUIFrame::AddPanel_1() m_toggleBtn2->SetToolTip( _("wxToggleButton") ); fgSizer1->Add( m_toggleBtn2, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 ); - m_hyperlink1 = new wxHyperlinkCtrl( m_panel1, wxID_ANY, _("www.wxwidgets.org"), _T("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink1 = new wxHyperlinkCtrl( m_panel1, wxID_ANY, _("www.wxwidgets.org"), wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); m_hyperlink1->SetToolTip( _("wxHyperlinkCtrl") ); fgSizer1->Add( m_hyperlink1, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 20 ); - m_spinCtrl1 = new wxSpinCtrl( m_panel1, wxID_ANY, _T("5"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 ); + m_spinCtrl1 = new wxSpinCtrl( m_panel1, wxID_ANY, wxT("5"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 10, 0 ); m_spinCtrl1->SetToolTip( _("wxSpinCtrl") ); fgSizer1->Add( m_spinCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 ); @@ -247,19 +247,19 @@ void GUIFrame::AddPanel_2() m_animationCtrl1 = new wxAnimationCtrl(m_panel2, wxID_ANY); m_animationCtrl1->SetToolTip(_("wxAnimationCtrl")); - if (m_animationCtrl1->LoadFile(_T("bitmaps/throbber.gif"))) + if (m_animationCtrl1->LoadFile(wxT("bitmaps/throbber.gif"))) m_animationCtrl1->Play(); fgSizer2->Add( m_animationCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 ); //wxCollapsiblePane 1 - m_collPane1 = new wxCollapsiblePane(m_panel2, -1, _T("Collapsed")); + m_collPane1 = new wxCollapsiblePane(m_panel2, -1, wxT("Collapsed")); wxWindow *win = m_collPane1->GetPane(); m_collPane1->SetToolTip(_("wxCollapsiblePane")); wxBoxSizer * collbSizer = new wxBoxSizer(wxVERTICAL); - wxStaticText* m_collSText = new wxStaticText(win, -1, _T("You can place")); - wxButton* m_collBut = new wxButton(win, -1, _T("anything")); - wxTextCtrl* m_collText = new wxTextCtrl(win, -1, _T("inside a wxCollapsiblePane")); + wxStaticText* m_collSText = new wxStaticText(win, -1, wxT("You can place")); + wxButton* m_collBut = new wxButton(win, -1, wxT("anything")); + wxTextCtrl* m_collText = new wxTextCtrl(win, -1, wxT("inside a wxCollapsiblePane")); collbSizer->Add( m_collSText, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 ); collbSizer->Add( m_collBut, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 ); collbSizer->Add( m_collText, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 ); @@ -267,14 +267,14 @@ void GUIFrame::AddPanel_2() fgSizer2->Add( m_collPane1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); //wxCollapsiblePane 2 - m_collPane2 = new wxCollapsiblePane(m_panel2, -1, _T("Expanded")); + m_collPane2 = new wxCollapsiblePane(m_panel2, -1, wxT("Expanded")); wxWindow *win2 = m_collPane2->GetPane(); m_collPane2->SetToolTip(_("wxCollapsiblePane")); wxBoxSizer * collbSizer2 = new wxBoxSizer(wxVERTICAL); - wxStaticText* m_collSText2 = new wxStaticText(win2, -1, _T("You can place")); - wxButton* m_collBut2 = new wxButton(win2, -1, _T("anything")); - wxTextCtrl* m_collText2 = new wxTextCtrl(win2, -1, _T("inside a wxCollapsiblePane")); + wxStaticText* m_collSText2 = new wxStaticText(win2, -1, wxT("You can place")); + wxButton* m_collBut2 = new wxButton(win2, -1, wxT("anything")); + wxTextCtrl* m_collText2 = new wxTextCtrl(win2, -1, wxT("inside a wxCollapsiblePane")); collbSizer2->Add( m_collSText2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 ); collbSizer2->Add( m_collBut2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 ); collbSizer2->Add( m_collText2, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0 ); @@ -309,7 +309,7 @@ void GUIFrame::AddPanel_3() bSizer2->Add( m_textCtrl2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 20 ); m_richText1 = new wxRichTextCtrl( m_panel3, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0|wxVSCROLL|wxHSCROLL|wxNO_BORDER|wxWANTS_CHARS ); - m_richText1->LoadFile(_T("richtext.xml")); + m_richText1->LoadFile(wxT("richtext.xml")); m_richText1->SetToolTip( _("wxRichTextCtrl") ); m_richText1->SetMinSize( wxSize( 200,200 ) ); bSizer2->Add( m_richText1, 0, wxALL, 20 ); @@ -339,7 +339,7 @@ void GUIFrame::AddPanel_4() m_fontPicker1->SetToolTip( _("wxFontPickerCtrl") ); fgSizer5->Add( m_fontPicker1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 20 ); - m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), _T("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, _T("_FilePickerCtrl") ); + m_filePicker1 = new wxFilePickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE, wxDefaultValidator, wxT("_FilePickerCtrl") ); #if defined(__WXMSW__) const wxString a_file = "C:\\Windows\\explorer.exe"; #else @@ -359,13 +359,13 @@ void GUIFrame::AddPanel_4() m_datePicker1->SetToolTip( _("wxDatePickerCtrl") ); fgSizer5->Add( m_datePicker1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 ); - m_genericDirCtrl1 = new wxGenericDirCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, wxEmptyString, 0, _T("_GenericDirCtrl") ); + m_genericDirCtrl1 = new wxGenericDirCtrl( m_panel4, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, wxEmptyString, 0, wxT("_GenericDirCtrl") ); m_genericDirCtrl1->ShowHidden( false ); m_genericDirCtrl1->SetToolTip( _("wxGenericDirCtrl") ); m_genericDirCtrl1->SetMinSize( wxSize( -1,150 ) ); fgSizer5->Add( m_genericDirCtrl1, 1, wxEXPAND|wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 20 ); - m_dirPicker1 = new wxDirPickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE, wxDefaultValidator, _T("_DirPickerCtrl") ); + m_dirPicker1 = new wxDirPickerCtrl( m_panel4, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE, wxDefaultValidator, wxT("_DirPickerCtrl") ); #if defined(__WXMSW__) const wxString a_dir = "C:\\Windows"; #else @@ -415,10 +415,10 @@ void GUIFrame::AddPanel_5() fgSizer4->Add( 0, 120, 1, wxEXPAND, 5 ); m_bmpComboBox1 = new wxBitmapComboBox(m_panel5, wxID_ANY,_("Item1")); - m_bmpComboBox1->Append(_("Item1"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG)); - m_bmpComboBox1->Append(_("Item2"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG)); - m_bmpComboBox1->Append(_("Item3"), wxBitmap(_T("bitmaps/bell.png"),wxBITMAP_TYPE_PNG)); - m_bmpComboBox1->Append(_("Item4"), wxBitmap(_T("bitmaps/sound.png"),wxBITMAP_TYPE_PNG)); + m_bmpComboBox1->Append(_("Item1"), wxBitmap(wxT("bitmaps/bell.png"),wxBITMAP_TYPE_PNG)); + m_bmpComboBox1->Append(_("Item2"), wxBitmap(wxT("bitmaps/sound.png"),wxBITMAP_TYPE_PNG)); + m_bmpComboBox1->Append(_("Item3"), wxBitmap(wxT("bitmaps/bell.png"),wxBITMAP_TYPE_PNG)); + m_bmpComboBox1->Append(_("Item4"), wxBitmap(wxT("bitmaps/sound.png"),wxBITMAP_TYPE_PNG)); m_bmpComboBox1->SetToolTip(_("wxBitmapComboBox")); fgSizer4->Add( m_bmpComboBox1, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 20 ); @@ -437,17 +437,17 @@ void GUIFrame::AddPanel_5() m_comboCtrl1->SetPopupControl(popupList); m_comboCtrl1->SetPopupMaxHeight(80); - m_comboCtrl1->SetText(_T("wxComboCtrl")); + m_comboCtrl1->SetText(wxT("wxComboCtrl")); m_comboCtrl1->SetToolTip(_("wxComboCtrl")); // Populate using wxListView methods - popupList->InsertItem(popupList->GetItemCount(),_T("wxComboCtrl")); - popupList->InsertItem(popupList->GetItemCount(),_T("with")); - popupList->InsertItem(popupList->GetItemCount(),_T("wxListView")); - popupList->InsertItem(popupList->GetItemCount(),_T("popup")); - popupList->InsertItem(popupList->GetItemCount(),_T("Item1")); - popupList->InsertItem(popupList->GetItemCount(),_T("Item2")); - popupList->InsertItem(popupList->GetItemCount(),_T("Item3")); + popupList->InsertItem(popupList->GetItemCount(),wxT("wxComboCtrl")); + popupList->InsertItem(popupList->GetItemCount(),wxT("with")); + popupList->InsertItem(popupList->GetItemCount(),wxT("wxListView")); + popupList->InsertItem(popupList->GetItemCount(),wxT("popup")); + popupList->InsertItem(popupList->GetItemCount(),wxT("Item1")); + popupList->InsertItem(popupList->GetItemCount(),wxT("Item2")); + popupList->InsertItem(popupList->GetItemCount(),wxT("Item3")); popupList->Select(0, true); fgSizer4->Add( m_comboCtrl1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 20 ); @@ -459,7 +459,7 @@ void GUIFrame::AddPanel_5() m_comboCtrl2->SetPopupControl(popupTree); m_comboCtrl2->SetPopupMaxHeight(80); - m_comboCtrl2->SetText(_T("wxComboCtrl")); + m_comboCtrl2->SetText(wxT("wxComboCtrl")); m_comboCtrl2->SetToolTip(_("wxComboCtrl")); //Add a root and some nodes using wxTreeCtrl methods diff --git a/utils/screenshotgen/src/screenshot_main.cpp b/utils/screenshotgen/src/screenshot_main.cpp index 5ff5195828..d7305e8266 100644 --- a/utils/screenshotgen/src/screenshot_main.cpp +++ b/utils/screenshotgen/src/screenshot_main.cpp @@ -68,7 +68,7 @@ void ScreenshotFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) info.SetName(_("Automatic Screenshot Generator")); info.SetVersion(_("1.0")); info.SetDescription(_("This utility automatically creates screenshots of wxWidgets controls for use in wxWidgets documentation.")); - info.SetCopyright(_T("(C) 2008 Utensil Candel")); + info.SetCopyright(wxT("(C) 2008 Utensil Candel")); wxAboutBox(info); } @@ -85,10 +85,10 @@ void ScreenshotFrame::OnCaptureFullScreen(wxCommandEvent& WXUNUSED(event)) wxBitmap fullscreen(1, 1); AutoCaptureMechanism::Capture(&fullscreen, 0, 0, screenWidth, screenHeight); - AutoCaptureMechanism::Save(&fullscreen, _T("fullscreen")); + AutoCaptureMechanism::Save(&fullscreen, wxT("fullscreen")); wxMessageBox(_("A screenshot of the entire screen was saved as:\n\n ") - + AutoCaptureMechanism::GetDefaultDirectoryAbsPath() + _T("fullscreen.png"), + + AutoCaptureMechanism::GetDefaultDirectoryAbsPath() + wxT("fullscreen.png"), _("Full screen capture"), wxICON_INFORMATION|wxOK, this); } @@ -107,7 +107,7 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event)) case wxYES: { wxArrayString files; - wxDir::GetAllFiles(dir, &files, _T("*.png"), wxDIR_FILES); + wxDir::GetAllFiles(dir, &files, wxT("*.png"), wxDIR_FILES); // remove all PNG files from the screenshots folder int n = files.GetCount(); @@ -135,11 +135,11 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event)) auto_cap.RegisterControl(m_radioBtn2, AJ_UnionEnd); auto_cap.RegisterControl(m_bpButton1); auto_cap.RegisterControl(m_bitmap1); - auto_cap.RegisterControl(m_gauge1, _T("wxGauge")); + auto_cap.RegisterControl(m_gauge1, wxT("wxGauge")); auto_cap.RegisterControl(m_slider1); auto_cap.RegisterControl(m_toggleBtn1, AJ_Union); auto_cap.RegisterControl(m_toggleBtn2, AJ_UnionEnd); - auto_cap.RegisterControl(m_hyperlink1, _T("wxHyperlinkCtrl")); + auto_cap.RegisterControl(m_hyperlink1, wxT("wxHyperlinkCtrl")); auto_cap.RegisterControl(m_spinCtrl1, AJ_RegionAdjust); auto_cap.RegisterControl(m_spinBtn1); auto_cap.RegisterControl(m_scrollBar1); @@ -151,10 +151,10 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event)) auto_cap.RegisterControl(m_radioBox1); auto_cap.RegisterControl(m_staticBox1); auto_cap.RegisterControl(m_treeCtrl1); - auto_cap.RegisterControl(m_listCtrl1, _T("wxListCtrl")); + auto_cap.RegisterControl(m_listCtrl1, wxT("wxListCtrl")); auto_cap.RegisterControl(m_animationCtrl1); - auto_cap.RegisterControl(m_collPane1, _T("wxCollapsiblePane"), AJ_Union); + auto_cap.RegisterControl(m_collPane1, wxT("wxCollapsiblePane"), AJ_Union); auto_cap.RegisterControl(m_collPane2, AJ_UnionEnd); auto_cap.RegisterPageTurn(); @@ -165,13 +165,13 @@ void ScreenshotFrame::OnCaptureAllControls(wxCommandEvent& WXUNUSED(event)) auto_cap.RegisterPageTurn(); - auto_cap.RegisterControl(m_colourPicker1, _T("wxColourPickerCtrl")); - auto_cap.RegisterControl(m_fontPicker1, _T("wxFontPickerCtrl")); - auto_cap.RegisterControl(m_filePicker1, _T("wxFilePickerCtrl"), AJ_RegionAdjust); - auto_cap.RegisterControl(m_calendar1, _T("wxCalendarCtrl"), AJ_RegionAdjust); - auto_cap.RegisterControl(m_datePicker1, _T("wxDatePickerCtrl")); - auto_cap.RegisterControl(m_genericDirCtrl1, _T("wxGenericDirCtrl")); - auto_cap.RegisterControl(m_dirPicker1, _T("wxDirPickerCtrl"), AJ_RegionAdjust); + auto_cap.RegisterControl(m_colourPicker1, wxT("wxColourPickerCtrl")); + auto_cap.RegisterControl(m_fontPicker1, wxT("wxFontPickerCtrl")); + auto_cap.RegisterControl(m_filePicker1, wxT("wxFilePickerCtrl"), AJ_RegionAdjust); + auto_cap.RegisterControl(m_calendar1, wxT("wxCalendarCtrl"), AJ_RegionAdjust); + auto_cap.RegisterControl(m_datePicker1, wxT("wxDatePickerCtrl")); + auto_cap.RegisterControl(m_genericDirCtrl1, wxT("wxGenericDirCtrl")); + auto_cap.RegisterControl(m_dirPicker1, wxT("wxDirPickerCtrl"), AJ_RegionAdjust); auto_cap.RegisterPageTurn(); diff --git a/utils/wxrc/wxrc.cpp b/utils/wxrc/wxrc.cpp index 0080c4e75f..7f9abc5aa7 100644 --- a/utils/wxrc/wxrc.cpp +++ b/utils/wxrc/wxrc.cpp @@ -65,9 +65,9 @@ private: wxXmlNode* children; while (node) { - if (node->GetName() == _T("object") - && node->GetAttribute(_T("class"),&classValue) - && node->GetAttribute(_T("name"),&nameValue)) + if (node->GetName() == wxT("object") + && node->GetAttribute(wxT("class"),&classValue) + && node->GetAttribute(wxT("name"),&nameValue)) { m_wdata.Add(XRCWidgetData(nameValue,classValue)); } @@ -84,24 +84,24 @@ public: const wxXmlNode* node) : m_className(className) , m_parentClassName(parentClassName) { - if ( className == _T("wxMenu") ) + if ( className == wxT("wxMenu") ) { - m_ancestorClassNames.insert(_T("wxMenu")); - m_ancestorClassNames.insert(_T("wxMenuBar")); + m_ancestorClassNames.insert(wxT("wxMenu")); + m_ancestorClassNames.insert(wxT("wxMenuBar")); } - else if ( className == _T("wxMDIChildFrame") ) + else if ( className == wxT("wxMDIChildFrame") ) { - m_ancestorClassNames.insert(_T("wxMDIParentFrame")); + m_ancestorClassNames.insert(wxT("wxMDIParentFrame")); } - else if( className == _T("wxMenuBar") || - className == _T("wxStatusBar") || - className == _T("wxToolBar") ) + else if( className == wxT("wxMenuBar") || + className == wxT("wxStatusBar") || + className == wxT("wxToolBar") ) { - m_ancestorClassNames.insert(_T("wxFrame")); + m_ancestorClassNames.insert(wxT("wxFrame")); } else { - m_ancestorClassNames.insert(_T("wxWindow")); + m_ancestorClassNames.insert(wxT("wxWindow")); } BrowseXmlNode(node->GetChildren()); @@ -114,16 +114,16 @@ public: bool CanBeUsedWithXRCCTRL(const wxString& name) { - if (name == _T("tool") || - name == _T("data") || - name == _T("unknown") || - name == _T("notebookpage") || - name == _T("separator") || - name == _T("sizeritem") || - name == _T("wxMenu") || - name == _T("wxMenuBar") || - name == _T("wxMenuItem") || - name.EndsWith(_T("Sizer")) ) + if (name == wxT("tool") || + name == wxT("data") || + name == wxT("unknown") || + name == wxT("notebookpage") || + name == wxT("separator") || + name == wxT("sizeritem") || + name == wxT("wxMenu") || + name == wxT("wxMenuBar") || + name == wxT("wxMenuItem") || + name.EndsWith(wxT("Sizer")) ) { return false; } @@ -133,8 +133,8 @@ public: void GenerateHeaderCode(wxFFile& file) { - file.Write(_T("class ") + m_className + _T(" : public ") + m_parentClassName - + _T(" {\nprotected:\n")); + file.Write(wxT("class ") + m_className + wxT(" : public ") + m_parentClassName + + wxT(" {\nprotected:\n")); size_t i; for(i=0;iLoadObject(this,parent,_T(\"") + file.Write(wxT("\nprivate:\n void InitWidgetsFromXRC(wxWindow *parent){\n") + wxT(" wxXmlResource::Get()->LoadObject(this,parent,wxT(\"") + m_className - + _T("\"), _T(\"") + + wxT("\"), wxT(\"") + m_parentClassName - + _T("\"));\n")); + + wxT("\"));\n")); for(i=0;iGetChildren(); wxString classValue,nameValue; while(node){ - if(node->GetName() == _T("object") - && node->GetAttribute(_T("class"),&classValue) - && node->GetAttribute(_T("name"),&nameValue)){ + if(node->GetName() == wxT("object") + && node->GetAttribute(wxT("class"),&classValue) + && node->GetAttribute(wxT("name"),&nameValue)){ aXRCWndClassData.Add( XRCWndClassData(nameValue,classValue,node) @@ -452,36 +452,36 @@ static bool NodeContainsFilename(wxXmlNode *node) const wxString name = node->GetName(); // Any bitmaps (bitmap2 is used for disabled toolbar buttons): - if ( name == _T("bitmap") || name == _T("bitmap2") ) + if ( name == wxT("bitmap") || name == wxT("bitmap2") ) return true; - if ( name == _T("icon") ) + if ( name == wxT("icon") ) return true; // wxBitmapButton: wxXmlNode *parent = node->GetParent(); if (parent != NULL && - parent->GetAttribute(_T("class"), _T("")) == _T("wxBitmapButton") && - (name == _T("focus") || - name == _T("disabled") || - name == _T("hover") || - name == _T("selected"))) + parent->GetAttribute(wxT("class"), wxT("")) == wxT("wxBitmapButton") && + (name == wxT("focus") || + name == wxT("disabled") || + name == wxT("hover") || + name == wxT("selected"))) return true; // wxBitmap or wxIcon toplevel resources: - if ( name == _T("object") ) + if ( name == wxT("object") ) { - wxString klass = node->GetAttribute(_T("class"), wxEmptyString); - if (klass == _T("wxBitmap") || - klass == _T("wxIcon") || - klass == _T("data") ) + wxString klass = node->GetAttribute(wxT("class"), wxEmptyString); + if (klass == wxT("wxBitmap") || + klass == wxT("wxIcon") || + klass == wxT("data") ) return true; } // URLs in wxHtmlWindow: - if ( name == _T("url") && + if ( name == wxT("url") && parent != NULL && - parent->GetAttribute(_T("class"), _T("")) == _T("wxHtmlWindow") ) + parent->GetAttribute(wxT("class"), wxT("")) == wxT("wxHtmlWindow") ) { // FIXME: this is wrong for e.g. http:// URLs return true; @@ -513,7 +513,7 @@ void XmlResApp::FindFilesInXML(wxXmlNode *node, wxArrayString& flist, const wxSt fullname = inputPath + wxFILE_SEP_PATH + n->GetContent(); if (flagVerbose) - wxPrintf(_T("adding ") + fullname + _T("...\n")); + wxPrintf(wxT("adding ") + fullname + wxT("...\n")); wxString filename = GetInternalFileName(n->GetContent(), flist); n->SetContent(filename); @@ -549,22 +549,22 @@ void XmlResApp::MakePackageZIP(const wxArrayString& flist) wxString files; for (size_t i = 0; i < flist.GetCount(); i++) - files += flist[i] + _T(" "); + files += flist[i] + wxT(" "); files.RemoveLast(); if (flagVerbose) - wxPrintf(_T("compressing ") + parOutput + _T("...\n")); + wxPrintf(wxT("compressing ") + parOutput + wxT("...\n")); wxString cwd = wxGetCwd(); wxSetWorkingDirectory(parOutputPath); - int execres = wxExecute(_T("zip -9 -j ") + - wxString(flagVerbose ? _T("\"") : _T("-q \"")) + - parOutput + _T("\" ") + files, true); + int execres = wxExecute(wxT("zip -9 -j ") + + wxString(flagVerbose ? wxT("\"") : wxT("-q \"")) + + parOutput + wxT("\" ") + files, true); wxSetWorkingDirectory(cwd); if (execres == -1) { - wxLogError(_T("Unable to execute zip program. Make sure it is in the path.")); - wxLogError(_T("You can download it at http://www.cdrom.com/pub/infozip/")); + wxLogError(wxT("Unable to execute zip program. Make sure it is in the path.")); + wxLogError(wxT("You can download it at http://www.cdrom.com/pub/infozip/")); retCode = 1; return; } @@ -585,9 +585,9 @@ static wxString FileToCppArray(wxString filename, int num) wxASSERT_MSG( static_cast(lng) == offset, wxT("Huge file not supported") ); - snum.Printf(_T("%i"), num); - output.Printf(_T("static size_t xml_res_size_") + snum + _T(" = %i;\n"), lng); - output += _T("static unsigned char xml_res_file_") + snum + _T("[] = {\n"); + snum.Printf(wxT("%i"), num); + output.Printf(wxT("static size_t xml_res_size_") + snum + wxT(" = %i;\n"), lng); + output += wxT("static unsigned char xml_res_file_") + snum + wxT("[] = {\n"); // we cannot use string literals because MSVC is dumb wannabe compiler // with arbitrary limitation to 2048 strings :( @@ -596,12 +596,12 @@ static wxString FileToCppArray(wxString filename, int num) for (size_t i = 0, linelng = 0; i < lng; i++) { - tmp.Printf(_T("%i"), buffer[i]); - if (i != 0) output << _T(','); + tmp.Printf(wxT("%i"), buffer[i]); + if (i != 0) output << wxT(','); if (linelng > 70) { linelng = 0; - output << _T("\n"); + output << wxT("\n"); } output << tmp; linelng += tmp.Length()+1; @@ -609,7 +609,7 @@ static wxString FileToCppArray(wxString filename, int num) delete[] buffer; - output += _T("};\n\n"); + output += wxT("};\n\n"); return output; } @@ -621,7 +621,7 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist) size_t i; if (flagVerbose) - wxPrintf(_T("creating C++ source file ") + parOutput + _T("...\n")); + wxPrintf(wxT("creating C++ source file ") + parOutput + wxT("...\n")); file.Write("" "//\n" @@ -673,8 +673,8 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist) wxString mime; wxString ext = wxFileName(flist[i]).GetExt(); - if ( ext.Lower() == _T("xrc") ) - mime = _T("text/xml"); + if ( ext.Lower() == wxT("xrc") ) + mime = wxT("text/xml"); #if wxUSE_MIMETYPE else { @@ -688,7 +688,7 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist) #endif // wxUSE_MIMETYPE s.Printf(" XRC_ADD_FILE(wxT(\"XRC_resource/" + flist[i] + - "\"), xml_res_file_%i, xml_res_size_%i, _T(\"%s\"));\n", + "\"), xml_res_file_%i, xml_res_size_%i, wxT(\"%s\"));\n", i, i, mime.c_str()); file.Write(s); } @@ -707,7 +707,7 @@ void XmlResApp::MakePackageCPP(const wxArrayString& flist) void XmlResApp::GenCPPHeader() { wxString fileSpec = ((parOutput.BeforeLast('.')).AfterLast('/')).AfterLast('\\'); - wxString heaFileName = fileSpec + _T(".h"); + wxString heaFileName = fileSpec + wxT(".h"); wxFFile file(heaFileName, wxT("wt")); file.Write( @@ -739,7 +739,7 @@ static wxString FileToPythonArray(wxString filename, int num) wxASSERT_MSG( static_cast(lng) == offset, wxT("Huge file not supported") ); - snum.Printf(_T("%i"), num); + snum.Printf(wxT("%i"), num); output = " xml_res_file_" + snum + " = '''\\\n"; unsigned char *buffer = new unsigned char[lng]; @@ -754,15 +754,15 @@ static wxString FileToPythonArray(wxString filename, int num) linelng = 0; } else if (c < 32 || c > 127 || c == '\'') - tmp.Printf(_T("\\x%02x"), c); + tmp.Printf(wxT("\\x%02x"), c); else if (c == '\\') - tmp = _T("\\\\"); + tmp = wxT("\\\\"); else tmp = (wxChar)c; if (linelng > 70) { linelng = 0; - output << _T("\\\n"); + output << wxT("\\\n"); } output << tmp; linelng += tmp.Length(); @@ -770,7 +770,7 @@ static wxString FileToPythonArray(wxString filename, int num) delete[] buffer; - output += _T("'''\n\n"); + output += wxT("'''\n\n"); return output; } @@ -782,7 +782,7 @@ void XmlResApp::MakePackagePython(const wxArrayString& flist) size_t i; if (flagVerbose) - wxPrintf(_T("creating Python source file ") + parOutput + _T("...\n")); + wxPrintf(wxT("creating Python source file ") + parOutput + wxT("...\n")); file.Write( "#\n" @@ -863,12 +863,12 @@ ExtractedStrings XmlResApp::FindStrings() for (size_t i = 0; i < parFiles.GetCount(); i++) { if (flagVerbose) - wxPrintf(_T("processing ") + parFiles[i] + _T("...\n")); + wxPrintf(wxT("processing ") + parFiles[i] + wxT("...\n")); wxXmlDocument doc; if (!doc.Load(parFiles[i])) { - wxLogError(_T("Error parsing file ") + parFiles[i]); + wxLogError(wxT("Error parsing file ") + parFiles[i]); retCode = 1; continue; } @@ -937,20 +937,20 @@ XmlResApp::FindStrings(const wxString& filename, wxXmlNode *node) n->GetType() == wxXML_CDATA_SECTION_NODE) && // ...it is textnode... ( - node/*not n!*/->GetName() == _T("label") || - (node/*not n!*/->GetName() == _T("value") && + node/*not n!*/->GetName() == wxT("label") || + (node/*not n!*/->GetName() == wxT("value") && !n->GetContent().IsNumber()) || - node/*not n!*/->GetName() == _T("help") || - node/*not n!*/->GetName() == _T("longhelp") || - node/*not n!*/->GetName() == _T("tooltip") || - node/*not n!*/->GetName() == _T("htmlcode") || - node/*not n!*/->GetName() == _T("title") || - node/*not n!*/->GetName() == _T("item") + node/*not n!*/->GetName() == wxT("help") || + node/*not n!*/->GetName() == wxT("longhelp") || + node/*not n!*/->GetName() == wxT("tooltip") || + node/*not n!*/->GetName() == wxT("htmlcode") || + node/*not n!*/->GetName() == wxT("title") || + node/*not n!*/->GetName() == wxT("item") )) // ...and known to contain translatable string { if (!flagGettext || - node->GetAttribute(_T("translate"), _T("1")) != _T("0")) + node->GetAttribute(wxT("translate"), wxT("1")) != wxT("0")) { arr.push_back ( -- 2.45.2