Compare commits

..

1 Commits

Author SHA1 Message Date
Bryan Petty
50c46e10bb This commit was manufactured by cvs2svn to create tag 'WX_2_8_4'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/WX_2_8_4@46016 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-05-14 08:18:10 +00:00
182 changed files with 12090 additions and 4119 deletions

1
aclocal.m4 vendored
View File

@@ -11,6 +11,7 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_include([build/aclocal/bakefile-dllar.m4])
m4_include([build/aclocal/bakefile-lang.m4])
m4_include([build/aclocal/bakefile.m4])
m4_include([build/aclocal/cppunit.m4])

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,483 @@
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_DLLAR_SH],
[
dnl ===================== dllar.sh begins here =====================
dnl (Created by merge-scripts.py from dllar.sh
dnl file do not edit here!)
D='$'
cat <<EOF >dllar.sh
#!/bin/sh
#
# dllar - a tool to build both a .dll and an .a file
# from a set of object (.o) files for EMX/OS2.
#
# Written by Andrew Zabolotny, bit@freya.etu.ru
# Ported to Unix like shell by Stefan Neis, Stefan.Neis@t-online.de
#
# This script will accept a set of files on the command line.
# All the public symbols from the .o files will be exported into
# a .DEF file, then linker will be run (through gcc) against them to
# build a shared library consisting of all given .o files. All libraries
# (.a) will be first decompressed into component .o files then act as
# described above. You can optionally give a description (-d "description")
# which will be put into .DLL. To see the list of accepted options (as well
# as command-line format) simply run this program without options. The .DLL
# is built to be imported by name (there is no guarantee that new versions
# of the library you build will have same ordinals for same symbols).
#
# dllar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# dllar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with dllar; see the file COPYING. If not, write to the Free
# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# To successfuly run this program you will need:
# - Current drive should have LFN support (HPFS, ext2, network, etc)
# (Sometimes dllar generates filenames which won't fit 8.3 scheme)
# - gcc
# (used to build the .dll)
# - emxexp
# (used to create .def file from .o files)
# - emximp
# (used to create .a file from .def file)
# - GNU text utilites (cat, sort, uniq)
# used to process emxexp output
# - GNU file utilities (mv, rm)
# - GNU sed
# - lxlite (optional, see flag below)
# (used for general .dll cleanup)
#
flag_USE_LXLITE=1;
#
# helper functions
# basnam, variant of basename, which does _not_ remove the path, _iff_
# second argument (suffix to remove) is given
basnam(){
case ${D}# in
1)
echo ${D}1 | sed 's/.*\\///' | sed 's/.*\\\\//'
;;
2)
echo ${D}1 | sed 's/'${D}2'${D}//'
;;
*)
echo "error in basnam ${D}*"
exit 8
;;
esac
}
# Cleanup temporary files and output
CleanUp() {
cd ${D}curDir
for i in ${D}inputFiles ; do
case ${D}i in
*!)
rm -rf \`basnam ${D}i !\`
;;
*)
;;
esac
done
# Kill result in case of failure as there is just to many stupid make/nmake
# things out there which doesn't do this.
if @<:@ ${D}# -eq 0 @:>@; then
rm -f ${D}arcFile ${D}arcFile2 ${D}defFile ${D}dllFile
fi
}
# Print usage and exit script with rc=1.
PrintHelp() {
echo 'Usage: dllar.sh @<:@-o@<:@utput@:>@ output_file@:>@ @<:@-i@<:@mport@:>@ importlib_name@:>@'
echo ' @<:@-name-mangler-script script.sh@:>@'
echo ' @<:@-d@<:@escription@:>@ "dll descrption"@:>@ @<:@-cc "CC"@:>@ @<:@-f@<:@lags@:>@ "CFLAGS"@:>@'
echo ' @<:@-ord@<:@inals@:>@@:>@ -ex@<:@clude@:>@ "symbol(s)"'
echo ' @<:@-libf@<:@lags@:>@ "{INIT|TERM}{GLOBAL|INSTANCE}"@:>@ @<:@-nocrt@<:@dll@:>@@:>@ @<:@-nolxl@<:@ite@:>@@:>@'
echo ' @<:@*.o@:>@ @<:@*.a@:>@'
echo '*> "output_file" should have no extension.'
echo ' If it has the .o, .a or .dll extension, it is automatically removed.'
echo ' The import library name is derived from this and is set to "name".a,'
echo ' unless overridden by -import'
echo '*> "importlib_name" should have no extension.'
echo ' If it has the .o, or .a extension, it is automatically removed.'
echo ' This name is used as the import library name and may be longer and'
echo ' more descriptive than the DLL name which has to follow the old '
echo ' 8.3 convention of FAT.'
echo '*> "script.sh may be given to override the output_file name by a'
echo ' different name. It is mainly useful if the regular make process'
echo ' of some package does not take into account OS/2 restriction of'
echo ' DLL name lengths. It takes the importlib name as input and is'
echo ' supposed to procude a shorter name as output. The script should'
echo ' expect to get importlib_name without extension and should produce'
echo ' a (max.) 8 letter name without extension.'
echo '*> "cc" is used to use another GCC executable. (default: gcc.exe)'
echo '*> "flags" should be any set of valid GCC flags. (default: -s -Zcrtdll)'
echo ' These flags will be put at the start of GCC command line.'
echo '*> -ord@<:@inals@:>@ tells dllar to export entries by ordinals. Be careful.'
echo '*> -ex@<:@clude@:>@ defines symbols which will not be exported. You can define'
echo ' multiple symbols, for example -ex "myfunc yourfunc _GLOBAL*".'
echo ' If the last character of a symbol is "*", all symbols beginning'
echo ' with the prefix before "*" will be exclude, (see _GLOBAL* above).'
echo '*> -libf@<:@lags@:>@ can be used to add INITGLOBAL/INITINSTANCE and/or'
echo ' TERMGLOBAL/TERMINSTANCE flags to the dynamically-linked library.'
echo '*> -nocrt@<:@dll@:>@ switch will disable linking the library against emx''s'
echo ' C runtime DLLs.'
echo '*> -nolxl@<:@ite@:>@ switch will disable running lxlite on the resulting DLL.'
echo '*> All other switches (for example -L./ or -lmylib) will be passed'
echo ' unchanged to GCC at the end of command line.'
echo '*> If you create a DLL from a library and you do not specify -o,'
echo ' the basename for DLL and import library will be set to library name,'
echo ' the initial library will be renamed to 'name'_s.a (_s for static)'
echo ' i.e. "dllar gcc.a" will create gcc.dll and gcc.a, and the initial'
echo ' library will be renamed into gcc_s.a.'
echo '--------'
echo 'Example:'
echo ' dllar -o gcc290.dll libgcc.a -d "GNU C runtime library" -ord'
echo ' -ex "__main __ctordtor*" -libf "INITINSTANCE TERMINSTANCE"'
CleanUp
exit 1
}
# Execute a command.
# If exit code of the commnad <> 0 CleanUp() is called and we'll exit the script.
# @Uses Whatever CleanUp() uses.
doCommand() {
echo "${D}*"
eval ${D}*
rcCmd=${D}?
if @<:@ ${D}rcCmd -ne 0 @:>@; then
echo "command failed, exit code="${D}rcCmd
CleanUp
exit ${D}rcCmd
fi
}
# main routine
# setup globals
cmdLine=${D}*
outFile=""
outimpFile=""
inputFiles=""
renameScript=""
description=""
CC=gcc.exe
CFLAGS="-s -Zcrtdll"
EXTRA_CFLAGS=""
EXPORT_BY_ORDINALS=0
exclude_symbols=""
library_flags=""
curDir=\`pwd\`
curDirS=curDir
case ${D}curDirS in
*/)
;;
*)
curDirS=${D}{curDirS}"/"
;;
esac
# Parse commandline
libsToLink=0
omfLinking=0
while @<:@ ${D}1 @:>@; do
case ${D}1 in
-ord*)
EXPORT_BY_ORDINALS=1;
;;
-o*)
shift
outFile=${D}1
;;
-i*)
shift
outimpFile=${D}1
;;
-name-mangler-script)
shift
renameScript=${D}1
;;
-d*)
shift
description=${D}1
;;
-f*)
shift
CFLAGS=${D}1
;;
-c*)
shift
CC=${D}1
;;
-h*)
PrintHelp
;;
-ex*)
shift
exclude_symbols=${D}{exclude_symbols}${D}1" "
;;
-libf*)
shift
library_flags=${D}{library_flags}${D}1" "
;;
-nocrt*)
CFLAGS="-s"
;;
-nolxl*)
flag_USE_LXLITE=0
;;
-* | /*)
case ${D}1 in
-L* | -l*)
libsToLink=1
;;
-Zomf)
omfLinking=1
;;
*)
;;
esac
EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
;;
*.dll)
EXTRA_CFLAGS="${D}{EXTRA_CFLAGS} \`basnam ${D}1 .dll\`"
if @<:@ ${D}omfLinking -eq 1 @:>@; then
EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.lib"
else
EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.a"
fi
;;
*)
found=0;
if @<:@ ${D}libsToLink -ne 0 @:>@; then
EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
else
for file in ${D}1 ; do
if @<:@ -f ${D}file @:>@; then
inputFiles="${D}{inputFiles} ${D}file"
found=1
fi
done
if @<:@ ${D}found -eq 0 @:>@; then
echo "ERROR: No file(s) found: "${D}1
exit 8
fi
fi
;;
esac
shift
done # iterate cmdline words
#
if @<:@ -z "${D}inputFiles" @:>@; then
echo "dllar: no input files"
PrintHelp
fi
# Now extract all .o files from .a files
newInputFiles=""
for file in ${D}inputFiles ; do
case ${D}file in
*.a | *.lib)
case ${D}file in
*.a)
suffix=".a"
AR="ar"
;;
*.lib)
suffix=".lib"
AR="emxomfar"
EXTRA_CFLAGS="${D}EXTRA_CFLAGS -Zomf"
;;
*)
;;
esac
dirname=\`basnam ${D}file ${D}suffix\`"_%"
mkdir ${D}dirname
if @<:@ ${D}? -ne 0 @:>@; then
echo "Failed to create subdirectory ./${D}dirname"
CleanUp
exit 8;
fi
# Append '!' to indicate archive
newInputFiles="${D}newInputFiles ${D}{dirname}!"
doCommand "cd ${D}dirname; ${D}AR x ../${D}file"
cd ${D}curDir
found=0;
for subfile in ${D}dirname/*.o* ; do
if @<:@ -f ${D}subfile @:>@; then
found=1
if @<:@ -s ${D}subfile @:>@; then
# FIXME: This should be: is file size > 32 byte, _not_ > 0!
newInputFiles="${D}newInputFiles ${D}subfile"
fi
fi
done
if @<:@ ${D}found -eq 0 @:>@; then
echo "WARNING: there are no files in archive \\'${D}file\\'"
fi
;;
*)
newInputFiles="${D}{newInputFiles} ${D}file"
;;
esac
done
inputFiles="${D}newInputFiles"
# Output filename(s).
do_backup=0;
if @<:@ -z ${D}outFile @:>@; then
do_backup=1;
set outFile ${D}inputFiles; outFile=${D}2
fi
# If it is an archive, remove the '!' and the '_%' suffixes
case ${D}outFile in
*_%!)
outFile=\`basnam ${D}outFile _%!\`
;;
*)
;;
esac
case ${D}outFile in
*.dll)
outFile=\`basnam ${D}outFile .dll\`
;;
*.DLL)
outFile=\`basnam ${D}outFile .DLL\`
;;
*.o)
outFile=\`basnam ${D}outFile .o\`
;;
*.obj)
outFile=\`basnam ${D}outFile .obj\`
;;
*.a)
outFile=\`basnam ${D}outFile .a\`
;;
*.lib)
outFile=\`basnam ${D}outFile .lib\`
;;
*)
;;
esac
case ${D}outimpFile in
*.a)
outimpFile=\`basnam ${D}outimpFile .a\`
;;
*.lib)
outimpFile=\`basnam ${D}outimpFile .lib\`
;;
*)
;;
esac
if @<:@ -z ${D}outimpFile @:>@; then
outimpFile=${D}outFile
fi
defFile="${D}{outFile}.def"
arcFile="${D}{outimpFile}.a"
arcFile2="${D}{outimpFile}.lib"
#create ${D}dllFile as something matching 8.3 restrictions,
if @<:@ -z ${D}renameScript @:>@ ; then
dllFile="${D}outFile"
else
dllFile=\`${D}renameScript ${D}outimpFile\`
fi
if @<:@ ${D}do_backup -ne 0 @:>@ ; then
if @<:@ -f ${D}arcFile @:>@ ; then
doCommand "mv ${D}arcFile ${D}{outFile}_s.a"
fi
if @<:@ -f ${D}arcFile2 @:>@ ; then
doCommand "mv ${D}arcFile2 ${D}{outFile}_s.lib"
fi
fi
# Extract public symbols from all the object files.
tmpdefFile=${D}{defFile}_%
rm -f ${D}tmpdefFile
for file in ${D}inputFiles ; do
case ${D}file in
*!)
;;
*)
doCommand "emxexp -u ${D}file >> ${D}tmpdefFile"
;;
esac
done
# Create the def file.
rm -f ${D}defFile
echo "LIBRARY \`basnam ${D}dllFile\` ${D}library_flags" >> ${D}defFile
dllFile="${D}{dllFile}.dll"
if @<:@ ! -z ${D}description @:>@; then
echo "DESCRIPTION \\"${D}{description}\\"" >> ${D}defFile
fi
echo "EXPORTS" >> ${D}defFile
doCommand "cat ${D}tmpdefFile | sort.exe | uniq.exe > ${D}{tmpdefFile}%"
grep -v "^ *;" < ${D}{tmpdefFile}% | grep -v "^ *${D}" >${D}tmpdefFile
# Checks if the export is ok or not.
for word in ${D}exclude_symbols; do
grep -v ${D}word < ${D}tmpdefFile >${D}{tmpdefFile}%
mv ${D}{tmpdefFile}% ${D}tmpdefFile
done
if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
sed "=" < ${D}tmpdefFile | \\
sed '
N
: loop
s/^\\(@<:@0-9@:>@\\+\\)\\(@<:@^;@:>@*\\)\\(;.*\\)\\?/\\2 @\\1 NONAME/
t loop
' > ${D}{tmpdefFile}%
grep -v "^ *${D}" < ${D}{tmpdefFile}% > ${D}tmpdefFile
else
rm -f ${D}{tmpdefFile}%
fi
cat ${D}tmpdefFile >> ${D}defFile
rm -f ${D}tmpdefFile
# Do linking, create implib, and apply lxlite.
gccCmdl="";
for file in ${D}inputFiles ; do
case ${D}file in
*!)
;;
*)
gccCmdl="${D}gccCmdl ${D}file"
;;
esac
done
doCommand "${D}CC ${D}CFLAGS -Zdll -o ${D}dllFile ${D}defFile ${D}gccCmdl ${D}EXTRA_CFLAGS"
touch "${D}{outFile}.dll"
doCommand "emximp -o ${D}arcFile ${D}defFile"
if @<:@ ${D}flag_USE_LXLITE -ne 0 @:>@; then
add_flags="";
if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
add_flags="-ynd"
fi
doCommand "lxlite -cs -t: -mrn -mln ${D}add_flags ${D}dllFile"
fi
doCommand "emxomf -s -l ${D}arcFile"
# Successful exit.
CleanUp 1
exit 0
EOF
dnl ===================== dllar.sh ends here =====================
])

View File

@@ -1,6 +1,30 @@
dnl ---------------------------------------------------------------------------
dnl Compiler detection macros by David Elliott
dnl ---------------------------------------------------------------------------
dnl
dnl This file is part of Bakefile (http://bakefile.sourceforge.net)
dnl
dnl Copyright (C) 2003-2007 Vaclav Slavik, David Elliott and others
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
dnl to deal in the Software without restriction, including without limitation
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
dnl and/or sell copies of the Software, and to permit persons to whom the
dnl Software is furnished to do so, subject to the following conditions:
dnl
dnl The above copyright notice and this permission notice shall be included in
dnl all copies or substantial portions of the Software.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
dnl DEALINGS IN THE SOFTWARE.
dnl
dnl $Id$
dnl
dnl Compiler detection macros by David Elliott
dnl
dnl ===========================================================================
@@ -89,12 +113,12 @@ AC_DEFUN([_AC_BAKEFILE_LANG_COMPILER],
)
]
)
AC_LANG_POP($2)
if test "x$bakefile_cv_[]_AC_LANG_ABBREV[]_compiler_[]$3" = "xyes"; then
:; $4
else
:; $5
fi
AC_LANG_POP($2)
])
dnl recent versions of SGI mipsPro compiler define _SGI_COMPILER_VERSION

View File

@@ -1,9 +1,36 @@
dnl ---------------------------------------------------------------------------
dnl Support macros for makefiles generated by BAKEFILE.
dnl ---------------------------------------------------------------------------
dnl
dnl This file is part of Bakefile (http://bakefile.sourceforge.net)
dnl
dnl Copyright (C) 2003-2007 Vaclav Slavik and others
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the "Software"),
dnl to deal in the Software without restriction, including without limitation
dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
dnl and/or sell copies of the Software, and to permit persons to whom the
dnl Software is furnished to do so, subject to the following conditions:
dnl
dnl The above copyright notice and this permission notice shall be included in
dnl all copies or substantial portions of the Software.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
dnl DEALINGS IN THE SOFTWARE.
dnl
dnl $Id$
dnl
dnl Support macros for makefiles generated by BAKEFILE.
dnl
dnl ---------------------------------------------------------------------------
dnl Lots of compiler & linker detection code contained here was taken from
dnl wxWindows configure.in script (see http://www.wxwindows.org)
dnl wxWidgets configure.in script (see http://www.wxwidgets.org)
dnl ---------------------------------------------------------------------------
@@ -51,7 +78,7 @@ AC_DEFUN([AC_BAKEFILE_PLATFORM],
PLATFORM_OS2=0
PLATFORM_BEOS=0
if test "x$BAKEFILE_FORCE_PLATFORM" = "x"; then
if test "x$BAKEFILE_FORCE_PLATFORM" = "x"; then
case "${BAKEFILE_HOST}" in
*-*-mingw32* )
PLATFORM_WIN32=1
@@ -65,7 +92,7 @@ AC_DEFUN([AC_BAKEFILE_PLATFORM],
*-*-darwin* )
PLATFORM_MAC=1
PLATFORM_MACOSX=1
;;
;;
*-*-beos* )
PLATFORM_BEOS=1
;;
@@ -99,7 +126,8 @@ AC_DEFUN([AC_BAKEFILE_PLATFORM],
PLATFORM_BEOS=1
;;
* )
AC_MSG_ERROR([Unknown platform: $BAKEFILE_FORCE_PLATFORM])
dnl wxWidgets-specific: allow unknown Unix systems
dnl AC_MSG_ERROR([Unknown platform: $BAKEFILE_FORCE_PLATFORM])
;;
esac
fi
@@ -126,7 +154,7 @@ AC_DEFUN([AC_BAKEFILE_PLATFORM_SPECIFICS],
AC_ARG_ENABLE([omf], AS_HELP_STRING([--enable-omf],
[use OMF object format (OS/2)]),
[bk_os2_use_omf="$enableval"])
case "${BAKEFILE_HOST}" in
*-*-darwin* )
dnl For Unix to MacOS X porting instructions, see:
@@ -153,7 +181,7 @@ AC_DEFUN([AC_BAKEFILE_PLATFORM_SPECIFICS],
OS2_LIBEXT="a"
fi
;;
i*86-*-beos* )
LDFLAGS="-L/boot/develop/lib/x86 $LDFLAGS"
;;
@@ -178,7 +206,7 @@ AC_DEFUN([AC_BAKEFILE_SUFFIXES],
DLLPREFIX_MODULE=""
DLLIMP_SUFFIX=""
dlldir="$libdir"
case "${BAKEFILE_HOST}" in
*-hp-hpux* )
SO_SUFFIX="sl"
@@ -261,7 +289,7 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD],
dnl the switch for gcc is the same under all platforms
PIC_FLAG="-fPIC"
fi
dnl Defaults for GCC and ELF .so shared libs:
SHARED_LD_CC="\$(CC) -shared ${PIC_FLAG} -o"
SHARED_LD_CXX="\$(CXX) -shared ${PIC_FLAG} -o"
@@ -431,8 +459,7 @@ AC_DEFUN([AC_BAKEFILE_SHARED_LD],
;;
*)
dnl wxWidgets-specific: allow unknown Unix systems
dnl AC_MSG_ERROR(unknown system type $BAKEFILE_HOST.)
AC_MSG_ERROR(unknown system type $BAKEFILE_HOST.)
esac
if test "x$PIC_FLAG" != "x" ; then
@@ -520,7 +547,7 @@ AC_DEFUN([AC_BAKEFILE_DEPS],
AS_HELP_STRING([--disable-dependency-tracking],
[don't use dependency tracking even if the compiler can]),
[bk_use_trackdeps="$enableval"])
AC_MSG_CHECKING([for dependency tracking method])
BK_DEPS=""
@@ -596,14 +623,19 @@ AC_DEFUN([AC_BAKEFILE_CHECK_BASIC_STUFF],
AC_PROG_MAKE_SET
AC_SUBST(MAKE_SET)
if test "x$SUNCXX" = "xyes"; then
dnl Sun C++ compiler requires special way of creating static libs;
dnl see here for more details:
dnl https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1229751&group_id=9863
AR=${AR:-"$CXX"}
AR=$CXX
AROPTIONS="-xar -o"
AC_SUBST(AR)
elif test "x$SGICC" = "xyes"; then
dnl Almost the same as above for SGI mipsPro compiler
AR=$CXX
AROPTIONS="-ar -o"
AC_SUBST(AR)
AROPTIONS=${AROPTIONS:-"-xar -o"}
else
AC_CHECK_TOOL(AR, ar, ar)
AROPTIONS=rcu
@@ -644,12 +676,12 @@ dnl ---------------------------------------------------------------------------
AC_DEFUN([AC_BAKEFILE_RES_COMPILERS],
[
case ${BAKEFILE_HOST} in
case ${BAKEFILE_HOST} in
*-*-cygwin* | *-*-mingw32* )
dnl Check for win32 resources compiler:
AC_CHECK_TOOL(WINDRES, windres)
;;
*-*-darwin* | powerpc-apple-macos* )
AC_CHECK_PROG(REZ, Rez, Rez, /Developer/Tools/Rez)
AC_CHECK_PROG(SETFILE, SetFile, SetFile, /Developer/Tools/SetFile)
@@ -680,7 +712,7 @@ AC_DEFUN([AC_BAKEFILE_PRECOMP_HEADERS],
USE_PCH=0
BK_MAKE_PCH=""
case ${BAKEFILE_HOST} in
case ${BAKEFILE_HOST} in
*-*-cygwin* )
dnl PCH support is broken in cygwin gcc because of unportable
dnl assumptions about mmap() in gcc code which make PCH generation
@@ -792,509 +824,25 @@ AC_DEFUN([AC_BAKEFILE],
AC_BAKEFILE_DEPS
AC_BAKEFILE_RES_COMPILERS
BAKEFILE_BAKEFILE_M4_VERSION="0.2.1"
BAKEFILE_BAKEFILE_M4_VERSION="0.2.2"
dnl includes autoconf_inc.m4:
$1
if test "$BAKEFILE_AUTOCONF_INC_M4_VERSION" = "" ; then
AC_MSG_ERROR([No version found in autoconf_inc.m4 - bakefile macro was changed to take additional argument, perhaps configure.in wasn't updated (see the documentation)?])
fi
if test "$BAKEFILE_BAKEFILE_M4_VERSION" != "$BAKEFILE_AUTOCONF_INC_M4_VERSION" ; then
AC_MSG_ERROR([Versions of Bakefile used to generate makefiles ($BAKEFILE_AUTOCONF_INC_M4_VERSION) and configure ($BAKEFILE_BAKEFILE_M4_VERSION) do not match.])
fi
])
dnl ---------------------------------------------------------------------------
dnl Embedded copies of helper scripts follow:
dnl ---------------------------------------------------------------------------
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_DLLAR_SH],
[
dnl ===================== dllar.sh begins here =====================
dnl (Created by merge-scripts.py from dllar.sh
dnl file do not edit here!)
D='$'
cat <<EOF >dllar.sh
#!/bin/sh
#
# dllar - a tool to build both a .dll and an .a file
# from a set of object (.o) files for EMX/OS2.
#
# Written by Andrew Zabolotny, bit@freya.etu.ru
# Ported to Unix like shell by Stefan Neis, Stefan.Neis@t-online.de
#
# This script will accept a set of files on the command line.
# All the public symbols from the .o files will be exported into
# a .DEF file, then linker will be run (through gcc) against them to
# build a shared library consisting of all given .o files. All libraries
# (.a) will be first decompressed into component .o files then act as
# described above. You can optionally give a description (-d "description")
# which will be put into .DLL. To see the list of accepted options (as well
# as command-line format) simply run this program without options. The .DLL
# is built to be imported by name (there is no guarantee that new versions
# of the library you build will have same ordinals for same symbols).
#
# dllar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# dllar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with dllar; see the file COPYING. If not, write to the Free
# Software Foundation, 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# To successfuly run this program you will need:
# - Current drive should have LFN support (HPFS, ext2, network, etc)
# (Sometimes dllar generates filenames which won't fit 8.3 scheme)
# - gcc
# (used to build the .dll)
# - emxexp
# (used to create .def file from .o files)
# - emximp
# (used to create .a file from .def file)
# - GNU text utilites (cat, sort, uniq)
# used to process emxexp output
# - GNU file utilities (mv, rm)
# - GNU sed
# - lxlite (optional, see flag below)
# (used for general .dll cleanup)
#
flag_USE_LXLITE=1;
#
# helper functions
# basnam, variant of basename, which does _not_ remove the path, _iff_
# second argument (suffix to remove) is given
basnam(){
case ${D}# in
1)
echo ${D}1 | sed 's/.*\\///' | sed 's/.*\\\\//'
;;
2)
echo ${D}1 | sed 's/'${D}2'${D}//'
;;
*)
echo "error in basnam ${D}*"
exit 8
;;
esac
}
# Cleanup temporary files and output
CleanUp() {
cd ${D}curDir
for i in ${D}inputFiles ; do
case ${D}i in
*!)
rm -rf \`basnam ${D}i !\`
;;
*)
;;
esac
done
# Kill result in case of failure as there is just to many stupid make/nmake
# things out there which doesn't do this.
if @<:@ ${D}# -eq 0 @:>@; then
rm -f ${D}arcFile ${D}arcFile2 ${D}defFile ${D}dllFile
fi
}
# Print usage and exit script with rc=1.
PrintHelp() {
echo 'Usage: dllar.sh @<:@-o@<:@utput@:>@ output_file@:>@ @<:@-i@<:@mport@:>@ importlib_name@:>@'
echo ' @<:@-name-mangler-script script.sh@:>@'
echo ' @<:@-d@<:@escription@:>@ "dll descrption"@:>@ @<:@-cc "CC"@:>@ @<:@-f@<:@lags@:>@ "CFLAGS"@:>@'
echo ' @<:@-ord@<:@inals@:>@@:>@ -ex@<:@clude@:>@ "symbol(s)"'
echo ' @<:@-libf@<:@lags@:>@ "{INIT|TERM}{GLOBAL|INSTANCE}"@:>@ @<:@-nocrt@<:@dll@:>@@:>@ @<:@-nolxl@<:@ite@:>@@:>@'
echo ' @<:@*.o@:>@ @<:@*.a@:>@'
echo '*> "output_file" should have no extension.'
echo ' If it has the .o, .a or .dll extension, it is automatically removed.'
echo ' The import library name is derived from this and is set to "name".a,'
echo ' unless overridden by -import'
echo '*> "importlib_name" should have no extension.'
echo ' If it has the .o, or .a extension, it is automatically removed.'
echo ' This name is used as the import library name and may be longer and'
echo ' more descriptive than the DLL name which has to follow the old '
echo ' 8.3 convention of FAT.'
echo '*> "script.sh may be given to override the output_file name by a'
echo ' different name. It is mainly useful if the regular make process'
echo ' of some package does not take into account OS/2 restriction of'
echo ' DLL name lengths. It takes the importlib name as input and is'
echo ' supposed to procude a shorter name as output. The script should'
echo ' expect to get importlib_name without extension and should produce'
echo ' a (max.) 8 letter name without extension.'
echo '*> "cc" is used to use another GCC executable. (default: gcc.exe)'
echo '*> "flags" should be any set of valid GCC flags. (default: -s -Zcrtdll)'
echo ' These flags will be put at the start of GCC command line.'
echo '*> -ord@<:@inals@:>@ tells dllar to export entries by ordinals. Be careful.'
echo '*> -ex@<:@clude@:>@ defines symbols which will not be exported. You can define'
echo ' multiple symbols, for example -ex "myfunc yourfunc _GLOBAL*".'
echo ' If the last character of a symbol is "*", all symbols beginning'
echo ' with the prefix before "*" will be exclude, (see _GLOBAL* above).'
echo '*> -libf@<:@lags@:>@ can be used to add INITGLOBAL/INITINSTANCE and/or'
echo ' TERMGLOBAL/TERMINSTANCE flags to the dynamically-linked library.'
echo '*> -nocrt@<:@dll@:>@ switch will disable linking the library against emx''s'
echo ' C runtime DLLs.'
echo '*> -nolxl@<:@ite@:>@ switch will disable running lxlite on the resulting DLL.'
echo '*> All other switches (for example -L./ or -lmylib) will be passed'
echo ' unchanged to GCC at the end of command line.'
echo '*> If you create a DLL from a library and you do not specify -o,'
echo ' the basename for DLL and import library will be set to library name,'
echo ' the initial library will be renamed to 'name'_s.a (_s for static)'
echo ' i.e. "dllar gcc.a" will create gcc.dll and gcc.a, and the initial'
echo ' library will be renamed into gcc_s.a.'
echo '--------'
echo 'Example:'
echo ' dllar -o gcc290.dll libgcc.a -d "GNU C runtime library" -ord'
echo ' -ex "__main __ctordtor*" -libf "INITINSTANCE TERMINSTANCE"'
CleanUp
exit 1
}
# Execute a command.
# If exit code of the commnad <> 0 CleanUp() is called and we'll exit the script.
# @Uses Whatever CleanUp() uses.
doCommand() {
echo "${D}*"
eval ${D}*
rcCmd=${D}?
if @<:@ ${D}rcCmd -ne 0 @:>@; then
echo "command failed, exit code="${D}rcCmd
CleanUp
exit ${D}rcCmd
fi
}
# main routine
# setup globals
cmdLine=${D}*
outFile=""
outimpFile=""
inputFiles=""
renameScript=""
description=""
CC=gcc.exe
CFLAGS="-s -Zcrtdll"
EXTRA_CFLAGS=""
EXPORT_BY_ORDINALS=0
exclude_symbols=""
library_flags=""
curDir=\`pwd\`
curDirS=curDir
case ${D}curDirS in
*/)
;;
*)
curDirS=${D}{curDirS}"/"
;;
esac
# Parse commandline
libsToLink=0
omfLinking=0
while @<:@ ${D}1 @:>@; do
case ${D}1 in
-ord*)
EXPORT_BY_ORDINALS=1;
;;
-o*)
shift
outFile=${D}1
;;
-i*)
shift
outimpFile=${D}1
;;
-name-mangler-script)
shift
renameScript=${D}1
;;
-d*)
shift
description=${D}1
;;
-f*)
shift
CFLAGS=${D}1
;;
-c*)
shift
CC=${D}1
;;
-h*)
PrintHelp
;;
-ex*)
shift
exclude_symbols=${D}{exclude_symbols}${D}1" "
;;
-libf*)
shift
library_flags=${D}{library_flags}${D}1" "
;;
-nocrt*)
CFLAGS="-s"
;;
-nolxl*)
flag_USE_LXLITE=0
;;
-* | /*)
case ${D}1 in
-L* | -l*)
libsToLink=1
;;
-Zomf)
omfLinking=1
;;
*)
;;
esac
EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
;;
*.dll)
EXTRA_CFLAGS="${D}{EXTRA_CFLAGS} \`basnam ${D}1 .dll\`"
if @<:@ ${D}omfLinking -eq 1 @:>@; then
EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.lib"
else
EXTRA_CFLAGS="${D}{EXTRA_CFLAGS}.a"
fi
;;
*)
found=0;
if @<:@ ${D}libsToLink -ne 0 @:>@; then
EXTRA_CFLAGS=${D}{EXTRA_CFLAGS}" "${D}1
else
for file in ${D}1 ; do
if @<:@ -f ${D}file @:>@; then
inputFiles="${D}{inputFiles} ${D}file"
found=1
fi
done
if @<:@ ${D}found -eq 0 @:>@; then
echo "ERROR: No file(s) found: "${D}1
exit 8
fi
fi
;;
esac
shift
done # iterate cmdline words
#
if @<:@ -z "${D}inputFiles" @:>@; then
echo "dllar: no input files"
PrintHelp
fi
# Now extract all .o files from .a files
newInputFiles=""
for file in ${D}inputFiles ; do
case ${D}file in
*.a | *.lib)
case ${D}file in
*.a)
suffix=".a"
AR="ar"
;;
*.lib)
suffix=".lib"
AR="emxomfar"
EXTRA_CFLAGS="${D}EXTRA_CFLAGS -Zomf"
;;
*)
;;
esac
dirname=\`basnam ${D}file ${D}suffix\`"_%"
mkdir ${D}dirname
if @<:@ ${D}? -ne 0 @:>@; then
echo "Failed to create subdirectory ./${D}dirname"
CleanUp
exit 8;
fi
# Append '!' to indicate archive
newInputFiles="${D}newInputFiles ${D}{dirname}!"
doCommand "cd ${D}dirname; ${D}AR x ../${D}file"
cd ${D}curDir
found=0;
for subfile in ${D}dirname/*.o* ; do
if @<:@ -f ${D}subfile @:>@; then
found=1
if @<:@ -s ${D}subfile @:>@; then
# FIXME: This should be: is file size > 32 byte, _not_ > 0!
newInputFiles="${D}newInputFiles ${D}subfile"
fi
fi
done
if @<:@ ${D}found -eq 0 @:>@; then
echo "WARNING: there are no files in archive \\'${D}file\\'"
fi
;;
*)
newInputFiles="${D}{newInputFiles} ${D}file"
;;
esac
done
inputFiles="${D}newInputFiles"
# Output filename(s).
do_backup=0;
if @<:@ -z ${D}outFile @:>@; then
do_backup=1;
set outFile ${D}inputFiles; outFile=${D}2
fi
# If it is an archive, remove the '!' and the '_%' suffixes
case ${D}outFile in
*_%!)
outFile=\`basnam ${D}outFile _%!\`
;;
*)
;;
esac
case ${D}outFile in
*.dll)
outFile=\`basnam ${D}outFile .dll\`
;;
*.DLL)
outFile=\`basnam ${D}outFile .DLL\`
;;
*.o)
outFile=\`basnam ${D}outFile .o\`
;;
*.obj)
outFile=\`basnam ${D}outFile .obj\`
;;
*.a)
outFile=\`basnam ${D}outFile .a\`
;;
*.lib)
outFile=\`basnam ${D}outFile .lib\`
;;
*)
;;
esac
case ${D}outimpFile in
*.a)
outimpFile=\`basnam ${D}outimpFile .a\`
;;
*.lib)
outimpFile=\`basnam ${D}outimpFile .lib\`
;;
*)
;;
esac
if @<:@ -z ${D}outimpFile @:>@; then
outimpFile=${D}outFile
fi
defFile="${D}{outFile}.def"
arcFile="${D}{outimpFile}.a"
arcFile2="${D}{outimpFile}.lib"
#create ${D}dllFile as something matching 8.3 restrictions,
if @<:@ -z ${D}renameScript @:>@ ; then
dllFile="${D}outFile"
else
dllFile=\`${D}renameScript ${D}outimpFile\`
fi
if @<:@ ${D}do_backup -ne 0 @:>@ ; then
if @<:@ -f ${D}arcFile @:>@ ; then
doCommand "mv ${D}arcFile ${D}{outFile}_s.a"
fi
if @<:@ -f ${D}arcFile2 @:>@ ; then
doCommand "mv ${D}arcFile2 ${D}{outFile}_s.lib"
fi
fi
# Extract public symbols from all the object files.
tmpdefFile=${D}{defFile}_%
rm -f ${D}tmpdefFile
for file in ${D}inputFiles ; do
case ${D}file in
*!)
;;
*)
doCommand "emxexp -u ${D}file >> ${D}tmpdefFile"
;;
esac
done
# Create the def file.
rm -f ${D}defFile
echo "LIBRARY \`basnam ${D}dllFile\` ${D}library_flags" >> ${D}defFile
dllFile="${D}{dllFile}.dll"
if @<:@ ! -z ${D}description @:>@; then
echo "DESCRIPTION \\"${D}{description}\\"" >> ${D}defFile
fi
echo "EXPORTS" >> ${D}defFile
doCommand "cat ${D}tmpdefFile | sort.exe | uniq.exe > ${D}{tmpdefFile}%"
grep -v "^ *;" < ${D}{tmpdefFile}% | grep -v "^ *${D}" >${D}tmpdefFile
# Checks if the export is ok or not.
for word in ${D}exclude_symbols; do
grep -v ${D}word < ${D}tmpdefFile >${D}{tmpdefFile}%
mv ${D}{tmpdefFile}% ${D}tmpdefFile
done
if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
sed "=" < ${D}tmpdefFile | \\
sed '
N
: loop
s/^\\(@<:@0-9@:>@\\+\\)\\(@<:@^;@:>@*\\)\\(;.*\\)\\?/\\2 @\\1 NONAME/
t loop
' > ${D}{tmpdefFile}%
grep -v "^ *${D}" < ${D}{tmpdefFile}% > ${D}tmpdefFile
else
rm -f ${D}{tmpdefFile}%
fi
cat ${D}tmpdefFile >> ${D}defFile
rm -f ${D}tmpdefFile
# Do linking, create implib, and apply lxlite.
gccCmdl="";
for file in ${D}inputFiles ; do
case ${D}file in
*!)
;;
*)
gccCmdl="${D}gccCmdl ${D}file"
;;
esac
done
doCommand "${D}CC ${D}CFLAGS -Zdll -o ${D}dllFile ${D}defFile ${D}gccCmdl ${D}EXTRA_CFLAGS"
touch "${D}{outFile}.dll"
doCommand "emximp -o ${D}arcFile ${D}defFile"
if @<:@ ${D}flag_USE_LXLITE -ne 0 @:>@; then
add_flags="";
if @<:@ ${D}EXPORT_BY_ORDINALS -ne 0 @:>@; then
add_flags="-ynd"
fi
doCommand "lxlite -cs -t: -mrn -mln ${D}add_flags ${D}dllFile"
fi
doCommand "emxomf -s -l ${D}arcFile"
# Successful exit.
CleanUp 1
exit 0
EOF
dnl ===================== dllar.sh ends here =====================
])
AC_DEFUN([AC_BAKEFILE_CREATE_FILE_BK_DEPS],
[
dnl ===================== bk-deps begins here =====================
@@ -1439,7 +987,7 @@ while test ${D}# -gt 0; do
args="${D}{args} ${D}1 ${D}2"
shift
;;
-s|-Wl,*)
# collect these load args
ldargs="${D}{ldargs} ${D}1"

View File

@@ -1,5 +1,5 @@
rem Uncomment the next line to set the version; used also in wxWidgets.iss
SET WXW_VER=2.8.4-rc2
SET WXW_VER=2.8.4
if (%WXW_VER%)==() SET WXW_VER=CVS
@@ -59,7 +59,7 @@ mkdir %WXWIN%\docs\pdf
mkdir %WXWIN%\docs\htmlhelp
mkdir %WXWIN%\docs\htb
echo starting word >> c:\temp.log
start /WAIT winword /mwx_ps
start /WAIT winword /mwx28_ps
echo cvs doc up part 2 >> c:\temp.log

View File

@@ -2,7 +2,7 @@
' laserjet ps driver
' Note that the output dir and hardcoded printer must exist
Sub wx_ps()
Sub wx28_ps()
swxWIN = Environ("WXWIN")
do_ps swxWIN & "\docs\pdf\", "wx"
do_ps swxWIN & "\contrib\docs\latex\svg", "svg"
@@ -15,28 +15,4 @@ Sub wx_ps()
bye_bye
End Sub
Sub do_ps(mydir, myfile)
' wx_ps Macro
' Macro recorded 04/05/2005 by cje2
'
sDAILYIN = Environ("DAILY") & "\in\"
ChangeFileOpenDirectory mydir
Documents.Open FileName:=myfile & ".rtf", ConfirmConversions:=False, ReadOnly:= _
False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _
"", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _
Format:=wdOpenFormatAuto
ActivePrinter = "\\biolpc22\laserjet"
ActiveDocument.Fields.Update
Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=False, PrintToFile:=True, PrintZoomColumn:=0, _
PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0, _
OutputFileName:=sDAILYIN & myfile & ".ps", Append:=False
ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
End Sub
Sub bye_bye()
Application.Quit SaveChanges:=wdDoNotSaveChanges
End Sub

3067
configure vendored

File diff suppressed because one or more lines are too long

View File

@@ -2102,18 +2102,55 @@ if test "x$SUNCC" = xyes; then
CFLAGS="-erroff=E_NO_EXPLICIT_TYPE_GIVEN $CFLAGS"
fi
dnl SGI mipsPro compiler gives this warning for "conversion from pointer to
dnl same-sized integral type" even when there is an explicit cast and as there
dnl is no way to turn it off and there are hundreds of these warnings in wx
dnl sources, just turn it off for now
dnl SGI mipsPro compiler version 7.4.4 and later (and maybe some earlier
dnl versions too but it's known that 7.4 doesn't give this warning) gives this
dnl warning for "conversion from pointer to same-sized integral type" even when
dnl there is an explicit cast and as there is no way to turn it off and there
dnl are hundreds of these warnings in wx sources, just turn it off for now
dnl
dnl a better long term solution would be to use #pragma set/reset woff in
dnl wxPtrToUInt() and use it instead of casts elsewhere
if test "x$SGICC" = "xyes"; then
CFLAGS="-woff 3970 $CFLAGS"
AC_CACHE_CHECK([if cc version is 7.4.4 or greater],
wx_cv_prog_sgicc744,
[
AC_TRY_COMPILE([],
[
#if _SGI_COMPILER_VERSION >= 744
chock me: mipsPro is 7.4.4 or later
#endif
],
wx_cv_prog_sgicc744=no,
wx_cv_prog_sgicc744=yes
)
]
)
if test "x$wx_cv_prog_sgicc744" = "xyes"; then
CFLAGS="-woff 3970 $CFLAGS"
fi
fi
if test "x$SGICXX" = "xyes"; then
CXXFLAGS="-woff 3970 $CXXFLAGS"
AC_CACHE_CHECK([if CC version is 7.4.4 or greater],
wx_cv_prog_sgicxx744,
[
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([],
[
#if _SGI_COMPILER_VERSION >= 744
chock me: mipsPro is 7.4.4 or later
#endif
],
wx_cv_prog_sgicxx744=no,
wx_cv_prog_sgicxx744=yes
)
AC_LANG_POP()
]
)
if test "x$wx_cv_prog_sgicxx744" = "xyes"; then
CXXFLAGS="-woff 3970 $CXXFLAGS"
fi
fi
dnl HP-UX c89/aCC compiler warnings
@@ -2139,7 +2176,7 @@ if test "x$COMPAQCXX" = "xyes"; then
dnl intconlosbit: "conversion to integral type of smaller size could lose
dnl data" this is a useful warning but there are too many of
dnl them for now
CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit"
CXXFLAGS="-w0 -msg_disable basclsnondto,unrimpret,intconlosbit $CXXFLAGS"
fi
dnl the next few tests are all for C++ features and so need to be done using
@@ -4666,7 +4703,11 @@ if test "$wxUSE_FILE" = "yes"; then
WX_CHECK_FUNCS(fsync)
fi
dnl at least under IRIX with mipsPro the C99 round() function is available when
dnl building using the C compiler but not when using C++ one
AC_LANG_PUSH(C++)
WX_CHECK_FUNCS(round,,,[#include <math.h>])
AC_LANG_POP()
dnl the following tests are for Unix(like) systems only
if test "$TOOLKIT" != "MSW"; then
@@ -7024,17 +7065,14 @@ if test "$wxUSE_TREECTRL" = "yes"; then
fi
if test "$wxUSE_POPUPWIN" = "yes"; then
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 ; then
AC_MSG_WARN([Popup window not yet supported under Mac OS X... disabled])
if test "$wxUSE_MAC" = 1 -o "$wxUSE_COCOA" = 1 -o "$wxUSE_PM" = 1 \
-o "$wxUSE_DFB" = 1; then
AC_MSG_WARN([Popup window not yet supported on this platform... disabled])
else
if test "$wxUSE_PM" = 1; then
AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled])
else
AC_DEFINE(wxUSE_POPUPWIN)
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS popup"
AC_DEFINE(wxUSE_POPUPWIN)
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS popup"
USES_CONTROLS=1
fi
USES_CONTROLS=1
fi
fi

19
debian/changelog vendored
View File

@@ -1,3 +1,22 @@
wxwidgets2.8 (2.8.4.0-0) unstable; urgency=low
* Fix bug in wxFileConfig when recreating a group (Steven Van Ingelgem)
* Fix wxStringOutputStream::Write() in Unicode build when the argument
overlaps UTF-8 characters boundary
* Account for lines without newline at the end in wxExecute()
* Handle socket shutdown by the peer correctly in wxSocket (Tim Kosse)
* Allow status bar children in XRC (Edmunt Pienkowski)
* Fix memory leak in wxWizard when not using sizers for the page layout
* Fix infinite loop when adding a wxStaticText control to a toolbar
* Fix wxNO_BORDER style for wxRadioBox (David Hart)
* wxComboBox::SetValue() doesn't emit EVT_TEXT anymore
* Fix wxTextCtrl::GetLineText() for empty lines (Marcin Wojdyr)
* Added wxString::char_str(), wchar_str(), From8BitData(), To8BitData(),
FromUTF8(), ToUTF8() and utf8_str() methods for forward compatiblity
with wxWidgets 3
-- Vadim Zeitlin <vadim@wxwindows.org> May, 09 Wed 2007 23:10:01 +0200
wxwidgets2.8 (2.8.3.0-0) unstable; urgency=low
* Added wxSizerFlags::Shaped(), FixedMinSize(), Top() and Bottom() methods.

2
debian/control.in vendored
View File

@@ -1,7 +1,7 @@
Source: wxwidgets=V
Section: libs
Priority: optional
Build-Depends: debhelper (>=4.0), flex, bison, gettext, libgtk2.0-dev, =PY, =PY-dev, zlib1g-dev, libjpeg62-dev, libpng12-dev, libtiff4-dev, libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev, libesd0-dev, libgnomeprintui2.2-dev, libgconf2-dev, libgstreamer0.10-dev, libgstreamer-plugins-base0.10-dev
Build-Depends: debhelper (>=4.0), flex, bison, gettext, libgtk2.0-dev, =PY, =PY-dev, zlib1g-dev, libjpeg62-dev, libpng12-dev, libtiff4-dev, libsm-dev, libgl1-mesa-dev | libgl-dev, libglu1-mesa-dev | libglu-dev, libesd0-dev, libgnomeprintui2.2-dev, libgconf2-dev, libgstreamer0.10-dev, libgstreamer-plugins-base0.10-dev
Maintainer: wxWidgets dev-team <wx-dev@lists.wxwidgets.org>
Standards-Version: 3.6.2.1

View File

@@ -60,7 +60,7 @@ getfilelist(){
fi
if [ $port = "mgl" ] || [ $port = "all" ]; then
filelist="$filelist mgl.rsp"
filelist="$filelist univ.rsp mgl.rsp"
fi
if [ $port = "dfb" ] || [ $port = "all" ]; then

View File

@@ -97,8 +97,9 @@ All:
- Fix wxStringOutputStream::Write() in Unicode build when the argument
overlaps UTF-8 characters boundary
- Account for lines without newline at the end in wxExecute()
- Added wxString::char_str() and wchar_str() methods for forward
compatiblity with wxWidgets 3
- Added wxString::char_str(), wchar_str(), From8BitData(), To8BitData(),
FromUTF8(), ToUTF8() and utf8_str() methods for forward compatiblity
with wxWidgets 3
All (Unix):
@@ -108,6 +109,8 @@ All (GUI):
- Allow status bar children in XRC (Edmunt Pienkowski)
- Fix memory leak in wxWizard when not using sizers for the page layout
- Added wxListCtrl::SetItemPtrData()
- wxHTML: Apply table background colour between the cells too (Michael Hieke)
wxMSW:
@@ -119,6 +122,7 @@ wxMSW:
- Fixed bug in wxThread::Wait() in console applications introduced in 2.8.3
- Support right-aligned/centered owner drawn items in wxListCtrl (troelsk)
- Compilation fixed with WXWIN_COMPATIBILITY_2_6==0
- Fix wxComboCtrl colours under Windows Vista (Kolya Kosenko)
wxGTK:
@@ -126,6 +130,11 @@ wxGTK:
- Fix wxNO_BORDER style for wxRadioBox (David Hart)
- wxComboBox::SetValue() doesn't emit EVT_TEXT anymore
- Fix wxTextCtrl::GetLineText() for empty lines (Marcin Wojdyr)
- Fix support for wxFD_FILE_MUST_EXIST in wxFileDialog
- Fix support for setting orientation, paper size and collate
in GNOME print backend
- Support wxTEXT_ALIGNMENT_JUSTIFIED in wxTextCtrl if GTK+ version is at
least 2.11 (Mart Raudsepp).
wxMac:

View File

@@ -943,6 +943,9 @@ from $0$ to {\it count}.
Associates application-defined data with this item.
Notice that this function cannot be used to associate pointers with the control
items, use \helpref{SetItemPtrData}{wxlistctrlsetitemptrdata} instead.
\membersection{wxListCtrl::SetItemFont}\label{wxlistctrlsetitemfont}
@@ -981,6 +984,18 @@ The image is an index into the image list associated with the list control.
Sets the position of the item, in icon or small icon view. Windows only.
\membersection{wxListCtrl::SetItemPtrData}\label{wxlistctrlsetitemptrdata}
\func{bool}{SetItemPtrData}{\param{long }{item}, \param{wxUIntPtr }{data}}
Associates application-defined data with this item. The \arg{data} parameter may
be either an integer or a pointer cast to the \texttt{wxUIntPtr} type which is
guaranteed to be large enough to be able to contain all integer types and
pointers.
\newsince{2.8.4}
\membersection{wxListCtrl::SetItemState}\label{wxlistctrlsetitemstate}
\func{bool}{SetItemState}{\param{long }{item}, \param{long }{state}, \param{long }{stateMask}}

View File

@@ -90,7 +90,7 @@ Creates a new input stream on the specified URL. You can use all but seek
functionality of wxStream. Seek isn't available on all streams. For example,
HTTP or FTP streams don't deal with it.
Note that this method is somewhat depreciated, all future wxWidgets applications
Note that this method is somewhat deprecated, all future wxWidgets applications
should really use \helpref{wxFileSystem}{wxfilesystem} instead.
Example:

View File

@@ -749,6 +749,24 @@ Returns the number of occurrences of {\it ch} in the string.
This is a wxWidgets 1.xx compatibility function; you should not use it in new code.
\membersection{wxString::From8BitData}\label{wxstringfrom8bitdata}
\func{static wxString }{From8BitData}{\param{const char*}{ buf}, \param{size\_t}{len}}
\func{static wxString }{From8BitData}{\param{const char*}{ buf}}
Converts given buffer of binary data from 8-bit string to wxString. In Unicode
build, the string is interpreted as being in ISO-8859-1 encoding. The version
without \arg{len} parameter takes NUL-terminated data.
This is a convenience method useful when storing binary data in wxString.
\newsince{2.8.4}
\wxheading{See also}
\helpref{To8BitData}{wxstringto8bitdata}
\membersection{wxString::FromAscii}\label{wxstringfromascii}
@@ -763,6 +781,19 @@ Use \helpref{wxString constructors}{wxstringconstruct} if you
need to convert from another charset.
\membersection{wxString::FromUTF8}\label{wxstringfromutf8}
\func{static wxString }{FromUTF8}{\param{const char*}{ s}}
\func{static wxString }{FromUTF8}{\param{const char*}{ s}, \param{size\_t}{ len}}
Converts C string encoded in UTF-8 to wxString.
Note that this method assumes that \arg{s} is a valid UTF-8 sequence and
doesn't do any validation in release builds, it's validity is only checked in
debug builds.
\membersection{wxString::GetChar}\label{wxstringgetchar}
\constfunc{wxChar}{GetChar}{\param{size\_t}{ n}}
@@ -1122,16 +1153,34 @@ This is a wxWidgets 1.xx compatibility function, use \helpref{Mid}{wxstringmid}
instead (but note that parameters have different meaning).
\membersection{wxString::To8BitData}\label{wxstringto8bitdata}
\constfunc{const char*}{To8BitData}{\void}
Converts the string to an 8-bit string (ANSI builds only).
\constfunc{const wxCharBuffer}{To8BitData}{\void}
Converts the string to an 8-bit string in ISO-8859-1 encoding in the form of
a wxCharBuffer (Unicode builds only).
This is a convenience method useful when storing binary data in wxString.
\newsince{2.8.4}
\wxheading{See also}
\helpref{From8BitData}{wxstringfrom8bitdata}
\membersection{wxString::ToAscii}\label{wxstringtoascii}
\constfunc{const char*}{ToAscii}{\void}
Converts the string to an ASCII, 7-bit string (ANSI builds only).
\constfunc{const wxCharBuffer}{ToAscii}{\void}
Converts the string to an ASCII, 7-bit string in the form of
a wxCharBuffer (Unicode builds only).
a wxCharBuffer (Unicode builds only) or a C string (ANSI builds).
Note that this conversion only works if the string contains only ASCII
characters. The \helpref{mb\_str}{wxstringmbstr} method provides more
@@ -1223,6 +1272,15 @@ bit integer numbers.
Please see \helpref{ToLongLong}{wxstringtolonglong} for additional remarks.
\membersection{wxString::ToUTF8}\label{wxstringtoutf8}
\constfunc{const wxCharBuffer}{ToUF8}{\void}
Same as \helpref{utf8\_str}{wxstringutf8str}.
\newsince{2.8.4}
\membersection{wxString::Trim}\label{wxstringtrim}
\func{wxString\&}{Trim}{\param{bool}{ fromRight = true}}
@@ -1272,6 +1330,16 @@ The same as MakeUpper.
This is a wxWidgets 1.xx compatibility function; you should not use it in new code.
\membersection{wxString::utf8\_str}\label{wxstringutf8str}
\constfunc{const wxCharBuffer}{utf8\_str}{\void}
Converts the strings contents to UTF-8 and returns it as a temporary
wxCharBuffer object.
\newsince{2.8.4}
\membersection{wxString::wc\_str}\label{wxstringwcstr}
\constfunc{const wchar\_t*}{wc\_str}{\param{wxMBConv\&}{ conv}}

View File

@@ -111,6 +111,7 @@ private: \
chartype *m_str; \
}
#if wxABI_VERSION >= 20804
// needed for wxString::char_str() and wchar_str()
#define DEFINE_WRITABLE_BUFFER(classname, baseclass, chartype) \
class WXDLLIMPEXP_BASE classname : public baseclass \
@@ -121,14 +122,19 @@ public: \
\
operator chartype*() { return this->data(); } \
}
#endif // wxABI_VERSION >= 20804
DEFINE_BUFFER(wxCharBuffer, char, wxStrdupA);
#if wxABI_VERSION >= 20804
DEFINE_WRITABLE_BUFFER(wxWritableCharBuffer, wxCharBuffer, char);
#endif
#if wxUSE_WCHAR_T
DEFINE_BUFFER(wxWCharBuffer, wchar_t, wxStrdupW);
#if wxABI_VERSION >= 20804
DEFINE_WRITABLE_BUFFER(wxWritableWCharBuffer, wxWCharBuffer, wchar_t);
#endif
#endif // wxUSE_WCHAR_T

View File

@@ -1197,6 +1197,18 @@
# endif
#endif /* wxUSE_ZIPSTREAM */
#if wxUSE_TARSTREAM
/* wxTar doesn't currently compile without wchar_t */
# if !wxUSE_WCHAR_T
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxTar requires wchar_t"
# else
# undef wxUSE_TARSTREAM
# define wxUSE_TARSTREAM 0
# endif
# endif
#endif /* wxUSE_TARSTREAM */
#if wxUSE_TARSTREAM
# if !wxUSE_ARCHIVE_STREAMS
# ifdef wxABORT_ON_CONFIG_ERROR

View File

@@ -84,9 +84,9 @@ public:
{
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
Set((ChannelType)colRGB,
(ChannelType)(colRGB >> 8),
(ChannelType)(colRGB >> 16));
Set((ChannelType)(0xFF & colRGB),
(ChannelType)(0xFF & (colRGB >> 8)),
(ChannelType)(0xFF & (colRGB >> 16)));
}

View File

@@ -95,7 +95,14 @@ private:
DECLARE_NO_ASSIGN_CLASS(wxConvAuto)
};
#endif // wxUSE_WCHAR_T
#else // !wxUSE_WCHAR_T
// it doesn't matter how we define it in this case as it's unused anyhow, but
// do define it to allow the code using wxConvAuto() as default argument (this
// is done in many places) to compile
typedef wxMBConv wxConvAuto;
#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
#endif // _WX_CONVAUTO_H_

View File

@@ -77,7 +77,10 @@ public:
wxString GetItemText( long item ) const;
void SetItemText( long item, const wxString& str );
wxUIntPtr GetItemData( long item ) const;
bool SetItemData( long item, long data );
#if wxABI_VERSION >= 20804
bool SetItemPtrData(long item, wxUIntPtr data);
#endif // wxABI 2.8.4+
bool SetItemData(long item, long data);
bool GetItemRect( long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS ) const;
bool GetItemPosition( long item, wxPoint& pos ) const;
bool SetItemPosition( long item, const wxPoint& pos ); // not supported in wxGLC

View File

@@ -47,10 +47,12 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSearchCtrlNameStr);
#if wxUSE_MENUS
// get/set search button menu
// --------------------------
virtual void SetMenu( wxMenu* menu );
virtual wxMenu* GetMenu();
#endif // wxUSE_MENUS
// get/set search options
// ----------------------
@@ -197,8 +199,10 @@ public:
// search control generic only
void SetSearchBitmap( const wxBitmap& bitmap );
void SetSearchMenuBitmap( const wxBitmap& bitmap );
void SetCancelBitmap( const wxBitmap& bitmap );
#if wxUSE_MENUS
void SetSearchMenuBitmap( const wxBitmap& bitmap );
#endif // wxUSE_MENUS
protected:
virtual void DoSetValue(const wxString& value, int flags = 0);
@@ -219,27 +223,46 @@ protected:
void OnSetFocus( wxFocusEvent& event );
void OnSize( wxSizeEvent& event );
bool HasMenu() const
{
#if wxUSE_MENUS
return m_menu != NULL;
#else // !wxUSE_MENUS
return false;
#endif // wxUSE_MENUS/!wxUSE_MENUS
}
private:
friend class wxSearchButton;
#if wxUSE_MENUS
void PopupSearchMenu();
#endif // wxUSE_MENUS
// the subcontrols
wxSearchTextCtrl *m_text;
wxSearchButton *m_searchButton;
wxSearchButton *m_cancelButton;
#if wxUSE_MENUS
wxMenu *m_menu;
#endif // wxUSE_MENUS
bool m_searchButtonVisible;
bool m_cancelButtonVisible;
bool m_searchBitmapUser;
bool m_searchMenuBitmapUser;
bool m_cancelBitmapUser;
#if wxUSE_MENUS
bool m_searchMenuBitmapUser;
#endif // wxUSE_MENUS
wxBitmap m_searchBitmap;
wxBitmap m_searchMenuBitmap;
wxBitmap m_cancelBitmap;
#if wxUSE_MENUS
wxBitmap m_searchMenuBitmap;
#endif // wxUSE_MENUS
private:
DECLARE_DYNAMIC_CLASS(wxSearchCtrl)

View File

@@ -29,7 +29,7 @@
#define wxGTK_CONV_FONT(s, font) wxGTK_CONV((s))
#define wxGTK_CONV_SYS(s) wxGTK_CONV((s))
#define wxGTK_CONV_BACK(s) wxConvUTF8.cMB2WX((s))
#else
#elif wxUSE_WCHAR_T
#include "wx/font.h"
// convert the text in given encoding to UTF-8 used by wxGTK
@@ -49,6 +49,12 @@
#define wxGTK_CONV(s) wxGTK_CONV_FONT((s), m_font)
#define wxGTK_CONV_SYS(s) wxConvertToGTK((s))
#define wxGTK_CONV_BACK(s) wxConvLocal.cWC2WX(wxConvUTF8.cMB2WC((s)))
#else // we're limited to ASCII
#define wxGTK_CONV_ENC(s, enc) (s)
#define wxGTK_CONV_FONT(s, font) (s)
#define wxGTK_CONV(s) (s)
#define wxGTK_CONV_SYS(s) (s)
#define wxGTK_CONV_BACK(s) (wxString(s))
#endif
// Some deprecated GTK+ prototypes we still use often

View File

@@ -122,7 +122,10 @@ class WXDLLEXPORT wxListCtrl: public wxControl
long GetItemData(long item) const ;
// Sets the item data
bool SetItemData(long item, long data) ;
#if wxABI_VERSION >= 20804
bool SetItemPtrData(long item, wxUIntPtr data);
#endif // wxABI 2.8.4+
bool SetItemData(long item, long data);
// Gets the item rectangle
bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;

View File

@@ -105,7 +105,8 @@ public:
virtual bool MSWCommand(WXUINT param, WXWORD id);
bool MSWProcessEditMsg(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam);
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
bool MSWShouldPreProcessMessage(WXMSG *pMsg);
WXHWND GetEditHWND() const;
// Standard event handling

View File

@@ -13,6 +13,8 @@
#ifndef _WX_DRAGIMAG_H_
#define _WX_DRAGIMAG_H_
#if wxUSE_DRAGIMAGE
#include "wx/bitmap.h"
#include "wx/icon.h"
#include "wx/cursor.h"
@@ -267,5 +269,6 @@ private:
DECLARE_NO_COPY_CLASS(wxDragImage)
};
#endif // wxUSE_DRAGIMAGE
#endif
// _WX_DRAGIMAG_H_

View File

@@ -163,7 +163,10 @@ public:
wxUIntPtr GetItemData(long item) const ;
// Sets the item data
bool SetItemData(long item, long data) ;
#if wxABI_VERSION >= 20804
bool SetItemPtrData(long item, wxUIntPtr data);
#endif // wxABI 2.8.4+
bool SetItemData(long item, long data);
// Gets the item rectangle
bool GetItemRect(long item, wxRect& rect, int code = wxLIST_RECT_BOUNDS) const ;

View File

@@ -291,8 +291,10 @@ private:
// true if the hash above is not empty
bool m_hasAnyAttr;
#if wxUSE_DRAGIMAGE
// used for dragging
wxDragImage *m_dragImage;
#endif
// Virtual root item, if wxTR_HIDE_ROOT is set.
void* m_pVirtualRoot;

View File

@@ -52,9 +52,11 @@ public:
wxSearchCtrlBase() { }
virtual ~wxSearchCtrlBase() { }
// search control
// search control
#if wxUSE_MENUS
virtual void SetMenu(wxMenu *menu) = 0;
virtual wxMenu *GetMenu() = 0;
#endif // wxUSE_MENUS
// get/set options
virtual void ShowSearchButton( bool show ) = 0;

View File

@@ -500,9 +500,13 @@ class WXDLLIMPEXP_BASE wxMBConv
public:
const char* cMB2WX(const char *psz) const { return psz; }
const char* cWX2MB(const char *psz) const { return psz; }
wxMBConv *Clone() const { return NULL; }
};
#define wxConvFile wxConvLocal
#define wxConvUI wxConvCurrent
typedef wxMBConv wxCSConv;
extern WXDLLIMPEXP_DATA_BASE(wxMBConv) wxConvLibc,
wxConvLocal,
@@ -513,8 +517,7 @@ extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent;
#define wxFNCONV(name) name
#define wxFNSTRINGCAST WXSTRINGCAST
#endif
// wxUSE_WCHAR_T
#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
// ----------------------------------------------------------------------------
// macros for the most common conversions

View File

@@ -836,6 +836,7 @@ public:
// identical to c_str(), for MFC compatibility
const wxChar* GetData() const { return c_str(); }
#if wxABI_VERSION >= 20804
// conversion to *non-const* multibyte or widestring buffer; modifying
// returned buffer won't affect the string, these methods are only useful
// for passing values to const-incorrect functions
@@ -844,6 +845,7 @@ public:
#if wxUSE_WCHAR_T
wxWritableWCharBuffer wchar_str() const { return wc_str(wxConvLibc); }
#endif
#endif // wxABI_VERSION >= 20804
// conversion to/from plain (i.e. 7 bit) ASCII: this is useful for
// converting numbers or strings which are certain not to contain special
@@ -861,6 +863,49 @@ public:
const char *ToAscii() const { return c_str(); }
#endif // Unicode/!Unicode
#if wxABI_VERSION >= 20804
// conversion to/from UTF-8:
#if wxUSE_UNICODE
static wxString FromUTF8(const char *utf8)
{ return wxString(utf8, wxConvUTF8); }
static wxString FromUTF8(const char *utf8, size_t len)
{ return wxString(utf8, wxConvUTF8, len); }
const wxCharBuffer utf8_str() const { return mb_str(wxConvUTF8); }
const wxCharBuffer ToUTF8() const { return utf8_str(); }
#elif wxUSE_WCHAR_T // ANSI
static wxString FromUTF8(const char *utf8)
{ return wxString(wxConvUTF8.cMB2WC(utf8)); }
static wxString FromUTF8(const char *utf8, size_t len)
{
size_t wlen;
wxWCharBuffer buf(wxConvUTF8.cMB2WC(utf8, len == npos ? wxNO_LEN : len, &wlen));
return wxString(buf.data(), wxConvLibc, wlen);
}
const wxCharBuffer utf8_str() const
{ return wxConvUTF8.cWC2MB(wc_str(wxConvLibc)); }
const wxCharBuffer ToUTF8() const { return utf8_str(); }
#endif // Unicode/ANSI
#endif // wxABI_VERSION >= 20804
#if wxABI_VERSION >= 20804
// functions for storing binary data in wxString:
#if wxUSE_UNICODE
static wxString From8BitData(const char *data, size_t len)
{ return wxString(data, wxConvISO8859_1, len); }
// version for NUL-terminated data:
static wxString From8BitData(const char *data)
{ return wxString(data, wxConvISO8859_1); }
const wxCharBuffer To8BitData() const { return mb_str(wxConvISO8859_1); }
#else // ANSI
static wxString From8BitData(const char *data, size_t len)
{ return wxString(data, len); }
// version for NUL-terminated data:
static wxString From8BitData(const char *data)
{ return wxString(data); }
const char *To8BitData() const { return c_str(); }
#endif // Unicode/ANSI
#endif // wxABI_VERSION >= 20804
// conversions with (possible) format conversions: have to return a
// buffer with temporary data
//

6749
locale/sk.po Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,3 +1,7 @@
type 'carb' {};
resource 'carb'(0) {};
data 'vers' (2) {
$"0100 2000 0000 0531 2E30 6430 0531 2E30"
$"6430"} ;

View File

@@ -2232,6 +2232,11 @@ public:
m_tab_ctrl_height = 20;
}
~wxTabFrame()
{
wxDELETE(m_tabs);
}
void SetTabCtrlHeight(int h)
{
m_tab_ctrl_height = h;

View File

@@ -159,8 +159,10 @@ void wxAuiFloatingFrame::OnSize(wxSizeEvent& event)
void wxAuiFloatingFrame::OnClose(wxCloseEvent& evt)
{
m_owner_mgr->OnFloatingPaneClosed(m_pane_window, evt);
if (!evt.GetVeto())
if (!evt.GetVeto()) {
m_mgr.DetachPane(m_pane_window);
Destroy();
}
}
void wxAuiFloatingFrame::OnMoveEvent(wxMoveEvent& event)

View File

@@ -502,7 +502,7 @@ wxAuiManager::wxAuiManager(wxWindow* managed_wnd, unsigned int flags)
m_dock_constraint_x = 0.3;
m_dock_constraint_y = 0.3;
m_reserved = NULL;
if (managed_wnd)
{
SetManagedWindow(managed_wnd);
@@ -511,6 +511,19 @@ wxAuiManager::wxAuiManager(wxWindow* managed_wnd, unsigned int flags)
wxAuiManager::~wxAuiManager()
{
// NOTE: It's possible that the windows have already been destroyed by the
// time this dtor is called, so this loop can result in memory access via
// invalid pointers, resulting in a crash. So it will be disabled while
// waiting for a better solution.
#if 0
for(size_t i = 0; i < m_panes.size(); i++ )
{
wxAuiPaneInfo& pinfo = m_panes[i];
if( pinfo.window && !pinfo.window->GetParent() )
delete pinfo.window;
}
#endif
delete m_art;
}
@@ -612,7 +625,7 @@ void wxAuiManager::SetFlags(unsigned int flags)
// set the new flags
m_flags = flags;
if (update_hint_wnd)
{
UpdateHintWindowConfig();
@@ -650,7 +663,7 @@ wxAuiManager* wxAuiManager::GetManager(wxWindow* window)
evt.ResumePropagation(wxEVENT_PROPAGATE_MAX);
if (!window->ProcessEvent(evt))
return NULL;
return evt.GetManager();
}
@@ -659,7 +672,7 @@ void wxAuiManager::UpdateHintWindowConfig()
{
// find out if the the system can do transparent frames
bool can_do_transparent = false;
wxWindow* w = m_frame;
while (w)
{
@@ -669,10 +682,10 @@ void wxAuiManager::UpdateHintWindowConfig()
can_do_transparent = f->CanSetTransparent();
break;
}
w = w->GetParent();
}
// if there is an existing hint window, delete it
if (m_hint_wnd)
{
@@ -682,9 +695,9 @@ void wxAuiManager::UpdateHintWindowConfig()
m_hint_fademax = 50;
m_hint_wnd = NULL;
if ((m_flags & wxAUI_MGR_TRANSPARENT_HINT) && can_do_transparent)
{
{
// Make a window to use for a transparent hint
#if defined(__WXMSW__) || defined(__WXGTK__)
m_hint_wnd = new wxFrame(m_frame, wxID_ANY, wxEmptyString,
@@ -712,7 +725,7 @@ void wxAuiManager::UpdateHintWindowConfig()
// blue.
p->SetBackgroundColour(*wxBLUE);
#endif
}
else
{
@@ -872,14 +885,14 @@ bool wxAuiManager::AddPane(wxWindow* window, const wxAuiPaneInfo& pane_info)
button.button_id = wxAUI_BUTTON_MAXIMIZE_RESTORE;
pinfo.buttons.Add(button);
}
if (pinfo.HasPinButton())
{
wxAuiPaneButton button;
button.button_id = wxAUI_BUTTON_PIN;
pinfo.buttons.Add(button);
}
if (pinfo.HasCloseButton())
{
wxAuiPaneButton button;
@@ -1035,7 +1048,7 @@ bool wxAuiManager::DetachPane(wxWindow* window)
{
m_action_window = NULL;
}
p.window->Reparent(m_frame);
p.frame->SetSizer(NULL);
p.frame->Destroy();
@@ -1096,7 +1109,7 @@ void wxAuiManager::ClosePane(wxAuiPaneInfo& pane_info)
}
// now we need to either destroy or hide the pane
if (pane_info.IsDestroyOnClose())
if (pane_info.IsDestroyOnClose())
{
wxWindow * window = pane_info.window;
DetachPane(window);
@@ -1104,8 +1117,8 @@ void wxAuiManager::ClosePane(wxAuiPaneInfo& pane_info)
{
window->Destroy();
}
}
else
}
else
{
pane_info.Hide();
}
@@ -1122,7 +1135,7 @@ void wxAuiManager::MaximizePane(wxAuiPaneInfo& pane_info)
if (!p.IsToolbar())
{
p.Restore();
// save hidden state
p.SetFlag(wxAuiPaneInfo::savedHiddenState,
p.HasFlag(wxAuiPaneInfo::optionHidden));
@@ -1608,7 +1621,7 @@ void wxAuiManager::LayoutAddPane(wxSizer* cont,
part.sizer_item = sizer_item;
uiparts.Add(part);
}
// if we have buttons, add a little space to the right
// of them to ease visual crowding
if (button_count >= 1)
@@ -1742,7 +1755,7 @@ void wxAuiManager::LayoutAddDock(wxSizer* cont,
{
wxAuiPaneInfo& pane = *(dock.panes.Item(pane_i));
int pane_pos = pane_positions.Item(pane_i);
if (pane.IsMaximized())
has_maximized_pane = true;
@@ -1789,7 +1802,7 @@ void wxAuiManager::LayoutAddDock(wxSizer* cont,
for (pane_i = 0; pane_i < pane_count; ++pane_i)
{
wxAuiPaneInfo& pane = *(dock.panes.Item(pane_i));
if (pane.IsMaximized())
has_maximized_pane = true;
@@ -1868,10 +1881,10 @@ wxSizer* wxAuiManager::LayoutAll(wxAuiPaneInfoArray& panes,
for (i = 0, dock_count = docks.GetCount(); i < dock_count; ++i)
{
wxAuiDockInfo& dock = docks.Item(i);
// empty out all panes, as they will be readded below
dock.panes.Empty();
if (dock.fixed)
{
// always reset fixed docks' sizes, because
@@ -1994,10 +2007,10 @@ wxSizer* wxAuiManager::LayoutAll(wxAuiPaneInfoArray& panes,
// new dock's size may not be more than the dock constraint
// parameter specifies. See SetDockSizeConstraint()
int max_dock_x_size = (int)(m_dock_constraint_x * ((double)cli_size.x));
int max_dock_y_size = (int)(m_dock_constraint_y * ((double)cli_size.y));
if (dock.IsHorizontal())
size = wxMin(size, max_dock_y_size);
else
@@ -2006,7 +2019,7 @@ wxSizer* wxAuiManager::LayoutAll(wxAuiPaneInfoArray& panes,
// absolute minimum size for a dock is 10 pixels
if (size < 10)
size = 10;
dock.size = size;
}
@@ -2253,7 +2266,7 @@ void wxAuiManager::GetDockSizeConstraint(double* width_pct, double* height_pct)
{
if (width_pct)
*width_pct = m_dock_constraint_x;
if (height_pct)
*height_pct = m_dock_constraint_y;
}
@@ -2308,7 +2321,7 @@ void wxAuiManager::Update()
{
m_action_window = NULL;
}
p.window->Reparent(m_frame);
p.frame->SetSizer(NULL);
p.frame->Destroy();
@@ -2650,10 +2663,10 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_LEFT),
GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)),
GetMaxLayer(docks, wxAUI_DOCK_TOP)) + 1;
if (drop.IsToolbar())
new_layer = auiToolBarLayer;
drop.Dock().Left().
Layer(new_layer).
Row(0).
@@ -2666,10 +2679,10 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_TOP),
GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
GetMaxLayer(docks, wxAUI_DOCK_RIGHT)) + 1;
if (drop.IsToolbar())
new_layer = auiToolBarLayer;
drop.Dock().Top().
Layer(new_layer).
Row(0).
@@ -2681,11 +2694,11 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
{
int new_layer = wxMax(wxMax(GetMaxLayer(docks, wxAUI_DOCK_RIGHT),
GetMaxLayer(docks, wxAUI_DOCK_TOP)),
GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)) + 1;
GetMaxLayer(docks, wxAUI_DOCK_BOTTOM)) + 1;
if (drop.IsToolbar())
new_layer = auiToolBarLayer;
drop.Dock().Right().
Layer(new_layer).
Row(0).
@@ -2698,10 +2711,10 @@ bool wxAuiManager::DoDrop(wxAuiDockInfoArray& docks,
int new_layer = wxMax( wxMax( GetMaxLayer(docks, wxAUI_DOCK_BOTTOM),
GetMaxLayer(docks, wxAUI_DOCK_LEFT)),
GetMaxLayer(docks, wxAUI_DOCK_RIGHT)) + 1;
if (drop.IsToolbar())
new_layer = auiToolBarLayer;
drop.Dock().Bottom().
Layer(new_layer).
Row(0).
@@ -3050,7 +3063,7 @@ void wxAuiManager::ShowHint(const wxRect& rect)
m_last_hint = rect;
m_hint_fadeamt = m_hint_fademax;
if ((m_flags & wxAUI_MGR_HINT_FADE)
&& !((m_hint_wnd->IsKindOf(CLASSINFO(wxPseudoTransparentFrame))) &&
(m_flags & wxAUI_MGR_NO_VENETIAN_BLINDS_FADE))
@@ -3082,7 +3095,7 @@ void wxAuiManager::ShowHint(const wxRect& rect)
{
if (!(m_flags & wxAUI_MGR_RECTANGLE_HINT))
return;
if (m_last_hint != rect)
{
// remove the last hint rectangle
@@ -3164,7 +3177,7 @@ void wxAuiManager::StartPaneDrag(wxWindow* pane_window,
wxAuiPaneInfo& pane = GetPane(pane_window);
if (!pane.IsOk())
return;
if (pane.IsToolbar())
{
m_action = actionDragToolbarPane;
@@ -3173,7 +3186,7 @@ void wxAuiManager::StartPaneDrag(wxWindow* pane_window,
{
m_action = actionDragFloatingPane;
}
m_action_window = pane_window;
m_action_offset = offset;
m_frame->CaptureMouse();
@@ -3280,7 +3293,7 @@ void wxAuiManager::DrawHintRect(wxWindow* pane_window,
const wxPoint& offset)
{
wxRect rect = CalculateHintRect(pane_window, pt, offset);
if (rect.IsEmpty())
{
HideHint();
@@ -3511,7 +3524,7 @@ void wxAuiManager::OnFloatingPaneClosed(wxWindow* wnd, wxCloseEvent& evt)
evt.Veto();
return;
}
else
else
{
ClosePane(pane);
}
@@ -3651,7 +3664,7 @@ void wxAuiManager::OnSize(wxSizeEvent& event)
{
DoFrameLayout();
Repaint();
#if wxUSE_MDI
if (m_frame->IsKindOf(CLASSINFO(wxMDIParentFrame)))
{
@@ -3675,7 +3688,7 @@ void wxAuiManager::OnFindManager(wxAuiManagerEvent& evt)
evt.SetManager(NULL);
return;
}
// if we are managing a child frame, get the 'real' manager
if (window->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
{
@@ -3683,7 +3696,7 @@ void wxAuiManager::OnFindManager(wxAuiManagerEvent& evt)
evt.SetManager(float_frame->GetOwnerManager());
return;
}
// return pointer to ourself
evt.SetManager(this);
}
@@ -3732,7 +3745,7 @@ void wxAuiManager::UpdateButtonOnScreen(wxAuiDockUIPart* button_ui_part,
wxAuiDockUIPart* hit_test = HitTest(event.GetX(), event.GetY());
if (!hit_test || !button_ui_part)
return;
int state = wxAUI_BUTTON_STATE_NORMAL;
if (hit_test == button_ui_part)
@@ -3777,7 +3790,7 @@ void wxAuiManager::OnLeftDown(wxMouseEvent& event)
{
if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER)
return;
// a dock may not be resized if it has a single
// pane which is not resizable
if (part->type == wxAuiDockUIPart::typeDockSizer && part->dock &&
@@ -3813,8 +3826,8 @@ void wxAuiManager::OnLeftDown(wxMouseEvent& event)
// we are an embedded wxAuiManager inside the wxAuiFloatingFrame.
// We want to initiate a toolbar drag in our owner manager
wxWindow* managed_wnd = GetManagedWindow();
if (part->pane &&
if (part->pane &&
part->pane->window &&
managed_wnd &&
managed_wnd->IsKindOf(CLASSINFO(wxAuiFloatingFrame)))
@@ -3826,9 +3839,9 @@ void wxAuiManager::OnLeftDown(wxMouseEvent& event)
event.m_y - part->rect.y));
return;
}
if (part->dock && part->dock->dock_direction == wxAUI_DOCK_CENTER)
return;
@@ -4253,12 +4266,12 @@ void wxAuiManager::OnMotion(wxMouseEvent& event)
UpdateButtonOnScreen(m_hover_button, event);
Repaint();
}
// mouse is over a button, so repaint the
// button in hover mode
UpdateButtonOnScreen(part, event);
m_hover_button = part;
}
}
else

View File

@@ -1028,9 +1028,10 @@ wxEvtHandler::~wxEvtHandler()
if (m_dynamicEvents)
{
wxList::iterator it = m_dynamicEvents->begin(),
en = m_dynamicEvents->end();
for (;it != en; ++it)
for ( wxList::iterator it = m_dynamicEvents->begin(),
end = m_dynamicEvents->end();
it != end;
++it )
{
#if WXWIN_COMPATIBILITY_EVENT_TYPES
wxEventTableEntry *entry = (wxEventTableEntry*)*it;

View File

@@ -41,11 +41,7 @@ struct wxRunningEventLoopCounter
~wxRunningEventLoopCounter() { wxRunningEventLoopCount--; }
};
#else // !__WXMSW__
struct wxRunningEventLoopCounter { };
#endif // __WXMSW__/!__WXMSW__
#endif // __WXMSW__
// ----------------------------------------------------------------------------
// globals
@@ -76,7 +72,9 @@ int wxEventLoopManual::Run()
// should undo
wxEventLoopActivator activate(wx_static_cast(wxEventLoop *, this));
#if defined(__WXMSW__) && wxUSE_THREADS
wxRunningEventLoopCounter evtLoopCounter;
#endif // __WXMSW__
// we must ensure that OnExit() is called even if an exception is thrown
// from inside Dispatch() but we must call it from Exit() in normal

View File

@@ -1304,7 +1304,7 @@ void wxMsgCatalogFile::FillHash(wxMessagesHash& hash,
: new wxCSConv(msgIdCharset);
#elif wxUSE_FONTMAP
wxASSERT_MSG( msgIdCharset == NULL,
wxASSERT_MSG( msgIdCharset.empty(),
_T("non-ASCII msgid languages only supported if wxUSE_WCHAR_T=1") );
wxEncodingConverter converter;
@@ -1430,6 +1430,7 @@ bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName,
file.FillHash(m_messages, msgIdCharset, bConvertEncoding);
#if wxUSE_WCHAR_T
// we should use a conversion compatible with the message catalog encoding
// in the GUI if we don't convert the strings to the current conversion but
// as the encoding is global, only change it once, otherwise we could get
@@ -1445,6 +1446,7 @@ bool wxMsgCatalog::Load(const wxChar *szDirPrefix, const wxChar *szName,
wxConvUI =
m_conv = new wxCSConv(file.GetCharset());
}
#endif // wxUSE_WCHAR_T
return true;
}

View File

@@ -28,6 +28,10 @@
#include "wx/sstream.h"
#if wxUSE_UNICODE
#include "wx/hashmap.h"
#endif
// ============================================================================
// wxStringInputStream implementation
// ============================================================================

View File

@@ -3692,4 +3692,6 @@ WXDLLIMPEXP_DATA_BASE(wxMBConv) wxConvLibc,
wxConvLocal,
wxConvUTF8;
WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent = NULL;
#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T

View File

@@ -1014,6 +1014,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
ignoreChanges = true;
#if wxUSE_CONFIG
if (wxConfig::Get(false))
{
wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ViewStyle"),
@@ -1021,6 +1022,7 @@ bool wxGenericFileDialog::Create( wxWindow *parent,
wxConfig::Get()->Read(wxT("/wxWindows/wxFileDialog/ShowHidden"),
&ms_lastShowHidden);
}
#endif
if ((m_dir.empty()) || (m_dir == wxT(".")))
{
@@ -1188,6 +1190,7 @@ wxGenericFileDialog::~wxGenericFileDialog()
if (!m_bypassGenericImpl)
{
#if wxUSE_CONFIG
if (wxConfig::Get(false))
{
wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ViewStyle"),
@@ -1195,6 +1198,7 @@ wxGenericFileDialog::~wxGenericFileDialog()
wxConfig::Get()->Write(wxT("/wxWindows/wxFileDialog/ShowHidden"),
ms_lastShowHidden);
}
#endif
const int count = m_choice->GetCount();
for ( int i = 0; i < count; i++ )
@@ -1471,6 +1475,7 @@ void wxGenericFileDialog::HandleAction( const wxString &fn )
{
wxMessageBox(_("Please choose an existing file."), _("Error"),
wxOK | wxICON_ERROR );
return;
}
SetPath( filename );

View File

@@ -5177,7 +5177,7 @@ wxUIntPtr wxGenericListCtrl::GetItemData( long item ) const
return info.m_data;
}
bool wxGenericListCtrl::SetItemData( long item, long data )
bool wxGenericListCtrl::SetItemPtrData( long item, wxUIntPtr data )
{
wxListItem info;
info.m_mask = wxLIST_MASK_DATA;
@@ -5187,6 +5187,11 @@ bool wxGenericListCtrl::SetItemData( long item, long data )
return true;
}
bool wxGenericListCtrl::SetItemData(long item, long data)
{
return SetItemPtrData(item, data);
}
wxRect wxGenericListCtrl::GetViewRect() const
{
return m_mainWin->GetViewRect();

View File

@@ -451,22 +451,6 @@ wxWindow *wxScrollHelper::GetTargetWindow() const
return m_targetWindow;
}
#ifdef __WXMAC__
static bool wxScrolledWindowHasChildren(wxWindow* win)
{
wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst();
while ( node )
{
wxWindow* child = node->GetData();
if ( !child->IsKindOf(CLASSINFO(wxScrollBar)) )
return true;
node = node->GetNext();
}
return false;
}
#endif
// ----------------------------------------------------------------------------
// scrolling implementation itself
// ----------------------------------------------------------------------------

View File

@@ -68,17 +68,17 @@ static wxColor wxStepColour(const wxColor& c, int ialpha)
{
if (ialpha == 100)
return c;
double r = c.Red(), g = c.Green(), b = c.Blue();
double bg;
// ialpha is 0..200 where 0 is completely black
// and 200 is completely white and 100 is the same
// convert that to normal alpha 0.0 - 1.0
ialpha = wxMin(ialpha, 200);
ialpha = wxMax(ialpha, 0);
double alpha = ((double)(ialpha - 100.0))/100.0;
if (ialpha > 100)
{
// blend with white
@@ -91,11 +91,11 @@ static wxColor wxStepColour(const wxColor& c, int ialpha)
bg = 0.0;
alpha = 1.0 + alpha; // 0 = transparent fg; 1 = opaque fg
}
r = wxBlendColour(r, bg, alpha);
g = wxBlendColour(g, bg, alpha);
b = wxBlendColour(b, bg, alpha);
return wxColour((unsigned char)r, (unsigned char)g, (unsigned char)b);
}
@@ -114,7 +114,7 @@ public:
{
m_search = search;
m_defaultFG = GetForegroundColour();
// remove the default minsize, the searchctrl will have one instead
SetSizeHints(wxDefaultCoord,wxDefaultCoord);
}
@@ -125,15 +125,15 @@ public:
{
ChangeValue(wxEmptyString);
}
m_descriptiveText = text;
}
wxString GetDescriptiveText() const
{
return m_descriptiveText;
}
protected:
void OnText(wxCommandEvent& eventText)
{
@@ -178,12 +178,12 @@ protected:
SetForegroundColour(m_defaultFG);
}
}
private:
wxSearchCtrl* m_search;
wxString m_descriptiveText;
wxColour m_defaultFG;
DECLARE_EVENT_TABLE()
};
@@ -228,11 +228,13 @@ protected:
m_search->SetFocus();
#if wxUSE_MENUS
if ( m_eventType == wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN )
{
// this happens automatically, just like on Mac OS X
m_search->PopupSearchMenu();
}
#endif // wxUSE_MENUS
}
void OnPaint(wxPaintEvent&)
@@ -294,17 +296,21 @@ wxSearchCtrl::wxSearchCtrl(wxWindow *parent, wxWindowID id,
void wxSearchCtrl::Init()
{
m_text = 0;
m_searchButton = 0;
m_cancelButton = 0;
m_menu = 0;
m_text = NULL;
m_searchButton = NULL;
m_cancelButton = NULL;
#if wxUSE_MENUS
m_menu = NULL;
#endif // wxUSE_MENUS
m_searchButtonVisible = true;
m_cancelButtonVisible = false;
m_searchMenuBitmapUser = false;
m_searchBitmapUser = false;
m_cancelBitmapUser = false;
#if wxUSE_MENUS
m_searchMenuBitmapUser = false;
#endif // wxUSE_MENUS
}
bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id,
@@ -326,7 +332,7 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id,
m_text = new wxSearchTextCtrl(this, value, style & ~wxBORDER_MASK);
m_text->SetDescriptiveText(_("Search"));
wxSize sizeText = m_text->GetBestSize();
m_searchButton = new wxSearchButton(this,wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN,m_searchBitmap);
@@ -352,11 +358,15 @@ wxSearchCtrl::~wxSearchCtrl()
delete m_text;
delete m_searchButton;
delete m_cancelButton;
#if wxUSE_MENUS
delete m_menu;
#endif // wxUSE_MENUS
}
// search control specific interfaces
#if wxUSE_MENUS
void wxSearchCtrl::SetMenu( wxMenu* menu )
{
if ( menu == m_menu )
@@ -382,7 +392,7 @@ void wxSearchCtrl::SetMenu( wxMenu* menu )
}
}
wxRect rect = GetRect();
LayoutControls(0, 0, rect.GetWidth(), rect.GetHeight());
LayoutControls(0, 0, rect.GetWidth(), rect.GetHeight());
}
wxMenu* wxSearchCtrl::GetMenu()
@@ -390,6 +400,8 @@ wxMenu* wxSearchCtrl::GetMenu()
return m_menu;
}
#endif // wxUSE_MENUS
void wxSearchCtrl::ShowSearchButton( bool show )
{
if ( m_searchButtonVisible == show )
@@ -452,7 +464,7 @@ wxSize wxSearchCtrl::DoGetBestSize() const
wxSize sizeCancel(0,0);
int searchMargin = 0;
int cancelMargin = 0;
if ( m_searchButtonVisible || m_menu )
if ( m_searchButtonVisible || HasMenu() )
{
sizeSearch = m_searchButton->GetBestSize();
searchMargin = MARGIN;
@@ -482,7 +494,7 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height)
{
if ( !m_text )
return;
wxSize sizeText = m_text->GetBestSize();
// make room for the search menu & clear button
int horizontalBorder = ( sizeText.y - sizeText.y * 14 / 21 ) / 2;
@@ -495,7 +507,7 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height)
wxSize sizeCancel(0,0);
int searchMargin = 0;
int cancelMargin = 0;
if ( m_searchButtonVisible || m_menu )
if ( m_searchButtonVisible || HasMenu() )
{
sizeSearch = m_searchButton->GetBestSize();
searchMargin = MARGIN;
@@ -505,7 +517,7 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height)
sizeCancel = m_cancelButton->GetBestSize();
cancelMargin = MARGIN;
}
m_searchButton->Show( m_searchButtonVisible || m_menu );
m_searchButton->Show( m_searchButtonVisible || HasMenu() );
m_cancelButton->Show( m_cancelButtonVisible );
if ( sizeSearch.x + sizeCancel.x > width )
@@ -520,9 +532,9 @@ void wxSearchCtrl::LayoutControls(int x, int y, int width, int height)
// position the subcontrols inside the client area
m_searchButton->SetSize(x, y + ICON_OFFSET - 1, sizeSearch.x, height);
m_text->SetSize( x + sizeSearch.x + searchMargin,
m_text->SetSize( x + sizeSearch.x + searchMargin,
y + ICON_OFFSET - BORDER,
textWidth,
textWidth,
height);
m_cancelButton->SetSize(x + sizeSearch.x + searchMargin + textWidth + cancelMargin,
y + ICON_OFFSET - 1, sizeCancel.x, height);
@@ -803,7 +815,7 @@ void wxSearchCtrl::SetSearchBitmap( const wxBitmap& bitmap )
m_searchBitmapUser = bitmap.Ok();
if ( m_searchBitmapUser )
{
if ( m_searchButton && !m_menu )
if ( m_searchButton && !HasMenu() )
{
m_searchButton->SetBitmapLabel( m_searchBitmap );
}
@@ -815,6 +827,8 @@ void wxSearchCtrl::SetSearchBitmap( const wxBitmap& bitmap )
}
}
#if wxUSE_MENUS
void wxSearchCtrl::SetSearchMenuBitmap( const wxBitmap& bitmap )
{
m_searchMenuBitmap = bitmap;
@@ -833,6 +847,8 @@ void wxSearchCtrl::SetSearchMenuBitmap( const wxBitmap& bitmap )
}
}
#endif // wxUSE_MENUS
void wxSearchCtrl::SetCancelBitmap( const wxBitmap& bitmap )
{
m_cancelBitmap = bitmap;
@@ -989,7 +1005,7 @@ wxBitmap wxSearchCtrl::RenderSearchBitmap( int x, int y, bool renderDrop )
mem.DrawPolygon(WXSIZEOF(dropPolygon),dropPolygon,multiplier*triangleX,multiplier*triangleY);
}
mem.SelectObject(wxNullBitmap);
//===============================================================================
// end drawing code
//===============================================================================
@@ -1114,7 +1130,7 @@ void wxSearchCtrl::RecalcBitmaps()
)
{
m_searchBitmap = RenderSearchBitmap(bitmapWidth,bitmapHeight,false);
if ( !m_menu )
if ( !HasMenu() )
{
m_searchButton->SetBitmapLabel(m_searchBitmap);
}
@@ -1122,6 +1138,7 @@ void wxSearchCtrl::RecalcBitmaps()
// else this bitmap was set by user, don't alter
}
#if wxUSE_MENUS
if ( !m_searchMenuBitmapUser )
{
if (
@@ -1138,6 +1155,7 @@ void wxSearchCtrl::RecalcBitmaps()
}
// else this bitmap was set by user, don't alter
}
#endif // wxUSE_MENUS
if ( !m_cancelBitmapUser )
{
@@ -1174,6 +1192,8 @@ void wxSearchCtrl::OnSize( wxSizeEvent& WXUNUSED(event) )
LayoutControls(0, 0, width, height);
}
#if wxUSE_MENUS
void wxSearchCtrl::PopupSearchMenu()
{
if ( m_menu )
@@ -1183,6 +1203,8 @@ void wxSearchCtrl::PopupSearchMenu()
}
}
#endif // wxUSE_MENUS
#endif // !wxUSE_NATIVE_SEARCH_CONTROL
#endif // wxUSE_SEARCHCTRL

View File

@@ -448,8 +448,11 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
if (encName.empty())
encName = _T("UTF-8");
#endif // wxUSE_INTL
#if wxUSE_WCHAR_T
static wxConvBrokenFileNames fileconv(encName);
wxConvFileName = &fileconv;
#endif // wxUSE_WCHAR_T
#if wxUSE_UNICODE
// gtk_init() wants UTF-8, not wchar_t, so convert

View File

@@ -271,7 +271,7 @@ wxWindowDC::wxWindowDC()
wxWindowDC::wxWindowDC( wxWindow *window )
{
wxASSERT_MSG( window, wxT("DC needs a window") );
wxCHECK_RET( window, wxT("DC needs a window") );
m_penGC = (GdkGC *) NULL;
m_brushGC = (GdkGC *) NULL;
@@ -2446,6 +2446,9 @@ wxPaintDC::wxPaintDC( wxWindow *win )
: wxClientDC( win )
{
#if USE_PAINT_REGION
if (!win) // the base class already asserted...
return;
if (!win->m_clipPaintRegion)
return;
@@ -2479,7 +2482,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
wxClientDC::wxClientDC( wxWindow *win )
: wxWindowDC( win )
{
wxCHECK_RET( win, _T("NULL window in wxClientDC::wxClientDC") );
if (!win) // the base class already asserted...
return;
#ifdef __WXUNIVERSAL__
wxPoint ptOrigin = win->GetClientAreaOrigin();

View File

@@ -65,6 +65,17 @@ static void gtk_filedialog_ok_callback(GtkWidget *widget, wxFileDialog *dialog)
}
}
if (style & wxFD_FILE_MUST_EXIST)
{
if ( !g_file_test(filename, G_FILE_TEST_EXISTS) )
{
wxMessageDialog dlg( dialog, _("Please choose an existing file."),
_("Error"), wxOK| wxICON_ERROR);
dlg.ShowModal();
return;
}
}
// change to the directory where the user went if asked
if (style & wxFD_CHANGE_DIR)
{

View File

@@ -148,6 +148,14 @@ public:
(void), (), NULL )
wxDL_METHOD_DEFINE( gboolean, gnome_print_config_set,
(GnomePrintConfig *config, const guchar *key, const guchar *value), (config, key, value), false )
wxDL_METHOD_DEFINE( gboolean, gnome_print_config_set_double,
(GnomePrintConfig *config, const guchar *key, gdouble value), (config, key, value), false )
wxDL_METHOD_DEFINE( gboolean, gnome_print_config_set_int,
(GnomePrintConfig *config, const guchar *key, gint value), (config, key, value), false )
wxDL_METHOD_DEFINE( gboolean, gnome_print_config_set_boolean,
(GnomePrintConfig *config, const guchar *key, gboolean value), (config, key, value), false )
wxDL_METHOD_DEFINE( gboolean, gnome_print_config_set_length,
(GnomePrintConfig *config, const guchar *key, gdouble value, const GnomePrintUnit *unit), (config, key, value, unit), false )
wxDL_METHOD_DEFINE( gboolean, gnome_print_config_get_length,
(GnomePrintConfig *config, const guchar *key, gdouble *val, const GnomePrintUnit **unit), (config, key, val, unit), false )
@@ -252,6 +260,10 @@ void wxGnomePrintLibrary::InitializeMethods()
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_default, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_set, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_set_boolean, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_set_double, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_set_int, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_set_length, success )
wxDL_METHOD_LOAD( m_gnome_print_lib, gnome_print_config_get_length, success )
wxDL_METHOD_LOAD( m_gnome_printui_lib, gnome_print_dialog_new, success )
@@ -290,12 +302,93 @@ wxGnomePrintNativeData::~wxGnomePrintNativeData()
bool wxGnomePrintNativeData::TransferTo( wxPrintData &data )
{
// TODO
return true;
}
bool wxGnomePrintNativeData::TransferFrom( const wxPrintData &data )
{
// TODO
if (data.GetOrientation() == wxLANDSCAPE)
{
gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAGE_ORIENTATION,
(guchar*)(char*)"R90" );
}
else
{
gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAGE_ORIENTATION,
(guchar*)(char*)"R0" );
}
if (data.GetCollate())
{
gs_lgp->gnome_print_config_set_boolean( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_COLLATE,
TRUE );
}
else
{
gs_lgp->gnome_print_config_set_boolean( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_COLLATE,
FALSE );
}
switch (data.GetPaperId())
{
case wxPAPER_A3: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"A3" );
break;
case wxPAPER_A5: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"A5" );
break;
case wxPAPER_B5: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"B5 (JIS)" );
break;
case wxPAPER_LETTER: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"Letter" );
break;
case wxPAPER_LEGAL: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"Legal" );
break;
case wxPAPER_EXECUTIVE: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"Executive" );
break;
case wxPAPER_ENV_10: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"Envelope #10" );
break;
case wxPAPER_ENV_C5: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"Envelope C5" );
break;
case wxPAPER_ENV_C6: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"Envelope C6" );
break;
case wxPAPER_ENV_B5: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"Envelope B5" );
break;
case wxPAPER_ENV_MONARCH: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"Envelope Monarch" );
break;
case wxPAPER_NONE: break;
default:
case wxPAPER_A4: gs_lgp->gnome_print_config_set( m_config,
(guchar*)(char*)GNOME_PRINT_KEY_PAPER_SIZE,
(guchar*)(char*)"A4" );
break;
}
return true;
}
@@ -428,6 +521,8 @@ wxGnomePrintDialog::wxGnomePrintDialog( wxWindow *parent, wxPrintData *data )
void wxGnomePrintDialog::Init()
{
wxPrintData data = m_printDialogData.GetPrintData();
data.ConvertToNative();
wxGnomePrintNativeData *native =
(wxGnomePrintNativeData*) data.GetNativeData();
@@ -457,8 +552,6 @@ wxGnomePrintDialog::~wxGnomePrintDialog()
int wxGnomePrintDialog::ShowModal()
{
// Transfer data from m_printDalogData to dialog here
int response = gtk_dialog_run (GTK_DIALOG (m_widget));
if (response == GNOME_PRINT_DIALOG_RESPONSE_CANCEL)
@@ -536,6 +629,8 @@ wxGnomePageSetupDialog::wxGnomePageSetupDialog( wxWindow *parent,
if (data)
m_pageDialogData = *data;
m_pageDialogData.GetPrintData().ConvertToNative();
wxGnomePrintNativeData *native =
(wxGnomePrintNativeData*) m_pageDialogData.GetPrintData().GetNativeData();

View File

@@ -144,7 +144,16 @@ static void wxGtkTextApplyTagsFromAttr(GtkWidget *text,
case wxTEXT_ALIGNMENT_CENTER:
align = GTK_JUSTIFY_CENTER;
break;
// gtk+ doesn't support justify as of gtk+-2.7.4
// gtk+ doesn't support justify before gtk+-2.11.0 with pango-1.17 being available
// (but if new enough pango isn't available it's a mere gtk warning)
#if GTK_CHECK_VERSION(2,11,0)
case wxTEXT_ALIGNMENT_JUSTIFIED:
if (!gtk_check_version(2,11,0))
align = GTK_JUSTIFY_FILL;
else
align = GTK_JUSTIFY_LEFT;
break;
#endif
}
g_snprintf(buf, sizeof(buf), "WXALIGNMENT %d", align);

View File

@@ -138,21 +138,25 @@ static void gtk_tree_entry_init (GTypeInstance* instance, gpointer g_class)
static void gtk_tree_entry_string_transform_func(const GValue *src_value,
GValue *dest_value)
{
GtkTreeEntry *entry;
/* Make sure src is a treeentry and dest can hold a string */
g_assert(GTK_IS_TREE_ENTRY(src_value->data[0].v_pointer));
g_assert(G_VALUE_HOLDS(dest_value, G_TYPE_STRING));
/* TODO: Use strdup here or just pass it? */
GtkTreeEntry* entry = GTK_TREE_ENTRY(src_value->data[0].v_pointer);
entry = GTK_TREE_ENTRY(src_value->data[0].v_pointer);
g_value_set_string(dest_value, entry->label);
}
static void gtk_tree_entry_dispose(GObject* obj)
{
GtkTreeEntry *entry;
g_assert(GTK_IS_TREE_ENTRY(obj));
GtkTreeEntry* entry = GTK_TREE_ENTRY(obj);
entry = GTK_TREE_ENTRY(obj);
/* free label if it exists */
if(entry->label)

View File

@@ -10,6 +10,8 @@
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#if wxUSE_CONFIG
#include "wx/utils.h"
#ifndef WX_PRECOMP
@@ -123,3 +125,5 @@ bool wxGetResource(const wxString& section, const wxString& entry, int *value, c
}
else return false;
}
#endif // wxUSE_CONFIG

View File

@@ -1157,6 +1157,10 @@ gtk_wxwindow_commit_cb (GtkIMContext *context,
wxFillOtherKeyEventFields(event,
window, window->m_imData->lastKeyEvent);
}
else
{
event.SetEventObject( window );
}
const wxWxCharBuffer data(wxGTK_CONV_BACK(str));
if( !data )

View File

@@ -136,7 +136,11 @@ wxHtmlTableCell::wxHtmlTableCell(wxHtmlContainerCell *parent, const wxHtmlTag& t
/* scan params: */
if (tag.HasParam(wxT("BGCOLOR")))
{
tag.GetParamAsColour(wxT("BGCOLOR"), &m_tBkg);
if (m_tBkg.Ok())
SetBackgroundColour(m_tBkg);
}
if (tag.HasParam(wxT("VALIGN")))
m_tValign = tag.GetParam(wxT("VALIGN"));
else

View File

@@ -258,6 +258,7 @@ wxClientDC::wxClientDC()
wxClientDC::wxClientDC(wxWindow *window) :
wxWindowDC( window )
{
wxCHECK_RET( window, _T("invalid window in wxClientDC") );
wxPoint origin = window->GetClientAreaOrigin() ;
m_window->GetClientSize( &m_width , &m_height);
SetDeviceOrigin( origin.x, origin.y );
@@ -266,6 +267,7 @@ wxClientDC::wxClientDC(wxWindow *window) :
#else
wxClientDC::wxClientDC(wxWindow *window)
{
wxCHECK_RET( window, _T("invalid window in wxClientDC") );
m_window = window ;
wxTopLevelWindowMac* rootwindow = window->MacGetTopLevelWindow() ;
if (!rootwindow)

View File

@@ -267,7 +267,7 @@ void wxFontRefData::MacFindFont()
m_macFontFamily = FMGetFontFamilyFromName( qdFontName );
if ( m_macFontFamily == kInvalidFontFamily )
{
wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName );
wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName.c_str() );
m_macFontFamily = GetAppFont();
}
#endif
@@ -292,7 +292,7 @@ void wxFontRefData::MacFindFont()
ATSFontFamilyRef atsfamily = ATSFontFamilyFindFromName( cf , kATSOptionFlagsDefault );
if ( atsfamily == (ATSFontFamilyRef) -1 )
{
wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName );
wxLogDebug( wxT("ATSFontFamilyFindFromName failed for %s"), m_faceName.c_str() );
m_macFontFamily = GetAppFont();
}
else

View File

@@ -1326,7 +1326,7 @@ long wxListCtrl::GetItemData(long item) const
}
// Sets the item data
bool wxListCtrl::SetItemData(long item, long data)
bool wxListCtrl::SetItemPtrData(long item, wxUIntPtr data)
{
if (m_genericImpl)
return m_genericImpl->SetItemData(item, data);
@@ -1340,6 +1340,11 @@ bool wxListCtrl::SetItemData(long item, long data)
return SetItem(info);
}
bool wxListCtrl::SetItemData(long item, long data)
{
return SetItemPtrData(item, data);
}
wxRect wxListCtrl::GetViewRect() const
{
wxASSERT_MSG( !HasFlag(wxLC_REPORT | wxLC_LIST),

View File

@@ -26,6 +26,8 @@
// Use polling instead of Mach ports, which doesn't work on Intel
// due to task_for_pid security issues.
// http://developer.apple.com/technotes/tn/tn2050.html
// What's a better test for Intel vs PPC?
#ifdef WORDS_BIGENDIAN
#define USE_POLLING 0
@@ -80,7 +82,7 @@ void* wxProcessTerminationThread::Entry()
{
usleep(100);
int status = 0;
int rc = waitpid(abs(m_data->pid), & status, WNOHANG);
int rc = waitpid(abs(m_data->pid), & status, 0);
if (rc != 0)
{
if ((rc != -1) && WIFEXITED(status))

View File

@@ -58,7 +58,7 @@ void wxAboutBox(const wxAboutDialogInfo& info)
// add everything remaining
msg << info.GetDescriptionAndCredits();
wxMessageBox(msg, _T("About ") + name);
wxMessageBox(msg, _("About ") + name);
}
else // simple "native" version is not enough
{

View File

@@ -357,12 +357,33 @@ void wxButton::SetDefault()
SetDefaultStyle(this, true);
}
// special version of wxGetTopLevelParent() which is safe to call when the
// parent is being destroyed: wxGetTopLevelParent() would just return NULL in
// this case because wxWindow version of IsTopLevel() is used when it's called
// during window destruction instead of wxTLW one, but we want to distinguish
// between these cases
static wxTopLevelWindow *GetTLWParentIfNotBeingDeleted(wxWindow *win)
{
for ( ; win; win = win->GetParent() )
{
if ( win->IsBeingDeleted() )
return NULL;
if ( win->IsTopLevel() )
break;
}
wxASSERT_MSG( win, _T("button without top level parent?") );
return wxDynamicCast(win, wxTopLevelWindow);
}
// set this button as being currently default
void wxButton::SetTmpDefault()
{
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
wxCHECK_RET( tlw, _T("button without top level window?") );
wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(GetParent());
if ( !tlw )
return;
wxWindow *winOldDefault = tlw->GetDefaultItem();
tlw->SetTmpDefaultItem(this);
@@ -374,9 +395,9 @@ void wxButton::SetTmpDefault()
// unset this button as currently default, it may still stay permanent default
void wxButton::UnsetTmpDefault()
{
wxTopLevelWindow *tlw = wxDynamicCast(wxGetTopLevelParent(this), wxTopLevelWindow);
wxCHECK_RET( tlw, _T("button without top level window?") );
wxTopLevelWindow * const tlw = GetTLWParentIfNotBeingDeleted(GetParent());
if ( !tlw )
return;
tlw->SetTmpDefaultItem(NULL);

View File

@@ -161,22 +161,36 @@ wxComboCtrl::~wxComboCtrl()
void wxComboCtrl::OnThemeChange()
{
wxUxThemeEngine* theme = wxUxThemeEngine::GetIfActive();
// there doesn't seem to be any way to get the text colour using themes
// API: TMT_TEXTCOLOR doesn't work neither for EDIT nor COMBOBOX
SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
wxUxThemeEngine * const theme = wxUxThemeEngine::GetIfActive();
if ( theme )
{
wxUxThemeHandle hTheme(this, L"COMBOBOX");
// NB: use EDIT, not COMBOBOX (the latter works in XP but not Vista)
wxUxThemeHandle hTheme(this, L"EDIT");
COLORREF col;
theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_FILLCOLOR,&col);
SetBackgroundColour(wxRGBToColour(col));
theme->GetThemeColor(hTheme,EP_EDITTEXT,ETS_NORMAL,TMT_TEXTCOLOR,&col);
SetForegroundColour(wxRGBToColour(col));
}
else
{
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
HRESULT hr = theme->GetThemeColor
(
hTheme,
EP_EDITTEXT,
ETS_NORMAL,
TMT_FILLCOLOR,
&col
);
if ( SUCCEEDED(hr) )
{
SetBackgroundColour(wxRGBToColour(col));
// skip the call below
return;
}
wxLogApiError(_T("GetThemeColor(EDIT, ETS_NORMAL, TMT_FILLCOLOR)"), hr);
}
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
}
void wxComboCtrl::OnResize()

View File

@@ -367,6 +367,30 @@ bool wxComboBox::MSWCommand(WXUINT param, WXWORD id)
return true;
}
bool wxComboBox::MSWShouldPreProcessMessage(WXMSG *pMsg)
{
// prevent command accelerators from stealing editing
// hotkeys when we have the focus
if (wxIsCtrlDown())
{
WPARAM vkey = pMsg->wParam;
switch (vkey)
{
case 'C':
case 'V':
case 'X':
case VK_INSERT:
case VK_DELETE:
case VK_HOME:
case VK_END:
return false;
}
}
return wxChoice::MSWShouldPreProcessMessage(pMsg);
}
WXHWND wxComboBox::GetEditHWND() const
{
// this function should not be called for wxCB_READONLY controls, it is

View File

@@ -798,7 +798,7 @@ bool wxListBox::MSWOnDraw(WXDRAWITEMSTRUCT *item)
if ( itemID == (UINT)-1 )
return false;
long data = ListBox_GetItemData(GetHwnd(), pStruct->itemID);
LRESULT data = ListBox_GetItemData(GetHwnd(), pStruct->itemID);
wxCHECK( data && (data != LB_ERR), false );

View File

@@ -948,7 +948,7 @@ wxUIntPtr wxListCtrl::GetItemData(long item) const
}
// Sets the item data
bool wxListCtrl::SetItemData(long item, long data)
bool wxListCtrl::SetItemPtrData(long item, wxUIntPtr data)
{
wxListItem info;
@@ -959,6 +959,11 @@ bool wxListCtrl::SetItemData(long item, long data)
return SetItem(info);
}
bool wxListCtrl::SetItemData(long item, long data)
{
return SetItemPtrData(item, data);
}
wxRect wxListCtrl::GetViewRect() const
{
wxASSERT_MSG( !HasFlag(wxLC_REPORT | wxLC_LIST),

View File

@@ -622,7 +622,9 @@ void wxTreeCtrl::Init()
{
m_textCtrl = NULL;
m_hasAnyAttr = false;
#if wxUSE_DRAGIMAGE
m_dragImage = NULL;
#endif
m_pVirtualRoot = NULL;
// initialize the global array of events now as it can't be done statically
@@ -2198,6 +2200,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
}
#endif // __WXWINCE__
#if wxUSE_DRAGIMAGE
if ( m_dragImage )
{
m_dragImage->Move(wxPoint(x, y));
@@ -2210,6 +2213,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
m_dragImage->Show();
}
}
#endif // wxUSE_DRAGIMAGE
break;
case WM_LBUTTONUP:
@@ -2235,6 +2239,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
// fall through
case WM_RBUTTONUP:
#if wxUSE_DRAGIMAGE
if ( m_dragImage )
{
m_dragImage->EndDrag();
@@ -2250,6 +2255,7 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
// are selected simultaneously which is quite weird
TreeView_SelectDropTarget(GetHwnd(), 0);
}
#endif // wxUSE_DRAGIMAGE
break;
}
}
@@ -2778,6 +2784,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
case TVN_BEGINDRAG:
case TVN_BEGINRDRAG:
#if wxUSE_DRAGIMAGE
if ( event.IsAllowed() )
{
// normally this is impossible because the m_dragImage is
@@ -2788,6 +2795,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
m_dragImage->BeginDrag(wxPoint(0,0), this);
m_dragImage->Show();
}
#endif // wxUSE_DRAGIMAGE
break;
case TVN_DELETEITEM:

View File

@@ -152,7 +152,12 @@ protected:
virtual bool OnRead(const wxMBConv& WXUNUSED(conv))
{
return wxTextFile::OnRead(
wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA));
#if wxUSE_WCHAR_T
wxMBConvUTF8(wxMBConvUTF8::MAP_INVALID_UTF8_TO_PUA)
#else
wxMBConv()
#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
);
}
};

View File

@@ -1,6 +1,6 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.1 (http://bakefile.sourceforge.net)
# Bakefile 0.2.2 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
@@ -34,14 +34,14 @@ clean:
(cd emulator/src && $(MAKE) clean)
(cd helpview/src && $(MAKE) clean)
(cd tex2rtf/src && $(MAKE) clean)
(cd HelpGen && $(MAKE) clean)
(cd HelpGen/src && $(MAKE) clean)
distclean: clean
rm -f config.cache config.log config.status bk-deps bk-make-pch shared-ld-sh Makefile
(cd emulator/src && $(MAKE) distclean)
(cd helpview/src && $(MAKE) distclean)
(cd tex2rtf/src && $(MAKE) distclean)
(cd HelpGen && $(MAKE) distclean)
(cd HelpGen/src && $(MAKE) distclean)
emulator:
(cd emulator/src && $(MAKE) all)
@@ -62,16 +62,16 @@ install-strip_tex2rtf:
(cd tex2rtf/src && $(MAKE) install-strip)
helpgen:
(cd HelpGen && $(MAKE) all)
(cd HelpGen/src && $(MAKE) all)
install_helpgen:
(cd HelpGen && $(MAKE) install)
(cd HelpGen/src && $(MAKE) install)
uninstall_helpgen:
(cd HelpGen && $(MAKE) uninstall)
(cd HelpGen/src && $(MAKE) uninstall)
install-strip_helpgen:
(cd HelpGen && $(MAKE) install-strip)
(cd HelpGen/src && $(MAKE) install-strip)
# Include dependency info, if present:

View File

@@ -1,6 +1,6 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.1 (http://bakefile.sourceforge.net)
# Bakefile 0.2.2 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
@@ -61,7 +61,7 @@ clean:
@echo $(MAKE) -f makefile.bcc $(MAKEARGS) clean >>tex2rtf.bat
call tex2rtf.bat
@del tex2rtf.bat
@echo cd HelpGen >helpgen.bat
@echo cd HelpGen\src >helpgen.bat
@echo $(MAKE) -f makefile.bcc $(MAKEARGS) clean >>helpgen.bat
call helpgen.bat
@del helpgen.bat
@@ -85,7 +85,7 @@ tex2rtf:
@del tex2rtf.bat
helpgen:
@echo cd HelpGen >helpgen.bat
@echo cd HelpGen\src >helpgen.bat
@echo $(MAKE) -f makefile.bcc $(MAKEARGS) all >>helpgen.bat
call helpgen.bat
@del helpgen.bat

View File

@@ -1,6 +1,6 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.1 (http://bakefile.sourceforge.net)
# Bakefile 0.2.2 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
@@ -41,7 +41,7 @@ clean:
$(MAKE) -C emulator\src -f makefile.gcc $(MAKEARGS) clean
$(MAKE) -C helpview\src -f makefile.gcc $(MAKEARGS) clean
$(MAKE) -C tex2rtf\src -f makefile.gcc $(MAKEARGS) clean
$(MAKE) -C HelpGen -f makefile.gcc $(MAKEARGS) clean
$(MAKE) -C HelpGen\src -f makefile.gcc $(MAKEARGS) clean
emulator:
$(MAKE) -C emulator\src -f makefile.gcc $(MAKEARGS) all
@@ -53,7 +53,7 @@ tex2rtf:
$(MAKE) -C tex2rtf\src -f makefile.gcc $(MAKEARGS) all
helpgen:
$(MAKE) -C HelpGen -f makefile.gcc $(MAKEARGS) all
$(MAKE) -C HelpGen\src -f makefile.gcc $(MAKEARGS) all
.PHONY: all clean emulator helpview tex2rtf helpgen

View File

@@ -1,6 +1,6 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.1 (http://bakefile.sourceforge.net)
# Bakefile 0.2.2 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
@@ -42,34 +42,34 @@ clean:
-if exist .\*.pch del .\*.pch
cd emulator\src
$(MAKE) -f makefile.vc $(MAKEARGS) clean
cd $(MAKEDIR)
cd "$(MAKEDIR)"
cd helpview\src
$(MAKE) -f makefile.vc $(MAKEARGS) clean
cd $(MAKEDIR)
cd "$(MAKEDIR)"
cd tex2rtf\src
$(MAKE) -f makefile.vc $(MAKEARGS) clean
cd $(MAKEDIR)
cd HelpGen
cd "$(MAKEDIR)"
cd HelpGen\src
$(MAKE) -f makefile.vc $(MAKEARGS) clean
cd $(MAKEDIR)
cd "$(MAKEDIR)"
sub_emulator:
cd emulator\src
$(MAKE) -f makefile.vc $(MAKEARGS) all
cd $(MAKEDIR)
cd "$(MAKEDIR)"
sub_helpview:
cd helpview\src
$(MAKE) -f makefile.vc $(MAKEARGS) all
cd $(MAKEDIR)
cd "$(MAKEDIR)"
sub_tex2rtf:
cd tex2rtf\src
$(MAKE) -f makefile.vc $(MAKEARGS) all
cd $(MAKEDIR)
cd "$(MAKEDIR)"
sub_helpgen:
cd HelpGen
cd HelpGen\src
$(MAKE) -f makefile.vc $(MAKEARGS) all
cd $(MAKEDIR)
cd "$(MAKEDIR)"

View File

@@ -1,6 +1,6 @@
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.1 (http://bakefile.sourceforge.net)
# Bakefile 0.2.2 (http://bakefile.sourceforge.net)
# Do not modify, all changes will be overwritten!
# =========================================================================
@@ -65,7 +65,7 @@ clean : .SYMBOLIC
cd tex2rtf\src
wmake $(__MAKEOPTS__) -f makefile.wat $(MAKEARGS) clean
cd $(WATCOM_CWD)
cd HelpGen
cd HelpGen\src
wmake $(__MAKEOPTS__) -f makefile.wat $(MAKEARGS) clean
cd $(WATCOM_CWD)
@@ -85,7 +85,7 @@ tex2rtf : .SYMBOLIC
cd $(WATCOM_CWD)
helpgen : .SYMBOLIC
cd HelpGen
cd HelpGen\src
wmake $(__MAKEOPTS__) -f makefile.wat $(MAKEARGS) all
cd $(WATCOM_CWD)

View File

@@ -2,7 +2,7 @@
<makefile>
<include file="../build/bakefiles/config.bkl"/>
<template id="sub">
<dependency-of>all</dependency-of>
</template>
@@ -11,19 +11,19 @@
<dir>emulator/src</dir>
<installable>no</installable>
</subproject>
<subproject id="helpview" template="sub">
<dir>helpview/src</dir>
<installable>no</installable>
</subproject>
<subproject id="tex2rtf" template="sub">
<dir>tex2rtf/src</dir>
<installable>yes</installable>
</subproject>
<subproject id="helpgen" template="sub">
<dir>HelpGen</dir>
<dir>HelpGen/src</dir>
<installable>yes</installable>
</subproject>

View File

@@ -27,6 +27,10 @@
# public symbols added in 2.8.4 (please keep in alphabetical order):
@WX_VERSION_TAG@.4 {
global:
*wxListCtrl*SetItemPtrData*;
# wxString::To/From8BitData()
*wxString*To8BitData*;
*wxString*From8BitData*;
# wxString::[w]char_str()
*wxString*char_str*;
# wxWritable[W]CharBuffer

View File

@@ -598,7 +598,8 @@ protected:
wxTreeListItem *m_shiftItem; // item, where the shift key was pressed
wxTreeListItem *m_editItem; // item, which is currently edited
wxTreeListItem *m_selectItem; // current selected item, not with wxTR_MULTIPLE
wxTreeListItem *m_select_me;
int m_curColumn;
int m_btnWidth, m_btnWidth2;
@@ -922,6 +923,29 @@ private:
// implementation
// ===========================================================================
// ---------------------------------------------------------------------------
// internal helpers
// ---------------------------------------------------------------------------
// check if the given item is under another one
static bool IsDescendantOf(const wxTreeListItem *parent, const wxTreeListItem *item)
{
while ( item )
{
if ( item == parent )
{
// item is a descendant of parent
return true;
}
item = item->GetItemParent();
}
return false;
}
// ---------------------------------------------------------------------------
// wxTreeListRenameTimer (internal)
// ---------------------------------------------------------------------------
@@ -1789,7 +1813,8 @@ void wxTreeListMainWindow::Init() {
m_shiftItem = (wxTreeListItem*)NULL;
m_editItem = (wxTreeListItem*)NULL;
m_selectItem = (wxTreeListItem*)NULL;
m_select_me = (wxTreeListItem*)NULL;
m_curColumn = -1; // no current column
m_hasFocus = false;
@@ -2418,6 +2443,27 @@ void wxTreeListMainWindow::Delete (const wxTreeItemId& itemId) {
}
wxTreeListItem *parent = item->GetItemParent();
// m_select_me records whether we need to select
// a different item, in idle time.
if ( m_select_me && IsDescendantOf(item, m_select_me) )
{
m_select_me = parent;
}
if ( IsDescendantOf(item, m_curItem) )
{
// Don't silently change the selection:
// do it properly in idle time, so event
// handlers get called.
// m_current = parent;
m_curItem = NULL;
m_select_me = parent;
}
// remove the item from the tree
if (parent) {
parent->GetChildren().Remove (item); // remove by value
}
@@ -2426,6 +2472,10 @@ void wxTreeListMainWindow::Delete (const wxTreeItemId& itemId) {
SendDeleteEvent (item);
if (m_selectItem == item) m_selectItem = (wxTreeListItem*)NULL;
item->DeleteChildren (this);
if (item == m_select_me)
m_select_me = NULL;
delete item;
}
@@ -2660,7 +2710,6 @@ void wxTreeListMainWindow::SelectItem (const wxTreeItemId& itemId,
if (unselect_others) {
m_selectItem = (item->IsSelected())? item: (wxTreeListItem*)NULL;
}
}
// send event to user code
@@ -3627,7 +3676,6 @@ void wxTreeListMainWindow::OnChar (wxKeyEvent &event) {
m_curItem = (wxTreeListItem*)newItem.m_pItem; // make the new item the current item
RefreshLine (oldItem);
}
}
wxTreeItemId wxTreeListMainWindow::HitTest (const wxPoint& point, int& flags, int& column) {
@@ -3969,9 +4017,23 @@ void wxTreeListMainWindow::OnIdle (wxIdleEvent &WXUNUSED(event)) {
* we actually redraw the tree when everything is over */
if (!m_dirty) return;
m_dirty = false;
// Check if we need to select the root item
// because nothing else has been selected.
// Delaying it means that we can invoke event handlers
// as required, when a first item is selected.
if (!m_owner->HasFlag(wxTR_MULTIPLE) && !m_owner->GetSelection().IsOk())
{
if (m_select_me)
m_owner->SelectItem(m_select_me);
else if (m_owner->GetRootItem().IsOk())
m_owner->SelectItem(m_owner->GetRootItem());
m_select_me = NULL;
m_curItem = (wxTreeListItem*)m_owner->GetSelection().m_pItem;
}
CalculatePositions();
Refresh();
AdjustMyScrollbars();

View File

@@ -395,7 +395,7 @@ class PyAUIFrame(wx.Frame):
self.Bind(wx.EVT_MENU, self.OnChangeContentPane, id=ID_TextContent)
self.Bind(wx.EVT_MENU, self.OnChangeContentPane, id=ID_SizeReportContent)
self.Bind(wx.EVT_MENU, self.OnChangeContentPane, id=ID_HTMLContent)
self.Bind(wx.EVT_MENU, self.OnClose, id=wx.ID_EXIT)
self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
self.Bind(wx.EVT_MENU, self.OnAbout, id=ID_About)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateUI, id=ID_TransparentHint)
@@ -431,12 +431,13 @@ class PyAUIFrame(wx.Frame):
def OnClose(self, event):
self._mgr.UnInit()
del self._mgr
self.Destroy()
event.Skip()
def OnExit(self, event):
self.Close()
def OnAbout(self, event):

View File

@@ -19,7 +19,8 @@ class TestPanel(wx.Panel):
title.SetFont(wx.Font(18, wx.SWISS, wx.NORMAL, wx.BOLD))
title.SetForegroundColour("blue")
self.cp = cp = wx.CollapsiblePane(self, label=label1)
self.cp = cp = wx.CollapsiblePane(self, label=label1,
style=wx.CP_DEFAULT_STYLE|wx.CP_NO_TLW_RESIZE)
self.Bind(wx.EVT_COLLAPSIBLEPANE_CHANGED, self.OnPaneChanged, cp)
self.MakePaneContent(cp.GetPane())

View File

@@ -136,19 +136,11 @@ class DragCanvas(wx.ScrolledWindow):
return shape
return None
# Remove a shape from the display
def EraseShape(self, shape, dc):
r = shape.GetRect()
dc.SetClippingRect(r)
self.TileBackground(dc)
self.DrawShapes(dc)
dc.DestroyClippingRegion()
# Clears the background, then redraws it. If the DC is passed, then
# we only do so in the area so designated. Otherwise, it's the whole thing.
def OnEraseBackground(self, evt):
dc = evt.GetDC()
if not dc:
dc = wx.ClientDC(self)
rect = self.GetUpdateRegion().GetBox()
@@ -231,11 +223,11 @@ class DragCanvas(wx.ScrolledWindow):
if dx <= tolerance and dy <= tolerance:
return
# erase the shape since it will be drawn independently now
dc = wx.ClientDC(self)
# refresh the area of the window where the shape was so it
# will get erased.
self.dragShape.shown = False
self.EraseShape(self.dragShape, dc)
self.RefreshRect(self.dragShape.GetRect(), True)
self.Update()
if self.dragShape.text:
self.dragImage = wx.DragString(self.dragShape.text,

View File

@@ -19,9 +19,11 @@
# * Annoying switching between tabs and resulting flicker
# how to replace a page in the notebook without deleting/adding?
# Where is SetPage!? tried freeze...tried reparent of dummy panel....
# AG: It looks like this issue is fixed by Freeze()ing and Thaw()ing the
# main frame and not the notebook
# TODO List:
# * UI design more prefessional
# * UI design more professional (is the new version more professional?)
# * save file positions (new field in demoModules) (@ LoadDemoSource)
# * Update main overview
@@ -30,6 +32,7 @@
import sys, os, time, traceback, types
import wx # This module uses the new wx namespace
import wx.aui
import wx.html
import images
@@ -43,6 +46,15 @@ import images
#---------------------------------------------------------------------------
USE_CUSTOMTREECTRL = False
ALLOW_AUI_FLOATING = False
DEFAULT_PERSPECTIVE = "Default Perspective"
#---------------------------------------------------------------------------
_demoPngs = ["overview", "recent", "frame", "dialog", "moredialog", "core",
"book", "customcontrol", "morecontrols", "layout", "process", "clipboard",
"images", "miscellaneous"]
_treeList = [
# new stuff
@@ -655,7 +667,9 @@ class DemoCodePanel(wx.Panel):
def ActiveModuleChanged(self):
self.LoadDemoSource(self.demoModules.GetSource())
self.UpdateControlState()
self.mainFrame.Freeze()
self.ReloadDemo()
self.mainFrame.Thaw()
def LoadDemoSource(self, source):
@@ -731,7 +745,7 @@ class DemoCodePanel(wx.Panel):
os.makedirs(GetModifiedDirectory())
if not os.path.exists(GetModifiedDirectory()):
wx.LogMessage("BUG: Created demo directory but it still doesn't exist")
raise AssetionError
raise AssertionError
except:
wx.LogMessage("Error creating demo directory: %s" % GetModifiedDirectory())
return
@@ -750,24 +764,37 @@ class DemoCodePanel(wx.Panel):
self.demoModules.LoadFromFile(modModified, modifiedFilename)
self.ActiveModuleChanged()
self.mainFrame.SetTreeModified(True)
def OnRestore(self, event): # Handles the "Delete Modified" button
modifiedFilename = GetModifiedFilename(self.demoModules.name)
self.demoModules.Delete(modModified)
os.unlink(modifiedFilename) # Delete the modified copy
busy = wx.BusyInfo("Reloading demo module...")
self.ActiveModuleChanged()
self.mainFrame.SetTreeModified(False)
#---------------------------------------------------------------------------
def opj(path):
"""Convert paths to the platform-specific separator"""
str = apply(os.path.join, tuple(path.split('/')))
st = apply(os.path.join, tuple(path.split('/')))
# HACK: on Linux, a leading / gets lost...
if path.startswith('/'):
str = '/' + str
return str
st = '/' + st
return st
def GetDataDir():
"""
Return the standard location on this platform for application data
"""
sp = wx.StandardPaths.Get()
return sp.GetUserDataDir()
def GetModifiedDirectory():
@@ -775,7 +802,7 @@ def GetModifiedDirectory():
Returns the directory where modified versions of the demo files
are stored
"""
return opj(wx.GetHomeDir() + "/.wxPyDemo/modified/")
return os.path.join(GetDataDir(), "modified")
def GetModifiedFilename(name):
@@ -784,7 +811,7 @@ def GetModifiedFilename(name):
"""
if not name.endswith(".py"):
name = name + ".py"
return GetModifiedDirectory() + name
return os.path.join(GetModifiedDirectory(), name)
def GetOriginalFilename(name):
@@ -804,6 +831,25 @@ def DoesModifiedExist(name):
return False
def GetConfig():
if not os.path.exists(GetDataDir()):
os.makedirs(GetDataDir())
config = wx.FileConfig(
localFilename=os.path.join(GetDataDir(), "options"))
return config
def SearchDemo(name, keyword):
""" Returns whether a demo contains the search keyword or not. """
fid = open(GetOriginalFilename(name), "rt")
fullText = fid.read()
fid.close()
if fullText.find(keyword) >= 0:
return True
return False
#---------------------------------------------------------------------------
class ModuleDictWrapper:
@@ -1156,10 +1202,13 @@ class wxPythonDemo(wx.Frame):
overviewText = "wxPython Overview"
def __init__(self, parent, title):
wx.Frame.__init__(self, parent, -1, title, size = (950, 720),
wx.Frame.__init__(self, parent, -1, title, size = (970, 720),
style=wx.DEFAULT_FRAME_STYLE | wx.NO_FULL_REPAINT_ON_RESIZE)
self.SetMinSize((640,480))
self.mgr = wx.aui.AuiManager()
self.mgr.SetManagedWindow(self)
self.loaded = False
self.cwd = os.getcwd()
@@ -1178,8 +1227,6 @@ class wxPythonDemo(wx.Frame):
except:
self.tbicon = None
wx.CallAfter(self.ShowTip)
self.otherWin = None
self.Bind(wx.EVT_IDLE, self.OnIdle)
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
@@ -1189,119 +1236,67 @@ class wxPythonDemo(wx.Frame):
self.Centre(wx.BOTH)
self.CreateStatusBar(1, wx.ST_SIZEGRIP)
splitter = wx.SplitterWindow(self, -1, style=wx.CLIP_CHILDREN | wx.SP_LIVE_UPDATE | wx.SP_3D)
splitter2 = wx.SplitterWindow(splitter, -1, style=wx.CLIP_CHILDREN | wx.SP_LIVE_UPDATE | wx.SP_3D)
def EmptyHandler(evt): pass
#splitter.Bind(wx.EVT_ERASE_BACKGROUND, EmptyHandler)
#splitter2.Bind(wx.EVT_ERASE_BACKGROUND, EmptyHandler)
# Prevent TreeCtrl from displaying all items after destruction when True
self.dying = False
self.skipLoad = False
def EmptyHandler(evt): pass
self.ReadConfigurationFile()
# Create a Notebook
self.nb = wx.Notebook(splitter2, -1, style=wx.CLIP_CHILDREN)
# Make a File menu
self.mainmenu = wx.MenuBar()
menu = wx.Menu()
item = menu.Append(-1, '&Redirect Output',
'Redirect print statements to a window',
wx.ITEM_CHECK)
self.Bind(wx.EVT_MENU, self.OnToggleRedirect, item)
exitItem = menu.Append(-1, 'E&xit\tCtrl-Q', 'Get the heck outta here!')
self.Bind(wx.EVT_MENU, self.OnFileExit, exitItem)
wx.App.SetMacExitMenuItemId(exitItem.GetId())
self.mainmenu.Append(menu, '&File')
# Make a Demo menu
menu = wx.Menu()
for item in _treeList[:-1]:
submenu = wx.Menu()
for childItem in item[1]:
mi = submenu.Append(-1, childItem)
self.Bind(wx.EVT_MENU, self.OnDemoMenu, mi)
menu.AppendMenu(wx.NewId(), item[0], submenu)
self.mainmenu.Append(menu, '&Demo')
# Make a Help menu
menu = wx.Menu()
findItem = menu.Append(-1, '&Find\tCtrl-F', 'Find in the Demo Code')
findnextItem = menu.Append(-1, 'Find &Next\tF3', 'Find Next')
menu.AppendSeparator()
shellItem = menu.Append(-1, 'Open Py&Shell Window\tF5',
'An interactive interpreter window with the demo app and frame objects in the namesapce')
inspToolItem = menu.Append(-1, 'Open &Widget Inspector\tF6',
'A tool that lets you browse the live widgets and sizers in an application')
menu.AppendSeparator()
helpItem = menu.Append(-1, '&About wxPython Demo', 'wxPython RULES!!!')
wx.App.SetMacAboutMenuItemId(helpItem.GetId())
self.Bind(wx.EVT_MENU, self.OnOpenShellWindow, shellItem)
self.Bind(wx.EVT_MENU, self.OnOpenWidgetInspector, inspToolItem)
self.Bind(wx.EVT_MENU, self.OnHelpAbout, helpItem)
self.Bind(wx.EVT_MENU, self.OnHelpFind, findItem)
self.Bind(wx.EVT_MENU, self.OnFindNext, findnextItem)
self.Bind(wx.EVT_FIND, self.OnFind)
self.Bind(wx.EVT_FIND_NEXT, self.OnFind)
self.Bind(wx.EVT_FIND_CLOSE, self.OnFindClose)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateFindItems, findItem)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateFindItems, findnextItem)
self.mainmenu.Append(menu, '&Help')
self.SetMenuBar(self.mainmenu)
self.nb = wx.Notebook(self, -1, style=wx.CLIP_CHILDREN)
imgList = wx.ImageList(16, 16)
for png in ["overview", "code", "demo"]:
bmp = images.catalog[png].getBitmap()
imgList.Add(bmp)
self.nb.AssignImageList(imgList)
self.BuildMenuBar()
self.finddata = wx.FindReplaceData()
self.finddata.SetFlags(wx.FR_DOWN)
if False:
# This is another way to set Accelerators, in addition to
# using the '\t<key>' syntax in the menu items.
aTable = wx.AcceleratorTable([(wx.ACCEL_ALT, ord('X'), exitItem.GetId()),
(wx.ACCEL_CTRL, ord('H'), helpItem.GetId()),
(wx.ACCEL_CTRL, ord('F'), findItem.GetId()),
(wx.ACCEL_NORMAL, wx.WXK_F3, findnextItem.GetId()),
(wx.ACCEL_NORMAL, wx.WXK_F9, shellItem.GetId()),
])
self.SetAcceleratorTable(aTable)
# Create a TreeCtrl
tID = wx.NewId()
leftPanel = wx.Panel(splitter)
leftPanel = wx.Panel(self, style=wx.TAB_TRAVERSAL|wx.CLIP_CHILDREN)
self.treeMap = {}
self.searchItems = {}
self.filter = wx.SearchCtrl(leftPanel)
self.tree = wxPythonDemoTree(leftPanel)
self.filter = wx.SearchCtrl(leftPanel, style=wx.TE_PROCESS_ENTER)
self.filter.ShowCancelButton(True)
self.filter.Bind(wx.EVT_TEXT, self.RecreateTree)
self.filter.Bind(wx.EVT_SEARCHCTRL_CANCEL_BTN,
lambda e: self.filter.SetValue(''))
self.treeMap = {}
self.tree = wx.TreeCtrl(leftPanel, tID, style =
wx.TR_DEFAULT_STYLE #| wx.TR_HAS_VARIABLE_ROW_HEIGHT
)
self.filter.Bind(wx.EVT_TEXT_ENTER, self.OnSearch)
searchMenu = wx.Menu()
item = searchMenu.AppendRadioItem(-1, "Sample Name")
self.Bind(wx.EVT_MENU, self.OnSearchMenu, item)
item = searchMenu.AppendRadioItem(-1, "Sample Content")
self.Bind(wx.EVT_MENU, self.OnSearchMenu, item)
self.filter.SetMenu(searchMenu)
self.root = self.tree.AddRoot("wxPython Overview")
self.RecreateTree()
self.tree.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded, id=tID)
self.tree.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnItemCollapsed, id=tID)
self.tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelChanged, id=tID)
self.tree.SetExpansionState(self.expansionState)
self.tree.Bind(wx.EVT_TREE_ITEM_EXPANDED, self.OnItemExpanded)
self.tree.Bind(wx.EVT_TREE_ITEM_COLLAPSED, self.OnItemCollapsed)
self.tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnSelChanged)
self.tree.Bind(wx.EVT_LEFT_DOWN, self.OnTreeLeftDown)
# Set up a wx.html.HtmlWindow on the Overview Notebook page
# we put it in a panel first because there seems to be a
# refresh bug of some sort (wxGTK) when it is directly in
# the notebook...
if 0: # the old way
self.ovr = wx.html.HtmlWindow(self.nb, -1, size=(400, 400))
self.nb.AddPage(self.ovr, self.overviewText)
self.nb.AddPage(self.ovr, self.overviewText, imageId=0)
else: # hopefully I can remove this hacky code soon, see SF bug #216861
panel = wx.Panel(self.nb, -1, style=wx.CLIP_CHILDREN)
self.ovr = wx.html.HtmlWindow(panel, -1, size=(400, 400))
self.nb.AddPage(panel, self.overviewText)
self.nb.AddPage(panel, self.overviewText, imageId=0)
def OnOvrSize(evt, ovr=self.ovr):
ovr.SetSize(evt.GetSize())
@@ -1314,7 +1309,7 @@ class wxPythonDemo(wx.Frame):
# Set up a log window
self.log = wx.TextCtrl(splitter2, -1,
self.log = wx.TextCtrl(self, -1,
style = wx.TE_MULTILINE|wx.TE_READONLY|wx.HSCROLL)
if wx.Platform == "__WXMAC__":
self.log.MacCheckSpelling(False)
@@ -1329,30 +1324,15 @@ class wxPythonDemo(wx.Frame):
#wx.Log_SetActiveTarget(wx.LogStderr())
#wx.Log_SetTraceMask(wx.TraceMessages)
self.Bind(wx.EVT_ACTIVATE, self.OnActivate)
wx.GetApp().Bind(wx.EVT_ACTIVATE_APP, self.OnAppActivate)
# add the windows to the splitter and split it.
splitter2.SplitHorizontally(self.nb, self.log, -160)
leftBox = wx.BoxSizer(wx.VERTICAL)
leftBox.Add(self.tree, 1, wx.EXPAND)
leftBox.Add(wx.StaticText(leftPanel, label = "Filter Demos:"), 0, wx.TOP|wx.LEFT, 5)
leftBox.Add(self.filter, 0, wx.EXPAND|wx.ALL, 5)
leftPanel.SetSizer(leftBox)
splitter.SplitVertically(leftPanel, splitter2, 220)
splitter.SetMinimumPaneSize(120)
splitter2.SetMinimumPaneSize(60)
# Make the splitter on the right expand the top window when resized
def SplitterOnSize(evt):
splitter = evt.GetEventObject()
sz = splitter.GetSize()
splitter.SetSashPosition(sz.height - 160, False)
evt.Skip()
splitter2.Bind(wx.EVT_SIZE, SplitterOnSize)
# select initial items
self.nb.SetSelection(0)
@@ -1372,32 +1352,289 @@ class wxPythonDemo(wx.Frame):
self.tree.SelectItem(selectedDemo)
self.tree.EnsureVisible(selectedDemo)
# Use the aui manager to set up everything
self.mgr.AddPane(self.nb, wx.aui.AuiPaneInfo().CenterPane().Name("Notebook"))
self.mgr.AddPane(leftPanel,
wx.aui.AuiPaneInfo().
Left().Layer(2).BestSize((240, -1)).
MinSize((160, -1)).
Floatable(ALLOW_AUI_FLOATING).FloatingSize((240, 700)).
Caption("wxPython Demos").
CloseButton(False).
Name("DemoTree"))
self.mgr.AddPane(self.log,
wx.aui.AuiPaneInfo().
Bottom().BestSize((-1, 150)).
MinSize((-1, 60)).
Floatable(ALLOW_AUI_FLOATING).FloatingSize((500, 160)).
Caption("Demo Log Messages").
CloseButton(False).
Name("LogWindow"))
#---------------------------------------------
self.auiConfigurations[DEFAULT_PERSPECTIVE] = self.mgr.SavePerspective()
self.mgr.Update()
self.mgr.SetFlags(self.mgr.GetFlags() ^ wx.aui.AUI_MGR_TRANSPARENT_DRAG)
def ReadConfigurationFile(self):
self.auiConfigurations = {}
self.expansionState = [0, 1]
config = GetConfig()
val = config.Read('ExpansionState')
if val:
self.expansionState = eval(val)
val = config.Read('AUIPerspectives')
if val:
self.auiConfigurations = eval(val)
def BuildMenuBar(self):
# Make a File menu
self.mainmenu = wx.MenuBar()
menu = wx.Menu()
item = menu.Append(-1, '&Redirect Output',
'Redirect print statements to a window',
wx.ITEM_CHECK)
self.Bind(wx.EVT_MENU, self.OnToggleRedirect, item)
exitItem = wx.MenuItem(menu, -1, 'E&xit\tCtrl-Q', 'Get the heck outta here!')
exitItem.SetBitmap(images.catalog['exit'].getBitmap())
menu.AppendItem(exitItem)
self.Bind(wx.EVT_MENU, self.OnFileExit, exitItem)
wx.App.SetMacExitMenuItemId(exitItem.GetId())
self.mainmenu.Append(menu, '&File')
# Make a Demo menu
menu = wx.Menu()
for indx, item in enumerate(_treeList[:-1]):
menuItem = wx.MenuItem(menu, -1, item[0])
submenu = wx.Menu()
for childItem in item[1]:
mi = submenu.Append(-1, childItem)
self.Bind(wx.EVT_MENU, self.OnDemoMenu, mi)
menuItem.SetBitmap(images.catalog[_demoPngs[indx+1]].getBitmap())
menuItem.SetSubMenu(submenu)
menu.AppendItem(menuItem)
self.mainmenu.Append(menu, '&Demo')
# Make an Option menu
# If we've turned off floatable panels then this menu is not needed
if ALLOW_AUI_FLOATING:
menu = wx.Menu()
auiPerspectives = self.auiConfigurations.keys()
auiPerspectives.sort()
perspectivesMenu = wx.Menu()
item = wx.MenuItem(perspectivesMenu, -1, DEFAULT_PERSPECTIVE, "Load startup default perspective", wx.ITEM_RADIO)
self.Bind(wx.EVT_MENU, self.OnAUIPerspectives, item)
perspectivesMenu.AppendItem(item)
for indx, key in enumerate(auiPerspectives):
if key == DEFAULT_PERSPECTIVE:
continue
item = wx.MenuItem(perspectivesMenu, -1, key, "Load user perspective %d"%indx, wx.ITEM_RADIO)
perspectivesMenu.AppendItem(item)
self.Bind(wx.EVT_MENU, self.OnAUIPerspectives, item)
menu.AppendMenu(wx.ID_ANY, "&AUI Perspectives", perspectivesMenu)
self.perspectives_menu = perspectivesMenu
item = wx.MenuItem(menu, -1, 'Save Perspective', 'Save AUI perspective')
item.SetBitmap(images.catalog['saveperspective'].getBitmap())
menu.AppendItem(item)
self.Bind(wx.EVT_MENU, self.OnSavePerspective, item)
item = wx.MenuItem(menu, -1, 'Delete Perspective', 'Delete AUI perspective')
item.SetBitmap(images.catalog['deleteperspective'].getBitmap())
menu.AppendItem(item)
self.Bind(wx.EVT_MENU, self.OnDeletePerspective, item)
menu.AppendSeparator()
item = wx.MenuItem(menu, -1, 'Restore Tree Expansion', 'Restore the initial tree expansion state')
item.SetBitmap(images.catalog['expansion'].getBitmap())
menu.AppendItem(item)
self.Bind(wx.EVT_MENU, self.OnTreeExpansion, item)
self.mainmenu.Append(menu, '&Options')
# Make a Help menu
menu = wx.Menu()
findItem = wx.MenuItem(menu, -1, '&Find\tCtrl-F', 'Find in the Demo Code')
findItem.SetBitmap(images.catalog['find'].getBitmap())
findNextItem = wx.MenuItem(menu, -1, 'Find &Next\tF3', 'Find Next')
findNextItem.SetBitmap(images.catalog['findnext'].getBitmap())
menu.AppendItem(findItem)
menu.AppendItem(findNextItem)
menu.AppendSeparator()
shellItem = wx.MenuItem(menu, -1, 'Open Py&Shell Window\tF5',
'An interactive interpreter window with the demo app and frame objects in the namesapce')
shellItem.SetBitmap(images.catalog['pyshell'].getBitmap())
menu.AppendItem(shellItem)
inspToolItem = wx.MenuItem(menu, -1, 'Open &Widget Inspector\tF6',
'A tool that lets you browse the live widgets and sizers in an application')
inspToolItem.SetBitmap(images.catalog['inspect'].getBitmap())
menu.AppendItem(inspToolItem)
menu.AppendSeparator()
helpItem = menu.Append(-1, '&About wxPython Demo', 'wxPython RULES!!!')
wx.App.SetMacAboutMenuItemId(helpItem.GetId())
self.Bind(wx.EVT_MENU, self.OnOpenShellWindow, shellItem)
self.Bind(wx.EVT_MENU, self.OnOpenWidgetInspector, inspToolItem)
self.Bind(wx.EVT_MENU, self.OnHelpAbout, helpItem)
self.Bind(wx.EVT_MENU, self.OnHelpFind, findItem)
self.Bind(wx.EVT_MENU, self.OnFindNext, findNextItem)
self.Bind(wx.EVT_FIND, self.OnFind)
self.Bind(wx.EVT_FIND_NEXT, self.OnFind)
self.Bind(wx.EVT_FIND_CLOSE, self.OnFindClose)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateFindItems, findItem)
self.Bind(wx.EVT_UPDATE_UI, self.OnUpdateFindItems, findNextItem)
self.mainmenu.Append(menu, '&Help')
self.SetMenuBar(self.mainmenu)
if False:
# This is another way to set Accelerators, in addition to
# using the '\t<key>' syntax in the menu items.
aTable = wx.AcceleratorTable([(wx.ACCEL_ALT, ord('X'), exitItem.GetId()),
(wx.ACCEL_CTRL, ord('H'), helpItem.GetId()),
(wx.ACCEL_CTRL, ord('F'), findItem.GetId()),
(wx.ACCEL_NORMAL, wx.WXK_F3, findnextItem.GetId()),
(wx.ACCEL_NORMAL, wx.WXK_F9, shellItem.GetId()),
])
self.SetAcceleratorTable(aTable)
#---------------------------------------------
def RecreateTree(self, evt=None):
# Catch the search type (name or content)
searchMenu = self.filter.GetMenu().GetMenuItems()
fullSearch = searchMenu[1].IsChecked()
if evt:
if fullSearch:
# Do not`scan all the demo files for every char
# the user input, use wx.EVT_TEXT_ENTER instead
return
expansionState = self.tree.GetExpansionState()
current = None
item = self.tree.GetSelection()
if item:
prnt = self.tree.GetItemParent(item)
if prnt:
current = (self.tree.GetItemText(item),
self.tree.GetItemText(prnt))
self.tree.Freeze()
self.tree.DeleteAllItems()
self.root = self.tree.AddRoot("wxPython Overview")
self.tree.SetItemImage(self.root, 0)
self.tree.SetItemPyData(self.root, 0)
treeFont = self.tree.GetFont()
catFont = self.tree.GetFont()
# The old native treectrl on MSW has a bug where it doesn't
# draw all of the text for an item if the font is larger than
# the default. It seems to be clipping the item's label as if
# it was the size of the same label in the default font.
if 'wxMSW' not in wx.PlatformInfo or wx.GetApp().GetComCtl32Version() >= 600:
treeFont.SetPointSize(treeFont.GetPointSize()+2)
treeFont.SetWeight(wx.BOLD)
catFont.SetWeight(wx.BOLD)
self.tree.SetItemFont(self.root, treeFont)
firstChild = None
selectItem = None
filter = self.filter.GetValue()
count = 0
for category, items in _treeList:
count += 1
if filter:
items = [item for item in items if filter.lower() in item.lower()]
if fullSearch:
items = self.searchItems[category]
else:
items = [item for item in items if filter.lower() in item.lower()]
if items:
child = self.tree.AppendItem(self.root, category)
child = self.tree.AppendItem(self.root, category, image=count)
self.tree.SetItemFont(child, catFont)
self.tree.SetItemPyData(child, count)
if not firstChild: firstChild = child
for childItem in items:
theDemo = self.tree.AppendItem(child, childItem)
image = count
if DoesModifiedExist(childItem):
image = len(_demoPngs)
theDemo = self.tree.AppendItem(child, childItem, image=image)
self.tree.SetItemPyData(theDemo, count)
self.treeMap[childItem] = theDemo
if current and (childItem, category) == current:
selectItem = theDemo
self.tree.Expand(self.root)
if firstChild:
self.tree.Expand(firstChild)
if filter:
self.tree.ExpandAll()
elif expansionState:
self.tree.SetExpansionState(expansionState)
if selectItem:
self.skipLoad = True
self.tree.SelectItem(selectItem)
self.skipLoad = False
self.tree.Thaw()
self.searchItems = {}
def OnSearchMenu(self, event):
# Catch the search type (name or content)
searchMenu = self.filter.GetMenu().GetMenuItems()
fullSearch = searchMenu[1].IsChecked()
if fullSearch:
self.OnSearch()
else:
self.RecreateTree()
def OnSearch(self, event=None):
value = self.filter.GetValue()
if not value:
self.RecreateTree()
return
wx.BeginBusyCursor()
for category, items in _treeList:
self.searchItems[category] = []
for childItem in items:
if SearchDemo(childItem, value):
self.searchItems[category].append(childItem)
wx.EndBusyCursor()
self.RecreateTree()
def SetTreeModified(self, modified):
item = self.tree.GetSelection()
if modified:
image = len(_demoPngs)
else:
image = self.tree.GetItemPyData(item)
self.tree.SetItemImage(item, image)
def WriteText(self, text):
if text[-1:] == '\n':
text = text[:-1]
@@ -1429,7 +1666,7 @@ class wxPythonDemo(wx.Frame):
#---------------------------------------------
def OnSelChanged(self, event):
if self.dying or not self.loaded:
if self.dying or not self.loaded or self.skipLoad:
return
item = event.GetItem()
@@ -1440,6 +1677,7 @@ class wxPythonDemo(wx.Frame):
def LoadDemo(self, demoName):
try:
wx.BeginBusyCursor()
self.Freeze()
os.chdir(self.cwd)
self.ShutdownDemoModule()
@@ -1457,13 +1695,13 @@ class wxPythonDemo(wx.Frame):
wx.LogMessage("Loading demo %s.py..." % demoName)
self.demoModules = DemoModules(demoName)
self.LoadDemoSource()
self.tree.Refresh()
else:
self.SetOverview("wxPython", mainOverview)
self.codePage = None
self.UpdateNotebook(0)
finally:
wx.EndBusyCursor()
self.Thaw()
#---------------------------------------------
def LoadDemoSource(self):
@@ -1494,6 +1732,10 @@ class wxPythonDemo(wx.Frame):
self.demoPage = DemoErrorPanel(self.nb, self.codePage,
DemoError(sys.exc_info()), self)
bg = self.nb.GetThemeBackgroundColour()
if bg:
self.demoPage.SetBackgroundColour(bg)
assert self.demoPage is not None, "runTest must return a window!"
else:
@@ -1504,7 +1746,7 @@ class wxPythonDemo(wx.Frame):
self.SetOverview(self.demoModules.name + " Overview", overviewText)
if self.firstTime:
# cahnge to the demo page the first time a module is run
# change to the demo page the first time a module is run
self.UpdateNotebook(2)
self.firstTime = False
else:
@@ -1524,6 +1766,7 @@ class wxPythonDemo(wx.Frame):
def UpdateNotebook(self, select = -1):
nb = self.nb
debug = False
self.Freeze()
def UpdatePage(page, pageText):
pageExists = False
@@ -1537,15 +1780,13 @@ class wxPythonDemo(wx.Frame):
if page:
if not pageExists:
# Add a new page
nb.AddPage(page, pageText)
nb.AddPage(page, pageText, imageId=nb.GetPageCount())
if debug: wx.LogMessage("DBG: ADDED %s" % pageText)
else:
if nb.GetPage(pagePos) != page:
# Reload an existing page
nb.Freeze()
nb.DeletePage(pagePos)
nb.InsertPage(pagePos, page, pageText)
nb.Thaw()
nb.InsertPage(pagePos, page, pageText, imageId=pagePos)
if debug: wx.LogMessage("DBG: RELOADED %s" % pageText)
else:
# Excellent! No redraw/flicker
@@ -1565,7 +1806,9 @@ class wxPythonDemo(wx.Frame):
if select >= 0 and select < nb.GetPageCount():
nb.SetSelection(select)
self.Thaw()
#---------------------------------------------
def SetOverview(self, name, text):
self.curOverview = text
@@ -1590,6 +1833,70 @@ class wxPythonDemo(wx.Frame):
else:
app.RestoreStdio()
print "Print statements and other standard output will now be sent to the usual location."
def OnAUIPerspectives(self, event):
perspective = self.perspectives_menu.GetLabel(event.GetId())
self.mgr.LoadPerspective(self.auiConfigurations[perspective])
self.mgr.Update()
def OnSavePerspective(self, event):
dlg = wx.TextEntryDialog(self, "Enter a name for the new perspective:", "AUI Configuration")
dlg.SetValue(("Perspective %d")%(len(self.auiConfigurations)+1))
if dlg.ShowModal() != wx.ID_OK:
return
perspectiveName = dlg.GetValue()
menuItems = self.perspectives_menu.GetMenuItems()
for item in menuItems:
if item.GetLabel() == perspectiveName:
wx.MessageBox("The selected perspective name:\n\n%s\n\nAlready exists."%perspectiveName,
"Error", style=wx.ICON_ERROR)
return
item = wx.MenuItem(self.perspectives_menu, -1, dlg.GetValue(),
"Load user perspective %d"%(len(self.auiConfigurations)+1),
wx.ITEM_RADIO)
self.Bind(wx.EVT_MENU, self.OnAUIPerspectives, item)
self.perspectives_menu.AppendItem(item)
item.Check(True)
self.auiConfigurations.update({dlg.GetValue(): self.mgr.SavePerspective()})
def OnDeletePerspective(self, event):
menuItems = self.perspectives_menu.GetMenuItems()[1:]
lst = []
loadDefault = False
for item in menuItems:
lst.append(item.GetLabel())
dlg = wx.MultiChoiceDialog(self,
"Please select the perspectives\nyou would like to delete:",
"Delete AUI Perspectives", lst)
if dlg.ShowModal() == wx.ID_OK:
selections = dlg.GetSelections()
strings = [lst[x] for x in selections]
for sel in strings:
self.auiConfigurations.pop(sel)
item = menuItems[lst.index(sel)]
if item.IsChecked():
loadDefault = True
self.perspectives_menu.GetMenuItems()[0].Check(True)
self.perspectives_menu.DeleteItem(item)
lst.remove(sel)
if loadDefault:
self.mgr.LoadPerspective(self.auiConfigurations[DEFAULT_PERSPECTIVE])
self.mgr.Update()
def OnTreeExpansion(self, event):
self.tree.SetExpansionState(self.expansionState)
def OnHelpAbout(self, event):
from About import MyAboutBox
@@ -1710,6 +2017,12 @@ class wxPythonDemo(wx.Frame):
self.mainmenu = None
if self.tbicon is not None:
self.tbicon.Destroy()
config = GetConfig()
config.Write('ExpansionState', str(self.tree.GetExpansionState()))
config.Write('AUIPerspectives', str(self.auiConfigurations))
config.Flush()
self.Destroy()
@@ -1723,18 +2036,20 @@ class wxPythonDemo(wx.Frame):
#---------------------------------------------
def ShowTip(self):
try:
showTipText = open(opj("data/showTips")).read()
config = GetConfig()
showTipText = config.Read("tips")
if showTipText:
showTip, index = eval(showTipText)
except IOError:
else:
showTip, index = (1, 0)
if showTip:
tp = wx.CreateFileTipProvider(opj("data/tips.txt"), index)
##tp = MyTP(0)
showTip = wx.ShowTip(self, tp)
index = tp.GetCurrentTip()
open(opj("data/showTips"), "w").write(str( (showTip, index) ))
config.Write("tips", str( (showTip, index) ))
config.Flush()
#---------------------------------------------
def OnDemoMenu(self, event):
@@ -1799,8 +2114,54 @@ class MySplashScreen(wx.SplashScreen):
frame.Show()
if self.fc.IsRunning():
self.Raise()
wx.CallAfter(frame.ShowTip)
#---------------------------------------------------------------------------
from wx.lib.mixins.treemixin import ExpansionState
if USE_CUSTOMTREECTRL:
import wx.lib.customtreectrl as CT
TreeBaseClass = CT.CustomTreeCtrl
else:
TreeBaseClass = wx.TreeCtrl
class wxPythonDemoTree(ExpansionState, TreeBaseClass):
def __init__(self, parent):
TreeBaseClass.__init__(self, parent, style=wx.TR_DEFAULT_STYLE|
wx.TR_HAS_VARIABLE_ROW_HEIGHT)
self.BuildTreeImageList()
if USE_CUSTOMTREECTRL:
self.SetSpacing(10)
self.SetWindowStyle(self.GetWindowStyle() & ~wx.TR_LINES_AT_ROOT)
def AppendItem(self, parent, text, image=-1, wnd=None):
if USE_CUSTOMTREECTRL:
item = TreeBaseClass.AppendItem(self, parent, text, image=image, wnd=wnd)
else:
item = TreeBaseClass.AppendItem(self, parent, text, image=image)
return item
def BuildTreeImageList(self):
imgList = wx.ImageList(16, 16)
for png in _demoPngs:
imgList.Add(images.catalog[png].getBitmap())
# add the image for modified demos.
imgList.Add(images.catalog["custom"].getBitmap())
self.AssignImageList(imgList)
def GetItemIdentity(self, item):
return self.GetPyData(item)
#---------------------------------------------------------------------------
class MyApp(wx.App):
def OnInit(self):
"""
@@ -1809,7 +2170,8 @@ class MyApp(wx.App):
"""
wx.SystemOptions.SetOptionInt("mac.window-plain-transition", 1)
self.SetAppName("wxPyDemo")
# For debugging
#self.SetAssertMode(wx.PYAPP_ASSERT_DIALOG)

