Compare commits
90 Commits
v2.3.2
...
AFTER_NEW_
Author | SHA1 | Date | |
---|---|---|---|
|
01ae0b038b | ||
|
0b9ab0bd82 | ||
|
955b11918b | ||
|
0cb50c83aa | ||
|
c848b2f955 | ||
|
1e3a888e72 | ||
|
5b96a71a56 | ||
|
3f2eabd59d | ||
|
48f72114ba | ||
|
b59da6c285 | ||
|
33754c4d83 | ||
|
5ece068d9f | ||
|
df22f86063 | ||
|
32334453e7 | ||
|
5c8835b94c | ||
|
17154fc8aa | ||
|
e044f6001e | ||
|
501d97d4fe | ||
|
13b1472fdd | ||
|
dfc40ef343 | ||
|
639692727b | ||
|
c26d72f10d | ||
|
3c299c3ab6 | ||
|
4c53d9ece2 | ||
|
8f684821f6 | ||
|
be03c0ec26 | ||
|
a250392c48 | ||
|
3355efa93c | ||
|
00500f403c | ||
|
d21d2e5adf | ||
|
754c44ae38 | ||
|
9d7de3c2b8 | ||
|
c640e407d5 | ||
|
3f562374f1 | ||
|
5fc67e5cf4 | ||
|
7613582bcc | ||
|
33984936de | ||
|
c6f4913a76 | ||
|
db3272a001 | ||
|
c4d596ea01 | ||
|
eb5e4d9ac1 | ||
|
e168b6acfd | ||
|
df16a53ef9 | ||
|
783fab59e5 | ||
|
c4e1b7f244 | ||
|
353f41cb3b | ||
|
c04857dd6a | ||
|
c4bcd8fcdd | ||
|
65d48d095f | ||
|
c1725ec7f3 | ||
|
d3b4d71020 | ||
|
147043343e | ||
|
865c589e50 | ||
|
b916f80933 | ||
|
713a0efc61 | ||
|
9283436576 | ||
|
f9bc168497 | ||
|
d00407b2c6 | ||
|
2e351786c5 | ||
|
b0c4280587 | ||
|
c16d276354 | ||
|
7070f55b2c | ||
|
17d5bdf9e9 | ||
|
4b614012da | ||
|
4ec2df6cbc | ||
|
3f345b477e | ||
|
e7ca6139d0 | ||
|
ffd10d5da7 | ||
|
8ff1234234 | ||
|
abb855613b | ||
|
7332adf035 | ||
|
dccaf28056 | ||
|
9210a48a33 | ||
|
dbdcff5102 | ||
|
f05605ff4d | ||
|
24eb81cbcf | ||
|
2ba4130573 | ||
|
4a0f7f3f17 | ||
|
01ec8f969d | ||
|
e856571123 | ||
|
c5e8ed2391 | ||
|
0a1d59000c | ||
|
9a3ba92945 | ||
|
71f1334b40 | ||
|
f20ad12c58 | ||
|
771a855fb9 | ||
|
cb3b65d4e2 | ||
|
6d7f865fb0 | ||
|
1a2c3cae6d | ||
|
048bd5039e |
@@ -1311,6 +1311,7 @@ MANUAL_DIST:
|
||||
PYTHON_DIST:
|
||||
mkdir $(DISTDIR)/wxPython
|
||||
mkdir $(DISTDIR)/wxPython/contrib
|
||||
mkdir $(DISTDIR)/wxPython/contrib/dllwidget
|
||||
mkdir $(DISTDIR)/wxPython/contrib/gizmos
|
||||
mkdir $(DISTDIR)/wxPython/contrib/glcanvas
|
||||
mkdir $(DISTDIR)/wxPython/contrib/glcanvas/gtk
|
||||
@@ -1325,6 +1326,7 @@ PYTHON_DIST:
|
||||
mkdir $(DISTDIR)/wxPython/src/gtk
|
||||
mkdir $(DISTDIR)/wxPython/wxPython
|
||||
mkdir $(DISTDIR)/wxPython/wxPython/lib
|
||||
mkdir $(DISTDIR)/wxPython/wxPython/lib/PyCrust
|
||||
mkdir $(DISTDIR)/wxPython/wxPython/lib/editor
|
||||
mkdir $(DISTDIR)/wxPython/wxPython/lib/mixins
|
||||
|
||||
@@ -1332,6 +1334,7 @@ PYTHON_DIST:
|
||||
cp $(WXDIR)/wxPython/*.py $(DISTDIR)/wxPython
|
||||
cp $(WXDIR)/wxPython/setup.cfg $(DISTDIR)/wxPython
|
||||
cp $(WXDIR)/wxPython/MANIFEST.in $(DISTDIR)/wxPython
|
||||
cp $(WXDIR)/wxPython/contrib/dllwidget/*.{py,cpp,h,i} $(DISTDIR)/wxPython/contrib/dllwidget
|
||||
cp $(WXDIR)/wxPython/contrib/gizmos/*.{py,cpp,i} $(DISTDIR)/wxPython/contrib/gizmos
|
||||
-cp $(WXDIR)/wxPython/contrib/glcanvas/* $(DISTDIR)/wxPython/contrib/glcanvas
|
||||
cp $(WXDIR)/wxPython/contrib/glcanvas/gtk/glcanvas.* $(DISTDIR)/wxPython/contrib/glcanvas/gtk
|
||||
@@ -1346,6 +1349,7 @@ PYTHON_DIST:
|
||||
cp $(WXDIR)/wxPython/src/gtk/*.py $(DISTDIR)/wxPython/src/gtk
|
||||
cp $(WXDIR)/wxPython/src/gtk/*.cpp $(DISTDIR)/wxPython/src/gtk
|
||||
cp $(WXDIR)/wxPython/wxPython/lib/*.py $(DISTDIR)/wxPython/wxPython/lib
|
||||
cp $(WXDIR)/wxPython/wxPython/lib/PyCrust/*.py $(DISTDIR)/wxPython/wxPython/lib/PyCrust
|
||||
cp $(WXDIR)/wxPython/wxPython/lib/editor/*.py $(DISTDIR)/wxPython/wxPython/lib/editor
|
||||
cp $(WXDIR)/wxPython/wxPython/lib/mixins/*.py $(DISTDIR)/wxPython/wxPython/lib/mixins
|
||||
|
||||
|
180
aclocal.m4
vendored
180
aclocal.m4
vendored
@@ -10,14 +10,29 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
# Configure paths for GTK+
|
||||
# Owen Taylor 97-11-3
|
||||
|
||||
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
|
||||
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS. Uses variables
|
||||
dnl gtk_config_prefix and/or gtk_config_exec_prefix if defined.
|
||||
dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
|
||||
dnl
|
||||
AC_DEFUN(AM_PATH_GTK,
|
||||
[
|
||||
[dnl
|
||||
dnl Get the cflags and libraries from the gtk-config script
|
||||
dnl
|
||||
AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
|
||||
gtk_config_prefix="$withval", gtk_config_prefix="")
|
||||
AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
|
||||
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
|
||||
AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
|
||||
, enable_gtktest=yes)
|
||||
|
||||
for module in . $4
|
||||
do
|
||||
case "$module" in
|
||||
gthread)
|
||||
gtk_config_args="$gtk_config_args gthread"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test x$gtk_config_exec_prefix != x ; then
|
||||
gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
|
||||
if test x${GTK_CONFIG+set} != xset ; then
|
||||
@@ -35,63 +50,156 @@ AC_DEFUN(AM_PATH_GTK,
|
||||
min_gtk_version=ifelse([$1], ,0.99.7,$1)
|
||||
AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
|
||||
no_gtk=""
|
||||
if test "$GTK_CONFIG" != "no" ; then
|
||||
GTK_CFLAGS=`$GTK_CONFIG --cflags`
|
||||
GTK_LIBS=`$GTK_CONFIG --libs gthread`
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$LIBS $GTK_LIBS"
|
||||
if test "$GTK_CONFIG" = "no" ; then
|
||||
no_gtk=yes
|
||||
else
|
||||
GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
|
||||
GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
|
||||
gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
||||
gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
||||
gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
|
||||
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
||||
if test "x$enable_gtktest" = "xyes" ; then
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LIBS="$LIBS"
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$GTK_LIBS $LIBS"
|
||||
dnl
|
||||
dnl Now check if the installed GTK is sufficiently new. (Also sanity
|
||||
dnl checks the results of gtk-config to some extent)
|
||||
dnl checks the results of gtk-config to some extent
|
||||
dnl
|
||||
AC_TRY_RUN([
|
||||
rm -f conf.gtktest
|
||||
AC_TRY_RUN([
|
||||
#include <gtk/gtk.h>
|
||||
#include <gtk/gtkfeatures.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int
|
||||
int
|
||||
main ()
|
||||
{
|
||||
int major, minor, micro;
|
||||
char *tmp_version;
|
||||
|
||||
if (sscanf("$min_gtk_version", "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
system ("touch conf.gtktest");
|
||||
|
||||
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
||||
tmp_version = g_strdup("$min_gtk_version");
|
||||
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
||||
printf("%s, bad version string\n", "$min_gtk_version");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if ((GTK_MAJOR_VERSION != gtk_major_version) ||
|
||||
(GTK_MINOR_VERSION != gtk_minor_version) ||
|
||||
(GTK_MICRO_VERSION != gtk_micro_version)) {
|
||||
printf("Headers vs. library version mismatch!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
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)));
|
||||
if ((gtk_major_version != $gtk_config_major_version) ||
|
||||
(gtk_minor_version != $gtk_config_minor_version) ||
|
||||
(gtk_micro_version != $gtk_config_micro_version))
|
||||
{
|
||||
printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
|
||||
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf ("*** was found! If gtk-config was correct, then it is best\n");
|
||||
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
|
||||
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
||||
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
||||
printf("*** required on your system.\n");
|
||||
printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
|
||||
printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
|
||||
printf("*** before re-running configure\n");
|
||||
}
|
||||
#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
|
||||
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
|
||||
(gtk_minor_version != GTK_MINOR_VERSION) ||
|
||||
(gtk_micro_version != GTK_MICRO_VERSION))
|
||||
{
|
||||
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
|
||||
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
|
||||
printf("*** library (version %d.%d.%d)\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
}
|
||||
#endif /* defined (GTK_MAJOR_VERSION) ... */
|
||||
else
|
||||
{
|
||||
if ((gtk_major_version > major) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
|
||||
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
|
||||
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
||||
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
|
||||
major, minor, micro);
|
||||
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
|
||||
printf("***\n");
|
||||
printf("*** If you have already installed a sufficiently new version, this error\n");
|
||||
printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
|
||||
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
||||
printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
|
||||
printf("*** correct copy of gtk-config. (In this case, you will have to\n");
|
||||
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
||||
printf("*** so that the correct libraries are found at run-time))\n");
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
else
|
||||
no_gtk=yes
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
if test "x$no_gtk" = x ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ifelse([$2], , :, [$2])
|
||||
ifelse([$2], , :, [$2])
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
if test "$GTK_CONFIG" = "no" ; then
|
||||
echo "*** The gtk-config script installed by GTK could not be found"
|
||||
echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
|
||||
echo "*** your path, or set the GTK_CONFIG environment variable to the"
|
||||
echo "*** full path to gtk-config."
|
||||
else
|
||||
if test -f conf.gtktest ; then
|
||||
:
|
||||
else
|
||||
echo "*** Could not run GTK test program, checking why..."
|
||||
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
||||
LIBS="$LIBS $GTK_LIBS"
|
||||
AC_TRY_LINK([
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
|
||||
[ echo "*** The test program compiled, but did not run. This usually means"
|
||||
echo "*** that the run-time linker is not finding GTK or finding the wrong"
|
||||
echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
|
||||
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
||||
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
||||
echo "*** is required on your system"
|
||||
echo "***"
|
||||
echo "*** If you have an old version installed, it is best to remove it, although"
|
||||
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
|
||||
echo "***"
|
||||
echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
|
||||
echo "*** came with the system with the command"
|
||||
echo "***"
|
||||
echo "*** rpm --erase --nodeps gtk gtk-devel" ],
|
||||
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
||||
echo "*** exact error that occured. This usually means GTK was incorrectly installed"
|
||||
echo "*** or that you have moved GTK since it was installed. In the latter case, you"
|
||||
echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LIBS="$ac_save_LIBS"
|
||||
fi
|
||||
fi
|
||||
GTK_CFLAGS=""
|
||||
GTK_LIBS=""
|
||||
ifelse([$3], , :, [$3])
|
||||
fi
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
rm -f conf.gtktest
|
||||
])
|
||||
|
||||
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
||||
|
108
configure.in
108
configure.in
@@ -384,6 +384,7 @@ dnl ------------------------------------------------------------------------
|
||||
dnl assume Unix
|
||||
USE_UNIX=1
|
||||
USE_WIN32=0
|
||||
USE_DOS=0
|
||||
USE_BEOS=0
|
||||
USE_MAC=0
|
||||
|
||||
@@ -412,6 +413,9 @@ dnl _REENTRANT" and it's easier to just define this symbol for these platforms
|
||||
dnl than checking it during run-time
|
||||
NEEDS_D_REENTRANT_FOR_R_FUNCS=0
|
||||
|
||||
dnl the additional define needed for MT programs
|
||||
CPP_MT_FLAG=-D_REENTRANT
|
||||
|
||||
dnl the list of all available toolkits
|
||||
dnl
|
||||
dnl update NUM_TOOLKITS calculation below when adding a new toolkit here!
|
||||
@@ -492,6 +496,7 @@ case "${host}" in
|
||||
*-*-freebsd*)
|
||||
USE_BSD=1
|
||||
USE_FREEBSD=1
|
||||
CPP_MT_FLAG=-D_THREAD_SAFE
|
||||
AC_DEFINE(__FREEBSD__)
|
||||
AC_DEFINE(__BSD__)
|
||||
DEFAULT_DEFAULT_wxUSE_GTK=1
|
||||
@@ -557,6 +562,15 @@ case "${host}" in
|
||||
DEFAULT_DEFAULT_wxUSE_MSW=1
|
||||
;;
|
||||
|
||||
*-pc-msdosdjgpp )
|
||||
USE_UNIX=0
|
||||
USE_DOS=1
|
||||
AC_DEFINE(__DOS__)
|
||||
PROGRAM_EXT=".exe"
|
||||
DEFAULT_DEFAULT_wxUSE_MGL=1
|
||||
DEFAULT_DEFAULT_wxUSE_SHARED=0
|
||||
;;
|
||||
|
||||
*-pc-os2_emx | *-pc-os2-emx )
|
||||
AC_DEFINE(__EMX__)
|
||||
PROGRAM_EXT=".exe"
|
||||
@@ -567,6 +581,7 @@ case "${host}" in
|
||||
dnl PowerPC Darwin based distributions (including Mac OS X)
|
||||
USE_BSD=1
|
||||
USE_DARWIN=1
|
||||
CPP_MT_FLAG=
|
||||
SO_SUFFIX=dylib
|
||||
AC_DEFINE(__BSD__)
|
||||
AC_DEFINE(__DARWIN__)
|
||||
@@ -684,9 +699,9 @@ if test $DEBUG_CONFIGURE = 1; then
|
||||
DEFAULT_wxUSE_STREAMS=no
|
||||
DEFAULT_wxUSE_SOCKETS=no
|
||||
DEFAULT_wxUSE_DIALUP_MANAGER=no
|
||||
DEFAULT_wxUSE_SERIAL=no
|
||||
DEFAULT_wxUSE_JOYSTICK=no
|
||||
DEFAULT_wxUSE_DYNLIB_CLASS=no
|
||||
DEFAULT_wxUSE_DYNAMIC_LOADER=no
|
||||
DEFAULT_wxUSE_LONGLONG=no
|
||||
DEFAULT_wxUSE_GEOMETRY=no
|
||||
|
||||
@@ -848,9 +863,9 @@ else
|
||||
DEFAULT_wxUSE_STREAMS=yes
|
||||
DEFAULT_wxUSE_SOCKETS=yes
|
||||
DEFAULT_wxUSE_DIALUP_MANAGER=yes
|
||||
DEFAULT_wxUSE_SERIAL=yes
|
||||
DEFAULT_wxUSE_JOYSTICK=yes
|
||||
DEFAULT_wxUSE_DYNLIB_CLASS=yes
|
||||
DEFAULT_wxUSE_DYNLIB_CLASS=no
|
||||
DEFAULT_wxUSE_DYNAMIC_LOADER=yes
|
||||
DEFAULT_wxUSE_LONGLONG=yes
|
||||
DEFAULT_wxUSE_GEOMETRY=yes
|
||||
|
||||
@@ -1068,6 +1083,7 @@ WX_ARG_ENABLE(timer, [ --enable-timer use wxTimer class], wxUS
|
||||
WX_ARG_ENABLE(wave, [ --enable-wave use wxWave class], wxUSE_WAVE)
|
||||
WX_ARG_ENABLE(fraction, [ --enable-fraction use wxFraction class], wxUSE_FRACTION)
|
||||
WX_ARG_ENABLE(dynlib, [ --enable-dynlib use wxLibrary class for DLL loading], wxUSE_DYNLIB_CLASS)
|
||||
WX_ARG_ENABLE(dynamicloader, [ --enable-dynamicloader use (new) wxDynamicLibrary class], wxUSE_DYNAMIC_LOADER)
|
||||
WX_ARG_ENABLE(longlong, [ --enable-longlong use wxLongLong class], wxUSE_LONGLONG)
|
||||
WX_ARG_ENABLE(geometry, [ --enable-geometry use geometry class], wxUSE_GEOMETRY)
|
||||
WX_ARG_ENABLE(log, [ --enable-log use logging system], wxUSE_LOG)
|
||||
@@ -1096,7 +1112,6 @@ dnl "big" options (i.e. those which change a lot of things throughout the librar
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
WX_ARG_ENABLE(threads, [ --enable-threads use threads], wxUSE_THREADS)
|
||||
WX_ARG_ENABLE(serial, [ --enable-serial use class serialization], wxUSE_SERIAL)
|
||||
|
||||
if test "$wxUSE_GUI" = "yes"; then
|
||||
|
||||
@@ -1414,7 +1429,7 @@ AC_CACHE_SAVE
|
||||
dnl cross-compiling support: we're cross compiling if the build system is
|
||||
dnl different from the target one (assume host and target be always the same)
|
||||
if test "$build" != "$host" ; then
|
||||
if test "$USE_WIN32" = 1 ; then
|
||||
if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 ; then
|
||||
CC=$host_alias-gcc
|
||||
CXX=$host_alias-c++
|
||||
AR=$host_alias-ar
|
||||
@@ -1959,17 +1974,24 @@ if test "$wxUSE_GUI" = "yes"; then
|
||||
gtk_version_cached=0
|
||||
AC_MSG_RESULT()
|
||||
|
||||
dnl we must link against lgthread unless the user
|
||||
dnl used --disable-threads
|
||||
GTK_MODULES=
|
||||
if test "$wxUSE_THREADS" = "yes"; then
|
||||
GTK_MODULES=gthread
|
||||
fi
|
||||
|
||||
wx_cv_lib_gtk=
|
||||
if test "x$wxUSE_GTK2" = "xyes"; then
|
||||
AM_PATH_GTK_2_0(1.3.1, wx_cv_lib_gtk=2.0, gthread)
|
||||
AM_PATH_GTK_2_0(1.3.1, wx_cv_lib_gtk=2.0, , $GTK_MODULES)
|
||||
fi
|
||||
|
||||
if test -z "$wx_cv_lib_gtk"; then
|
||||
AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7)
|
||||
AM_PATH_GTK(1.2.7, wx_cv_lib_gtk=1.2.7, , $GTK_MODULES)
|
||||
fi
|
||||
|
||||
if test -z "$wx_cv_lib_gtk"; then
|
||||
AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3)
|
||||
AM_PATH_GTK(1.2.3, wx_cv_lib_gtk=1.2.3, , $GTK_MODULES)
|
||||
fi
|
||||
|
||||
if test -z "$wx_cv_lib_gtk"; then
|
||||
@@ -2019,8 +2041,6 @@ equivalent variable and GTK+ is version 1.2.3 or above.
|
||||
fi
|
||||
|
||||
if test "$wxUSE_MGL" = 1; then
|
||||
dnl FIXME_MGL - test for MGL's variants for freebsd etc.
|
||||
|
||||
AC_MSG_CHECKING(for SciTech MGL library)
|
||||
if test "x$MGL_ROOT" = x ; then
|
||||
AC_MSG_RESULT(not found)
|
||||
@@ -2029,7 +2049,19 @@ equivalent variable and GTK+ is version 1.2.3 or above.
|
||||
AC_MSG_RESULT($MGL_ROOT)
|
||||
fi
|
||||
|
||||
mgl_os=linux/gcc/glibc
|
||||
dnl Find MGL library that we want
|
||||
dnl FIXME_MGL - test for MGL variants for freebsd etc.
|
||||
case "${host}" in
|
||||
*-*-linux* )
|
||||
mgl_os=linux/gcc/glibc
|
||||
;;
|
||||
*-pc-msdosdjgpp )
|
||||
mgl_os=dos32/dj2
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR(This system type ${host} is not yet supported by wxMGL.)
|
||||
esac
|
||||
|
||||
mgl_lib_type=""
|
||||
|
||||
if test "$wxUSE_DEBUG_FLAG" = yes ; then
|
||||
@@ -2242,7 +2274,7 @@ equivalent variable and GTK+ is version 1.2.3 or above.
|
||||
|
||||
ALL_OBJECTS="${ALL_OBJECTS} \$(COMMONOBJS) \$(GENERICOBJS)"
|
||||
|
||||
if test "$TOOLKIT" != "MSW"; then
|
||||
if test "$TOOLKIT" != "MSW" -a "$USE_DOS" != 1; then
|
||||
ALL_OBJECTS="${ALL_OBJECTS} \$(UNIXOBJS)"
|
||||
fi
|
||||
|
||||
@@ -2889,20 +2921,21 @@ AC_FUNC_VPRINTF
|
||||
|
||||
dnl check for vsscanf() and vsnprintf() - on some platforms (Linux, glibc
|
||||
dnl 2.1.1 for the first one, HP-UX for the second) it's available in the
|
||||
dnl library but the prototype is missing, so we can't use AC_CHECK_FUNCS here,
|
||||
dnl do it manually
|
||||
dnl library but the prototype is missing, so we can't use AC_CHECK_FUNCS() here,
|
||||
dnl do it manually. We can't use AC_TRY_COMPILE(), either, because it doesn't
|
||||
dnl check if the symbol is available at linking time
|
||||
|
||||
dnl we use AC_TRY_COMPILE() here instead of AC_TRY_RUN() to make the checks
|
||||
dnl work for cross-compilation, but AC_TRY_COMPILE() normally only compiles
|
||||
dnl we use AC_TRY_LINK() here instead of AC_TRY_RUN() to make the checks
|
||||
dnl work for cross-compilation, but AC_TRY_LINK() normally only compiles
|
||||
dnl one function while we need at least 2 - hence the ugly hack below. To
|
||||
dnl understand why it works, remember that AC_TRY_COMPILE() just prepends
|
||||
dnl understand why it works, remember that AC_TRY_LINK() just prepends
|
||||
dnl "int main() {" in the beginning of the code and "; return 0; }" at the
|
||||
dnl end...
|
||||
|
||||
dnl if we fail to find vsnprintf, also try for _vsnprintf as that is what
|
||||
dnl we'll find under MSW if it exists.
|
||||
|
||||
dnl final note: AC_TRY_COMPILE will only be executed if there is nothing in
|
||||
dnl final note: AC_TRY_LINK will only be executed if there is nothing in
|
||||
dnl the cache so we have to do AC_DEFINE(HAVE_VSNPRINTF) below and not inside
|
||||
dnl it or the symbol wouldn't be defined for the 2nd and subsequent configure
|
||||
dnl runs
|
||||
@@ -2910,7 +2943,7 @@ dnl runs
|
||||
dnl check for vsnprintf() - a safe version of vsprintf()
|
||||
AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
|
||||
[
|
||||
AC_TRY_COMPILE([
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
], [
|
||||
@@ -2931,7 +2964,7 @@ AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
|
||||
], [
|
||||
wx_cv_func_vsnprintf=yes
|
||||
], [
|
||||
AC_TRY_COMPILE([
|
||||
AC_TRY_LINK([
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
], [
|
||||
@@ -2960,7 +2993,7 @@ AC_CACHE_CHECK([for vsnprintf], wx_cv_func_vsnprintf,
|
||||
if test "$wx_cv_func_vsnprintf" = yes; then
|
||||
AC_DEFINE(HAVE_VSNPRINTF)
|
||||
else
|
||||
AC_MSG_WARN(unsafe function sprintf will be used instead of snprintf)
|
||||
AC_MSG_WARN(unsafe function vsprintf will be used instead of vsnprintf)
|
||||
fi
|
||||
|
||||
dnl check for vsscanf()
|
||||
@@ -3434,10 +3467,8 @@ fi
|
||||
if test "$wxUSE_THREADS" = "yes"; then
|
||||
AC_DEFINE(wxUSE_THREADS)
|
||||
|
||||
dnl must define _REENTRANT for multithreaded code except for Darwin/Mac OS X
|
||||
if test "$USE_DARWIN" != 1; then
|
||||
TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS -D_REENTRANT"
|
||||
fi
|
||||
dnl we must define _REENTRANT or something along these lines for MT code
|
||||
TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS $CPP_MT_FLAG"
|
||||
|
||||
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS thread"
|
||||
else
|
||||
@@ -3763,7 +3794,11 @@ if test "$wxUSE_DATETIME" = "yes"; then
|
||||
[
|
||||
wx_cv_var_timezone=__timezone
|
||||
],
|
||||
AC_MSG_ERROR(no timezone variable)
|
||||
[
|
||||
if test "$USE_DOS" = 0 ; then
|
||||
AC_MSG_ERROR(no timezone variable)
|
||||
fi
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@@ -3773,7 +3808,9 @@ if test "$wxUSE_DATETIME" = "yes"; then
|
||||
)
|
||||
|
||||
dnl as we want $wx_cv_var_timezone to be expanded, use AC_DEFINE_UNQUOTED
|
||||
AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
|
||||
if test "x$wx_cv_var_timezone" != x ; then
|
||||
AC_DEFINE_UNQUOTED(WX_TIMEZONE, $wx_cv_var_timezone)
|
||||
fi
|
||||
|
||||
dnl check for localtime (it's POSIX, but the check can do no harm...)
|
||||
AC_CHECK_FUNCS(localtime)
|
||||
@@ -3979,7 +4016,7 @@ if test "$TOOLKIT" != "MSW"; then
|
||||
|
||||
HAVE_DL_FUNCS=0
|
||||
HAVE_SHL_FUNCS=0
|
||||
if test "$wxUSE_DYNLIB_CLASS" = "yes"; then
|
||||
if test "$wxUSE_DYNAMIC_LOADER" = "yes" -o "$wxUSE_DYNLIB_CLASS" = "yes" ; then
|
||||
if test "$USE_DARWIN" = 1; then
|
||||
dnl dlopen/dlerror is implemented in dynlib.cpp for Darwin/Mac OS X
|
||||
HAVE_DL_FUNCS=1
|
||||
@@ -4027,6 +4064,7 @@ if test "$TOOLKIT" != "MSW"; then
|
||||
if test "$HAVE_SHL_FUNCS" = 0; then
|
||||
if test "$USE_UNIX" = 1; then
|
||||
AC_MSG_WARN([Missing dynamic loading support, several features will be disabled])
|
||||
wxUSE_DYNAMIC_LOADER=no
|
||||
wxUSE_DYNLIB_CLASS=no
|
||||
else
|
||||
AC_MSG_WARN([Assuming wxLibrary class works on this platform])
|
||||
@@ -4036,11 +4074,10 @@ if test "$TOOLKIT" != "MSW"; then
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
|
||||
if test "$wxUSE_DYNAMIC_LOADER" = "yes" ; then
|
||||
AC_DEFINE(wxUSE_DYNAMIC_LOADER)
|
||||
elif test "$wxUSE_DYNLIB_CLASS" = "yes" ; then
|
||||
AC_DEFINE(wxUSE_DYNLIB_CLASS)
|
||||
else
|
||||
wxUSE_ODBC=no
|
||||
wxUSE_SERIAL=no
|
||||
fi
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
@@ -4059,13 +4096,6 @@ if test "$wxUSE_wxUSE_EXPERIMENTAL_PRINTF" = "yes"; then
|
||||
AC_DEFINE(wxUSE_EXPERIMENTAL_PRINTF)
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
dnl serialization support
|
||||
dnl ----------------------------------------------------------------
|
||||
|
||||
if test "$wxUSE_SERIAL" = "yes" ; then
|
||||
AC_DEFINE(wxUSE_SERIAL)
|
||||
fi
|
||||
|
||||
dnl ----------------------------------------------------------------
|
||||
dnl iODBC support
|
||||
|
@@ -230,7 +230,7 @@ void wxLEDNumberCtrl::OnPaint(wxPaintEvent &Event)
|
||||
// just skip it
|
||||
break;
|
||||
default :
|
||||
wxFAIL_MSG(_("Unknown digit value"));
|
||||
wxFAIL_MSG(wxT("Unknown digit value"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -344,7 +344,7 @@ void wxLEDNumberCtrl::RecalcInternals(const wxSize &CurrentSize)
|
||||
m_LeftStartPos = (ClientWidth - ValueWidth) / 2;
|
||||
break;
|
||||
default :
|
||||
wxFAIL_MSG(_("Unknown alignent value for wxLEDNumberCtrl."));
|
||||
wxFAIL_MSG(wxT("Unknown alignent value for wxLEDNumberCtrl."));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -494,11 +494,16 @@ int wxXmlResourceHandler::GetStyle(const wxString& param, int defaults)
|
||||
|
||||
wxString wxXmlResourceHandler::GetText(const wxString& param)
|
||||
{
|
||||
wxString str1 = GetParamValue(param);
|
||||
wxString str1;
|
||||
wxString str2;
|
||||
const wxChar *dt;
|
||||
wxChar amp_char;
|
||||
|
||||
if (m_resource->GetUseLocale())
|
||||
str1 = wxGetTranslation(GetParamValue(param));
|
||||
else
|
||||
str1 = GetParamValue(param);
|
||||
|
||||
// VS: First version of XRC resources used $ instead of & (which is illegal in XML),
|
||||
// but later I realized that '_' fits this purpose much better (because
|
||||
// &File means "File with F underlined").
|
||||
@@ -529,11 +534,8 @@ wxString wxXmlResourceHandler::GetText(const wxString& param)
|
||||
}
|
||||
else str2 << *dt;
|
||||
}
|
||||
|
||||
if (m_resource->GetUseLocale())
|
||||
return wxGetTranslation(str2);
|
||||
else
|
||||
return str2;
|
||||
|
||||
return str2;
|
||||
}
|
||||
|
||||
|
||||
|
7
debian/changelog
vendored
7
debian/changelog
vendored
@@ -22,6 +22,13 @@ wxwindows2.3 (2.3.0) unstable; urgency=low
|
||||
|
||||
-- Ron Lee <ron@debian.org> Sat, 27 Jan 2001 01:51:24 -0800
|
||||
|
||||
wxwindows2.2 (2.2.8.5) unstable; urgency=low
|
||||
|
||||
* Add wxSIZE_T_IS defines to setup.h
|
||||
Add automate that to my TODO list.
|
||||
|
||||
-- Ron Lee <ron@debian.org> Tue, 27 Nov 2001 05:55:47 -0800
|
||||
|
||||
wxwindows2.2 (2.2.8.4) unstable; urgency=low
|
||||
|
||||
* Put the (modified) size_t == ulong kludge back into sndwav.cpp
|
||||
|
224
distrib/msw/copybase.bat
Executable file
224
distrib/msw/copybase.bat
Executable file
@@ -0,0 +1,224 @@
|
||||
@echo off
|
||||
|
||||
rem VZ: this is quick and _very_ dirty
|
||||
|
||||
set VER=2.3.2
|
||||
set DEST=s:\upload\wxBase-%VER%
|
||||
|
||||
mkdir %DEST%
|
||||
mkdir %DEST%\include
|
||||
mkdir %DEST%\include\wx
|
||||
mkdir %DEST%\include\wx\msw
|
||||
mkdir %DEST%\include\wx\protocol
|
||||
mkdir %DEST%\include\wx\unix
|
||||
mkdir %DEST%\locale
|
||||
mkdir %DEST%\samples
|
||||
mkdir %DEST%\samples\console
|
||||
mkdir %DEST%\src
|
||||
mkdir %DEST%\src\common
|
||||
mkdir %DEST%\src\msw
|
||||
mkdir %DEST%\src\regex
|
||||
mkdir %DEST%\src\unix
|
||||
mkdir %DEST%\src\zlib
|
||||
|
||||
chdir %WXWIN%
|
||||
|
||||
rem Copy the files to the root directory
|
||||
|
||||
copy /q docs\changes.txt %DEST%\CHANGES.txt
|
||||
copy /q docs\licence.txt %DEST%\LICENCE.txt
|
||||
copy /q docs\install.txt %DEST%\README.txt
|
||||
copy /q docs\symbols.txt %DEST%\SYMBOLS.txt
|
||||
|
||||
rem Copy the project files
|
||||
|
||||
copy /q src\wxBase.dsp %DEST%\src\wxBase.dsp
|
||||
copy /q src\wxBase.dsw %DEST%\src\wxBase.dsw
|
||||
copy /q include\wx\msw\setup.h %DEST%\include\wx\msw\setup.h
|
||||
|
||||
rem Copy the sample
|
||||
|
||||
copy /q samples\console\console.cpp %DEST%\samples\console\console.cpp
|
||||
copy /q samples\console\console.dsp %DEST%\samples\console\console.dsp
|
||||
copy /q samples\console\testdata.fc %DEST%\samples\console\testdata.fc
|
||||
|
||||
rem Copy regex and zlib files
|
||||
|
||||
copy /q src\regex\*.* %DEST%\src\regex
|
||||
copy /q src\zlib\*.* %DEST%\src\zlib
|
||||
|
||||
rem The rest is generated from src/files.lst
|
||||
|
||||
copy /q include\wx\app.h %DEST%\include\wx\app.h
|
||||
copy /q include\wx\arrimpl.cpp %DEST%\include\wx\arrimpl.cpp
|
||||
copy /q include\wx\buffer.h %DEST%\include\wx\buffer.h
|
||||
copy /q include\wx\chkconf.h %DEST%\include\wx\chkconf.h
|
||||
copy /q include\wx\clntdata.h %DEST%\include\wx\clntdata.h
|
||||
copy /q include\wx\cmdline.h %DEST%\include\wx\cmdline.h
|
||||
copy /q include\wx\confbase.h %DEST%\include\wx\confbase.h
|
||||
copy /q include\wx\config.h %DEST%\include\wx\config.h
|
||||
copy /q include\wx\date.h %DEST%\include\wx\date.h
|
||||
copy /q include\wx\datetime.h %DEST%\include\wx\datetime.h
|
||||
copy /q include\wx\datetime.inl %DEST%\include\wx\datetime.inl
|
||||
copy /q include\wx\datstrm.h %DEST%\include\wx\datstrm.h
|
||||
copy /q include\wx\db.h %DEST%\include\wx\db.h
|
||||
copy /q include\wx\dbtable.h %DEST%\include\wx\dbtable.h
|
||||
copy /q include\wx\dde.h %DEST%\include\wx\dde.h
|
||||
copy /q include\wx\debug.h %DEST%\include\wx\debug.h
|
||||
copy /q include\wx\defs.h %DEST%\include\wx\defs.h
|
||||
copy /q include\wx\dir.h %DEST%\include\wx\dir.h
|
||||
copy /q include\wx\dynarray.h %DEST%\include\wx\dynarray.h
|
||||
copy /q include\wx\dynlib.h %DEST%\include\wx\dynlib.h
|
||||
copy /q include\wx\encconv.h %DEST%\include\wx\encconv.h
|
||||
copy /q include\wx\event.h %DEST%\include\wx\event.h
|
||||
copy /q include\wx\ffile.h %DEST%\include\wx\ffile.h
|
||||
copy /q include\wx\file.h %DEST%\include\wx\file.h
|
||||
copy /q include\wx\fileconf.h %DEST%\include\wx\fileconf.h
|
||||
copy /q include\wx\filefn.h %DEST%\include\wx\filefn.h
|
||||
copy /q include\wx\filename.h %DEST%\include\wx\filename.h
|
||||
copy /q include\wx\filesys.h %DEST%\include\wx\filesys.h
|
||||
copy /q include\wx\fontenc.h %DEST%\include\wx\fontenc.h
|
||||
copy /q include\wx\fontmap.h %DEST%\include\wx\fontmap.h
|
||||
copy /q include\wx\fs_inet.h %DEST%\include\wx\fs_inet.h
|
||||
copy /q include\wx\fs_mem.h %DEST%\include\wx\fs_mem.h
|
||||
copy /q include\wx\fs_zip.h %DEST%\include\wx\fs_zip.h
|
||||
copy /q include\wx\gsocket.h %DEST%\include\wx\gsocket.h
|
||||
copy /q include\wx\hash.h %DEST%\include\wx\hash.h
|
||||
copy /q include\wx\intl.h %DEST%\include\wx\intl.h
|
||||
copy /q include\wx\ioswrap.h %DEST%\include\wx\ioswrap.h
|
||||
copy /q include\wx\ipcbase.h %DEST%\include\wx\ipcbase.h
|
||||
copy /q include\wx\list.h %DEST%\include\wx\list.h
|
||||
copy /q include\wx\listimpl.cpp %DEST%\include\wx\listimpl.cpp
|
||||
copy /q include\wx\log.h %DEST%\include\wx\log.h
|
||||
copy /q include\wx\longlong.h %DEST%\include\wx\longlong.h
|
||||
copy /q include\wx\memconf.h %DEST%\include\wx\memconf.h
|
||||
copy /q include\wx\memory.h %DEST%\include\wx\memory.h
|
||||
copy /q include\wx\memtext.h %DEST%\include\wx\memtext.h
|
||||
copy /q include\wx\mimetype.h %DEST%\include\wx\mimetype.h
|
||||
copy /q include\wx\module.h %DEST%\include\wx\module.h
|
||||
copy /q include\wx\mstream.h %DEST%\include\wx\mstream.h
|
||||
copy /q include\wx\object.h %DEST%\include\wx\object.h
|
||||
copy /q include\wx\objstrm.h %DEST%\include\wx\objstrm.h
|
||||
copy /q include\wx\platform.h %DEST%\include\wx\platform.h
|
||||
copy /q include\wx\process.h %DEST%\include\wx\process.h
|
||||
copy /q include\wx\regex.h %DEST%\include\wx\regex.h
|
||||
copy /q include\wx\sckaddr.h %DEST%\include\wx\sckaddr.h
|
||||
copy /q include\wx\sckipc.h %DEST%\include\wx\sckipc.h
|
||||
copy /q include\wx\sckstrm.h %DEST%\include\wx\sckstrm.h
|
||||
copy /q include\wx\serbase.h %DEST%\include\wx\serbase.h
|
||||
copy /q include\wx\snglinst.h %DEST%\include\wx\snglinst.h
|
||||
copy /q include\wx\socket.h %DEST%\include\wx\socket.h
|
||||
copy /q include\wx\strconv.h %DEST%\include\wx\strconv.h
|
||||
copy /q include\wx\stream.h %DEST%\include\wx\stream.h
|
||||
copy /q include\wx\string.h %DEST%\include\wx\string.h
|
||||
copy /q include\wx\sysopt.h %DEST%\include\wx\sysopt.h
|
||||
copy /q include\wx\textbuf.h %DEST%\include\wx\textbuf.h
|
||||
copy /q include\wx\textfile.h %DEST%\include\wx\textfile.h
|
||||
copy /q include\wx\thread.h %DEST%\include\wx\thread.h
|
||||
copy /q include\wx\time.h %DEST%\include\wx\time.h
|
||||
copy /q include\wx\timer.h %DEST%\include\wx\timer.h
|
||||
copy /q include\wx\tokenzr.h %DEST%\include\wx\tokenzr.h
|
||||
copy /q include\wx\txtstrm.h %DEST%\include\wx\txtstrm.h
|
||||
copy /q include\wx\url.h %DEST%\include\wx\url.h
|
||||
copy /q include\wx\utils.h %DEST%\include\wx\utils.h
|
||||
copy /q include\wx\variant.h %DEST%\include\wx\variant.h
|
||||
copy /q include\wx\vector.h %DEST%\include\wx\vector.h
|
||||
copy /q include\wx\version.h %DEST%\include\wx\version.h
|
||||
copy /q include\wx\wfstream.h %DEST%\include\wx\wfstream.h
|
||||
copy /q include\wx\wx.h %DEST%\include\wx\wx.h
|
||||
copy /q include\wx\wxchar.h %DEST%\include\wx\wxchar.h
|
||||
copy /q include\wx\wxprec.h %DEST%\include\wx\wxprec.h
|
||||
copy /q include\wx\zipstrm.h %DEST%\include\wx\zipstrm.h
|
||||
copy /q include\wx\zstream.h %DEST%\include\wx\zstream.h
|
||||
copy /q include\wx\unix\gsockunx.h %DEST%\include\wx\unix\gsockunx.h
|
||||
copy /q include\wx\unix\mimetype.h %DEST%\include\wx\unix\mimetype.h
|
||||
copy /q include\wx\msw\dde.h %DEST%\include\wx\msw\dde.h
|
||||
copy /q include\wx\msw\mimetype.h %DEST%\include\wx\msw\mimetype.h
|
||||
copy /q include\wx\protocol\file.h %DEST%\include\wx\protocol\file.h
|
||||
copy /q include\wx\protocol\ftp.h %DEST%\include\wx\protocol\ftp.h
|
||||
copy /q include\wx\protocol\http.h %DEST%\include\wx\protocol\http.h
|
||||
copy /q include\wx\protocol\protocol.h %DEST%\include\wx\protocol\protocol.h
|
||||
|
||||
copy /q src\common\init.cpp %DEST%\src\common\init.cpp
|
||||
copy /q src\common\appcmn.cpp %DEST%\src\common\appcmn.cpp
|
||||
copy /q src\common\clntdata.cpp %DEST%\src\common\clntdata.cpp
|
||||
copy /q src\common\cmdline.cpp %DEST%\src\common\cmdline.cpp
|
||||
copy /q src\common\config.cpp %DEST%\src\common\config.cpp
|
||||
copy /q src\common\datetime.cpp %DEST%\src\common\datetime.cpp
|
||||
copy /q src\common\datstrm.cpp %DEST%\src\common\datstrm.cpp
|
||||
copy /q src\common\db.cpp %DEST%\src\common\db.cpp
|
||||
copy /q src\common\dbtable.cpp %DEST%\src\common\dbtable.cpp
|
||||
copy /q src\common\dircmn.cpp %DEST%\src\common\dircmn.cpp
|
||||
copy /q src\common\dynarray.cpp %DEST%\src\common\dynarray.cpp
|
||||
copy /q src\common\dynlib.cpp %DEST%\src\common\dynlib.cpp
|
||||
copy /q src\common\encconv.cpp %DEST%\src\common\encconv.cpp
|
||||
copy /q src\common\event.cpp %DEST%\src\common\event.cpp
|
||||
copy /q src\common\extended.c %DEST%\src\common\extended.c
|
||||
copy /q src\common\ffile.cpp %DEST%\src\common\ffile.cpp
|
||||
copy /q src\common\file.cpp %DEST%\src\common\file.cpp
|
||||
copy /q src\common\fileconf.cpp %DEST%\src\common\fileconf.cpp
|
||||
copy /q src\common\filefn.cpp %DEST%\src\common\filefn.cpp
|
||||
copy /q src\common\filename.cpp %DEST%\src\common\filename.cpp
|
||||
copy /q src\common\filesys.cpp %DEST%\src\common\filesys.cpp
|
||||
copy /q src\common\fontmap.cpp %DEST%\src\common\fontmap.cpp
|
||||
copy /q src\common\fs_inet.cpp %DEST%\src\common\fs_inet.cpp
|
||||
copy /q src\common\fs_mem.cpp %DEST%\src\common\fs_mem.cpp
|
||||
copy /q src\common\fs_zip.cpp %DEST%\src\common\fs_zip.cpp
|
||||
copy /q src\common\ftp.cpp %DEST%\src\common\ftp.cpp
|
||||
copy /q src\common\hash.cpp %DEST%\src\common\hash.cpp
|
||||
copy /q src\common\http.cpp %DEST%\src\common\http.cpp
|
||||
copy /q src\common\intl.cpp %DEST%\src\common\intl.cpp
|
||||
copy /q src\common\ipcbase.cpp %DEST%\src\common\ipcbase.cpp
|
||||
copy /q src\common\list.cpp %DEST%\src\common\list.cpp
|
||||
copy /q src\common\log.cpp %DEST%\src\common\log.cpp
|
||||
copy /q src\common\longlong.cpp %DEST%\src\common\longlong.cpp
|
||||
copy /q src\common\memory.cpp %DEST%\src\common\memory.cpp
|
||||
copy /q src\common\mimecmn.cpp %DEST%\src\common\mimecmn.cpp
|
||||
copy /q src\common\module.cpp %DEST%\src\common\module.cpp
|
||||
copy /q src\common\mstream.cpp %DEST%\src\common\mstream.cpp
|
||||
copy /q src\common\object.cpp %DEST%\src\common\object.cpp
|
||||
copy /q src\common\objstrm.cpp %DEST%\src\common\objstrm.cpp
|
||||
copy /q src\common\process.cpp %DEST%\src\common\process.cpp
|
||||
copy /q src\common\protocol.cpp %DEST%\src\common\protocol.cpp
|
||||
copy /q src\common\regex.cpp %DEST%\src\common\regex.cpp
|
||||
copy /q src\common\sckaddr.cpp %DEST%\src\common\sckaddr.cpp
|
||||
copy /q src\common\sckfile.cpp %DEST%\src\common\sckfile.cpp
|
||||
copy /q src\common\sckipc.cpp %DEST%\src\common\sckipc.cpp
|
||||
copy /q src\common\sckstrm.cpp %DEST%\src\common\sckstrm.cpp
|
||||
copy /q src\common\serbase.cpp %DEST%\src\common\serbase.cpp
|
||||
copy /q src\common\socket.cpp %DEST%\src\common\socket.cpp
|
||||
copy /q src\common\strconv.cpp %DEST%\src\common\strconv.cpp
|
||||
copy /q src\common\stream.cpp %DEST%\src\common\stream.cpp
|
||||
copy /q src\common\string.cpp %DEST%\src\common\string.cpp
|
||||
copy /q src\common\sysopt.cpp %DEST%\src\common\sysopt.cpp
|
||||
copy /q src\common\textbuf.cpp %DEST%\src\common\textbuf.cpp
|
||||
copy /q src\common\textfile.cpp %DEST%\src\common\textfile.cpp
|
||||
copy /q src\common\timercmn.cpp %DEST%\src\common\timercmn.cpp
|
||||
copy /q src\common\tokenzr.cpp %DEST%\src\common\tokenzr.cpp
|
||||
copy /q src\common\txtstrm.cpp %DEST%\src\common\txtstrm.cpp
|
||||
copy /q src\common\unzip.c %DEST%\src\common\unzip.c
|
||||
copy /q src\common\url.cpp %DEST%\src\common\url.cpp
|
||||
copy /q src\common\utilscmn.cpp %DEST%\src\common\utilscmn.cpp
|
||||
copy /q src\common\variant.cpp %DEST%\src\common\variant.cpp
|
||||
copy /q src\common\wfstream.cpp %DEST%\src\common\wfstream.cpp
|
||||
copy /q src\common\wxchar.cpp %DEST%\src\common\wxchar.cpp
|
||||
copy /q src\common\zipstrm.cpp %DEST%\src\common\zipstrm.cpp
|
||||
copy /q src\common\zstream.cpp %DEST%\src\common\zstream.cpp
|
||||
copy /q src\unix\dir.cpp %DEST%\src\unix\dir.cpp
|
||||
copy /q src\unix\gsocket.c %DEST%\src\unix\gsocket.c
|
||||
copy /q src\unix\mimetype.cpp %DEST%\src\unix\mimetype.cpp
|
||||
copy /q src\unix\snglinst.cpp %DEST%\src\unix\snglinst.cpp
|
||||
copy /q src\unix\threadpsx.cpp %DEST%\src\unix\threadpsx.cpp
|
||||
copy /q src\unix\utilsunx.cpp %DEST%\src\unix\utilsunx.cpp
|
||||
copy /q src\msw\dde.cpp %DEST%\src\msw\dde.cpp
|
||||
copy /q src\msw\dir.cpp %DEST%\src\msw\dir.cpp
|
||||
copy /q src\msw\gsocket.c %DEST%\src\msw\gsocket.c
|
||||
copy /q src\msw\gsockmsw.c %DEST%\src\msw\gsockmsw.c
|
||||
copy /q src\msw\main.cpp %DEST%\src\msw\main.cpp
|
||||
copy /q src\msw\mimetype.cpp %DEST%\src\msw\mimetype.cpp
|
||||
copy /q src\msw\regconf.cpp %DEST%\src\msw\regconf.cpp
|
||||
copy /q src\msw\registry.cpp %DEST%\src\msw\registry.cpp
|
||||
copy /q src\msw\snglinst.cpp %DEST%\src\msw\snglinst.cpp
|
||||
copy /q src\msw\thread.cpp %DEST%\src\msw\thread.cpp
|
||||
copy /q src\msw\utils.cpp %DEST%\src\msw\utils.cpp
|
||||
copy /q src\msw\utilsexc.cpp %DEST%\src\msw\utilsexc.cpp
|
@@ -139,6 +139,7 @@ docview.cpp Common
|
||||
dseldlg.cpp Common
|
||||
dynarray.cpp Common Base
|
||||
dynlib.cpp Common Base
|
||||
dynload.cpp Common Base
|
||||
effects.cpp Common
|
||||
encconv.cpp Common Base
|
||||
event.cpp Common Base
|
||||
@@ -191,7 +192,6 @@ module.cpp Common Base
|
||||
mstream.cpp Common Base
|
||||
nbkbase.cpp Common
|
||||
object.cpp Common Base
|
||||
objstrm.cpp Common Base
|
||||
odbc.cpp Common NotGTK,NotX,NotOS2
|
||||
paper.cpp Common
|
||||
popupcmn.cpp Common
|
||||
@@ -206,7 +206,6 @@ sckaddr.cpp Common Socket,Base
|
||||
sckfile.cpp Common Socket,Base
|
||||
sckipc.cpp Common Socket,Base
|
||||
sckstrm.cpp Common Socket,Base
|
||||
serbase.cpp Common Base
|
||||
sizer.cpp Common
|
||||
socket.cpp Common Socket,Base
|
||||
statbar.cpp Common
|
||||
@@ -350,9 +349,9 @@ wave.cpp MSW
|
||||
window.cpp MSW LowLevel
|
||||
|
||||
dialup.cpp Unix NotMac
|
||||
dir.cpp Unix Base,NotMac
|
||||
fontenum.cpp Unix NotMac
|
||||
fontutil.cpp Unix NotMac
|
||||
dir.cpp Unix Base,NotMac,NotMGL
|
||||
fontenum.cpp Unix NotMac,NotMGL
|
||||
fontutil.cpp Unix NotMac,NotMGL
|
||||
gsocket.c Unix Base,NotMac
|
||||
mimetype.cpp Unix Base,NotMac
|
||||
snglinst.cpp Unix Base
|
||||
@@ -723,6 +722,7 @@ confbase.h WXH Base
|
||||
config.h WXH Base
|
||||
containr.h WXH
|
||||
control.h WXH
|
||||
cshelp.h WXH
|
||||
ctrlsub.h WXH
|
||||
cursor.h WXH
|
||||
dataobj.h WXH
|
||||
@@ -752,6 +752,7 @@ docview.h WXH
|
||||
dragimag.h WXH
|
||||
dynarray.h WXH Base
|
||||
dynlib.h WXH Base
|
||||
dynload.h WXH Base
|
||||
encconv.h WXH Base
|
||||
event.h WXH Base
|
||||
expr.h WXH
|
||||
@@ -787,7 +788,6 @@ gsocket.h WXH Base
|
||||
hash.h WXH Base
|
||||
help.h WXH
|
||||
helpbase.h WXH
|
||||
cshelp.h WXH
|
||||
helphtml.h WXH
|
||||
helpwin.h WXH
|
||||
icon.h WXH
|
||||
@@ -830,7 +830,6 @@ msgdlg.h WXH
|
||||
mstream.h WXH Base
|
||||
notebook.h WXH
|
||||
object.h WXH Base
|
||||
objstrm.h WXH Base
|
||||
odbc.h WXH
|
||||
ownerdrw.h WXH
|
||||
palette.h WXH
|
||||
@@ -858,7 +857,6 @@ sckipc.h WXH Base
|
||||
sckstrm.h WXH Base
|
||||
scrolbar.h WXH
|
||||
scrolwin.h WXH
|
||||
serbase.h WXH Base
|
||||
settings.h WXH
|
||||
sizer.h WXH
|
||||
slider.h WXH
|
||||
@@ -1444,11 +1442,12 @@ brush.cpp MGL LowLevel
|
||||
pen.cpp MGL LowLevel
|
||||
font.cpp MGL LowLevel
|
||||
data.cpp MGL LowLevel
|
||||
#fontenum.cpp MGL LowLevel
|
||||
#fontutil.cpp MGL LowLevel
|
||||
fontenum.cpp MGL LowLevel
|
||||
fontutil.cpp MGL LowLevel
|
||||
evtloop.cpp MGL LowLevel
|
||||
app.cpp MGL LowLevel
|
||||
bitmap.cpp MGL LowLevel
|
||||
dir.cpp MGL LowLevel
|
||||
clipbrd.cpp MGL LowLevel
|
||||
cursor.cpp MGL LowLevel
|
||||
dcclient.cpp MGL LowLevel
|
||||
|
@@ -45,6 +45,8 @@
|
||||
}
|
||||
|
||||
foreach $file (sort keys %wxUNIX) {
|
||||
next if $wxUNIX{$file} =~ /\bNotMGL\b/;
|
||||
|
||||
($fileobj = $file) =~ s/cp?p?$/\o/;
|
||||
|
||||
$project{"MGL_SOURCES"} .= "unix/" . $file . " ";
|
||||
|
@@ -10,4 +10,5 @@ src/univ/themes/*.cpp
|
||||
|
||||
docs/microwin/readme.txt
|
||||
docs/microwin/microwindows.patches
|
||||
docs/univ/*.txt
|
||||
|
||||
|
@@ -60,6 +60,20 @@ Unix ports:
|
||||
and the compiler flags for C++ files only, CFLAGS should still be used
|
||||
to compile pure C files.
|
||||
|
||||
2.3.3
|
||||
-----
|
||||
|
||||
All:
|
||||
|
||||
- fixes to the command line parsing error and usage messages
|
||||
- modified wxFileName::CreateTempFileName() to open the file atomically
|
||||
(if possible) and, especially, not to leak the file descriptors under Unix
|
||||
|
||||
wxMSW:
|
||||
|
||||
- fixed flicker in wxTreeCtrl::SetItemXXX()
|
||||
- fixed redraw problems in dynamically resized wxStaticText
|
||||
|
||||
2.3.2
|
||||
-----
|
||||
|
||||
@@ -93,6 +107,8 @@ All (GUI):
|
||||
wxMSW:
|
||||
|
||||
- support for the DBCS fonts (CP 932, 936, 949, 950) (Nathan Cook)
|
||||
- new library naming convention under VC++ -- please change your application
|
||||
project files
|
||||
|
||||
wxGTK:
|
||||
|
||||
|
@@ -5,24 +5,13 @@
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="#FFFFFF" TEXT=#000000 LINK=#FF0000 VLINK=#000000>
|
||||
<BODY BGCOLOR=#FFFFFF TEXT=#000000 VLINK="#63659C" LINK="#313063" ALINK="#313063">
|
||||
|
||||
<font face="Arial, Lucida Sans, Helvetica">
|
||||
|
||||
<a name="top"></a>
|
||||
|
||||
<table width=100% border=0 cellpadding=5 cellspacing=0>
|
||||
<tr>
|
||||
<td bgcolor="#C4ECF9">
|
||||
<font size=+1 face="Arial, Lucida Sans, Helvetica" color="#000000">
|
||||
<IMG src="logo.gif" align=left>
|
||||
<!-- wxWindows Documentation -->
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<P>
|
||||
<IMG src="logo.gif" align=left hspace=10 vspace=0>
|
||||
|
||||
Welcome to wxWindows 2, the première cross-platform GUI C++ framework. This is an index of
|
||||
the plain text, HTML, Windows Help and Acrobat documentation: availability depends on what you've
|
||||
@@ -76,16 +65,16 @@ downloaded from the <a href="http://www.wxwindows.org">wxWindows Web site</a>.<P
|
||||
<table border=1 align=center>
|
||||
|
||||
<tr>
|
||||
<td align=center bgcolor="#FFFF00">
|
||||
<td align=center bgcolor="#C4ECF9">
|
||||
<B>HTML</B>
|
||||
</td>
|
||||
<td align=center bgcolor="#FFFF00">
|
||||
<td align=center bgcolor="#C4ECF9">
|
||||
<B>WinHelp</B>
|
||||
</td>
|
||||
<td align=center bgcolor="#FFFF00">
|
||||
<td align=center bgcolor="#C4ECF9">
|
||||
<B>MS HTML Help</B>
|
||||
</td>
|
||||
<td align=center bgcolor="#FFFF00">
|
||||
<td align=center bgcolor="#C4ECF9">
|
||||
<B>PDF</B>
|
||||
</td>
|
||||
</tr>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 6.2 KiB |
@@ -405,12 +405,20 @@ Add a parameter of the given {\it type} to the command line description.
|
||||
|
||||
\membersection{wxCmdLineParser::Parse}\label{wxcmdlineparserparse}
|
||||
|
||||
\func{int}{Parse}{\void}
|
||||
\func{int}{Parse}{\param{bool }{giveUsage = {\tt TRUE}}}
|
||||
|
||||
Parse the command line, return $0$ if ok, $-1$ if {\tt "-h"} or {\tt "--help"}
|
||||
option was encountered and the help message was given or a positive value if a
|
||||
syntax error occured.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{giveUsage}{If {\tt TRUE} (default), the usage message is given if a
|
||||
syntax error was encountered while parsing the command line or if help was
|
||||
requested. If {\tt FALSE}, only error messages about possible syntax errors
|
||||
are given, use \helpref{Usage}{wxcmdlineparserusage} to show the usage message
|
||||
from the caller if needed.}
|
||||
|
||||
\membersection{wxCmdLineParser::Usage}\label{wxcmdlineparserusage}
|
||||
|
||||
\func{void}{Usage}{\void}
|
||||
|
@@ -686,11 +686,12 @@ exist it is created.
|
||||
|
||||
\func{void}{SetRecordDefaults}{\param{bool }{bDoIt = TRUE}}
|
||||
|
||||
Sets whether defaults are written back to the config file.
|
||||
Sets whether defaults are recorded to the config file whenever an attempt to
|
||||
read read the value which is not present in it is done.
|
||||
|
||||
If on (default is off) all default values are written back to the config file.
|
||||
This allows the user to see what config options may be changed and is probably
|
||||
useful only for wxFileConfig.
|
||||
If on (default is off) all default values for the settings used by the program
|
||||
are written back to the config file. This allows the user to see what config
|
||||
options may be changed and is probably useful only for wxFileConfig.
|
||||
|
||||
\membersection{wxConfigBase::SetUmask}\label{wxfileconfigsetumask}
|
||||
|
||||
|
@@ -226,7 +226,7 @@ Set this file name object to the home directory.
|
||||
|
||||
\membersection{wxFileName::AssignTempFileName}\label{wxfilenameassigntempfilename}
|
||||
|
||||
\func{void}{AssignTempFileName}{\param{const wxString\& }{prefix}}
|
||||
\func{void}{AssignTempFileName}{\param{const wxString\& }{prefix}, \param{wxFile *}{fileTemp = {\tt NULL}}}
|
||||
|
||||
The function calls \helpref{CreateTempFileName}{wxfilenamecreatetempfilename} to
|
||||
create a temporary file and sets this object to the name of the file. If a
|
||||
@@ -241,16 +241,28 @@ Reset all components to default, uninitialized state.
|
||||
|
||||
\membersection{wxFileName::CreateTempFileName}\label{wxfilenamecreatetempfilename}
|
||||
|
||||
\func{static wxString}{CreateTempFileName}{\param{const wxString\& }{prefix}}
|
||||
\func{static wxString}{CreateTempFileName}{\param{const wxString\& }{prefix}, \param{wxFile *}{fileTemp = {\tt NULL}}}
|
||||
|
||||
Returns a temporary file name starting with the given {\it prefix}. If
|
||||
the {\it prefix} is an absolute path, the temporary file is created in this
|
||||
directory, otherwise it is created in the default system directory for the
|
||||
temporary files or in the current directory.
|
||||
|
||||
If the function succeeds, the temporary file is actually created (but not
|
||||
opened) as well. Under Unix, it will have read and write permissions for the
|
||||
owner only.
|
||||
If the function succeeds, the temporary file is actually created. If\rtfsp
|
||||
{\it fileTemp} is not {\tt NULL}, this file will be opened using the name of
|
||||
the temporary file. When possible, this is done in an atomic way ensuring that
|
||||
no race condition occurs between the temporary file name generation and opening
|
||||
it which could often lead to security compromise on the multiuser systems.
|
||||
If {\it fileTemp} is {\tt NULL}, the file is only created, but not opened.
|
||||
|
||||
Under Unix, the temporary file will have read and write permissions for the
|
||||
owner only to minimize the security problems.
|
||||
|
||||
\wxheading{Parameters}
|
||||
|
||||
\docparam{prefix}{Prefix to use for the temporary file name construction}
|
||||
|
||||
\docparam{fileTemp}{The file to open or {\tt NULL} to just get the name}
|
||||
|
||||
\wxheading{Return value}
|
||||
|
||||
|
@@ -32,6 +32,10 @@ If both wxTR\_HAS\_BUTTONS and wxTR\_TWIST\_BUTTONS are given,
|
||||
twister buttons are generated. Generic only.}
|
||||
\twocolitem{\windowstyle{wxTR\_NO\_LINES}}{Use this style
|
||||
to hide vertical level connectors.}
|
||||
\twocolitem{\windowstyle{wxTR\_FULL\_ROW\_HIGHLIGHT}}{Use this style to have the background
|
||||
colour and the selection highlight extend over the entire horizontal
|
||||
row of the tree control window. (This flag is ignored under Windows unless you
|
||||
specify wxTR\_NO\_LINES as well.) }
|
||||
\twocolitem{\windowstyle{wxTR\_LINES\_AT\_ROOT}}{Use this style
|
||||
to show lines between root nodes.
|
||||
Only applicable if wxTR\_HIDE\_ROOT is set and wxTR\_NO\_LINES is not set.}
|
||||
|
@@ -20,9 +20,11 @@ characters from languages other than English.
|
||||
Starting with release 2.1 wxWindows has support for compiling in Unicode mode
|
||||
on the platforms which support it. Unicode is a standard for character
|
||||
encoding which addresses the shortcomings of the previous, 8 bit standards, by
|
||||
using 16 bit for encoding each character. This allows to have 65536 characters
|
||||
instead of the usual 256 and is sufficient to encode all of the world
|
||||
languages at once. More details about Unicode may be found at {\tt www.unicode.org}.
|
||||
using at least 16 (and possibly 32) bits for encoding each character. This
|
||||
allows to have at least 65536 characters (what is called the BMP, or basic
|
||||
multilingual plane) and possible $2^{32}$ of them instead of the usual 256 and
|
||||
is sufficient to encode all of the world languages at once. More details about
|
||||
Unicode may be found at {\tt www.unicode.org}.
|
||||
|
||||
% TODO expand on it, say that Unicode extends ASCII, mention ISO8859, ...
|
||||
|
||||
@@ -52,6 +54,8 @@ Basically, there are only a few things to watch out for:
|
||||
\item Character type ({\tt char} or {\tt wchar\_t})
|
||||
\item Literal strings (i.e. {\tt "Hello, world!"} or {\tt '*'})
|
||||
\item String functions ({\tt strlen()}, {\tt strcpy()}, ...)
|
||||
\item Special preprocessor tokens ({\tt \_\_FILE\_\_}, {\tt \_\_DATE\_\_}
|
||||
and {\tt \_\_TIME\_\_})
|
||||
\end{itemize}
|
||||
|
||||
Let's look at them in order. First of all, each character in an Unicode
|
||||
@@ -59,20 +63,27 @@ program takes 2 bytes instead of usual one, so another type should be used to
|
||||
store the characters ({\tt char} only holds 1 byte usually). This type is
|
||||
called {\tt wchar\_t} which stands for {\it wide-character type}.
|
||||
|
||||
Also, the string and character constants should be encoded on 2 bytes instead
|
||||
of one. This is achieved by using the standard C (and C++) way: just put the
|
||||
letter {\tt 'L'} after any string constant and it becomes a {\it long}
|
||||
constant, i.e. a wide character one. To make things a bit more readable, you
|
||||
are also allowed to prefix the constant with {\tt 'L'} instead of putting it
|
||||
after it.
|
||||
Also, the string and character constants should be encoded using wide
|
||||
characters ({\tt wchar\_t} type) which typically take $2$ or $4$ bytes instead
|
||||
of {\tt char} which only takes one. This is achieved by using the standard C
|
||||
(and C++) way: just put the letter {\tt 'L'} after any string constant and it
|
||||
becomes a {\it long} constant, i.e. a wide character one. To make things a bit
|
||||
more readable, you are also allowed to prefix the constant with {\tt 'L'}
|
||||
instead of putting it after it.
|
||||
|
||||
Finally, the standard C functions don't work with {\tt wchar\_t} strings, so
|
||||
another set of functions exists which do the same thing but accept
|
||||
Of course, the usual standard C functions don't work with {\tt wchar\_t}
|
||||
strings, so another set of functions exists which do the same thing but accept
|
||||
{\tt wchar\_t *} instead of {\tt char *}. For example, a function to get the
|
||||
length of a wide-character string is called {\tt wcslen()} (compare with
|
||||
{\tt strlen()} - you see that the only difference is that the "str" prefix
|
||||
standing for "string" has been replaced with "wcs" standing for
|
||||
"wide-character string").
|
||||
standing for "string" has been replaced with "wcs" standing for "wide-character
|
||||
string").
|
||||
|
||||
And finally, the standard preprocessor tokens enumerated above expand to ANSI
|
||||
strings but it is more likely that Unicode strings are wanted in the Unicode
|
||||
build. wxWindows provides the macros {\tt \_\_TFILE\_\_}, {\tt \_\_TDATE\_\_}
|
||||
and {\tt \_\_TTIME\_\_} which behave exactly as the standard ones except that
|
||||
they produce ANSI strings in ANSI build and Unicode ones in the Unicode build.
|
||||
|
||||
To summarize, here is a brief example of how a program which can be compiled
|
||||
in both ANSI and Unicode modes could look like:
|
||||
@@ -82,10 +93,14 @@ in both ANSI and Unicode modes could look like:
|
||||
wchar_t wch = L'*';
|
||||
const wchar_t *ws = L"Hello, world!";
|
||||
int len = wcslen(ws);
|
||||
|
||||
wprintf(L"Compiled at %s\n", __TDATE__);
|
||||
#else // ANSI
|
||||
char ch = '*';
|
||||
const char *s = "Hello, world!";
|
||||
int len = strlen(s);
|
||||
|
||||
printf("Compiled at %s\n", __DATE__);
|
||||
#endif // Unicode/ANSI
|
||||
\end{verbatim}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
|
||||
Welcome to wxWindows/Motif 2.2.0
|
||||
Welcome to wxWindows/Motif 2.3.2
|
||||
|
||||
You have downloaded version 2.2.0 of the Motif port of
|
||||
You have downloaded version 2.3.2 of the Motif port of
|
||||
the wxWindows GUI library.
|
||||
|
||||
More information about the wxWindows project as a whole
|
||||
@@ -33,7 +33,7 @@ Alternatively, you may also use the bug reporting system
|
||||
linked from the wxWindows web page.
|
||||
|
||||
The library produced by the install process will be called
|
||||
libwx_motif.a (static) and libwx_motif-2.2.so.0.0.0 (shared) so that
|
||||
libwx_motif.a (static) and libwx_motif-2.3.so.0.0.0 (shared) so that
|
||||
once a binary incompatible version of wxWindows/Motif comes out
|
||||
we'll augment the library version number to avoid linking problems.
|
||||
|
||||
|
@@ -10,6 +10,7 @@ TN0009 Creating and converting icons
|
||||
TN0010 Compiling wxWindows applications in the VC++ IDE
|
||||
TN0011 All about version numbers
|
||||
TN0012 wxWindows platform, toolkit and library names
|
||||
TN0013 how to make a wxGTK distribution
|
||||
|
||||
|
||||
Version: $Id$
|
||||
|
141
docs/tech/tn0013.txt
Normal file
141
docs/tech/tn0013.txt
Normal file
@@ -0,0 +1,141 @@
|
||||
How to prepare wxGTK distribution
|
||||
=================================
|
||||
|
||||
0. Introduction
|
||||
---------------
|
||||
|
||||
This note explains what should be done, step by step, to prepare the packages
|
||||
for a wxGTK distribution.
|
||||
|
||||
1. Preparing the sources
|
||||
------------------------
|
||||
|
||||
a) Do a fresh checkout using the command
|
||||
|
||||
cvs -d :pserver:anoncvs@cvs.wxwindows.org:/home/wxcvs co wxGTK
|
||||
|
||||
NB: if you realize later that some needed files were not checked out
|
||||
by this command, please modify CVSROOT/modules to include the missing
|
||||
files so that it works for the next release!
|
||||
|
||||
You also need the samples, demos and contrib directories, so change to
|
||||
wxWindows directory created by the first cvs command and do "cvs up -d"
|
||||
for each of them.
|
||||
|
||||
b) Create a build directory under wxWindows, e.g. I use "gtk-release",
|
||||
"cd" to it and type "make -j1 dist bzip-dist-only". This should create
|
||||
the following files;
|
||||
|
||||
wxGTK-${version}.tar.bz2
|
||||
wxGTK-demos-${version}.tar.bz2
|
||||
wxGTK-samples-${version}.tar.bz2
|
||||
wxGTK-${version}.tar.gz
|
||||
wxGTK-demos-${version}.tar.gz
|
||||
wxGTK-samples-${version}.tar.gz
|
||||
|
||||
where version is something like 2.3.2.
|
||||
|
||||
Note 1: "-j1" is needed now because make dist target is broken and doesn't
|
||||
allow parallelizing, if your make is aliased to "make -j4" (like
|
||||
mine), it simply won't work.
|
||||
|
||||
Note 2; there are also dist-only and bzip-dist targets, the "-only" suffix
|
||||
means to just create the archive supposing that the files
|
||||
themselves are already under _dist_dir/wxGTK-${version} where
|
||||
"make dist" creates them
|
||||
|
||||
2. Building the RPMs
|
||||
--------------------
|
||||
|
||||
Note that we didn't check if the library actually could be built - this is
|
||||
because it is done during this step, during the RPM generation. If, for
|
||||
whatever reason, you don't build the RPMs, you must have checked previously
|
||||
that the library could be built - nothing worse than a release which doesn't
|
||||
even compile!
|
||||
|
||||
The rest of this section applies to a system with RPM installed (Redhat in my
|
||||
case).
|
||||
|
||||
a) Setting up the RPM tree: you should have the RPM tree set up properly
|
||||
before doing anything else. If you are going to build the RPMs as root,
|
||||
you already have one under /usr/src/redhat and can just build there.
|
||||
Otherwise you may do it (without root rights) in any directory RPM_ROOT.
|
||||
RPM_ROOT should have the following subdirectories: BUILD, RPMS, SOURCES,
|
||||
SPECS and SRPMS. RPMS should contain i386, i686 and noarch. You should
|
||||
also create the file ~/.rpmmacros containing at least the following line:
|
||||
"%_topdir /biton/zeitlin/rpm".
|
||||
|
||||
In either case, put the file wxGTK-${version}.tar.bz2 in SOURCES
|
||||
subdirectory and wxGTK.spec in SPECS one (hint: you can just link them from
|
||||
there - like this you won't forget to update them after redoing "make
|
||||
dist").
|
||||
|
||||
b) Start RPM build by going to RPM_ROOT directory and typing "rpm -bb
|
||||
SPECS/wxGTK.spec". It may be a good idea to append "2&>1 | tee wxGTK.out"
|
||||
(or "|& tee" if you're using the one true shell ;-) as it might be not
|
||||
easy to detect errors in the verbose rpm output if anything goes wrong.
|
||||
|
||||
Then wait (and pray that nothing goes wrong because if anything does
|
||||
you'll have to restart from the very beginning because rpm doesn't allow
|
||||
to short circuit the package generation).
|
||||
|
||||
If everything goes well, the following files are produced:
|
||||
|
||||
SRPMS/wxGTK-${version}-1.src.rpm
|
||||
RPMS/i386/wxGTK-${version}-1.i386.rpm
|
||||
RPMS/i386/wxGTK-devel-${version}-1.i386.rpm
|
||||
RPMS/i386/wxGTK-gl-${version}-1.i386.rpm
|
||||
RPMS/i386/wxGTK-static-${version}-1.i386.rpm
|
||||
|
||||
3. Building the DEBs
|
||||
--------------------
|
||||
|
||||
[Ron is doing this]
|
||||
|
||||
4. Uploading the files
|
||||
----------------------
|
||||
|
||||
All 11 files should be uploaded (via FTP) to several locations.
|
||||
|
||||
a) incoming.sourceforge.net, go to project admin page on sf.net and choose
|
||||
add/edit releases for more details
|
||||
|
||||
b) ftp.remstar.com (Julian has the password)
|
||||
|
||||
5. Announcing the release
|
||||
-------------------------
|
||||
|
||||
a) FreshMeat:
|
||||
- http://freshmeat.net/projects/wxwindowsgtk/
|
||||
- username and password are "wxgtk" for logging in
|
||||
- hit "new release" at the top
|
||||
- follow the step by step
|
||||
|
||||
b) wx-announce mailing list: mailto:wx-announce@lists.wxwindows.org
|
||||
|
||||
[where is the announcement text? TODO]
|
||||
|
||||
c) update www.wxwindows.org
|
||||
|
||||
d) GNOME (very effective, stays on front page for days):
|
||||
- http://www.gnome.org/applist
|
||||
- Search for wxWindows
|
||||
- Update the version number
|
||||
- Ignore the error message
|
||||
|
||||
e) MacNN:
|
||||
- http://www.macnn.com
|
||||
- Contact or Contribute or something
|
||||
|
||||
f) MacRumors:
|
||||
- http://www.macrumors.com
|
||||
- Contact or Contribute or something
|
||||
|
||||
g) Apple Developers Connection:
|
||||
mailto: adcnews@apple.com
|
||||
|
||||
h) LinuxDevices.com:
|
||||
Interesting for wxUniversal.
|
||||
|
||||
i) The Python mailing list:
|
||||
|
43
docs/univ/porting.txt
Normal file
43
docs/univ/porting.txt
Normal file
@@ -0,0 +1,43 @@
|
||||
Porting wxUniversal to a new platform
|
||||
=====================================
|
||||
|
||||
wxUniv relies on the low level toolkit to work. Here are the classes which
|
||||
this toolkit to implement to support wxUniv (roughly sorted by importance
|
||||
inside each category):
|
||||
|
||||
1. System classes
|
||||
-----------------
|
||||
|
||||
wxApp
|
||||
wxEventLoop
|
||||
wxTimer
|
||||
wxSystemSettings
|
||||
|
||||
2. Window classes
|
||||
-----------------
|
||||
|
||||
wxWindow
|
||||
wxTopLevelWindow
|
||||
wxPopupWindow
|
||||
|
||||
3. GDI classes
|
||||
--------------
|
||||
|
||||
wxDC
|
||||
wxBitmap
|
||||
wxBrush
|
||||
wxColour
|
||||
wxCursor
|
||||
wxFont
|
||||
wxIcon
|
||||
wxPalette
|
||||
wxPen
|
||||
wxRegion
|
||||
|
||||
4. Miscellaneous
|
||||
----------------
|
||||
|
||||
wxClipboard
|
||||
wxDropSourceBase
|
||||
wxDropTarget
|
||||
|
@@ -4,7 +4,7 @@
|
||||
Welcome to wxUniversal!
|
||||
|
||||
Acknowledgements: wxUniversal wouldn't have been written without the
|
||||
generuous support of SciTech Software. Many thanks to Kendall Benett and
|
||||
generous support of SciTech Software. Many thanks to Kendall Benett and
|
||||
Tom Ryan!
|
||||
|
||||
0. Introduction
|
||||
@@ -18,20 +18,20 @@ by drawing them itself (using low level wxWindows classes). Please see
|
||||
for more details about it.
|
||||
|
||||
The advantage of wxUniversal is that you have precise control over the
|
||||
controls appearance (it is not always possible to change all aspects of the
|
||||
controls' appearance (it is not always possible to change all aspects of the
|
||||
native controls) and the theme support: the same program may be changed to
|
||||
look completely differently without changing a single line of its code but
|
||||
look completely differently without changing a single line of its code but
|
||||
just changing the theme.
|
||||
|
||||
Another advantage is that it makes writing ports of wxWindows for other
|
||||
platforms (such as OS/2, BeOS or QNX) much simpler, so it is of special
|
||||
interest to the people interested in porting wxWindows to another platform.
|
||||
interest to people interested in porting wxWindows to another platform.
|
||||
|
||||
However, wxUniversal doesn't have the 100% native look and feel unlike the
|
||||
However, wxUniversal doesn't have a 100% native look and feel unlike the
|
||||
other wxWindows ports - this is the price to pay for the extra flexibility.
|
||||
|
||||
1. Requirments and supported platforms
|
||||
--------------------------------------
|
||||
1. Requirements and supported platforms
|
||||
---------------------------------------
|
||||
|
||||
wxUniversal is used together with another wxWindows port which provides the
|
||||
"low level classes" mentioned above. Currently it can be built either with
|
||||
@@ -47,7 +47,7 @@ toolkit.
|
||||
|
||||
a) Using Visual C++ 6.0
|
||||
|
||||
Simply open the src/wxUniv.dsw file in MSDEV and build it.
|
||||
Simply open the src/wxUniv.dsw file in DevStudio and build it.
|
||||
|
||||
b) Cygwin
|
||||
|
||||
@@ -55,10 +55,14 @@ b) Cygwin
|
||||
|
||||
c) Other compilers
|
||||
|
||||
Unfortunately we don't have the makefiles for any other compilers yet.
|
||||
Unfortunately we don't have makefiles for any other compilers yet.
|
||||
Please contact us if you would like to help us with creating one for the
|
||||
compiler you use.
|
||||
|
||||
Note that you can use the wxUniversal classes, wxMSW and MicroWindows (from
|
||||
Century Software) to build a different variant of wxUniversal than that
|
||||
documented here. Please see docs/univ/readme.txt for further information.
|
||||
|
||||
3. Installing under Unix
|
||||
------------------------
|
||||
|
||||
@@ -87,7 +91,7 @@ itself, namely:
|
||||
* WWW page: http://www.wxwindows.org/
|
||||
|
||||
|
||||
Hope you will find wxUniversal useful!
|
||||
Hope you find wxUniversal useful!
|
||||
|
||||
Vadim Zeitlin
|
||||
|
@@ -533,6 +533,22 @@
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_WXHTML_HELP) */
|
||||
|
||||
#ifndef wxUSE_UNICODE
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_UNICODE must be defined."
|
||||
# else
|
||||
# define wxUSE_UNICODE 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_UNICODE) */
|
||||
|
||||
#if defined(__WXMSW__) && !defined(wxUSE_UNICODE_MSLU)
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_UNICODE_MSLU must be defined."
|
||||
# else
|
||||
# define wxUSE_UNICODE_MSLU 0
|
||||
# endif
|
||||
#endif /* !defined(wxUSE_UNICODE) */
|
||||
|
||||
/*
|
||||
check consistency of the settings
|
||||
*/
|
||||
@@ -877,5 +893,14 @@
|
||||
# endif
|
||||
#endif /* wxUSE_CLIPBOARD */
|
||||
|
||||
#if wxUSE_UNICODE_MSLU && !wxUSE_UNICODE
|
||||
# ifdef wxABORT_ON_CONFIG_ERROR
|
||||
# error "wxUSE_UNICODE_MSLU requires wxUSE_UNICODE"
|
||||
# else
|
||||
# undef wxUSE_UNICODE
|
||||
# define wxUSE_UNICODE 1
|
||||
# endif
|
||||
#endif /* wxUSE_UNICODE_MSLU */
|
||||
|
||||
#endif /* wxUSE_GUI */
|
||||
|
||||
|
@@ -162,7 +162,10 @@ public:
|
||||
// parse the command line, return 0 if ok, -1 if "-h" or "--help" option
|
||||
// was encountered and the help message was given or a positive value if a
|
||||
// syntax error occured
|
||||
int Parse();
|
||||
//
|
||||
// if showUsage is true, Usage() is called in case of syntax error or if
|
||||
// help was requested
|
||||
int Parse(bool showUsage = TRUE);
|
||||
|
||||
// give the usage message describing all program options
|
||||
void Usage();
|
||||
|
@@ -155,43 +155,56 @@ public:
|
||||
|
||||
// key access: returns TRUE if value was really read, FALSE if default used
|
||||
// (and if the key is not found the default value is returned.)
|
||||
|
||||
// read a string from the key
|
||||
virtual bool Read(const wxString& key, wxString *pStr) const = 0;
|
||||
virtual bool Read(const wxString& key, wxString *pStr, const wxString& defVal) const;
|
||||
bool Read(const wxString& key, wxString *pStr) const;
|
||||
bool Read(const wxString& key, wxString *pStr, const wxString& defVal) const;
|
||||
|
||||
virtual wxString Read(const wxString& key, const wxString& defVal = wxEmptyString) const;
|
||||
// read a number (long)
|
||||
bool Read(const wxString& key, long *pl) const;
|
||||
bool Read(const wxString& key, long *pl, long defVal) const;
|
||||
|
||||
virtual bool Read(const wxString& key, long *pl) const = 0;
|
||||
virtual bool Read(const wxString& key, long *pl, long defVal) const;
|
||||
// read an int
|
||||
bool Read(const wxString& key, int *pi) const;
|
||||
bool Read(const wxString& key, int *pi, int defVal) const;
|
||||
|
||||
virtual long Read(const wxString& strKey, long defVal) const
|
||||
{ long l; Read(strKey, &l, defVal); return l; }
|
||||
// read a double
|
||||
bool Read(const wxString& key, double* val) const;
|
||||
bool Read(const wxString& key, double* val, double defVal) const;
|
||||
|
||||
// Convenience functions that are built on other forms
|
||||
// read a bool
|
||||
bool Read(const wxString& key, bool* val) const;
|
||||
bool Read(const wxString& key, bool* val, bool defVal) const;
|
||||
|
||||
// int
|
||||
virtual bool Read(const wxString& key, int *pi) const;
|
||||
virtual bool Read(const wxString& key, int *pi, int defVal) const;
|
||||
// convenience functions returning directly the value (we don't have them for
|
||||
// int/double/bool as there would be ambiguities with the long one then)
|
||||
wxString Read(const wxString& key,
|
||||
const wxString& defVal = wxEmptyString) const
|
||||
{ wxString s; (void)Read(key, &s, defVal); return s; }
|
||||
|
||||
// double
|
||||
virtual bool Read(const wxString& key, double* val) const;
|
||||
virtual bool Read(const wxString& key, double* val, double defVal) const;
|
||||
|
||||
// bool
|
||||
virtual bool Read(const wxString& key, bool* val) const;
|
||||
virtual bool Read(const wxString& key, bool* val, bool defVal) const;
|
||||
long Read(const wxString& key, long defVal) const
|
||||
{ long l; (void)Read(key, &l, defVal); return l; }
|
||||
|
||||
// write the value (return true on success)
|
||||
virtual bool Write(const wxString& key, const wxString& value) = 0;
|
||||
virtual bool Write(const wxString& key, long value) = 0;
|
||||
bool Write(const wxString& key, const wxString& value)
|
||||
{ return DoWriteString(key, value); }
|
||||
|
||||
// convenience functions
|
||||
virtual bool Write(const wxString& key, double value);
|
||||
virtual bool Write(const wxString& key, bool value);
|
||||
bool Write(const wxString& key, long value)
|
||||
{ return DoWriteLong(key, value); }
|
||||
|
||||
bool Write(const wxString& key, int value)
|
||||
{ return DoWriteInt(key, value); }
|
||||
|
||||
bool Write(const wxString& key, double value)
|
||||
{ return DoWriteDouble(key, value); }
|
||||
|
||||
bool Write(const wxString& key, bool value)
|
||||
{ return DoWriteBool(key, value); }
|
||||
|
||||
// we have to provide a separate version for C strings as otherwise they
|
||||
// would be converted to bool and not to wxString as expected!
|
||||
virtual bool Write(const wxString& key, const wxChar *value);
|
||||
bool Write(const wxString& key, const wxChar *value)
|
||||
{ return Write(key, wxString(value)); }
|
||||
|
||||
// permanently writes all changes
|
||||
virtual bool Flush(bool bCurrentOnly = FALSE) = 0;
|
||||
@@ -242,6 +255,19 @@ protected:
|
||||
static bool IsImmutable(const wxString& key)
|
||||
{ return !key.IsEmpty() && key[0] == wxCONFIG_IMMUTABLE_PREFIX; }
|
||||
|
||||
// do read/write the values of different types
|
||||
virtual bool DoReadString(const wxString& key, wxString *pStr) const = 0;
|
||||
virtual bool DoReadLong(const wxString& key, long *pl) const = 0;
|
||||
virtual bool DoReadInt(const wxString& key, int *pi) const;
|
||||
virtual bool DoReadDouble(const wxString& key, double* val) const;
|
||||
virtual bool DoReadBool(const wxString& key, bool* val) const;
|
||||
|
||||
virtual bool DoWriteString(const wxString& key, const wxString& value) = 0;
|
||||
virtual bool DoWriteLong(const wxString& key, long value) = 0;
|
||||
virtual bool DoWriteInt(const wxString& key, int value);
|
||||
virtual bool DoWriteDouble(const wxString& key, double value);
|
||||
virtual bool DoWriteBool(const wxString& key, bool value);
|
||||
|
||||
private:
|
||||
// are we doing automatic environment variable expansion?
|
||||
bool m_bExpandEnvVars;
|
||||
@@ -260,27 +286,27 @@ private:
|
||||
long m_style;
|
||||
};
|
||||
|
||||
// a handy little class which changes current path to the path of given entry
|
||||
// and restores it in dtor: so if you declare a local variable of this type,
|
||||
// you work in the entry directory and the path is automatically restored
|
||||
// when the function returns
|
||||
// Taken out of wxConfig since not all compilers can cope with nested classes.
|
||||
class wxConfigPathChanger
|
||||
{
|
||||
public:
|
||||
// ctor/dtor do path changing/restorin
|
||||
wxConfigPathChanger(const wxConfigBase *pContainer, const wxString& strEntry);
|
||||
~wxConfigPathChanger();
|
||||
// a handy little class which changes current path to the path of given entry
|
||||
// and restores it in dtor: so if you declare a local variable of this type,
|
||||
// you work in the entry directory and the path is automatically restored
|
||||
// when the function returns
|
||||
// Taken out of wxConfig since not all compilers can cope with nested classes.
|
||||
class wxConfigPathChanger
|
||||
{
|
||||
public:
|
||||
// ctor/dtor do path changing/restorin
|
||||
wxConfigPathChanger(const wxConfigBase *pContainer, const wxString& strEntry);
|
||||
~wxConfigPathChanger();
|
||||
|
||||
// get the key name
|
||||
const wxString& Name() const { return m_strName; }
|
||||
// get the key name
|
||||
const wxString& Name() const { return m_strName; }
|
||||
|
||||
private:
|
||||
wxConfigBase *m_pContainer; // object we live in
|
||||
wxString m_strName, // name of entry (i.e. name only)
|
||||
m_strOldPath; // saved path
|
||||
bool m_bChanged; // was the path changed?
|
||||
};
|
||||
private:
|
||||
wxConfigBase *m_pContainer; // object we live in
|
||||
wxString m_strName, // name of entry (i.e. name only)
|
||||
m_strOldPath; // saved path
|
||||
bool m_bChanged; // was the path changed?
|
||||
};
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -180,6 +180,23 @@ typedef short int WXTYPE;
|
||||
// because -1 is a valid (and largely used) value for window id.
|
||||
typedef int wxWindowID;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// other feature tests
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Every ride down a slippery slope begins with a single step..
|
||||
//
|
||||
// Yes, using nested classes is indeed against our coding standards in
|
||||
// general, but there are places where you can use them to advantage
|
||||
// without totally breaking ports that cannot use them. If you do, then
|
||||
// wrap it in this guard, but such cases should still be relatively rare.
|
||||
|
||||
#ifndef __WIN16__
|
||||
#define wxUSE_NESTED_CLASSES 1
|
||||
#else
|
||||
#define wxUSE_NESTED_CLASSES 0
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// portable calling conventions macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -18,6 +18,8 @@
|
||||
|
||||
#if wxUSE_DIALUP_MANAGER
|
||||
|
||||
#include "wx/event.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// misc
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -96,11 +96,6 @@ public:
|
||||
virtual wxInputStream& LoadObject(wxInputStream& stream);
|
||||
#endif
|
||||
|
||||
#if wxUSE_SERIAL
|
||||
// need this to keep from hiding the virtual from wxObject
|
||||
virtual void LoadObject(wxObjectInputStream& stream) { wxObject::LoadObject(stream); };
|
||||
#endif
|
||||
|
||||
// Called by wxWindows
|
||||
virtual bool OnSaveDocument(const wxString& filename);
|
||||
virtual bool OnOpenDocument(const wxString& filename);
|
||||
|
@@ -18,7 +18,11 @@
|
||||
|
||||
#include "wx/setup.h"
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
#if wxUSE_DYNAMIC_LOADER
|
||||
|
||||
#include "wx/dynload.h" // Use the new (version of) wxDynamicLibrary instead
|
||||
|
||||
#elif wxUSE_DYNLIB_CLASS
|
||||
|
||||
#include "wx/string.h"
|
||||
#include "wx/list.h"
|
||||
@@ -85,7 +89,7 @@ public:
|
||||
if success pointer is not NULL, it will be filled with TRUE if everything
|
||||
went ok and FALSE otherwise
|
||||
*/
|
||||
static wxDllType LoadLibrary(const wxString& libname, bool *success = NULL);
|
||||
static wxDllType LoadLibrary(const wxString& libname, bool *success = 0);
|
||||
|
||||
/*
|
||||
This function unloads the shared library previously loaded with
|
||||
@@ -109,14 +113,15 @@ public:
|
||||
|
||||
Returns the pointer to the symbol or NULL on error.
|
||||
*/
|
||||
static void * GetSymbol(wxDllType dllHandle, const wxString &name);
|
||||
static void *GetSymbol(wxDllType dllHandle, const wxString &name, bool success = 0);
|
||||
|
||||
// return the standard DLL extension (with leading dot) for this platform
|
||||
static wxString GetDllExt();
|
||||
static const wxString &GetDllExt() { return ms_dllext; }
|
||||
|
||||
private:
|
||||
// forbid construction of objects
|
||||
wxDllLoader();
|
||||
static const wxString ms_dllext;
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
207
include/wx/dynload.h
Normal file
207
include/wx/dynload.h
Normal file
@@ -0,0 +1,207 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dynload.h
|
||||
// Purpose: Dynamic loading framework
|
||||
// Author: Ron Lee, David Falkinder, Vadim Zeitlin and a cast of 1000's
|
||||
// (derived in part from dynlib.cpp (c) 1998 Guilhem Lavaux)
|
||||
// Modified by:
|
||||
// Created: 03/12/01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2001 Ron Lee <ron@debian.org>
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef _WX_DYNAMICLOADER_H__
|
||||
#define _WX_DYNAMICLOADER_H__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "dynload.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_DYNAMIC_LOADER
|
||||
|
||||
#include "wx/hash.h"
|
||||
#include "wx/module.h"
|
||||
|
||||
|
||||
// Ugh, I'd much rather this was typesafe, but no time
|
||||
// to rewrite wxHashTable right now..
|
||||
|
||||
typedef wxHashTable wxDLManifest;
|
||||
typedef wxHashTable wxDLImports;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// conditional compilation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Note: WXPM/EMX has to be tested first, since we want to use
|
||||
// native version, even if configure detected presence of DLOPEN.
|
||||
|
||||
#if defined(__WXPM__) || defined(__EMX__)
|
||||
#define INCL_DOS
|
||||
#include <os2.h>
|
||||
typedef HMODULE wxDllType;
|
||||
#elif defined(HAVE_DLOPEN)
|
||||
#include <dlfcn.h>
|
||||
typedef void *wxDllType;
|
||||
#elif defined(HAVE_SHL_LOAD)
|
||||
#include <dl.h>
|
||||
typedef shl_t wxDllType;
|
||||
#elif defined(__WINDOWS__)
|
||||
#include <windows.h> // needed to get HMODULE
|
||||
typedef HMODULE wxDllType;
|
||||
#elif defined(__DARWIN__)
|
||||
typedef void *wxDllType;
|
||||
#elif defined(__WXMAC__)
|
||||
typedef CFragConnectionID wxDllType;
|
||||
#else
|
||||
#error "wxLibrary can't be compiled on this platform, sorry."
|
||||
#endif
|
||||
|
||||
// LoadLibrary is defined in windows.h as LoadLibraryA, but wxDllLoader
|
||||
// method should be called LoadLibrary, not LoadLibraryA or LoadLibraryW!
|
||||
|
||||
#if defined(__WIN32__) && defined(LoadLibrary)
|
||||
# include "wx/msw/winundef.h"
|
||||
#endif
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxDllLoader
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// Cross platform wrapper for dlopen and friends.
|
||||
// There are no instances of this class, it simply
|
||||
// serves as a namespace for its static member functions.
|
||||
|
||||
class WXDLLEXPORT wxDllLoader
|
||||
{
|
||||
public:
|
||||
|
||||
// libname may be either the full path to the file or just the filename
|
||||
// in which case the library is searched for in all standard locations.
|
||||
// The platform specific library extension is automatically appended.
|
||||
|
||||
static wxDllType Load(const wxString& name);
|
||||
|
||||
// The same as Load, except 'name' is searched for without modification.
|
||||
|
||||
static wxDllType LoadLibrary(const wxString& name);
|
||||
static void UnloadLibrary(wxDllType dll);
|
||||
|
||||
// return a valid handle for the main program itself or NULL if
|
||||
// back linking is not supported by the current platform (e.g. Win32)
|
||||
|
||||
static wxDllType GetProgramHandle();
|
||||
|
||||
// resolve a symbol in a loaded DLL, such as a variable or function
|
||||
// name. dllHandle is a handle previously returned by LoadLibrary(),
|
||||
// symbol is the (possibly mangled) name of the symbol.
|
||||
// (use extern "C" to export unmangled names)
|
||||
//
|
||||
// Since it is perfectly valid for the returned symbol to actually be
|
||||
// NULL, that is not always indication of an error. Pass and test the
|
||||
// parameter 'success' for a true indication of success or failure to
|
||||
// load the symbol.
|
||||
//
|
||||
// Returns a pointer to the symbol on success.
|
||||
|
||||
static void *GetSymbol(wxDllType dllHandle, const wxString &name, bool *success = 0);
|
||||
|
||||
// return the platform standard DLL extension (with leading dot)
|
||||
|
||||
static const wxString &GetDllExt() { return ms_dllext; }
|
||||
|
||||
private:
|
||||
|
||||
wxDllLoader(); // forbid construction of objects
|
||||
static const wxString ms_dllext; // Platform specific shared lib suffix.
|
||||
};
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxDynamicLibrary
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
class wxDLManifestEntry
|
||||
{
|
||||
public:
|
||||
|
||||
static wxDLImports ms_classes; // Static hash of all imported classes.
|
||||
|
||||
wxDLManifestEntry( const wxString &libname );
|
||||
~wxDLManifestEntry();
|
||||
|
||||
wxDLManifestEntry *Ref() { ++m_count; return this; }
|
||||
bool Unref() { return (m_count-- < 2) ? (delete this, TRUE) : FALSE; }
|
||||
|
||||
bool IsLoaded() const { return m_count > 0; }
|
||||
|
||||
wxDllType GetLinkHandle() const { return m_handle; }
|
||||
wxDllType GetProgramHandle() const { return wxDllLoader::GetProgramHandle(); }
|
||||
void *GetSymbol(const wxString &symbol, bool *success = 0)
|
||||
{
|
||||
return wxDllLoader::GetSymbol( m_handle, symbol, success );
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
// Order of these three *is* important, do not change it
|
||||
|
||||
wxClassInfo *m_before; // sm_first before loading this lib
|
||||
wxDllType m_handle; // Handle from dlopen.
|
||||
wxClassInfo *m_after; // ..and after.
|
||||
|
||||
size_t m_count; // Ref count of Link and Create calls.
|
||||
wxModuleList m_wxmodules; // any wxModules that we initialised.
|
||||
|
||||
void UpdateClassInfo(); // Update the wxClassInfo table
|
||||
void RestoreClassInfo(); // Restore the original wxClassInfo state.
|
||||
void RegisterModules(); // Init any wxModules in the lib.
|
||||
void UnregisterModules(); // Cleanup any wxModules we installed.
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxDLManifestEntry)
|
||||
};
|
||||
|
||||
|
||||
class WXDLLEXPORT wxDynamicLibrary
|
||||
{
|
||||
public:
|
||||
|
||||
// Static accessors.
|
||||
|
||||
static wxDLManifestEntry *Link(const wxString &libname);
|
||||
static bool Unlink(const wxString &libname);
|
||||
|
||||
// Instance methods.
|
||||
|
||||
wxDynamicLibrary(const wxString &libname);
|
||||
~wxDynamicLibrary();
|
||||
|
||||
bool IsLoaded() const { return m_entry && m_entry->IsLoaded(); }
|
||||
void *GetSymbol(const wxString &symbol, bool *success = 0)
|
||||
{
|
||||
return m_entry->GetSymbol( symbol, success );
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
static wxDLManifest ms_manifest; // Static hash of loaded libs.
|
||||
wxDLManifestEntry *m_entry; // Cache our entry in the manifest.
|
||||
|
||||
// We could allow this class to be copied if we really
|
||||
// wanted to, but not without modification.
|
||||
|
||||
DECLARE_NO_COPY_CLASS(wxDynamicLibrary)
|
||||
};
|
||||
|
||||
|
||||
#endif // wxUSE_DYNAMIC_LOADER
|
||||
#endif // _WX_DYNAMICLOADER_H__
|
||||
|
||||
// vi:sts=4:sw=4:et
|
@@ -95,6 +95,7 @@
|
||||
class WXDLLEXPORT wxFileConfigGroup;
|
||||
class WXDLLEXPORT wxFileConfigEntry;
|
||||
class WXDLLEXPORT wxFileConfigLineList;
|
||||
class WXDLLEXPORT wxInputStream;
|
||||
|
||||
class WXDLLEXPORT wxFileConfig : public wxConfigBase
|
||||
{
|
||||
@@ -152,39 +153,6 @@ public:
|
||||
virtual bool HasGroup(const wxString& strName) const;
|
||||
virtual bool HasEntry(const wxString& strName) const;
|
||||
|
||||
virtual bool Read(const wxString& key, wxString *pStr) const;
|
||||
virtual bool Read(const wxString& key, wxString *pStr, const wxString& defValue) const;
|
||||
virtual bool Read(const wxString& key, long *pl) const;
|
||||
|
||||
// The following are necessary to satisfy the compiler
|
||||
wxString Read(const wxString& key, const wxString& defVal) const
|
||||
{ return wxConfigBase::Read(key, defVal); }
|
||||
bool Read(const wxString& key, long *pl, long defVal) const
|
||||
{ return wxConfigBase::Read(key, pl, defVal); }
|
||||
long Read(const wxString& key, long defVal) const
|
||||
{ return wxConfigBase::Read(key, defVal); }
|
||||
bool Read(const wxString& key, int *pi, int defVal) const
|
||||
{ return wxConfigBase::Read(key, pi, defVal); }
|
||||
bool Read(const wxString& key, int *pi) const
|
||||
{ return wxConfigBase::Read(key, pi); }
|
||||
bool Read(const wxString& key, double* val) const
|
||||
{ return wxConfigBase::Read(key, val); }
|
||||
bool Read(const wxString& key, double* val, double defVal) const
|
||||
{ return wxConfigBase::Read(key, val, defVal); }
|
||||
bool Read(const wxString& key, bool* val) const
|
||||
{ return wxConfigBase::Read(key, val); }
|
||||
bool Read(const wxString& key, bool* val, bool defVal) const
|
||||
{ return wxConfigBase::Read(key, val, defVal); }
|
||||
|
||||
virtual bool Write(const wxString& key, const wxString& szValue);
|
||||
virtual bool Write(const wxString& key, long lValue);
|
||||
bool Write(const wxString& key, double value)
|
||||
{ return wxConfigBase::Write(key, value); }
|
||||
bool Write(const wxString& key, bool value)
|
||||
{ return wxConfigBase::Write(key, value); }
|
||||
bool Write(const wxString& key, const wxChar* value)
|
||||
{ return wxConfigBase::Write(key, value); }
|
||||
|
||||
virtual bool Flush(bool bCurrentOnly = FALSE);
|
||||
|
||||
virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
|
||||
@@ -202,6 +170,13 @@ public:
|
||||
void LineListRemove(wxFileConfigLineList *pLine);
|
||||
bool LineListIsEmpty();
|
||||
|
||||
protected:
|
||||
virtual bool DoReadString(const wxString& key, wxString *pStr) const;
|
||||
virtual bool DoReadLong(const wxString& key, long *pl) const;
|
||||
|
||||
virtual bool DoWriteString(const wxString& key, const wxString& szValue);
|
||||
virtual bool DoWriteLong(const wxString& key, long lValue);
|
||||
|
||||
private:
|
||||
// GetXXXFileName helpers: return ('/' terminated) directory names
|
||||
static wxString GetGlobalDir();
|
||||
|
@@ -38,6 +38,8 @@
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/datetime.h"
|
||||
|
||||
class WXDLLEXPORT wxFile;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// constants
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -208,9 +210,12 @@ public:
|
||||
void AssignHomeDir();
|
||||
static wxString GetHomeDir();
|
||||
|
||||
// get a temp file name starting with the specified prefix
|
||||
void AssignTempFileName(const wxString& prefix);
|
||||
static wxString CreateTempFileName(const wxString& prefix);
|
||||
// get a temp file name starting with the specified prefix and open the
|
||||
// file passed to us using this name for writing (atomically if
|
||||
// possible)
|
||||
void AssignTempFileName(const wxString& prefix, wxFile *fileTemp = NULL);
|
||||
static wxString CreateTempFileName(const wxString& prefix,
|
||||
wxFile *fileTemp = NULL);
|
||||
|
||||
// directory creation and removal.
|
||||
// if full is TRUE, will try to make each directory in the path.
|
||||
@@ -260,11 +265,12 @@ public:
|
||||
static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
|
||||
|
||||
// is this filename absolute?
|
||||
bool IsAbsolute( wxPathFormat format = wxPATH_NATIVE );
|
||||
bool IsAbsolute() const
|
||||
{ return !m_relative; }
|
||||
|
||||
// is this filename relative?
|
||||
bool IsRelative( wxPathFormat format = wxPATH_NATIVE )
|
||||
{ return !IsAbsolute(format); }
|
||||
bool IsRelative() const
|
||||
{ return m_relative; }
|
||||
|
||||
// Information about path format
|
||||
|
||||
@@ -354,6 +360,9 @@ private:
|
||||
// the file name and extension (empty for directories)
|
||||
wxString m_name,
|
||||
m_ext;
|
||||
|
||||
// is the path relative
|
||||
bool m_relative;
|
||||
};
|
||||
|
||||
#endif // _WX_FILENAME_H_
|
||||
|
@@ -382,6 +382,8 @@ protected:
|
||||
|
||||
wxTimer *m_renameTimer;
|
||||
wxString m_renameRes;
|
||||
|
||||
wxBitmap *m_arrowRight,*m_arrowDown;
|
||||
|
||||
// the common part of all ctors
|
||||
void Init();
|
||||
|
@@ -332,10 +332,6 @@
|
||||
* Use streams
|
||||
*/
|
||||
#define wxUSE_STREAMS 1
|
||||
/*
|
||||
* Use class serialization
|
||||
*/
|
||||
#define wxUSE_SERIAL 1
|
||||
/*
|
||||
* Use sockets
|
||||
*/
|
||||
@@ -345,10 +341,6 @@
|
||||
* streams implementation.
|
||||
*/
|
||||
#define wxUSE_STD_IOSTREAM 0
|
||||
/*
|
||||
* wxLibrary class
|
||||
*/
|
||||
#define wxUSE_DYNLIB_CLASS 1
|
||||
|
||||
/*
|
||||
* Use font metric files in GetTextExtent for wxPostScriptDC
|
||||
@@ -418,9 +410,9 @@
|
||||
*/
|
||||
#define wxUSE_SPLINES 1
|
||||
/*
|
||||
* Use wxLibrary class
|
||||
* Use wxObjectLoader class
|
||||
*/
|
||||
#define wxUSE_DYNLIB_CLASS 1
|
||||
#define wxUSE_DYNAMIC_LOADER 1
|
||||
|
||||
/*
|
||||
* Use the mdi architecture
|
||||
|
@@ -332,10 +332,6 @@
|
||||
* Use streams
|
||||
*/
|
||||
#define wxUSE_STREAMS 1
|
||||
/*
|
||||
* Use class serialization
|
||||
*/
|
||||
#define wxUSE_SERIAL 1
|
||||
/*
|
||||
* Use sockets
|
||||
*/
|
||||
@@ -345,10 +341,6 @@
|
||||
* streams implementation.
|
||||
*/
|
||||
#define wxUSE_STD_IOSTREAM 0
|
||||
/*
|
||||
* wxLibrary class
|
||||
*/
|
||||
#define wxUSE_DYNLIB_CLASS 1
|
||||
|
||||
/*
|
||||
* Use font metric files in GetTextExtent for wxPostScriptDC
|
||||
@@ -418,9 +410,9 @@
|
||||
*/
|
||||
#define wxUSE_SPLINES 1
|
||||
/*
|
||||
* Use wxLibrary class
|
||||
* Use wxObjectLoader class
|
||||
*/
|
||||
#define wxUSE_DYNLIB_CLASS 1
|
||||
#define wxUSE_DYNAMIC_LOADER 1
|
||||
|
||||
/*
|
||||
* Use the mdi architecture
|
||||
|
@@ -297,5 +297,8 @@ private:
|
||||
#define WX_DECLARE_EXPORTED_HASH(el, list, hash) \
|
||||
_WX_DECLARE_HASH(el, list, hash, class WXDLLEXPORT)
|
||||
|
||||
#define WX_DECLARE_USER_EXPORTED_HASH(el, list, hash, usergoo) \
|
||||
_WX_DECLARE_HASH(el, list, hash, class usergoo)
|
||||
|
||||
#endif
|
||||
// _WX_HASH_H__
|
||||
|
@@ -461,10 +461,18 @@ private:
|
||||
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
|
||||
WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, class WXDLLEXPORT)
|
||||
|
||||
#define WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo) \
|
||||
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
|
||||
WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, class usergoo)
|
||||
|
||||
// this macro must be inserted in your program after
|
||||
// #include <wx/listimpl.cpp>
|
||||
#define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!"
|
||||
|
||||
#define WX_DEFINE_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
|
||||
#define WX_DEFINE_USER_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
|
||||
|
||||
|
||||
// =============================================================================
|
||||
// now we can define classes 100% compatible with the old ones
|
||||
// =============================================================================
|
||||
|
@@ -543,11 +543,6 @@ DECLARE_LOG_FUNCTION2(SysError, long lErrCode);
|
||||
// debug only logging functions: use them with API name and error code
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifndef __TFILE__
|
||||
#define __XFILE__(x) Tx)
|
||||
#define __TFILE__ __XFILE__(__FILE__)
|
||||
#endif
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
// make life easier for people using VC++ IDE: clicking on the message
|
||||
// will take us immediately to the place of the failed API
|
||||
|
@@ -68,6 +68,8 @@
|
||||
#endif
|
||||
#elif defined(__VISAGECPP__) && __IBMCPP__ >= 400
|
||||
#define wxLongLong_t long long
|
||||
#elif defined(__DJGPP__) && __DJGPP__ >= 2
|
||||
#define wxLongLong_t long long
|
||||
#else // no native long long type
|
||||
// both warning and pragma warning are not portable, but at least an
|
||||
// unknown pragma should never be an error - except that, actually, some
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#define _WX_PRIVATE_H_
|
||||
|
||||
#include <mgraph.hpp>
|
||||
#include "pmapi.h"
|
||||
|
||||
class WXDLLEXPORT wxBitmap;
|
||||
|
||||
|
@@ -32,15 +32,20 @@ public:
|
||||
wxModule() {}
|
||||
virtual ~wxModule() {}
|
||||
|
||||
// if module init routine returns FALSE application will fail to startup
|
||||
// if module init routine returns FALSE application
|
||||
// will fail to startup
|
||||
|
||||
bool Init() { return OnInit(); }
|
||||
void Exit() { OnExit(); }
|
||||
|
||||
// Override both of these
|
||||
// Override both of these
|
||||
// called on program startup
|
||||
|
||||
virtual bool OnInit() = 0;
|
||||
// called just before program termination, but only if OnInit()
|
||||
|
||||
// called just before program termination, but only if OnInit()
|
||||
// succeeded
|
||||
|
||||
virtual void OnExit() = 0;
|
||||
|
||||
static void RegisterModule(wxModule* module);
|
||||
@@ -48,6 +53,10 @@ public:
|
||||
static bool InitializeModules();
|
||||
static void CleanUpModules();
|
||||
|
||||
// used by wxObjectLoader when unloading shared libs's
|
||||
|
||||
static void UnregisterModule(wxModule* module);
|
||||
|
||||
protected:
|
||||
static wxModuleList m_modules;
|
||||
|
||||
|
@@ -65,30 +65,6 @@ public:
|
||||
// return TRUE if the current group is empty
|
||||
bool IsEmpty() const;
|
||||
|
||||
// read/write
|
||||
bool Read(const wxString& key, wxString *pStr) const;
|
||||
bool Read(const wxString& key, wxString *pStr, const wxString& szDefault) const;
|
||||
bool Read(const wxString& key, long *plResult) const;
|
||||
|
||||
// The following are necessary to satisfy the compiler
|
||||
wxString Read(const wxString& key, const wxString& defVal) const
|
||||
{ return wxConfigBase::Read(key, defVal); }
|
||||
bool Read(const wxString& key, long *pl, long defVal) const
|
||||
{ return wxConfigBase::Read(key, pl, defVal); }
|
||||
long Read(const wxString& key, long defVal) const
|
||||
{ return wxConfigBase::Read(key, defVal); }
|
||||
bool Read(const wxString& key, int *pi, int defVal) const
|
||||
{ return wxConfigBase::Read(key, pi, defVal); }
|
||||
bool Read(const wxString& key, int *pi) const
|
||||
{ return wxConfigBase::Read(key, pi); }
|
||||
bool Read(const wxString& key, double* val) const
|
||||
{ return wxConfigBase::Read(key, val); }
|
||||
bool Read(const wxString& key, double* val, double defVal) const
|
||||
{ return wxConfigBase::Read(key, val, defVal); }
|
||||
|
||||
bool Write(const wxString& key, const wxString& szValue);
|
||||
bool Write(const wxString& key, long lValue);
|
||||
|
||||
virtual bool Flush(bool bCurrentOnly = FALSE);
|
||||
|
||||
virtual bool RenameEntry(const wxString& oldName, const wxString& newName);
|
||||
@@ -98,6 +74,14 @@ public:
|
||||
virtual bool DeleteGroup(const wxString& szKey);
|
||||
virtual bool DeleteAll();
|
||||
|
||||
protected:
|
||||
// read/write
|
||||
bool DoReadString(const wxString& key, wxString *pStr) const;
|
||||
bool DoReadLong(const wxString& key, long *plResult) const;
|
||||
|
||||
bool DoWriteString(const wxString& key, const wxString& szValue);
|
||||
bool DoWriteLong(const wxString& key, long lValue);
|
||||
|
||||
private:
|
||||
// helpers
|
||||
wxString GetPrivateKeyName(const wxString& szKey) const;
|
||||
|
@@ -391,6 +391,9 @@ WXDLLEXPORT extern wxString wxGetWindowClass(WXHWND hWnd);
|
||||
// is, for mainly historical reasons, signed)
|
||||
WXDLLEXPORT extern WXWORD wxGetWindowId(WXHWND hWnd);
|
||||
|
||||
// check if hWnd's WNDPROC is wndProc. Return true if yes, false if they are different
|
||||
extern bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc);
|
||||
|
||||
// Does this window style specify any border?
|
||||
inline bool wxStyleHasBorder(long style)
|
||||
{
|
||||
|
@@ -63,41 +63,6 @@ public:
|
||||
virtual size_t GetNumberOfEntries(bool bRecursive = FALSE) const;
|
||||
virtual size_t GetNumberOfGroups(bool bRecursive = FALSE) const;
|
||||
|
||||
// read/write
|
||||
bool Read(const wxString& key, wxString *pStr) const;
|
||||
bool Read(const wxString& key, wxString *pStr, const wxString& szDefault) const;
|
||||
wxString Read(const wxString& key, const wxString& defVal) const
|
||||
{ return wxConfigBase::Read(key, defVal); }
|
||||
|
||||
bool Read(const wxString& key, long *plResult) const;
|
||||
bool Read(const wxString& key, long *pl, long defVal) const
|
||||
{ return wxConfigBase::Read(key, pl, defVal); }
|
||||
long Read(const wxString& key, long defVal) const
|
||||
{ return wxConfigBase::Read(key, defVal); }
|
||||
|
||||
// The following are necessary to satisfy the compiler
|
||||
bool Read(const wxString& key, int *pi, int defVal) const
|
||||
{ return wxConfigBase::Read(key, pi, defVal); }
|
||||
bool Read(const wxString& key, int *pi) const
|
||||
{ return wxConfigBase::Read(key, pi); }
|
||||
|
||||
bool Read(const wxString& key, double* val, double defVal) const
|
||||
{ return wxConfigBase::Read(key, val, defVal); }
|
||||
bool Read(const wxString& key, double* val) const
|
||||
{ return wxConfigBase::Read(key, val); }
|
||||
|
||||
bool Read(const wxString& key, bool *pb, bool defVal) const
|
||||
{ return wxConfigBase::Read(key, pb, defVal); }
|
||||
bool Read(const wxString& key, bool *pb) const
|
||||
{ return wxConfigBase::Read(key, pb); }
|
||||
|
||||
bool Write(const wxString& key, const wxString& szValue);
|
||||
bool Write(const wxString& key, long lValue);
|
||||
bool Write(const wxString& key, double dValue)
|
||||
{ return wxConfigBase::Write(key, dValue); }
|
||||
bool Write(const wxString& key, bool bValue)
|
||||
{ return wxConfigBase::Write(key, bValue); }
|
||||
|
||||
virtual bool Flush(bool WXUNUSED(bCurrentOnly) = FALSE) { return TRUE; }
|
||||
|
||||
// rename
|
||||
@@ -124,6 +89,13 @@ protected:
|
||||
return self->m_keyLocal;
|
||||
}
|
||||
|
||||
// implement read/write methods
|
||||
virtual bool DoReadString(const wxString& key, wxString *pStr) const;
|
||||
virtual bool DoReadLong(const wxString& key, long *plResult) const;
|
||||
|
||||
virtual bool DoWriteString(const wxString& key, const wxString& szValue);
|
||||
virtual bool DoWriteLong(const wxString& key, long lValue);
|
||||
|
||||
private:
|
||||
// no copy ctor/assignment operator
|
||||
wxRegConfig(const wxRegConfig&);
|
||||
|
@@ -161,15 +161,27 @@
|
||||
// defined as wchar_t, wxString will use Unicode internally. If you set this
|
||||
// to 1, you must use wxT() macro for all literal strings in the program.
|
||||
//
|
||||
// Unicode is currently only fully supported under Windows NT/2000 (Windows 9x
|
||||
// Unicode is currently only fully supported under Windows NT/2000/XP (Windows 9x
|
||||
// doesn't support it and the programs compiled in Unicode mode will not run
|
||||
// under 9x).
|
||||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0 (unless you only plan to use Windows NT/2000)
|
||||
// Recommended setting: 0 (unless you only plan to use Windows NT/2000/XP)
|
||||
#define wxUSE_UNICODE 0
|
||||
|
||||
// Set wxUSE_UNICODE_MSLU to 1 if you want to compile wxWindows in Unicode mode
|
||||
// and be able to run compiled apps under Windows 9x as well as NT/2000/XP. This
|
||||
// setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see
|
||||
// http://www.microsoft.com/globaldev/Articles/mslu_announce.asp). Note that you
|
||||
// will have to modify the makefiles to include unicows.lib import library as the first
|
||||
// library.
|
||||
//
|
||||
// Default is 0
|
||||
//
|
||||
// Recommended setting: 0
|
||||
#define wxUSE_UNICODE_MSLU 0
|
||||
|
||||
// Setting wxUSE_WCHAR_T to 1 gives you some degree of Unicode support without
|
||||
// compiling the program in Unicode mode. More precisely, it will be possible
|
||||
// to construct wxString from a wide (Unicode) string and convert any wxString
|
||||
@@ -228,9 +240,6 @@
|
||||
// Use standard C++ streams if 1. If 0, use wxWin streams implementation.
|
||||
#define wxUSE_STD_IOSTREAM 0
|
||||
|
||||
// Use serialization (requires utils/serialize)
|
||||
#define wxUSE_SERIAL 0
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// non GUI features selection
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -333,14 +342,14 @@
|
||||
|
||||
// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows
|
||||
// to connect/disconnect from the network and be notified whenever the dial-up
|
||||
// network connection is established/terminated. Requires wxUSE_DYNLIB_CLASS.
|
||||
// network connection is established/terminated. Requires wxUSE_DYNAMIC_LOADER.
|
||||
//
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_DIALUP_MANAGER 1
|
||||
|
||||
// Compile in wxLibrary class for run-time DLL loading and function calling.
|
||||
// Compile in classes for run-time DLL loading and function calling.
|
||||
// Required by wxUSE_DIALUP_MANAGER.
|
||||
//
|
||||
// This setting is for Win32 only
|
||||
@@ -348,7 +357,7 @@
|
||||
// Default is 1.
|
||||
//
|
||||
// Recommended setting: 1
|
||||
#define wxUSE_DYNLIB_CLASS 1
|
||||
#define wxUSE_DYNAMIC_LOADER 1
|
||||
|
||||
// Set to 1 to use socket classes
|
||||
#define wxUSE_SOCKETS 1
|
||||
|
@@ -16,12 +16,8 @@
|
||||
#pragma interface "stattext.h"
|
||||
#endif
|
||||
|
||||
#include "wx/control.h"
|
||||
|
||||
class WXDLLEXPORT wxStaticText : public wxControl
|
||||
class WXDLLEXPORT wxStaticText : public wxStaticTextBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||
|
||||
public:
|
||||
wxStaticText() { }
|
||||
|
||||
@@ -44,18 +40,16 @@ public:
|
||||
long style = 0,
|
||||
const wxString& name = wxStaticTextNameStr);
|
||||
|
||||
// accessors
|
||||
void SetLabel(const wxString& label);
|
||||
bool SetFont( const wxFont &font );
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
|
||||
// callbacks
|
||||
virtual long MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
// override some methods to resize the window properly
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual bool SetFont( const wxFont &font );
|
||||
|
||||
protected:
|
||||
virtual void DoSetSize(int x, int y, int w, int h,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -400,6 +400,9 @@ protected:
|
||||
// SetImageList helper
|
||||
void SetAnyImageList(wxImageList *imageList, int which);
|
||||
|
||||
// refresh a single item
|
||||
void RefreshItem(const wxTreeItemId& item);
|
||||
|
||||
wxTextCtrl *m_textCtrl; // used while editing the item label
|
||||
wxImageList *m_imageListNormal, // images for tree elements
|
||||
*m_imageListState; // special images for app defined states
|
||||
|
@@ -2,10 +2,11 @@
|
||||
// Name: object.h
|
||||
// Purpose: wxObject class, plus run-time type information macros
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Modified by: Ron Lee
|
||||
// Created: 01/02/97
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Julian Smart and Markus Holzem
|
||||
// Copyright: (c) 1997 Julian Smart and Markus Holzem
|
||||
// (c) 2001 Ron Lee <ron@debian.org>
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -16,6 +17,10 @@
|
||||
#pragma interface "object.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/defs.h"
|
||||
#include "wx/memory.h"
|
||||
|
||||
@@ -23,135 +28,230 @@ class WXDLLEXPORT wxObject;
|
||||
|
||||
#if wxUSE_DYNAMIC_CLASSES
|
||||
|
||||
// #ifdef __GNUWIN32__
|
||||
// ----------------------------------------------------------------------------
|
||||
// conditional compilation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef GetClassName
|
||||
#undef GetClassName
|
||||
#endif
|
||||
#ifdef GetClassInfo
|
||||
#undef GetClassInfo
|
||||
#endif
|
||||
// #endif
|
||||
|
||||
class WXDLLEXPORT wxClassInfo;
|
||||
class WXDLLEXPORT wxInputStream;
|
||||
class WXDLLEXPORT wxOutputStream;
|
||||
class WXDLLEXPORT wxObjectInputStream;
|
||||
class WXDLLEXPORT wxObjectOutputStream;
|
||||
class WXDLLEXPORT wxHashTable;
|
||||
class WXDLLEXPORT wxObject_Serialize;
|
||||
|
||||
#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT)
|
||||
#include "wx/ioswrap.h"
|
||||
#include "wx/ioswrap.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dynamic object system declarations
|
||||
*/
|
||||
|
||||
typedef wxObject * (*wxObjectConstructorFn) (void);
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxClassInfo
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
typedef wxObject *(*wxObjectConstructorFn)(void);
|
||||
|
||||
class WXDLLEXPORT wxClassInfo
|
||||
{
|
||||
public:
|
||||
wxClassInfo(const wxChar *cName,
|
||||
const wxChar *baseName1,
|
||||
const wxChar *baseName2,
|
||||
int sz,
|
||||
wxObjectConstructorFn fn);
|
||||
wxClassInfo::wxClassInfo(const wxChar *className,
|
||||
const wxChar *baseName1,
|
||||
const wxChar *baseName2,
|
||||
int size,
|
||||
wxObjectConstructorFn ctor)
|
||||
: m_className(className)
|
||||
, m_baseClassName1(baseName1)
|
||||
, m_baseClassName2(baseName2)
|
||||
, m_objectSize(size)
|
||||
, m_objectConstructor(ctor)
|
||||
, m_baseInfo1(0)
|
||||
, m_baseInfo2(0)
|
||||
, m_next(sm_first)
|
||||
{ sm_first = this; }
|
||||
|
||||
wxObject *CreateObject(void);
|
||||
wxObject *CreateObject() { return m_objectConstructor ? (*m_objectConstructor)() : 0; }
|
||||
|
||||
const wxChar *GetClassName() const { return m_className; }
|
||||
const wxChar *GetBaseClassName1() const { return m_baseClassName1; }
|
||||
const wxChar *GetBaseClassName2() const { return m_baseClassName2; }
|
||||
const wxClassInfo* GetBaseClass1() const { return m_baseInfo1; }
|
||||
const wxClassInfo* GetBaseClass2() const { return m_baseInfo2; }
|
||||
int GetSize() const { return m_objectSize; }
|
||||
wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; }
|
||||
static const wxClassInfo* GetFirst() { return sm_first; }
|
||||
const wxClassInfo* GetNext() const { return m_next; }
|
||||
bool IsKindOf(const wxClassInfo *info) const;
|
||||
const wxChar *GetClassName() const { return m_className; }
|
||||
const wxChar *GetBaseClassName1() const { return m_baseClassName1; }
|
||||
const wxChar *GetBaseClassName2() const { return m_baseClassName2; }
|
||||
const wxClassInfo *GetBaseClass1() const { return m_baseInfo1; }
|
||||
const wxClassInfo *GetBaseClass2() const { return m_baseInfo2; }
|
||||
int GetSize() const { return m_objectSize; }
|
||||
|
||||
static wxClassInfo *FindClass(const wxChar *c);
|
||||
wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; }
|
||||
static const wxClassInfo *GetFirst() { return sm_first; }
|
||||
const wxClassInfo *GetNext() const { return m_next; }
|
||||
static wxClassInfo *FindClass(const wxChar *className);
|
||||
|
||||
// Climb upwards through inheritance hierarchy.
|
||||
// Dual inheritance is catered for.
|
||||
|
||||
// Initializes parent pointers and hash table for fast searching.
|
||||
static void InitializeClasses();
|
||||
bool IsKindOf(const wxClassInfo *info) const
|
||||
{
|
||||
return info != 0 &&
|
||||
( info == this ||
|
||||
( m_baseInfo1 && m_baseInfo1->IsKindOf(info) ) ||
|
||||
( m_baseInfo2 && m_baseInfo2->IsKindOf(info) ) );
|
||||
}
|
||||
|
||||
// Cleans up hash table used for fast searching.
|
||||
static void CleanUpClasses();
|
||||
// Initializes parent pointers and hash table for fast searching.
|
||||
|
||||
static void InitializeClasses();
|
||||
|
||||
// Cleans up hash table used for fast searching.
|
||||
|
||||
static void CleanUpClasses();
|
||||
|
||||
public:
|
||||
const wxChar* m_className;
|
||||
const wxChar* m_baseClassName1;
|
||||
const wxChar* m_baseClassName2;
|
||||
int m_objectSize;
|
||||
wxObjectConstructorFn m_objectConstructor;
|
||||
const wxChar *m_className;
|
||||
const wxChar *m_baseClassName1;
|
||||
const wxChar *m_baseClassName2;
|
||||
int m_objectSize;
|
||||
wxObjectConstructorFn m_objectConstructor;
|
||||
|
||||
// Pointers to base wxClassInfos: set in InitializeClasses
|
||||
const wxClassInfo* m_baseInfo1;
|
||||
const wxClassInfo* m_baseInfo2;
|
||||
// Pointers to base wxClassInfos: set in InitializeClasses
|
||||
|
||||
// class info object live in a linked list: pointers to its head and the
|
||||
// next element in it
|
||||
static wxClassInfo* sm_first;
|
||||
wxClassInfo* m_next;
|
||||
const wxClassInfo *m_baseInfo1;
|
||||
const wxClassInfo *m_baseInfo2;
|
||||
|
||||
static wxHashTable* sm_classTable;
|
||||
// class info object live in a linked list:
|
||||
// pointers to its head and the next element in it
|
||||
|
||||
static wxClassInfo *sm_first;
|
||||
wxClassInfo *m_next;
|
||||
|
||||
static wxHashTable *sm_classTable;
|
||||
};
|
||||
|
||||
WXDLLEXPORT wxObject* wxCreateDynamicObject(const wxChar *name);
|
||||
WXDLLEXPORT wxObject *wxCreateDynamicObject(const wxChar *name);
|
||||
|
||||
#if wxUSE_SERIAL
|
||||
WXDLLEXPORT wxObject* wxCreateStoredObject( wxInputStream& stream );
|
||||
#endif
|
||||
|
||||
#define DECLARE_DYNAMIC_CLASS(name) \
|
||||
public:\
|
||||
static wxClassInfo sm_class##name;\
|
||||
wxClassInfo *GetClassInfo() const \
|
||||
// ----------------------------------------------------------------------------
|
||||
// Dynamic class macros
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#define DECLARE_DYNAMIC_CLASS(name) \
|
||||
public: \
|
||||
static wxClassInfo sm_class##name; \
|
||||
virtual wxClassInfo *GetClassInfo() const \
|
||||
{ return &name::sm_class##name; }
|
||||
|
||||
#define DECLARE_ABSTRACT_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
|
||||
#define DECLARE_CLASS(name) DECLARE_DYNAMIC_CLASS(name)
|
||||
|
||||
//////
|
||||
////// for concrete classes
|
||||
//////
|
||||
// -----------------------------------
|
||||
// for concrete classes
|
||||
// -----------------------------------
|
||||
|
||||
// Single inheritance with one base class
|
||||
#define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
|
||||
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
||||
{ return new name; }\
|
||||
wxClassInfo name::sm_class##name((wxChar *) wxT(#name), (wxChar *) wxT(#basename), (wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
|
||||
// Single inheritance with one base class
|
||||
|
||||
// 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 *) wxT(#name), (wxChar *) wxT(#basename1), (wxChar *) wxT(#basename2), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name);
|
||||
#define IMPLEMENT_DYNAMIC_CLASS(name, basename) \
|
||||
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name() \
|
||||
{ return new name; } \
|
||||
wxClassInfo name::sm_class##name(wxT(#name), wxT(#basename), \
|
||||
0, (int) sizeof(name), \
|
||||
(wxObjectConstructorFn) wxConstructorFor##name);
|
||||
|
||||
//////
|
||||
////// for abstract classes
|
||||
//////
|
||||
// Multiple inheritance with two base classes
|
||||
|
||||
// Single inheritance with one base class
|
||||
#define IMPLEMENT_ABSTRACT_CLASS(name, basename) \
|
||||
wxClassInfo name::sm_class##name((wxChar *) wxT(#name), (wxChar *) wxT(#basename), \
|
||||
(wxChar *) NULL, (int) sizeof(name), (wxObjectConstructorFn) NULL);
|
||||
#define IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \
|
||||
wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name() \
|
||||
{ return new name; } \
|
||||
wxClassInfo name::sm_class##name(wxT(#name), wxT(#basename1), \
|
||||
wxT(#basename2), (int) sizeof(name), \
|
||||
(wxObjectConstructorFn) wxConstructorFor##name);
|
||||
|
||||
// Multiple inheritance with two base classes
|
||||
#define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
|
||||
wxClassInfo name::sm_class##name((wxChar *) wxT(#name), (wxChar *) wxT(#basename1), \
|
||||
(wxChar *) wxT(#basename2), (int) sizeof(name), (wxObjectConstructorFn) NULL);
|
||||
// -----------------------------------
|
||||
// for abstract classes
|
||||
// -----------------------------------
|
||||
|
||||
// Single inheritance with one base class
|
||||
|
||||
#define IMPLEMENT_ABSTRACT_CLASS(name, basename) \
|
||||
wxClassInfo name::sm_class##name(wxT(#name), wxT(#basename), \
|
||||
0, (int) sizeof(name), (wxObjectConstructorFn) 0);
|
||||
|
||||
// Multiple inheritance with two base classes
|
||||
|
||||
#define IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
|
||||
wxClassInfo name::sm_class##name(wxT(#name), wxT(#basename1), \
|
||||
wxT(#basename2), (int) sizeof(name), \
|
||||
(wxObjectConstructorFn) 0);
|
||||
|
||||
#define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
|
||||
#define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2
|
||||
|
||||
// -----------------------------------
|
||||
// for pluggable classes
|
||||
// -----------------------------------
|
||||
|
||||
// NOTE: this should probably be the very first statement
|
||||
// in the class declaration so wxPluginSentinel is
|
||||
// the first member initialised and the last destroyed.
|
||||
|
||||
// _DECLARE_DL_SENTINEL(name) wxPluginSentinel m_pluginsentinel;
|
||||
|
||||
#if wxUSE_NESTED_CLASSES
|
||||
|
||||
#if 0
|
||||
#define _DECLARE_DL_SENTINEL(name) \
|
||||
wxPluginSentinel m_pluginsentinel;
|
||||
|
||||
#else
|
||||
|
||||
#define _DECLARE_DL_SENTINEL(name) \
|
||||
class name##PluginSentinel { \
|
||||
private: \
|
||||
static const wxString sm_className; \
|
||||
public: \
|
||||
name##PluginSentinel(); \
|
||||
~##name##PluginSentinel(); \
|
||||
}; \
|
||||
name##PluginSentinel m_pluginsentinel;
|
||||
#endif
|
||||
|
||||
#define _IMPLEMENT_DL_SENTINEL(name) \
|
||||
const wxString name::name##PluginSentinel::sm_className(#name); \
|
||||
name::name##PluginSentinel::name##PluginSentinel() { \
|
||||
wxDLManifestEntry *e = (wxDLManifestEntry*) wxDLManifestEntry::ms_classes.Get(#name); \
|
||||
if( e != 0 ) { e->Ref(); } \
|
||||
} \
|
||||
name::name##PluginSentinel::~##name##PluginSentinel() { \
|
||||
wxDLManifestEntry *e = (wxDLManifestEntry*) wxDLManifestEntry::ms_classes.Get(#name); \
|
||||
if( e != 0 ) { wxCHECK_RET( !e->Unref(), _T("premature library unlinking") ); } \
|
||||
}
|
||||
#else
|
||||
|
||||
#define _DECLARE_DL_SENTINEL(name)
|
||||
#define _IMPLEMENT_DL_SENTINEL(name)
|
||||
|
||||
#endif // wxUSE_NESTED_CLASSES
|
||||
|
||||
#define DECLARE_PLUGGABLE_CLASS(name) \
|
||||
DECLARE_DYNAMIC_CLASS(name) _DECLARE_DL_SENTINEL(name)
|
||||
|
||||
#define DECLARE_ABSTRACT_PLUGGABLE_CLASS(name) \
|
||||
DECLARE_ABSTRACT_CLASS(name) _DECLARE_DL_SENTINEL(name)
|
||||
|
||||
#define IMPLEMENT_PLUGGABLE_CLASS(name, basename) \
|
||||
IMPLEMENT_DYNAMIC_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name)
|
||||
#define IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2) \
|
||||
IMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name)
|
||||
|
||||
#define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) \
|
||||
IMPLEMENT_ABSTRACT_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name)
|
||||
#define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \
|
||||
IMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name)
|
||||
|
||||
|
||||
#define CLASSINFO(name) (&name::sm_class##name)
|
||||
|
||||
#else // !wxUSE_DYNAMIC_CLASSES
|
||||
|
||||
// No dynamic class system: so stub out the macros
|
||||
// No dynamic class system: so stub out the macros
|
||||
|
||||
#define DECLARE_DYNAMIC_CLASS(name)
|
||||
#define DECLARE_ABSTRACT_CLASS(name)
|
||||
#define DECLARE_CLASS(name)
|
||||
@@ -162,137 +262,144 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \
|
||||
#define IMPLEMENT_CLASS IMPLEMENT_ABSTRACT_CLASS
|
||||
#define IMPLEMENT_CLASS2 IMPLEMENT_ABSTRACT_CLASS2
|
||||
|
||||
#endif // wxUSE_DYNAMIC_CLASSES/!wxUSE_DYNAMIC_CLASSES
|
||||
#define DECLARE_PLUGGABLE_CLASS(name)
|
||||
#define DECLARE_ABSTRACT_PLUGGABLE_CLASS(name)
|
||||
#define IMPLEMENT_PLUGGABLE_CLASS(name, basename)
|
||||
#define IMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2)
|
||||
#define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename)
|
||||
#define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2)
|
||||
|
||||
#endif // wxUSE_DYNAMIC_CLASSES
|
||||
|
||||
|
||||
#define wxIS_KIND_OF(obj, className) obj->IsKindOf(&className::sm_class##className)
|
||||
|
||||
// Just seems a bit nicer-looking (pretend it's not a macro)
|
||||
// Just seems a bit nicer-looking (pretend it's not a macro)
|
||||
|
||||
#define wxIsKindOf(obj, className) obj->IsKindOf(&className::sm_class##className)
|
||||
|
||||
// to be replaced by dynamic_cast<> in the future
|
||||
#define wxDynamicCast(obj, className) \
|
||||
(className *) wxCheckDynamicCast((wxObject*)(obj), &className::sm_class##className)
|
||||
// to be replaced by dynamic_cast<> in the future
|
||||
|
||||
#define wxDynamicCast(obj, className) \
|
||||
(className *) wxCheckDynamicCast((wxObject*)(obj), &className::sm_class##className)
|
||||
|
||||
// The 'this' pointer is always true, so use this version
|
||||
// to cast the this pointer and avoid compiler warnings.
|
||||
|
||||
// The 'this' pointer is always true, so use this version to cast the this
|
||||
// pointer and avoid compiler warnings.
|
||||
#define wxDynamicCastThis(className) \
|
||||
(IsKindOf(&className::sm_class##className) \
|
||||
? (className *)(this) \
|
||||
: (className *)0)
|
||||
(IsKindOf(&className::sm_class##className) ? (className *)(this) : (className *)0)
|
||||
|
||||
#define wxConstCast(obj, className) ((className *)(obj))
|
||||
|
||||
|
||||
#ifdef __WXDEBUG__
|
||||
inline void wxCheckCast(void *ptr)
|
||||
{
|
||||
wxASSERT_MSG( ptr, _T("wxStaticCast() used incorrectly") );
|
||||
}
|
||||
inline void wxCheckCast(void *ptr)
|
||||
{
|
||||
wxASSERT_MSG( ptr, _T("wxStaticCast() used incorrectly") );
|
||||
}
|
||||
#define wxStaticCast(obj, className) \
|
||||
(wxCheckCast(wxDynamicCast(obj, className)), ((className *)(obj)))
|
||||
|
||||
#define wxStaticCast(obj, className) \
|
||||
(wxCheckCast(wxDynamicCast(obj, className)), ((className *)(obj)))
|
||||
#else // !__WXDEBUG__
|
||||
#define wxStaticCast(obj, className) ((className *)(obj))
|
||||
|
||||
#else // !Debug
|
||||
#define wxStaticCast(obj, className) ((className *)(obj))
|
||||
#endif // Debug/!Debug
|
||||
#endif // __WXDEBUG__
|
||||
|
||||
// Unfortunately Borland seems to need this include.
|
||||
#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT)
|
||||
#ifdef __BORLANDC__
|
||||
#if wxUSE_IOSTREAMH
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
// Unfortunately Borland seems to need this include.
|
||||
|
||||
#if wxUSE_STD_IOSTREAM \
|
||||
&& (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) \
|
||||
&& defined(__BORLANDC__)
|
||||
#if wxUSE_IOSTREAMH
|
||||
#include <iostream.h>
|
||||
#else
|
||||
#include <iostream>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxObject
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
class WXDLLEXPORT wxObjectRefData;
|
||||
|
||||
class WXDLLEXPORT wxObject
|
||||
{
|
||||
public:
|
||||
DECLARE_ABSTRACT_CLASS(wxObject)
|
||||
|
||||
// This is equivalent to using the macro DECLARE_ABSTRACT_CLASS
|
||||
static wxClassInfo sm_classwxObject;
|
||||
public:
|
||||
wxObject() : m_refData(0) {}
|
||||
virtual ~wxObject() { UnRef(); }
|
||||
|
||||
wxObject(void);
|
||||
virtual ~wxObject(void);
|
||||
|
||||
virtual wxClassInfo *GetClassInfo(void) const { return &sm_classwxObject; }
|
||||
|
||||
bool IsKindOf(wxClassInfo *info) const;
|
||||
bool IsKindOf(wxClassInfo *info) const;
|
||||
|
||||
#if defined(__WXDEBUG__) && wxUSE_MEMORY_TRACING
|
||||
void * operator new (size_t size, wxChar * fileName = NULL, int lineNum = 0);
|
||||
# if defined(__VISAGECPP__)
|
||||
# if __DEBUG_ALLOC__
|
||||
void operator delete (void * buf,const char * _fname, size_t _line);
|
||||
# endif //__DEBUG_ALLOC__
|
||||
# else // Everybody else
|
||||
void operator delete (void * buf);
|
||||
# endif // end of VISAGECPP
|
||||
void *operator new (size_t size, wxChar *fileName = 0, int lineNum = 0);
|
||||
|
||||
// VC++ 6.0
|
||||
# if defined(__VISUALC__) && (__VISUALC__ >= 1200)
|
||||
#ifndef __VISAGECPP__
|
||||
void operator delete (void * buf);
|
||||
#elif __DEBUG_ALLOC__
|
||||
void operator delete (void *buf, const char *_fname, size_t _line);
|
||||
#endif
|
||||
|
||||
// VC++ 6.0
|
||||
|
||||
#if defined(__VISUALC__) && (__VISUALC__ >= 1200)
|
||||
void operator delete(void *buf, wxChar*, int);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Causes problems for VC++
|
||||
# if wxUSE_ARRAY_MEMORY_OPERATORS && !defined(__VISUALC__) && !defined( __MWERKS__)
|
||||
void * operator new[] (size_t size, wxChar * fileName = NULL, int lineNum = 0);
|
||||
void operator delete[] (void * buf);
|
||||
# endif
|
||||
|
||||
# ifdef __MWERKS__
|
||||
void * operator new[] (size_t size, wxChar * fileName , int lineNum = 0);
|
||||
void * operator new[] (size_t size) { return operator new[] ( size , NULL , 0 ) ; }
|
||||
void operator delete[] (void * buf);
|
||||
# endif
|
||||
#if wxUSE_ARRAY_MEMORY_OPERATORS && !defined(__VISUALC__) && !defined( __MWERKS__)
|
||||
void *operator new[] (size_t size, wxChar *fileName = 0, int lineNum = 0);
|
||||
void operator delete[] (void *buf);
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__
|
||||
void *operator new[] (size_t size, wxChar *fileName , int lineNum = 0);
|
||||
void *operator new[] (size_t size) { return operator new[] ( size, 0, 0 ) ; }
|
||||
void operator delete[] (void *buf);
|
||||
#endif
|
||||
|
||||
#endif // Debug & memory tracing
|
||||
|
||||
|
||||
#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT)
|
||||
virtual void Dump(wxSTD ostream& str);
|
||||
virtual void Dump(wxSTD ostream& str);
|
||||
#endif
|
||||
|
||||
#if wxUSE_SERIAL
|
||||
virtual void StoreObject( wxObjectOutputStream &stream );
|
||||
virtual void LoadObject( wxObjectInputStream &stream );
|
||||
#endif
|
||||
// make a 'clone' of the object
|
||||
|
||||
void Ref(const wxObject& clone);
|
||||
|
||||
// make a 'clone' of the object
|
||||
void Ref(const wxObject& clone);
|
||||
// destroy a reference
|
||||
|
||||
void UnRef();
|
||||
|
||||
// destroy a reference
|
||||
void UnRef(void);
|
||||
|
||||
inline wxObjectRefData *GetRefData(void) const { return m_refData; }
|
||||
inline void SetRefData(wxObjectRefData *data) { m_refData = data; }
|
||||
inline wxObjectRefData *GetRefData() const { return m_refData; }
|
||||
inline void SetRefData(wxObjectRefData *data) { m_refData = data; }
|
||||
|
||||
protected:
|
||||
wxObjectRefData* m_refData;
|
||||
#if wxUSE_SERIAL
|
||||
wxObject_Serialize* m_serialObj;
|
||||
#endif
|
||||
wxObjectRefData *m_refData;
|
||||
};
|
||||
|
||||
/*
|
||||
* wxObjectData
|
||||
*/
|
||||
|
||||
class WXDLLEXPORT wxObjectRefData {
|
||||
|
||||
class WXDLLEXPORT wxObjectRefData
|
||||
{
|
||||
friend class wxObject;
|
||||
|
||||
public:
|
||||
wxObjectRefData(void);
|
||||
virtual ~wxObjectRefData(void);
|
||||
wxObjectRefData() : m_count(1) {}
|
||||
virtual ~wxObjectRefData() {}
|
||||
|
||||
inline int GetRefCount(void) const { return m_count; }
|
||||
inline int GetRefCount() const { return m_count; }
|
||||
private:
|
||||
int m_count;
|
||||
};
|
||||
|
||||
|
||||
inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo)
|
||||
{
|
||||
return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : 0;
|
||||
@@ -306,15 +413,14 @@ inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo)
|
||||
#define WXDEBUG_NEW new
|
||||
#endif
|
||||
|
||||
// Redefine new to be the debugging version. This doesn't
|
||||
// work with all compilers, in which case you need to
|
||||
// use WXDEBUG_NEW explicitly if you wish to use the debugging version.
|
||||
// Redefine new to be the debugging version. This doesn't
|
||||
// work with all compilers, in which case you need to
|
||||
// use WXDEBUG_NEW explicitly if you wish to use the debugging version.
|
||||
|
||||
#if defined(__WXDEBUG__) && wxUSE_GLOBAL_MEMORY_OPERATORS && wxUSE_DEBUG_NEW_ALWAYS
|
||||
#define new new(__TFILE__,__LINE__)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
// _WX_OBJECTH__
|
||||
|
||||
#endif // _WX_OBJECTH__
|
||||
|
||||
// vi:sts=4:sw=4:et
|
||||
|
@@ -1,90 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: objstrm.h
|
||||
// Purpose: wxObjectStream classes
|
||||
// Author: Guilhem Lavaux
|
||||
// Modified by:
|
||||
// Created: 16/07/98
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 1998 Guilhem Lavaux
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _WX_WXOBJSTRM_H__
|
||||
#define _WX_WXOBJSTRM_H__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
#include "wx/defs.h"
|
||||
|
||||
#if wxUSE_STREAMS && wxUSE_SERIAL
|
||||
|
||||
#include "wx/object.h"
|
||||
#include "wx/string.h"
|
||||
#include "wx/stream.h"
|
||||
|
||||
class wxObjectStreamInfo : public wxObject {
|
||||
public:
|
||||
wxString object_name;
|
||||
int n_children, children_removed;
|
||||
wxList children;
|
||||
wxObjectStreamInfo *parent;
|
||||
wxObject *object;
|
||||
bool duplicate, recall;
|
||||
};
|
||||
|
||||
class wxObjectOutputStream : public wxFilterOutputStream {
|
||||
public:
|
||||
wxObjectOutputStream(wxOutputStream& s);
|
||||
|
||||
void AddChild(wxObject *obj);
|
||||
bool SaveObject(wxObject& obj);
|
||||
|
||||
bool FirstStage() const { return m_stage == 0; }
|
||||
|
||||
wxString GetObjectName(wxObject *obj);
|
||||
|
||||
protected:
|
||||
void WriteObjectDef(wxObjectStreamInfo& info);
|
||||
void ProcessObjectDef(wxObjectStreamInfo *info);
|
||||
void ProcessObjectData(wxObjectStreamInfo *info);
|
||||
|
||||
protected:
|
||||
int m_stage;
|
||||
bool m_saving;
|
||||
wxObjectStreamInfo *m_current_info;
|
||||
wxList m_saved_objs;
|
||||
};
|
||||
|
||||
class wxObjectInputStream : public wxFilterInputStream {
|
||||
public:
|
||||
wxObjectInputStream(wxInputStream& s);
|
||||
|
||||
bool SecondCall() const { return m_secondcall; }
|
||||
void Recall(bool on = TRUE) { m_current_info->recall = on; }
|
||||
|
||||
wxObject *GetChild(int no) const;
|
||||
wxObject *GetChild();
|
||||
int NumberOfChildren() const { return m_current_info->n_children; }
|
||||
void RemoveChildren(int nb);
|
||||
wxObject *GetParent() const;
|
||||
wxObject *LoadObject();
|
||||
|
||||
wxObject *SolveName(const wxString& objName) const;
|
||||
|
||||
protected:
|
||||
bool ReadObjectDef(wxObjectStreamInfo *info);
|
||||
wxObjectStreamInfo *ProcessObjectDef(wxObjectStreamInfo *info);
|
||||
void ProcessObjectData(wxObjectStreamInfo *info);
|
||||
|
||||
protected:
|
||||
bool m_secondcall;
|
||||
wxObjectStreamInfo *m_current_info;
|
||||
wxList m_solver;
|
||||
};
|
||||
|
||||
#endif
|
||||
// wxUSE_STREAMS && wxUSE_SERIAL
|
||||
|
||||
#endif
|
||||
// _WX_WXOBJSTRM_H__
|
@@ -18,52 +18,68 @@ WXDLLEXPORT_DATA(extern const char*) wxGaugeNameStr;
|
||||
|
||||
class WXDLLEXPORT wxGauge: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxGauge)
|
||||
public:
|
||||
inline wxGauge() { m_rangeMax = 0; m_gaugePos = 0; }
|
||||
public:
|
||||
inline wxGauge() { m_nRangeMax = 0; m_nGaugePos = 0; }
|
||||
|
||||
inline wxGauge(wxWindow *parent, wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
inline wxGauge( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,int nRange
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxGA_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
const wxString& name = wxGaugeNameStr)
|
||||
{
|
||||
Create(parent, id, range, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
int range,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxGA_HORIZONTAL,
|
||||
,const wxString& rsName = wxGaugeNameStr
|
||||
)
|
||||
{
|
||||
Create( pParent
|
||||
,vId
|
||||
,nRange
|
||||
,rPos
|
||||
,rSize
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,rValidator
|
||||
#endif
|
||||
const wxString& name = wxGaugeNameStr);
|
||||
|
||||
void SetShadowWidth(int w);
|
||||
void SetBezelFace(int w);
|
||||
void SetRange(int r);
|
||||
void SetValue(int pos);
|
||||
|
||||
int GetShadowWidth() const ;
|
||||
int GetBezelFace() const ;
|
||||
int GetRange() const ;
|
||||
int GetValue() const ;
|
||||
|
||||
bool SetForegroundColour(const wxColour& col);
|
||||
bool SetBackgroundColour(const wxColour& col);
|
||||
|
||||
virtual void Command(wxCommandEvent& WXUNUSED(event)) {} ;
|
||||
|
||||
protected:
|
||||
int m_rangeMax;
|
||||
int m_gaugePos;
|
||||
};
|
||||
,rsName
|
||||
);
|
||||
}
|
||||
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,int nRange
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxGA_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
// _WX_GAUGE_H_
|
||||
,const wxString& rsName = wxGaugeNameStr
|
||||
);
|
||||
|
||||
int GetShadowWidth(void) const;
|
||||
int GetBezelFace(void) const;
|
||||
int GetRange(void) const;
|
||||
int GetValue(void) const;
|
||||
|
||||
bool SetBackgroundColour(const wxColour& rColour);
|
||||
void SetBezelFace(int nWidth);
|
||||
bool SetForegroundColour(const wxColour& rColour);
|
||||
void SetRange(int nRange);
|
||||
void SetShadowWidth(int nWidth);
|
||||
void SetValue(int nPos);
|
||||
|
||||
inline virtual bool AcceptsFocus(void) const { return FALSE; }
|
||||
inline virtual void Command(wxCommandEvent& WXUNUSED(rEvent)) {};
|
||||
|
||||
protected:
|
||||
int m_nRangeMax;
|
||||
int m_nGaugePos;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxGauge)
|
||||
}; // end of CLASS wxGauge
|
||||
|
||||
#endif // _WX_GAUGE_H_
|
||||
|
||||
|
@@ -232,6 +232,10 @@ inline bool wxStyleHasBorder(long style)
|
||||
wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0;
|
||||
}
|
||||
|
||||
WXDLLEXPORT extern void wxOS2SetFont( HWND hWnd
|
||||
,const wxFont& rFont
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
// _WX_PRIVATE_H_
|
||||
|
@@ -19,105 +19,168 @@ class WXDLLEXPORT wxBitmap ;
|
||||
|
||||
class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||
public:
|
||||
wxRadioBox();
|
||||
wxRadioBox();
|
||||
|
||||
inline wxRadioBox(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||
inline wxRadioBox( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsTitle
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,int nNum = 0
|
||||
,const wxString asChoices[] = NULL
|
||||
,int nMajorDim = 0
|
||||
,long lStyle = wxRA_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr)
|
||||
,const wxValidator& rVal = wxDefaultValidator
|
||||
#endif
|
||||
{
|
||||
Create(parent, id, title, pos, size, n, choices, majorDim, style, val, name);
|
||||
}
|
||||
|
||||
~wxRadioBox();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
int n = 0, const wxString choices[] = NULL,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL,
|
||||
,const wxString& rsName = wxRadioBoxNameStr
|
||||
)
|
||||
{
|
||||
Create( pParent
|
||||
,vId
|
||||
,rsTitle
|
||||
,rPos
|
||||
,rSize
|
||||
,nNum
|
||||
,asChoices
|
||||
,nMajorDim
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr);
|
||||
,rVal
|
||||
#endif
|
||||
,rsName
|
||||
);
|
||||
}
|
||||
|
||||
virtual bool OS2Command(WXUINT param, WXWORD id);
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
~wxRadioBox();
|
||||
|
||||
int FindString(const wxString& s) const;
|
||||
void SetSelection(int N);
|
||||
int GetSelection() const;
|
||||
virtual int GetCount() const;
|
||||
wxString GetString(int N) const;
|
||||
virtual void SetString(int n, const wxString& label);
|
||||
virtual int GetColumnCount() const;
|
||||
virtual int GetRowCount() const;
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsTitle
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,int nNum = 0
|
||||
,const wxString asChoices[] = NULL
|
||||
,int nMajorDim = 0
|
||||
,long lStyle = wxRA_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
,const wxValidator& rVal = wxDefaultValidator
|
||||
#endif
|
||||
,const wxString& rsName = wxRadioBoxNameStr
|
||||
);
|
||||
|
||||
void GetSize(int *x, int *y) const;
|
||||
void GetPosition(int *x, int *y) const;
|
||||
void Command(wxCommandEvent& rEvent);
|
||||
bool ContainsHWND(WXHWND hWnd) const;
|
||||
bool Enable(bool bEnable);
|
||||
void Enable( int nItem
|
||||
,bool bEnable
|
||||
);
|
||||
int FindString(const wxString& sStr) const;
|
||||
|
||||
void SetLabel(int item, const wxString& label);
|
||||
void SetLabel(int item, wxBitmap *bitmap);
|
||||
wxString GetLabel(int item) const;
|
||||
bool Show(bool show);
|
||||
void SetFocus();
|
||||
bool Enable(bool enable);
|
||||
void Enable(int item, bool enable);
|
||||
void Show(int item, bool show) ;
|
||||
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
inline void SetButtonFont(const wxFont& font) { SetFont(font); }
|
||||
virtual WXHBRUSH OnCtlColor( WXHDC hDC
|
||||
,WXHWND hWnd
|
||||
,WXUINT uCtlColor
|
||||
,WXUINT uMessage
|
||||
,WXWPARAM wParam
|
||||
,WXLPARAM lParam
|
||||
);
|
||||
virtual bool OS2Command( WXUINT uParam
|
||||
,WXWORD wId
|
||||
);
|
||||
void SendNotificationEvent(void);
|
||||
void Show( int nItem
|
||||
,bool bShow = TRUE
|
||||
) ;
|
||||
bool Show(bool bShow);
|
||||
MRESULT WindowProc( WXUINT uMsg
|
||||
,WXWPARAM wParam
|
||||
,WXLPARAM lParam
|
||||
);
|
||||
|
||||
virtual wxString GetStringSelection() const;
|
||||
virtual bool SetStringSelection(const wxString& s);
|
||||
inline virtual int Number() const { return m_noItems; } ;
|
||||
void Command(wxCommandEvent& event);
|
||||
|
||||
inline int GetNumberOfRowsOrCols() const { return m_noRowsOrCols; }
|
||||
inline void SetNumberOfRowsOrCols(int n) { m_noRowsOrCols = n; }
|
||||
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
WXHWND *GetRadioButtons() const { return m_radioButtons; }
|
||||
bool ContainsHWND(WXHWND hWnd) const;
|
||||
void SendNotificationEvent();
|
||||
virtual int GetColumnCount(void) const;
|
||||
virtual int GetCount(void) const;
|
||||
inline int GetNumberOfRowsOrCols(void) const { return m_nNoRowsOrCols; }
|
||||
int GetNumHor(void) const;
|
||||
int GetNumVer(void) const;
|
||||
void GetPosition( int* pnX
|
||||
,int* pnY
|
||||
) const;
|
||||
inline WXHWND* GetRadioButtons(void) const { return m_ahRadioButtons; }
|
||||
virtual int GetRowCount(void) const;
|
||||
int GetSelection(void) const;
|
||||
void GetSize( int* pnX
|
||||
,int* pnY
|
||||
) const;
|
||||
void GetSizeFlags(void) const;
|
||||
void AdjustButtons( int nX
|
||||
,int nY
|
||||
,int nWidth
|
||||
,int nHeight
|
||||
,int lSizeFlags
|
||||
);
|
||||
wxString GetString(int nIndex) const;
|
||||
virtual wxString GetStringSelection(void) const;
|
||||
|
||||
// get the number of buttons per column/row
|
||||
int GetNumVer() const;
|
||||
int GetNumHor() const;
|
||||
inline void SetButtonFont(const wxFont& rFont) { SetFont(rFont); }
|
||||
void SetFocus(void);
|
||||
virtual bool SetFont(const wxFont& rFont);
|
||||
inline void SetLabelFont(const wxFont& WXUNUSED(font)) {};
|
||||
inline void SetNumberOfRowsOrCols(int nNum) { m_nNoRowsOrCols = nNum; }
|
||||
void SetSelection(int nIndex);
|
||||
virtual void SetString( int nNum
|
||||
,const wxString& rsLabel
|
||||
);
|
||||
virtual bool SetStringSelection(const wxString& rsStr);
|
||||
|
||||
void SetLabel( int nItem
|
||||
,const wxString& rsLabel
|
||||
);
|
||||
void SetLabel( int item
|
||||
,wxBitmap* pBitmap
|
||||
);
|
||||
wxString GetLabel(int nItem) const;
|
||||
|
||||
#if WXWIN_COMPATIBILITY
|
||||
wxRadioBox(wxWindow *parent, wxFunction func, const char *title,
|
||||
int x = -1, int y = -1, int width = -1, int height = -1,
|
||||
int n = 0, char **choices = NULL,
|
||||
int majorDim = 0, long style = wxRA_HORIZONTAL, const char *name = wxRadioBoxNameStr);
|
||||
#endif // WXWIN_COMPATIBILITY
|
||||
|
||||
protected:
|
||||
void SubclassRadioButton(WXHWND hWndBtn);
|
||||
void AdjustButtons( int nX
|
||||
,int nY
|
||||
,int nWidth
|
||||
,int nHeight
|
||||
,long lSizeFlags
|
||||
);
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
virtual void DoSetSize( int nX
|
||||
,int nY
|
||||
,int nWidth
|
||||
,int nHeight
|
||||
,int nSizeFlags = wxSIZE_AUTO
|
||||
);
|
||||
wxSize GetMaxButtonSize(void) const;
|
||||
wxSize GetTotalButtonSize(const wxSize& rSizeBtn) const;
|
||||
void SubclassRadioButton(WXHWND hWndBtn);
|
||||
|
||||
WXHWND * m_radioButtons;
|
||||
int m_majorDim ;
|
||||
int * m_radioWidth; // for bitmaps
|
||||
int * m_radioHeight;
|
||||
|
||||
int m_noItems;
|
||||
int m_noRowsOrCols;
|
||||
int m_selectedButton;
|
||||
WXHWND* m_ahRadioButtons;
|
||||
int m_nMajorDim ;
|
||||
int* m_pnRadioWidth; // for bitmaps
|
||||
int* m_pnRadioHeight;
|
||||
int m_nNoItems;
|
||||
int m_nNoRowsOrCols;
|
||||
int m_nSelectedButton;
|
||||
int m_nSizeFlags;
|
||||
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
private:
|
||||
virtual void SetLabel(const wxString& label)
|
||||
{ wxWindowBase::SetLabel(label); }
|
||||
wxString GetLabel() const
|
||||
{ return(wxWindowBase::GetLabel()); }
|
||||
};
|
||||
inline wxString GetLabel() const
|
||||
{ return wxWindowBase::GetLabel(); }
|
||||
inline void SetLabel(const wxString& rsLabel)
|
||||
{ wxWindowBase::SetLabel(rsLabel); }
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioBox)
|
||||
}; // end of wxRadioBox
|
||||
|
||||
#endif
|
||||
// _WX_RADIOBOX_H_
|
||||
|
@@ -18,38 +18,55 @@ WXDLLEXPORT_DATA(extern const char*) wxRadioButtonNameStr;
|
||||
|
||||
class WXDLLEXPORT wxRadioButton: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||
protected:
|
||||
public:
|
||||
inline wxRadioButton() {}
|
||||
inline wxRadioButton(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
public:
|
||||
inline wxRadioButton() {}
|
||||
inline wxRadioButton( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = 0
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
const wxString& name = wxRadioButtonNameStr)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& label,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize, long style = 0,
|
||||
,const wxString& rsName = wxRadioButtonNameStr
|
||||
)
|
||||
{
|
||||
Create( pParent
|
||||
,vId
|
||||
,rsLabel
|
||||
,rPos
|
||||
,rSize
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,rValidator
|
||||
#endif
|
||||
const wxString& name = wxRadioButtonNameStr);
|
||||
,rsName
|
||||
);
|
||||
}
|
||||
|
||||
virtual void SetLabel(const wxString& label);
|
||||
virtual void SetValue(bool val);
|
||||
virtual bool GetValue() const ;
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = 0
|
||||
#if wxUSE_VALIDATORS
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
,const wxString& rsName = wxRadioButtonNameStr
|
||||
);
|
||||
virtual void SetLabel(const wxString& rsLabel);
|
||||
virtual void SetValue(bool bVal);
|
||||
virtual bool GetValue(void) const ;
|
||||
|
||||
bool OS2Command(WXUINT param, WXWORD id);
|
||||
void Command(wxCommandEvent& event);
|
||||
};
|
||||
bool OS2Command( WXUINT wParam
|
||||
,WXWORD wId
|
||||
);
|
||||
void Command(wxCommandEvent& rEvent);
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxRadioButton)
|
||||
}; // end of wxRadioButton
|
||||
|
||||
#endif
|
||||
// _WX_RADIOBUT_H_
|
||||
|
@@ -376,5 +376,8 @@
|
||||
#define NO_TEXT_WINDOW_STREAM 1 // defined in textctrl.h for DLL builds
|
||||
#endif
|
||||
|
||||
#define wxUSE_UNICODE 0
|
||||
#define wxUSE_UNICODE_MSLU 0
|
||||
|
||||
#endif
|
||||
// _WX_SETUP_H_
|
||||
|
@@ -19,95 +19,135 @@ WXDLLEXPORT_DATA(extern const char*) wxSliderNameStr;
|
||||
// Slider
|
||||
class WXDLLEXPORT wxSlider: public wxSliderBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxSlider)
|
||||
|
||||
public:
|
||||
wxSlider();
|
||||
|
||||
inline wxSlider(wxWindow *parent, wxWindowID id,
|
||||
int value, int minValue, int maxValue,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSL_HORIZONTAL,
|
||||
inline wxSlider( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,int nValue
|
||||
,int nMinValue
|
||||
,int nMaxValue
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSL_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
const wxString& name = wxSliderNameStr)
|
||||
{
|
||||
Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
|
||||
}
|
||||
|
||||
~wxSlider();
|
||||
|
||||
bool Create(wxWindow *parent, wxWindowID id,
|
||||
int value, int minValue, int maxValue,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSL_HORIZONTAL,
|
||||
,const wxString& rsName = wxSliderNameStr
|
||||
)
|
||||
{
|
||||
Create( pParent
|
||||
,vId
|
||||
,nValue
|
||||
,nMinValue
|
||||
,nMaxValue
|
||||
,rPos
|
||||
,rSize
|
||||
,lStyle
|
||||
#if wxUSE_VALIDATORS
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
,rValidator
|
||||
#endif
|
||||
const wxString& name = wxSliderNameStr);
|
||||
,rsName
|
||||
);
|
||||
}
|
||||
~wxSlider();
|
||||
|
||||
virtual int GetValue() const ;
|
||||
virtual void SetValue(int);
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,int nValue
|
||||
,int nMinValue
|
||||
,int nMaxValue
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSL_HORIZONTAL
|
||||
#if wxUSE_VALIDATORS
|
||||
,const wxValidator& rValidator = wxDefaultValidator
|
||||
#endif
|
||||
,const wxString& rsName = wxSliderNameStr
|
||||
);
|
||||
|
||||
void GetSize(int *x, int *y) const ;
|
||||
void GetPosition(int *x, int *y) const ;
|
||||
virtual int GetValue(void) const ;
|
||||
virtual void SetValue(int);
|
||||
|
||||
bool Show(bool show);
|
||||
void GetSize( int* pnX
|
||||
,int* pnY
|
||||
) const;
|
||||
void GetPosition( int* pnX
|
||||
,int* pnY
|
||||
) const ;
|
||||
bool Show(bool bShow);
|
||||
void SetRange( int nMinValue
|
||||
,int nMaxValue
|
||||
);
|
||||
|
||||
void SetRange(int minValue, int maxValue);
|
||||
inline int GetMin(void) const { return m_nRangeMin; }
|
||||
inline int GetMax(void) const { return m_nRangeMax; }
|
||||
|
||||
inline int GetMin() const { return m_rangeMin; }
|
||||
inline int GetMax() const { return m_rangeMax; }
|
||||
//
|
||||
// For trackbars only
|
||||
//
|
||||
void ClearSel(void);
|
||||
void ClearTicks(void);
|
||||
|
||||
void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
|
||||
int GetLineSize(void) const;
|
||||
int GetPageSize(void) const ;
|
||||
int GetSelEnd(void) const;
|
||||
int GetSelStart(void) const;
|
||||
inline int GetTickFreq(void) const { return m_nTickFreq; }
|
||||
int GetThumbLength(void) const ;
|
||||
|
||||
void SetLineSize(int nLineSize);
|
||||
void SetPageSize(int nPageSize);
|
||||
void SetSelection( int nMinPos
|
||||
,int nMaxPos
|
||||
);
|
||||
void SetThumbLength(int nLen) ;
|
||||
void SetTick(int ntickPos) ;
|
||||
void SetTickFreq( int n
|
||||
,int nPos
|
||||
);
|
||||
|
||||
//
|
||||
// IMPLEMENTATION
|
||||
//
|
||||
inline WXHWND GetStaticMin(void) const { return m_hStaticMin; }
|
||||
inline WXHWND GetStaticMax(void) const { return m_hStaticMax; }
|
||||
inline WXHWND GetEditValue(void) const { return m_hStaticValue; }
|
||||
virtual bool ContainsHWND(WXHWND hWnd) const;
|
||||
void Command(wxCommandEvent& rEvent);
|
||||
virtual WXHBRUSH OnCtlColor( WXHDC hDC
|
||||
,WXHWND hWnd
|
||||
,WXUINT uCtlColor
|
||||
,WXUINT uMessage
|
||||
,WXWPARAM wParam
|
||||
,WXLPARAM lParam
|
||||
);
|
||||
virtual bool OS2OnScroll( int nOrientation
|
||||
,WXWORD wParam
|
||||
,WXWORD wPos
|
||||
,WXHWND hControl
|
||||
);
|
||||
|
||||
// For trackbars only
|
||||
void SetTickFreq(int n, int pos);
|
||||
inline int GetTickFreq() const { return m_tickFreq; }
|
||||
void SetPageSize(int pageSize);
|
||||
int GetPageSize() const ;
|
||||
void ClearSel() ;
|
||||
void ClearTicks() ;
|
||||
void SetLineSize(int lineSize);
|
||||
int GetLineSize() const ;
|
||||
int GetSelEnd() const ;
|
||||
int GetSelStart() const ;
|
||||
void SetSelection(int minPos, int maxPos);
|
||||
void SetThumbLength(int len) ;
|
||||
int GetThumbLength() const ;
|
||||
void SetTick(int tickPos) ;
|
||||
protected:
|
||||
WXHWND m_hStaticMin;
|
||||
WXHWND m_hStaticMax;
|
||||
WXHWND m_hStaticValue;
|
||||
int m_nRangeMin;
|
||||
int m_nRangeMax;
|
||||
int m_nPageSize;
|
||||
int m_nLineSize;
|
||||
int m_nTickFreq;
|
||||
double m_dPixelToRange;
|
||||
int m_nThumbLength;
|
||||
|
||||
// IMPLEMENTATION
|
||||
WXHWND GetStaticMin() const { return m_staticMin; }
|
||||
WXHWND GetStaticMax() const { return m_staticMax; }
|
||||
WXHWND GetEditValue() const { return m_staticValue; }
|
||||
virtual bool ContainsHWND(WXHWND hWnd) const;
|
||||
|
||||
void Command(wxCommandEvent& event);
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
virtual bool OS2OnScroll(int orientation, WXWORD wParam,
|
||||
WXWORD pos, WXHWND control);
|
||||
|
||||
protected:
|
||||
WXHWND m_staticMin;
|
||||
WXHWND m_staticMax;
|
||||
WXHWND m_staticValue;
|
||||
int m_rangeMin;
|
||||
int m_rangeMax;
|
||||
int m_pageSize;
|
||||
int m_lineSize;
|
||||
int m_tickFreq;
|
||||
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
};
|
||||
virtual void DoSetSize( int nX
|
||||
,int nY
|
||||
,int nWidth
|
||||
,int nHeight
|
||||
,int nSizeFlags = wxSIZE_AUTO
|
||||
);
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSlider)
|
||||
}; // end of CLASS wxSlider
|
||||
|
||||
#endif
|
||||
// _WX_SLIDER_H_
|
||||
|
@@ -15,58 +15,66 @@
|
||||
#include "wx/control.h"
|
||||
#include "wx/event.h"
|
||||
|
||||
extern MRESULT EXPENTRY wxSpinCtrlWndProc(
|
||||
HWND hWnd
|
||||
, UINT uMessage
|
||||
, MPARAM wParam
|
||||
, MPARAM lParam
|
||||
);
|
||||
|
||||
class WXDLLEXPORT wxSpinButton: public wxSpinButtonBase
|
||||
{
|
||||
public:
|
||||
// Construction
|
||||
wxSpinButton() { }
|
||||
|
||||
inline wxSpinButton( wxWindow *parent
|
||||
,wxWindowID id = -1
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = wxSP_VERTICAL
|
||||
,const wxString& name = "wxSpinButton"
|
||||
inline wxSpinButton( wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSP_VERTICAL
|
||||
,const wxString& rsName = "wxSpinButton"
|
||||
)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
Create(pParent, vId, rPos, rSize, lStyle, rsName);
|
||||
}
|
||||
|
||||
virtual ~wxSpinButton();
|
||||
|
||||
bool Create( wxWindow *parent
|
||||
,wxWindowID id = -1
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = wxSP_VERTICAL
|
||||
,const wxString& name = "wxSpinButton"
|
||||
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSP_VERTICAL
|
||||
,const wxString& rsName = "wxSpinButton"
|
||||
);
|
||||
|
||||
// Accessors
|
||||
virtual int GetValue() const ;
|
||||
virtual void SetValue(int val) ;
|
||||
virtual void SetRange( int minVal
|
||||
,int maxVal
|
||||
);
|
||||
inline virtual int GetMax(void) const { return m_max; }
|
||||
inline virtual int GetMin(void) const { return m_min; }
|
||||
virtual int GetValue(void) const;
|
||||
inline bool IsVertical(void) const {return ((m_windowStyle & wxSP_VERTICAL) != 0); }
|
||||
virtual void SetValue(int nVal);
|
||||
virtual void SetRange( int nMinVal
|
||||
,int nMaxVal
|
||||
);
|
||||
|
||||
//
|
||||
// Implementation
|
||||
virtual bool OS2Command( WXUINT param
|
||||
,WXWORD id
|
||||
//
|
||||
virtual bool OS2Command( WXUINT wParam
|
||||
,WXWORD wId
|
||||
);
|
||||
virtual bool OS2OnNotify( int idCtrl
|
||||
,WXLPARAM lParam
|
||||
,WXLPARAM* result
|
||||
);
|
||||
virtual bool OS2OnScroll( int orientation
|
||||
virtual bool OS2OnScroll( int nOrientation
|
||||
,WXWORD wParam
|
||||
,WXWORD pos
|
||||
,WXHWND control
|
||||
,WXWORD wPos
|
||||
,WXHWND hControl
|
||||
);
|
||||
|
||||
inline virtual bool AcceptsFocus(void) const { return FALSE; }
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinButton)
|
||||
};
|
||||
#endif
|
||||
// _WX_SPINBUTT_H_
|
||||
}; // end of CLASS wxSpinButton
|
||||
|
||||
#endif // _WX_SPINBUTT_H_
|
||||
|
@@ -13,6 +13,9 @@
|
||||
#define _WX_MSW_SPINCTRL_H_
|
||||
|
||||
#include "wx/spinbutt.h" // the base class
|
||||
#include "wx/dynarray.h"
|
||||
class WXDLLEXPORT wxSpinCtrl;
|
||||
WX_DEFINE_EXPORTED_ARRAY(wxSpinCtrl *, wxArraySpins);
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Under Win32 and OS2 PM, wxSpinCtrl is a wxSpinButton with a buddy
|
||||
@@ -24,55 +27,99 @@ class WXDLLEXPORT wxSpinCtrl : public wxSpinButton
|
||||
{
|
||||
public:
|
||||
wxSpinCtrl() { }
|
||||
|
||||
wxSpinCtrl(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS,
|
||||
int min = 0, int max = 100, int initial = 0,
|
||||
const wxString& name = _T("wxSpinCtrl"))
|
||||
wxSpinCtrl( wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,const wxString& rsValue = wxEmptyString
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSP_ARROW_KEYS
|
||||
,int nMin = 0
|
||||
,int nMax = 100
|
||||
,int nInitial = 0
|
||||
,const wxString& rsName = _T("wxSpinCtrl")
|
||||
)
|
||||
{
|
||||
Create(parent, id, value, pos, size, style, min, max, initial, name);
|
||||
Create(pParent, vId, rsValue, rPos, rSize, lStyle, nMin, nMax, nInitial, rsName);
|
||||
}
|
||||
virtual ~wxSpinCtrl();
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxSP_ARROW_KEYS,
|
||||
int min = 0, int max = 100, int initial = 0,
|
||||
const wxString& name = _T("wxSpinCtrl"));
|
||||
bool Create(wxWindow* pParent
|
||||
,wxWindowID vId = -1
|
||||
,const wxString& rsValue = wxEmptyString
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxSP_ARROW_KEYS
|
||||
,int nMin = 0
|
||||
,int nMax = 100
|
||||
,int nInitial = 0
|
||||
,const wxString& rsName = _T("wxSpinCtrl")
|
||||
);
|
||||
|
||||
// a wxTextCtrl-like method (but we can't have GetValue returning wxString
|
||||
//
|
||||
// A wxTextCtrl-like method (but we can't have GetValue returning wxString
|
||||
// because the base class already has one returning int!)
|
||||
void SetValue(const wxString& text);
|
||||
//
|
||||
void SetValue(const wxString& rsText);
|
||||
|
||||
//
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
//
|
||||
virtual bool Enable(bool bEnable = TRUE);
|
||||
|
||||
virtual void SetValue(int val) { wxSpinButton::SetValue(val); }
|
||||
virtual int GetValue() const;
|
||||
virtual bool SetFont(const wxFont &font);
|
||||
virtual int GetValue(void) const;
|
||||
|
||||
virtual bool SetFont(const wxFont &rFont);
|
||||
virtual void SetFocus(void);
|
||||
inline virtual void SetValue(int nVal) { wxSpinButton::SetValue(nVal); }
|
||||
|
||||
virtual bool Show(bool bShow = TRUE);
|
||||
|
||||
//
|
||||
// wxSpinButton doesn't accept focus, but we do
|
||||
//
|
||||
inline virtual bool AcceptsFocus(void) const { return FALSE; }
|
||||
|
||||
//
|
||||
// Return the spinctrl object whose buddy is the given window or NULL
|
||||
// Doesn't really do much under OS/2
|
||||
//
|
||||
static wxSpinCtrl* GetSpinForTextCtrl(WXHWND hWndBuddy);
|
||||
|
||||
//
|
||||
// Process a WM_COMMAND generated by the buddy text control
|
||||
//
|
||||
bool ProcessTextCommand( WXWORD wCmd
|
||||
,WXWORD wId
|
||||
);
|
||||
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
virtual bool Show(bool show = TRUE);
|
||||
protected:
|
||||
void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual void DoGetPosition( int* nlX
|
||||
,int* nlY
|
||||
) const;
|
||||
void DoMoveWindow( int nX
|
||||
,int nY
|
||||
,int nWidth
|
||||
,int nHeight
|
||||
);
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
virtual void DoGetSize( int* pnWidth
|
||||
,int* pnHeight
|
||||
) const;
|
||||
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
//
|
||||
// The handler for wxSpinButton events
|
||||
//
|
||||
void OnSpinChange(wxSpinEvent& rEvent);
|
||||
void OnChar(wxKeyEvent& rEvent);
|
||||
|
||||
// the handler for wxSpinButton events
|
||||
void OnSpinChange(wxSpinEvent& event);
|
||||
|
||||
WXHWND m_hwndBuddy;
|
||||
WXHWND m_hWndBuddy;
|
||||
static wxArraySpins m_svAllSpins;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
}; // end of CLASS wxSpinCtrl
|
||||
|
||||
#endif // _WX_MSW_SPINCTRL_H_
|
||||
|
||||
|
@@ -60,6 +60,10 @@ class WXDLLEXPORT wxStaticBitmap : public wxStaticBitmapBase
|
||||
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
virtual MRESULT OS2WindowProc( WXUINT uMsg
|
||||
,WXWPARAM wParam
|
||||
,WXLPARAM lParam
|
||||
);
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
@@ -77,7 +81,7 @@ protected:
|
||||
wxGDIImage* m_pImage;
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBitmap)
|
||||
};
|
||||
}; // end of wxStaticBitmap
|
||||
|
||||
#endif
|
||||
// _WX_STATBMP_H_
|
||||
|
@@ -19,50 +19,49 @@ WXDLLEXPORT_DATA(extern const char*) wxStaticBoxNameStr;
|
||||
// Group box
|
||||
class WXDLLEXPORT wxStaticBox : public wxStaticBoxBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
|
||||
public:
|
||||
public:
|
||||
inline wxStaticBox() {}
|
||||
inline wxStaticBox( wxWindow* parent
|
||||
,wxWindowID id
|
||||
,const wxString& label
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = 0
|
||||
,const wxString& name = wxStaticBoxNameStr
|
||||
inline wxStaticBox( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = 0
|
||||
,const wxString& rsName = wxStaticBoxNameStr
|
||||
)
|
||||
{
|
||||
Create(parent, id, label, pos, size, style, name);
|
||||
Create(pParent, vId, rsLabel, rPos, rSize, lStyle, rsName);
|
||||
}
|
||||
|
||||
bool Create( wxWindow* parent
|
||||
,wxWindowID id
|
||||
,const wxString& label
|
||||
,const wxPoint& pos = wxDefaultPosition
|
||||
,const wxSize& size = wxDefaultSize
|
||||
,long style = 0
|
||||
,const wxString& name = wxStaticBoxNameStr
|
||||
);
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = 0
|
||||
,const wxString& rsName = wxStaticBoxNameStr
|
||||
);
|
||||
|
||||
//
|
||||
// implementation from now on
|
||||
// --------------------------
|
||||
//
|
||||
virtual MRESULT OS2WindowProc( WXUINT uMsg
|
||||
,WXWPARAM wParam
|
||||
,WXLPARAM lParam
|
||||
);
|
||||
|
||||
void OnEraseBackground(wxEraseEvent& event);
|
||||
|
||||
virtual MRESULT OS2WindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
virtual WXHBRUSH OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
|
||||
WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
|
||||
|
||||
//
|
||||
// overriden base class virtuals
|
||||
virtual bool AcceptsFocus() const { return FALSE; }
|
||||
//
|
||||
inline virtual bool AcceptsFocus(void) const { return FALSE; }
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticBox)
|
||||
}; // end of CLASS wxStaticBox
|
||||
|
||||
#endif
|
||||
// _WX_STATBOX_H_
|
||||
|
@@ -21,29 +21,62 @@
|
||||
|
||||
class WXDLLEXPORT wxStaticLine : public wxStaticLineBase
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticLine)
|
||||
|
||||
public:
|
||||
// constructors and pseudo-constructors
|
||||
wxStaticLine() { }
|
||||
|
||||
wxStaticLine( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticTextNameStr )
|
||||
wxStaticLine( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxLI_HORIZONTAL
|
||||
,const wxString& rsName = wxStaticTextNameStr
|
||||
)
|
||||
{
|
||||
Create(parent, id, pos, size, style, name);
|
||||
Create(pParent, vId, rPos, rSize, lStyle, rsName);
|
||||
}
|
||||
|
||||
bool Create( wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint &pos = wxDefaultPosition,
|
||||
const wxSize &size = wxDefaultSize,
|
||||
long style = wxLI_HORIZONTAL,
|
||||
const wxString &name = wxStaticTextNameStr );
|
||||
};
|
||||
bool Create( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxPoint& rPos = wxDefaultPosition
|
||||
,const wxSize& rSize = wxDefaultSize
|
||||
,long lStyle = wxLI_HORIZONTAL
|
||||
,const wxString& rsName = wxStaticTextNameStr
|
||||
);
|
||||
|
||||
inline bool IsVertical(void) const { return((GetWindowStyleFlag() & wxLI_VERTICAL) != 0); }
|
||||
inline static int GetDefaultSize(void) { return 2; }
|
||||
|
||||
//
|
||||
// Overriden base class virtuals
|
||||
//
|
||||
inline virtual bool AcceptsFocus(void) const {return FALSE;}
|
||||
|
||||
protected:
|
||||
inline wxSize AdjustSize(const wxSize& rSize) const
|
||||
{
|
||||
wxSize vSizeReal( rSize.x
|
||||
,rSize.y
|
||||
);
|
||||
|
||||
if (IsVertical())
|
||||
{
|
||||
if (rSize.x == -1 )
|
||||
vSizeReal.x = GetDefaultSize();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rSize.y == -1)
|
||||
vSizeReal.y = GetDefaultSize();
|
||||
}
|
||||
return vSizeReal;
|
||||
}
|
||||
|
||||
inline wxSize DoGetBestSize(void) const { return (AdjustSize(wxDefaultSize)); }
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticLine)
|
||||
}; // end of CLASS wxStaticLine
|
||||
|
||||
#endif // _WX_OS2_STATLINE_H_
|
||||
|
||||
|
@@ -22,11 +22,8 @@ WXDLLEXPORT_DATA(extern const char*) wxStaticTextNameStr;
|
||||
|
||||
class WXDLLEXPORT wxStaticText : public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||
|
||||
public:
|
||||
public:
|
||||
inline wxStaticText() { }
|
||||
|
||||
inline wxStaticText( wxWindow* pParent
|
||||
,wxWindowID vId
|
||||
,const wxString& rsLabel
|
||||
@@ -69,6 +66,9 @@ class WXDLLEXPORT wxStaticText : public wxControl
|
||||
|
||||
protected:
|
||||
virtual wxSize DoGetBestSize(void) const;
|
||||
|
||||
private:
|
||||
DECLARE_DYNAMIC_CLASS(wxStaticText)
|
||||
}; // end of CLASS wxStaticText
|
||||
|
||||
#endif
|
||||
|
@@ -78,13 +78,32 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
OS: first test for generic Unix defines, then for particular flavours and
|
||||
OS: first of all, test for MS-DOS platform. We must do this before testing
|
||||
for Unix, because DJGPP compiler defines __unix__ under MS-DOS
|
||||
*/
|
||||
#if defined(__GO32__) || defined(__DJGPP__) || defined(__DOS__)
|
||||
#ifndef __DOS__
|
||||
#define __DOS__
|
||||
#endif
|
||||
/* size_t is the same as unsigned int for Watcom 11 compiler, */
|
||||
/* so define it if it hadn't been done by configure yet */
|
||||
#if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
|
||||
#ifdef __WATCOMC__
|
||||
#define wxSIZE_T_IS_UINT
|
||||
#endif
|
||||
#ifdef __DJGPP__
|
||||
#define wxSIZE_T_IS_ULONG
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
OS: then test for generic Unix defines, then for particular flavours and
|
||||
finally for Unix-like systems
|
||||
*/
|
||||
#if defined(__UNIX__) || defined(__unix) || defined(__unix__) || \
|
||||
defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \
|
||||
defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
|
||||
defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
|
||||
#elif defined(__UNIX__) || defined(__unix) || defined(__unix__) || \
|
||||
defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \
|
||||
defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) || \
|
||||
defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
|
||||
|
||||
#define __UNIX_LIKE__
|
||||
|
||||
@@ -168,12 +187,6 @@
|
||||
#endif
|
||||
#define wxSIZE_T_IS_UINT
|
||||
|
||||
#elif defined(__DOS__)
|
||||
/* size_t is the same as unsigned int for Watcom 11 compiler, */
|
||||
/* so define it if it hadn't been done by configure yet */
|
||||
#if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG)
|
||||
#define wxSIZE_T_IS_UINT
|
||||
#endif
|
||||
#else /* Windows */
|
||||
#ifndef __WINDOWS__
|
||||
#define __WINDOWS__
|
||||
|
@@ -52,6 +52,8 @@
|
||||
#undef FindResource
|
||||
#endif
|
||||
|
||||
class WXDLLEXPORT wxInputStream;
|
||||
|
||||
/*
|
||||
* Internal format for control/panel item
|
||||
*/
|
||||
@@ -153,7 +155,7 @@ class WXDLLEXPORT wxResourceTable: public wxHashTable
|
||||
virtual bool DeleteResource(const wxString& name);
|
||||
|
||||
virtual bool ParseResourceFile(const wxString& filename);
|
||||
virtual bool ParseResourceFile( wxInputStream *is ) ;
|
||||
virtual bool ParseResourceFile(wxInputStream *is);
|
||||
virtual bool ParseResourceData(const wxString& data);
|
||||
virtual bool SaveResource(const wxString& filename);
|
||||
|
||||
|
@@ -1,67 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: serbase.h
|
||||
// Purpose: Serialization plug-ins
|
||||
// Author: Guilhem Lavaux
|
||||
// Modified by:
|
||||
// Created: July 1998
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) Guilhem Lavaux
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#ifndef _WX_WX_SERBASEH_H__
|
||||
#define _WX_WX_SERBASEH_H__
|
||||
|
||||
#include "wx/setup.h"
|
||||
#include "wx/dynlib.h"
|
||||
|
||||
#define WXSERIAL(classname) classname##_Serialize
|
||||
|
||||
#if wxUSE_SERIAL
|
||||
class wxObject_Serialize : public wxObject {
|
||||
DECLARE_DYNAMIC_CLASS(wxObject_Serialize)
|
||||
public:
|
||||
wxObject_Serialize() {}
|
||||
virtual ~wxObject_Serialize() {}
|
||||
|
||||
void SetObject(wxObject *obj) { m_object = obj; }
|
||||
wxObject *Object() { return m_object; }
|
||||
|
||||
protected:
|
||||
wxObject *m_object;
|
||||
};
|
||||
#endif
|
||||
// wxUSE_SERIAL
|
||||
|
||||
|
||||
#define DECLARE_SERIAL_CLASS(classname, parent) \
|
||||
class WXSERIAL(classname) : public WXSERIAL(parent) { \
|
||||
DECLARE_DYNAMIC_CLASS(classname##_Serialize) \
|
||||
public: \
|
||||
WXSERIAL(classname)() { } \
|
||||
virtual ~WXSERIAL(classname)() { } \
|
||||
\
|
||||
virtual void StoreObject(wxObjectOutputStream& stream); \
|
||||
virtual void LoadObject(wxObjectInputStream& stream); \
|
||||
};
|
||||
|
||||
#define DECLARE_ALIAS_SERIAL_CLASS(classname, parent) \
|
||||
class WXSERIAL(classname) : public WXSERIAL(parent) { \
|
||||
DECLARE_DYNAMIC_CLASS(classname##_Serialize) \
|
||||
public: \
|
||||
WXSERIAL(classname)() { } \
|
||||
virtual ~WXSERIAL(classname)() { } \
|
||||
};
|
||||
|
||||
#define IMPLEMENT_SERIAL_CLASS(classname, parent) \
|
||||
IMPLEMENT_DYNAMIC_CLASS(classname##_Serialize, parent##_Serialize)
|
||||
|
||||
#define IMPLEMENT_ALIAS_SERIAL_CLASS(classname, parent) \
|
||||
IMPLEMENT_DYNAMIC_CLASS(classname##_Serialize, parent##_Serialize)
|
||||
|
||||
#if wxUSE_SERIAL
|
||||
DECLARE_SERIAL_CLASS(wxList, wxObject)
|
||||
DECLARE_SERIAL_CLASS(wxHashTable, wxObject)
|
||||
#endif
|
||||
// wxUSE_SERIAL
|
||||
|
||||
#endif
|
@@ -122,9 +122,6 @@ public:
|
||||
|
||||
// Operators
|
||||
wxInputStream& operator>>(wxOutputStream& out) { return Read(out); }
|
||||
#if wxUSE_SERIAL
|
||||
wxInputStream& operator>>(wxObject *& obj);
|
||||
#endif
|
||||
wxInputStream& operator>>( __wxInputManip func) { return func(*this); }
|
||||
|
||||
protected:
|
||||
@@ -161,9 +158,6 @@ public:
|
||||
virtual void Sync();
|
||||
|
||||
wxOutputStream& operator<<(wxInputStream& out) { return Write(out); }
|
||||
#if wxUSE_SERIAL
|
||||
wxOutputStream& operator<<(wxObject& obj);
|
||||
#endif
|
||||
wxOutputStream& operator<<( __wxOutputManip func) { return func(*this); }
|
||||
|
||||
protected:
|
||||
|
@@ -139,6 +139,8 @@ inline int Stricmp(const char *psz1, const char *psz2)
|
||||
return stricmp(psz1, psz2);
|
||||
#elif defined(__WATCOMC__)
|
||||
return stricmp(psz1, psz2);
|
||||
#elif defined(__DJGPP__)
|
||||
return stricmp(psz1, psz2);
|
||||
#elif defined(__EMX__)
|
||||
return stricmp(psz1, psz2);
|
||||
#elif defined(__WXPM__)
|
||||
|
@@ -114,21 +114,23 @@ enum wxTreeItemIcon
|
||||
* wxTreeCtrl flags
|
||||
*/
|
||||
// TODO: maybe renumber these?
|
||||
#define wxTR_NO_BUTTONS 0x0000 // for convenience
|
||||
#define wxTR_HAS_BUTTONS 0x0001 // generates a +/- button
|
||||
#define wxTR_TWIST_BUTTONS 0x0002 // generates a twister button
|
||||
#define wxTR_NO_LINES 0x0004 // don't generate level connectors
|
||||
#define wxTR_LINES_AT_ROOT 0x0008 // connect top-level nodes
|
||||
#define wxTR_MAC_BUTTONS wxTR_TWIST_BUTTONS // backward compatibility
|
||||
#define wxTR_NO_BUTTONS 0x0000 // for convenience
|
||||
#define wxTR_HAS_BUTTONS 0x0001 // generates a +/- button
|
||||
#define wxTR_TWIST_BUTTONS 0x0002 // generates a twister button
|
||||
#define wxTR_NO_LINES 0x0004 // don't generate level connectors
|
||||
#define wxTR_LINES_AT_ROOT 0x0008 // connect top-level nodes
|
||||
#define wxTR_MAC_BUTTONS wxTR_TWIST_BUTTONS // backward compatibility
|
||||
#define wxTR_AQUA_BUTTONS 0x0010 // used internally
|
||||
|
||||
#define wxTR_SINGLE 0x0000 // for convenience
|
||||
#define wxTR_MULTIPLE 0x0020 // can select multiple items
|
||||
#define wxTR_EXTENDED 0x0040 // TODO: allow extended selection
|
||||
#define wxTR_SINGLE 0x0000 // for convenience
|
||||
#define wxTR_MULTIPLE 0x0020 // can select multiple items
|
||||
#define wxTR_EXTENDED 0x0040 // TODO: allow extended selection
|
||||
#define wxTR_FULL_ROW_HIGHLIGHT 0x2000 // highlight full horizontal space
|
||||
|
||||
#define wxTR_EDIT_LABELS 0x0200 // can edit item labels
|
||||
#define wxTR_ROW_LINES 0x0400 // put border around items
|
||||
#define wxTR_HIDE_ROOT 0x0800 // don't display root node
|
||||
#define wxTR_HAS_VARIABLE_ROW_HEIGHT 0x0080 // what it says
|
||||
#define wxTR_EDIT_LABELS 0x0200 // can edit item labels
|
||||
#define wxTR_ROW_LINES 0x0400 // put border around items
|
||||
#define wxTR_HIDE_ROOT 0x0800 // don't display root node
|
||||
#define wxTR_HAS_VARIABLE_ROW_HEIGHT 0x0080 // what it says
|
||||
|
||||
// TODO: different default styles for wxGTK, wxMotif, whatever?
|
||||
#ifdef __WXMAC__
|
||||
|
@@ -23,6 +23,7 @@
|
||||
#include "wx/event.h"
|
||||
#include "wx/app.h"
|
||||
#include "wx/utils.h"
|
||||
#include "wx/stream.h"
|
||||
|
||||
#if wxUSE_GUI
|
||||
|
||||
@@ -83,11 +84,6 @@
|
||||
#include "wx/valtext.h"
|
||||
#endif // wxUSE_VALIDATORS
|
||||
|
||||
#if wxUSE_SERIAL
|
||||
#include "wx/objstrm.h"
|
||||
#include "wx/serbase.h"
|
||||
#endif // wxUSE_SERIAL
|
||||
|
||||
#endif // wxUSE_GUI
|
||||
|
||||
#endif
|
||||
|
@@ -439,7 +439,7 @@ typedef unsigned __WCHAR_TYPE__ wxUChar;
|
||||
|
||||
// define wxStricmp for various compilers without Unicode possibilities
|
||||
#if !defined(wxStricmp) && !wxUSE_UNICODE
|
||||
# if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__)
|
||||
# if defined(__BORLANDC__) || defined(__WATCOMC__) || defined(__SALFORDC__) || defined(__VISAGECPP__) || defined(__EMX__) || defined(__DJGPP__)
|
||||
# define wxStricmp stricmp
|
||||
# define wxStrnicmp strnicmp
|
||||
# elif defined(__SC__) || defined(__VISUALC__) || (defined(__MWERKS__) && defined(__INTEL__))
|
||||
@@ -674,12 +674,22 @@ WXDLLEXPORT size_t wxStrftime(wxChar *s, size_t max, const wxChar *fmt, const
|
||||
// and _() in wxWindows sources
|
||||
#define wxT(x) _T(x)
|
||||
|
||||
// a Unicode-friendly __FILE__ analog
|
||||
// Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs
|
||||
#ifndef __TFILE__
|
||||
#define __XFILE__(x) wxT(x)
|
||||
#define __TFILE__ __XFILE__(__FILE__)
|
||||
#endif
|
||||
|
||||
#ifndef __TDATE__
|
||||
#define __XDATE__(x) wxT(x)
|
||||
#define __TDATE__ __XDATE__(__DATE__)
|
||||
#endif
|
||||
|
||||
#ifndef __TTIME__
|
||||
#define __XTIME__(x) wxT(x)
|
||||
#define __TTIME__ __XTIME__(__TIME__)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
//_WX_WXCHAR_H_
|
||||
|
||||
|
858
locale/cs.po
858
locale/cs.po
File diff suppressed because it is too large
Load Diff
606
locale/da.po
606
locale/da.po
File diff suppressed because it is too large
Load Diff
614
locale/de.po
614
locale/de.po
File diff suppressed because it is too large
Load Diff
615
locale/es.po
615
locale/es.po
File diff suppressed because it is too large
Load Diff
614
locale/fi.po
614
locale/fi.po
File diff suppressed because it is too large
Load Diff
614
locale/fr.po
614
locale/fr.po
File diff suppressed because it is too large
Load Diff
1179
locale/it.po
1179
locale/it.po
File diff suppressed because it is too large
Load Diff
614
locale/nl.po
614
locale/nl.po
File diff suppressed because it is too large
Load Diff
629
locale/ru.po
629
locale/ru.po
File diff suppressed because it is too large
Load Diff
632
locale/sl.po
632
locale/sl.po
File diff suppressed because it is too large
Load Diff
614
locale/sv.po
614
locale/sv.po
File diff suppressed because it is too large
Load Diff
589
locale/wxstd.po
589
locale/wxstd.po
File diff suppressed because it is too large
Load Diff
614
locale/zh.po
614
locale/zh.po
File diff suppressed because it is too large
Load Diff
@@ -100,6 +100,11 @@ bool MyApp::OnInit()
|
||||
|
||||
wxConfigBase *pConfig = wxConfigBase::Get();
|
||||
|
||||
// uncomment this to force writing back of the defaults for all values
|
||||
// if they're not present in the config - this can give the user an idea
|
||||
// of all possible settings for this program
|
||||
pConfig->SetRecordDefaults();
|
||||
|
||||
// or you could also write something like this:
|
||||
// wxFileConfig *pConfig = new wxFileConfig("conftest");
|
||||
// wxConfigBase::Set(pConfig);
|
||||
@@ -209,7 +214,7 @@ void MyFrame::OnQuit(wxCommandEvent&)
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent&)
|
||||
{
|
||||
wxMessageBox(_T("wxConfig demo\n<EFBFBD> Vadim Zeitlin 1998"), _T("About"),
|
||||
wxMessageBox(_T("wxConfig demo\n<EFBFBD> 1998-2001 Vadim Zeitlin"), _T("About"),
|
||||
wxICON_INFORMATION | wxOK);
|
||||
}
|
||||
|
||||
|
@@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
// what to test (in alphabetic order)? uncomment the line below to do all tests
|
||||
#define TEST_ALL
|
||||
// #define TEST_ALL
|
||||
#ifdef TEST_ALL
|
||||
#define TEST_ARRAYS
|
||||
#define TEST_CHARSET
|
||||
@@ -828,7 +828,7 @@ static void TestFileNameConstruction()
|
||||
printf("ERROR: fullname should be '%s'\n", fni.fullname);
|
||||
}
|
||||
|
||||
bool isAbsolute = fn.IsAbsolute(fni.format);
|
||||
bool isAbsolute = fn.IsAbsolute();
|
||||
printf("'%s' is %s (%s)\n\t",
|
||||
fullname.c_str(),
|
||||
isAbsolute ? "absolute" : "relative",
|
||||
@@ -5304,7 +5304,7 @@ int main(int argc, char **argv)
|
||||
#endif // TEST_FILE
|
||||
|
||||
#ifdef TEST_FILENAME
|
||||
if ( 0 )
|
||||
if ( 1 )
|
||||
{
|
||||
wxFileName fn;
|
||||
fn.Assign("c:\\foo", "bar.baz");
|
||||
|
@@ -37,6 +37,33 @@
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// event constants
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// declare a custom event type
|
||||
//
|
||||
// note that in wxWin 2.3+ these macros expand simply into the following code:
|
||||
//
|
||||
// extern const wxEventType wxEVT_MY_CUSTOM_COMMAND;
|
||||
//
|
||||
// const wxEventType wxEVT_MY_CUSTOM_COMMAND = wxNewEventType();
|
||||
//
|
||||
// and you may use this code directly if you don't care about 2.2 compatibility
|
||||
BEGIN_DECLARE_EVENT_TYPES()
|
||||
DECLARE_EVENT_TYPE(wxEVT_MY_CUSTOM_COMMAND, 7777)
|
||||
END_DECLARE_EVENT_TYPES()
|
||||
|
||||
DEFINE_EVENT_TYPE(wxEVT_MY_CUSTOM_COMMAND)
|
||||
|
||||
// it may also be convenient to define an event table macro for this event type
|
||||
#define EVT_MY_CUSTOM_COMMAND(id, fn) \
|
||||
DECLARE_EVENT_TABLE_ENTRY( \
|
||||
wxEVT_MY_CUSTOM_COMMAND, id, -1, \
|
||||
(wxObjectEventFunction)(wxEventFunction)(wxCommandEventFunction)&fn, \
|
||||
(wxObject *) NULL \
|
||||
),
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// private classes
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -70,6 +97,9 @@ public:
|
||||
void OnPopEventHandler(wxCommandEvent& event);
|
||||
void OnTest(wxCommandEvent& event);
|
||||
|
||||
void OnFireCustom(wxCommandEvent& event);
|
||||
void OnProcessCustom(wxCommandEvent& event);
|
||||
|
||||
void OnUpdateUIPop(wxUpdateUIEvent& event);
|
||||
|
||||
protected:
|
||||
@@ -116,6 +146,7 @@ enum
|
||||
Event_Dynamic,
|
||||
Event_Push,
|
||||
Event_Pop,
|
||||
Event_Custom,
|
||||
Event_Test
|
||||
};
|
||||
|
||||
@@ -140,11 +171,17 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
|
||||
EVT_MENU(Event_Connect, MyFrame::OnConnect)
|
||||
|
||||
EVT_MENU(Event_Custom, MyFrame::OnFireCustom)
|
||||
EVT_MENU(Event_Test, MyFrame::OnTest)
|
||||
EVT_MENU(Event_Push, MyFrame::OnPushEventHandler)
|
||||
EVT_MENU(Event_Pop, MyFrame::OnPopEventHandler)
|
||||
|
||||
EVT_UPDATE_UI(Event_Pop, MyFrame::OnUpdateUIPop)
|
||||
|
||||
EVT_MY_CUSTOM_COMMAND(-1, MyFrame::OnProcessCustom)
|
||||
|
||||
// this would also work:
|
||||
//EVT_CUSTOM(wxEVT_MY_CUSTOM_COMMAND, -1, MyFrame::OnProcessCustom)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
BEGIN_EVENT_TABLE(MyEvtHandler, wxEvtHandler)
|
||||
@@ -170,8 +207,8 @@ IMPLEMENT_APP(MyApp)
|
||||
bool MyApp::OnInit()
|
||||
{
|
||||
// create the main application window
|
||||
MyFrame *frame = new MyFrame("Event wxWindows Sample",
|
||||
wxPoint(50, 50), wxSize(450, 340));
|
||||
MyFrame *frame = new MyFrame(_T("Event wxWindows Sample"),
|
||||
wxPoint(50, 50), wxSize(600, 340));
|
||||
|
||||
// and show it (the frames, unlike simple controls, are not shown when
|
||||
// created initially)
|
||||
@@ -197,35 +234,38 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
||||
// create a menu bar
|
||||
wxMenu *menuFile = new wxMenu;
|
||||
|
||||
menuFile->Append(Event_About, "&About...\tCtrl-A", "Show about dialog");
|
||||
menuFile->Append(Event_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
|
||||
menuFile->AppendSeparator();
|
||||
menuFile->Append(Event_Quit, "E&xit\tAlt-X", "Quit this program");
|
||||
menuFile->Append(Event_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
|
||||
|
||||
wxMenu *menuEvent = new wxMenu;
|
||||
menuEvent->Append(Event_Connect, "&Connect\tCtrl-C",
|
||||
"Connect or disconnect the dynamic event handler",
|
||||
menuEvent->Append(Event_Connect, _T("&Connect\tCtrl-C"),
|
||||
_T("Connect or disconnect the dynamic event handler"),
|
||||
TRUE /* checkable */);
|
||||
menuEvent->Append(Event_Dynamic, "&Dynamic event\tCtrl-D",
|
||||
"Dynamic event sample - only works after Connect");
|
||||
menuEvent->Append(Event_Dynamic, _T("&Dynamic event\tCtrl-D"),
|
||||
_T("Dynamic event sample - only works after Connect"));
|
||||
menuEvent->AppendSeparator();
|
||||
menuEvent->Append(Event_Push, "&Push event handler\tCtrl-P",
|
||||
"Push event handler for test event");
|
||||
menuEvent->Append(Event_Pop, "P&op event handler\tCtrl-O",
|
||||
"Pop event handler for test event");
|
||||
menuEvent->Append(Event_Test, "Test event\tCtrl-T",
|
||||
"Test event processed by pushed event handler");
|
||||
menuEvent->Append(Event_Push, _T("&Push event handler\tCtrl-P"),
|
||||
_T("Push event handler for test event"));
|
||||
menuEvent->Append(Event_Pop, _T("P&op event handler\tCtrl-O"),
|
||||
_T("Pop event handler for test event"));
|
||||
menuEvent->Append(Event_Test, _T("Test event\tCtrl-T"),
|
||||
_T("Test event processed by pushed event handler"));
|
||||
menuEvent->AppendSeparator();
|
||||
menuEvent->Append(Event_Custom, _T("Fire c&ustom event\tCtrl-U"),
|
||||
_T("Generate a custom event"));
|
||||
|
||||
// now append the freshly created menu to the menu bar...
|
||||
wxMenuBar *menuBar = new wxMenuBar();
|
||||
menuBar->Append(menuFile, "&File");
|
||||
menuBar->Append(menuEvent, "&Event");
|
||||
menuBar->Append(menuFile, _T("&File"));
|
||||
menuBar->Append(menuEvent, _T("&Event"));
|
||||
|
||||
// ... and attach this menu bar to the frame
|
||||
SetMenuBar(menuBar);
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
CreateStatusBar(3);
|
||||
SetStatusText("Welcome to wxWindows event sample");
|
||||
SetStatusText(_T("Welcome to wxWindows event sample"));
|
||||
SetStatusText(_T("Dynamic: off"), Status_Dynamic);
|
||||
SetStatusText(_T("Push count: 0"), Status_Push);
|
||||
#endif // wxUSE_STATUSBAR
|
||||
@@ -322,3 +362,19 @@ void MyFrame::OnUpdateUIPop(wxUpdateUIEvent& event)
|
||||
event.Enable( m_nPush > 0 );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// custom event methods
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
void MyFrame::OnFireCustom(wxCommandEvent& event)
|
||||
{
|
||||
wxCommandEvent eventCustom(wxEVT_MY_CUSTOM_COMMAND);
|
||||
|
||||
wxPostEvent(this, eventCustom);
|
||||
}
|
||||
|
||||
void MyFrame::OnProcessCustom(wxCommandEvent& event)
|
||||
{
|
||||
wxLogMessage(_T("Got a custom event!"));
|
||||
}
|
||||
|
||||
|
@@ -75,6 +75,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
MENU_LINK(TogHideRoot)
|
||||
MENU_LINK(TogRootLines)
|
||||
MENU_LINK(TogBorder)
|
||||
MENU_LINK(TogFullHighlight)
|
||||
MENU_LINK(Dump)
|
||||
#ifndef NO_MULTIPLE_SELECTION
|
||||
MENU_LINK(DumpSelected)
|
||||
@@ -185,6 +186,7 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
|
||||
style_menu->Append(TreeTest_TogRootLines, "Toggle &lines at root");
|
||||
style_menu->Append(TreeTest_TogHideRoot, "Toggle &hidden root");
|
||||
style_menu->Append(TreeTest_TogBorder, "Toggle &item border");
|
||||
style_menu->Append(TreeTest_TogFullHighlight, "Toggle &full row highlight");
|
||||
style_menu->Append(TreeTest_TogEdit, "Toggle &edit mode");
|
||||
#ifndef NO_MULTIPLE_SELECTION
|
||||
style_menu->Append(TreeTest_ToggleSel, wxT("Toggle &selection mode"));
|
||||
|
@@ -153,6 +153,7 @@ public:
|
||||
void OnTogHideRoot(wxCommandEvent& event) { TogStyle(wxTR_HIDE_ROOT); }
|
||||
void OnTogRootLines(wxCommandEvent& event) { TogStyle(wxTR_LINES_AT_ROOT); }
|
||||
void OnTogBorder(wxCommandEvent& event) { TogStyle(wxTR_ROW_LINES); }
|
||||
void OnTogFullHighlight(wxCommandEvent& event) { TogStyle(wxTR_FULL_ROW_HIGHLIGHT); }
|
||||
|
||||
void OnDump(wxCommandEvent& event);
|
||||
#ifndef NO_MULTIPLE_SELECTION
|
||||
@@ -223,6 +224,7 @@ enum
|
||||
TreeTest_TogHideRoot,
|
||||
TreeTest_TogRootLines,
|
||||
TreeTest_TogBorder,
|
||||
TreeTest_TogFullHighlight,
|
||||
TreeTest_Dump,
|
||||
TreeTest_DumpSelected,
|
||||
TreeTest_Count,
|
||||
|
16
setup.h.in
16
setup.h.in
@@ -88,6 +88,9 @@
|
||||
/* PowerPC Darwin & Mac OS X */
|
||||
#undef __POWERPC__
|
||||
|
||||
/* MS-DOS with DJGPP */
|
||||
#undef __DOS__
|
||||
|
||||
/* Stupid hack; __WINDOWS__ clashes with wx/defs.h */
|
||||
#ifndef __WINDOWS__
|
||||
#undef __WINDOWS__
|
||||
@@ -551,10 +554,6 @@
|
||||
* Use streams
|
||||
*/
|
||||
#define wxUSE_STREAMS 0
|
||||
/*
|
||||
* Use class serialization
|
||||
*/
|
||||
#define wxUSE_SERIAL 0
|
||||
/*
|
||||
* Use sockets
|
||||
*/
|
||||
@@ -572,6 +571,10 @@
|
||||
* wxLibrary class
|
||||
*/
|
||||
#define wxUSE_DYNLIB_CLASS 0
|
||||
/*
|
||||
* Use wxObjectLoader
|
||||
*/
|
||||
#define wxUSE_DYNAMIC_LOADER 0
|
||||
|
||||
/*
|
||||
* Use wxTimer
|
||||
@@ -603,6 +606,11 @@
|
||||
*/
|
||||
#define wxUSE_UNICODE 0
|
||||
|
||||
/*
|
||||
* Use MS Layer for Unicode on Win9X (Win32 only)?
|
||||
*/
|
||||
#define wxUSE_UNICODE_MSLU 0
|
||||
|
||||
/*
|
||||
* Work around a bug in GNU libc 5.x wcstombs() implementation.
|
||||
*
|
||||
|
@@ -166,7 +166,7 @@ bool wxAppBase::OnInit()
|
||||
OnInitCmdLine(parser);
|
||||
|
||||
bool cont;
|
||||
switch ( parser.Parse() )
|
||||
switch ( parser.Parse(FALSE /* don't show usage */) )
|
||||
{
|
||||
case -1:
|
||||
cont = OnCmdLineHelp(parser);
|
||||
@@ -287,7 +287,7 @@ bool wxAppBase::OnCmdLineParsed(wxCmdLineParser& parser)
|
||||
if ( !SetDisplayMode(wxDisplayModeInfo(w, h, bpp)) )
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
#endif // __WXMGL__
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@@ -109,7 +109,9 @@ struct wxCmdLineOption
|
||||
|
||||
public:
|
||||
wxCmdLineEntryType kind;
|
||||
wxString shortName, longName, description;
|
||||
wxString shortName,
|
||||
longName,
|
||||
description;
|
||||
wxCmdLineParamType type;
|
||||
int flags;
|
||||
|
||||
@@ -476,7 +478,7 @@ void wxCmdLineParser::Reset()
|
||||
// the real work is done here
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
int wxCmdLineParser::Parse()
|
||||
int wxCmdLineParser::Parse(bool showUsage)
|
||||
{
|
||||
bool maybeOption = TRUE; // can the following arg be an option?
|
||||
bool ok = TRUE; // TRUE until an error is detected
|
||||
@@ -803,7 +805,7 @@ int wxCmdLineParser::Parse()
|
||||
}
|
||||
}
|
||||
|
||||
if ( !ok )
|
||||
if ( !ok && showUsage )
|
||||
{
|
||||
Usage();
|
||||
}
|
||||
@@ -849,13 +851,30 @@ void wxCmdLineParser::Usage()
|
||||
brief << _T('[');
|
||||
}
|
||||
|
||||
brief << chSwitch << opt.shortName;
|
||||
if ( !opt.shortName.empty() )
|
||||
{
|
||||
brief << chSwitch << opt.shortName;
|
||||
}
|
||||
else if ( !opt.longName.empty() )
|
||||
{
|
||||
brief << _T("--") << opt.longName;
|
||||
}
|
||||
else
|
||||
{
|
||||
wxFAIL_MSG( _T("option without neither short nor long name?") );
|
||||
}
|
||||
|
||||
wxString option;
|
||||
option << _T(" ") << chSwitch << opt.shortName;
|
||||
if ( !!opt.longName )
|
||||
|
||||
if ( !opt.shortName.empty() )
|
||||
{
|
||||
option << _T(" --") << opt.longName;
|
||||
option << _T(" ") << chSwitch << opt.shortName;
|
||||
}
|
||||
|
||||
if ( !opt.longName.empty() )
|
||||
{
|
||||
option << (option.empty() ? _T(" ") : _T(", "))
|
||||
<< _T("--") << opt.longName;
|
||||
}
|
||||
|
||||
if ( opt.kind != wxCMD_LINE_SWITCH )
|
||||
@@ -904,7 +923,13 @@ void wxCmdLineParser::Usage()
|
||||
wxLogMessage(m_data->m_logo);
|
||||
}
|
||||
|
||||
// in console mode we want to show the brief usage message first, then the
|
||||
// detailed one but in GUI build we give the details first and then the
|
||||
// summary - like this, the brief message appears in the wxLogGui dialog,
|
||||
// as expected
|
||||
#if !wxUSE_GUI
|
||||
wxLogMessage(brief);
|
||||
#endif // !wxUSE_GUI
|
||||
|
||||
// now construct the detailed help message
|
||||
size_t len, lenMax = 0;
|
||||
@@ -927,6 +952,11 @@ void wxCmdLineParser::Usage()
|
||||
}
|
||||
|
||||
wxLogMessage(detailed);
|
||||
|
||||
// do it now if not done above
|
||||
#if wxUSE_GUI
|
||||
wxLogMessage(brief);
|
||||
#endif // wxUSE_GUI
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -42,6 +42,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
#include <ctype.h>
|
||||
#include <limits.h> // for INT_MAX
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// global and class static variables
|
||||
@@ -99,36 +100,80 @@ wxConfigBase *wxConfigBase::Create()
|
||||
return ms_pConfig;
|
||||
}
|
||||
|
||||
wxString wxConfigBase::Read(const wxString& key, const wxString& defVal) const
|
||||
{
|
||||
wxString s;
|
||||
Read(key, &s, defVal);
|
||||
return s;
|
||||
}
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxConfigBase reading entries
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxConfigBase::Read(const wxString& key, wxString *str, const wxString& defVal) const
|
||||
{
|
||||
if (!Read(key, str))
|
||||
{
|
||||
*str = ExpandEnvVars(defVal);
|
||||
return FALSE;
|
||||
// implement both Read() overloads for the given type in terms of DoRead()
|
||||
#define IMPLEMENT_READ_FOR_TYPE(name, type, deftype, extra) \
|
||||
bool wxConfigBase::Read(const wxString& key, type *val) const \
|
||||
{ \
|
||||
wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") ); \
|
||||
\
|
||||
return DoRead##name(key, val); \
|
||||
} \
|
||||
\
|
||||
bool wxConfigBase::Read(const wxString& key, \
|
||||
type *val, \
|
||||
deftype defVal) const \
|
||||
{ \
|
||||
wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") ); \
|
||||
\
|
||||
if ( DoRead##name(key, val) ) \
|
||||
return TRUE; \
|
||||
\
|
||||
if ( IsRecordingDefaults() ) \
|
||||
{ \
|
||||
((wxConfigBase *)this)->DoWrite##name(key, defVal); \
|
||||
} \
|
||||
\
|
||||
*val = extra(defVal); \
|
||||
\
|
||||
return FALSE; \
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxConfigBase::Read(const wxString& key, long *pl, long defVal) const
|
||||
|
||||
IMPLEMENT_READ_FOR_TYPE(String, wxString, const wxString&, ExpandEnvVars)
|
||||
IMPLEMENT_READ_FOR_TYPE(Long, long, long, long)
|
||||
IMPLEMENT_READ_FOR_TYPE(Int, int, int, int)
|
||||
IMPLEMENT_READ_FOR_TYPE(Double, double, double, double)
|
||||
IMPLEMENT_READ_FOR_TYPE(Bool, bool, bool, bool)
|
||||
|
||||
#undef IMPLEMENT_READ_FOR_TYPE
|
||||
|
||||
// the DoReadXXX() for the other types have implementation in the base class
|
||||
// but can be overridden in the derived ones
|
||||
bool wxConfigBase::DoReadInt(const wxString& key, int *pi) const
|
||||
{
|
||||
if (!Read(key, pl))
|
||||
{
|
||||
*pl = defVal;
|
||||
wxCHECK_MSG( pi, FALSE, _T("wxConfig::Read(): NULL parameter") );
|
||||
|
||||
long l;
|
||||
if ( !DoReadLong(key, &l) )
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
|
||||
wxASSERT_MSG( l < INT_MAX, _T("overflow in wxConfig::DoReadInt") );
|
||||
|
||||
*pi = (int)l;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxConfigBase::Read(const wxString& key, double* val) const
|
||||
bool wxConfigBase::DoReadBool(const wxString& key, bool* val) const
|
||||
{
|
||||
wxCHECK_MSG( val, FALSE, _T("wxConfig::Read(): NULL parameter") );
|
||||
|
||||
long l;
|
||||
if ( !DoReadLong(key, &l) )
|
||||
return FALSE;
|
||||
|
||||
wxASSERT_MSG( l == 0 || l == 1, _T("bad bool value in wxConfig::DoReadInt") );
|
||||
|
||||
*val = l != 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxConfigBase::DoReadDouble(const wxString& key, double* val) const
|
||||
{
|
||||
wxString str;
|
||||
if ( Read(key, &str) )
|
||||
@@ -139,78 +184,7 @@ bool wxConfigBase::Read(const wxString& key, double* val) const
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxConfigBase::Read(const wxString& key, double* val, double defVal) const
|
||||
{
|
||||
if (!Read(key, val))
|
||||
{
|
||||
*val = defVal;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxConfigBase::Read(const wxString& key, bool* val) const
|
||||
{
|
||||
long l;
|
||||
if (Read(key, & l))
|
||||
{
|
||||
*val = (l != 0);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool wxConfigBase::Read(const wxString& key, bool* val, bool defVal) const
|
||||
{
|
||||
if (!Read(key, val))
|
||||
{
|
||||
*val = defVal;
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Convenience functions
|
||||
|
||||
bool wxConfigBase::Read(const wxString& key, int *pi) const
|
||||
{
|
||||
long l;
|
||||
bool ret = Read(key, &l);
|
||||
if (ret)
|
||||
*pi = (int) l;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool wxConfigBase::Read(const wxString& key, int *pi, int defVal) const
|
||||
{
|
||||
long l;
|
||||
bool ret = Read(key, &l, (long) defVal);
|
||||
if (ret)
|
||||
*pi = (int) l;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool wxConfigBase::Write(const wxString& key, double val)
|
||||
{
|
||||
wxString str;
|
||||
str.Printf(wxT("%g"), val);
|
||||
return Write(key, str);
|
||||
}
|
||||
|
||||
bool wxConfigBase::Write(const wxString& key, bool value)
|
||||
{
|
||||
return Write(key, value ? 1l : 0l);
|
||||
}
|
||||
|
||||
bool wxConfigBase::Write(const wxString& key, const wxChar *value)
|
||||
{
|
||||
// explicit cast needed, otherwise value would have been converted to bool
|
||||
return Write(key, wxString(value));
|
||||
}
|
||||
|
||||
// string reading helper
|
||||
wxString wxConfigBase::ExpandEnvVars(const wxString& str) const
|
||||
{
|
||||
wxString tmp; // Required for BC++
|
||||
@@ -221,6 +195,25 @@ wxString wxConfigBase::ExpandEnvVars(const wxString& str) const
|
||||
return tmp;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxConfigBase writing
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxConfigBase::DoWriteDouble(const wxString& key, double val)
|
||||
{
|
||||
return DoWriteString(key, wxString::Format(_T("%g"), val));
|
||||
}
|
||||
|
||||
bool wxConfigBase::DoWriteInt(const wxString& key, int value)
|
||||
{
|
||||
return DoWriteLong(key, (long)value);
|
||||
}
|
||||
|
||||
bool wxConfigBase::DoWriteBool(const wxString& key, bool value)
|
||||
{
|
||||
return DoWriteLong(key, value ? 1l : 0l);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxConfigPathChanger
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -102,7 +102,22 @@
|
||||
#define WX_TIMEZONE _timezone
|
||||
#elif defined(__MWERKS__)
|
||||
long wxmw_timezone = 28800;
|
||||
#define WX_TIMEZONE wxmw_timezone;
|
||||
#define WX_TIMEZONE wxmw_timezone
|
||||
#elif defined(__DJGPP__)
|
||||
#include <sys/timeb.h>
|
||||
#include <values.h>
|
||||
static long wxGetTimeZone()
|
||||
{
|
||||
static long timezone = MAXLONG; // invalid timezone
|
||||
if (timezone == MAXLONG)
|
||||
{
|
||||
struct timeb tb;
|
||||
ftime(&tb);
|
||||
timezone = tb.timezone;
|
||||
}
|
||||
return timezone;
|
||||
}
|
||||
#define WX_TIMEZONE wxGetTimeZone()
|
||||
#else // unknown platform - try timezone
|
||||
#define WX_TIMEZONE timezone
|
||||
#endif
|
||||
|
@@ -37,7 +37,6 @@
|
||||
#include "wx/filefn.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/tokenzr.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// conditional compilation
|
||||
@@ -68,14 +67,15 @@
|
||||
# define wxDllOpen(lib) shl_load(lib.fn_str(), BIND_DEFERRED, 0)
|
||||
# define wxDllClose shl_unload
|
||||
|
||||
static inline void *wxDllGetSymbol(shl_t handle, const wxString& name)
|
||||
{
|
||||
void *sym;
|
||||
if ( shl_findsym(&handle, name.mb_str(), TYPE_UNDEFINED, &sym) == 0 )
|
||||
return sym;
|
||||
else
|
||||
return (void *)0;
|
||||
}
|
||||
static inline void *wxDllGetSymbol(shl_t handle, const wxString& name)
|
||||
{
|
||||
void *sym;
|
||||
if ( shl_findsym(&handle, name.mb_str(), TYPE_UNDEFINED, &sym) == 0 )
|
||||
return sym;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#elif defined(__DARWIN__)
|
||||
/* Porting notes:
|
||||
* The dlopen port is a port from dl_next.xs by Anno Siegel.
|
||||
@@ -174,7 +174,7 @@ void wxLibrary::PrepareClasses(wxClassInfo *first)
|
||||
{
|
||||
if (info->m_className)
|
||||
classTable.Put(info->m_className, (wxObject *)info);
|
||||
info = (wxClassInfo *)info->GetNext();
|
||||
info = info->m_next;
|
||||
}
|
||||
|
||||
// Set base pointers for each wxClassInfo
|
||||
@@ -198,27 +198,19 @@ void *wxLibrary::GetSymbol(const wxString& symbname)
|
||||
// wxDllLoader
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/* static */
|
||||
wxString wxDllLoader::GetDllExt()
|
||||
{
|
||||
wxString ext;
|
||||
|
||||
#if defined(__WINDOWS__) || defined(__WXPM__) || defined(__EMX__)
|
||||
ext = _T(".dll");
|
||||
const wxString wxDllLoader::ms_dllext( _T(".dll") );
|
||||
#elif defined(__UNIX__)
|
||||
# if defined(__HPUX__)
|
||||
ext = _T(".sl");
|
||||
# else //__HPUX__
|
||||
ext = _T(".so");
|
||||
# endif //__HPUX__
|
||||
#if defined(__HPUX__)
|
||||
const wxString wxDllLoader::ms_dllext( _T(".sl") );
|
||||
#else
|
||||
const wxString wxDllLoader::ms_dllext( _T(".so") );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return ext;
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxDllType
|
||||
wxDllLoader::GetProgramHandle(void)
|
||||
wxDllType wxDllLoader::GetProgramHandle()
|
||||
{
|
||||
#if defined( HAVE_DLOPEN ) && !defined(__EMX__)
|
||||
// optain handle for main program
|
||||
@@ -233,110 +225,124 @@ wxDllLoader::GetProgramHandle(void)
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxDllType
|
||||
wxDllLoader::LoadLibrary(const wxString & libname, bool *success)
|
||||
wxDllType wxDllLoader::LoadLibrary(const wxString & libname, bool *success)
|
||||
{
|
||||
wxDllType handle;
|
||||
wxDllType handle;
|
||||
bool failed = FALSE;
|
||||
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
FSSpec myFSSpec ;
|
||||
Ptr myMainAddr ;
|
||||
Str255 myErrName ;
|
||||
FSSpec myFSSpec;
|
||||
Ptr myMainAddr;
|
||||
Str255 myErrName;
|
||||
|
||||
wxMacFilename2FSSpec( libname , &myFSSpec ) ;
|
||||
if (GetDiskFragment( &myFSSpec , 0 , kCFragGoesToEOF , "\p" , kPrivateCFragCopy , &handle , &myMainAddr ,
|
||||
myErrName ) != noErr )
|
||||
wxMacFilename2FSSpec( libname , &myFSSpec );
|
||||
|
||||
if( GetDiskFragment( &myFSSpec,
|
||||
0,
|
||||
kCFragGoesToEOF,
|
||||
"\p",
|
||||
kPrivateCFragCopy,
|
||||
&handle,
|
||||
&myMainAddr,
|
||||
myErrName ) != noErr )
|
||||
{
|
||||
p2cstr( myErrName ) ;
|
||||
wxLogSysError( _("Failed to load shared library '%s' Error '%s'") , libname.c_str() , (char*)myErrName ) ;
|
||||
handle = NULL ;
|
||||
p2cstr( myErrName );
|
||||
wxLogSysError( _("Failed to load shared library '%s' Error '%s'"),
|
||||
libname.c_str(),
|
||||
(char*)myErrName );
|
||||
handle = 0;
|
||||
failed = TRUE;
|
||||
}
|
||||
|
||||
#elif defined(__WXPM__) || defined(__EMX__)
|
||||
char zError[256] = "";
|
||||
char zError[256] = "";
|
||||
wxDllOpen(zError, libname, handle);
|
||||
#else // !Mac
|
||||
|
||||
#else
|
||||
handle = wxDllOpen(libname);
|
||||
#endif // OS
|
||||
|
||||
#endif
|
||||
|
||||
if ( !handle )
|
||||
{
|
||||
wxString msg(_("Failed to load shared library '%s'"));
|
||||
|
||||
#ifdef HAVE_DLERROR
|
||||
const char *errmsg = dlerror();
|
||||
if ( errmsg )
|
||||
wxChar *err = dlerror();
|
||||
if( err )
|
||||
{
|
||||
// the error string format is "libname: ...", but we already have
|
||||
// libname, so cut it off
|
||||
const char *p = strchr(errmsg, ':');
|
||||
if ( p )
|
||||
{
|
||||
if ( *++p == ' ' )
|
||||
p++;
|
||||
}
|
||||
else
|
||||
{
|
||||
p = errmsg;
|
||||
}
|
||||
|
||||
msg += _T(" (%s)");
|
||||
wxLogError(msg, libname.c_str(), p);
|
||||
}
|
||||
else
|
||||
#endif // HAVE_DLERROR
|
||||
{
|
||||
wxLogSysError(msg, libname.c_str());
|
||||
failed = TRUE;
|
||||
wxLogError( msg, err );
|
||||
}
|
||||
#else
|
||||
failed = TRUE;
|
||||
wxLogSysError( msg, libname.c_str() );
|
||||
#endif
|
||||
}
|
||||
|
||||
if ( success )
|
||||
{
|
||||
*success = handle != 0;
|
||||
}
|
||||
*success = !failed;
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
|
||||
/* static */
|
||||
void
|
||||
wxDllLoader::UnloadLibrary(wxDllType handle)
|
||||
void wxDllLoader::UnloadLibrary(wxDllType handle)
|
||||
{
|
||||
wxDllClose(handle);
|
||||
}
|
||||
|
||||
/* static */
|
||||
void *
|
||||
wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name)
|
||||
void *wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *success)
|
||||
{
|
||||
void *symbol = NULL; // return value
|
||||
bool failed = FALSE;
|
||||
void *symbol = 0;
|
||||
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
Ptr symAddress ;
|
||||
CFragSymbolClass symClass ;
|
||||
Str255 symName ;
|
||||
Ptr symAddress;
|
||||
CFragSymbolClass symClass;
|
||||
Str255 symName;
|
||||
|
||||
#if TARGET_CARBON
|
||||
c2pstrcpy( (StringPtr) symName , name ) ;
|
||||
c2pstrcpy( (StringPtr) symName, name );
|
||||
#else
|
||||
strcpy( (char *) symName , name ) ;
|
||||
c2pstr( (char *) symName ) ;
|
||||
strcpy( (char *) symName, name );
|
||||
c2pstr( (char *) symName );
|
||||
#endif
|
||||
if( FindSymbol( dllHandle, symName, &symAddress, &symClass ) == noErr )
|
||||
symbol = (void *)symAddress;
|
||||
|
||||
if ( FindSymbol( dllHandle , symName , &symAddress , &symClass ) == noErr )
|
||||
symbol = (void *)symAddress ;
|
||||
#elif defined( __WXPM__ ) || defined(__EMX__)
|
||||
#elif defined(__WXPM__) || defined(__EMX__)
|
||||
wxDllGetSymbol(dllHandle, symbol);
|
||||
|
||||
#else
|
||||
// mb_str() is necessary in Unicode build
|
||||
symbol = wxDllGetSymbol(dllHandle, name.mb_str());
|
||||
|
||||
#endif
|
||||
|
||||
if ( !symbol )
|
||||
{
|
||||
wxString msg(_("wxDllLoader failed to GetSymbol '%s'"));
|
||||
|
||||
#ifdef HAVE_DLERROR
|
||||
wxChar *err = dlerror();
|
||||
if( err )
|
||||
{
|
||||
failed = TRUE;
|
||||
wxLogError( msg, err );
|
||||
}
|
||||
#else
|
||||
failed = TRUE;
|
||||
wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"),
|
||||
name.c_str());
|
||||
#endif
|
||||
}
|
||||
|
||||
if( success )
|
||||
*success = !failed;
|
||||
|
||||
return symbol;
|
||||
}
|
||||
|
||||
@@ -362,59 +368,26 @@ wxLibraries::~wxLibraries()
|
||||
|
||||
wxLibrary *wxLibraries::LoadLibrary(const wxString& name)
|
||||
{
|
||||
wxNode *node;
|
||||
wxLibrary *lib;
|
||||
wxLibrary *lib;
|
||||
wxClassInfo *old_sm_first;
|
||||
wxNode *node = m_loaded.Find(name.GetData());
|
||||
|
||||
#if defined(__VISAGECPP__)
|
||||
node = m_loaded.Find(name.GetData());
|
||||
if (node != NULL)
|
||||
return ((wxLibrary *)node->Data());
|
||||
#else // !OS/2
|
||||
if ( (node = m_loaded.Find(name.GetData())) != NULL)
|
||||
return ((wxLibrary *)node->Data());
|
||||
#endif
|
||||
|
||||
// If DLL shares data, this is necessary.
|
||||
old_sm_first = wxClassInfo::sm_first;
|
||||
wxClassInfo::sm_first = NULL;
|
||||
|
||||
wxString libname = ConstructLibraryName(name);
|
||||
|
||||
/*
|
||||
Unix automatically builds that library name, at least for dlopen()
|
||||
*/
|
||||
#if 0
|
||||
#if defined(__UNIX__)
|
||||
// found the first file in LD_LIBRARY_PATH with this name
|
||||
wxString libPath("/lib:/usr/lib"); // system path first
|
||||
const char *envLibPath = getenv("LD_LIBRARY_PATH");
|
||||
if ( envLibPath )
|
||||
libPath << wxT(':') << envLibPath;
|
||||
wxStringTokenizer tokenizer(libPath, wxT(':'));
|
||||
while ( tokenizer.HasMoreToken() )
|
||||
{
|
||||
wxString fullname(tokenizer.NextToken());
|
||||
|
||||
fullname << wxT('/') << libname;
|
||||
if ( wxFileExists(fullname) )
|
||||
{
|
||||
libname = fullname;
|
||||
|
||||
// found the library
|
||||
break;
|
||||
}
|
||||
}
|
||||
//else: not found in the path, leave the name as is (secutiry risk?)
|
||||
|
||||
#endif // __UNIX__
|
||||
#endif
|
||||
|
||||
bool success = FALSE;
|
||||
wxDllType handle = wxDllLoader::LoadLibrary(libname, &success);
|
||||
if(success)
|
||||
{
|
||||
lib = new wxLibrary(handle);
|
||||
wxClassInfo::sm_first = old_sm_first;
|
||||
|
||||
m_loaded.Append(name.GetData(), lib);
|
||||
}
|
||||
else
|
||||
|
598
src/common/dynload.cpp
Normal file
598
src/common/dynload.cpp
Normal file
@@ -0,0 +1,598 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: dynload.cpp
|
||||
// Purpose: Dynamic loading framework
|
||||
// Author: Ron Lee, David Falkinder, Vadim Zeitlin and a cast of 1000's
|
||||
// (derived in part from dynlib.cpp (c) 1998 Guilhem Lavaux)
|
||||
// Modified by:
|
||||
// Created: 03/12/01
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2001 Ron Lee <ron@debian.org>
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "dynload.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// headers
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#if wxUSE_DYNAMIC_LOADER
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
#include "wx/msw/private.h"
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#endif
|
||||
|
||||
#include "wx/dynload.h"
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// conditional compilation
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#if defined(__WXPM__) || defined(__EMX__)
|
||||
#define INCL_DOS
|
||||
#include <os2.h>
|
||||
#define wxDllOpen(error, lib, handle) DosLoadModule(error, sizeof(error), lib, &handle)
|
||||
#define wxDllGetSymbol(handle, modaddr) DosQueryProcAddr(handle, 1L, NULL, (PFN*)modaddr)
|
||||
#define wxDllClose(handle) DosFreeModule(handle)
|
||||
|
||||
#elif defined(HAVE_DLOPEN)
|
||||
// note about dlopen() flags: we use RTLD_NOW to have more Windows-like
|
||||
// behaviour (Win won't let you load a library with missing symbols) and
|
||||
// RTLD_GLOBAL because it is needed sometimes and probably doesn't hurt
|
||||
// otherwise. On True64-Unix RTLD_GLOBAL is not allowed and on VMS the
|
||||
// second argument on dlopen is ignored.
|
||||
|
||||
#ifdef __VMS
|
||||
#define wxDllOpen(lib) dlopen(lib.fn_str(), 0)
|
||||
|
||||
#elif defined( __osf__ )
|
||||
#define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_LAZY)
|
||||
|
||||
#else
|
||||
#define wxDllOpen(lib) dlopen(lib.fn_str(), RTLD_LAZY | RTLD_GLOBAL)
|
||||
#endif // __VMS
|
||||
|
||||
#define wxDllGetSymbol(handle, name) dlsym(handle, name)
|
||||
#define wxDllClose dlclose
|
||||
|
||||
#elif defined(HAVE_SHL_LOAD)
|
||||
#define wxDllOpen(lib) shl_load(lib.fn_str(), BIND_DEFERRED, 0)
|
||||
#define wxDllClose shl_unload
|
||||
|
||||
static inline void *wxDllGetSymbol(shl_t handle, const wxString& name)
|
||||
{
|
||||
void *sym;
|
||||
return ( shl_findsym(&handle, name.mb_str(), TYPE_UNDEFINED, &sym) == 0 )
|
||||
? sym : 0;
|
||||
}
|
||||
|
||||
#elif defined(__DARWIN__)
|
||||
|
||||
// Porting notes:
|
||||
// The dlopen port is a port from dl_next.xs by Anno Siegel.
|
||||
// dl_next.xs is itself a port from dl_dlopen.xs by Paul Marquess.
|
||||
// The method used here is just to supply the sun style dlopen etc.
|
||||
// functions in terms of Darwin NS*.
|
||||
|
||||
void *dlopen(const char *path, int mode); // mode is ignored
|
||||
void *dlsym(void *handle, const char *symbol);
|
||||
int dlclose(void *handle);
|
||||
const char *dlerror(void);
|
||||
|
||||
#define wxDllOpen(lib) dlopen(lib.fn_str(), 0)
|
||||
#define wxDllGetSymbol(handle, name) dlsym(handle, name)
|
||||
#define wxDllClose dlclose
|
||||
|
||||
#elif defined(__WINDOWS__)
|
||||
|
||||
// using LoadLibraryEx under Win32 to avoid name clash with LoadLibrary
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
||||
#ifdef _UNICODE
|
||||
#define wxDllOpen(lib) ::LoadLibraryExW(lib, 0, 0)
|
||||
#else
|
||||
#define wxDllOpen(lib) ::LoadLibraryExA(lib, 0, 0)
|
||||
#endif
|
||||
|
||||
#else // Win16
|
||||
#define wxDllOpen(lib) ::LoadLibrary(lib)
|
||||
#endif // Win32/16
|
||||
#define wxDllGetSymbol(handle, name) ::GetProcAddress(handle, name)
|
||||
#define wxDllClose ::FreeLibrary
|
||||
|
||||
#elif defined(__WXMAC__)
|
||||
#define wxDllClose(handle) CloseConnection(&handle)
|
||||
#else
|
||||
#error "Don't know how to load shared libraries on this platform."
|
||||
#endif
|
||||
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
// ============================================================================
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxDllLoader (all these methods are static)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
#if defined(__WINDOWS__) || defined(__WXPM__) || defined(__EMX__)
|
||||
const wxString wxDllLoader::ms_dllext( _T(".dll") );
|
||||
#elif defined(__UNIX__)
|
||||
#if defined(__HPUX__)
|
||||
const wxString wxDllLoader::ms_dllext( _T(".sl") );
|
||||
#else
|
||||
const wxString wxDllLoader::ms_dllext( _T(".so") );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
wxDllType wxDllLoader::GetProgramHandle()
|
||||
{
|
||||
#if defined( HAVE_DLOPEN ) && !defined(__EMX__)
|
||||
// obtain handle for main program
|
||||
return dlopen(NULL, RTLD_NOW/*RTLD_LAZY*/);
|
||||
#elif defined (HAVE_SHL_LOAD)
|
||||
// shl_findsymbol with NULL handle looks up in main program
|
||||
return 0;
|
||||
#else
|
||||
wxFAIL_MSG( wxT("This method is not implemented under Windows or OS/2"));
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
wxDllType wxDllLoader::LoadLibrary(const wxString &name)
|
||||
{
|
||||
wxString libname( name + wxDllLoader::GetDllExt() );
|
||||
wxDllType handle;
|
||||
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
FSSpec myFSSpec;
|
||||
Ptr myMainAddr;
|
||||
Str255 myErrName;
|
||||
|
||||
wxMacFilename2FSSpec( libname , &myFSSpec );
|
||||
|
||||
if( GetDiskFragment( &myFSSpec,
|
||||
0,
|
||||
kCFragGoesToEOF,
|
||||
"\p",
|
||||
kPrivateCFragCopy,
|
||||
&handle,
|
||||
&myMainAddr,
|
||||
myErrName ) != noErr )
|
||||
{
|
||||
p2cstr( myErrName );
|
||||
wxLogSysError( _("Failed to load shared library '%s' Error '%s'"),
|
||||
libname.c_str(),
|
||||
(char*)myErrName );
|
||||
handle = 0;
|
||||
}
|
||||
|
||||
#elif defined(__WXPM__) || defined(__EMX__)
|
||||
char zError[256] = "";
|
||||
wxDllOpen(zError, libname, handle);
|
||||
#else
|
||||
handle = wxDllOpen(libname);
|
||||
#endif
|
||||
if ( !handle )
|
||||
{
|
||||
wxString msg(_("Failed to load shared library '%s'"));
|
||||
#ifdef HAVE_DLERROR
|
||||
wxChar *err = dlerror();
|
||||
if( err )
|
||||
wxLogError( msg, err );
|
||||
#else
|
||||
wxLogSysError( msg, libname.c_str() );
|
||||
#endif
|
||||
}
|
||||
return handle;
|
||||
}
|
||||
|
||||
void wxDllLoader::UnloadLibrary(wxDllType handle)
|
||||
{
|
||||
wxDllClose(handle);
|
||||
}
|
||||
|
||||
void *wxDllLoader::GetSymbol(wxDllType dllHandle, const wxString &name, bool *success)
|
||||
{
|
||||
bool failed = FALSE;
|
||||
void *symbol = 0;
|
||||
|
||||
#if defined(__WXMAC__) && !defined(__UNIX__)
|
||||
Ptr symAddress;
|
||||
CFragSymbolClass symClass;
|
||||
Str255 symName;
|
||||
#if TARGET_CARBON
|
||||
c2pstrcpy( (StringPtr) symName, name );
|
||||
#else
|
||||
strcpy( (char *) symName, name );
|
||||
c2pstr( (char *) symName );
|
||||
#endif
|
||||
if( FindSymbol( dllHandle, symName, &symAddress, &symClass ) == noErr )
|
||||
symbol = (void *)symAddress;
|
||||
|
||||
#elif defined(__WXPM__) || defined(__EMX__)
|
||||
wxDllGetSymbol(dllHandle, symbol);
|
||||
#else
|
||||
|
||||
// mb_str() is necessary in Unicode build
|
||||
symbol = wxDllGetSymbol(dllHandle, name.mb_str());
|
||||
#endif
|
||||
|
||||
if ( !symbol )
|
||||
{
|
||||
wxString msg(_("wxDllLoader failed to GetSymbol '%s'"));
|
||||
#ifdef HAVE_DLERROR
|
||||
wxChar *err = dlerror();
|
||||
if( err )
|
||||
{
|
||||
failed = TRUE;
|
||||
wxLogError( msg, err );
|
||||
}
|
||||
#else
|
||||
failed = TRUE;
|
||||
wxLogSysError(_("Couldn't find symbol '%s' in a dynamic library"),
|
||||
name.c_str());
|
||||
#endif
|
||||
}
|
||||
if( success )
|
||||
*success = !failed;
|
||||
|
||||
return symbol;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxDLManifestEntry
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
wxDLImports wxDLManifestEntry::ms_classes(wxKEY_STRING);
|
||||
|
||||
wxDLManifestEntry::wxDLManifestEntry( const wxString &libname )
|
||||
: m_before(wxClassInfo::sm_first)
|
||||
, m_handle(wxDllLoader::LoadLibrary( libname ))
|
||||
, m_after(wxClassInfo::sm_first)
|
||||
, m_count(1)
|
||||
{
|
||||
if( m_handle != 0 )
|
||||
{
|
||||
UpdateClassInfo();
|
||||
RegisterModules();
|
||||
}
|
||||
else
|
||||
--m_count; // Flag us for deletion
|
||||
}
|
||||
|
||||
wxDLManifestEntry::~wxDLManifestEntry()
|
||||
{
|
||||
UnregisterModules();
|
||||
RestoreClassInfo();
|
||||
|
||||
wxDllLoader::UnloadLibrary(m_handle);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------
|
||||
// Private methods
|
||||
// ------------------------
|
||||
|
||||
void wxDLManifestEntry::UpdateClassInfo()
|
||||
{
|
||||
wxClassInfo *info;
|
||||
wxHashTable *t = wxClassInfo::sm_classTable;
|
||||
|
||||
// FIXME: Below is simply a cut and paste specialisation of
|
||||
// wxClassInfo::InitializeClasses. Once this stabilises,
|
||||
// the two should probably be merged.
|
||||
//
|
||||
// Actually it's becoming questionable whether we should merge
|
||||
// this info with the main ClassInfo tables since we can nearly
|
||||
// handle this completely internally now and it does expose
|
||||
// certain (minimal % user_stupidy) risks.
|
||||
|
||||
for(info = m_after; info != m_before; info = info->m_next)
|
||||
{
|
||||
if( info->m_className )
|
||||
{
|
||||
if( t->Get(info->m_className) == 0 )
|
||||
t->Put(info->m_className, (wxObject *)info);
|
||||
|
||||
// Hash all the class names into a local table too so
|
||||
// we can quickly find the entry they correspond to.
|
||||
|
||||
if( ms_classes.Get(info->m_className) == 0 )
|
||||
ms_classes.Put(info->m_className, (wxObject *) this);
|
||||
}
|
||||
}
|
||||
|
||||
for(info = m_after; info != m_before; info = info->m_next)
|
||||
{
|
||||
if( info->m_baseClassName1 )
|
||||
info->m_baseInfo1 = (wxClassInfo *)t->Get(info->m_baseClassName1);
|
||||
if( info->m_baseClassName2 )
|
||||
info->m_baseInfo2 = (wxClassInfo *)t->Get(info->m_baseClassName2);
|
||||
}
|
||||
}
|
||||
|
||||
void wxDLManifestEntry::RestoreClassInfo()
|
||||
{
|
||||
wxClassInfo *info;
|
||||
|
||||
for(info = m_after; info != m_before; info = info->m_next)
|
||||
{
|
||||
wxClassInfo::sm_classTable->Delete(info->m_className);
|
||||
ms_classes.Delete(info->m_className);
|
||||
}
|
||||
|
||||
if( wxClassInfo::sm_first == m_after )
|
||||
wxClassInfo::sm_first = m_before;
|
||||
else
|
||||
{
|
||||
info = wxClassInfo::sm_first;
|
||||
while( info->m_next && info->m_next != m_after ) info = info->m_next;
|
||||
|
||||
wxASSERT_MSG( info, _T("ClassInfo from wxDynamicLibrary not found on purge"))
|
||||
|
||||
info->m_next = m_before;
|
||||
}
|
||||
}
|
||||
|
||||
void wxDLManifestEntry::RegisterModules()
|
||||
{
|
||||
// Plugin libraries might have wxModules, Register and initialise them if
|
||||
// they do.
|
||||
//
|
||||
// Note that these classes are NOT included in the reference counting since
|
||||
// it's implicit that they will be unloaded if and when the last handle to
|
||||
// the library is. We do have to keep a copy of the module's pointer
|
||||
// though, as there is currently no way to Unregister it without it.
|
||||
|
||||
wxASSERT_MSG( m_count == 1,
|
||||
_T("RegisterModules should only be called for the first load") );
|
||||
|
||||
for(wxClassInfo *info = m_after; info != m_before; info = info->m_next)
|
||||
{
|
||||
if( info->IsKindOf(CLASSINFO(wxModule)) )
|
||||
{
|
||||
wxModule *m = wxDynamicCast(info->CreateObject(), wxModule);
|
||||
|
||||
wxASSERT_MSG( m, _T("wxDynamicCast of wxModule failed") );
|
||||
|
||||
m_wxmodules.Append(m);
|
||||
wxModule::RegisterModule(m);
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Likewise this is (well was) very similar to InitializeModules()
|
||||
|
||||
for(wxModuleList::Node *node = m_wxmodules.GetFirst(); node; node->GetNext())
|
||||
{
|
||||
if( !node->GetData()->Init() )
|
||||
{
|
||||
wxLogDebug(_T("wxModule::Init() failed for wxDynamicLibrary"));
|
||||
|
||||
// XXX: Watch this, a different hash implementation might break it,
|
||||
// a good hash implementation would let us fix it though.
|
||||
|
||||
// The name of the game is to remove any uninitialised modules and
|
||||
// let the dtor Exit the rest on shutdown, (which we'll initiate
|
||||
// shortly).
|
||||
|
||||
wxModuleList::Node *oldNode = 0;
|
||||
do {
|
||||
node = node->GetNext();
|
||||
delete oldNode;
|
||||
wxModule::UnregisterModule( node->GetData() );
|
||||
oldNode = node;
|
||||
} while( node );
|
||||
|
||||
--m_count; // Flag us for deletion
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wxDLManifestEntry::UnregisterModules()
|
||||
{
|
||||
wxModuleList::Node *node;
|
||||
|
||||
for(node = m_wxmodules.GetFirst(); node; node->GetNext())
|
||||
node->GetData()->Exit();
|
||||
|
||||
for(node = m_wxmodules.GetFirst(); node; node->GetNext())
|
||||
wxModule::UnregisterModule( node->GetData() );
|
||||
|
||||
m_wxmodules.DeleteContents(TRUE);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// wxDynamicLibrary
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
wxDLManifest wxDynamicLibrary::ms_manifest(wxKEY_STRING);
|
||||
|
||||
// ------------------------
|
||||
// Static accessors
|
||||
// ------------------------
|
||||
|
||||
wxDLManifestEntry *wxDynamicLibrary::Link(const wxString &libname)
|
||||
{
|
||||
wxDLManifestEntry *entry = (wxDLManifestEntry*) ms_manifest.Get(libname);
|
||||
|
||||
if( entry )
|
||||
{
|
||||
entry->Ref();
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = new wxDLManifestEntry( libname );
|
||||
|
||||
if( entry->IsLoaded() )
|
||||
{
|
||||
ms_manifest.Put(libname, (wxObject*) entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
wxCHECK_MSG( !entry->Unref(), 0,
|
||||
_T("Currently linked library is, ..not loaded??") );
|
||||
entry = 0;
|
||||
}
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
bool wxDynamicLibrary::Unlink(const wxString &libname)
|
||||
{
|
||||
wxDLManifestEntry *entry = (wxDLManifestEntry*) ms_manifest.Get(libname);
|
||||
|
||||
if( entry )
|
||||
return entry->Unref();
|
||||
|
||||
wxLogDebug(_T("Attempt to Unlink library '%s' (which is not linked)."), libname.c_str());
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ------------------------
|
||||
// Class implementation
|
||||
// ------------------------
|
||||
|
||||
wxDynamicLibrary::wxDynamicLibrary(const wxString &libname)
|
||||
{
|
||||
m_entry = (wxDLManifestEntry*) ms_manifest.Get(libname);
|
||||
|
||||
if( m_entry != 0 )
|
||||
{
|
||||
m_entry->Ref();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_entry = new wxDLManifestEntry( libname );
|
||||
ms_manifest.Put(libname, (wxObject*) m_entry);
|
||||
|
||||
wxASSERT_MSG( m_entry != 0, _T("Failed to create manifest entry") );
|
||||
}
|
||||
}
|
||||
|
||||
wxDynamicLibrary::~wxDynamicLibrary()
|
||||
{
|
||||
wxNode *node;
|
||||
ms_manifest.BeginFind();
|
||||
|
||||
// It's either this or store the name of the lib just to do this.
|
||||
|
||||
for(node = ms_manifest.Next(); node; node = ms_manifest.Next())
|
||||
if( (wxDLManifestEntry*)node->GetData() == m_entry )
|
||||
break;
|
||||
|
||||
if( m_entry && m_entry->Unref() )
|
||||
delete node;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __DARWIN__
|
||||
// ---------------------------------------------------------------------------
|
||||
// For Darwin/Mac OS X
|
||||
// supply the sun style dlopen functions in terms of Darwin NS*
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
extern "C" {
|
||||
#import <mach-o/dyld.h>
|
||||
};
|
||||
|
||||
enum dyldErrorSource
|
||||
{
|
||||
OFImage,
|
||||
};
|
||||
|
||||
static char dl_last_error[1024];
|
||||
|
||||
static
|
||||
void TranslateError(const char *path, enum dyldErrorSource type, int number)
|
||||
{
|
||||
unsigned int index;
|
||||
static char *OFIErrorStrings[] =
|
||||
{
|
||||
"%s(%d): Object Image Load Failure\n",
|
||||
"%s(%d): Object Image Load Success\n",
|
||||
"%s(%d): Not an recognisable object file\n",
|
||||
"%s(%d): No valid architecture\n",
|
||||
"%s(%d): Object image has an invalid format\n",
|
||||
"%s(%d): Invalid access (permissions?)\n",
|
||||
"%s(%d): Unknown error code from NSCreateObjectFileImageFromFile\n",
|
||||
};
|
||||
#define NUM_OFI_ERRORS (sizeof(OFIErrorStrings) / sizeof(OFIErrorStrings[0]))
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case OFImage:
|
||||
index = number;
|
||||
if (index > NUM_OFI_ERRORS - 1) {
|
||||
index = NUM_OFI_ERRORS - 1;
|
||||
}
|
||||
sprintf(dl_last_error, OFIErrorStrings[index], path, number);
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf(dl_last_error, "%s(%d): Totally unknown error type %d\n",
|
||||
path, number, type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
const char *dlerror()
|
||||
{
|
||||
return dl_last_error;
|
||||
}
|
||||
void *dlopen(const char *path, int mode /* mode is ignored */)
|
||||
{
|
||||
int dyld_result;
|
||||
NSObjectFileImage ofile;
|
||||
NSModule handle = 0;
|
||||
|
||||
dyld_result = NSCreateObjectFileImageFromFile(path, &ofile);
|
||||
if(dyld_result != NSObjectFileImageSuccess)
|
||||
{
|
||||
TranslateError(path, OFImage, dyld_result);
|
||||
}
|
||||
else
|
||||
{
|
||||
// NSLinkModule will cause the run to abort on any link error's
|
||||
// not very friendly but the error recovery functionality is limited.
|
||||
handle = NSLinkModule(ofile, path, TRUE);
|
||||
}
|
||||
|
||||
return handle;
|
||||
}
|
||||
|
||||
int dlclose(void *handle) /* stub only */
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void *dlsym(void *handle, const char *symbol)
|
||||
{
|
||||
return NSIsSymbolNameDefined(symbol)
|
||||
? NSAddressOfSymbol( NSLookupAndBindSymbol(symbol) )
|
||||
: 0 ;
|
||||
}
|
||||
|
||||
#endif // __DARWIN__
|
||||
#endif // wxUSE_DYNAMIC_LOADER
|
||||
|
||||
// vi:sts=4:sw=4:et
|
@@ -59,9 +59,16 @@
|
||||
#ifdef __GNUWIN32__
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#elif defined(__DOS__) && defined(__WATCOMC__)
|
||||
#include <io.h>
|
||||
char* mktemp(char *path) { return _mktemp(path); }
|
||||
#elif defined(__DOS__)
|
||||
#if defined(__WATCOMC__)
|
||||
#include <io.h>
|
||||
#elif defined(__DJGPP__)
|
||||
#include <io.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#else
|
||||
#error "Please specify the header with file functions declarations."
|
||||
#endif
|
||||
#elif (defined(__WXPM__))
|
||||
#include <io.h>
|
||||
#define W_OK 2
|
||||
@@ -425,7 +432,7 @@ bool wxFile::Eof() const
|
||||
|
||||
int iRc;
|
||||
|
||||
#if defined(__UNIX__) || defined(__GNUWIN32__) || defined( __MWERKS__ ) || defined(__SALFORDC__)
|
||||
#if defined(__DOS__) || defined(__UNIX__) || defined(__GNUWIN32__) || defined( __MWERKS__ ) || defined(__SALFORDC__)
|
||||
// @@ this doesn't work, of course, on unseekable file descriptors
|
||||
off_t ofsCur = Tell(),
|
||||
ofsMax = Length();
|
||||
@@ -471,7 +478,7 @@ bool wxTempFile::Open(const wxString& strName)
|
||||
{
|
||||
m_strName = strName;
|
||||
|
||||
m_strTemp = wxFileName::CreateTempFileName(strName);
|
||||
m_strTemp = wxFileName::CreateTempFileName(strName, &m_file);
|
||||
|
||||
if ( m_strTemp.empty() )
|
||||
{
|
||||
@@ -479,13 +486,6 @@ bool wxTempFile::Open(const wxString& strName)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// actually open the file now (it must already exist)
|
||||
if ( !m_file.Open(m_strTemp, wxFile::write) )
|
||||
{
|
||||
// opening existing file failed?
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef __UNIX__
|
||||
// the temp file should have the same permissions as the original one
|
||||
mode_t mode;
|
||||
|
@@ -819,8 +819,7 @@ bool wxFileConfig::HasEntry(const wxString& strName) const
|
||||
// read/write values
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
bool wxFileConfig::Read(const wxString& key,
|
||||
wxString* pStr) const
|
||||
bool wxFileConfig::DoReadString(const wxString& key, wxString* pStr) const
|
||||
{
|
||||
wxConfigPathChanger path(this, key);
|
||||
|
||||
@@ -829,32 +828,12 @@ bool wxFileConfig::Read(const wxString& key,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*pStr = ExpandEnvVars(pEntry->Value());
|
||||
*pStr = pEntry->Value();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxFileConfig::Read(const wxString& key,
|
||||
wxString* pStr, const wxString& defVal) const
|
||||
{
|
||||
wxConfigPathChanger path(this, key);
|
||||
|
||||
wxFileConfigEntry *pEntry = m_pCurrentGroup->FindEntry(path.Name());
|
||||
bool ok;
|
||||
if (pEntry == NULL) {
|
||||
if( IsRecordingDefaults() )
|
||||
((wxFileConfig *)this)->Write(key,defVal);
|
||||
*pStr = ExpandEnvVars(defVal);
|
||||
ok = FALSE;
|
||||
}
|
||||
else {
|
||||
*pStr = ExpandEnvVars(pEntry->Value());
|
||||
ok = TRUE;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool wxFileConfig::Read(const wxString& key, long *pl) const
|
||||
bool wxFileConfig::DoReadLong(const wxString& key, long *pl) const
|
||||
{
|
||||
wxString str;
|
||||
if ( !Read(key, & str) )
|
||||
@@ -862,11 +841,10 @@ bool wxFileConfig::Read(const wxString& key, long *pl) const
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*pl = wxAtol(str);
|
||||
return TRUE;
|
||||
return str.ToLong(pl);
|
||||
}
|
||||
|
||||
bool wxFileConfig::Write(const wxString& key, const wxString& szValue)
|
||||
bool wxFileConfig::DoWriteString(const wxString& key, const wxString& szValue)
|
||||
{
|
||||
wxConfigPathChanger path(this, key);
|
||||
|
||||
@@ -901,12 +879,9 @@ bool wxFileConfig::Write(const wxString& key, const wxString& szValue)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool wxFileConfig::Write(const wxString& key, long lValue)
|
||||
bool wxFileConfig::DoWriteLong(const wxString& key, long lValue)
|
||||
{
|
||||
// ltoa() is not ANSI :-(
|
||||
wxString buf;
|
||||
buf.Printf(wxT("%ld"), lValue);
|
||||
return Write(key, buf);
|
||||
return Write(key, wxString::Format(_T("%ld"), lValue));
|
||||
}
|
||||
|
||||
bool wxFileConfig::Flush(bool /* bCurrentOnly */)
|
||||
|
@@ -33,6 +33,7 @@
|
||||
#include "wx/intl.h"
|
||||
#include "wx/file.h"
|
||||
#include "wx/filename.h"
|
||||
#include "wx/dir.h"
|
||||
|
||||
// there are just too many of those...
|
||||
#ifdef __VISUALC__
|
||||
@@ -77,10 +78,15 @@
|
||||
#endif // __WINDOWS__
|
||||
#endif // native Win compiler
|
||||
|
||||
#if defined(__DOS__) && defined(__WATCOMC__)
|
||||
#include <direct.h>
|
||||
#include <dos.h>
|
||||
#include <io.h>
|
||||
#if defined(__DOS__)
|
||||
#ifdef __WATCOMC__
|
||||
#include <direct.h>
|
||||
#include <dos.h>
|
||||
#include <io.h>
|
||||
#endif
|
||||
#ifdef __DJGPP__
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __GNUWIN32__
|
||||
@@ -1196,7 +1202,16 @@ bool wxMkdir(const wxString& dir, int perm)
|
||||
if ( mkdir(wxFNCONV(dirname), perm) != 0 )
|
||||
#elif defined(__WXPM__)
|
||||
if (::DosCreateDir((PSZ)dirname, NULL) != 0) // enhance for EAB's??
|
||||
#else // !MSW and !OS/2 VAC++
|
||||
#elif defined(__DOS__)
|
||||
#if defined(__WATCOMC__)
|
||||
(void)perm;
|
||||
if ( wxMkDir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 )
|
||||
#elif defined(__DJGPP__)
|
||||
if ( mkdir(wxFNCONV(dirname), perm) != 0 )
|
||||
#else
|
||||
#error "Unsupported DOS compiler!"
|
||||
#endif
|
||||
#else // !MSW, !DOS and !OS/2 VAC++
|
||||
(void)perm;
|
||||
if ( wxMkDir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 )
|
||||
#endif // !MSW/MSW
|
||||
@@ -1289,435 +1304,62 @@ bool wxGetTempFileName(const wxString& prefix, wxString& buf)
|
||||
|
||||
// Get first file name matching given wild card.
|
||||
|
||||
#if defined(__UNIX__)
|
||||
|
||||
// Get first file name matching given wild card.
|
||||
// Flags are reserved for future use.
|
||||
|
||||
#if !defined( __VMS__ ) || ( __VMS_VER >= 70000000 )
|
||||
static DIR *gs_dirStream = (DIR *) NULL;
|
||||
static wxString gs_strFileSpec;
|
||||
static int gs_findFlags = 0;
|
||||
#endif
|
||||
static wxDir *gs_dir = NULL;
|
||||
static wxString gs_dirPath;
|
||||
|
||||
wxString wxFindFirstFile(const wxChar *spec, int flags)
|
||||
{
|
||||
wxString result;
|
||||
#ifdef __VMS
|
||||
wxChar *specvms = NULL;
|
||||
#endif
|
||||
gs_dirPath = wxPathOnly(spec);
|
||||
if ( gs_dirPath.IsEmpty() )
|
||||
gs_dirPath = wxT(".");
|
||||
if ( gs_dirPath.Last() != wxFILE_SEP_PATH )
|
||||
gs_dirPath << wxFILE_SEP_PATH;
|
||||
|
||||
#if !defined( __VMS__ ) || ( __VMS_VER >= 70000000 )
|
||||
if (gs_dirStream)
|
||||
closedir(gs_dirStream); // edz 941103: better housekeping
|
||||
|
||||
gs_findFlags = flags;
|
||||
|
||||
gs_strFileSpec = spec;
|
||||
|
||||
// Find path only so we can concatenate
|
||||
// found file onto path
|
||||
wxString path(wxPathOnly(gs_strFileSpec));
|
||||
|
||||
// special case: path is really "/"
|
||||
if ( !path && gs_strFileSpec[0u] == wxT('/') )
|
||||
#ifdef __VMS
|
||||
{
|
||||
wxStrcpy( specvms , wxT( "[000000]" ) );
|
||||
gs_strFileSpec = specvms;
|
||||
wxString path_vms(wxPathOnly(gs_strFileSpec));
|
||||
path = path_vms;
|
||||
}
|
||||
#else
|
||||
path = wxT('/');
|
||||
#endif
|
||||
// path is empty => Local directory
|
||||
if ( !path )
|
||||
#ifdef __VMS
|
||||
{
|
||||
wxStrcpy( specvms , wxT( "[]" ) );
|
||||
gs_strFileSpec = specvms;
|
||||
wxString path_vms1(wxPathOnly(gs_strFileSpec));
|
||||
path = path_vms1;
|
||||
}
|
||||
#else
|
||||
path = wxT('.');
|
||||
#endif
|
||||
|
||||
gs_dirStream = opendir(path.fn_str());
|
||||
if ( !gs_dirStream )
|
||||
{
|
||||
wxLogSysError(_("Can not enumerate files in directory '%s'"),
|
||||
path.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
result = wxFindNextFile();
|
||||
}
|
||||
#endif // !VMS6.x or earlier
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
wxString wxFindNextFile()
|
||||
{
|
||||
wxString result;
|
||||
|
||||
#if !defined( __VMS__ ) || ( __VMS_VER >= 70000000 )
|
||||
wxCHECK_MSG( gs_dirStream, result, wxT("must call wxFindFirstFile first") );
|
||||
|
||||
// Find path only so we can concatenate
|
||||
// found file onto path
|
||||
wxString path(wxPathOnly(gs_strFileSpec));
|
||||
wxString name(wxFileNameFromPath(gs_strFileSpec));
|
||||
|
||||
/* MATTHEW: special case: path is really "/" */
|
||||
if ( !path && gs_strFileSpec[0u] == wxT('/'))
|
||||
path = wxT('/');
|
||||
|
||||
// Do the reading
|
||||
struct dirent *nextDir;
|
||||
for ( nextDir = readdir(gs_dirStream);
|
||||
nextDir != NULL;
|
||||
nextDir = readdir(gs_dirStream) )
|
||||
{
|
||||
if (wxMatchWild(name, nextDir->d_name, FALSE) && // RR: added FALSE to find hidden files
|
||||
strcmp(nextDir->d_name, ".") &&
|
||||
strcmp(nextDir->d_name, "..") )
|
||||
{
|
||||
result.Empty();
|
||||
if ( !path.IsEmpty() )
|
||||
{
|
||||
result = path;
|
||||
if ( path != wxT('/') )
|
||||
result += wxT('/');
|
||||
}
|
||||
|
||||
result += nextDir->d_name;
|
||||
|
||||
// Only return "." and ".." when they match
|
||||
bool isdir;
|
||||
if ( (strcmp(nextDir->d_name, ".") == 0) ||
|
||||
(strcmp(nextDir->d_name, "..") == 0))
|
||||
{
|
||||
if ( (gs_findFlags & wxDIR) != 0 )
|
||||
isdir = TRUE;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
isdir = wxDirExists(result);
|
||||
|
||||
// and only return directories when flags & wxDIR
|
||||
if ( !gs_findFlags ||
|
||||
((gs_findFlags & wxDIR) && isdir) ||
|
||||
((gs_findFlags & wxFILE) && !isdir) )
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
result.Empty(); // not found
|
||||
|
||||
closedir(gs_dirStream);
|
||||
gs_dirStream = (DIR *) NULL;
|
||||
#endif // !VMS6.2 or earlier
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#elif defined(__WXMAC__)
|
||||
|
||||
struct MacDirectoryIterator
|
||||
{
|
||||
CInfoPBRec m_CPB ;
|
||||
wxInt16 m_index ;
|
||||
long m_dirId ;
|
||||
Str255 m_name ;
|
||||
} ;
|
||||
|
||||
static int g_iter_flags ;
|
||||
|
||||
static MacDirectoryIterator g_iter ;
|
||||
wxString g_iter_spec ;
|
||||
|
||||
wxString wxFindFirstFile(const wxChar *spec, int flags)
|
||||
{
|
||||
wxString result;
|
||||
|
||||
g_iter_spec = spec ;
|
||||
g_iter_spec.MakeUpper() ;
|
||||
g_iter_flags = flags; /* MATTHEW: [5] Remember flags */
|
||||
|
||||
// Find path only so we can concatenate found file onto path
|
||||
wxString path(wxPathOnly(spec));
|
||||
FSSpec fsspec ;
|
||||
|
||||
wxMacFilename2FSSpec( path , &fsspec ) ;
|
||||
g_iter.m_CPB.hFileInfo.ioVRefNum = fsspec.vRefNum ;
|
||||
g_iter.m_CPB.hFileInfo.ioNamePtr = g_iter.m_name ;
|
||||
g_iter.m_index = 0 ;
|
||||
|
||||
Boolean isDir ;
|
||||
FSpGetDirectoryID( &fsspec , &g_iter.m_dirId , &isDir ) ;
|
||||
if ( !isDir )
|
||||
return wxEmptyString ;
|
||||
|
||||
return wxFindNextFile( ) ;
|
||||
}
|
||||
|
||||
wxString wxFindNextFile()
|
||||
{
|
||||
wxString result;
|
||||
|
||||
short err = noErr ;
|
||||
wxString name ;
|
||||
if (gs_dir)
|
||||
delete gs_dir;
|
||||
gs_dir = new wxDir(gs_dirPath);
|
||||
|
||||
while(1)
|
||||
if ( !gs_dir->IsOpened() )
|
||||
{
|
||||
while ( err == noErr )
|
||||
{
|
||||
g_iter.m_index++ ;
|
||||
g_iter.m_CPB.dirInfo.ioFDirIndex = g_iter.m_index;
|
||||
g_iter.m_CPB.dirInfo.ioDrDirID = g_iter.m_dirId; /* we need to do this every time */
|
||||
err = PBGetCatInfoSync((CInfoPBPtr)&g_iter.m_CPB);
|
||||
if ( err != noErr )
|
||||
break ;
|
||||
|
||||
if ( ( g_iter.m_CPB.dirInfo.ioFlAttrib & ioDirMask) != 0 && (g_iter_flags & wxDIR) ) // we have a directory
|
||||
break ;
|
||||
|
||||
if ( ( g_iter.m_CPB.dirInfo.ioFlAttrib & ioDirMask) == 0 && !(g_iter_flags & wxFILE ) )
|
||||
continue ;
|
||||
|
||||
// hit !
|
||||
break ;
|
||||
}
|
||||
if ( err != noErr )
|
||||
{
|
||||
return wxEmptyString ;
|
||||
}
|
||||
FSSpec spec ;
|
||||
|
||||
FSMakeFSSpecCompat(g_iter.m_CPB.hFileInfo.ioVRefNum,
|
||||
g_iter.m_dirId,
|
||||
g_iter.m_name,
|
||||
&spec) ;
|
||||
|
||||
wxString name = wxMacFSSpec2MacFilename( &spec ) ;
|
||||
if ( g_iter_spec.Right(4)==(":*.*") || g_iter_spec.Right(2)==(":*") || name.Upper().Matches(g_iter_spec) )
|
||||
return name ;
|
||||
wxLogSysError(_("Can not enumerate files '%s'"), spec);
|
||||
return wxEmptyString;
|
||||
}
|
||||
return wxEmptyString ;
|
||||
}
|
||||
|
||||
#elif defined(__WXMSW__)
|
||||
|
||||
#ifdef __WIN32__
|
||||
static HANDLE gs_hFileStruct = INVALID_HANDLE_VALUE;
|
||||
static WIN32_FIND_DATA gs_findDataStruct;
|
||||
#else // Win16
|
||||
#ifdef __BORLANDC__
|
||||
static struct ffblk gs_findDataStruct;
|
||||
#else
|
||||
static struct _find_t gs_findDataStruct;
|
||||
#endif // Borland
|
||||
#endif // Win32/16
|
||||
|
||||
static wxString gs_strFileSpec;
|
||||
static int gs_findFlags = 0;
|
||||
|
||||
wxString wxFindFirstFile(const wxChar *spec, int flags)
|
||||
{
|
||||
wxString result;
|
||||
|
||||
gs_strFileSpec = spec;
|
||||
gs_findFlags = flags; /* MATTHEW: [5] Remember flags */
|
||||
|
||||
// Find path only so we can concatenate found file onto path
|
||||
wxString path(wxPathOnly(gs_strFileSpec));
|
||||
if ( !path.IsEmpty() )
|
||||
result << path << wxT('\\');
|
||||
|
||||
#ifdef __WIN32__
|
||||
if ( gs_hFileStruct != INVALID_HANDLE_VALUE )
|
||||
FindClose(gs_hFileStruct);
|
||||
|
||||
gs_hFileStruct = ::FindFirstFile(WXSTRINGCAST spec, &gs_findDataStruct);
|
||||
|
||||
if ( gs_hFileStruct == INVALID_HANDLE_VALUE )
|
||||
|
||||
int dirFlags = 0;
|
||||
switch (flags)
|
||||
{
|
||||
result.Empty();
|
||||
|
||||
case wxDIR: dirFlags = wxDIR_DIRS; break;
|
||||
case wxFILE: dirFlags = wxDIR_FILES; break;
|
||||
default: dirFlags = wxDIR_DIRS | wxDIR_FILES; break;
|
||||
}
|
||||
|
||||
wxString result;
|
||||
gs_dir->GetFirst(&result, wxFileNameFromPath(spec), dirFlags);
|
||||
if ( result.IsEmpty() )
|
||||
{
|
||||
wxDELETE(gs_dir);
|
||||
return result;
|
||||
}
|
||||
|
||||
bool isdir = !!(gs_findDataStruct.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
||||
|
||||
if (isdir && !(flags & wxDIR))
|
||||
return wxFindNextFile();
|
||||
else if (!isdir && flags && !(flags & wxFILE))
|
||||
return wxFindNextFile();
|
||||
|
||||
result += gs_findDataStruct.cFileName;
|
||||
|
||||
return result;
|
||||
#else // !Win32
|
||||
int flag = _A_NORMAL;
|
||||
if (flags & wxDIR)
|
||||
flag = _A_SUBDIR;
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
if (findfirst(WXSTRINGCAST spec, &gs_findDataStruct, flag) == 0)
|
||||
#else
|
||||
if (_dos_findfirst(WXSTRINGCAST spec, flag, &gs_findDataStruct) == 0)
|
||||
#endif
|
||||
{
|
||||
char attrib;
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
attrib = gs_findDataStruct.ff_attrib;
|
||||
#else
|
||||
attrib = gs_findDataStruct.attrib;
|
||||
#endif
|
||||
|
||||
if (attrib & _A_SUBDIR) {
|
||||
if (!(gs_findFlags & wxDIR))
|
||||
return wxFindNextFile();
|
||||
} else if (gs_findFlags && !(gs_findFlags & wxFILE))
|
||||
return wxFindNextFile();
|
||||
|
||||
result +=
|
||||
#ifdef __BORLANDC__
|
||||
gs_findDataStruct.ff_name
|
||||
#else
|
||||
gs_findDataStruct.name
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
return result;
|
||||
#endif // __WIN32__
|
||||
}
|
||||
|
||||
|
||||
wxString wxFindNextFile()
|
||||
{
|
||||
wxString result;
|
||||
|
||||
// Find path only so we can concatenate found file onto path
|
||||
wxString path(wxPathOnly(gs_strFileSpec));
|
||||
|
||||
try_again:
|
||||
|
||||
#ifdef __WIN32__
|
||||
if (gs_hFileStruct == INVALID_HANDLE_VALUE)
|
||||
return result;
|
||||
|
||||
bool success = (FindNextFile(gs_hFileStruct, &gs_findDataStruct) != 0);
|
||||
if (!success)
|
||||
{
|
||||
FindClose(gs_hFileStruct);
|
||||
gs_hFileStruct = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
bool isdir = !!(gs_findDataStruct.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY);
|
||||
|
||||
if (isdir && !(gs_findFlags & wxDIR))
|
||||
goto try_again;
|
||||
else if (!isdir && gs_findFlags && !(gs_findFlags & wxFILE))
|
||||
goto try_again;
|
||||
|
||||
if ( !path.IsEmpty() )
|
||||
result << path << wxT('\\');
|
||||
result << gs_findDataStruct.cFileName;
|
||||
}
|
||||
|
||||
return result;
|
||||
#else // Win16
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
if (findnext(&gs_findDataStruct) == 0)
|
||||
#else
|
||||
if (_dos_findnext(&gs_findDataStruct) == 0)
|
||||
#endif
|
||||
{
|
||||
/* MATTHEW: [5] Check directory flag */
|
||||
char attrib;
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
attrib = gs_findDataStruct.ff_attrib;
|
||||
#else
|
||||
attrib = gs_findDataStruct.attrib;
|
||||
#endif
|
||||
|
||||
if (attrib & _A_SUBDIR) {
|
||||
if (!(gs_findFlags & wxDIR))
|
||||
goto try_again;
|
||||
} else if (gs_findFlags && !(gs_findFlags & wxFILE))
|
||||
goto try_again;
|
||||
|
||||
|
||||
result +=
|
||||
#ifdef __BORLANDC__
|
||||
gs_findDataStruct.ff_name
|
||||
#else
|
||||
gs_findDataStruct.name
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
return result;
|
||||
#endif // Win32/16
|
||||
}
|
||||
|
||||
#elif defined(__WXPM__)
|
||||
|
||||
wxString wxFindFirstFile(const wxChar *spec, int flags)
|
||||
{
|
||||
wxString result;
|
||||
|
||||
/*
|
||||
// TODO: figure something out here for OS/2
|
||||
gs_strFileSpec = spec;
|
||||
gs_findFlags = flags;
|
||||
|
||||
// Find path only so we can concatenate found file onto path
|
||||
wxString path(wxPathOnly(gs_strFileSpec));
|
||||
if ( !path.IsEmpty() )
|
||||
result << path << wxT('\\');
|
||||
|
||||
int flag = _A_NORMAL;
|
||||
if (flags & wxDIR)
|
||||
flag = _A_SUBDIR;
|
||||
|
||||
if (_dos_findfirst(WXSTRINGCAST spec, flag, &gs_findDataStruct) == 0)
|
||||
{
|
||||
char attrib;
|
||||
attrib = gs_findDataStruct.attrib;
|
||||
|
||||
if (attrib & _A_SUBDIR) {
|
||||
if (!(gs_findFlags & wxDIR))
|
||||
return wxFindNextFile();
|
||||
} else if (gs_findFlags && !(gs_findFlags & wxFILE))
|
||||
return wxFindNextFile();
|
||||
|
||||
result += gs_findDataStruct.name;
|
||||
}
|
||||
*/
|
||||
return result;
|
||||
return gs_dirPath + result;
|
||||
}
|
||||
|
||||
wxString wxFindNextFile()
|
||||
{
|
||||
wxASSERT_MSG( gs_dir, wxT("You must call wxFindFirstFile before!") );
|
||||
|
||||
wxString result;
|
||||
// TODO:
|
||||
return result;
|
||||
gs_dir->GetNext(&result);
|
||||
|
||||
if ( result.IsEmpty() )
|
||||
{
|
||||
wxDELETE(gs_dir);
|
||||
return result;
|
||||
}
|
||||
|
||||
return gs_dirPath + result;
|
||||
}
|
||||
|
||||
#endif // Unix/Windows/OS/2
|
||||
|
||||
// Get current working directory.
|
||||
// If buf is NULL, allocates space using new, else
|
||||
|
@@ -32,9 +32,9 @@
|
||||
or just
|
||||
filename
|
||||
(although :filename works as well).
|
||||
:::filename.ext is not yet supported. TODO.
|
||||
Since the volume is just part of the file path, it is not
|
||||
treated like a separate entity as it is done under DOS.
|
||||
treated like a separate entity as it is done under DOS and
|
||||
VMS, it is just treated as another dir.
|
||||
|
||||
wxPATH_VMS: VMS native format, absolute file names have the form
|
||||
<device>:[dir1.dir2.dir3]file.txt
|
||||
@@ -61,55 +61,62 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma implementation "filename.h"
|
||||
#pragma implementation "filename.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/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/intl.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/file.h"
|
||||
#endif
|
||||
|
||||
#include "wx/filename.h"
|
||||
#include "wx/tokenzr.h"
|
||||
#include "wx/config.h" // for wxExpandEnvVars
|
||||
#include "wx/utils.h"
|
||||
#include "wx/file.h"
|
||||
|
||||
#if wxUSE_DYNLIB_CLASS
|
||||
#include "wx/dynlib.h"
|
||||
#if wxUSE_DYNAMIC_LOADER || wxUSE_DYNLIB_CLASS
|
||||
#include "wx/dynlib.h"
|
||||
#endif
|
||||
|
||||
// For GetShort/LongPathName
|
||||
#ifdef __WIN32__
|
||||
#include <windows.h>
|
||||
|
||||
#include "wx/msw/winundef.h"
|
||||
#include <windows.h>
|
||||
#include "wx/msw/winundef.h"
|
||||
#endif
|
||||
|
||||
// utime() is POSIX so should normally be available on all Unices
|
||||
#ifdef __UNIX_LIKE__
|
||||
#include <sys/types.h>
|
||||
#include <utime.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/types.h>
|
||||
#include <utime.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__
|
||||
#include <stat.h>
|
||||
#include <unistd.h>
|
||||
#include <unix.h>
|
||||
#include <stat.h>
|
||||
#include <unistd.h>
|
||||
#include <unix.h>
|
||||
#endif
|
||||
|
||||
#ifdef __WATCOMC__
|
||||
#include <io.h>
|
||||
#include <sys/utime.h>
|
||||
#include <sys/stat.h>
|
||||
#include <io.h>
|
||||
#include <sys/utime.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#ifdef __VISAGECPP__
|
||||
#ifndef MAX_PATH
|
||||
#define MAX_PATH 256
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -219,6 +226,7 @@ void wxFileName::Assign( const wxFileName &filepath )
|
||||
m_dirs = filepath.GetDirs();
|
||||
m_name = filepath.GetName();
|
||||
m_ext = filepath.GetExt();
|
||||
m_relative = filepath.IsRelative();
|
||||
}
|
||||
|
||||
void wxFileName::Assign(const wxString& volume,
|
||||
@@ -227,18 +235,70 @@ void wxFileName::Assign(const wxString& volume,
|
||||
const wxString& ext,
|
||||
wxPathFormat format )
|
||||
{
|
||||
wxStringTokenizer tn(path, GetPathSeparators(format));
|
||||
|
||||
wxPathFormat my_format = GetFormat( format );
|
||||
wxString my_path = path;
|
||||
|
||||
m_dirs.Clear();
|
||||
while ( tn.HasMoreTokens() )
|
||||
|
||||
if (!my_path.empty())
|
||||
{
|
||||
wxString token = tn.GetNextToken();
|
||||
// 1) Determine if the path is relative or absolute.
|
||||
|
||||
switch (my_format)
|
||||
{
|
||||
case wxPATH_MAC:
|
||||
m_relative = ( my_path[0u] == wxT(':') );
|
||||
// We then remove a leading ":". The reason is in our
|
||||
// storage form for relative paths:
|
||||
// ":dir:file.txt" actually means "./dir/file.txt" in
|
||||
// DOS notation and should get stored as
|
||||
// (relative) (dir) (file.txt)
|
||||
// "::dir:file.txt" actually means "../dir/file.txt"
|
||||
// stored as (relative) (..) (dir) (file.txt)
|
||||
// This is important only for the Mac as an empty dir
|
||||
// actually means <UP>, whereas under DOS, double
|
||||
// slashes can be ignored: "\\\\" is the same as "\\".
|
||||
if (m_relative)
|
||||
my_path.Remove( 0, 1 );
|
||||
break;
|
||||
case wxPATH_VMS:
|
||||
// TODO: what is the relative path format here?
|
||||
m_relative = FALSE;
|
||||
break;
|
||||
case wxPATH_UNIX:
|
||||
m_relative = ( my_path[0u] != wxT('/') );
|
||||
break;
|
||||
case wxPATH_DOS:
|
||||
m_relative = ( (my_path[0u] != wxT('/')) && (my_path[0u] != wxT('\\')) );
|
||||
break;
|
||||
default:
|
||||
wxFAIL_MSG( wxT("error") );
|
||||
break;
|
||||
}
|
||||
|
||||
// 2) Break up the path into its members. If the original path
|
||||
// was just "/" or "\\", m_dirs will be empty. We know from
|
||||
// the m_relative field, if this means "nothing" or "root dir".
|
||||
|
||||
wxStringTokenizer tn( my_path, GetPathSeparators(my_format) );
|
||||
|
||||
// if the path starts with a slash, we do need the first empty dir
|
||||
// entry to be able to tell later that it was an absolute path, but
|
||||
// otherwise ignore the double slashes
|
||||
if ( m_dirs.IsEmpty() || !token.IsEmpty() )
|
||||
m_dirs.Add( token );
|
||||
while ( tn.HasMoreTokens() )
|
||||
{
|
||||
wxString token = tn.GetNextToken();
|
||||
|
||||
// Remove empty token under DOS and Unix, interpret them
|
||||
// as .. under Mac.
|
||||
if (token.empty())
|
||||
{
|
||||
if (my_format == wxPATH_MAC)
|
||||
m_dirs.Add( wxT("..") );
|
||||
// else ignore
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dirs.Add( token );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_volume = volume;
|
||||
@@ -270,7 +330,7 @@ void wxFileName::Assign(const wxString& fullpathOrig,
|
||||
wxString volume, path, name, ext;
|
||||
|
||||
// do some consistency checks in debug mode: the name should be really just
|
||||
// the filename and the path should be realyl just a path
|
||||
// the filename and the path should be really just a path
|
||||
#ifdef __WXDEBUG__
|
||||
wxString pathDummy, nameDummy, extDummy;
|
||||
|
||||
@@ -397,9 +457,9 @@ wxString wxFileName::GetHomeDir()
|
||||
return ::wxGetHomeDir();
|
||||
}
|
||||
|
||||
void wxFileName::AssignTempFileName( const wxString& prefix )
|
||||
void wxFileName::AssignTempFileName(const wxString& prefix, wxFile *fileTemp)
|
||||
{
|
||||
wxString tempname = CreateTempFileName(prefix);
|
||||
wxString tempname = CreateTempFileName(prefix, fileTemp);
|
||||
if ( tempname.empty() )
|
||||
{
|
||||
// error, failed to get temp file name
|
||||
@@ -412,7 +472,8 @@ void wxFileName::AssignTempFileName( const wxString& prefix )
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxString wxFileName::CreateTempFileName(const wxString& prefix)
|
||||
wxString
|
||||
wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
|
||||
{
|
||||
wxString path, dir, name;
|
||||
|
||||
@@ -460,10 +521,10 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
|
||||
|
||||
// Temporarily remove - MN
|
||||
#ifndef __WATCOMC__
|
||||
::DosCreateDir(wxStringBuffer(MAX_PATH), NULL);
|
||||
::DosCreateDir(wxStringBuffer(path, MAX_PATH), NULL);
|
||||
#endif
|
||||
|
||||
#else // !Windows, !OS/2, !DOS
|
||||
#else // !Windows, !OS/2
|
||||
if ( dir.empty() )
|
||||
{
|
||||
dir = wxGetenv(_T("TMP"));
|
||||
@@ -493,31 +554,31 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
|
||||
|
||||
path += name;
|
||||
|
||||
#if defined(__DOS__) && defined(__WATCOMC__)
|
||||
#if defined(HAVE_MKSTEMP)
|
||||
// scratch space for mkstemp()
|
||||
path += _T("XXXXXX");
|
||||
|
||||
// can use the cast here because the length doesn't change and the string
|
||||
// is not shared
|
||||
if ( !_mktemp((char *)path.mb_str()) )
|
||||
int fdTemp = mkstemp((char *)path.mb_str());
|
||||
if ( fdTemp == -1 )
|
||||
{
|
||||
// this might be not necessary as mkstemp() on most systems should have
|
||||
// already done it but it doesn't hurt neither...
|
||||
path.clear();
|
||||
}
|
||||
#elif defined(HAVE_MKSTEMP)
|
||||
// scratch space for mkstemp()
|
||||
path += _T("XXXXXX");
|
||||
|
||||
// can use the cast here because the length doesn't change and the string
|
||||
// is not shared
|
||||
if ( mkstemp((char *)path.mb_str()) == -1 )
|
||||
else // mkstemp() succeeded
|
||||
{
|
||||
// this might be not necessary as mkstemp() on most systems should have
|
||||
// already done it but it doesn't hurt neither...
|
||||
path.clear();
|
||||
// avoid leaking the fd
|
||||
if ( fileTemp )
|
||||
{
|
||||
fileTemp->Attach(fdTemp);
|
||||
}
|
||||
else
|
||||
{
|
||||
close(fdTemp);
|
||||
}
|
||||
}
|
||||
//else: file already created
|
||||
#else // !HAVE_MKSTEMP
|
||||
|
||||
#ifdef HAVE_MKTEMP
|
||||
@@ -528,9 +589,11 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
|
||||
{
|
||||
path.clear();
|
||||
}
|
||||
#else // !HAVE_MKTEMP
|
||||
#else // !HAVE_MKTEMP (includes __DOS__)
|
||||
// generate the unique file name ourselves
|
||||
#ifndef __DOS__
|
||||
path << (unsigned int)getpid();
|
||||
#endif
|
||||
|
||||
wxString pathTry;
|
||||
|
||||
@@ -552,10 +615,20 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
|
||||
|
||||
if ( !path.empty() )
|
||||
{
|
||||
// create the file - of course, there is a race condition here, this is
|
||||
}
|
||||
#endif // HAVE_MKSTEMP/!HAVE_MKSTEMP
|
||||
|
||||
#endif // Windows/!Windows
|
||||
|
||||
if ( path.empty() )
|
||||
{
|
||||
wxLogSysError(_("Failed to create a temporary file name"));
|
||||
}
|
||||
else if ( fileTemp && !fileTemp->IsOpened() )
|
||||
{
|
||||
// open the file - of course, there is a race condition here, this is
|
||||
// why we always prefer using mkstemp()...
|
||||
wxFile file;
|
||||
if ( !file.Open(path, wxFile::write_excl, wxS_IRUSR | wxS_IWUSR) )
|
||||
if ( !fileTemp->Open(path, wxFile::write_excl, wxS_IRUSR | wxS_IWUSR) )
|
||||
{
|
||||
// FIXME: If !ok here should we loop and try again with another
|
||||
// file name? That is the standard recourse if open(O_EXCL)
|
||||
@@ -567,14 +640,6 @@ wxString wxFileName::CreateTempFileName(const wxString& prefix)
|
||||
path.clear();
|
||||
}
|
||||
}
|
||||
#endif // HAVE_MKSTEMP/!HAVE_MKSTEMP
|
||||
|
||||
#endif // Windows/!Windows
|
||||
|
||||
if ( path.empty() )
|
||||
{
|
||||
wxLogSysError(_("Failed to create a temporary file name"));
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
@@ -653,7 +718,7 @@ bool wxFileName::Normalize(wxPathNormalize flags,
|
||||
format = GetFormat(format);
|
||||
|
||||
// make the path absolute
|
||||
if ( (flags & wxPATH_NORM_ABSOLUTE) && !IsAbsolute() )
|
||||
if ( (flags & wxPATH_NORM_ABSOLUTE) && m_relative )
|
||||
{
|
||||
if ( cwd.empty() )
|
||||
{
|
||||
@@ -664,6 +729,7 @@ bool wxFileName::Normalize(wxPathNormalize flags,
|
||||
curDir.AssignDir(cwd);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// the path may be not absolute because it doesn't have the volume name
|
||||
// but in this case we shouldn't modify the directory components of it
|
||||
// but just set the current volume
|
||||
@@ -677,6 +743,8 @@ bool wxFileName::Normalize(wxPathNormalize flags,
|
||||
curDir.Clear();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
m_relative = FALSE;
|
||||
}
|
||||
|
||||
// handle ~ stuff under Unix only
|
||||
@@ -802,6 +870,8 @@ bool wxFileName::MakeRelativeTo(const wxString& pathBase, wxPathFormat format)
|
||||
{
|
||||
m_dirs.Insert(wxT(".."), 0u);
|
||||
}
|
||||
|
||||
m_relative = TRUE;
|
||||
|
||||
// we were modified
|
||||
return TRUE;
|
||||
@@ -837,56 +907,6 @@ bool wxFileName::IsCaseSensitive( wxPathFormat format )
|
||||
return GetFormat(format) == wxPATH_UNIX;
|
||||
}
|
||||
|
||||
bool wxFileName::IsAbsolute( wxPathFormat format )
|
||||
{
|
||||
// if we have no path, we can't be an abs filename
|
||||
if ( m_dirs.IsEmpty() )
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
format = GetFormat(format);
|
||||
|
||||
if ( format == wxPATH_UNIX )
|
||||
{
|
||||
const wxString& str = m_dirs[0u];
|
||||
if ( str.empty() )
|
||||
{
|
||||
// the path started with '/', it's an absolute one
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// the path is absolute if it starts with a path separator or
|
||||
// with "~" or "~user"
|
||||
wxChar ch = str[0u];
|
||||
|
||||
return IsPathSeparator(ch, format) || ch == _T('~');
|
||||
}
|
||||
else // !Unix
|
||||
{
|
||||
// must have the drive
|
||||
if ( m_volume.empty() )
|
||||
return FALSE;
|
||||
|
||||
switch ( format )
|
||||
{
|
||||
default:
|
||||
wxFAIL_MSG( _T("unknown wxPATH_XXX style") );
|
||||
// fall through
|
||||
|
||||
case wxPATH_DOS:
|
||||
return m_dirs[0u].empty();
|
||||
|
||||
case wxPATH_VMS:
|
||||
// TODO: what is the relative path format here?
|
||||
return TRUE;
|
||||
|
||||
case wxPATH_MAC:
|
||||
return !m_dirs[0u].empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* static */
|
||||
wxString wxFileName::GetVolumeSeparator(wxPathFormat format)
|
||||
{
|
||||
@@ -1000,16 +1020,82 @@ wxString wxFileName::GetPath( bool add_separator, wxPathFormat format ) const
|
||||
{
|
||||
format = GetFormat( format );
|
||||
|
||||
wxString ret;
|
||||
size_t count = m_dirs.GetCount();
|
||||
for ( size_t i = 0; i < count; i++ )
|
||||
wxString fullpath;
|
||||
|
||||
// the leading character
|
||||
if ( format == wxPATH_MAC && m_relative )
|
||||
{
|
||||
ret += m_dirs[i];
|
||||
if ( add_separator || (i < count) )
|
||||
ret += wxFILE_SEP_PATH;
|
||||
fullpath += wxFILE_SEP_PATH_MAC;
|
||||
}
|
||||
else if ( format == wxPATH_DOS )
|
||||
{
|
||||
if (!m_relative)
|
||||
fullpath += wxFILE_SEP_PATH_DOS;
|
||||
}
|
||||
else if ( format == wxPATH_UNIX )
|
||||
{
|
||||
if (!m_relative)
|
||||
fullpath += wxFILE_SEP_PATH_UNIX;
|
||||
}
|
||||
|
||||
// then concatenate all the path components using the path separator
|
||||
size_t dirCount = m_dirs.GetCount();
|
||||
if ( dirCount )
|
||||
{
|
||||
if ( format == wxPATH_VMS )
|
||||
{
|
||||
fullpath += wxT('[');
|
||||
}
|
||||
|
||||
|
||||
for ( size_t i = 0; i < dirCount; i++ )
|
||||
{
|
||||
// TODO: What to do with ".." under VMS
|
||||
|
||||
switch (format)
|
||||
{
|
||||
case wxPATH_MAC:
|
||||
{
|
||||
if (m_dirs[i] == wxT("."))
|
||||
break;
|
||||
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
|
||||
fullpath += m_dirs[i];
|
||||
fullpath += wxT(':');
|
||||
break;
|
||||
}
|
||||
case wxPATH_DOS:
|
||||
{
|
||||
fullpath += m_dirs[i];
|
||||
fullpath += wxT('\\');
|
||||
break;
|
||||
}
|
||||
case wxPATH_UNIX:
|
||||
{
|
||||
fullpath += m_dirs[i];
|
||||
fullpath += wxT('/');
|
||||
break;
|
||||
}
|
||||
case wxPATH_VMS:
|
||||
{
|
||||
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
|
||||
fullpath += m_dirs[i];
|
||||
if (i == dirCount-1)
|
||||
fullpath += wxT(']');
|
||||
else
|
||||
fullpath += wxT('.');
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
wxFAIL_MSG( wxT("error") );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
|
||||
return fullpath;
|
||||
}
|
||||
|
||||
wxString wxFileName::GetFullPath( wxPathFormat format ) const
|
||||
@@ -1021,59 +1107,91 @@ wxString wxFileName::GetFullPath( wxPathFormat format ) const
|
||||
// first put the volume
|
||||
if ( !m_volume.empty() )
|
||||
{
|
||||
{
|
||||
// Special Windows UNC paths hack, part 2: undo what we did in
|
||||
// SplitPath() and make an UNC path if we have a drive which is not a
|
||||
// single letter (hopefully the network shares can't be one letter only
|
||||
// although I didn't find any authoritative docs on this)
|
||||
if ( format == wxPATH_DOS && m_volume.length() > 1 )
|
||||
{
|
||||
fullpath << wxFILE_SEP_PATH_DOS << wxFILE_SEP_PATH_DOS << m_volume;
|
||||
}
|
||||
else // !UNC
|
||||
{
|
||||
fullpath << m_volume << GetVolumeSeparator(format);
|
||||
{
|
||||
// Special Windows UNC paths hack, part 2: undo what we did in
|
||||
// SplitPath() and make an UNC path if we have a drive which is not a
|
||||
// single letter (hopefully the network shares can't be one letter only
|
||||
// although I didn't find any authoritative docs on this)
|
||||
if ( format == wxPATH_DOS && m_volume.length() > 1 )
|
||||
{
|
||||
fullpath << wxFILE_SEP_PATH_DOS << wxFILE_SEP_PATH_DOS << m_volume;
|
||||
}
|
||||
else if ( format == wxPATH_DOS || format == wxPATH_VMS )
|
||||
{
|
||||
fullpath << m_volume << GetVolumeSeparator(format);
|
||||
}
|
||||
// else ignore
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// the leading character
|
||||
if ( format == wxPATH_MAC && m_relative )
|
||||
{
|
||||
fullpath += wxFILE_SEP_PATH_MAC;
|
||||
}
|
||||
else if ( format == wxPATH_DOS )
|
||||
{
|
||||
if (!m_relative)
|
||||
fullpath += wxFILE_SEP_PATH_DOS;
|
||||
}
|
||||
else if ( format == wxPATH_UNIX )
|
||||
{
|
||||
if (!m_relative)
|
||||
fullpath += wxFILE_SEP_PATH_UNIX;
|
||||
}
|
||||
|
||||
// then concatenate all the path components using the path separator
|
||||
size_t dirCount = m_dirs.GetCount();
|
||||
if ( dirCount )
|
||||
{
|
||||
// under Mac, we must have a path separator in the beginning of the
|
||||
// relative path - otherwise it would be parsed as an absolute one
|
||||
if ( format == wxPATH_MAC && m_dirs[0].empty() )
|
||||
{
|
||||
fullpath += wxFILE_SEP_PATH_MAC;
|
||||
}
|
||||
|
||||
wxChar chPathSep = GetPathSeparators(format)[0u];
|
||||
if ( format == wxPATH_VMS )
|
||||
{
|
||||
fullpath += _T('[');
|
||||
fullpath += wxT('[');
|
||||
}
|
||||
|
||||
|
||||
for ( size_t i = 0; i < dirCount; i++ )
|
||||
{
|
||||
// under VMS, we shouldn't have a leading dot
|
||||
if ( i && (format != wxPATH_VMS || !m_dirs[i - 1].empty()) )
|
||||
fullpath += chPathSep;
|
||||
// TODO: What to do with ".." under VMS
|
||||
|
||||
fullpath += m_dirs[i];
|
||||
}
|
||||
|
||||
if ( format == wxPATH_VMS )
|
||||
{
|
||||
fullpath += _T(']');
|
||||
}
|
||||
else // !VMS
|
||||
{
|
||||
// separate the file name from the last directory, notice that we
|
||||
// intentionally do it even if the name and extension are empty as
|
||||
// this allows us to distinguish the directories from the file
|
||||
// names (the directories have the trailing slash)
|
||||
fullpath += chPathSep;
|
||||
switch (format)
|
||||
{
|
||||
case wxPATH_MAC:
|
||||
{
|
||||
if (m_dirs[i] == wxT("."))
|
||||
break;
|
||||
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
|
||||
fullpath += m_dirs[i];
|
||||
fullpath += wxT(':');
|
||||
break;
|
||||
}
|
||||
case wxPATH_DOS:
|
||||
{
|
||||
fullpath += m_dirs[i];
|
||||
fullpath += wxT('\\');
|
||||
break;
|
||||
}
|
||||
case wxPATH_UNIX:
|
||||
{
|
||||
fullpath += m_dirs[i];
|
||||
fullpath += wxT('/');
|
||||
break;
|
||||
}
|
||||
case wxPATH_VMS:
|
||||
{
|
||||
if (m_dirs[i] != wxT("..")) // convert back from ".." to nothing
|
||||
fullpath += m_dirs[i];
|
||||
if (i == dirCount-1)
|
||||
fullpath += wxT(']');
|
||||
else
|
||||
fullpath += wxT('.');
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
wxFAIL_MSG( wxT("error") );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1120,7 +1238,7 @@ wxString wxFileName::GetLongPath() const
|
||||
bool success = FALSE;
|
||||
|
||||
// VZ: this code was disabled, why?
|
||||
#if 0 // wxUSE_DYNLIB_CLASS
|
||||
#if 0 // wxUSE_DYNAMIC_LOADER
|
||||
typedef DWORD (*GET_LONG_PATH_NAME)(const wxChar *, wxChar *, DWORD);
|
||||
|
||||
static bool s_triedToLoad = FALSE;
|
||||
@@ -1168,7 +1286,7 @@ wxString wxFileName::GetLongPath() const
|
||||
}
|
||||
if (success)
|
||||
return pathOut;
|
||||
#endif // wxUSE_DYNLIB_CLASS
|
||||
#endif // wxUSE_DYNAMIC_LOADER
|
||||
|
||||
if (!success)
|
||||
{
|
||||
@@ -1287,7 +1405,7 @@ void wxFileName::SplitPath(const wxString& fullpathWithVolume,
|
||||
if ( format == wxPATH_DOS || format == wxPATH_VMS )
|
||||
{
|
||||
wxString sepVol = GetVolumeSeparator(format);
|
||||
|
||||
|
||||
size_t posFirstColon = fullpath.find_first_of(sepVol);
|
||||
if ( posFirstColon != wxString::npos )
|
||||
{
|
||||
@@ -1338,7 +1456,7 @@ void wxFileName::SplitPath(const wxString& fullpathWithVolume,
|
||||
else
|
||||
{
|
||||
// take everything up to the path separator but take care to make
|
||||
// tha path equal to something like '/', not empty, for the files
|
||||
// the path equal to something like '/', not empty, for the files
|
||||
// immediately under root directory
|
||||
size_t len = posLastSlash;
|
||||
if ( !len )
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user