jquant2.o \
jdmerge.o
-
-OBJECTS = $(@GUIOBJS@) $(@COMMONOBJS@) $(@GENERICOBJS@) $(@UNIXOBJS@) $(HTMLOBJS) \
- $(JPEGOBJS) $(PNGOBJS) $(ZLIBOBJS)
-
-DEPFILES = $(@GUIDEPS@) $(@COMMONDEPS@) $(@GENERICDEPS@) $(UNIXDEPS) $(HTMLDEPS)
-
-HEADERS = $(@GUIHEADERS@) $(HTML_HEADERS) $(UNIX_HEADERS) $(PROTOCOL_HEADERS) \
- $(GENERIC_HEADERS) $(WX_HEADERS)
+BASE_OBJS = \
+ dynarray.o \
+ event.o \
+ hash.o \
+ intl.o \
+ init.o \
+ file.o \
+ filefn.o \
+ list.o \
+ log.o \
+ object.o \
+ string.o \
+ utilscmn.o \
+ utilsunx.o
+
+BASE_DEPS = \
+ dynarray.d \
+ event.d \
+ hash.d \
+ intl.d \
+ init.d \
+ file.d \
+ filefn.d \
+ list.d \
+ log.d \
+ object.d \
+ string.d \
+ utilscmn.d \
+ utilsunx.d
+
+BASE_HEADERS =
+
+GUIOBJS = @GUIOBJS@
+GUIDEPS = @GUIDEPS@
+GUIHEADERS = @GUIHEADERS@
+COMMONOBJS = @COMMONOBJS@
+COMMONDEPS = @COMMONDEPS@
+GENERICOBJS = @GENERICOBJS@
+GENERICDEPS = @GENERICDEPS@
+UNIXOBJS = @UNIXOBJS@
+UNIXDEPS = @UNIXDEPS@
+
+OBJECTS = @ALL_OBJECTS@
+
+DEPFILES = @ALL_DEPFILES@
+
+HEADERS = @ALL_HEADERS@
all: @WX_CREATE_LINKS@
if (gtk_minor_version == 1) return FALSE;
return !((gtk_major_version > major) ||
- ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
- ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
+ ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
+ ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)));
}
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
DEFAULT_wxUSE_UNICODE=no
DEFAULT_wxUSE_WCSRTOMBS=no
-
+
DEFAULT_wxUSE_GIF=no
DEFAULT_wxUSE_PCX=no
DEFAULT_wxUSE_PNM=no
DEFAULT_wxUSE_UNICODE=no
DEFAULT_wxUSE_WCSRTOMBS=no
-
+
DEFAULT_wxUSE_GIF=yes
DEFAULT_wxUSE_PCX=yes
DEFAULT_wxUSE_PNM=yes
fi
done
+dnl ---------------------------------------------------------------------------
+dnl --disable-gui will build only non-GUI part of wxWindows: check for this
+dnl first to disable many other switches if it's given
+dnl
+dnl NB: this is still in testing stage, don't use if you don't know what you're
+dnl doing
+dnl ---------------------------------------------------------------------------
+
+WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI)
+
+dnl disable everything GUI related then
+if test "$wxUSE_GUI" = "no"; then
+ DEFAULT_wxUSE_ZLIB=no
+ DEFAULT_wxUSE_LIBPNG=no
+ DEFAULT_wxUSE_LIBJPEG=no
+ DEFAULT_wxUSE_SOCKETS=no
+ DEFAULT_wxUSE_JOYSTICK=no
+ DEFAULT_wxUSE_AFM_FOR_POSTSCRIPT=no
+ DEFAULT_wxUSE_NORMALIZED_PS_FONTS=no
+ DEFAULT_wxUSE_POSTSCRIPT=no
+ DEFAULT_wxUSE_X_RESOURCES=no
+ DEFAULT_wxUSE_CLIPBOARD=no
+ DEFAULT_wxUSE_TOOLTIPS=no
+ DEFAULT_wxUSE_DRAG_AND_DROP=no
+ DEFAULT_wxUSE_SPLINES=no
+ DEFAULT_wxUSE_MDI_ARCHITECTURE=no
+ DEFAULT_wxUSE_DOC_VIEW_ARCHITECTURE=no
+ DEFAULT_wxUSE_PRINTING_ARCHITECTURE=no
+ DEFAULT_wxUSE_PROLOGIO=no
+ DEFAULT_wxUSE_RESOURCES=no
+ DEFAULT_wxUSE_CONSTRAINTS=no
+ DEFAULT_wxUSE_IPC=no
+ DEFAULT_wxUSE_HELP=no
+ DEFAULT_wxUSE_WXTREE=no
+ DEFAULT_wxUSE_METAFILE=no
+ DEFAULT_wxUSE_COMMONDLGS=no
+ DEFAULT_wxUSE_DIRDLG=no
+ DEFAULT_wxUSE_TEXTDLG=no
+ DEFAULT_wxUSE_STARTUP_TIPS=no
+ DEFAULT_wxUSE_PROGRESSDLG=no
+ DEFAULT_wxUSE_MINIFRAME=no
+ DEFAULT_wxUSE_HTML=no
+ DEFAULT_wxUSE_FS_INET=no
+ DEFAULT_wxUSE_FS_ZIP=no
+ DEFAULT_wxUSE_BUSYINFO=no
+ DEFAULT_wxUSE_ZIPSTREAM=no
+ DEFAULT_wxUSE_VALIDATORS=yes
+ DEFAULT_wxUSE_ACCEL=no
+ DEFAULT_wxUSE_CARET=no
+ DEFAULT_wxUSE_BMPBUTTON=no
+ DEFAULT_wxUSE_CHECKBOX=no
+ DEFAULT_wxUSE_CHECKLST=no
+ DEFAULT_wxUSE_CHOICE=yes
+ DEFAULT_wxUSE_COMBOBOX=no
+ DEFAULT_wxUSE_GAUGE=no
+ DEFAULT_wxUSE_GRID=no
+ DEFAULT_wxUSE_IMAGLIST=no
+ DEFAULT_wxUSE_LISTBOX=no
+ DEFAULT_wxUSE_LISTCTRL=no
+ DEFAULT_wxUSE_NOTEBOOK=no
+ DEFAULT_wxUSE_RADIOBOX=no
+ DEFAULT_wxUSE_RADIOBTN=no
+ DEFAULT_wxUSE_SASH=no
+ DEFAULT_wxUSE_SCROLLBAR=no
+ DEFAULT_wxUSE_SLIDER=no
+ DEFAULT_wxUSE_SPINBTN=no
+ DEFAULT_wxUSE_SPLITTER=no
+ DEFAULT_wxUSE_STATBMP=no
+ DEFAULT_wxUSE_STATBOX=no
+ DEFAULT_wxUSE_STATLINE=no
+ DEFAULT_wxUSE_STATUSBAR=yes
+ DEFAULT_wxUSE_TABDIALOG=no
+ DEFAULT_wxUSE_TOOLBAR=no
+ DEFAULT_wxUSE_TREECTRL=no
+ DEFAULT_wxUSE_GIF=no
+ DEFAULT_wxUSE_PCX=no
+ DEFAULT_wxUSE_PNM=no
+fi
+
AC_ARG_WITH(gtk, [ --with-gtk use GTK+], [wxUSE_GTK="$withval" CACHE_GTK=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif], [wxUSE_MOTIF="$withval" CACHE_MOTIF=1 TOOLKIT_GIVEN=1])
AC_ARG_WITH(wine, [ --with-wine use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1])
WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
-dnl ---------------------------------------------------------------------------
-dnl --disable-gui will build only non-GUI part of wxWindows
-dnl
-dnl NB: this is still in testing stage, don't use if you don't know what you're
-dnl doing
-dnl ---------------------------------------------------------------------------
-
-WX_ARG_ENABLE(gui, [ --enable-gui use GUI classes], wxUSE_GUI)
-
dnl ---------------------------------------------------------------------------
dnl (small) optional non GUI classes
dnl ---------------------------------------------------------------------------
AC_MSG_CHECKING(for toolkit)
+if test "$wxUSE_GUI" = "yes"; then
+
if test "$TOOLKIT_GIVEN" = 1; then
dnl convert "yes" to 1 and "no" to 0
for toolkit in `echo $ALL_TOOLKITS`; do
fi
done
+dnl from "if wxUSE_GUI"
+else
+ AC_MSG_RESULT(base only)
+fi
+
dnl ---------------------------------------------------------------------------
dnl Checks for programs
dnl ---------------------------------------------------------------------------
dnl search for toolkit (widget sets)
dnl ----------------------------------------------------------------
+if test "$wxUSE_GUI" = "yes"; then
+
TOOLKIT=
TOOLKIT_INCLUDE=
if test "$wxUSE_CYGWIN" = 1 || test "$wxUSE_MINGW" = 1 ; then
if test "$cross_compiling" = "yes" ; then
- AC_MSG_WARN(Cross compiling --- skipping windows.h check)
+ AC_MSG_WARN(Cross compiling --- skipping windows.h check)
else
- AC_MSG_CHECKING(for Windows headers)
- WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h)
- if test "$ac_find_includes" != "" ; then
+ AC_MSG_CHECKING(for Windows headers)
+ WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, windows.h)
+ if test "$ac_find_includes" != "" ; then
AC_MSG_RESULT(found $ac_find_includes)
TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE -I$ac_find_includes"
- else
+ else
AC_MSG_RESULT(no)
AC_MSG_ERROR(please set CFLAGS to contain the location of windows.h)
fi
TOOLKIT=MSW
- GUIOBJS=MSW_GUIOBJS
- GUIHEADERS=MSW_HEADERS
- COMMONOBJS=MSW_COMMONOBJS
- GENERICOBJS=MSW_GENERICOBJS
+ GUIOBJS="\$(MSW_GUIOBJS)"
+ GUIHEADERS="\$(MSW_HEADERS)"
+ COMMONOBJS="\$(MSW_COMMONOBJS)"
+ GENERICOBJS="\$(MSW_GENERICOBJS)"
UNIXOBJS=
GUIDIST=MSW_DIST
PROGRAM_EXT=.exe
GUI_TK_LIBRARY="$GTK_LIBS"
TOOLKIT=GTK
- GUIHEADERS=GTK_HEADERS
- GUIOBJS=GTK_GUIOBJS
- COMMONOBJS=GTK_COMMONOBJS
- GENERICOBJS=GTK_GENERICOBJS
- GUIDEPS=GTK_GUIDEPS
- COMMONDEPS=GTK_COMMONDEPS
- GENERICDEPS=GTK_GENERICDEPS
- UNIXOBJS=UNIXOBJS
+ GUIOBJS="\$(GTK_GUIOBJS)"
+ GUIHEADERS="\$(GTK_HEADERS)"
+ COMMONOBJS="\$(GTK_COMMONOBJS)"
+ GENERICOBJS="\$(GTK_GENERICOBJS)"
+ GUIDEPS="\$(GTK_GUIDEPS)"
+ COMMONDEPS="\$(GTK_COMMONDEPS)"
+ GENERICDEPS="\$(GTK_GENERICDEPS)"
+ UNIXOBJS="\$(UNIX_OBJS)"
GUIDIST=GTK_DIST
fi
WXWINE=1
TOOLKIT=MSW
- GUIHEADERS=MSW_HEADERS
- GUIOBJS=MSW_GUIOBJS
- COMMONOBJS=MSW_COMMONOBJS
- GENERICOBJS=MSW_GENERICOBJS
- GUIDEPS=MSW_GUIDEPS
- COMMONDEPS=MSW_COMMONDEPS
- GENERICDEPS=MSW_GENERICDEPS
- UNIXOBJS=UNIXOBJS
+ GUIHEADERS="\$(MSW_HEADERS)"
+ GUIOBJS="\$(MSW_GUIOBJS)"
+ COMMONOBJS="\$(MSW_COMMONOBJS)"
+ GENERICOBJS="\$(MSW_GENERICOBJS)"
+ GUIDEPS="\$(MSW_GUIDEPS)"
+ COMMONDEPS="\$(MSW_COMMONDEPS)"
+ GENERICDEPS="\$(MSW_GENERICDEPS)"
+ UNIXOBJS="\$(UNIX_OBJS)"
GUIDIST=MSW_DIST
fi
GUI_TK_LIBRARY="$GUI_TK_LIBRARY $GUI_TK_LINK"
TOOLKIT=MOTIF
- GUIHEADERS=MOTIF_HEADERS
- GUIOBJS=MOTIF_GUIOBJS
- COMMONOBJS=MOTIF_COMMONOBJS
- GENERICOBJS=MOTIF_GENERICOBJS
- GUIDEPS=MOTIF_GUIDEPS
- COMMONDEPS=MOTIF_COMMONDEPS
- GENERICDEPS=MOTIF_GENERICDEPS
- UNIXOBJS=UNIXOBJS
+ GUIHEADERS="\$(MOTIF_HEADERS)"
+ GUIOBJS="\$(MOTIF_GUIOBJS)"
+ COMMONOBJS="\$(MOTIF_COMMONOBJS)"
+ GENERICOBJS="\$(MOTIF_GENERICOBJS)"
+ GUIDEPS="\$(MOTIF_GUIDEPS)"
+ COMMONDEPS="\$(MOTIF_COMMONDEPS)"
+ GENERICDEPS="\$(MOTIF_GENERICDEPS)"
+ UNIXOBJS="\$(UNIX_OBJS)"
GUIDIST=MOTIF_DIST
fi
dnl the name of the (libtool) library
WX_LIBRARY="wx_${TOOLKIT_DIR}"
+ dnl the sources, their dependenices and the headers
+ ALL_OBJECTS="\$(GUIOBJS) \$(COMMONOBJS) \$(GENERICOBJS) \$(UNIXOBJS) \$(HTMLOBJS) \$(JPEGOBJS) \$(PNGOBJS) \$(ZLIBOBJS)"
+ ALL_DEPFILES="\$(GUIDEPS) \$(COMMONDEPS) \$(GENERICDEPS) \$(UNIXDEPS) \$(HTMLDEPS)"
+ ALL_HEADERS="\$(GUIHEADERS) \$(HTML_HEADERS) \$(UNIX_HEADERS) \$(PROTOCOL_HEADERS) \$(GENERIC_HEADERS) \$(WX_HEADERS)"
+else
+ dnl leave all TOOLKIT_XXX vars empty
+
+ dnl the sources, their dependenices and the headers
+ ALL_OBJECTS="\$(BASE_OBJS)"
+ ALL_DEPFILES="\${BASE_DEPS}"
+ ALL_HEADERS="\${BASE_HEADERS}"
+
+ dnl building wxBase only
+ WX_LIBRARY="wxbase"
+fi
+
dnl the name of the (libtool) library
-WX_LIBRARY_NAME="libwx_${TOOLKIT_DIR}.la"
+WX_LIBRARY_NAME="lib${WX_LIBRARY}.la"
dnl the name of the static library
-WX_LIBRARY_NAME_STATIC="libwx_${TOOLKIT_DIR}.a"
+WX_LIBRARY_NAME_STATIC="lib${WX_LIBRARY}.a"
dnl the name of the shared library
-WX_LIBRARY_NAME_SHARED="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
+WX_LIBRARY_NAME_SHARED="lib${WX_LIBRARY}-${WX_RELEASE}.so.${WX_CURRENT}.${WX_REVISION}.${WX_AGE}"
dnl the name of the links to the shared library
-WX_LIBRARY_LINK1="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so.${WX_CURRENT}"
-WX_LIBRARY_LINK2="libwx_${TOOLKIT_DIR}-${WX_RELEASE}.so"
-WX_LIBRARY_LINK3="libwx_${TOOLKIT_DIR}.so"
+WX_LIBRARY_LINK1="lib${WX_LIBRARY}-${WX_RELEASE}.so.${WX_CURRENT}"
+WX_LIBRARY_LINK2="lib${WX_LIBRARY}-${WX_RELEASE}.so"
+WX_LIBRARY_LINK3="lib${WX_LIBRARY}.so"
dnl shared library settings
SHARED_LD=
AC_CHECK_HEADERS(wcstr.h)
dnl defines HAVE_FNMATCH_H
AC_CHECK_HEADERS(fnmatch.h)
-dnl defines HAVE_X11_XKBLIB_H
-AC_CHECK_HEADERS(X11/XKBlib.h)
+
+if test "$wxUSE_GUI" = "yes"; then
+ dnl defines HAVE_X11_XKBLIB_H
+ AC_CHECK_HEADERS(X11/XKBlib.h)
+fi
dnl ---------------------------------------------------------------------------
dnl Checks for typedefs
dnl check for uname (POSIX) and gethostname (BSD)
AC_CHECK_FUNCS(uname gethostname, break)
+dnl check for MT-safe version of strtok
+AC_CHECK_FUNCS(strtok_r)
+
dnl check for inet_addr, inet_aton, ...
AC_CHECK_FUNCS(inet_addr)
AC_CHECK_FUNCS(inet_aton)
DEP_INFO_FLAGS=
if test "$GCC" = yes ; then
if test "$wxUSE_NO_RTTI" = "yes" ; then
- WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti"
+ WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-rtti"
fi
if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
- WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-exceptions"
+ WXDEBUG_DEFINE="$WXDEBUG_DEFINE -fno-exceptions"
fi
if test "$wxUSE_PERMISSIVE" = "yes" ; then
CFLAGS="${CFLAGS} -fpermissive"
AC_MSG_WARN("--with-dynlib and --with-odbc will be disabled due to missing shared library support")
wxUSE_ODBC=no
wxUSE_DYNLIB_CLASS=no
- else
- AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.")
- fi
+ else
+ AC_MSG_WARN("Cannot check dynlib requirements on non-Unix platforms. dynlib remains enabled.")
+ fi
fi
fi
if test "$wxUSE_GTK" = 1; then
if test "$WXGTK12" != 1; then
AC_MSG_WARN([Drag and drop is only supported under GTK+ 1.2])
- wxUSE_DRAG_AND_DROP=no
+ wxUSE_DRAG_AND_DROP=no
fi
fi
if test "$wxUSE_MOTIF" = 1; then
AC_MSG_WARN([Drag and drop is not yet supported under Motif])
- wxUSE_DRAG_AND_DROP=no
+ wxUSE_DRAG_AND_DROP=no
fi
if test "$wxUSE_DRAG_AND_DROP" = "yes"; then
if test "$wxUSE_WINE" = 1 ; then
AC_MSG_WARN([wxStaticLine is not supported under WINE])
else
- AC_DEFINE(wxUSE_STATLINE)
+ AC_DEFINE(wxUSE_STATLINE)
fi
fi
dnl Output the makefiles and such from the results found above
dnl ---------------------------------------------------------------------------
-dnl if we add wxUSE_GUI in the future, it might be handy to separate the libs
-dnl into GUI and non-GUI parts
GUILIBS="$GUI_TK_LIBRARY $OPENGL_LINK $LIBPNG_LINK $ZLIB_LINK $TOOLKIT_LINK"
dnl all additional libraries (except wxWindows itself) we link with
-EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK $GUILIBS"
-
-dnl all the libraries needed to link wxWindows programs (when the library is not
-dnl yet installed)
-LIBS="\${top_builddir}/src/${TOOLKIT_DIR}/${WX_LIBRARY_NAME} $EXTRA_LIBS"
+EXTRA_LIBS="$LIBS $POSIX4_LINK $WCHAR_LINK $THREADS_LINK $DMALLOC_LINK"
+if test "$wxUSE_GUI" = "yes"; then
+ EXTRA_LIBS="$EXTRA_LIBS $GUILIBS"
+fi
dnl all the libraries needed to link wxWindows programs when using the
dnl makefile system without libtool
if test "$GXX" = yes ; then
dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
CXXWARNINGS="-Wall"
- dnl there is one weird warning in docview.h:71 which prevents me from doing
- dnl this...
+ dnl FIXME: there is one weird warning in docview.h:71 which prevents me from
+ dnl doing this... (VZ)
dnl CXXWARNINGS="-Wall -Werror"
fi
EXTRA_CFLAGS="$WXDEBUG $PROFILE $OPTIMISE $INCLUDES"
dnl mfc, nativdlg, oleauto, ownerdrw, proplist
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS bombs controls dialogs drawing dynamic \
forty fractal image wxpoem"
+else
+ SAMPLES_SUBDIRS=""
fi
dnl for convenience, sort the samples in alphabetical order
AC_SUBST(COMMONDEPS)
AC_SUBST(GENERICDEPS)
AC_SUBST(UNIXOBJS)
+AC_SUBST(UNIXDEPS)
+AC_SUBST(ALL_OBJECTS)
+AC_SUBST(ALL_DEPFILES)
+AC_SUBST(ALL_HEADERS)
AC_SUBST(GUIDIST)
dnl additional subdirectories where we will build
dnl colon)
AC_OUTPUT([
wx-config
- src/make.env
- src/makeprog.env
- src/makelib.env
+ src/make.env
+ src/makeprog.env
+ src/makelib.env
Makefile
samples/Makefile
samples/bombs/Makefile
samples/checklst/Makefile
samples/config/Makefile
samples/controls/Makefile
- samples/dialogs/Makefile
- samples/docview/Makefile
- samples/docvwmdi/Makefile
- samples/dnd/Makefile
- samples/drawing/Makefile
- samples/dynamic/Makefile
- samples/image/Makefile
- samples/internat/Makefile
- samples/layout/Makefile
- samples/listctrl/Makefile
- samples/mdi/Makefile
- samples/minifram/Makefile
- samples/minimal/Makefile
- samples/notebook/Makefile
+ samples/dialogs/Makefile
+ samples/docview/Makefile
+ samples/docvwmdi/Makefile
+ samples/dnd/Makefile
+ samples/drawing/Makefile
+ samples/dynamic/Makefile
+ samples/image/Makefile
+ samples/internat/Makefile
+ samples/layout/Makefile
+ samples/listctrl/Makefile
+ samples/mdi/Makefile
+ samples/minifram/Makefile
+ samples/minimal/Makefile
+ samples/notebook/Makefile
samples/printing/Makefile
samples/proplist/Makefile
- samples/sashtest/Makefile
- samples/scroll/Makefile
- samples/splitter/Makefile
- samples/text/Makefile
- samples/thread/Makefile
- samples/toolbar/Makefile
- samples/treectrl/Makefile
- samples/typetest/Makefile
- samples/validate/Makefile
- samples/wxpoem/Makefile
- samples/wxsocket/Makefile
- samples/wizard/Makefile
- samples/html/Makefile
- samples/html/about/Makefile
- samples/html/help/Makefile
- samples/html/printing/Makefile
- samples/html/test/Makefile
- samples/html/zip/Makefile
- samples/html/virtual/Makefile
- samples/html/widget/Makefile
- utils/Makefile
- utils/wxMMedia2/Makefile
- utils/wxMMedia2/lib/Makefile
- utils/wxMMedia2/sample/Makefile
- utils/glcanvas/Makefile
- utils/glcanvas/${GL_TOOLKIT_DIR}/Makefile
- utils/ogl/Makefile
- utils/ogl/src/Makefile
+ samples/sashtest/Makefile
+ samples/scroll/Makefile
+ samples/splitter/Makefile
+ samples/text/Makefile
+ samples/thread/Makefile
+ samples/toolbar/Makefile
+ samples/treectrl/Makefile
+ samples/typetest/Makefile
+ samples/validate/Makefile
+ samples/wxpoem/Makefile
+ samples/wxsocket/Makefile
+ samples/wizard/Makefile
+ samples/html/Makefile
+ samples/html/about/Makefile
+ samples/html/help/Makefile
+ samples/html/printing/Makefile
+ samples/html/test/Makefile
+ samples/html/zip/Makefile
+ samples/html/virtual/Makefile
+ samples/html/widget/Makefile
+ utils/Makefile
+ utils/wxMMedia2/Makefile
+ utils/wxMMedia2/lib/Makefile
+ utils/wxMMedia2/sample/Makefile
+ utils/glcanvas/Makefile
+ utils/glcanvas/${GL_TOOLKIT_DIR}/Makefile
+ utils/ogl/Makefile
+ utils/ogl/src/Makefile
],
[
chmod +x wx-config
- if test ! -d include; then
- mkdir include
- fi
- if test ! -d include/wx; then
- mkdir include/wx
- fi
- if test ! -d include/wx/${TOOLKIT_DIR}; then
- mkdir include/wx/${TOOLKIT_DIR}
- fi
- cp -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
+ if test ! -d include; then
+ mkdir include
+ fi
+ if test ! -d include/wx; then
+ mkdir include/wx
+ fi
+ if test ! -d include/wx/${TOOLKIT_DIR}; then
+ mkdir include/wx/${TOOLKIT_DIR}
+ fi
+ cp -f setup.h include/wx/${TOOLKIT_DIR}/setup.h
],
[
LN_S="${ac_cv_prog_LN_S}"
# compiler, &c)
#
# Known flags:
+# B makes part of the base library too
# 16 a generic file implementing Win32 control for Win16
# 32 only can be compiled under Win32
# PS PostScript related file, normally not compiled under Windows
# S Socket file (currently doesn't compile under Win16 nor with GNU)
# R Not required for the GTK port
# X Not required for the Motif port
+#
# WX Base header
# GTK GTK header
# MSW MSW header
choiccmn.cpp C R
cmndata.cpp C
-config.cpp C
+config.cpp C B
ctrlcmn.cpp C R
-date.cpp C
+date.cpp C B
datstrm.cpp C
db.cpp C
dbtable.cpp C
dlgcmn.cpp C
docmdi.cpp C
docview.cpp C
-dynarray.cpp C
-dynlib.cpp C
+dynarray.cpp C B
+dynlib.cpp C B
event.cpp C
-extended.c C
-ffile.cpp C
-file.cpp C
-fileconf.cpp C
-filefn.cpp C
-filesys.cpp C
+extended.c C B
+ffile.cpp C B
+file.cpp C B
+fileconf.cpp C B
+filefn.cpp C B
+filesys.cpp C B
fontcmn.cpp C
framecmn.cpp C
fs_inet.cpp C
ftp.cpp C S
gdicmn.cpp C
gifdecod.cpp C
-hash.cpp C
+hash.cpp C B
helpbase.cpp C
http.cpp C S
imagbmp.cpp C
imagpcx.cpp C 32
imagpng.cpp C 32
imagpnm.cpp C 32
-intl.cpp C
+intl.cpp C B
ipcbase.cpp C
layout.cpp C
-list.cpp C
-log.cpp C
+list.cpp C B
+log.cpp C B
memory.cpp C
-mimetype.cpp C 32
-module.cpp C
+mimetype.cpp C 32,B
+module.cpp C B
mstream.cpp C
-object.cpp C
+object.cpp C B
objstrm.cpp C
odbc.cpp C R
paper.cpp C
prntbase.cpp C
-process.cpp C 32
+process.cpp C 32,B
protocol.cpp C S
resource.cpp C
sckaddr.cpp C S
sizer.cpp C
socket.cpp C S
stream.cpp C
-strconv.cpp C
-string.cpp C
+strconv.cpp C B
+string.cpp C B
tbarbase.cpp C
tbarsmpl.cpp C
textcmn.cpp C
-textfile.cpp C
-time.cpp C
-timercmn.cpp C
-tokenzr.cpp C
+textfile.cpp C B
+time.cpp C B
+timercmn.cpp C B
+tokenzr.cpp C B
txtstrm.cpp C
unzip.c C
url.cpp C S
-utilscmn.cpp C
+utilscmn.cpp C B
valgen.cpp C
validate.cpp C
valtext.cpp C
-variant.cpp C
+variant.cpp C B
wfstream.cpp C
wincmn.cpp C
-wxchar.cpp C
+wxchar.cpp C B
wxexpr.cpp C
zipstrm.cpp C
zstream.cpp C
xpmhand.cpp M
gsocket.c M S
+dialup.cpp U
threadpsx.cpp U
utilsunx.cpp U
gsocket.c U
<li>Release date: c. July 2nd, 2000
<li>Unicode compilation working in wxGTK and wxMSW.
<li>wxDateTime class.
+<li>Regular expressions support.
</ul>
<P>
#include "wx/event.h" // for the base class
-#include "wx/window.h" // for wxTopLevelWindows
+#if wxUSE_GUI
+ #include "wx/window.h" // for wxTopLevelWindows
+#endif // wxUSE_GUI
#if wxUSE_LOG
#include "wx/log.h"
// prevents the program from continuing - it's a good place to create
// the top level program window and return TRUE.
//
- // Override: always.
+ // Override: always in GUI application, rarely in console ones.
+#if wxUSE_GUI
virtual bool OnInit() { return FALSE; };
+#else // !GUI
+ virtual bool OnInit() { return TRUE; };
+#endif // wxUSE_GUI
+#if wxUSE_GUI
// a platform-dependent version of OnInit(): the code here is likely to
// depend on the toolkit. default version does nothing.
//
// Override: rarely.
virtual bool OnInitGui() { return TRUE; }
+#endif // wxUSE_GUI
// called to start program execution - the default version just enters
// the main GUI loop in which events are received and processed until
// the last window is not deleted (if GetExitOnFrameDelete) or
- // ExitMainLoop() is called.
+ // ExitMainLoop() is called. In console mode programs, the execution
+ // of the program really starts here
//
- // Override: rarely.
+ // Override: rarely in GUI applications, always in console ones.
+#if wxUSE_GUI
virtual int OnRun() { return MainLoop(); };
+#else // !GUI
+ virtual int OnRun() = 0;
+#endif // wxUSE_GUI
// called after the main loop termination. This is a good place for
// cleaning up (it may be too late in dtor) and is also useful if you
// the worker functions - usually not used directly by the user code
// -----------------------------------------------------------------
+#if wxUSE_GUI
// execute the main GUI loop, the function returns when the loop ends
virtual int MainLoop() = 0;
// process the first event in the event queue (blocks until an event
// apperas if there are none currently)
virtual void Dispatch() = 0;
+#endif // wxUSE_GUI
// application info: name, description, vendor
// -------------------------------------------
const wxString& GetVendorName() const { return m_vendorName; }
void SetVendorName(const wxString& name) { m_vendorName = name; }
+#if wxUSE_GUI
// top level window functions
// --------------------------
void SetExitOnFrameDelete(bool flag) { m_exitOnFrameDelete = flag; }
bool GetExitOnFrameDelete() const { return m_exitOnFrameDelete; }
+#endif // wxUSE_GUI
+
// miscellaneous customization functions
// -------------------------------------
// user-defined class (default implementation creates a wxLogGui
// object) - this log object is used by default by all wxLogXXX()
// functions.
- virtual wxLog *CreateLogTarget() { return new wxLogGui; }
+ virtual wxLog *CreateLogTarget()
+#if wxUSE_GUI
+ { return new wxLogGui; }
+#else // !GUI
+ { return new wxLogStderr; }
+#endif // wxUSE_GUI
#endif // wxUSE_LOG
-
+#if wxUSE_GUI
// get the standard icon used by wxWin dialogs - this allows the user
// to customize the standard dialogs. The 'which' parameter is one of
// wxICON_XXX values
// printing.
virtual void SetPrintMode(int WXUNUSED(mode)) { }
int GetPrintMode() const { return wxPRINT_POSTSCRIPT; }
+#endif // wxUSE_GUI
// implementation only from now on
// -------------------------------
// TRUE if the application wants to get debug output
bool m_wantDebugOutput;
+#if wxUSE_GUI
// the main top level window - may be NULL
wxWindow *m_topWindow;
+#endif // wxUSE_GUI
};
// ----------------------------------------------------------------------------
// now include the declaration of the real class
// ----------------------------------------------------------------------------
-#if defined(__WXMSW__)
- #include "wx/msw/app.h"
-#elif defined(__WXMOTIF__)
- #include "wx/motif/app.h"
-#elif defined(__WXQT__)
- #include "wx/qt/app.h"
-#elif defined(__WXGTK__)
- #include "wx/gtk/app.h"
-#elif defined(__WXMAC__)
- #include "wx/mac/app.h"
-#elif defined(__WXPM__)
- #include "wx/os2/app.h"
-#elif defined(__WXSTUBS__)
- #include "wx/stubs/app.h"
-#endif
+#if wxUSE_GUI
+ #if defined(__WXMSW__)
+ #include "wx/msw/app.h"
+ #elif defined(__WXMOTIF__)
+ #include "wx/motif/app.h"
+ #elif defined(__WXQT__)
+ #include "wx/qt/app.h"
+ #elif defined(__WXGTK__)
+ #include "wx/gtk/app.h"
+ #elif defined(__WXMAC__)
+ #include "wx/mac/app.h"
+ #elif defined(__WXPM__)
+ #include "wx/os2/app.h"
+ #elif defined(__WXSTUBS__)
+ #include "wx/stubs/app.h"
+ #endif
+#else // !GUI
+ typedef wxAppBase wxApp;
+#endif // GUI/!GUI
// ----------------------------------------------------------------------------
// the global data
// global functions
// ----------------------------------------------------------------------------
+// event loop related functions only work in GUI programs
+// ------------------------------------------------------
+
+#if wxUSE_GUI
+
// Force an exit from main loop
-void WXDLLEXPORT wxExit();
+extern void WXDLLEXPORT wxExit();
// Yield to other apps/messages
-bool WXDLLEXPORT wxYield();
+extern bool WXDLLEXPORT wxYield();
+
+#endif // wxUSE_GUI
+
+// console applications may avoid using DECLARE_APP and IMPLEMENT_APP macros
+// and call these functions instead at the program startup and termination
+// -------------------------------------------------------------------------
+
+#if wxUSE_NOGUI
+
+// initialize the library (may be called as many times as needed, but each
+// call to wxInitialize() must be matched by wxUninitialize())
+extern bool WXDLLEXPORT wxInitialize();
+
+// clean up - the library can't be used any more after the last call to
+// wxUninitialize()
+extern void WXDLLEXPORT wxUninitialize();
+
+#endif // wxUSE_NOGUI
// ----------------------------------------------------------------------------
// macros for dynamic creation of the application object
// Name: listimpl.cpp
// Purpose: helper file for implementation of dynamic lists
// Author: Vadim Zeitlin
-// Modified by:
+// Modified by:
// Created: 16.10.97
// RCS-ID: $Id$
// Copyright: (c) 1997 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
* 4) WX_DEFINE_OBJARRAY *
*****************************************************************************/
+// needed to resolve the conflict between global T and macro parameter T
+#define _WX_ERROR_REMOVE2(x) T("bad index in " #x "::Remove()")
+
// macro implements remaining (not inline) methods of template list
// (it's private to this file)
#undef _DEFINE_OBJARRAY
\
void name::Remove(size_t uiIndex) \
{ \
- wxCHECK_RET( uiIndex < Count(), _T("bad index in " #name "::Remove()") ); \
+ wxCHECK_RET( uiIndex < Count(), _WX_ERROR_REMOVE2(name) ); \
\
delete (T*)wxBaseArray::Item(uiIndex); \
\
} \
} \
\
- return wxNOT_FOUND; \
-}
+ return wxNOT_FOUND; \
+}
// redefine the macro so that now it will generate the class implementation
// old value would provoke a compile-time error if this file is not included
#define _WX_BUFFER_H
#include "wx/wxchar.h"
+
#include <string.h> // strdup
// ----------------------------------------------------------------------------
public:
wxCharBuffer(const char *str)
{
- wxASSERT_MSG( str, _T("NULL string in wxCharBuffer") );
+ wxASSERT_MSG( str, T("NULL string in wxCharBuffer") );
m_str = str ? strdup(str) : (char *)NULL;
}
wxCharBuffer(size_t len)
{
m_str = (char *)malloc(len+1);
- m_str[len] = '\0';
+ m_str[len] = '\0';
}
// no need to check for NULL, free() does it
~wxCharBuffer() { free(m_str); }
public:
wxWCharBuffer(const wchar_t *wcs)
{
- wxASSERT_MSG( wcs, _T("NULL string in wxWCharBuffer") );
+ wxASSERT_MSG( wcs, T("NULL string in wxWCharBuffer") );
if (wcs) {
size_t siz = (wcslen(wcs)+1)*sizeof(wchar_t);
wxWCharBuffer(size_t len)
{
m_wcs = (wchar_t *)malloc((len+1)*sizeof(wchar_t));
- m_wcs[len] = L'\0';
+ m_wcs[len] = L'\0';
}
// no need to check for NULL, free() does it
operator const wchar_t *() const { return m_wcs; }
wchar_t operator[](size_t n) const { return m_wcs[n]; }
-
+
private:
wchar_t *m_wcs;
};
#endif
#if wxUSE_UNICODE
-#define wxMB2WXbuf wxWCharBuffer
-#define wxWX2MBbuf wxCharBuffer
-#define wxWC2WXbuf wxChar*
-#define wxWX2WCbuf wxChar*
-#else
-#define wxMB2WXbuf wxChar*
-#define wxWX2MBbuf wxChar*
-#define wxWC2WXbuf wxCharBuffer
-#define wxWX2WCbuf wxWCharBuffer
-#endif
+ #define wxMB2WXbuf wxWCharBuffer
+ #define wxWX2MBbuf wxCharBuffer
+ #define wxWC2WXbuf wxChar*
+ #define wxWX2WCbuf wxChar*
+#else // ANSI
+ #define wxMB2WXbuf wxChar*
+ #define wxWX2MBbuf wxChar*
+ #define wxWC2WXbuf wxCharBuffer
+ #define wxWX2WCbuf wxWCharBuffer
+#endif // Unicode/ANSI
// ----------------------------------------------------------------------------
// template class for any kind of data
/////////////////////////////////////////////////////////////////////////////
-// Name: debug.h
+// Name: wx/debug.h
// Purpose: Misc debug functions and macros
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// RCS-ID: $Id$
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
-// Licence: wxWindows license
+// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DEBUG_H_
#include "wx/wxchar.h"
-#ifndef __TFILE__
-#define __XFILE__(x) _T(x)
-#define __TFILE__ __XFILE__(__FILE__)
-#endif
-
// ----------------------------------------------------------------------------
-/**
- @name Debugging macros
+/**
+ @name Debugging macros
All debugging macros rely on ASSERT() which in turn calls user-defined
OnAssert() function. To keep things simple, it's called even when the
expression is TRUE (i.e. everything is ok) and by default does nothing: just
returns the same value back. But if you redefine it to do something more sexy
- (popping up a message box in your favourite GUI, sending you e-mail or
+ (popping up a message box in your favourite GUI, sending you e-mail or
whatever) it will affect all ASSERTs, FAILs and CHECKs in your code.
<BR>
<BR>
- <b>Warning</b>: if you don't like advices on programming style, don't read
+ <b>Warning</b>: if you don't like advices on programming style, don't read
further! ;-)
<BR>
<BR>
// NB: these macros work also in release mode!
-/**
+/**
These macros must be used only in invalid situation: for example, an
invalid parameter (NULL pointer) is passed to a function. Instead of
dereferencing it and causing core dump the function might try using
CHECK( p != NULL ) or CHECK( p != NULL, return LogError("p is NULL!!") )
- @name Macros which remain even in 'release' mode
+ @name Macros which remain even in 'release' mode
*/
//@{
/// check that expression is true, "return" if not (also FAILs in debug mode)
# pragma suppress 571 // Virtual function hiding
#endif // __SALFORDC__
-#ifdef __VISUALC__
-#ifndef WIN32
-// VC1.5 does not have LPTSTR type
-#define LPTSTR LPSTR
-#define LPCTSTR LPCSTR
-#endif
-#endif
+#if defined(__VISUALC__) && !defined(WIN32)
+ // VC1.5 does not have LPTSTR type
+ #define LPTSTR LPSTR
+ #define LPCTSTR LPCSTR
+#endif // VC++ 1.5
// Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files,
// so define it ourselves
// Make sure the environment is set correctly
#if defined(__WXMSW__) && defined(__X__)
#error "Target can't be both X and Windows"
-#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXPM__) && \
- !defined(__WXMAC__) && !defined(__X__) && !defined(__WXQT__) && !defined(__WXSTUBS__)
+#elif !defined(__WXMOTIF__) && !defined(__WXMSW__) && !defined(__WXGTK__) && \
+ !defined(__WXPM__) && !defined(__WXMAC__) && !defined(__X__) && \
+ !defined(__WXQT__) && !defined(__WXSTUBS__) && wxUSE_GUI
#error "No Target! Use -D[__WXMOTIF__|__WXGTK__|__WXMSW__|__WXMAC__|__WXQT__|__WXPM__|__WXSTUBS__]"
#endif
#include "wx/version.h"
+// ----------------------------------------------------------------------------
+// compatibility defines
+// ----------------------------------------------------------------------------
+
+// possibility to build non GUI apps is new, so don't burden ourselves with
+// compatibility code
+#if !wxUSE_GUI
+ #undef WXWIN_COMPATIBILITY_2
+ #define WXWIN_COMPATIBILITY_2 0
+#endif // !GUI
+
// ============================================================================
// non portable C++ features
// ============================================================================
// check for native bool type and TRUE/FALSE constants
// ----------------------------------------------------------------------------
-#if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXQT__) || defined(__WXPM__) || defined(__WXSTUBS__)
- // Bool is now obsolete, use bool instead
- // typedef int Bool;
+// define boolean constants if not done yet
+#ifndef TRUE
+ #define TRUE 1
+#endif
- #ifndef TRUE
- #define TRUE 1
- #define FALSE 0
- #define Bool_DEFINED
- #endif
-#elif defined(__WXMSW__)
- #ifndef TRUE
- #define TRUE 1
- #define FALSE 0
- #endif
-#endif // TRUE/FALSE
+#ifndef FALSE
+ #define FALSE 0
+#endif
// Add more tests here for Windows compilers that already define bool
// (under Unix, configure tests for this)
extern const wxChar *wxEmptyString;
-#define WXDIALUP_MANAGER_DEFAULT_BEACONHOST _T("www.yahoo.com")
+#define WXDIALUP_MANAGER_DEFAULT_BEACONHOST T("www.yahoo.com")
// ----------------------------------------------------------------------------
// A class which groups functions dealing with connecting to the network from a
bool async = TRUE) = 0;
// returns TRUE if (async) dialing is in progress
- virtual bool IsDialling() const = 0;
+ virtual bool IsDialing() const = 0;
// cancel dialing the number initiated with Dial(async = TRUE)
// NB: this won't result in DISCONNECTED event being sent
// Sets the commands to start up the network and to hang up again. Used by
// the Unix implementations only.
virtual void
- SetConnectCommand(const wxString& commandDial = _T("/usr/bin/pon"),
- const wxString& commandHangup = _T("/usr/bin/poff")) = 0;
+ SetConnectCommand(const wxString& commandDial = T("/usr/bin/pon"),
+ const wxString& commandHangup = T("/usr/bin/poff")) = 0;
};
// ----------------------------------------------------------------------------
// template classes
// ============================================================================
+// resolves the name conflict between the T() macor and T typedef: we can't
+// use T() inside WX_DEFINE_ARRAY!
+#define _WX_ERROR_SIZEOF T("illegal use of DEFINE_ARRAY")
+#define _WX_ERROR_REMOVE T("removing inexisting element in wxArray::Remove")
+
// ----------------------------------------------------------------------------
// This macro generates a new array class. It is intended for storage of simple
// types of sizeof()<=sizeof(long) or pointers if sizeof(pointer)<=sizeof(long)
size_t type = sizeof(T); \
size_t sizelong = sizeof(long); \
if ( type > sizelong ) \
- { wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \
+ { wxFAIL_MSG( _WX_ERROR_SIZEOF ); } \
} \
\
name& operator=(const name& src) \
void Remove(T Item) \
{ int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \
- _T("removing inexisting element in wxArray::Remove") ); \
+ _WX_ERROR_REMOVE); \
wxBaseArray::Remove((size_t)iIndex); } \
\
void Sort(CMPFUNC##T fCmp) { wxBaseArray::Sort((CMPFUNC)fCmp); } \
{ size_t type = sizeof(T); \
size_t sizelong = sizeof(long); \
if ( type > sizelong ) \
- { wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \
+ { wxFAIL_MSG( _WX_ERROR_SIZEOF ); } \
m_fnCompare = fn; \
} \
\
void Remove(T Item) \
{ int iIndex = Index(Item); \
wxCHECK2_MSG( iIndex != wxNOT_FOUND, return, \
- _T("removing inexisting element in wxArray::Remove") ); \
+ _WX_ERROR_REMOVE ); \
wxBaseArray::Remove((size_t)iIndex); } \
\
private: \
#include "wx/defs.h"
#include "wx/object.h"
-#include "wx/gdicmn.h"
+
+#if wxUSE_GUI
+ #include "wx/gdicmn.h"
+#endif
#if wxUSE_THREADS
#include "wx/thread.h"
#endif
-/*
- * Event types
- *
- */
+// ----------------------------------------------------------------------------
+// forward declarations
+// ----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxList;
+
+#if wxUSE_GUI
+ class WXDLLEXPORT wxClientData;
+ class WXDLLEXPORT wxDC;
+ class WXDLLEXPORT wxMenu;
+#endif // wxUSE_GUI
+
+// ----------------------------------------------------------------------------
+// Event types
+// ----------------------------------------------------------------------------
typedef int wxEventType;
bool m_isCommandEvent;
};
+#if wxUSE_GUI
+
// Item or menu event class
/*
wxEVT_COMMAND_BUTTON_CLICKED
wxEVT_COMMAND_COMBOBOX_SELECTED
*/
-class WXDLLEXPORT wxClientData;
-
class WXDLLEXPORT wxCommandEvent : public wxEvent
{
DECLARE_DYNAMIC_CLASS(wxCommandEvent)
wxEVT_NC_RIGHT_DCLICK,
*/
-class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxMouseEvent : public wxEvent
{
DECLARE_DYNAMIC_CLASS(wxMouseEvent)
wxEVT_ERASE_BACKGROUND
*/
-class WXDLLEXPORT wxDC;
class WXDLLEXPORT wxEraseEvent : public wxEvent
{
DECLARE_DYNAMIC_CLASS(wxEraseEvent)
{
// GetVeto() will return FALSE anyhow...
wxCHECK_RET( m_canVeto,
- _T("call to Veto() ignored (can't veto this event)") );
+ T("call to Veto() ignored (can't veto this event)") );
m_veto = veto;
}
void CopyObject(wxObject& obj) const;
};
-// Idle event
-/*
- wxEVT_IDLE
- */
-
-class WXDLLEXPORT wxIdleEvent : public wxEvent
-{
- DECLARE_DYNAMIC_CLASS(wxIdleEvent)
-
-public:
- wxIdleEvent()
- { m_eventType = wxEVT_IDLE; m_requestMore = FALSE; }
-
- void RequestMore(bool needMore = TRUE) { m_requestMore = needMore; }
- bool MoreRequested() const { return m_requestMore; }
-
- void CopyObject(wxObject& obj) const;
-
-protected:
- bool m_requestMore;
-};
-
// Update UI event
/*
wxEVT_UPDATE_UI
*/
-class WXDLLEXPORT wxMenu;
-class WXDLLEXPORT wxWindow;
-
class WXDLLEXPORT wxUpdateUIEvent : public wxCommandEvent
{
DECLARE_DYNAMIC_CLASS(wxUpdateUIEvent)
wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); }
};
+#endif // wxUSE_GUI
+
+// Idle event
+/*
+ wxEVT_IDLE
+ */
+
+class WXDLLEXPORT wxIdleEvent : public wxEvent
+{
+ DECLARE_DYNAMIC_CLASS(wxIdleEvent)
+
+public:
+ wxIdleEvent()
+ { m_eventType = wxEVT_IDLE; m_requestMore = FALSE; }
+
+ void RequestMore(bool needMore = TRUE) { m_requestMore = needMore; }
+ bool MoreRequested() const { return m_requestMore; }
+
+ void CopyObject(wxObject& obj) const;
+
+protected:
+ bool m_requestMore;
+};
+
/* TODO
wxEVT_POWER,
wxEVT_MOUSE_CAPTURE_CHANGED,
wxEVT_COMPARE_ITEM
*/
-class WXDLLEXPORT wxWindow;
-class WXDLLEXPORT wxControl;
-
-// struct WXDLLEXPORT wxEventTableEntry;
-
typedef void (wxObject::*wxObjectEventFunction)(wxEvent&);
struct WXDLLEXPORT wxEventTableEntry
virtual void OnCommand(wxWindow& WXUNUSED(win),
wxCommandEvent& WXUNUSED(event))
{
- wxFAIL_MSG(_T("shouldn't be called any more"));
+ wxFAIL_MSG(T("shouldn't be called any more"));
}
// Called if child control has no callback function
};
typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
+#if wxUSE_GUI
typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&);
typedef void (wxEvtHandler::*wxScrollEventFunction)(wxScrollEvent&);
typedef void (wxEvtHandler::*wxScrollWinEventFunction)(wxScrollWinEvent&);
typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&);
typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&);
typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&);
+#endif // wxUSE_GUI
// N.B. In GNU-WIN32, you *have* to take the address of a member function
// (use &) or the compiler crashes...
#define EVT_UPDATE_UI(id, func) \
{ wxEVT_UPDATE_UI, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxUpdateUIEventFunction) & func, (wxObject *) NULL },\
-/*
- * Helper functions
- */
+// ----------------------------------------------------------------------------
+// Helper functions
+// ----------------------------------------------------------------------------
+
+#if wxUSE_GUI
// Find a window with the focus, that is also a descendant of the given window.
// This is used to determine the window to initially send commands to.
wxWindow* wxFindFocusDescendant(wxWindow* ancestor);
+#endif // wxUSE_GUI
+
#endif
// _WX_EVENTH__
bool Close();
// assign an existing file descriptor and get it back from wxFFile object
- void Attach(FILE *fp, const wxString& name = _T(""))
+ void Attach(FILE *fp, const wxString& name = T(""))
{ Close(); m_fp = fp; m_name = name; }
void Detach() { m_fp = NULL; }
FILE *fp() const { return m_fp; }
// New constructor: one size fits all. Specify wxCONFIG_USE_LOCAL_FILE or
// wxCONFIG_USE_GLOBAL_FILE to say which files should be used.
wxFileConfig(const wxString& appName,
- const wxString& vendorName = _T(""),
- const wxString& localFilename = _T(""),
- const wxString& globalFilename = _T(""),
+ const wxString& vendorName = T(""),
+ const wxString& localFilename = T(""),
+ const wxString& globalFilename = T(""),
long style = wxCONFIG_USE_LOCAL_FILE);
// dtor will save unsaved data
WXDLLEXPORT bool wxRmdir(const wxString& dir, int flags = 0);
// separators in file names
-#define wxFILE_SEP_EXT _T('.')
-#define wxFILE_SEP_DSK _T(':')
-#define wxFILE_SEP_PATH_DOS _T('\\')
-#define wxFILE_SEP_PATH_UNIX _T('/')
+#define wxFILE_SEP_EXT T('.')
+#define wxFILE_SEP_DSK T(':')
+#define wxFILE_SEP_PATH_DOS T('\\')
+#define wxFILE_SEP_PATH_UNIX T('/')
// separator in the path list (as in PATH environment variable)
// NB: these are strings and not characters on purpose!
-#define wxPATH_SEP_DOS _T(";")
-#define wxPATH_SEP_UNIX _T(":")
+#define wxPATH_SEP_DOS T(";")
+#define wxPATH_SEP_UNIX T(":")
// platform independent versions
#ifdef __UNIX__
// enumerate the different encodings either for given font family or for
// all font families - will result in OnFontEncoding() being called for
// each available (family, encoding) couple
- virtual bool EnumerateEncodings(const wxString& family = _T(""));
+ virtual bool EnumerateEncodings(const wxString& family = T(""));
// callbacks which are called after one of EnumerateXXX() functions from
// above is invoked - all of them may return FALSE to stop enumeration or
const wxSize &size = wxDefaultSize,
long style = wxLC_LIST,
const wxValidator &validator = wxDefaultValidator,
- const wxString &name = _T("filelist") );
+ const wxString &name = T("filelist") );
void ChangeToListMode();
void ChangeToReportMode();
void ChangeToIconMode();
@param newmsg if used, new message to display
@returns true if ABORT button has not been pressed
*/
- bool Update(int value = -1, const wxString& newmsg = _T(""));
+ bool Update(int value = -1, const wxString& newmsg = T(""));
/* Can be called to continue after the cancel button has been pressed, but
the program decided to continue the operation (e.g., user didn't
#if wxUSE_STATUSBAR
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
- const wxString& name = _T("statusBar"));
+ const wxString& name = T("statusBar"));
virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
const wxString& name );
virtual wxStatusBar *GetStatusBar() const;
#if wxUSE_STATUSBAR
// no status bars
- virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1,
- wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; }
+ virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
+ long WXUNUSED(style) = 1,
+ wxWindowID WXUNUSED(id) = 1,
+ const wxString& WXUNUSED(name) = wxEmptyString)
+ { return (wxStatusBar*)NULL; }
+
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
#if wxUSE_STATUSBAR
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
- const wxString& name = _T("statusBar"));
+ const wxString& name = T("statusBar"));
virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
const wxString& name );
virtual wxStatusBar *GetStatusBar() const;
#if wxUSE_STATUSBAR
// no status bars
- virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1,
- wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; }
+ virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
+ long WXUNUSED(style) = 1,
+ wxWindowID WXUNUSED(id) = 1,
+ const wxString& WXUNUSED(name) = wxEmptyString)
+ { return (wxStatusBar*)NULL; }
+
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
// gettext() style macro (notice that xgettext should be invoked with "-k_"
// option to extract the strings inside _() from the sources)
#ifndef WXINTL_NO_GETTEXT_MACRO
- #define _(str) wxGetTranslation(_T(str))
+ #define _(str) wxGetTranslation(T(str))
#endif
// ----------------------------------------------------------------------------
inline ~wxConnectionBase(void) {}
// Calls that CLIENT can make
- virtual bool Execute(wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT ) = 0;
- virtual bool Execute(const wxString& str) { return Execute(WXSTRINGCAST str, -1, wxIPC_TEXT); }
+ virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT ) = 0;
+ virtual bool Execute(const wxString& str) { return Execute(str, -1, wxIPC_TEXT); }
virtual char *Request(const wxString& item, int *size = (int *) NULL, wxIPCFormat format = wxIPC_TEXT) = 0;
virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0;
virtual bool StartAdvise(const wxString& item) = 0;
// GUI part (andnot just the base one) of the library, they're implemented in
// src/generic/logg.cpp *and not src/common/log.cpp unlike all the rest)
-#ifndef wxUSE_NOGUI
+#if wxUSE_GUI
// log everything to a text window (GUI only of course)
class WXDLLEXPORT wxLogTextCtrl : public wxLog
wxLogFrame *m_pLogFrame; // the log frame
};
-#endif // wxUSE_NOGUI
+#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// /dev/null log target: suppress logging until this object goes out of scope
// ----------------------------------------------------------------------------
#ifndef __TFILE__
- #define __XFILE__(x) _T(x)
+ #define __XFILE__(x) Tx)
#define __TFILE__ __XFILE__(__FILE__)
#endif
// will take us immediately to the place of the failed API
#ifdef __VISUALC__
#define wxLogApiError(api, rc) \
- wxLogDebug(_T("%s(%d): '%s' failed with error 0x%08lx (%s)."), \
+ wxLogDebug(T("%s(%d): '%s' failed with error 0x%08lx (%s)."), \
__TFILE__, __LINE__, api, \
rc, wxSysErrorMsg(rc))
#else // !VC++
#define wxLogApiError(api, rc) \
- wxLogDebug(_T("In file %s at line %d: '%s' failed with " \
+ wxLogDebug(T("In file %s at line %d: '%s' failed with " \
"error 0x%08lx (%s)."), \
__TFILE__, __LINE__, api, \
rc, wxSysErrorMsg(rc))
public:
/* This list should be filled in with strings indicating the formats
- this client can provide. Almost all clients will provide "TEXT".
+ this client can provide. Almost all clients will provide "TEXT(".
Format names should be 4 characters long, so things will work
out on the Macintosh */
wxStringList formats;
/* Set the clipboard string; does not require a client. */
void SetClipboardString(char *, long time);
- /* Get data from the clipboard in the format "TEXT". */
+ /* Get data from the clipboard in the format "TEXT(". */
char *GetClipboardString(long time);
/* Get data from the clipboard */
// the string ID identifies the format of clipboard or DnD data. a word
// processor would e.g. add a wxTextDataObject and a wxPrivateDataObject
- // to the clipboard - the latter with the Id "WXWORD_FORMAT".
+ // to the clipboard - the latter with the Id "WXWORD_FORMAT(".
void SetId( const wxString& id )
{ m_id = id; }
// Header signatures for various resources
#define BFT_ICON 0x4349 /* 'IC' */
#define BFT_BITMAP 0x4d42 /* 'BM' */
-#define BFT_CURSOR 0x5450 /* 'PT' */
+#define BFT_CURSOR 0x5450 /* 'PT(' */
// This WIDTHBYTES macro determines the number of BYTES per scan line.
#define WIDTHBYTES( i) ((i + 31) / 32 * 4)
~wxDDEConnection(void);
// Calls that CLIENT can make
- virtual bool Execute(wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
- virtual bool Execute(const wxString& str) { return Execute(WXSTRINGCAST str, -1, wxIPC_TEXT); }
+ virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
+ virtual bool Execute(const wxString& str) { return Execute(str, -1, wxIPC_TEXT); }
virtual char *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT);
virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
virtual bool StartAdvise(const wxString& item);
* for this combination of CTl3D/FAFA settings
*/
-#define STATIC_CLASS _T("STATIC")
+#define STATIC_CLASS T("STATIC")
#define STATIC_FLAGS (SS_LEFT|WS_CHILD|WS_VISIBLE)
-#define CHECK_CLASS _T("BUTTON")
+#define CHECK_CLASS T("BUTTON")
#define CHECK_FLAGS (BS_AUTOCHECKBOX|WS_TABSTOP|WS_CHILD)
#define CHECK_IS_FAFA FALSE
-#define RADIO_CLASS _T("BUTTON")
+#define RADIO_CLASS T("BUTTON")
#define RADIO_FLAGS (BS_AUTORADIOBUTTON|WS_CHILD|WS_VISIBLE)
#define RADIO_SIZE 20
#define RADIO_IS_FAFA FALSE
#define PURE_WINDOWS
-#define GROUP_CLASS _T("BUTTON")
+#define GROUP_CLASS T("BUTTON")
#define GROUP_FLAGS (BS_GROUPBOX|WS_CHILD|WS_VISIBLE)
/*
#define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
{ return new name; }\
- wxClassInfo name::sm_class##name((wxChar *) _T(#name), (wxChar *) _T(#basename), (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
+ wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename), (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
// Multiple inheritance with two base classes
#define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
{ return new name; }\
- wxClassInfo name::sm_class##name((wxChar *) _T(#name), (wxChar *) _T(#basename1), (wxChar *) _T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
+ wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename1), (wxChar *) T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
//////
////// for abstract classes
// Single inheritance with one base class
#define IMPLEMENT_ABSTRACT_CLASS(name, basename) \
- wxClassInfo name::sm_class##name((wxChar *) _T(#name), (wxChar *) _T(#basename), \
+ wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename), \
(wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) NULL);
// Multiple inheritance with two base classes
#define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
- wxClassInfo name::sm_class##name((wxChar *) _T(#name), (wxChar *) _T(#basename1), \
- (wxChar *) _T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) NULL);
+ wxClassInfo name::sm_class##name((wxChar *) T(#name), (wxChar *) T(#basename1), \
+ (wxChar *) T(#basename2), (int) sizeof(name), (wxObjectConstructorFn) NULL);
#define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
#define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2
// Called when the property is double clicked.
bool OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
- bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = _T("String List Editor"));
+ bool EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title = T("String List Editor"));
// Called when the edit (...) button is pressed.
void OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow);
friend class wxTCPServer;
friend class wxTCPClient;
friend void Client_OnRequest(wxSocketBase&,
- wxSocketNotify, char *);
+ wxSocketNotify, char *);
friend void Server_OnRequest(wxSocketServer&,
- wxSocketNotify, char *);
+ wxSocketNotify, char *);
public:
wxTCPConnection(char *buffer, int size);
virtual ~wxTCPConnection();
// Calls that CLIENT can make
- bool Execute(wxChar *data, int size = -1,
+ bool Execute(const wxChar *data, int size = -1,
wxIPCFormat format = wxIPC_TEXT);
char *Request(const wxString& item, int *size = NULL,
wxIPCFormat format = wxIPC_TEXT);
#if wxUSE_WCHAR_T
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
// wxMBConv (base class for conversions, using libc conversion itself)
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMBConv
{
public:
+ // the actual conversion takes place here
+ virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
+ virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
+
+ // No longer inline since BC++ complains.
+ const wxWCharBuffer cMB2WC(const char *psz) const;
+ const wxCharBuffer cWC2MB(const wchar_t *psz) const;
- // the actual conversion takes place here
- virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
- virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
-
- // No longer inline since BC++ complains.
- const wxWCharBuffer cMB2WC(const char *psz) const;
- const wxCharBuffer cWC2MB(const wchar_t *psz) const;
#if wxUSE_UNICODE
- const wxWCharBuffer cMB2WX(const char *psz) const { return cMB2WC(psz); }
- const wxCharBuffer cWX2MB(const wchar_t *psz) const { return cWC2MB(psz); }
- const wchar_t* cWC2WX(const wchar_t *psz) const { return psz; }
- const wchar_t* cMB2WC(const wchar_t *psz) const { return psz; }
-#else
- const char* cMB2WX(const char *psz) const { return psz; }
- const char* cWX2MB(const char *psz) const { return psz; }
- const wxCharBuffer cWC2WX(const wchar_t *psz) const { return cWC2MB(psz); }
- const wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); }
-#endif
+ const wxWCharBuffer cMB2WX(const char *psz) const { return cMB2WC(psz); }
+ const wxCharBuffer cWX2MB(const wchar_t *psz) const { return cWC2MB(psz); }
+ const wchar_t* cWC2WX(const wchar_t *psz) const { return psz; }
+ const wchar_t* cMB2WC(const wchar_t *psz) const { return psz; }
+#else // ANSI
+ const char* cMB2WX(const char *psz) const { return psz; }
+ const char* cWX2MB(const char *psz) const { return psz; }
+ const wxCharBuffer cWC2WX(const wchar_t *psz) const { return cWC2MB(psz); }
+ const wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); }
+#endif // Unicode/ANSI
};
WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc;
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
// wxMBConvFile (for conversion to filenames)
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxMBConvFile: public wxMBConv
+class WXDLLEXPORT wxMBConvFile : public wxMBConv
{
public:
- virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
- virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
+ virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
+ virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
};
WXDLLEXPORT_DATA(extern wxMBConvFile) wxConvFile;
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
// wxMBConvUTF7 (for conversion using UTF7 encoding)
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxMBConvUTF7: public wxMBConv
+class WXDLLEXPORT wxMBConvUTF7 : public wxMBConv
{
public:
- virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
- virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
+ virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
+ virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
};
WXDLLEXPORT_DATA(extern wxMBConvUTF7) wxConvUTF7;
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
// wxMBConvUTF8 (for conversion using UTF8 encoding)
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxMBConvUTF8: public wxMBConv
+class WXDLLEXPORT wxMBConvUTF8 : public wxMBConv
{
public:
- virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
- virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
+ virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
+ virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
};
WXDLLEXPORT_DATA(extern wxMBConvUTF8) wxConvUTF8;
#ifdef __WXGTK12__
-//---------------------------------------------------------------------------
+
+// ----------------------------------------------------------------------------
// wxMBConvUTF8 (for conversion using GDK's internal converions)
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxMBConvGdk: public wxMBConv
+class WXDLLEXPORT wxMBConvGdk : public wxMBConv
{
public:
- virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
- virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
+ virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
+ virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
};
WXDLLEXPORT_DATA(extern wxMBConvGdk) wxConvGdk;
-#endif
-//---------------------------------------------------------------------------
-// wxCSConv (for conversion based on laodable char sets)
-//---------------------------------------------------------------------------
+#endif // wxGTK 1.2
-class wxCharacterSet;
+// ----------------------------------------------------------------------------
+// wxCSConv (for conversion based on loadable char sets)
+// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxCSConv: public wxMBConv
+class WXDLLEXPORT wxCharacterSet;
+
+class WXDLLEXPORT wxCSConv : public wxMBConv
{
-private:
- wxChar *m_name;
- wxCharacterSet *m_cset;
- bool m_deferred;
- void SetName(const wxChar *charset);
-
public:
- wxCSConv(const wxChar *charset);
- virtual ~wxCSConv();
- void LoadNow();
- virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
- virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
+ wxCSConv(const wxChar *charset);
+ virtual ~wxCSConv();
+
+ void LoadNow();
+
+ virtual size_t MB2WC(wchar_t *buf, const char *psz, size_t n) const;
+ virtual size_t WC2MB(char *buf, const wchar_t *psz, size_t n) const;
+
+private:
+ void SetName(const wxChar *charset);
+
+ wxChar *m_name;
+ wxCharacterSet *m_cset;
+ bool m_deferred;
};
WXDLLEXPORT_DATA(extern wxCSConv) wxConvLocal;
-#define wxConv_local wxConvLocal
-
WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent;
-#define wxConv_current wxConvCurrent
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
// filename conversion macros
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
// filenames are multibyte on Unix and probably widechar on Windows?
#if defined(__UNIX__) || defined(__BORLANDC__)
-#define wxMBFILES 1
+ #define wxMBFILES 1
#else
-#define wxMBFILES 0
+ #define wxMBFILES 0
#endif
#if wxMBFILES
-#define wxFNCONV(name) wxConvFile.cWX2MB(name)
-#define FNSTRINGCAST MBSTRINGCAST
+ #define wxFNCONV(name) wxConvFile.cWX2MB(name)
+ #define wxFNSTRINGCAST wxMBSTRINGCAST
#else
-#define wxFNCONV(name) name
-#define FNSTRINGCAST WXSTRINGCAST
+ #define wxFNCONV(name) name
+ #define wxFNSTRINGCAST WXSTRINGCAST
#endif
#else
// !wxUSE_WCHAR_T
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
// stand-ins in absence of wchar_t
-//---------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
-class WXDLLEXPORT wxMBConv
+class WXDLLEXPORT wxMBConv
{
public:
- const char* cMB2WX(const char *psz) const { return psz; }
- const char* cWX2MB(const char *psz) const { return psz; }
+ const char* cMB2WX(const char *psz) const { return psz; }
+ const char* cWX2MB(const char *psz) const { return psz; }
};
+
WXDLLEXPORT_DATA(extern wxMBConv) wxConvLibc, wxConvFile;
WXDLLEXPORT_DATA(extern wxMBConv *) wxConvCurrent;
#define wxFNCONV(name) name
-#define FNSTRINGCAST WXSTRINGCAST
+#define wxFNSTRINGCAST WXSTRINGCAST
#endif
// wxUSE_WCHAR_T
-#endif
+// ----------------------------------------------------------------------------
+// macros for the most common conversions
+// ----------------------------------------------------------------------------
+
+#if wxUSE_UNICODE
+ #define wxConvertWX2MB(s) wxConvCurrent->cWX2MB(s)
+ #define wxConvertMB2WX(s) wxConvCurrent->cMB2WX(s)
+#else // ANSI
+ // no conversions to do
+ #define wxConvertWX2MB(s) (s)
+ #define wxConvertMB2WX(s) (s)
+#endif // Unicode/ANSI
+
+#endif
// _WX_WXSTRCONVH__
// Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////////
+/*
+ Efficient string class [more or less] compatible with MFC CString,
+ wxWindows version 1 wxString and std::string and some handy functions
+ missing from string.h.
+*/
+
#ifndef _WX_WXSTRINGH__
#define _WX_WXSTRINGH__
#ifdef __GNUG__
-#pragma interface "string.h"
+ #pragma interface "string.h"
+#endif
+
+// ----------------------------------------------------------------------------
+// conditinal compilation
+// ----------------------------------------------------------------------------
+
+// compile the std::string compatibility functions if defined
+#define wxSTD_STRING_COMPATIBILITY
+
+// define to derive wxString from wxObject (deprecated!)
+#ifdef WXSTRING_IS_WXOBJECT
+ #undef WXSTRING_IS_WXOBJECT
#endif
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
#ifdef __WXMAC__
#include <ctype.h>
#endif
#include <strings.h> // for strcasecmp()
#endif // AIX
-#ifndef WX_PRECOMP
- #include "wx/defs.h"
+#include "wx/defs.h" // everybody should include this
+#include "wx/debug.h" // for wxASSERT()
+#include "wx/wxchar.h" // for wxChar
+#include "wx/buffer.h" // for wxCharBuffer
+#include "wx/strconv.h" // for wxConvertXXX() macros and wxMBConv classes
+#ifndef WX_PRECOMP
#ifdef WXSTRING_IS_WXOBJECT
- #include "wx/object.h"
+ #include "wx/object.h" // base class
#endif
#endif // !PCH
-#include "wx/debug.h"
-#include "wx/wxchar.h"
-#include "wx/buffer.h"
-
-/*
- Efficient string class [more or less] compatible with MFC CString,
- wxWindows version 1 wxString and std::string and some handy functions
- missing from string.h.
-*/
-
// ---------------------------------------------------------------------------
// macros
// ---------------------------------------------------------------------------
-// compile the std::string compatibility functions if defined
-#define wxSTD_STRING_COMPATIBILITY
-
-// define to derive wxString from wxObject
-#ifdef WXSTRING_IS_WXOBJECT
-#undef WXSTRING_IS_WXOBJECT
-#endif
-
-// maximum possible length for a string means "take all string" everywhere
-// (as sizeof(StringData) is unknown here we substract 100)
-const unsigned int wxSTRING_MAXLEN = UINT_MAX - 100;
-
// 'naughty' cast
#define WXSTRINGCAST (wxChar *)(const wxChar *)
-#define WXCSTRINGCAST (wxChar *)(const wxChar *)
-#define MBSTRINGCAST (char *)(const char *)
-#define WCSTRINGCAST (wchar_t *)(const wchar_t *)
+#define wxCSTRINGCAST (wxChar *)(const wxChar *)
+#define wxMBSTRINGCAST (char *)(const char *)
+#define wxWCSTRINGCAST (wchar_t *)(const wchar_t *)
// implementation only
#define ASSERT_VALID_INDEX(i) wxASSERT( (unsigned)(i) <= Len() )
-// include conversion classes
-#include "wx/strconv.h"
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
+// maximum possible length for a string means "take all string" everywhere
+// (as sizeof(StringData) is unknown here, we substract 100)
+const unsigned int wxSTRING_MAXLEN = UINT_MAX - 100;
+
+// ----------------------------------------------------------------------------
+// global data
+// ----------------------------------------------------------------------------
+
+// global pointer to empty string
+WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
// ---------------------------------------------------------------------------
-// Global functions complementing standard C string library replacements for
+// global functions complementing standard C string library replacements for
// strlen() and portable strcasecmp()
//---------------------------------------------------------------------------
-// USE wx* FUNCTIONS IN wx/wxchar.h INSTEAD - THIS IS ONLY FOR BINARY COMPATIBILITY
+
+// Use wxXXX() functions from wxchar.h instead! These functions are for
+// backwards compatibility only.
// checks whether the passed in pointer is NULL and if the string is empty
inline bool WXDLLEXPORT IsEmpty(const char *p) { return (!p || !*p); }
#endif // OS/compiler
}
-// ----------------------------------------------------------------------------
-// global data
-// ----------------------------------------------------------------------------
-
-WXDLLEXPORT_DATA(extern const wxChar*) wxEmptyString;
-
-// global pointer to empty string
-WXDLLEXPORT_DATA(extern const wxChar*) g_szNul;
-
// return an empty wxString
class WXDLLEXPORT wxString; // not yet defined
-inline const wxString& wxGetEmptyString() { return *(wxString *)&g_szNul; }
+inline const wxString& wxGetEmptyString() { return *(wxString *)&wxEmptyString; }
// ---------------------------------------------------------------------------
// string data prepended with some housekeeping info (used by wxString class),
// is never used directly (but had to be put here to allow inlining)
// ---------------------------------------------------------------------------
+
struct WXDLLEXPORT wxStringData
{
int nRefs; // reference count
// string (re)initialization functions
// initializes the string to the empty value (must be called only from
// ctors, use Reinit() otherwise)
- void Init() { m_pchData = (wxChar *)g_szNul; }
+ void Init() { m_pchData = (wxChar *)wxEmptyString; }
// initializaes the string with (a part of) C-string
void InitWith(const wxChar *psz, size_t nPos = 0, size_t nLen = wxSTRING_MAXLEN);
// as Init, but also frees old data
// (default value of wxSTRING_MAXLEN means take all the string)
wxString(const wxChar *psz, size_t nLength = wxSTRING_MAXLEN)
{ InitWith(psz, 0, nLength); }
+
#if wxUSE_UNICODE
// from multibyte string
// (NB: nLength is right now number of Unicode characters, not
// from wxWCharBuffer (i.e. return from wxGetString)
wxString(const wxWCharBuffer& psz)
{ InitWith(psz, 0, wxSTRING_MAXLEN); }
-#else
+#else // ANSI
// from C string (for compilers using unsigned char)
wxString(const unsigned char* psz, size_t nLength = wxSTRING_MAXLEN)
{ InitWith((const char*)psz, 0, nLength); }
// from multibyte string
wxString(const char *psz, wxMBConv& WXUNUSED(conv), size_t nLength = wxSTRING_MAXLEN)
{ InitWith(psz, 0, nLength); }
+
#if wxUSE_WCHAR_T
// from wide (Unicode) string
wxString(const wchar_t *pwz);
-#endif
+#endif // !wxUSE_WCHAR_T
+
// from wxCharBuffer
wxString(const wxCharBuffer& psz)
{ InitWith(psz, 0, wxSTRING_MAXLEN); }
-#endif
+#endif // Unicode/ANSI
+
// dtor is not virtual, this class must not be inherited from!
~wxString() { GetStringData()->Unlock(); }
const wxChar* c_str() const { return m_pchData; }
// (and this with [wx]Printf()!)
const wxChar* wx_str() const { return m_pchData; }
- //
+ // identical to c_str()
const wxChar* GetData() const { return m_pchData; }
+
+ // conversions with (possible) format convertions: have to return a
+ // buffer with temporary data
#if wxUSE_UNICODE
const wxCharBuffer mb_str(wxMBConv& conv = wxConvLibc) const { return conv.cWC2MB(m_pchData); }
+ const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); }
+
const wxChar* wc_str(wxMBConv& WXUNUSED(conv) = wxConvLibc) const { return m_pchData; }
+
#if wxMBFILES
const wxCharBuffer fn_str() const { return mb_str(wxConvFile); }
-#else
+#else // !wxMBFILES
const wxChar* fn_str() const { return m_pchData; }
-#endif
-#else
- const wxChar* mb_str(wxMBConv& WXUNUSED(conv) = wxConvLibc ) const { return m_pchData; }
+#endif // wxMBFILES/!wxMBFILES
+#else // ANSI
+#if wxUSE_MULTIBYTE
+ const wxChar* mb_str(wxMBConv& WXUNUSED(conv) = wxConvLibc) const
+ { return m_pchData; }
+ const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); }
+#else // !mmultibyte
+ const wxChar* mb_str() const { return m_pchData; }
+ const wxWX2MBbuf mbc_str() const { return mb_str(); }
+#endif // multibyte/!multibyte
#if wxUSE_WCHAR_T
const wxWCharBuffer wc_str(wxMBConv& conv) const { return conv.cMB2WC(m_pchData); }
-#endif
+#endif // wxUSE_WCHAR_T
const wxChar* fn_str() const { return m_pchData; }
-#endif
- // for convenience
- const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); }
+#endif // Unicode/ANSI
// overloaded assignment
// from another wxString
#if wxUSE_UNICODE
// from wxWCharBuffer
wxString& operator=(const wxWCharBuffer& psz) { return operator=((const wchar_t *)psz); }
-#else
+#else // ANSI
// from another kind of C string
wxString& operator=(const unsigned char* psz);
#if wxUSE_WCHAR_T
#endif
// from wxCharBuffer
wxString& operator=(const wxCharBuffer& psz) { return operator=((const char *)psz); }
-#endif
+#endif // Unicode/ANSI
// string concatenation
// in place concatenation
// remove spaces from left or from right (default) side
wxString& Trim(bool bFromRight = TRUE);
// add nCount copies chPad in the beginning or at the end (default)
- wxString& Pad(size_t nCount, wxChar chPad = _T(' '), bool bFromRight = TRUE);
+ wxString& Pad(size_t nCount, wxChar chPad = T(' '), bool bFromRight = TRUE);
// truncate string to given length
wxString& Truncate(size_t uiLen);
// return the maximum size of the string
size_t max_size() const { return wxSTRING_MAXLEN; }
// resize the string, filling the space with c if c != 0
- void resize(size_t nSize, wxChar ch = _T('\0'));
+ void resize(size_t nSize, wxChar ch = T('\0'));
// delete the contents of the string
void clear() { Empty(); }
// returns true if the string is empty
// so the original string may be safely deleted. When a string is retrieved
// from the array (operator[] or Item() method), a reference is returned.
// ----------------------------------------------------------------------------
+
class WXDLLEXPORT wxArrayString
{
public:
wxString WXDLLEXPORT operator+(const wxChar *psz, const wxString& string);
#if wxUSE_UNICODE
inline wxString WXDLLEXPORT operator+(const wxString& string, const wxWCharBuffer& buf)
-{ return string + (const wchar_t *)buf; }
+ { return string + (const wchar_t *)buf; }
inline wxString WXDLLEXPORT operator+(const wxWCharBuffer& buf, const wxString& string)
-{ return (const wchar_t *)buf + string; }
+ { return (const wchar_t *)buf + string; }
#else
inline wxString WXDLLEXPORT operator+(const wxString& string, const wxCharBuffer& buf)
-{ return string + (const char *)buf; }
+ { return string + (const char *)buf; }
inline wxString WXDLLEXPORT operator+(const wxCharBuffer& buf, const wxString& string)
-{ return (const char *)buf + string; }
+ { return (const char *)buf + string; }
#endif
// ---------------------------------------------------------------------------
// Implementation only from here until the end of file
// ---------------------------------------------------------------------------
+// don't pollute the library user's name space
+#undef ASSERT_VALID_INDEX
+
#if defined(wxSTD_STRING_COMPATIBILITY) && wxUSE_STD_IOSTREAM
#include "wx/ioswrap.h"
// ----------------------------------------------------------------------------
// Sound the bell
-WXDLLEXPORT void wxBell(void) ;
+WXDLLEXPORT void wxBell();
// Get OS version
WXDLLEXPORT int wxGetOsVersion(int *majorVsn= (int *) NULL,int *minorVsn= (int *) NULL) ;
// Return a string with the current date/time
WXDLLEXPORT wxString wxNow();
+#if wxUSE_GUI
// Don't synthesize KeyUp events holding down a key and producing
// KeyDown events with autorepeat. On by default and always on
// in wxMSW.
// Return the current ID
WXDLLEXPORT long wxGetCurrentId();
+#endif // wxUSE_GUI
+
// ----------------------------------------------------------------------------
// Various conversions
// ----------------------------------------------------------------------------
WXDLLEXPORT wxChar* wxGetUserHome(const wxString& user = wxEmptyString);
#endif
+#if wxUSE_GUI // GUI only things from now on
+
// ----------------------------------------------------------------------------
// Strip out any menu codes
// ----------------------------------------------------------------------------
#endif // X || GTK
+#endif // wxUSE_GUI
+
#endif
// _WX_UTILSH__
// Construction & destruction
wxVariant();
- wxVariant(double val, const wxString& name = g_szNul);
- wxVariant(long val, const wxString& name = g_szNul);
+ wxVariant(double val, const wxString& name = wxEmptyString);
+ wxVariant(long val, const wxString& name = wxEmptyString);
#ifdef HAVE_BOOL
- wxVariant(bool val, const wxString& name = g_szNul);
+ wxVariant(bool val, const wxString& name = wxEmptyString);
#endif
- wxVariant(char val, const wxString& name = g_szNul);
- wxVariant(const wxString& val, const wxString& name = g_szNul);
- wxVariant(const wxChar* val, const wxString& name = g_szNul); // Necessary or VC++ assumes bool!
- wxVariant(const wxStringList& val, const wxString& name = g_szNul);
- wxVariant(const wxList& val, const wxString& name = g_szNul); // List of variants
+ wxVariant(char val, const wxString& name = wxEmptyString);
+ wxVariant(const wxString& val, const wxString& name = wxEmptyString);
+ wxVariant(const wxChar* val, const wxString& name = wxEmptyString); // Necessary or VC++ assumes bool!
+ wxVariant(const wxStringList& val, const wxString& name = wxEmptyString);
+ wxVariant(const wxList& val, const wxString& name = wxEmptyString); // List of variants
#if wxUSE_TIMEDATE
- wxVariant(const wxTime& val, const wxString& name = g_szNul); // Time
- wxVariant(const wxDate& val, const wxString& name = g_szNul); // Date
+ wxVariant(const wxTime& val, const wxString& name = wxEmptyString); // Time
+ wxVariant(const wxDate& val, const wxString& name = wxEmptyString); // Date
#endif
- wxVariant(void* ptr, const wxString& name = g_szNul); // void* (general purpose)
- wxVariant(wxVariantData* data, const wxString& name = g_szNul); // User-defined data
+ wxVariant(void* ptr, const wxString& name = wxEmptyString); // void* (general purpose)
+ wxVariant(wxVariantData* data, const wxString& name = wxEmptyString); // User-defined data
wxVariant(const wxVariant& variant);
~wxVariant();
static void Chain(wxWizardPageSimple *first, wxWizardPageSimple *second)
{
wxCHECK_RET( first && second,
- _T("NULL passed to wxWizardPageSimple::Chain") );
+ T("NULL passed to wxWizardPageSimple::Chain") );
first->SetNext(second);
second->SetPrev(first);
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c)
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXH__
#define _WX_WXH__
-#include "wx/setup.h" // Which features to include - user editable
#include "wx/defs.h"
+#include "wx/object.h"
+#include "wx/dynarray.h"
+#include "wx/list.h"
+#include "wx/hash.h"
#include "wx/string.h"
+#include "wx/intl.h"
#include "wx/log.h"
+#include "wx/event.h"
+#include "wx/app.h"
+#include "wx/utils.h"
+
+#if wxUSE_GUI
+
#include "wx/window.h"
#include "wx/panel.h"
#include "wx/frame.h"
#include "wx/dcscreen.h"
#include "wx/button.h"
#include "wx/menu.h"
-#include "wx/app.h"
-#include "wx/event.h"
#include "wx/list.h"
#include "wx/pen.h"
#include "wx/brush.h"
#include "wx/cursor.h"
#include "wx/dialog.h"
#include "wx/timer.h"
-#include "wx/utils.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
#include "wx/cmndata.h"
#include "wx/filedlg.h"
#include "wx/dirdlg.h"
-#if wxUSE_INTL
- #include "wx/intl.h"
-#endif // wxUSE_INTL
-
#if wxUSE_VALIDATORS
#include "wx/valtext.h"
#endif // wxUSE_VALIDATORS
#include "wx/serbase.h"
#endif // wxUSE_SERIAL
+#endif // wxUSE_GUI
+
#endif
// _WX_WXH__
typedef signed __WCHAR_TYPE__ wxSChar;
typedef unsigned __WCHAR_TYPE__ wxUChar;
-# define _T(x) L##x
+# define T(x) L##x
// ctype.h functions (wctype.h)
# define wxIsalnum iswalnum
# include <ctype.h>
# include <string.h>
-# if 0 // temporary - preserve binary compatibilty
-typedef char wxChar;
-typedef signed char wxSChar;
-typedef unsigned char wxUChar;
-# else
-# define wxChar char
-# define wxSChar signed char
-# define wxUChar unsigned char
-# endif
-
-# ifdef __FreeBSD__
-# undef _T
-# endif
-# define _T(x) x
+# if 0 // temporary - preserve binary compatibilty
+ typedef char wxChar;
+ typedef signed char wxSChar;
+ typedef unsigned char wxUChar;
+# else
+# define wxChar char
+# define wxSChar signed char
+# define wxUChar unsigned char
+# endif
+
+# ifdef __FreeBSD__
+# undef T
+# endif
+# define T(x) x
// ctype.h functions
-# define wxIsalnum isalnum
-# define wxIsalpha isalpha
-# define wxIsctrl isctrl
-# define wxIsdigit isdigit
-# define wxIsgraph isgraph
-# define wxIslower islower
-# define wxIsprint isprint
-# define wxIspunct ispunct
-# define wxIsspace isspace
-# define wxIsupper isupper
-# define wxIsxdigit isxdigit
-# define wxTolower tolower
-# define wxToupper toupper
-
- // locale.h functons
-# define wxSetlocale setlocale
-
- // string.h functions
- // #define wxStricmp strcasecmp
- // wxStricmp is defined below!!
-
- // #define wxStrtok strtok_r // this needs a configure check
+# define wxIsalnum isalnum
+# define wxIsalpha isalpha
+# define wxIsctrl isctrl
+# define wxIsdigit isdigit
+# define wxIsgraph isgraph
+# define wxIslower islower
+# define wxIsprint isprint
+# define wxIspunct ispunct
+# define wxIsspace isspace
+# define wxIsupper isupper
+# define wxIsxdigit isxdigit
+# define wxTolower tolower
+# define wxToupper toupper
+
+ // locale.h functons
+# define wxSetlocale setlocale
+
+ // string.h functions
+ // #define wxStricmp strcasecmp
+ // wxStricmp is defined below!!
+
+ #ifdef HAVE_STRTOK_R
+ #define wxStrtok(str, sep, last) strtok_r(str, sep, last)
+ #else
+ #define wxStrtok(str, sep, last) strtok(str, sep)
+ #endif
// leave the rest to defaults below
-# define wxNEED_WX_STRING_H
-# define wxNEED_WX_STDIO_H
-# define wxNEED_WX_STDLIB_H
-# define wxNEED_WX_TIME_H
+# define wxNEED_WX_STRING_H
+# define wxNEED_WX_STDIO_H
+# define wxNEED_WX_STDLIB_H
+# define wxNEED_WX_TIME_H
# endif//Unicode
#endif//TCHAR-aware compilers
WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const struct tm *tm);
#endif
+// a Unicode-friendly __FILE__ analog
+#ifndef __TFILE__
+ #define __XFILE__(x) T(x)
+ #define __TFILE__ __XFILE__(__FILE__)
+#endif
+
#endif
//_WX_WXCHAR_H_
return value.word;
else if (type == wxExprString)
return wxString(value.string);
- else return wxString(_T(""));
+ else return wxString(T(""));
}
inline wxString StringValue(void) const {
return wxString(value.string);
else if (type == wxExprWord)
return wxString(value.word);
- else return wxString(_T(""));
+ else return wxString(T(""));
}
// Get nth arg of clause (starting from 1)
#include "wx/wx.h"
#endif
-#include "wx/net.h"
+#include "wx/dialup.h"
// ----------------------------------------------------------------------------
// private classes
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame *)NULL, -1, title, pos, size)
{
- // set the frame icon
- SetIcon(wxICON(mondrian));
-
// create a menu bar
wxMenu *menuFile = new wxMenu;
/*
* Use GUI
*/
-#define wxUSE_GUI 1
+#define wxUSE_GUI 0
/*
- * Defined if !wxUSE_GUI
+ * Don't use GUI (defined to 1 when compiling/using base only)
*/
-#undef wxUSE_NOGUI
+#define wxUSE_NOGUI 0
/*
* Use constraints mechanism
#define wxUSE_POSTSCRIPT 0
/*
- * Compile wxString with wide character (Unicode) support?
+ * Compile wxString with some Unicode support?
+ */
+#define wxUSE_WCHAR_T 0
+
+/*
+ * Compile wxString in wide character (Unicode) mode?
*/
#define wxUSE_UNICODE 0
+/*
+ * Compile wxString with (limited) multibyte char support?
+ */
+#define wxUSE_MULTIBYTE 0
+
/*
* Work around a bug in GNU libc 5.x wcstombs() implementation.
*
/* Define if you have the shl_load function. */
#undef HAVE_SHL_LOAD
+/* Define if you have strtok_r function. */
+#undef HAVE_STRTOK_R
+
/* Define if you have the uname function. */
#undef HAVE_UNAME
{
int sel = GetSelection();
wxString str;
- wxCHECK_MSG( sel != wxNOT_FOUND, str, _T("no selection, hence no string") );
+ wxCHECK_MSG( sel != wxNOT_FOUND, str, T("no selection, hence no string") );
str = GetString(sel);
return str;
{
int selIndex = FindString(sel);
wxCHECK_MSG( selIndex != wxNOT_FOUND, FALSE,
- _T("can't set selection to string not in the control") );
+ T("can't set selection to string not in the control") );
SetSelection(selIndex);
void wxChoiceBase::SetClientObject(int n, wxClientData *data)
{
wxASSERT_MSG( m_clientDataItemsType != ClientData_Void,
- _T("can't have both object and void client data") );
+ T("can't have both object and void client data") );
wxClientData *clientDataOld = DoGetClientObject(n);
if ( clientDataOld )
wxClientData *wxChoiceBase::GetClientObject(int n) const
{
wxASSERT_MSG( m_clientDataItemsType == ClientData_Object,
- _T("this window doesn't have object client data") );
+ T("this window doesn't have object client data") );
return DoGetClientObject(n);
}
void wxChoiceBase::SetClientData(int n, void *data)
{
wxASSERT_MSG( m_clientDataItemsType != ClientData_Object,
- _T("can't have both object and void client data") );
+ T("can't have both object and void client data") );
DoSetClientData(n, data);
m_clientDataItemsType = ClientData_Void;
void *wxChoiceBase::GetClientData(int n) const
{
wxASSERT_MSG( m_clientDataItemsType == ClientData_Void,
- _T("this window doesn't have void client data") );
+ T("this window doesn't have void client data") );
return DoGetClientData(n);
}
static wxString wxGetPrintDlgError()
{
DWORD err = CommDlgExtendedError();
- wxString msg = _T("Unknown");
+ wxString msg = T("Unknown");
switch (err)
{
- case CDERR_FINDRESFAILURE: msg = _T("CDERR_FINDRESFAILURE"); break;
- case CDERR_INITIALIZATION: msg = _T("CDERR_INITIALIZATION"); break;
- case CDERR_LOADRESFAILURE: msg = _T("CDERR_LOADRESFAILURE"); break;
- case CDERR_LOADSTRFAILURE: msg = _T("CDERR_LOADSTRFAILURE"); break;
- case CDERR_LOCKRESFAILURE: msg = _T("CDERR_LOCKRESFAILURE"); break;
- case CDERR_MEMALLOCFAILURE: msg = _T("CDERR_MEMALLOCFAILURE"); break;
- case CDERR_MEMLOCKFAILURE: msg = _T("CDERR_MEMLOCKFAILURE"); break;
- case CDERR_NOHINSTANCE: msg = _T("CDERR_NOHINSTANCE"); break;
- case CDERR_NOHOOK: msg = _T("CDERR_NOHOOK"); break;
- case CDERR_NOTEMPLATE: msg = _T("CDERR_NOTEMPLATE"); break;
- case CDERR_STRUCTSIZE: msg = _T("CDERR_STRUCTSIZE"); break;
- case PDERR_RETDEFFAILURE: msg = _T("PDERR_RETDEFFAILURE"); break;
- case PDERR_PRINTERNOTFOUND: msg = _T("PDERR_PRINTERNOTFOUND"); break;
- case PDERR_PARSEFAILURE: msg = _T("PDERR_PARSEFAILURE"); break;
- case PDERR_NODEVICES: msg = _T("PDERR_NODEVICES"); break;
- case PDERR_NODEFAULTPRN: msg = _T("PDERR_NODEFAULTPRN"); break;
- case PDERR_LOADDRVFAILURE: msg = _T("PDERR_LOADDRVFAILURE"); break;
- case PDERR_INITFAILURE: msg = _T("PDERR_INITFAILURE"); break;
- case PDERR_GETDEVMODEFAIL: msg = _T("PDERR_GETDEVMODEFAIL"); break;
- case PDERR_DNDMMISMATCH: msg = _T("PDERR_DNDMMISMATCH"); break;
- case PDERR_DEFAULTDIFFERENT: msg = _T("PDERR_DEFAULTDIFFERENT"); break;
- case PDERR_CREATEICFAILURE: msg = _T("PDERR_CREATEICFAILURE"); break;
+ case CDERR_FINDRESFAILURE: msg = T("CDERR_FINDRESFAILURE"); break;
+ case CDERR_INITIALIZATION: msg = T("CDERR_INITIALIZATION"); break;
+ case CDERR_LOADRESFAILURE: msg = T("CDERR_LOADRESFAILURE"); break;
+ case CDERR_LOADSTRFAILURE: msg = T("CDERR_LOADSTRFAILURE"); break;
+ case CDERR_LOCKRESFAILURE: msg = T("CDERR_LOCKRESFAILURE"); break;
+ case CDERR_MEMALLOCFAILURE: msg = T("CDERR_MEMALLOCFAILURE"); break;
+ case CDERR_MEMLOCKFAILURE: msg = T("CDERR_MEMLOCKFAILURE"); break;
+ case CDERR_NOHINSTANCE: msg = T("CDERR_NOHINSTANCE"); break;
+ case CDERR_NOHOOK: msg = T("CDERR_NOHOOK"); break;
+ case CDERR_NOTEMPLATE: msg = T("CDERR_NOTEMPLATE"); break;
+ case CDERR_STRUCTSIZE: msg = T("CDERR_STRUCTSIZE"); break;
+ case PDERR_RETDEFFAILURE: msg = T("PDERR_RETDEFFAILURE"); break;
+ case PDERR_PRINTERNOTFOUND: msg = T("PDERR_PRINTERNOTFOUND"); break;
+ case PDERR_PARSEFAILURE: msg = T("PDERR_PARSEFAILURE"); break;
+ case PDERR_NODEVICES: msg = T("PDERR_NODEVICES"); break;
+ case PDERR_NODEFAULTPRN: msg = T("PDERR_NODEFAULTPRN"); break;
+ case PDERR_LOADDRVFAILURE: msg = T("PDERR_LOADDRVFAILURE"); break;
+ case PDERR_INITFAILURE: msg = T("PDERR_INITFAILURE"); break;
+ case PDERR_GETDEVMODEFAIL: msg = T("PDERR_GETDEVMODEFAIL"); break;
+ case PDERR_DNDMMISMATCH: msg = T("PDERR_DNDMMISMATCH"); break;
+ case PDERR_DEFAULTDIFFERENT: msg = T("PDERR_DEFAULTDIFFERENT("); break;
+ case PDERR_CREATEICFAILURE: msg = T("PDERR_CREATEICFAILURE"); break;
default: break;
}
return msg;
pd->hDevNames = NULL;
#if defined(__WXDEBUG__) && defined(__WIN32__)
- wxString str(_T("Printing error: "));
+ wxString str(T("Printing error: "));
str += wxGetPrintDlgError();
wxLogDebug(str);
#endif
//// Printer name
- if (m_printerName != _T(""))
+ if (m_printerName != T(""))
{
// TODO: make this Unicode compatible
int len = wxMin(31, m_printerName.Len());
else
{
// Shouldn't really get here
- wxFAIL_MSG(_T("Couldn't find paper size in paper database."));
+ wxFAIL_MSG(T("Couldn't find paper size in paper database."));
m_paperId = wxPAPER_NONE;
m_paperSize.x = 0;
else
{
// Shouldn't really get here
- wxFAIL_MSG(_T("Paper database wasn't initialized in wxPrintData::ConvertFromNative."));
+ wxFAIL_MSG(T("Paper database wasn't initialized in wxPrintData::ConvertFromNative."));
m_paperId = wxPAPER_NONE;
m_paperSize.x = 0;
else
{
// Shouldn't really get here
- wxFAIL_MSG(_T("Couldn't find paper size from DEVMODE."));
+ wxFAIL_MSG(T("Couldn't find paper size from DEVMODE."));
m_paperSize.x = 0;
m_paperSize.y = 0;
m_printData.SetNativeData((void*) NULL);
- wxASSERT_MSG( (pd->hDevMode), _T("hDevMode must be non-NULL in ConvertToNative!"));
+ wxASSERT_MSG( (pd->hDevMode), T("hDevMode must be non-NULL in ConvertToNative!"));
pd->hDC = (HDC) NULL;
pd->nFromPage = (UINT)m_printFromPage;
m_printData.SetNativeData((void*) NULL);
- wxASSERT_MSG( (pd->hDevMode), _T("hDevMode must be non-NULL in ConvertToNative!"));
+ wxASSERT_MSG( (pd->hDevMode), T("hDevMode must be non-NULL in ConvertToNative!"));
// pd->hDevMode = GlobalAlloc(GMEM_MOVEABLE, sizeof(DEVMODE));
void wxPageSetupDialogData::CalculateIdFromPaperSize()
{
wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL),
- _T("wxThePrintPaperDatabase should not be NULL. "
+ T("wxThePrintPaperDatabase should not be NULL. "
"Do not create global print dialog data objects.") );
wxSize sz = GetPaperSize();
void wxPageSetupDialogData::CalculatePaperSizeFromId()
{
wxASSERT_MSG( (wxThePrintPaperDatabase != (wxPrintPaperDatabase*) NULL),
- _T("wxThePrintPaperDatabase should not be NULL. "
+ T("wxThePrintPaperDatabase should not be NULL. "
"Do not create global print dialog data objects.") );
wxSize sz = wxThePrintPaperDatabase->GetSize(m_printData.GetPaperId());
bool wxConfigBase::Write(const wxString& key, double val)
{
wxString str;
- str.Printf(_T("%f"), val);
+ str.Printf(T("%f"), val);
return Write(key, str);
}
wxString strCurrent;
const wxChar *pc = sz;
for ( ;; ) {
- if ( *pc == _T('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) {
- if ( strCurrent == _T(".") ) {
+ if ( *pc == T('\0') || *pc == wxCONFIG_PATH_SEPARATOR ) {
+ if ( strCurrent == T(".") ) {
// ignore
}
- else if ( strCurrent == _T("..") ) {
+ else if ( strCurrent == T("..") ) {
// go up one level
if ( aParts.IsEmpty() )
wxLogWarning(_("'%s' has extra '..', ignored."), sz);
//else:
// could log an error here, but we prefer to ignore extra '/'
- if ( *pc == _T('\0') )
+ if ( *pc == T('\0') )
return;
}
else
// even if it's possible to create controls without parents in some port,
// it should surely be discouraged because it doesn't work at all under
// Windows
- wxCHECK_MSG( parent, FALSE, _T("all controls must have parents") );
+ wxCHECK_MSG( parent, FALSE, T("all controls must have parents") );
if ( !CreateBase(parent, id, pos, size, style, validator, name) )
return FALSE;
#define ABBR_LENGTH 3
static const wxChar *dayname[] = {
- _T("Sunday"), _T("Monday"), _T("Tuesday"), _T("Wednesday"),
- _T("Thursday"), _T("Friday"), _T("Saturday")
+ T("Sunday"), T("Monday"), T("Tuesday"), T("Wednesday"),
+ T("Thursday"), T("Friday"), T("Saturday")
};
static const wxChar *mname[] = {
- _T("January"), _T("February"), _T("March"), _T("April"), _T("May"), _T("June"),
- _T("July"), _T("August"), _T("September"), _T("October"), _T("November"), _T("December")
+ T("January"), T("February"), T("March"), T("April"), T("May"), T("June"),
+ T("July"), T("August"), T("September"), T("October"), T("November"), T("December")
};
static int GauDays[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
{
DisplayFormat=wxMDY;
DisplayOptions='\0';
- if (wxStrcmp(dat, _T("TODAY")) == 0 || wxStrcmp(dat, _T("today")) == 0)
+ if (wxStrcmp(dat, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0)
{
// Sets the current date
Set();
else
{
wxChar buf[100];
- wxStrcpy(buf, WXSTRINGCAST dat);
+ wxStrcpy(buf, dat);
- wxChar *save_ptr, *token = wxStrtok(buf,_T("/-"),&save_ptr);
+ wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr);
month = wxAtoi(token);
- day = wxAtoi(wxStrtok((wxChar *) NULL,_T("/-"),&save_ptr));
- year = wxAtoi(wxStrtok((wxChar *) NULL,_T(" "),&save_ptr));
+ day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr));
+ year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&save_ptr));
}
mdy_to_julian ();
{
DisplayFormat=wxMDY;
DisplayOptions='\0';
- if (wxStrcmp(dat, _T("TODAY")) == 0 || wxStrcmp(dat, _T("today")) == 0)
+ if (wxStrcmp(dat, T("TODAY")) == 0 || wxStrcmp(dat, T("today")) == 0)
{
// Sets the current date
Set();
else
{
wxChar buf[100];
- wxStrcpy(buf, WXSTRINGCAST dat);
+ wxStrcpy(buf, dat);
- wxChar *save_ptr, *token = wxStrtok(buf,_T("/-"),&save_ptr);
+ wxChar *save_ptr, *token = wxStrtok(buf,T("/-"),&save_ptr);
month = wxAtoi(token);
- day = wxAtoi(wxStrtok((wxChar *) NULL,_T("/-"),&save_ptr));
- year = wxAtoi(wxStrtok((wxChar *) NULL,_T(" "),&save_ptr));
+ day = wxAtoi(wxStrtok((wxChar *) NULL,T("/-"),&save_ptr));
+ year = wxAtoi(wxStrtok((wxChar *) NULL,T(" "),&save_ptr));
}
mdy_to_julian ();
}
wxStrncpy( buf, wxGetTranslation(dayname[day_of_week-1]),
(DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- wxStrcat( buf, _T(", "));
+ wxStrcat( buf, T(", "));
wxStrncat( buf, wxGetTranslation(mname[month-1]),
(DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- wxStrcat( buf, _T(" "));
- wxSprintf( buf+wxStrlen(buf), _T("%d, %d"), day, abs(year) );
+ wxStrcat( buf, T(" "));
+ wxSprintf( buf+wxStrlen(buf), T("%d, %d"), day, abs(year) );
if (year < 0)
wxStrcat(buf,_(" B.C."));
return wxString(buf);
wxStrcpy(buf, _("invalid date"));
return wxString(buf);
}
- wxSprintf(buf,_T("%d "), day);
+ wxSprintf(buf,T("%d "), day);
wxStrncat(buf, wxGetTranslation(mname[month-1]),
(DisplayOptions & wxDATE_ABBR) ? ABBR_LENGTH : 9);
- wxSprintf( buf+wxStrlen(buf), _T(" %d"), abs(year) );
+ wxSprintf( buf+wxStrlen(buf), T(" %d"), abs(year) );
if (year < 0)
wxStrcat(buf, _(" B.C."));
return wxString(buf);
if (day==0 || month==0 || year==0)
wxStrcpy(buf, _("invalid date"));
else
- wxSprintf( buf+wxStrlen(buf), _T("%1d/%1d/%02d"), month, day,
+ wxSprintf( buf+wxStrlen(buf), T("%1d/%1d/%02d"), month, day,
(DisplayOptions & wxNO_CENTURY) && (abs(year) > 1899)
? (abs(year) - (abs(year) / 100 * 100))
: (abs(year)) );
return wxString(buf);
}
- return wxString(_T(""));
+ return wxString(T(""));
}
void wxDate::SetFormat( int format )
// =====================================================================
// Results from a Microsoft Access 7.0 db, using a driver from Microsoft
//
- // SQL_VARCHAR type name = 'TEXT', Precision = 255
+ // SQL_VARCHAR type name = 'TEXT(', Precision = 255
// SQL_TIMESTAMP type name = 'DATETIME'
// SQL_DECIMAL SQL_NO_DATA_FOUND
// SQL_NUMERIC type name = 'CURRENCY', Precision = 19
int c = 0;
if (privileges & DB_GRANT_SELECT)
{
- strcat(sqlStmt, "SELECT");
+ strcat(sqlStmt, "SELECT(");
c++;
}
if (privileges & DB_GRANT_INSERT)
{
if (c++)
strcat(sqlStmt, ", ");
- strcat(sqlStmt, "INSERT");
+ strcat(sqlStmt, "INSERT(");
}
if (privileges & DB_GRANT_UPDATE)
{
wxString line;
for (size_t pos = 0; pos < message.Len(); pos++)
{
- if (message[pos] == _T('\n'))
+ if (message[pos] == T('\n'))
{
if (!line.IsEmpty())
{
wxStaticText *s1 = new wxStaticText( this, -1, line );
box->Add( s1 );
- line = _T("");
+ line = T("");
}
else
{
void wxDocMDIParentFrame::OnMRUFile(wxCommandEvent& event)
{
wxString f(m_docManager->GetHistoryFile(event.GetSelection() - wxID_FILE1));
- if (f != _T(""))
+ if (f != T(""))
(void)m_docManager->CreateDocument(f, wxDOC_SILENT);
}
// local constants
// ----------------------------------------------------------------------------
-static const char *s_MRUEntryFormat = _T("&%d %s");
+static const char *s_MRUEntryFormat = T("&%d %s");
// ============================================================================
// implementation
bool ret = FALSE;
if (!IsModified()) return TRUE;
- if (m_documentFile == _T("") || !m_savedYet)
+ if (m_documentFile == T("") || !m_savedYet)
ret = SaveAs();
else
ret = OnSaveDocument(m_documentFile);
wxString path, name, ext;
wxSplitPath(fileName, & path, & name, & ext);
- if (ext.IsEmpty() || ext == _T(""))
+ if (ext.IsEmpty() || ext == T(""))
{
fileName += ".";
fileName += docTemplate->GetDefaultExtension();
return FALSE;
wxString msgTitle;
- if (wxTheApp->GetAppName() != _T(""))
+ if (wxTheApp->GetAppName() != T(""))
msgTitle = wxTheApp->GetAppName();
else
msgTitle = wxString(_("File error"));
return FALSE;
wxString msgTitle;
- if (wxTheApp->GetAppName() != _T(""))
+ if (wxTheApp->GetAppName() != T(""))
msgTitle = wxTheApp->GetAppName();
else
msgTitle = wxString(_("File error"));
// Get title, or filename if no title, else unnamed
bool wxDocument::GetPrintableName(wxString& buf) const
{
- if (m_documentTitle != _T(""))
+ if (m_documentTitle != T(""))
{
buf = m_documentTitle;
return TRUE;
}
- else if (m_documentFile != _T(""))
+ else if (m_documentFile != T(""))
{
buf = wxFileNameFromPath(m_documentFile);
return TRUE;
GetPrintableName(title);
wxString msgTitle;
- if (wxTheApp->GetAppName() != _T(""))
+ if (wxTheApp->GetAppName() != T(""))
msgTitle = wxTheApp->GetAppName();
else
msgTitle = wxString(_("Warning"));
// Existing document
wxDocTemplate *temp = (wxDocTemplate *) NULL;
- wxString path2(_T(""));
- if (path != _T(""))
+ wxString path2(T(""));
+ if (path != T(""))
path2 = path;
if (flags & wxDOC_SILENT)
{
// add a '|' to separate this filter from the previous one
if ( !descrBuf.IsEmpty() )
- descrBuf << _T('|');
+ descrBuf << T('|');
descrBuf << templates[i]->GetDescription()
- << _T(" (") << templates[i]->GetFileFilter() << _T(") |")
+ << T(" (") << templates[i]->GetFileFilter() << T(") |")
<< templates[i]->GetFileFilter();
}
}
#else
- wxString descrBuf = _T("*.*");
+ wxString descrBuf = T("*.*");
#endif
int FilterIndex = 0;
wxString pathTmp = wxFileSelectorEx(_("Select a file"),
- _T(""),
- _T(""),
+ T(""),
+ T(""),
&FilterIndex,
descrBuf,
0,
}
else
{
- path = _T("");
+ path = T("");
return (wxDocTemplate *) NULL;
}
#if 0
if (!temp)
return (wxDocTemplate *) NULL;
- wxChar *pathTmp = wxFileSelector(_("Select a file"), _T(""), _T(""),
+ wxChar *pathTmp = wxFileSelector(_("Select a file"), T(""), T(""),
temp->GetDefaultExtension(),
temp->GetFileFilter(),
0, wxTheApp->GetTopWindow());
wxDocTemplate *wxDocManager::SelectDocumentType(wxDocTemplate **templates,
int noTemplates)
{
- wxChar **strings = new wxChar *[noTemplates];
+ const wxChar **strings = new wxChar *[noTemplates];
wxChar **data = new wxChar *[noTemplates];
int i;
int n = 0;
{
if (templates[i]->IsVisible())
{
- strings[n] = WXSTRINGCAST templates[i]->m_description;
+ strings[n] = templates[i]->m_description;
data[n] = (wxChar *)templates[i];
n ++;
}
wxDocTemplate *wxDocManager::SelectViewType(wxDocTemplate **templates,
int noTemplates)
{
- wxChar **strings = new wxChar *[noTemplates];
+ const wxChar **strings = new wxChar *[noTemplates];
wxChar **data = new wxChar *[noTemplates];
int i;
int n = 0;
for (i = 0; i < noTemplates; i++)
{
- if (templates[i]->IsVisible() && (templates[i]->GetViewName() != _T("")))
+ if (templates[i]->IsVisible() && (templates[i]->GetViewName() != T("")))
{
- strings[n] = WXSTRINGCAST templates[i]->m_viewTypeName;
+ strings[n] = templates[i]->m_viewTypeName;
data[n] = (wxChar *)templates[i];
n ++;
}
#if wxUSE_PRINTING_ARCHITECTURE
wxDocPrintout::wxDocPrintout(wxView *view, const wxString& title)
- : wxPrintout(WXSTRINGCAST title)
+ : wxPrintout(title)
{
m_printoutView = view;
}
{
wxCommand *command = (wxCommand *)m_currentCommand->Data();
wxString commandName(command->GetName());
- if (commandName == _T("")) commandName = _("Unnamed command");
+ if (commandName == T("")) commandName = _("Unnamed command");
bool canUndo = command->CanUndo();
if (canUndo)
buf = wxString(_("&Undo ")) + commandName;
{
wxCommand *redoCommand = (wxCommand *)m_currentCommand->Next()->Data();
wxString redoCommandName(redoCommand->GetName());
- if (redoCommandName == _T("")) redoCommandName = _("Unnamed command");
+ if (redoCommandName == T("")) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName;
m_commandEditMenu->SetLabel(wxID_REDO, buf);
m_commandEditMenu->Enable(wxID_REDO, TRUE);
// we've undone to the start of the list, but can redo the first.
wxCommand *redoCommand = (wxCommand *)m_commands.First()->Data();
wxString redoCommandName(redoCommand->GetName());
- if (redoCommandName == _T("")) redoCommandName = _("Unnamed command");
+ if (redoCommandName == T("")) redoCommandName = _("Unnamed command");
buf = wxString(_("&Redo ")) + redoCommandName;
m_commandEditMenu->SetLabel(wxID_REDO, buf);
m_commandEditMenu->Enable(wxID_REDO, TRUE);
void wxFileHistory::RemoveFileFromHistory(int i)
{
wxCHECK_RET( i < m_fileHistoryN,
- _T("invalid index in wxFileHistory::RemoveFileFromHistory") );
+ T("invalid index in wxFileHistory::RemoveFileFromHistory") );
wxNode* node = m_fileMenus.First();
while ( node )
// to be removed as soon as wxMenu::Delete() is implemented
#if 1
- menu->SetLabel(wxID_FILE1 + m_fileHistoryN - 1, _T(""));
+ menu->SetLabel(wxID_FILE1 + m_fileHistoryN - 1, T(""));
#endif
node = node->Next();
{
m_fileHistoryN = 0;
wxString buf;
- buf.Printf(_T("file%d"), m_fileHistoryN+1);
+ buf.Printf(T("file%d"), m_fileHistoryN+1);
wxString historyFile;
- while ((m_fileHistoryN <= m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != _T("")))
+ while ((m_fileHistoryN <= m_fileMaxFiles) && config.Read(buf, &historyFile) && (historyFile != T("")))
{
m_fileHistory[m_fileHistoryN] = copystring((const wxChar*) historyFile);
m_fileHistoryN ++;
- buf.Printf(_T("file%d"), m_fileHistoryN+1);
+ buf.Printf(T("file%d"), m_fileHistoryN+1);
historyFile = "";
}
AddFilesToMenu();
for (i = 0; i < m_fileHistoryN; i++)
{
wxString buf;
- buf.Printf(_T("file%d"), i+1);
+ buf.Printf(T("file%d"), i+1);
config.Write(buf, wxString(m_fileHistory[i]));
}
}
// add item at the given position
void wxBaseArray::Insert(long lItem, size_t nIndex)
{
- wxCHECK_RET( nIndex <= m_nCount, _T("bad index in wxArray::Insert") );
+ wxCHECK_RET( nIndex <= m_nCount, T("bad index in wxArray::Insert") );
Grow();
// removes item from array (by index)
void wxBaseArray::Remove(size_t nIndex)
{
- wxCHECK_RET( nIndex <= m_nCount, _T("bad index in wxArray::Remove") );
+ wxCHECK_RET( nIndex <= m_nCount, T("bad index in wxArray::Remove") );
memmove(&m_pItems[nIndex], &m_pItems[nIndex + 1],
(m_nCount - nIndex - 1)*sizeof(long));
int iIndex = Index(lItem);
wxCHECK_RET( iIndex != wxNOT_FOUND,
- _T("removing inexistent item in wxArray::Remove") );
+ T("removing inexistent item in wxArray::Remove") );
Remove((size_t)iIndex);
}
const char *envLibPath = getenv("LD_LIBRARY_PATH");
if ( envLibPath )
libPath << ':' << envLibPath;
- wxStringTokenizer tokenizer(libPath, _T(':'));
+ wxStringTokenizer tokenizer(libPath, T(':'));
while ( tokenizer.HasMoreToken() )
{
wxString fullname(tokenizer.NextToken());
// Created: 01/02/97
// RCS-ID: $Id$
// Copyright: (c) Julian Smart and Markus Holzem
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#ifndef WX_PRECOMP
#include "wx/defs.h"
- #include "wx/control.h"
- #include "wx/utils.h"
#include "wx/app.h"
- #include "wx/dc.h"
+ #include "wx/list.h"
+
+ #if wxUSE_GUI
+ #include "wx/control.h"
+ #include "wx/utils.h"
+ #include "wx/dc.h"
+ #endif // wxUSE_GUI
#endif
#include "wx/event.h"
-#include "wx/validate.h"
+
+#if wxUSE_GUI
+ #include "wx/validate.h"
+#endif // wxUSE_GUI
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxEvtHandler, wxObject)
IMPLEMENT_ABSTRACT_CLASS(wxEvent, wxObject)
- IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxScrollWinEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxIconizeEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent)
IMPLEMENT_DYNAMIC_CLASS(wxIdleEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxCommandEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxQueryNewPaletteEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent)
- IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent)
+
+ #if wxUSE_GUI
+ IMPLEMENT_DYNAMIC_CLASS(wxCommandEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxNotifyEvent, wxCommandEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxScrollEvent, wxCommandEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxScrollWinEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxMouseEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxKeyEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxSizeEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxPaintEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxEraseEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxMoveEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxFocusEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxCloseEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxShowEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxMaximizeEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxIconizeEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxMenuEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxJoystickEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxDropFilesEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxActivateEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxInitDialogEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxSysColourChangedEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxUpdateUIEvent, wxCommandEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxNavigationKeyEvent, wxCommandEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxPaletteChangedEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxQueryNewPaletteEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxWindowCreateEvent, wxEvent)
+ IMPLEMENT_DYNAMIC_CLASS(wxWindowDestroyEvent, wxEvent)
+ #endif // wxUSE_GUI
const wxEventTable *wxEvtHandler::GetEventTable() const
{ return &wxEvtHandler::sm_eventTable; }
void wxEvent::CopyObject(wxObject& object_dest) const
{
- wxEvent *obj = (wxEvent *)&object_dest;
+ wxEvent *obj = (wxEvent *)&object_dest;
wxObject::CopyObject(object_dest);
obj->m_eventType = m_eventType;
obj->m_isCommandEvent = m_isCommandEvent;
}
+#if wxUSE_GUI
+
/*
* Command events
*
void wxCommandEvent::CopyObject(wxObject& obj_d) const
{
- wxCommandEvent *obj = (wxCommandEvent *)&obj_d;
+ wxCommandEvent *obj = (wxCommandEvent *)&obj_d;
wxEvent::CopyObject(obj_d);
void wxScrollWinEvent::CopyObject(wxObject& obj_d) const
{
- wxScrollWinEvent *obj = (wxScrollWinEvent*)&obj_d;
+ wxScrollWinEvent *obj = (wxScrollWinEvent*)&obj_d;
wxEvent::CopyObject(obj_d);
case 3:
return RightDClick();
default:
- wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonDClick"));
+ wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonDClick"));
}
return FALSE;
case 3:
return RightDown();
default:
- wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonDown"));
+ wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonDown"));
}
return FALSE;
case 3:
return RightUp();
default:
- wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonUp"));
+ wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonUp"));
}
return FALSE;
case 3:
return (RightDown() || RightUp() || RightDClick());
default:
- wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::Button"));
+ wxFAIL_MSG(T("invalid parameter in wxMouseEvent::Button"));
}
return FALSE;
case 3:
return RightIsDown();
default:
- wxFAIL_MSG(_T("invalid parameter in wxMouseEvent::ButtonIsDown"));
+ wxFAIL_MSG(T("invalid parameter in wxMouseEvent::ButtonIsDown"));
}
return FALSE;
#endif
obj->m_canVeto = m_canVeto;
}
-
+
void wxShowEvent::CopyObject(wxObject& obj_d) const
{
wxShowEvent *obj = (wxShowEvent *)&obj_d;
obj->m_buttonChange = m_buttonChange;
obj->m_buttonState = m_buttonState;
obj->m_joyStick = m_joyStick;
-}
+}
void wxDropFilesEvent::CopyObject(wxObject& obj_d) const
{
obj->m_noFiles = m_noFiles;
obj->m_pos = m_pos;
// TODO: Problem with obj->m_files. It should be deallocated by the
- // destructor of the event.
-}
-
-void wxIdleEvent::CopyObject(wxObject& obj_d) const
-{
- wxIdleEvent *obj = (wxIdleEvent *)&obj_d;
- wxEvent::CopyObject(obj_d);
-
- obj->m_requestMore = m_requestMore;
+ // destructor of the event.
}
void wxUpdateUIEvent::CopyObject(wxObject &obj_d) const
SetEventObject(win);
}
+#endif // wxUSE_GUI
+
+void wxIdleEvent::CopyObject(wxObject& obj_d) const
+{
+ wxIdleEvent *obj = (wxIdleEvent *)&obj_d;
+ wxEvent::CopyObject(obj_d);
+
+ obj->m_requestMore = m_requestMore;
+}
+
/*
* Event handler
*/
// TODO: Wake up idle handler for the other platforms.
#ifdef __WXGTK__
- if (g_isIdle)
+ if (g_isIdle)
wxapp_install_idle_handler();
#endif
bool wxEvtHandler::ProcessEvent(wxEvent& event)
{
+#if wxUSE_GUI
/* check that our flag corresponds to reality */
wxASSERT( m_isWindow == IsKindOf(CLASSINFO(wxWindow)) );
+#endif // wxUSE_GUI
/* An event handler can be enabled or disabled */
if ( GetEvtHandlerEnabled() )
{
#if wxUSE_THREADS
- /* Check whether we are in a child thread. */
+ /* Check whether we are in a child thread. */
if (!wxThread::IsMain())
return ProcessThreadEvent(event);
#endif
const wxEventTable *table = GetEventTable();
-#if wxUSE_VALIDATORS
+#if wxUSE_GUI && wxUSE_VALIDATORS
// Try the associated validator first, if this is a window.
// Problem: if the event handler of the window has been replaced,
// this wxEvtHandler may no longer be a window.
return TRUE;
}
+#if wxUSE_GUI
// Carry on up the parent-child hierarchy,
// but only if event is a command event: it wouldn't
// make sense for a parent to receive a child's size event, for example
if (parent && !parent->IsBeingDeleted())
return parent->GetEventHandler()->ProcessEvent(event);
}
+#endif // wxUSE_GUI
// Last try - application object.
if ( wxTheApp && (this != wxTheApp) )
bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event )
{
wxCHECK_MSG( m_dynamicEvents, FALSE,
- _T("caller should check that we have dynamic events") );
+ T("caller should check that we have dynamic events") );
int commandId = event.GetId();
}
#endif // WXWIN_COMPATIBILITY
+#if wxUSE_GUI
+
// Find a window with the focus, that is also a descendant of the given window.
// This is used to determine the window to initially send commands to.
wxWindow* wxFindFocusDescendant(wxWindow* ancestor)
return focusWin;
}
+#endif // wxUSE_GUI
bool wxFFile::Open(const wxChar *filename, const char *mode)
{
- wxASSERT_MSG( !m_fp, _T("should close or detach the old file first") );
+ wxASSERT_MSG( !m_fp, T("should close or detach the old file first") );
#if wxUSE_UNICODE
char *tmp_fname;
bool wxFFile::ReadAll(wxString *str)
{
- wxCHECK_MSG( str, FALSE, _T("invalid parameter") );
- wxCHECK_MSG( IsOpened(), FALSE, _T("can't read from closed file") );
+ wxCHECK_MSG( str, FALSE, T("invalid parameter") );
+ wxCHECK_MSG( IsOpened(), FALSE, T("can't read from closed file") );
clearerr(m_fp);
size_t wxFFile::Read(void *pBuf, size_t nCount)
{
- wxCHECK_MSG( pBuf, FALSE, _T("invalid parameter") );
- wxCHECK_MSG( IsOpened(), FALSE, _T("can't read from closed file") );
+ wxCHECK_MSG( pBuf, FALSE, T("invalid parameter") );
+ wxCHECK_MSG( IsOpened(), FALSE, T("can't read from closed file") );
size_t nRead = fread(pBuf, 1, nCount, m_fp);
if ( (nRead < nCount) && Error() )
size_t wxFFile::Write(const void *pBuf, size_t nCount)
{
- wxCHECK_MSG( pBuf, FALSE, _T("invalid parameter") );
- wxCHECK_MSG( IsOpened(), FALSE, _T("can't write to closed file") );
+ wxCHECK_MSG( pBuf, FALSE, T("invalid parameter") );
+ wxCHECK_MSG( IsOpened(), FALSE, T("can't write to closed file") );
size_t nWritten = fwrite(pBuf, 1, nCount, m_fp);
if ( nWritten < nCount )
bool wxFFile::Seek(long ofs, wxSeekMode mode)
{
- wxCHECK_MSG( IsOpened(), FALSE, _T("can't seek on closed file") );
+ wxCHECK_MSG( IsOpened(), FALSE, T("can't seek on closed file") );
int origin;
switch ( mode )
{
default:
- wxFAIL_MSG(_T("unknown seek mode"));
+ wxFAIL_MSG(T("unknown seek mode"));
// still fall through
case wxFromStart:
wxCharBuffer fname = wxConvFile.cWC2MB(name);
return !access(fname, 0) &&
- !stat(MBSTRINGCAST fname, &st) &&
+ !stat(wxMBSTRINGCAST fname, &st) &&
(st.st_mode & S_IFREG);
#else
return !access(name, 0) &&
break;
default:
- wxFAIL_MSG(_T("bad wxFile::Access mode parameter."));
+ wxFAIL_MSG(T("bad wxFile::Access mode parameter."));
}
return access(wxFNCONV(name), how) == 0;
// different partitions for example). Unfortunately, the only standard
// (POSIX) temp file creation function tmpnam() can't do it.
#if defined(__UNIX__) || defined(__WXSTUBS__)|| defined( __WXMAC__ )
- static const wxChar *szMktempSuffix = _T("XXXXXX");
+ static const wxChar *szMktempSuffix = T("XXXXXX");
m_strTemp << strName << szMktempSuffix;
- mktemp(MBSTRINGCAST m_strTemp.mb_str()); // will do because length doesn't change
+ // can use the cast because length doesn't change
+ mktemp(wxMBSTRINGCAST m_strTemp.mb_str());
#elif defined(__WXPM__)
// for now just create a file
// future enhancements can be to set some extended attributes for file systems
// OS/2 supports that have them (HPFS, FAT32) and security (HPFS386)
- static const wxChar *szMktempSuffix = _T("XXX");
+ static const wxChar *szMktempSuffix = T("XXX");
m_strTemp << strName << szMktempSuffix;
mkdir(m_strTemp.GetWriteBuf(MAX_PATH));
#else // Windows
wxString strPath;
wxSplitPath(strName, &strPath, NULL, NULL);
if ( strPath.IsEmpty() )
- strPath = _T('.'); // GetTempFileName will fail if we give it empty string
+ strPath = T('.'); // GetTempFileName will fail if we give it empty string
#ifdef __WIN32__
- if ( !GetTempFileName(strPath, _T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) )
+ if ( !GetTempFileName(strPath, T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) )
#else
// Not sure why MSVC++ 1.5 header defines first param as BYTE - bug?
- if ( !GetTempFileName((BYTE) (DWORD)(const wxChar*) strPath, _T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) )
+ if ( !GetTempFileName((BYTE) (DWORD)(const wxChar*) strPath, T("wx_"),0, m_strTemp.GetWriteBuf(MAX_PATH)) )
#endif
- wxLogLastError(_T("GetTempFileName"));
+ wxLogLastError(T("GetTempFileName"));
m_strTemp.UngetWriteBuf();
#endif // Windows/Unix
wxString strDir;
#ifdef __UNIX__
- strDir = _T("/etc/");
+ strDir = T("/etc/");
#elif defined(__WXPM__)
ULONG aulSysInfo[QSV_MAX] = {0};
UINT drive;
}
}
#elif defined(__WXSTUBS__)
- wxASSERT_MSG( FALSE, _T("TODO") ) ;
+ wxASSERT_MSG( FALSE, T("TODO") ) ;
#elif defined(__WXMAC__)
- wxASSERT_MSG( FALSE, _T("TODO") ) ;
+ wxASSERT_MSG( FALSE, T("TODO") ) ;
#else // Windows
wxChar szWinDir[MAX_PATH];
::GetWindowsDirectory(szWinDir, MAX_PATH);
strDir = szWinDir;
- strDir << _T('\\');
+ strDir << T('\\');
#endif // Unix/Windows
return strDir;
wxGetHomeDir(&strDir);
#ifdef __UNIX__
- if (strDir.Last() != _T('/')) strDir << _T('/');
+ if (strDir.Last() != T('/')) strDir << T('/');
#else
- if (strDir.Last() != _T('\\')) strDir << _T('\\');
+ if (strDir.Last() != T('\\')) strDir << T('\\');
#endif
return strDir;
wxString str = GetGlobalDir();
str << szFile;
- if ( wxStrchr(szFile, _T('.')) == NULL )
+ if ( wxStrchr(szFile, T('.')) == NULL )
#ifdef __UNIX__
- str << _T(".conf");
+ str << T(".conf");
#else // Windows
- str << _T(".ini");
+ str << T(".ini");
#endif // UNIX/Win
return str;
wxString str = GetLocalDir();
#ifdef __UNIX__
- str << _T('.');
+ str << T('.');
#endif
str << szFile;
#ifdef __WXMSW__
- if ( wxStrchr(szFile, _T('.')) == NULL )
- str << _T(".ini");
+ if ( wxStrchr(szFile, T('.')) == NULL )
+ str << T(".ini");
#endif
return str;
;
// skip blank/comment lines
- if ( *pStart == _T('\0')|| *pStart == _T(';') || *pStart == _T('#') )
+ if ( *pStart == T('\0')|| *pStart == T(';') || *pStart == T('#') )
continue;
- if ( *pStart == _T('[') ) { // a new group
+ if ( *pStart == T('[') ) { // a new group
pEnd = pStart;
- while ( *++pEnd != _T(']') ) {
- if ( *pEnd == _T('\n') || *pEnd == _T('\0') )
+ while ( *++pEnd != T(']') ) {
+ if ( *pEnd == T('\n') || *pEnd == T('\0') )
break;
}
- if ( *pEnd != _T(']') ) {
+ if ( *pEnd != T(']') ) {
wxLogError(_("file '%s': unexpected character %c at line %d."),
file.GetName(), *pEnd, n + 1);
continue; // skip this line
// check that there is nothing except comments left on this line
bool bCont = TRUE;
- while ( *++pEnd != _T('\0') && bCont ) {
+ while ( *++pEnd != T('\0') && bCont ) {
switch ( *pEnd ) {
- case _T('#'):
- case _T(';'):
+ case T('#'):
+ case T(';'):
bCont = FALSE;
break;
- case _T(' '):
- case _T('\t'):
+ case T(' '):
+ case T('\t'):
// ignore whitespace ('\n' impossible here)
break;
}
else { // a key
const wxChar *pEnd = pStart;
- while ( *pEnd != _T('=') && !wxIsspace(*pEnd) ) {
- if ( *pEnd == _T('\\') ) {
+ while ( *pEnd != T('=') && !wxIsspace(*pEnd) ) {
+ if ( *pEnd == T('\\') ) {
// next character may be space or not - still take it because it's
// quoted
pEnd++;
while ( isspace(*pEnd) )
pEnd++;
- if ( *pEnd++ != _T('=') ) {
+ if ( *pEnd++ != T('=') ) {
wxLogError(_("file '%s', line %d: '=' expected."),
file.GetName(), n + 1);
}
wxString strName = path.Name();
if ( strName.IsEmpty() ) {
// setting the value of a group is an error
- wxASSERT_MSG( wxIsEmpty(szValue), _T("can't set value of a group!") );
+ wxASSERT_MSG( wxIsEmpty(szValue), T("can't set value of a group!") );
// ... except if it's empty in which case it's a way to force it's creation
m_pCurrentGroup->SetDirty();
{
// ltoa() is not ANSI :-(
wxString buf;
- buf.Printf(_T("%ld"), lValue);
+ buf.Printf(T("%ld"), lValue);
return Write(key, buf);
}
if ( bGroupIfEmptyAlso && m_pCurrentGroup->IsEmpty() ) {
if ( m_pCurrentGroup != m_pRootGroup ) {
ConfigGroup *pGroup = m_pCurrentGroup;
- SetPath(_T("..")); // changes m_pCurrentGroup!
+ SetPath(T("..")); // changes m_pCurrentGroup!
m_pCurrentGroup->DeleteSubgroupByName(pGroup->Name());
}
//else: never delete the root group
if ( remove(m_strLocalFile.fn_str()) == -1 )
wxLogSysError(_("can't delete user configuration file '%s'"), m_strLocalFile.c_str());
- m_strLocalFile = m_strGlobalFile = _T("");
+ m_strLocalFile = m_strGlobalFile = T("");
Init();
return TRUE;
// this group wasn't present in local config file, add it now
if ( pParent != NULL ) {
wxString strFullName;
- strFullName << _T("[")
+ strFullName << T("[")
// +1: no '/'
<< FilterOutEntryName(GetFullName().c_str() + 1)
- << _T("]");
+ << T("]");
m_pLine = m_pConfig->LineListInsert(strFullName,
pParent->GetLastGroupLine());
pParent->SetLastGroup(this); // we're surely after all the others
LineList *line = GetGroupLine();
wxString strFullName;
- strFullName << _T("[") << (GetFullName().c_str() + 1) << _T("]"); // +1: no '/'
+ strFullName << T("[") << (GetFullName().c_str() + 1) << T("]"); // +1: no '/'
line->SetText(strFullName);
SetDirty();
if ( Parent() )
return Parent()->GetFullName() + wxCONFIG_PATH_SEPARATOR + Name();
else
- return _T("");
+ return T("");
}
// ----------------------------------------------------------------------------
if ( bUser ) {
wxString strVal = FilterOutValue(strValue);
wxString strLine;
- strLine << FilterOutEntryName(m_strName) << _T('=') << strVal;
+ strLine << FilterOutEntryName(m_strName) << T('=') << strVal;
if ( m_pLine != NULL ) {
// entry was read from the local config file, just modify the line
bool bQuoted = !str.IsEmpty() && str[0] == '"';
for ( size_t n = bQuoted ? 1 : 0; n < str.Len(); n++ ) {
- if ( str[n] == _T('\\') ) {
+ if ( str[n] == T('\\') ) {
switch ( str[++n] ) {
- case _T('n'):
- strResult += _T('\n');
+ case T('n'):
+ strResult += T('\n');
break;
- case _T('r'):
- strResult += _T('\r');
+ case T('r'):
+ strResult += T('\r');
break;
- case _T('t'):
- strResult += _T('\t');
+ case T('t'):
+ strResult += T('\t');
break;
- case _T('\\'):
- strResult += _T('\\');
+ case T('\\'):
+ strResult += T('\\');
break;
- case _T('"'):
- strResult += _T('"');
+ case T('"'):
+ strResult += T('"');
break;
}
}
else {
- if ( str[n] != _T('"') || !bQuoted )
+ if ( str[n] != T('"') || !bQuoted )
strResult += str[n];
else if ( n != str.Len() - 1 ) {
wxLogWarning(_("unexpected \" at position %d in '%s'."),
strResult.Alloc(str.Len());
// quoting is necessary to preserve spaces in the beginning of the string
- bool bQuote = wxIsspace(str[0]) || str[0] == _T('"');
+ bool bQuote = wxIsspace(str[0]) || str[0] == T('"');
if ( bQuote )
- strResult += _T('"');
+ strResult += T('"');
wxChar c;
for ( size_t n = 0; n < str.Len(); n++ ) {
switch ( str[n] ) {
- case _T('\n'):
- c = _T('n');
+ case T('\n'):
+ c = T('n');
break;
- case _T('\r'):
- c = _T('r');
+ case T('\r'):
+ c = T('r');
break;
- case _T('\t'):
- c = _T('t');
+ case T('\t'):
+ c = T('t');
break;
- case _T('\\'):
- c = _T('\\');
+ case T('\\'):
+ c = T('\\');
break;
- case _T('"'):
+ case T('"'):
if ( bQuote ) {
- c = _T('"');
+ c = T('"');
break;
}
//else: fall through
}
// we get here only for special characters
- strResult << _T('\\') << c;
+ strResult << T('\\') << c;
}
if ( bQuote )
- strResult += _T('"');
+ strResult += T('"');
return strResult;
}
strResult.Alloc(str.Len());
for ( const wxChar *pc = str.c_str(); *pc != '\0'; pc++ ) {
- if ( *pc == _T('\\') )
+ if ( *pc == T('\\') )
pc++;
strResult += *pc;
wxString strResult;
strResult.Alloc(str.Len());
- for ( const wxChar *pc = str.c_str(); *pc != _T('\0'); pc++ ) {
+ for ( const wxChar *pc = str.c_str(); *pc != T('\0'); pc++ ) {
wxChar c = *pc;
// we explicitly allow some of "safe" chars and 8bit ASCII characters
// which will probably never have special meaning
// NB: note that wxCONFIG_IMMUTABLE_PREFIX and wxCONFIG_PATH_SEPARATOR
// should *not* be quoted
- if ( !wxIsalnum(c) && !wxStrchr(_T("@_/-!.*%"), c) && ((c & 0x80) == 0) )
- strResult += _T('\\');
+ if ( !wxIsalnum(c) && !wxStrchr(T("@_/-!.*%"), c) && ((c & 0x80) == 0) )
+ strResult += T('\\');
strResult += c;
}
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
#ifdef __GNUG__
#pragma implementation "filefn.h"
#endif
#include "windows.h"
#endif
+// ----------------------------------------------------------------------------
+// constants
+// ----------------------------------------------------------------------------
+
#define _MAXPATHLEN 500
-extern wxChar *wxBuffer;
#ifdef __WXMAC__
extern wxChar gwxMacFileName[] ;
extern wxChar gwxMacFileName2[] ;
IMPLEMENT_DYNAMIC_CLASS(wxPathList, wxStringList)
#endif
+// ----------------------------------------------------------------------------
+// private globals
+// ----------------------------------------------------------------------------
+
+static wxChar wxFileFunctionsBuffer[4*_MAXPATHLEN];
+
+// ============================================================================
+// implementation
+// ============================================================================
+
void wxPathList::Add (const wxString& path)
{
wxStringList::Add (WXSTRINGCAST path);
{
static const wxChar PATH_TOKS[] =
#ifdef __WINDOWS__
- _T(" ;"); // Don't seperate with colon in DOS (used for drive)
+ T(" ;"); // Don't seperate with colon in DOS (used for drive)
#else
- _T(" :;");
+ T(" :;");
#endif
wxChar *val = wxGetenv (WXSTRINGCAST envVariable);
wxString wxPathList::FindValidPath (const wxString& file)
{
- if (wxFileExists (wxExpandPath(wxBuffer, file)))
- return wxString(wxBuffer);
+ if (wxFileExists (wxExpandPath(wxFileFunctionsBuffer, file)))
+ return wxString(wxFileFunctionsBuffer);
wxChar buf[_MAXPATHLEN];
- wxStrcpy(buf, wxBuffer);
+ wxStrcpy(buf, wxFileFunctionsBuffer);
wxChar *filename = (wxChar*) NULL; /* shut up buggy egcs warning */
filename = IsAbsolutePath (buf) ? wxFileNameFromPath (buf) : (wxChar *)buf;
for (wxNode * node = First (); node; node = node->Next ())
{
wxChar *path = (wxChar *) node->Data ();
- wxStrcpy (wxBuffer, path);
- wxChar ch = wxBuffer[wxStrlen(wxBuffer)-1];
- if (ch != _T('\\') && ch != _T('/'))
- wxStrcat (wxBuffer, _T("/"));
- wxStrcat (wxBuffer, filename);
+ wxStrcpy (wxFileFunctionsBuffer, path);
+ wxChar ch = wxFileFunctionsBuffer[wxStrlen(wxFileFunctionsBuffer)-1];
+ if (ch != T('\\') && ch != T('/'))
+ wxStrcat (wxFileFunctionsBuffer, T("/"));
+ wxStrcat (wxFileFunctionsBuffer, filename);
#ifdef __WINDOWS__
- Unix2DosFilename (wxBuffer);
+ Unix2DosFilename (wxFileFunctionsBuffer);
#endif
- if (wxFileExists (wxBuffer))
+ if (wxFileExists (wxFileFunctionsBuffer))
{
- return wxString(wxBuffer); // Found!
+ return wxString(wxFileFunctionsBuffer); // Found!
}
} // for()
- return wxString(_T("")); // Not found
+ return wxString(T("")); // Not found
}
wxString wxPathList::FindAbsoluteValidPath (const wxString& file)
{
- wxString f = FindValidPath(file);
- if (wxIsAbsolutePath(f))
- return f;
- else
- {
- wxChar buf[500];
- wxGetWorkingDirectory(buf, 499);
- int len = (int)wxStrlen(buf);
- wxChar lastCh = 0;
- if (len > 0)
- lastCh = buf[len-1];
- if (lastCh != _T('/') && lastCh != _T('\\'))
+ wxString f = FindValidPath(file);
+ if ( wxIsAbsolutePath(f) )
+ return f;
+
+ wxString buf;
+ wxGetWorkingDirectory(buf.GetWriteBuf(_MAXPATHLEN), _MAXPATHLEN - 1);
+ buf.UngetWriteBuf();
+ if ( !wxEndsWithPathSeparator(buf) )
{
-#ifdef __WINDOWS__
- wxStrcat(buf, _T("\\"));
-#else
- wxStrcat(buf, _T("/"));
-#endif
+ buf += wxFILE_SEP_PATH;
}
- wxStrcat(buf, (const wxChar *)f);
- wxStrcpy(wxBuffer, buf);
- return wxString(wxBuffer);
- }
+ buf += f;
+
+ return buf;
}
bool
struct stat stbuf;
#endif
- if ((filename != _T("")) && stat (FNSTRINGCAST filename.fn_str(), &stbuf) == 0)
+ if ((filename != T("")) && stat (wxFNSTRINGCAST filename.fn_str(), &stbuf) == 0)
return TRUE;
return FALSE;
#endif
bool
wxIsAbsolutePath (const wxString& filename)
{
- if (filename != _T(""))
+ if (filename != T(""))
{
- if (filename[0] == _T('/')
+ if (filename[0] == T('/')
#ifdef __VMS__
- || (filename[0] == _T('[') && filename[1] != _T('.'))
+ || (filename[0] == T('[') && filename[1] != T('.'))
#endif
#ifdef __WINDOWS__
/* MSDOS */
- || filename[0] == _T('\\') || (wxIsalpha (filename[0]) && filename[1] == _T(':'))
+ || filename[0] == T('\\') || (wxIsalpha (filename[0]) && filename[1] == T(':'))
#endif
)
return TRUE;
int i = len-1;
while (i > 0)
{
- if (buffer[i] == _T('.'))
+ if (buffer[i] == T('.'))
{
buffer[i] = 0;
break;
size_t i = len-1;
while (i > 0)
{
- if (buffer.GetChar(i) == _T('.'))
+ if (buffer.GetChar(i) == T('.'))
{
buffer = buffer.Left(i);
break;
wxChar *wxRealPath (wxChar *path)
{
#ifdef __WXMSW__
- static const wxChar SEP = _T('\\');
+ static const wxChar SEP = T('\\');
Unix2DosFilename(path);
#else
- static const wxChar SEP = _T('/');
+ static const wxChar SEP = T('/');
#endif
if (path[0] && path[1]) {
/* MATTHEW: special case "/./x" */
wxChar *p;
- if (path[2] == SEP && path[1] == _T('.'))
+ if (path[2] == SEP && path[1] == T('.'))
p = &path[0];
else
p = &path[2];
{
if (*p == SEP)
{
- if (p[1] == _T('.') && p[2] == _T('.') && (p[3] == SEP || p[3] == _T('\0')))
+ if (p[1] == T('.') && p[2] == T('.') && (p[3] == SEP || p[3] == T('\0')))
{
wxChar *q;
for (q = p - 1; q >= path && *q != SEP; q--);
- if (q[0] == SEP && (q[1] != _T('.') || q[2] != _T('.') || q[3] != SEP)
+ if (q[0] == SEP && (q[1] != T('.') || q[2] != T('.') || q[3] != SEP)
&& (q - 1 <= path || q[-1] != SEP))
{
wxStrcpy (q, p + 3);
- if (path[0] == _T('\0'))
+ if (path[0] == T('\0'))
{
path[0] = SEP;
- path[1] = _T('\0');
+ path[1] = T('\0');
}
#ifdef __WXMSW__
/* Check that path[2] is NULL! */
- else if (path[1] == _T(':') && !path[2])
+ else if (path[1] == T(':') && !path[2])
{
path[2] = SEP;
- path[3] = _T('\0');
+ path[3] = T('\0');
}
#endif
p = q - 1;
}
}
- else if (p[1] == _T('.') && (p[2] == SEP || p[2] == _T('\0')))
+ else if (p[1] == T('.') && (p[2] == SEP || p[2] == T('\0')))
wxStrcpy (p, p + 2);
}
}
// Must be destroyed
wxChar *wxCopyAbsolutePath(const wxString& filename)
{
- if (filename == _T(""))
+ if (filename == T(""))
return (wxChar *) NULL;
- if (! IsAbsolutePath(wxExpandPath(wxBuffer, filename))) {
+ if (! IsAbsolutePath(wxExpandPath(wxFileFunctionsBuffer, filename))) {
wxChar buf[_MAXPATHLEN];
- buf[0] = _T('\0');
+ buf[0] = T('\0');
wxGetWorkingDirectory(buf, WXSIZEOF(buf));
wxChar ch = buf[wxStrlen(buf) - 1];
#ifdef __WXMSW__
- if (ch != _T('\\') && ch != _T('/'))
- wxStrcat(buf, _T("\\"));
+ if (ch != T('\\') && ch != T('/'))
+ wxStrcat(buf, T("\\"));
#else
- if (ch != _T('/'))
- wxStrcat(buf, _T("/"));
+ if (ch != T('/'))
+ wxStrcat(buf, T("/"));
#endif
- wxStrcat(buf, wxBuffer);
+ wxStrcat(buf, wxFileFunctionsBuffer);
return copystring( wxRealPath(buf) );
}
- return copystring( wxBuffer );
+ return copystring( wxFileFunctionsBuffer );
}
/*-
int q;
// Some compilers don't like this line.
-// const wxChar trimchars[] = _T("\n \t");
+// const wxChar trimchars[] = T("\n \t");
wxChar trimchars[4];
- trimchars[0] = _T('\n');
- trimchars[1] = _T(' ');
- trimchars[2] = _T('\t');
+ trimchars[0] = T('\n');
+ trimchars[1] = T(' ');
+ trimchars[2] = T('\t');
trimchars[3] = 0;
#ifdef __WXMSW__
- const wxChar SEP = _T('\\');
+ const wxChar SEP = T('\\');
#else
- const wxChar SEP = _T('/');
+ const wxChar SEP = T('/');
#endif
- buf[0] = _T('\0');
- if (name == NULL || *name == _T('\0'))
+ buf[0] = T('\0');
+ if (name == NULL || *name == T('\0'))
return buf;
nm = copystring(name); // Make a scratch copy
wxChar *nm_tmp = nm;
/* And strip off trailing whitespace and cr */
s = nm + (q = wxStrlen(nm)) - 1;
while (q-- && wxStrchr((wxChar *)trimchars, *s) != NULL)
- *s = _T('\0');
+ *s = T('\0');
s = nm;
d = lnm;
#ifdef __WXMSW__
q = FALSE;
#else
- q = nm[0] == _T('\\') && nm[1] == _T('~');
+ q = nm[0] == T('\\') && nm[1] == T('~');
#endif
/* Expand inline environment variables */
while (*d)
{
*d++ = *s;
- if(*s == _T('\\'))
+ if(*s == T('\\'))
{
*(d - 1) = *++s;
if (*d)
#else
while ((*d++ = *s)) {
# ifndef __WXMSW__
- if (*s == _T('\\')) {
+ if (*s == T('\\')) {
if ((*(d - 1) = *++s)) {
s++;
continue;
# endif
#endif
#ifdef __WXMSW__
- if (*s++ == _T('$') && (*s == _T('{') || *s == _T(')')))
+ if (*s++ == T('$') && (*s == T('{') || *s == T(')')))
#else
- if (*s++ == _T('$'))
+ if (*s++ == T('$'))
#endif
{
register wxChar *start = d;
- register int braces = (*s == _T('{') || *s == _T('('));
+ register int braces = (*s == T('{') || *s == T('('));
register wxChar *value;
#ifdef __VISAGECPP__
// VA gives assignment in logical expr warning
#else
while ((*d++ = *s))
#endif
- if (braces ? (*s == _T('}') || *s == _T(')')) : !(wxIsalnum(*s) || *s == _T('_')) )
+ if (braces ? (*s == T('}') || *s == T(')')) : !(wxIsalnum(*s) || *s == T('_')) )
break;
else
s++;
/* Expand ~ and ~user */
nm = lnm;
- s = _T("");
- if (nm[0] == _T('~') && !q)
+ s = T("");
+ if (nm[0] == T('~') && !q)
{
/* prefix ~ */
if (nm[1] == SEP || nm[1] == 0)
{ /* ~/filename */
// FIXME: wxGetUserHome could return temporary storage in Unicode mode
- if ((s = WXSTRINGCAST wxGetUserHome(_T(""))) != NULL) {
+ if ((s = WXSTRINGCAST wxGetUserHome(T(""))) != NULL) {
if (*++nm)
nm++;
}
if ((home = WXSTRINGCAST wxGetUserHome(wxString(nm + 1))) == NULL) {
if (was_sep) /* replace only if it was there: */
*s = SEP;
- s = _T("");
+ s = T("");
} else {
nm = nnm;
s = home;
d = buf;
if (s && *s) { /* MATTHEW: s could be NULL if user '~' didn't exist */
/* Copy home dir */
- while (_T('\0') != (*d++ = *s++))
+ while (T('\0') != (*d++ = *s++))
/* loop */;
// Handle root home
if (d - 1 > buf && *(d - 2) != SEP)
{
static wxChar dest[_MAXPATHLEN];
- if (filename == _T(""))
+ if (filename == T(""))
return (wxChar *) NULL;
wxStrcpy (dest, WXSTRINGCAST filename);
if (envname != WXSTRINGCAST NULL && (val = wxGetenv (WXSTRINGCAST envname)) != NULL &&
(tcp = wxStrstr (dest, val)) != NULL)
{
- wxStrcpy (wxBuffer, tcp + wxStrlen (val));
- *tcp++ = _T('$');
- *tcp++ = _T('{');
+ wxStrcpy (wxFileFunctionsBuffer, tcp + wxStrlen (val));
+ *tcp++ = T('$');
+ *tcp++ = T('{');
wxStrcpy (tcp, WXSTRINGCAST envname);
- wxStrcat (tcp, _T("}"));
- wxStrcat (tcp, wxBuffer);
+ wxStrcat (tcp, T("}"));
+ wxStrcat (tcp, wxFileFunctionsBuffer);
}
// Handle User's home (ignore root homes!)
(len = wxStrlen(val)) > 2 &&
wxStrncmp(dest, val, len) == 0)
{
- wxStrcpy(wxBuffer, _T("~"));
- if (user != _T(""))
- wxStrcat(wxBuffer, (const wxChar*) user);
+ wxStrcpy(wxFileFunctionsBuffer, T("~"));
+ if (user != T(""))
+ wxStrcat(wxFileFunctionsBuffer, (const wxChar*) user);
#ifdef __WXMSW__
-// strcat(wxBuffer, "\\");
+// strcat(wxFileFunctionsBuffer, "\\");
#else
-// strcat(wxBuffer, "/");
+// strcat(wxFileFunctionsBuffer, "/");
#endif
- wxStrcat(wxBuffer, dest + len);
- wxStrcpy (dest, wxBuffer);
+ wxStrcat(wxFileFunctionsBuffer, dest + len);
+ wxStrcpy (dest, wxFileFunctionsBuffer);
}
return dest;
tcp = path + wxStrlen (path);
while (--tcp >= path)
{
- if (*tcp == _T('/') || *tcp == _T('\\')
+ if (*tcp == T('/') || *tcp == T('\\')
#ifdef __VMS__
- || *tcp == _T(':') || *tcp == _T(']'))
+ || *tcp == T(':') || *tcp == T(']'))
#else
)
#endif
return tcp + 1;
} /* while */
#if defined(__WXMSW__) || defined(__WXPM__)
- if (wxIsalpha (*path) && *(path + 1) == _T(':'))
+ if (wxIsalpha (*path) && *(path + 1) == T(':'))
return path + 2;
#endif
}
wxString wxFileNameFromPath (const wxString& path1)
{
- if (path1 != _T(""))
+ if (path1 != T(""))
{
wxChar *path = WXSTRINGCAST path1 ;
tcp = path + wxStrlen (path);
while (--tcp >= path)
{
- if (*tcp == _T('/') || *tcp == _T('\\')
+ if (*tcp == T('/') || *tcp == T('\\')
#ifdef __VMS__
- || *tcp == _T(':') || *tcp == _T(']'))
+ || *tcp == T(':') || *tcp == T(']'))
#else
)
#endif
return wxString(tcp + 1);
} /* while */
#if defined(__WXMSW__) || defined(__WXPM__)
- if (wxIsalpha (*path) && *(path + 1) == _T(':'))
+ if (wxIsalpha (*path) && *(path + 1) == T(':'))
return wxString(path + 2);
#endif
}
while (!done && i > -1)
{
// ] is for VMS
- if (path[i] == _T('/') || path[i] == _T('\\') || path[i] == _T(']'))
+ if (path[i] == T('/') || path[i] == T('\\') || path[i] == T(']'))
{
done = TRUE;
#ifdef __VMS__
#if defined(__WXMSW__) || defined(__WXPM__)
// Try Drive specifier
- if (wxIsalpha (buf[0]) && buf[1] == _T(':'))
+ if (wxIsalpha (buf[0]) && buf[1] == T(':'))
{
// A:junk --> A:. (since A:.\junk Not A:\junk)
- buf[2] = _T('.');
- buf[3] = _T('\0');
+ buf[2] = T('.');
+ buf[3] = T('\0');
return buf;
}
#endif
// Return just the directory, or NULL if no directory
wxString wxPathOnly (const wxString& path)
{
- if (path != _T(""))
+ if (path != T(""))
{
wxChar buf[_MAXPATHLEN];
while (!done && i > -1)
{
// ] is for VMS
- if (path[i] == _T('/') || path[i] == _T('\\') || path[i] == _T(']'))
+ if (path[i] == T('/') || path[i] == T('\\') || path[i] == T(']'))
{
done = TRUE;
#ifdef __VMS__
#if defined(__WXMSW__) || defined(__WXPM__)
// Try Drive specifier
- if (wxIsalpha (buf[0]) && buf[1] == _T(':'))
+ if (wxIsalpha (buf[0]) && buf[1] == T(':'))
{
// A:junk --> A:. (since A:.\junk Not A:\junk)
- buf[2] = _T('.');
- buf[3] = _T('\0');
+ buf[2] = T('.');
+ buf[3] = T('\0');
return wxString(buf);
}
#endif
}
- return wxString(_T(""));
+ return wxString(T(""));
}
// Utility for converting delimiters in DOS filenames to UNIX style
if (s)
{
memmove( s+1 , s ,(strlen( s ) + 1)*sizeof(wxChar)) ;
- if ( *s == _T(':') )
- *s = _T('.') ;
+ if ( *s == T(':') )
+ *s = T('.') ;
else
- *s = _T('/') ;
+ *s = T('/') ;
while (*s)
{
- if (*s == _T(':'))
- *s = _T('/');
+ if (*s == T(':'))
+ *s = T('/');
else
*s = wxTolower(*s); // Case INDEPENDENT
s++;
{
if (s)
{
- if ( *s == _T('.') )
+ if ( *s == T('.') )
{
// relative path , since it goes on with slash which is translated to a :
memmove( s , s+1 ,strlen( s )*sizeof(wxChar) ) ;
}
- else if ( *s == _T('/') )
+ else if ( *s == T('/') )
{
// absolute path -> on mac just start with the drive name
memmove( s , s+1 ,strlen( s )*sizeof(wxChar) ) ;
}
else
{
- wxASSERT_MSG( 1 , _T("unknown path beginning") ) ;
+ wxASSERT_MSG( 1 , T("unknown path beginning") ) ;
}
while (*s)
{
- if (*s == _T('/') || *s == _T('\\'))
- *s = _T(':');
+ if (*s == T('/') || *s == T('\\'))
+ *s = T(':');
s++ ;
}
if (s)
while (*s)
{
- if (*s == _T('\\'))
- *s = _T('/');
+ if (*s == T('\\'))
+ *s = T('/');
#if defined(__WXMSW__) || defined(__WXPM__)
else
*s = wxTolower(*s); // Case INDEPENDENT
if (s)
while (*s)
{
- if (*s == _T('/'))
- *s = _T('\\');
+ if (*s == T('/'))
+ *s = T('\\');
s++;
}
#endif
(fp2 = fopen (gwxMacFileName2, "rb")) == NULL ||
(fp3 = fopen (gwxMacFileName3, "wb")) == NULL)
#else
- if ((fp1 = fopen (FNSTRINGCAST file1.fn_str(), "rb")) == NULL ||
- (fp2 = fopen (FNSTRINGCAST file2.fn_str(), "rb")) == NULL ||
+ if ((fp1 = fopen (wxFNSTRINGCAST file1.fn_str(), "rb")) == NULL ||
+ (fp2 = fopen (wxFNSTRINGCAST file2.fn_str(), "rb")) == NULL ||
(fp3 = fopen (wxFNCONV(outfile), "wb")) == NULL)
#endif
{
return FALSE;
if ((fd2 = fopen (gwxMacFileName2, "wb")) == NULL)
#else
- if ((fd1 = fopen (FNSTRINGCAST file1.fn_str(), "rb")) == NULL)
+ if ((fd1 = fopen (wxFNSTRINGCAST file1.fn_str(), "rb")) == NULL)
return FALSE;
- if ((fd2 = fopen (FNSTRINGCAST file2.fn_str(), "wb")) == NULL)
+ if ((fd2 = fopen (wxFNSTRINGCAST file2.fn_str(), "wb")) == NULL)
#endif
{
fclose (fd1);
return TRUE;
#else
// Normal system call
- if (0 == rename (FNSTRINGCAST file1.fn_str(), FNSTRINGCAST file2.fn_str()))
+ if (0 == rename (wxFNSTRINGCAST file1.fn_str(), wxFNSTRINGCAST file2.fn_str()))
return TRUE;
#endif
// Try to copy
bool wxRemoveFile(const wxString& file)
{
#if defined(__VISUALC__) || defined(__BORLANDC__) || defined(__WATCOMC__)
- int flag = remove(FNSTRINGCAST file.fn_str());
+ int flag = remove(wxFNSTRINGCAST file.fn_str());
#elif defined( __WXMAC__ )
wxStrcpy( gwxMacFileName , file ) ;
wxUnix2MacFilename( gwxMacFileName ) ;
int flag = unlink(gwxMacFileName);
#else
- int flag = unlink(FNSTRINGCAST file.fn_str());
+ int flag = unlink(wxFNSTRINGCAST file.fn_str());
#endif
return (flag == 0) ;
}
#if (!(defined(__WXMSW__) || defined(__WXPM__))) || (defined(__GNUWIN32__) && !defined(__MINGW32__)) || defined(__WXWINE__)
if ( mkdir(wxFNCONV(dirname), perm) != 0 )
#else // MSW and OS/2
- if ( mkdir(FNSTRINGCAST wxFNCONV(dirname)) != 0 )
+ if ( mkdir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 )
#endif // !MSW/MSW
{
wxLogSysError(_("Directory '%s' couldn't be created"), dirname);
#ifdef __SALFORDC__
return FALSE; // What to do?
#else
- return (rmdir(FNSTRINGCAST dir.fn_str()) == 0);
+ return (rmdir(wxFNSTRINGCAST dir.fn_str()) == 0);
#endif
#endif
/* Windows API returns -1 from stat for "c:\dir\" if "c:\dir" exists
* OTOH, we should change "d:" to "d:\" and leave "\" as is. */
wxString strPath(pszPathName);
- if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != _T('\0') )
- strPath.Last() = _T('\0');
+ if ( wxEndsWithPathSeparator(pszPathName) && pszPathName[1] != T('\0') )
+ strPath.Last() = T('\0');
#ifdef __SALFORDC__
struct _stat st;
struct stat st;
#endif
- return stat(FNSTRINGCAST strPath.fn_str(), &st) == 0 && (st.st_mode & S_IFDIR);
+ return stat(wxFNSTRINGCAST strPath.fn_str(), &st) == 0 && (st.st_mode & S_IFDIR);
}
// Get a temporary filename, opening and closing the file.
for (short suffix = last_temp + 1; suffix != last_temp; ++suffix %= 1000)
{
- wxSprintf (tmp, _T("/tmp/%s%d.%03x"), WXSTRINGCAST prefix, (int) getpid (), (int) suffix);
+ wxSprintf (tmp, T("/tmp/%s%d.%03x"), WXSTRINGCAST prefix, (int) getpid (), (int) suffix);
if (!wxFileExists( tmp ))
{
// Touch the file to create it (reserve name)
wxString path(wxPathOnly(gs_strFileSpec));
// special case: path is really "/"
- if ( !path && gs_strFileSpec[0u] == _T('/') )
- path = _T('/');
+ if ( !path && gs_strFileSpec[0u] == T('/') )
+ path = T('/');
// path is empty => Local directory
if ( !path )
- path = _T('.');
+ path = T('.');
gs_dirStream = opendir(path.fn_str());
if ( !gs_dirStream )
wxString result;
#ifndef __VMS__
- wxCHECK_MSG( gs_dirStream, result, _T("must call wxFindFirstFile first") );
+ wxCHECK_MSG( gs_dirStream, result, T("must call wxFindFirstFile first") );
// Find path only so we can concatenate
// found file onto path
wxString name(wxFileNameFromPath(gs_strFileSpec));
/* MATTHEW: special case: path is really "/" */
- if ( !path && gs_strFileSpec[0u] == _T('/'))
- path = _T('/');
+ if ( !path && gs_strFileSpec[0u] == T('/'))
+ path = T('/');
// Do the reading
struct dirent *nextDir;
if ( !path.IsEmpty() )
{
result = path;
- if ( path != _T('/') )
- result += _T('/');
+ if ( path != T('/') )
+ result += T('/');
}
result += nextDir->d_name;
// Find path only so we can concatenate found file onto path
wxString path(wxPathOnly(gs_strFileSpec));
if ( !path.IsEmpty() )
- result << path << _T('\\');
+ result << path << T('\\');
#ifdef __WIN32__
if ( gs_hFileStruct != INVALID_HANDLE_VALUE )
goto try_again;
if ( !path.IsEmpty() )
- result << path << _T('\\');
+ result << path << T('\\');
result << gs_findDataStruct.cFileName;
}
if (getcwd(buf, sz) == NULL) {
#endif
#endif
- buf[0] = _T('.');
- buf[1] = _T('\0');
+ buf[0] = T('.');
+ buf[1] = T('\0');
}
#if wxUSE_UNICODE
else {
bool wxSetWorkingDirectory(const wxString& d)
{
#if defined( __UNIX__ ) || defined( __WXMAC__ ) || defined(__WXPM__)
- return (chdir(FNSTRINGCAST d.fn_str()) == 0);
+ return (chdir(wxFNSTRINGCAST d.fn_str()) == 0);
#elif defined(__WINDOWS__)
#ifdef __WIN32__
wxString *pstrExt)
{
// it can be empty, but it shouldn't be NULL
- wxCHECK_RET( pszFileName, _T("NULL file name in wxSplitPath") );
+ wxCHECK_RET( pszFileName, T("NULL file name in wxSplitPath") );
const wxChar *pDot = wxStrrchr(pszFileName, wxFILE_SEP_EXT);
wxChar *pat = WXSTRINGCAST(tmp);
while (*pat) {
switch (*pat++) {
- case _T('?'): case _T('*'): case _T('['): case _T('{'):
+ case T('?'): case T('*'): case T('['): case T('{'):
return TRUE;
- case _T('\\'):
+ case T('\\'):
if (!*pat++)
return FALSE;
}
wxChar *cp;
bool done = FALSE, ret_code, ok;
// Below is for vi fans
- const wxChar OB = _T('{'), CB = _T('}');
+ const wxChar OB = T('{'), CB = T('}');
// dot_special means '.' only matches '.'
- if (dot_special && *str == _T('.') && *pattern != *str)
+ if (dot_special && *str == T('.') && *pattern != *str)
return FALSE;
- while ((*pattern != _T('\0')) && (!done)
- && (((*str==_T('\0'))&&((*pattern==OB)||(*pattern==_T('*'))))||(*str!=_T('\0')))) {
+ while ((*pattern != T('\0')) && (!done)
+ && (((*str==T('\0'))&&((*pattern==OB)||(*pattern==T('*'))))||(*str!=T('\0')))) {
switch (*pattern) {
- case _T('\\'):
+ case T('\\'):
pattern++;
- if (*pattern != _T('\0'))
+ if (*pattern != T('\0'))
pattern++;
break;
- case _T('*'):
+ case T('*'):
pattern++;
ret_code = FALSE;
- while ((*str!=_T('\0'))
+ while ((*str!=T('\0'))
&& (!(ret_code=wxMatchWild(pattern, str++, FALSE))))
/*loop*/;
if (ret_code) {
- while (*str != _T('\0'))
+ while (*str != T('\0'))
str++;
- while (*pattern != _T('\0'))
+ while (*pattern != T('\0'))
pattern++;
}
break;
- case _T('['):
+ case T('['):
pattern++;
repeat:
- if ((*pattern == _T('\0')) || (*pattern == _T(']'))) {
+ if ((*pattern == T('\0')) || (*pattern == T(']'))) {
done = TRUE;
break;
}
- if (*pattern == _T('\\')) {
+ if (*pattern == T('\\')) {
pattern++;
- if (*pattern == _T('\0')) {
+ if (*pattern == T('\0')) {
done = TRUE;
break;
}
}
- if (*(pattern + 1) == _T('-')) {
+ if (*(pattern + 1) == T('-')) {
c = *pattern;
pattern += 2;
- if (*pattern == _T(']')) {
+ if (*pattern == T(']')) {
done = TRUE;
break;
}
- if (*pattern == _T('\\')) {
+ if (*pattern == T('\\')) {
pattern++;
- if (*pattern == _T('\0')) {
+ if (*pattern == T('\0')) {
done = TRUE;
break;
}
goto repeat;
}
pattern++;
- while ((*pattern != _T(']')) && (*pattern != _T('\0'))) {
- if ((*pattern == _T('\\')) && (*(pattern + 1) != _T('\0')))
+ while ((*pattern != T(']')) && (*pattern != T('\0'))) {
+ if ((*pattern == T('\\')) && (*(pattern + 1) != T('\0')))
pattern++;
pattern++;
}
- if (*pattern != _T('\0')) {
+ if (*pattern != T('\0')) {
pattern++, str++;
}
break;
- case _T('?'):
+ case T('?'):
pattern++;
str++;
break;
case OB:
pattern++;
- while ((*pattern != CB) && (*pattern != _T('\0'))) {
+ while ((*pattern != CB) && (*pattern != T('\0'))) {
cp = str;
ok = TRUE;
- while (ok && (*cp != _T('\0')) && (*pattern != _T('\0'))
- && (*pattern != _T(',')) && (*pattern != CB)) {
- if (*pattern == _T('\\'))
+ while (ok && (*cp != T('\0')) && (*pattern != T('\0'))
+ && (*pattern != T(',')) && (*pattern != CB)) {
+ if (*pattern == T('\\'))
pattern++;
ok = (*pattern++ == *cp++);
}
- if (*pattern == _T('\0')) {
+ if (*pattern == T('\0')) {
ok = FALSE;
done = TRUE;
break;
} else if (ok) {
str = cp;
- while ((*pattern != CB) && (*pattern != _T('\0'))) {
- if (*++pattern == _T('\\')) {
+ while ((*pattern != CB) && (*pattern != T('\0'))) {
+ if (*++pattern == T('\\')) {
if (*++pattern == CB)
pattern++;
}
}
} else {
- while (*pattern!=CB && *pattern!=_T(',') && *pattern!=_T('\0')) {
- if (*++pattern == _T('\\')) {
- if (*++pattern == CB || *pattern == _T(','))
+ while (*pattern!=CB && *pattern!=T(',') && *pattern!=T('\0')) {
+ if (*++pattern == T('\\')) {
+ if (*++pattern == CB || *pattern == T(','))
pattern++;
}
}
}
- if (*pattern != _T('\0'))
+ if (*pattern != T('\0'))
pattern++;
}
break;
}
}
}
- while (*pattern == _T('*'))
+ while (*pattern == T('*'))
pattern++;
- return ((*str == _T('\0')) && (*pattern == _T('\0')));
+ return ((*str == T('\0')) && (*pattern == T('\0')));
};
#endif
l2 = l;
for (int i = l-1; i >= 0; i--) {
c = loc[(unsigned int) i];
- if (c == _T('#')) l2 = i + 1;
- if (c == _T('.')) {ext = loc.Right(l2-i-1); break;}
- if ((c == _T('/')) || (c == _T('\\')) || (c == _T(':'))) {return wxEmptyString;}
+ if (c == T('#')) l2 = i + 1;
+ if (c == T('.')) {ext = loc.Right(l2-i-1); break;}
+ if ((c == T('/')) || (c == T('\\')) || (c == T(':'))) {return wxEmptyString;}
}
if (m_MimeMng == NULL) {
bool fnd;
fnd = FALSE;
- for (i = l-1; (i >= 0) && ((location[i] != _T('#')) || (!fnd)); i--) {
- if ((location[i] == _T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
+ for (i = l-1; (i >= 0) && ((location[i] != T('#')) || (!fnd)); i--) {
+ if ((location[i] == T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
}
- if (!fnd) return _T("file");
- for (++i; (i < l) && (location[i] != _T(':')); i++) s << location[i];
+ if (!fnd) return T("file");
+ for (++i; (i < l) && (location[i] != T(':')); i++) s << location[i];
return s;
}
fnd = FALSE;
for (i = location.Length()-1; i >= 0; i--) {
- if ((location[i] == _T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
- else if (fnd && (location[i] == _T('#'))) return location.Left(i);
+ if ((location[i] == T(':')) && (i != 1 /*win: C:\path*/)) fnd = TRUE;
+ else if (fnd && (location[i] == T('#'))) return location.Left(i);
}
return wxEmptyString;
}
{
int i, l = location.Length();
int l2 = l + 1;
- for (i = l-1; (i >= 0) && ((location[i] != _T(':')) || (i == 1) || (location[i-2] == _T(':'))); i--) {if (location[i] == _T('#')) l2 = i + 1;}
+ for (i = l-1; (i >= 0) && ((location[i] != T(':')) || (i == 1) || (location[i-2] == T(':'))); i--) {if (location[i] == T('#')) l2 = i + 1;}
if (i == 0) return wxEmptyString;
else return location.Mid(i + 1, l2 - i - 2);
}
for (int i = l-1; i >= 0; i--) {
c = location[i];
- if (c == _T('#')) return location.Right(l-i-1);
- else if ((c == _T('.')) || (c == _T('/')) || (c == _T('\\')) || (c == _T(':'))) return wxEmptyString;
+ if (c == T('#')) return location.Right(l-i-1);
+ else if ((c == T('.')) || (c == T('/')) || (c == T('\\')) || (c == T(':'))) return wxEmptyString;
}
return wxEmptyString;
}
bool wxLocalFSHandler::CanOpen(const wxString& location)
{
- return GetProtocol(location) == _T("file");
+ return GetProtocol(location) == T("file");
}
wxFSFile* wxLocalFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
m_Path = location;
for (i = m_Path.Length()-1; i >= 0; i--)
- if (m_Path[(unsigned int) i] == _T('\\')) m_Path.GetWritableChar(i) = _T('/'); // wanna be windows-safe
+ if (m_Path[(unsigned int) i] == T('\\')) m_Path.GetWritableChar(i) = T('/'); // wanna be windows-safe
if (is_dir == FALSE)
{
for (i = m_Path.Length()-1; i >= 0; i--)
{
- if (m_Path[(unsigned int) i] == _T('/'))
+ if (m_Path[(unsigned int) i] == T('/'))
{
- if ((i > 1) && (m_Path[(unsigned int) (i-1)] == _T('/')) && (m_Path[(unsigned int) (i-2)] == _T(':')))
+ if ((i > 1) && (m_Path[(unsigned int) (i-1)] == T('/')) && (m_Path[(unsigned int) (i-2)] == T(':')))
{
i -= 2;
continue;
break;
}
}
- else if (m_Path[(unsigned int) i] == _T(':')) {
+ else if (m_Path[(unsigned int) i] == T(':')) {
pathpos = i;
break;
}
{
for (i = 0; i < (int) m_Path.Length(); i++)
{
- if (m_Path[(unsigned int) i] == _T(':'))
+ if (m_Path[(unsigned int) i] == T(':'))
{
- //m_Path << _T('/');
+ //m_Path << T('/');
m_Path.Remove(i+1);
break;
}
}
else
{
- if (m_Path[m_Path.Length()-1] != _T('/'))
- m_Path << _T('/');
+ if (m_Path[m_Path.Length()-1] != T('/'))
+ m_Path << T('/');
m_Path.Remove(pathpos+1);
}
}
meta = 0;
for (i = 0; i < ln; i++)
{
- if (loc[(unsigned int) i] == _T('\\')) loc.GetWritableChar(i) = _T('/'); // wanna be windows-safe
+ if (loc[(unsigned int) i] == T('\\')) loc.GetWritableChar(i) = T('/'); // wanna be windows-safe
if (!meta) switch (loc[(unsigned int) i])
{
- case _T('/') : case _T(':') : case _T('#') : meta = loc[(unsigned int) i];
+ case T('/') : case T(':') : case T('#') : meta = loc[(unsigned int) i];
}
}
m_LastName = wxEmptyString;
// try relative paths first :
- if (meta != _T(':'))
+ if (meta != T(':'))
{
node = m_Handlers.GetFirst();
while (node)
wxString wxFontBase::GetFamilyString() const
{
- wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
+ wxCHECK_MSG( Ok(), T("wxDEFAULT("), T("invalid font") );
switch ( GetFamily() )
{
- case wxDECORATIVE: return _T("wxDECORATIVE");
- case wxROMAN: return _T("wxROMAN");
- case wxSCRIPT: return _T("wxSCRIPT");
- case wxSWISS: return _T("wxSWISS");
- case wxMODERN: return _T("wxMODERN");
- case wxTELETYPE: return _T("wxTELETYPE");
- default: return _T("wxDEFAULT");
+ case wxDECORATIVE: return T("wxDECORATIVE");
+ case wxROMAN: return T("wxROMAN");
+ case wxSCRIPT: return T("wxSCRIPT(");
+ case wxSWISS: return T("wxSWISS");
+ case wxMODERN: return T("wxMODERN");
+ case wxTELETYPE: return T("wxTELETYPE");
+ default: return T("wxDEFAULT(");
}
}
wxString wxFontBase::GetStyleString() const
{
- wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
+ wxCHECK_MSG( Ok(), T("wxDEFAULT("), T("invalid font") );
switch ( GetStyle() )
{
- case wxNORMAL: return _T("wxNORMAL");
- case wxSLANT: return _T("wxSLANT");
- case wxITALIC: return _T("wxITALIC");
- default: return _T("wxDEFAULT");
+ case wxNORMAL: return T("wxNORMAL");
+ case wxSLANT: return T("wxSLANT(");
+ case wxITALIC: return T("wxITALIC");
+ default: return T("wxDEFAULT(");
}
}
wxString wxFontBase::GetWeightString() const
{
- wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
+ wxCHECK_MSG( Ok(), T("wxDEFAULT("), T("invalid font") );
switch ( GetWeight() )
{
- case wxNORMAL: return _T("wxNORMAL");
- case wxBOLD: return _T("wxBOLD");
- case wxLIGHT: return _T("wxLIGHT");
- default: return _T("wxDEFAULT");
+ case wxNORMAL: return T("wxNORMAL");
+ case wxBOLD: return T("wxBOLD");
+ case wxLIGHT: return T("wxLIGHT(");
+ default: return T("wxDEFAULT(");
}
}
bool wxInternetFSHandler::CanOpen(const wxString& location)
{
wxString p = GetProtocol(location);
- return (p == _T("http")) || (p == _T("ftp"));
+ return (p == T("http")) || (p == T("ftp"));
}
wxFSFile* wxInternetFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString& location)
{
- wxString right = GetProtocol(location) + _T(":") + GetRightLocation(location);
+ wxString right = GetProtocol(location) + T(":") + GetRightLocation(location);
wxInputStream *s;
wxString content;
wxInetCacheNode *info;
{
wxChar buf[256];
- wxGetTempFileName( _T("wxhtml"), buf);
+ wxGetTempFileName( T("wxhtml"), buf);
info = new wxInetCacheNode(buf, content);
m_Cache.Put(right, info);
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxFTP, wxProtocol)
-IMPLEMENT_PROTOCOL(wxFTP, _T("ftp"), _T("ftp"), TRUE)
+IMPLEMENT_PROTOCOL(wxFTP, T("ftp"), T("ftp"), TRUE)
#endif
////////////////////////////////////////////////////////////////
m_lastError = wxPROTO_NOERR;
m_streaming = FALSE;
- m_user = _T("anonymous");
+ m_user = T("anonymous");
m_passwd = wxGetUserId();
m_passwd += '@';
m_passwd += wxGetHostName();
wxFTP::~wxFTP()
{
- SendCommand("QUIT", '2');
+ SendCommand("QUIT(", '2');
}
////////////////////////////////////////////////////////////////
return FALSE;
}
- command.sprintf(_T("USER %s"), (const wxChar *)m_user);
+ command.sprintf(T("USER %s"), (const wxChar *)m_user);
if (!SendCommand(command, '3')) {
Close();
return FALSE;
}
- command.sprintf(_T("PASS %s"), (const wxChar *)m_passwd);
+ command.sprintf(T("PASS %s"), (const wxChar *)m_passwd);
if (!SendCommand(command, '2')) {
Close();
return FALSE;
wxString my_host = host;
addr.Hostname(my_host);
- addr.Service(_T("ftp"));
+ addr.Service(T("ftp"));
return Connect(addr);
}
return FALSE;
}
if (m_connected)
- SendCommand(wxString(_T("QUIT")), '2');
+ SendCommand(wxString(T("QUIT(")), '2');
return wxSocketClient::Close();
}
m_lastError = wxPROTO_STREAMING;
return FALSE;
}
- tmp_str = command + _T("\r\n");
+ tmp_str = command + T("\r\n");
const wxWX2MBbuf tmp_buf = tmp_str.mb_str();
- if (Write(MBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) {
+ if (Write(wxMBSTRINGCAST tmp_buf, strlen(tmp_buf)).Error()) {
m_lastError = wxPROTO_NETERR;
return FALSE;
}
if (m_lastResult.GetChar(3) == '-') {
wxString key = m_lastResult.Left((size_t)3);
- key += _T(' ');
+ key += T(' ');
while (m_lastResult.Index(key) != 0) {
m_lastError = GetLine(this, m_lastResult);
{
wxString str = dir;
- str.Prepend(_T("CWD "));
+ str.Prepend(T("CWD "));
return SendCommand(str, '2');
}
bool wxFTP::MkDir(const wxString& dir)
{
wxString str = dir;
- str.Prepend(_T("MKD "));
+ str.Prepend(T("MKD "));
return SendCommand(str, '2');
}
{
wxString str = dir;
- str.Prepend(_T("PWD "));
+ str.Prepend(T("PWD "));
return SendCommand(str, '2');
}
{
int beg, end;
- if (!SendCommand(_T("PWD"), '2'))
+ if (!SendCommand(T("PWD"), '2'))
return wxString((char *)NULL);
- beg = m_lastResult.Find(_T('\"'),FALSE);
- end = m_lastResult.Find(_T('\"'),TRUE);
+ beg = m_lastResult.Find(T('\"'),FALSE);
+ end = m_lastResult.Find(T('\"'),TRUE);
return wxString(beg+1, end);
}
{
wxString str;
- str = _T("RNFR ") + src;
+ str = T("RNFR ") + src;
if (!SendCommand(str, '3'))
return FALSE;
- str = _T("RNTO ") + dst;
+ str = T("RNTO ") + dst;
return SendCommand(str, '2');
}
{
wxString str;
- str = _T("DELE ");
+ str = T("DELE ");
str += path;
return SendCommand(str, '2');
}
wxUint16 port;
wxUint32 hostaddr;
- if (!SendCommand(_T("PASV"), '2'))
+ if (!SendCommand(T("PASV"), '2'))
return NULL;
- addr_pos = m_lastResult.Find(_T('('));
+ addr_pos = m_lastResult.Find(T('('));
if (addr_pos == -1) {
m_lastError = wxPROTO_PROTERR;
return NULL;
}
straddr = m_lastResult(addr_pos+1, m_lastResult.Length());
- wxSscanf((const wxChar *)straddr,_T("%d,%d,%d,%d,%d,%d"),&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]);
+ wxSscanf((const wxChar *)straddr,T("%d,%d,%d,%d,%d,%d"),&a[2],&a[3],&a[4],&a[5],&a[0],&a[1]);
hostaddr = (wxUint16)a[5] << 24 | (wxUint16)a[4] << 16 |
(wxUint16)a[3] << 8 | a[2];
bool wxFTP::Abort(void)
{
m_streaming = FALSE;
- if (!SendCommand(_T("ABOR"), '4'))
+ if (!SendCommand(T("ABOR"), '4'))
return FALSE;
return GetResult('2');
}
int pos_size;
wxInputFTPStream *in_stream;
- if (!SendCommand(_T("TYPE I"), '2'))
+ if (!SendCommand(T("TYPE I"), '2'))
return NULL;
wxSocketClient *sock = GetPort();
return NULL;
}
- tmp_str = _T("RETR ") + wxURL::ConvertFromURI(path);
+ tmp_str = T("RETR ") + wxURL::ConvertFromURI(path);
if (!SendCommand(tmp_str, '1'))
return NULL;
in_stream = new wxInputFTPStream(this, sock);
- pos_size = m_lastResult.Index(_T('('));
+ pos_size = m_lastResult.Index(T('('));
if (pos_size != wxNOT_FOUND) {
- wxString str_size = m_lastResult(pos_size+1, m_lastResult.Index(_T(')'))-1);
+ wxString str_size = m_lastResult(pos_size+1, m_lastResult.Index(T(')'))-1);
in_stream->m_ftpsize = wxAtoi(WXSTRINGCAST str_size);
}
{
wxString tmp_str;
- if (!SendCommand(_T("TYPE I"), '2'))
+ if (!SendCommand(T("TYPE I"), '2'))
return NULL;
wxSocketClient *sock = GetPort();
- tmp_str = _T("STOR ") + path;
+ tmp_str = T("STOR ") + path;
if (!SendCommand(tmp_str, '1'))
return FALSE;
{
wxList *file_list = new wxList;
wxSocketBase *sock = GetPort();
- wxString tmp_str = _T("NLST");
+ wxString tmp_str = T("NLST(");
if (!wildcard.IsNull())
tmp_str += wildcard;
static cdef table[]={
// #ifdef __WXMSW__
- {_T("AQUAMARINE"),112, 219, 147},
- {_T("BLACK"),0, 0, 0},
- {_T("BLUE"), 0, 0, 255},
- {_T("BLUE VIOLET"), 159, 95, 159},
- {_T("BROWN"), 165, 42, 42},
- {_T("CADET BLUE"), 95, 159, 159},
- {_T("CORAL"), 255, 127, 0},
- {_T("CORNFLOWER BLUE"), 66, 66, 111},
- {_T("CYAN"), 0, 255, 255},
- {_T("DARK GREY"), 47, 47, 47}, // ?
-
- {_T("DARK GREEN"), 47, 79, 47},
- {_T("DARK OLIVE GREEN"), 79, 79, 47},
- {_T("DARK ORCHID"), 153, 50, 204},
- {_T("DARK SLATE BLUE"), 107, 35, 142},
- {_T("DARK SLATE GREY"), 47, 79, 79},
- {_T("DARK TURQUOISE"), 112, 147, 219},
- {_T("DIM GREY"), 84, 84, 84},
- {_T("FIREBRICK"), 142, 35, 35},
- {_T("FOREST GREEN"), 35, 142, 35},
- {_T("GOLD"), 204, 127, 50},
- {_T("GOLDENROD"), 219, 219, 112},
- {_T("GREY"), 128, 128, 128},
- {_T("GREEN"), 0, 255, 0},
- {_T("GREEN YELLOW"), 147, 219, 112},
- {_T("INDIAN RED"), 79, 47, 47},
- {_T("KHAKI"), 159, 159, 95},
- {_T("LIGHT BLUE"), 191, 216, 216},
- {_T("LIGHT GREY"), 192, 192, 192},
- {_T("LIGHT STEEL BLUE"), 143, 143, 188},
- {_T("LIME GREEN"), 50, 204, 50},
- {_T("LIGHT MAGENTA"), 255, 0, 255},
- {_T("MAGENTA"), 255, 0, 255},
- {_T("MAROON"), 142, 35, 107},
- {_T("MEDIUM AQUAMARINE"), 50, 204, 153},
- {_T("MEDIUM GREY"), 100, 100, 100},
- {_T("MEDIUM BLUE"), 50, 50, 204},
- {_T("MEDIUM FOREST GREEN"), 107, 142, 35},
- {_T("MEDIUM GOLDENROD"), 234, 234, 173},
- {_T("MEDIUM ORCHID"), 147, 112, 219},
- {_T("MEDIUM SEA GREEN"), 66, 111, 66},
- {_T("MEDIUM SLATE BLUE"), 127, 0, 255},
- {_T("MEDIUM SPRING GREEN"), 127, 255, 0},
- {_T("MEDIUM TURQUOISE"), 112, 219, 219},
- {_T("MEDIUM VIOLET RED"), 219, 112, 147},
- {_T("MIDNIGHT BLUE"), 47, 47, 79},
- {_T("NAVY"), 35, 35, 142},
- {_T("ORANGE"), 204, 50, 50},
- {_T("ORANGE RED"), 255, 0, 127},
- {_T("ORCHID"), 219, 112, 219},
- {_T("PALE GREEN"), 143, 188, 143},
- {_T("PINK"), 188, 143, 234},
- {_T("PLUM"), 234, 173, 234},
- {_T("PURPLE"), 176, 0, 255},
- {_T("RED"), 255, 0, 0},
- {_T("SALMON"), 111, 66, 66},
- {_T("SEA GREEN"), 35, 142, 107},
- {_T("SIENNA"), 142, 107, 35},
- {_T("SKY BLUE"), 50, 153, 204},
- {_T("SLATE BLUE"), 0, 127, 255},
- {_T("SPRING GREEN"), 0, 255, 127},
- {_T("STEEL BLUE"), 35, 107, 142},
- {_T("TAN"), 219, 147, 112},
- {_T("THISTLE"), 216, 191, 216},
- {_T("TURQUOISE"), 173, 234, 234},
- {_T("VIOLET"), 79, 47, 79},
- {_T("VIOLET RED"), 204, 50, 153},
- {_T("WHEAT"), 216, 216, 191},
- {_T("WHITE"), 255, 255, 255},
- {_T("YELLOW"), 255, 255, 0},
- {_T("YELLOW GREEN"), 153, 204, 50},
+ {T("AQUAMARINE"),112, 219, 147},
+ {T("BLACK"),0, 0, 0},
+ {T("BLUE"), 0, 0, 255},
+ {T("BLUE VIOLET("), 159, 95, 159},
+ {T("BROWN"), 165, 42, 42},
+ {T("CADET BLUE"), 95, 159, 159},
+ {T("CORAL"), 255, 127, 0},
+ {T("CORNFLOWER BLUE"), 66, 66, 111},
+ {T("CYAN"), 0, 255, 255},
+ {T("DARK GREY"), 47, 47, 47}, // ?
+
+ {T("DARK GREEN"), 47, 79, 47},
+ {T("DARK OLIVE GREEN"), 79, 79, 47},
+ {T("DARK ORCHID"), 153, 50, 204},
+ {T("DARK SLATE BLUE"), 107, 35, 142},
+ {T("DARK SLATE GREY"), 47, 79, 79},
+ {T("DARK TURQUOISE"), 112, 147, 219},
+ {T("DIM GREY"), 84, 84, 84},
+ {T("FIREBRICK"), 142, 35, 35},
+ {T("FOREST GREEN"), 35, 142, 35},
+ {T("GOLD"), 204, 127, 50},
+ {T("GOLDENROD"), 219, 219, 112},
+ {T("GREY"), 128, 128, 128},
+ {T("GREEN"), 0, 255, 0},
+ {T("GREEN YELLOW"), 147, 219, 112},
+ {T("INDIAN RED"), 79, 47, 47},
+ {T("KHAKI"), 159, 159, 95},
+ {T("LIGHT BLUE"), 191, 216, 216},
+ {T("LIGHT GREY"), 192, 192, 192},
+ {T("LIGHT STEEL BLUE"), 143, 143, 188},
+ {T("LIME GREEN"), 50, 204, 50},
+ {T("LIGHT MAGENTA"), 255, 0, 255},
+ {T("MAGENTA"), 255, 0, 255},
+ {T("MAROON"), 142, 35, 107},
+ {T("MEDIUM AQUAMARINE"), 50, 204, 153},
+ {T("MEDIUM GREY"), 100, 100, 100},
+ {T("MEDIUM BLUE"), 50, 50, 204},
+ {T("MEDIUM FOREST GREEN"), 107, 142, 35},
+ {T("MEDIUM GOLDENROD"), 234, 234, 173},
+ {T("MEDIUM ORCHID"), 147, 112, 219},
+ {T("MEDIUM SEA GREEN"), 66, 111, 66},
+ {T("MEDIUM SLATE BLUE"), 127, 0, 255},
+ {T("MEDIUM SPRING GREEN"), 127, 255, 0},
+ {T("MEDIUM TURQUOISE"), 112, 219, 219},
+ {T("MEDIUM VIOLET RED"), 219, 112, 147},
+ {T("MIDNIGHT BLUE"), 47, 47, 79},
+ {T("NAVY"), 35, 35, 142},
+ {T("ORANGE"), 204, 50, 50},
+ {T("ORANGE RED"), 255, 0, 127},
+ {T("ORCHID"), 219, 112, 219},
+ {T("PALE GREEN"), 143, 188, 143},
+ {T("PINK"), 188, 143, 234},
+ {T("PLUM"), 234, 173, 234},
+ {T("PURPLE"), 176, 0, 255},
+ {T("RED"), 255, 0, 0},
+ {T("SALMON"), 111, 66, 66},
+ {T("SEA GREEN"), 35, 142, 107},
+ {T("SIENNA"), 142, 107, 35},
+ {T("SKY BLUE"), 50, 153, 204},
+ {T("SLATE BLUE"), 0, 127, 255},
+ {T("SPRING GREEN"), 0, 255, 127},
+ {T("STEEL BLUE"), 35, 107, 142},
+ {T("TAN"), 219, 147, 112},
+ {T("THISTLE"), 216, 191, 216},
+ {T("TURQUOISE"), 173, 234, 234},
+ {T("VIOLET("), 79, 47, 79},
+ {T("VIOLET RED"), 204, 50, 153},
+ {T("WHEAT("), 216, 216, 191},
+ {T("WHITE"), 255, 255, 255},
+ {T("YELLOW"), 255, 255, 0},
+ {T("YELLOW GREEN"), 153, 204, 50},
// #endif
#if defined(__WXGTK__) || defined(__X__)
- {_T("MEDIUM GOLDENROD"), 234, 234, 173},
- {_T("MEDIUM FOREST GREEN"), 107, 142, 35},
- {_T("LIGHT MAGENTA"), 255, 0, 255},
- {_T("MEDIUM GREY"), 100, 100, 100},
+ {T("MEDIUM GOLDENROD"), 234, 234, 173},
+ {T("MEDIUM FOREST GREEN"), 107, 142, 35},
+ {T("LIGHT MAGENTA"), 255, 0, 255},
+ {T("MEDIUM GREY"), 100, 100, 100},
#endif
{0,0,0,0}
#else
each_font->GetFamily() == FamilyOrFontId &&
#endif
- ((each_font->GetFaceName() == _T("")) || each_font->GetFaceName() == Face))
+ ((each_font->GetFaceName() == T("")) || each_font->GetFaceName() == Face))
//#endif
return each_font;
}
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxHTTP, wxProtocol)
-IMPLEMENT_PROTOCOL(wxHTTP, _T("http"), _T("80"), TRUE)
+IMPLEMENT_PROTOCOL(wxHTTP, T("http"), T("80"), TRUE)
#endif
#define HTTP_BSIZE 2048
wxString wxHTTP::GetContentType()
{
- return GetHeader(_T("Content-Type"));
+ return GetHeader(T("Content-Type"));
}
void wxHTTP::SetProxyMode(bool on)
wxString *str = (wxString *)head->Data();
wxString buf;
- buf.Printf(_T("%s: %s\n\r"), head->GetKeyString(), str->GetData());
+ buf.Printf(T("%s: %s\n\r"), head->GetKeyString(), str->GetData());
const wxWX2MBbuf cbuf = buf.mb_str();
Write(cbuf, strlen(cbuf));
return FALSE;
}
- if (!addr->Service(_T("http")))
+ if (!addr->Service(T("http")))
addr->Service(80);
return TRUE;
wxString tmp_str = path;
// If there is no User-Agent defined, define it.
- if (GetHeader(_T("User-Agent")).IsNull())
- SetHeader(_T("User-Agent"), _T("wxWindows 2.x"));
+ if (GetHeader(T("User-Agent")).IsNull())
+ SetHeader(T("User-Agent"), T("wxWindows 2.x"));
switch (req) {
case wxHTTP_GET:
- tmp_buf = _T("GET");
+ tmp_buf = T("GET(");
break;
default:
return FALSE;
SetFlags(NONE);
Notify(FALSE);
- wxSprintf(buf, _T("%s %s HTTP/1.0\n\r"), tmp_buf, tmp_str.GetData());
+ wxSprintf(buf, T("%s %s HTTP/1.0\n\r"), tmp_buf, tmp_str.GetData());
const wxWX2MBbuf pathbuf = wxConvLibc.cWX2MB(buf);
- Write(pathbuf, strlen(MBSTRINGCAST pathbuf));
+ Write(pathbuf, strlen(wxMBSTRINGCAST pathbuf));
SendHeaders();
Write("\n\r", 2);
return FALSE;
}
- if (!tmp_str.Contains(_T("HTTP/"))) {
+ if (!tmp_str.Contains(T("HTTP/"))) {
// TODO: support HTTP v0.9 which can have no header.
// FIXME: tmp_str is not put back in the in-queue of the socket.
- SetHeader(_T("Content-Length"), _T("-1"));
- SetHeader(_T("Content-Type"), _T("none/none"));
+ SetHeader(T("Content-Length"), T("-1"));
+ SetHeader(T("Content-Type"), T("none/none"));
RestoreState();
return TRUE;
}
- wxStringTokenizer token(tmp_str,_T(' '));
+ wxStringTokenizer token(tmp_str,T(' '));
wxString tmp_str2;
bool ret_value;
tmp_str2 = token.NextToken();
switch (tmp_str2[(unsigned int) 0]) {
- case _T('1'):
+ case T('1'):
/* INFORMATION / SUCCESS */
break;
- case _T('2'):
+ case T('2'):
/* SUCCESS */
break;
- case _T('3'):
+ case T('3'):
/* REDIRECTION */
break;
default:
if (!BuildRequest(path, wxHTTP_GET))
return NULL;
- if (!GetHeader(_T("Content-Length")).IsEmpty())
- inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(_T("Content-Length")));
+ if (!GetHeader(T("Content-Length")).IsEmpty())
+ inp_stream->m_httpsize = wxAtoi(WXSTRINGCAST GetHeader(T("Content-Length")));
else
inp_stream->m_httpsize = (size_t)-1;
int height = (int)wxINT32_SWAP_ON_BE( dbuf[1] );
if (width > 32767)
{
- wxLogError( _T("Image width > 32767 pixels for file.") );
+ wxLogError( T("Image width > 32767 pixels for file.") );
return FALSE;
}
if (height > 32767)
{
- wxLogError( _T("Image height > 32767 pixels for file.") );
+ wxLogError( T("Image height > 32767 pixels for file.") );
return FALSE;
}
int bpp = (int)wxUINT16_SWAP_ON_BE( aWord );
if (bpp != 1 && bpp != 4 && bpp != 8 && bpp != 16 && bpp != 24 && bpp != 32)
{
- wxLogError( _T("unknown bitdepth in file.") );
+ wxLogError( T("unknown bitdepth in file.") );
return FALSE;
}
int comp = (int)wxINT32_SWAP_ON_BE( dbuf[0] );
if (comp != BI_RGB && comp != BI_RLE4 && comp != BI_RLE8 && comp != BI_BITFIELDS)
{
- wxLogError( _T("unknown encoding in Windows BMP file.") );
+ wxLogError( T("unknown encoding in Windows BMP file.") );
return FALSE;
}
((comp == BI_RLE8) && (bpp != 8)) ||
((comp == BI_BITFIELDS) && (bpp != 16 && bpp != 32)))
{
- wxLogError( _T("encoding of BMP doesn't match bitdepth.") );
+ wxLogError( T("encoding of BMP doesn't match bitdepth.") );
return FALSE;
}
if (bpp < 16)
cmap = (struct _cmap *)malloc(sizeof(struct _cmap) * ncolors);
if (!cmap)
{
- wxLogError( _T("Cannot allocate RAM for color map in BMP file.") );
+ wxLogError( T("Cannot allocate RAM for color map in BMP file.") );
return FALSE;
}
}
unsigned char *ptr = image->GetData();
if (!ptr)
{
- wxLogError( _T("Cannot allocate RAM for RGB data in file.") );
+ wxLogError( T("Cannot allocate RAM for RGB data in file.") );
if (cmap)
free(cmap);
return FALSE;
{
if (comp == BI_RLE4)
{
- wxLogError( _T("Can't deal with 4bit encoded yet.") );
+ wxLogError( T("Can't deal with 4bit encoded yet.") );
image->Destroy();
free(cmap);
return FALSE;
{
wxImage image;
- wxCHECK_MSG( Ok(), image, _T("invalid image") );
+ wxCHECK_MSG( Ok(), image, T("invalid image") );
- wxCHECK_MSG( (width > 0) && (height > 0), image, _T("invalid image size") );
+ wxCHECK_MSG( (width > 0) && (height > 0), image, T("invalid image size") );
image.Create( width, height );
char unsigned *data = image.GetData();
- wxCHECK_MSG( data, image, _T("unable to create image") );
+ wxCHECK_MSG( data, image, T("unable to create image") );
if (M_IMGDATA->m_hasMask)
image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue );
{
wxImage image;
- wxCHECK_MSG( Ok(), image, _T("invalid image") );
+ wxCHECK_MSG( Ok(), image, T("invalid image") );
wxCHECK_MSG( (rect.GetLeft()>=0) && (rect.GetTop()>=0) && (rect.GetRight()<=GetWidth()) && (rect.GetBottom()<=GetHeight())
- , image, _T("invalid subimage size") );
+ , image, T("invalid subimage size") );
int subwidth=rect.GetWidth();
const int subheight=rect.GetHeight();
char unsigned *subdata = image.GetData(), *data=GetData();
- wxCHECK_MSG( subdata, image, _T("unable to create image") );
+ wxCHECK_MSG( subdata, image, T("unable to create image") );
if (M_IMGDATA->m_hasMask)
image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue );
void wxImage::SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b )
{
- wxCHECK_RET( Ok(), _T("invalid image") );
+ wxCHECK_RET( Ok(), T("invalid image") );
int w = M_IMGDATA->m_width;
int h = M_IMGDATA->m_height;
- wxCHECK_RET( (x>=0) && (y>=0) && (x<w) && (y<h), _T("invalid image index") );
+ wxCHECK_RET( (x>=0) && (y>=0) && (x<w) && (y<h), T("invalid image index") );
long pos = (y * w + x) * 3;
unsigned char wxImage::GetRed( int x, int y )
{
- wxCHECK_MSG( Ok(), 0, _T("invalid image") );
+ wxCHECK_MSG( Ok(), 0, T("invalid image") );
int w = M_IMGDATA->m_width;
int h = M_IMGDATA->m_height;
- wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, _T("invalid image index") );
+ wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, T("invalid image index") );
long pos = (y * w + x) * 3;
unsigned char wxImage::GetGreen( int x, int y )
{
- wxCHECK_MSG( Ok(), 0, _T("invalid image") );
+ wxCHECK_MSG( Ok(), 0, T("invalid image") );
int w = M_IMGDATA->m_width;
int h = M_IMGDATA->m_height;
- wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, _T("invalid image index") );
+ wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, T("invalid image index") );
long pos = (y * w + x) * 3;
unsigned char wxImage::GetBlue( int x, int y )
{
- wxCHECK_MSG( Ok(), 0, _T("invalid image") );
+ wxCHECK_MSG( Ok(), 0, T("invalid image") );
int w = M_IMGDATA->m_width;
int h = M_IMGDATA->m_height;
- wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, _T("invalid image index") );
+ wxCHECK_MSG( (x>=0) && (y>=0) && (x<w) && (y<h), 0, T("invalid image index") );
long pos = (y * w + x) * 3;
char unsigned *wxImage::GetData() const
{
- wxCHECK_MSG( Ok(), (char unsigned *)NULL, _T("invalid image") );
+ wxCHECK_MSG( Ok(), (char unsigned *)NULL, T("invalid image") );
return M_IMGDATA->m_data;
}
void wxImage::SetData( char unsigned *data )
{
- wxCHECK_RET( Ok(), _T("invalid image") );
+ wxCHECK_RET( Ok(), T("invalid image") );
wxImageRefData *newRefData = new wxImageRefData();
void wxImage::SetMaskColour( unsigned char r, unsigned char g, unsigned char b )
{
- wxCHECK_RET( Ok(), _T("invalid image") );
+ wxCHECK_RET( Ok(), T("invalid image") );
M_IMGDATA->m_maskRed = r;
M_IMGDATA->m_maskGreen = g;
unsigned char wxImage::GetMaskRed() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid image") );
+ wxCHECK_MSG( Ok(), 0, T("invalid image") );
return M_IMGDATA->m_maskRed;
}
unsigned char wxImage::GetMaskGreen() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid image") );
+ wxCHECK_MSG( Ok(), 0, T("invalid image") );
return M_IMGDATA->m_maskGreen;
}
unsigned char wxImage::GetMaskBlue() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid image") );
+ wxCHECK_MSG( Ok(), 0, T("invalid image") );
return M_IMGDATA->m_maskBlue;
}
void wxImage::SetMask( bool mask )
{
- wxCHECK_RET( Ok(), _T("invalid image") );
+ wxCHECK_RET( Ok(), T("invalid image") );
M_IMGDATA->m_hasMask = mask;
}
bool wxImage::HasMask() const
{
- wxCHECK_MSG( Ok(), FALSE, _T("invalid image") );
+ wxCHECK_MSG( Ok(), FALSE, T("invalid image") );
return M_IMGDATA->m_hasMask;
}
int wxImage::GetWidth() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid image") );
+ wxCHECK_MSG( Ok(), 0, T("invalid image") );
return M_IMGDATA->m_width;
}
int wxImage::GetHeight() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid image") );
+ wxCHECK_MSG( Ok(), 0, T("invalid image") );
return M_IMGDATA->m_height;
}
}
else {
- wxLogError( _T("Can't load image from file '%s': file does not exist."), filename.c_str() );
+ wxLogError( T("Can't load image from file '%s': file does not exist."), filename.c_str() );
return FALSE;
}
}
else {
- wxLogError( _T("Can't load image from file '%s': file does not exist."), filename.c_str() );
+ wxLogError( T("Can't load image from file '%s': file does not exist."), filename.c_str() );
return FALSE;
}
}
- wxLogWarning( _T("No handler found for this image.") );
+ wxLogWarning( T("No handler found for this image.") );
return FALSE;
}
if (handler == NULL)
{
- wxLogWarning( _T("No image handler for type %d defined."), type );
+ wxLogWarning( T("No image handler for type %d defined."), type );
return FALSE;
}
if (handler == NULL)
{
- wxLogWarning( _T("No image handler for type %s defined."), mimetype.GetData() );
+ wxLogWarning( T("No image handler for type %s defined."), mimetype.GetData() );
return FALSE;
}
bool wxImage::SaveFile( wxOutputStream& stream, int type )
{
- wxCHECK_MSG( Ok(), FALSE, _T("invalid image") );
+ wxCHECK_MSG( Ok(), FALSE, T("invalid image") );
wxImageHandler *handler = FindHandler(type);
if (handler == NULL)
{
- wxLogWarning( _T("No image handler for type %d defined."), type );
+ wxLogWarning( T("No image handler for type %d defined."), type );
return FALSE;
}
bool wxImage::SaveFile( wxOutputStream& stream, const wxString& mimetype )
{
- wxCHECK_MSG( Ok(), FALSE, _T("invalid image") );
+ wxCHECK_MSG( Ok(), FALSE, T("invalid image") );
wxImageHandler *handler = FindHandlerMime(mimetype);
if (handler == NULL)
{
- wxLogWarning( _T("No image handler for type %s defined."), mimetype.GetData() );
+ wxLogWarning( T("No image handler for type %s defined."), mimetype.GetData() );
return FALSE;
}
}
else {
- wxLogError( _T("Can't check image format of file '%s': file does not exist."), name.c_str() );
+ wxLogError( T("Can't check image format of file '%s': file does not exist."), name.c_str() );
return FALSE;
}
// set bitmap parameters
wxBitmap bitmap;
- wxCHECK_MSG( Ok(), bitmap, _T("invalid image") );
+ wxCHECK_MSG( Ok(), bitmap, T("invalid image") );
bitmap.SetWidth( width );
bitmap.SetHeight( bmpHeight );
bitmap.SetDepth( wxDisplayDepth() );
// create a DIB header
int headersize = sizeof(BITMAPINFOHEADER);
LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize );
- wxCHECK_MSG( lpDIBh, bitmap, _T("could not allocate memory for DIB header") );
+ wxCHECK_MSG( lpDIBh, bitmap, T("could not allocate memory for DIB header") );
// Fill in the DIB header
lpDIBh->bmiHeader.biSize = headersize;
lpDIBh->bmiHeader.biWidth = (DWORD)width;
lpBits = (unsigned char *)malloc( lpDIBh->bmiHeader.biSizeImage );
if( !lpBits )
{
- wxFAIL_MSG( _T("could not allocate memory for DIB") );
+ wxFAIL_MSG( T("could not allocate memory for DIB") );
free( lpDIBh );
return bitmap;
}
// check the bitmap
if( !bitmap.Ok() )
{
- wxFAIL_MSG( _T("invalid bitmap") );
+ wxFAIL_MSG( T("invalid bitmap") );
return;
}
unsigned char *data = GetData();
if( !data )
{
- wxFAIL_MSG( _T("could not allocate data for image") );
+ wxFAIL_MSG( T("could not allocate data for image") );
return;
}
LPBITMAPINFO lpDIBh = (BITMAPINFO *) malloc( headersize );
if( !lpDIBh )
{
- wxFAIL_MSG( _T("could not allocate data for DIB header") );
+ wxFAIL_MSG( T("could not allocate data for DIB header") );
free( data );
return;
}
lpBits = (unsigned char *) malloc( lpDIBh->bmiHeader.biSizeImage );
if( !lpBits )
{
- wxFAIL_MSG( _T("could not allocate data for DIB") );
+ wxFAIL_MSG( T("could not allocate data for DIB") );
free( data );
free( lpDIBh );
return;
{
wxBitmap bitmap;
- wxCHECK_MSG( Ok(), bitmap, _T("invalid image") );
+ wxCHECK_MSG( Ok(), bitmap, T("invalid image") );
int width = GetWidth();
int height = GetHeight();
wxImage::wxImage( const wxBitmap &bitmap )
{
- wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") );
GdkImage *gdk_image = gdk_image_get( bitmap.GetPixmap(),
0, 0,
bitmap.GetWidth(), bitmap.GetHeight() );
- wxCHECK_RET( gdk_image, _T("couldn't create image") );
+ wxCHECK_RET( gdk_image, T("couldn't create image") );
Create( bitmap.GetWidth(), bitmap.GetHeight() );
char unsigned *data = GetData();
if (!data)
{
gdk_image_destroy( gdk_image );
- wxFAIL_MSG( _T("couldn't create image") );
+ wxFAIL_MSG( T("couldn't create image") );
return;
}
{
wxBitmap bitmap;
- wxCHECK_MSG( Ok(), bitmap, _T("invalid image") );
+ wxCHECK_MSG( Ok(), bitmap, T("invalid image") );
int width = GetWidth();
int height = GetHeight();
vi = XGetVisualInfo( dpy, VisualIDMask|VisualDepthMask, &vinfo_template, &nitem );
- wxCHECK_MSG( vi, wxNullBitmap, _T("no visual") );
+ wxCHECK_MSG( vi, wxNullBitmap, T("no visual") );
XFree( vi );
wxImage::wxImage( const wxBitmap &bitmap )
{
- wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") );
Display *dpy = (Display*) wxGetDisplay();
Visual* vis = DefaultVisual( dpy, DefaultScreen( dpy ) );
bitmap.GetWidth(), bitmap.GetHeight(),
AllPlanes, ZPixmap );
- wxCHECK_RET( ximage, _T("couldn't create image") );
+ wxCHECK_RET( ximage, T("couldn't create image") );
Create( bitmap.GetWidth(), bitmap.GetHeight() );
char unsigned *data = GetData();
if (!data)
{
XDestroyImage( ximage );
- wxFAIL_MSG( _T("couldn't create image") );
+ wxFAIL_MSG( T("couldn't create image") );
return;
}
vi = XGetVisualInfo( dpy, VisualIDMask|VisualDepthMask, &vinfo_template, &nitem );
- wxCHECK_RET( vi, _T("no visual") );
+ wxCHECK_RET( vi, T("no visual") );
if ((bpp == 16) && (vi->red_mask != 0xf800)) bpp = 15;
{
switch (error)
{
- case E_FORMATO: wxLogError(_T("wxGIFHandler: error in image format")); break;
- case E_MEMORIA: wxLogError(_T("wxGIFHandler: couldn't allocate memory")); break;
- default: wxLogError(_T("wxGIFHandler: unknown error !!!"));
+ case E_FORMATO: wxLogError(T("wxGIFHandler: error in image format")); break;
+ case E_MEMORIA: wxLogError(T("wxGIFHandler: couldn't allocate memory")); break;
+ default: wxLogError(T("wxGIFHandler: unknown error !!!"));
}
}
delete decod;
wxOutputStream& WXUNUSED(stream), bool verbose )
{
if (verbose)
- wxLogDebug(_T("wxGIFHandler is read-only!!"));
+ wxLogDebug(T("wxGIFHandler is read-only!!"));
return FALSE;
}
if (!CanRead(stream))
{
if (verbose)
- wxLogError(_T("wxPCXHandler: this is not a PCX file"));
+ wxLogError(T("wxPCXHandler: this is not a PCX file"));
return FALSE;
}
{
switch (error)
{
- case E_FORMATO: wxLogError(_T("wxPCXHandler: image format unsupported")); break;
- case E_MEMORIA: wxLogError(_T("wxPCXHandler: couldn't allocate memory")); break;
- case E_VERSION: wxLogError(_T("wxPCXHandler: version number too low")); break;
- default: wxLogError(_T("wxPCXHandler: unknown error !!!"));
+ case E_FORMATO: wxLogError(T("wxPCXHandler: image format unsupported")); break;
+ case E_MEMORIA: wxLogError(T("wxPCXHandler: couldn't allocate memory")); break;
+ case E_VERSION: wxLogError(T("wxPCXHandler: version number too low")); break;
+ default: wxLogError(T("wxPCXHandler: unknown error !!!"));
}
}
image->Destroy();
bool wxPCXHandler::SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool verbose )
{
if (verbose)
- wxLogError(_T("wxPCXHandler::SaveFile still not implemented"));
+ wxLogError(T("wxPCXHandler::SaveFile still not implemented"));
return FALSE;
}
wxString line;
wxTextInputStream text_stream(stream);
- if (stream.Peek()==_T('#'))
+ if (stream.Peek()==T('#'))
{
text_stream >> line;
Skip_Comment(stream);
wxTextInputStream text_stream(buf_stream);
Skip_Comment(buf_stream);
- if (buf_stream.GetC()==_T('P')) c=buf_stream.GetC();
+ if (buf_stream.GetC()==T('P')) c=buf_stream.GetC();
switch (c)
{
- case _T('2'):
- wxLogError(_T("Loading Grey Ascii PNM image is not yet implemented."));
+ case T('2'):
+ wxLogError(T("Loading Grey Ascii PNM image is not yet implemented."));
return FALSE;
- case _T('5'):
- wxLogError(_T("Loading Grey Raw PNM image is not yet implemented."));
+ case T('5'):
+ wxLogError(T("Loading Grey Raw PNM image is not yet implemented."));
return FALSE;
- case _T('3'): case _T('6'): break;
+ case T('3'): case T('6'): break;
default :
- wxLogError(_T("Loading PNM image : file not recognized."));
+ wxLogError(T("Loading PNM image : file not recognized."));
return FALSE;
}
unsigned char *ptr = image->GetData();
if (!ptr)
{
- wxLogError( _T("Cannot allocate RAM for RGB data in PNM file.") );
+ wxLogError( T("Cannot allocate RAM for RGB data in PNM file.") );
return FALSE;
}
if (buf_stream.LastError()!=wxSTREAM_NOERROR)
{
- wxLogError(_T("Loading PNM image : file seems truncated."));
+ wxLogError(T("Loading PNM image : file seems truncated."));
return FALSE;
}
}
Skip_Comment(stream);
- if (stream.GetC()==_T('P'))
+ if (stream.GetC()==T('P'))
switch (stream.GetC())
{
- case _T('3'): case _T('6'):
+ case T('3'): case T('6'):
stream.SeekI(pos);
return TRUE;
}
--- /dev/null
+/////////////////////////////////////////////////////////////////////////////
+// Name: common/init.cpp
+// Purpose: initialisation for the library
+// Author: Vadim Zeitlin
+// Modified by:
+// Created: 04.10.99
+// RCS-ID: $Id$
+// Copyright: (c) Vadim Zeitlin
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+#ifdef __GNUG__
+ #pragma implementation "appbase.h"
+#endif
+
+#include "wx/app.h"
+#include "wx/debug.h"
+
+// ----------------------------------------------------------------------------
+// global vars
+// ----------------------------------------------------------------------------
+
+wxApp * WXDLLEXPORT wxTheApp = NULL;
+
+wxAppInitializerFunction
+ wxAppBase::m_appInitFn = (wxAppInitializerFunction)NULL;
+
+// ----------------------------------------------------------------------------
+// private classes
+// ----------------------------------------------------------------------------
+
+class /* no WXDLLEXPORT */ wxConsoleApp : public wxApp
+{
+public:
+ virtual int OnRun() { wxFAIL_MSG(T("unreachable")); return 0; }
+};
+
+// ----------------------------------------------------------------------------
+// private vars
+// ----------------------------------------------------------------------------
+
+static size_t gs_nInitCount = 0;
+
+// ============================================================================
+// implementation
+// ============================================================================
+
+bool WXDLLEXPORT wxInitialize()
+{
+ if ( gs_nInitCount++ )
+ {
+ // already initialized
+ return TRUE;
+ }
+
+ wxASSERT_MSG( !wxTheApp,
+ T("either call wxInitialize or create app, not both!") );
+
+ wxTheApp = new wxConsoleApp;
+
+ return wxTheApp != NULL;
+}
+
+void WXDLLEXPORT wxUninitialize()
+{
+ if ( !--gs_nInitCount )
+ {
+ // delete the application object
+ delete wxTheApp;
+ wxTheApp = (wxApp *)NULL;
+ }
+}
// search first in prefix/fr/LC_MESSAGES, then in prefix/fr and finally in
// prefix (assuming the language is 'fr')
searchPath << prefix << wxFILE_SEP_PATH << lang << wxFILE_SEP_PATH
- << _T("LC_MESSAGES") << wxPATH_SEP
+ << T("LC_MESSAGES") << wxPATH_SEP
<< prefix << wxFILE_SEP_PATH << lang << wxPATH_SEP
<< prefix << wxPATH_SEP;
// then take the current directory
// FIXME it should be the directory of the executable
- searchPath << GetAllMsgCatalogSubdirs(_T("."), lang) << wxPATH_SEP;
+ searchPath << GetAllMsgCatalogSubdirs(T("."), lang) << wxPATH_SEP;
// and finally add some standard ones
searchPath
- << GetAllMsgCatalogSubdirs(_T("/usr/share/locale"), lang) << wxPATH_SEP
- << GetAllMsgCatalogSubdirs(_T("/usr/lib/locale"), lang) << wxPATH_SEP
- << GetAllMsgCatalogSubdirs(_T("/usr/local/share/locale"), lang);
+ << GetAllMsgCatalogSubdirs(T("/usr/share/locale"), lang) << wxPATH_SEP
+ << GetAllMsgCatalogSubdirs(T("/usr/lib/locale"), lang) << wxPATH_SEP
+ << GetAllMsgCatalogSubdirs(T("/usr/local/share/locale"), lang);
return searchPath;
}
#endif // 0
wxString searchPath = GetFullSearchPath(szDirPrefix);
- const wxChar *sublocale = wxStrchr(szDirPrefix, _T('_'));
+ const wxChar *sublocale = wxStrchr(szDirPrefix, T('_'));
if ( sublocale )
{
// also add just base locale name: for things like "fr_BE" (belgium
// (we're using an object because we have several return paths)
NoTransErr noTransErr;
-// Then why do you translate at all? Just use _T() and not _(). RR.
-
- wxLogVerbose(_("looking for catalog '%s' in path '%s'."),
+ wxLogVerbose(T("looking for catalog '%s' in path '%s'."),
szName.c_str(), searchPath.c_str());
wxString strFullName;
m_pMsgCat = NULL;
bool bOk = TRUE;
if ( bLoadDefault )
- bOk = AddCatalog(_T("wxstd"));
+ bOk = AddCatalog(T("wxstd"));
return bOk;
}
// get the translation of given string in current locale
const wxMB2WXbuf wxLocale::GetString(const wxChar *szOrigString,
- const wxChar *szDomain) const
+ const wxChar *szDomain) const
{
if ( wxIsEmpty(szOrigString) )
return szDomain;
const char *pszTrans = NULL;
+#if wxUSE_UNICODE
const wxWX2MBbuf szOrgString = wxConvCurrent->cWX2MB(szOrigString);
+#else // ANSI
+ #define szOrgString szOrigString
+#endif // Unicode/ANSI
wxMsgCatalog *pMsgCat;
if ( szDomain != NULL ) {
return (wxMB2WXbuf)(szOrigString);
}
else
- return (wxMB2WXbuf)(wxConvCurrent->cMB2WX(pszTrans));
+ {
+ // FIXME it was
+ // return (wxMB2WXbuf)(wxConvCurrent->cMB2WX(pszTrans));
+ // before, but we don't want to use wxConvCurrent explicitly to
+ // avoid linking unnecessary code in ANSI programs without MB
+ // support
+ return (wxMB2WXbuf)(pszTrans);
+ }
+
+ #undef szOrgString
}
// find catalog by name in a linked list, return NULL if !found
switch ( m_keyType )
{
default:
- wxFAIL_MSG(_T("bad key type."));
+ wxFAIL_MSG(T("bad key type."));
// let compiler optimize the line above away in release build
// by not putting return here...
break;
default:
- wxFAIL_MSG(_T("invalid key type"));
+ wxFAIL_MSG(T("invalid key type"));
}
if ( previous )
int wxNodeBase::IndexOf() const
{
- wxCHECK_MSG( m_list, wxNOT_FOUND, _T("node doesn't belong to a list in IndexOf"));
+ wxCHECK_MSG( m_list, wxNOT_FOUND, T("node doesn't belong to a list in IndexOf"));
// It would be more efficient to implement IndexOf() completely inside
// wxListBase (only traverse the list once), but this is probably a more
void wxListBase::DoCopy(const wxListBase& list)
{
wxASSERT_MSG( !list.m_destroy,
- _T("copying list which owns it's elements is a bad idea") );
+ T("copying list which owns it's elements is a bad idea") );
m_count = list.m_count;
m_destroy = list.m_destroy;
{
// all objects in a keyed list should have a key
wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL,
- _T("need a key for the object to append") );
+ T("need a key for the object to append") );
wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object);
wxCHECK_MSG( (m_keyType == wxKEY_INTEGER) ||
(m_keyType == wxKEY_NONE && m_count == 0),
(wxNodeBase *)NULL,
- _T("can't append object with numeric key to this list") );
+ T("can't append object with numeric key to this list") );
wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key);
return AppendCommon(node);
wxCHECK_MSG( (m_keyType == wxKEY_STRING) ||
(m_keyType == wxKEY_NONE && m_count == 0),
(wxNodeBase *)NULL,
- _T("can't append object with string key to this list") );
+ T("can't append object with string key to this list") );
wxNodeBase *node = CreateNode(m_nodeLast, (wxNodeBase *)NULL, object, key);
return AppendCommon(node);
{
// all objects in a keyed list should have a key
wxCHECK_MSG( m_keyType == wxKEY_NONE, (wxNodeBase *)NULL,
- _T("need a key for the object to insert") );
+ T("need a key for the object to insert") );
wxCHECK_MSG( !position || position->m_list == this, (wxNodeBase *)NULL,
- _T("can't insert before a node from another list") );
+ T("can't insert before a node from another list") );
// previous and next node for the node being inserted
wxNodeBase *prev, *next;
}
}
- wxFAIL_MSG( _T("invalid index in wxListBase::Item") );
+ wxFAIL_MSG( T("invalid index in wxListBase::Item") );
return (wxNodeBase *)NULL;
}
wxNodeBase *wxListBase::Find(const wxListKey& key) const
{
wxASSERT_MSG( m_keyType == key.GetKeyType(),
- _T("this list is not keyed on the type of this key") );
+ T("this list is not keyed on the type of this key") );
for ( wxNodeBase *current = GetFirst(); current; current = current->GetNext() )
{
wxNodeBase *wxListBase::DetachNode(wxNodeBase *node)
{
- wxCHECK_MSG( node, NULL, _T("detaching NULL wxNodeBase") );
+ wxCHECK_MSG( node, NULL, T("detaching NULL wxNodeBase") );
wxCHECK_MSG( node->m_list == this, NULL,
- _T("detaching node which is not from this list") );
+ T("detaching node which is not from this list") );
// update the list
wxNodeBase **prevNext = node->GetPrevious() ? &node->GetPrevious()->m_next
// wxWindows
#ifndef WX_PRECOMP
- #include "wx/window.h"
- #ifdef __WXMSW__
- #include "wx/msw/private.h"
- #endif
- #include "wx/event.h"
- #include "wx/app.h"
- #include "wx/string.h"
- #include "wx/intl.h"
- #ifndef wxUSE_NOGUI
- #include "wx/msgdlg.h"
- #endif
+ #include "wx/string.h"
+ #include "wx/intl.h"
+ #include "wx/app.h"
+
+ #if wxUSE_GUI
+ #include "wx/window.h"
+ #ifdef __WXMSW__
+ #include "wx/msw/private.h"
+ #endif
+ #include "wx/msgdlg.h"
+ #endif
#endif //WX_PRECOMP
#include "wx/file.h"
if ( !s_bInGetActiveTarget ) {
s_bInGetActiveTarget = TRUE;
-#ifdef wxUSE_NOGUI
- ms_pLogger = new wxLogStderr;
-#else // GUI
// ask the application to create a log target for us
if ( wxTheApp != NULL )
ms_pLogger = wxTheApp->CreateLogTarget();
else
ms_pLogger = new wxLogStderr;
-#endif // !GUI/GUI
s_bInGetActiveTarget = FALSE;
wxStrftime(buf, WXSIZEOF(buf), ms_timestamp, localtime(&timeNow));
str->Empty();
- *str << buf << _T(": ");
+ *str << buf << T(": ");
}
}
void wxLog::DoLogString(const wxChar *WXUNUSED(szString), time_t WXUNUSED(t))
{
- wxFAIL_MSG(_T("DoLogString must be overriden if it's called."));
+ wxFAIL_MSG(T("DoLogString must be overriden if it's called."));
}
void wxLog::Flush()
{
wxString str;
TimeStamp(&str);
- str << szString << _T('\n');
+ str << szString << T('\n');
fputs(str.mb_str(), m_fp);
fflush(m_fp);
// under Windows, programs usually don't have stderr at all, so make show the
// messages also under debugger
#ifdef __WXMSW__
- OutputDebugString(str + _T('\r'));
+ OutputDebugString(str + T('\r'));
#endif // MSW
}
void wxLogStream::DoLogString(const wxChar *szString, time_t WXUNUSED(t))
{
- (*m_ostr) << wxConvCurrent->cWX2MB(szString) << endl << flush;
+ (*m_ostr) << wxConvertWX2MB(szString) << endl;
}
#endif // wxUSE_STD_IOSTREAM
bool wxLog::ms_doLog = TRUE;
bool wxLog::ms_bAutoCreate = TRUE;
-const wxChar *wxLog::ms_timestamp = _T("%X"); // time only, no date
+const wxChar *wxLog::ms_timestamp = T("%X"); // time only, no date
wxTraceMask wxLog::ms_ulTraceMask = (wxTraceMask)0;
wxArrayString wxLog::ms_aTraceMasks;
// copy it to our buffer and free memory
wxStrncpy(s_szBuf, (const wxChar *)lpMsgBuf, WXSIZEOF(s_szBuf) - 1);
- s_szBuf[WXSIZEOF(s_szBuf) - 1] = _T('\0');
+ s_szBuf[WXSIZEOF(s_szBuf) - 1] = T('\0');
LocalFree(lpMsgBuf);
// returned string is capitalized and ended with '\r\n' - bad
size_t len = wxStrlen(s_szBuf);
if ( len > 0 ) {
// truncate string
- if ( s_szBuf[len - 2] == _T('\r') )
- s_szBuf[len - 2] = _T('\0');
+ if ( s_szBuf[len - 2] == T('\r') )
+ s_szBuf[len - 2] = T('\0');
}
return s_szBuf;
// make life easier for people using VC++ IDE: clicking on the message
// will take us immediately to the place of the failed assert
#ifdef __VISUALC__
- wxSprintf(szBuf, _T("%s(%d): assert failed"), szFile, nLine);
+ wxSprintf(szBuf, T("%s(%d): assert failed"), szFile, nLine);
#else // !VC++
// make the error message more clear for all the others
- wxSprintf(szBuf, _T("Assert failed in file %s at line %d"), szFile, nLine);
+ wxSprintf(szBuf, T("Assert failed in file %s at line %d"), szFile, nLine);
#endif // VC/!VC
if ( szMsg != NULL ) {
- wxStrcat(szBuf, _T(": "));
+ wxStrcat(szBuf, T(": "));
wxStrcat(szBuf, szMsg);
}
else {
- wxStrcat(szBuf, _T("."));
+ wxStrcat(szBuf, T("."));
}
if ( !s_bNoAsserts ) {
// send it to the normal log destination
wxLogDebug(szBuf);
-#if wxUSE_NOGUI
- Trap();
-#else // GUI
+#if wxUSE_GUI
// this message is intentionally not translated - it is for
// developpers only
- wxStrcat(szBuf, _T("\nDo you want to stop the program?"
+ wxStrcat(szBuf, T("\nDo you want to stop the program?"
"\nYou can also choose [Cancel] to suppress "
"further warnings."));
//case wxNO: nothing to do
}
-#endif // !GUI/GUI
+#else // !GUI
+ Trap();
+#endif // GUI/!GUI
}
s_bInAssert = FALSE;
*/
void wxMemStruct::ErrorMsg (const char * mesg)
{
- wxLogDebug(_T("wxWindows memory checking error: %s"), mesg);
+ wxLogDebug(T("wxWindows memory checking error: %s"), mesg);
PrintNode ();
// << m_fileName << ' ' << m_lineNum << endl;
*/
void wxMemStruct::ErrorMsg ()
{
- wxLogDebug(_T("wxWindows over/underwrite memory error:"));
+ wxLogDebug(T("wxWindows over/underwrite memory error:"));
PrintNode ();
// cerr << m_fileName << ' ' << m_lineNum << endl;
// Let's put this in standard form so IDEs can load the file at the appropriate
// line
- wxString msg(_T(""));
+ wxString msg(T(""));
if (m_fileName)
- msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum);
+ msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum);
if (info && info->GetClassName())
msg += info->GetClassName();
else
- msg += _T("object");
+ msg += T("object");
wxString msg2;
- msg2.Printf(_T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize());
+ msg2.Printf(T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize());
msg += msg2;
wxLogDebug(msg);
wxString msg("");
if (m_fileName)
- msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum);
- msg += _T("non-object data");
+ msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum);
+ msg += T("non-object data");
wxString msg2;
- msg2.Printf(_T(" at $%lX, size %d\n"), (long)GetActualData(), (int)RequestSize());
+ msg2.Printf(T(" at $%lX, size %d\n"), (long)GetActualData(), (int)RequestSize());
msg += msg2;
wxLogDebug(msg);
{
wxObject *obj = (wxObject *)m_actualData;
- wxString msg(_T(""));
+ wxString msg(T(""));
if (m_fileName)
- msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum);
+ msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum);
/* TODO: We no longer have a stream (using wxLogDebug) so we can't dump it.
if (obj->GetClassInfo() && obj->GetClassInfo()->GetClassName())
msg += obj->GetClassInfo()->GetClassName();
else
- msg += _T("unknown object class");
+ msg += T("unknown object class");
wxString msg2("");
- msg2.Printf(_T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize());
+ msg2.Printf(T(" at $%lX, size %d"), (long)GetActualData(), (int)RequestSize());
msg += msg2;
wxLogDebug(msg);
}
else
{
- wxString msg(_T(""));
+ wxString msg(T(""));
if (m_fileName)
- msg.Printf(_T("%s(%d): "), m_fileName, (int)m_lineNum);
+ msg.Printf(T("%s(%d): "), m_fileName, (int)m_lineNum);
wxString msg2("");
- msg2.Printf(_T("non-object data at $%lX, size %d"), (long)GetActualData(), (int)RequestSize() );
+ msg2.Printf(T("non-object data at $%lX, size %d"), (long)GetActualData(), (int)RequestSize() );
msg += msg2;
wxLogDebug(msg);
}
else {
// Can't use the error routines as we have no recognisable object.
#ifndef __WXGTK__
- wxLogDebug(_T("Can't verify memory struct - all bets are off!"));
+ wxLogDebug(T("Can't verify memory struct - all bets are off!"));
#endif
}
return 0;
// if (TRUE)
{
- wxChar* appName = _T("application");
+ wxChar* appName = T("application");
wxString appNameStr("");
if (wxTheApp)
{
appNameStr = wxTheApp->GetAppName();
appName = WXSTRINGCAST appNameStr;
- wxLogDebug(_T("----- Memory dump of %s at %s -----"), appName, WXSTRINGCAST wxNow() );
+ wxLogDebug(T("----- Memory dump of %s at %s -----"), appName, WXSTRINGCAST wxNow() );
}
else
{
- wxLogDebug( _T("----- Memory dump -----") );
+ wxLogDebug( T("----- Memory dump -----") );
}
}
TraverseList ((PmSFV)&wxMemStruct::Dump, (checkPoint ? checkPoint->m_next : (wxMemStruct*)NULL));
- wxLogDebug( _T("") );
- wxLogDebug( _T("") );
+ wxLogDebug( T("") );
+ wxLogDebug( T("") );
return TRUE;
#else
// if (TRUE)
{
- wxChar* appName = _T("application");
- wxString appNameStr(_T(""));
+ wxChar* appName = T("application");
+ wxString appNameStr(T(""));
if (wxTheApp)
{
appNameStr = wxTheApp->GetAppName();
appName = WXSTRINGCAST appNameStr;
- wxLogDebug(_T("----- Memory statistics of %s at %s -----"), appName, WXSTRINGCAST wxNow() );
+ wxLogDebug(T("----- Memory statistics of %s at %s -----"), appName, WXSTRINGCAST wxNow() );
}
else
{
- wxLogDebug( _T("----- Memory statistics -----") );
+ wxLogDebug( T("----- Memory statistics -----") );
}
}
// if (detailed && (data != (void*)m_debugStream) && (data != (void*) m_streamBuf))
if (detailed && (data != (void*) wxLog::GetActiveTarget()))
{
- wxChar *className = _T("nonobject");
+ wxChar *className = T("nonobject");
if (st->m_isObject && st->GetActualData())
{
wxObject *obj = (wxObject *)st->GetActualData();
{
while (list)
{
- wxLogDebug(_T("%ld objects of class %s, total size %ld"),
+ wxLogDebug(T("%ld objects of class %s, total size %ld"),
list->instanceCount, list->instanceClass, list->totalSize);
wxDebugStatsStruct *old = list;
list = old->next;
free((char *)old);
}
- wxLogDebug(_T(""));
+ wxLogDebug(T(""));
}
SetDebugMode(currentMode);
- wxLogDebug(_T("Number of object items: %ld"), noObjectNodes);
- wxLogDebug(_T("Number of non-object items: %ld"), noNonObjectNodes);
- wxLogDebug(_T("Total allocated size: %ld"), totalSize);
- wxLogDebug(_T(""));
- wxLogDebug(_T(""));
+ wxLogDebug(T("Number of object items: %ld"), noObjectNodes);
+ wxLogDebug(T("Number of non-object items: %ld"), noNonObjectNodes);
+ wxLogDebug(T("Total allocated size: %ld"), totalSize);
+ wxLogDebug(T(""));
+ wxLogDebug(T(""));
return TRUE;
#else
// if (TRUE)
{
- wxChar* appName = _T("application");
- wxString appNameStr(_T(""));
+ wxChar* appName = T("application");
+ wxString appNameStr(T(""));
if (wxTheApp)
{
appNameStr = wxTheApp->GetAppName();
appName = WXSTRINGCAST appNameStr;
- wxLogDebug(_T("----- Classes in %s -----"), appName);
+ wxLogDebug(T("----- Classes in %s -----"), appName);
}
}
if (info->GetClassName())
{
wxString msg(info->GetClassName());
- msg += _T(" ");
+ msg += T(" ");
if (info->GetBaseClassName1() && !info->GetBaseClassName2())
{
- msg += _T("is a ");
+ msg += T("is a ");
msg += info->GetBaseClassName1();
}
else if (info->GetBaseClassName1() && info->GetBaseClassName2())
{
- msg += _T("is a ");
+ msg += T("is a ");
msg += info->GetBaseClassName1() ;
- msg += _T(", ");
+ msg += T(", ");
msg += info->GetBaseClassName2() ;
}
if (info->GetConstructor())
- msg += _T(": dynamic");
+ msg += T(": dynamic");
wxLogDebug(msg);
}
node = wxClassInfo::sm_classTable->Next();
n ++;
}
- wxLogDebug(_T(""));
- wxLogDebug(_T("There are %d classes derived from wxObject."), n);
- wxLogDebug(_T(""));
- wxLogDebug(_T(""));
+ wxLogDebug(T(""));
+ wxLogDebug(T("There are %d classes derived from wxObject."), n);
+ wxLogDebug(T(""));
+ wxLogDebug(T(""));
return TRUE;
}
int totSize = wxDebugContext::TotSize (size);
char * buf = (char *) malloc(totSize);
if (!buf) {
- wxLogDebug(_T("Call to malloc (%ld) failed."), (long)size);
+ wxLogDebug(T("Call to malloc (%ld) failed."), (long)size);
return 0;
}
wxMemStruct * st = (wxMemStruct *)buf;
break;
}
- wxASSERT_MSG( n == pos, _T("invalid position in MailCapEntry::Insert") );
+ wxASSERT_MSG( n == pos, T("invalid position in MailCapEntry::Insert") );
m_next = cur->m_next;
cur->m_next = this;
// append this element to the list
void Append(MailCapEntry *next)
{
- wxCHECK_RET( next != NULL, _T("Append()ing to what?") );
+ wxCHECK_RET( next != NULL, T("Append()ing to what?") );
// FIXME slooow...
MailCapEntry *cur;
cur->m_next = this;
- wxASSERT_MSG( !m_next, _T("Append()ing element already in the list?") );
+ wxASSERT_MSG( !m_next, T("Append()ing element already in the list?") );
}
private:
bool hasFilename = FALSE;
wxString str;
- for ( const wxChar *pc = command.c_str(); *pc != _T('\0'); pc++ ) {
- if ( *pc == _T('%') ) {
+ for ( const wxChar *pc = command.c_str(); *pc != T('\0'); pc++ ) {
+ if ( *pc == T('%') ) {
switch ( *++pc ) {
- case _T('s'):
+ case T('s'):
// '%s' expands into file name (quoted because it might
// contain spaces) - except if there are already quotes
// there because otherwise some programs may get confused
// by double double quotes
#if 0
- if ( *(pc - 2) == _T('"') )
+ if ( *(pc - 2) == T('"') )
str << params.GetFileName();
else
- str << _T('"') << params.GetFileName() << _T('"');
+ str << T('"') << params.GetFileName() << T('"');
#endif
str << params.GetFileName();
hasFilename = TRUE;
break;
- case _T('t'):
+ case T('t'):
// '%t' expands into MIME type (quote it too just to be
// consistent)
- str << _T('\'') << params.GetMimeType() << _T('\'');
+ str << T('\'') << params.GetMimeType() << T('\'');
break;
- case _T('{'):
+ case T('{'):
{
- const wxChar *pEnd = wxStrchr(pc, _T('}'));
+ const wxChar *pEnd = wxStrchr(pc, T('}'));
if ( pEnd == NULL ) {
wxString mimetype;
wxLogWarning(_("Unmatched '{' in an entry for "
"mime type %s."),
params.GetMimeType().c_str());
- str << _T("%{");
+ str << T("%{");
}
else {
wxString param(pc + 1, pEnd - pc - 1);
- str << _T('\'') << params.GetParamValue(param) << _T('\'');
+ str << T('\'') << params.GetParamValue(param) << T('\'');
pc = pEnd;
}
}
break;
- case _T('n'):
- case _T('F'):
+ case T('n'):
+ case T('F'):
// TODO %n is the number of parts, %F is an array containing
// the names of temp files these parts were written to
// and their mime types.
break;
default:
- wxLogDebug(_T("Unknown field %%%c in command '%s'."),
+ wxLogDebug(T("Unknown field %%%c in command '%s'."),
*pc, command.c_str());
str << *pc;
}
// metamail(1) man page states that if the mailcap entry doesn't have '%s'
// the program will accept the data on stdin: so give it to it!
if ( !hasFilename && !str.IsEmpty() ) {
- str << _T(" < '") << params.GetFileName() << _T('\'');
+ str << T(" < '") << params.GetFileName() << T('\'');
}
return str;
bool wxMimeTypesManager::IsOfType(const wxString& mimeType,
const wxString& wildcard)
{
- wxASSERT_MSG( mimeType.Find(_T('*')) == wxNOT_FOUND,
- _T("first MIME type can't contain wildcards") );
+ wxASSERT_MSG( mimeType.Find(T('*')) == wxNOT_FOUND,
+ T("first MIME type can't contain wildcards") );
// all comparaisons are case insensitive (2nd arg of IsSameAs() is FALSE)
- if ( wildcard.BeforeFirst(_T('/')).IsSameAs(mimeType.BeforeFirst(_T('/')), FALSE) )
+ if ( wildcard.BeforeFirst(T('/')).IsSameAs(mimeType.BeforeFirst(T('/')), FALSE) )
{
- wxString strSubtype = wildcard.AfterFirst(_T('/'));
+ wxString strSubtype = wildcard.AfterFirst(T('/'));
- if ( strSubtype == _T("*") ||
- strSubtype.IsSameAs(mimeType.AfterFirst(_T('/')), FALSE) )
+ if ( strSubtype == T("*") ||
+ strSubtype.IsSameAs(mimeType.AfterFirst(T('/')), FALSE) )
{
// matches (either exactly or it's a wildcard)
return TRUE;
// suppress possible error messages
wxLogNull nolog;
wxString strKey;
- strKey << m_strFileType << _T("\\shell\\") << verb << _T("\\command");
+ strKey << m_strFileType << T("\\shell\\") << verb << T("\\command");
wxRegKey key(wxRegKey::HKCR, strKey);
wxString command;
if ( key.Open() ) {
// it's the default value of the key
- if ( key.QueryValue(_T(""), command) ) {
+ if ( key.QueryValue(T(""), command) ) {
// transform it from '%1' to '%s' style format string
// NB: we don't make any attempt to verify that the string is valid,
bool foundFilename = FALSE;
size_t len = command.Len();
for ( size_t n = 0; (n < len) && !foundFilename; n++ ) {
- if ( command[n] == _T('%') &&
- (n + 1 < len) && command[n + 1] == _T('1') ) {
+ if ( command[n] == T('%') &&
+ (n + 1 < len) && command[n + 1] == T('1') ) {
// replace it with '%s'
- command[n + 1] = _T('s');
+ command[n + 1] = T('s');
foundFilename = TRUE;
}
if ( !foundFilename ) {
// we didn't find any '%1'!
// HACK: append the filename at the end, hope that it will do
- command << _T(" %s");
+ command << T(" %s");
}
}
}
cmd = m_info->GetOpenCommand();
}
else {
- cmd = GetCommand(_T("open"));
+ cmd = GetCommand(T("open"));
}
*openCmd = wxFileType::ExpandCommand(cmd, params);
cmd = m_info->GetPrintCommand();
}
else {
- cmd = GetCommand(_T("print"));
+ cmd = GetCommand(T("print"));
}
*printCmd = wxFileType::ExpandCommand(cmd, params);
// suppress possible error messages
wxLogNull nolog;
- wxRegKey key(wxRegKey::HKCR, /*m_strFileType*/ _T(".") + m_ext);
- if ( key.Open() && key.QueryValue(_T("Content Type"), *mimeType) ) {
+ wxRegKey key(wxRegKey::HKCR, /*m_strFileType*/ T(".") + m_ext);
+ if ( key.Open() && key.QueryValue(T("Content Type"), *mimeType) ) {
return TRUE;
}
else {
}
wxString strIconKey;
- strIconKey << m_strFileType << _T("\\DefaultIcon");
+ strIconKey << m_strFileType << T("\\DefaultIcon");
// suppress possible error messages
wxLogNull nolog;
if ( key.Open() ) {
wxString strIcon;
// it's the default value of the key
- if ( key.QueryValue(_T(""), strIcon) ) {
+ if ( key.QueryValue(T(""), strIcon) ) {
// the format is the following: <full path to file>, <icon index>
// NB: icon index may be negative as well as positive and the full
// path may contain the environment variables inside '%'
- wxString strFullPath = strIcon.BeforeLast(_T(',')),
- strIndex = strIcon.AfterLast(_T(','));
+ wxString strFullPath = strIcon.BeforeLast(T(',')),
+ strIndex = strIcon.AfterLast(T(','));
// index may be omitted, in which case BeforeLast(',') is empty and
// AfterLast(',') is the whole string
if ( strFullPath.IsEmpty() ) {
strFullPath = strIndex;
- strIndex = _T("0");
+ strIndex = T("0");
}
wxString strExpPath = wxExpandEnvVars(strFullPath);
switch ( (int)hIcon ) {
case 0: // means no icons were found
case 1: // means no such file or it wasn't a DLL/EXE/OCX/ICO/...
- wxLogDebug(_T("incorrect registry entry '%s': no such icon."),
+ wxLogDebug(T("incorrect registry entry '%s': no such icon."),
key.GetName().c_str());
break;
if ( key.Open() ) {
// it's the default value of the key
- if ( key.QueryValue(_T(""), *desc) ) {
+ if ( key.QueryValue(T(""), *desc) ) {
return TRUE;
}
}
{
// add the leading point if necessary
wxString str;
- if ( ext[0u] != _T('.') ) {
- str = _T('.');
+ if ( ext[0u] != T('.') ) {
+ str = T('.');
}
str << ext;
wxRegKey key(wxRegKey::HKCR, str);
if ( key.Open() ) {
// it's the default value of the key
- if ( key.QueryValue(_T(""), strFileType) ) {
+ if ( key.QueryValue(T(""), strFileType) ) {
// create the new wxFileType object
wxFileType *fileType = new wxFileType;
fileType->m_impl->Init(strFileType, ext);
{
// HACK I don't know of any official documentation which mentions this
// location, but as a matter of fact IE uses it, so why not we?
- static const wxChar *szMimeDbase = _T("MIME\\Database\\Content Type\\");
+ static const wxChar *szMimeDbase = T("MIME\\Database\\Content Type\\");
wxString strKey = szMimeDbase;
strKey << mimeType;
wxString ext;
wxRegKey key(wxRegKey::HKCR, strKey);
if ( key.Open() ) {
- if ( key.QueryValue(_T("Extension"), ext) ) {
+ if ( key.QueryValue(T("Extension"), ext) ) {
return GetFileTypeFromExtension(ext);
}
}
if ( command.IsEmpty() || (wxSystem(command) == 0) ) {
// ok, passed
- wxLogTrace(_T("Test '%s' for mime type '%s' succeeded."),
+ wxLogTrace(T("Test '%s' for mime type '%s' succeeded."),
command.c_str(), params.GetMimeType().c_str());
break;
}
else {
- wxLogTrace(_T("Test '%s' for mime type '%s' failed."),
+ wxLogTrace(T("Test '%s' for mime type '%s' failed."),
command.c_str(), params.GetMimeType().c_str());
}
// one extension in the space or comma delimitid list
wxString strExt;
for ( const wxChar *p = strExtensions; ; p++ ) {
- if ( *p == _T(' ') || *p == _T(',') || *p == _T('\0') ) {
+ if ( *p == T(' ') || *p == T(',') || *p == T('\0') ) {
if ( !strExt.IsEmpty() ) {
extensions.Add(strExt);
strExt.Empty();
//else: repeated spaces (shouldn't happen, but it's not that
// important if it does happen)
- if ( *p == _T('\0') )
+ if ( *p == T('\0') )
break;
}
- else if ( *p == _T('.') ) {
+ else if ( *p == T('.') ) {
// remove the dot from extension (but only if it's the first char)
if ( !strExt.IsEmpty() ) {
- strExt += _T('.');
+ strExt += T('.');
}
//else: no, don't append it
}
// (taken from metamail(1) sources)
static const wxChar *aStandardLocations[] =
{
- _T("/etc"),
- _T("/usr/etc"),
- _T("/usr/local/etc"),
- _T("/etc/mail"),
- _T("/usr/public/lib")
+ T("/etc"),
+ T("/usr/etc"),
+ T("/usr/local/etc"),
+ T("/etc/mail"),
+ T("/usr/public/lib")
};
// first read the system wide file(s)
for ( size_t n = 0; n < WXSIZEOF(aStandardLocations); n++ ) {
wxString dir = aStandardLocations[n];
- wxString file = dir + _T("/mailcap");
+ wxString file = dir + T("/mailcap");
if ( wxFile::Exists(file) ) {
ReadMailcap(file);
}
- file = dir + _T("/mime.types");
+ file = dir + T("/mime.types");
if ( wxFile::Exists(file) ) {
ReadMimeTypes(file);
}
}
- wxString strHome = wxGetenv(_T("HOME"));
+ wxString strHome = wxGetenv(T("HOME"));
// and now the users mailcap
- wxString strUserMailcap = strHome + _T("/.mailcap");
+ wxString strUserMailcap = strHome + T("/.mailcap");
if ( wxFile::Exists(strUserMailcap) ) {
ReadMailcap(strUserMailcap);
}
// read the users mime.types
- wxString strUserMimeTypes = strHome + _T("/.mime.types");
+ wxString strUserMimeTypes = strHome + T("/.mime.types");
if ( wxFile::Exists(strUserMimeTypes) ) {
ReadMimeTypes(strUserMimeTypes);
}
for ( size_t n = 0; n < count; n++ ) {
wxString extensions = m_aExtensions[n];
while ( !extensions.IsEmpty() ) {
- wxString field = extensions.BeforeFirst(_T(' '));
- extensions = extensions.AfterFirst(_T(' '));
+ wxString field = extensions.BeforeFirst(T(' '));
+ extensions = extensions.AfterFirst(T(' '));
// consider extensions as not being case-sensitive
if ( field.IsSameAs(ext, FALSE /* no case */) ) {
// then try to find "text/*" as match for "text/plain" (for example)
// NB: if mimeType doesn't contain '/' at all, BeforeFirst() will return
// the whole string - ok.
- wxString strCategory = mimetype.BeforeFirst(_T('/'));
+ wxString strCategory = mimetype.BeforeFirst(T('/'));
size_t nCount = m_aTypes.Count();
for ( size_t n = 0; n < nCount; n++ ) {
- if ( (m_aTypes[n].BeforeFirst(_T('/')) == strCategory ) &&
- m_aTypes[n].AfterFirst(_T('/')) == _T("*") ) {
+ if ( (m_aTypes[n].BeforeFirst(T('/')) == strCategory ) &&
+ m_aTypes[n].AfterFirst(T('/')) == T("*") ) {
index = n;
break;
}
size_t nExts = exts.GetCount();
for ( size_t nExt = 0; nExt < nExts; nExt++ ) {
if ( nExt > 0 ) {
- extensions += _T(' ');
+ extensions += T(' ');
}
extensions += exts[nExt];
}
AddMailcapInfo(filetype.GetMimeType(),
filetype.GetOpenCommand(),
filetype.GetPrintCommand(),
- _T(""),
+ T(""),
filetype.GetDescription());
}
m_aTypes.Add(strType);
m_aEntries.Add(entry);
- m_aExtensions.Add(_T(""));
+ m_aExtensions.Add(T(""));
m_aDescriptions.Add(strDesc);
}
else {
bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
{
- wxLogTrace(_T("--- Parsing mime.types file '%s' ---"), strFileName.c_str());
+ wxLogTrace(T("--- Parsing mime.types file '%s' ---"), strFileName.c_str());
wxTextFile file(strFileName);
if ( !file.Open() )
pc++;
// comment?
- if ( *pc == _T('#') ) {
+ if ( *pc == T('#') ) {
// skip the whole line
pc = NULL;
continue;
}
// detect file format
- const wxChar *pEqualSign = wxStrchr(pc, _T('='));
+ const wxChar *pEqualSign = wxStrchr(pc, T('='));
if ( pEqualSign == NULL ) {
// brief format
// ------------
// first field is mime type
- for ( strMimeType.Empty(); !wxIsspace(*pc) && *pc != _T('\0'); pc++ ) {
+ for ( strMimeType.Empty(); !wxIsspace(*pc) && *pc != T('\0'); pc++ ) {
strMimeType += *pc;
}
;
const wxChar *pEnd;
- if ( *pc == _T('"') ) {
+ if ( *pc == T('"') ) {
// the string is quoted and ends at the matching quote
- pEnd = wxStrchr(++pc, _T('"'));
+ pEnd = wxStrchr(++pc, T('"'));
if ( pEnd == NULL ) {
wxLogWarning(_("Mime.types file %s, line %d: unterminated "
"quoted string."),
wxString strRHS(pc, pEnd - pc);
// check what follows this entry
- if ( *pEnd == _T('"') ) {
+ if ( *pEnd == T('"') ) {
// skip this quote
pEnd++;
}
// if there is something left, it may be either a '\\' to continue
// the line or the next field of the same entry
- bool entryEnded = *pc == _T('\0'),
+ bool entryEnded = *pc == T('\0'),
nextFieldOnSameLine = FALSE;
if ( !entryEnded ) {
- nextFieldOnSameLine = ((*pc != _T('\\')) || (pc[1] != _T('\0')));
+ nextFieldOnSameLine = ((*pc != T('\\')) || (pc[1] != T('\0')));
}
// now see what we got
- if ( strLHS == _T("type") ) {
+ if ( strLHS == T("type") ) {
strMimeType = strRHS;
}
- else if ( strLHS == _T("desc") ) {
+ else if ( strLHS == T("desc") ) {
strDesc = strRHS;
}
- else if ( strLHS == _T("exts") ) {
+ else if ( strLHS == T("exts") ) {
strExtensions = strRHS;
}
else {
// although it doesn't seem to be covered by RFCs, some programs
// (notably Netscape) create their entries with several comma
// separated extensions (RFC mention the spaces only)
- strExtensions.Replace(_T(","), _T(" "));
+ strExtensions.Replace(T(","), T(" "));
// also deal with the leading dot
- if ( !strExtensions.IsEmpty() && strExtensions[0] == _T('.') ) {
+ if ( !strExtensions.IsEmpty() && strExtensions[0] == T('.') ) {
strExtensions.erase(0, 1);
}
bool wxMimeTypesManagerImpl::ReadMailcap(const wxString& strFileName,
bool fallback)
{
- wxLogTrace(_T("--- Parsing mailcap file '%s' ---"), strFileName.c_str());
+ wxLogTrace(T("--- Parsing mailcap file '%s' ---"), strFileName.c_str());
wxTextFile file(strFileName);
if ( !file.Open() )
pc++;
// comment or empty string?
- if ( *pc == _T('#') || *pc == _T('\0') )
+ if ( *pc == T('#') || *pc == T('\0') )
continue;
// no, do parse
curField; // accumulator
for ( bool cont = TRUE; cont; pc++ ) {
switch ( *pc ) {
- case _T('\\'):
+ case T('\\'):
// interpret the next character literally (notice that
// backslash can be used for line continuation)
- if ( *++pc == _T('\0') ) {
+ if ( *++pc == T('\0') ) {
// fetch the next line.
// pc currently points to nowhere, but after the next
}
break;
- case _T('\0'):
+ case T('\0'):
cont = FALSE; // end of line reached, exit the loop
// fall through
- case _T(';'):
+ case T(';'):
// store this field and start looking for the next one
// trim whitespaces from both sides
switch ( currentToken ) {
case Field_Type:
strType = curField;
- if ( strType.Find(_T('/')) == wxNOT_FOUND ) {
+ if ( strType.Find(T('/')) == wxNOT_FOUND ) {
// we interpret "type" as "type/*"
- strType += _T("/*");
+ strType += T("/*");
}
currentToken = Field_OpenCmd;
bool ok = TRUE;
// is this something of the form foo=bar?
- const wxChar *pEq = wxStrchr(curField, _T('='));
+ const wxChar *pEq = wxStrchr(curField, T('='));
if ( pEq != NULL ) {
- wxString lhs = curField.BeforeFirst(_T('=')),
- rhs = curField.AfterFirst(_T('='));
+ wxString lhs = curField.BeforeFirst(T('=')),
+ rhs = curField.AfterFirst(T('='));
lhs.Trim(TRUE); // from right
rhs.Trim(FALSE); // from left
- if ( lhs == _T("print") )
+ if ( lhs == T("print") )
strPrintCmd = rhs;
- else if ( lhs == _T("test") )
+ else if ( lhs == T("test") )
strTest = rhs;
- else if ( lhs == _T("description") ) {
+ else if ( lhs == T("description") ) {
// it might be quoted
- if ( rhs[0u] == _T('"') &&
- rhs.Last() == _T('"') ) {
+ if ( rhs[0u] == T('"') &&
+ rhs.Last() == T('"') ) {
strDesc = wxString(rhs.c_str() + 1,
rhs.Len() - 2);
}
strDesc = rhs;
}
}
- else if ( lhs == _T("compose") ||
- lhs == _T("composetyped") ||
- lhs == _T("notes") ||
- lhs == _T("edit") )
+ else if ( lhs == T("compose") ||
+ lhs == T("composetyped") ||
+ lhs == T("notes") ||
+ lhs == T("edit") )
; // ignore
else
ok = FALSE;
// TODO support the flags:
// 1. create an xterm for 'needsterminal'
// 2. append "| $PAGER" for 'copiousoutput'
- if ( curField == _T("needsterminal") )
+ if ( curField == T("needsterminal") )
needsterminal = TRUE;
- else if ( curField == _T("copiousoutput") )
+ else if ( curField == T("copiousoutput") )
copiousoutput = TRUE;
- else if ( curField == _T("textualnewlines") )
+ else if ( curField == T("textualnewlines") )
; // ignore
else
ok = FALSE;
// programmer
wxLogDebug
(
- _T("Mailcap file %s, line %d: unknown "
+ T("Mailcap file %s, line %d: unknown "
"field '%s' for the MIME type "
"'%s' ignored."),
strFileName.c_str(),
break;
default:
- wxFAIL_MSG(_T("unknown field type in mailcap"));
+ wxFAIL_MSG(T("unknown field type in mailcap"));
}
// next token starts immediately after ';'
m_aTypes.Add(strType);
m_aEntries.Add(entry);
- m_aExtensions.Add(_T(""));
+ m_aExtensions.Add(T(""));
m_aDescriptions.Add(strDesc);
}
else {
#endif
#if !USE_SHARED_LIBRARY
-wxClassInfo wxObject::sm_classwxObject((wxChar *) _T("wxObject"), (wxChar *) NULL, (wxChar *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
+wxClassInfo wxObject::sm_classwxObject((wxChar *) T("wxObject"), (wxChar *) NULL, (wxChar *) NULL, (int ) sizeof(wxObject), (wxObjectConstructorFn) NULL);
wxClassInfo* wxClassInfo::sm_first = (wxClassInfo *) NULL;
wxHashTable* wxClassInfo::sm_classTable = (wxHashTable*) NULL;
#endif
{
wxString name;
- name.Printf(_T("%x"), (unsigned long)obj);
+ name.Printf(T("%x"), (unsigned long)obj);
return name;
}
if (info.duplicate) {
data_s.WriteString(TAG_DUPLICATE_OBJECT);
data_s.WriteString(GetObjectName(info.object));
- wxPrintf(_T("info.object (dup %s)\n"), info.object->GetClassInfo()->GetClassName());
+ wxPrintf(T("info.object (dup %s)\n"), info.object->GetClassInfo()->GetClassName());
return;
}
if (info.object) {
data_s.WriteString(info.object->GetClassInfo()->GetClassName());
- wxPrintf(_T("info.object (%s)\n"), info.object->GetClassInfo()->GetClassName());
+ wxPrintf(T("info.object (%s)\n"), info.object->GetClassInfo()->GetClassName());
} else {
data_s.WriteString(TAG_EMPTY_OBJECT);
- wxPrintf(_T("info.object (NULL)\n"));
+ wxPrintf(T("info.object (NULL)\n"));
return;
}
int wxPreviewControlBar::GetZoomControl()
{
wxChar buf[20];
- if (m_zoomControl && (m_zoomControl->GetStringSelection() != _T("")))
+ if (m_zoomControl && (m_zoomControl->GetStringSelection() != T("")))
{
wxStrcpy(buf, m_zoomControl->GetStringSelection());
buf[wxStrlen(buf) - 1] = 0;
{ "wxLB_EXTENDED", wxLB_EXTENDED },
{ "wxLB_NEEDED_SB", wxLB_NEEDED_SB },
{ "wxLB_ALWAYS_SB", wxLB_ALWAYS_SB },
- { "wxLB_SORT", wxLB_SORT },
+ { "wxLB_SORT(", wxLB_SORT },
{ "wxLB_OWNERDRAW", wxLB_OWNERDRAW },
{ "wxLB_HSCROLL", wxLB_HSCROLL },
{ "wxCB_SIMPLE", wxCB_SIMPLE },
{ "wxCB_DROPDOWN", wxCB_DROPDOWN },
{ "wxCB_READONLY", wxCB_READONLY },
- { "wxCB_SORT", wxCB_SORT },
+ { "wxCB_SORT(", wxCB_SORT },
/* wxGauge */
{ "wxGA_PROGRESSBAR", wxGA_PROGRESSBAR },
{ "wxSL_VERTICAL", wxSL_VERTICAL },
{ "wxSL_AUTOTICKS", wxSL_AUTOTICKS },
{ "wxSL_LABELS", wxSL_LABELS },
- { "wxSL_LEFT", wxSL_LEFT },
+ { "wxSL_LEFT(", wxSL_LEFT },
{ "wxSL_TOP", wxSL_TOP },
- { "wxSL_RIGHT", wxSL_RIGHT },
+ { "wxSL_RIGHT(", wxSL_RIGHT },
{ "wxSL_BOTTOM", wxSL_BOTTOM },
{ "wxSL_BOTH", wxSL_BOTH },
{ "wxSL_SELRANGE", wxSL_SELRANGE },
/* wxTreeCtrl */
{ "wxTR_HAS_BUTTONS", wxTR_HAS_BUTTONS },
{ "wxTR_EDIT_LABELS", wxTR_EDIT_LABELS },
- { "wxTR_LINES_AT_ROOT", wxTR_LINES_AT_ROOT },
+ { "wxTR_LINES_AT_ROOT(", wxTR_LINES_AT_ROOT },
/* wxListCtrl */
{ "wxLC_ICON", wxLC_ICON },
{ "wxLC_SMALL_ICON", wxLC_SMALL_ICON },
- { "wxLC_LIST", wxLC_LIST },
- { "wxLC_REPORT", wxLC_REPORT },
+ { "wxLC_LIST(", wxLC_LIST },
+ { "wxLC_REPORT(", wxLC_REPORT },
{ "wxLC_ALIGN_TOP", wxLC_ALIGN_TOP },
- { "wxLC_ALIGN_LEFT", wxLC_ALIGN_LEFT },
+ { "wxLC_ALIGN_LEFT(", wxLC_ALIGN_LEFT },
{ "wxLC_AUTOARRANGE", wxLC_AUTOARRANGE },
- { "wxLC_USER_TEXT", wxLC_USER_TEXT },
+ { "wxLC_USER_TEXT(", wxLC_USER_TEXT },
{ "wxLC_EDIT_LABELS", wxLC_EDIT_LABELS },
{ "wxLC_NO_HEADER", wxLC_NO_HEADER },
{ "wxLC_NO_SORT_HEADER", wxLC_NO_SORT_HEADER },
/* wxControl */
{ "wxFIXED_LENGTH", wxFIXED_LENGTH},
- { "wxALIGN_LEFT", wxALIGN_LEFT},
+ { "wxALIGN_LEFT(", wxALIGN_LEFT},
{ "wxALIGN_CENTER", wxALIGN_CENTER},
{ "wxALIGN_CENTRE", wxALIGN_CENTRE},
- { "wxALIGN_RIGHT", wxALIGN_RIGHT},
+ { "wxALIGN_RIGHT(", wxALIGN_RIGHT},
{ "wxCOLOURED", wxCOLOURED},
/* wxToolBar */
{ "wxTB_3DBUTTONS", wxTB_3DBUTTONS},
{ "wxTB_HORIZONTAL", wxTB_HORIZONTAL},
{ "wxTB_VERTICAL", wxTB_VERTICAL},
- { "wxTB_FLAT", wxTB_FLAT},
+ { "wxTB_FLAT(", wxTB_FLAT},
/* Generic */
{ "wxVSCROLL", wxVSCROLL },
{ "wxMINIMIZE", wxICONIZE},
{ "wxMAXIMIZE", wxMAXIMIZE},
{ "wxSDI", 0},
- { "wxMDI_PARENT", 0},
+ { "wxMDI_PARENT(", 0},
{ "wxMDI_CHILD", 0},
{ "wxTHICK_FRAME", wxTHICK_FRAME},
{ "wxRESIZE_BORDER", wxRESIZE_BORDER},
{ "wxNATIVE_IMPL", 0},
{ "wxEXTENDED_IMPL", 0},
{ "wxBACKINGSTORE", wxBACKINGSTORE},
-// { "wxFLAT", wxFLAT},
+// { "wxFLAT(", wxFLAT},
// { "wxMOTIF_RESIZE", wxMOTIF_RESIZE},
{ "wxFIXED_LENGTH", 0},
{ "wxDOUBLE_BORDER", wxDOUBLE_BORDER},
{ "wxCLIP_CHILDREN", wxCLIP_CHILDREN},
{ "wxTINY_CAPTION_HORIZ", wxTINY_CAPTION_HORIZ},
- { "wxTINY_CAPTION_VERT", wxTINY_CAPTION_VERT},
+ { "wxTINY_CAPTION_VERT(", wxTINY_CAPTION_VERT},
// Text font families
- { "wxDEFAULT", wxDEFAULT},
+ { "wxDEFAULT(", wxDEFAULT},
{ "wxDECORATIVE", wxDECORATIVE},
{ "wxROMAN", wxROMAN},
- { "wxSCRIPT", wxSCRIPT},
+ { "wxSCRIPT(", wxSCRIPT},
{ "wxSWISS", wxSWISS},
{ "wxMODERN", wxMODERN},
{ "wxTELETYPE", wxTELETYPE},
{ "wxVARIABLE", wxVARIABLE},
{ "wxFIXED", wxFIXED},
{ "wxNORMAL", wxNORMAL},
- { "wxLIGHT", wxLIGHT},
+ { "wxLIGHT(", wxLIGHT},
{ "wxBOLD", wxBOLD},
{ "wxITALIC", wxITALIC},
- { "wxSLANT", wxSLANT},
+ { "wxSLANT(", wxSLANT},
{ "wxSOLID", wxSOLID},
- { "wxDOT", wxDOT},
+ { "wxDOT(", wxDOT},
{ "wxLONG_DASH", wxLONG_DASH},
{ "wxSHORT_DASH", wxSHORT_DASH},
{ "wxDOT_DASH", wxDOT_DASH},
{ "wxUSER_DASH", wxUSER_DASH},
- { "wxTRANSPARENT", wxTRANSPARENT},
+ { "wxTRANSPARENT(", wxTRANSPARENT},
{ "wxSTIPPLE", wxSTIPPLE},
{ "wxBDIAGONAL_HATCH", wxBDIAGONAL_HATCH},
{ "wxCROSSDIAG_HATCH", wxCROSSDIAG_HATCH},
{ "wxJOIN_ROUND", wxJOIN_ROUND},
{ "wxCAP_ROUND", wxCAP_ROUND},
{ "wxCAP_PROJECTING", wxCAP_PROJECTING},
- { "wxCAP_BUTT", wxCAP_BUTT},
+ { "wxCAP_BUTT(", wxCAP_BUTT},
// Logical ops
{ "wxCLEAR", wxCLEAR},
{ "wxXOR", wxXOR},
- { "wxINVERT", wxINVERT},
+ { "wxINVERT(", wxINVERT},
{ "wxOR_REVERSE", wxOR_REVERSE},
{ "wxAND_REVERSE", wxAND_REVERSE},
{ "wxCOPY", wxCOPY},
{ "wxAND", wxAND},
- { "wxAND_INVERT", wxAND_INVERT},
+ { "wxAND_INVERT(", wxAND_INVERT},
{ "wxNO_OP", wxNO_OP},
{ "wxNOR", wxNOR},
{ "wxEQUIV", wxEQUIV},
- { "wxSRC_INVERT", wxSRC_INVERT},
- { "wxOR_INVERT", wxOR_INVERT},
+ { "wxSRC_INVERT(", wxSRC_INVERT},
+ { "wxOR_INVERT(", wxOR_INVERT},
{ "wxNAND", wxNAND},
{ "wxOR", wxOR},
- { "wxSET", wxSET},
+ { "wxSET(", wxSET},
{ "wxFLOOD_SURFACE", wxFLOOD_SURFACE},
{ "wxFLOOD_BORDER", wxFLOOD_BORDER},
void wxResourceTable::AddResource(wxItemResource *item)
{
wxString name = item->GetName();
- if (name == _T(""))
+ if (name == T(""))
name = item->GetTitle();
- if (name == _T(""))
- name = _T("no name");
+ if (name == T(""))
+ name = T("no name");
// Delete existing resource, if any.
Delete(name);
// Register pre-loaded bitmap data
wxItemResource *item = new wxItemResource;
// item->SetType(wxRESOURCE_TYPE_XBM_DATA);
- item->SetType(_T("wxXBMData"));
+ item->SetType(T("wxXBMData"));
item->SetName(name);
item->SetValue1((long)bits);
item->SetValue2((long)width);
// Register pre-loaded bitmap data
wxItemResource *item = new wxItemResource;
// item->SetType(wxRESOURCE_TYPE_XPM_DATA);
- item->SetType(_T("wxXPMData"));
+ item->SetType(T("wxXPMData"));
item->SetName(name);
item->SetValue1((long)data);
AddResource(item);
size = wxSize(childResource->GetWidth(), childResource->GetHeight());
}
- if (itemType == wxString(_T("wxButton")) || itemType == wxString(_T("wxBitmapButton")))
+ if (itemType == wxString(T("wxButton")) || itemType == wxString(T("wxBitmapButton")))
{
- if (childResource->GetValue4() != _T(""))
+ if (childResource->GetValue4() != T(""))
{
// Bitmap button
wxBitmap bitmap = childResource->GetBitmap();
control = new wxButton(parent, id, childResource->GetTitle(), pos, size,
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
}
- else if (itemType == wxString(_T("wxMessage")) || itemType == wxString(_T("wxStaticText")) ||
- itemType == wxString(_T("wxStaticBitmap")))
+ else if (itemType == wxString(T("wxMessage")) || itemType == wxString(T("wxStaticText")) ||
+ itemType == wxString(T("wxStaticBitmap")))
{
- if (childResource->GetValue4() != _T(""))
+ if (childResource->GetValue4() != T(""))
{
// Bitmap message
wxBitmap bitmap = childResource->GetBitmap();
childResource->GetStyle(), childResource->GetName());
}
}
- else if (itemType == wxString(_T("wxText")) || itemType == wxString(_T("wxTextCtrl")) || itemType == wxString(_T("wxMultiText")))
+ else if (itemType == wxString(T("wxText")) || itemType == wxString(T("wxTextCtrl")) || itemType == wxString(T("wxMultiText")))
{
control = new wxTextCtrl(parent, id, childResource->GetValue4(), pos, size,
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
}
- else if (itemType == wxString(_T("wxCheckBox")))
+ else if (itemType == wxString(T("wxCheckBox")))
{
control = new wxCheckBox(parent, id, childResource->GetTitle(), pos, size,
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
((wxCheckBox *)control)->SetValue((childResource->GetValue1() != 0));
}
#if wxUSE_GAUGE
- else if (itemType == wxString(_T("wxGauge")))
+ else if (itemType == wxString(T("wxGauge")))
{
control = new wxGauge(parent, id, (int)childResource->GetValue2(), pos, size,
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
}
#endif
#if wxUSE_RADIOBTN
- else if (itemType == wxString(_T("wxRadioButton")))
+ else if (itemType == wxString(T("wxRadioButton")))
{
control = new wxRadioButton(parent, id, childResource->GetTitle(), // (int)childResource->GetValue1(),
pos, size,
}
#endif
#if wxUSE_SCROLLBAR
- else if (itemType == wxString(_T("wxScrollBar")))
+ else if (itemType == wxString(T("wxScrollBar")))
{
control = new wxScrollBar(parent, id, pos, size,
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
}
#endif
- else if (itemType == wxString(_T("wxSlider")))
+ else if (itemType == wxString(T("wxSlider")))
{
control = new wxSlider(parent, id, (int)childResource->GetValue1(),
(int)childResource->GetValue2(), (int)childResource->GetValue3(), pos, size,
childResource->GetStyle(), wxDefaultValidator, childResource->GetName());
}
- else if (itemType == wxString(_T("wxGroupBox")) || itemType == wxString(_T("wxStaticBox")))
+ else if (itemType == wxString(T("wxGroupBox")) || itemType == wxString(T("wxStaticBox")))
{
control = new wxStaticBox(parent, id, childResource->GetTitle(), pos, size,
childResource->GetStyle(), childResource->GetName());
}
- else if (itemType == wxString(_T("wxListBox")))
+ else if (itemType == wxString(T("wxListBox")))
{
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
if (strings)
delete[] strings;
}
- else if (itemType == wxString(_T("wxChoice")))
+ else if (itemType == wxString(T("wxChoice")))
{
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
delete[] strings;
}
#if wxUSE_COMBOBOX
- else if (itemType == wxString(_T("wxComboBox")))
+ else if (itemType == wxString(T("wxComboBox")))
{
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
delete[] strings;
}
#endif
- else if (itemType == wxString(_T("wxRadioBox")))
+ else if (itemType == wxString(T("wxRadioBox")))
{
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
wxString functor(clause->Functor());
wxItemResource *item = (wxItemResource *) NULL;
- if (functor == _T("dialog"))
+ if (functor == T("dialog"))
item = wxResourceInterpretDialog(table, clause);
- else if (functor == _T("panel"))
+ else if (functor == T("panel"))
item = wxResourceInterpretDialog(table, clause, TRUE);
- else if (functor == _T("menubar"))
+ else if (functor == T("menubar"))
item = wxResourceInterpretMenuBar(table, clause);
- else if (functor == _T("menu"))
+ else if (functor == T("menu"))
item = wxResourceInterpretMenu(table, clause);
- else if (functor == _T("string"))
+ else if (functor == T("string"))
item = wxResourceInterpretString(table, clause);
- else if (functor == _T("bitmap"))
+ else if (functor == T("bitmap"))
item = wxResourceInterpretBitmap(table, clause);
- else if (functor == _T("icon"))
+ else if (functor == T("icon"))
item = wxResourceInterpretIcon(table, clause);
if (item)
{
// Remove any existing resource of same name
- if (item->GetName() != _T(""))
+ if (item->GetName() != T(""))
table.DeleteResource(item->GetName());
table.AddResource(item);
}
static const wxChar *g_ValidControlClasses[] =
{
- _T("wxButton"),
- _T("wxBitmapButton"),
- _T("wxMessage"),
- _T("wxStaticText"),
- _T("wxStaticBitmap"),
- _T("wxText"),
- _T("wxTextCtrl"),
- _T("wxMultiText"),
- _T("wxListBox"),
- _T("wxRadioBox"),
- _T("wxRadioButton"),
- _T("wxCheckBox"),
- _T("wxBitmapCheckBox"),
- _T("wxGroupBox"),
- _T("wxStaticBox"),
- _T("wxSlider"),
- _T("wxGauge"),
- _T("wxScrollBar"),
- _T("wxChoice"),
- _T("wxComboBox")
+ T("wxButton"),
+ T("wxBitmapButton"),
+ T("wxMessage"),
+ T("wxStaticText"),
+ T("wxStaticBitmap"),
+ T("wxText"),
+ T("wxTextCtrl"),
+ T("wxMultiText"),
+ T("wxListBox"),
+ T("wxRadioBox"),
+ T("wxRadioButton"),
+ T("wxCheckBox"),
+ T("wxBitmapCheckBox"),
+ T("wxGroupBox"),
+ T("wxStaticBox"),
+ T("wxSlider"),
+ T("wxGauge"),
+ T("wxScrollBar"),
+ T("wxChoice"),
+ T("wxComboBox")
};
static bool wxIsValidControlClass(const wxString& c)
{
wxItemResource *dialogItem = new wxItemResource;
if (isPanel)
- dialogItem->SetType(_T("wxPanel"));
+ dialogItem->SetType(T("wxPanel"));
else
- dialogItem->SetType(_T("wxDialog"));
- wxString style = _T("");
- wxString title = _T("");
- wxString name = _T("");
- wxString backColourHex = _T("");
- wxString labelColourHex = _T("");
- wxString buttonColourHex = _T("");
+ dialogItem->SetType(T("wxDialog"));
+ wxString style = T("");
+ wxString title = T("");
+ wxString name = T("");
+ wxString backColourHex = T("");
+ wxString labelColourHex = T("");
+ wxString buttonColourHex = T("");
long windowStyle = wxDEFAULT_DIALOG_STYLE;
if (isPanel)
wxExpr *labelFontExpr = (wxExpr *) NULL;
wxExpr *buttonFontExpr = (wxExpr *) NULL;
wxExpr *fontExpr = (wxExpr *) NULL;
- expr->GetAttributeValue(_T("style"), style);
- expr->GetAttributeValue(_T("name"), name);
- expr->GetAttributeValue(_T("title"), title);
- expr->GetAttributeValue(_T("x"), x);
- expr->GetAttributeValue(_T("y"), y);
- expr->GetAttributeValue(_T("width"), width);
- expr->GetAttributeValue(_T("height"), height);
- expr->GetAttributeValue(_T("modal"), isModal);
- expr->GetAttributeValue(_T("label_font"), &labelFontExpr);
- expr->GetAttributeValue(_T("button_font"), &buttonFontExpr);
- expr->GetAttributeValue(_T("font"), &fontExpr);
- expr->GetAttributeValue(_T("background_colour"), backColourHex);
- expr->GetAttributeValue(_T("label_colour"), labelColourHex);
- expr->GetAttributeValue(_T("button_colour"), buttonColourHex);
+ expr->GetAttributeValue(T("style"), style);
+ expr->GetAttributeValue(T("name"), name);
+ expr->GetAttributeValue(T("title"), title);
+ expr->GetAttributeValue(T("x"), x);
+ expr->GetAttributeValue(T("y"), y);
+ expr->GetAttributeValue(T("width"), width);
+ expr->GetAttributeValue(T("height"), height);
+ expr->GetAttributeValue(T("modal"), isModal);
+ expr->GetAttributeValue(T("label_font"), &labelFontExpr);
+ expr->GetAttributeValue(T("button_font"), &buttonFontExpr);
+ expr->GetAttributeValue(T("font"), &fontExpr);
+ expr->GetAttributeValue(T("background_colour"), backColourHex);
+ expr->GetAttributeValue(T("label_colour"), labelColourHex);
+ expr->GetAttributeValue(T("button_colour"), buttonColourHex);
int useDialogUnits = 0;
- expr->GetAttributeValue(_T("use_dialog_units"), useDialogUnits);
+ expr->GetAttributeValue(T("use_dialog_units"), useDialogUnits);
if (useDialogUnits != 0)
dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_DIALOG_UNITS);
int useDefaults = 0;
- expr->GetAttributeValue(_T("use_system_defaults"), useDefaults);
+ expr->GetAttributeValue(T("use_system_defaults"), useDefaults);
if (useDefaults != 0)
dialogItem->SetResourceStyle(dialogItem->GetResourceStyle() | wxRESOURCE_USE_DEFAULTS);
long id = 0;
- expr->GetAttributeValue(_T("id"), id);
+ expr->GetAttributeValue(T("id"), id);
dialogItem->SetId(id);
- if (style != _T(""))
+ if (style != T(""))
{
windowStyle = wxParseWindowStyle(style);
}
dialogItem->SetTitle(title);
dialogItem->SetSize(x, y, width, height);
- if (backColourHex != _T(""))
+ if (backColourHex != T(""))
{
int r = 0;
int g = 0;
b = wxHexToDec(backColourHex.Mid(4, 2));
dialogItem->SetBackgroundColour(wxColour((unsigned char)r,(unsigned char)g,(unsigned char)b));
}
- if (labelColourHex != _T(""))
+ if (labelColourHex != T(""))
{
int r = 0;
int g = 0;
b = wxHexToDec(labelColourHex.Mid(4, 2));
dialogItem->SetLabelColour(wxColour((unsigned char)r,(unsigned char)g,(unsigned char)b));
}
- if (buttonColourHex != _T(""))
+ if (buttonColourHex != T(""))
{
int r = 0;
int g = 0;
if (controlExpr->Number() == 3)
{
wxString controlKeyword(controlExpr->Nth(1)->StringValue());
- if (controlKeyword != _T("") && controlKeyword == _T("control"))
+ if (controlKeyword != T("") && controlKeyword == T("control"))
{
// The value part: always a list.
wxExpr *listExpr = controlExpr->Nth(2);
controlItem->SetType(controlType);
controlItem->SetId(id);
- if (controlType == _T("wxButton"))
+ if (controlType == T("wxButton"))
{
// Check for bitmap resource name (in case loading old-style resource file)
if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
wxString str(expr->Nth(count)->StringValue());
count ++;
- if (str != _T(""))
+ if (str != T(""))
{
controlItem->SetValue4(str);
- controlItem->SetType(_T("wxBitmapButton"));
+ controlItem->SetType(T("wxBitmapButton"));
}
}
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
}
- else if (controlType == _T("wxBitmapButton"))
+ else if (controlType == T("wxBitmapButton"))
{
// Check for bitmap resource name
if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
}
}
- else if (controlType == _T("wxCheckBox"))
+ else if (controlType == T("wxCheckBox"))
{
// Check for default value
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
}
}
#if wxUSE_RADIOBTN
- else if (controlType == _T("wxRadioButton"))
+ else if (controlType == T("wxRadioButton"))
{
// Check for default value
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
}
}
#endif
- else if (controlType == _T("wxText") || controlType == _T("wxTextCtrl") || controlType == _T("wxMultiText"))
+ else if (controlType == T("wxText") || controlType == T("wxTextCtrl") || controlType == T("wxMultiText"))
{
// Check for default value
if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
}
}
}
- else if (controlType == _T("wxMessage") || controlType == _T("wxStaticText"))
+ else if (controlType == T("wxMessage") || controlType == T("wxStaticText"))
{
// Check for bitmap resource name (in case it's an old-style .wxr file)
if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
wxString str(expr->Nth(count)->StringValue());
controlItem->SetValue4(str);
count ++;
- controlItem->SetType(_T("wxStaticText"));
+ controlItem->SetType(T("wxStaticText"));
}
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
}
- else if (controlType == _T("wxStaticBitmap"))
+ else if (controlType == T("wxStaticBitmap"))
{
// Check for bitmap resource name
if (expr->Nth(count) && ((expr->Nth(count)->Type() == PrologString) || (expr->Nth(count)->Type() == PrologWord)))
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
}
- else if (controlType == _T("wxGroupBox") || controlType == _T("wxStaticBox"))
+ else if (controlType == T("wxGroupBox") || controlType == T("wxStaticBox"))
{
if (expr->Nth(count) && expr->Nth(count)->Type() == PrologList)
controlItem->SetFont(wxResourceInterpretFontSpec(expr->Nth(count)));
}
- else if (controlType == _T("wxGauge"))
+ else if (controlType == T("wxGauge"))
{
// Check for default value
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
}
}
}
- else if (controlType == _T("wxSlider"))
+ else if (controlType == T("wxSlider"))
{
// Check for default value
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
}
}
}
- else if (controlType == _T("wxScrollBar"))
+ else if (controlType == T("wxScrollBar"))
{
// DEFAULT VALUE
if (expr->Nth(count) && (expr->Nth(count)->Type() == PrologInteger))
}
}
}
- else if (controlType == _T("wxListBox"))
+ else if (controlType == T("wxListBox"))
{
wxExpr *valueList = (wxExpr *) NULL;
}
}
}
- else if (controlType == _T("wxChoice"))
+ else if (controlType == T("wxChoice"))
{
wxExpr *valueList = (wxExpr *) NULL;
// Check for default value list
}
}
#if wxUSE_COMBOBOX
- else if (controlType == _T("wxComboBox"))
+ else if (controlType == T("wxComboBox"))
{
wxExpr *textValue = expr->Nth(count);
if (textValue && (textValue->Type() == PrologString || textValue->Type() == PrologWord))
}
#endif
#if 1
- else if (controlType == _T("wxRadioBox"))
+ else if (controlType == T("wxRadioBox"))
{
wxExpr *valueList = (wxExpr *) NULL;
// Check for default value list
if (expr->Number() == 0)
{
// item->SetType(wxRESOURCE_TYPE_SEPARATOR);
- item->SetType(_T("wxMenuSeparator"));
+ item->SetType(T("wxMenuSeparator"));
return item;
}
else
{
// item->SetType(wxTYPE_MENU); // Well, menu item, but doesn't matter.
- item->SetType(_T("wxMenu")); // Well, menu item, but doesn't matter.
+ item->SetType(T("wxMenu")); // Well, menu item, but doesn't matter.
if (labelExpr)
{
wxString str(labelExpr->StringValue());
wxItemResource *wxResourceInterpretMenu(wxResourceTable& table, wxExpr *expr)
{
wxExpr *listExpr = (wxExpr *) NULL;
- expr->GetAttributeValue(_T("menu"), &listExpr);
+ expr->GetAttributeValue(T("menu"), &listExpr);
if (!listExpr)
return (wxItemResource *) NULL;
return (wxItemResource *) NULL;
wxString name;
- if (expr->GetAttributeValue(_T("name"), name))
+ if (expr->GetAttributeValue(T("name"), name))
{
menuResource->SetName(name);
}
wxItemResource *wxResourceInterpretMenuBar(wxResourceTable& table, wxExpr *expr)
{
wxExpr *listExpr = (wxExpr *) NULL;
- expr->GetAttributeValue(_T("menu"), &listExpr);
+ expr->GetAttributeValue(T("menu"), &listExpr);
if (!listExpr)
return (wxItemResource *) NULL;
wxItemResource *resource = new wxItemResource;
- resource->SetType(_T("wxMenu"));
+ resource->SetType(T("wxMenu"));
// resource->SetType(wxTYPE_MENU);
wxExpr *element = listExpr->GetFirst();
}
wxString name;
- if (expr->GetAttributeValue(_T("name"), name))
+ if (expr->GetAttributeValue(T("name"), name))
{
resource->SetName(name);
}
{
wxItemResource *bitmapItem = new wxItemResource;
// bitmapItem->SetType(wxTYPE_BITMAP);
- bitmapItem->SetType(_T("wxBitmap"));
+ bitmapItem->SetType(T("wxBitmap"));
wxString name;
- if (expr->GetAttributeValue(_T("name"), name))
+ if (expr->GetAttributeValue(T("name"), name))
{
bitmapItem->SetName(name);
}
if (bitmapExpr->Number() == 3)
{
wxString bitmapKeyword(bitmapExpr->Nth(1)->StringValue());
- if (bitmapKeyword == _T("bitmap") || bitmapKeyword == _T("icon"))
+ if (bitmapKeyword == T("bitmap") || bitmapKeyword == T("icon"))
{
// The value part: always a list.
wxExpr *listExpr = bitmapExpr->Nth(2);
{
wxItemResource *bitmapSpec = new wxItemResource;
// bitmapSpec->SetType(wxTYPE_BITMAP);
- bitmapSpec->SetType(_T("wxBitmap"));
+ bitmapSpec->SetType(T("wxBitmap"));
// List is of form: [filename, bitmaptype, platform, colours, xresolution, yresolution]
// where everything after 'filename' is optional.
wxExpr *coloursExpr = listExpr->Nth(3);
wxExpr *xresExpr = listExpr->Nth(4);
wxExpr *yresExpr = listExpr->Nth(5);
- if (nameExpr && nameExpr->StringValue() != _T(""))
+ if (nameExpr && nameExpr->StringValue() != T(""))
{
bitmapSpec->SetName(nameExpr->StringValue());
}
- if (typeExpr && typeExpr->StringValue() != _T(""))
+ if (typeExpr && typeExpr->StringValue() != T(""))
{
bitmapSpec->SetValue1(wxParseWindowStyle(typeExpr->StringValue()));
}
else
bitmapSpec->SetValue1(0);
- if (platformExpr && platformExpr->StringValue() != _T(""))
+ if (platformExpr && platformExpr->StringValue() != T(""))
{
wxString plat(platformExpr->StringValue());
- if (plat == _T("windows") || plat == _T("WINDOWS"))
+ if (plat == T("windows") || plat == T("WINDOWS"))
bitmapSpec->SetValue2(RESOURCE_PLATFORM_WINDOWS);
- else if (plat == _T("x") || plat == _T("X"))
+ else if (plat == T("x") || plat == T("X"))
bitmapSpec->SetValue2(RESOURCE_PLATFORM_X);
- else if (plat == _T("mac") || plat == _T("MAC"))
+ else if (plat == T("mac") || plat == T("MAC"))
bitmapSpec->SetValue2(RESOURCE_PLATFORM_MAC);
else
bitmapSpec->SetValue2(RESOURCE_PLATFORM_ANY);
if (item)
{
// item->SetType(wxTYPE_ICON);
- item->SetType(_T("wxIcon"));
+ item->SetType(T("wxIcon"));
return item;
}
else
int style = wxNORMAL;
int weight = wxNORMAL;
int underline = 0;
- wxString faceName(_T(""));
+ wxString faceName(T(""));
wxExpr *pointExpr = expr->Nth(0);
wxExpr *familyExpr = expr->Nth(1);
wxGetResourceToken(fd);
wxChar *name = copystring(wxConvCurrent->cMB2WX(wxResourceBuffer));
wxChar *actualName = name;
- if (name[0] == _T('"'))
+ if (name[0] == T('"'))
actualName = name + 1;
int len = wxStrlen(name);
- if ((len > 0) && (name[len-1] == _T('"')))
+ if ((len > 0) && (name[len-1] == T('"')))
name[len-1] = 0;
if (!wxResourceParseIncludeFile(actualName, table))
{
int len = wxStrlen(s);
int j = 0;
int ii = *i;
- while ((ii < len) && (wxIsalpha(s[ii]) || (s[ii] == _T('_'))))
+ while ((ii < len) && (wxIsalpha(s[ii]) || (s[ii] == T('_'))))
{
buf[j] = s[ii];
j ++;
// Eat whitespace and conjunction characters
while ((ii < len) &&
- ((s[ii] == _T(' ')) || (s[ii] == _T('|')) || (s[ii] == _T(','))))
+ ((s[ii] == T(' ')) || (s[ii] == T('|')) || (s[ii] == T(','))))
{
ii ++;
}
static wxResourceBitListStruct wxResourceBitListTable[] =
{
/* wxListBox */
- { _T("wxSINGLE"), wxLB_SINGLE },
- { _T("wxMULTIPLE"), wxLB_MULTIPLE },
- { _T("wxEXTENDED"), wxLB_EXTENDED },
- { _T("wxLB_SINGLE"), wxLB_SINGLE },
- { _T("wxLB_MULTIPLE"), wxLB_MULTIPLE },
- { _T("wxLB_EXTENDED"), wxLB_EXTENDED },
- { _T("wxLB_NEEDED_SB"), wxLB_NEEDED_SB },
- { _T("wxLB_ALWAYS_SB"), wxLB_ALWAYS_SB },
- { _T("wxLB_SORT"), wxLB_SORT },
- { _T("wxLB_OWNERDRAW"), wxLB_OWNERDRAW },
- { _T("wxLB_HSCROLL"), wxLB_HSCROLL },
+ { T("wxSINGLE"), wxLB_SINGLE },
+ { T("wxMULTIPLE"), wxLB_MULTIPLE },
+ { T("wxEXTENDED"), wxLB_EXTENDED },
+ { T("wxLB_SINGLE"), wxLB_SINGLE },
+ { T("wxLB_MULTIPLE"), wxLB_MULTIPLE },
+ { T("wxLB_EXTENDED"), wxLB_EXTENDED },
+ { T("wxLB_NEEDED_SB"), wxLB_NEEDED_SB },
+ { T("wxLB_ALWAYS_SB"), wxLB_ALWAYS_SB },
+ { T("wxLB_SORT("), wxLB_SORT },
+ { T("wxLB_OWNERDRAW"), wxLB_OWNERDRAW },
+ { T("wxLB_HSCROLL"), wxLB_HSCROLL },
/* wxComboxBox */
- { _T("wxCB_SIMPLE"), wxCB_SIMPLE },
- { _T("wxCB_DROPDOWN"), wxCB_DROPDOWN },
- { _T("wxCB_READONLY"), wxCB_READONLY },
- { _T("wxCB_SORT"), wxCB_SORT },
+ { T("wxCB_SIMPLE"), wxCB_SIMPLE },
+ { T("wxCB_DROPDOWN"), wxCB_DROPDOWN },
+ { T("wxCB_READONLY"), wxCB_READONLY },
+ { T("wxCB_SORT("), wxCB_SORT },
/* wxGauge */
- { _T("wxGA_PROGRESSBAR"), wxGA_PROGRESSBAR },
- { _T("wxGA_HORIZONTAL"), wxGA_HORIZONTAL },
- { _T("wxGA_VERTICAL"), wxGA_VERTICAL },
+ { T("wxGA_PROGRESSBAR"), wxGA_PROGRESSBAR },
+ { T("wxGA_HORIZONTAL"), wxGA_HORIZONTAL },
+ { T("wxGA_VERTICAL"), wxGA_VERTICAL },
/* wxTextCtrl */
- { _T("wxPASSWORD"), wxPASSWORD},
- { _T("wxPROCESS_ENTER"), wxPROCESS_ENTER},
- { _T("wxTE_PASSWORD"), wxTE_PASSWORD},
- { _T("wxTE_READONLY"), wxTE_READONLY},
- { _T("wxTE_PROCESS_ENTER"), wxTE_PROCESS_ENTER},
- { _T("wxTE_MULTILINE"), wxTE_MULTILINE},
- { _T("wxTE_NO_VSCROLL"), wxTE_NO_VSCROLL},
+ { T("wxPASSWORD"), wxPASSWORD},
+ { T("wxPROCESS_ENTER"), wxPROCESS_ENTER},
+ { T("wxTE_PASSWORD"), wxTE_PASSWORD},
+ { T("wxTE_READONLY"), wxTE_READONLY},
+ { T("wxTE_PROCESS_ENTER"), wxTE_PROCESS_ENTER},
+ { T("wxTE_MULTILINE"), wxTE_MULTILINE},
+ { T("wxTE_NO_VSCROLL"), wxTE_NO_VSCROLL},
/* wxRadioBox/wxRadioButton */
- { _T("wxRB_GROUP"), wxRB_GROUP },
- { _T("wxRA_SPECIFY_COLS"), wxRA_SPECIFY_COLS },
- { _T("wxRA_SPECIFY_ROWS"), wxRA_SPECIFY_ROWS },
- { _T("wxRA_HORIZONTAL"), wxRA_HORIZONTAL },
- { _T("wxRA_VERTICAL"), wxRA_VERTICAL },
+ { T("wxRB_GROUP"), wxRB_GROUP },
+ { T("wxRA_SPECIFY_COLS"), wxRA_SPECIFY_COLS },
+ { T("wxRA_SPECIFY_ROWS"), wxRA_SPECIFY_ROWS },
+ { T("wxRA_HORIZONTAL"), wxRA_HORIZONTAL },
+ { T("wxRA_VERTICAL"), wxRA_VERTICAL },
/* wxSlider */
- { _T("wxSL_HORIZONTAL"), wxSL_HORIZONTAL },
- { _T("wxSL_VERTICAL"), wxSL_VERTICAL },
- { _T("wxSL_AUTOTICKS"), wxSL_AUTOTICKS },
- { _T("wxSL_LABELS"), wxSL_LABELS },
- { _T("wxSL_LEFT"), wxSL_LEFT },
- { _T("wxSL_TOP"), wxSL_TOP },
- { _T("wxSL_RIGHT"), wxSL_RIGHT },
- { _T("wxSL_BOTTOM"), wxSL_BOTTOM },
- { _T("wxSL_BOTH"), wxSL_BOTH },
- { _T("wxSL_SELRANGE"), wxSL_SELRANGE },
+ { T("wxSL_HORIZONTAL"), wxSL_HORIZONTAL },
+ { T("wxSL_VERTICAL"), wxSL_VERTICAL },
+ { T("wxSL_AUTOTICKS"), wxSL_AUTOTICKS },
+ { T("wxSL_LABELS"), wxSL_LABELS },
+ { T("wxSL_LEFT("), wxSL_LEFT },
+ { T("wxSL_TOP"), wxSL_TOP },
+ { T("wxSL_RIGHT("), wxSL_RIGHT },
+ { T("wxSL_BOTTOM"), wxSL_BOTTOM },
+ { T("wxSL_BOTH"), wxSL_BOTH },
+ { T("wxSL_SELRANGE"), wxSL_SELRANGE },
/* wxScrollBar */
- { _T("wxSB_HORIZONTAL"), wxSB_HORIZONTAL },
- { _T("wxSB_VERTICAL"), wxSB_VERTICAL },
+ { T("wxSB_HORIZONTAL"), wxSB_HORIZONTAL },
+ { T("wxSB_VERTICAL"), wxSB_VERTICAL },
/* wxButton */
- { _T("wxBU_AUTODRAW"), wxBU_AUTODRAW },
- { _T("wxBU_NOAUTODRAW"), wxBU_NOAUTODRAW },
+ { T("wxBU_AUTODRAW"), wxBU_AUTODRAW },
+ { T("wxBU_NOAUTODRAW"), wxBU_NOAUTODRAW },
/* wxTreeCtrl */
- { _T("wxTR_HAS_BUTTONS"), wxTR_HAS_BUTTONS },
- { _T("wxTR_EDIT_LABELS"), wxTR_EDIT_LABELS },
- { _T("wxTR_LINES_AT_ROOT"), wxTR_LINES_AT_ROOT },
+ { T("wxTR_HAS_BUTTONS"), wxTR_HAS_BUTTONS },
+ { T("wxTR_EDIT_LABELS"), wxTR_EDIT_LABELS },
+ { T("wxTR_LINES_AT_ROOT("), wxTR_LINES_AT_ROOT },
/* wxListCtrl */
- { _T("wxLC_ICON"), wxLC_ICON },
- { _T("wxLC_SMALL_ICON"), wxLC_SMALL_ICON },
- { _T("wxLC_LIST"), wxLC_LIST },
- { _T("wxLC_REPORT"), wxLC_REPORT },
- { _T("wxLC_ALIGN_TOP"), wxLC_ALIGN_TOP },
- { _T("wxLC_ALIGN_LEFT"), wxLC_ALIGN_LEFT },
- { _T("wxLC_AUTOARRANGE"), wxLC_AUTOARRANGE },
- { _T("wxLC_USER_TEXT"), wxLC_USER_TEXT },
- { _T("wxLC_EDIT_LABELS"), wxLC_EDIT_LABELS },
- { _T("wxLC_NO_HEADER"), wxLC_NO_HEADER },
- { _T("wxLC_NO_SORT_HEADER"), wxLC_NO_SORT_HEADER },
- { _T("wxLC_SINGLE_SEL"), wxLC_SINGLE_SEL },
- { _T("wxLC_SORT_ASCENDING"), wxLC_SORT_ASCENDING },
- { _T("wxLC_SORT_DESCENDING"), wxLC_SORT_DESCENDING },
+ { T("wxLC_ICON"), wxLC_ICON },
+ { T("wxLC_SMALL_ICON"), wxLC_SMALL_ICON },
+ { T("wxLC_LIST("), wxLC_LIST },
+ { T("wxLC_REPORT("), wxLC_REPORT },
+ { T("wxLC_ALIGN_TOP"), wxLC_ALIGN_TOP },
+ { T("wxLC_ALIGN_LEFT("), wxLC_ALIGN_LEFT },
+ { T("wxLC_AUTOARRANGE"), wxLC_AUTOARRANGE },
+ { T("wxLC_USER_TEXT("), wxLC_USER_TEXT },
+ { T("wxLC_EDIT_LABELS"), wxLC_EDIT_LABELS },
+ { T("wxLC_NO_HEADER"), wxLC_NO_HEADER },
+ { T("wxLC_NO_SORT_HEADER"), wxLC_NO_SORT_HEADER },
+ { T("wxLC_SINGLE_SEL"), wxLC_SINGLE_SEL },
+ { T("wxLC_SORT_ASCENDING"), wxLC_SORT_ASCENDING },
+ { T("wxLC_SORT_DESCENDING"), wxLC_SORT_DESCENDING },
/* wxSpinButton */
- { _T("wxSP_VERTICAL"), wxSP_VERTICAL},
- { _T("wxSP_HORIZONTAL"), wxSP_HORIZONTAL},
- { _T("wxSP_ARROW_KEYS"), wxSP_ARROW_KEYS},
- { _T("wxSP_WRAP"), wxSP_WRAP},
+ { T("wxSP_VERTICAL"), wxSP_VERTICAL},
+ { T("wxSP_HORIZONTAL"), wxSP_HORIZONTAL},
+ { T("wxSP_ARROW_KEYS"), wxSP_ARROW_KEYS},
+ { T("wxSP_WRAP"), wxSP_WRAP},
/* wxSplitterWnd */
- { _T("wxSP_NOBORDER"), wxSP_NOBORDER},
- { _T("wxSP_3D"), wxSP_3D},
- { _T("wxSP_BORDER"), wxSP_BORDER},
+ { T("wxSP_NOBORDER"), wxSP_NOBORDER},
+ { T("wxSP_3D"), wxSP_3D},
+ { T("wxSP_BORDER"), wxSP_BORDER},
/* wxTabCtrl */
- { _T("wxTC_MULTILINE"), wxTC_MULTILINE},
- { _T("wxTC_RIGHTJUSTIFY"), wxTC_RIGHTJUSTIFY},
- { _T("wxTC_FIXEDWIDTH"), wxTC_FIXEDWIDTH},
- { _T("wxTC_OWNERDRAW"), wxTC_OWNERDRAW},
+ { T("wxTC_MULTILINE"), wxTC_MULTILINE},
+ { T("wxTC_RIGHTJUSTIFY"), wxTC_RIGHTJUSTIFY},
+ { T("wxTC_FIXEDWIDTH"), wxTC_FIXEDWIDTH},
+ { T("wxTC_OWNERDRAW"), wxTC_OWNERDRAW},
/* wxStatusBar95 */
- { _T("wxST_SIZEGRIP"), wxST_SIZEGRIP},
+ { T("wxST_SIZEGRIP"), wxST_SIZEGRIP},
/* wxControl */
- { _T("wxFIXED_LENGTH"), wxFIXED_LENGTH},
- { _T("wxALIGN_LEFT"), wxALIGN_LEFT},
- { _T("wxALIGN_CENTER"), wxALIGN_CENTER},
- { _T("wxALIGN_CENTRE"), wxALIGN_CENTRE},
- { _T("wxALIGN_RIGHT"), wxALIGN_RIGHT},
- { _T("wxCOLOURED"), wxCOLOURED},
+ { T("wxFIXED_LENGTH"), wxFIXED_LENGTH},
+ { T("wxALIGN_LEFT("), wxALIGN_LEFT},
+ { T("wxALIGN_CENTER"), wxALIGN_CENTER},
+ { T("wxALIGN_CENTRE"), wxALIGN_CENTRE},
+ { T("wxALIGN_RIGHT("), wxALIGN_RIGHT},
+ { T("wxCOLOURED"), wxCOLOURED},
/* wxToolBar */
- { _T("wxTB_3DBUTTONS"), wxTB_3DBUTTONS},
- { _T("wxTB_HORIZONTAL"), wxTB_HORIZONTAL},
- { _T("wxTB_VERTICAL"), wxTB_VERTICAL},
- { _T("wxTB_FLAT"), wxTB_FLAT},
+ { T("wxTB_3DBUTTONS"), wxTB_3DBUTTONS},
+ { T("wxTB_HORIZONTAL"), wxTB_HORIZONTAL},
+ { T("wxTB_VERTICAL"), wxTB_VERTICAL},
+ { T("wxTB_FLAT("), wxTB_FLAT},
/* wxDialog */
- { _T("wxDIALOG_MODAL"), wxDIALOG_MODAL },
+ { T("wxDIALOG_MODAL"), wxDIALOG_MODAL },
/* Generic */
- { _T("wxVSCROLL"), wxVSCROLL },
- { _T("wxHSCROLL"), wxHSCROLL },
- { _T("wxCAPTION"), wxCAPTION },
- { _T("wxSTAY_ON_TOP"), wxSTAY_ON_TOP},
- { _T("wxICONIZE"), wxICONIZE},
- { _T("wxMINIMIZE"), wxICONIZE},
- { _T("wxMAXIMIZE"), wxMAXIMIZE},
- { _T("wxSDI"), 0},
- { _T("wxMDI_PARENT"), 0},
- { _T("wxMDI_CHILD"), 0},
- { _T("wxTHICK_FRAME"), wxTHICK_FRAME},
- { _T("wxRESIZE_BORDER"), wxRESIZE_BORDER},
- { _T("wxSYSTEM_MENU"), wxSYSTEM_MENU},
- { _T("wxMINIMIZE_BOX"), wxMINIMIZE_BOX},
- { _T("wxMAXIMIZE_BOX"), wxMAXIMIZE_BOX},
- { _T("wxRESIZE_BOX"), wxRESIZE_BOX},
- { _T("wxDEFAULT_FRAME_STYLE"), wxDEFAULT_FRAME_STYLE},
- { _T("wxDEFAULT_FRAME"), wxDEFAULT_FRAME_STYLE},
- { _T("wxDEFAULT_DIALOG_STYLE"), wxDEFAULT_DIALOG_STYLE},
- { _T("wxBORDER"), wxBORDER},
- { _T("wxRETAINED"), wxRETAINED},
- { _T("wxNATIVE_IMPL"), 0},
- { _T("wxEXTENDED_IMPL"), 0},
- { _T("wxBACKINGSTORE"), wxBACKINGSTORE},
-// { _T("wxFLAT"), wxFLAT},
-// { _T("wxMOTIF_RESIZE"), wxMOTIF_RESIZE},
- { _T("wxFIXED_LENGTH"), 0},
- { _T("wxDOUBLE_BORDER"), wxDOUBLE_BORDER},
- { _T("wxSUNKEN_BORDER"), wxSUNKEN_BORDER},
- { _T("wxRAISED_BORDER"), wxRAISED_BORDER},
- { _T("wxSIMPLE_BORDER"), wxSIMPLE_BORDER},
- { _T("wxSTATIC_BORDER"), wxSTATIC_BORDER},
- { _T("wxTRANSPARENT_WINDOW"), wxTRANSPARENT_WINDOW},
- { _T("wxNO_BORDER"), wxNO_BORDER},
- { _T("wxCLIP_CHILDREN"), wxCLIP_CHILDREN},
- { _T("wxTAB_TRAVERSAL"), 0}, // Compatibility only
-
- { _T("wxTINY_CAPTION_HORIZ"), wxTINY_CAPTION_HORIZ},
- { _T("wxTINY_CAPTION_VERT"), wxTINY_CAPTION_VERT},
+ { T("wxVSCROLL"), wxVSCROLL },
+ { T("wxHSCROLL"), wxHSCROLL },
+ { T("wxCAPTION"), wxCAPTION },
+ { T("wxSTAY_ON_TOP"), wxSTAY_ON_TOP},
+ { T("wxICONIZE"), wxICONIZE},
+ { T("wxMINIMIZE"), wxICONIZE},
+ { T("wxMAXIMIZE"), wxMAXIMIZE},
+ { T("wxSDI"), 0},
+ { T("wxMDI_PARENT("), 0},
+ { T("wxMDI_CHILD"), 0},
+ { T("wxTHICK_FRAME"), wxTHICK_FRAME},
+ { T("wxRESIZE_BORDER"), wxRESIZE_BORDER},
+ { T("wxSYSTEM_MENU"), wxSYSTEM_MENU},
+ { T("wxMINIMIZE_BOX"), wxMINIMIZE_BOX},
+ { T("wxMAXIMIZE_BOX"), wxMAXIMIZE_BOX},
+ { T("wxRESIZE_BOX"), wxRESIZE_BOX},
+ { T("wxDEFAULT_FRAME_STYLE"), wxDEFAULT_FRAME_STYLE},
+ { T("wxDEFAULT_FRAME"), wxDEFAULT_FRAME_STYLE},
+ { T("wxDEFAULT_DIALOG_STYLE"), wxDEFAULT_DIALOG_STYLE},
+ { T("wxBORDER"), wxBORDER},
+ { T("wxRETAINED"), wxRETAINED},
+ { T("wxNATIVE_IMPL"), 0},
+ { T("wxEXTENDED_IMPL"), 0},
+ { T("wxBACKINGSTORE"), wxBACKINGSTORE},
+// { T("wxFLAT("), wxFLAT},
+// { T("wxMOTIF_RESIZE"), wxMOTIF_RESIZE},
+ { T("wxFIXED_LENGTH"), 0},
+ { T("wxDOUBLE_BORDER"), wxDOUBLE_BORDER},
+ { T("wxSUNKEN_BORDER"), wxSUNKEN_BORDER},
+ { T("wxRAISED_BORDER"), wxRAISED_BORDER},
+ { T("wxSIMPLE_BORDER"), wxSIMPLE_BORDER},
+ { T("wxSTATIC_BORDER"), wxSTATIC_BORDER},
+ { T("wxTRANSPARENT_WINDOW"), wxTRANSPARENT_WINDOW},
+ { T("wxNO_BORDER"), wxNO_BORDER},
+ { T("wxCLIP_CHILDREN"), wxCLIP_CHILDREN},
+ { T("wxTAB_TRAVERSAL"), 0}, // Compatibility only
+
+ { T("wxTINY_CAPTION_HORIZ"), wxTINY_CAPTION_HORIZ},
+ { T("wxTINY_CAPTION_VERT("), wxTINY_CAPTION_VERT},
// Text font families
- { _T("wxDEFAULT"), wxDEFAULT},
- { _T("wxDECORATIVE"), wxDECORATIVE},
- { _T("wxROMAN"), wxROMAN},
- { _T("wxSCRIPT"), wxSCRIPT},
- { _T("wxSWISS"), wxSWISS},
- { _T("wxMODERN"), wxMODERN},
- { _T("wxTELETYPE"), wxTELETYPE},
- { _T("wxVARIABLE"), wxVARIABLE},
- { _T("wxFIXED"), wxFIXED},
- { _T("wxNORMAL"), wxNORMAL},
- { _T("wxLIGHT"), wxLIGHT},
- { _T("wxBOLD"), wxBOLD},
- { _T("wxITALIC"), wxITALIC},
- { _T("wxSLANT"), wxSLANT},
- { _T("wxSOLID"), wxSOLID},
- { _T("wxDOT"), wxDOT},
- { _T("wxLONG_DASH"), wxLONG_DASH},
- { _T("wxSHORT_DASH"), wxSHORT_DASH},
- { _T("wxDOT_DASH"), wxDOT_DASH},
- { _T("wxUSER_DASH"), wxUSER_DASH},
- { _T("wxTRANSPARENT"), wxTRANSPARENT},
- { _T("wxSTIPPLE"), wxSTIPPLE},
- { _T("wxBDIAGONAL_HATCH"), wxBDIAGONAL_HATCH},
- { _T("wxCROSSDIAG_HATCH"), wxCROSSDIAG_HATCH},
- { _T("wxFDIAGONAL_HATCH"), wxFDIAGONAL_HATCH},
- { _T("wxCROSS_HATCH"), wxCROSS_HATCH},
- { _T("wxHORIZONTAL_HATCH"), wxHORIZONTAL_HATCH},
- { _T("wxVERTICAL_HATCH"), wxVERTICAL_HATCH},
- { _T("wxJOIN_BEVEL"), wxJOIN_BEVEL},
- { _T("wxJOIN_MITER"), wxJOIN_MITER},
- { _T("wxJOIN_ROUND"), wxJOIN_ROUND},
- { _T("wxCAP_ROUND"), wxCAP_ROUND},
- { _T("wxCAP_PROJECTING"), wxCAP_PROJECTING},
- { _T("wxCAP_BUTT"), wxCAP_BUTT},
+ { T("wxDEFAULT("), wxDEFAULT},
+ { T("wxDECORATIVE"), wxDECORATIVE},
+ { T("wxROMAN"), wxROMAN},
+ { T("wxSCRIPT("), wxSCRIPT},
+ { T("wxSWISS"), wxSWISS},
+ { T("wxMODERN"), wxMODERN},
+ { T("wxTELETYPE"), wxTELETYPE},
+ { T("wxVARIABLE"), wxVARIABLE},
+ { T("wxFIXED"), wxFIXED},
+ { T("wxNORMAL"), wxNORMAL},
+ { T("wxLIGHT("), wxLIGHT},
+ { T("wxBOLD"), wxBOLD},
+ { T("wxITALIC"), wxITALIC},
+ { T("wxSLANT("), wxSLANT},
+ { T("wxSOLID"), wxSOLID},
+ { T("wxDOT("), wxDOT},
+ { T("wxLONG_DASH"), wxLONG_DASH},
+ { T("wxSHORT_DASH"), wxSHORT_DASH},
+ { T("wxDOT_DASH"), wxDOT_DASH},
+ { T("wxUSER_DASH"), wxUSER_DASH},
+ { T("wxTRANSPARENT("), wxTRANSPARENT},
+ { T("wxSTIPPLE"), wxSTIPPLE},
+ { T("wxBDIAGONAL_HATCH"), wxBDIAGONAL_HATCH},
+ { T("wxCROSSDIAG_HATCH"), wxCROSSDIAG_HATCH},
+ { T("wxFDIAGONAL_HATCH"), wxFDIAGONAL_HATCH},
+ { T("wxCROSS_HATCH"), wxCROSS_HATCH},
+ { T("wxHORIZONTAL_HATCH"), wxHORIZONTAL_HATCH},
+ { T("wxVERTICAL_HATCH"), wxVERTICAL_HATCH},
+ { T("wxJOIN_BEVEL"), wxJOIN_BEVEL},
+ { T("wxJOIN_MITER"), wxJOIN_MITER},
+ { T("wxJOIN_ROUND"), wxJOIN_ROUND},
+ { T("wxCAP_ROUND"), wxCAP_ROUND},
+ { T("wxCAP_PROJECTING"), wxCAP_PROJECTING},
+ { T("wxCAP_BUTT("), wxCAP_BUTT},
// Logical ops
- { _T("wxCLEAR"), wxCLEAR},
- { _T("wxXOR"), wxXOR},
- { _T("wxINVERT"), wxINVERT},
- { _T("wxOR_REVERSE"), wxOR_REVERSE},
- { _T("wxAND_REVERSE"), wxAND_REVERSE},
- { _T("wxCOPY"), wxCOPY},
- { _T("wxAND"), wxAND},
- { _T("wxAND_INVERT"), wxAND_INVERT},
- { _T("wxNO_OP"), wxNO_OP},
- { _T("wxNOR"), wxNOR},
- { _T("wxEQUIV"), wxEQUIV},
- { _T("wxSRC_INVERT"), wxSRC_INVERT},
- { _T("wxOR_INVERT"), wxOR_INVERT},
- { _T("wxNAND"), wxNAND},
- { _T("wxOR"), wxOR},
- { _T("wxSET"), wxSET},
-
- { _T("wxFLOOD_SURFACE"), wxFLOOD_SURFACE},
- { _T("wxFLOOD_BORDER"), wxFLOOD_BORDER},
- { _T("wxODDEVEN_RULE"), wxODDEVEN_RULE},
- { _T("wxWINDING_RULE"), wxWINDING_RULE},
- { _T("wxHORIZONTAL"), wxHORIZONTAL},
- { _T("wxVERTICAL"), wxVERTICAL},
- { _T("wxBOTH"), wxBOTH},
- { _T("wxCENTER_FRAME"), wxCENTER_FRAME},
- { _T("wxOK"), wxOK},
- { _T("wxYES_NO"), wxYES_NO},
- { _T("wxCANCEL"), wxCANCEL},
- { _T("wxYES"), wxYES},
- { _T("wxNO"), wxNO},
- { _T("wxICON_EXCLAMATION"), wxICON_EXCLAMATION},
- { _T("wxICON_HAND"), wxICON_HAND},
- { _T("wxICON_QUESTION"), wxICON_QUESTION},
- { _T("wxICON_INFORMATION"), wxICON_INFORMATION},
- { _T("wxICON_STOP"), wxICON_STOP},
- { _T("wxICON_ASTERISK"), wxICON_ASTERISK},
- { _T("wxICON_MASK"), wxICON_MASK},
- { _T("wxCENTRE"), wxCENTRE},
- { _T("wxCENTER"), wxCENTRE},
- { _T("wxUSER_COLOURS"), wxUSER_COLOURS},
- { _T("wxVERTICAL_LABEL"), 0},
- { _T("wxHORIZONTAL_LABEL"), 0},
+ { T("wxCLEAR"), wxCLEAR},
+ { T("wxXOR"), wxXOR},
+ { T("wxINVERT("), wxINVERT},
+ { T("wxOR_REVERSE"), wxOR_REVERSE},
+ { T("wxAND_REVERSE"), wxAND_REVERSE},
+ { T("wxCOPY"), wxCOPY},
+ { T("wxAND"), wxAND},
+ { T("wxAND_INVERT("), wxAND_INVERT},
+ { T("wxNO_OP"), wxNO_OP},
+ { T("wxNOR"), wxNOR},
+ { T("wxEQUIV"), wxEQUIV},
+ { T("wxSRC_INVERT("), wxSRC_INVERT},
+ { T("wxOR_INVERT("), wxOR_INVERT},
+ { T("wxNAND"), wxNAND},
+ { T("wxOR"), wxOR},
+ { T("wxSET("), wxSET},
+
+ { T("wxFLOOD_SURFACE"), wxFLOOD_SURFACE},
+ { T("wxFLOOD_BORDER"), wxFLOOD_BORDER},
+ { T("wxODDEVEN_RULE"), wxODDEVEN_RULE},
+ { T("wxWINDING_RULE"), wxWINDING_RULE},
+ { T("wxHORIZONTAL"), wxHORIZONTAL},
+ { T("wxVERTICAL"), wxVERTICAL},
+ { T("wxBOTH"), wxBOTH},
+ { T("wxCENTER_FRAME"), wxCENTER_FRAME},
+ { T("wxOK"), wxOK},
+ { T("wxYES_NO"), wxYES_NO},
+ { T("wxCANCEL"), wxCANCEL},
+ { T("wxYES"), wxYES},
+ { T("wxNO"), wxNO},
+ { T("wxICON_EXCLAMATION"), wxICON_EXCLAMATION},
+ { T("wxICON_HAND"), wxICON_HAND},
+ { T("wxICON_QUESTION"), wxICON_QUESTION},
+ { T("wxICON_INFORMATION"), wxICON_INFORMATION},
+ { T("wxICON_STOP"), wxICON_STOP},
+ { T("wxICON_ASTERISK"), wxICON_ASTERISK},
+ { T("wxICON_MASK"), wxICON_MASK},
+ { T("wxCENTRE"), wxCENTRE},
+ { T("wxCENTER"), wxCENTRE},
+ { T("wxUSER_COLOURS"), wxUSER_COLOURS},
+ { T("wxVERTICAL_LABEL"), 0},
+ { T("wxHORIZONTAL_LABEL"), 0},
// Bitmap types (not strictly styles)
- { _T("wxBITMAP_TYPE_XPM"), wxBITMAP_TYPE_XPM},
- { _T("wxBITMAP_TYPE_XBM"), wxBITMAP_TYPE_XBM},
- { _T("wxBITMAP_TYPE_BMP"), wxBITMAP_TYPE_BMP},
- { _T("wxBITMAP_TYPE_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE},
- { _T("wxBITMAP_TYPE_BMP_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE},
- { _T("wxBITMAP_TYPE_GIF"), wxBITMAP_TYPE_GIF},
- { _T("wxBITMAP_TYPE_TIF"), wxBITMAP_TYPE_TIF},
- { _T("wxBITMAP_TYPE_ICO"), wxBITMAP_TYPE_ICO},
- { _T("wxBITMAP_TYPE_ICO_RESOURCE"), wxBITMAP_TYPE_ICO_RESOURCE},
- { _T("wxBITMAP_TYPE_CUR"), wxBITMAP_TYPE_CUR},
- { _T("wxBITMAP_TYPE_CUR_RESOURCE"), wxBITMAP_TYPE_CUR_RESOURCE},
- { _T("wxBITMAP_TYPE_XBM_DATA"), wxBITMAP_TYPE_XBM_DATA},
- { _T("wxBITMAP_TYPE_XPM_DATA"), wxBITMAP_TYPE_XPM_DATA},
- { _T("wxBITMAP_TYPE_ANY"), wxBITMAP_TYPE_ANY}
+ { T("wxBITMAP_TYPE_XPM"), wxBITMAP_TYPE_XPM},
+ { T("wxBITMAP_TYPE_XBM"), wxBITMAP_TYPE_XBM},
+ { T("wxBITMAP_TYPE_BMP"), wxBITMAP_TYPE_BMP},
+ { T("wxBITMAP_TYPE_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE},
+ { T("wxBITMAP_TYPE_BMP_RESOURCE"), wxBITMAP_TYPE_BMP_RESOURCE},
+ { T("wxBITMAP_TYPE_GIF"), wxBITMAP_TYPE_GIF},
+ { T("wxBITMAP_TYPE_TIF"), wxBITMAP_TYPE_TIF},
+ { T("wxBITMAP_TYPE_ICO"), wxBITMAP_TYPE_ICO},
+ { T("wxBITMAP_TYPE_ICO_RESOURCE"), wxBITMAP_TYPE_ICO_RESOURCE},
+ { T("wxBITMAP_TYPE_CUR"), wxBITMAP_TYPE_CUR},
+ { T("wxBITMAP_TYPE_CUR_RESOURCE"), wxBITMAP_TYPE_CUR_RESOURCE},
+ { T("wxBITMAP_TYPE_XBM_DATA"), wxBITMAP_TYPE_XBM_DATA},
+ { T("wxBITMAP_TYPE_XPM_DATA"), wxBITMAP_TYPE_XPM_DATA},
+ { T("wxBITMAP_TYPE_ANY"), wxBITMAP_TYPE_ANY}
};
static int wxResourceBitListCount = (sizeof(wxResourceBitListTable)/sizeof(wxResourceBitListStruct));
wxItemResource *item = table->FindResource(resource);
if (item)
{
- if ((item->GetType() == _T("")) || (item->GetType() != _T("wxBitmap")))
+ if ((item->GetType() == T("")) || (item->GetType() != T("wxBitmap")))
{
wxLogWarning(_("%s not a bitmap resource specification."), (const wxChar*) resource);
return wxNullBitmap;
wxItemResource *item = table->FindResource(resource);
if (item)
{
- if ((item->GetType() == _T("")) || wxStrcmp(item->GetType(), _T("wxIcon")) != 0)
+ if ((item->GetType() == T("")) || wxStrcmp(item->GetType(), T("wxIcon")) != 0)
{
wxLogWarning(_("%s not an icon resource specification."), (const wxChar*) resource);
return wxNullIcon;
while (node)
{
wxItemResource *child = (wxItemResource *)node->Data();
- if ((child->GetType() != _T("")) && (child->GetType() == _T("wxMenuSeparator")))
+ if ((child->GetType() != T("")) && (child->GetType() == T("wxMenuSeparator")))
menu->AppendSeparator();
else if (child->GetChildren().Number() > 0)
{
table = wxDefaultResourceTable;
wxItemResource *menuResource = table->FindResource(resource);
- if (menuResource && (menuResource->GetType() != _T("")) && (menuResource->GetType() == _T("wxMenu")))
+ if (menuResource && (menuResource->GetType() != T("")) && (menuResource->GetType() == T("wxMenu")))
{
if (!menuBar)
menuBar = new wxMenuBar;
table = wxDefaultResourceTable;
wxItemResource *menuResource = table->FindResource(resource);
- if (menuResource && (menuResource->GetType() != _T("")) && (menuResource->GetType() == _T("wxMenu")))
+ if (menuResource && (menuResource->GetType() != T("")) && (menuResource->GetType() == T("wxMenu")))
// if (menuResource && (menuResource->GetType() == wxTYPE_MENU))
return wxResourceCreateMenu(menuResource);
return (wxMenu *) NULL;
wxItemResource *resource = table->FindResource((const wxChar *)resourceName);
// if (!resource || (resource->GetType() != wxTYPE_DIALOG_BOX))
- if (!resource || (resource->GetType() == _T("")) ||
- ! ((resource->GetType() == _T("wxDialog")) || (resource->GetType() == _T("wxPanel"))))
+ if (!resource || (resource->GetType() == T("")) ||
+ ! ((resource->GetType() == T("wxDialog")) || (resource->GetType() == T("wxPanel"))))
return FALSE;
wxString title(resource->GetTitle());
bool wxIPV4address::Hostname(const wxString& name)
{
// Some people are sometimes fool.
- if (name == _T("")) {
- wxLogWarning( _T("Trying to solve a NULL hostname: giving up") );
+ if (name == T("")) {
+ wxLogWarning( T("Trying to solve a NULL hostname: giving up") );
return FALSE;
}
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxFileProto, wxProtocol)
-IMPLEMENT_PROTOCOL(wxFileProto, _T("file"), NULL, FALSE)
+IMPLEMENT_PROTOCOL(wxFileProto, T("file"), NULL, FALSE)
#endif
wxFileProto::wxFileProto()
return TRUE;
}
-bool wxTCPConnection::Execute (wxChar *data, int size, wxIPCFormat format)
+bool wxTCPConnection::Execute (const wxChar *data, int size, wxIPCFormat format)
{
if (!m_sock->IsConnected())
return FALSE;
wxStaticBoxSizer::wxStaticBoxSizer( wxStaticBox *box, int orient )
: wxBoxSizer( orient )
{
- wxASSERT_MSG( box, _T("wxStaticBoxSizer needs a static box") );
+ wxASSERT_MSG( box, T("wxStaticBoxSizer needs a static box") );
m_staticBox = box;
}
if (sig != 0xfeeddead)
{
- wxLogMessage(_T("Warning: invalid signature returned to ReadMsg"));
+ wxLogMessage(T("Warning: invalid signature returned to ReadMsg"));
goto exit;
}
if (sig != 0xdeadfeed)
{
- //wxLogMessage(_T("Warning: invalid signature returned to ReadMsg"));
+ //wxLogMessage(T("Warning: invalid signature returned to ReadMsg"));
goto exit;
}
#if defined(__UNIX__) && wxUSE_TEXTFILE
// search through files in /usr/share/i18n/charmaps
wxString fname;
- for (fname = ::wxFindFirstFile(_T("/usr/share/i18n/charmaps/*"));
+ for (fname = ::wxFindFirstFile(T("/usr/share/i18n/charmaps/*"));
!fname.IsEmpty();
fname = ::wxFindNextFile()) {
wxTextFile cmap(fname);
wxString comchar,escchar;
bool in_charset = FALSE;
- // wxFprintf(stderr,_T("Loaded: %s\n"),fname.c_str());
+ // wxFprintf(stderr,T("Loaded: %s\n"),fname.c_str());
wxString line;
for (line = cmap.GetFirstLine();
!cmap.Eof();
line = cmap.GetNextLine()) {
- // wxFprintf(stderr,_T("line contents: %s\n"),line.c_str());
+ // wxFprintf(stderr,T("line contents: %s\n"),line.c_str());
wxStringTokenizer token(line);
wxString cmd = token.GetNextToken();
if (cmd == comchar) {
- if (token.GetNextToken() == _T("alias"))
+ if (token.GetNextToken() == T("alias"))
cset->names.Add(token.GetNextToken());
}
- else if (cmd == _T("<code_set_name>"))
+ else if (cmd == T("<code_set_name>"))
cset->names.Add(token.GetNextToken());
- else if (cmd == _T("<comment_char>"))
+ else if (cmd == T("<comment_char>"))
comchar = token.GetNextToken();
- else if (cmd == _T("<escape_char>"))
+ else if (cmd == T("<escape_char>"))
escchar = token.GetNextToken();
- else if (cmd == _T("<mb_cur_min>")) {
+ else if (cmd == T("<mb_cur_min>")) {
delete cset;
cset = (wxCharacterSet *) NULL;
break; // we don't support multibyte charsets ourselves (yet)
}
- else if (cmd == _T("CHARMAP")) {
+ else if (cmd == T("CHARMAP")) {
cset->data = (wchar_t *)calloc(256, sizeof(wchar_t));
in_charset = TRUE;
}
- else if (cmd == _T("END")) {
- if (token.GetNextToken() == _T("CHARMAP"))
+ else if (cmd == T("END")) {
+ if (token.GetNextToken() == T("CHARMAP"))
in_charset = FALSE;
}
else if (in_charset) {
wxString uni = token.GetNextToken();
// skip whitespace again
while (wxIsEmpty(uni) && token.HasMoreTokens()) uni = token.GetNextToken();
- if ((hex.Len() > 2) && (wxString(hex.GetChar(0)) == escchar) && (hex.GetChar(1) == _T('x')) &&
- (uni.Left(2) == _T("<U"))) {
+ if ((hex.Len() > 2) && (wxString(hex.GetChar(0)) == escchar) && (hex.GetChar(1) == T('x')) &&
+ (uni.Left(2) == T("<U"))) {
hex.MakeUpper(); uni.MakeUpper();
int pos = ::wxHexToDec(hex.Mid(2,2));
if (pos>=0) {
unsigned long uni1 = ::wxHexToDec(uni.Mid(2,2));
unsigned long uni2 = ::wxHexToDec(uni.Mid(4,2));
cset->data[pos] = (uni1 << 16) | uni2;
- // wxFprintf(stderr,_T("char %02x mapped to %04x (%c)\n"),pos,cset->data[pos],cset->data[pos]);
+ // wxFprintf(stderr,T("char %02x mapped to %04x (%c)\n"),pos,cset->data[pos],cset->data[pos]);
}
}
}
#ifdef __UNIX__
// first, convert the character set name to standard form
wxString codeset;
- if (wxString(charset,3).CmpNoCase(_T("ISO")) == 0) {
+ if (wxString(charset,3).CmpNoCase(T("ISO")) == 0) {
// make sure it's represented in the standard form: ISO_8859-1
- codeset = _T("ISO_");
+ codeset = T("ISO_");
charset += 3;
- if ((*charset == _T('-')) || (*charset == _T('_'))) charset++;
+ if ((*charset == T('-')) || (*charset == T('_'))) charset++;
if (wxStrlen(charset)>4) {
- if (wxString(charset,4) == _T("8859")) {
- codeset << _T("8859-");
- if (*charset == _T('-')) charset++;
+ if (wxString(charset,4) == T("8859")) {
+ codeset << T("8859-");
+ if (*charset == T('-')) charset++;
}
}
}
void wxCSConv::LoadNow()
{
-// wxPrintf(_T("Conversion request\n"));
+// wxPrintf(T("Conversion request\n"));
if (m_deferred) {
if (!m_name) {
#ifdef __UNIX__
- wxChar *lang = wxGetenv(_T("LANG"));
- wxChar *dot = lang ? wxStrchr(lang, _T('.')) : (wxChar *)NULL;
+ wxChar *lang = wxGetenv(T("LANG"));
+ wxChar *dot = lang ? wxStrchr(lang, T('.')) : (wxChar *)NULL;
if (dot) SetName(dot+1);
#endif
}
{
wxStringData data;
wxChar dummy;
-} g_strEmpty = { {-1, 0, 0}, _T('\0') };
+} g_strEmpty = { {-1, 0, 0}, T('\0') };
// empty C style string: points to 'string data' byte of g_strEmpty
-extern const wxChar WXDLLEXPORT *g_szNul = &g_strEmpty.dummy;
+extern const wxChar WXDLLEXPORT *wxEmptyString = &g_strEmpty.dummy;
// ----------------------------------------------------------------------------
// conditional compilation
}
}
-#else
+#else // ANSI
#if wxUSE_WCHAR_T
// from wide string
Init();
}
}
-#endif
+#endif // wxUSE_WCHAR_T
-#endif
+#endif // Unicode/ANSI
// ---------------------------------------------------------------------------
// memory allocation
pData->nDataLength = nLen;
pData->nAllocLength = nLen + EXTRA_ALLOC;
m_pchData = pData->data(); // data starts after wxStringData
- m_pchData[nLen] = _T('\0');
+ m_pchData[nLen] = T('\0');
}
// must be called before changing this string
pData->nDataLength = 0;
pData->nAllocLength = nLen;
m_pchData = pData->data(); // data starts after wxStringData
- m_pchData[0u] = _T('\0');
+ m_pchData[0u] = T('\0');
}
else if ( pData->IsShared() ) {
pData->Unlock(); // memory not freed because shared
AllocBeforeWrite(nSrcLen);
memcpy(m_pchData, pszSrcData, nSrcLen*sizeof(wxChar));
GetStringData()->nDataLength = nSrcLen;
- m_pchData[nSrcLen] = _T('\0');
+ m_pchData[nSrcLen] = T('\0');
}
}
// fast concatenation - all is done in our buffer
memcpy(m_pchData + nLen, pszSrcData, nSrcLen*sizeof(wxChar));
- m_pchData[nNewLen] = _T('\0'); // put terminating '\0'
+ m_pchData[nNewLen] = T('\0'); // put terminating '\0'
GetStringData()->nDataLength = nNewLen; // and fix the length
}
//else: the string to append was empty
wxString wxString::BeforeFirst(wxChar ch) const
{
wxString str;
- for ( const wxChar *pc = m_pchData; *pc != _T('\0') && *pc != ch; pc++ )
+ for ( const wxChar *pc = m_pchData; *pc != T('\0') && *pc != ch; pc++ )
str += *pc;
return str;
wxString strTemp;
const wxChar *pCurrent = m_pchData;
const wxChar *pSubstr;
- while ( *pCurrent != _T('\0') ) {
+ while ( *pCurrent != T('\0') ) {
pSubstr = wxStrstr(pCurrent, szOld);
if ( pSubstr == NULL ) {
// strTemp is unused if no replacements were made, so avoid the copy
psz--;
// truncate at trailing space start
- *++psz = _T('\0');
+ *++psz = T('\0');
GetStringData()->nDataLength = psz - m_pchData;
}
else
if ( uiLen < Len() ) {
CopyBeforeWrite();
- *(m_pchData + uiLen) = _T('\0');
+ *(m_pchData + uiLen) = T('\0');
GetStringData()->nDataLength = uiLen;
}
//else: nothing to do, string is already short enough
wxString& wxString::operator<<(int i)
{
wxString res;
- res.Printf(_T("%d"), i);
+ res.Printf(T("%d"), i);
return (*this) << res;
}
wxString& wxString::operator<<(float f)
{
wxString res;
- res.Printf(_T("%f"), f);
+ res.Printf(T("%f"), f);
return (*this) << res;
}
wxString& wxString::operator<<(double d)
{
wxString res;
- res.Printf(_T("%g"), d);
+ res.Printf(T("%g"), d);
return (*this) << res;
}
Reinit();
for (size_t n = 0; pszFormat[n]; n++)
- if (pszFormat[n] == _T('%')) {
+ if (pszFormat[n] == T('%')) {
static char s_szFlags[256] = "%";
size_t flagofs = 1;
bool adj_left = FALSE, in_prec = FALSE,
do {
#define CHECK_PREC if (in_prec && !prec_dot) { s_szFlags[flagofs++] = '.'; prec_dot = TRUE; }
switch (pszFormat[++n]) {
- case _T('\0'):
+ case T('\0'):
done = TRUE;
break;
- case _T('%'):
- *this += _T('%');
+ case T('%'):
+ *this += T('%');
done = TRUE;
break;
- case _T('#'):
- case _T('0'):
- case _T(' '):
- case _T('+'):
- case _T('\''):
+ case T('#'):
+ case T('0'):
+ case T(' '):
+ case T('+'):
+ case T('\''):
CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n];
break;
- case _T('-'):
+ case T('-'):
CHECK_PREC
adj_left = TRUE;
s_szFlags[flagofs++] = pszFormat[n];
break;
- case _T('.'):
+ case T('.'):
CHECK_PREC
in_prec = TRUE;
prec_dot = FALSE;
max_width = 0;
// dot will be auto-added to s_szFlags if non-negative number follows
break;
- case _T('h'):
+ case T('h'):
ilen = -1;
CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n];
break;
- case _T('l'):
+ case T('l'):
ilen = 1;
CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n];
break;
- case _T('q'):
- case _T('L'):
+ case T('q'):
+ case T('L'):
ilen = 2;
CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n];
break;
- case _T('Z'):
+ case T('Z'):
ilen = 3;
CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n];
break;
- case _T('*'):
+ case T('*'):
{
int len = va_arg(argptr, int);
if (in_prec) {
flagofs += ::sprintf(s_szFlags+flagofs,"%d",len);
}
break;
- case _T('1'): case _T('2'): case _T('3'):
- case _T('4'): case _T('5'): case _T('6'):
- case _T('7'): case _T('8'): case _T('9'):
+ case T('1'): case T('2'): case T('3'):
+ case T('4'): case T('5'): case T('6'):
+ case T('7'): case T('8'): case T('9'):
{
int len = 0;
CHECK_PREC
- while ((pszFormat[n]>=_T('0')) && (pszFormat[n]<=_T('9'))) {
+ while ((pszFormat[n]>=T('0')) && (pszFormat[n]<=T('9'))) {
s_szFlags[flagofs++] = pszFormat[n];
- len = len*10 + (pszFormat[n] - _T('0'));
+ len = len*10 + (pszFormat[n] - T('0'));
n++;
}
if (in_prec) max_width = len;
n--; // the main loop pre-increments n again
}
break;
- case _T('d'):
- case _T('i'):
- case _T('o'):
- case _T('u'):
- case _T('x'):
- case _T('X'):
+ case T('d'):
+ case T('i'):
+ case T('o'):
+ case T('u'):
+ case T('x'):
+ case T('X'):
CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n];
s_szFlags[flagofs] = '\0';
*this += wxString(s_szScratch);
done = TRUE;
break;
- case _T('e'):
- case _T('E'):
- case _T('f'):
- case _T('g'):
- case _T('G'):
+ case T('e'):
+ case T('E'):
+ case T('f'):
+ case T('g'):
+ case T('G'):
CHECK_PREC
s_szFlags[flagofs++] = pszFormat[n];
s_szFlags[flagofs] = '\0';
*this += wxString(s_szScratch);
done = TRUE;
break;
- case _T('p'):
+ case T('p'):
{
void *val = va_arg(argptr, void *);
CHECK_PREC
done = TRUE;
}
break;
- case _T('c'):
+ case T('c'):
{
wxChar val = va_arg(argptr, int);
// we don't need to honor padding here, do we?
done = TRUE;
}
break;
- case _T('s'):
+ case T('s'):
if (ilen == -1) {
// wx extension: we'll let %hs mean non-Unicode strings
char *val = va_arg(argptr, char *);
size_t len = wxSTRING_MAXLEN;
if (val) {
for (len = 0; val[len] && (len<max_width); len++);
- } else val = _T("(null)");
+ } else val = T("(null)");
wxString s(val, len);
#endif
if (s.Len() < min_width)
- s.Pad(min_width - s.Len(), _T(' '), adj_left);
+ s.Pad(min_width - s.Len(), T(' '), adj_left);
*this += s;
} else {
wxChar *val = va_arg(argptr, wxChar *);
size_t len = wxSTRING_MAXLEN;
if (val) {
for (len = 0; val[len] && (len<max_width); len++);
- } else val = _T("(null)");
+ } else val = T("(null)");
wxString s(val, len);
if (s.Len() < min_width)
- s.Pad(min_width - s.Len(), _T(' '), adj_left);
+ s.Pad(min_width - s.Len(), T(' '), adj_left);
*this += s;
}
done = TRUE;
break;
- case _T('n'):
+ case T('n'):
if (ilen == 0) {
int *val = va_arg(argptr, int *);
*val = Len();
s_szFlags[flagofs++] = pszFormat[n];
else {
// bad format
- *this += _T('%'); // just to pass the glibc tst-printf.c
+ *this += T('%'); // just to pass the glibc tst-printf.c
n--;
done = TRUE;
}
{
// check char by char
const wxChar *pszTxt;
- for ( pszTxt = c_str(); *pszMask != _T('\0'); pszMask++, pszTxt++ ) {
+ for ( pszTxt = c_str(); *pszMask != T('\0'); pszMask++, pszTxt++ ) {
switch ( *pszMask ) {
- case _T('?'):
- if ( *pszTxt == _T('\0') )
+ case T('?'):
+ if ( *pszTxt == T('\0') )
return FALSE;
// pszText and pszMask will be incremented in the loop statement
break;
- case _T('*'):
+ case T('*'):
{
// ignore special chars immediately following this one
- while ( *pszMask == _T('*') || *pszMask == _T('?') )
+ while ( *pszMask == T('*') || *pszMask == T('?') )
pszMask++;
// if there is nothing more, match
- if ( *pszMask == _T('\0') )
+ if ( *pszMask == T('\0') )
return TRUE;
// are there any other metacharacters in the mask?
size_t uiLenMask;
- const wxChar *pEndMask = wxStrpbrk(pszMask, _T("*?"));
+ const wxChar *pEndMask = wxStrpbrk(pszMask, T("*?"));
if ( pEndMask != NULL ) {
// we have to match the string between two metachars
}
// match only if nothing left
- return *pszTxt == _T('\0');
+ return *pszTxt == T('\0');
}
// Count the number of chars
if ( !filenameToUse )
{
// what kind of message to give? is it an error or a program bug?
- wxLogDebug(_T("Can't save textctrl to file without filename."));
+ wxLogDebug(T("Can't save textctrl to file without filename."));
return FALSE;
}
wxTextCtrl& wxTextCtrlBase::operator<<(float f)
{
wxString str;
- str.Printf(_T("%.2f"), f);
+ str.Printf(T("%.2f"), f);
AppendText(str);
return *TEXTCTRL(this);
}
wxTextCtrl& wxTextCtrlBase::operator<<(double d)
{
wxString str;
- str.Printf(_T("%.2f"), d);
+ str.Printf(T("%.2f"), d);
AppendText(str);
return *TEXTCTRL(this);
}
wxTextCtrl& wxTextCtrlBase::operator<<(int i)
{
wxString str;
- str.Printf(_T("%d"), i);
+ str.Printf(T("%d"), i);
AppendText(str);
return *TEXTCTRL(this);
}
wxTextCtrl& wxTextCtrlBase::operator<<(long i)
{
wxString str;
- str.Printf(_T("%ld"), i);
+ str.Printf(T("%ld"), i);
AppendText(str);
return *TEXTCTRL(this);
}
{
switch ( type ) {
default:
- wxFAIL_MSG(_T("bad file type in wxTextFile::GetEOL."));
+ wxFAIL_MSG(T("bad file type in wxTextFile::GetEOL."));
// fall through nevertheless - we must return something...
- case wxTextFileType_None: return _T("");
- case wxTextFileType_Unix: return _T("\n");
- case wxTextFileType_Dos: return _T("\r\n");
- case wxTextFileType_Mac: return _T("\r");
+ case wxTextFileType_None: return T("");
+ case wxTextFileType_Unix: return T("\n");
+ case wxTextFileType_Dos: return T("\r\n");
+ case wxTextFileType_Mac: return T("\r");
}
}
/*
if (IsDST()) setError(NIHCL_BADTIME,DEFAULT,
date.dayOfMonth(),date.nameOfMonth(),date.year(),
- h,m,s,(dst?_("DST"):""));
+ h,m,s,(dst?_("DST("):""));
*/
}
sec += TIME_ZONE; // adjust to GMT
switch (Precision) {
case wxStdMinSec:
- wxSprintf(timeBuf,_T("%2d:%02d:%02d"),hh,GetMinute(),GetSecond());
+ wxSprintf(timeBuf,T("%2d:%02d:%02d"),hh,GetMinute(),GetSecond());
break;
case wxStdMin:
- wxSprintf(timeBuf,_T("%2d:%02d"),hh,GetMinute());
+ wxSprintf(timeBuf,T("%2d:%02d"),hh,GetMinute());
break;
}
c = m_input->GetC();
if (!m_input) return (wxChar) 0;
- if (c != _T('\n') &&
- c != _T('\r') &&
- c != _T('\t') &&
- c != _T(' '))
+ if (c != T('\n') &&
+ c != T('\r') &&
+ c != T('\t') &&
+ c != T(' '))
{
return c;
}
void wxTextInputStream::SkipIfEndOfLine( wxChar c )
{
- if (c == _T('\n'))
+ if (c == T('\n'))
{
// eat on UNIX
return;
}
- if (c == _T('\r'))
+ if (c == T('\r'))
{
// eat on both Mac and DOS
wxChar c2 = m_input->GetC();
if (!m_input) return;
- if (c2 == _T('\n'))
+ if (c2 == T('\n'))
{
// eat on DOS
return;
if (!m_input) return 0;
i = 0;
- if (! (c == _T('-') || c == _T('+') || isdigit(c)) )
+ if (! (c == T('-') || c == T('+') || isdigit(c)) )
{
m_input->Ungetch(c);
return 0;
}
- if (c == _T('-'))
+ if (c == T('-'))
{
sign = -1;
c = m_input->GetC();
} else
- if (c == _T('+'))
+ if (c == T('+'))
{
sign = 1;
c = m_input->GetC();
while (isdigit(c))
{
- i = i*10 + (c - (int)_T('0'));
+ i = i*10 + (c - (int)T('0'));
c = m_input->GetC();
}
if (!m_input) return 0.0;
f = 0.0;
- if (! (c == _T('.') || c == _T('-') || c == _T('+') || isdigit(c)) )
+ if (! (c == T('.') || c == T('-') || c == T('+') || isdigit(c)) )
{
m_input->Ungetch(c);
return 0.0;
}
- if (c == _T('-'))
+ if (c == T('-'))
{
sign = -1;
c = m_input->GetC();
} else
- if (c == _T('+'))
+ if (c == T('+'))
{
sign = 1;
c = m_input->GetC();
while (isdigit(c))
{
- f = f*10 + (c - _T('0'));
+ f = f*10 + (c - T('0'));
c = m_input->GetC();
}
- if (c == _T('.'))
+ if (c == T('.'))
{
double f_multiplicator = (double) 0.1;
while (isdigit(c))
{
- f += (c-_T('0'))*f_multiplicator;
+ f += (c-T('0'))*f_multiplicator;
f_multiplicator /= 10;
c = m_input->GetC();
}
- if (c == _T('e'))
+ if (c == T('e'))
{
double f_multiplicator = 0.0;
int i, e;
switch (c)
{
- case _T('-'): f_multiplicator = 0.1; break;
- case _T('+'): f_multiplicator = 10.0; break;
+ case T('-'): f_multiplicator = 0.1; break;
+ case T('+'): f_multiplicator = 10.0; break;
}
e = Read8(); // why only max 256 ?
c = m_input->GetC();
if (!m_input) break;
- if (c == _T('\n'))
+ if (c == T('\n'))
{
// eat on UNIX
break;
}
- if (c == _T('\r'))
+ if (c == T('\r'))
{
// eat on both Mac and DOS
wxChar c2 = m_input->GetC();
if (!m_input) break;
- if (c2 == _T('\n'))
+ if (c2 == T('\n'))
{
// eat on DOS
break;
return *this;
}
- if (c1 == _T('\r'))
+ if (c1 == T('\r'))
{
- c = _T('\n');
+ c = T('\n');
wxChar c2 = m_input->GetC();
if (!m_input) return *this;
- if (c2 != _T('\n'))
+ if (c2 != T('\n'))
{
// we are on a Mac
m_input->Ungetch( c2 );
void wxTextOutputStream::Write32(wxUint32 i)
{
wxString str;
- str.Printf(_T("%u"), i);
+ str.Printf(T("%u"), i);
WriteString(str);
}
void wxTextOutputStream::Write16(wxUint16 i)
{
wxString str;
- str.Printf(_T("%u"), i);
+ str.Printf(T("%u"), i);
WriteString(str);
}
void wxTextOutputStream::Write8(wxUint8 i)
{
wxString str;
- str.Printf(_T("%u"), i);
+ str.Printf(T("%u"), i);
WriteString(str);
}
{
wxString str;
- str.Printf(_T("%f"), d);
+ str.Printf(T("%f"), d);
WriteString(str);
}
for (size_t i = 0; i < string.Len(); i++)
{
wxChar c = string[i];
- if (c == _T('\n'))
+ if (c == T('\n'))
{
#if defined(__WINDOWS__)
- c = _T('\r');
+ c = T('\r');
m_output->Write( (const void*)(&c), sizeof(wxChar) );
- c = _T('\n');
+ c = T('\n');
m_output->Write( (const void*)(&c), sizeof(wxChar) );
#elif defined(__UNIX__)
- c = _T('\n');
+ c = T('\n');
m_output->Write( (const void*)(&c), sizeof(wxChar) );
#elif defined(__WXMAC__)
- c = _T('\r');
+ c = T('\r');
m_output->Write( (const void*)(&c), sizeof(wxChar) );
#elif defined(__OS2__)
- c = _T('\r');
+ c = T('\r');
m_output->Write( (const void*)(&c), sizeof(wxChar) );
- c = _T('\n');
+ c = T('\n');
m_output->Write( (const void*)(&c), sizeof(wxChar) );
#else
#error "wxTextOutputStream: unsupported platform."
wxTextOutputStream &endl( wxTextOutputStream &stream )
{
- return stream << _T('\n');
+ return stream << T('\n');
}
#endif
CleanData();
// Third, we rebuild the URL.
- m_url = m_protoname + _T(":");
+ m_url = m_protoname + T(":");
if (m_protoinfo->m_needhost)
- m_url = m_url + _T("//") + m_hostname;
+ m_url = m_url + T("//") + m_hostname;
m_url += m_path;
int pos;
// Find end
- pos = url.Find(_T(':'));
+ pos = url.Find(T(':'));
if (pos == -1)
return FALSE;
url = url(2, url.Length());
- pos = url.Find(_T('/'));
+ pos = url.Find(T('/'));
if (pos == -1)
pos = url.Length();
return FALSE;
temp_url = url(0, pos);
- url = url(url.Find(_T('/')), url.Length());
+ url = url(url.Find(T('/')), url.Length());
// Retrieve service number
- pos2 = temp_url.Find(_T(':'), TRUE);
+ pos2 = temp_url.Find(T(':'), TRUE);
if (pos2 != -1 && pos2 < pos) {
m_servname = temp_url(pos2+1, pos);
if (!m_servname.IsNumber())
}
// Retrieve user and password.
- pos2 = temp_url.Find(_T('@'));
+ pos2 = temp_url.Find(T('@'));
// Even if pos2 equals -1, this code is right.
m_hostname = temp_url(pos2+1, temp_url.Length());
- m_user = _T("");
- m_password = _T("");
+ m_user = T("");
+ m_password = T("");
if (pos2 == -1)
return TRUE;
temp_url = temp_url(0, pos2);
- pos2 = temp_url.Find(_T(':'));
+ pos2 = temp_url.Find(T(':'));
if (pos2 == -1)
return FALSE;
if (url.Length() != 0)
m_path = ConvertToValidURI(url);
else
- m_path = _T("/");
+ m_path = T("/");
return TRUE;
}
}
m_error = wxURL_NOERR;
- if (m_user != _T("")) {
+ if (m_user != T("")) {
m_protocol->SetUser(m_user);
m_protocol->SetPassword(m_password);
}
}
wxString tmp_str = url_proxy;
- int pos = tmp_str.Find(_T(':'));
+ int pos = tmp_str.Find(T(':'));
if (pos == -1)
return;
wxIPV4address addr;
tmp_str = url_proxy;
- pos = tmp_str.Find(_T(':'));
+ pos = tmp_str.Find(T(':'));
// This is an invalid proxy name.
if (pos == -1)
return;
for (i=0;i<uri.Len();i++) {
wxChar c = uri.GetChar(i);
- if (c == _T(' '))
- out_str += _T('+');
+ if (c == T(' '))
+ out_str += T('+');
else {
- if (!isalpha(c) && c != _T('.') && c != _T('+') && c != _T('/')) {
- hexa_code.Printf(_T("%%%02X"), c);
+ if (!isalpha(c) && c != T('.') && c != T('+') && c != T('/')) {
+ hexa_code.Printf(T("%%%02X"), c);
out_str += hexa_code;
} else
out_str += c;
size_t i = 0;
while (i<uri.Len()) {
int code;
- if (uri[i] == _T('%')) {
+ if (uri[i] == T('%')) {
i++;
- if (uri[i] >= _T('A') && uri[i] <= _T('F'))
- code = (uri[i] - _T('A') + 10) * 16;
+ if (uri[i] >= T('A') && uri[i] <= T('F'))
+ code = (uri[i] - T('A') + 10) * 16;
else
- code = (uri[i] - _T('0')) * 16;
+ code = (uri[i] - T('0')) * 16;
i++;
- if (uri[i] >= _T('A') && uri[i] <= _T('F'))
- code += (uri[i] - _T('A')) + 10;
+ if (uri[i] >= T('A') && uri[i] <= T('F'))
+ code += (uri[i] - T('A')) + 10;
else
- code += (uri[i] - _T('0'));
+ code += (uri[i] - T('0'));
i++;
new_uri += (wxChar)code;
continue;
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
#ifdef __GNUG__
-#pragma implementation "utils.h"
+ #pragma implementation "utils.h"
#endif
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
-#pragma hdrstop
+ #pragma hdrstop
#endif
#ifndef WX_PRECOMP
-#include "wx/defs.h"
-#include "wx/utils.h"
-#include "wx/window.h"
-#include "wx/menu.h"
-#include "wx/frame.h"
-#include "wx/msgdlg.h"
-#include "wx/textdlg.h"
-#endif
+ #include "wx/defs.h"
+ #include "wx/string.h"
+ #include "wx/utils.h"
+
+ #if wxUSE_GUI
+ #include "wx/window.h"
+ #include "wx/menu.h"
+ #include "wx/frame.h"
+ #include "wx/msgdlg.h"
+ #include "wx/textdlg.h"
+ #endif // wxUSE_GUI
+#endif // WX_PRECOMP
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
#if !defined(__WATCOMC__)
#if !(defined(_MSC_VER) && (_MSC_VER > 800))
#include <errno.h>
#endif
#endif
+
#include <time.h>
+
#ifndef __MWERKS__
-#include <sys/types.h>
-#include <sys/stat.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
#endif
#ifdef __SALFORDC__
-#include <clib.h>
+ #include <clib.h>
#endif
-// Pattern matching code.
+// Pattern matching code. (FIXME)
// Yes, this path is deliberate (for Borland compilation)
#ifdef wx_mac /* MATTHEW: [5] Mac doesn't like paths with "/" */
#include "glob.inc"
#endif
#ifdef __WXMSW__
-#include "windows.h"
+ #include "windows.h"
#endif
-#define _MAXPATHLEN 500
+// ----------------------------------------------------------------------------
+// function protoypes
+// ----------------------------------------------------------------------------
+
+#if wxUSE_GUI
+ static wxWindow *wxFindWindowByLabel1(const wxString& title, wxWindow *parent);
+ static wxWindow *wxFindWindowByName1 (const wxString& title, wxWindow *parent);
+#endif // wxUSE_GUI
-extern wxChar *wxBuffer;
+// ============================================================================
+// implementation
+// ============================================================================
// ----------------------------------------------------------------------------
-// private functions
+// string functions
// ----------------------------------------------------------------------------
-static wxWindow *wxFindWindowByLabel1(const wxString& title, wxWindow * parent);
-static wxWindow *wxFindWindowByName1 (const wxString& title, wxWindow * parent);
-
#ifdef __WXMAC__
int strcasecmp(const char *str_1, const char *str_2)
{
return 0 ;
}
-#endif
+#endif // wxMAC
+
#ifdef __VMS__
// we have no strI functions under VMS, therefore I have implemented
// an inefficient but portable version: convert copies of strings to lowercase
return(result);
}
-#endif
+#endif // __VMS__
#ifdef __WINDOWS__
wxChar *
copystring (const wxChar *s)
{
- if (s == NULL) s = _T("");
+ if (s == NULL) s = T("");
size_t len = wxStrlen (s) + 1;
wxChar *news = new wxChar[len];
{
static wxChar buf[20];
- wxSprintf (buf, _T("%d"), number);
+ wxSprintf (buf, T("%d"), number);
return buf;
}
{
static wxChar buf[20];
- wxSprintf (buf, _T("%ld"), number);
+ wxSprintf (buf, T("%ld"), number);
return buf;
}
// Array used in DecToHex conversion routine.
-static wxChar hexArray[] = _T("0123456789ABCDEF");
+static wxChar hexArray[] = T("0123456789ABCDEF");
// Convert 2-digit hex number to decimal
int wxHexToDec(const wxString& buf)
{
int firstDigit, secondDigit;
- if (buf.GetChar(0) >= _T('A'))
- firstDigit = buf.GetChar(0) - _T('A') + 10;
+ if (buf.GetChar(0) >= T('A'))
+ firstDigit = buf.GetChar(0) - T('A') + 10;
else
- firstDigit = buf.GetChar(0) - _T('0');
+ firstDigit = buf.GetChar(0) - T('0');
- if (buf.GetChar(1) >= _T('A'))
- secondDigit = buf.GetChar(1) - _T('A') + 10;
+ if (buf.GetChar(1) >= T('A'))
+ secondDigit = buf.GetChar(1) - T('A') + 10;
else
- secondDigit = buf.GetChar(1) - _T('0');
+ secondDigit = buf.GetChar(1) - T('0');
return firstDigit * 16 + secondDigit;
}
return FALSE;
}
-// Don't synthesize KeyUp events holding down a key and producing
-// KeyDown events with autorepeat. On by default and always on
-// on in wxMSW. wxGTK version in utilsgtk.cpp.
-#ifndef __WXGTK__
-bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
-{
- return TRUE; // detectable auto-repeat is the only mode MSW supports
-}
-#endif
-
// Return the current date/time
// [volatile]
-wxString wxNow( void )
+wxString wxNow()
{
time_t now = time((time_t *) NULL);
char *date = ctime(&now);
return wxString(date);
}
-/*
- * Strip out any menu codes
- */
+#if wxUSE_GUI
+
+// ----------------------------------------------------------------------------
+// Strip out any menu codes
+// ----------------------------------------------------------------------------
wxChar *wxStripMenuCodes (wxChar *in, wxChar *out)
{
while (*in)
{
- if (*in == _T('&'))
+ if (*in == T('&'))
{
// Check && -> &, &x -> x
- if (*++in == _T('&'))
+ if (*++in == T('&'))
*out++ = *in++;
}
- else if (*in == _T('\t'))
+ else if (*in == T('\t'))
{
// Remove all stuff after \t in X mode, and let the stuff as is
// in Windows mode.
*out++ = *in++;
} // while
- *out = _T('\0');
+ *out = T('\0');
return tmpOut;
}
return str1;
}
-/*
- * Window search functions
- *
- */
+// ----------------------------------------------------------------------------
+// Window search functions
+// ----------------------------------------------------------------------------
/*
* If parent is non-NULL, look through children for a label or title
return menuBar->FindMenuItem (menuString, itemString);
}
+#endif // wxUSE_GUI
+
/*
On Fri, 21 Jul 1995, Paul Craven wrote:
}
#endif
-void wxEnableTopLevelWindows(bool enable)
-{
- wxWindowList::Node *node;
- for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
- node->GetData()->Enable(enable);
-}
-// Yield to other apps/messages and disable user input
-bool wxSafeYield(wxWindow *win)
-{
- wxEnableTopLevelWindows(FALSE);
- // always enable ourselves
- if ( win )
- win->Enable(TRUE);
- bool rc = wxYield();
- wxEnableTopLevelWindows(TRUE);
- return rc;
-}
+#if wxUSE_GUI
+
+// ----------------------------------------------------------------------------
+// GUI helpers
+// ----------------------------------------------------------------------------
/*
* N.B. these convenience functions must be separate from msgdlgg.cpp, textdlgg.cpp
{
return ( c >= 0 && c < 128 ) ;
}
-#endif
+#endif // __MWERKS__
+
+// ----------------------------------------------------------------------------
+// misc functions
+// ----------------------------------------------------------------------------
+
+void wxEnableTopLevelWindows(bool enable)
+{
+ wxWindowList::Node *node;
+ for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
+ node->GetData()->Enable(enable);
+}
+
+// Yield to other apps/messages and disable user input
+bool wxSafeYield(wxWindow *win)
+{
+ wxEnableTopLevelWindows(FALSE);
+ // always enable ourselves
+ if ( win )
+ win->Enable(TRUE);
+ bool rc = wxYield();
+ wxEnableTopLevelWindows(TRUE);
+ return rc;
+}
+
+// Don't synthesize KeyUp events holding down a key and producing KeyDown
+// events with autorepeat. On by default and always on in wxMSW. wxGTK version
+// in utilsgtk.cpp.
+#ifndef __WXGTK__
+bool wxSetDetectableAutoRepeat( bool WXUNUSED(flag) )
+{
+ return TRUE; // detectable auto-repeat is the only mode MSW supports
+}
+#endif // !wxGTK
+
+#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// network and user id functions
return FALSE;
wxStrncpy(address, email, maxSize - 1);
- address[maxSize - 1] = _T('\0');
+ address[maxSize - 1] = T('\0');
return TRUE;
}
if ( !!user )
{
wxString email(user);
- email << _T('@') << host;
+ email << T('@') << host;
}
}
virtual bool Read(istream& str);
#endif
virtual bool Read(wxString& str);
- virtual wxString GetType() const { return _T("list"); };
+ virtual wxString GetType() const { return T("list"); };
void Clear();
void wxVariantDataList::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("list")), _T("wxVariantDataList::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("list")), T("wxVariantDataList::Copy: Can't copy to this type of data") );
wxVariantDataList& listData = (wxVariantDataList&) data;
bool wxVariantDataList::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("list")), _T("wxVariantDataList::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("list")), T("wxVariantDataList::Eq: argument mismatch") );
wxVariantDataList& listData = (wxVariantDataList&) data;
wxNode* node1 = m_value.First();
bool wxVariantDataList::Write(wxString& str) const
{
- str = _T("");
+ str = T("");
wxNode* node = m_value.First();
while (node)
{
wxVariant* var = (wxVariant*) node->Data();
if (node != m_value.First())
- str += _T(" ");
+ str += T(" ");
wxString str1;
str += var->MakeString();
node = node->Next();
#if wxUSE_STD_IOSTREAM
bool wxVariantDataList::Read(istream& WXUNUSED(str))
{
- wxFAIL_MSG(_T("Unimplemented"));
+ wxFAIL_MSG(T("Unimplemented"));
// TODO
return FALSE;
}
bool wxVariantDataList::Read(wxString& WXUNUSED(str))
{
- wxFAIL_MSG(_T("Unimplemented"));
+ wxFAIL_MSG(T("Unimplemented"));
// TODO
return FALSE;
}
virtual bool Read(istream& str);
#endif
virtual bool Read(wxString& str);
- virtual wxString GetType() const { return _T("stringlist"); };
+ virtual wxString GetType() const { return T("stringlist"); };
protected:
wxStringList m_value;
void wxVariantDataStringList::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("stringlist")), _T("wxVariantDataStringList::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("stringlist")), T("wxVariantDataStringList::Copy: Can't copy to this type of data") );
wxVariantDataStringList& listData = (wxVariantDataStringList&) data;
bool wxVariantDataStringList::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("stringlist")), _T("wxVariantDataStringList::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("stringlist")), T("wxVariantDataStringList::Eq: argument mismatch") );
wxVariantDataStringList& listData = (wxVariantDataStringList&) data;
wxNode* node1 = m_value.First();
bool wxVariantDataStringList::Write(wxString& str) const
{
- str = _T("");
+ str = T("");
wxNode* node = m_value.First();
while (node)
{
wxChar* s = (wxChar*) node->Data();
if (node != m_value.First())
- str += _T(" ");
+ str += T(" ");
str += s;
node = node->Next();
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataStringList::Read(istream& WXUNUSED(str))
{
- wxFAIL_MSG(_T("Unimplemented"));
+ wxFAIL_MSG(T("Unimplemented"));
// TODO
return FALSE;
}
bool wxVariantDataStringList::Read(wxString& WXUNUSED(str))
{
- wxFAIL_MSG(_T("Unimplemented"));
+ wxFAIL_MSG(T("Unimplemented"));
// TODO
return FALSE;
}
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return _T("long"); };
+ virtual wxString GetType() const { return T("long"); };
protected:
long m_value;
void wxVariantDataLong::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("long")), _T("wxVariantDataLong::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("long")), T("wxVariantDataLong::Copy: Can't copy to this type of data") );
wxVariantDataLong& otherData = (wxVariantDataLong&) data;
bool wxVariantDataLong::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("long")), _T("wxVariantDataLong::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("long")), T("wxVariantDataLong::Eq: argument mismatch") );
wxVariantDataLong& otherData = (wxVariantDataLong&) data;
bool wxVariantDataLong::Write(wxString& str) const
{
- str.Printf(_T("%ld"), m_value);
+ str.Printf(T("%ld"), m_value);
return TRUE;
}
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream &str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return _T("double"); };
+ virtual wxString GetType() const { return T("double"); };
protected:
double m_value;
void wxVariantDataReal::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("double")), _T("wxVariantDataReal::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("double")), T("wxVariantDataReal::Copy: Can't copy to this type of data") );
wxVariantDataReal& otherData = (wxVariantDataReal&) data;
bool wxVariantDataReal::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("double")), _T("wxVariantDataReal::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("double")), T("wxVariantDataReal::Eq: argument mismatch") );
wxVariantDataReal& otherData = (wxVariantDataReal&) data;
bool wxVariantDataReal::Write(wxString& str) const
{
- str.Printf(_T("%.4f"), m_value);
+ str.Printf(T("%.4f"), m_value);
return TRUE;
}
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return _T("bool"); };
+ virtual wxString GetType() const { return T("bool"); };
protected:
bool m_value;
void wxVariantDataBool::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("bool")), _T("wxVariantDataBool::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("bool")), T("wxVariantDataBool::Copy: Can't copy to this type of data") );
wxVariantDataBool& otherData = (wxVariantDataBool&) data;
bool wxVariantDataBool::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("bool")), _T("wxVariantDataBool::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("bool")), T("wxVariantDataBool::Eq: argument mismatch") );
wxVariantDataBool& otherData = (wxVariantDataBool&) data;
bool wxVariantDataBool::Write(wxString& str) const
{
- str.Printf(_T("%d"), (int) m_value);
+ str.Printf(T("%d"), (int) m_value);
return TRUE;
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataBool::Read(istream& WXUNUSED(str))
{
- wxFAIL_MSG(_T("Unimplemented"));
+ wxFAIL_MSG(T("Unimplemented"));
// str >> (long) m_value;
return FALSE;
}
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return _T("char"); };
+ virtual wxString GetType() const { return T("char"); };
protected:
char m_value;
void wxVariantDataChar::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("char")), _T("wxVariantDataChar::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("char")), T("wxVariantDataChar::Copy: Can't copy to this type of data") );
wxVariantDataChar& otherData = (wxVariantDataChar&) data;
bool wxVariantDataChar::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("char")), _T("wxVariantDataChar::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("char")), T("wxVariantDataChar::Eq: argument mismatch") );
wxVariantDataChar& otherData = (wxVariantDataChar&) data;
bool wxVariantDataChar::Write(wxString& str) const
{
- str.Printf(_T("%c"), m_value);
+ str.Printf(T("%c"), m_value);
return TRUE;
}
#if wxUSE_STD_IOSTREAM
bool wxVariantDataChar::Read(istream& WXUNUSED(str))
{
- wxFAIL_MSG(_T("Unimplemented"));
+ wxFAIL_MSG(T("Unimplemented"));
// str >> m_value;
return FALSE;
}
virtual bool Read(wxInputStream& str);
virtual bool Write(wxOutputStream& str) const;
#endif // wxUSE_STREAMS
- virtual wxString GetType() const { return _T("string"); };
+ virtual wxString GetType() const { return T("string"); };
protected:
wxString m_value;
void wxVariantDataString::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("string")), _T("wxVariantDataString::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("string")), T("wxVariantDataString::Copy: Can't copy to this type of data") );
wxVariantDataString& otherData = (wxVariantDataString&) data;
bool wxVariantDataString::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("string")), _T("wxVariantDataString::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("string")), T("wxVariantDataString::Eq: argument mismatch") );
wxVariantDataString& otherData = (wxVariantDataString&) data;
virtual bool Read(istream& str);
#endif
virtual bool Read(wxString& str);
- virtual wxString GetType() const { return _T("time"); };
+ virtual wxString GetType() const { return T("time"); };
virtual wxVariantData* Clone() { return new wxVariantDataTime; }
protected:
void wxVariantDataTime::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("time")), _T("wxVariantDataTime::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("time")), T("wxVariantDataTime::Copy: Can't copy to this type of data") );
wxVariantDataTime& otherData = (wxVariantDataTime&) data;
bool wxVariantDataTime::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("time")), _T("wxVariantDataTime::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("time")), T("wxVariantDataTime::Eq: argument mismatch") );
wxVariantDataTime& otherData = (wxVariantDataTime&) data;
virtual bool Read(istream& str);
#endif
virtual bool Read(wxString& str);
- virtual wxString GetType() const { return _T("date"); };
+ virtual wxString GetType() const { return T("date"); };
virtual wxVariantData* Clone() { return new wxVariantDataDate; }
protected:
void wxVariantDataDate::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("date")), _T("wxVariantDataDate::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("date")), T("wxVariantDataDate::Copy: Can't copy to this type of data") );
wxVariantDataDate& otherData = (wxVariantDataDate&) data;
bool wxVariantDataDate::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("date")), _T("wxVariantDataDate::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("date")), T("wxVariantDataDate::Eq: argument mismatch") );
wxVariantDataDate& otherData = (wxVariantDataDate&) data;
virtual bool Read(istream& str);
#endif
virtual bool Read(wxString& str);
- virtual wxString GetType() const { return _T("void*"); };
+ virtual wxString GetType() const { return T("void*"); };
virtual wxVariantData* Clone() { return new wxVariantDataVoidPtr; }
protected:
void wxVariantDataVoidPtr::Copy(wxVariantData& data)
{
- wxASSERT_MSG( (data.GetType() == _T("void*")), _T("wxVariantDataVoidPtr::Copy: Can't copy to this type of data") );
+ wxASSERT_MSG( (data.GetType() == T("void*")), T("wxVariantDataVoidPtr::Copy: Can't copy to this type of data") );
wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data;
bool wxVariantDataVoidPtr::Eq(wxVariantData& data) const
{
- wxASSERT_MSG( (data.GetType() == _T("void*")), _T("wxVariantDataVoidPtr::Eq: argument mismatch") );
+ wxASSERT_MSG( (data.GetType() == T("void*")), T("wxVariantDataVoidPtr::Eq: argument mismatch") );
wxVariantDataVoidPtr& otherData = (wxVariantDataVoidPtr&) data;
bool wxVariantDataVoidPtr::Write(wxString& str) const
{
- str.Printf(_T("%ld"), (long) m_value);
+ str.Printf(T("%ld"), (long) m_value);
return TRUE;
}
void wxVariant::operator= (double value)
{
- if (GetType() == _T("double"))
+ if (GetType() == T("double"))
{
((wxVariantDataReal*)GetData())->SetValue(value);
}
void wxVariant::operator= (long value)
{
- if (GetType() == _T("long"))
+ if (GetType() == T("long"))
{
((wxVariantDataLong*)GetData())->SetValue(value);
}
void wxVariant::operator= (char value)
{
- if (GetType() == _T("char"))
+ if (GetType() == T("char"))
{
((wxVariantDataChar*)GetData())->SetValue(value);
}
void wxVariant::operator= (bool value)
{
- if (GetType() == _T("bool"))
+ if (GetType() == T("bool"))
{
((wxVariantDataBool*)GetData())->SetValue(value);
}
void wxVariant::operator= (const wxString& value)
{
- if (GetType() == _T("string"))
+ if (GetType() == T("string"))
{
((wxVariantDataString*)GetData())->SetValue(value);
}
void wxVariant::operator= (const wxChar* value)
{
- if (GetType() == _T("string"))
+ if (GetType() == T("string"))
{
((wxVariantDataString*)GetData())->SetValue(wxString(value));
}
bool wxVariant::operator== (const wxStringList& value) const
{
- wxASSERT_MSG( (GetType() == _T("stringlist")), _T("Invalid type for == operator") );
+ wxASSERT_MSG( (GetType() == T("stringlist")), T("Invalid type for == operator") );
wxVariantDataStringList other(value);
return (m_data->Eq(other));
void wxVariant::operator= (const wxStringList& value)
{
- if (GetType() == _T("stringlist"))
+ if (GetType() == T("stringlist"))
{
((wxVariantDataStringList*)GetData())->SetValue(value);
}
bool wxVariant::operator== (const wxList& value) const
{
- wxASSERT_MSG( (GetType() == _T("list")), _T("Invalid type for == operator") );
+ wxASSERT_MSG( (GetType() == T("list")), T("Invalid type for == operator") );
wxVariantDataList other(value);
return (m_data->Eq(other));
void wxVariant::operator= (const wxList& value)
{
- if (GetType() == _T("list"))
+ if (GetType() == T("list"))
{
((wxVariantDataList*)GetData())->SetValue(value);
}
void wxVariant::operator= (const wxTime& value)
{
- if (GetType() == _T("time"))
+ if (GetType() == T("time"))
{
((wxVariantDataTime*)GetData())->SetValue(value);
}
void wxVariant::operator= (const wxDate& value)
{
- if (GetType() == _T("date"))
+ if (GetType() == T("date"))
{
((wxVariantDataTime*)GetData())->SetValue(value);
}
void wxVariant::operator= (void* value)
{
- if (GetType() == _T("void*"))
+ if (GetType() == T("void*"))
{
((wxVariantDataVoidPtr*)GetData())->SetValue(value);
}
// Treat a list variant as an array
wxVariant wxVariant::operator[] (size_t idx) const
{
- wxASSERT_MSG( (GetType() == _T("list") || GetType() == _T("stringlist")), _T("Invalid type for array operator") );
+ wxASSERT_MSG( (GetType() == T("list") || GetType() == T("stringlist")), T("Invalid type for array operator") );
- if (GetType() == _T("list"))
+ if (GetType() == T("list"))
{
wxVariantDataList* data = (wxVariantDataList*) m_data;
- wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), _T("Invalid index for array") );
+ wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), T("Invalid index for array") );
return * (wxVariant*) (data->GetValue().Nth(idx)->Data());
}
- else if (GetType() == _T("stringlist"))
+ else if (GetType() == T("stringlist"))
{
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
- wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), _T("Invalid index for array") );
+ wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), T("Invalid index for array") );
wxVariant variant( wxString( (wxChar*) (data->GetValue().Nth(idx)->Data()) ));
return variant;
// We can't return a reference to a variant for a string list, since the string
// is actually stored as a char*, not a variant.
- wxASSERT_MSG( (GetType() == _T("list")), _T("Invalid type for array operator") );
+ wxASSERT_MSG( (GetType() == T("list")), T("Invalid type for array operator") );
wxVariantDataList* data = (wxVariantDataList*) m_data;
- wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), _T("Invalid index for array") );
+ wxASSERT_MSG( (idx < (size_t) data->GetValue().Number()), T("Invalid index for array") );
return * (wxVariant*) (data->GetValue().Nth(idx)->Data());
}
// Return the number of elements in a list
int wxVariant::GetCount() const
{
- wxASSERT_MSG( (GetType() == _T("list") || GetType() == _T("stringlist")), _T("Invalid type for GetCount()") );
+ wxASSERT_MSG( (GetType() == T("list") || GetType() == T("stringlist")), T("Invalid type for GetCount()") );
- if (GetType() == _T("list"))
+ if (GetType() == T("list"))
{
wxVariantDataList* data = (wxVariantDataList*) m_data;
return data->GetValue().Number();
}
- else if (GetType() == _T("stringlist"))
+ else if (GetType() == T("stringlist"))
{
wxVariantDataStringList* data = (wxVariantDataStringList*) m_data;
return data->GetValue().Number();
if (GetData()->Write(str))
return str;
}
- return wxString(_T(""));
+ return wxString(T(""));
}
// Accessors
wxString wxVariant::GetType() const
{
if (IsNull())
- return wxString(_T("null"));
+ return wxString(T("null"));
else
return m_data->GetType();
}
return value;
else
{
- wxFAIL_MSG(_T("Could not convert to a real number"));
+ wxFAIL_MSG(T("Could not convert to a real number"));
return 0.0;
}
}
return value;
else
{
- wxFAIL_MSG(_T("Could not convert to an integer"));
+ wxFAIL_MSG(T("Could not convert to an integer"));
return 0;
}
}
return value;
else
{
- wxFAIL_MSG(_T("Could not convert to a char"));
+ wxFAIL_MSG(T("Could not convert to a char"));
return 0;
}
}
return value;
else
{
- wxFAIL_MSG(_T("Could not convert to a bool"));
+ wxFAIL_MSG(T("Could not convert to a bool"));
return 0;
}
}
return value;
else
{
- wxFAIL_MSG(_T("Could not convert to a string"));
+ wxFAIL_MSG(T("Could not convert to a string"));
return wxString("");
}
}
return value;
else
{
- wxFAIL_MSG(_T("Could not convert to a time"));
+ wxFAIL_MSG(T("Could not convert to a time"));
return wxTime();
}
}
return value;
else
{
- wxFAIL_MSG(_T("Could not convert to a date"));
+ wxFAIL_MSG(T("Could not convert to a date"));
return wxDate();
}
}
void* wxVariant::GetVoidPtr() const
{
- wxASSERT( (GetType() == _T("void*")) );
+ wxASSERT( (GetType() == T("void*")) );
return (void*) ((wxVariantDataVoidPtr*) m_data)->GetValue();
}
wxList& wxVariant::GetList() const
{
- wxASSERT( (GetType() == _T("list")) );
+ wxASSERT( (GetType() == T("list")) );
return (wxList&) ((wxVariantDataList*) m_data)->GetValue();
}
wxStringList& wxVariant::GetStringList() const
{
- wxASSERT( (GetType() == _T("stringlist")) );
+ wxASSERT( (GetType() == T("stringlist")) );
return (wxStringList&) ((wxVariantDataStringList*) m_data)->GetValue();
}
{
wxList& list = GetList();
- wxASSERT_MSG( (item < list.Number()), _T("Invalid index to Delete") );
+ wxASSERT_MSG( (item < list.Number()), T("Invalid index to Delete") );
wxNode* node = list.Nth(item);
wxVariant* variant = (wxVariant*) node->Data();
delete variant;
// Clear list
void wxVariant::ClearList()
{
- if (!IsNull() && (GetType() == _T("list")))
+ if (!IsNull() && (GetType() == T("list")))
{
((wxVariantDataList*) m_data)->Clear();
}
else
{
- if (GetType() != _T("list"))
+ if (GetType() != T("list"))
{
delete m_data;
m_data = NULL;
bool wxVariant::Convert(long* value) const
{
wxString type(GetType());
- if (type == _T("double"))
+ if (type == T("double"))
*value = (long) (((wxVariantDataReal*)GetData())->GetValue());
- else if (type == _T("long"))
+ else if (type == T("long"))
*value = ((wxVariantDataLong*)GetData())->GetValue();
#ifdef HAVE_BOOL
- else if (type == _T("bool"))
+ else if (type == T("bool"))
*value = (long) (((wxVariantDataBool*)GetData())->GetValue());
#endif
- else if (type == _T("string"))
+ else if (type == T("string"))
*value = wxAtol((const wxChar*) ((wxVariantDataString*)GetData())->GetValue());
else
return FALSE;
bool wxVariant::Convert(bool* value) const
{
wxString type(GetType());
- if (type == _T("double"))
+ if (type == T("double"))
*value = ((int) (((wxVariantDataReal*)GetData())->GetValue()) != 0);
- else if (type == _T("long"))
+ else if (type == T("long"))
*value = (((wxVariantDataLong*)GetData())->GetValue() != 0);
#ifdef HAVE_BOOL
- else if (type == _T("bool"))
+ else if (type == T("bool"))
*value = ((wxVariantDataBool*)GetData())->GetValue();
#endif
- else if (type == _T("string"))
+ else if (type == T("string"))
{
wxString val(((wxVariantDataString*)GetData())->GetValue());
val.MakeLower();
- if (val == _T("true") || val == _T("yes"))
+ if (val == T("true") || val == T("yes"))
*value = TRUE;
- else if (val == _T("false") || val == _T("no"))
+ else if (val == T("false") || val == T("no"))
*value = FALSE;
else
return FALSE;
bool wxVariant::Convert(double* value) const
{
wxString type(GetType());
- if (type == _T("double"))
+ if (type == T("double"))
*value = ((wxVariantDataReal*)GetData())->GetValue();
- else if (type == _T("long"))
+ else if (type == T("long"))
*value = (double) (((wxVariantDataLong*)GetData())->GetValue());
#ifdef HAVE_BOOL
- else if (type == _T("bool"))
+ else if (type == T("bool"))
*value = (double) (((wxVariantDataBool*)GetData())->GetValue());
#endif
- else if (type == _T("string"))
+ else if (type == T("string"))
*value = (double) wxAtof((const wxChar*) ((wxVariantDataString*)GetData())->GetValue());
else
return FALSE;
bool wxVariant::Convert(char* value) const
{
wxString type(GetType());
- if (type == _T("char"))
+ if (type == T("char"))
*value = ((wxVariantDataChar*)GetData())->GetValue();
- else if (type == _T("long"))
+ else if (type == T("long"))
*value = (char) (((wxVariantDataLong*)GetData())->GetValue());
#ifdef HAVE_BOOL
- else if (type == _T("bool"))
+ else if (type == T("bool"))
*value = (char) (((wxVariantDataBool*)GetData())->GetValue());
#endif
else
bool wxVariant::Convert(wxTime* value) const
{
wxString type(GetType());
- if (type == _T("time"))
+ if (type == T("time"))
*value = ((wxVariantDataTime*)GetData())->GetValue();
- else if (type == _T("date"))
+ else if (type == T("date"))
*value = wxTime(((wxVariantDataDate*)GetData())->GetValue());
else
return FALSE;
bool wxVariant::Convert(wxDate* value) const
{
wxString type(GetType());
- if (type == _T("date"))
+ if (type == T("date"))
*value = ((wxVariantDataDate*)GetData())->GetValue();
else
return FALSE;
// m_isWindow is set to TRUE in wxWindowBase::Init() as well as many other
// member variables - check that it has been called (will catch the case
// when a new ctor is added which doesn't call InitWindow)
- wxASSERT_MSG( m_isWindow, _T("Init() must have been called before!") );
+ wxASSERT_MSG( m_isWindow, T("Init() must have been called before!") );
// generate a new id if the user doesn't care about it
m_windowId = id == -1 ? NewControlId() : id;
// we weren't a dialog class
wxTopLevelWindows.DeleteObject(this);
- wxASSERT_MSG( GetChildren().GetCount() == 0, _T("children not destroyed") );
+ wxASSERT_MSG( GetChildren().GetCount() == 0, T("children not destroyed") );
// make sure that there are no dangling pointers left pointing to us
wxPanel *panel = wxDynamicCast(GetParent(), wxPanel);
wxWindow *child = node->GetData();
- wxASSERT_MSG( child, _T("children list contains empty nodes") );
+ wxASSERT_MSG( child, T("children list contains empty nodes") );
delete child;
wxASSERT_MSG( !GetChildren().Find(child),
- _T("child didn't remove itself using RemoveChild()") );
+ T("child didn't remove itself using RemoveChild()") );
}
return TRUE;
if ( !(direction & wxCENTRE_ON_SCREEN) || wxDynamicCast(this, wxControl) )
{
// theo nly chance to get this is to have a wxControl without parent
- wxCHECK_RET( parent, _T("a control must have a parent") );
+ wxCHECK_RET( parent, T("a control must have a parent") );
// adjust to the parents client area origin
wxPoint posParent = parent->ClientToScreen(wxPoint(0, 0));
void wxWindowBase::AddChild(wxWindowBase *child)
{
- wxCHECK_RET( child, _T("can't add a NULL child") );
+ wxCHECK_RET( child, T("can't add a NULL child") );
GetChildren().Append(child);
child->SetParent(this);
void wxWindowBase::RemoveChild(wxWindowBase *child)
{
- wxCHECK_RET( child, _T("can't remove a NULL child") );
+ wxCHECK_RET( child, T("can't remove a NULL child") );
GetChildren().DeleteObject(child);
child->SetParent((wxWindow *)NULL);
if ( m_caret )
{
wxASSERT_MSG( m_caret->GetWindow() == this,
- _T("caret should be created associated to this window") );
+ T("caret should be created associated to this window") );
}
}
#endif // wxUSE_CARET
wxChar *windowClass = GetClassInfo()->GetClassName();
wxString winName;
- if ( GetName() == _T("") )
- winName = _T("unnamed");
+ if ( GetName() == T("") )
+ winName = T("unnamed");
else
winName = GetName();
- wxLogDebug( _T("Constraint(s) not satisfied for window of type %s, name %s:\n"),
+ wxLogDebug( T("Constraint(s) not satisfied for window of type %s, name %s:\n"),
(const wxChar *)windowClass,
(const wxChar *)winName);
- if ( !constr->left.GetDone()) wxLogDebug( _T(" unsatisfied 'left' constraint.\n") );
- if ( !constr->right.GetDone()) wxLogDebug( _T(" unsatisfied 'right' constraint.\n") );
- if ( !constr->width.GetDone()) wxLogDebug( _T(" unsatisfied 'width' constraint.\n") );
- if ( !constr->height.GetDone()) wxLogDebug( _T(" unsatisfied 'height' constraint.\n") );
- wxLogDebug( _T("Please check constraints: try adding AsIs() constraints.\n") );
+ if ( !constr->left.GetDone()) wxLogDebug( T(" unsatisfied 'left' constraint.\n") );
+ if ( !constr->right.GetDone()) wxLogDebug( T(" unsatisfied 'right' constraint.\n") );
+ if ( !constr->width.GetDone()) wxLogDebug( T(" unsatisfied 'width' constraint.\n") );
+ if ( !constr->height.GetDone()) wxLogDebug( T(" unsatisfied 'height' constraint.\n") );
+ wxLogDebug( T("Please check constraints: try adding AsIs() constraints.\n") );
}
if ( recurse )
void wxWindowBase::DoSetClientObject( wxClientData *data )
{
wxASSERT_MSG( m_clientDataType != ClientData_Void,
- _T("can't have both object and void client data") );
+ T("can't have both object and void client data") );
if ( m_clientObject )
delete m_clientObject;
wxClientData *wxWindowBase::DoGetClientObject() const
{
wxASSERT_MSG( m_clientDataType == ClientData_Object,
- _T("this window doesn't have object client data") );
+ T("this window doesn't have object client data") );
return m_clientObject;
}
void wxWindowBase::DoSetClientData( void *data )
{
wxASSERT_MSG( m_clientDataType != ClientData_Object,
- _T("can't have both object and void client data") );
+ T("can't have both object and void client data") );
m_clientData = data;
m_clientDataType = ClientData_Void;
void *wxWindowBase::DoGetClientData() const
{
wxASSERT_MSG( m_clientDataType == ClientData_Void,
- _T("this window doesn't have void client data") );
+ T("this window doesn't have void client data") );
return m_clientData;
}
{
if (buf) {
if (!n || !*psz) {
- if (n) *buf = _T('\0');
+ if (n) *buf = T('\0');
return 0;
}
return mbstowcs(buf, psz, n);
psz = wxStrpbrk(psz, delim);
if (!psz) *save_ptr = (wxChar*)NULL;
else {
- *psz = _T('\0');
+ *psz = T('\0');
*save_ptr = psz + 1;
}
return ret;
// FIXME: only correct for C locale
while (wxIsspace(*nptr)) nptr++;
- if (*nptr == _T('+') || *nptr == _T('-')) nptr++;
+ if (*nptr == T('+') || *nptr == T('-')) nptr++;
while (wxIsdigit(*nptr)) nptr++;
- if (*nptr == _T('.')) {
+ if (*nptr == T('.')) {
nptr++;
while (wxIsdigit(*nptr)) nptr++;
}
- if (*nptr == _T('E') || *nptr == _T('e')) {
+ if (*nptr == T('E') || *nptr == T('e')) {
nptr++;
- if (*nptr == _T('+') || *nptr == _T('-')) nptr++;
+ if (*nptr == T('+') || *nptr == T('-')) nptr++;
while (wxIsdigit(*nptr)) nptr++;
}
wxString data(nptr, nptr-start);
wxWX2MBbuf dat = data.mb_str(wxConvLibc);
- char *rdat = MBSTRINGCAST dat;
+ char *rdat = wxMBSTRINGCAST dat;
double ret = strtod(dat, &rdat);
if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat));
// FIXME: only correct for C locale
while (wxIsspace(*nptr)) nptr++;
- if (*nptr == _T('+') || *nptr == _T('-')) nptr++;
+ if (*nptr == T('+') || *nptr == T('-')) nptr++;
if (((base == 0) || (base == 16)) &&
- (nptr[0] == _T('0') && nptr[1] == _T('x'))) {
+ (nptr[0] == T('0') && nptr[1] == T('x'))) {
nptr += 2;
base = 16;
}
- else if ((base == 0) && (nptr[0] == _T('0'))) base = 8;
+ else if ((base == 0) && (nptr[0] == T('0'))) base = 8;
else if (base == 0) base = 10;
- while ((wxIsdigit(*nptr) && (*nptr - _T('0') < base)) ||
- (wxIsalpha(*nptr) && (wxToupper(*nptr) - _T('A') + 10 < base))) nptr++;
+ while ((wxIsdigit(*nptr) && (*nptr - T('0') < base)) ||
+ (wxIsalpha(*nptr) && (wxToupper(*nptr) - T('A') + 10 < base))) nptr++;
wxString data(nptr, nptr-start);
wxWX2MBbuf dat = data.mb_str(wxConvLibc);
- char *rdat = MBSTRINGCAST dat;
+ char *rdat = wxMBSTRINGCAST dat;
long int ret = strtol(dat, &rdat, base);
if (endptr) *endptr = (wxChar *)(start + (rdat - (const char *)dat));
wxString wxExpr::Functor(void) const // Use only for a clause
{
if ((type != wxExprList) || !value.first)
- return wxString(_T(""));
+ return wxString(T(""));
if (value.first->type == wxExprWord)
return wxString(value.first->value.word);
else
- return wxString(_T(""));
+ return wxString(T(""));
}
bool wxExpr::IsFunctor(const wxString& f) const // Use only for a clause
// DeleteAttributeValue(attribute);
wxExpr *patt = new wxExpr(wxExprWord, attribute);
- wxExpr *pequals = new wxExpr(wxExprWord, _T("="));
+ wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList);
wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(val);
- wxExpr *pequals = new wxExpr(wxExprWord, _T("="));
+ wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList);
// DeleteAttributeValue(attribute);
wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(val);
- wxExpr *pequals = new wxExpr(wxExprWord, _T("="));
+ wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList);
wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(wxExprString, val);
- wxExpr *pequals = new wxExpr(wxExprWord, _T("="));
+ wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList);
wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(wxExprWord, val);
- wxExpr *pequals = new wxExpr(wxExprWord, _T("="));
+ wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList);
wxExpr *patt = new wxExpr(wxExprWord, attribute);
wxExpr *pval = new wxExpr(val);
- wxExpr *pequals = new wxExpr(wxExprWord, _T("="));
+ wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr = new wxExpr(wxExprList);
// Now make an (=, Att, Value) triple
wxExpr *patt = new wxExpr(wxExprWord, attribute);
- wxExpr *pequals = new wxExpr(wxExprWord, _T("="));
+ wxExpr *pequals = new wxExpr(wxExprWord, T("="));
wxExpr *listExpr2 = new wxExpr(wxExprList);
{
wxExpr *expr = value.first;
- if ((expr->Type() == wxExprWord) && (wxStrcmp(expr->WordValue(), _T("=")) == 0))
+ if ((expr->Type() == wxExprWord) && (wxStrcmp(expr->WordValue(), T("=")) == 0))
{
wxExpr *arg1 = expr->next;
wxExpr *arg2 = arg1->next;
thewxExprDatabase = this;
const wxWX2MBbuf buf = buffer.mb_str();
- LexFromString(MBSTRINGCAST buf);
+ LexFromString(wxMBSTRINGCAST buf);
yyparse();
wxExprCleanUp();
return (noErrors == 0);
t = s;
for(i=1; i<len; i++) // 1 since we want to skip leading quote
{
- if (sbuf[i] == _T('\\') && sbuf[i+1] == _T('"'))
+ if (sbuf[i] == T('\\') && sbuf[i+1] == T('"'))
{
- *t++ = _T('"');
+ *t++ = T('"');
i ++;
}
- else if (sbuf[i] == _T('\\') && sbuf[i+1] == _T('\\'))
+ else if (sbuf[i] == T('\\') && sbuf[i+1] == T('\\'))
{
- *t++ = _T('\\');
+ *t++ = T('\\');
i ++;
}
else
*t++ = sbuf[i];
}
- *t = _T('\0');
+ *t = T('\0');
wxExpr *x = new wxExpr(wxExprString, s, FALSE);
return (char *)x;
#pragma hdrstop
#endif
-#if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
+#if wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
#include "wx/log.h"
#include "wx/intl.h"
m_Pos = 0;
m_Size = 0;
- m_Archive = (void*) unzOpen(archive.mb_str(wxConvFile));
- if (m_Archive == NULL)
+ m_Archive = (void*) unzOpen(archive.fn_str());
+ if (m_Archive == NULL)
{
m_lasterror = wxStream_READ_ERR;
return;
}
- if (unzLocateFile((unzFile)m_Archive, file.mb_str(wxConvFile), 0) != UNZ_OK)
+ if (unzLocateFile((unzFile)m_Archive, file.fn_str(), 0) != UNZ_OK)
{
m_lasterror = wxStream_READ_ERR;
return;
}
-
+
unzGetCurrentFileInfo((unzFile)m_Archive, &zinfo, (char*) NULL, 0, (void*) NULL, 0, (char*) NULL, 0);
- if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK)
+ if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK)
{
m_lasterror = wxStream_READ_ERR;
return;
wxZipInputStream::~wxZipInputStream()
{
- if (m_Archive)
+ if (m_Archive)
{
if (m_Size != 0)
unzCloseCurrentFile((unzFile)m_Archive);
off_t nextpos;
void *buf;
- switch (mode)
+ switch (mode)
{
case wxFromCurrent : nextpos = seek + m_Pos; break;
case wxFromStart : nextpos = seek; break;
}
// cheated seeking :
- if (nextpos > m_Pos)
+ if (nextpos > m_Pos)
{
buf = malloc(nextpos - m_Pos);
unzReadCurrentFile((unzFile)m_Archive, buf, nextpos - m_Pos);
}
else if (nextpos < m_Pos) {
unzCloseCurrentFile((unzFile)m_Archive);
- if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK)
- {
+ if (unzOpenCurrentFile((unzFile)m_Archive) != UNZ_OK)
+ {
m_lasterror = wxStream_READ_ERR;
return m_Pos;
}
}
#endif
- // wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
+ // wxUSE_STREAMS && wxUSE_ZIPSTREAM && wxUSE_ZLIB
err = deflate(m_deflate, Z_FINISH);
if (err != Z_STREAM_END)
{
- wxLogDebug( _T("wxZlibOutputStream: an error occured while closing the stream.\n") );
+ wxLogDebug( T("wxZlibOutputStream: an error occured while closing the stream.\n") );
return;
}
if ( dialog.ShowModal() == wxID_OK )
return dialog.GetStringSelection();
else
- return _T("");
+ return T("");
}
// Overloaded for backward compatibility
{
m_selection = 0;
m_clientData = NULL;
- m_stringSelection = _T("");
+ m_stringSelection = T("");
m_dialogStyle = style;
*/
#define NUM_COLS 48
-static wxString wxColourDialogNames[NUM_COLS]={_T("ORANGE"),
- _T("GOLDENROD"),
- _T("WHEAT"),
- _T("SPRING GREEN"),
- _T("SKY BLUE"),
- _T("SLATE BLUE"),
- _T("MEDIUM VIOLET RED"),
- _T("PURPLE"),
-
- _T("RED"),
- _T("YELLOW"),
- _T("MEDIUM SPRING GREEN"),
- _T("PALE GREEN"),
- _T("CYAN"),
- _T("LIGHT STEEL BLUE"),
- _T("ORCHID"),
- _T("LIGHT MAGENTA"),
-
- _T("BROWN"),
- _T("YELLOW"),
- _T("GREEN"),
- _T("CADET BLUE"),
- _T("MEDIUM BLUE"),
- _T("MAGENTA"),
- _T("MAROON"),
- _T("ORANGE RED"),
-
- _T("FIREBRICK"),
- _T("CORAL"),
- _T("FOREST GREEN"),
- _T("AQUAMARINE"),
- _T("BLUE"),
- _T("NAVY"),
- _T("THISTLE"),
- _T("MEDIUM VIOLET RED"),
-
- _T("INDIAN RED"),
- _T("GOLD"),
- _T("MEDIUM SEA GREEN"),
- _T("MEDIUM BLUE"),
- _T("MIDNIGHT BLUE"),
- _T("GREY"),
- _T("PURPLE"),
- _T("KHAKI"),
-
- _T("BLACK"),
- _T("MEDIUM FOREST GREEN"),
- _T("KHAKI"),
- _T("DARK GREY"),
- _T("SEA GREEN"),
- _T("LIGHT GREY"),
- _T("MEDIUM SLATE BLUE"),
- _T("WHITE")
+static wxString wxColourDialogNames[NUM_COLS]={T("ORANGE"),
+ T("GOLDENROD"),
+ T("WHEAT("),
+ T("SPRING GREEN"),
+ T("SKY BLUE"),
+ T("SLATE BLUE"),
+ T("MEDIUM VIOLET RED"),
+ T("PURPLE"),
+
+ T("RED"),
+ T("YELLOW"),
+ T("MEDIUM SPRING GREEN"),
+ T("PALE GREEN"),
+ T("CYAN"),
+ T("LIGHT STEEL BLUE"),
+ T("ORCHID"),
+ T("LIGHT MAGENTA"),
+
+ T("BROWN"),
+ T("YELLOW"),
+ T("GREEN"),
+ T("CADET BLUE"),
+ T("MEDIUM BLUE"),
+ T("MAGENTA"),
+ T("MAROON"),
+ T("ORANGE RED"),
+
+ T("FIREBRICK"),
+ T("CORAL"),
+ T("FOREST GREEN"),
+ T("AQUAMARINE"),
+ T("BLUE"),
+ T("NAVY"),
+ T("THISTLE"),
+ T("MEDIUM VIOLET RED"),
+
+ T("INDIAN RED"),
+ T("GOLD"),
+ T("MEDIUM SEA GREEN"),
+ T("MEDIUM BLUE"),
+ T("MIDNIGHT BLUE"),
+ T("GREY"),
+ T("PURPLE"),
+ T("KHAKI"),
+
+ T("BLACK"),
+ T("MEDIUM FOREST GREEN"),
+ T("KHAKI"),
+ T("DARK GREY"),
+ T("SEA GREEN"),
+ T("LIGHT GREY"),
+ T("MEDIUM SLATE BLUE"),
+ T("WHITE")
};
wxGenericColourDialog::wxGenericColourDialog()
wxChar userId[256];
wxGetUserId (userId, sizeof (userId) / sizeof (char));
wxChar tmp[256];
- wxStrcpy (tmp, _T("/tmp/preview_"));
+ wxStrcpy (tmp, T("/tmp/preview_"));
wxStrcat (tmp, userId);
m_printData.SetFilename(tmp);
#endif
wxChar tmp2[256];
wxStrcpy(tmp2, m_printData.GetFilename());
- wxStrcat (tmp2, _T(".ps"));
+ wxStrcat (tmp2, T(".ps"));
m_printData.SetFilename(tmp2);
}
- else if ((m_printData.GetFilename() == _T("")) && (m_printData.GetPrintMode() == wxPRINT_MODE_FILE))
+ else if ((m_printData.GetFilename() == T("")) && (m_printData.GetPrintMode() == wxPRINT_MODE_FILE))
{
- wxString file = wxSaveFileSelector (_("PostScript"), _T("ps"));
+ wxString file = wxSaveFileSelector (_("PostScript"), T("ps"));
if ( file.IsEmpty() )
{
m_ok = FALSE;
void wxPostScriptDC::SetClippingRegion (long x, long y, long w, long h)
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (m_clipping) return;
void wxPostScriptDC::SetClippingRegion( const wxRegion &WXUNUSED(region) )
{
- wxFAIL_MSG( _T("wxPostScriptDC::SetClippingRegion not implemented.") );
+ wxFAIL_MSG( T("wxPostScriptDC::SetClippingRegion not implemented.") );
}
void wxPostScriptDC::DestroyClippingRegion()
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
wxDC::DestroyClippingRegion();
void wxPostScriptDC::Clear()
{
- wxFAIL_MSG( _T("wxPostScriptDC::Clear not implemented.") );
+ wxFAIL_MSG( T("wxPostScriptDC::Clear not implemented.") );
}
void wxPostScriptDC::DoFloodFill (long WXUNUSED(x), long WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style))
{
- wxFAIL_MSG( _T("wxPostScriptDC::FloodFill not implemented.") );
+ wxFAIL_MSG( T("wxPostScriptDC::FloodFill not implemented.") );
}
bool wxPostScriptDC::DoGetPixel (long WXUNUSED(x), long WXUNUSED(y), wxColour * WXUNUSED(col)) const
{
- wxFAIL_MSG( _T("wxPostScriptDC::GetPixel not implemented.") );
+ wxFAIL_MSG( T("wxPostScriptDC::GetPixel not implemented.") );
return FALSE;
}
void wxPostScriptDC::DoCrossHair (long WXUNUSED(x), long WXUNUSED(y))
{
- wxFAIL_MSG( _T("wxPostScriptDC::CrossHair not implemented.") );
+ wxFAIL_MSG( T("wxPostScriptDC::CrossHair not implemented.") );
}
void wxPostScriptDC::DoDrawLine (long x1, long y1, long x2, long y2)
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return;
void wxPostScriptDC::DoDrawArc (long x1, long y1, long x2, long y2, long xc, long yc)
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
long dx = x1 - xc;
long dy = y1 - yc;
void wxPostScriptDC::DoDrawEllipticArc(long x,long y,long w,long h,double sa,double ea)
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (sa>=360 || sa<=-360) sa=sa-int(sa/360)*360;
if (ea>=360 || ea<=-360) ea=ea-int(ea/360)*360;
void wxPostScriptDC::DoDrawPoint (long x, long y)
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return;
void wxPostScriptDC::DoDrawPolygon (int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle))
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (n <= 0) return;
void wxPostScriptDC::DoDrawLines (int n, wxPoint points[], long xoffset, long yoffset)
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return;
void wxPostScriptDC::DoDrawRectangle (long x, long y, long width, long height)
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (m_brush.GetStyle () != wxTRANSPARENT)
{
void wxPostScriptDC::DoDrawRoundedRectangle (long x, long y, long width, long height, double radius)
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (radius < 0.0)
{
void wxPostScriptDC::DoDrawEllipse (long x, long y, long width, long height)
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (m_brush.GetStyle () != wxTRANSPARENT)
{
void wxPostScriptDC::DoDrawBitmap( const wxBitmap& bitmap, long x, long y, bool WXUNUSED(useMask) )
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (!bitmap.Ok()) return;
void wxPostScriptDC::SetFont( const wxFont& font )
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (!font.Ok()) return;
void wxPostScriptDC::SetPen( const wxPen& pen )
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (!pen.Ok()) return;
void wxPostScriptDC::SetBrush( const wxBrush& brush )
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (!brush.Ok()) return;
void wxPostScriptDC::DoDrawText( const wxString& text, long x, long y )
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
SetFont( m_font );
void wxPostScriptDC::SetLogicalFunction (int WXUNUSED(function))
{
- wxFAIL_MSG( _T("wxPostScriptDC::SetLogicalFunction not implemented.") );
+ wxFAIL_MSG( T("wxPostScriptDC::SetLogicalFunction not implemented.") );
}
void wxPostScriptDC::DoDrawSpline( wxList *points )
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
SetPen( m_pen );
void wxPostScriptDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? 1 : -1);
void wxPostScriptDC::SetDeviceOrigin( long x, long y )
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
int h = 0;
int w = 0;
bool wxPostScriptDC::StartDoc( const wxString& message )
{
- wxCHECK_MSG( m_ok, FALSE, _T("invalid postscript dc") );
+ wxCHECK_MSG( m_ok, FALSE, T("invalid postscript dc") );
if (m_printData.GetFilename() == "")
{
void wxPostScriptDC::EndDoc ()
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
if (m_clipping)
{
wxChar userID[256];
if ( wxGetEmailAddress(userID, sizeof(userID)) )
{
- fprintf( m_pstream, "%%%%For: %s ", MBSTRINGCAST wxConvCurrent->cWX2MB(userID) );
+ fprintf( m_pstream, "%%%%For: %s ", wxMBSTRINGCAST wxConvCurrent->cWX2MB(userID) );
wxChar userName[245];
if (wxGetUserName(userName, sizeof(userName)))
- fprintf( m_pstream, " (%s)", MBSTRINGCAST wxConvCurrent->cWX2MB(userName) );
+ fprintf( m_pstream, " (%s)", wxMBSTRINGCAST wxConvCurrent->cWX2MB(userName) );
fprintf( m_pstream, "\n" );
}
else if ( wxGetUserName(userID, sizeof(userID)) )
{
- fprintf( m_pstream, "%%%%For: %s\n", MBSTRINGCAST wxConvCurrent->cWX2MB(userID) );;
+ fprintf( m_pstream, "%%%%For: %s\n", wxMBSTRINGCAST wxConvCurrent->cWX2MB(userID) );;
}
// THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe <andy@hyperparallel.com>
void wxPostScriptDC::StartPage()
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
fprintf( m_pstream, "%%%%Page: %d\n", wxPageNumber++ );
void wxPostScriptDC::EndPage ()
{
- wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
+ wxCHECK_RET( m_ok && m_pstream, T("invalid postscript dc") );
fprintf( m_pstream, "showpage\n" );
}
long xsrc, long ysrc,
int rop, bool WXUNUSED(useMask) )
{
- wxCHECK_MSG( m_ok && m_pstream, FALSE, _T("invalid postscript dc") );
+ wxCHECK_MSG( m_ok && m_pstream, FALSE, T("invalid postscript dc") );
- wxCHECK_MSG( source, FALSE, _T("invalid source dc") );
+ wxCHECK_MSG( source, FALSE, T("invalid source dc") );
/* blit into a bitmap */
wxBitmap bitmap( (int)fwidth, (int)fheight );
if (!fontToUse) fontToUse = (wxFont*) &m_font;
- wxCHECK_RET( fontToUse, _T("GetTextExtent: no font defined") );
- wxCHECK_RET( x, _T("GetTextExtent: x == NULL") );
- wxCHECK_RET( y, _T("GetTextExtent: y == NULL") );
+ wxCHECK_RET( fontToUse, T("GetTextExtent: no font defined") );
+ wxCHECK_RET( x, T("GetTextExtent: x == NULL") );
+ wxCHECK_RET( y, T("GetTextExtent: y == NULL") );
const wxWX2MBbuf strbuf = string.mb_str();
// Created: 12/12/98
// RCS-ID: $Id$
// Copyright: (c) Harm van der Heijden and Robert Roebling
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
/* width height ncolors chars_per_pixel */
"16 16 6 1",
/* colors */
-" s None c None",
-". c #000000",
-"+ c #c0c0c0",
-"@ c #808080",
-"# c #ffff00",
-"$ c #ffffff",
+" s None c None",
+". c #000000",
+"+ c #c0c0c0",
+"@ c #808080",
+"# c #ffff00",
+"$ c #ffffff",
/* pixels */
" ",
" @@@@@ ",
/* width height ncolors chars_per_pixel */
"16 16 6 1",
/* colors */
-" s None c None",
-". c #000000",
-"+ c #c0c0c0",
-"@ c #808080",
-"# c #ffff00",
-"$ c #ffffff",
+" s None c None",
+". c #000000",
+"+ c #c0c0c0",
+"@ c #808080",
+"# c #ffff00",
+"$ c #ffffff",
/* pixels */
" ",
" @@@@@ ",
{
m_path = path;
m_name = name;
- /* Insert logic to detect hidden files here
- * In UnixLand we just check whether the first char is a dot
+ /* Insert logic to detect hidden files here
+ * In UnixLand we just check whether the first char is a dot
* For FileNameFromPath read LastDirNameInThisPath ;-) */
// m_isHidden = (bool)(wxFileNameFromPath(*m_path)[0] == '.');
m_isHidden = FALSE;
m_imageListNormal->Add(wxICON(icon2));
SetImageList(m_imageListNormal);
#endif
-
+
m_showHidden = FALSE;
m_rootId = AddRoot( _("Sections") );
SetItemHasChildren(m_rootId);
#define ADD_SECTION(a,b) \
if (wxPathExists((a))) { m_paths.Add( (a) ); m_names.Add( (b) ); };
-void wxDirCtrl::SetupSections()
+void wxDirCtrl::SetupSections()
{
wxString home;
m_names.Clear();
#ifdef __WXMSW__
// better than nothing
- ADD_SECTION(_T("c:\\"), _("My Harddisk") )
+ ADD_SECTION(T("c:\\"), _("My Harddisk") )
#else
- ADD_SECTION(_T("/"), _("The Computer") )
+ ADD_SECTION(T("/"), _("The Computer") )
wxGetHomeDir(&home);
ADD_SECTION(home, _("My Home") )
- ADD_SECTION(_T("/mnt"), _("Mounted Devices") )
- ADD_SECTION(_T("/usr"), _("User") )
- ADD_SECTION(_T("/usr/local"), _("User Local") )
- ADD_SECTION(_T("/var"), _("Variables") )
- ADD_SECTION(_T("/etc"), _("Etcetera") )
- ADD_SECTION(_T("/tmp"), _("Temporary") )
+ ADD_SECTION(T("/mnt"), _("Mounted Devices") )
+ ADD_SECTION(T("/usr"), _("User") )
+ ADD_SECTION(T("/usr/local"), _("User Local") )
+ ADD_SECTION(T("/var"), _("Variables") )
+ ADD_SECTION(T("/etc"), _("Etcetera") )
+ ADD_SECTION(T("/tmp"), _("Temporary") )
#endif
}
#undef ADD_SECTION
wxDirItemData *dir_item;
// wxASSERT(m_paths.Count() == m_names.Count()); ?
-
- for (unsigned int i=0; i<m_paths.Count(); i++)
+
+ for (unsigned int i=0; i<m_paths.Count(); i++)
{
- dir_item = new wxDirItemData(m_paths[i],m_names[i]);
+ dir_item = new wxDirItemData(m_paths[i],m_names[i]);
#ifdef __WXMSW__
- id = AppendItem( parent, m_names[i], -1, -1, dir_item);
+ id = AppendItem( parent, m_names[i], -1, -1, dir_item);
#else
- id = AppendItem( parent, m_names[i], 0, 1, dir_item);
+ id = AppendItem( parent, m_names[i], 0, 1, dir_item);
#endif
if (dir_item->m_hasSubDirs) SetItemHasChildren(id);
}
event.Veto();
return;
}
-
+
// don't rename the individual sections
if (GetParent( event.GetItem() ) == m_rootId)
{
if ((event.GetLabel().IsEmpty()) ||
(event.GetLabel() == _(".")) ||
(event.GetLabel() == _("..")) ||
- (event.GetLabel().First( _T("/") ) != wxNOT_FOUND))
+ (event.GetLabel().First( T("/") ) != wxNOT_FOUND))
{
wxMessageDialog dialog(this, _("Illegal directory name."), _("Error"), wxOK | wxICON_ERROR );
- dialog.ShowModal();
+ dialog.ShowModal();
event.Veto();
- return;
+ return;
}
wxTreeItemId id = event.GetItem();
wxDirItemData *data = (wxDirItemData*)GetItemData( id );
wxASSERT( data );
-
+
wxString new_name( wxPathOnly( data->m_path ) );
- new_name += _T("/");
+ new_name += T("/");
new_name += event.GetLabel();
-
+
wxLogNull log;
-
+
if (wxFileExists(new_name))
{
wxMessageDialog dialog(this, _("File name exists already."), _("Error"), wxOK | wxICON_ERROR );
- dialog.ShowModal();
+ dialog.ShowModal();
event.Veto();
}
-
+
if (wxRenameFile(data->m_path,new_name))
{
data->SetNewDirName( new_name );
else
{
wxMessageDialog dialog(this, _("Operation not permitted."), _("Error"), wxOK | wxICON_ERROR );
- dialog.ShowModal();
+ dialog.ShowModal();
event.Veto();
}
}
m_paths.Clear();
m_names.Clear();
search = data->m_path + "/*";
- for (path = wxFindFirstFile( search, wxDIR ); !path.IsNull();
- path=wxFindNextFile() )
+ for (path = wxFindFirstFile( search, wxDIR ); !path.IsNull();
+ path=wxFindNextFile() )
{
filename = wxFileNameFromPath( path );
/* Don't add "." and ".." to the tree. I think wxFindNextFile
* also checks this, but I don't quite understand what happens
* there. Also wxFindNextFile seems to swallow hidden dirs */
- if ((filename != ".") && (filename != ".."))
+ if ((filename != ".") && (filename != ".."))
{
m_paths.Add(path);
m_names.Add(filename);
}
}
-
+
CreateItems( event.GetItem() );
SortChildren( event.GetItem() );
-
+
wxEndBusyCursor();
}
/* Workaround because DeleteChildren has disapeared (why?) and
* CollapseAndReset doesn't work as advertised (deletes parent too) */
child = GetFirstChild(parent, cookie);
- while (child.IsOk())
+ while (child.IsOk())
{
Delete(child);
- /* Not GetNextChild below, because the cookie mechanism can't
+ /* Not GetNextChild below, because the cookie mechanism can't
* handle disappearing children! */
child = GetFirstChild(parent, cookie);
}
END_EVENT_TABLE()
wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message,
- const wxString& defaultPath, long style,
- const wxPoint& pos) :
+ const wxString& defaultPath, long style,
+ const wxPoint& pos) :
wxDialog(parent, -1, message, pos, wxSize(300,300),
- wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
+ wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
m_message = message;
m_dialogStyle = style;
m_parent = parent;
-
+
m_path = defaultPath;
-
+
wxBeginBusyCursor();
-
+
wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL );
// 1) dir ctrl
- m_dir = new wxDirCtrl( this, ID_DIRCTRL, "/", wxDefaultPosition, wxSize(200,200),
- wxTR_HAS_BUTTONS | wxSUNKEN_BORDER | wxTR_EDIT_LABELS);
+ m_dir = new wxDirCtrl( this, ID_DIRCTRL, "/", wxDefaultPosition, wxSize(200,200),
+ wxTR_HAS_BUTTONS | wxSUNKEN_BORDER | wxTR_EDIT_LABELS);
topsizer->Add( m_dir, 1, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );
-
+
// 2) text ctrl
- m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition );
+ m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition );
topsizer->Add( m_input, 0, wxTOP|wxLEFT|wxRIGHT | wxEXPAND, 10 );
-
+
// m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden") );
// m_check->SetValue(TRUE);
-
+
#if wxUSE_STATLINE
// 3) static line
topsizer->Add( new wxStaticLine( this, -1 ), 0, wxEXPAND | wxLEFT|wxRIGHT|wxTOP, 10 );
buttonsizer->Add( m_cancel, 0, wxLEFT|wxRIGHT, 10 );
m_new = new wxButton( this, ID_NEW, _("New...") );
buttonsizer->Add( m_new, 0, wxLEFT|wxRIGHT, 10 );
-
+
topsizer->Add( buttonsizer, 0, wxALL | wxCENTER, 10 );
m_ok->SetDefault();
m_dir->SetFocus();
-
+
SetAutoLayout( TRUE );
SetSizer( topsizer );
-
+
topsizer->SetSizeHints( this );
topsizer->Fit( this );
void wxDirDialog::OnTreeSelected( wxTreeEvent &event )
{
wxDirItemData *data = (wxDirItemData*)m_dir->GetItemData(event.GetItem());
- if (data)
+ if (data)
m_input->SetValue( data->m_path );
};
void wxDirDialog::OnTreeKeyDown( wxTreeEvent &WXUNUSED(event) )
{
wxDirItemData *data = (wxDirItemData*)m_dir->GetItemData(m_dir->GetSelection());
- if (data)
+ if (data)
m_input->SetValue( data->m_path );
};
else {
// Trouble...
msg = _("Failed to create directory ")+m_path+
- _("\n(Do you have the required permissions?)");
+ _("\n(Do you have the required permissions?)");
wxMessageDialog errmsg(this, msg, _("Error creating directory"), wxOK | wxICON_ERROR);
errmsg.ShowModal();
// We still don't have a valid dir. Back to the main dialog.
if ((id == m_dir->GetRootItem()) ||
(m_dir->GetParent(id) == m_dir->GetRootItem()))
{
- wxMessageDialog msg(this, _("You cannot add a new directory to this section."),
- _("Create directory"), wxOK | wxICON_INFORMATION );
+ wxMessageDialog msg(this, _("You cannot add a new directory to this section."),
+ _("Create directory"), wxOK | wxICON_INFORMATION );
msg.ShowModal();
return;
}
wxTreeItemId parent = m_dir->GetParent( id );
wxDirItemData *data = (wxDirItemData*)m_dir->GetItemData( parent );
wxASSERT( data );
-
- wxString new_name( _T("NewName") );
+
+ wxString new_name( T("NewName") );
wxString path( data->m_path );
- path += _T( "/" );
+ path += T("/");
path += new_name;
if (wxFileExists(path))
{
// try NewName0, NewName1 etc.
int i = 0;
- do {
- new_name = _T("NewName");
- wxString num;
- num.Printf( "%d", i );
- new_name += num;
-
+ do {
+ new_name = T("NewName");
+ wxString num;
+ num.Printf( "%d", i );
+ new_name += num;
+
path = data->m_path;
- path += _T( "/" );
+ path += T("/");
path += new_name;
- i++;
- } while (wxFileExists(path));
+ i++;
+ } while (wxFileExists(path));
}
-
+
wxLogNull log;
- if (!wxMkdir(path))
+ if (!wxMkdir(path))
{
wxMessageDialog dialog(this, _("Operation not permitted."), _("Error"), wxOK | wxICON_ERROR );
- dialog.ShowModal();
+ dialog.ShowModal();
return;
}
{
wxFileData *fd1 = (wxFileData*)data1 ;
wxFileData *fd2 = (wxFileData*)data2 ;
- if (fd1->GetName() == _T("..")) return -1;
- if (fd2->GetName() == _T("..")) return 1;
+ if (fd1->GetName() == T("..")) return -1;
+ if (fd2->GetName() == T("..")) return 1;
if (fd1->IsDir() && !fd2->IsDir()) return -1;
if (fd2->IsDir() && !fd1->IsDir()) return 1;
return strcmp( fd1->GetName(), fd2->GetName() );
s += _(" bytes ");
}
s += IntToString( m_day );
- s += _T(".");
+ s += T(".");
s += IntToString( m_month );
- s += _T(".");
+ s += T(".");
s += IntToString( m_year );
- s += _T(" ");
+ s += T(" ");
s += IntToString( m_hour );
- s += _T(":");
+ s += T(":");
s += IntToString( m_minute );
- s += _T(" ");
+ s += T(" ");
s += m_permissions;
return s;
};
else s = LongToString( m_size );
break;
case 2:
- if (m_day < 10) s = _T("0"); else s = _T("");
+ if (m_day < 10) s = T("0"); else s = T("");
s += IntToString( m_day );
- s += _T(".");
- if (m_month < 10) s += _T("0");
+ s += T(".");
+ if (m_month < 10) s += T("0");
s += IntToString( m_month );
- s += _T(".");
- if (m_year < 10) s += _T("0"); // this should happen real soon...
+ s += T(".");
+ if (m_year < 10) s += T("0"); // this should happen real soon...
s += IntToString( m_year );
break;
case 3:
- if (m_hour < 10) s = _T("0"); else s = _T("");
+ if (m_hour < 10) s = T("0"); else s = T("");
s += IntToString( m_hour );
- s += _T(":");
- if (m_minute < 10) s += _T("0");
+ s += T(":");
+ if (m_minute < 10) s += T("0");
s += IntToString( m_minute );
break;
case 4:
s = m_permissions;
break;
default:
- s = _T("No entry");
+ s = T("No entry");
break;
}
return s;
wxFileCtrl::wxFileCtrl()
{
- m_dirName = _T("/");
+ m_dirName = T("/");
m_showHidden = FALSE;
}
item.m_itemId = 0;
item.m_col = 0;
- if (m_dirName != _T("/"))
+ if (m_dirName != T("/"))
{
wxString p( wxPathOnly(m_dirName) );
- if (p.IsEmpty()) p = _T("/");
- fd = new wxFileData( _T(".."), p );
+ if (p.IsEmpty()) p = T("/");
+ fd = new wxFileData( T(".."), p );
Add( fd, item );
item.m_itemId++;
}
- wxString res = m_dirName + _T("/*");
+ wxString res = m_dirName + T("/*");
wxString f( wxFindFirstFile( res.GetData(), wxDIR ) );
while (!f.IsEmpty())
{
res = wxFileNameFromPath( f );
fd = new wxFileData( res, f );
wxString s = fd->GetName();
- if (m_showHidden || (s[0] != _T('.')))
+ if (m_showHidden || (s[0] != T('.')))
{
Add( fd, item );
item.m_itemId++;
f = wxFindNextFile();
}
- res = m_dirName + _T("/") + m_wild;
+ res = m_dirName + T("/") + m_wild;
f = wxFindFirstFile( res.GetData(), wxFILE );
while (!f.IsEmpty())
{
res = wxFileNameFromPath( f );
fd = new wxFileData( res, f );
wxString s = fd->GetName();
- if (m_showHidden || (s[0] != _T('.')))
+ if (m_showHidden || (s[0] != T('.')))
{
Add( fd, item );
item.m_itemId++;
void wxFileCtrl::MakeDir()
{
- wxString new_name( _T("NewName") );
+ wxString new_name( T("NewName") );
wxString path( m_dirName );
- path += _T( "/" );
+ path += T("/");
path += new_name;
if (wxFileExists(path))
{
do {
new_name = _("NewName");
wxString num;
- num.Printf( _T("%d"), i );
+ num.Printf( T("%d"), i );
new_name += num;
path = m_dirName;
- path += _T("/");
+ path += T("/");
path += new_name;
i++;
} while (wxFileExists(path));
void wxFileCtrl::GoToParentDir()
{
- if (m_dirName != _T("/"))
+ if (m_dirName != T("/"))
{
wxString fname( wxFileNameFromPath(m_dirName) );
m_dirName = wxPathOnly( m_dirName );
- if (m_dirName.IsEmpty()) m_dirName = _T("/");
+ if (m_dirName.IsEmpty()) m_dirName = T("/");
Update();
int id = FindItem( 0, fname );
if (id != -1)
if ((event.GetLabel().IsEmpty()) ||
(event.GetLabel() == _(".")) ||
(event.GetLabel() == _("..")) ||
- (event.GetLabel().First( _T("/") ) != wxNOT_FOUND))
+ (event.GetLabel().First( T("/") ) != wxNOT_FOUND))
{
wxMessageDialog dialog(this, _("Illegal directory name."), _("Error"), wxOK | wxICON_ERROR );
dialog.ShowModal();
}
wxString new_name( wxPathOnly( fd->GetFullName() ) );
- new_name += _T("/");
+ new_name += T("/");
new_name += event.GetLabel();
wxLogNull log;
m_dir = getcwd( buf, sizeof(buf) );
}
m_path = defaultDir;
- m_path += _T("/");
+ m_path += T("/");
m_path += defaultFile;
m_fileName = defaultFile;
m_wildCard = wildCard;
if (m_wildCard.IsEmpty())
m_wildCard = _("All files (*)|*");
- wxStringTokenizer tokens( m_wildCard, _T("|") );
+ wxStringTokenizer tokens( m_wildCard, T("|") );
wxString firstWild;
wxString firstWildText;
if (tokens.CountTokens() == 1)
}
else
{
- wxASSERT_MSG( tokens.CountTokens() % 2 == 0, _T("Wrong file type descripition") );
+ wxASSERT_MSG( tokens.CountTokens() % 2 == 0, T("Wrong file type descripition") );
firstWildText = tokens.GetNextToken();
firstWild = tokens.GetNextToken();
}
if (FindFocus() != m_list) return;
wxString filename( event.m_item.m_text );
- if (filename == _T("..")) return;
+ if (filename == T("..")) return;
wxString dir;
m_list->GetDir( dir );
- if (dir != _T("/")) dir += _T("/");
+ if (dir != T("/")) dir += T("/");
dir += filename;
if (wxDirExists(dir)) return;
wxString dir;
m_list->GetDir( dir );
if (filename.IsEmpty()) return;
- if (filename == _T(".")) return;
+ if (filename == T(".")) return;
- if (filename == _T(".."))
+ if (filename == T(".."))
{
m_list->GoToParentDir();
m_list->SetFocus();
return;
}
- if (filename == _T("~"))
+ if (filename == T("~"))
{
m_list->GoToHomeDir();
m_list->SetFocus();
return;
}
- if (filename[0] == _T('~'))
+ if (filename[0] == T('~'))
{
filename.Remove( 0, 1 );
wxString tmp( wxGetUserHome() );
- tmp += _T('/');
+ tmp += T('/');
tmp += filename;
filename = tmp;
}
- if ((filename.Find(_T('*')) != wxNOT_FOUND) ||
- (filename.Find(_T('?')) != wxNOT_FOUND))
+ if ((filename.Find(T('*')) != wxNOT_FOUND) ||
+ (filename.Find(T('?')) != wxNOT_FOUND))
{
- if (filename.Find(_T('/')) != wxNOT_FOUND)
+ if (filename.Find(T('/')) != wxNOT_FOUND)
{
wxMessageBox(_("Illegal file specification."), _("Error"), wxOK | wxICON_ERROR );
return;
return;
}
- if (dir != _T("/")) dir += _T("/");
- if (filename[0] != _T('/'))
+ if (dir != T("/")) dir += T("/");
+ if (filename[0] != T('/'))
{
dir += filename;
filename = dir;
wxSplitPath(path, &m_dir, &m_fileName, &ext);
if (!ext.IsEmpty())
{
- m_fileName += _T(".");
+ m_fileName += T(".");
m_fileName += ext;
}
}
int x, int y)
{
// TODO: implement this somehow
- return wxFileSelector(message, default_path, default_filename, _T(""),
+ return wxFileSelector(message, default_path, default_filename, T(""),
wildcard, flags, parent, x, y);
}
{
wxString filter2;
if ( defaultExtension && !filter )
- filter2 = wxString(_T("*.")) + wxString(defaultExtension) ;
+ filter2 = wxString(T("*.")) + wxString(defaultExtension) ;
else if ( filter )
filter2 = filter;
wxString str = _("Load %s file");
wxSprintf(prompt, str, what);
- if (*ext == _T('.')) ext++;
+ if (*ext == T('.')) ext++;
wxChar wild[60];
- wxSprintf(wild, _T("*.%s"), ext);
+ wxSprintf(wild, T("*.%s"), ext);
return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
wxString str = _("Save %s file");
wxSprintf(prompt, str, what);
- if (*ext == _T('.')) ext++;
+ if (*ext == T('.')) ext++;
wxChar wild[60];
- wxSprintf(wild, _T("*.%s"), ext);
+ wxSprintf(wild, T("*.%s"), ext);
return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
#endif
#define NUM_COLS 48
-static wxString wxColourDialogNames[NUM_COLS]={_T("ORANGE"),
- _T("GOLDENROD"),
- _T("WHEAT"),
- _T("SPRING GREEN"),
- _T("SKY BLUE"),
- _T("SLATE BLUE"),
- _T("MEDIUM VIOLET RED"),
- _T("PURPLE"),
-
- _T("RED"),
- _T("YELLOW"),
- _T("MEDIUM SPRING GREEN"),
- _T("PALE GREEN"),
- _T("CYAN"),
- _T("LIGHT STEEL BLUE"),
- _T("ORCHID"),
- _T("LIGHT MAGENTA"),
-
- _T("BROWN"),
- _T("YELLOW"),
- _T("GREEN"),
- _T("CADET BLUE"),
- _T("MEDIUM BLUE"),
- _T("MAGENTA"),
- _T("MAROON"),
- _T("ORANGE RED"),
-
- _T("FIREBRICK"),
- _T("CORAL"),
- _T("FOREST GREEN"),
- _T("AQUARAMINE"),
- _T("BLUE"),
- _T("NAVY"),
- _T("THISTLE"),
- _T("MEDIUM VIOLET RED"),
-
- _T("INDIAN RED"),
- _T("GOLD"),
- _T("MEDIUM SEA GREEN"),
- _T("MEDIUM BLUE"),
- _T("MIDNIGHT BLUE"),
- _T("GREY"),
- _T("PURPLE"),
- _T("KHAKI"),
-
- _T("BLACK"),
- _T("MEDIUM FOREST GREEN"),
- _T("KHAKI"),
- _T("DARK GREY"),
- _T("SEA GREEN"),
- _T("LIGHT GREY"),
- _T("MEDIUM SLATE BLUE"),
- _T("WHITE")
+static wxString wxColourDialogNames[NUM_COLS]={T("ORANGE"),
+ T("GOLDENROD"),
+ T("WHEAT("),
+ T("SPRING GREEN"),
+ T("SKY BLUE"),
+ T("SLATE BLUE"),
+ T("MEDIUM VIOLET RED"),
+ T("PURPLE"),
+
+ T("RED"),
+ T("YELLOW"),
+ T("MEDIUM SPRING GREEN"),
+ T("PALE GREEN"),
+ T("CYAN"),
+ T("LIGHT STEEL BLUE"),
+ T("ORCHID"),
+ T("LIGHT MAGENTA"),
+
+ T("BROWN"),
+ T("YELLOW"),
+ T("GREEN"),
+ T("CADET BLUE"),
+ T("MEDIUM BLUE"),
+ T("MAGENTA"),
+ T("MAROON"),
+ T("ORANGE RED"),
+
+ T("FIREBRICK"),
+ T("CORAL"),
+ T("FOREST GREEN"),
+ T("AQUARAMINE"),
+ T("BLUE"),
+ T("NAVY"),
+ T("THISTLE"),
+ T("MEDIUM VIOLET RED"),
+
+ T("INDIAN RED"),
+ T("GOLD"),
+ T("MEDIUM SEA GREEN"),
+ T("MEDIUM BLUE"),
+ T("MIDNIGHT BLUE"),
+ T("GREY"),
+ T("PURPLE"),
+ T("KHAKI"),
+
+ T("BLACK"),
+ T("MEDIUM FOREST GREEN"),
+ T("KHAKI"),
+ T("DARK GREY"),
+ T("SEA GREEN"),
+ T("LIGHT GREY"),
+ T("MEDIUM SLATE BLUE"),
+ T("WHITE")
};
/*
int fontUnderline = underLineCheckBox->GetValue();
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
- if (colourChoice->GetStringSelection() != _T(""))
+ if (colourChoice->GetStringSelection() != T(""))
{
wxColour *col = (wxColour*) NULL;
col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
switch (weight)
{
case wxLIGHT:
- return _T("Light");
+ return T("Light");
case wxBOLD:
- return _T("Bold");
+ return T("Bold");
case wxNORMAL:
default:
- return _T("Normal");
+ return T("Normal");
}
- return _T("Normal");
+ return T("Normal");
}
wxChar *wxFontStyleIntToString(int style)
switch (style)
{
case wxITALIC:
- return _T("Italic");
+ return T("Italic");
case wxSLANT:
- return _T("Slant");
+ return T("Slant");
case wxNORMAL:
default:
- return _T("Normal");
+ return T("Normal");
}
- return _T("Normal");
+ return T("Normal");
}
wxChar *wxFontFamilyIntToString(int family)
switch (family)
{
case wxROMAN:
- return _T("Roman");
+ return T("Roman");
case wxDECORATIVE:
- return _T("Decorative");
+ return T("Decorative");
case wxMODERN:
- return _T("Modern");
+ return T("Modern");
case wxSCRIPT:
- return _T("Script");
+ return T("Script");
case wxTELETYPE:
- return _T("Teletype");
+ return T("Teletype");
case wxSWISS:
default:
- return _T("Swiss");
+ return T("Swiss");
}
- return _T("Swiss");
+ return T("Swiss");
}
int wxFontFamilyStringToInt(wxChar *family)
if (!family)
return wxSWISS;
- if (wxStrcmp(family, _T("Roman")) == 0)
+ if (wxStrcmp(family, T("Roman")) == 0)
return wxROMAN;
- else if (wxStrcmp(family, _T("Decorative")) == 0)
+ else if (wxStrcmp(family, T("Decorative")) == 0)
return wxDECORATIVE;
- else if (wxStrcmp(family, _T("Modern")) == 0)
+ else if (wxStrcmp(family, T("Modern")) == 0)
return wxMODERN;
- else if (wxStrcmp(family, _T("Script")) == 0)
+ else if (wxStrcmp(family, T("Script")) == 0)
return wxSCRIPT;
- else if (wxStrcmp(family, _T("Teletype")) == 0)
+ else if (wxStrcmp(family, T("Teletype")) == 0)
return wxTELETYPE;
else return wxSWISS;
}
{
if (!style)
return wxNORMAL;
- if (wxStrcmp(style, _T("Italic")) == 0)
+ if (wxStrcmp(style, T("Italic")) == 0)
return wxITALIC;
- else if (wxStrcmp(style, _T("Slant")) == 0)
+ else if (wxStrcmp(style, T("Slant")) == 0)
return wxSLANT;
else
return wxNORMAL;
{
if (!weight)
return wxNORMAL;
- if (wxStrcmp(weight, _T("Bold")) == 0)
+ if (wxStrcmp(weight, T("Bold")) == 0)
return wxBOLD;
- else if (wxStrcmp(weight, _T("Light")) == 0)
+ else if (wxStrcmp(weight, T("Light")) == 0)
return wxLIGHT;
else
return wxNORMAL;
{
wxString lockfile;
wxGetHomeDir(&lockfile);
- lockfile << WXEXTHELP_SEPARATOR << _T(".netscape/lock");
+ lockfile << WXEXTHELP_SEPARATOR << T(".netscape/lock");
struct stat statbuf;
if(lstat(lockfile.fn_str(), &statbuf) == 0)
// cannot use wxFileExists, because it's a link pointing to a
// non-existing location if(wxFileExists(lockfile))
{
long success;
- command << m_BrowserName << _T(" -remote openURL(")
- << _T("file://") << m_MapFile
- << WXEXTHELP_SEPARATOR << relativeURL << _T(")");
+ command << m_BrowserName << T(" -remote openURL(")
+ << T("file://") << m_MapFile
+ << WXEXTHELP_SEPARATOR << relativeURL << T(")");
success = wxExecute(command);
if(success != 0 ) // returns PID on success
return TRUE;
}
}
command = m_BrowserName;
- command << _T(" file://")
+ command << T(" file://")
<< m_MapFile << WXEXTHELP_SEPARATOR << relativeURL;
return wxExecute(command) != 0;
#endif
{
newfile = WXEXTHELP_SEPARATOR;
const wxChar *cptr = wxGetLocale()->GetName().c_str();
- while(*cptr && *cptr != _T('_'))
+ while(*cptr && *cptr != T('_'))
newfile << *(cptr++);
if(wxDirExists(newfile))
file = newfile;
bool rc = FALSE;
wxString file;
file << m_MapFile << WXEXTHELP_SEPARATOR << contents;
- if(file.Contains(_T('#')))
- file = file.BeforeLast(_T('#'));
+ if(file.Contains(T('#')))
+ file = file.BeforeLast(T('#'));
if(contents.Length() && wxFileExists(file))
rc = DisplaySection(CONTENTS_ID);
// if not found, open homemade toc:
- return rc ? TRUE : KeywordSearch(_T(""));
+ return rc ? TRUE : KeywordSearch(T(""));
}
bool
{
wxNode *node = m_images.Nth( index );
- wxCHECK_MSG( node, (wxBitmap *) NULL, _T("wrong index in image list") );
+ wxCHECK_MSG( node, (wxBitmap *) NULL, T("wrong index in image list") );
return (wxBitmap*)node->Data();
}
{
wxNode *node = m_images.Nth( index );
- wxCHECK_MSG( node, FALSE, _T("wrong index in image list") );
+ wxCHECK_MSG( node, FALSE, T("wrong index in image list") );
wxBitmap* newBitmap = NULL;
if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
{
wxNode *node = m_images.Nth( index );
- wxCHECK_MSG( node, FALSE, _T("wrong index in image list") );
+ wxCHECK_MSG( node, FALSE, T("wrong index in image list") );
m_images.DeleteNode( node );
wxNode *node = m_images.Nth( index );
- wxCHECK_MSG( node, FALSE, _T("wrong index in image list") );
+ wxCHECK_MSG( node, FALSE, T("wrong index in image list") );
wxBitmap *bm = (wxBitmap*)node->Data();
width = bm->GetWidth();
{
wxNode *node = m_images.Nth( index );
- wxCHECK_MSG( node, FALSE, _T("wrong index in image list") );
+ wxCHECK_MSG( node, FALSE, T("wrong index in image list") );
wxBitmap *bm = (wxBitmap*)node->Data();
wxListItemData *item = (wxListItemData*)node->Data();
wxString s;
item->GetText( s );
- if (s.IsEmpty()) s = _T("H");
+ if (s.IsEmpty()) s = T("H");
long lw,lh;
dc->GetTextExtent( s, &lw, &lh );
m_bound_label.width = lw;
void wxListMainWindow::EditLabel( long item )
{
wxNode *node = m_lines.Nth( item );
- wxCHECK_RET( node, _T("wrong index in wxListCtrl::Edit()") );
+ wxCHECK_RET( node, T("wrong index in wxListCtrl::Edit()") );
m_currentEdit = (wxListLineData*) node->Data();
void wxListMainWindow::OnRenameTimer()
{
- wxCHECK_RET( m_current, _T("invalid m_current") );
+ wxCHECK_RET( m_current, T("invalid m_current") );
Edit( m_lines.IndexOf( m_current ) );
}
void wxListMainWindow::DeleteColumn( int col )
{
wxCHECK_RET( col < (int)m_columns.GetCount(),
- _T("attempting to delete inexistent column in wxListView") );
+ T("attempting to delete inexistent column in wxListView") );
m_dirty = TRUE;
wxNode *node = m_columns.Nth( col );
#pragma hdrstop
#endif
-#ifdef wxUSE_NOGUI
- #error "This file can't be compiled in NOGUI mode!"
+#if !wxUSE_GUI
+ #error "This file can't be compiled without GUI!"
#endif
#ifndef WX_PRECOMP
{
wxString msg;
TimeStamp(&msg);
- msg << szString << _T('\n');
+ msg << szString << T('\n');
m_pTextCtrl->AppendText(msg);
}
if ( nLines > 25 ) // don't put too many lines in message box
break;
- str << m_aMessages[n - 1] << _T("\n");
+ str << m_aMessages[n - 1] << T("\n");
}
const wxChar *title;
// debug window anyhow, but do put a timestamp
wxString str;
TimeStamp(&str);
- str << szString << _T("\n\r");
+ str << szString << T("\n\r");
OutputDebugString(str);
#else
// send them to stderr
- wxFprintf(stderr, _T("%s: %s\n"),
- level == wxLOG_Trace ? _T("Trace")
- : _T("Debug"),
+ wxFprintf(stderr, T("%s: %s\n"),
+ level == wxLOG_Trace ? T("Trace")
+ : T("Debug"),
szString);
fflush(stderr);
#endif
{
// get the file name
// -----------------
- const wxChar *szFileName = wxSaveFileSelector(_T("log"), _T("txt"), _T("log.txt"));
+ const wxChar *szFileName = wxSaveFileSelector(T("log"), T("txt"), T("log.txt"));
if ( szFileName == NULL ) {
// cancelled
return;
wxString msg;
TimeStamp(&msg);
- msg << szString << _T('\n');
+ msg << szString << T('\n');
pText->AppendText(msg);
inputsizer->Add( new wxStaticText( this, -1, prompt ), 0, wxCENTER | wxLEFT, 10 );
// spin ctrl
wxString valStr;
- valStr.Printf(_T("%lu"), m_value);
+ valStr.Printf(T("%lu"), m_value);
m_spinctrl = new wxTextCtrl(this, -1, valStr, wxDefaultPosition, wxSize( 140, -1 ) );
inputsizer->Add( m_spinctrl, 1, wxCENTER | wxLEFT | wxRIGHT, 10 );
// add both
void wxNumberEntryDialog::OnOK(wxCommandEvent& WXUNUSED(event))
{
- if ( (wxSscanf(m_spinctrl->GetValue(), _T("%lu"), &m_value) != 1) ||
+ if ( (wxSscanf(m_spinctrl->GetValue(), T("%lu"), &m_value) != 1) ||
(m_value < m_min) || (m_value > m_max) )
{
// not a number or out of range
wxString f = wxFileSelector(_("PostScript file"),
wxPathOnly(wxThePrintSetupData->GetPrinterFile()),
wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()),
- _T("ps"), _T("*.ps"), 0, this);
+ T("ps"), T("*.ps"), 0, this);
if ( f.IsEmpty() )
return;
{
nTimeLabels++;
- m_elapsed = CreateLabel(_T("Elapsed time : "), &lastWindow);
+ m_elapsed = CreateLabel(T("Elapsed time : "), &lastWindow);
}
if ( style & wxPD_ESTIMATED_TIME )
{
nTimeLabels++;
- m_estimated = CreateLabel(_T("Estimated time : "), &lastWindow);
+ m_estimated = CreateLabel(T("Estimated time : "), &lastWindow);
}
if ( style & wxPD_REMAINING_TIME )
{
nTimeLabels++;
- m_remaining = CreateLabel(_T("Remaining time : "), &lastWindow);
+ m_remaining = CreateLabel(T("Remaining time : "), &lastWindow);
}
if ( nTimeLabels > 0 )
{
wxLayoutConstraints *c;
- wxStaticText *label = new wxStaticText(this, -1, _T("unknown"));
+ wxStaticText *label = new wxStaticText(this, -1, T("unknown"));
c = new wxLayoutConstraints;
// VZ: I like the labels be centered - if the others don't mind, you may
bool
wxProgressDialog::Update(int value, const wxString& newmsg)
{
- wxASSERT_MSG( value == -1 || m_gauge, _T("cannot update non existent dialog") );
- wxASSERT_MSG( value <= m_maximum, _T("invalid progress value") );
+ wxASSERT_MSG( value == -1 || m_gauge, T("cannot update non existent dialog") );
+ wxASSERT_MSG( value <= m_maximum, T("invalid progress value") );
if( m_gauge )
unsigned long hours = val / 3600;
unsigned long minutes = (val % 3600) / 60;
unsigned long seconds = val % 60;
- s.Printf(_T("%lu:%02lu:%02lu"), hours, minutes, seconds);
+ s.Printf(T("%lu:%02lu:%02lu"), hours, minutes, seconds);
if ( s != label->GetLabel() )
label->SetLabel(s);
return new wxPropertyValue(m_value.stringPtr);
case wxPropertyValueNull:
- wxFAIL_MSG( _T("Should never get here!\n" ) );
+ wxFAIL_MSG( T("Should never get here!\n" ) );
break;
}
return NULL;
return;
}
case wxPropertyValueNull:
- wxFAIL_MSG( _T("Should never get here!\n" ) );
+ wxFAIL_MSG( T("Should never get here!\n" ) );
break;
}
}
if (node)
{
node->WritePropertyType(stream);
- stream.Append( _T("(") );
+ stream.Append( T("(") );
node = node->m_next;
bool first = TRUE;
while (node)
{
if (!first)
- stream.Append( _T(" ") );
+ stream.Append( T(" ") );
node->WritePropertyType(stream);
node = node->m_next;
if (node)
- stream.Append( _T(",\n" ) );
+ stream.Append( T(",\n" ) );
first = FALSE;
}
- stream.Append( _T(").\n\n") );
+ stream.Append( T(").\n\n") );
}
}
{
case wxPropertyValueInteger:
{
- tmp.Printf( _T("%ld"), m_value.integer );
+ tmp.Printf( T("%ld"), m_value.integer );
stream.Append( tmp );
break;
}
case wxPropertyValueIntegerPtr:
{
- tmp.Printf( _T("%ld"), *m_value.integerPtr );
+ tmp.Printf( T("%ld"), *m_value.integerPtr );
stream.Append( tmp );
break;
}
case wxPropertyValuebool:
{
if (m_value.integer)
- stream.Append( _T("True") );
+ stream.Append( T("True") );
else
- stream.Append( _T("False") );
+ stream.Append( T("False") );
break;
}
case wxPropertyValueboolPtr:
{
if (*m_value.integerPtr)
- stream.Append( _T("True") );
+ stream.Append( T("True") );
else
- stream.Append( _T("False") );
+ stream.Append( T("False") );
break;
}
case wxPropertyValueReal:
{
double d = m_value.real;
- tmp.Printf( _T("%.6g"), d );
+ tmp.Printf( T("%.6g"), d );
stream.Append( tmp );
break;
}
case wxPropertyValueRealPtr:
{
double d = *m_value.realPtr;
- tmp.Printf( _T("%.6g"), d );
+ tmp.Printf( T("%.6g"), d );
stream.Append( tmp );
break;
}
}
case wxPropertyValueStringPtr:
{
- wxFAIL_MSG( _T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") );
+ wxFAIL_MSG( T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") );
/*
int i;
int len = strlen(*(m_value.stringPtr));
case wxPropertyValueList:
{
if (!m_value.first)
- stream.Append( _T("[]") );
+ stream.Append( T("[]") );
else
{
wxPropertyValue *expr = m_value.first;
- stream.Append( _T("[") );
+ stream.Append( T("[") );
while (expr)
{
expr->WritePropertyType(stream);
expr = expr->m_next;
if (expr)
- stream.Append( _T(", ") );
+ stream.Append( T(", ") );
}
- stream.Append( _T("]") );
+ stream.Append( T("]") );
}
break;
}
wxChar *wxPropertyValidator::FloatToString (float number) {
static wxChar buf[20];
- wxSprintf (buf, _T("%.6g"), number);
+ wxSprintf (buf, T("%.6g"), number);
return buf;
}
wxChar *wxPropertyValidator::DoubleToString (double number) {
static wxChar buf[20];
- wxSprintf (buf, _T("%.6g"), number);
+ wxSprintf (buf, T("%.6g"), number);
return buf;
}
while (node)
{
wxWindow *win = (wxWindow *)node->Data();
- if (win->GetName() != _T(""))
+ if (win->GetName() != T(""))
{
wxProperty *prop = m_propertySheet->GetProperty(win->GetName());
if (prop)
if (!m_propertySheet)
return;
- if (win.GetName() == _T(""))
+ if (win.GetName() == T(""))
return;
- if (wxStrcmp(win.GetName(), _T("ok")) == 0)
+ if (wxStrcmp(win.GetName(), T("ok")) == 0)
OnOk(event);
- else if (wxStrcmp(win.GetName(), _T("cancel")) == 0)
+ else if (wxStrcmp(win.GetName(), T("cancel")) == 0)
OnCancel(event);
- else if (wxStrcmp(win.GetName(), _T("help")) == 0)
+ else if (wxStrcmp(win.GetName(), T("help")) == 0)
OnHelp(event);
- else if (wxStrcmp(win.GetName(), _T("update")) == 0)
+ else if (wxStrcmp(win.GetName(), T("update")) == 0)
OnUpdate(event);
- else if (wxStrcmp(win.GetName(), _T("revert")) == 0)
+ else if (wxStrcmp(win.GetName(), T("revert")) == 0)
OnRevert(event);
else
{
if (!StringToFloat(WXSTRINGCAST value, &val))
{
wxChar buf[200];
- wxSprintf(buf, _T("Value %s is not a valid real number!"), (const wxChar *)value);
- wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxSprintf(buf, T("Value %s is not a valid real number!"), (const wxChar *)value);
+ wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
if (val < m_realMin || val > m_realMax)
{
wxChar buf[200];
- wxSprintf(buf, _T("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax);
- wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxSprintf(buf, T("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax);
+ wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
return TRUE;
if (!StringToLong(WXSTRINGCAST value, &val))
{
wxChar buf[200];
- wxSprintf(buf, _T("Value %s is not a valid integer!"), (const wxChar *)value);
- wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxSprintf(buf, T("Value %s is not a valid integer!"), (const wxChar *)value);
+ wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
}
bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow))
{
wxString s(view->GetValueList()->GetStringSelection());
- if (s != _T(""))
+ if (s != T(""))
{
view->GetValueText()->SetValue(s);
view->RetrieveProperty(property);
if (!StringToFloat(WXSTRINGCAST value, &val))
{
wxChar buf[200];
- wxSprintf(buf, _T("Value %s is not a valid real number!"), value.GetData());
- wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxSprintf(buf, T("Value %s is not a valid real number!"), value.GetData());
+ wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
if (!StringToLong(WXSTRINGCAST value, &val))
{
wxChar buf[200];
- wxSprintf(buf, _T("Value %s is not a valid integer!"), value.GetData());
- wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxSprintf(buf, T("Value %s is not a valid integer!"), value.GetData());
+ wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
if (val < m_integerMin || val > m_integerMax)
{
wxChar buf[200];
- wxSprintf(buf, _T("Value must be an integer between %ld and %ld!"), m_integerMin, m_integerMax);
- wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxSprintf(buf, T("Value must be an integer between %ld and %ld!"), m_integerMin, m_integerMax);
+ wxMessageBox(buf, T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
return TRUE;
if (!view->GetValueText())
return FALSE;
wxString value(view->GetValueText()->GetValue());
- if (value != _T("True") && value != _T("False"))
+ if (value != T("True") && value != T("False"))
{
- wxMessageBox(_T("Value must be True or False!"), _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxMessageBox(T("Value must be True or False!"), T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
return TRUE;
wxString value(view->GetValueText()->GetValue());
bool boolValue = FALSE;
- if (value == _T("True"))
+ if (value == T("True"))
boolValue = TRUE;
else
boolValue = FALSE;
view->ShowListBoxControl(TRUE);
view->GetValueList()->Enable(TRUE);
- view->GetValueList()->Append(_T("True"));
- view->GetValueList()->Append(_T("False"));
+ view->GetValueList()->Append(T("True"));
+ view->GetValueList()->Append(T("False"));
wxChar *currentString = copystring(view->GetValueText()->GetValue());
view->GetValueList()->SetStringSelection(currentString);
delete[] currentString;
m_filenameWildCard.GetData(),
0,
parentWindow);
- if (s != _T(""))
+ if (s != T(""))
{
property->GetValue() = s;
view->DisplayProperty(property);
expr = expr->GetNext();
}
- wxString title(_T("Editing "));
+ wxString title(T("Editing "));
title += property->GetName();
if (EditStringList(parentWindow, stringList, title.GetData()))
{
SaveCurrentSelection();
- wxChar *initialText = _T("");
+ wxChar *initialText = T("");
wxNode *node = m_stringList->Add(initialText);
m_listBox->Append(initialText, (void *)node);
m_currentSelection = m_stringList->Number() - 1;
if ( dialog )
iconized = dialog->IsIconized();
else
- wxFAIL_MSG(_T("should have a top level frame or dialog parent!"));
+ wxFAIL_MSG(T("should have a top level frame or dialog parent!"));
}
if ( iconized )
}
else
{
- wxFAIL_MSG(_T("splitter: attempt to remove a non-existent window"));
+ wxFAIL_MSG(T("splitter: attempt to remove a non-existent window"));
return FALSE;
}
// Replace a window with another one
bool wxSplitterWindow::ReplaceWindow(wxWindow *winOld, wxWindow *winNew)
{
- wxCHECK_MSG( winOld, FALSE, _T("use one of Split() functions instead") );
- wxCHECK_MSG( winNew, FALSE, _T("use Unsplit() functions instead") );
+ wxCHECK_MSG( winOld, FALSE, T("use one of Split() functions instead") );
+ wxCHECK_MSG( winNew, FALSE, T("use Unsplit() functions instead") );
if ( winOld == m_windowTwo )
{
}
else
{
- wxFAIL_MSG(_T("splitter: attempt to replace a non-existent window"));
+ wxFAIL_MSG(T("splitter: attempt to replace a non-existent window"));
return FALSE;
}
wxSize sizeReal = AdjustSize(size);
- m_statbox = new wxStaticBox(parent, id, _T(""), pos, sizeReal, style, name);
+ m_statbox = new wxStaticBox(parent, id, T(""), pos, sizeReal, style, name);
return TRUE;
}
//
// text->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE));
- m_text = new wxTextCtrl(this, -1, _T(""),
+ m_text = new wxTextCtrl(this, -1, T(""),
wxDefaultPosition, wxSize(200, 160),
wxTE_MULTILINE | wxTE_READONLY | wxSUNKEN_BORDER);
m_text->SetFont(wxFont(14, wxROMAN, wxNORMAL, wxNORMAL));
delete m_data;
wxASSERT_MSG( m_children.IsEmpty(),
- _T("please call DeleteChildren() before deleting the item") );
+ T("please call DeleteChildren() before deleting the item") );
}
void wxGenericTreeItem::DeleteChildren(wxTreeCtrl *tree)
size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively)
{
- wxCHECK_MSG( item.IsOk(), 0u, _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), 0u, T("invalid tree item") );
return item.m_pItem->GetChildrenCount(recursively);
}
wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), _T(""), _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), T(""), T("invalid tree item") );
return item.m_pItem->GetText();
}
int wxTreeCtrl::GetItemImage(const wxTreeItemId& item,
wxTreeItemIcon which) const
{
- wxCHECK_MSG( item.IsOk(), -1, _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), -1, T("invalid tree item") );
return item.m_pItem->GetImage(which);
}
wxTreeItemData *wxTreeCtrl::GetItemData(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), NULL, _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), NULL, T("invalid tree item") );
return item.m_pItem->GetData();
}
void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text)
{
- wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+ wxCHECK_RET( item.IsOk(), T("invalid tree item") );
wxClientDC dc(this);
wxGenericTreeItem *pItem = item.m_pItem;
int image,
wxTreeItemIcon which)
{
- wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+ wxCHECK_RET( item.IsOk(), T("invalid tree item") );
wxGenericTreeItem *pItem = item.m_pItem;
pItem->SetImage(image, which);
void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data)
{
- wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+ wxCHECK_RET( item.IsOk(), T("invalid tree item") );
item.m_pItem->SetData(data);
}
void wxTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has)
{
- wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+ wxCHECK_RET( item.IsOk(), T("invalid tree item") );
wxGenericTreeItem *pItem = item.m_pItem;
pItem->SetHasPlus(has);
void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold)
{
- wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
+ wxCHECK_RET( item.IsOk(), T("invalid tree item") );
// avoid redrawing the tree if no real change
wxGenericTreeItem *pItem = item.m_pItem;
bool wxTreeCtrl::IsVisible(const wxTreeItemId& WXUNUSED(item)) const
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return TRUE;
}
bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), FALSE, T("invalid tree item") );
return !item.m_pItem->GetChildren().IsEmpty();
}
bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), FALSE, T("invalid tree item") );
return item.m_pItem->IsExpanded();
}
bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), FALSE, T("invalid tree item") );
return item.m_pItem->IsSelected();
}
bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), FALSE, T("invalid tree item") );
return item.m_pItem->IsBold();
}
wxTreeItemId wxTreeCtrl::GetParent(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") );
return item.m_pItem->GetParent();
}
wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item, long& cookie) const
{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") );
cookie = 0;
return GetNextChild(item, cookie);
wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& item, long& cookie) const
{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") );
wxArrayGenericTreeItems& children = item.m_pItem->GetChildren();
if ( (size_t)cookie < children.Count() )
wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") );
wxArrayGenericTreeItems& children = item.m_pItem->GetChildren();
return (children.IsEmpty() ? wxTreeItemId() : wxTreeItemId(children.Last()));
wxTreeItemId wxTreeCtrl::GetNextSibling(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") );
wxGenericTreeItem *i = item.m_pItem;
wxGenericTreeItem *parent = i->GetParent();
wxTreeItemId wxTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") );
wxGenericTreeItem *i = item.m_pItem;
wxGenericTreeItem *parent = i->GetParent();
wxTreeItemId wxTreeCtrl::GetFirstVisibleItem() const
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return wxTreeItemId();
}
wxTreeItemId wxTreeCtrl::GetNextVisible(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") );
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return wxTreeItemId();
}
wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const
{
- wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
+ wxCHECK_MSG( item.IsOk(), wxTreeItemId(), T("invalid tree item") );
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return wxTreeItemId();
}
int image, int selImage,
wxTreeItemData *data)
{
- wxCHECK_MSG( !m_anchor, wxTreeItemId(), _T("tree can have only one root") );
+ wxCHECK_MSG( !m_anchor, wxTreeItemId(), T("tree can have only one root") );
wxClientDC dc(this);
m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text, dc,
int index = parent->GetChildren().Index(idPrevious.m_pItem);
wxASSERT_MSG( index != wxNOT_FOUND,
- _T("previous item in wxTreeCtrl::InsertItem() is not a sibling") );
+ T("previous item in wxTreeCtrl::InsertItem() is not a sibling") );
return DoInsertItem(parentId, (size_t)++index, text, image, selImage, data);
}
bool unselect_others,
bool extended_select)
{
- wxCHECK_RET( itemId.IsOk(), _T("invalid tree item") );
+ wxCHECK_RET( itemId.IsOk(), T("invalid tree item") );
bool is_single=!(GetWindowStyleFlag() & wxTR_MULTIPLE);
wxGenericTreeItem *item = itemId.m_pItem;
//wxCHECK_RET( ( (!unselect_others) && is_single),
- // _T("this is a single selection tree") );
+ // T("this is a single selection tree") );
// to keep going anyhow !!!
if (is_single)
static int tree_ctrl_compare_func(wxGenericTreeItem **item1,
wxGenericTreeItem **item2)
{
- wxCHECK_MSG( s_treeBeingSorted, 0, _T("bug in wxTreeCtrl::SortChildren()") );
+ wxCHECK_MSG( s_treeBeingSorted, 0, T("bug in wxTreeCtrl::SortChildren()") );
return s_treeBeingSorted->OnCompareItems(*item1, *item2);
}
void wxTreeCtrl::SortChildren(const wxTreeItemId& itemId)
{
- wxCHECK_RET( itemId.IsOk(), _T("invalid tree item") );
+ wxCHECK_RET( itemId.IsOk(), T("invalid tree item") );
wxGenericTreeItem *item = itemId.m_pItem;
wxCHECK_RET( !s_treeBeingSorted,
- _T("wxTreeCtrl::SortChildren is not reentrant") );
+ T("wxTreeCtrl::SortChildren is not reentrant") );
wxArrayGenericTreeItems& children = item->GetChildren();
if ( children.Count() > 1 )
}
else
{
- wxFAIL_MSG(_T("wxDC::GetFont() failed!"));
+ wxFAIL_MSG(T("wxDC::GetFont() failed!"));
}
}
}
else
{
- wxFAIL_MSG(_T("wxDC::GetFont() failed!"));
+ wxFAIL_MSG(T("wxDC::GetFont() failed!"));
}
}
bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
{
- wxASSERT_MSG( page != m_page, _T("this is useless") );
+ wxASSERT_MSG( page != m_page, T("this is useless") );
// we'll use this to decide whether we have to change the label of this
// button or not (initially the label is "Next")
bool wxWizard::RunWizard(wxWizardPage *firstPage)
{
- wxCHECK_MSG( firstPage, FALSE, _T("can't run empty wizard") );
+ wxCHECK_MSG( firstPage, FALSE, T("can't run empty wizard") );
// can't return FALSE here because there is no old page
(void)ShowPage(firstPage, TRUE /* forward */);
{
wxASSERT_MSG( (event.GetEventObject() == m_btnNext) ||
(event.GetEventObject() == m_btnPrev),
- _T("unknown button") );
+ T("unknown button") );
bool forward = event.GetEventObject() == m_btnNext;
{
page = m_page->GetPrev();
- wxASSERT_MSG( page, _T("\"<Back\" button should have been disabled") );
+ wxASSERT_MSG( page, T("\"<Back\" button should have been disabled") );
}
// just pass to the new page (or may be not - but we don't care here)
// Author: Robert Roebling
// Id: $id:$
// Copyright: (c) 1998 Robert Roebling
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
class wxAccelRefData: public wxObjectRefData
{
public:
-
- wxAccelRefData(void);
-
+ wxAccelRefData();
+
wxList m_accels;
};
-wxAccelRefData::wxAccelRefData(void)
+wxAccelRefData::wxAccelRefData()
{
m_accels.DeleteContents( TRUE );
}
#define M_ACCELDATA ((wxAccelRefData *)m_refData)
IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable,wxObject)
-
+
wxAcceleratorTable::wxAcceleratorTable()
{
}
wxAcceleratorTable::wxAcceleratorTable( int n, wxAcceleratorEntry entries[] )
{
m_refData = new wxAccelRefData();
-
+
for (int i = 0; i < n; i++)
{
int flag = entries[i].GetFlags();
(((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) &&
(((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) &&
(((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown()))
- {
+ {
return entry->GetCommand();
- }
+ }
node = node->Next();
}
-
+
return -1;
}
bool wxYield()
{
bool has_idle = (wxTheApp->m_idleTag != 0);
-
+
if (has_idle)
{
/* We need to temporarily remove idle callbacks or the loop will
might have been changed (it also will update other things set from
OnUpdateUI() which is a nice (and desired) side effect) */
while (wxTheApp->ProcessIdle()) { }
-
+
if (has_idle)
{
/* re-add idle handler */
wxTheApp->m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL );
}
-
+
return TRUE;
}
gint wxapp_idle_callback( gpointer WXUNUSED(data) )
{
if (!wxTheApp) return TRUE;
-
+
#if (GTK_MINOR_VERSION > 0)
/* when getting called from GDK's idle handler we
are no longer within GDK's grab on the GUI
void wxapp_install_idle_handler()
{
- wxASSERT_MSG( wxTheApp->m_idleTag == 0, _T("attempt to install idle handler twice") );
+ wxASSERT_MSG( wxTheApp->m_idleTag == 0, T("attempt to install idle handler twice") );
/* this routine gets called by all event handlers
indicating that the idle is over. */
void wxapp_install_thread_wakeup()
{
if (wxTheApp->m_wakeUpTimerTag) return;
-
+
wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 100, wxapp_wakeup_timerout_callback, (gpointer) NULL );
}
void wxapp_uninstall_thread_wakeup()
{
if (!wxTheApp->m_wakeUpTimerTag) return;
-
+
gtk_timeout_remove( wxTheApp->m_wakeUpTimerTag );
wxTheApp->m_wakeUpTimerTag = 0;
}
index |= (g >> (5 - vis->green_prec)) << vis->green_shift;
index |= (b >> (5 - vis->blue_prec)) << vis->blue_shift;
#else
- wxFAIL_MSG( _T("Unsupported graphics hardware") );
+ wxFAIL_MSG( T("Unsupported graphics hardware") );
#endif
}
m_colorCube[ (r*1024) + (g*32) + b ] = index;
win->ProcessEvent(event);
win->OnInternalIdle();
-
+
if (event.MoreRequested())
needMore = TRUE;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
if (wxDebugContext::CountObjectsLeft() > 0)
{
- wxLogDebug(_T("There were memory leaks.\n"));
+ wxLogDebug(T("There were memory leaks.\n"));
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
if (!wxTheApp)
{
wxCHECK_MSG( wxApp::GetInitializerFunction(), -1,
- _T("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
+ T("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxTheApp = (wxApp*) test_app;
}
- wxCHECK_MSG( wxTheApp, -1, _T("wxWindows error: no application object") );
+ wxCHECK_MSG( wxTheApp, -1, T("wxWindows error: no application object") );
wxTheApp->argc = argc;
#if wxUSE_UNICODE
return wxIcon(warning_xpm);
default:
- wxFAIL_MSG(_T("requested non existent standard icon"));
+ wxFAIL_MSG(T("requested non existent standard icon"));
// still fall through
case wxICON_HAND:
m_bitmap = (GdkBitmap*) NULL;
}
- wxFAIL_MSG( _T("TODO") );
+ wxFAIL_MSG( T("TODO") );
return FALSE;
}
m_bitmap = (GdkBitmap*) NULL;
}
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( T("not implemented") );
return FALSE;
}
if (!bitmap.Ok()) return FALSE;
- wxCHECK_MSG( bitmap.GetBitmap(), FALSE, _T("Cannot create mask from colour bitmap") );
+ wxCHECK_MSG( bitmap.GetBitmap(), FALSE, T("Cannot create mask from colour bitmap") );
m_bitmap = gdk_pixmap_new( (GdkWindow*) &gdk_root_parent, bitmap.GetWidth(), bitmap.GetHeight(), 1 );
wxBitmap::wxBitmap( int width, int height, int depth )
{
- wxCHECK_RET( (width > 0) && (height > 0), _T("invalid bitmap size") )
+ wxCHECK_RET( (width > 0) && (height > 0), T("invalid bitmap size") )
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
if (depth == -1) depth = gdk_window_get_visual( parent )->depth;
wxCHECK_RET( (depth == gdk_window_get_visual( parent )->depth) ||
- (depth == 1), _T("invalid bitmap depth") )
+ (depth == 1), T("invalid bitmap depth") )
m_refData = new wxBitmapRefData();
M_BMPDATA->m_mask = (wxMask *) NULL;
wxBitmap::wxBitmap( const char **bits )
{
- wxCHECK_RET( bits != NULL, _T("invalid bitmap data") )
+ wxCHECK_RET( bits != NULL, T("invalid bitmap data") )
m_refData = new wxBitmapRefData();
wxBitmap::wxBitmap( char **bits )
{
- wxCHECK_RET( bits != NULL, _T("invalid bitmap data") )
+ wxCHECK_RET( bits != NULL, T("invalid bitmap data") )
m_refData = new wxBitmapRefData();
M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits );
- wxCHECK_RET( M_BMPDATA->m_pixmap, _T("couldn't create pixmap") );
+ wxCHECK_RET( M_BMPDATA->m_pixmap, T("couldn't create pixmap") );
if (mask)
{
M_BMPDATA->m_height = height;
M_BMPDATA->m_bpp = 1;
- wxCHECK_RET( M_BMPDATA->m_bitmap, _T("couldn't create bitmap") );
+ wxCHECK_RET( M_BMPDATA->m_bitmap, T("couldn't create bitmap") );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
int wxBitmap::GetHeight() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), -1, T("invalid bitmap") );
return M_BMPDATA->m_height;
}
int wxBitmap::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), -1, T("invalid bitmap") );
return M_BMPDATA->m_width;
}
int wxBitmap::GetDepth() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), -1, T("invalid bitmap") );
return M_BMPDATA->m_bpp;
}
wxMask *wxBitmap::GetMask() const
{
- wxCHECK_MSG( Ok(), (wxMask *) NULL, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), (wxMask *) NULL, T("invalid bitmap") );
return M_BMPDATA->m_mask;
}
void wxBitmap::SetMask( wxMask *mask )
{
- wxCHECK_RET( Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( Ok(), T("invalid bitmap") );
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(palette) )
{
- wxCHECK_MSG( Ok(), FALSE, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), FALSE, T("invalid bitmap") );
if (type == wxBITMAP_TYPE_PNG)
{
GdkPixmap *wxBitmap::GetPixmap() const
{
- wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, T("invalid bitmap") );
return M_BMPDATA->m_pixmap;
}
GdkBitmap *wxBitmap::GetBitmap() const
{
- wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, T("invalid bitmap") );
return M_BMPDATA->m_bitmap;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxBitmapButton creation failed") );
+ wxFAIL_MSG( T("wxBitmapButton creation failed") );
return FALSE;
}
void wxBitmapButton::SetLabel( const wxString &label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
wxControl::SetLabel( label );
}
wxString wxBitmapButton::GetLabel() const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid button") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid button") );
return wxControl::GetLabel();
}
void wxBitmapButton::SetBitmap()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
wxBitmap the_one;
void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
if ( ! m_disabled.Ok() ) return;
m_disabled = bitmap;
void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
if ( ! m_focus.Ok() ) return;
m_focus = bitmap;
void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
if (!m_bitmap.Ok()) return;
m_bitmap = bitmap;
void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
if ( ! m_selected.Ok() ) return;
m_selected = bitmap;
{
if (m_refData == NULL)
{
- wxFAIL_MSG( _T("invalid brush") );
+ wxFAIL_MSG( T("invalid brush") );
return 0;
}
{
if (m_refData == NULL)
{
- wxFAIL_MSG( _T("invalid brush") );
+ wxFAIL_MSG( T("invalid brush") );
return wxNullColour;
}
{
if (m_refData == NULL)
{
- wxFAIL_MSG( _T("invalid brush") );
+ wxFAIL_MSG( T("invalid brush") );
return &wxNullBitmap;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxButton creation failed") );
+ wxFAIL_MSG( T("wxButton creation failed") );
return FALSE;
}
void wxButton::SetLabel( const wxString &label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
wxControl::SetLabel( label );
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxCheckBox creation failed") );
+ wxFAIL_MSG( T("wxCheckBox creation failed") );
return FALSE;
}
void wxCheckBox::SetValue( bool state )
{
- wxCHECK_RET( m_widgetCheckbox != NULL, _T("invalid checkbox") );
+ wxCHECK_RET( m_widgetCheckbox != NULL, T("invalid checkbox") );
if (state == GetValue())
return;
bool wxCheckBox::GetValue() const
{
- wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, _T("invalid checkbox") );
+ wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, T("invalid checkbox") );
return GTK_TOGGLE_BUTTON(m_widgetCheckbox)->active;
}
void wxCheckBox::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widgetLabel != NULL, _T("invalid checkbox") );
+ wxCHECK_RET( m_widgetLabel != NULL, T("invalid checkbox") );
wxControl::SetLabel( label );
bool wxCheckListBox::IsChecked( int index ) const
{
- wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid checklistbox") );
+ wxCHECK_MSG( m_list != NULL, FALSE, T("invalid checklistbox") );
GList *child = g_list_nth( m_list->children, index );
if (child)
wxString str = wxString(label->label,*wxConvCurrent);
- return (str[1] == _T('X'));
+ return (str[1] == T('X'));
}
- wxFAIL_MSG(_T("wrong checklistbox index"));
+ wxFAIL_MSG(T("wrong checklistbox index"));
return FALSE;
}
void wxCheckListBox::Check( int index, bool check )
{
- wxCHECK_RET( m_list != NULL, _T("invalid checklistbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid checklistbox") );
GList *child = g_list_nth( m_list->children, index );
if (child)
wxString str = wxString(label->label,*wxConvCurrent);
- if (check == (str[1] == _T('X'))) return;
+ if (check == (str[1] == T('X'))) return;
if (check)
- str.SetChar( 1, _T('X') );
+ str.SetChar( 1, T('X') );
else
- str.SetChar( 1, _T('-') );
+ str.SetChar( 1, T('-') );
gtk_label_set( label, str.mbc_str() );
return;
}
- wxFAIL_MSG(_T("wrong checklistbox index"));
+ wxFAIL_MSG(T("wrong checklistbox index"));
}
int wxCheckListBox::GetItemHeight() const
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxChoice creation failed") );
+ wxFAIL_MSG( T("wxChoice creation failed") );
return FALSE;
}
void wxChoice::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
+ wxCHECK_RET( m_widget != NULL, T("invalid choice") );
GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu_item = gtk_menu_item_new_with_label( item.mbc_str() );
void wxChoice::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxChoice::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxChoice::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxChoice::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxChoice::Clear()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
+ wxCHECK_RET( m_widget != NULL, T("invalid choice") );
gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new();
void wxChoice::Delete( int WXUNUSED(n) )
{
- wxFAIL_MSG( _T("wxChoice:Delete not implemented") );
+ wxFAIL_MSG( T("wxChoice:Delete not implemented") );
}
int wxChoice::FindString( const wxString &string ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid choice") );
// If you read this code once and you think you understand
// it, then you are very wrong. Robert Roebling.
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
+ wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") );
if (string == wxString(label->label,*wxConvCurrent))
return count;
int wxChoice::GetSelection()
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
wxString wxChoice::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
+ wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") );
return wxString(label->label,*wxConvCurrent);
}
count++;
}
- wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") );
+ wxFAIL_MSG( T("wxChoice: invalid index in GetString()") );
- return _T("");
+ return T("");
}
wxString wxChoice::GetStringSelection() const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid choice") );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
+ wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") );
return wxString(label->label,*wxConvCurrent);
}
int wxChoice::Number() const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
void wxChoice::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
+ wxCHECK_RET( m_widget != NULL, T("invalid choice") );
int tmp = n;
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
void wxChoice::SetStringSelection( const wxString &string )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
+ wxCHECK_RET( m_widget != NULL, T("invalid choice") );
int n = FindString( string );
if (n != -1) SetSelection( n );
bool wxClipboard::Open()
{
- wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") );
+ wxCHECK_MSG( !m_open, FALSE, T("clipboard already open") );
m_open = TRUE;
bool wxClipboard::SetData( wxDataObject *data )
{
- wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( m_open, FALSE, T("clipboard not open") );
- wxCHECK_MSG( data, FALSE, _T("data is invalid") );
+ wxCHECK_MSG( data, FALSE, T("data is invalid") );
Clear();
bool wxClipboard::AddData( wxDataObject *data )
{
- wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( m_open, FALSE, T("clipboard not open") );
- wxCHECK_MSG( data, FALSE, _T("data is invalid") );
+ wxCHECK_MSG( data, FALSE, T("data is invalid") );
/* if clipboard has been cleared before, create new data broker */
if (!m_dataBroker) m_dataBroker = new wxDataBroker();
/* get native format id of new data object */
GdkAtom format = data->GetFormat().GetAtom();
- wxCHECK_MSG( format, FALSE, _T("data has invalid format") );
+ wxCHECK_MSG( format, FALSE, T("data has invalid format") );
/* This should happen automatically, but to be on the safe side */
m_ownsClipboard = FALSE;
void wxClipboard::Close()
{
- wxCHECK_RET( m_open, _T("clipboard not open") );
+ wxCHECK_RET( m_open, T("clipboard not open") );
m_open = FALSE;
}
bool wxClipboard::IsSupported( wxDataFormat format )
{
- wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( m_open, FALSE, T("clipboard not open") );
/* store requested format to be asked for by callbacks */
m_targetRequested = format.GetAtom();
- wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
+ wxCHECK_MSG( m_targetRequested, FALSE, T("invalid clipboard format") );
m_formatSupported = FALSE;
bool wxClipboard::GetData( wxDataObject *data )
{
- wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( m_open, FALSE, T("clipboard not open") );
/* is data supported by clipboard ? */
m_targetRequested = data->GetFormat().GetAtom();
- wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
+ wxCHECK_MSG( m_targetRequested, FALSE, T("invalid clipboard format") );
/* start query */
/* this is a true error as we checked for the presence of such data before */
- wxCHECK_MSG( m_formatSupported, FALSE, _T("error retrieving data from clipboard") );
+ wxCHECK_MSG( m_formatSupported, FALSE, T("error retrieving data from clipboard") );
return TRUE;
}
m_refData = new wxColourRefData();
if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color ))
{
- wxFAIL_MSG( _T("wxColour: couldn't find colour") );
- wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName );
+ wxFAIL_MSG( T("wxColour: couldn't find colour") );
+ wxPrintf( T("Colourname %s.\n"), WXSTRINGCAST colourName );
delete m_refData;
m_refData = (wxObjectRefData *) NULL;
unsigned char wxColour::Red() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), 0, T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
}
unsigned char wxColour::Green() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), 0, T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
}
unsigned char wxColour::Blue() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), 0, T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
}
int wxColour::GetPixel() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), 0, T("invalid colour") );
return M_COLDATA->m_color.pixel;
}
GdkColor *wxColour::GetColor() const
{
- wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), (GdkColor *) NULL, T("invalid colour") );
return &M_COLDATA->m_color;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxComboBox creation failed") );
+ wxFAIL_MSG( T("wxComboBox creation failed") );
return FALSE;
}
void wxComboBox::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
void wxComboBox::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxComboBox::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxComboBox::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxComboBox::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxComboBox::Clear()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() );
void wxComboBox::Delete( int n )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkList *listbox = GTK_LIST( GTK_COMBO(m_widget)->list );
if (!child)
{
- wxFAIL_MSG(_T("wrong index"));
+ wxFAIL_MSG(T("wrong index"));
return;
}
int wxComboBox::FindString( const wxString &item )
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
int wxComboBox::GetSelection() const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
wxString wxComboBox::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
}
else
{
- wxFAIL_MSG( _T("wxComboBox: wrong index") );
+ wxFAIL_MSG( T("wxComboBox: wrong index") );
}
return str;
wxString wxComboBox::GetStringSelection() const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
return tmp;
}
- wxFAIL_MSG( _T("wxComboBox: no selection") );
+ wxFAIL_MSG( T("wxComboBox: no selection") );
- return _T("");
+ return T("");
}
int wxComboBox::Number() const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
void wxComboBox::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
DisableEvents();
void wxComboBox::SetStringSelection( const wxString &string )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
int res = FindString( string );
if (res == -1) return;
void wxComboBox::SetValue( const wxString& value )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
- wxString tmp = _T("");
+ wxString tmp = T("");
if (!value.IsNull()) tmp = value;
gtk_entry_set_text( GTK_ENTRY(entry), tmp.mbc_str() );
}
void wxComboBox::Copy()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::Cut()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::Paste()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::SetInsertionPoint( long pos )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_entry_set_position( GTK_ENTRY(entry), (int)pos );
void wxComboBox::SetInsertionPointEnd()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
SetInsertionPoint( -1 );
}
void wxComboBox::Replace( long from, long to, const wxString& value )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
// FIXME: not quite sure how to do this method right in multibyte mode
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
void wxComboBox::Remove(long from, long to)
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
void wxControl::SetLabel( const wxString &label )
{
m_label.Empty();
- for ( const wxChar *pc = label; *pc != _T('\0'); pc++ )
+ for ( const wxChar *pc = label; *pc != T('\0'); pc++ )
{
- if ( *pc == _T('&') )
+ if ( *pc == T('&') )
{
pc++; // skip it
#if 0 // it would be unused anyhow for now - kbd interface not done yet
- if ( *pc != _T('&') ) m_chAccel = *pc;
+ if ( *pc != T('&') ) m_chAccel = *pc;
#endif
}
m_label << *pc;
case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break;
*/
default:
- wxFAIL_MSG(_T("unsupported cursor type"));
+ wxFAIL_MSG(T("unsupported cursor type"));
// will use the standard one
case wxCURSOR_ARROW:
return;
wxASSERT_MSG( !gs_savedCursor.Ok(),
- _T("forgot to call wxEndBusyCursor, will leak memory") );
+ T("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = g_globalCursor;
wxPalette wxNullPalette;
/* Default window names */
-const wxChar *wxButtonNameStr = _T("button");
-const wxChar *wxCanvasNameStr = _T("canvas");
-const wxChar *wxCheckBoxNameStr = _T("check");
-const wxChar *wxChoiceNameStr = _T("choice");
-const wxChar *wxComboBoxNameStr = _T("comboBox");
-const wxChar *wxDialogNameStr = _T("dialog");
-const wxChar *wxFrameNameStr = _T("frame");
-const wxChar *wxGaugeNameStr = _T("gauge");
-const wxChar *wxStaticBoxNameStr = _T("groupBox");
-const wxChar *wxListBoxNameStr = _T("listBox");
-const wxChar *wxStaticTextNameStr = _T("message");
-const wxChar *wxStaticBitmapNameStr = _T("message");
-const wxChar *wxMultiTextNameStr = _T("multitext");
-const wxChar *wxPanelNameStr = _T("panel");
-const wxChar *wxRadioBoxNameStr = _T("radioBox");
-const wxChar *wxRadioButtonNameStr = _T("radioButton");
-const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton");
-const wxChar *wxScrollBarNameStr = _T("scrollBar");
-const wxChar *wxSliderNameStr = _T("slider");
-const wxChar *wxStaticNameStr = _T("static");
-const wxChar *wxTextCtrlWindowNameStr = _T("textWindow");
-const wxChar *wxTextCtrlNameStr = _T("text");
-const wxChar *wxVirtListBoxNameStr = _T("virtListBox");
-const wxChar *wxButtonBarNameStr = _T("buttonbar");
-const wxChar *wxEnhDialogNameStr = _T("Shell");
-const wxChar *wxToolBarNameStr = _T("toolbar");
-const wxChar *wxStatusLineNameStr = _T("status_line");
-const wxChar *wxEmptyString = _T("");
-const wxChar *wxGetTextFromUserPromptStr = _T("Input Text");
-const wxChar *wxMessageBoxCaptionStr = _T("Message");
-const wxChar *wxFileSelectorPromptStr = _T("Select a file");
-const wxChar *wxFileSelectorDefaultWildcardStr = _T("*");
-const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error");
-const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error");
-const wxChar *wxDirDialogNameStr = _T("wxDirCtrl");
-const wxChar *wxDirDialogDefaultFolderStr = _T("/");
+const wxChar *wxButtonNameStr = T("button");
+const wxChar *wxCanvasNameStr = T("canvas");
+const wxChar *wxCheckBoxNameStr = T("check");
+const wxChar *wxChoiceNameStr = T("choice");
+const wxChar *wxComboBoxNameStr = T("comboBox");
+const wxChar *wxDialogNameStr = T("dialog");
+const wxChar *wxFrameNameStr = T("frame");
+const wxChar *wxGaugeNameStr = T("gauge");
+const wxChar *wxStaticBoxNameStr = T("groupBox");
+const wxChar *wxListBoxNameStr = T("listBox");
+const wxChar *wxStaticTextNameStr = T("message");
+const wxChar *wxStaticBitmapNameStr = T("message");
+const wxChar *wxMultiTextNameStr = T("multitext");
+const wxChar *wxPanelNameStr = T("panel");
+const wxChar *wxRadioBoxNameStr = T("radioBox");
+const wxChar *wxRadioButtonNameStr = T("radioButton");
+const wxChar *wxBitmapRadioButtonNameStr = T("radioButton");
+const wxChar *wxScrollBarNameStr = T("scrollBar");
+const wxChar *wxSliderNameStr = T("slider");
+const wxChar *wxStaticNameStr = T("static");
+const wxChar *wxTextCtrlWindowNameStr = T("textWindow");
+const wxChar *wxTextCtrlNameStr = T("text");
+const wxChar *wxVirtListBoxNameStr = T("virtListBox");
+const wxChar *wxButtonBarNameStr = T("buttonbar");
+const wxChar *wxEnhDialogNameStr = T("Shell");
+const wxChar *wxToolBarNameStr = T("toolbar");
+const wxChar *wxStatusLineNameStr = T("status_line");
+const wxChar *wxGetTextFromUserPromptStr = T("Input Text");
+const wxChar *wxMessageBoxCaptionStr = T("Message");
+const wxChar *wxFileSelectorPromptStr = T("Select a file");
+const wxChar *wxFileSelectorDefaultWildcardStr = T("*");
+const wxChar *wxInternalErrorStr = T("wxWindows Internal Error");
+const wxChar *wxFatalErrorStr = T("wxWindows Fatal Error");
+const wxChar *wxDirDialogNameStr = T("wxDirCtrl");
+const wxChar *wxDirDialogDefaultFolderStr = T("/");
/* See wx/utils.h */
-const wxChar *wxFloatToStringStr = _T("%.2f");
-const wxChar *wxDoubleToStringStr = _T("%.2f");
+const wxChar *wxFloatToStringStr = T("%.2f");
+const wxChar *wxDoubleToStringStr = T("%.2f");
/* Dafaults for wxWindow etc. */
const wxSize wxDefaultSize(-1, -1);
m_type = wxDF_PRIVATE;
m_id = gdk_atom_name( m_atom );
- if (m_id == _T("file:ALL"))
+ if (m_id == T("file:ALL"))
{
m_type = wxDF_FILENAME;
}
if (m_type == wxDF_TEXT)
{
- m_id = _T("STRING");
+ m_id = T("STRING");
}
else
if (m_type == wxDF_BITMAP)
{
- m_id = _T("image/png");
+ m_id = T("image/png");
}
else
if (m_type == wxDF_FILENAME)
{
- m_id = _T("file:ALL");
+ m_id = T("file:ALL");
}
else
{
- wxFAIL_MSG( _T("invalid dataformat") );
+ wxFAIL_MSG( T("invalid dataformat") );
}
m_hasAtom = FALSE;
else
if (m_type == wxDF_PRIVATE)
{
- m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE );
+ m_atom = gdk_atom_intern( wxMBSTRINGCAST m_id.mbc_str(), FALSE );
}
else
if (m_type == wxDF_FILENAME)
wxPrivateDataObject::wxPrivateDataObject()
{
- wxString id = _T("application/");
+ wxString id = T("application/");
id += wxTheApp->GetAppName();
m_format.SetId( id );
m_isMemDC = FALSE;
m_font = window->GetFont();
- wxASSERT_MSG( window, _T("DC needs a window") );
+ wxASSERT_MSG( window, T("DC needs a window") );
GtkWidget *widget = window->m_wxwindow;
- wxASSERT_MSG( widget, _T("DC needs a widget") );
+ wxASSERT_MSG( widget, T("DC needs a widget") );
m_window = widget->window;
void wxWindowDC::DoFloodFill( long WXUNUSED(x), long WXUNUSED(y),
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
{
- wxFAIL_MSG( _T("wxWindowDC::DoFloodFill not implemented") );
+ wxFAIL_MSG( T("wxWindowDC::DoFloodFill not implemented") );
}
bool wxWindowDC::DoGetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{
- wxFAIL_MSG( _T("wxWindowDC::DoGetPixel not implemented") );
+ wxFAIL_MSG( T("wxWindowDC::DoGetPixel not implemented") );
return FALSE;
}
void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
void wxWindowDC::DoCrossHair( long x, long y )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
long xc, long yc )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
long xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1);
void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
void wxWindowDC::DoDrawPoint( long x, long y )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if ((m_pen.GetStyle() != wxTRANSPARENT) && m_window)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return;
if (n <= 0) return;
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (n <= 0) return;
void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height, double radius )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long x, long y,
bool useMask )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
- wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") );
/* scale/translate size and position */
of the source dc, but scales correctly on the target dc and
knows about possible mask information in a memory dc. */
- wxCHECK_MSG( Ok(), FALSE, _T("invalid window dc") );
+ wxCHECK_MSG( Ok(), FALSE, T("invalid window dc") );
- wxCHECK_MSG( source, FALSE, _T("invalid source dc") );
+ wxCHECK_MSG( source, FALSE, T("invalid source dc") );
if (!m_window) return FALSE;
void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (!m_window) return;
void wxWindowDC::Clear()
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (!m_window) return;
void wxWindowDC::SetPen( const wxPen &pen )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_pen == pen) return;
void wxWindowDC::SetBrush( const wxBrush &brush )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_brush == brush) return;
/* CMB 21/7/98: Added SetBackground. Sets background brush
* for Clear() and bg colour for shapes filled with cross-hatch brush */
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_backgroundBrush == brush) return;
void wxWindowDC::SetLogicalFunction( int function )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_logicalFunction == function) return;
#endif
default:
{
- wxFAIL_MSG( _T("unsupported logical function") );
+ wxFAIL_MSG( T("unsupported logical function") );
break;
}
}
void wxWindowDC::SetTextForeground( const wxColour &col )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_textForegroundColour == col) return;
void wxWindowDC::SetTextBackground( const wxColour &col )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_textBackgroundColour == col) return;
void wxWindowDC::SetBackgroundMode( int mode )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
m_backgroundMode = mode;
void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
{
- wxFAIL_MSG( _T("wxWindowDC::SetPalette not implemented") );
+ wxFAIL_MSG( T("wxWindowDC::SetPalette not implemented") );
}
void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
wxDC::DoSetClippingRegion( x, y, width, height );
void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (region.Empty())
{
void wxWindowDC::DestroyClippingRegion()
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
wxDC::DestroyClippingRegion();
int wxWindowDC::GetDepth() const
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return -1;
}
void wxWindowDC::DoDrawSpline( wxList *points )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxDialog creation failed") );
+ wxFAIL_MSG( T("wxDialog creation failed") );
return FALSE;
}
void wxDialog::SetTitle( const wxString& title )
{
m_title = title;
- if (m_title.IsNull()) m_title = _T("");
+ if (m_title.IsNull()) m_title = T("");
gtk_window_set_title( GTK_WINDOW(m_widget), m_title.mbc_str() );
}
void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") );
#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
- wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid dialog") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") );
+ wxASSERT_MSG( (m_wxwindow != NULL), T("invalid dialog") );
if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE;
void wxDialog::Centre( int direction )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") );
int x = 0;
int y = 0;
else
if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL;
*/
- wxFAIL_MSG( _T("wxDialog:SetModal obsolete now") );
+ wxFAIL_MSG( T("wxDialog:SetModal obsolete now") );
}
int wxDialog::ShowModal()
{
if (IsModal())
{
- wxFAIL_MSG( _T("wxDialog:ShowModal called twice") );
+ wxFAIL_MSG( T("wxDialog:ShowModal called twice") );
return GetReturnCode();
}
if (!IsModal())
{
- wxFAIL_MSG( _T("wxDialog:EndModal called twice") );
+ wxFAIL_MSG( T("wxDialog:EndModal called twice") );
return;
}
if (!m_dragWidget) return FALSE;
/*
- wxPrintf( _T("format: %s.\n"), format.GetId().c_str() );
- if (format.GetType() == wxDF_PRIVATE) wxPrintf( _T("private data.\n") );
- if (format.GetType() == wxDF_TEXT) wxPrintf( _T("text data.\n") );
+ wxPrintf( T("format: %s.\n"), format.GetId().c_str() );
+ if (format.GetType() == wxDF_PRIVATE) wxPrintf( T("private data.\n") );
+ if (format.GetType() == wxDF_TEXT) wxPrintf( T("text data.\n") );
*/
#if wxUSE_THREADS
void wxDropTarget::UnregisterWidget( GtkWidget *widget )
{
- wxCHECK_RET( widget != NULL, _T("unregister widget is NULL") );
+ wxCHECK_RET( widget != NULL, T("unregister widget is NULL") );
gtk_drag_dest_unset( widget );
void wxDropTarget::RegisterWidget( GtkWidget *widget )
{
- wxCHECK_RET( widget != NULL, _T("register widget is NULL") );
+ wxCHECK_RET( widget != NULL, T("register widget is NULL") );
/* gtk_drag_dest_set() determines what default behaviour we'd like
GTK to supply. we don't want to specify out targets (=formats)
wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{
- wxASSERT_MSG( m_data, _T("wxDragSource: no data") );
+ wxASSERT_MSG( m_data, T("wxDragSource: no data") );
if (!m_data) return (wxDragResult) wxDragNone;
m_needParent = FALSE;
if (!PreCreation( parent, pos, wxDefaultSize ) ||
- !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, _T("filedialog") ))
+ !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, T("filedialog") ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return;
}
m_message = message;
- m_path = _T("");
+ m_path = T("");
m_fileName = defaultFileName;
m_dir = defaultDir;
m_wildCard = wildCard;
gtk_file_selection_hide_fileop_buttons( sel ); // they don't work anyway
m_path.Append(m_dir);
- if( ! m_path.IsEmpty() && m_path.Last()!=_T('/') )
+ if( ! m_path.IsEmpty() && m_path.Last()!=T('/') )
m_path.Append('/');
m_path.Append(m_fileName);
wxSplitPath(path, &m_dir, &m_fileName, &ext);
if (!ext.IsEmpty())
{
- m_fileName += _T(".");
+ m_fileName += T(".");
m_fileName += ext;
}
}
int x, int y)
{
// TODO: implement this somehow
- return wxFileSelector(message, default_path, default_filename, _T(""),
+ return wxFileSelector(message, default_path, default_filename, T(""),
wildcard, flags, parent, x, y);
}
{
wxString filter2;
if ( defaultExtension && !filter )
- filter2 = wxString(_T("*.")) + wxString(defaultExtension) ;
+ filter2 = wxString(T("*.")) + wxString(defaultExtension) ;
else if ( filter )
filter2 = filter;
wxString str = _("Load %s file");
wxSprintf(prompt, str, what);
- if (*ext == _T('.')) ext++;
+ if (*ext == T('.')) ext++;
wxChar wild[60];
- wxSprintf(wild, _T("*.%s"), ext);
+ wxSprintf(wild, T("*.%s"), ext);
return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
wxString str = _("Save %s file");
wxSprintf(prompt, str, what);
- if (*ext == _T('.')) ext++;
+ if (*ext == T('.')) ext++;
wxChar wild[60];
- wxSprintf(wild, _T("*.%s"), ext);
+ wxSprintf(wild, T("*.%s"), ext);
return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
wxString tmp;
wxString fontname( xFontName );
- wxStringTokenizer tn( fontname, _T("-") );
+ wxStringTokenizer tn( fontname, T("-") );
tn.GetNextToken(); // foundry
M_FONTDATA->m_faceName = tn.GetNextToken(); // courier
tmp = tn.GetNextToken().MakeUpper();
- if (tmp == _T("BOLD")) M_FONTDATA->m_weight = wxBOLD;
+ if (tmp == T("BOLD")) M_FONTDATA->m_weight = wxBOLD;
tmp = tn.GetNextToken().MakeUpper();
- if (tmp == _T("I")) M_FONTDATA->m_style = wxITALIC;
- if (tmp == _T("O")) M_FONTDATA->m_style = wxITALIC;
+ if (tmp == T("I")) M_FONTDATA->m_style = wxITALIC;
+ if (tmp == T("O")) M_FONTDATA->m_style = wxITALIC;
tn.GetNextToken(); // set width
tn.GetNextToken(); // ?
tn.GetNextToken(); // y-res
tmp = tn.GetNextToken().MakeUpper();
- if (tmp == _T("M")) M_FONTDATA->m_family = wxMODERN;
- else if (M_FONTDATA->m_faceName == _T("TIMES")) M_FONTDATA->m_family = wxROMAN;
- else if (M_FONTDATA->m_faceName == _T("HELVETICA")) M_FONTDATA->m_family = wxSWISS;
- else if (M_FONTDATA->m_faceName == _T("LUCIDATYPEWRITER")) M_FONTDATA->m_family = wxTELETYPE;
- else if (M_FONTDATA->m_faceName == _T("LUCIDA")) M_FONTDATA->m_family = wxDECORATIVE;
- else if (M_FONTDATA->m_faceName == _T("UTOPIA")) M_FONTDATA->m_family = wxSCRIPT;
+ if (tmp == T("M")) M_FONTDATA->m_family = wxMODERN;
+ else if (M_FONTDATA->m_faceName == T("TIMES")) M_FONTDATA->m_family = wxROMAN;
+ else if (M_FONTDATA->m_faceName == T("HELVETICA")) M_FONTDATA->m_family = wxSWISS;
+ else if (M_FONTDATA->m_faceName == T("LUCIDATYPEWRITER")) M_FONTDATA->m_family = wxTELETYPE;
+ else if (M_FONTDATA->m_faceName == T("LUCIDA")) M_FONTDATA->m_family = wxDECORATIVE;
+ else if (M_FONTDATA->m_faceName == T("UTOPIA")) M_FONTDATA->m_family = wxSCRIPT;
}
bool wxFont::Create( int pointSize,
int wxFont::GetPointSize() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid font") );
+ wxCHECK_MSG( Ok(), 0, T("invalid font") );
return M_FONTDATA->m_pointSize;
}
wxString wxFont::GetFaceName() const
{
- wxCHECK_MSG( Ok(), _T(""), _T("invalid font") );
+ wxCHECK_MSG( Ok(), T(""), T("invalid font") );
return M_FONTDATA->m_faceName;
}
int wxFont::GetFamily() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid font") );
+ wxCHECK_MSG( Ok(), 0, T("invalid font") );
return M_FONTDATA->m_family;
}
int wxFont::GetStyle() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid font") );
+ wxCHECK_MSG( Ok(), 0, T("invalid font") );
return M_FONTDATA->m_style;
}
int wxFont::GetWeight() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid font") );
+ wxCHECK_MSG( Ok(), 0, T("invalid font") );
return M_FONTDATA->m_weight;
}
bool wxFont::GetUnderlined() const
{
- wxCHECK_MSG( Ok(), FALSE, _T("invalid font") );
+ wxCHECK_MSG( Ok(), FALSE, T("invalid font") );
return M_FONTDATA->m_underlined;
}
wxFontEncoding wxFont::GetEncoding() const
{
- wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, _T("invalid font") );
+ wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, T("invalid font") );
return M_FONTDATA->m_encoding;
}
{
if (!Ok())
{
- wxFAIL_MSG( _T("invalid font") );
+ wxFAIL_MSG( T("invalid font") );
return (GdkFont*) NULL;
}
if (!font)
{
- wxLogError(_T("could not load any font"));
+ wxLogError(T("could not load any font"));
}
return font;
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE,
- wxDefaultValidator, _T("fontdialog") ))
+ wxDefaultValidator, T("fontdialog") ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return;
}
#ifndef __WXGTK12__
- wxFAIL_MSG( _T("TODO") );
+ wxFAIL_MSG( T("TODO") );
#else // GTK+ 1.2
wxString m_message( _("Choose font") );
m_widget = gtk_font_selection_dialog_new( m_message.mbc_str() );
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxFrame creation failed") );
+ wxFAIL_MSG( T("wxFrame creation failed") );
return FALSE;
}
gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() );
#ifdef __WXDEBUG__
- debug_focus_in( m_widget, _T("wxFrame::m_widget"), name );
+ debug_focus_in( m_widget, T("wxFrame::m_widget"), name );
#endif
gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
#ifdef __WXDEBUG__
- debug_focus_in( m_mainWidget, _T("wxFrame::m_mainWidget"), name );
+ debug_focus_in( m_mainWidget, T("wxFrame::m_mainWidget"), name );
#endif
/* m_wxwindow only represents the client area without toolbar and menubar */
gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
#ifdef __WXDEBUG__
- debug_focus_in( m_wxwindow, _T("wxFrame::m_wxwindow"), name );
+ debug_focus_in( m_wxwindow, T("wxFrame::m_wxwindow"), name );
#endif
/* we donm't allow the frame to get the focus as otherwise
bool wxFrame::Show( bool show )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
if (show && !m_sizeSet)
{
bool wxFrame::Destroy()
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
/* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
- wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") );
/* avoid recursions */
if (m_resizing) return;
void wxFrame::Centre( int direction )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
int x = 0;
int y = 0;
void wxFrame::DoGetClientSize( int *width, int *height ) const
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
wxWindow::DoGetClientSize( width, height );
if (height)
void wxFrame::DoSetClientSize( int width, int height )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
/* menu bar */
if (m_frameMenuBar)
m_resizing = TRUE;
/* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
- wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") );
m_width = width;
m_height = height;
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
void wxFrame::SetMenuBar( wxMenuBar *menuBar )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
+ wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") );
m_frameMenuBar = menuBar;
#if wxUSE_TOOLBAR
wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& name )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
- wxCHECK_MSG( m_frameToolBar == NULL, FALSE, _T("recreating toolbar in wxFrame") );
+ wxCHECK_MSG( m_frameToolBar == NULL, FALSE, T("recreating toolbar in wxFrame") );
m_insertInClientArea = FALSE;
#if wxUSE_STATUSBAR
wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, const wxString& name )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
- wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, _T("recreating status bar in wxFrame") );
+ wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, T("recreating status bar in wxFrame") );
m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
void wxFrame::SetStatusText(const wxString& text, int number)
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
- wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set text for") );
+ wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set text for") );
m_frameStatusBar->SetStatusText(text, number);
}
void wxFrame::SetStatusWidths(int n, const int widths_field[] )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
- wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set widths for") );
+ wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set widths for") );
m_frameStatusBar->SetStatusWidths(n, widths_field);
}
void wxFrame::SetTitle( const wxString &title )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
m_title = title;
- if (m_title.IsNull()) m_title = _T("");
+ if (m_title.IsNull()) m_title = T("");
gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
}
void wxFrame::SetIcon( const wxIcon &icon )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
m_icon = icon;
if (!icon.Ok()) return;
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxGauge creation failed") );
+ wxFAIL_MSG( T("wxGauge creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxListBox creation failed") );
+ wxFAIL_MSG( T("wxListBox creation failed") );
return FALSE;
}
void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
GList *children = m_list->children;
int length = g_list_length(children);
- wxCHECK_RET( pos <= length, _T("invalid index in wxListBox::InsertItems") );
+ wxCHECK_RET( pos <= length, T("invalid index in wxListBox::InsertItems") );
// VZ: it seems that GTK 1.0.6 doesn't has a function to insert an item
// into a listbox at the given position, this is why we first delete
void wxListBox::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
GtkWidget *list_item;
void wxListBox::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxListBox::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxListBox::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxListBox::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxListBox::Clear()
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
gtk_list_clear_items( m_list, 0, Number() );
void wxListBox::Delete( int n )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
- wxCHECK_RET( child, _T("wrong listbox index") );
+ wxCHECK_RET( child, T("wrong listbox index") );
GList *list = g_list_append( (GList*) NULL, child->data );
gtk_list_remove_items( m_list, list );
void wxListBox::Deselect( int n )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
DisableEvents();
int wxListBox::FindString( const wxString &item ) const
{
- wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelection() const
{
- wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelections( wxArrayInt& aSelections ) const
{
- wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
// get the number of selected items first
GList *child = m_list->children;
wxString wxListBox::GetString( int n ) const
{
- wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
return str;
}
- wxFAIL_MSG(_T("wrong listbox index"));
+ wxFAIL_MSG(T("wrong listbox index"));
- return _T("");
+ return T("");
}
wxString wxListBox::GetStringSelection() const
{
- wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") );
GList *selection = m_list->selection;
if (selection)
return str;
}
- wxFAIL_MSG(_T("no listbox selection available"));
- return _T("");
+ wxFAIL_MSG(T("no listbox selection available"));
+ return T("");
}
int wxListBox::Number()
{
- wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
bool wxListBox::Selected( int n )
{
- wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, FALSE, T("invalid listbox") );
GList *target = g_list_nth( m_list->children, n );
if (target)
child = child->next;
}
}
- wxFAIL_MSG(_T("wrong listbox index"));
+ wxFAIL_MSG(T("wrong listbox index"));
return FALSE;
}
void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
{
- wxFAIL_MSG(_T("wxListBox::Set not implemented"));
+ wxFAIL_MSG(T("wxListBox::Set not implemented"));
}
void wxListBox::SetFirstItem( int WXUNUSED(n) )
{
- wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
+ wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
{
- wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
+ wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetSelection( int n, bool select )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
DisableEvents();
void wxListBox::SetString( int n, const wxString &string )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
}
else
{
- wxFAIL_MSG(_T("wrong listbox index"));
+ wxFAIL_MSG(T("wrong listbox index"));
}
}
void wxListBox::SetStringSelection( const wxString &string, bool select )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
SetSelection( FindString(string), select );
}
#if wxUSE_DRAG_AND_DROP
void wxListBox::SetDropTarget( wxDropTarget *dropTarget )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
#ifndef NEW_GTK_DND_CODE
if (m_dropTarget)
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
{
- wxASSERT_MSG( m_menuBar == NULL, _T("Only one menubar allowed") );
+ wxASSERT_MSG( m_menuBar == NULL, T("Only one menubar allowed") );
m_menuBar = menu_bar;
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
- !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("wxMDIClientWindow") ))
+ !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, T("wxMDIClientWindow") ))
{
- wxFAIL_MSG( _T("wxMDIClientWindow creation failed") );
+ wxFAIL_MSG( T("wxMDIClientWindow creation failed") );
return FALSE;
}
m_invokingWindow = (wxWindow*) NULL;
if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
- !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("menubar") ))
+ !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, T("menubar") ))
{
- wxFAIL_MSG( _T("wxMenuBar creation failed") );
+ wxFAIL_MSG( T("wxMenuBar creation failed") );
return;
}
m_invokingWindow = (wxWindow*) NULL;
if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
- !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("menubar") ))
+ !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, T("menubar") ))
{
- wxFAIL_MSG( _T("wxMenuBar creation failed") );
+ wxFAIL_MSG( T("wxMenuBar creation failed") );
return;
}
/* GTK 1.2 wants to have "_" instead of "&" for accelerators */
wxString str;
- for ( pc = title; *pc != _T('\0'); pc++ )
+ for ( pc = title; *pc != T('\0'); pc++ )
{
- if (*pc == _T('&'))
+ if (*pc == T('&'))
{
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
- str << _T('_');
+ str << T('_');
}
- else if (*pc == _T('/'))
+ else if (*pc == T('/'))
{
- str << _T('\\');
+ str << T('\\');
#endif
}
else
{
#if __WXGTK12__
- if ( *pc == _T('_') )
+ if ( *pc == T('_') )
{
// underscores must be doubled to prevent them from being
// interpreted as accelerator character prefix by GTK
/* local buffer in multibyte form */
wxString buf;
- buf << _T('/') << str.c_str();
+ buf << T('/') << str.c_str();
char *cbuf = new char[buf.Length()+1];
strcpy(cbuf, buf.mbc_str());
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
/* in order to get the pointer to the item we need the item text _without_ underscores */
- wxString tmp = _T("<main>/");
- for ( pc = str; *pc != _T('\0'); pc++ )
+ wxString tmp = T("<main>/");
+ for ( pc = str; *pc != T('\0'); pc++ )
{
// contrary to the common sense, we must throw out _all_ underscores,
// (i.e. "Hello__World" => "HelloWorld" and not "Hello_World" as we
// might naively think). IMHO it's a bug in GTK+ (VZ)
- while (*pc == _T('_'))
+ while (*pc == T('_'))
pc++;
tmp << *pc;
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, _T("wxMenuBar::Check: no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::Check: no such item") );
item->Check(check);
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked: no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsChecked: no such item") );
return item->IsChecked();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, _T("wxMenuBar::Enable: no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::Enable: no such item") );
item->Enable(enable);
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled: no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsEnabled: no such item") );
return item->IsEnabled();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetLabel: no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenuBar::GetLabel: no such item") );
return item->GetText();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, _T("wxMenuBar::SetLabel: no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::SetLabel: no such item") );
item->SetText( label );
}
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_RET( node, _T("menu not found") );
+ wxCHECK_RET( node, T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_MSG( node, _T("invalid"), _T("menu not found") );
+ wxCHECK_MSG( node, T("invalid"), T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_RET( node, _T("menu not found") );
+ wxCHECK_RET( node, T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, _T("wxMenuBar::SetHelpString: no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::SetHelpString: no such item") );
item->SetHelp( helpString );
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetHelpString: no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenuBar::GetHelpString: no such item") );
return item->GetHelp();
}
return;
wxMenuItem* item = menu->FindItem( id );
- wxCHECK_RET( item, _T("error in menu item callback") );
+ wxCHECK_RET( item, T("error in menu item callback") );
if (item->IsCheckable())
{
void wxMenuItem::SetName( const wxString& str )
{
/* '\t' is the deliminator indicating a hot key */
- m_text = _T("");
+ m_text = T("");
const wxChar *pc = str;
- for (; (*pc != _T('\0')) && (*pc != _T('\t')); pc++ )
+ for (; (*pc != T('\0')) && (*pc != T('\t')); pc++ )
{
- if (*pc == _T('&'))
+ if (*pc == T('&'))
{
#if (GTK_MINOR_VERSION > 0)
- m_text << _T('_');
+ m_text << T('_');
}
- else if ( *pc == _T('_') ) // escape underscores
+ else if ( *pc == T('_') ) // escape underscores
{
- m_text << _T("__");
+ m_text << T("__");
}
- else if (*pc == _T('/')) /* we have to filter out slashes ... */
+ else if (*pc == T('/')) /* we have to filter out slashes ... */
{
- m_text << _T('\\'); /* ... and replace them with back slashes */
+ m_text << T('\\'); /* ... and replace them with back slashes */
#endif
}
else
}
/* only GTK 1.2 knows about hot keys */
- m_hotKey = _T("");
+ m_hotKey = T("");
#if (GTK_MINOR_VERSION > 0)
- if(*pc == _T('\t'))
+ if(*pc == T('\t'))
{
pc++;
m_hotKey = pc;
void wxMenuItem::Check( bool check )
{
- wxCHECK_RET( m_menuItem, _T("invalid menu item") );
+ wxCHECK_RET( m_menuItem, T("invalid menu item") );
- wxCHECK_RET( IsCheckable(), _T("Can't check uncheckable item!") )
+ wxCHECK_RET( IsCheckable(), T("Can't check uncheckable item!") )
if (check == m_isChecked) return;
void wxMenuItem::Enable( bool enable )
{
- wxCHECK_RET( m_menuItem, _T("invalid menu item") );
+ wxCHECK_RET( m_menuItem, T("invalid menu item") );
gtk_widget_set_sensitive( m_menuItem, enable );
m_isEnabled = enable;
bool wxMenuItem::IsChecked() const
{
- wxCHECK_MSG( m_menuItem, FALSE, _T("invalid menu item") );
+ wxCHECK_MSG( m_menuItem, FALSE, T("invalid menu item") );
wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item!
m_eventHandler = this;
m_clientData = (void*) NULL;
- if (m_title.IsNull()) m_title = _T("");
- if (m_title != _T(""))
+ if (m_title.IsNull()) m_title = T("");
+ if (m_title != T(""))
{
Append(-2, m_title);
AppendSeparator();
switch (hotkey[0])
{
- case _T('a'): /* Alt */
- case _T('A'):
- case _T('m'): /* Meta */
- case _T('M'):
+ case T('a'): /* Alt */
+ case T('A'):
+ case T('m'): /* Meta */
+ case T('M'):
{
strcpy( hotbuf, "<alt>" );
wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() );
return hotbuf;
}
- case _T('c'): /* Ctrl */
- case _T('C'):
- case _T('s'): /* Strg, yeah man, I'm German */
- case _T('S'):
+ case T('c'): /* Ctrl */
+ case T('C'):
+ case T('s'): /* Strg, yeah man, I'm German */
+ case T('S'):
{
strcpy( hotbuf, "<control>" );
wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() );
return hotbuf;
}
- case _T('F'): /* function keys */
+ case T('F'): /* function keys */
{
strcpy( hotbuf, hotkey.mb_str() );
return hotbuf;
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
/* in order to get the pointer to the item we need the item text _without_ underscores */
- wxString s = _T("<main>/");
- for ( const wxChar *pc = text; *pc != _T('\0'); pc++ )
+ wxString s = T("<main>/");
+ for ( const wxChar *pc = text; *pc != T('\0'); pc++ )
{
- while (*pc == _T('_')) pc++; /* skip it */
+ while (*pc == T('_')) pc++; /* skip it */
s << *pc;
}
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
/* in order to get the pointer to the item we need the item text _without_ underscores */
- wxString s = _T("<main>/");
- for ( const wxChar *pc = text; *pc != _T('\0'); pc++ )
+ wxString s = T("<main>/");
+ for ( const wxChar *pc = text; *pc != T('\0'); pc++ )
{
- if (*pc == _T('_')) pc++; /* skip it */
+ if (*pc == T('_')) pc++; /* skip it */
s << *pc;
}
int wxMenu::FindItem( const wxString itemString ) const
{
- wxString s = _T("");
- for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ )
+ wxString s = T("");
+ for ( const wxChar *pc = itemString; *pc != T('\0'); pc++ )
{
- if (*pc == _T('&'))
+ if (*pc == T('&'))
{
pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0)
- s << _T('_');
+ s << T('_');
#endif
}
s << *pc;
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, _T("wxMenu::Enable: no such item") );
+ wxCHECK_RET( item, T("wxMenu::Enable: no such item") );
item->Enable(enable);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, FALSE, _T("wxMenu::IsEnabled: no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenu::IsEnabled: no such item") );
return item->IsEnabled();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, _T("wxMenu::Check: no such item") );
+ wxCHECK_RET( item, T("wxMenu::Check: no such item") );
item->Check(enable);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, FALSE, _T("wxMenu::IsChecked: no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenu::IsChecked: no such item") );
return item->IsChecked();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") );
+ wxCHECK_RET( item, T("wxMenu::SetLabel: no such item") );
item->SetText(label);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, _T(""), _T("wxMenu::GetLabel: no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenu::GetLabel: no such item") );
return item->GetText();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, _T("wxMenu::SetHelpString: no such item") );
+ wxCHECK_RET( item, T("wxMenu::SetHelpString: no such item") );
item->SetHelp( helpString );
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, _T(""), _T("wxMenu::GetHelpString: no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenu::GetHelpString: no such item") );
return item->GetHelp();
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxNoteBook creation failed") );
+ wxFAIL_MSG( T("wxNoteBook creation failed") );
return FALSE;
}
m_widget = gtk_notebook_new();
#ifdef __WXDEBUG__
- debug_focus_in( m_widget, _T("wxNotebook::m_widget"), name );
+ debug_focus_in( m_widget, T("wxNotebook::m_widget"), name );
#endif
gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
int wxNotebook::GetSelection() const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") );
GList *pages = GTK_NOTEBOOK(m_widget)->children;
wxString wxNotebook::GetPageText( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (nb_page)
return nb_page->m_text;
else
- return _T("");
+ return T("");
}
int wxNotebook::GetPageImage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (nb_page)
wxNotebookPage* wxNotebook::GetNotebookPage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*) NULL, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*) NULL, T("invalid notebook") );
- wxCHECK_MSG( page < (int)m_pages.GetCount(), (wxNotebookPage*) NULL, _T("invalid notebook index") );
+ wxCHECK_MSG( page < (int)m_pages.GetCount(), (wxNotebookPage*) NULL, T("invalid notebook index") );
wxNode *node = m_pages.Nth( page );
int wxNotebook::SetSelection( int page )
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") );
- wxCHECK_MSG( page < (int)m_pages.GetCount(), -1, _T("invalid notebook index") );
+ wxCHECK_MSG( page < (int)m_pages.GetCount(), -1, T("invalid notebook index") );
int selOld = GetSelection();
void wxNotebook::AdvanceSelection( bool forward )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid notebook") );
+ wxCHECK_RET( m_widget != NULL, T("invalid notebook") );
int sel = GetSelection();
int max = GetPageCount();
bool wxNotebook::SetPageText( int page, const wxString &text )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
- wxCHECK_MSG( nb_page, FALSE, _T("SetPageText: invalid page index") );
+ wxCHECK_MSG( nb_page, FALSE, T("SetPageText: invalid page index") );
nb_page->m_text = text;
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
{
- wxFAIL_MSG( _T("wxNotebook::SetPageSize not implemented") );
+ wxFAIL_MSG( T("wxNotebook::SetPageSize not implemented") );
}
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
{
- wxFAIL_MSG( _T("wxNotebook::SetPadding not implemented") );
+ wxFAIL_MSG( T("wxNotebook::SetPadding not implemented") );
}
void wxNotebook::SetTabSize(const wxSize& WXUNUSED(sz))
{
- wxFAIL_MSG( _T("wxNotebook::SetTabSize not implemented") );
+ wxFAIL_MSG( T("wxNotebook::SetTabSize not implemented") );
}
bool wxNotebook::DeleteAllPages()
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") );
while (m_pages.GetCount() > 0)
DeletePage( m_pages.GetCount()-1 );
bool wxNotebook::InsertPage( int position, wxWindow* win, const wxString& text,
bool select, int imageId )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") );
wxCHECK_MSG( win->GetParent() == this, FALSE,
- _T("Can't add a page whose parent is not the notebook!") );
+ T("Can't add a page whose parent is not the notebook!") );
/* don't receive switch page during addition */
gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget),
/* set the label text */
page->m_text = text;
- if (page->m_text.IsEmpty()) page->m_text = _T("");
+ if (page->m_text.IsEmpty()) page->m_text = T("");
page->m_label = GTK_LABEL( gtk_label_new(page->m_text.mbc_str()) );
gtk_box_pack_end( GTK_BOX(page->m_box), GTK_WIDGET(page->m_label), FALSE, FALSE, 3 );
wxWindow *wxNotebook::GetPage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (!nb_page)
const unsigned char *WXUNUSED(green),
const unsigned char *WXUNUSED(blue) )
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return FALSE;
}
const unsigned char WXUNUSED(green),
const unsigned char WXUNUSED(blue) ) const
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return 0;
}
unsigned char *WXUNUSED(green),
unsigned char *WXUNUSED(blue) ) const
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return 0;
}
int wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), -1, T("invalid pen") );
return M_PENDATA->m_capStyle;
}
int wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), -1, T("invalid pen") );
return M_PENDATA->m_joinStyle;
}
int wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), -1, T("invalid pen") );
return M_PENDATA->m_style;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), -1, T("invalid pen") );
return M_PENDATA->m_width;
}
wxColour &wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), wxNullColour, T("invalid pen") );
return M_PENDATA->m_colour;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxRadioBox creation failed") );
+ wxFAIL_MSG( T("wxRadioBox creation failed") );
return FALSE;
}
label.Empty();
for ( const wxChar *pc = choices[i]; *pc; pc++ )
{
- if ( *pc != _T('&') )
+ if ( *pc != T('&') )
label += *pc;
}
if ( m_majorDim == 0 )
{
// avoid dividing by 0 below
- wxFAIL_MSG( _T("dimension of radiobox should not be 0!") );
+ wxFAIL_MSG( T("dimension of radiobox should not be 0!") );
m_majorDim = 1;
}
bool wxRadioBox::Show( bool show )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobox") );
wxWindow::Show( show );
int wxRadioBox::FindString( const wxString &s ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid radiobox") );
int count = 0;
void wxRadioBox::SetFocus()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
if (m_boxes.GetCount() == 0) return;
void wxRadioBox::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxNode *node = m_boxes.Nth( n );
- wxCHECK_RET( node, _T("radiobox wrong index") );
+ wxCHECK_RET( node, T("radiobox wrong index") );
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
int wxRadioBox::GetSelection(void) const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid radiobox") );
int count = 0;
node = node->Next();
}
- wxFAIL_MSG( _T("wxRadioBox none selected") );
+ wxFAIL_MSG( T("wxRadioBox none selected") );
return -1;
}
wxString wxRadioBox::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") );
wxNode *node = m_boxes.Nth( n );
- wxCHECK_MSG( node, _T(""), _T("radiobox wrong index") );
+ wxCHECK_MSG( node, T(""), T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *label = GTK_LABEL( button->child );
wxString wxRadioBox::GetLabel( int item ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") );
return GetString( item );
}
void wxRadioBox::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxControl::SetLabel( label );
void wxRadioBox::SetLabel( int item, const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, _T("radiobox wrong index") );
+ wxCHECK_RET( node, T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *g_label = GTK_LABEL( button->child );
void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
{
- wxFAIL_MSG(_T("wxRadioBox::SetLabel not implemented."));
+ wxFAIL_MSG(T("wxRadioBox::SetLabel not implemented."));
}
bool wxRadioBox::Enable( bool enable )
void wxRadioBox::Enable( int item, bool enable )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, _T("radiobox wrong index") );
+ wxCHECK_RET( node, T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkWidget *label = button->child;
void wxRadioBox::Show( int item, bool show )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, _T("radiobox wrong index") );
+ wxCHECK_RET( node, T("radiobox wrong index") );
GtkWidget *button = GTK_WIDGET( node->Data() );
wxString wxRadioBox::GetStringSelection() const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") );
wxNode *node = m_boxes.First();
while (node)
node = node->Next();
}
- wxFAIL_MSG( _T("wxRadioBox none selected") );
- return _T("");
+ wxFAIL_MSG( T("wxRadioBox none selected") );
+ return T("");
}
bool wxRadioBox::SetStringSelection( const wxString &s )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobox") );
int res = FindString( s );
if (res == -1) return FALSE;
void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
{
- wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented."));
+ wxFAIL_MSG(T("wxRadioBox::SetNumberOfRowsOrCols not implemented."));
}
void wxRadioBox::DisableEvents()
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxRadioButton creation failed") );
+ wxFAIL_MSG( T("wxRadioButton creation failed") );
return FALSE;
}
void wxRadioButton::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobutton") );
wxControl::SetLabel( label );
GtkButton *bin = GTK_BUTTON( m_widget );
void wxRadioButton::SetValue( bool val )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobutton") );
if (val == GetValue())
return;
bool wxRadioButton::GetValue() const
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobutton") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobutton") );
return GTK_TOGGLE_BUTTON(m_widget)->active;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxScrollBar creation failed") );
+ wxFAIL_MSG( T("wxScrollBar creation failed") );
return FALSE;
}
case wxSYS_VSCROLL_X: return 15;
}
- wxCHECK_MSG( index, 0, _T("wxSystemSettings::GetSystemMetric not fully implemented") );
+ wxCHECK_MSG( index, 0, T("wxSystemSettings::GetSystemMetric not fully implemented") );
return 0;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxSlider creation failed") );
+ wxFAIL_MSG( T("wxSlider creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, new_size ) ||
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return FALSE;
}
int wxSpinButton::GetMin() const
{
- wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") );
+ wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") );
return (int)ceil(m_adjust->lower);
}
int wxSpinButton::GetMax() const
{
- wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") );
+ wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") );
return (int)ceil(m_adjust->upper);
}
int wxSpinButton::GetValue() const
{
- wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") );
+ wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") );
return (int)ceil(m_adjust->value);
}
void wxSpinButton::SetValue( int value )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid spin button") );
float fpos = (float)value;
m_oldPos = fpos;
void wxSpinButton::SetRange(int minVal, int maxVal)
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid spin button") );
float fmin = (float)minVal;
float fmax = (float)maxVal;
void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid spin button") );
m_width = 15;
gtk_widget_set_usize( m_widget, m_width, m_height );
void wxStaticBitmap::CreatePixmapWidget()
{
- wxCHECK_RET( m_bitmap.Ok(), _T("should only be called if we have a bitmap") );
+ wxCHECK_RET( m_bitmap.Ok(), T("should only be called if we have a bitmap") );
GdkBitmap *mask = (GdkBitmap *) NULL;
if ( m_bitmap.GetMask() )
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxStaticBox creation failed") );
+ wxFAIL_MSG( T("wxStaticBox creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxStaticLine creation failed") );
+ wxFAIL_MSG( T("wxStaticLine creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxToolBar creation failed") );
+ wxFAIL_MSG( T("wxToolBar creation failed") );
return FALSE;
}
m_hasToolAlready = TRUE;
wxCHECK_MSG( bitmap.Ok(), (wxToolBarTool *)NULL,
- _T("invalid bitmap for wxToolBar icon") );
+ T("invalid bitmap for wxToolBar icon") );
wxCHECK_MSG( bitmap.GetBitmap() == NULL, (wxToolBarTool *)NULL,
- _T("wxToolBar doesn't support GdkBitmap") );
+ T("wxToolBar doesn't support GdkBitmap") );
wxCHECK_MSG( bitmap.GetPixmap() != NULL, (wxToolBarTool *)NULL,
- _T("wxToolBar::Add needs a wxBitmap") );
+ T("wxToolBar::Add needs a wxBitmap") );
GtkWidget *tool_pixmap = (GtkWidget *)NULL;
void wxToolBar::ClearTools()
{
- wxFAIL_MSG( _T("wxToolBar::ClearTools not implemented") );
+ wxFAIL_MSG( T("wxToolBar::ClearTools not implemented") );
}
bool wxToolBar::Realize()
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
}
void wxToolBar::ToggleTool( int toolIndex, bool toggle )
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
}
wxObject *wxToolBar::GetToolClientData( int index ) const
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return (wxObject*)NULL;
}
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return FALSE;
}
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return FALSE;
}
void wxToolBar::SetMargins( int x, int y )
{
- wxCHECK_RET( !m_hasToolAlready, _T("wxToolBar::SetMargins must be called before adding tool.") );
+ wxCHECK_RET( !m_hasToolAlready, T("wxToolBar::SetMargins must be called before adding tool.") );
if (x > 2) gtk_toolbar_append_space( m_toolbar ); // oh well
void wxToolBar::SetToolPacking( int WXUNUSED(packing) )
{
- wxFAIL_MSG( _T("wxToolBar::SetToolPacking not implemented") );
+ wxFAIL_MSG( T("wxToolBar::SetToolPacking not implemented") );
}
void wxToolBar::SetToolSeparation( int separation )
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
- return _T("");
+ return T("");
}
wxString wxToolBar::GetToolShortHelp(int toolIndex)
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
- return _T("");
+ return T("");
}
void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString)
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return;
}
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxTextCtrl creation failed") );
+ wxFAIL_MSG( T("wxTextCtrl creation failed") );
return FALSE;
}
wxString wxTextCtrl::GetValue() const
{
- wxCHECK_MSG( m_text != NULL, _T(""), _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, T(""), T("invalid text ctrl") );
wxString tmp;
if (m_windowStyle & wxTE_MULTILINE)
void wxTextCtrl::SetValue( const wxString &value )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
- wxString tmp = _T("");
+ wxString tmp = T("");
if (!value.IsNull()) tmp = value;
if (m_windowStyle & wxTE_MULTILINE)
{
void wxTextCtrl::WriteText( const wxString &text )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (text.IsEmpty()) return;
void wxTextCtrl::AppendText( const wxString &text )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (text.IsEmpty()) return;
if (text)
{
- wxString buf(_T(""));
+ wxString buf(T(""));
long i;
int currentLine = 0;
for (i = 0; currentLine != lineNo && text[i]; i++ )
{
/* If you implement this, don't forget to update the documentation!
* (file docs/latex/wx/text.tex) */
- wxFAIL_MSG( _T("wxTextCtrl::OnDropFiles not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::OnDropFiles not implemented") );
}
bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
const wxChar* stop = text.c_str() + pos;
for ( const wxChar *p = text.c_str(); p < stop; p++ )
{
- if (*p == _T('\n'))
+ if (*p == T('\n'))
{
(*y)++;
*x=0;
void wxTextCtrl::SetInsertionPoint( long pos )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
{
void wxTextCtrl::SetInsertionPointEnd()
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
SetInsertionPoint(gtk_text_get_length(GTK_TEXT(m_text)));
void wxTextCtrl::SetEditable( bool editable )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
gtk_text_set_editable( GTK_TEXT(m_text), editable );
void wxTextCtrl::SetSelection( long from, long to )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
}
long wxTextCtrl::GetInsertionPoint() const
{
- wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, 0, T("invalid text ctrl") );
return (long) GTK_EDITABLE(m_text)->current_pos;
}
long wxTextCtrl::GetLastPosition() const
{
- wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, 0, T("invalid text ctrl") );
int pos = 0;
if (m_windowStyle & wxTE_MULTILINE)
void wxTextCtrl::Remove( long from, long to )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
}
void wxTextCtrl::Replace( long from, long to, const wxString &value )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
void wxTextCtrl::Cut()
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) );
void wxTextCtrl::Copy()
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) );
void wxTextCtrl::Paste()
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) );
void wxTextCtrl::Undo()
{
// TODO
- wxFAIL_MSG( _T("wxTextCtrl::Undo not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::Undo not implemented") );
}
void wxTextCtrl::Redo()
{
// TODO
- wxFAIL_MSG( _T("wxTextCtrl::Redo not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::Redo not implemented") );
}
bool wxTextCtrl::CanUndo() const
{
// TODO
- wxFAIL_MSG( _T("wxTextCtrl::CanUndo not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::CanUndo not implemented") );
return FALSE;
}
bool wxTextCtrl::CanRedo() const
{
// TODO
- wxFAIL_MSG( _T("wxTextCtrl::CanRedo not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::CanRedo not implemented") );
return FALSE;
}
// selection.
void wxTextCtrl::GetSelection(long* from, long* to) const
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (!(GTK_EDITABLE(m_text)->has_selection))
{
bool wxTextCtrl::IsEditable() const
{
- wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") );
return GTK_EDITABLE(m_text)->editable;
}
void wxTextCtrl::Clear()
{
- SetValue( _T("") );
+ SetValue( T("") );
}
void wxTextCtrl::OnChar( wxKeyEvent &key_event )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if ((key_event.KeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER))
{
// the font will change for subsequent text insertiongs
bool wxTextCtrl::SetFont( const wxFont &font )
{
- wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") );
if ( !wxWindowBase::SetFont(font) )
{
bool wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) )
{
- wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") );
// doesn't work
return FALSE;
bool wxTextCtrl::SetBackgroundColour( const wxColour &colour )
{
- wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") );
wxControl::SetBackgroundColour( colour );
// Yuck this is really BOTH site and platform dependent
// so we should use some other strategy!
#ifdef __SUN__
- #define DEFAULT_XRESOURCE_DIR _T("/usr/openwin/lib/app-defaults")
+ #define DEFAULT_XRESOURCE_DIR T("/usr/openwin/lib/app-defaults")
#else
- #define DEFAULT_XRESOURCE_DIR _T("/usr/lib/X11/app-defaults")
+ #define DEFAULT_XRESOURCE_DIR T("/usr/lib/X11/app-defaults")
#endif
//-----------------------------------------------------------------------------
wxStrcpy(buf, name);
return buf; // Exists so ...
}
- if (*name == _T('/'))
+ if (*name == T('/'))
wxStrcpy(buf, name);
else
{
// Put in standard place for resource files if not absolute
wxStrcpy(buf, DEFAULT_XRESOURCE_DIR);
- wxStrcat(buf, _T("/"));
+ wxStrcat(buf, T("/"));
wxStrcat(buf, FileNameFromPath(name));
}
if (create)
if ((home = wxGetUserHome(wxString())) != NULL)
{
wxStrcpy(dest, home);
- if (dest[wxStrlen(dest) - 1] != _T('/')) wxStrcat(dest, _T("/"));
+ if (dest[wxStrlen(dest) - 1] != T('/')) wxStrcat(dest, T("/"));
if (filename == NULL)
{
- if ((filename = wxGetenv(_T("XENVIRONMENT"))) == NULL) filename = _T(".Xdefaults");
+ if ((filename = wxGetenv(T("XENVIRONMENT("))) == NULL) filename = T(".Xdefaults");
}
else
- if (*filename != _T('.')) wxStrcat(dest, _T("."));
+ if (*filename != T('.')) wxStrcat(dest, T("."));
wxStrcat(dest, filename);
}
else
{
- dest[0] = _T('\0');
+ dest[0] = T('\0');
}
}
return dest;
// Open XENVIRONMENT file, or if not defined, the .Xdefaults,
// and merge into existing database
- if ((environment = wxGetenv(_T("XENVIRONMENT"))) == NULL)
+ if ((environment = wxGetenv(T("XENVIRONMENT("))) == NULL)
{
size_t len;
#if wxUSE_UNICODE
void wxDeleteResources(const wxChar *file)
{
- wxLogTrace(wxTraceResAlloc, _T("Delete: Number = %d"), wxTheResourceCache->Number());
+ wxLogTrace(wxTraceResAlloc, T("Delete: Number = %d"), wxTheResourceCache->Number());
wxChar buffer[500];
(void)GetIniFile(buffer, file);
database = (XrmDatabase)node->Data();
else {
database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer));
- wxLogTrace(wxTraceResAlloc, _T("Write: Number = %d"), wxTheResourceCache->Number());
+ wxLogTrace(wxTraceResAlloc, T("Write: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
char resName[300];
- strcpy(resName, !section.IsNull() ? MBSTRINGCAST section.mb_str() : "wxWindows");
+ strcpy(resName, !section.IsNull() ? wxMBSTRINGCAST section.mb_str() : "wxWindows");
strcat(resName, ".");
strcat(resName, entry.mb_str());
XrmPutStringResource(&database, resName, value.mb_str());
else
{
database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer));
- wxLogTrace(wxTraceResAlloc, _T("Get: Number = %d"), wxTheResourceCache->Number());
+ wxLogTrace(wxTraceResAlloc, T("Get: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
} else
{
// Handle True, False here
// True, Yes, Enables, Set or Activated
- if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')
+ if (*s == 'T(' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')
*value = TRUE;
// False, No, Disabled, Reset, Cleared, Deactivated
else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C')
wxLog::AddTraceMask("focus");
s_done = TRUE;
}
- wxLogTrace(_T("FOCUS NOW AT: %s"), name);
+ wxLogTrace(T("FOCUS NOW AT: %s"), name);
*/
return FALSE;
void debug_focus_in( GtkWidget* widget, const wxChar* name, const wxChar *window )
{
wxString tmp = name;
- tmp += _T(" FROM ");
+ tmp += T(" FROM ");
tmp += window;
wxChar *s = new wxChar[tmp.Length()+1];
wxapp_install_idle_handler();
/*
- wxPrintf( _T("1) OnButtonPress from ") );
+ wxPrintf( T("1) OnButtonPress from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
wxPrintf( win->GetClassInfo()->GetClassName() );
- wxPrintf( _T(".\n") );
+ wxPrintf( T(".\n") );
*/
if (!win->m_hasVMT) return FALSE;
if (g_blockEventsOnDrag) return TRUE;
gtk_widget_grab_focus (win->m_wxwindow);
/*
- wxPrintf( _T("GrabFocus from ") );
+ wxPrintf( T("GrabFocus from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
wxPrintf( win->GetClassInfo()->GetClassName() );
- wxPrintf( _T(".\n") );
+ wxPrintf( T(".\n") );
*/
}
}
/*
- wxPrintf( _T("2) OnButtonPress from ") );
+ wxPrintf( T("2) OnButtonPress from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
wxPrintf( win->GetClassInfo()->GetClassName() );
- wxPrintf( _T(".\n") );
+ wxPrintf( T(".\n") );
*/
wxEventType event_type = wxEVT_LEFT_DOWN;
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxWindow creation failed") );
+ wxFAIL_MSG( T("wxWindow creation failed") );
return FALSE;
}
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
#ifdef __WXDEBUG__
- debug_focus_in( m_widget, _T("wxWindow::m_widget"), name );
+ debug_focus_in( m_widget, T("wxWindow::m_widget"), name );
#endif
GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
#ifdef __WXDEBUG__
- debug_focus_in( scrolledWindow->hscrollbar, _T("wxWindow::hsrcollbar"), name );
- debug_focus_in( scrolledWindow->vscrollbar, _T("wxWindow::vsrcollbar"), name );
+ debug_focus_in( scrolledWindow->hscrollbar, T("wxWindow::hsrcollbar"), name );
+ debug_focus_in( scrolledWindow->vscrollbar, T("wxWindow::vsrcollbar"), name );
#endif
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
m_wxwindow = gtk_myfixed_new();
#ifdef __WXDEBUG__
- debug_focus_in( m_wxwindow, _T("wxWindow::m_wxwindow"), name );
+ debug_focus_in( m_wxwindow, T("wxWindow::m_wxwindow"), name );
#endif
gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
bool wxWindow::PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize &size )
{
- wxCHECK_MSG( !m_needParent || parent, FALSE, _T("Need complete parent.") );
+ wxCHECK_MSG( !m_needParent || parent, FALSE, T("Need complete parent.") );
/* this turns -1 into 20 so that a minimal window is
visible even although -1,-1 has been given as the
void wxWindow::PostCreation()
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid window") );
if (m_wxwindow)
{
bool wxWindow::Destroy()
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid window") );
m_hasVMT = FALSE;
void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
- wxASSERT_MSG( (m_parent != NULL), _T("wxWindow::SetSize requires parent.\n") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid window") );
+ wxASSERT_MSG( (m_parent != NULL), T("wxWindow::SetSize requires parent.\n") );
if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE;
void wxWindow::DoGetSize( int *width, int *height ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (width) (*width) = m_width;
if (height) (*height) = m_height;
void wxWindow::DoSetClientSize( int width, int height )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_wxwindow)
{
void wxWindow::DoGetClientSize( int *width, int *height ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_wxwindow)
{
void wxWindow::DoGetPosition( int *x, int *y ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (x) (*x) = m_x;
if (y) (*y) = m_y;
void wxWindow::DoClientToScreen( int *x, int *y ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
void wxWindow::DoScreenToClient( int *x, int *y ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
bool wxWindow::Show( bool show )
{
- wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") );
if (!wxWindowBase::Show(show))
{
bool wxWindow::Enable( bool enable )
{
- wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") );
if (!wxWindowBase::Enable(enable))
{
int wxWindow::GetCharHeight() const
{
- wxCHECK_MSG( (m_widget != NULL), 12, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), 12, T("invalid window") );
- wxCHECK_MSG( m_font.Ok(), 12, _T("invalid font") );
+ wxCHECK_MSG( m_font.Ok(), 12, T("invalid font") );
GdkFont *font = m_font.GetInternalFont( 1.0 );
int wxWindow::GetCharWidth() const
{
- wxCHECK_MSG( (m_widget != NULL), 8, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), 8, T("invalid window") );
- wxCHECK_MSG( m_font.Ok(), 8, _T("invalid font") );
+ wxCHECK_MSG( m_font.Ok(), 8, T("invalid font") );
GdkFont *font = m_font.GetInternalFont( 1.0 );
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
- wxCHECK_RET( fontToUse.Ok(), _T("invalid font") );
+ wxCHECK_RET( fontToUse.Ok(), T("invalid font") );
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
if (x) (*x) = gdk_string_width( font, string.mbc_str() );
void wxWindow::SetFocus()
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
GtkWidget *connect_widget = GetConnectWidget();
if (connect_widget)
bool wxWindow::Reparent( wxWindowBase *newParentBase )
{
- wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") );
wxWindow *oldParent = m_parent,
*newParent = (wxWindow *)newParentBase;
void wxWindow::DoAddChild(wxWindow *child)
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid window") );
- wxASSERT_MSG( (child != NULL), _T("invalid child window") );
+ wxASSERT_MSG( (child != NULL), T("invalid child window") );
- wxASSERT_MSG( (m_insertCallback != NULL), _T("invalid child insertion function") );
+ wxASSERT_MSG( (m_insertCallback != NULL), T("invalid child insertion function") );
/* add to list */
AddChild( child );
void wxWindow::Raise()
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
void wxWindow::Lower()
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
bool wxWindow::SetCursor( const wxCursor &cursor )
{
- wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") );
return wxWindowBase::SetCursor( cursor );
}
void wxWindow::WarpPointer( int x, int y )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
GtkWidget *connect_widget = GetConnectWidget();
if (connect_widget->window)
void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
void wxWindow::Clear()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
if (!m_widget->window) return;
bool wxWindow::SetBackgroundColour( const wxColour &colour )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") );
if (!wxWindowBase::SetBackgroundColour(colour))
{
bool wxWindow::SetForegroundColour( const wxColour &colour )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") );
if (!wxWindowBase::SetForegroundColour(colour))
{
bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") );
- wxCHECK_MSG( menu != NULL, FALSE, _T("invalid popup-menu") );
+ wxCHECK_MSG( menu != NULL, FALSE, T("invalid popup-menu") );
SetInvokingWindow( menu, this );
void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
GtkWidget *dnd_widget = GetConnectWidget();
bool wxWindow::SetFont( const wxFont &font )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") );
if (!wxWindowBase::SetFont(font))
{
void wxWindow::CaptureMouse()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( g_captureWindow == NULL, _T("CaptureMouse called twice") );
+ wxCHECK_RET( g_captureWindow == NULL, T("CaptureMouse called twice") );
GtkWidget *connect_widget = GetConnectWidget();
if (!connect_widget->window) return;
void wxWindow::ReleaseMouse()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( g_captureWindow, _T("ReleaseMouse called twice") );
+ wxCHECK_RET( g_captureWindow, T("ReleaseMouse called twice") );
GtkWidget *connect_widget = GetConnectWidget();
if (!connect_widget->window) return;
void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
+ wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") );
m_hasScrolling = TRUE;
void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
+ wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
{
int wxWindow::GetScrollThumb( int orient ) const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") );
- wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
+ wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->page_size+0.5);
int wxWindow::GetScrollPos( int orient ) const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") );
- wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
+ wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->value+0.5);
int wxWindow::GetScrollRange( int orient ) const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") );
- wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
+ wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->upper+0.5);
void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
+ wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") );
if (!m_scrollGC)
{
// Author: Robert Roebling
// Id: $id:$
// Copyright: (c) 1998 Robert Roebling
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
class wxAccelRefData: public wxObjectRefData
{
public:
-
- wxAccelRefData(void);
-
+ wxAccelRefData();
+
wxList m_accels;
};
-wxAccelRefData::wxAccelRefData(void)
+wxAccelRefData::wxAccelRefData()
{
m_accels.DeleteContents( TRUE );
}
#define M_ACCELDATA ((wxAccelRefData *)m_refData)
IMPLEMENT_DYNAMIC_CLASS(wxAcceleratorTable,wxObject)
-
+
wxAcceleratorTable::wxAcceleratorTable()
{
}
wxAcceleratorTable::wxAcceleratorTable( int n, wxAcceleratorEntry entries[] )
{
m_refData = new wxAccelRefData();
-
+
for (int i = 0; i < n; i++)
{
int flag = entries[i].GetFlags();
(((entry->GetFlags() & wxACCEL_CTRL) == 0) || event.ControlDown()) &&
(((entry->GetFlags() & wxACCEL_SHIFT) == 0) || event.ShiftDown()) &&
(((entry->GetFlags() & wxACCEL_ALT) == 0) || event.AltDown() || event.MetaDown()))
- {
+ {
return entry->GetCommand();
- }
+ }
node = node->Next();
}
-
+
return -1;
}
bool wxYield()
{
bool has_idle = (wxTheApp->m_idleTag != 0);
-
+
if (has_idle)
{
/* We need to temporarily remove idle callbacks or the loop will
might have been changed (it also will update other things set from
OnUpdateUI() which is a nice (and desired) side effect) */
while (wxTheApp->ProcessIdle()) { }
-
+
if (has_idle)
{
/* re-add idle handler */
wxTheApp->m_idleTag = gtk_idle_add( wxapp_idle_callback, (gpointer) NULL );
}
-
+
return TRUE;
}
gint wxapp_idle_callback( gpointer WXUNUSED(data) )
{
if (!wxTheApp) return TRUE;
-
+
#if (GTK_MINOR_VERSION > 0)
/* when getting called from GDK's idle handler we
are no longer within GDK's grab on the GUI
void wxapp_install_idle_handler()
{
- wxASSERT_MSG( wxTheApp->m_idleTag == 0, _T("attempt to install idle handler twice") );
+ wxASSERT_MSG( wxTheApp->m_idleTag == 0, T("attempt to install idle handler twice") );
/* this routine gets called by all event handlers
indicating that the idle is over. */
void wxapp_install_thread_wakeup()
{
if (wxTheApp->m_wakeUpTimerTag) return;
-
+
wxTheApp->m_wakeUpTimerTag = gtk_timeout_add( 100, wxapp_wakeup_timerout_callback, (gpointer) NULL );
}
void wxapp_uninstall_thread_wakeup()
{
if (!wxTheApp->m_wakeUpTimerTag) return;
-
+
gtk_timeout_remove( wxTheApp->m_wakeUpTimerTag );
wxTheApp->m_wakeUpTimerTag = 0;
}
index |= (g >> (5 - vis->green_prec)) << vis->green_shift;
index |= (b >> (5 - vis->blue_prec)) << vis->blue_shift;
#else
- wxFAIL_MSG( _T("Unsupported graphics hardware") );
+ wxFAIL_MSG( T("Unsupported graphics hardware") );
#endif
}
m_colorCube[ (r*1024) + (g*32) + b ] = index;
win->ProcessEvent(event);
win->OnInternalIdle();
-
+
if (event.MoreRequested())
needMore = TRUE;
#if (defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
if (wxDebugContext::CountObjectsLeft() > 0)
{
- wxLogDebug(_T("There were memory leaks.\n"));
+ wxLogDebug(T("There were memory leaks.\n"));
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
if (!wxTheApp)
{
wxCHECK_MSG( wxApp::GetInitializerFunction(), -1,
- _T("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
+ T("wxWindows error: No initializer - use IMPLEMENT_APP macro.\n") );
wxAppInitializerFunction app_ini = wxApp::GetInitializerFunction();
wxTheApp = (wxApp*) test_app;
}
- wxCHECK_MSG( wxTheApp, -1, _T("wxWindows error: no application object") );
+ wxCHECK_MSG( wxTheApp, -1, T("wxWindows error: no application object") );
wxTheApp->argc = argc;
#if wxUSE_UNICODE
return wxIcon(warning_xpm);
default:
- wxFAIL_MSG(_T("requested non existent standard icon"));
+ wxFAIL_MSG(T("requested non existent standard icon"));
// still fall through
case wxICON_HAND:
m_bitmap = (GdkBitmap*) NULL;
}
- wxFAIL_MSG( _T("TODO") );
+ wxFAIL_MSG( T("TODO") );
return FALSE;
}
m_bitmap = (GdkBitmap*) NULL;
}
- wxFAIL_MSG( _T("not implemented") );
+ wxFAIL_MSG( T("not implemented") );
return FALSE;
}
if (!bitmap.Ok()) return FALSE;
- wxCHECK_MSG( bitmap.GetBitmap(), FALSE, _T("Cannot create mask from colour bitmap") );
+ wxCHECK_MSG( bitmap.GetBitmap(), FALSE, T("Cannot create mask from colour bitmap") );
m_bitmap = gdk_pixmap_new( (GdkWindow*) &gdk_root_parent, bitmap.GetWidth(), bitmap.GetHeight(), 1 );
wxBitmap::wxBitmap( int width, int height, int depth )
{
- wxCHECK_RET( (width > 0) && (height > 0), _T("invalid bitmap size") )
+ wxCHECK_RET( (width > 0) && (height > 0), T("invalid bitmap size") )
GdkWindow *parent = (GdkWindow*) &gdk_root_parent;
if (depth == -1) depth = gdk_window_get_visual( parent )->depth;
wxCHECK_RET( (depth == gdk_window_get_visual( parent )->depth) ||
- (depth == 1), _T("invalid bitmap depth") )
+ (depth == 1), T("invalid bitmap depth") )
m_refData = new wxBitmapRefData();
M_BMPDATA->m_mask = (wxMask *) NULL;
wxBitmap::wxBitmap( const char **bits )
{
- wxCHECK_RET( bits != NULL, _T("invalid bitmap data") )
+ wxCHECK_RET( bits != NULL, T("invalid bitmap data") )
m_refData = new wxBitmapRefData();
wxBitmap::wxBitmap( char **bits )
{
- wxCHECK_RET( bits != NULL, _T("invalid bitmap data") )
+ wxCHECK_RET( bits != NULL, T("invalid bitmap data") )
m_refData = new wxBitmapRefData();
M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits );
- wxCHECK_RET( M_BMPDATA->m_pixmap, _T("couldn't create pixmap") );
+ wxCHECK_RET( M_BMPDATA->m_pixmap, T("couldn't create pixmap") );
if (mask)
{
M_BMPDATA->m_height = height;
M_BMPDATA->m_bpp = 1;
- wxCHECK_RET( M_BMPDATA->m_bitmap, _T("couldn't create bitmap") );
+ wxCHECK_RET( M_BMPDATA->m_bitmap, T("couldn't create bitmap") );
if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this);
}
int wxBitmap::GetHeight() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), -1, T("invalid bitmap") );
return M_BMPDATA->m_height;
}
int wxBitmap::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), -1, T("invalid bitmap") );
return M_BMPDATA->m_width;
}
int wxBitmap::GetDepth() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), -1, T("invalid bitmap") );
return M_BMPDATA->m_bpp;
}
wxMask *wxBitmap::GetMask() const
{
- wxCHECK_MSG( Ok(), (wxMask *) NULL, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), (wxMask *) NULL, T("invalid bitmap") );
return M_BMPDATA->m_mask;
}
void wxBitmap::SetMask( wxMask *mask )
{
- wxCHECK_RET( Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( Ok(), T("invalid bitmap") );
if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask;
bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(palette) )
{
- wxCHECK_MSG( Ok(), FALSE, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), FALSE, T("invalid bitmap") );
if (type == wxBITMAP_TYPE_PNG)
{
GdkPixmap *wxBitmap::GetPixmap() const
{
- wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, T("invalid bitmap") );
return M_BMPDATA->m_pixmap;
}
GdkBitmap *wxBitmap::GetBitmap() const
{
- wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, _T("invalid bitmap") );
+ wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, T("invalid bitmap") );
return M_BMPDATA->m_bitmap;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxBitmapButton creation failed") );
+ wxFAIL_MSG( T("wxBitmapButton creation failed") );
return FALSE;
}
void wxBitmapButton::SetLabel( const wxString &label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
wxControl::SetLabel( label );
}
wxString wxBitmapButton::GetLabel() const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid button") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid button") );
return wxControl::GetLabel();
}
void wxBitmapButton::SetBitmap()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
wxBitmap the_one;
void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
if ( ! m_disabled.Ok() ) return;
m_disabled = bitmap;
void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
if ( ! m_focus.Ok() ) return;
m_focus = bitmap;
void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
if (!m_bitmap.Ok()) return;
m_bitmap = bitmap;
void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
if ( ! m_selected.Ok() ) return;
m_selected = bitmap;
{
if (m_refData == NULL)
{
- wxFAIL_MSG( _T("invalid brush") );
+ wxFAIL_MSG( T("invalid brush") );
return 0;
}
{
if (m_refData == NULL)
{
- wxFAIL_MSG( _T("invalid brush") );
+ wxFAIL_MSG( T("invalid brush") );
return wxNullColour;
}
{
if (m_refData == NULL)
{
- wxFAIL_MSG( _T("invalid brush") );
+ wxFAIL_MSG( T("invalid brush") );
return &wxNullBitmap;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxButton creation failed") );
+ wxFAIL_MSG( T("wxButton creation failed") );
return FALSE;
}
void wxButton::SetLabel( const wxString &label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid button") );
+ wxCHECK_RET( m_widget != NULL, T("invalid button") );
wxControl::SetLabel( label );
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxCheckBox creation failed") );
+ wxFAIL_MSG( T("wxCheckBox creation failed") );
return FALSE;
}
void wxCheckBox::SetValue( bool state )
{
- wxCHECK_RET( m_widgetCheckbox != NULL, _T("invalid checkbox") );
+ wxCHECK_RET( m_widgetCheckbox != NULL, T("invalid checkbox") );
if (state == GetValue())
return;
bool wxCheckBox::GetValue() const
{
- wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, _T("invalid checkbox") );
+ wxCHECK_MSG( m_widgetCheckbox != NULL, FALSE, T("invalid checkbox") );
return GTK_TOGGLE_BUTTON(m_widgetCheckbox)->active;
}
void wxCheckBox::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widgetLabel != NULL, _T("invalid checkbox") );
+ wxCHECK_RET( m_widgetLabel != NULL, T("invalid checkbox") );
wxControl::SetLabel( label );
bool wxCheckListBox::IsChecked( int index ) const
{
- wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid checklistbox") );
+ wxCHECK_MSG( m_list != NULL, FALSE, T("invalid checklistbox") );
GList *child = g_list_nth( m_list->children, index );
if (child)
wxString str = wxString(label->label,*wxConvCurrent);
- return (str[1] == _T('X'));
+ return (str[1] == T('X'));
}
- wxFAIL_MSG(_T("wrong checklistbox index"));
+ wxFAIL_MSG(T("wrong checklistbox index"));
return FALSE;
}
void wxCheckListBox::Check( int index, bool check )
{
- wxCHECK_RET( m_list != NULL, _T("invalid checklistbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid checklistbox") );
GList *child = g_list_nth( m_list->children, index );
if (child)
wxString str = wxString(label->label,*wxConvCurrent);
- if (check == (str[1] == _T('X'))) return;
+ if (check == (str[1] == T('X'))) return;
if (check)
- str.SetChar( 1, _T('X') );
+ str.SetChar( 1, T('X') );
else
- str.SetChar( 1, _T('-') );
+ str.SetChar( 1, T('-') );
gtk_label_set( label, str.mbc_str() );
return;
}
- wxFAIL_MSG(_T("wrong checklistbox index"));
+ wxFAIL_MSG(T("wrong checklistbox index"));
}
int wxCheckListBox::GetItemHeight() const
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxChoice creation failed") );
+ wxFAIL_MSG( T("wxChoice creation failed") );
return FALSE;
}
void wxChoice::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
+ wxCHECK_RET( m_widget != NULL, T("invalid choice") );
GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu_item = gtk_menu_item_new_with_label( item.mbc_str() );
void wxChoice::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxChoice::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxChoice::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxChoice::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxChoice::Clear()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
+ wxCHECK_RET( m_widget != NULL, T("invalid choice") );
gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new();
void wxChoice::Delete( int WXUNUSED(n) )
{
- wxFAIL_MSG( _T("wxChoice:Delete not implemented") );
+ wxFAIL_MSG( T("wxChoice:Delete not implemented") );
}
int wxChoice::FindString( const wxString &string ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid choice") );
// If you read this code once and you think you understand
// it, then you are very wrong. Robert Roebling.
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
+ wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") );
if (string == wxString(label->label,*wxConvCurrent))
return count;
int wxChoice::GetSelection()
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
wxString wxChoice::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
+ wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") );
return wxString(label->label,*wxConvCurrent);
}
count++;
}
- wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") );
+ wxFAIL_MSG( T("wxChoice: invalid index in GetString()") );
- return _T("");
+ return T("");
}
wxString wxChoice::GetStringSelection() const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid choice") );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
+ wxASSERT_MSG( label != NULL , T("wxChoice: invalid label") );
return wxString(label->label,*wxConvCurrent);
}
int wxChoice::Number() const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid choice") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
void wxChoice::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
+ wxCHECK_RET( m_widget != NULL, T("invalid choice") );
int tmp = n;
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
void wxChoice::SetStringSelection( const wxString &string )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
+ wxCHECK_RET( m_widget != NULL, T("invalid choice") );
int n = FindString( string );
if (n != -1) SetSelection( n );
bool wxClipboard::Open()
{
- wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") );
+ wxCHECK_MSG( !m_open, FALSE, T("clipboard already open") );
m_open = TRUE;
bool wxClipboard::SetData( wxDataObject *data )
{
- wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( m_open, FALSE, T("clipboard not open") );
- wxCHECK_MSG( data, FALSE, _T("data is invalid") );
+ wxCHECK_MSG( data, FALSE, T("data is invalid") );
Clear();
bool wxClipboard::AddData( wxDataObject *data )
{
- wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( m_open, FALSE, T("clipboard not open") );
- wxCHECK_MSG( data, FALSE, _T("data is invalid") );
+ wxCHECK_MSG( data, FALSE, T("data is invalid") );
/* if clipboard has been cleared before, create new data broker */
if (!m_dataBroker) m_dataBroker = new wxDataBroker();
/* get native format id of new data object */
GdkAtom format = data->GetFormat().GetAtom();
- wxCHECK_MSG( format, FALSE, _T("data has invalid format") );
+ wxCHECK_MSG( format, FALSE, T("data has invalid format") );
/* This should happen automatically, but to be on the safe side */
m_ownsClipboard = FALSE;
void wxClipboard::Close()
{
- wxCHECK_RET( m_open, _T("clipboard not open") );
+ wxCHECK_RET( m_open, T("clipboard not open") );
m_open = FALSE;
}
bool wxClipboard::IsSupported( wxDataFormat format )
{
- wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( m_open, FALSE, T("clipboard not open") );
/* store requested format to be asked for by callbacks */
m_targetRequested = format.GetAtom();
- wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
+ wxCHECK_MSG( m_targetRequested, FALSE, T("invalid clipboard format") );
m_formatSupported = FALSE;
bool wxClipboard::GetData( wxDataObject *data )
{
- wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( m_open, FALSE, T("clipboard not open") );
/* is data supported by clipboard ? */
m_targetRequested = data->GetFormat().GetAtom();
- wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
+ wxCHECK_MSG( m_targetRequested, FALSE, T("invalid clipboard format") );
/* start query */
/* this is a true error as we checked for the presence of such data before */
- wxCHECK_MSG( m_formatSupported, FALSE, _T("error retrieving data from clipboard") );
+ wxCHECK_MSG( m_formatSupported, FALSE, T("error retrieving data from clipboard") );
return TRUE;
}
m_refData = new wxColourRefData();
if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color ))
{
- wxFAIL_MSG( _T("wxColour: couldn't find colour") );
- wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName );
+ wxFAIL_MSG( T("wxColour: couldn't find colour") );
+ wxPrintf( T("Colourname %s.\n"), WXSTRINGCAST colourName );
delete m_refData;
m_refData = (wxObjectRefData *) NULL;
unsigned char wxColour::Red() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), 0, T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
}
unsigned char wxColour::Green() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), 0, T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
}
unsigned char wxColour::Blue() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), 0, T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
}
int wxColour::GetPixel() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), 0, T("invalid colour") );
return M_COLDATA->m_color.pixel;
}
GdkColor *wxColour::GetColor() const
{
- wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") );
+ wxCHECK_MSG( Ok(), (GdkColor *) NULL, T("invalid colour") );
return &M_COLDATA->m_color;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxComboBox creation failed") );
+ wxFAIL_MSG( T("wxComboBox creation failed") );
return FALSE;
}
void wxComboBox::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
void wxComboBox::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxComboBox::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxComboBox::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxComboBox::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxComboBox::Clear()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() );
void wxComboBox::Delete( int n )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkList *listbox = GTK_LIST( GTK_COMBO(m_widget)->list );
if (!child)
{
- wxFAIL_MSG(_T("wrong index"));
+ wxFAIL_MSG(T("wrong index"));
return;
}
int wxComboBox::FindString( const wxString &item )
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
int wxComboBox::GetSelection() const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
wxString wxComboBox::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
}
else
{
- wxFAIL_MSG( _T("wxComboBox: wrong index") );
+ wxFAIL_MSG( T("wxComboBox: wrong index") );
}
return str;
wxString wxComboBox::GetStringSelection() const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
return tmp;
}
- wxFAIL_MSG( _T("wxComboBox: no selection") );
+ wxFAIL_MSG( T("wxComboBox: no selection") );
- return _T("");
+ return T("");
}
int wxComboBox::Number() const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
void wxComboBox::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
DisableEvents();
void wxComboBox::SetStringSelection( const wxString &string )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
int res = FindString( string );
if (res == -1) return;
void wxComboBox::SetValue( const wxString& value )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
- wxString tmp = _T("");
+ wxString tmp = T("");
if (!value.IsNull()) tmp = value;
gtk_entry_set_text( GTK_ENTRY(entry), tmp.mbc_str() );
}
void wxComboBox::Copy()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::Cut()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::Paste()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::SetInsertionPoint( long pos )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_entry_set_position( GTK_ENTRY(entry), (int)pos );
void wxComboBox::SetInsertionPointEnd()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
SetInsertionPoint( -1 );
}
void wxComboBox::Replace( long from, long to, const wxString& value )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
// FIXME: not quite sure how to do this method right in multibyte mode
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
void wxComboBox::Remove(long from, long to)
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
void wxControl::SetLabel( const wxString &label )
{
m_label.Empty();
- for ( const wxChar *pc = label; *pc != _T('\0'); pc++ )
+ for ( const wxChar *pc = label; *pc != T('\0'); pc++ )
{
- if ( *pc == _T('&') )
+ if ( *pc == T('&') )
{
pc++; // skip it
#if 0 // it would be unused anyhow for now - kbd interface not done yet
- if ( *pc != _T('&') ) m_chAccel = *pc;
+ if ( *pc != T('&') ) m_chAccel = *pc;
#endif
}
m_label << *pc;
case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break;
*/
default:
- wxFAIL_MSG(_T("unsupported cursor type"));
+ wxFAIL_MSG(T("unsupported cursor type"));
// will use the standard one
case wxCURSOR_ARROW:
return;
wxASSERT_MSG( !gs_savedCursor.Ok(),
- _T("forgot to call wxEndBusyCursor, will leak memory") );
+ T("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = g_globalCursor;
wxPalette wxNullPalette;
/* Default window names */
-const wxChar *wxButtonNameStr = _T("button");
-const wxChar *wxCanvasNameStr = _T("canvas");
-const wxChar *wxCheckBoxNameStr = _T("check");
-const wxChar *wxChoiceNameStr = _T("choice");
-const wxChar *wxComboBoxNameStr = _T("comboBox");
-const wxChar *wxDialogNameStr = _T("dialog");
-const wxChar *wxFrameNameStr = _T("frame");
-const wxChar *wxGaugeNameStr = _T("gauge");
-const wxChar *wxStaticBoxNameStr = _T("groupBox");
-const wxChar *wxListBoxNameStr = _T("listBox");
-const wxChar *wxStaticTextNameStr = _T("message");
-const wxChar *wxStaticBitmapNameStr = _T("message");
-const wxChar *wxMultiTextNameStr = _T("multitext");
-const wxChar *wxPanelNameStr = _T("panel");
-const wxChar *wxRadioBoxNameStr = _T("radioBox");
-const wxChar *wxRadioButtonNameStr = _T("radioButton");
-const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton");
-const wxChar *wxScrollBarNameStr = _T("scrollBar");
-const wxChar *wxSliderNameStr = _T("slider");
-const wxChar *wxStaticNameStr = _T("static");
-const wxChar *wxTextCtrlWindowNameStr = _T("textWindow");
-const wxChar *wxTextCtrlNameStr = _T("text");
-const wxChar *wxVirtListBoxNameStr = _T("virtListBox");
-const wxChar *wxButtonBarNameStr = _T("buttonbar");
-const wxChar *wxEnhDialogNameStr = _T("Shell");
-const wxChar *wxToolBarNameStr = _T("toolbar");
-const wxChar *wxStatusLineNameStr = _T("status_line");
-const wxChar *wxEmptyString = _T("");
-const wxChar *wxGetTextFromUserPromptStr = _T("Input Text");
-const wxChar *wxMessageBoxCaptionStr = _T("Message");
-const wxChar *wxFileSelectorPromptStr = _T("Select a file");
-const wxChar *wxFileSelectorDefaultWildcardStr = _T("*");
-const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error");
-const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error");
-const wxChar *wxDirDialogNameStr = _T("wxDirCtrl");
-const wxChar *wxDirDialogDefaultFolderStr = _T("/");
+const wxChar *wxButtonNameStr = T("button");
+const wxChar *wxCanvasNameStr = T("canvas");
+const wxChar *wxCheckBoxNameStr = T("check");
+const wxChar *wxChoiceNameStr = T("choice");
+const wxChar *wxComboBoxNameStr = T("comboBox");
+const wxChar *wxDialogNameStr = T("dialog");
+const wxChar *wxFrameNameStr = T("frame");
+const wxChar *wxGaugeNameStr = T("gauge");
+const wxChar *wxStaticBoxNameStr = T("groupBox");
+const wxChar *wxListBoxNameStr = T("listBox");
+const wxChar *wxStaticTextNameStr = T("message");
+const wxChar *wxStaticBitmapNameStr = T("message");
+const wxChar *wxMultiTextNameStr = T("multitext");
+const wxChar *wxPanelNameStr = T("panel");
+const wxChar *wxRadioBoxNameStr = T("radioBox");
+const wxChar *wxRadioButtonNameStr = T("radioButton");
+const wxChar *wxBitmapRadioButtonNameStr = T("radioButton");
+const wxChar *wxScrollBarNameStr = T("scrollBar");
+const wxChar *wxSliderNameStr = T("slider");
+const wxChar *wxStaticNameStr = T("static");
+const wxChar *wxTextCtrlWindowNameStr = T("textWindow");
+const wxChar *wxTextCtrlNameStr = T("text");
+const wxChar *wxVirtListBoxNameStr = T("virtListBox");
+const wxChar *wxButtonBarNameStr = T("buttonbar");
+const wxChar *wxEnhDialogNameStr = T("Shell");
+const wxChar *wxToolBarNameStr = T("toolbar");
+const wxChar *wxStatusLineNameStr = T("status_line");
+const wxChar *wxGetTextFromUserPromptStr = T("Input Text");
+const wxChar *wxMessageBoxCaptionStr = T("Message");
+const wxChar *wxFileSelectorPromptStr = T("Select a file");
+const wxChar *wxFileSelectorDefaultWildcardStr = T("*");
+const wxChar *wxInternalErrorStr = T("wxWindows Internal Error");
+const wxChar *wxFatalErrorStr = T("wxWindows Fatal Error");
+const wxChar *wxDirDialogNameStr = T("wxDirCtrl");
+const wxChar *wxDirDialogDefaultFolderStr = T("/");
/* See wx/utils.h */
-const wxChar *wxFloatToStringStr = _T("%.2f");
-const wxChar *wxDoubleToStringStr = _T("%.2f");
+const wxChar *wxFloatToStringStr = T("%.2f");
+const wxChar *wxDoubleToStringStr = T("%.2f");
/* Dafaults for wxWindow etc. */
const wxSize wxDefaultSize(-1, -1);
m_type = wxDF_PRIVATE;
m_id = gdk_atom_name( m_atom );
- if (m_id == _T("file:ALL"))
+ if (m_id == T("file:ALL"))
{
m_type = wxDF_FILENAME;
}
if (m_type == wxDF_TEXT)
{
- m_id = _T("STRING");
+ m_id = T("STRING");
}
else
if (m_type == wxDF_BITMAP)
{
- m_id = _T("image/png");
+ m_id = T("image/png");
}
else
if (m_type == wxDF_FILENAME)
{
- m_id = _T("file:ALL");
+ m_id = T("file:ALL");
}
else
{
- wxFAIL_MSG( _T("invalid dataformat") );
+ wxFAIL_MSG( T("invalid dataformat") );
}
m_hasAtom = FALSE;
else
if (m_type == wxDF_PRIVATE)
{
- m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE );
+ m_atom = gdk_atom_intern( wxMBSTRINGCAST m_id.mbc_str(), FALSE );
}
else
if (m_type == wxDF_FILENAME)
wxPrivateDataObject::wxPrivateDataObject()
{
- wxString id = _T("application/");
+ wxString id = T("application/");
id += wxTheApp->GetAppName();
m_format.SetId( id );
m_isMemDC = FALSE;
m_font = window->GetFont();
- wxASSERT_MSG( window, _T("DC needs a window") );
+ wxASSERT_MSG( window, T("DC needs a window") );
GtkWidget *widget = window->m_wxwindow;
- wxASSERT_MSG( widget, _T("DC needs a widget") );
+ wxASSERT_MSG( widget, T("DC needs a widget") );
m_window = widget->window;
void wxWindowDC::DoFloodFill( long WXUNUSED(x), long WXUNUSED(y),
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
{
- wxFAIL_MSG( _T("wxWindowDC::DoFloodFill not implemented") );
+ wxFAIL_MSG( T("wxWindowDC::DoFloodFill not implemented") );
}
bool wxWindowDC::DoGetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{
- wxFAIL_MSG( _T("wxWindowDC::DoGetPixel not implemented") );
+ wxFAIL_MSG( T("wxWindowDC::DoGetPixel not implemented") );
return FALSE;
}
void wxWindowDC::DoDrawLine( long x1, long y1, long x2, long y2 )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
void wxWindowDC::DoCrossHair( long x, long y )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
void wxWindowDC::DoDrawArc( long x1, long y1, long x2, long y2,
long xc, long yc )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
long xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1);
void wxWindowDC::DoDrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
void wxWindowDC::DoDrawPoint( long x, long y )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if ((m_pen.GetStyle() != wxTRANSPARENT) && m_window)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
void wxWindowDC::DoDrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return;
if (n <= 0) return;
void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (n <= 0) return;
void wxWindowDC::DoDrawRectangle( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
void wxWindowDC::DoDrawRoundedRectangle( long x, long y, long width, long height, double radius )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
void wxWindowDC::DoDrawEllipse( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long x, long y,
bool useMask )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
- wxCHECK_RET( bitmap.Ok(), _T("invalid bitmap") );
+ wxCHECK_RET( bitmap.Ok(), T("invalid bitmap") );
/* scale/translate size and position */
of the source dc, but scales correctly on the target dc and
knows about possible mask information in a memory dc. */
- wxCHECK_MSG( Ok(), FALSE, _T("invalid window dc") );
+ wxCHECK_MSG( Ok(), FALSE, T("invalid window dc") );
- wxCHECK_MSG( source, FALSE, _T("invalid source dc") );
+ wxCHECK_MSG( source, FALSE, T("invalid source dc") );
if (!m_window) return FALSE;
void wxWindowDC::DoDrawText( const wxString &text, long x, long y )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (!m_window) return;
void wxWindowDC::Clear()
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (!m_window) return;
void wxWindowDC::SetPen( const wxPen &pen )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_pen == pen) return;
void wxWindowDC::SetBrush( const wxBrush &brush )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_brush == brush) return;
/* CMB 21/7/98: Added SetBackground. Sets background brush
* for Clear() and bg colour for shapes filled with cross-hatch brush */
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_backgroundBrush == brush) return;
void wxWindowDC::SetLogicalFunction( int function )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_logicalFunction == function) return;
#endif
default:
{
- wxFAIL_MSG( _T("unsupported logical function") );
+ wxFAIL_MSG( T("unsupported logical function") );
break;
}
}
void wxWindowDC::SetTextForeground( const wxColour &col )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_textForegroundColour == col) return;
void wxWindowDC::SetTextBackground( const wxColour &col )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (m_textBackgroundColour == col) return;
void wxWindowDC::SetBackgroundMode( int mode )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
m_backgroundMode = mode;
void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
{
- wxFAIL_MSG( _T("wxWindowDC::SetPalette not implemented") );
+ wxFAIL_MSG( T("wxWindowDC::SetPalette not implemented") );
}
void wxWindowDC::DoSetClippingRegion( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
wxDC::DoSetClippingRegion( x, y, width, height );
void wxWindowDC::DoSetClippingRegionAsRegion( const wxRegion ®ion )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
if (region.Empty())
{
void wxWindowDC::DestroyClippingRegion()
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
wxDC::DestroyClippingRegion();
int wxWindowDC::GetDepth() const
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return -1;
}
void wxWindowDC::DoDrawSpline( wxList *points )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxDialog creation failed") );
+ wxFAIL_MSG( T("wxDialog creation failed") );
return FALSE;
}
void wxDialog::SetTitle( const wxString& title )
{
m_title = title;
- if (m_title.IsNull()) m_title = _T("");
+ if (m_title.IsNull()) m_title = T("");
gtk_window_set_title( GTK_WINDOW(m_widget), m_title.mbc_str() );
}
void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") );
#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
- wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid dialog") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") );
+ wxASSERT_MSG( (m_wxwindow != NULL), T("invalid dialog") );
if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE;
void wxDialog::Centre( int direction )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") );
int x = 0;
int y = 0;
else
if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL;
*/
- wxFAIL_MSG( _T("wxDialog:SetModal obsolete now") );
+ wxFAIL_MSG( T("wxDialog:SetModal obsolete now") );
}
int wxDialog::ShowModal()
{
if (IsModal())
{
- wxFAIL_MSG( _T("wxDialog:ShowModal called twice") );
+ wxFAIL_MSG( T("wxDialog:ShowModal called twice") );
return GetReturnCode();
}
if (!IsModal())
{
- wxFAIL_MSG( _T("wxDialog:EndModal called twice") );
+ wxFAIL_MSG( T("wxDialog:EndModal called twice") );
return;
}
if (!m_dragWidget) return FALSE;
/*
- wxPrintf( _T("format: %s.\n"), format.GetId().c_str() );
- if (format.GetType() == wxDF_PRIVATE) wxPrintf( _T("private data.\n") );
- if (format.GetType() == wxDF_TEXT) wxPrintf( _T("text data.\n") );
+ wxPrintf( T("format: %s.\n"), format.GetId().c_str() );
+ if (format.GetType() == wxDF_PRIVATE) wxPrintf( T("private data.\n") );
+ if (format.GetType() == wxDF_TEXT) wxPrintf( T("text data.\n") );
*/
#if wxUSE_THREADS
void wxDropTarget::UnregisterWidget( GtkWidget *widget )
{
- wxCHECK_RET( widget != NULL, _T("unregister widget is NULL") );
+ wxCHECK_RET( widget != NULL, T("unregister widget is NULL") );
gtk_drag_dest_unset( widget );
void wxDropTarget::RegisterWidget( GtkWidget *widget )
{
- wxCHECK_RET( widget != NULL, _T("register widget is NULL") );
+ wxCHECK_RET( widget != NULL, T("register widget is NULL") );
/* gtk_drag_dest_set() determines what default behaviour we'd like
GTK to supply. we don't want to specify out targets (=formats)
wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) )
{
- wxASSERT_MSG( m_data, _T("wxDragSource: no data") );
+ wxASSERT_MSG( m_data, T("wxDragSource: no data") );
if (!m_data) return (wxDragResult) wxDragNone;
m_needParent = FALSE;
if (!PreCreation( parent, pos, wxDefaultSize ) ||
- !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, _T("filedialog") ))
+ !CreateBase( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, wxDefaultValidator, T("filedialog") ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return;
}
m_message = message;
- m_path = _T("");
+ m_path = T("");
m_fileName = defaultFileName;
m_dir = defaultDir;
m_wildCard = wildCard;
gtk_file_selection_hide_fileop_buttons( sel ); // they don't work anyway
m_path.Append(m_dir);
- if( ! m_path.IsEmpty() && m_path.Last()!=_T('/') )
+ if( ! m_path.IsEmpty() && m_path.Last()!=T('/') )
m_path.Append('/');
m_path.Append(m_fileName);
wxSplitPath(path, &m_dir, &m_fileName, &ext);
if (!ext.IsEmpty())
{
- m_fileName += _T(".");
+ m_fileName += T(".");
m_fileName += ext;
}
}
int x, int y)
{
// TODO: implement this somehow
- return wxFileSelector(message, default_path, default_filename, _T(""),
+ return wxFileSelector(message, default_path, default_filename, T(""),
wildcard, flags, parent, x, y);
}
{
wxString filter2;
if ( defaultExtension && !filter )
- filter2 = wxString(_T("*.")) + wxString(defaultExtension) ;
+ filter2 = wxString(T("*.")) + wxString(defaultExtension) ;
else if ( filter )
filter2 = filter;
wxString str = _("Load %s file");
wxSprintf(prompt, str, what);
- if (*ext == _T('.')) ext++;
+ if (*ext == T('.')) ext++;
wxChar wild[60];
- wxSprintf(wild, _T("*.%s"), ext);
+ wxSprintf(wild, T("*.%s"), ext);
return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
wxString str = _("Save %s file");
wxSprintf(prompt, str, what);
- if (*ext == _T('.')) ext++;
+ if (*ext == T('.')) ext++;
wxChar wild[60];
- wxSprintf(wild, _T("*.%s"), ext);
+ wxSprintf(wild, T("*.%s"), ext);
return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
wxString tmp;
wxString fontname( xFontName );
- wxStringTokenizer tn( fontname, _T("-") );
+ wxStringTokenizer tn( fontname, T("-") );
tn.GetNextToken(); // foundry
M_FONTDATA->m_faceName = tn.GetNextToken(); // courier
tmp = tn.GetNextToken().MakeUpper();
- if (tmp == _T("BOLD")) M_FONTDATA->m_weight = wxBOLD;
+ if (tmp == T("BOLD")) M_FONTDATA->m_weight = wxBOLD;
tmp = tn.GetNextToken().MakeUpper();
- if (tmp == _T("I")) M_FONTDATA->m_style = wxITALIC;
- if (tmp == _T("O")) M_FONTDATA->m_style = wxITALIC;
+ if (tmp == T("I")) M_FONTDATA->m_style = wxITALIC;
+ if (tmp == T("O")) M_FONTDATA->m_style = wxITALIC;
tn.GetNextToken(); // set width
tn.GetNextToken(); // ?
tn.GetNextToken(); // y-res
tmp = tn.GetNextToken().MakeUpper();
- if (tmp == _T("M")) M_FONTDATA->m_family = wxMODERN;
- else if (M_FONTDATA->m_faceName == _T("TIMES")) M_FONTDATA->m_family = wxROMAN;
- else if (M_FONTDATA->m_faceName == _T("HELVETICA")) M_FONTDATA->m_family = wxSWISS;
- else if (M_FONTDATA->m_faceName == _T("LUCIDATYPEWRITER")) M_FONTDATA->m_family = wxTELETYPE;
- else if (M_FONTDATA->m_faceName == _T("LUCIDA")) M_FONTDATA->m_family = wxDECORATIVE;
- else if (M_FONTDATA->m_faceName == _T("UTOPIA")) M_FONTDATA->m_family = wxSCRIPT;
+ if (tmp == T("M")) M_FONTDATA->m_family = wxMODERN;
+ else if (M_FONTDATA->m_faceName == T("TIMES")) M_FONTDATA->m_family = wxROMAN;
+ else if (M_FONTDATA->m_faceName == T("HELVETICA")) M_FONTDATA->m_family = wxSWISS;
+ else if (M_FONTDATA->m_faceName == T("LUCIDATYPEWRITER")) M_FONTDATA->m_family = wxTELETYPE;
+ else if (M_FONTDATA->m_faceName == T("LUCIDA")) M_FONTDATA->m_family = wxDECORATIVE;
+ else if (M_FONTDATA->m_faceName == T("UTOPIA")) M_FONTDATA->m_family = wxSCRIPT;
}
bool wxFont::Create( int pointSize,
int wxFont::GetPointSize() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid font") );
+ wxCHECK_MSG( Ok(), 0, T("invalid font") );
return M_FONTDATA->m_pointSize;
}
wxString wxFont::GetFaceName() const
{
- wxCHECK_MSG( Ok(), _T(""), _T("invalid font") );
+ wxCHECK_MSG( Ok(), T(""), T("invalid font") );
return M_FONTDATA->m_faceName;
}
int wxFont::GetFamily() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid font") );
+ wxCHECK_MSG( Ok(), 0, T("invalid font") );
return M_FONTDATA->m_family;
}
int wxFont::GetStyle() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid font") );
+ wxCHECK_MSG( Ok(), 0, T("invalid font") );
return M_FONTDATA->m_style;
}
int wxFont::GetWeight() const
{
- wxCHECK_MSG( Ok(), 0, _T("invalid font") );
+ wxCHECK_MSG( Ok(), 0, T("invalid font") );
return M_FONTDATA->m_weight;
}
bool wxFont::GetUnderlined() const
{
- wxCHECK_MSG( Ok(), FALSE, _T("invalid font") );
+ wxCHECK_MSG( Ok(), FALSE, T("invalid font") );
return M_FONTDATA->m_underlined;
}
wxFontEncoding wxFont::GetEncoding() const
{
- wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, _T("invalid font") );
+ wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, T("invalid font") );
return M_FONTDATA->m_encoding;
}
{
if (!Ok())
{
- wxFAIL_MSG( _T("invalid font") );
+ wxFAIL_MSG( T("invalid font") );
return (GdkFont*) NULL;
}
if (!font)
{
- wxLogError(_T("could not load any font"));
+ wxLogError(T("could not load any font"));
}
return font;
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
!CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE,
- wxDefaultValidator, _T("fontdialog") ))
+ wxDefaultValidator, T("fontdialog") ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return;
}
#ifndef __WXGTK12__
- wxFAIL_MSG( _T("TODO") );
+ wxFAIL_MSG( T("TODO") );
#else // GTK+ 1.2
wxString m_message( _("Choose font") );
m_widget = gtk_font_selection_dialog_new( m_message.mbc_str() );
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxFrame creation failed") );
+ wxFAIL_MSG( T("wxFrame creation failed") );
return FALSE;
}
gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() );
#ifdef __WXDEBUG__
- debug_focus_in( m_widget, _T("wxFrame::m_widget"), name );
+ debug_focus_in( m_widget, T("wxFrame::m_widget"), name );
#endif
gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
gtk_container_add( GTK_CONTAINER(m_widget), m_mainWidget );
#ifdef __WXDEBUG__
- debug_focus_in( m_mainWidget, _T("wxFrame::m_mainWidget"), name );
+ debug_focus_in( m_mainWidget, T("wxFrame::m_mainWidget"), name );
#endif
/* m_wxwindow only represents the client area without toolbar and menubar */
gtk_container_add( GTK_CONTAINER(m_mainWidget), m_wxwindow );
#ifdef __WXDEBUG__
- debug_focus_in( m_wxwindow, _T("wxFrame::m_wxwindow"), name );
+ debug_focus_in( m_wxwindow, T("wxFrame::m_wxwindow"), name );
#endif
/* we donm't allow the frame to get the focus as otherwise
bool wxFrame::Show( bool show )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
if (show && !m_sizeSet)
{
bool wxFrame::Destroy()
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
/* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
- wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") );
/* avoid recursions */
if (m_resizing) return;
void wxFrame::Centre( int direction )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
int x = 0;
int y = 0;
void wxFrame::DoGetClientSize( int *width, int *height ) const
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
wxWindow::DoGetClientSize( width, height );
if (height)
void wxFrame::DoSetClientSize( int width, int height )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
/* menu bar */
if (m_frameMenuBar)
m_resizing = TRUE;
/* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
- wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") );
m_width = width;
m_height = height;
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
#if wxUSE_CONSTRAINTS
if (GetAutoLayout())
void wxFrame::SetMenuBar( wxMenuBar *menuBar )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
+ wxASSERT_MSG( (m_wxwindow != NULL), T("invalid frame") );
m_frameMenuBar = menuBar;
#if wxUSE_TOOLBAR
wxToolBar* wxFrame::CreateToolBar( long style, wxWindowID id, const wxString& name )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
- wxCHECK_MSG( m_frameToolBar == NULL, FALSE, _T("recreating toolbar in wxFrame") );
+ wxCHECK_MSG( m_frameToolBar == NULL, FALSE, T("recreating toolbar in wxFrame") );
m_insertInClientArea = FALSE;
#if wxUSE_STATUSBAR
wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, const wxString& name )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
- wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, _T("recreating status bar in wxFrame") );
+ wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, T("recreating status bar in wxFrame") );
m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
void wxFrame::SetStatusText(const wxString& text, int number)
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
- wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set text for") );
+ wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set text for") );
m_frameStatusBar->SetStatusText(text, number);
}
void wxFrame::SetStatusWidths(int n, const int widths_field[] )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
- wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set widths for") );
+ wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set widths for") );
m_frameStatusBar->SetStatusWidths(n, widths_field);
}
void wxFrame::SetTitle( const wxString &title )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
m_title = title;
- if (m_title.IsNull()) m_title = _T("");
+ if (m_title.IsNull()) m_title = T("");
gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
}
void wxFrame::SetIcon( const wxIcon &icon )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid frame") );
m_icon = icon;
if (!icon.Ok()) return;
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxGauge creation failed") );
+ wxFAIL_MSG( T("wxGauge creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxListBox creation failed") );
+ wxFAIL_MSG( T("wxListBox creation failed") );
return FALSE;
}
void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
GList *children = m_list->children;
int length = g_list_length(children);
- wxCHECK_RET( pos <= length, _T("invalid index in wxListBox::InsertItems") );
+ wxCHECK_RET( pos <= length, T("invalid index in wxListBox::InsertItems") );
// VZ: it seems that GTK 1.0.6 doesn't has a function to insert an item
// into a listbox at the given position, this is why we first delete
void wxListBox::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
GtkWidget *list_item;
void wxListBox::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxListBox::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, NULL, T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxListBox::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxListBox::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxListBox::Clear()
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
gtk_list_clear_items( m_list, 0, Number() );
void wxListBox::Delete( int n )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
- wxCHECK_RET( child, _T("wrong listbox index") );
+ wxCHECK_RET( child, T("wrong listbox index") );
GList *list = g_list_append( (GList*) NULL, child->data );
gtk_list_remove_items( m_list, list );
void wxListBox::Deselect( int n )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
DisableEvents();
int wxListBox::FindString( const wxString &item ) const
{
- wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelection() const
{
- wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelections( wxArrayInt& aSelections ) const
{
- wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
// get the number of selected items first
GList *child = m_list->children;
wxString wxListBox::GetString( int n ) const
{
- wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
return str;
}
- wxFAIL_MSG(_T("wrong listbox index"));
+ wxFAIL_MSG(T("wrong listbox index"));
- return _T("");
+ return T("");
}
wxString wxListBox::GetStringSelection() const
{
- wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, T(""), T("invalid listbox") );
GList *selection = m_list->selection;
if (selection)
return str;
}
- wxFAIL_MSG(_T("no listbox selection available"));
- return _T("");
+ wxFAIL_MSG(T("no listbox selection available"));
+ return T("");
}
int wxListBox::Number()
{
- wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, -1, T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
bool wxListBox::Selected( int n )
{
- wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid listbox") );
+ wxCHECK_MSG( m_list != NULL, FALSE, T("invalid listbox") );
GList *target = g_list_nth( m_list->children, n );
if (target)
child = child->next;
}
}
- wxFAIL_MSG(_T("wrong listbox index"));
+ wxFAIL_MSG(T("wrong listbox index"));
return FALSE;
}
void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
{
- wxFAIL_MSG(_T("wxListBox::Set not implemented"));
+ wxFAIL_MSG(T("wxListBox::Set not implemented"));
}
void wxListBox::SetFirstItem( int WXUNUSED(n) )
{
- wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
+ wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
{
- wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
+ wxFAIL_MSG(T("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetSelection( int n, bool select )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
DisableEvents();
void wxListBox::SetString( int n, const wxString &string )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
}
else
{
- wxFAIL_MSG(_T("wrong listbox index"));
+ wxFAIL_MSG(T("wrong listbox index"));
}
}
void wxListBox::SetStringSelection( const wxString &string, bool select )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
SetSelection( FindString(string), select );
}
#if wxUSE_DRAG_AND_DROP
void wxListBox::SetDropTarget( wxDropTarget *dropTarget )
{
- wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
+ wxCHECK_RET( m_list != NULL, T("invalid listbox") );
#ifndef NEW_GTK_DND_CODE
if (m_dropTarget)
void wxMDIChildFrame::SetMenuBar( wxMenuBar *menu_bar )
{
- wxASSERT_MSG( m_menuBar == NULL, _T("Only one menubar allowed") );
+ wxASSERT_MSG( m_menuBar == NULL, T("Only one menubar allowed") );
m_menuBar = menu_bar;
m_insertCallback = (wxInsertChildFunction)wxInsertChildInMDI;
if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) ||
- !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("wxMDIClientWindow") ))
+ !CreateBase( parent, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, T("wxMDIClientWindow") ))
{
- wxFAIL_MSG( _T("wxMDIClientWindow creation failed") );
+ wxFAIL_MSG( T("wxMDIClientWindow creation failed") );
return FALSE;
}
m_invokingWindow = (wxWindow*) NULL;
if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
- !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, _T("menubar") ))
+ !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, T("menubar") ))
{
- wxFAIL_MSG( _T("wxMenuBar creation failed") );
+ wxFAIL_MSG( T("wxMenuBar creation failed") );
return;
}
m_invokingWindow = (wxWindow*) NULL;
if (!PreCreation( (wxWindow*) NULL, wxDefaultPosition, wxDefaultSize ) ||
- !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("menubar") ))
+ !CreateBase( (wxWindow*) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, T("menubar") ))
{
- wxFAIL_MSG( _T("wxMenuBar creation failed") );
+ wxFAIL_MSG( T("wxMenuBar creation failed") );
return;
}
/* GTK 1.2 wants to have "_" instead of "&" for accelerators */
wxString str;
- for ( pc = title; *pc != _T('\0'); pc++ )
+ for ( pc = title; *pc != T('\0'); pc++ )
{
- if (*pc == _T('&'))
+ if (*pc == T('&'))
{
#if (GTK_MINOR_VERSION > 0) && (GTK_MICRO_VERSION > 0)
- str << _T('_');
+ str << T('_');
}
- else if (*pc == _T('/'))
+ else if (*pc == T('/'))
{
- str << _T('\\');
+ str << T('\\');
#endif
}
else
{
#if __WXGTK12__
- if ( *pc == _T('_') )
+ if ( *pc == T('_') )
{
// underscores must be doubled to prevent them from being
// interpreted as accelerator character prefix by GTK
/* local buffer in multibyte form */
wxString buf;
- buf << _T('/') << str.c_str();
+ buf << T('/') << str.c_str();
char *cbuf = new char[buf.Length()+1];
strcpy(cbuf, buf.mbc_str());
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
/* in order to get the pointer to the item we need the item text _without_ underscores */
- wxString tmp = _T("<main>/");
- for ( pc = str; *pc != _T('\0'); pc++ )
+ wxString tmp = T("<main>/");
+ for ( pc = str; *pc != T('\0'); pc++ )
{
// contrary to the common sense, we must throw out _all_ underscores,
// (i.e. "Hello__World" => "HelloWorld" and not "Hello_World" as we
// might naively think). IMHO it's a bug in GTK+ (VZ)
- while (*pc == _T('_'))
+ while (*pc == T('_'))
pc++;
tmp << *pc;
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, _T("wxMenuBar::Check: no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::Check: no such item") );
item->Check(check);
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked: no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsChecked: no such item") );
return item->IsChecked();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, _T("wxMenuBar::Enable: no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::Enable: no such item") );
item->Enable(enable);
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled: no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsEnabled: no such item") );
return item->IsEnabled();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetLabel: no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenuBar::GetLabel: no such item") );
return item->GetText();
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, _T("wxMenuBar::SetLabel: no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::SetLabel: no such item") );
item->SetText( label );
}
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_RET( node, _T("menu not found") );
+ wxCHECK_RET( node, T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_MSG( node, _T("invalid"), _T("menu not found") );
+ wxCHECK_MSG( node, T("invalid"), T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxNode *node = m_menus.Nth( pos );
- wxCHECK_RET( node, _T("menu not found") );
+ wxCHECK_RET( node, T("menu not found") );
wxMenu* menu = (wxMenu*)node->Data();
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_RET( item, _T("wxMenuBar::SetHelpString: no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::SetHelpString: no such item") );
item->SetHelp( helpString );
}
{
wxMenuItem* item = FindMenuItemById( id );
- wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetHelpString: no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenuBar::GetHelpString: no such item") );
return item->GetHelp();
}
return;
wxMenuItem* item = menu->FindItem( id );
- wxCHECK_RET( item, _T("error in menu item callback") );
+ wxCHECK_RET( item, T("error in menu item callback") );
if (item->IsCheckable())
{
void wxMenuItem::SetName( const wxString& str )
{
/* '\t' is the deliminator indicating a hot key */
- m_text = _T("");
+ m_text = T("");
const wxChar *pc = str;
- for (; (*pc != _T('\0')) && (*pc != _T('\t')); pc++ )
+ for (; (*pc != T('\0')) && (*pc != T('\t')); pc++ )
{
- if (*pc == _T('&'))
+ if (*pc == T('&'))
{
#if (GTK_MINOR_VERSION > 0)
- m_text << _T('_');
+ m_text << T('_');
}
- else if ( *pc == _T('_') ) // escape underscores
+ else if ( *pc == T('_') ) // escape underscores
{
- m_text << _T("__");
+ m_text << T("__");
}
- else if (*pc == _T('/')) /* we have to filter out slashes ... */
+ else if (*pc == T('/')) /* we have to filter out slashes ... */
{
- m_text << _T('\\'); /* ... and replace them with back slashes */
+ m_text << T('\\'); /* ... and replace them with back slashes */
#endif
}
else
}
/* only GTK 1.2 knows about hot keys */
- m_hotKey = _T("");
+ m_hotKey = T("");
#if (GTK_MINOR_VERSION > 0)
- if(*pc == _T('\t'))
+ if(*pc == T('\t'))
{
pc++;
m_hotKey = pc;
void wxMenuItem::Check( bool check )
{
- wxCHECK_RET( m_menuItem, _T("invalid menu item") );
+ wxCHECK_RET( m_menuItem, T("invalid menu item") );
- wxCHECK_RET( IsCheckable(), _T("Can't check uncheckable item!") )
+ wxCHECK_RET( IsCheckable(), T("Can't check uncheckable item!") )
if (check == m_isChecked) return;
void wxMenuItem::Enable( bool enable )
{
- wxCHECK_RET( m_menuItem, _T("invalid menu item") );
+ wxCHECK_RET( m_menuItem, T("invalid menu item") );
gtk_widget_set_sensitive( m_menuItem, enable );
m_isEnabled = enable;
bool wxMenuItem::IsChecked() const
{
- wxCHECK_MSG( m_menuItem, FALSE, _T("invalid menu item") );
+ wxCHECK_MSG( m_menuItem, FALSE, T("invalid menu item") );
wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item!
m_eventHandler = this;
m_clientData = (void*) NULL;
- if (m_title.IsNull()) m_title = _T("");
- if (m_title != _T(""))
+ if (m_title.IsNull()) m_title = T("");
+ if (m_title != T(""))
{
Append(-2, m_title);
AppendSeparator();
switch (hotkey[0])
{
- case _T('a'): /* Alt */
- case _T('A'):
- case _T('m'): /* Meta */
- case _T('M'):
+ case T('a'): /* Alt */
+ case T('A'):
+ case T('m'): /* Meta */
+ case T('M'):
{
strcpy( hotbuf, "<alt>" );
wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() );
return hotbuf;
}
- case _T('c'): /* Ctrl */
- case _T('C'):
- case _T('s'): /* Strg, yeah man, I'm German */
- case _T('S'):
+ case T('c'): /* Ctrl */
+ case T('C'):
+ case T('s'): /* Strg, yeah man, I'm German */
+ case T('S'):
{
strcpy( hotbuf, "<control>" );
wxString last = hotkey.Right(1);
strcat( hotbuf, last.mb_str() );
return hotbuf;
}
- case _T('F'): /* function keys */
+ case T('F'): /* function keys */
{
strcpy( hotbuf, hotkey.mb_str() );
return hotbuf;
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
/* in order to get the pointer to the item we need the item text _without_ underscores */
- wxString s = _T("<main>/");
- for ( const wxChar *pc = text; *pc != _T('\0'); pc++ )
+ wxString s = T("<main>/");
+ for ( const wxChar *pc = text; *pc != T('\0'); pc++ )
{
- while (*pc == _T('_')) pc++; /* skip it */
+ while (*pc == T('_')) pc++; /* skip it */
s << *pc;
}
gtk_item_factory_create_item( m_factory, &entry, (gpointer) this, 2 ); /* what is 2 ? */
/* in order to get the pointer to the item we need the item text _without_ underscores */
- wxString s = _T("<main>/");
- for ( const wxChar *pc = text; *pc != _T('\0'); pc++ )
+ wxString s = T("<main>/");
+ for ( const wxChar *pc = text; *pc != T('\0'); pc++ )
{
- if (*pc == _T('_')) pc++; /* skip it */
+ if (*pc == T('_')) pc++; /* skip it */
s << *pc;
}
int wxMenu::FindItem( const wxString itemString ) const
{
- wxString s = _T("");
- for ( const wxChar *pc = itemString; *pc != _T('\0'); pc++ )
+ wxString s = T("");
+ for ( const wxChar *pc = itemString; *pc != T('\0'); pc++ )
{
- if (*pc == _T('&'))
+ if (*pc == T('&'))
{
pc++; /* skip it */
#if (GTK_MINOR_VERSION > 0)
- s << _T('_');
+ s << T('_');
#endif
}
s << *pc;
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, _T("wxMenu::Enable: no such item") );
+ wxCHECK_RET( item, T("wxMenu::Enable: no such item") );
item->Enable(enable);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, FALSE, _T("wxMenu::IsEnabled: no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenu::IsEnabled: no such item") );
return item->IsEnabled();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, _T("wxMenu::Check: no such item") );
+ wxCHECK_RET( item, T("wxMenu::Check: no such item") );
item->Check(enable);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, FALSE, _T("wxMenu::IsChecked: no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenu::IsChecked: no such item") );
return item->IsChecked();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") );
+ wxCHECK_RET( item, T("wxMenu::SetLabel: no such item") );
item->SetText(label);
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, _T(""), _T("wxMenu::GetLabel: no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenu::GetLabel: no such item") );
return item->GetText();
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_RET( item, _T("wxMenu::SetHelpString: no such item") );
+ wxCHECK_RET( item, T("wxMenu::SetHelpString: no such item") );
item->SetHelp( helpString );
}
{
wxMenuItem *item = FindItem(id);
- wxCHECK_MSG( item, _T(""), _T("wxMenu::GetHelpString: no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenu::GetHelpString: no such item") );
return item->GetHelp();
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxNoteBook creation failed") );
+ wxFAIL_MSG( T("wxNoteBook creation failed") );
return FALSE;
}
m_widget = gtk_notebook_new();
#ifdef __WXDEBUG__
- debug_focus_in( m_widget, _T("wxNotebook::m_widget"), name );
+ debug_focus_in( m_widget, T("wxNotebook::m_widget"), name );
#endif
gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
int wxNotebook::GetSelection() const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") );
GList *pages = GTK_NOTEBOOK(m_widget)->children;
wxString wxNotebook::GetPageText( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (nb_page)
return nb_page->m_text;
else
- return _T("");
+ return T("");
}
int wxNotebook::GetPageImage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (nb_page)
wxNotebookPage* wxNotebook::GetNotebookPage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*) NULL, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, (wxNotebookPage*) NULL, T("invalid notebook") );
- wxCHECK_MSG( page < (int)m_pages.GetCount(), (wxNotebookPage*) NULL, _T("invalid notebook index") );
+ wxCHECK_MSG( page < (int)m_pages.GetCount(), (wxNotebookPage*) NULL, T("invalid notebook index") );
wxNode *node = m_pages.Nth( page );
int wxNotebook::SetSelection( int page )
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid notebook") );
- wxCHECK_MSG( page < (int)m_pages.GetCount(), -1, _T("invalid notebook index") );
+ wxCHECK_MSG( page < (int)m_pages.GetCount(), -1, T("invalid notebook index") );
int selOld = GetSelection();
void wxNotebook::AdvanceSelection( bool forward )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid notebook") );
+ wxCHECK_RET( m_widget != NULL, T("invalid notebook") );
int sel = GetSelection();
int max = GetPageCount();
bool wxNotebook::SetPageText( int page, const wxString &text )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
- wxCHECK_MSG( nb_page, FALSE, _T("SetPageText: invalid page index") );
+ wxCHECK_MSG( nb_page, FALSE, T("SetPageText: invalid page index") );
nb_page->m_text = text;
void wxNotebook::SetPageSize( const wxSize &WXUNUSED(size) )
{
- wxFAIL_MSG( _T("wxNotebook::SetPageSize not implemented") );
+ wxFAIL_MSG( T("wxNotebook::SetPageSize not implemented") );
}
void wxNotebook::SetPadding( const wxSize &WXUNUSED(padding) )
{
- wxFAIL_MSG( _T("wxNotebook::SetPadding not implemented") );
+ wxFAIL_MSG( T("wxNotebook::SetPadding not implemented") );
}
void wxNotebook::SetTabSize(const wxSize& WXUNUSED(sz))
{
- wxFAIL_MSG( _T("wxNotebook::SetTabSize not implemented") );
+ wxFAIL_MSG( T("wxNotebook::SetTabSize not implemented") );
}
bool wxNotebook::DeleteAllPages()
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") );
while (m_pages.GetCount() > 0)
DeletePage( m_pages.GetCount()-1 );
bool wxNotebook::InsertPage( int position, wxWindow* win, const wxString& text,
bool select, int imageId )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid notebook") );
wxCHECK_MSG( win->GetParent() == this, FALSE,
- _T("Can't add a page whose parent is not the notebook!") );
+ T("Can't add a page whose parent is not the notebook!") );
/* don't receive switch page during addition */
gtk_signal_disconnect_by_func( GTK_OBJECT(m_widget),
/* set the label text */
page->m_text = text;
- if (page->m_text.IsEmpty()) page->m_text = _T("");
+ if (page->m_text.IsEmpty()) page->m_text = T("");
page->m_label = GTK_LABEL( gtk_label_new(page->m_text.mbc_str()) );
gtk_box_pack_end( GTK_BOX(page->m_box), GTK_WIDGET(page->m_label), FALSE, FALSE, 3 );
wxWindow *wxNotebook::GetPage( int page ) const
{
- wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, _T("invalid notebook") );
+ wxCHECK_MSG( m_widget != NULL, (wxWindow*) NULL, T("invalid notebook") );
wxNotebookPage* nb_page = GetNotebookPage(page);
if (!nb_page)
const unsigned char *WXUNUSED(green),
const unsigned char *WXUNUSED(blue) )
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return FALSE;
}
const unsigned char WXUNUSED(green),
const unsigned char WXUNUSED(blue) ) const
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return 0;
}
unsigned char *WXUNUSED(green),
unsigned char *WXUNUSED(blue) ) const
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
return 0;
}
int wxPen::GetCap() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), -1, T("invalid pen") );
return M_PENDATA->m_capStyle;
}
int wxPen::GetJoin() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), -1, T("invalid pen") );
return M_PENDATA->m_joinStyle;
}
int wxPen::GetStyle() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), -1, T("invalid pen") );
return M_PENDATA->m_style;
}
int wxPen::GetWidth() const
{
- wxCHECK_MSG( Ok(), -1, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), -1, T("invalid pen") );
return M_PENDATA->m_width;
}
wxColour &wxPen::GetColour() const
{
- wxCHECK_MSG( Ok(), wxNullColour, _T("invalid pen") );
+ wxCHECK_MSG( Ok(), wxNullColour, T("invalid pen") );
return M_PENDATA->m_colour;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxRadioBox creation failed") );
+ wxFAIL_MSG( T("wxRadioBox creation failed") );
return FALSE;
}
label.Empty();
for ( const wxChar *pc = choices[i]; *pc; pc++ )
{
- if ( *pc != _T('&') )
+ if ( *pc != T('&') )
label += *pc;
}
if ( m_majorDim == 0 )
{
// avoid dividing by 0 below
- wxFAIL_MSG( _T("dimension of radiobox should not be 0!") );
+ wxFAIL_MSG( T("dimension of radiobox should not be 0!") );
m_majorDim = 1;
}
bool wxRadioBox::Show( bool show )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobox") );
wxWindow::Show( show );
int wxRadioBox::FindString( const wxString &s ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid radiobox") );
int count = 0;
void wxRadioBox::SetFocus()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
if (m_boxes.GetCount() == 0) return;
void wxRadioBox::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxNode *node = m_boxes.Nth( n );
- wxCHECK_RET( node, _T("radiobox wrong index") );
+ wxCHECK_RET( node, T("radiobox wrong index") );
GtkToggleButton *button = GTK_TOGGLE_BUTTON( node->Data() );
int wxRadioBox::GetSelection(void) const
{
- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, -1, T("invalid radiobox") );
int count = 0;
node = node->Next();
}
- wxFAIL_MSG( _T("wxRadioBox none selected") );
+ wxFAIL_MSG( T("wxRadioBox none selected") );
return -1;
}
wxString wxRadioBox::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") );
wxNode *node = m_boxes.Nth( n );
- wxCHECK_MSG( node, _T(""), _T("radiobox wrong index") );
+ wxCHECK_MSG( node, T(""), T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *label = GTK_LABEL( button->child );
wxString wxRadioBox::GetLabel( int item ) const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") );
return GetString( item );
}
void wxRadioBox::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxControl::SetLabel( label );
void wxRadioBox::SetLabel( int item, const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, _T("radiobox wrong index") );
+ wxCHECK_RET( node, T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *g_label = GTK_LABEL( button->child );
void wxRadioBox::SetLabel( int WXUNUSED(item), wxBitmap *WXUNUSED(bitmap) )
{
- wxFAIL_MSG(_T("wxRadioBox::SetLabel not implemented."));
+ wxFAIL_MSG(T("wxRadioBox::SetLabel not implemented."));
}
bool wxRadioBox::Enable( bool enable )
void wxRadioBox::Enable( int item, bool enable )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, _T("radiobox wrong index") );
+ wxCHECK_RET( node, T("radiobox wrong index") );
GtkButton *button = GTK_BUTTON( node->Data() );
GtkWidget *label = button->child;
void wxRadioBox::Show( int item, bool show )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobox") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobox") );
wxNode *node = m_boxes.Nth( item );
- wxCHECK_RET( node, _T("radiobox wrong index") );
+ wxCHECK_RET( node, T("radiobox wrong index") );
GtkWidget *button = GTK_WIDGET( node->Data() );
wxString wxRadioBox::GetStringSelection() const
{
- wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, T(""), T("invalid radiobox") );
wxNode *node = m_boxes.First();
while (node)
node = node->Next();
}
- wxFAIL_MSG( _T("wxRadioBox none selected") );
- return _T("");
+ wxFAIL_MSG( T("wxRadioBox none selected") );
+ return T("");
}
bool wxRadioBox::SetStringSelection( const wxString &s )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobox") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobox") );
int res = FindString( s );
if (res == -1) return FALSE;
void wxRadioBox::SetNumberOfRowsOrCols( int WXUNUSED(n) )
{
- wxFAIL_MSG(_T("wxRadioBox::SetNumberOfRowsOrCols not implemented."));
+ wxFAIL_MSG(T("wxRadioBox::SetNumberOfRowsOrCols not implemented."));
}
void wxRadioBox::DisableEvents()
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxRadioButton creation failed") );
+ wxFAIL_MSG( T("wxRadioButton creation failed") );
return FALSE;
}
void wxRadioButton::SetLabel( const wxString& label )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobutton") );
wxControl::SetLabel( label );
GtkButton *bin = GTK_BUTTON( m_widget );
void wxRadioButton::SetValue( bool val )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid radiobutton") );
+ wxCHECK_RET( m_widget != NULL, T("invalid radiobutton") );
if (val == GetValue())
return;
bool wxRadioButton::GetValue() const
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid radiobutton") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid radiobutton") );
return GTK_TOGGLE_BUTTON(m_widget)->active;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxScrollBar creation failed") );
+ wxFAIL_MSG( T("wxScrollBar creation failed") );
return FALSE;
}
case wxSYS_VSCROLL_X: return 15;
}
- wxCHECK_MSG( index, 0, _T("wxSystemSettings::GetSystemMetric not fully implemented") );
+ wxCHECK_MSG( index, 0, T("wxSystemSettings::GetSystemMetric not fully implemented") );
return 0;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxSlider creation failed") );
+ wxFAIL_MSG( T("wxSlider creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, new_size ) ||
!CreateBase( parent, id, pos, new_size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return FALSE;
}
int wxSpinButton::GetMin() const
{
- wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") );
+ wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") );
return (int)ceil(m_adjust->lower);
}
int wxSpinButton::GetMax() const
{
- wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") );
+ wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") );
return (int)ceil(m_adjust->upper);
}
int wxSpinButton::GetValue() const
{
- wxCHECK_MSG( (m_widget != NULL), 0, _T("invalid spin button") );
+ wxCHECK_MSG( (m_widget != NULL), 0, T("invalid spin button") );
return (int)ceil(m_adjust->value);
}
void wxSpinButton::SetValue( int value )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid spin button") );
float fpos = (float)value;
m_oldPos = fpos;
void wxSpinButton::SetRange(int minVal, int maxVal)
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid spin button") );
float fmin = (float)minVal;
float fmax = (float)maxVal;
void wxSpinButton::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid spin button") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid spin button") );
m_width = 15;
gtk_widget_set_usize( m_widget, m_width, m_height );
void wxStaticBitmap::CreatePixmapWidget()
{
- wxCHECK_RET( m_bitmap.Ok(), _T("should only be called if we have a bitmap") );
+ wxCHECK_RET( m_bitmap.Ok(), T("should only be called if we have a bitmap") );
GdkBitmap *mask = (GdkBitmap *) NULL;
if ( m_bitmap.GetMask() )
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxStaticBox creation failed") );
+ wxFAIL_MSG( T("wxStaticBox creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxStaticLine creation failed") );
+ wxFAIL_MSG( T("wxStaticLine creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxXX creation failed") );
+ wxFAIL_MSG( T("wxXX creation failed") );
return FALSE;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxToolBar creation failed") );
+ wxFAIL_MSG( T("wxToolBar creation failed") );
return FALSE;
}
m_hasToolAlready = TRUE;
wxCHECK_MSG( bitmap.Ok(), (wxToolBarTool *)NULL,
- _T("invalid bitmap for wxToolBar icon") );
+ T("invalid bitmap for wxToolBar icon") );
wxCHECK_MSG( bitmap.GetBitmap() == NULL, (wxToolBarTool *)NULL,
- _T("wxToolBar doesn't support GdkBitmap") );
+ T("wxToolBar doesn't support GdkBitmap") );
wxCHECK_MSG( bitmap.GetPixmap() != NULL, (wxToolBarTool *)NULL,
- _T("wxToolBar::Add needs a wxBitmap") );
+ T("wxToolBar::Add needs a wxBitmap") );
GtkWidget *tool_pixmap = (GtkWidget *)NULL;
void wxToolBar::ClearTools()
{
- wxFAIL_MSG( _T("wxToolBar::ClearTools not implemented") );
+ wxFAIL_MSG( T("wxToolBar::ClearTools not implemented") );
}
bool wxToolBar::Realize()
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
}
void wxToolBar::ToggleTool( int toolIndex, bool toggle )
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
}
wxObject *wxToolBar::GetToolClientData( int index ) const
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return (wxObject*)NULL;
}
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return FALSE;
}
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return FALSE;
}
void wxToolBar::SetMargins( int x, int y )
{
- wxCHECK_RET( !m_hasToolAlready, _T("wxToolBar::SetMargins must be called before adding tool.") );
+ wxCHECK_RET( !m_hasToolAlready, T("wxToolBar::SetMargins must be called before adding tool.") );
if (x > 2) gtk_toolbar_append_space( m_toolbar ); // oh well
void wxToolBar::SetToolPacking( int WXUNUSED(packing) )
{
- wxFAIL_MSG( _T("wxToolBar::SetToolPacking not implemented") );
+ wxFAIL_MSG( T("wxToolBar::SetToolPacking not implemented") );
}
void wxToolBar::SetToolSeparation( int separation )
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
- return _T("");
+ return T("");
}
wxString wxToolBar::GetToolShortHelp(int toolIndex)
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
- return _T("");
+ return T("");
}
void wxToolBar::SetToolLongHelp(int toolIndex, const wxString& helpString)
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return;
}
node = node->Next();
}
- wxFAIL_MSG( _T("wrong toolbar index") );
+ wxFAIL_MSG( T("wrong toolbar index") );
return;
}
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, validator, name ))
{
- wxFAIL_MSG( _T("wxTextCtrl creation failed") );
+ wxFAIL_MSG( T("wxTextCtrl creation failed") );
return FALSE;
}
wxString wxTextCtrl::GetValue() const
{
- wxCHECK_MSG( m_text != NULL, _T(""), _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, T(""), T("invalid text ctrl") );
wxString tmp;
if (m_windowStyle & wxTE_MULTILINE)
void wxTextCtrl::SetValue( const wxString &value )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
- wxString tmp = _T("");
+ wxString tmp = T("");
if (!value.IsNull()) tmp = value;
if (m_windowStyle & wxTE_MULTILINE)
{
void wxTextCtrl::WriteText( const wxString &text )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (text.IsEmpty()) return;
void wxTextCtrl::AppendText( const wxString &text )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (text.IsEmpty()) return;
if (text)
{
- wxString buf(_T(""));
+ wxString buf(T(""));
long i;
int currentLine = 0;
for (i = 0; currentLine != lineNo && text[i]; i++ )
{
/* If you implement this, don't forget to update the documentation!
* (file docs/latex/wx/text.tex) */
- wxFAIL_MSG( _T("wxTextCtrl::OnDropFiles not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::OnDropFiles not implemented") );
}
bool wxTextCtrl::PositionToXY(long pos, long *x, long *y ) const
const wxChar* stop = text.c_str() + pos;
for ( const wxChar *p = text.c_str(); p < stop; p++ )
{
- if (*p == _T('\n'))
+ if (*p == T('\n'))
{
(*y)++;
*x=0;
void wxTextCtrl::SetInsertionPoint( long pos )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
{
void wxTextCtrl::SetInsertionPointEnd()
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
SetInsertionPoint(gtk_text_get_length(GTK_TEXT(m_text)));
void wxTextCtrl::SetEditable( bool editable )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (m_windowStyle & wxTE_MULTILINE)
gtk_text_set_editable( GTK_TEXT(m_text), editable );
void wxTextCtrl::SetSelection( long from, long to )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
gtk_editable_select_region( GTK_EDITABLE(m_text), (gint)from, (gint)to );
}
long wxTextCtrl::GetInsertionPoint() const
{
- wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, 0, T("invalid text ctrl") );
return (long) GTK_EDITABLE(m_text)->current_pos;
}
long wxTextCtrl::GetLastPosition() const
{
- wxCHECK_MSG( m_text != NULL, 0, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, 0, T("invalid text ctrl") );
int pos = 0;
if (m_windowStyle & wxTE_MULTILINE)
void wxTextCtrl::Remove( long from, long to )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
}
void wxTextCtrl::Replace( long from, long to, const wxString &value )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
gtk_editable_delete_text( GTK_EDITABLE(m_text), (gint)from, (gint)to );
void wxTextCtrl::Cut()
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_cut_clipboard( GTK_EDITABLE(m_text) );
void wxTextCtrl::Copy()
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_copy_clipboard( GTK_EDITABLE(m_text) );
void wxTextCtrl::Paste()
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
#if (GTK_MINOR_VERSION > 0)
gtk_editable_paste_clipboard( GTK_EDITABLE(m_text) );
void wxTextCtrl::Undo()
{
// TODO
- wxFAIL_MSG( _T("wxTextCtrl::Undo not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::Undo not implemented") );
}
void wxTextCtrl::Redo()
{
// TODO
- wxFAIL_MSG( _T("wxTextCtrl::Redo not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::Redo not implemented") );
}
bool wxTextCtrl::CanUndo() const
{
// TODO
- wxFAIL_MSG( _T("wxTextCtrl::CanUndo not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::CanUndo not implemented") );
return FALSE;
}
bool wxTextCtrl::CanRedo() const
{
// TODO
- wxFAIL_MSG( _T("wxTextCtrl::CanRedo not implemented") );
+ wxFAIL_MSG( T("wxTextCtrl::CanRedo not implemented") );
return FALSE;
}
// selection.
void wxTextCtrl::GetSelection(long* from, long* to) const
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if (!(GTK_EDITABLE(m_text)->has_selection))
{
bool wxTextCtrl::IsEditable() const
{
- wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") );
return GTK_EDITABLE(m_text)->editable;
}
void wxTextCtrl::Clear()
{
- SetValue( _T("") );
+ SetValue( T("") );
}
void wxTextCtrl::OnChar( wxKeyEvent &key_event )
{
- wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ wxCHECK_RET( m_text != NULL, T("invalid text ctrl") );
if ((key_event.KeyCode() == WXK_RETURN) && (m_windowStyle & wxPROCESS_ENTER))
{
// the font will change for subsequent text insertiongs
bool wxTextCtrl::SetFont( const wxFont &font )
{
- wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") );
if ( !wxWindowBase::SetFont(font) )
{
bool wxTextCtrl::SetForegroundColour( const wxColour &WXUNUSED(colour) )
{
- wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") );
// doesn't work
return FALSE;
bool wxTextCtrl::SetBackgroundColour( const wxColour &colour )
{
- wxCHECK_MSG( m_text != NULL, FALSE, _T("invalid text ctrl") );
+ wxCHECK_MSG( m_text != NULL, FALSE, T("invalid text ctrl") );
wxControl::SetBackgroundColour( colour );
// Yuck this is really BOTH site and platform dependent
// so we should use some other strategy!
#ifdef __SUN__
- #define DEFAULT_XRESOURCE_DIR _T("/usr/openwin/lib/app-defaults")
+ #define DEFAULT_XRESOURCE_DIR T("/usr/openwin/lib/app-defaults")
#else
- #define DEFAULT_XRESOURCE_DIR _T("/usr/lib/X11/app-defaults")
+ #define DEFAULT_XRESOURCE_DIR T("/usr/lib/X11/app-defaults")
#endif
//-----------------------------------------------------------------------------
wxStrcpy(buf, name);
return buf; // Exists so ...
}
- if (*name == _T('/'))
+ if (*name == T('/'))
wxStrcpy(buf, name);
else
{
// Put in standard place for resource files if not absolute
wxStrcpy(buf, DEFAULT_XRESOURCE_DIR);
- wxStrcat(buf, _T("/"));
+ wxStrcat(buf, T("/"));
wxStrcat(buf, FileNameFromPath(name));
}
if (create)
if ((home = wxGetUserHome(wxString())) != NULL)
{
wxStrcpy(dest, home);
- if (dest[wxStrlen(dest) - 1] != _T('/')) wxStrcat(dest, _T("/"));
+ if (dest[wxStrlen(dest) - 1] != T('/')) wxStrcat(dest, T("/"));
if (filename == NULL)
{
- if ((filename = wxGetenv(_T("XENVIRONMENT"))) == NULL) filename = _T(".Xdefaults");
+ if ((filename = wxGetenv(T("XENVIRONMENT("))) == NULL) filename = T(".Xdefaults");
}
else
- if (*filename != _T('.')) wxStrcat(dest, _T("."));
+ if (*filename != T('.')) wxStrcat(dest, T("."));
wxStrcat(dest, filename);
}
else
{
- dest[0] = _T('\0');
+ dest[0] = T('\0');
}
}
return dest;
// Open XENVIRONMENT file, or if not defined, the .Xdefaults,
// and merge into existing database
- if ((environment = wxGetenv(_T("XENVIRONMENT"))) == NULL)
+ if ((environment = wxGetenv(T("XENVIRONMENT("))) == NULL)
{
size_t len;
#if wxUSE_UNICODE
void wxDeleteResources(const wxChar *file)
{
- wxLogTrace(wxTraceResAlloc, _T("Delete: Number = %d"), wxTheResourceCache->Number());
+ wxLogTrace(wxTraceResAlloc, T("Delete: Number = %d"), wxTheResourceCache->Number());
wxChar buffer[500];
(void)GetIniFile(buffer, file);
database = (XrmDatabase)node->Data();
else {
database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer));
- wxLogTrace(wxTraceResAlloc, _T("Write: Number = %d"), wxTheResourceCache->Number());
+ wxLogTrace(wxTraceResAlloc, T("Write: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
char resName[300];
- strcpy(resName, !section.IsNull() ? MBSTRINGCAST section.mb_str() : "wxWindows");
+ strcpy(resName, !section.IsNull() ? wxMBSTRINGCAST section.mb_str() : "wxWindows");
strcat(resName, ".");
strcat(resName, entry.mb_str());
XrmPutStringResource(&database, resName, value.mb_str());
else
{
database = XrmGetFileDatabase(wxConvCurrent->cWX2MB(buffer));
- wxLogTrace(wxTraceResAlloc, _T("Get: Number = %d"), wxTheResourceCache->Number());
+ wxLogTrace(wxTraceResAlloc, T("Get: Number = %d"), wxTheResourceCache->Number());
wxTheResourceCache->Append(buffer, (wxObject *)database);
}
} else
{
// Handle True, False here
// True, Yes, Enables, Set or Activated
- if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')
+ if (*s == 'T(' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')
*value = TRUE;
// False, No, Disabled, Reset, Cleared, Deactivated
else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C')
wxLog::AddTraceMask("focus");
s_done = TRUE;
}
- wxLogTrace(_T("FOCUS NOW AT: %s"), name);
+ wxLogTrace(T("FOCUS NOW AT: %s"), name);
*/
return FALSE;
void debug_focus_in( GtkWidget* widget, const wxChar* name, const wxChar *window )
{
wxString tmp = name;
- tmp += _T(" FROM ");
+ tmp += T(" FROM ");
tmp += window;
wxChar *s = new wxChar[tmp.Length()+1];
wxapp_install_idle_handler();
/*
- wxPrintf( _T("1) OnButtonPress from ") );
+ wxPrintf( T("1) OnButtonPress from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
wxPrintf( win->GetClassInfo()->GetClassName() );
- wxPrintf( _T(".\n") );
+ wxPrintf( T(".\n") );
*/
if (!win->m_hasVMT) return FALSE;
if (g_blockEventsOnDrag) return TRUE;
gtk_widget_grab_focus (win->m_wxwindow);
/*
- wxPrintf( _T("GrabFocus from ") );
+ wxPrintf( T("GrabFocus from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
wxPrintf( win->GetClassInfo()->GetClassName() );
- wxPrintf( _T(".\n") );
+ wxPrintf( T(".\n") );
*/
}
}
/*
- wxPrintf( _T("2) OnButtonPress from ") );
+ wxPrintf( T("2) OnButtonPress from ") );
if (win->GetClassInfo() && win->GetClassInfo()->GetClassName())
wxPrintf( win->GetClassInfo()->GetClassName() );
- wxPrintf( _T(".\n") );
+ wxPrintf( T(".\n") );
*/
wxEventType event_type = wxEVT_LEFT_DOWN;
if (!PreCreation( parent, pos, size ) ||
!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name ))
{
- wxFAIL_MSG( _T("wxWindow creation failed") );
+ wxFAIL_MSG( T("wxWindow creation failed") );
return FALSE;
}
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
#ifdef __WXDEBUG__
- debug_focus_in( m_widget, _T("wxWindow::m_widget"), name );
+ debug_focus_in( m_widget, T("wxWindow::m_widget"), name );
#endif
GtkScrolledWindow *scrolledWindow = GTK_SCROLLED_WINDOW(m_widget);
#ifdef __WXDEBUG__
- debug_focus_in( scrolledWindow->hscrollbar, _T("wxWindow::hsrcollbar"), name );
- debug_focus_in( scrolledWindow->vscrollbar, _T("wxWindow::vsrcollbar"), name );
+ debug_focus_in( scrolledWindow->hscrollbar, T("wxWindow::hsrcollbar"), name );
+ debug_focus_in( scrolledWindow->vscrollbar, T("wxWindow::vsrcollbar"), name );
#endif
GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS( GTK_OBJECT(m_widget)->klass );
m_wxwindow = gtk_myfixed_new();
#ifdef __WXDEBUG__
- debug_focus_in( m_wxwindow, _T("wxWindow::m_wxwindow"), name );
+ debug_focus_in( m_wxwindow, T("wxWindow::m_wxwindow"), name );
#endif
gtk_container_add( GTK_CONTAINER(m_widget), m_wxwindow );
bool wxWindow::PreCreation( wxWindow *parent, const wxPoint &pos, const wxSize &size )
{
- wxCHECK_MSG( !m_needParent || parent, FALSE, _T("Need complete parent.") );
+ wxCHECK_MSG( !m_needParent || parent, FALSE, T("Need complete parent.") );
/* this turns -1 into 20 so that a minimal window is
visible even although -1,-1 has been given as the
void wxWindow::PostCreation()
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid window") );
if (m_wxwindow)
{
bool wxWindow::Destroy()
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid window") );
m_hasVMT = FALSE;
void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
- wxASSERT_MSG( (m_parent != NULL), _T("wxWindow::SetSize requires parent.\n") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid window") );
+ wxASSERT_MSG( (m_parent != NULL), T("wxWindow::SetSize requires parent.\n") );
if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE;
void wxWindow::DoGetSize( int *width, int *height ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (width) (*width) = m_width;
if (height) (*height) = m_height;
void wxWindow::DoSetClientSize( int width, int height )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_wxwindow)
{
void wxWindow::DoGetClientSize( int *width, int *height ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_wxwindow)
{
void wxWindow::DoGetPosition( int *x, int *y ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (x) (*x) = m_x;
if (y) (*y) = m_y;
void wxWindow::DoClientToScreen( int *x, int *y ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
void wxWindow::DoScreenToClient( int *x, int *y ) const
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
bool wxWindow::Show( bool show )
{
- wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") );
if (!wxWindowBase::Show(show))
{
bool wxWindow::Enable( bool enable )
{
- wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") );
if (!wxWindowBase::Enable(enable))
{
int wxWindow::GetCharHeight() const
{
- wxCHECK_MSG( (m_widget != NULL), 12, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), 12, T("invalid window") );
- wxCHECK_MSG( m_font.Ok(), 12, _T("invalid font") );
+ wxCHECK_MSG( m_font.Ok(), 12, T("invalid font") );
GdkFont *font = m_font.GetInternalFont( 1.0 );
int wxWindow::GetCharWidth() const
{
- wxCHECK_MSG( (m_widget != NULL), 8, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), 8, T("invalid window") );
- wxCHECK_MSG( m_font.Ok(), 8, _T("invalid font") );
+ wxCHECK_MSG( m_font.Ok(), 8, T("invalid font") );
GdkFont *font = m_font.GetInternalFont( 1.0 );
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
- wxCHECK_RET( fontToUse.Ok(), _T("invalid font") );
+ wxCHECK_RET( fontToUse.Ok(), T("invalid font") );
GdkFont *font = fontToUse.GetInternalFont( 1.0 );
if (x) (*x) = gdk_string_width( font, string.mbc_str() );
void wxWindow::SetFocus()
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
GtkWidget *connect_widget = GetConnectWidget();
if (connect_widget)
bool wxWindow::Reparent( wxWindowBase *newParentBase )
{
- wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") );
wxWindow *oldParent = m_parent,
*newParent = (wxWindow *)newParentBase;
void wxWindow::DoAddChild(wxWindow *child)
{
- wxASSERT_MSG( (m_widget != NULL), _T("invalid window") );
+ wxASSERT_MSG( (m_widget != NULL), T("invalid window") );
- wxASSERT_MSG( (child != NULL), _T("invalid child window") );
+ wxASSERT_MSG( (child != NULL), T("invalid child window") );
- wxASSERT_MSG( (m_insertCallback != NULL), _T("invalid child insertion function") );
+ wxASSERT_MSG( (m_insertCallback != NULL), T("invalid child insertion function") );
/* add to list */
AddChild( child );
void wxWindow::Raise()
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
void wxWindow::Lower()
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
bool wxWindow::SetCursor( const wxCursor &cursor )
{
- wxCHECK_MSG( (m_widget != NULL), FALSE, _T("invalid window") );
+ wxCHECK_MSG( (m_widget != NULL), FALSE, T("invalid window") );
return wxWindowBase::SetCursor( cursor );
}
void wxWindow::WarpPointer( int x, int y )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
GtkWidget *connect_widget = GetConnectWidget();
if (connect_widget->window)
void wxWindow::Refresh( bool eraseBackground, const wxRect *rect )
{
- wxCHECK_RET( (m_widget != NULL), _T("invalid window") );
+ wxCHECK_RET( (m_widget != NULL), T("invalid window") );
if (!m_widget->window) return;
void wxWindow::Clear()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
if (!m_widget->window) return;
bool wxWindow::SetBackgroundColour( const wxColour &colour )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") );
if (!wxWindowBase::SetBackgroundColour(colour))
{
bool wxWindow::SetForegroundColour( const wxColour &colour )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") );
if (!wxWindowBase::SetForegroundColour(colour))
{
bool wxWindow::DoPopupMenu( wxMenu *menu, int x, int y )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") );
- wxCHECK_MSG( menu != NULL, FALSE, _T("invalid popup-menu") );
+ wxCHECK_MSG( menu != NULL, FALSE, T("invalid popup-menu") );
SetInvokingWindow( menu, this );
void wxWindow::SetDropTarget( wxDropTarget *dropTarget )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
GtkWidget *dnd_widget = GetConnectWidget();
bool wxWindow::SetFont( const wxFont &font )
{
- wxCHECK_MSG( m_widget != NULL, FALSE, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, FALSE, T("invalid window") );
if (!wxWindowBase::SetFont(font))
{
void wxWindow::CaptureMouse()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( g_captureWindow == NULL, _T("CaptureMouse called twice") );
+ wxCHECK_RET( g_captureWindow == NULL, T("CaptureMouse called twice") );
GtkWidget *connect_widget = GetConnectWidget();
if (!connect_widget->window) return;
void wxWindow::ReleaseMouse()
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( g_captureWindow, _T("ReleaseMouse called twice") );
+ wxCHECK_RET( g_captureWindow, T("ReleaseMouse called twice") );
GtkWidget *connect_widget = GetConnectWidget();
if (!connect_widget->window) return;
void wxWindow::SetScrollbar( int orient, int pos, int thumbVisible,
int range, bool refresh )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
+ wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") );
m_hasScrolling = TRUE;
void wxWindow::SetScrollPos( int orient, int pos, bool WXUNUSED(refresh) )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
+ wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
{
int wxWindow::GetScrollThumb( int orient ) const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") );
- wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
+ wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->page_size+0.5);
int wxWindow::GetScrollPos( int orient ) const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") );
- wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
+ wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->value+0.5);
int wxWindow::GetScrollRange( int orient ) const
{
- wxCHECK_MSG( m_widget != NULL, 0, _T("invalid window") );
+ wxCHECK_MSG( m_widget != NULL, 0, T("invalid window") );
- wxCHECK_MSG( m_wxwindow != NULL, 0, _T("window needs client area for scrolling") );
+ wxCHECK_MSG( m_wxwindow != NULL, 0, T("window needs client area for scrolling") );
if (orient == wxHORIZONTAL)
return (int)(m_hAdjust->upper+0.5);
void wxWindow::ScrollWindow( int dx, int dy, const wxRect* WXUNUSED(rect) )
{
- wxCHECK_RET( m_widget != NULL, _T("invalid window") );
+ wxCHECK_RET( m_widget != NULL, T("invalid window") );
- wxCHECK_RET( m_wxwindow != NULL, _T("window needs client area for scrolling") );
+ wxCHECK_RET( m_wxwindow != NULL, T("window needs client area for scrolling") );
if (!m_scrollGC)
{
return TRUE;
}
- else if (tag.GetName() == "OBJECT") {
+ else if (tag.GetName() == "OBJECT(") {
m_Name = m_Page = wxEmptyString;
ParseInner(tag);
if (m_Page != wxEmptyString) {
alg.MakeUpper();
if (alg == "CENTER")
SetAlignHor(HTML_ALIGN_CENTER);
- else if (alg == "LEFT")
+ else if (alg == "LEFT(")
SetAlignHor(HTML_ALIGN_LEFT);
- else if (alg == "RIGHT")
+ else if (alg == "RIGHT(")
SetAlignHor(HTML_ALIGN_RIGHT);
}
}
// This is true in most case but some page can return:
// "text/html; char-encoding=...."
// So we use Find instead
- return (file.GetMimeType().Find(_T("text/html")) == 0);
+ return (file.GetMimeType().Find(T("text/html")) == 0);
}
FORCE_LINK_ME(mod_fonts)
-TAG_HANDLER_BEGIN(FONT, "FONT")
+TAG_HANDLER_BEGIN(FONT, "FONT(")
TAG_HANDLER_PROC(tag)
{
TAG_HANDLER_END(FONT)
-TAG_HANDLER_BEGIN(FACES, "U,I,B,TT")
+TAG_HANDLER_BEGIN(FACES, "U,I,B,TT(")
TAG_HANDLER_PROC(tag)
{
str = m_WParser -> GetFS() -> OpenFile(tmp);
if (tag.HasParam("WIDTH")) tag.ScanParam("WIDTH", "%i", &w);
- if (tag.HasParam("HEIGHT")) tag.ScanParam("HEIGHT", "%i", &h);
+ if (tag.HasParam("HEIGHT(")) tag.ScanParam("HEIGHT(", "%i", &h);
al = HTML_ALIGN_BOTTOM;
if (tag.HasParam("ALIGN")) {
wxString alstr = tag.GetParam("ALIGN");
{
cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::CIRCLE, coords );
}
- else if (tmp == "RECT")
+ else if (tmp == "RECT(")
{
cel = new wxHtmlImageMapAreaCell( wxHtmlImageMapAreaCell::RECT, coords );
}
unsigned long tmp;
wxColour clr;
- if (tag.HasParam("TEXT")) {
- if (tag.ScanParam("TEXT", "#%lX", &tmp) == 1) {
+ if (tag.HasParam("TEXT(")) {
+ if (tag.ScanParam("TEXT(", "#%lX", &tmp) == 1) {
clr = wxColour((tmp & 0xFF0000) >> 16 , (tmp & 0x00FF00) >> 8, (tmp & 0x0000FF));
m_WParser -> SetActualColor(clr);
m_WParser -> GetContainer() -> InsertCell(new wxHtmlColourCell(clr));
als = m_rAlign;
if (tag.HasParam("ALIGN")) als = tag.GetParam("ALIGN");
als.MakeUpper();
- if (als == "RIGHT") m_WParser -> SetAlign(HTML_ALIGN_RIGHT);
+ if (als == "RIGHT(") m_WParser -> SetAlign(HTML_ALIGN_RIGHT);
else if (als == "CENTER") m_WParser -> SetAlign(HTML_ALIGN_CENTER);
}
m_WParser -> OpenContainer();
window = XtWindow( (Widget) wxTheApp->GetTopWindow()->GetTopWidget() );
int success = XmClipboardRetrieve((Display*) wxGetDisplay(),
- window, "TEXT", (XtPointer) 0, 0, & numBytes, & privateId) ;
+ window, "TEXT(", (XtPointer) 0, 0, & numBytes, & privateId) ;
// Assume only text is supported. If we have anything at all,
// or the clipboard is locked so we're not sure, we say we support it.
XmClipboardCopy((Display*) wxGetDisplay(),
window,
itemId,
- "TEXT",
+ "TEXT(",
(XtPointer) data,
strlen(data) + 1,
0,
}
result = XmClipboardRetrieve((Display*) wxGetDisplay(),
window,
- "TEXT",
+ "TEXT(",
(XtPointer) data,
currentDataSize,
&numBytes,
// Only wxDF_TEXT supported
if (dataFormat == wxDF_TEXT)
{
- strcpy(formatName, "TEXT");
+ strcpy(formatName, "TEXT(");
return TRUE;
}
else
static int FormatStringToID(char *str)
{
- if (!strcmp(str, "TEXT"))
+ if (!strcmp(str, "TEXT("))
return wxDF_TEXT;
return wxRegisterClipboardFormat(str);
char *str;
long length;
- str = GetClipboardData("TEXT", &length, time);
+ str = GetClipboardData("TEXT(", &length, time);
if (!str) {
str = new char[1];
*str = 0;
else
return NULL;
} else if (cbString) {
- if (!strcmp(format, "TEXT"))
+ if (!strcmp(format, "TEXT("))
return copystring(cbString);
else
return NULL;
m_type = wxDF_PRIVATE;
m_id = XGetAtomName( (Display*) wxGetDisplay(), m_atom );
- if (m_id == _T("file:ALL"))
+ if (m_id == T("file:ALL"))
{
m_type = wxDF_FILENAME;
}
if (m_type == wxDF_TEXT)
{
- m_id = _T("STRING");
+ m_id = T("STRING");
}
else
if (m_type == wxDF_BITMAP)
{
- m_id = _T("BITMAP");
+ m_id = T("BITMAP");
}
else
if (m_type == wxDF_FILENAME)
{
- m_id = _T("file:ALL");
+ m_id = T("file:ALL");
}
else
{
- wxFAIL_MSG( _T("invalid dataformat") );
+ wxFAIL_MSG( T("invalid dataformat") );
}
m_hasAtom = FALSE;
*/
if (m_type == wxDF_PRIVATE)
{
- m_atom = XInternAtom( (Display*) wxGetDisplay(), MBSTRINGCAST m_id.mbc_str(), FALSE );
+ m_atom = XInternAtom( (Display*) wxGetDisplay(), wxMBSTRINGCAST m_id.mbc_str(), FALSE );
}
else
if (m_type == wxDF_FILENAME)
wxPrivateDataObject::wxPrivateDataObject()
{
- wxString id = _T("application/");
+ wxString id = T("application/");
id += wxTheApp->GetAppName();
m_format.SetId( id );
void wxWindowDC::DoDrawSpline( wxList *points )
{
- wxCHECK_RET( Ok(), _T("invalid window dc") );
+ wxCHECK_RET( Ok(), T("invalid window dc") );
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
M_FONTDATA->m_style,
M_FONTDATA->m_weight,
M_FONTDATA->m_underlined,
- _T(""),
+ T(""),
M_FONTDATA->m_encoding);
if ( !font )
{
- wxFAIL_MSG( _T("Could not allocate even a default font -- something is wrong.") );
+ wxFAIL_MSG( T("Could not allocate even a default font -- something is wrong.") );
return (wxXFont*) NULL;
}
static char **CreateFontList(wxChar spacing, int *nFonts)
{
wxString pattern;
- pattern.Printf(_T("-*-*-*-*-*-*-*-*-*-*-%c-*-*-*"), spacing);
+ pattern.Printf(T("-*-*-*-*-*-*-*-*-*-*-%c-*-*-*"), spacing);
// get the list of all fonts
return XListFonts((Display *)wxGetDisplay(), pattern, 32767, nFonts);
if ( fixedWidthOnly )
{
bool cont = TRUE;
- fonts = CreateFontList(_T('m'), &nFonts);
+ fonts = CreateFontList(T('m'), &nFonts);
if ( fonts )
{
cont = ProcessFamiliesFromFontList(this, fonts, nFonts);
return TRUE;
}
- fonts = CreateFontList(_T('c'), &nFonts);
+ fonts = CreateFontList(T('c'), &nFonts);
if ( !fonts )
{
return TRUE;
}
else
{
- fonts = CreateFontList(_T('*'), &nFonts);
+ fonts = CreateFontList(T('*'), &nFonts);
if ( !fonts )
{
- wxFAIL_MSG(_T("No fonts at all on this system?"));
+ wxFAIL_MSG(T("No fonts at all on this system?"));
return FALSE;
}
{
#if 0
wxString pattern;
- pattern.Printf(_T("-*-%s-*-*-*-*-*-*-*-*-*-*-*-*"),
- family.IsEmpty() ? _T("*") : family.c_str());
+ pattern.Printf(T("-*-%s-*-*-*-*-*-*-*-*-*-*-*-*"),
+ family.IsEmpty() ? T("*") : family.c_str());
// get the list of all fonts
int nFonts;
strcat (dest, "/");
if (filename == NULL)
{
- if ((filename = getenv ("XENVIRONMENT")) == NULL)
+ if ((filename = getenv ("XENVIRONMENT(")) == NULL)
filename = ".Xdefaults";
}
else if (*filename != '.')
{
// Handle True, False here
// True, Yes, Enables, Set or Activated
- if (*s == 'T' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')
+ if (*s == 'T(' || *s == 'Y' || *s == 'E' || *s == 'S' || *s == 'A')
*value = TRUE;
// False, No, Disabled, Reset, Cleared, Deactivated
else if (*s == 'F' || *s == 'N' || *s == 'D' || *s == 'R' || *s == 'C')
* and merge into existing database
*/
- if ((environment = getenv ("XENVIRONMENT")) == NULL)
+ if ((environment = getenv ("XENVIRONMENT(")) == NULL)
{
size_t len;
environment = GetIniFile (filename, NULL);
}
wxASSERT_MSG( m_cursor.Ok(),
- _T("cursor must be valid after call to the base version"));
+ T("cursor must be valid after call to the base version"));
WXDisplay *dpy = GetXDisplay();
WXCursor x_cursor = m_cursor.GetXCursor(dpy);
// NB: all "NoRedraw" classes must have the same names as the "normal" classes
// with NR suffix - wxWindow::MSWCreate() supposes this
-wxChar wxFrameClassName[] = _T("wxFrameClass");
-wxChar wxFrameClassNameNoRedraw[] = _T("wxFrameClassNR");
-wxChar wxMDIFrameClassName[] = _T("wxMDIFrameClass");
-wxChar wxMDIFrameClassNameNoRedraw[] = _T("wxMDIFrameClassNR");
-wxChar wxMDIChildFrameClassName[] = _T("wxMDIChildFrameClass");
-wxChar wxMDIChildFrameClassNameNoRedraw[] = _T("wxMDIChildFrameClassNR");
-wxChar wxPanelClassName[] = _T("wxPanelClass");
-wxChar wxCanvasClassName[] = _T("wxCanvasClass");
+wxChar wxFrameClassName[] = T("wxFrameClass");
+wxChar wxFrameClassNameNoRedraw[] = T("wxFrameClassNR");
+wxChar wxMDIFrameClassName[] = T("wxMDIFrameClass");
+wxChar wxMDIFrameClassNameNoRedraw[] = T("wxMDIFrameClassNR");
+wxChar wxMDIChildFrameClassName[] = T("wxMDIChildFrameClass");
+wxChar wxMDIChildFrameClassNameNoRedraw[] = T("wxMDIChildFrameClassNR");
+wxChar wxPanelClassName[] = T("wxPanelClass");
+wxChar wxCanvasClassName[] = T("wxCanvasClass");
HICON wxSTD_FRAME_ICON = (HICON) NULL;
HICON wxSTD_MDICHILDFRAME_ICON = (HICON) NULL;
wxClassInfo::InitializeClasses();
#if wxUSE_RESOURCES
- wxGetResource(_T("wxWindows"), _T("OsVersion"), &wxOsVersion);
+ wxGetResource(T("wxWindows"), T("OsVersion"), &wxOsVersion);
#endif
// I'm annoyed ... I don't know where to put this and I don't want to
InitCommonControls();
#if wxUSE_RICHEDIT
- gs_hRichEdit = LoadLibrary(_T("RICHED32.DLL"));
+ gs_hRichEdit = LoadLibrary(T("RICHED32.DLL"));
if (gs_hRichEdit == (HINSTANCE) NULL)
{
#if wxUSE_CTL3D
if (!Ctl3dRegister(wxhInstance))
- wxLogError(_T("Cannot register CTL3D"));
+ wxLogError(T("Cannot register CTL3D"));
Ctl3dAutoSubclass(wxhInstance);
#endif
g_globalCursor = new wxCursor;
- wxSTD_FRAME_ICON = LoadIcon(wxhInstance, _T("wxSTD_FRAME"));
- wxSTD_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, _T("wxSTD_MDIPARENTFRAME"));
- wxSTD_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, _T("wxSTD_MDICHILDFRAME"));
+ wxSTD_FRAME_ICON = LoadIcon(wxhInstance, T("wxSTD_FRAME"));
+ wxSTD_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, T("wxSTD_MDIPARENTFRAME"));
+ wxSTD_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, T("wxSTD_MDICHILDFRAME"));
- wxDEFAULT_FRAME_ICON = LoadIcon(wxhInstance, _T("wxDEFAULT_FRAME"));
- wxDEFAULT_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, _T("wxDEFAULT_MDIPARENTFRAME"));
- wxDEFAULT_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, _T("wxDEFAULT_MDICHILDFRAME"));
+ wxDEFAULT_FRAME_ICON = LoadIcon(wxhInstance, T("wxDEFAULT_FRAME"));
+ wxDEFAULT_MDIPARENTFRAME_ICON = LoadIcon(wxhInstance, T("wxDEFAULT_MDIPARENTFRAME"));
+ wxDEFAULT_MDICHILDFRAME_ICON = LoadIcon(wxhInstance, T("wxDEFAULT_MDICHILDFRAME"));
RegisterWindowClasses();
LOGBRUSH lb;
lb.lbStyle = BS_PATTERN;
- lb.lbHatch = (int)LoadBitmap( wxhInstance, _T("wxDISABLE_BUTTON_BITMAP") );
+ lb.lbHatch = (int)LoadBitmap( wxhInstance, T("wxDISABLE_BUTTON_BITMAP") );
if ( lb.lbHatch )
{
wxDisableButtonBrush = ::CreateBrushIndirect( & lb );
if (i < len)
{
- if (cmdLine.GetChar(i) == _T('"')) // We found the start of a string
+ if (cmdLine.GetChar(i) == T('"')) // We found the start of a string
{
i ++;
int first = i;
- while ((i < len) && (cmdLine.GetChar(i) != _T('"')))
+ while ((i < len) && (cmdLine.GetChar(i) != T('"')))
i ++;
wxString arg(cmdLine.Mid(first, (i - first)));
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft(TRUE) > 0)
{
- wxLogDebug(_T("There were memory leaks."));
+ wxLogDebug(T("There were memory leaks."));
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
// the IMPLEMENT_APP macro is used instead, which sets an initializer
// function for delayed, dynamic app object construction.
wxCHECK_MSG( wxApp::GetInitializerFunction(), 0,
- _T("No initializer - use IMPLEMENT_APP macro.") );
+ T("No initializer - use IMPLEMENT_APP macro.") );
wxTheApp = (*wxApp::GetInitializerFunction()) ();
}
- wxCHECK_MSG( wxTheApp, 0, _T("You have to define an instance of wxApp!") );
+ wxCHECK_MSG( wxTheApp, 0, T("You have to define an instance of wxApp!") );
// save the WinMain() parameters
wxTheApp->ConvertToStandardCommandArgs(lpCmdLine);
{
#if wxUSE_THREADS
wxASSERT_MSG( wxThread::IsMain(),
- _T("only the main thread can process Windows messages") );
+ T("only the main thread can process Windows messages") );
static bool s_hadGuiLock = TRUE;
static wxMsgArray s_aSavedMessages;
int wxApp::GetComCtl32Version() const
{
// have we loaded COMCTL32 yet?
- HMODULE theModule = ::GetModuleHandle(_T("COMCTL32"));
+ HMODULE theModule = ::GetModuleHandle(T("COMCTL32"));
int version = 0;
// if so, then we can check for the version
return wxIcon("wxICON_WARNING");
default:
- wxFAIL_MSG(_T("requested non existent standard icon"));
+ wxFAIL_MSG(T("requested non existent standard icon"));
// still fall through
case wxICON_HAND:
if (m_selectedInto)
{
wxChar buf[200];
- wxSprintf(buf, _T("Bitmap was deleted without selecting out of wxMemoryDC %lX."), (unsigned long) m_selectedInto);
+ wxSprintf(buf, T("Bitmap was deleted without selecting out of wxMemoryDC %lX."), (unsigned long) m_selectedInto);
wxFatalError(buf);
}
if (m_hBitmap)
if (M_BITMAPDATA->m_selectedInto)
{
wxChar buf[200];
- wxSprintf(buf, _T("Bitmap %lX was deleted without selecting out of wxMemoryDC %lX."), (unsigned long) this, (unsigned long) M_BITMAPDATA->m_selectedInto);
+ wxSprintf(buf, T("Bitmap %lX was deleted without selecting out of wxMemoryDC %lX."), (unsigned long) this, (unsigned long) M_BITMAPDATA->m_selectedInto);
wxFatalError(buf);
}
if (M_BITMAPDATA->m_hBitmap)
wxBitmapHandler *handler = FindHandler(type);
if ( handler == NULL ) {
- wxLogWarning(_T("no bitmap handler for type %d defined."), type);
+ wxLogWarning(T("no bitmap handler for type %d defined."), type);
return FALSE;
}
wxBitmapHandler *handler = FindHandler(type);
if ( handler == NULL ) {
- wxLogWarning(_T("no bitmap handler for type %d defined."), type);
+ wxLogWarning(T("no bitmap handler for type %d defined."), type);
return FALSE;
}
wxBitmapHandler *handler = FindHandler(type);
if ( handler == NULL ) {
- wxLogWarning(_T("no bitmap handler for type %d defined."), type);
+ wxLogWarning(T("no bitmap handler for type %d defined."), type);
return FALSE;
}
}
// it's probably not found
- wxLogError(_T("Can't load bitmap '%s' from resources! Check .rc file."), name.c_str());
+ wxLogError(T("Can't load bitmap '%s' from resources! Check .rc file."), name.c_str());
return FALSE;
}
m_hWnd = (WXHWND)CreateWindowEx
(
0,
- _T("BUTTON"),
- _T(""),
+ T("BUTTON"),
+ T(""),
WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_OWNERDRAW ,
0, 0, 0, 0,
GetWinHwnd(parent),
m_hWnd = (WXHWND)CreateWindowEx
(
MakeExtendedStyle(m_windowStyle),
- _T("BUTTON"),
+ T("BUTTON"),
label,
WS_VISIBLE | WS_TABSTOP | WS_CHILD,
0, 0, 0, 0,
bool wxCaret::MSWCreateCaret()
{
- wxASSERT_MSG( GetWindow(), _T("caret without window cannot be created") );
- wxASSERT_MSG( IsOk(), _T("caret of zero size cannot be created") );
+ wxASSERT_MSG( GetWindow(), T("caret without window cannot be created") );
+ wxASSERT_MSG( IsOk(), T("caret of zero size cannot be created") );
if ( !m_hasCaret )
{
void wxCaret::DoShow()
{
- wxASSERT_MSG( GetWindow(), _T("caret without window cannot be shown") );
- wxASSERT_MSG( IsOk(), _T("caret of zero size cannot be shown") );
+ wxASSERT_MSG( GetWindow(), T("caret without window cannot be shown") );
+ wxASSERT_MSG( IsOk(), T("caret of zero size cannot be shown") );
if ( m_hasCaret )
{
if ( m_hasCaret )
{
wxWindow *winFocus = wxWindow::FindFocus();
- wxASSERT_MSG( winFocus == GetWindow(), _T("how did we lose focus?") );
+ wxASSERT_MSG( winFocus == GetWindow(), T("how did we lose focus?") );
CALL_CARET_API(SetCaretPos, (m_x, m_y));
}
m_windowStyle = style;
wxString Label = label;
- if (Label == _T(""))
- Label = _T(" "); // Apparently needed or checkbox won't show
+ if (Label == T(""))
+ Label = T(" "); // Apparently needed or checkbox won't show
if ( id == -1 )
m_windowId = NewControlId();
msStyle |= WS_BORDER;
*/
- m_hWnd = (WXHWND)CreateWindowEx(exStyle, _T("BUTTON"), Label,
+ m_hWnd = (WXHWND)CreateWindowEx(exStyle, T("BUTTON"), Label,
msStyle,
0, 0, 0, 0,
(HWND)parent->GetHWND(), (HMENU)m_windowId,
checkHeight = -1 ;
long msStyle = CHECK_FLAGS;
- HWND wx_button = CreateWindowEx(MakeExtendedStyle(m_windowStyle), CHECK_CLASS, _T("toggle"),
+ HWND wx_button = CreateWindowEx(MakeExtendedStyle(m_windowStyle), CHECK_CLASS, T("toggle"),
msStyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
void wxBitmapCheckBox::SetLabel(const wxBitmap& bitmap)
{
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
}
// update it
int index = m_pParent->GetItemIndex(this);
- wxASSERT_MSG( index != wxNOT_FOUND, _T("what does this item do here?") );
+ wxASSERT_MSG( index != wxNOT_FOUND, T("what does this item do here?") );
m_nIndex = (size_t)index;
}
if ( ::SendMessage(hwndListbox, LB_GETITEMRECT,
m_nIndex, (LPARAM)&rcUpdate) == LB_ERR )
{
- wxLogDebug(_T("LB_GETITEMRECT failed"));
+ wxLogDebug(T("LB_GETITEMRECT failed"));
}
#else // Win16
// FIXME this doesn't work if the listbox is scrolled!
void wxCheckListBox::Delete(int N)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- _T("invalid index in wxListBox::Delete") );
+ T("invalid index in wxListBox::Delete") );
wxListBox::Delete(N);
void wxCheckListBox::InsertItems(int nItems, const wxString items[], int pos)
{
wxCHECK_RET( pos >= 0 && pos <= m_noItems,
- _T("invalid index in wxCheckListBox::InsertItems") );
+ T("invalid index in wxCheckListBox::InsertItems") );
wxListBox::InsertItems(nItems, items, pos);
wxASSERT_MSG( !(style & wxCB_DROPDOWN) &&
!(style & wxCB_READONLY) &&
!(style & wxCB_SIMPLE),
- _T("this style flag is ignored by wxChoice, you "
+ T("this style flag is ignored by wxChoice, you "
"probably want to use a wxComboBox") );
- if ( !MSWCreateControl(_T("COMBOBOX"), msStyle) )
+ if ( !MSWCreateControl(T("COMBOBOX"), msStyle) )
return FALSE;
for ( int i = 0; i < n; i++ )
void wxChoice::Delete(int n)
{
- wxCHECK_RET( n < GetCount(), _T("invalid item index in wxChoice::Delete") );
+ wxCHECK_RET( n < GetCount(), T("invalid item index in wxChoice::Delete") );
SendMessage(GetHwnd(), CB_DELETESTRING, n, 0);
}
{
if ( SendMessage(GetHwnd(), CB_SETITEMDATA, n, (LPARAM)clientData) == CB_ERR )
{
- wxLogLastError(_T("CB_SETITEMDATA"));
+ wxLogLastError(T("CB_SETITEMDATA"));
}
}
LPARAM rc = SendMessage(GetHwnd(), CB_GETITEMDATA, n, 0);
if ( rc == CB_ERR )
{
- wxLogLastError(_T("CB_GETITEMDATA"));
+ wxLogLastError(T("CB_GETITEMDATA"));
// unfortunately, there is no way to return an error code to the user
rc = (LPARAM) NULL;
bool wxOpenClipboard()
{
- wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, _T("clipboard already opened.") );
+ wxCHECK_MSG( !gs_wxClipboardIsOpen, TRUE, T("clipboard already opened.") );
wxWindow *win = wxTheApp->GetTopWindow();
if ( win )
}
else
{
- wxLogDebug(_T("Can not open clipboard without a main window."));
+ wxLogDebug(T("Can not open clipboard without a main window."));
return FALSE;
}
bool wxCloseClipboard()
{
- wxCHECK_MSG( gs_wxClipboardIsOpen, FALSE, _T("clipboard is not opened") );
+ wxCHECK_MSG( gs_wxClipboardIsOpen, FALSE, T("clipboard is not opened") );
gs_wxClipboardIsOpen = FALSE;
bool wxClipboard::AddData( wxDataObject *data )
{
- wxCHECK_MSG( data, FALSE, _T("data is invalid") );
+ wxCHECK_MSG( data, FALSE, T("data is invalid") );
#if wxUSE_DRAG_AND_DROP
- wxCHECK_MSG( wxIsClipboardOpened(), FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( wxIsClipboardOpened(), FALSE, T("clipboard not open") );
wxDataFormat format = data->GetFormat();
bool wxClipboard::GetData( wxDataObject *data )
{
- wxCHECK_MSG( wxIsClipboardOpened(), FALSE, _T("clipboard not open") );
+ wxCHECK_MSG( wxIsClipboardOpened(), FALSE, T("clipboard not open") );
#if wxUSE_DRAG_AND_DROP
wxDataFormat format = data->GetFormat();
if ( want3D || wxStyleHasBorder(m_windowStyle) )
msStyle |= WS_BORDER;
- m_hWnd = (WXHWND)::CreateWindowEx(exStyle, _T("COMBOBOX"), NULL,
+ m_hWnd = (WXHWND)::CreateWindowEx(exStyle, T("COMBOBOX"), NULL,
msStyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
- wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create combobox") );
+ wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create combobox") );
/*
#if wxUSE_CTL3D
if ( !m_hWnd )
{
#ifdef __WXDEBUG__
- wxLogError(_T("Failed to create a control of class '%s'"), classname);
+ wxLogError(T("Failed to create a control of class '%s'"), classname);
#endif // DEBUG
return FALSE;
lpDIB->bmiHeader.biBitCount)));
// Get a hDC so we can create a bitmap compatible with it
- hDC = CreateDC( _T("DISPLAY"), NULL, NULL, NULL);
+ hDC = CreateDC( T("DISPLAY"), NULL, NULL, NULL);
// 5) Create a device dependent bitmap with the XOR bits.
hbmXor = CreateDIBitmap( hDC, (LPBITMAPINFOHEADER)&(lpDIB->bmiHeader),
lpDIB->bmiHeader.biBitCount)));
// Get a hDC so we can create a bitmap compatible with it
- hDC = CreateDC( _T("DISPLAY"), NULL, NULL, NULL);
+ hDC = CreateDC( T("DISPLAY"), NULL, NULL, NULL);
// 5) Create a device dependent bitmap with the XOR bits.
hbmXor = CreateBitmap( (int )lpDIB->bmiHeader.biWidth,
}
case wxCURSOR_HAND:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_HAND"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_HAND"));
break;
}
case wxCURSOR_BULLSEYE:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_BULLSEYE"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_BULLSEYE"));
break;
}
case wxCURSOR_PENCIL:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_PENCIL"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_PENCIL"));
break;
}
case wxCURSOR_MAGNIFIER:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_MAGNIFIER"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_MAGNIFIER"));
break;
}
case wxCURSOR_NO_ENTRY:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_NO_ENTRY"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_NO_ENTRY"));
break;
}
case wxCURSOR_LEFT_BUTTON:
}
case wxCURSOR_SIZING:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_SIZING"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_SIZING"));
break;
}
case wxCURSOR_WATCH:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_WATCH"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_WATCH"));
break;
}
case wxCURSOR_SPRAYCAN:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_ROLLER"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_ROLLER"));
break;
}
case wxCURSOR_PAINT_BRUSH:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_PBRUSH"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_PBRUSH"));
break;
}
case wxCURSOR_POINT_LEFT:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_PLEFT"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_PLEFT("));
break;
}
case wxCURSOR_POINT_RIGHT:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_PRIGHT"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_PRIGHT("));
break;
}
case wxCURSOR_QUESTION_ARROW:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_QARROW"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_QARROW"));
break;
}
case wxCURSOR_BLANK:
{
- M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), _T("wxCURSOR_BLANK"));
+ M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(wxGetInstance(), T("wxCURSOR_BLANK"));
break;
}
default:
wxColour wxNullColour;
// Default window names
-const wxChar *wxButtonNameStr = _T("button");
-const wxChar *wxCanvasNameStr = _T("canvas");
-const wxChar *wxCheckBoxNameStr = _T("check");
-const wxChar *wxChoiceNameStr = _T("choice");
-const wxChar *wxComboBoxNameStr = _T("comboBox");
-const wxChar *wxDialogNameStr = _T("dialog");
-const wxChar *wxFrameNameStr = _T("frame");
-const wxChar *wxGaugeNameStr = _T("gauge");
-const wxChar *wxStaticBoxNameStr = _T("groupBox");
-const wxChar *wxListBoxNameStr = _T("listBox");
-const wxChar *wxStaticTextNameStr = _T("message");
-const wxChar *wxStaticBitmapNameStr = _T("message");
-const wxChar *wxMultiTextNameStr = _T("multitext");
-const wxChar *wxPanelNameStr = _T("panel");
-const wxChar *wxRadioBoxNameStr = _T("radioBox");
-const wxChar *wxRadioButtonNameStr = _T("radioButton");
-const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton");
-const wxChar *wxScrollBarNameStr = _T("scrollBar");
-const wxChar *wxSliderNameStr = _T("slider");
-const wxChar *wxStaticNameStr = _T("static");
-const wxChar *wxTextCtrlWindowNameStr = _T("textWindow");
-const wxChar *wxTextCtrlNameStr = _T("text");
-const wxChar *wxVirtListBoxNameStr = _T("virtListBox");
-const wxChar *wxButtonBarNameStr = _T("buttonbar");
-const wxChar *wxEnhDialogNameStr = _T("Shell");
-const wxChar *wxToolBarNameStr = _T("toolbar");
-const wxChar *wxStatusLineNameStr = _T("status_line");
-const wxChar *wxEmptyString = _T("");
-const wxChar *wxGetTextFromUserPromptStr = _T("Input Text");
-const wxChar *wxMessageBoxCaptionStr = _T("Message");
-const wxChar *wxFileSelectorPromptStr = _T("Select a file");
-const wxChar *wxFileSelectorDefaultWildcardStr = _T("*.*");
-const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error");
-const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error");
-const wxChar *wxTreeCtrlNameStr = _T("treeCtrl");
-const wxChar *wxDirDialogNameStr = _T("wxDirCtrl");
-const wxChar *wxDirDialogDefaultFolderStr = _T("/");
+const wxChar *wxButtonNameStr = T("button");
+const wxChar *wxCanvasNameStr = T("canvas");
+const wxChar *wxCheckBoxNameStr = T("check");
+const wxChar *wxChoiceNameStr = T("choice");
+const wxChar *wxComboBoxNameStr = T("comboBox");
+const wxChar *wxDialogNameStr = T("dialog");
+const wxChar *wxFrameNameStr = T("frame");
+const wxChar *wxGaugeNameStr = T("gauge");
+const wxChar *wxStaticBoxNameStr = T("groupBox");
+const wxChar *wxListBoxNameStr = T("listBox");
+const wxChar *wxStaticTextNameStr = T("message");
+const wxChar *wxStaticBitmapNameStr = T("message");
+const wxChar *wxMultiTextNameStr = T("multitext");
+const wxChar *wxPanelNameStr = T("panel");
+const wxChar *wxRadioBoxNameStr = T("radioBox");
+const wxChar *wxRadioButtonNameStr = T("radioButton");
+const wxChar *wxBitmapRadioButtonNameStr = T("radioButton");
+const wxChar *wxScrollBarNameStr = T("scrollBar");
+const wxChar *wxSliderNameStr = T("slider");
+const wxChar *wxStaticNameStr = T("static");
+const wxChar *wxTextCtrlWindowNameStr = T("textWindow");
+const wxChar *wxTextCtrlNameStr = T("text");
+const wxChar *wxVirtListBoxNameStr = T("virtListBox");
+const wxChar *wxButtonBarNameStr = T("buttonbar");
+const wxChar *wxEnhDialogNameStr = T("Shell");
+const wxChar *wxToolBarNameStr = T("toolbar");
+const wxChar *wxStatusLineNameStr = T("status_line");
+const wxChar *wxGetTextFromUserPromptStr = T("Input Text");
+const wxChar *wxMessageBoxCaptionStr = T("Message");
+const wxChar *wxFileSelectorPromptStr = T("Select a file");
+const wxChar *wxFileSelectorDefaultWildcardStr = T("*.*");
+const wxChar *wxInternalErrorStr = T("wxWindows Internal Error");
+const wxChar *wxFatalErrorStr = T("wxWindows Fatal Error");
+const wxChar *wxTreeCtrlNameStr = T("treeCtrl");
+const wxChar *wxDirDialogNameStr = T("wxDirCtrl");
+const wxChar *wxDirDialogDefaultFolderStr = T("/");
// See wx/utils.h
-const wxChar *wxFloatToStringStr = _T("%.2f");
-const wxChar *wxDoubleToStringStr = _T("%.2f");
+const wxChar *wxFloatToStringStr = T("%.2f");
+const wxChar *wxDoubleToStringStr = T("%.2f");
#ifdef __WXMSW__
-const wxChar *wxUserResourceStr = _T("TEXT");
+const wxChar *wxUserResourceStr = T("TEXT(");
#endif
#if wxUSE_SHARED_LIBRARY
void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
{
- wxCHECK_RET( region.GetHRGN(), _T("invalid clipping region") );
+ wxCHECK_RET( region.GetHRGN(), T("invalid clipping region") );
wxRect box = region.GetBox();
}
else
{
- wxCHECK_RET( m_selectedBitmap.Ok(), _T("this DC can't be cleared") );
+ wxCHECK_RET( m_selectedBitmap.Ok(), T("this DC can't be cleared") );
rect.left = 0; rect.top = 0;
rect.right = m_selectedBitmap.GetWidth();
HDC memdc = ::CreateCompatibleDC( cdc );
HBITMAP hbitmap = (HBITMAP) bmp.GetHBITMAP( );
- wxASSERT_MSG( hbitmap, _T("bitmap is ok but HBITMAP is NULL?") );
+ wxASSERT_MSG( hbitmap, T("bitmap is ok but HBITMAP is NULL?") );
::SelectObject( memdc, hbitmap );
::BitBlt( cdc, x, y, bmp.GetWidth(), bmp.GetHeight(), memdc, 0, 0, SRCCOPY);
HFONT f = (HFONT) ::SelectObject(GetHdc(), (HFONT) m_font.GetResourceHandle());
if (f == (HFONT) NULL)
{
- wxLogDebug(_T("::SelectObject failed in wxDC::SetFont."));
+ wxLogDebug(T("::SelectObject failed in wxDC::SetFont."));
}
if (!m_oldFont)
m_oldFont = (WXHFONT) f;
wxPaintDC::wxPaintDC(wxWindow *canvas)
{
- wxCHECK_RET( canvas, _T("NULL canvas in wxPaintDC ctor") );
+ wxCHECK_RET( canvas, T("NULL canvas in wxPaintDC ctor") );
#ifdef __WXDEBUG__
if ( g_isPainting <= 0 )
{
- wxFAIL_MSG( _T("wxPaintDC may be created only in EVT_PAINT handler!") );
+ wxFAIL_MSG( T("wxPaintDC may be created only in EVT_PAINT handler!") );
return;
}
size_t index;
wxPaintDCInfo *info = FindInCache(&index);
- wxCHECK_RET( info, _T("existing DC should have a cache entry") );
+ wxCHECK_RET( info, T("existing DC should have a cache entry") );
if ( !--info->count )
{
// a device context
if (bitmap.GetSelectedInto() && (bitmap.GetSelectedInto() != this))
{
- wxFatalError(_T("Error in wxMemoryDC::SelectObject\nBitmap is selected in another wxMemoryDC.\nDelete the first wxMemoryDC or use SelectObject(NULL)"));
+ wxFatalError(T("Error in wxMemoryDC::SelectObject\nBitmap is selected in another wxMemoryDC.\nDelete the first wxMemoryDC or use SelectObject(NULL)"));
return;
}
if (bm == ERROR)
{
- wxFatalError(_T("Error in wxMemoryDC::SelectObject\nBitmap may not be loaded, or may be selected in another wxMemoryDC.\nDelete the first wxMemoryDC to deselect bitmap."));
+ wxFatalError(T("Error in wxMemoryDC::SelectObject\nBitmap may not be loaded, or may be selected in another wxMemoryDC.\nDelete the first wxMemoryDC to deselect bitmap."));
}
else if (!m_oldBitmap)
m_oldBitmap = (WXHBITMAP) bm;
{
m_isInteractive = interactive;
- if (!file.IsNull() && file != _T(""))
+ if (!file.IsNull() && file != T(""))
m_printData.SetFilename(file);
#if wxUSE_COMMON_DIALOGS
}
else
#endif
- if ((!driver_name.IsNull() && driver_name != _T("")) &&
- (!device_name.IsNull() && device_name != _T("")) &&
- (!file.IsNull() && file != _T("")))
+ if ((!driver_name.IsNull() && driver_name != T("")) &&
+ (!device_name.IsNull() && device_name != T("")) &&
+ (!file.IsNull() && file != T("")))
{
m_hDC = (WXHDC) CreateDC(WXSTRINGCAST driver_name, WXSTRINGCAST device_name, WXSTRINGCAST file, NULL);
m_ok = m_hDC ? TRUE: FALSE;
if (ret <= 0)
{
DWORD lastError = GetLastError();
- wxLogDebug(_T("wxDC::StartDoc failed with error: %d\n"), lastError);
+ wxLogDebug(T("wxDC::StartDoc failed with error: %d\n"), lastError);
}
#endif
GlobalFree(pd.hDevMode);
pd.hDevMode=NULL;
}
- return ( deviceName != _T("") );
+ return ( deviceName != T("") );
}
#if 0
wxChar* deviceName;
wxChar* portName = (wxChar*) NULL; // Obsolete in WIN32
- if (devNameStr == _T(""))
+ if (devNameStr == T(""))
deviceName = (wxChar*) NULL;
else
deviceName = WXSTRINGCAST devNameStr;
if ( hDevMode )
lpDevMode = (DEVMODE*) GlobalLock(hDevMode);
- if (devNameStr == _T(""))
+ if (devNameStr == T(""))
{
// Retrieve the default device name
wxString portName;
bool ret = wxGetDefaultDeviceName(devNameStr, portName);
- wxASSERT_MSG( ret, _T("Could not get default device name.") );
+ wxASSERT_MSG( ret, T("Could not get default device name.") );
deviceName = WXSTRINGCAST devNameStr;
}
wxDDEServer::~wxDDEServer(void)
{
- if (m_serviceName != _T(""))
+ if (m_serviceName != T(""))
{
HSZ serviceName = DdeCreateStringHandle(DDEIdInst, WXSTRINGCAST m_serviceName, CP_WINANSI);
if (DdeNameService(DDEIdInst, serviceName, NULL, DNS_UNREGISTER) == 0)
switch (DdeGetLastError(DDEIdInst))
{
case DMLERR_ADVACKTIMEOUT:
- err = _T("A request for a synchronous advise transaction has timed out.");
+ err = T("A request for a synchronous advise transaction has timed out.");
break;
case DMLERR_BUSY:
- err = _T("The response to the transaction caused the DDE_FBUSY bit to be set.");
+ err = T("The response to the transaction caused the DDE_FBUSY bit to be set.");
break;
case DMLERR_DATAACKTIMEOUT:
- err = _T("A request for a synchronous data transaction has timed out.");
+ err = T("A request for a synchronous data transaction has timed out.");
break;
case DMLERR_DLL_NOT_INITIALIZED:
- err = _T("A DDEML function was called without first calling the DdeInitialize function,\n\ror an invalid instance identifier\n\rwas passed to a DDEML function.");
+ err = T("A DDEML function was called without first calling the DdeInitialize function,\n\ror an invalid instance identifier\n\rwas passed to a DDEML function.");
break;
case DMLERR_DLL_USAGE:
- err = _T("An application initialized as APPCLASS_MONITOR has\n\rattempted to perform a DDE transaction,\n\ror an application initialized as APPCMD_CLIENTONLY has \n\rattempted to perform server transactions.");
+ err = T("An application initialized as APPCLASS_MONITOR has\n\rattempted to perform a DDE transaction,\n\ror an application initialized as APPCMD_CLIENTONLY has \n\rattempted to perform server transactions.");
break;
case DMLERR_EXECACKTIMEOUT:
- err = _T("A request for a synchronous execute transaction has timed out.");
+ err = T("A request for a synchronous execute transaction has timed out.");
break;
case DMLERR_INVALIDPARAMETER:
- err = _T("A parameter failed to be validated by the DDEML.");
+ err = T("A parameter failed to be validated by the DDEML.");
break;
case DMLERR_LOW_MEMORY:
- err = _T("A DDEML application has created a prolonged race condition.");
+ err = T("A DDEML application has created a prolonged race condition.");
break;
case DMLERR_MEMORY_ERROR:
- err = _T("A memory allocation failed.");
+ err = T("A memory allocation failed.");
break;
case DMLERR_NO_CONV_ESTABLISHED:
- err = _T("A client's attempt to establish a conversation has failed.");
+ err = T("A client's attempt to establish a conversation has failed.");
break;
case DMLERR_NOTPROCESSED:
- err = _T("A transaction failed.");
+ err = T("A transaction failed.");
break;
case DMLERR_POKEACKTIMEOUT:
- err = _T("A request for a synchronous poke transaction has timed out.");
+ err = T("A request for a synchronous poke transaction has timed out.");
break;
case DMLERR_POSTMSG_FAILED:
- err = _T("An internal call to the PostMessage function has failed. ");
+ err = T("An internal call to the PostMessage function has failed. ");
break;
case DMLERR_REENTRANCY:
- err = _T("Reentrancy problem.");
+ err = T("Reentrancy problem.");
break;
case DMLERR_SERVER_DIED:
- err = _T("A server-side transaction was attempted on a conversation\n\rthat was terminated by the client, or the server\n\rterminated before completing a transaction.");
+ err = T("A server-side transaction was attempted on a conversation\n\rthat was terminated by the client, or the server\n\rterminated before completing a transaction.");
break;
case DMLERR_SYS_ERROR:
- err = _T("An internal error has occurred in the DDEML.");
+ err = T("An internal error has occurred in the DDEML.");
break;
case DMLERR_UNADVACKTIMEOUT:
- err = _T("A request to end an advise transaction has timed out.");
+ err = T("A request to end an advise transaction has timed out.");
break;
case DMLERR_UNFOUND_QUEUE_ID:
- err = _T("An invalid transaction identifier was passed to a DDEML function.\n\rOnce the application has returned from an XTYP_XACT_COMPLETE callback,\n\rthe transaction identifier for that callback is no longer valid.");
+ err = T("An invalid transaction identifier was passed to a DDEML function.\n\rOnce the application has returned from an XTYP_XACT_COMPLETE callback,\n\rthe transaction identifier for that callback is no longer valid.");
break;
default:
- err = _T("Unrecognised error type.");
+ err = T("Unrecognised error type.");
break;
}
- MessageBox((HWND) NULL, (LPCTSTR)err, _T("DDE Error"), MB_OK | MB_ICONINFORMATION);
+ MessageBox((HWND) NULL, (LPCTSTR)err, T("DDE Error"), MB_OK | MB_ICONINFORMATION);
}
#endif
// otherwise it would look too strange)
const wxChar *dlg;
if ( style & wxRESIZE_BORDER )
- dlg = _T("wxResizeableDialog");
+ dlg = T("wxResizeableDialog");
else if ( style & wxCAPTION )
- dlg = _T("wxCaptionDialog");
+ dlg = T("wxCaptionDialog");
else
- dlg = _T("wxNoCaptionDialog");
+ dlg = T("wxNoCaptionDialog");
MSWCreate(m_windowId, parent, NULL, this, NULL,
x, y, width, height,
0, // style is not used if we have dlg template
const wxString& password,
bool async)
{
- wxCHECK_MSG( IsOk(), FALSE, _T("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") );
if ( ms_hRasConnection )
{
- wxFAIL_MSG(_T("there is already an active connection"));
+ wxFAIL_MSG(T("there is already an active connection"));
return TRUE;
}
return FALSE;
}
- wxASSERT_MSG( ms_hRasConnection, _T("dialing but no connection?") );
+ wxASSERT_MSG( ms_hRasConnection, T("dialing but no connection?") );
ms_dialer = NULL;
bool wxDialUpManagerMSW::HangUp()
{
- wxCHECK_MSG( IsOk(), FALSE, _T("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") );
// we may terminate either the connection we initiated or another one which
// is active now
bool wxDialUpManagerMSW::IsOnline() const
{
- wxCHECK_MSG( IsOk(), FALSE, _T("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") );
if ( ms_userSpecifiedOnlineStatus != -1 )
{
void wxDialUpManagerMSW::SetOnlineStatus(bool isOnline)
{
- wxCHECK_RET( IsOk(), _T("using uninitialized wxDialUpManager") );
+ wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") );
ms_userSpecifiedOnlineStatus = isOnline;
}
bool wxDialUpManagerMSW::EnableAutoCheckOnlineStatus(size_t nSeconds)
{
- wxCHECK_MSG( IsOk(), FALSE, _T("using uninitialized wxDialUpManager") );
+ wxCHECK_MSG( IsOk(), FALSE, T("using uninitialized wxDialUpManager") );
bool ok = ms_pfnRasConnectionNotification != 0;
if ( dwRet != 0 )
{
- wxLogDebug(_T("RasConnectionNotification() failed: %s"),
+ wxLogDebug(T("RasConnectionNotification() failed: %s"),
GetErrorString(dwRet));
CleanUpThreadData();
void wxDialUpManagerMSW::DisableAutoCheckOnlineStatus()
{
- wxCHECK_RET( IsOk(), _T("using uninitialized wxDialUpManager") );
+ wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") );
if ( m_hThread )
{
void wxDialUpManagerMSW::SetWellKnownHost(const wxString& WXUNUSED(hostname),
int WXUNUSED(port))
{
- wxCHECK_RET( IsOk(), _T("using uninitialized wxDialUpManager") );
+ wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") );
// nothing to do - we don't use this
}
void wxDialUpManagerMSW::SetConnectCommand(const wxString& WXUNUSED(dial),
const wxString& WXUNUSED(hangup))
{
- wxCHECK_RET( IsOk(), _T("using uninitialized wxDialUpManager") );
+ wxCHECK_RET( IsOk(), T("using uninitialized wxDialUpManager") );
// nothing to do - we don't use this
}
{
wxDialUpManagerMSW *dialUpManager = wxDialUpManagerMSW::GetDialer();
- wxCHECK_RET( dialUpManager, _T("who started to dial then?") );
+ wxCHECK_RET( dialUpManager, T("who started to dial then?") );
dialUpManager->OnDialProgress(rasconnstate, dwError);
}
/* Header signatutes for various resources */
#define BFT_ICON 0x4349 /* 'IC' */
#define BFT_BITMAP 0x4d42 /* 'BM' */
-#define BFT_CURSOR 0x5450 /* 'PT' */
+#define BFT_CURSOR 0x5450 /* 'PT(' */
/* macro to determine if resource is a DIB */
#define ISDIB(bft) ((bft) == BFT_BITMAP)
fh = OpenFile (wxFNCONV(lpFileName), &of, OF_READ);
if (fh == -1) {
- wsprintf(str,_T("Can't open file '%s'"), lpFileName);
- MessageBox(NULL, str, _T("Error"), MB_ICONSTOP | MB_OK);
+ wsprintf(str,T("Can't open file '%s'"), lpFileName);
+ MessageBox(NULL, str, T("Error"), MB_ICONSTOP | MB_OK);
return (0);
}
#define BFT_ICON 0x4349 /* 'IC' */
#define BFT_BITMAP 0x4d42 /* 'BM' */
-#define BFT_CURSOR 0x5450 /* 'PT' */
+#define BFT_CURSOR 0x5450 /* 'PT(' */
#ifndef SEEK_CUR
/* flags for _lseek */
// Begin drag
bool wxDragImage::BeginDrag(const wxPoint& hotspot, wxWindow* WXUNUSED(window))
{
- wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in BeginDrag."));
+ wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in BeginDrag."));
bool ret = (ImageList_BeginDrag((HIMAGELIST) m_hImageList, 0, hotspot.x, hotspot.y) != 0);
- wxASSERT_MSG( (ret), _T("BeginDrag failed."));
+ wxASSERT_MSG( (ret), T("BeginDrag failed."));
if (!ret)
return FALSE;
// First add the cursor to the image list
int cursorIndex = ImageList_AddIcon((HIMAGELIST) m_hImageList, (HICON) m_cursor.GetHCURSOR());
- wxASSERT_MSG( (cursorIndex != -1), _T("ImageList_AddIcon failed in BeginDrag."));
+ wxASSERT_MSG( (cursorIndex != -1), T("ImageList_AddIcon failed in BeginDrag."));
if (cursorIndex != -1)
{
// End drag
bool wxDragImage::EndDrag(wxWindow* WXUNUSED(window))
{
- wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in EndDrag."));
+ wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in EndDrag."));
ImageList_EndDrag();
// is non-NULL, or in screen coordinates if NULL.
bool wxDragImage::Move(const wxPoint& pt, wxWindow* window)
{
- wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in Move."));
+ wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in Move."));
// TODO: what coordinates are these in: window, client, or screen?
bool ret = (ImageList_DragMove( pt.x, pt.y ) != 0);
bool wxDragImage::Show(wxWindow* window)
{
- wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in Show."));
+ wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in Show."));
HWND hWnd = 0;
if (window)
bool wxDragImage::Hide(wxWindow* window)
{
- wxASSERT_MSG( (m_hImageList != 0), _T("Image list must not be null in Hide."));
+ wxASSERT_MSG( (m_hImageList != 0), T("Image list must not be null in Hide."));
HWND hWnd = 0;
if (window)
wxString filter2;
if ( defaultExtension && !filter )
- filter2 = wxString(_T("*.")) + defaultExtension;
+ filter2 = wxString(T("*.")) + defaultExtension;
else if ( filter )
filter2 = filter;
for( unsigned int i = 0; i < filter2.Len(); i++ )
{
- if( filter2.GetChar(i) == _T('|') )
+ if( filter2.GetChar(i) == T('|') )
{
// save the start index of the new filter
unsigned int is = i++;
// find the end of the filter
for( ; i < filter2.Len(); i++ )
{
- if(filter2[i] == _T('|'))
+ if(filter2[i] == T('|'))
break;
}
int y)
{
- wxFileDialog fileDialog(parent, title ? title : _T(""), defaultDir ? defaultDir : _T(""),
- defaultFileName ? defaultFileName : _T(""), filter ? filter : _T(""), flags, wxPoint(x, y));
+ wxFileDialog fileDialog(parent, title ? title : T(""), defaultDir ? defaultDir : T(""),
+ defaultFileName ? defaultFileName : T(""), filter ? filter : T(""), flags, wxPoint(x, y));
if ( fileDialog.ShowModal() == wxID_OK )
{
m_message = message;
m_dialogStyle = style;
m_parent = parent;
- m_path = _T("");
+ m_path = T("");
m_fileName = defaultFileName;
m_dir = defaultDir;
m_wildCard = wildCard;
static wxChar fileNameBuffer [ MAXPATH ]; // the file-name
wxChar titleBuffer [ MAXFILE+1+MAXEXT ]; // the file-name, without path
- *fileNameBuffer = _T('\0');
- *titleBuffer = _T('\0');
+ *fileNameBuffer = T('\0');
+ *titleBuffer = T('\0');
long msw_flags = 0;
if ( (m_dialogStyle & wxHIDE_READONLY) || (m_dialogStyle & wxSAVE) )
size_t i = 0;
size_t len = m_dir.Length();
for (i = 0; i < len; i++)
- if (m_dir[i] == _T('/'))
- m_dir[i] = _T('\\');
+ if (m_dir[i] == T('/'))
+ m_dir[i] = T('\\');
of.lpstrInitialDir = m_dir.c_str();
wxString theFilter;
if ( wxStrlen(m_wildCard) == 0 )
- theFilter = wxString(_T("*.*"));
+ theFilter = wxString(T("*.*"));
else
theFilter = m_wildCard ;
wxString filterBuffer;
- if ( !wxStrchr( theFilter, _T('|') ) ) { // only one filter ==> default text
+ if ( !wxStrchr( theFilter, T('|') ) ) { // only one filter ==> default text
filterBuffer.Printf(_("Files (%s)|%s"),
theFilter.c_str(), theFilter.c_str());
}
}
- filterBuffer += _T("|");
+ filterBuffer += T("|");
// Replace | with \0
for (i = 0; i < filterBuffer.Len(); i++ ) {
- if ( filterBuffer.GetChar(i) == _T('|') ) {
- filterBuffer[i] = _T('\0');
+ if ( filterBuffer.GetChar(i) == T('|') ) {
+ filterBuffer[i] = T('\0');
}
}
//=== Setting defaultFileName >>=========================================
wxStrncpy( fileNameBuffer, (const wxChar *)m_fileName, MAXPATH-1 );
- fileNameBuffer[ MAXPATH-1 ] = _T('\0');
+ fileNameBuffer[ MAXPATH-1 ] = T('\0');
of.lpstrFile = fileNameBuffer; // holds returned filename
of.nMaxFile = MAXPATH;
m_filterIndex = (int)of.nFilterIndex;
- if ( of.nFileExtension && fileNameBuffer[ of.nFileExtension-1] != _T('.') )
+ if ( of.nFileExtension && fileNameBuffer[ of.nFileExtension-1] != T('.') )
{ // user has typed an filename
// without an extension:
extension = extension + wxStrlen( extension ) +1;
}
- extension = wxStrrchr( extension, _T('.') );
+ extension = wxStrrchr( extension, T('.') );
if ( extension // != "blabla"
- && !wxStrrchr( extension, _T('*') ) // != "blabla.*"
- && !wxStrrchr( extension, _T('?') ) // != "blabla.?"
+ && !wxStrrchr( extension, T('*') ) // != "blabla.*"
+ && !wxStrrchr( extension, T('?') ) // != "blabla.?"
&& extension[1] // != "blabla."
- && extension[1] != _T(' ') ) // != "blabla. "
+ && extension[1] != T(' ') ) // != "blabla. "
{
// now concat extension to the fileName:
m_fileName = wxString(fileNameBuffer) + extension;
int len = wxStrlen( fileNameBuffer );
wxStrncpy( fileNameBuffer + len, extension, MAXPATH - len );
- fileNameBuffer[ MAXPATH -1 ] = _T('\0');
+ fileNameBuffer[ MAXPATH -1 ] = T('\0');
}
}
if ( dwErr != 0 )
{
// this msg is only for developers
- wxLogError(_T("Common dialog failed with error code %0lx."),
+ wxLogError(T("Common dialog failed with error code %0lx."),
dwErr);
}
//else: it was just cancelled
prompt.Printf(str, what);
const wxChar *ext = extension;
- if (*ext == _T('.'))
+ if (*ext == T('.'))
ext++;
wxString wild;
- wild.Printf(_T("*.%s"), ext);
+ wild.Printf(T("*.%s"), ext);
return wxFileSelector (prompt, NULL, default_name, ext, wild, 0, parent);
}
{
// VZ: the old code returned FALSE in this case, but it doesn't seem
// to make sense because the font _was_ created
- wxLogDebug(_T("Calling wxFont::RealizeResource() twice"));
+ wxLogDebug(T("Calling wxFont::RealizeResource() twice"));
return TRUE;
}
{
case wxSCRIPT:
ff_family = FF_SCRIPT ;
- ff_face = _T("Script") ;
+ ff_face = T("Script") ;
break ;
case wxDECORATIVE:
case wxROMAN:
ff_family = FF_ROMAN;
- ff_face = _T("Times New Roman") ;
+ ff_face = T("Times New Roman") ;
break;
case wxTELETYPE:
case wxMODERN:
ff_family = FF_MODERN;
- ff_face = _T("Courier New") ;
+ ff_face = T("Courier New") ;
break;
case wxSWISS:
ff_family = FF_SWISS;
- ff_face = _T("Arial") ;
+ ff_face = T("Arial") ;
break;
case wxDEFAULT:
default:
ff_family = FF_SWISS;
- ff_face = _T("Arial") ;
+ ff_face = T("Arial") ;
}
BYTE ff_italic;
break;
default:
- wxFAIL_MSG(_T("unknown font slant"));
+ wxFAIL_MSG(T("unknown font slant"));
// fall through
case wxNORMAL:
switch ( M_FONTDATA->m_weight )
{
default:
- wxFAIL_MSG(_T("unknown font weight"));
+ wxFAIL_MSG(T("unknown font weight"));
// fall through
case wxNORMAL:
break;
default:
- wxFAIL_MSG(_T("unsupported encoding"));
+ wxFAIL_MSG(T("unsupported encoding"));
// fall through
case wxFONTENCODING_SYSTEM:
{
// VZ: calling CreateStatusBar twice is an error - why anyone would do it?
wxCHECK_MSG( m_frameStatusBar == NULL, FALSE,
- _T("recreating status bar in wxFrame") );
+ T("recreating status bar in wxFrame") );
m_frameStatusBar = OnCreateStatusBar(number, style, id,
name);
void wxFrame::SetStatusText(const wxString& text, int number)
{
- wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set text for") );
+ wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set text for") );
m_frameStatusBar->SetStatusText(text, number);
}
void wxFrame::SetStatusWidths(int n, const int widths_field[])
{
- wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set widths for") );
+ wxCHECK_RET( m_frameStatusBar != NULL, T("no statusbar to set widths for") );
m_frameStatusBar->SetStatusWidths(n, widths_field);
PositionStatusBar();
return;
}
- wxCHECK_RET( !menu_bar->GetFrame(), _T("this menubar is already attached") );
+ wxCHECK_RET( !menu_bar->GetFrame(), T("this menubar is already attached") );
if (m_frameMenuBar)
delete m_frameMenuBar;
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{
wxCHECK_MSG( m_frameToolBar == NULL, FALSE,
- _T("recreating toolbar in wxFrame") );
+ T("recreating toolbar in wxFrame") );
wxToolBar* toolBar = OnCreateToolBar(style, id, name);
if (toolBar)
msFlags |= ZYZGS_3D;
HWND wx_button =
- CreateWindowEx(MakeExtendedStyle(m_windowStyle), _T("zYzGauge"), NULL, msFlags,
+ CreateWindowEx(MakeExtendedStyle(m_windowStyle), T("zYzGauge"), NULL, msFlags,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
/* static global variables */
-static wxChar gszzYzGaugeClass[] = _T("zYzGauge");
+static wxChar gszzYzGaugeClass[] = T("zYzGauge");
/* window word position definitions */
/* Get a DC to determine whether device is mono or not, and set
* default foreground/background colors as appropriate.
*/
- hdc = CreateIC(_T("DISPLAY"), NULL, NULL, 0L) ;
+ hdc = CreateIC(T("DISPLAY"), NULL, NULL, 0L) ;
if (hdc)
{
/* check for mono-display */
hFont = (HFONT) SelectObject(hdc, pgauge->hFont);
/* build up a string to blit out--ie the meaning of life: "42%" */
- wsprintf(ach, _T("%3d%%"), (WORD)((DWORD)iPos * 100 / iRange));
+ wsprintf(ach, T("%3d%%"), (WORD)((DWORD)iPos * 100 / iRange));
/* Win32s has no GetTextExtent(); let's try GetTextExtentPoint() instead */
#if defined(__WIN32__)
GetTextExtentPoint(hdc, ach, wGomerX = lstrlen(ach), &size);
bool wxWinHelpController::DisplayContents(void)
{
- if (m_helpFile == _T("")) return FALSE;
+ if (m_helpFile == T("")) return FALSE;
wxString str = m_helpFile;
size_t len = str.Length();
- if (!(str[(size_t)(len-1)] == _T('p') && str[(size_t)(len-2)] == _T('l') && str[(size_t)(len-3)] == _T('h') && str[(size_t)(len-4)] == _T('.')))
- str += _T(".hlp");
+ if (!(str[(size_t)(len-1)] == T('p') && str[(size_t)(len-2)] == T('l') && str[(size_t)(len-3)] == T('h') && str[(size_t)(len-4)] == T('.')))
+ str += T(".hlp");
if (wxTheApp->GetTopWindow())
{
bool wxWinHelpController::DisplaySection(int section)
{
// Use context number
- if (m_helpFile == _T("")) return FALSE;
+ if (m_helpFile == T("")) return FALSE;
wxString str = m_helpFile;
size_t len = str.Length();
- if (!(str[(size_t)(len-1)] == _T('p') && str[(size_t)(len-2)] == _T('l') && str[(size_t)(len-3)] == _T('h') && str[(size_t)(len-4)] == _T('.')))
- str += _T(".hlp");
+ if (!(str[(size_t)(len-1)] == T('p') && str[(size_t)(len-2)] == T('l') && str[(size_t)(len-3)] == T('h') && str[(size_t)(len-4)] == T('.')))
+ str += T(".hlp");
if (wxTheApp->GetTopWindow())
{
bool wxWinHelpController::DisplayBlock(long block)
{
// Use context number -- a very rough equivalent to block id!
- if (m_helpFile == _T("")) return FALSE;
+ if (m_helpFile == T("")) return FALSE;
wxString str = m_helpFile;
size_t len = str.Length();
if (!(str[(size_t)(len-1)] == 'p' && str[(size_t)(len-2)] == 'l' && str[(size_t)(len-3)] == 'h' && str[(size_t)(len-4)] == '.'))
- str += _T(".hlp");
+ str += T(".hlp");
if (wxTheApp->GetTopWindow())
{
bool wxWinHelpController::KeywordSearch(const wxString& k)
{
- if (m_helpFile == _T("")) return FALSE;
+ if (m_helpFile == T("")) return FALSE;
wxString str = m_helpFile;
size_t len = str.Length();
- if (!(str[(size_t)(len-1)] == _T('p') && str[(size_t)(len-2)] == _T('l') && str[(size_t)(len-3)] == _T('h') && str[(size_t)(len-4)] == _T('.')))
- str += _T(".hlp");
+ if (!(str[(size_t)(len-1)] == T('p') && str[(size_t)(len-2)] == T('l') && str[(size_t)(len-3)] == T('h') && str[(size_t)(len-4)] == T('.')))
+ str += T(".hlp");
if (wxTheApp->GetTopWindow())
{
event.m_commandInt = aSelections[0] ;
event.m_clientData = GetClientData(event.m_commandInt);
wxString str(GetString(event.m_commandInt));
- if (str != _T(""))
+ if (str != T(""))
{
event.m_commandString = str;
}
wstyle |= WS_BORDER;
}
- m_hWnd = (WXHWND)::CreateWindowEx(exStyle, _T("LISTBOX"), NULL,
+ m_hWnd = (WXHWND)::CreateWindowEx(exStyle, T("LISTBOX"), NULL,
wstyle | WS_CHILD,
0, 0, 0, 0,
(HWND)parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
- wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create listbox") );
+ wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create listbox") );
#if wxUSE_CTL3D
if (want3D)
void wxListBox::SetFirstItem(int N)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- _T("invalid index in wxListBox::SetFirstItem") );
+ T("invalid index in wxListBox::SetFirstItem") );
SendMessage(GetHwnd(),LB_SETTOPINDEX,(WPARAM)N,(LPARAM)0) ;
}
void wxListBox::Delete(int N)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- _T("invalid index in wxListBox::Delete") );
+ T("invalid index in wxListBox::Delete") );
SendMessage(GetHwnd(), LB_DELETESTRING, N, 0);
m_noItems--;
if ( m_windowStyle & wxLB_OWNERDRAW ) {
// client data must be pointer to wxOwnerDrawn, otherwise we would crash
// in OnMeasure/OnDraw.
- wxFAIL_MSG(_T("Can't use client data with owner-drawn listboxes"));
+ wxFAIL_MSG(T("Can't use client data with owner-drawn listboxes"));
}
else
#endif
ListBox_SetItemData(GetHwnd(), ui, pNewItem);
wxASSERT_MSG(clientData[ui] == NULL,
- _T("Can't use client data with owner-drawn listboxes"));
+ T("Can't use client data with owner-drawn listboxes"));
}
}
#endif
void wxListBox::SetSelection(int N, bool select)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- _T("invalid index in wxListBox::SetSelection") );
+ T("invalid index in wxListBox::SetSelection") );
if ((m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED))
SendMessage(GetHwnd(), LB_SETSEL, select, N);
bool wxListBox::Selected(int N) const
{
wxCHECK_MSG( N >= 0 && N < m_noItems, FALSE,
- _T("invalid index in wxListBox::Selected") );
+ T("invalid index in wxListBox::Selected") );
return SendMessage(GetHwnd(), LB_GETSEL, N, 0) == 0 ? FALSE : TRUE;
}
void wxListBox::Deselect(int N)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- _T("invalid index in wxListBox::Deselect") );
+ T("invalid index in wxListBox::Deselect") );
if ((m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED))
SendMessage(GetHwnd(), LB_SETSEL, FALSE, N);
void *wxListBox::GetClientData(int N) const
{
wxCHECK_MSG( N >= 0 && N < m_noItems, NULL,
- _T("invalid index in wxListBox::GetClientData") );
+ T("invalid index in wxListBox::GetClientData") );
return (void *)SendMessage(GetHwnd(), LB_GETITEMDATA, N, 0);
}
void wxListBox::SetClientData(int N, void *Client_data)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- _T("invalid index in wxListBox::SetClientData") );
+ T("invalid index in wxListBox::SetClientData") );
if ( ListBox_SetItemData(GetHwnd(), N, Client_data) == LB_ERR )
- wxLogDebug(_T("LB_SETITEMDATA failed"));
+ wxLogDebug(T("LB_SETITEMDATA failed"));
}
// Return number of selections and an array of selected integers
if (no_sel != 0) {
int *selections = new int[no_sel];
if ( ListBox_GetSelItems(GetHwnd(), no_sel, selections) == LB_ERR ) {
- wxFAIL_MSG(_T("This listbox can't have single-selection style!"));
+ wxFAIL_MSG(T("This listbox can't have single-selection style!"));
}
aSelections.Alloc(no_sel);
wxCHECK_MSG( !(m_windowStyle & wxLB_MULTIPLE) &&
!(m_windowStyle & wxLB_EXTENDED),
-1,
- _T("GetSelection() can't be used with multiple-selection "
+ T("GetSelection() can't be used with multiple-selection "
"listboxes, use GetSelections() instead.") );
return ListBox_GetCurSel(GetHwnd());
wxString wxListBox::GetString(int N) const
{
wxCHECK_MSG( N >= 0 && N < m_noItems, "",
- _T("invalid index in wxListBox::GetClientData") );
+ T("invalid index in wxListBox::GetClientData") );
int len = ListBox_GetTextLen(GetHwnd(), N);
return;
TEXTMETRIC lpTextMetric;
- if (s != _T(""))
+ if (s != T(""))
{
int existingExtent = (int)SendMessage(GetHwnd(), LB_GETHORIZONTALEXTENT, 0, 0L);
HDC dc = GetWindowDC(GetHwnd());
wxListBox::InsertItems(int nItems, const wxString items[], int pos)
{
wxCHECK_RET( pos >= 0 && pos <= m_noItems,
- _T("invalid index in wxListBox::InsertItems") );
+ T("invalid index in wxListBox::InsertItems") );
int i;
for (i = 0; i < nItems; i++)
ListBox_InsertString(GetHwnd(), i + pos, items[i]);
m_noItems += nItems;
- SetHorizontalExtent(_T(""));
+ SetHorizontalExtent(T(""));
}
void wxListBox::SetString(int N, const wxString& s)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
- _T("invalid index in wxListBox::SetString") );
+ T("invalid index in wxListBox::SetString") );
int sel = -1;
if (!(m_windowStyle & wxLB_MULTIPLE) && !(m_windowStyle & wxLB_EXTENDED))
MEASUREITEMSTRUCT *pStruct = (MEASUREITEMSTRUCT *)item;
wxDC dc;
- dc.SetHDC((WXHDC)CreateIC(_T("DISPLAY"), NULL, NULL, 0));
+ dc.SetHDC((WXHDC)CreateIC(T("DISPLAY"), NULL, NULL, 0));
dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_ANSI_VAR_FONT));
pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE;
// Create the ListView control.
m_hWnd = (WXHWND)CreateWindowEx(exStyle,
WC_LISTVIEW,
- _T(""),
+ T(""),
wstyle,
x, y, w, h,
GetWinHwnd(GetParent()),
if ( !m_hWnd )
{
- wxLogError(_T("Can't create list control window."));
+ wxLogError(T("Can't create list control window."));
return FALSE;
}
m_colCount--;
}
- wxASSERT_MSG( m_colCount == 0, _T("no columns should be left") );
+ wxASSERT_MSG( m_colCount == 0, T("no columns should be left") );
return TRUE;
}
}
else
{
- wxLogDebug(_T("Failed to insert the column '%s' into listview!"),
+ wxLogDebug(T("Failed to insert the column '%s' into listview!"),
lvCol.pszText);
}
int width = size.x;
int height = size.y;
- m_windowMenu = (WXHMENU) ::LoadMenu(wxGetInstance(), _T("wxWindowMenu"));
+ m_windowMenu = (WXHMENU) ::LoadMenu(wxGetInstance(), T("wxWindowMenu"));
DWORD msflags = WS_OVERLAPPED;
if (style & wxMINIMIZE_BOX)
{
// this shouldn't happen because it means that our messages are being
// lost (they're not sent to the parent frame nor to the children)
- wxFAIL_MSG(_T("MDI parent frame is not active, "
+ wxFAIL_MSG(T("MDI parent frame is not active, "
"yet there is no active MDI child?"));
}
else if ( m_hWnd == hwndDeact )
{
wxASSERT_MSG( parent->m_currentChild == this,
- _T("can't deactivate MDI child which wasn't active!") );
+ T("can't deactivate MDI child which wasn't active!") );
activated = FALSE;
parent->m_currentChild = NULL;
m_hWnd = (WXHWND)::CreateWindowEx
(
exStyle,
- _T("MDICLIENT"),
+ T("MDICLIENT("),
NULL,
msStyle,
0, 0, 0, 0,
// update menu bar of the parent window
wxWindow *parent = win->GetParent();
- wxCHECK_RET( parent, _T("MDI client without parent frame? weird...") );
+ wxCHECK_RET( parent, T("MDI client without parent frame? weird...") );
::DrawMenuBar(GetWinHwnd(parent));
}
int chars = GetMenuString(hmenu, i, buf, WXSIZEOF(buf), MF_BYPOSITION);
if ( chars == 0 )
{
- wxLogLastError(_T("GetMenuString"));
+ wxLogLastError(T("GetMenuString"));
continue;
}
- if ( wxStripMenuCodes(wxString(buf)).IsSameAs(_T("Help")) )
+ if ( wxStripMenuCodes(wxString(buf)).IsSameAs(T("Help")) )
{
success = TRUE;
::InsertMenu(hmenu, i, MF_BYPOSITION | MF_POPUP | MF_STRING,
- (UINT)subMenu, _T("&Window"));
+ (UINT)subMenu, T("&Window"));
break;
}
}
if ( !success )
{
- ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, _T("&Window"));
+ ::AppendMenu(hmenu, MF_POPUP, (UINT)subMenu, T("&Window"));
}
MDISetMenu(win, hmenu, subMenu);
// function appends a new item or submenu to the menu
void wxMenu::Append(wxMenuItem *pItem)
{
- wxCHECK_RET( pItem != NULL, _T("can't append NULL item to the menu") );
+ wxCHECK_RET( pItem != NULL, T("can't append NULL item to the menu") );
#if wxUSE_ACCEL
// check for accelerators: they are given after '\t'
wxString label = pItem->GetName();
- int posTab = label.Find(_T('\t'));
+ int posTab = label.Find(T('\t'));
if ( posTab != wxNOT_FOUND ) {
// parse the accelerator string
int keyCode = 0;
else if ( current == _("shift") )
accelFlags |= wxACCEL_SHIFT;
else {
- wxLogDebug(_T("Unknown accel modifier: '%s'"),
+ wxLogDebug(T("Unknown accel modifier: '%s'"),
current.c_str());
}
}
if ( current.IsEmpty() ) {
- wxLogDebug(_T("No accel key found, accel string ignored."));
+ wxLogDebug(T("No accel key found, accel string ignored."));
}
else {
if ( current.Len() == 1 ) {
(current.Len() == 2 ||
(current.Len() == 3 && isdigit(current[2U]))) ) {
int n;
- wxSscanf(current.c_str() + 1, _T("%d"), &n);
+ wxSscanf(current.c_str() + 1, T("%d"), &n);
keyCode = VK_F1 + n - 1;
}
else {
- wxLogDebug(_T("Unrecognized accel key '%s', accel "
+ wxLogDebug(T("Unrecognized accel key '%s', accel "
"string ignored."), current.c_str());
}
}
if ( !SetMenuItemInfo(GetHmenu(), (unsigned)id, FALSE, &mii) )
{
- wxLogLastError(_T("SetMenuItemInfo"));
+ wxLogLastError(T("SetMenuItemInfo"));
}
}
#endif // __WIN32__
break;
}
- wxCHECK_RET( node, _T("wxMenu::Delete(): item doesn't exist") );
+ wxCHECK_RET( node, T("wxMenu::Delete(): item doesn't exist") );
HMENU menu = GetHmenu();
void wxMenu::Enable(int id, bool Flag)
{
wxMenuItem *item = FindItemForId(id);
- wxCHECK_RET( item != NULL, _T("can't enable non-existing menu item") );
+ wxCHECK_RET( item != NULL, T("can't enable non-existing menu item") );
item->Enable(Flag);
}
bool wxMenu::IsEnabled(int id) const
{
wxMenuItem *item = FindItemForId(id);
- wxCHECK_MSG( item != NULL, FALSE, _T("invalid item id") );
+ wxCHECK_MSG( item != NULL, FALSE, T("invalid item id") );
return item->IsEnabled();
}
void wxMenu::Check(int id, bool Flag)
{
wxMenuItem *item = FindItemForId(id);
- wxCHECK_RET( item != NULL, _T("can't get status of non-existing menu item") );
+ wxCHECK_RET( item != NULL, T("can't get status of non-existing menu item") );
item->Check(Flag);
}
bool wxMenu::IsChecked(int id) const
{
wxMenuItem *item = FindItemForId(id);
- wxCHECK_MSG( item != NULL, FALSE, _T("invalid item id") );
+ wxCHECK_MSG( item != NULL, FALSE, T("invalid item id") );
return item->IsChecked();
}
void wxMenu::SetLabel(int id, const wxString& label)
{
wxMenuItem *item = FindItemForId(id) ;
- wxCHECK_RET( item, _T("wxMenu::SetLabel: no such item") );
+ wxCHECK_RET( item, T("wxMenu::SetLabel: no such item") );
item->SetName(label);
}
if (pItem)
label = pItem->GetName() ;
else
- wxFAIL_MSG(_T("wxMenu::GetLabel: item doesn't exist"));
+ wxFAIL_MSG(T("wxMenu::GetLabel: item doesn't exist"));
return label;
}
if (item)
item->SetHelp(helpString);
else
- wxFAIL_MSG(_T("wxMenu::SetHelpString: item doesn't exist"));
+ wxFAIL_MSG(T("wxMenu::SetHelpString: item doesn't exist"));
}
wxString wxMenu::GetHelpString (int itemId) const
if (item)
help = item->GetHelp();
else
- wxFAIL_MSG(_T("wxMenu::GetHelpString: item doesn't exist"));
+ wxFAIL_MSG(T("wxMenu::GetHelpString: item doesn't exist"));
return help;
}
(unsigned)idMenuTitle, m_title) ||
!InsertMenu(hMenu, 1u, MF_BYPOSITION, (unsigned)-1, NULL) )
{
- wxLogLastError(_T("InsertMenu"));
+ wxLogLastError(T("InsertMenu"));
}
}
}
{
// menu can be in at most one menubar because otherwise they would both
// delete the menu pointer
- wxASSERT_MSG( !m_menuBar, _T("menu belongs to 2 menubars, expect a crash") );
+ wxASSERT_MSG( !m_menuBar, T("menu belongs to 2 menubars, expect a crash") );
m_menuBar = menubar;
m_savehMenu = m_hMenu;
void wxMenu::Detach()
{
- wxASSERT_MSG( m_menuBar, _T("can't detach menu if it's not attached") );
+ wxASSERT_MSG( m_menuBar, T("can't detach menu if it's not attached") );
m_hMenu = m_savehMenu;
m_savehMenu = 0;
void wxMenuBar::Refresh()
{
- wxCHECK_RET( m_menuBarFrame, _T("can't refresh a menubar withotu a frame") );
+ wxCHECK_RET( m_menuBarFrame, T("can't refresh a menubar withotu a frame") );
DrawMenuBar((HWND)m_menuBarFrame->GetHWND()) ;
}
if (m_hMenu != 0 )
return m_hMenu;
- wxCHECK_MSG( !m_hMenu, TRUE, _T("menubar already created") );
+ wxCHECK_MSG( !m_hMenu, TRUE, T("menubar already created") );
m_hMenu = (WXHMENU)::CreateMenu();
wxMenu *itemMenu = NULL;
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
- wxCHECK_RET( item, _T("attempt to enable an item which doesn't exist") );
+ wxCHECK_RET( item, T("attempt to enable an item which doesn't exist") );
item->Enable(enable);
}
wxMenu *itemMenu = NULL;
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
- wxCHECK_RET( item, _T("attempt to check an item which doesn't exist") );
- wxCHECK_RET( item->IsCheckable(), _T("attempt to check an uncheckable item") );
+ wxCHECK_RET( item, T("attempt to check an item which doesn't exist") );
+ wxCHECK_RET( item->IsCheckable(), T("attempt to check an uncheckable item") );
item->Check(check);
}
wxMenu *itemMenu = NULL;
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
- wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsChecked(): no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsChecked(): no such item") );
int flag = ::GetMenuState(GetHmenuOf(itemMenu), id, MF_BYCOMMAND);
wxMenu *itemMenu = NULL;
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
- wxCHECK_MSG( item, FALSE, _T("wxMenuBar::IsEnabled(): no such item") );
+ wxCHECK_MSG( item, FALSE, T("wxMenuBar::IsEnabled(): no such item") );
int flag = ::GetMenuState(GetHmenuOf(itemMenu), id, MF_BYCOMMAND) ;
wxMenu *itemMenu = NULL;
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
- wxCHECK_RET( item, _T("wxMenuBar::SetLabel(): no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::SetLabel(): no such item") );
item->SetName(label);
}
wxMenu *itemMenu = NULL;
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
- wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetLabel(): no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenuBar::GetLabel(): no such item") );
return item->GetName();
}
wxMenu *itemMenu = NULL;
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
- wxCHECK_RET( item, _T("wxMenuBar::SetHelpString(): no such item") );
+ wxCHECK_RET( item, T("wxMenuBar::SetHelpString(): no such item") );
item->SetHelp(helpString);
}
wxMenu *itemMenu = NULL;
wxMenuItem *item = FindItemForId(id, &itemMenu) ;
- wxCHECK_MSG( item, _T(""), _T("wxMenuBar::GetHelpString(): no such item") );
+ wxCHECK_MSG( item, T(""), T("wxMenuBar::GetHelpString(): no such item") );
return item->GetHelp();
}
UINT flagsOld = ::GetMenuState((HMENU)m_hMenu, pos, MF_BYPOSITION);
if ( flagsOld == 0xFFFFFFFF )
{
- wxLogLastError(_T("GetMenuState"));
+ wxLogLastError(T("GetMenuState"));
return;
}
if ( ::RemoveMenu((HMENU)m_hMenu, (UINT)pos, MF_BYPOSITION) )
{
// VZ: I'm not sure about what's going on here, so I leave an assert
- wxASSERT_MSG( m_menus[pos] == a_menu, _T("what is this parameter for??") );
+ wxASSERT_MSG( m_menus[pos] == a_menu, T("what is this parameter for??") );
a_menu->Detach();
if ( !::AppendMenu(GetHmenu(), MF_POPUP | MF_STRING,
(UINT)submenu, title) )
{
- wxLogLastError(_T("AppendMenu"));
+ wxLogLastError(T("AppendMenu"));
}
Refresh();
new_menus[i] = m_menus[i];
m_menus[i] = NULL;
new_titles[i] = m_titles[i];
- m_titles[i] = _T("");
+ m_titles[i] = T("");
}
new_menus[pos] = (wxMenu *)menu;
new_menus[i] = m_menus[i-1];
m_menus[i-1] = NULL;
new_titles[i] = m_titles[i-1];
- m_titles[i-1] = _T("");
+ m_titles[i-1] = T("");
}
if (m_menus)
{
new_menus[i] = m_menus[i];
m_menus[i] = NULL;
new_titles[i] = m_titles[i];
- m_titles[i] = _T("");
+ m_titles[i] = T("");
}
if (m_menus)
{
void wxMenuBar::Attach(wxFrame *frame)
{
- wxASSERT_MSG( !m_menuBarFrame, _T("menubar already attached!") );
+ wxASSERT_MSG( !m_menuBarFrame, T("menubar already attached!") );
m_menuBarFrame = frame;
else if ( m_savehMenu != 0 )
return m_savehMenu;
- wxFAIL_MSG(_T("wxMenu without HMENU"));
+ wxFAIL_MSG(T("wxMenu without HMENU"));
return 0;
}
#endif //owner drawn
m_strHelp(strHelp)
{
- wxASSERT_MSG( pParentMenu != NULL, _T("a menu item should have a parent") );
+ wxASSERT_MSG( pParentMenu != NULL, T("a menu item should have a parent") );
#if wxUSE_OWNER_DRAWN
// set default menu colors
void wxMenuItem::Check(bool bDoCheck)
{
- wxCHECK_RET( IsCheckable(), _T("only checkable items may be checked") );
+ wxCHECK_RET( IsCheckable(), T("only checkable items may be checked") );
if ( m_bChecked != bDoCheck ) {
long rc = CheckMenuItem(GetHMenuOf(m_pParentMenu),
MF_BYCOMMAND | flagsOld,
id, data) == 0xFFFFFFFF )
{
- wxLogLastError(_T("ModifyMenu"));
+ wxLogLastError(T("ModifyMenu"));
}
}
}
M_METAFILEDATA->m_windowsMappingMode = wxMM_ANISOTROPIC;
M_METAFILEDATA->m_metafile = 0;
- if (!file.IsNull() && (file.Cmp(_T("")) == 0))
+ if (!file.IsNull() && (file.Cmp(T("")) == 0))
M_METAFILEDATA->m_metafile = (WXHANDLE) GetMetaFile(file);
}
if (!file.IsNull() && wxFileExists(file))
wxRemoveFile(file);
- if (!file.IsNull() && (file != _T("")))
+ if (!file.IsNull() && (file != T("")))
m_hDC = (WXHDC) CreateMetaFile(file);
else
m_hDC = (WXHDC) CreateMetaFile(NULL);
m_minY = 10000;
m_maxX = -10000;
m_maxY = -10000;
- if (file != _T("") && wxFileExists(file)) wxRemoveFile(file);
+ if (file != T("") && wxFileExists(file)) wxRemoveFile(file);
m_hDC = (WXHDC) CreateMetaFile(file);
m_ok = TRUE;
if (!fd) return FALSE;
wxChar tempFileBuf[256];
- wxGetTempFileName(_T("mf"), tempFileBuf);
+ wxGetTempFileName(T("mf"), tempFileBuf);
FILE *fHandle = fopen(wxConvFile.cWX2MB(tempFileBuf), "wb");
if (!fHandle)
return FALSE;
#define HASCAPTION( hwnd ) (TestWinStyle( hwnd, IBS_VERTCAPTION ) ||\
TestWinStyle( hwnd, IBS_HORZCAPTION ))
-#define SETCAPTIONSIZE(h,i) (UINT)SetProp(h,_T("ibSize"),(HANDLE)i)
-#define GETCAPTIONSIZE(h) (UINT)GetProp(h,_T("ibSize"))
-#define FREECAPTIONSIZE(h) RemoveProp(h,_T("ibSize"))
+#define SETCAPTIONSIZE(h,i) (UINT)SetProp(h,T("ibSize"),(HANDLE)i)
+#define GETCAPTIONSIZE(h) (UINT)GetProp(h,T("ibSize"))
+#define FREECAPTIONSIZE(h) RemoveProp(h,T("ibSize"))
-#define SETMENUWASUPFLAG(h,i) (UINT)SetProp(h,_T("ibFlag"),(HANDLE)i)
-#define GETMENUWASUPFLAG(h) (UINT)GetProp(h,_T("ibFlag"))
-#define FREEMENUWASUPFLAG(h) RemoveProp(h,_T("ibFlag"))
+#define SETMENUWASUPFLAG(h,i) (UINT)SetProp(h,T("ibFlag"),(HANDLE)i)
+#define GETMENUWASUPFLAG(h) (UINT)GetProp(h,T("ibFlag"))
+#define FREEMENUWASUPFLAG(h) RemoveProp(h,T("ibFlag"))
/////////////////////////////////////////////////////////////////////
// Little known fact:
{
// VZ: I don't know what should be here, but the vars must
// be inited!
- wxFAIL_MSG(_T("don't know how to initialize cx, cy"));
+ wxFAIL_MSG(T("don't know how to initialize cx, cy"));
cx = cy = 0;
}
{
// Can only rotate true type fonts (well, ok, we could
// try and use "modern").
- wxStrcpy( lf.lfFaceName, _T("Arial") ) ;
+ wxStrcpy( lf.lfFaceName, T("Arial") ) ;
lf.lfPitchAndFamily = FF_SWISS | 0x04;
lf.lfEscapement = 900 ;
wxWindow* win = NULL;
- if (str == _T("BUTTON"))
+ if (str == T("BUTTON"))
{
int style1 = (style & 0xFF);
if ((style1 == BS_3STATE) || (style1 == BS_AUTO3STATE) || (style1 == BS_AUTOCHECKBOX) ||
{
// TODO: how to find the bitmap?
win = new wxBitmapButton;
- wxLogError(_T("Have not yet implemented bitmap button as BS_BITMAP button."));
+ wxLogError(T("Have not yet implemented bitmap button as BS_BITMAP button."));
}
#endif
else if (style1 == BS_OWNERDRAW)
}
else
{
- wxLogError(_T("Don't know what kind of button this is: id = %d"),
+ wxLogError(T("Don't know what kind of button this is: id = %d"),
id);
}
}
- else if (str == _T("COMBOBOX"))
+ else if (str == T("COMBOBOX"))
{
win = new wxComboBox;
}
// for correct functioning.
// Could have wxWindow::AdoptAttributesFromHWND(WXHWND)
// to be overridden by each control class.
- else if (str == _T("EDIT"))
+ else if (str == T("EDIT("))
{
win = new wxTextCtrl;
}
- else if (str == _T("LISTBOX"))
+ else if (str == T("LISTBOX"))
{
win = new wxListBox;
}
- else if (str == _T("SCROLLBAR"))
+ else if (str == T("SCROLLBAR"))
{
win = new wxScrollBar;
}
#if defined(__WIN95__) && !defined(__TWIN32__)
- else if (str == _T("MSCTLS_UPDOWN32"))
+ else if (str == T("MSCTLS_UPDOWN32"))
{
win = new wxSpinButton;
}
#endif
- else if (str == _T("MSCTLS_TRACKBAR32"))
+ else if (str == T("MSCTLS_TRACKBAR32"))
{
// Need to ascertain if it's horiz or vert
win = new wxSlider;
}
- else if (str == _T("STATIC"))
+ else if (str == T("STATIC"))
{
int style1 = (style & 0xFF);
win = new wxStaticBitmap;
// Help! this doesn't correspond with the wxWin implementation.
- wxLogError(_T("Please make SS_BITMAP statics into owner-draw buttons."));
+ wxLogError(T("Please make SS_BITMAP statics into owner-draw buttons."));
}
#endif
}
else
{
- wxString msg(_T("Don't know how to convert from Windows class "));
+ wxString msg(T("Don't know how to convert from Windows class "));
msg += str;
wxLogError(msg);
}
int wxNotebook::SetSelection(int nPage)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("notebook page out of range") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, T("notebook page out of range") );
ChangePage(m_nSelection, nPage);
bool wxNotebook::SetPageText(int nPage, const wxString& strText)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, T("notebook page out of range") );
TC_ITEM tcItem;
tcItem.mask = TCIF_TEXT;
wxString wxNotebook::GetPageText(int nPage) const
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), _T(""), _T("notebook page out of range") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), T(""), T("notebook page out of range") );
wxChar buf[256];
TC_ITEM tcItem;
int wxNotebook::GetPageImage(int nPage) const
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, _T("notebook page out of range") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), -1, T("notebook page out of range") );
TC_ITEM tcItem;
tcItem.mask = TCIF_IMAGE;
bool wxNotebook::SetPageImage(int nPage, int nImage)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, T("notebook page out of range") );
TC_ITEM tcItem;
tcItem.mask = TCIF_IMAGE;
// remove one page from the notebook
bool wxNotebook::DeletePage(int nPage)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, T("notebook page out of range") );
if ( m_nSelection == nPage ) {
// advance selection backwards - the page being deleted shouldn't be left
// remove one page from the notebook, without deleting
bool wxNotebook::RemovePage(int nPage)
{
- wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, _T("notebook page out of range") );
+ wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, T("notebook page out of range") );
TabCtrl_DeleteItem(m_hwnd, nPage);
}
if ( TabCtrl_InsertItem(m_hwnd, nPage, &tcItem) == -1 ) {
- wxLogError(_T("Can't create the notebook page '%s'."), strText.c_str());
+ wxLogError(T("Can't create the notebook page '%s'."), strText.c_str());
return FALSE;
}
wxVariant retVariant;
if (Invoke(property, DISPATCH_PROPERTYGET, retVariant, noArgs, args))
{
- if (retVariant.GetType() == _T("void*"))
+ if (retVariant.GetType() == T("void*"))
{
return (WXIDISPATCH*) retVariant.GetVoidPtr();
}
if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId)))
{
- wxLogWarning(_T("Cannot obtain CLSID from ProgID"));
+ wxLogWarning(T("Cannot obtain CLSID from ProgID"));
return FALSE;
}
if (FAILED(GetActiveObject(clsId, NULL, &pUnk)))
{
- wxLogWarning(_T("Cannot find an active object"));
+ wxLogWarning(T("Cannot find an active object"));
return FALSE;
}
if (pUnk->QueryInterface(IID_IDispatch, (LPVOID*) &m_dispatchPtr) != S_OK)
{
- wxLogWarning(_T("Cannot find IDispatch interface"));
+ wxLogWarning(T("Cannot find IDispatch interface"));
return FALSE;
}
if (FAILED(CLSIDFromProgID((BSTR) unicodeName, &clsId)))
{
- wxLogWarning(_T("Cannot obtain CLSID from ProgID"));
+ wxLogWarning(T("Cannot obtain CLSID from ProgID"));
return FALSE;
}
// start a new copy of Excel, grab the IDispatch interface
if (FAILED(CoCreateInstance(clsId, NULL, CLSCTX_LOCAL_SERVER, IID_IDispatch, (void**)&m_dispatchPtr)))
{
- wxLogWarning(_T("Cannot start an instance of this class."));
+ wxLogWarning(T("Cannot start an instance of this class."));
return FALSE;
}
wxString type(variant.GetType());
- if (type == _T("long"))
+ if (type == T("long"))
{
oleVariant.vt = VT_I4;
oleVariant.lVal = variant.GetLong() ;
}
- else if (type == _T("double"))
+ else if (type == T("double"))
{
oleVariant.vt = VT_R8;
oleVariant.dblVal = variant.GetDouble();
}
- else if (type == _T("bool"))
+ else if (type == T("bool"))
{
oleVariant.vt = VT_BOOL;
// 'bool' required for VC++ 4 apparently
oleVariant.boolVal = variant.GetBool();
#endif
}
- else if (type == _T("string"))
+ else if (type == T("string"))
{
wxString str( variant.GetString() );
oleVariant.vt = VT_BSTR;
oleVariant.bstrVal = ConvertStringToOle(str);
}
- else if (type == _T("date"))
+ else if (type == T("date"))
{
wxDate date( variant.GetDate() );
oleVariant.vt = VT_DATE;
0, 0, 0, oleVariant.date))
return FALSE;
}
- else if (type == _T("time"))
+ else if (type == T("time"))
{
wxTime time( variant.GetTime() );
oleVariant.vt = VT_DATE;
time.GetHour(), time.GetMinute(), time.GetSecond(), oleVariant.date))
return FALSE;
}
- else if (type == _T("void*"))
+ else if (type == T("void*"))
{
oleVariant.vt = VT_DISPATCH;
oleVariant.pdispVal = (IDispatch*) variant.GetVoidPtr();
}
- else if (type == _T("list") || type == _T("stringlist"))
+ else if (type == T("list") || type == T("stringlist"))
{
oleVariant.vt = VT_VARIANT | VT_ARRAY;
}
default:
{
- wxLogError(_T("wxAutomationObject::ConvertOleToVariant: Unknown variant value type"));
+ wxLogError(T("wxAutomationObject::ConvertOleToVariant: Unknown variant value type"));
return FALSE;
}
}
}
else
{
- wxLogWarning(_T("ReleaseVariant: Array contains non-variant type"));
+ wxLogWarning(T("ReleaseVariant: Array contains non-variant type"));
}
// Free the array itself.
break;
default:
- wxLogWarning(_T("ReleaseVariant: Unknown type"));
+ wxLogWarning(T("ReleaseVariant: Unknown type"));
break;
}
}
wxString s;
wxCHECK_MSG( !IsStandard(), s,
- _T("name of predefined format cannot be retrieved") );
+ T("name of predefined format cannot be retrieved") );
int len = ::GetClipboardFormatName(m_format, s.GetWriteBuf(max), max);
s.UngetWriteBuf();
FORMATETC *rgelt,
ULONG *pceltFetched)
{
- wxLogTrace(_T("wxIEnumFORMATETC::Next"));
+ wxLogTrace(T("wxIEnumFORMATETC::Next"));
if ( celt > 1 )
return S_FALSE;
STDMETHODIMP wxIEnumFORMATETC::Skip(ULONG celt)
{
- wxLogTrace(_T("wxIEnumFORMATETC::Skip"));
+ wxLogTrace(T("wxIEnumFORMATETC::Skip"));
if ( m_nCurrent == 0 )
m_nCurrent++;
STDMETHODIMP wxIEnumFORMATETC::Reset()
{
- wxLogTrace(_T("wxIEnumFORMATETC::Reset"));
+ wxLogTrace(T("wxIEnumFORMATETC::Reset"));
m_nCurrent = 0;
STDMETHODIMP wxIEnumFORMATETC::Clone(IEnumFORMATETC **ppenum)
{
- wxLogTrace(_T("wxIEnumFORMATETC::Clone"));
+ wxLogTrace(T("wxIEnumFORMATETC::Clone"));
wxIEnumFORMATETC *pNew = new wxIEnumFORMATETC(m_format.cfFormat);
pNew->AddRef();
// get data functions
STDMETHODIMP wxIDataObject::GetData(FORMATETC *pformatetcIn, STGMEDIUM *pmedium)
{
- wxLogTrace(_T("wxIDataObject::GetData"));
+ wxLogTrace(T("wxIDataObject::GetData"));
// is data is in our format?
HRESULT hr = QueryGetData(pformatetcIn);
STDMETHODIMP wxIDataObject::GetDataHere(FORMATETC *pformatetc,
STGMEDIUM *pmedium)
{
- wxLogTrace(_T("wxIDataObject::GetDataHere"));
+ wxLogTrace(T("wxIDataObject::GetDataHere"));
// put data in caller provided medium
if ( pmedium->tymed != TYMED_HGLOBAL )
// copy data
void *pBuf = GlobalLock(pmedium->hGlobal);
if ( pBuf == NULL ) {
- wxLogLastError(_T("GlobalLock"));
+ wxLogLastError(T("GlobalLock"));
return E_OUTOFMEMORY;
}
STGMEDIUM *pmedium,
BOOL fRelease)
{
- wxLogTrace(_T("wxIDataObject::SetData"));
+ wxLogTrace(T("wxIDataObject::SetData"));
return E_NOTIMPL;
}
{
// do we accept data in this format?
if ( pformatetc == NULL ) {
- wxLogTrace(_T("wxIDataObject::QueryGetData: invalid ptr."));
+ wxLogTrace(T("wxIDataObject::QueryGetData: invalid ptr."));
return E_INVALIDARG;
}
// the only one allowed by current COM implementation
if ( pformatetc->lindex != -1 ) {
- wxLogTrace(_T("wxIDataObject::QueryGetData: bad lindex %d"),
+ wxLogTrace(T("wxIDataObject::QueryGetData: bad lindex %d"),
pformatetc->lindex);
return DV_E_LINDEX;
}
// we don't support anything other (THUMBNAIL, ICON, DOCPRINT...)
if ( pformatetc->dwAspect != DVASPECT_CONTENT ) {
- wxLogTrace(_T("wxIDataObject::QueryGetData: bad dwAspect %d"),
+ wxLogTrace(T("wxIDataObject::QueryGetData: bad dwAspect %d"),
pformatetc->dwAspect);
return DV_E_DVASPECT;
}
// @@ we only transfer data by global memory (bad for large amounts of it!)
if ( !(pformatetc->tymed & TYMED_HGLOBAL) ) {
- wxLogTrace(_T("wxIDataObject::QueryGetData: %s != TYMED_HGLOBAL."),
+ wxLogTrace(T("wxIDataObject::QueryGetData: %s != TYMED_HGLOBAL."),
GetTymedName(pformatetc->tymed));
return DV_E_TYMED;
}
// and now check the type of data requested
if ( m_pDataObject->IsSupportedFormat((wxDataFormatId)pformatetc->cfFormat) ) {
- wxLogTrace(_T("wxIDataObject::QueryGetData: %s ok"),
+ wxLogTrace(T("wxIDataObject::QueryGetData: %s ok"),
wxDataObject::GetFormatName((wxDataFormatId)pformatetc->cfFormat));
return S_OK;
}
else {
- wxLogTrace(_T("wxIDataObject::QueryGetData: %s unsupported"),
+ wxLogTrace(T("wxIDataObject::QueryGetData: %s unsupported"),
wxDataObject::GetFormatName((wxDataFormatId)pformatetc->cfFormat));
return DV_E_FORMATETC;
}
STDMETHODIMP wxIDataObject::GetCanonicalFormatEtc(FORMATETC *pFormatetcIn,
FORMATETC *pFormatetcOut)
{
- wxLogTrace(_T("wxIDataObject::GetCanonicalFormatEtc"));
+ wxLogTrace(T("wxIDataObject::GetCanonicalFormatEtc"));
// @@ implementation is trivial, we might want something better here
if ( pFormatetcOut != NULL )
STDMETHODIMP wxIDataObject::EnumFormatEtc(DWORD dwDirection,
IEnumFORMATETC **ppenumFormatEtc)
{
- wxLogTrace(_T("wxIDataObject::EnumFormatEtc"));
+ wxLogTrace(T("wxIDataObject::EnumFormatEtc"));
if ( dwDirection == DATADIR_SET ) {
// we don't allow setting of data anyhow
static char s_szBuf[128];
switch ( format ) {
- case CF_TEXT: return "CF_TEXT";
+ case CF_TEXT: return "CF_TEXT(";
case CF_BITMAP: return "CF_BITMAP";
- case CF_METAFILEPICT: return "CF_METAFILEPICT";
+ case CF_METAFILEPICT: return "CF_METAFILEPICT(";
case CF_SYLK: return "CF_SYLK";
case CF_DIF: return "CF_DIF";
case CF_TIFF: return "CF_TIFF";
- case CF_OEMTEXT: return "CF_OEMTEXT";
+ case CF_OEMTEXT: return "CF_OEMTEXT(";
case CF_DIB: return "CF_DIB";
case CF_PALETTE: return "CF_PALETTE";
case CF_PENDATA: return "CF_PENDATA";
case CF_RIFF: return "CF_RIFF";
case CF_WAVE: return "CF_WAVE";
- case CF_UNICODETEXT: return "CF_UNICODETEXT";
+ case CF_UNICODETEXT: return "CF_UNICODETEXT(";
case CF_ENHMETAFILE: return "CF_ENHMETAFILE";
case CF_HDROP: return "CF_HDROP";
case CF_LOCALE: return "CF_LOCALE";
case TYMED_ISTREAM: return "TYMED_ISTREAM";
case TYMED_ISTORAGE: return "TYMED_ISTORAGE";
case TYMED_GDI: return "TYMED_GDI";
- case TYMED_MFPICT: return "TYMED_MFPICT";
+ case TYMED_MFPICT: return "TYMED_MFPICT(";
case TYMED_ENHMF: return "TYMED_ENHMF";
default:
sprintf(s_szBuf, "type of media format %d (unknown)", tymed);
// Notes : you must call SetData() before if you had used def ctor
wxDragResult wxDropSource::DoDragDrop(bool bAllowMove)
{
- wxCHECK_MSG( m_pData != NULL, wxDragNone, _T("No data in wxDropSource!") );
+ wxCHECK_MSG( m_pData != NULL, wxDragNone, T("No data in wxDropSource!") );
DWORD dwEffect;
HRESULT hr = ::DoDragDrop(m_pData->GetInterface(),
else {
if ( FAILED(hr) ) {
wxLogApiError("DoDragDrop", hr);
- wxLogError(_T("Drag & drop operation failed."));
+ wxLogError(T("Drag & drop operation failed."));
}
else {
- wxLogDebug(_T("Unexpected success return code %08lx from DoDragDrop."), hr);
+ wxLogDebug(T("Unexpected success return code %08lx from DoDragDrop."), hr);
}
return wxDragError;
POINTL pt,
DWORD *pdwEffect)
{
- wxLogDebug(_T("IDropTarget::DragEnter"));
+ wxLogDebug(T("IDropTarget::DragEnter"));
wxASSERT( m_pIDataObject == NULL );
// Notes : good place to do any clean-up
STDMETHODIMP wxIDropTarget::DragLeave()
{
- wxLogDebug(_T("IDropTarget::DragLeave"));
+ wxLogDebug(T("IDropTarget::DragLeave"));
// remove the UI feedback
m_pTarget->OnLeave();
POINTL pt,
DWORD *pdwEffect)
{
- wxLogDebug(_T("IDropTarget::Drop"));
+ wxLogDebug(T("IDropTarget::Drop"));
// TODO I don't know why there is this parameter, but so far I assume
// that it's the same we've already got in DragEnter
UINT len2 = ::DragQueryFile(hdrop, n, aszFiles[n], len);
if ( len2 != len - 1 ) {
- wxLogDebug(_T("In wxFileDropTarget::OnDrop DragQueryFile returned %d "
+ wxLogDebug(T("In wxFileDropTarget::OnDrop DragQueryFile returned %d "
"characters, %d expected."), len2, len - 1);
}
}
if ( m_pszCForm == NULL )
m_pszCForm = new wxChar[UUID_CSTRLEN];
- wsprintf(m_pszCForm, _T("0x%8.8X,0x%4.4X,0x%4.4X,0x%2.2X,0x2.2%X,"
+ wsprintf(m_pszCForm, T("0x%8.8X,0x%4.4X,0x%4.4X,0x%2.2X,0x2.2%X,"
"0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X,0x2.2%X"),
m_uuid.Data1, m_uuid.Data2, m_uuid.Data3,
m_uuid.Data4[1], m_uuid.Data4[2], m_uuid.Data4[3], m_uuid.Data4[4],
delete [] szStripped;
// # without this menu items look too tightly packed (at least under Windows)
- str += _T('W'); // 'W' is typically the widest letter
+ str += T('W'); // 'W' is typically the widest letter
dc.GetTextExtent(str, (long *)pwidth, (long *)pheight);
///////////////////////////////////////////////////////////////////////
// If running on a Pen Windows system, register this app so all
// EDIT controls in dialogs are replaced by HEDIT controls.
-// (Notice the CONTROL statement in the RC file is "EDIT",
+// (Notice the CONTROL statement in the RC file is "EDIT(",
// RegisterPenApp will automatically change that control to
// an HEDIT.
if ((g_hPenWin = (HANDLE)GetSystemMetrics(SM_PENWINDOWS)) != (HANDLE)NULL) {
if (!win)
{
wxEndBusyCursor();
- wxLogDebug(_T("Could not create an abort dialog."));
+ wxLogDebug(T("Could not create an abort dialog."));
delete dc;
}
}
}
- wxASSERT_MSG( selectedButton != -1, _T("click from alien button?") );
+ wxASSERT_MSG( selectedButton != -1, T("click from alien button?") );
if ( selectedButton != m_selectedButton )
{
}
// Create a dummy radio control to end the group.
- (void)CreateWindowEx(0, RADIO_CLASS, _T(""), WS_GROUP | RADIO_FLAGS,
+ (void)CreateWindowEx(0, RADIO_CLASS, T(""), WS_GROUP | RADIO_FLAGS,
0, 0, 0, 0, hwndParent,
(HMENU)NewControlId(), wxGetInstance(), NULL);
wxString wxRadioBox::GetLabel(int item) const
{
- wxCHECK_MSG( item >= 0 && item < m_noItems, _T(""), _T("invalid radiobox index") );
+ wxCHECK_MSG( item >= 0 && item < m_noItems, T(""), T("invalid radiobox index") );
return wxGetWindowText(m_radioButtons[item]);
}
void wxRadioBox::SetLabel(int item, const wxString& label)
{
- wxCHECK_RET( item >= 0 && item < m_noItems, _T("invalid radiobox index") );
+ wxCHECK_RET( item >= 0 && item < m_noItems, T("invalid radiobox index") );
m_radioWidth[item] = m_radioHeight[item] = -1;
SetWindowText((HWND)m_radioButtons[item], label.c_str());
m_radioWidth[item] = bitmap->GetWidth() + FB_MARGIN;
m_radioHeight[item] = bitmap->GetHeight() + FB_MARGIN;
*/
- wxFAIL_MSG(_T("not implemented"));
+ wxFAIL_MSG(T("not implemented"));
}
int wxRadioBox::FindString(const wxString& s) const
void wxRadioBox::SetSelection(int N)
{
- wxCHECK_RET( (N >= 0) && (N < m_noItems), _T("invalid radiobox index") );
+ wxCHECK_RET( (N >= 0) && (N < m_noItems), T("invalid radiobox index") );
// Following necessary for Win32s, because Win32s translate BM_SETCHECK
if (m_selectedButton >= 0 && m_selectedButton < m_noItems)
void wxRadioBox::Enable(int item, bool enable)
{
wxCHECK_RET( item >= 0 && item < m_noItems,
- _T("invalid item in wxRadioBox::Enable()") );
+ T("invalid item in wxRadioBox::Enable()") );
::EnableWindow((HWND) m_radioButtons[item], enable);
}
void wxRadioBox::Show(int item, bool show)
{
wxCHECK_RET( item >= 0 && item < m_noItems,
- _T("invalid item in wxRadioBox::Show()") );
+ T("invalid item in wxRadioBox::Show()") );
::ShowWindow((HWND)m_radioButtons[item], show ? SW_SHOW : SW_HIDE);
}
{
wxRadioBox *radiobox = (wxRadioBox *)::GetWindowLong(hwnd, GWL_USERDATA);
- wxCHECK_MSG( radiobox, 0, _T("radio button without radio box?") );
+ wxCHECK_MSG( radiobox, 0, T("radio button without radio box?") );
int sel = radiobox->GetSelection();
msStyle,0,0,0,0,
(HWND) parent->GetHWND(), (HMENU)m_windowId, wxGetInstance(), NULL);
- wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create radiobutton") );
+ wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create radiobutton") );
#if wxUSE_CTL3D
if (want3D)
// SetValue(value);
// start GRW fix
- if (label != _T(""))
+ if (label != T(""))
{
int label_width, label_height;
GetTextExtent(label, &label_width, &label_height, NULL, NULL, & this->GetFont());
if ( appName.IsEmpty() )
{
- wxCHECK_RET( wxTheApp, _T("No application name in wxRegConfig ctor!") );
+ wxCHECK_RET( wxTheApp, T("No application name in wxRegConfig ctor!") );
strRoot << wxTheApp->GetAppName();
}
else
if ( IsImmutable(path.Name()) ) {
if ( TryGetValue(m_keyGlobal, path.Name(), *pStr) ) {
if ( m_keyLocal.HasValue(path.Name()) ) {
- wxLogWarning(_T("User value for immutable key '%s' ignored."),
+ wxLogWarning(T("User value for immutable key '%s' ignored."),
path.Name().c_str());
}
*pStr = wxConfigBase::ExpandEnvVars(*pStr);
if ( IsImmutable(path.Name()) ) {
if ( TryGetValue(m_keyGlobal, path.Name(), *pStr) ) {
if ( m_keyLocal.HasValue(path.Name()) ) {
- wxLogWarning(_T("User value for immutable key '%s' ignored."),
+ wxLogWarning(T("User value for immutable key '%s' ignored."),
path.Name().c_str());
}
if ( IsImmutable(path.Name()) ) {
if ( TryGetValue(m_keyGlobal, path.Name(), plResult) ) {
if ( m_keyLocal.HasValue(path.Name()) ) {
- wxLogWarning(_T("User value for immutable key '%s' ignored."),
+ wxLogWarning(T("User value for immutable key '%s' ignored."),
path.Name().c_str());
}
wxConfigPathChanger path(this, key);
if ( IsImmutable(path.Name()) ) {
- wxLogError(_T("Can't change immutable entry '%s'."), path.Name().c_str());
+ wxLogError(T("Can't change immutable entry '%s'."), path.Name().c_str());
return FALSE;
}
wxConfigPathChanger path(this, key);
if ( IsImmutable(path.Name()) ) {
- wxLogError(_T("Can't change immutable entry '%s'."), path.Name().c_str());
+ wxLogError(T("Can't change immutable entry '%s'."), path.Name().c_str());
return FALSE;
}
// TODO there is no way to rename a registry key - we must do a deep copy
// ourselves
- wxFAIL_MSG(_T("Registry key renaming not implemented"));
+ wxFAIL_MSG(T("Registry key renaming not implemented"));
return FALSE;
}
}
aStdKeys[] =
{
- { HKEY_CLASSES_ROOT, _T("HKEY_CLASSES_ROOT"), _T("HKCR") },
+ { HKEY_CLASSES_ROOT, T("HKEY_CLASSES_ROOT("), T("HKCR") },
#ifdef __WIN32__
- { HKEY_CURRENT_USER, _T("HKEY_CURRENT_USER"), _T("HKCU") },
- { HKEY_LOCAL_MACHINE, _T("HKEY_LOCAL_MACHINE"), _T("HKLM") },
- { HKEY_USERS, _T("HKEY_USERS"), _T("HKU") }, // short name?
- { HKEY_PERFORMANCE_DATA, _T("HKEY_PERFORMANCE_DATA"), _T("HKPD") },
+ { HKEY_CURRENT_USER, T("HKEY_CURRENT_USER"), T("HKCU") },
+ { HKEY_LOCAL_MACHINE, T("HKEY_LOCAL_MACHINE"), T("HKLM") },
+ { HKEY_USERS, T("HKEY_USERS"), T("HKU") }, // short name?
+ { HKEY_PERFORMANCE_DATA, T("HKEY_PERFORMANCE_DATA"), T("HKPD") },
#if WINVER >= 0x0400
- { HKEY_CURRENT_CONFIG, _T("HKEY_CURRENT_CONFIG"), _T("HKCC") },
+ { HKEY_CURRENT_CONFIG, T("HKEY_CURRENT_CONFIG"), T("HKCC") },
#ifndef __GNUWIN32__
- { HKEY_DYN_DATA, _T("HKEY_DYN_DATA"), _T("HKDD") }, // short name?
+ { HKEY_DYN_DATA, T("HKEY_DYN_DATA"), T("HKDD") }, // short name?
#endif //GNUWIN32
#endif //WINVER >= 4.0
#endif //WIN32
};
// the registry name separator (perhaps one day MS will change it to '/' ;-)
-#define REG_SEPARATOR _T('\\')
+#define REG_SEPARATOR T('\\')
// useful for Windows programmers: makes somewhat more clear all these zeroes
// being passed to Windows APIs
const wxChar *wxRegKey::GetStdKeyName(size_t key)
{
// return empty string if key is invalid
- wxCHECK_MSG( key < nStdKeys, _T(""), _T("invalid key in wxRegKey::GetStdKeyName") );
+ wxCHECK_MSG( key < nStdKeys, T(""), T("invalid key in wxRegKey::GetStdKeyName") );
return aStdKeys[key].szName;
}
const wxChar *wxRegKey::GetStdKeyShortName(size_t key)
{
// return empty string if key is invalid
- wxCHECK( key < nStdKeys, _T("") );
+ wxCHECK( key < nStdKeys, T("") );
return aStdKeys[key].szShortName;
}
}
if ( ui == nStdKeys ) {
- wxFAIL_MSG(_T("invalid key prefix in wxRegKey::ExtractKeyName."));
+ wxFAIL_MSG(T("invalid key prefix in wxRegKey::ExtractKeyName."));
hRootKey = HKEY_CLASSES_ROOT;
}
return (StdKey)ui;
}
- wxFAIL_MSG(_T("non root hkey passed to wxRegKey::GetStdKeyFromHkey."));
+ wxFAIL_MSG(T("non root hkey passed to wxRegKey::GetStdKeyFromHkey."));
return HKCR;
}
else {
// check that we read the value of right type
wxASSERT_MSG( dwType == REG_DWORD,
- _T("Type mismatch in wxRegKey::QueryValue().") );
+ T("Type mismatch in wxRegKey::QueryValue().") );
return TRUE;
}
if ( m_dwLastError == ERROR_SUCCESS ) {
// check that it was the right type
wxASSERT_MSG( dwType == REG_SZ,
- _T("Type mismatch in wxRegKey::QueryValue().") );
+ T("Type mismatch in wxRegKey::QueryValue().") );
return TRUE;
}
static wxString s_str;
s_str = pKey->GetName();
if ( !wxIsEmpty(szValue) )
- s_str << _T("\\") << szValue;
+ s_str << T("\\") << szValue;
return s_str.c_str();
}
// Now create scrollbar
DWORD _direction = (style & wxHORIZONTAL) ?
SBS_HORZ: SBS_VERT;
- HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(style), _T("SCROLLBAR"), _T("scrollbar"),
+ HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(style), T("SCROLLBAR"), T("scrollbar"),
_direction | WS_CHILD | WS_VISIBLE,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
bool want3D;
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
- m_staticValue = (WXHWND) CreateWindowEx(exStyle, _T("STATIC"), NULL,
+ m_staticValue = (WXHWND) CreateWindowEx(exStyle, T("STATIC"), NULL,
msStyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
// Now create min static control
- wxSprintf(wxBuffer, _T("%d"), minValue);
- m_staticMin = (WXHWND) CreateWindowEx(0, _T("STATIC"), wxBuffer,
+ wxSprintf(wxBuffer, T("%d"), minValue);
+ m_staticMin = (WXHWND) CreateWindowEx(0, T("STATIC"), wxBuffer,
STATIC_FLAGS,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
SubclassWin(GetHWND());
- SetWindowText((HWND) m_hWnd, _T(""));
+ SetWindowText((HWND) m_hWnd, T(""));
SetFont(parent->GetFont());
if ( m_windowStyle & wxSL_LABELS )
{
// Finally, create max value static item
- wxSprintf(wxBuffer, _T("%d"), maxValue);
- m_staticMax = (WXHWND) CreateWindowEx(0, _T("STATIC"), wxBuffer,
+ wxSprintf(wxBuffer, T("%d"), maxValue);
+ m_staticMax = (WXHWND) CreateWindowEx(0, T("STATIC"), wxBuffer,
STATIC_FLAGS,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
::SendMessage(GetHwnd(), TBM_SETPOS, (WPARAM)TRUE, (LPARAM)value);
if (m_staticValue)
{
- wxSprintf(wxBuffer, _T("%d"), value);
+ wxSprintf(wxBuffer, T("%d"), value);
SetWindowText((HWND) m_staticValue, wxBuffer);
}
}
wxChar buf[40];
if ( m_staticMin )
{
- wxSprintf(buf, _T("%d"), m_rangeMin);
+ wxSprintf(buf, T("%d"), m_rangeMin);
SetWindowText((HWND) m_staticMin, buf);
}
if ( m_staticMax )
{
- wxSprintf(buf, _T("%d"), m_rangeMax);
+ wxSprintf(buf, T("%d"), m_rangeMax);
SetWindowText((HWND) m_staticMax, buf);
}
}
bool want3D;
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D) ;
- m_staticValue = (WXHWND) CreateWindowEx(exStyle, _T("STATIC"), NULL,
+ m_staticValue = (WXHWND) CreateWindowEx(exStyle, T("STATIC"), NULL,
msStyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
// Now create min static control
- wxSprintf(wxBuffer, _T("%d"), minValue);
- m_staticMin = (WXHWND) CreateWindowEx(0, _T("STATIC"), wxBuffer,
+ wxSprintf(wxBuffer, T("%d"), minValue);
+ m_staticMin = (WXHWND) CreateWindowEx(0, T("STATIC"), wxBuffer,
STATIC_FLAGS,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
else
msStyle = SBS_HORZ | WS_CHILD | WS_VISIBLE | WS_TABSTOP ;
- HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(m_windowStyle), _T("SCROLLBAR"), wxBuffer,
+ HWND scroll_bar = CreateWindowEx(MakeExtendedStyle(m_windowStyle), T("SCROLLBAR"), wxBuffer,
msStyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
SubclassWin(GetHWND());
// Finally, create max value static item
- wxSprintf(wxBuffer, _T("%d"), maxValue);
- m_staticMax = (WXHWND) CreateWindowEx(0, _T("STATIC"), wxBuffer,
+ wxSprintf(wxBuffer, T("%d"), maxValue);
+ m_staticMax = (WXHWND) CreateWindowEx(0, T("STATIC"), wxBuffer,
STATIC_FLAGS,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)NewControlId(),
wxGetInstance(), NULL);
::SetScrollPos(GetHwnd(), SB_CTL, value, TRUE);
if (m_staticValue)
{
- wxSprintf(wxBuffer, _T("%d"), value);
+ wxSprintf(wxBuffer, T("%d"), value);
SetWindowText((HWND) m_staticValue, wxBuffer);
}
}
wxChar buf[40];
if ( m_staticMin )
{
- wxSprintf(buf, _T("%d"), m_rangeMin);
+ wxSprintf(buf, T("%d"), m_rangeMin);
SetWindowText((HWND) m_staticMin, buf);
}
if ( m_staticMax )
{
- wxSprintf(buf, _T("%d"), m_rangeMax);
+ wxSprintf(buf, T("%d"), m_rangeMax);
SetWindowText((HWND) m_staticMax, buf);
}
}
bool wxSpinButton::MSWOnScroll(int orientation, WXWORD wParam,
WXWORD pos, WXHWND control)
{
- wxCHECK_MSG( control, FALSE, _T("scrolling what?") )
+ wxCHECK_MSG( control, FALSE, T("scrolling what?") )
if ( wParam != SB_THUMBPOSITION )
{
#ifdef __WIN32__
// create a static control with either SS_BITMAP or SS_ICON style depending
// on what we have here
- const wxChar *classname = _T("STATIC");
+ const wxChar *classname = T("STATIC");
int winstyle = m_isIcon ? SS_ICON : SS_BITMAP;
#else // Win16
- const wxChar *classname = _T("BUTTON");
+ const wxChar *classname = T("BUTTON");
int winstyle = BS_OWNERDRAW;
#endif // Win32
m_hWnd = (WXHWND)::CreateWindow
(
classname,
- _T(""),
+ T(""),
winstyle | WS_CHILD | WS_VISIBLE,
0, 0, 0, 0,
(HWND)parent->GetHWND(),
NULL
);
- wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create static bitmap") );
+ wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create static bitmap") );
SetBitmap(bitmap);
WXDWORD exStyle = Determine3DEffects(0, &want3D) ;
HWND wx_button =
- CreateWindowEx(exStyle, _T("BUTTON"), (const wxChar *)label, msStyle,
+ CreateWindowEx(exStyle, T("BUTTON"), (const wxChar *)label, msStyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
#if wxUSE_CTL3D
wstyle |= SBARS_SIZEGRIP;
m_hWnd = (WXHWND)CreateStatusWindow(wstyle,
- _T(""),
+ T(""),
(HWND)parent->GetHWND(),
m_windowId);
if ( m_hWnd == 0 ) {
- wxLogSysError(_T("can't create status bar window"));
+ wxLogSysError(T("can't create status bar window"));
return FALSE;
}
}
if ( !StatusBar_SetParts(hwnd, m_nFields, pWidths) ) {
- wxLogLastError(_T("StatusBar_SetParts"));
+ wxLogLastError(T("StatusBar_SetParts"));
}
delete [] pWidths;
void wxStatusBar95::SetStatusText(const wxString& strText, int nField)
{
if ( !StatusBar_SetText(hwnd, nField, strText) ) {
- wxLogLastError(_T("StatusBar_SetText"));
+ wxLogLastError(T("StatusBar_SetText"));
}
}
{
wxASSERT( (nField > -1) && (nField < m_nFields) );
- wxString str(_T(""));
+ wxString str(T(""));
int len = StatusBar_GetTextLen(hwnd, nField);
if (len > 0)
{
m_hWnd = (WXHWND)::CreateWindow
(
- _T("STATIC"),
- _T(""),
+ T("STATIC"),
+ T(""),
WS_VISIBLE | WS_CHILD |
SS_GRAYRECT | SS_SUNKEN, // | SS_ETCHEDFRAME,
pos.x, pos.y, sizeReal.x, sizeReal.y,
if ( !m_hWnd )
{
#ifdef __WXDEBUG__
- wxLogDebug(_T("Failed to create static control"));
+ wxLogDebug(T("Failed to create static control"));
#endif
return FALSE;
}
if ( wxStyleHasBorder(m_windowStyle) )
msStyle |= WS_BORDER;
- m_hWnd = (WXHWND)::CreateWindowEx(MakeExtendedStyle(m_windowStyle), _T("STATIC"), (const wxChar *)label,
+ m_hWnd = (WXHWND)::CreateWindowEx(MakeExtendedStyle(m_windowStyle), T("STATIC"), (const wxChar *)label,
msStyle,
0, 0, 0, 0, (HWND) parent->GetHWND(), (HMENU)m_windowId,
wxGetInstance(), NULL);
- wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create static ctrl") );
+ wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create static ctrl") );
#if wxUSE_CTL3D
/*
wxString curLine;
for ( const wxChar *pc = text; ; pc++ ) {
- if ( *pc == _T('\n') || *pc == _T('\0') ) {
+ if ( *pc == T('\n') || *pc == T('\0') ) {
GetTextExtent(curLine, &widthLine, &heightLine);
if ( widthLine > widthTextMax )
widthTextMax = widthLine;
heightTextTotal += heightLine;
- if ( *pc == _T('\n') ) {
+ if ( *pc == T('\n') ) {
curLine.Empty();
}
else {
// Create the toolbar control.
HWND hWndTabCtrl = CreateWindowEx(0L, // No extended styles.
WC_TABCONTROL, // Class name for the tab control
- _T(""), // No default text.
+ T(""), // No default text.
WS_CHILD | WS_BORDER | WS_VISIBLE | tabStyle, // Styles and defaults.
x, y, width, height, // Standard size and position.
(HWND) parent->GetHWND(), // Parent window
wxString wxTabCtrl::GetItemText(int item) const
{
wxChar buf[256];
- wxString str(_T(""));
+ wxString str(T(""));
TC_ITEM tcItem;
tcItem.mask = TCIF_TEXT;
tcItem.pszText = buf;
TC_ITEM tcItem;
tcItem.mask = TCIF_PARAM;
tcItem.lParam = (long) data;
- if (text != _T(""))
+ if (text != T(""))
{
tcItem.mask |= TCIF_TEXT;
wxStrcpy(buf, (const wxChar*) text);
LRESULT APIENTRY _EXPORT wxTaskBarIconWindowProc( HWND hWnd, unsigned msg,
UINT wParam, LONG lParam );
-wxChar *wxTaskBarWindowClass = _T("wxTaskBarWindowClass");
+wxChar *wxTaskBarWindowClass = T("wxTaskBarWindowClass");
wxList wxTaskBarIcon::sm_taskBarIcons;
bool wxTaskBarIcon::sm_registeredClass = FALSE;
notifyData.hIcon = (HICON) icon.GetHICON();
}
- if (((const wxChar*) tooltip != NULL) && (tooltip != _T("")))
+ if (((const wxChar*) tooltip != NULL) && (tooltip != T("")))
{
notifyData.uFlags |= NIF_TIP ;
lstrcpyn(notifyData.szTip, WXSTRINGCAST tooltip, sizeof(notifyData.szTip));
return TRUE;
// Also register the taskbar message here
- sm_taskbarMsg = ::RegisterWindowMessage(_T("wxTaskBarIconMessage"));
+ sm_taskbarMsg = ::RegisterWindowMessage(T("wxTaskBarIconMessage"));
WNDCLASS wc;
bool rc;
HINSTANCE hInstance = GetModuleHandle(NULL);
HWND hWnd = CreateWindowEx (0, wxTaskBarWindowClass,
- _T("wxTaskBarWindow"),
+ T("wxTaskBarWindow"),
WS_OVERLAPPED,
0,
0,
m_foregroundColour = *wxBLACK ;
wxASSERT_MSG( (style & wxTB_VERTICAL) == 0,
- _T("Sorry, wxToolBar95 under Windows 95 only "
+ T("Sorry, wxToolBar95 under Windows 95 only "
"supports horizontal orientation.") );
m_maxWidth = -1;
(
exStyle, // Extended styles.
TOOLBARCLASSNAME, // Class name for the toolbar.
- _T(""), // No default text.
+ T(""), // No default text.
msflags, // Styles
x, y, width, height, // Standard toolbar size and position.
(HWND) parent->GetHWND(), // Parent window of the toolbar.
NULL // No class data.
);
- wxCHECK_MSG( hWndToolbar, FALSE, _T("Toolbar creation failed") );
+ wxCHECK_MSG( hWndToolbar, FALSE, T("Toolbar creation failed") );
// Toolbar-specific initialisation
::SendMessage(hWndToolbar, TB_BUTTONSTRUCTSIZE,
replaceBitmap.nButtons = noButtons;
if (::SendMessage((HWND) GetHWND(), TB_REPLACEBITMAP, (WPARAM) 0, (LPARAM) &replaceBitmap) == -1)
{
- wxFAIL_MSG(_T("Could not add bitmap to toolbar"));
+ wxFAIL_MSG(T("Could not add bitmap to toolbar"));
}
::DeleteObject((HBITMAP) oldToolBarBitmap);
addBitmap.nID = (UINT)m_hBitmap;
if (::SendMessage((HWND) GetHWND(), TB_ADDBITMAP, (WPARAM) noButtons, (LPARAM) &addBitmap) == -1)
{
- wxFAIL_MSG(_T("Could not add bitmap to toolbar"));
+ wxFAIL_MSG(T("Could not add bitmap to toolbar"));
}
}
long rc = ::SendMessage((HWND) GetHWND(), TB_ADDBUTTONS, (WPARAM)i, (LPARAM)& buttons);
- wxCHECK_MSG( rc, FALSE, _T("failed to add buttons to the toolbar") );
+ wxCHECK_MSG( rc, FALSE, T("failed to add buttons to the toolbar") );
(void)::SendMessage((HWND) GetHWND(), TB_AUTOSIZE, (WPARAM)0, (LPARAM) 0);
if ( m_windowStyle & wxTE_MULTILINE )
{
wxASSERT_MSG( !(m_windowStyle & wxTE_PROCESS_ENTER),
- _T("wxTE_PROCESS_ENTER style is ignored for multiline "
+ T("wxTE_PROCESS_ENTER style is ignored for multiline "
"text controls (they always process it)") );
msStyle |= ES_MULTILINE | ES_WANTRETURN;
m_lDlgCode |= DLGC_WANTTAB;
// do create the control - either an EDIT or RICHEDIT
- const wxChar *windowClass = _T("EDIT");
+ const wxChar *windowClass = T("EDIT(");
#if wxUSE_RICHEDIT
if ( m_windowStyle & wxTE_RICH )
{
msStyle |= ES_AUTOVSCROLL;
m_isRich = TRUE;
- windowClass = _T("RICHEDIT");
+ windowClass = T("RICHEDIT(");
}
else
m_isRich = FALSE;
wxGetInstance(),
NULL);
- wxCHECK_MSG( m_hWnd, FALSE, _T("Failed to create text ctrl") );
+ wxCHECK_MSG( m_hWnd, FALSE, T("Failed to create text ctrl") );
#if wxUSE_CTL3D
if ( want3D )
GetClassName(hWnd, buf, WXSIZEOF(buf));
- if ( wxStricmp(buf, _T("EDIT")) == 0 )
+ if ( wxStricmp(buf, T("EDIT(")) == 0 )
m_isRich = FALSE;
else
m_isRich = TRUE;
void wxTextCtrl::Clear()
{
- SetWindowText(GetHwnd(), _T(""));
+ SetWindowText(GetHwnd(), T(""));
}
// ----------------------------------------------------------------------------
wxMutex::~wxMutex()
{
if (m_locked > 0)
- wxLogDebug(_T("Warning: freeing a locked mutex (%d locks)."), m_locked);
+ wxLogDebug(T("Warning: freeing a locked mutex (%d locks)."), m_locked);
CloseHandle(p_internal->p_mutex);
}
case WAIT_TIMEOUT:
default:
- wxFAIL_MSG(_T("impossible return value in wxMutex::Lock"));
+ wxFAIL_MSG(T("impossible return value in wxMutex::Lock"));
}
m_locked++;
win_priority = THREAD_PRIORITY_HIGHEST;
else
{
- wxFAIL_MSG(_T("invalid value of thread priority parameter"));
+ wxFAIL_MSG(T("invalid value of thread priority parameter"));
win_priority = THREAD_PRIORITY_NORMAL;
}
break;
default:
- wxFAIL_MSG(_T("unexpected result of MsgWaitForMultipleObject"));
+ wxFAIL_MSG(T("unexpected result of MsgWaitForMultipleObject"));
}
} while ( result != WAIT_OBJECT_0 );
}
wxASSERT_MSG( (LPVOID)rc != (LPVOID)STILL_ACTIVE,
- _T("thread must be already terminated.") );
+ T("thread must be already terminated.") );
::CloseHandle(hThread);
}
::ExitThread((DWORD)status);
- wxFAIL_MSG(_T("Couldn't return from ExitThread()!"));
+ wxFAIL_MSG(T("Couldn't return from ExitThread()!"));
}
void wxThread::SetPriority(unsigned int prio)
{
// this would dead lock everything...
wxASSERT_MSG( !wxThread::IsMain(),
- _T("main thread doesn't want to block in wxMutexGuiEnter()!") );
+ T("main thread doesn't want to block in wxMutexGuiEnter()!") );
// the order in which we enter the critical sections here is crucial!!
{
// decrement the number of waiters now
wxASSERT_MSG( s_nWaitingForGui > 0,
- _T("calling wxMutexGuiLeave() without entering it first?") );
+ T("calling wxMutexGuiLeave() without entering it first?") );
s_nWaitingForGui--;
void WXDLLEXPORT wxMutexGuiLeaveOrEnter()
{
wxASSERT_MSG( wxThread::IsMain(),
- _T("only main thread may call wxMutexGuiLeaveOrEnter()!") );
+ T("only main thread may call wxMutexGuiLeaveOrEnter()!") );
wxCriticalSectionLocker enter(*s_critsectWaitingForGui);
if (milliseconds < 0)
milliseconds = lastMilli;
- wxCHECK_MSG( milliseconds > 0, FALSE, _T("invalid value for timer timeour") );
+ wxCHECK_MSG( milliseconds > 0, FALSE, T("invalid value for timer timeour") );
lastMilli = milli = milliseconds;
{
wxNode *node = wxTimerList.Find((long)idTimer);
- wxCHECK_MSG( node, 0, _T("bogus timer id in wxTimerProc") );
+ wxCHECK_MSG( node, 0, T("bogus timer id in wxTimerProc") );
wxProcessTimer(*(wxTimer *)node->Data());
DFC_BUTTON,
DFCS_BUTTONCHECK | DFCS_CHECKED) )
{
- wxLogLastError(_T("DrawFrameControl(check)"));
+ wxLogLastError(T("DrawFrameControl(check)"));
}
bmp.SetHBITMAP((WXHBITMAP)hbmpCheck);
DFC_BUTTON,
DFCS_BUTTONCHECK) )
{
- wxLogLastError(_T("DrawFrameControl(uncheck)"));
+ wxLogLastError(T("DrawFrameControl(uncheck)"));
}
bmp.SetHBITMAP((WXHBITMAP)hbmpCheck);
if ( !DoGetItem(&tvItem) )
{
// don't return some garbage which was on stack, but an empty string
- buf[0] = _T('\0');
+ buf[0] = T('\0');
}
return wxString(buf);
switch ( which )
{
default:
- wxFAIL_MSG( _T("unknown tree item image type") );
+ wxFAIL_MSG( T("unknown tree item image type") );
case wxTreeItemIcon_Normal:
mask = TVIF_IMAGE;
switch ( which )
{
default:
- wxFAIL_MSG( _T("unknown tree item image type") );
+ wxFAIL_MSG( T("unknown tree item image type") );
case wxTreeItemIcon_Normal:
imageNormal = image;
}
else
{
- wxFAIL_MSG( _T("failed to change tree items data") );
+ wxFAIL_MSG( T("failed to change tree items data") );
}
}
else
// to crash too because the code elsewhere supposes that the pointer the
// wxTreeItemIndirectData has is a real wxItemData and not
// wxTreeItemIndirectData as well
- wxASSERT_MSG( !HasIndirectData(item), _T("setting indirect data twice?") );
+ wxASSERT_MSG( !HasIndirectData(item), T("setting indirect data twice?") );
SetItemData(item, (wxTreeItemData *)data);
wxTreeItemId wxTreeCtrl::GetSelection() const
{
wxCHECK_MSG( !(m_windowStyle & wxTR_MULTIPLE), (WXHTREEITEM)0,
- _T("this only works with single selection controls") );
+ T("this only works with single selection controls") );
return wxTreeItemId((WXHTREEITEM) TreeView_GetSelection(GetHwnd()));
}
wxTreeItemId wxTreeCtrl::GetNextVisible(const wxTreeItemId& item) const
{
- wxASSERT_MSG( IsVisible(item), _T("The item you call GetNextVisible() "
+ wxASSERT_MSG( IsVisible(item), T("The item you call GetNextVisible() "
"for must be visible itself!"));
return wxTreeItemId((WXHTREEITEM) TreeView_GetNextVisible(GetHwnd(), (HTREEITEM) (WXHTREEITEM) item));
wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const
{
- wxASSERT_MSG( IsVisible(item), _T("The item you call GetPrevVisible() "
+ wxASSERT_MSG( IsVisible(item), T("The item you call GetPrevVisible() "
"for must be visible itself!"));
return wxTreeItemId((WXHTREEITEM) TreeView_GetPrevVisible(GetHwnd(), (HTREEITEM) (WXHTREEITEM) item));
flag == (TVE_COLLAPSE | TVE_COLLAPSERESET) ||
flag == TVE_EXPAND ||
flag == TVE_TOGGLE,
- _T("Unknown flag in wxTreeCtrl::DoExpand") );
+ T("Unknown flag in wxTreeCtrl::DoExpand") );
// TreeView_Expand doesn't send TVN_ITEMEXPAND(ING) messages, so we must
// emulate them. This behaviour has changed slightly with comctl32.dll
void wxTreeCtrl::Unselect()
{
- wxASSERT_MSG( !(m_windowStyle & wxTR_MULTIPLE), _T("doesn't make sense") );
+ wxASSERT_MSG( !(m_windowStyle & wxTR_MULTIPLE), T("doesn't make sense") );
// just remove the selection
SelectItem(wxTreeItemId((WXHTREEITEM) 0));
wxTreeCtrl *tree)
{
wxCHECK_MSG( pItem1 && pItem2, 0,
- _T("sorting tree without data doesn't make sense") );
+ T("sorting tree without data doesn't make sense") );
return tree->OnCompareItems(pItem1->GetId(), pItem2->GetId());
}
break;
default:
- wxLogDebug(_T("unexpected code %d in TVN_ITEMEXPAND "
+ wxLogDebug(T("unexpected code %d in TVN_ITEMEXPAND "
"message"), tv->action);
}
/// END for console support
// In the WIN.INI file
-static const wxChar WX_SECTION[] = _T("wxWindows");
-static const wxChar eHOSTNAME[] = _T("HostName");
-static const wxChar eUSERID[] = _T("UserId");
-static const wxChar eUSERNAME[] = _T("UserName");
+static const wxChar WX_SECTION[] = T("wxWindows");
+static const wxChar eHOSTNAME[] = T("HostName");
+static const wxChar eUSERID[] = T("UserId");
+static const wxChar eUSERNAME[] = T("UserName");
// For the following functions we SHOULD fill in support
// for Windows-NT (which I don't know) as I assume it begin
return (::GetComputerName(buf, &nSize) != 0);
#else
wxChar *sysname;
- const wxChar *default_host = _T("noname");
+ const wxChar *default_host = T("noname");
- if ((sysname = wxGetenv(_T("SYSTEM_NAME"))) == NULL) {
+ if ((sysname = wxGetenv(T("SYSTEM_NAME"))) == NULL) {
GetProfileString(WX_SECTION, eHOSTNAME, default_host, buf, maxSize - 1);
} else
wxStrncpy(buf, sysname, maxSize - 1);
- buf[maxSize] = _T('\0');
+ buf[maxSize] = T('\0');
return *buf ? TRUE : FALSE;
#endif
}
if ( ::GetUserName(buf, &nSize) == 0 )
{
// actually, it does happen on Win9x if the user didn't log on
- DWORD res = ::GetEnvironmentVariable(_T("username"), buf, maxSize);
+ DWORD res = ::GetEnvironmentVariable(T("username"), buf, maxSize);
if ( res == 0 )
{
// not found
return TRUE;
#else // Win16 or Win32s
wxChar *user;
- const wxChar *default_id = _T("anonymous");
+ const wxChar *default_id = T("anonymous");
// Can't assume we have NIS (PC-NFS) or some other ID daemon
// So we ...
- if ( (user = wxGetenv(_T("USER"))) == NULL &&
- (user = wxGetenv(_T("LOGNAME"))) == NULL )
+ if ( (user = wxGetenv(T("USER"))) == NULL &&
+ (user = wxGetenv(T("LOGNAME"))) == NULL )
{
// Use wxWindows configuration data (comming soon)
GetProfileString(WX_SECTION, eUSERID, default_id, buf, maxSize - 1);
// Get the computer name of a DC for the domain.
if ( NetGetDCName( NULL, wszDomain, &ComputerName ) != NERR_Success )
{
- wxLogError(_T("Can not find domain controller"));
+ wxLogError(T("Can not find domain controller"));
goto error;
}
break;
case NERR_InvalidComputer:
- wxLogError(_T("Invalid domain controller name."));
+ wxLogError(T("Invalid domain controller name."));
goto error;
case NERR_UserNotFound:
- wxLogError(_T("Invalid user name '%s'."), szUserName);
+ wxLogError(T("Invalid user name '%s'."), szUserName);
goto error;
default:
- wxLogSysError(_T("Can't get information about user"));
+ wxLogSysError(T("Can't get information about user"));
goto error;
}
return TRUE;
error:
- wxLogError(_T("Couldn't look up full user name."));
+ wxLogError(T("Couldn't look up full user name."));
return FALSE;
#else // !USE_NET_API
// Could use NIS, MS-Mail or other site specific programs
// Use wxWindows configuration data
- bool ok = GetProfileString(WX_SECTION, eUSERNAME, _T(""), buf, maxSize - 1) != 0;
+ bool ok = GetProfileString(WX_SECTION, eUSERNAME, T(""), buf, maxSize - 1) != 0;
if ( !ok )
{
ok = wxGetUserId(buf, maxSize);
if ( !ok )
{
- wxStrncpy(buf, _T("Unknown User"), maxSize);
+ wxStrncpy(buf, T("Unknown User"), maxSize);
}
#endif // Win32/16
}
wxShell(const wxString& command)
{
wxChar *shell;
- if ((shell = wxGetenv(_T("COMSPEC"))) == NULL)
- shell = _T("\\COMMAND.COM");
+ if ((shell = wxGetenv(T("COMSPEC"))) == NULL)
+ shell = T("\\COMMAND.COM");
wxChar tmp[255];
- if (command != _T(""))
- wxSprintf(tmp, _T("%s /c %s"), shell, WXSTRINGCAST command);
+ if (command != T(""))
+ wxSprintf(tmp, T("%s /c %s"), shell, WXSTRINGCAST command);
else
wxStrcpy(tmp, shell);
// Non-fatal error: pop up message box and (possibly) continue
void wxError(const wxString& msg, const wxString& title)
{
- wxSprintf(wxBuffer, _T("%s\nContinue?"), WXSTRINGCAST msg);
+ wxSprintf(wxBuffer, T("%s\nContinue?"), WXSTRINGCAST msg);
if (MessageBox(NULL, (LPCTSTR)wxBuffer, (LPCTSTR)WXSTRINGCAST title,
MB_ICONSTOP | MB_YESNO) == IDNO)
wxExit();
// Fatal error: pop up message box and abort
void wxFatalError(const wxString& msg, const wxString& title)
{
- wxSprintf(wxBuffer, _T("%s: %s"), WXSTRINGCAST title, WXSTRINGCAST msg);
+ wxSprintf(wxBuffer, T("%s: %s"), WXSTRINGCAST title, WXSTRINGCAST msg);
FatalAppExit(0, (LPCTSTR)wxBuffer);
}
#if wxUSE_RESOURCES
bool wxWriteResource(const wxString& section, const wxString& entry, const wxString& value, const wxString& file)
{
- if (file != _T(""))
+ if (file != T(""))
return (WritePrivateProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)value, (LPCTSTR)WXSTRINGCAST file) != 0);
else
return (WriteProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)WXSTRINGCAST value) != 0);
bool wxWriteResource(const wxString& section, const wxString& entry, float value, const wxString& file)
{
wxChar buf[50];
- wxSprintf(buf, _T("%.4f"), value);
+ wxSprintf(buf, T("%.4f"), value);
return wxWriteResource(section, entry, buf, file);
}
bool wxWriteResource(const wxString& section, const wxString& entry, long value, const wxString& file)
{
wxChar buf[50];
- wxSprintf(buf, _T("%ld"), value);
+ wxSprintf(buf, T("%ld"), value);
return wxWriteResource(section, entry, buf, file);
}
bool wxWriteResource(const wxString& section, const wxString& entry, int value, const wxString& file)
{
wxChar buf[50];
- wxSprintf(buf, _T("%d"), value);
+ wxSprintf(buf, T("%d"), value);
return wxWriteResource(section, entry, buf, file);
}
bool wxGetResource(const wxString& section, const wxString& entry, wxChar **value, const wxString& file)
{
- static const wxChar defunkt[] = _T("$$default");
- if (file != _T(""))
+ static const wxChar defunkt[] = T("$$default");
+ if (file != T(""))
{
int n = GetPrivateProfileString((LPCTSTR)WXSTRINGCAST section, (LPCTSTR)WXSTRINGCAST entry, (LPCTSTR)defunkt,
(LPTSTR)wxBuffer, 1000, (LPCTSTR)WXSTRINGCAST file);
void wxEndBusyCursor()
{
wxCHECK_RET( gs_wxBusyCursorCount > 0,
- _T("no matching wxBeginBusyCursor() for wxEndBusyCursor()") );
+ T("no matching wxBeginBusyCursor() for wxEndBusyCursor()") );
if ( --gs_wxBusyCursorCount == 0 )
{
if ( szHome == NULL ) {
// we're homeless...
wxLogWarning(_("can't find user's HOME, using current directory."));
- strDir = _T(".");
+ strDir = T(".");
}
else
strDir = szHome;
// add a trailing slash if needed
- if ( strDir.Last() != _T('/') )
- strDir << _T('/');
+ if ( strDir.Last() != T('/') )
+ strDir << T('/');
#else // Windows
#ifdef __WIN32__
- const wxChar *szHome = wxGetenv(_T("HOMEDRIVE"));
+ const wxChar *szHome = wxGetenv(T("HOMEDRIVE"));
if ( szHome != NULL )
strDir << szHome;
- szHome = wxGetenv(_T("HOMEPATH"));
+ szHome = wxGetenv(T("HOMEPATH"));
if ( szHome != NULL ) {
strDir << szHome;
// create it in our program's dir. However, if the user took care
// to set HOMEPATH to something other than "\\", we suppose that he
// knows what he is doing and use the supplied value.
- if ( wxStrcmp(szHome, _T("\\")) != 0 )
+ if ( wxStrcmp(szHome, T("\\")) != 0 )
return strDir.c_str();
}
wxChar *home;
wxString user1(user);
- if (user1 != _T("")) {
+ if (user1 != T("")) {
wxChar tmp[64];
if (wxGetUserId(tmp, sizeof(tmp)/sizeof(char))) {
// Guests belong in the temp dir
- if (wxStricmp(tmp, _T("annonymous")) == 0) {
- if ((home = wxGetenv(_T("TMP"))) != NULL ||
- (home = wxGetenv(_T("TMPDIR"))) != NULL ||
- (home = wxGetenv(_T("TEMP"))) != NULL)
- return *home ? home : (wxChar*)_T("\\");
+ if (wxStricmp(tmp, T("annonymous")) == 0) {
+ if ((home = wxGetenv(T("TMP"))) != NULL ||
+ (home = wxGetenv(T("TMPDIR"))) != NULL ||
+ (home = wxGetenv(T("TEMP"))) != NULL)
+ return *home ? home : (wxChar*)T("\\");
}
if (wxStricmp(tmp, WXSTRINGCAST user1) == 0)
- user1 = _T("");
+ user1 = T("");
}
}
- if (user1 == _T(""))
- if ((home = wxGetenv(_T("HOME"))) != NULL)
+ if (user1 == T(""))
+ if ((home = wxGetenv(T("HOME"))) != NULL)
{
wxStrcpy(wxBuffer, home);
Unix2DosFilename(wxBuffer);
return TRUE;//*** temporary?
}
else{
- wxFAIL_MSG(_T("wnd==NULL !!!"));
+ wxFAIL_MSG(T("wnd==NULL !!!"));
return FALSE;//*** temporary?
}
}
/* make sure DBWIN is open and waiting */
- heventDBWIN = OpenEvent(EVENT_MODIFY_STATE, FALSE, _T("DBWIN_BUFFER_READY"));
+ heventDBWIN = OpenEvent(EVENT_MODIFY_STATE, FALSE, T("DBWIN_BUFFER_READY"));
if ( !heventDBWIN )
{
- //MessageBox(NULL, _T("DBWIN_BUFFER_READY nonexistent"), NULL, MB_OK);
+ //MessageBox(NULL, T("DBWIN_BUFFER_READY nonexistent"), NULL, MB_OK);
return;
}
/* get a handle to the data synch object */
- heventData = OpenEvent(EVENT_MODIFY_STATE, FALSE, _T("DBWIN_DATA_READY"));
+ heventData = OpenEvent(EVENT_MODIFY_STATE, FALSE, T("DBWIN_DATA_READY"));
if ( !heventData )
{
- // MessageBox(NULL, _T("DBWIN_DATA_READY nonexistent"), NULL, MB_OK);
+ // MessageBox(NULL, T("DBWIN_DATA_READY nonexistent"), NULL, MB_OK);
CloseHandle(heventDBWIN);
return;
}
- hSharedFile = CreateFileMapping((HANDLE)-1, NULL, PAGE_READWRITE, 0, 4096, _T("DBWIN_BUFFER"));
+ hSharedFile = CreateFileMapping((HANDLE)-1, NULL, PAGE_READWRITE, 0, 4096, T("DBWIN_BUFFER"));
if (!hSharedFile)
{
- //MessageBox(NULL, _T("DebugTrace: Unable to create file mapping object DBWIN_BUFFER"), _T("Error"), MB_OK);
+ //MessageBox(NULL, T("DebugTrace: Unable to create file mapping object DBWIN_BUFFER"), T("Error"), MB_OK);
CloseHandle(heventDBWIN);
CloseHandle(heventData);
return;
lpszSharedMem = (LPSTR)MapViewOfFile(hSharedFile, FILE_MAP_WRITE, 0, 0, 512);
if (!lpszSharedMem)
{
- //MessageBox(NULL, _T("DebugTrace: Unable to map shared memory"), _T("Error"), MB_OK);
+ //MessageBox(NULL, T("DebugTrace: Unable to map shared memory"), T("Error"), MB_OK);
CloseHandle(heventDBWIN);
CloseHandle(heventData);
return;
*((LPDWORD)lpszSharedMem) = _getpid();
#endif
- wsprintf((LPTSTR)(lpszSharedMem + sizeof(DWORD)), _T("%s"), achBuffer);
+ wsprintf((LPTSTR)(lpszSharedMem + sizeof(DWORD)), T("%s"), achBuffer);
/* signal data ready event */
SetEvent(heventData);
}
wxASSERT_MSG( data->dwExitCode != STILL_ACTIVE,
- _T("process should have terminated") );
+ T("process should have terminated") );
// send a message indicating process termination to the window
SendMessage(data->hWnd, wxWM_PROC_TERMINATED, 0, (LPARAM)data);
long wxExecute(const wxString& command, bool sync, wxProcess *handler)
{
- wxCHECK_MSG( !!command, 0, _T("empty command in wxExecute") );
+ wxCHECK_MSG( !!command, 0, T("empty command in wxExecute") );
#if defined(__WIN32__) && !defined(__TWIN32__)
// the old code is disabled because we really need a process handle
// termination
HWND hwnd = ::CreateWindow(wxPanelClassName, NULL, 0, 0, 0, 0, 0, NULL,
(HMENU)NULL, wxGetInstance(), 0);
- wxASSERT_MSG( hwnd, _T("can't create a hidden window for wxExecute") );
+ wxASSERT_MSG( hwnd, T("can't create a hidden window for wxExecute") );
FARPROC ExecuteWindowInstance = MakeProcInstance((FARPROC)wxExecuteWindowCbk,
wxGetInstance());
data->state = sync;
if ( sync )
{
- wxASSERT_MSG( !handler, _T("wxProcess param ignored for sync execution") );
+ wxASSERT_MSG( !handler, T("wxProcess param ignored for sync execution") );
data->handler = NULL;
}
HRSRC hresInfo;
#if defined(__WIN32__) && !defined(__TWIN32__)
#ifdef _UNICODE
- hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, _T("WAVE"));
+ hresInfo = ::FindResourceW((HMODULE) wxhInstance, fileName, T("WAVE"));
#else
- hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, _T("WAVE"));
+ hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, T("WAVE"));
#endif
#else
- hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, _T("WAVE"));
+ hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, T("WAVE"));
#endif
if (!hresInfo)
return FALSE;
long style,
const wxString& name)
{
- wxCHECK_MSG( parent, FALSE, _T("can't create wxWindow without parent") );
+ wxCHECK_MSG( parent, FALSE, T("can't create wxWindow without parent") );
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
return FALSE;
{
WXHANDLE hFont = m_font.GetResourceHandle();
- wxASSERT_MSG( hFont, _T("should have valid font") );
+ wxASSERT_MSG( hFont, T("should have valid font") );
::SendMessage(hWnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
}
}
wxASSERT_MSG( m_cursor.Ok(),
- _T("cursor must be valid after call to the base version"));
+ T("cursor must be valid after call to the base version"));
HWND hWnd = GetHwnd();
void wxWindow::SubclassWin(WXHWND hWnd)
{
- wxASSERT_MSG( !m_oldWndProc, _T("subclassing window twice?") );
+ wxASSERT_MSG( !m_oldWndProc, T("subclassing window twice?") );
HWND hwnd = (HWND)hWnd;
- wxCHECK_RET( ::IsWindow(hwnd), _T("invalid HWND in SubclassWin") );
+ wxCHECK_RET( ::IsWindow(hwnd), T("invalid HWND in SubclassWin") );
wxAssociateWinWithHandle(hwnd, this);
{
m_hWnd = 0;
- wxCHECK_RET( ::IsWindow(hwnd), _T("invalid HWND in UnsubclassWin") );
+ wxCHECK_RET( ::IsWindow(hwnd), T("invalid HWND in UnsubclassWin") );
FARPROC farProc = (FARPROC) GetWindowLong(hwnd, GWL_WNDPROC);
if ( (m_oldWndProc != 0) && (farProc != (FARPROC) m_oldWndProc) )
{
// trace all messages - useful for the debugging
#ifdef __WXDEBUG__
- wxLogTrace(wxTraceMessages, _T("Processing %s(wParam=%8lx, lParam=%8lx)"),
+ wxLogTrace(wxTraceMessages, T("Processing %s(wParam=%8lx, lParam=%8lx)"),
wxGetMessageName(message), wParam, lParam);
#endif // __WXDEBUG__
if ( !processed )
{
#ifdef __WXDEBUG__
- wxLogTrace(wxTraceMessages, _T("Forwarding %s to DefWindowProc."),
+ wxLogTrace(wxTraceMessages, T("Forwarding %s to DefWindowProc."),
wxGetMessageName(message));
#endif // __WXDEBUG__
rc.result = MSWDefWindowProc(message, wParam, lParam);
// adding NULL hWnd is (first) surely a result of an error and
// (secondly) breaks menu command processing
wxCHECK_RET( hWnd != (HWND)NULL,
- _T("attempt to add a NULL hWnd to window list ignored") );
+ T("attempt to add a NULL hWnd to window list ignored") );
wxWindow *oldWin = wxFindWinFromHandle((WXHWND) hWnd);
int chars = GetMenuString(hMenu, i, buf, 100, MF_BYPOSITION);
if ( !chars )
{
- wxLogLastError(_T("GetMenuString"));
+ wxLogLastError(T("GetMenuString"));
continue;
}
- if ( wxStrcmp(buf, _T("&Window")) == 0 )
+ if ( wxStrcmp(buf, T("&Window")) == 0 )
{
RemoveMenu(hMenu, i, MF_BYPOSITION);
if ( !::SetWindowPos(GetHwnd(), HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE) )
{
- wxLogLastError(_T("SetWindowPos"));
+ wxLogLastError(T("SetWindowPos"));
}
}
// move the dialog to its initial position without forcing repainting
if ( !::MoveWindow(GetHwnd(), x1, y1, width1, height1, FALSE) )
{
- wxLogLastError(_T("MoveWindow"));
+ wxLogLastError(T("MoveWindow"));
}
}
else
wxString className(wclass);
if ( GetWindowStyleFlag() & wxNO_FULL_REPAINT_ON_RESIZE )
{
- className += _T("NR");
+ className += T("NR");
}
m_hWnd = (WXHWND)CreateWindowEx(extendedStyle,
wclass,
- title ? title : _T(""),
+ title ? title : T(""),
style,
x1, y1,
width1, height1,
break;
default:
- wxFAIL_MSG(_T("no such joystick event"));
+ wxFAIL_MSG(T("no such joystick event"));
return FALSE;
}
case 0x0008: return "WM_KILLFOCUS";
case 0x000A: return "WM_ENABLE";
case 0x000B: return "WM_SETREDRAW";
- case 0x000C: return "WM_SETTEXT";
- case 0x000D: return "WM_GETTEXT";
+ case 0x000C: return "WM_SETTEXT(";
+ case 0x000D: return "WM_GETTEXT(";
case 0x000E: return "WM_GETTEXTLENGTH";
- case 0x000F: return "WM_PAINT";
+ case 0x000F: return "WM_PAINT(";
case 0x0010: return "WM_CLOSE";
case 0x0011: return "WM_QUERYENDSESSION";
- case 0x0012: return "WM_QUIT";
+ case 0x0012: return "WM_QUIT(";
case 0x0013: return "WM_QUERYOPEN";
case 0x0014: return "WM_ERASEBKGND";
case 0x0015: return "WM_SYSCOLORCHANGE";
case 0x002D: return "WM_DELETEITEM";
case 0x002E: return "WM_VKEYTOITEM";
case 0x002F: return "WM_CHARTOITEM";
- case 0x0030: return "WM_SETFONT";
- case 0x0031: return "WM_GETFONT";
+ case 0x0030: return "WM_SETFONT(";
+ case 0x0031: return "WM_GETFONT(";
case 0x0037: return "WM_QUERYDRAGICON";
case 0x0039: return "WM_COMPAREITEM";
case 0x0041: return "WM_COMPACTING";
case 0x004A: return "WM_COPYDATA";
case 0x004B: return "WM_CANCELJOURNAL";
case 0x004E: return "WM_NOTIFY";
- case 0x0050: return "WM_INPUTLANGCHANGEREQUEST";
+ case 0x0050: return "WM_INPUTLANGCHANGEREQUEST(";
case 0x0051: return "WM_INPUTLANGCHANGE";
case 0x0052: return "WM_TCARD";
case 0x0053: return "WM_HELP";
case 0x0054: return "WM_USERCHANGED";
- case 0x0055: return "WM_NOTIFYFORMAT";
+ case 0x0055: return "WM_NOTIFYFORMAT(";
case 0x007B: return "WM_CONTEXTMENU";
case 0x007C: return "WM_STYLECHANGING";
case 0x007D: return "WM_STYLECHANGED";
case 0x0081: return "WM_NCCREATE";
case 0x0082: return "WM_NCDESTROY";
case 0x0083: return "WM_NCCALCSIZE";
- case 0x0084: return "WM_NCHITTEST";
- case 0x0085: return "WM_NCPAINT";
+ case 0x0084: return "WM_NCHITTEST(";
+ case 0x0085: return "WM_NCPAINT(";
case 0x0086: return "WM_NCACTIVATE";
case 0x0087: return "WM_GETDLGCODE";
case 0x00A0: return "WM_NCMOUSEMOVE";
case 0x0105: return "WM_SYSKEYUP";
case 0x0106: return "WM_SYSCHAR";
case 0x0107: return "WM_SYSDEADCHAR";
- case 0x0108: return "WM_KEYLAST";
+ case 0x0108: return "WM_KEYLAST(";
#ifdef __WIN32__
case 0x010D: return "WM_IME_STARTCOMPOSITION";
case 0x0115: return "WM_VSCROLL";
case 0x0116: return "WM_INITMENU";
case 0x0117: return "WM_INITMENUPOPUP";
- case 0x011F: return "WM_MENUSELECT";
+ case 0x011F: return "WM_MENUSELECT(";
case 0x0120: return "WM_MENUCHAR";
case 0x0121: return "WM_ENTERIDLE";
case 0x0200: return "WM_MOUSEMOVE";
case 0x0214: return "WM_SIZING";
case 0x0215: return "WM_CAPTURECHANGED";
case 0x0216: return "WM_MOVING";
- case 0x0218: return "WM_POWERBROADCAST";
+ case 0x0218: return "WM_POWERBROADCAST(";
case 0x0219: return "WM_DEVICECHANGE";
#endif //WIN32
case 0x0221: return "WM_MDIDESTROY";
case 0x0222: return "WM_MDIACTIVATE";
case 0x0223: return "WM_MDIRESTORE";
- case 0x0224: return "WM_MDINEXT";
+ case 0x0224: return "WM_MDINEXT(";
case 0x0225: return "WM_MDIMAXIMIZE";
case 0x0226: return "WM_MDITILE";
case 0x0227: return "WM_MDICASCADE";
case 0x0233: return "WM_DROPFILES";
#ifdef __WIN32__
- case 0x0281: return "WM_IME_SETCONTEXT";
+ case 0x0281: return "WM_IME_SETCONTEXT(";
case 0x0282: return "WM_IME_NOTIFY";
case 0x0283: return "WM_IME_CONTROL";
case 0x0284: return "WM_IME_COMPOSITIONFULL";
- case 0x0285: return "WM_IME_SELECT";
+ case 0x0285: return "WM_IME_SELECT(";
case 0x0286: return "WM_IME_CHAR";
case 0x0290: return "WM_IME_KEYDOWN";
case 0x0291: return "WM_IME_KEYUP";
#endif //WIN32
- case 0x0300: return "WM_CUT";
+ case 0x0300: return "WM_CUT(";
case 0x0301: return "WM_COPY";
case 0x0302: return "WM_PASTE";
case 0x0303: return "WM_CLEAR";
case 0x0304: return "WM_UNDO";
- case 0x0305: return "WM_RENDERFORMAT";
+ case 0x0305: return "WM_RENDERFORMAT(";
case 0x0306: return "WM_RENDERALLFORMATS";
case 0x0307: return "WM_DESTROYCLIPBOARD";
case 0x0308: return "WM_DRAWCLIPBOARD";
// listview
case 0x1000 + 0: return "LVM_GETBKCOLOR";
case 0x1000 + 1: return "LVM_SETBKCOLOR";
- case 0x1000 + 2: return "LVM_GETIMAGELIST";
- case 0x1000 + 3: return "LVM_SETIMAGELIST";
- case 0x1000 + 4: return "LVM_GETITEMCOUNT";
+ case 0x1000 + 2: return "LVM_GETIMAGELIST(";
+ case 0x1000 + 3: return "LVM_SETIMAGELIST(";
+ case 0x1000 + 4: return "LVM_GETITEMCOUNT(";
case 0x1000 + 5: return "LVM_GETITEMA";
case 0x1000 + 75: return "LVM_GETITEMW";
case 0x1000 + 6: return "LVM_SETITEMA";
case 0x1000 + 12: return "LVM_GETNEXTITEM";
case 0x1000 + 13: return "LVM_FINDITEMA";
case 0x1000 + 83: return "LVM_FINDITEMW";
- case 0x1000 + 14: return "LVM_GETITEMRECT";
+ case 0x1000 + 14: return "LVM_GETITEMRECT(";
case 0x1000 + 15: return "LVM_SETITEMPOSITION";
case 0x1000 + 16: return "LVM_GETITEMPOSITION";
case 0x1000 + 17: return "LVM_GETSTRINGWIDTHA";
case 0x1000 + 87: return "LVM_GETSTRINGWIDTHW";
- case 0x1000 + 18: return "LVM_HITTEST";
+ case 0x1000 + 18: return "LVM_HITTEST(";
case 0x1000 + 19: return "LVM_ENSUREVISIBLE";
case 0x1000 + 20: return "LVM_SCROLL";
case 0x1000 + 21: return "LVM_REDRAWITEMS";
case 0x1000 + 30: return "LVM_SETCOLUMNWIDTH";
case 0x1000 + 31: return "LVM_GETHEADER";
case 0x1000 + 33: return "LVM_CREATEDRAGIMAGE";
- case 0x1000 + 34: return "LVM_GETVIEWRECT";
+ case 0x1000 + 34: return "LVM_GETVIEWRECT(";
case 0x1000 + 35: return "LVM_GETTEXTCOLOR";
case 0x1000 + 36: return "LVM_SETTEXTCOLOR";
case 0x1000 + 37: return "LVM_GETTEXTBKCOLOR";
case 0x1000 + 115: return "LVM_GETITEMTEXTW";
case 0x1000 + 46: return "LVM_SETITEMTEXTA";
case 0x1000 + 116: return "LVM_SETITEMTEXTW";
- case 0x1000 + 47: return "LVM_SETITEMCOUNT";
+ case 0x1000 + 47: return "LVM_SETITEMCOUNT(";
case 0x1000 + 48: return "LVM_SORTITEMS";
case 0x1000 + 49: return "LVM_SETITEMPOSITION32";
- case 0x1000 + 50: return "LVM_GETSELECTEDCOUNT";
+ case 0x1000 + 50: return "LVM_GETSELECTEDCOUNT(";
case 0x1000 + 51: return "LVM_GETITEMSPACING";
case 0x1000 + 52: return "LVM_GETISEARCHSTRINGA";
case 0x1000 + 117: return "LVM_GETISEARCHSTRINGW";
case 0x1000 + 53: return "LVM_SETICONSPACING";
case 0x1000 + 54: return "LVM_SETEXTENDEDLISTVIEWSTYLE";
case 0x1000 + 55: return "LVM_GETEXTENDEDLISTVIEWSTYLE";
- case 0x1000 + 56: return "LVM_GETSUBITEMRECT";
- case 0x1000 + 57: return "LVM_SUBITEMHITTEST";
+ case 0x1000 + 56: return "LVM_GETSUBITEMRECT(";
+ case 0x1000 + 57: return "LVM_SUBITEMHITTEST(";
case 0x1000 + 58: return "LVM_SETCOLUMNORDERARRAY";
case 0x1000 + 59: return "LVM_GETCOLUMNORDERARRAY";
case 0x1000 + 60: return "LVM_SETHOTITEM";
case 0x1000 + 61: return "LVM_GETHOTITEM";
case 0x1000 + 62: return "LVM_SETHOTCURSOR";
case 0x1000 + 63: return "LVM_GETHOTCURSOR";
- case 0x1000 + 64: return "LVM_APPROXIMATEVIEWRECT";
+ case 0x1000 + 64: return "LVM_APPROXIMATEVIEWRECT(";
case 0x1000 + 65: return "LVM_SETWORKAREA";
// tree view
case 0x1100 + 50: return "TVM_INSERTITEMW";
case 0x1100 + 1: return "TVM_DELETEITEM";
case 0x1100 + 2: return "TVM_EXPAND";
- case 0x1100 + 4: return "TVM_GETITEMRECT";
- case 0x1100 + 5: return "TVM_GETCOUNT";
- case 0x1100 + 6: return "TVM_GETINDENT";
- case 0x1100 + 7: return "TVM_SETINDENT";
- case 0x1100 + 8: return "TVM_GETIMAGELIST";
- case 0x1100 + 9: return "TVM_SETIMAGELIST";
+ case 0x1100 + 4: return "TVM_GETITEMRECT(";
+ case 0x1100 + 5: return "TVM_GETCOUNT(";
+ case 0x1100 + 6: return "TVM_GETINDENT(";
+ case 0x1100 + 7: return "TVM_SETINDENT(";
+ case 0x1100 + 8: return "TVM_GETIMAGELIST(";
+ case 0x1100 + 9: return "TVM_SETIMAGELIST(";
case 0x1100 + 10: return "TVM_GETNEXTITEM";
case 0x1100 + 11: return "TVM_SELECTITEM";
case 0x1100 + 12: return "TVM_GETITEMA";
case 0x1100 + 14: return "TVM_EDITLABELA";
case 0x1100 + 65: return "TVM_EDITLABELW";
case 0x1100 + 15: return "TVM_GETEDITCONTROL";
- case 0x1100 + 16: return "TVM_GETVISIBLECOUNT";
- case 0x1100 + 17: return "TVM_HITTEST";
+ case 0x1100 + 16: return "TVM_GETVISIBLECOUNT(";
+ case 0x1100 + 17: return "TVM_HITTEST(";
case 0x1100 + 18: return "TVM_CREATEDRAGIMAGE";
case 0x1100 + 19: return "TVM_SORTCHILDREN";
case 0x1100 + 20: return "TVM_ENSUREVISIBLE";
case 0x1100 + 25: return "TVM_GETTOOLTIPS";
// header
- case 0x1200 + 0: return "HDM_GETITEMCOUNT";
+ case 0x1200 + 0: return "HDM_GETITEMCOUNT(";
case 0x1200 + 1: return "HDM_INSERTITEMA";
case 0x1200 + 10: return "HDM_INSERTITEMW";
case 0x1200 + 2: return "HDM_DELETEITEM";
case 0x1200 + 11: return "HDM_GETITEMW";
case 0x1200 + 4: return "HDM_SETITEMA";
case 0x1200 + 12: return "HDM_SETITEMW";
- case 0x1200 + 5: return "HDM_LAYOUT";
- case 0x1200 + 6: return "HDM_HITTEST";
- case 0x1200 + 7: return "HDM_GETITEMRECT";
- case 0x1200 + 8: return "HDM_SETIMAGELIST";
- case 0x1200 + 9: return "HDM_GETIMAGELIST";
+ case 0x1200 + 5: return "HDM_LAYOUT(";
+ case 0x1200 + 6: return "HDM_HITTEST(";
+ case 0x1200 + 7: return "HDM_GETITEMRECT(";
+ case 0x1200 + 8: return "HDM_SETIMAGELIST(";
+ case 0x1200 + 9: return "HDM_GETIMAGELIST(";
case 0x1200 + 15: return "HDM_ORDERTOINDEX";
case 0x1200 + 16: return "HDM_CREATEDRAGIMAGE";
case 0x1200 + 17: return "HDM_GETORDERARRAY";
case 0x1200 + 19: return "HDM_SETHOTDIVIDER";
// tab control
- case 0x1300 + 2: return "TCM_GETIMAGELIST";
- case 0x1300 + 3: return "TCM_SETIMAGELIST";
- case 0x1300 + 4: return "TCM_GETITEMCOUNT";
+ case 0x1300 + 2: return "TCM_GETIMAGELIST(";
+ case 0x1300 + 3: return "TCM_SETIMAGELIST(";
+ case 0x1300 + 4: return "TCM_GETITEMCOUNT(";
case 0x1300 + 5: return "TCM_GETITEMA";
case 0x1300 + 60: return "TCM_GETITEMW";
case 0x1300 + 6: return "TCM_SETITEMA";
case 0x1300 + 62: return "TCM_INSERTITEMW";
case 0x1300 + 8: return "TCM_DELETEITEM";
case 0x1300 + 9: return "TCM_DELETEALLITEMS";
- case 0x1300 + 10: return "TCM_GETITEMRECT";
+ case 0x1300 + 10: return "TCM_GETITEMRECT(";
case 0x1300 + 11: return "TCM_GETCURSEL";
case 0x1300 + 12: return "TCM_SETCURSEL";
- case 0x1300 + 13: return "TCM_HITTEST";
+ case 0x1300 + 13: return "TCM_HITTEST(";
case 0x1300 + 14: return "TCM_SETITEMEXTRA";
- case 0x1300 + 40: return "TCM_ADJUSTRECT";
+ case 0x1300 + 40: return "TCM_ADJUSTRECT(";
case 0x1300 + 41: return "TCM_SETITEMSIZE";
case 0x1300 + 42: return "TCM_REMOVEIMAGE";
case 0x1300 + 43: return "TCM_SETPADDING";
- case 0x1300 + 44: return "TCM_GETROWCOUNT";
+ case 0x1300 + 44: return "TCM_GETROWCOUNT(";
case 0x1300 + 45: return "TCM_GETTOOLTIPS";
case 0x1300 + 46: return "TCM_SETTOOLTIPS";
case 0x1300 + 47: return "TCM_GETCURFOCUS";
case WM_USER+21: return "TB_INSERTBUTTON";
case WM_USER+22: return "TB_DELETEBUTTON";
case WM_USER+23: return "TB_GETBUTTON";
- case WM_USER+24: return "TB_BUTTONCOUNT";
+ case WM_USER+24: return "TB_BUTTONCOUNT(";
case WM_USER+25: return "TB_COMMANDTOINDEX";
case WM_USER+26: return "TB_SAVERESTOREA";
case WM_USER+76: return "TB_SAVERESTOREW";
case WM_USER+27: return "TB_CUSTOMIZE";
case WM_USER+28: return "TB_ADDSTRINGA";
case WM_USER+77: return "TB_ADDSTRINGW";
- case WM_USER+29: return "TB_GETITEMRECT";
+ case WM_USER+29: return "TB_GETITEMRECT(";
case WM_USER+30: return "TB_BUTTONSTRUCTSIZE";
case WM_USER+31: return "TB_SETBUTTONSIZE";
case WM_USER+32: return "TB_SETBITMAPSIZE";
case WM_USER+33: return "TB_AUTOSIZE";
case WM_USER+35: return "TB_GETTOOLTIPS";
case WM_USER+36: return "TB_SETTOOLTIPS";
- case WM_USER+37: return "TB_SETPARENT";
+ case WM_USER+37: return "TB_SETPARENT(";
case WM_USER+39: return "TB_SETROWS";
case WM_USER+40: return "TB_GETROWS";
case WM_USER+42: return "TB_SETCMDID";
case WM_USER+45: return "TB_GETBUTTONTEXTA";
case WM_USER+75: return "TB_GETBUTTONTEXTW";
case WM_USER+46: return "TB_REPLACEBITMAP";
- case WM_USER+47: return "TB_SETINDENT";
- case WM_USER+48: return "TB_SETIMAGELIST";
- case WM_USER+49: return "TB_GETIMAGELIST";
+ case WM_USER+47: return "TB_SETINDENT(";
+ case WM_USER+48: return "TB_SETIMAGELIST(";
+ case WM_USER+49: return "TB_GETIMAGELIST(";
case WM_USER+50: return "TB_LOADIMAGES";
- case WM_USER+51: return "TB_GETRECT";
- case WM_USER+52: return "TB_SETHOTIMAGELIST";
- case WM_USER+53: return "TB_GETHOTIMAGELIST";
- case WM_USER+54: return "TB_SETDISABLEDIMAGELIST";
- case WM_USER+55: return "TB_GETDISABLEDIMAGELIST";
+ case WM_USER+51: return "TB_GETRECT(";
+ case WM_USER+52: return "TB_SETHOTIMAGELIST(";
+ case WM_USER+53: return "TB_GETHOTIMAGELIST(";
+ case WM_USER+54: return "TB_SETDISABLEDIMAGELIST(";
+ case WM_USER+55: return "TB_GETDISABLEDIMAGELIST(";
case WM_USER+56: return "TB_SETSTYLE";
case WM_USER+57: return "TB_GETSTYLE";
case WM_USER+58: return "TB_GETBUTTONSIZE";
if (dc)
{
xpmAttr.valuemask = XpmReturnPixels;
- int errorStatus = XpmReadFileToImage(&dc, MBSTRINGCAST name.mb_str(wxConvFile), &ximage, (XImage **) NULL, &xpmAttr);
+ int errorStatus = XpmReadFileToImage(&dc, wxMBSTRINGCAST name.mb_str(wxConvFile), &ximage, (XImage **) NULL, &xpmAttr);
DeleteDC(dc);
if (errorStatus == XpmSuccess)
{
ximage.height = M_BITMAPHANDLERDATA->m_height;
ximage.depth = M_BITMAPHANDLERDATA->m_depth;
ximage.bitmap = (HBITMAP)M_BITMAPHANDLERDATA->m_hBitmap;
- int errorStatus = XpmWriteFileFromImage(&dc, MBSTRINGCAST name.mb_str(wxConvFile),
+ int errorStatus = XpmWriteFileFromImage(&dc, wxMBSTRINGCAST name.mb_str(wxConvFile),
&ximage, (XImage *) NULL, (XpmAttributes *) NULL);
if (dc)
#include "wx/setup.h"
-#if wxUSE_DIALUP_MANAGER
-
#ifdef __GNUG__
#pragma implementation "dialup.h"
#endif
+#if wxUSE_DIALUP_MANAGER
+
#ifndef WX_PRECOMP
# include "wx/defs.h"
#endif // !PCH
public:
wxDialUpManagerImpl();
~wxDialUpManagerImpl();
-
+
/** Could the dialup manager be initialized correctly? If this function
returns FALSE, no other functions will work neither, so it's a good idea
to call this function and check its result before calling any other
}
/// returns TRUE if (async) dialing is in progress
- inline virtual bool IsDialling() const
+ inline virtual bool IsDialing() const
{ return m_DialProcess != NULL; }
// cancel dialing the number initiated with Dial(async = TRUE)
/// pid of dial process
int m_DialPId;
friend class wxDialProcess;
-
+
/// determine status
void CheckStatus(bool fromAsync = FALSE) const;
{
if(m_IsOnline == 0)
return FALSE;
- if(IsDialling())
+ if(IsDialing())
{
wxLogError(_("Already dialling ISP."));
return FALSE;
bool
wxDialUpManagerImpl::CancelDialing()
{
- if(! IsDialling())
+ if(! IsDialing())
return FALSE;
return kill(m_DialPId, SIGTERM) > 0;
}
if(m_CanUseIfconfig != 0) // unknown or yes
{
wxASSERT(m_IfconfigPath.length());
-
+
wxString tmpfile = wxGetTempFileName("_wxdialuptest");
wxString cmd = "/bin/sh -c \'";
cmd << m_IfconfigPath << " >" << tmpfile << '\'';
/* I tried to add an option to wxExecute() to not close stdout,
so we could let ifconfig write directly to the tmpfile, but
- this does not work. That should be faster, as it doesn´t call
+ this does not work. That should be faster, as it doesn´t call
the shell first. I have no idea why. :-( (KB) */
#if 0
// temporarily redirect stdout/stderr:
// This can be used under Win 9x, too!
struct hostent *hp;
struct sockaddr_in serv_addr;
- int sockfd;
+ int sockfd;
m_IsOnline = 0; // assume false
if((hp = gethostbyname(m_BeaconHost)) == NULL)
return; // no DNS no net
-
- serv_addr.sin_family = hp->h_addrtype;
+
+ serv_addr.sin_family = hp->h_addrtype;
memcpy(&serv_addr.sin_addr,hp->h_addr, hp->h_length);
- serv_addr.sin_port = htons(m_BeaconPort);
- if( ( sockfd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0)
- {
+ serv_addr.sin_port = htons(m_BeaconPort);
+ if( ( sockfd = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0)
+ {
// sys_error("cannot create socket for gw");
return;
}
sizeof(serv_addr)) == -1)
return;
#endif
-
+
if( connect(sockfd, (struct sockaddr *) &serv_addr, sizeof(serv_addr)) < 0)
- {
+ {
//sys_error("cannot connect to server");
return;
}
wxMutex::~wxMutex()
{
if (m_locked > 0)
- wxLogDebug(_T("Freeing a locked mutex (%d locks)"), m_locked);
+ wxLogDebug(T("Freeing a locked mutex (%d locks)"), m_locked);
pthread_mutex_destroy( &(p_internal->p_mutex) );
delete p_internal;
int err = pthread_mutex_lock( &(p_internal->p_mutex) );
if (err == EDEADLK)
{
- wxLogDebug(_T("Locking this mutex would lead to deadlock!"));
+ wxLogDebug(T("Locking this mutex would lead to deadlock!"));
return wxMUTEX_DEAD_LOCK;
}
}
else
{
- wxLogDebug(_T("Unlocking not locked mutex."));
+ wxLogDebug(T("Unlocking not locked mutex."));
return wxMUTEX_UNLOCKED;
}
// terminate the thread
thread->Exit(status);
- wxFAIL_MSG(_T("wxThread::Exit() can't return."));
+ wxFAIL_MSG(T("wxThread::Exit() can't return."));
return NULL;
}
wxThreadError wxThreadInternal::Run()
{
wxCHECK_MSG( GetState() == STATE_NEW, wxTHREAD_RUNNING,
- _T("thread may only be started once after successful Create()") );
+ T("thread may only be started once after successful Create()") );
// the mutex was locked on Create(), so we will be able to lock it again
// only when the thread really starts executing and enters the wait -
void wxThreadInternal::Wait()
{
- wxCHECK_RET( WasCancelled(), _T("thread should have been cancelled first") );
+ wxCHECK_RET( WasCancelled(), T("thread should have been cancelled first") );
// if the thread we're waiting for is waiting for the GUI mutex, we will
// deadlock so make sure we release it temporarily
// the state is set from the thread which pauses us first, this function
// is called later so the state should have been already set
wxCHECK_RET( m_state == STATE_PAUSED,
- _T("thread must first be paused with wxThread::Pause().") );
+ T("thread must first be paused with wxThread::Pause().") );
// don't pause the thread which is being terminated - this would lead to
// deadlock if the thread is paused after Delete() had called Resume() but
void wxThreadInternal::Resume()
{
wxCHECK_RET( m_state == STATE_PAUSED,
- _T("can't resume thread which is not suspended.") );
+ T("can't resume thread which is not suspended.") );
// we will be able to lock this mutex only when Pause() starts waiting
wxMutexLocker lock(m_mutexSuspend);
{
wxCHECK_RET( ((int)WXTHREAD_MIN_PRIORITY <= (int)prio) &&
((int)prio <= (int)WXTHREAD_MAX_PRIORITY),
- _T("invalid thread priority") );
+ T("invalid thread priority") );
wxCriticalSectionLocker lock(m_critsect);
case STATE_EXITED:
default:
- wxFAIL_MSG(_T("impossible to set thread priority in this state"));
+ wxFAIL_MSG(T("impossible to set thread priority in this state"));
}
}
if ( p_internal->GetState() != STATE_RUNNING )
{
- wxLogDebug(_T("Can't pause thread which is not running."));
+ wxLogDebug(T("Can't pause thread which is not running."));
return wxTHREAD_NOT_RUNNING;
}
}
else
{
- wxLogDebug(_T("Attempt to resume a thread which is not paused."));
+ wxLogDebug(T("Attempt to resume a thread which is not paused."));
return wxTHREAD_MISC_ERROR;
}
m_critsect.Enter();
if (p_internal->GetState() != STATE_EXITED &&
p_internal->GetState() != STATE_NEW)
- wxLogDebug(_T("The thread is being destroyed althought it is still running ! The application may crash."));
+ wxLogDebug(T("The thread is being destroyed althought it is still running ! The application may crash."));
m_critsect.Leave();
void wxThreadModule::OnExit()
{
- wxASSERT_MSG( wxThread::IsMain(), _T("only main thread can be here") );
+ wxASSERT_MSG( wxThread::IsMain(), T("only main thread can be here") );
// terminate any threads left
size_t count = gs_allThreads.GetCount();
if ( count != 0u )
- wxLogDebug(_T("Some threads were not terminated by the application."));
+ wxLogDebug(T("Some threads were not terminated by the application."));
for ( size_t n = 0u; n < count; n++ )
{
#ifdef __SUN__
int usleep(unsigned int usec);
#else // !Sun
- #ifdef __EMX
+ #ifdef __EMX
/* I copied this from the XFree86 diffs. AV. */
#define INCL_DOSPROCESS
#include <os2.h>
{
DosSleep(delay ? (delay/1000l) : 1l);
}
- #else
- void usleep(unsigned long usec);
- #endif
+ #else
+ void usleep(unsigned long usec);
+ #endif
#endif // Sun/EMX/Something else
};
#define HAVE_USLEEP 1
long wxExecute( const wxString& command, bool sync, wxProcess *process )
{
- wxCHECK_MSG( !command.IsEmpty(), 0, _T("can't exec empty command") );
+ wxCHECK_MSG( !command.IsEmpty(), 0, T("can't exec empty command") );
int argc = 0;
wxChar *argv[WXEXECUTE_NARGS];
wxString argument;
const wxChar *cptr = command.c_str();
- wxChar quotechar = _T('\0'); // is arg quoted?
+ wxChar quotechar = T('\0'); // is arg quoted?
bool escaped = FALSE;
// split the command line in arguments
do
{
- argument=_T("");
- quotechar = _T('\0');
+ argument=T("");
+ quotechar = T('\0');
// eat leading whitespace:
while ( wxIsspace(*cptr) )
cptr++;
- if ( *cptr == _T('\'') || *cptr == _T('"') )
+ if ( *cptr == T('\'') || *cptr == T('"') )
quotechar = *cptr++;
do
{
- if ( *cptr == _T('\\') && ! escaped )
+ if ( *cptr == T('\\') && ! escaped )
{
escaped = TRUE;
cptr++;
// have we reached the end of the argument?
if ( (*cptr == quotechar && ! escaped)
- || (quotechar == _T('\0') && wxIsspace(*cptr))
- || *cptr == _T('\0') )
+ || (quotechar == T('\0') && wxIsspace(*cptr))
+ || *cptr == T('\0') )
{
wxASSERT_MSG( argc < WXEXECUTE_NARGS,
- _T("too many arguments in wxExecute") );
+ T("too many arguments in wxExecute") );
argv[argc] = new wxChar[argument.length() + 1];
wxStrcpy(argv[argc], argument.c_str());
{
wxString cmd;
if ( !!command )
- cmd.Printf(_T("xterm -e %s"), command.c_str());
+ cmd.Printf(T("xterm -e %s"), command.c_str());
else
cmd = command;
long wxExecute( wxChar **argv, bool sync, wxProcess *process )
{
- wxCHECK_MSG( *argv, 0, _T("can't exec empty command") );
+ wxCHECK_MSG( *argv, 0, T("can't exec empty command") );
- int end_proc_detect[2];
#if wxUSE_UNICODE
int mb_argc = 0;
char *mb_argv[WXEXECUTE_NARGS];
- while (argv[mb_argc]) {
- wxWX2MBbuf mb_arg = wxConvCurrent->cWX2MB(argv[mb_argc]);
+ while (argv[mb_argc])
+ {
+ wxWX2MBbuf mb_arg = wxConvertWX2MB(argv[mb_argc]);
mb_argv[mb_argc] = strdup(mb_arg);
mb_argc++;
}
mb_argv[mb_argc] = (char *) NULL;
-#else
+
+ // this macro will free memory we used above
+ #define ARGS_CLEANUP \
+ for ( mb_argc = 0; mb_argb[mb_argc]; mb_argc++ ) \
+ free(mb_argv[mb_argc])
+#else // ANSI
+ // no need for cleanup
+ #define ARGS_CLEANUP
+
wxChar **mb_argv = argv;
-#endif
+#endif // Unicode/ANSI
+#if wxUSE_GUI
// create pipes
+ int end_proc_detect[2];
if (pipe(end_proc_detect) == -1)
{
wxLogSysError( _("Pipe creation failed") );
-#if wxUSE_UNICODE
- mb_argc = 0;
- while (mb_argv[mb_argc])
- free(mb_argv[mb_argc++]);
-#endif
+
+ ARGS_CLEANUP;
+
return 0;
}
+#endif // wxUSE_GUI
// fork the process
#if HAVE_VFORK
if (pid == -1)
{
wxLogSysError( _("Fork failed") );
-#if wxUSE_UNICODE
- mb_argc = 0;
- while (mb_argv[mb_argc])
- free(mb_argv[mb_argc++]);
-#endif
+
+ ARGS_CLEANUP;
+
return 0;
}
else if (pid == 0)
{
+#if wxUSE_GUI
// we're in child
close(end_proc_detect[0]); // close reading side
+#endif // wxUSE_GUI
// These three lines close the open file descriptors to to avoid any
// input/output which might block the process or irritate the user. If
// leave stderr opened, it won't do any hurm
for ( int fd = 0; fd < FD_SETSIZE; fd++ )
{
- if ( fd != end_proc_detect[1] && fd != STDERR_FILENO )
+#if wxUSE_GUI
+ if ( fd == end_proc_detect[1] )
+ continue;
+#endif // wxUSE_GUI
+
+ if ( fd != STDERR_FILENO )
close(fd);
}
}
}
else
{
+#if wxUSE_GUI
// we're in parent
close(end_proc_detect[1]); // close writing side
wxEndProcessData *data = new wxEndProcessData;
data->tag = wxAddProcessCallback(data, end_proc_detect[0]);
-#if wxUSE_UNICODE
- mb_argc = 0;
- while (mb_argv[mb_argc])
- free(mb_argv[mb_argc++]);
-#endif
+ ARGS_CLEANUP;
if ( sync )
{
- wxASSERT_MSG( !process, _T("wxProcess param ignored for sync exec") );
+ wxASSERT_MSG( !process, T("wxProcess param ignored for sync exec") );
data->process = NULL;
// sync execution: indicate it by negating the pid
return pid;
}
+#else // !wxUSE_GUI
+ wxASSERT_MSG( sync, T("async execution not supported yet") );
+
+ int exitcode = 0;
+ if ( waitpid(pid, &exitcode, 0) == -1 || !WIFEXITED(exitcode) )
+ {
+ wxLogSysError(_("Waiting for subprocess termination failed"));
+ }
+
+ return exitcode;
+#endif // wxUSE_GUI
}
+
+ #undef ARGS_CLEANUP
}
// ----------------------------------------------------------------------------
{
*home = wxGetUserHome( wxString() );
if ( home->IsEmpty() )
- *home = _T("/");
+ *home = T("/");
return home->c_str();
}
#if wxUSE_UNICODE
const wxMB2WXbuf wxGetUserHome( const wxString &user )
-#else // just for binary compatibility
+#else // just for binary compatibility -- there is no 'const' here
char *wxGetUserHome( const wxString &user )
#endif
{
if ( !user )
{
- register wxChar *ptr;
+ wxChar *ptr;
- if ((ptr = wxGetenv(_T("HOME"))) != NULL)
+ if ((ptr = wxGetenv(T("HOME"))) != NULL)
{
return ptr;
}
- if ((ptr = wxGetenv(_T("USER"))) != NULL || (ptr = wxGetenv(_T("LOGNAME"))) != NULL)
+ if ((ptr = wxGetenv(T("USER"))) != NULL || (ptr = wxGetenv(T("LOGNAME"))) != NULL)
{
- who = getpwnam(wxConvCurrent->cWX2MB(ptr));
+ who = getpwnam(wxConvertWX2MB(ptr));
}
// We now make sure the the user exists!
who = getpwnam (user.mb_str());
}
-#if wxUSE_UNICODE
- return who ? wxConvCurrent->cMB2WX(who->pw_dir) : (wxMB2WXbuf)((wxChar*)NULL);
-#else
- return who ? who->pw_dir : ((char*)NULL);
-#endif
+ return wxConvertMB2WX(who ? who->pw_dir : NULL);
}
// ----------------------------------------------------------------------------
// private use only)
static bool wxGetHostNameInternal(wxChar *buf, int sz)
{
- wxCHECK_MSG( buf, FALSE, _T("NULL pointer in wxGetHostNameInternal") );
+ wxCHECK_MSG( buf, FALSE, T("NULL pointer in wxGetHostNameInternal") );
- *buf = _T('\0');
+ *buf = T('\0');
// we're using uname() which is POSIX instead of less standard sysinfo()
#if defined(HAVE_UNAME)
bool ok = uname(&uts) != -1;
if ( ok )
{
- wxStrncpy(buf, wxConvCurrent->cMB2WX(uts.nodename), sz - 1);
- buf[sz] = _T('\0');
+ wxStrncpy(buf, wxConvertMB2WX(uts.nodename), sz - 1);
+ buf[sz] = T('\0');
}
#elif defined(HAVE_GETHOSTNAME)
bool ok = gethostname(buf, sz) != -1;
#else // no uname, no gethostname
- wxFAIL_MSG(_T("don't know host name for this machine"));
+ wxFAIL_MSG(T("don't know host name for this machine"));
bool ok = FALSE;
#endif // uname/gethostname
{
// BSD systems return the FQDN, we only want the hostname, so extract
// it (we consider that dots are domain separators)
- wxChar *dot = wxStrchr(buf, _T('.'));
+ wxChar *dot = wxStrchr(buf, T('.'));
if ( dot )
{
// nuke it
- *dot = _T('\0');
+ *dot = T('\0');
}
}
if ( ok )
{
- if ( !wxStrchr(buf, _T('.')) )
+ if ( !wxStrchr(buf, T('.')) )
{
- struct hostent *host = gethostbyname(wxConvCurrent->cWX2MB(buf));
+ struct hostent *host = gethostbyname(wxConvertWX2MB(buf));
if ( !host )
{
wxLogSysError(_("Cannot get the official hostname"));
else
{
// the canonical name
- wxStrncpy(buf, wxConvCurrent->cMB2WX(host->h_name), sz);
+ wxStrncpy(buf, wxConvertMB2WX(host->h_name), sz);
}
}
//else: it's already a FQDN (BSD behaves this way)
{
struct passwd *who;
- *buf = _T('\0');
+ *buf = T('\0');
if ((who = getpwuid(getuid ())) != NULL)
{
- wxStrncpy (buf, wxConvCurrent->cMB2WX(who->pw_name), sz - 1);
+ wxStrncpy (buf, wxConvertMB2WX(who->pw_name), sz - 1);
return TRUE;
}
struct passwd *who;
char *comma;
- *buf = _T('\0');
+ *buf = T('\0');
if ((who = getpwuid (getuid ())) != NULL) {
comma = strchr(who->pw_gecos, ',');
if (comma)
*comma = '\0'; // cut off non-name comment fields
- wxStrncpy (buf, wxConvCurrent->cMB2WX(who->pw_gecos), sz - 1);
+ wxStrncpy (buf, wxConvertMB2WX(who->pw_gecos), sz - 1);
return TRUE;
}
return FALSE;
}
+#if wxUSE_GUI
+
// ----------------------------------------------------------------------------
// error and debug output routines (deprecated, use wxLog)
// ----------------------------------------------------------------------------
void wxError( const wxString &msg, const wxString &title )
{
wxFprintf( stderr, _("Error ") );
- if (!title.IsNull()) wxFprintf( stderr, _T("%s "), WXSTRINGCAST(title) );
- if (!msg.IsNull()) wxFprintf( stderr, _T(": %s"), WXSTRINGCAST(msg) );
- wxFprintf( stderr, _T(".\n") );
+ if (!title.IsNull()) wxFprintf( stderr, T("%s "), WXSTRINGCAST(title) );
+ if (!msg.IsNull()) wxFprintf( stderr, T(": %s"), WXSTRINGCAST(msg) );
+ wxFprintf( stderr, T(".\n") );
}
void wxFatalError( const wxString &msg, const wxString &title )
{
wxFprintf( stderr, _("Error ") );
- if (!title.IsNull()) wxFprintf( stderr, _T("%s "), WXSTRINGCAST(title) );
- if (!msg.IsNull()) wxFprintf( stderr, _T(": %s"), WXSTRINGCAST(msg) );
- wxFprintf( stderr, _T(".\n") );
+ if (!title.IsNull()) wxFprintf( stderr, T("%s "), WXSTRINGCAST(title) );
+ if (!msg.IsNull()) wxFprintf( stderr, T(": %s"), WXSTRINGCAST(msg) );
+ wxFprintf( stderr, T(".\n") );
exit(3); // the same exit code as for abort()
}
static inline wxNativeFont wxLoadFont(const wxString& fontSpec)
{
- return gdk_font_load( wxConvCurrent->cWX2MB(fontSpec) );
+ return gdk_font_load( wxConvertWX2MB(fontSpec) );
}
static inline void wxFreeFont(wxNativeFont font)
wxString xfamily;
switch (family)
{
- case wxDECORATIVE: xfamily = _T("lucida"); break;
- case wxROMAN: xfamily = _T("times"); break;
- case wxMODERN: xfamily = _T("courier"); break;
- case wxSWISS: xfamily = _T("helvetica"); break;
- case wxTELETYPE: xfamily = _T("lucidatypewriter"); break;
- case wxSCRIPT: xfamily = _T("utopia"); break;
- default: xfamily = _T("*");
+ case wxDECORATIVE: xfamily = T("lucida"); break;
+ case wxROMAN: xfamily = T("times"); break;
+ case wxMODERN: xfamily = T("courier"); break;
+ case wxSWISS: xfamily = T("helvetica"); break;
+ case wxTELETYPE: xfamily = T("lucidatypewriter"); break;
+ case wxSCRIPT: xfamily = T("utopia"); break;
+ default: xfamily = T("*");
}
wxString fontSpec;
if (!facename.IsEmpty())
{
- fontSpec.Printf(_T("-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*"),
+ fontSpec.Printf(T("-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*"),
facename.c_str());
if ( wxTestFontSpec(fontSpec) )
wxString xstyle;
switch (style)
{
- case wxITALIC: xstyle = _T("i"); break;
- case wxSLANT: xstyle = _T("o"); break;
- case wxNORMAL: xstyle = _T("r"); break;
- default: xstyle = _T("*"); break;
+ case wxITALIC: xstyle = T("i"); break;
+ case wxSLANT: xstyle = T("o"); break;
+ case wxNORMAL: xstyle = T("r"); break;
+ default: xstyle = T("*"); break;
}
wxString xweight;
switch (weight)
{
- case wxBOLD: xweight = _T("bold"); break;
+ case wxBOLD: xweight = T("bold"); break;
case wxLIGHT:
- case wxNORMAL: xweight = _T("medium"); break;
- default: xweight = _T("*"); break;
+ case wxNORMAL: xweight = T("medium"); break;
+ default: xweight = T("*"); break;
}
wxString xregistry, xencoding;
case wxFONTENCODING_ISO8859_15:
{
int cp = encoding - wxFONTENCODING_ISO8859_1 + 1;
- xregistry = _T("iso8859");
- xencoding.Printf(_T("%d"), cp);
+ xregistry = T("iso8859");
+ xencoding.Printf(T("%d"), cp);
}
break;
case wxFONTENCODING_KOI8:
- xregistry = _T("koi8");
- if ( wxTestFontSpec(_T("-*-*-*-*-*-*-*-*-*-*-*-*-koi8-1")) )
+ xregistry = T("koi8");
+ if ( wxTestFontSpec(T("-*-*-*-*-*-*-*-*-*-*-*-*-koi8-1")) )
{
- xencoding = _T("1");
+ xencoding = T("1");
// test passed, no need to do it once more
test = FALSE;
}
else
{
- xencoding = _T("*");
+ xencoding = T("*");
}
break;
case wxFONTENCODING_CP1252:
{
int cp = encoding - wxFONTENCODING_CP1250 + 1250;
- fontSpec.Printf(_T("-*-*-*-*-*-*-*-*-*-*-*-*-microsoft-cp%d"),
+ fontSpec.Printf(T("-*-*-*-*-*-*-*-*-*-*-*-*-microsoft-cp%d"),
cp);
if ( wxTestFontSpec(fontSpec) )
{
- xregistry = _T("microsoft");
- xencoding.Printf(_T("cp%d"), cp);
+ xregistry = T("microsoft");
+ xencoding.Printf(T("cp%d"), cp);
// test passed, no need to do it once more
test = FALSE;
else
{
// fall back to LatinX
- xregistry = _T("iso8859");
- xencoding.Printf(_T("%d"), cp - 1249);
+ xregistry = T("iso8859");
+ xencoding.Printf(T("%d"), cp - 1249);
}
}
break;
default:
test = FALSE;
xregistry =
- xencoding = _T("*");
+ xencoding = T("*");
}
if ( test )
{
- fontSpec.Printf(_T("-*-*-*-*-*-*-*-*-*-*-*-*-%s-%s"),
+ fontSpec.Printf(T("-*-*-*-*-*-*-*-*-*-*-*-*-%s-%s"),
xregistry.c_str(), xencoding.c_str());
if ( !wxTestFontSpec(fontSpec) )
{
// this encoding isn't available - what to do?
xregistry =
- xencoding = _T("*");
+ xencoding = T("*");
}
}
// construct the X font spec from our data
- fontSpec.Printf(_T("-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-%s-%s"),
+ fontSpec.Printf(T("-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-%s-%s"),
xfamily.c_str(), xweight.c_str(), xstyle.c_str(),
pointSize, xregistry.c_str(), xencoding.c_str());
return font;
}
+#endif // wxUSE_GUI