View File

@@ -211,7 +211,8 @@ class MyEvtHandler(ogl.ShapeEvtHandler):
if shape.Selected():
shape.Select(False, dc)
canvas.Redraw(dc)
#canvas.Redraw(dc)
canvas.Refresh(False)
else:
redraw = False
shapeList = canvas.GetDiagram().GetShapeList()
@@ -230,7 +231,8 @@ class MyEvtHandler(ogl.ShapeEvtHandler):
for s in toUnselect:
s.Select(False, dc)
canvas.Redraw(dc)
##canvas.Redraw(dc)
canvas.Refresh(False)
self.UpdateStatusBar(shape)
@@ -251,9 +253,11 @@ class MyEvtHandler(ogl.ShapeEvtHandler):
def OnMovePost(self, dc, x, y, oldX, oldY, display):
shape = self.GetShape()
ogl.ShapeEvtHandler.OnMovePost(self, dc, x, y, oldX, oldY, display)
self.UpdateStatusBar(self.GetShape())
self.UpdateStatusBar(shape)
if "wxMac" in wx.PlatformInfo:
shape.GetCanvas().Refresh(False)
def OnRightClick(self, *dontcare):
self.log.WriteText("%s\n" % self.GetShape())
@@ -334,8 +338,8 @@ class TestWindow(ogl.ShapeCanvas):
s.SetBitmap(bmp)
self.MyAddShape(s, 225, 130, None, None, "Bitmap")
dc = wx.ClientDC(self)
self.PrepareDC(dc)
#dc = wx.ClientDC(self)
#self.PrepareDC(dc)
for x in range(len(self.shapes)):
fromShape = self.shapes[x]

View File

@@ -30,8 +30,9 @@ class TestTreeCtrlPanel(wx.Panel):
tID = wx.NewId()
self.tree = MyTreeCtrl(self, tID, wx.DefaultPosition, wx.DefaultSize,
wx.TR_HAS_BUTTONS
| wx.TR_EDIT_LABELS
wx.TR_DEFAULT_STYLE
#wx.TR_HAS_BUTTONS
#| wx.TR_EDIT_LABELS
#| wx.TR_MULTIPLE
#| wx.TR_HIDE_ROOT
, self.log)

View File

@@ -1,6 +1,10 @@
import wx, wx.lib.customtreectrl, wx.gizmos
import treemixin
try:
import treemixin
except ImportError:
from wx.lib.mixins import treemixin
overview = treemixin.__doc__
class TreeModel(object):
''' TreeModel holds the domain objects that are shown in the different

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 807 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 817 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 995 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 985 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 519 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 440 B

Some files were not shown because too many files have changed in this diff Show More