Merged wxPython 2.4.x to the 2.5 branch (Finally!!!)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2003-03-25 06:35:27 +00:00
parent 9b4e3f352b
commit 1e4a197e4c
586 changed files with 62691 additions and 17740 deletions

View File

@@ -2,8 +2,12 @@
.emacs.desktop
.gdb_history
MANIFEST
_build_dmg
_build_rpm
build
build-gtk
build-gtk2
build-gtk2.unicode
build-pkg
build-pkg-debug
build.local

View File

@@ -1,57 +1,32 @@
Building wxPython on Mac OS X
-----------------------------
NOTE: OS X support is HIGHLY EXPERIMENTAL at this time. Most things
are working now, but a few still don't. I know about most of
them and am addressing them as I have time. If you have any
ideas about a fix for the stuff that's still broken then
please persue them and send the fixes to me.
These are the steps I have used for building wxPython on Mac OS X 10.1
These are the steps I have used for building wxPython on Mac OS X 10.x
with the Apple Developer Tools, a.k.a the Darwin version. I assume
that you know your way around a command line and that you know how to
get things from various CVS repositories as needed.
1. Python 2.2 is required. There is a disk image with an installer
package in the wxPython Sourceforge download area, in this group:
1. "MacPython-OSX" 2.3 is required. There is a disk image with an
installer package in the wxPython Sourceforge download area, in
this group:
http://sourceforge.net/project/showfiles.php?group_id=10718&release_id=84730
If, for some reason you need to build your own Python, get the
source from www.python.org and follow theinstructions in the
Mac/OSX/README file to build and install Python.app and the
Python.framework.
If you build your own Python then you may want to make a symlink or
two in /usr/local/bin so that this version of Python can be found
from the command line. For example:
cd /usr/local/bin
sudo ln -s /Library/Frameworks/Python.framework/Versions/2.2/bin/python2.2 python2.2
sudo ln -s python2.2 python
Also, if you create a /usr/local/bin/pythonw script like the
following then you can run Python GUI apps (like wxPython) directly
from the command line:
#!/bin/sh
exec /Applications/Python.app/Contents/MacOS/python $@
Be sure to give this script execute permissions:
sudo chmod +x /usr/local/bin/pythonw
If you would like to make a MachoPython installer from what you
built then you may want to look at the scripts I use to do it
located in wxPython/distrib/mac/buildPython.
source from www.python.org and follow the instructions in the
Mac/OSX/README file to build and install the Python.framework and
Python tools.
One last thing, make sure that /usr/local/bin is in your PATH
environment variable.
environment variable since that is where the new python and pythonw
commands will be located.
2. In a wxWindows CVS tree make a build directory.
2. In a wxWindows CVS tree make a build directory. (You can also use
a CVS snapshot located in http://wxwindows.org/snapshots/ or the
released wxPythonSrc-*.tr.gz archive.)
cd ~/proj/wxWindows # or wherever you put it
mkdir build
@@ -69,7 +44,14 @@ get things from various CVS repositories as needed.
5. Build and install wxPython.
cd ../wxPython
python setup.py IN_CVS_TREE=1 build install
python setup.py build install
If you would like to install to someplace besides the Python
site-packages directory (such as to your home directory) then you
can add "--root=<path>" after the "install" command. To use
wxPython like this you'll need to ensure that the directory
containing wxPyrthon is contained in in the PYTHONPATH environment
variable.
6. Test. Just navigate in the Finder to the demo directory and double
click demo.py, or simple.py, or whatever you want to run. Or from

View File

@@ -1,23 +1,27 @@
Building wxPython on Unix or Unix-like Systems
----------------------------------------------
The basic steps for building wxPython for Unix or Unix-like systems
are:
NOTE: You should probably look at the ../ README.1st.txt file for
directions for how to build wxPython the "new way." This files
describes the "old way" to build on unix-like systems. The difference
is very simple: The new way uses a private copy of wxGTK while the
old way uses either an existing wxGTK that may be installed and used
by other apps, or you can build a wxGTK that will be accissible by
other apps.
1. Compile and/or install glib and gtk+
2. Compile and/or install wxGTK
3. Compile and install wxPython
We'll go into more detail of each of these steps below, but first a
few bits of background information on tools.
NOTE 2: I use a tool called SWIG (http://www.swig.org) to help
generate the C++ sources used in the wxPython extension module.
However you don't need to have SWIG unless you want to modify the *.i
files. I've made several modifications to and older version of SWIG
that are specific to wxPython's needs and so the modified sources are
included in the wx CVS at .../wxPython/wxSWIG. But because of the
size and since most people won't need it my SWIG is not included in
the wxPythonSrc tarball. You'll need to get it from CVS or a CVS
snapshot.
I use a tool called SWIG (http://www.swig.org) to help generate the
C++ sources used in the wxPython extension module. However you don't
need to have SWIG unless you want to modify the *.i files. I've made
several modifications to SWIG specific to wxPython's needs and so the
modified sources are included in the wx CVS at .../wxPython/wxSWIG.
If you need to modify the *.i files for wxPython then change to this
directory and run:
If you need to modify the *.i files for wxPython then you will need to
build wxswig. Change to the .../wxPython/wxSWIG directory and run:
configure
make
@@ -46,29 +50,13 @@ A. First of all, check and see if you've already got glib/gtk+ on your
gtk-config --version
If you have version 1.2.5 or better then you're all set. You can
skip to step #2.
If you have version 1.2.7 or better then you're all set. Otherwise
either get the pacakges for your unix distribution and install them
or get the sources from www.gtk.org and build and install them.
B. If your system has a binary package mechanism, (RPMs, debs,
whatever...) check and see if binaries for glib abd gtk+ are
available. Be sure to get the runtime library package as well as
the development package, if they are separate. Install them with
your package tool, and skip to step #2.
C. If all else fails, you can get the source code for glib and gtk+ at
http://www.gtk.org/. Fetch the latest of each in the 1.2.x
series. Compile and install each of them like this:
gzip -d [package].tar.gz | tar xvf -
cd [package]
./configure
make
make install
The last step will probably have to be done as root. Also, if your
system needs anything done to update the dynamic loader for shared
libraries, (such as running ldconfig on Linux) then do it after
each library is installed.
The best version to get is the latest 1.2.x release as the
wxWindows support for GTK 2.x is still beta-level. (Most tings
work great though, and it looks real nice.)
@@ -77,30 +65,40 @@ C. If all else fails, you can get the source code for glib and gtk+ at
A. You can find the sources and RPMs for wxGTK at
http://wxwindows.org/, just follow the download links from the
nevigation panel. You can also check out a current snapshot of the
sources from the CVS server. (Some information about annonymous
CVS access is at http://wxwindows.org/cvs.htm.) The advantage of
using CVS is that you can easily update as soon as the developers
check in new sources or fixes. The advantage of using a released
version is that it usually has had more thorough testing done. You
can decide which method is best for you.
navigation panel.
Source code for wxGTK is now included with the wxPythonSrc tarball,
and is the recommended way to get released wxGTK source code if you
plan on building both.
You can also check out a current snapshot of the sources from the
CVS server. (Some information about annonymous CVS access is at
http://wxwindows.org/cvs.htm.) The advantage of using CVS is that
you can easily update as soon as the developers check in new
sources or fixes. The advantage of using a released version is
that it usually has had more thorough testing done. You can decide
which method is best for you.
B. You'll usually want to use a version of wxGTK that has the same
version number as the wxPython sources you are using. (Another
advantage of using CVS is that you'll get both at the same time.)
advantage of using wxPythonSrc or CVS is that you'll get both at
the same time.)
C. If using the RPMs be sure to get both the wxGTK and wxGTK-devel
RPMs (at a minimum) and then install them as root.
rpm -Uhv wxGTK-2.2.2-0.i386.rpm wxGTK-devel-2.2.2-0.i386.rpm
D. If using the sources (either from the tarball or from CVS) then
configure it like this:
cd wxWindows # or whatever your top-level directory is called
mkdir build
cd build
../configure --with-gtk
../configure --with-gtk --enable-geometry
There are gobs and gobs of options for the configure script, run
../configure --help to see them all. I'll describe some that I find
@@ -118,32 +116,9 @@ D. If using the sources (either from the tarball or from CVS) then
special debugging code in wxWindows by defining the __WXDEBUG__
macro. You'll get some extra asserts, failure logging, etc.
To make a static library and not make a shared library, use the
--disable-shared and --enable-static flags.
If you are using GTK 2.x then you'll want to add --enable-gtk2 and
probably also --enable-unicode.
NOTE: There is a potential type mismatch between Python and wxGTK.
This happens if Python defines some flags that turn on 64-bit file
offset support and wxGTK does not. This causes some basic types,
like off_t, to be typedef'd differently causing the C++ method
signatures to be incompatible and giving link errors at runtime.
If you get errors upon running a wxPython script that looks
something like this:
SeekI_13wxInputStream10wxSeekMode: referenced symbol not found
then that is probably the issue. This can be fixed in the current
code by predefining these flags before wxGTK's configure is run,
for example:
export CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DHAVE_LARGEFILE_SUPPORT"
export CXXFLAGS=$CFLAGS
../configure --with-gtk --with-opengl --enable-debug
In the 2.3.3 final release there will be a real configure flag for
it, and it should be enabled by default. You will be able to use
--enable-largefile or --disable-largefile to control it. If you
still get this or a similar error with 2.3.3 then try disabling
largefile support in wxGTK.
E. Now just compile and install. You need to use GNU make, so if your
system has something else get GNU make and build and install it and
@@ -156,6 +131,7 @@ E. Now just compile and install. You need to use GNU make, so if your
system needs anything done to update the dynamic loader for shared
libraries, (such as running ldconfig on Linux) then do it now.
F. You can test your build by changing to one of the directories under
build/samples or build/demos, running make and then running the
executable that is built.
@@ -167,33 +143,24 @@ F. You can test your build by changing to one of the directories under
A. You have the same options (and same advantages/disadvantages) for
getting the wxPython source, either a released snapshot or from
CVS. The released version file is named wxPython-[version].tar.gz
CVS. The released version file is named wxPythonSrc-[version].tar.gz
and is available at http://wxpython.org/download.php. If you want
to use CVS you'll find wxPython in the wxWindows CVS tree (see
above) in the wxWindows/wxPython directory.
B. As mentioned previouslly, wxPython is built with the standard
Python Distutils tool. If you are using Python 2.0 or later you
are all set, otherwise you need to download and install Distutils
1.0 from http://www.python.org/sigs/distutils-sig/.
B. wxPython is built with the standard Python Distutils tool and
currently includes it's own snapshot of the latest version of
distutils which can also be used with previous versions of Python
On Unix systems Distutils figures out what commands and flags to
use for the compiler and linker by looking in the Makefile that was
used to build Python itself. Most of the time this works okay. If
it doesn't, there doesn't seem to be a way to override the values
that Distutils uses without hacking either Distutils itself, or
Python's Makefile. (Complain to the distutils-sig about this
please.) For example, on a Solaris system I had to edit
/usr/local/lib/python1.5/config/Makefile and replace
LDSHARED=ld -G
with
LDSHARED=gcc -G
This particular problem has been fixed in Python 1.6 and beyond,
but there may be similar issues on other platforms.
Python's Makefile. (NOTE: This has been changed with the
distutilsincluded with Python 2.3 but I havn't yet looked into how
best to utilize this in wxPython...)
While we're on the subject of how Python was built... Since
wxPython is a C++ extension some platforms and/or compilers will
@@ -215,13 +182,14 @@ B. As mentioned previouslly, wxPython is built with the standard
make install
I recently built Python 2.1.3 and Python 2.2.1 on Solaris and did
not have to resort to this workaround so apparently thigns are
not have to resort to this workaround so apparently things are
getting better there. I will leave this note here though in case
there are similar issues elsewhere. However I did run into a
Python build issue that affects the wxPython build when attempting
to use SunCC instead of GNU gcc. See the note below titled
"Building with non-GNU compilers" if you are interested.
C. Change to the root wxPython directory and look at the setup.py
file. This is the script that configures and defines all the
information that Distutils needs to build wxPython. There are some
@@ -248,18 +216,7 @@ C. Change to the root wxPython directory and look at the setup.py
will be executed to regenerate the wrapper C++
and shadow python files.
IN_CVS_TREE If you are using the CVS version of the
wxWindows and wxPython sources then you will
need to set this flag to non-zero. This is
needed because some source files from the
wxWindows tree are copied to be under the
wxPython tree in order to keep Distutils happy.
With this flag set then setup.py will
automatically keep these copied sources up to
date if the original version is ever updated.
If you are using the tar.gz version of the
Python sources then these copied sources are
already present in your source tree.
etc.
D. To build and install wxPython you simply need to execute the
@@ -269,15 +226,32 @@ D. To build and install wxPython you simply need to execute the
site-packages directory you may need to be root to run the install
command.
python setup.py build
python setup.py install
python setup.py build install
If you need to change any of the build flags that can also be done
on the setup.py command line, like this:
python setup.py BUILD_GLCANVAS=0 build install
If you are using GTK 2.x then you'll want to add these flags:
python setup.py WXPORT=gtk2 UNICODE=1 build install
If you would like to install to someplace besides the Python
site-packages directory (such as to your home directory) then you
can add "--root=<path>" after the "install" command. To use
wxPython like this you'll need to ensure that the directory
containing wxPyrthon is contained in in the PYTHONPATH environment
variable.
E. At this point you should be able to change into the wxPython/demo
directory and run the demo:
python demo.py
F. If you would like to make a test build that doesn't overwrite the
F. If you would like to make a test build that doesn't overwrite any
installed version of wxPython you can do so with this command
instead of the install command above:
@@ -360,5 +334,7 @@ before running configure, like this in bash:
After making and installing Python with this configuration you should
be able to build wxPython as described in the steps above.
-----------------
robin@alldunn.com

View File

@@ -8,10 +8,9 @@ your sources from and what your desired end result is, there are
several permutations of those steps. At a high level the basic steps
are:
1. Get the wxWindows sources
1. Get the sources
2. Build the wxWindows DLL
3. Get the wxPython sources
4. Build and Install wxPython
3. Build and Install wxPython
We'll go into more detail of each of these steps below, but first a
few bits of background information on tools.
@@ -20,7 +19,11 @@ I use a tool called SWIG (http://www.swig.org) to help generate the
C++ sources used in the wxPython extension module. However you don't
need to have SWIG unless you want to modify the *.i files. I've made
several modifications to SWIG specific to wxPython's needs and so the
modified sources are included in the wx CVS at .../wxPython/wxSWIG.
modified sources are included in the wx CVS at.../wxPython/wxSWIG.
But because of the size and since most people won't need it my SWIG is
not included in the wxPythonSrc tarball. You'll need to get it from
CVS or a CVS snapshot.
If you need to modify the *.i files for wxPython then change to this
directory and run:
@@ -42,6 +45,7 @@ If anybody wants to try it I'll take any required patches for the
setup script and for these instructions.
UNICODE
-------
@@ -69,44 +73,44 @@ And now on to the fun stuff...
1. Get the wxWindows sources
----------------------------
1. Get the sources
------------------
A. There are a few possible ways to get sources for wxWindows. You
can download a released version from http://wxwindows.org/ or you
can get current development sources from the CVS server. (Some
information about annonymous CVS access is at the
http://wxwindows.org/cvs.htm site.) The advantage of using CVS is
that you can easily update as soon as the developers check in new
sources or fixes. The advantage of using a released version is
that it usually has had more thorough testing done. You can decide
which method is best for you.
A. You can either use a tarball with the released version of the
source code for wxWindows/wxPython, or you can get current
development sources from the CVS repository. (Some information
about annonymous CVS access is at the http://wxwindows.org/cvs.htm
site.) The advantage of using CVS is that you can easily update as
soon as the developers check in new sources or fixes. The
advantage of using a released version is that it usually has had
more thorough testing done. You can decide which method is best
for you. The released version file is named
wxPythonSrc-[version].tar.gz and is available from the wxPython
website at http://wxpython.org/download.php. You can use WinZip to
unpack it if you don't have tar and gzip.
B. You'll usually want to use wxWindows sources that have the same
version number as the wxPython sources you are using. (Another
advantage of using CVS is that you'll get both at the same time.)
C. Once you get the sources be sure to put them in a path without a
B. Once you get the sources be sure to put them in a path without a
space in it (i.e., NOT c:\Program Files\wx) and set an environment
variable named WXWIN to this directory. For example:
variable named WXWIN to the top level directory. For example:
mkdir \wx2
cd \wx2
unzip wxMSW-2.2.2.zip
set WXWIN=c:\wx2
set WXWIN=c:\wx\wxPythonSrc-2.4.0.4
You'll probably want to add that last line to your autoexec.bat or
You'll probably want to add that line to your autoexec.bat or
System Properties depending on the type of system you are on.
D. Change to the wx2\include\wx\msw directory and copy setup0.h to
C. Change to the %WXWIN%\include\wx\msw directory and copy setup0.h to
setup.h and then edit setup.h. This is how you control which parts
of wxWindows are compiled into or left out of the build, simply by
turning options on or off. I have the following differences from
the default setup0.h in my setup.h, but you can experiment with
other settings if you like:
WXWIN_COMPATIBILITY_2_2 0
wxDIALOG_UNIT_COMPATIBILITY 0
wxUSE_DEBUG_CONTEXT 1
wxUSE_MEMORY_TRACING 1
wxUSE_CMDLINE_PARSER 0
wxUSE_FSVOLUME 0
@@ -134,6 +138,7 @@ A. Although MSVC project files are provided I always use the makefiles
Python, (and I make sure they stay that way.) You would have to
edit the project files a bit to make it work otherwise.
B. There are three different types of wxWindows DLLs that can be
produced by the VC makefile simply by providing a flag on the nmake
command-line, I call the three types DEBUG, FINAL, and HYBRID.
@@ -157,43 +162,41 @@ B. There are three different types of wxWindows DLLs that can be
wxmsw[version].dll. This DLL is compiled with optimizations
turned on and without debugging information and without
__WXDEBUG__. The /MD flag is used which means that you
can use this version with the standard python.exe. This
is the version that I use when making the binary installer
for win32.
can use this version with the standard python.exe.
HYBRID Specified with "FINAL=hybrid" and produces a DLL named
wxmsw[version]h.dll. This DLL is almost the same as the
DEBUG version except the /MD flag is used which means that
you can use the standard python.exe but you still get the
debugging info and the __WXDEBUG__ code enabled. With the
debugger you can trace through the the code for the
wxPython extension and the wxWindows DLL, but not the
Python interpreter. You might use this version when you
want to deploy a wxPython app with the __WXDEBUG__ code
enabled. I use this mode most of the time during
development simply because it's easier than having to
remember to type python_d all the time.
FINAL version except the __WXDEBUG__ is used which means
that you will get extra runtime assertions and validations
from wxWindows. If any of these fail then they are turned
into a Python exception that you can catch and deal with
in your code. This is the version that I use when making
the binary installer for win32.
Since different DLL names and object file directories are used you
can build all three types if you like.
C. Change to the wx2\src\msw directory and type the following command,
C. Change to the %WXWIN%\src\msw directory and type the following command,
using the value for FINAL that you want:
nmake -f makefile.vc dll pch FINAL=hybrid
nmake -f makefile.vc dll FINAL=hybrid
Your machine will then crunch away for possibly a long time,
depending on your hardware, and when it's done you should have a
DLL and some library files in \wx2\lib.
DLL and some library files in %WXWIN%\lib.
D. You'll either need to add \wx2\lib to the PATH or copy the DLL file
to a directory already on the PATH so the DLL can be found at
D. You'll either need to add %WXWIN%\lib to the PATH or copy the DLL
file to a directory already on the PATH so the DLL can be found at
runtime. Another option is to copy the DLL to the directory that
the wxPython pacakge is installed to, for example,
c:\Python22\lib\site-packages\wxPython.
E. You can test your build by changing to one of the directories under
\wx2\samples or \wx2\demos and typing (using the right FINAL flag):
%WXWIN%\samples or %WXWIN\demos and typing (using the right FINAL flag):
nmake -f makefile.vc FINAL=hybrid WXUSINGDLL=1
@@ -201,20 +204,8 @@ E. You can test your build by changing to one of the directories under
3. Get the wxPython sources
---------------------------
A. You have the same options (and same advantages/disadvantages) for
getting the wxPython source, either a released snapshot or from
CVS. The released version file is named wxPython-[version].tar.gz
and is available at http://wxpython.org/download.php. You can use
WinZip to unpack it if you don't have tar and gzip. If you want to
use CVS you'll find wxPython in the wxWindows CVS tree (see above)
in the wxWindows/wxPython directory.
4. Build and Install wxPython
3. Build and Install wxPython
-----------------------------
A. As mentioned previouslly, wxPython is built with the standard
@@ -222,6 +213,7 @@ A. As mentioned previouslly, wxPython is built with the standard
are all set, otherwise you need to download and install Distutils
1.0 from http://www.python.org/sigs/distutils-sig/.
B. Change to the root wxPython directory and look at the setup.py
file. This is the script that configures and defines all the
information that Distutils needs to build wxPython. There are some
@@ -246,18 +238,7 @@ B. Change to the root wxPython directory and look at the setup.py
will be executed to regenerate the wrapper C++
and shadow python files.
IN_CVS_TREE If you are using the CVS version of the
wxWindows and wxPython sources then you will
need to set this flag to non-zero. This is
needed because some source files from the
wxWindows tree are copied to be under the
wxPython tree in order to keep Distutils happy.
With this flag set then setup.py will
automatically keep these copied sources up to
date if the original version is ever updated.
If you are using the tar.gz version of the
Python sources then these copied sources are
already present in your source tree.
etc.
C. To build and install wxPython you simply need to execute the
@@ -280,12 +261,20 @@ C. To build and install wxPython you simply need to execute the
commented out. Just search for "GX-" and uncomment it so it is put
into the cflags list.
If you would like to install to someplace besides the Python
site-packages directory (such as to your home directory) then you
can add "--root=<path>" after the "install" command. To use
wxPython like this you'll need to ensure that the directory
containing wxPyrthon is contained in in the PYTHONPATH environment
variable.
D. At this point you should be able to change into the wxPython\demo
directory and run the demo:
python demo.py
E. If you would like to make a test build that doesn't overwrite the
installed version of wxPython you can do so with one of these
commands instead of the install command above:
@@ -301,8 +290,8 @@ E. If you would like to make a test build that doesn't overwrite the
To run using this test version just add the base wxPython source
directory to the PYTHONPATH:
set PYTHONPATH=c:\wx2\wxPython
cd c:\wx2\wxPython\demo
set PYTHONPATH=%WXDIR%\wxPython
cd %WXDIR%\wxPython\demo
python demo.py

View File

@@ -2,8 +2,239 @@ CHANGES.txt for wxPython
----------------------------------------------------------------------
2.3.3
-----
?????
-------
Added wxScrolledPanel from Wil Sadkin
2.4.0.7
-------
Gave up on generating a warning upon the use of the old true/false or
TRUE/FALSE values.
Fixed wxGenericTreeCtrl (used on wxGTK and wxMac for wxTreeCtrl) so
that it can successfully handle lots of nodes instead of overflowing
when the virtual height of the widget overflowed a 16-bit value.
Fixed the typemap that converts strings to wxColours to also accept
unicode.
Fixed problem where the wrong class name could sometimes be used for
OOR.
Fixed an interpreter lock problem in the __eq__ and __ne__ methods in
wxSize and etc.
Updated PyCrust to version 0.9
Instead of always logging C++ assertions, added wxPYAPP_ASSERT_LOG
flag to turn it on. In most cases turning it into an exception (the
default behavior) is enough. See below in the 2.3.4.1 notes for more
details.
2.4.0.6 (a.k.a. the I'm so stupid release)
-------
The new deprecation class for the old true/false symbols can now be
returned from OnInit. And I promise to be sure I am testing what I
think I am testing in the future...
2.4.0.5 (a.k.a. the blame it on Kevin release)
-------
A few little but annoying bug fixes.
Updated pycolourchooser.
Updated to 0.9b of PyCrust.
2.4.0.4
-------
Added missing wxRect methods
Add OOR support for wxApp objects too.
Added wxCursorFromImage, which works on wxMSW and wxGTK so far.
All platforms now send EVT_DESTROY_WINDOW. Be warned that at the time
the event is sent the window is in the process of being deconstructed,
and so calling some (most?) methods of the window itself may cause
problems.
Fixed SF Bug #689481, a method in the OGL wrappers was using the wrong
return type.
Fixed SF Bug #689958, an endless loop in printout.py.
Added EVT_WINDOW_CREATE_ID and EVT_WINDOW_DESTROY_ID so these events
can be associated with a specific window ID and more easily caught by
the parent window.
Fixed copy-paste error in wxListCtrl.GetFirstSelected.
Added missing Init method (and an overloading wrapper) to wxLocale
wrapper.
Added a wxBitmap.SetMaskColour convenience method.
Changed how the dynamic event tables (used for all Python wx classes,
C++ wx classes typically use static event tables) are searched such
that they behave from a Python perspective more like the static tables
in C++. Namely that if there are identical event bindings in a base
Python class and a derived Python class that the one in the derived
class will be found first and that if Skip is called that the one in
the base class will still be found instead of skipping directly to the
static stable in the C++ class.
Switched to using True/False in the wxPython lib and demo instead of
true/false or TRUE/FALSE to prepare for the new boolean type and
constants being added to Python. Added code to wx.py to test for the
existence of the new constants and to create suitable values if not
present.
Added some static wxApp functions that help with integration with the
Mac UI. They are no-ops on other platforms so it doesn't hurt to
always call them. The functions are:
wxApp_GetMacDefaultEncodingIsPC
wxApp_GetMacSupportPCMenuShortcuts
wxApp_GetMacAboutMenuItemId
wxApp_GetMacPreferencesMenuItemId
wxApp_GetMacExitMenuItemId
wxApp_GetMacHelpMenuTitleName
wxApp_SetMacDefaultEncodingIsPC
wxApp_SetMacSupportPCMenuShortcuts
wxApp_SetMacAboutMenuItemId
wxApp_SetMacPreferencesMenuItemId
wxApp_SetMacExitMenuItemId
wxApp_SetMacHelpMenuTitleName
Refactored, enhanced and added capabilities for the DrawXXXList
functions, inspired by code from Chris Barker.
The wxWindows .mo language catalog files are now installed in a
subdirectory of the wxPython package dir on MSW since that platform
doesn't have a standard place for them.
Added missing deselect methods for wxGrid.
Fixed typemaps for wxGridCellCoordsArray.
Updated to the 0.9a version of PyCrust
2.4.0.2
-------
Several bug fixes.
Added wxIntCtrl from Will Sadkin.
Added wxPyColourChooser by Michael Gilfix.
2.4.0.1
-------
No major new features since 2.3.4.2, mostly bug fixes and minor
enhancements.
Added function wrappers for the common dialogs from Kevin Altis. See
wxPython/lib/dialogs.py for more details.
2.3.4.2
-------
Various bug fixes.
2.3.4.1
-------
Updated XRCed and wxTimeCtrl contribs.
Show a couple new wxGrid features in the demo.
Several bug fixes in wxWindows.
Added wxHtmlFilter.
wxASSERT and related C++ runtime diagnostics are now converted to
Python exceptions. When an assert happens a wxPyAssertionError
(which derives from AssertionError) exception is created and when
control returns back to the Python code that invoked the C++ API it
will be raised. The same exception restrictions are in place as
before, namely that exceptions can't cross from one Python layer
through C++ to another Python layer. That simply means that if you
want to catch wxPyAssertionError or any other exception that you need
to do it before control returns to C++ at the end of your event
handler or callback code. There is some test code in demo/wxButton.py
you can use to play with this new feature.
Added some methods to wxApp (SetAssertMode and GetAssertMode) that let
you control how C++ assertions are processed. Valid modes are:
wxPYAPP_ASSERT_SUPPRESS, wxPYAPP_ASSERT_EXCEPTION, and
wxPYAPP_ASSERT_DIALOG. Using _SUPPRESS will give you behavior like
the old "final" builds and the assert will be ignored, _EXCEPTION is
the new default described above, and _DIALOG is like the default in
2.3.3.1 and prior "hybrid" builds. You can also combine _EXCEPTION
and _DIALOG if you wish, although I don't know why you would.
You can now overload OnInitGui, OnExit and OnAssert in your classes
derived from wxApp.
Added GetSelectedCells, GetSelectionBlockTopLeft,
GetSelectionBlockBottomRight, GetSelectedRows, GetSelectedCols nethods
to wxGrid.
Added Python == and != operators for some basic classes
Fixed the Python wrappers for wxInputStream so they no longer block
when reading from a wxProcess on wxGTK. They now work more or less as
they did before 2.3.3.1 but the dual meaning of eof() has been
removed. There is now a CanRead() method that lets you know if there
is data waiting to be read from the pipe.
Fixed method name clash in wxIEHtmlWin, renamed Refresh to RefreshPage.
Added Throbber from Cliff Wells to the library and the demo.
Windows installer prompts to uninstall old version first.
Added wxPython.lib.evtmgr by Robb Shecter, which is an easier, more
"Pythonic" and more OO method of registering handlers for wxWindows
events using the Publish/Subscribe pattern.
Added wxPython.lib.popupctl by Gerrit van Dyk which is a combobox-like
gizmo for poping up arbitrary controls. It is currently using
wxDialog because of some issues with wxPopupWindow...
Added wxPython.lib.gridmovers by Gerrit van Dyk which facilitates the
dragging of columns and/or rows in a wxGrid.
Added wxPython.lib.multisash by Gerrit van Dyk which is a nice
implementation of allowing the user to split a window any number of
times either horizontally or vertically, and to close the split off
windows when desired.
Added helpviewer tool that displays HTML books similarly to how MS
HTMLHelp viewer does. Changed how the wxPythonDocs tarball is built
and added a script to launch the doc viewer.
2.3.3.1
-------
Added wxSplashScreen.
Added wxGenericDirCtrl.
@@ -174,6 +405,9 @@ Added wxXmlResourceHandler which allows you to create custom handlers
for nonstandard class types in XRC resources. See the demo for an
example.
Added wxPython.lib.mixins.rubberband module from Robb Shecter.
Added wxTimeCtrl from Will Sadkin.
@@ -205,8 +439,8 @@ Added XRCed to the wxPython Tools directory, contributed by Roman
Rolinsky.
Added a new "constructor" to most of the window classes that calls the
default C++ contructor, (the one with no parameters) and also added the
coresponding Create(...) method. This allows you to do a 2-step
default C++ constructor, (the one with no parameters) and also added the
corresponding Create(...) method. This allows you to do a 2-step
creation of windows which is sometimes required for doing things such
as setting extended style flags before the window is created, or for
passing the object to the XRC resource system to be created from the
@@ -742,7 +976,7 @@ methods look like this:
toggle=FALSE)
There are also coresponding InsertTool and InsertSimpleTool methods
There are also corresponding InsertTool and InsertSimpleTool methods
that additionally take an integer position as the first parameter.
Added a wrapper for the new PCX and TIFF ImageHandlers.

View File

@@ -44,11 +44,6 @@ include samples/doodle/*.txt
include samples/doodle/*.py
include samples/doodle/*.iss
include samples/doodle/sample.ddl
include samples/stxview/*.txt
include samples/stxview/*.py
include samples/stxview/*.stx
include samples/stxview/StructuredText/*.py
include samples/stxview/StructuredText/*.txt
include samples/wxProject/*.txt
include samples/wxProject/*.py
include samples/StyleEditor/*.py

View File

@@ -3,58 +3,34 @@ wxPython README
Welcome to the wonderful world of wxPython!
Once you have installed the wxPython extension module, you can try it
out by going to the [install dir]\wxPython\demo directory and typing:
So where do you go from here? The best thing to do is to run the demo
and use its source code to help you learn how to use wxPython. Most
of the classes available are demonstrated there, and you can view the
sources directly in the demo so it is designed to help you learn. If
you are on Windows or OS X then you can run the demo just by double
clicking it's icon. If you are on Linux/Unix then change to the
directory containing the demo and type:
python demo.py
There are also some other sample files there for you to play with and
learn from.
There are also some sample mini applications available for you to run
and to play with as a learning exercise.
If you selected to install the documentation then point your browser
to [install dir]\wxPython\docs\index.htm and you will then be looking
at the docs for wxWindows. For the most part you can use the C++ docs
as most classes and methods are used identically. Where there are
differences they are documented with a "wxPython Note."
The next thing you should do is join the wxPython-users maillist where
you can interact with a community of other users and developers who
are willing to help you learn, answer questions and solve problems.
To join the mail list just send an email message to the following
address from the account you want to receive the mail messages from
the list:
On Win32 systems the binary self-installer creates a program group on
the Start Menu that contains a link to running the demo and a link to
the help file. To help you save disk space I'm now using Microsoft's
HTML Help format. If your system doesn't know what to do with the help
file, you can install the HTML Help Viewer as part of IE 4+, NT
Service Pack 4+, or the HTML Workshop at
wxPython-users-subscribe@lists.wxwindows.org
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hwMicrosoftHTMLHelpDownloads.asp
For some features, the latest common controls library from microsoft
is required. You can get this by installing IE 5.0 or Office 2000.
You can also get it independently from here:
http://download.microsoft.com/download/platformsdk/Comctl32/5.80.2614.3600/W9XNT4/EN-US/50comupd.exe
Windows 95 users may also need the WinSock 2.0 and OpenGL libraries.
These can be found at these sites:
http://www.microsoft.com/windows95/downloads/contents/wuadmintools/s_wunetworkingtools/w95sockets2/default.asp
http://www.opengl.org/Downloads/Downloads.html
Getting Help
------------
Since wxPython is a blending of multiple technologies, help comes from
multiple sources. See the http://wxPython.org/ for details on various
sources of help, but probably the best source is the wxPython-users
mail list. You can view the archive or subscribe by going to
http://lists.wxwindows.org/mailman/listinfo/wxpython-users
Or you can send mail directly to the list using this address:
wxpython-users@lists.wxwindows.org
There is also a good set of class reference documentation available
for wxPython, but currently it is geared for the C++ user. This may
be a little daunting at first, but with a little practice you'll
easily be able to "translate" from the C++ shown there to Python. Not
all classes documented are available in Python, but most of the GUI
related classes are.
Other Info
@@ -62,17 +38,21 @@ Other Info
Please also see the following files in this directory:
CHANGES.txt Information about new features, fixes, etc. in
each release.
CHANGES.txt Information about new features, fixes,
etc. in each release.
BUILD.unix.txt Instructions for building wxPython on various
Unix-like platforms.
../README.1st.txt Instructions for building wxGTK and
wxPython on Unix-like platforms the
"new way."
BUILD.win32.txt Instructions for building wxPython on Windows.
BUILD.unix.txt Instructions for building wxPython on
various Unix-like platforms the "old way."
BUILD.osx.txt Instructions for building wxPython on Mac OS X.
BUILD.win32.txt Instructions for building wxPython on Windows.
licence/* Text of the wxWindows license.
BUILD.osx.txt Instructions for building wxPython on Mac OS X.
licence/* Text of the wxWindows license.

View File

@@ -9,6 +9,8 @@ function getpyver {
PYVER=2.1
elif [ "$1" = "22" ]; then
PYVER=2.2
elif [ "$1" = "23" ]; then
PYVER=2.3
else
echo You must specify Python version as first parameter.
exit
@@ -30,7 +32,7 @@ OTHERFLAGS=""
# "c" --> clean
if [ "$1" = "c" ]; then
shift
CMD="$SETUP $FLAGS $OTHERFLAGS clean"
CMD="$SETUP $FLAGS $OTHERFLAGS clean $*"
OTHERCMD="rm -f wxPython/*.so"
# "d" --> clean extension modules only
@@ -47,12 +49,12 @@ elif [ "$1" = "t" ]; then
# "i" --> install
elif [ "$1" = "i" ]; then
shift
CMD="$SETUP $FLAGS $OTHERFLAGS install"
CMD="$SETUP $FLAGS $OTHERFLAGS build_ext install $*"
# "s" --> source dist
elif [ "$1" = "s" ]; then
shift
CMD="$SETUP $OTHERFLAGS sdist"
CMD="$SETUP $OTHERFLAGS sdist $*"
# "r" --> rpm dist
elif [ "$1" = "r" ]; then

View File

@@ -8,7 +8,7 @@ set FLAGS=USE_SWIG=1 IN_CVS_TREE=1
rem Use non-default python?
iff "%1" == "15" .or. "%1" == "20" .or. "%1" == "21" .or. "%1" == "22" then
iff "%1" == "15" .or. "%1" == "20" .or. "%1" == "21" .or. "%1" == "22" .or. "%1" == "23" then
set VER=%1
set PYTHON=%TOOLS%\python%1%\python.exe
shift
@@ -71,29 +71,26 @@ elseiff "%1" == "a" then
shift
set CMD=echo Finished!
call b.bat 15 c
call b.bat 15 f
cd demo
p15 encode_bitmaps.py
cd -
call b.bat 15 r
call b.bat 15 c
call b.bat 15 h
call b.bat 15 r
call b.bat 21 c
call b.bat 21 f
call b.bat 21 r
call b.bat 21 c
call b.bat 21 d
call b.bat 21 h
call b.bat 21 r
call b.bat 21 d UNICODE=1
call b.bat 21 h UNICODE=1
call b.bat 21 r UNICODE=1
call b.bat 22 c
call b.bat 22 f
call b.bat 22 r
call b.bat 22 c
call b.bat 22 d
call b.bat 22 h
call b.bat 22 r
call b.bat 22 d UNICODE=1
call b.bat 22 h UNICODE=1
call b.bat 22 r UNICODE=1
call b.bat 23 d
call b.bat 23 h
call b.bat 23 r
call b.bat 23 d UNICODE=1
call b.bat 23 h UNICODE=1
call b.bat 23 r UNICODE=1
rem "b" --> both debug and hybrid builds

View File

@@ -19,6 +19,8 @@
/* Implementation : PYTHON */
#define SWIGPYTHON
#include "Python.h"
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
@@ -36,12 +38,9 @@
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
@@ -110,8 +109,8 @@ public:
wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc);
PyObject* idobj = wxPyConstructObject((void*)&id, "wxTreeItemId", FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, "wxRect", FALSE);
PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), FALSE);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
Py_DECREF(dcobj);
Py_DECREF(idobj);
@@ -659,11 +658,10 @@ static PyObject *_wrap_wxEditableListBox_SetStrings(PyObject *self, PyObject *ar
PyObject* item = PySequence_GetItem(_obj1, i);
#if wxUSE_UNICODE
PyObject* str = PyObject_Unicode(item);
_arg1->Add(PyUnicode_AsUnicode(str));
#else
PyObject* str = PyObject_Str(item);
_arg1->Add(PyString_AsString(str));
#endif
_arg1->Add(Py2wxString(str));
Py_DECREF(item);
Py_DECREF(str);
}
@@ -1790,7 +1788,7 @@ static PyObject *_wrap_wxLEDNumberCtrl_GetValue(PyObject *self, PyObject *args,
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif

View File

@@ -272,8 +272,8 @@ public:
wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc);
PyObject* idobj = wxPyConstructObject((void*)&id, "wxTreeItemId", FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, "wxRect", FALSE);
PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), FALSE);
PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), FALSE);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
Py_DECREF(dcobj);
Py_DECREF(idobj);

View File

@@ -69,7 +69,7 @@ public:
~wxGLContext();
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxString& colour);
void SwapBuffers();
#ifdef __WXGTK__
@@ -151,7 +151,7 @@ public:
%pragma(python) addtomethod = "wxGLCanvasWithContext:val._setOORInfo(self)"
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxString& colour);
void SwapBuffers();
wxGLContext* GetContext();

View File

@@ -27,15 +27,17 @@
#if wxUSE_GLCANVAS
#ifndef WX_PRECOMP
#include <wx/frame.h>
#include "wx/frame.h"
#include "wx/settings.h"
#include "wx/intl.h"
#include "wx/log.h"
#endif
#include <wx/msw/private.h>
#include <wx/settings.h>
#include <wx/log.h>
#include "wx/msw/private.h"
#include "myglcanvas.h"
const wxChar* wxGLCanvasName = wxT("GLcanvas");
static const wxChar *wxGLCanvasClassName = wxT("wxGLCanvasClass");
static const wxChar *wxGLCanvasClassNameNoRedraw = wxT("wxGLCanvasClassNR");
@@ -108,7 +110,7 @@ void wxGLContext::SetCurrent()
*/
}
void wxGLContext::SetColour(const char *colour)
void wxGLContext::SetColour(const wxChar *colour)
{
float r = 0.0;
float g = 0.0;
@@ -403,7 +405,6 @@ static void AdjustPFDForAttributes(PIXELFORMATDESCRIPTOR& pfd, int *attribList)
void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
{
int pixelFormat;
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), /* size */
1, /* version */
@@ -427,13 +428,13 @@ void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
AdjustPFDForAttributes(pfd, attribList);
pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
int pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
if (pixelFormat == 0) {
wxLogWarning(_("ChoosePixelFormat failed."));
wxLogLastError(_T("ChoosePixelFormat"));
}
else {
if (SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) != TRUE) {
wxLogWarning(_("SetPixelFormat failed."));
if ( !::SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) ) {
wxLogLastError(_T("SetPixelFormat"));
}
}
}
@@ -527,7 +528,7 @@ void wxGLCanvas::SetCurrent()
}
}
void wxGLCanvas::SetColour(const char *colour)
void wxGLCanvas::SetColour(const wxChar *colour)
{
if (m_glContext)
m_glContext->SetColour(colour);
@@ -728,7 +729,7 @@ bool wxGLApp::InitGLVisual(int *attribList)
AdjustPFDForAttributes(pfd, attribList);
// use DC for whole (root) screen, since no windows have yet been created
pixelFormat = ChoosePixelFormat((HDC) ::GetDC(NULL), &pfd);
pixelFormat = ChoosePixelFormat(ScreenHDC(), &pfd);
if (pixelFormat == 0) {
wxLogError(_("Failed to initialize OpenGL"));

View File

@@ -24,6 +24,7 @@
#include <wx/scrolwin.h>
#include <windows.h>
#include "wx/msw/winundef.h"
#include <GL/gl.h>
@@ -69,7 +70,7 @@ public:
~wxGLContext();
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxChar *colour);
void SwapBuffers();
@@ -83,21 +84,26 @@ public:
wxWindow* m_window;
};
extern const wxChar* wxGLCanvasName;
class wxGLCanvas: public wxWindow
{
DECLARE_CLASS(wxGLCanvas)
public:
wxGLCanvas(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette);
const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette);
wxGLCanvas( wxWindow *parent, const wxGLContext *shared = (wxGLContext *)NULL,
wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "GLCanvas",
const wxSize& size = wxDefaultSize, long style = 0, const wxString&
name = wxGLCanvasName,
int *attribList = (int*) NULL, const wxPalette& palette = wxNullPalette );
wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared = (wxGLCanvas *)NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = "GLCanvas", int *attribList = 0, const wxPalette& palette = wxNullPalette );
const wxString& name = wxGLCanvasName, int *attribList = 0, const wxPalette& palette = wxNullPalette );
~wxGLCanvas();
@@ -106,7 +112,7 @@ class wxGLCanvas: public wxWindow
const wxPoint& pos, const wxSize& size, long style, const wxString& name);
void SetCurrent();
void SetColour(const char *colour);
void SetColour(const wxChar *colour);
void SwapBuffers();
void OnSize(wxSizeEvent& event);

View File

@@ -37,23 +37,23 @@ private:
public:
FS_DWebBrowserEvents2(wxIEHtmlWin *iewin) : m_iewin(iewin) {}
virtual ~FS_DWebBrowserEvents2()
virtual ~FS_DWebBrowserEvents2()
{
}
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
{
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
{
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
{
{
return E_NOTIMPL;
};
@@ -72,7 +72,7 @@ public:
m_iewin->GetParent()->AddPendingEvent(event);
};
bool Process(WXTYPE etype, wxString text = "", long l1 = 0, long l2 = 0)
bool Process(WXTYPE etype, wxString text = wxEmptyString, long l1 = 0, long l2 = 0)
{
if (! m_iewin || ! m_iewin->GetParent())
return true;
@@ -103,7 +103,7 @@ public:
return v.bstrVal;
}
else
return "";
return wxEmptyString;
};
#define STR_ARG(arg) GetStrArg(pDispParams->rgvarg[arg])
@@ -116,7 +116,7 @@ public:
WORD wFlags, DISPPARAMS * pDispParams,
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
unsigned int * puArgErr)
{
{
if (wFlags & DISPATCH_PROPERTYGET)
return E_NOTIMPL;
@@ -125,21 +125,21 @@ public:
case DISPID_BEFORENAVIGATE2:
if (Process(wxEVT_COMMAND_MSHTML_BEFORENAVIGATE2, STR_ARG(5)))
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
else
else
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
break;
case DISPID_NEWWINDOW2:
if (Process(wxEVT_COMMAND_MSHTML_NEWWINDOW2))
*pDispParams->rgvarg->pboolVal = VARIANT_FALSE;
else
else
*pDispParams->rgvarg->pboolVal = VARIANT_TRUE;
break;
case DISPID_PROGRESSCHANGE:
Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, "", LONG_ARG(1), LONG_ARG(0));
Post(wxEVT_COMMAND_MSHTML_PROGRESSCHANGE, wxEmptyString, LONG_ARG(1), LONG_ARG(0));
break;
case DISPID_DOCUMENTCOMPLETE:
Post(wxEVT_COMMAND_MSHTML_DOCUMENTCOMPLETE, STR_ARG(0));
break;
@@ -183,7 +183,7 @@ wxIEHtmlWin::wxIEHtmlWin(wxWindow * parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name) :
const wxString& name) :
wxActiveX(parent, PROGID, id, pos, size, style, name)
{
SetupBrowser();
@@ -287,12 +287,12 @@ private:
istream *m_is;
public:
IStreamAdaptor(istream *is) : IStreamAdaptorBase(), m_is(is)
IStreamAdaptor(istream *is) : IStreamAdaptorBase(), m_is(is)
{
wxASSERT(m_is != NULL);
}
~IStreamAdaptor()
~IStreamAdaptor()
{
delete m_is;
}
@@ -314,12 +314,12 @@ private:
wxInputStream *m_is;
public:
IwxStreamAdaptor(wxInputStream *is) : IStreamAdaptorBase(), m_is(is)
IwxStreamAdaptor(wxInputStream *is) : IStreamAdaptorBase(), m_is(is)
{
wxASSERT(m_is != NULL);
}
~IwxStreamAdaptor()
~IwxStreamAdaptor()
{
delete m_is;
}
@@ -338,7 +338,7 @@ public:
void wxIEHtmlWin::LoadUrl(const wxString& url)
{
VARIANTARG navFlag, targetFrame, postData, headers;
navFlag.vt = VT_EMPTY;
navFlag.vt = VT_EMPTY;
navFlag.vt = VT_I2;
navFlag.iVal = navNoReadFromCache;
targetFrame.vt = VT_EMPTY;
@@ -346,8 +346,8 @@ void wxIEHtmlWin::LoadUrl(const wxString& url)
headers.vt = VT_EMPTY;
HRESULT hret = 0;
hret = m_webBrowser->Navigate((BSTR) (const wchar_t *) url.wc_str(wxConvUTF8),
&navFlag, &targetFrame, &postData, &headers);
hret = m_webBrowser->Navigate((BSTR) (const wchar_t *) url.wc_str(wxConvUTF8),
&navFlag, &targetFrame, &postData, &headers);
};
class wxOwnedMemInputStream : public wxMemoryInputStream
@@ -358,7 +358,7 @@ public:
wxOwnedMemInputStream(char *data, size_t len) :
wxMemoryInputStream(data, len), m_data(data)
{}
~wxOwnedMemInputStream()
~wxOwnedMemInputStream()
{
free(m_data);
}
@@ -524,17 +524,17 @@ wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
{
wxAutoOleInterface<IHTMLTxtRange> tr(GetSelRange(m_oleObject));
if (! tr)
return "";
return wxEmptyString;
BSTR text = NULL;
HRESULT hr = E_FAIL;
if (asHTML)
hr = tr->get_htmlText(&text);
else
hr = tr->get_text(&text);
if (hr != S_OK)
return "";
return wxEmptyString;
wxString s = text;
SysFreeString(text);
@@ -545,41 +545,41 @@ wxString wxIEHtmlWin::GetStringSelection(bool asHTML)
wxString wxIEHtmlWin::GetText(bool asHTML)
{
if (! m_webBrowser.Ok())
return "";
return wxEmptyString;
// get document dispatch interface
IDispatch *iDisp = NULL;
HRESULT hr = m_webBrowser->get_Document(&iDisp);
if (hr != S_OK)
return "";
return wxEmptyString;
// Query for Document Interface
wxAutoOleInterface<IHTMLDocument2> hd(IID_IHTMLDocument2, iDisp);
iDisp->Release();
if (! hd.Ok())
return "";
return wxEmptyString;
// get body element
IHTMLElement *_body = NULL;
hd->get_body(&_body);
if (! _body)
return "";
return wxEmptyString;
wxAutoOleInterface<IHTMLElement> body(_body);
// get inner text
BSTR text = NULL;
hr = E_FAIL;
if (asHTML)
hr = body->get_innerHTML(&text);
else
hr = body->get_innerText(&text);
if (hr != S_OK)
return "";
return wxEmptyString;
wxString s = text;
SysFreeString(text);
return s;
};
return s;
};

View File

@@ -19,6 +19,8 @@
/* Implementation : PYTHON */
#define SWIGPYTHON
#include "Python.h"
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
@@ -36,12 +38,9 @@
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
@@ -177,7 +176,7 @@ static PyObject *_wrap_wxMSHTMLEvent_GetText1(PyObject *self, PyObject *args, Py
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -589,7 +588,7 @@ static PyObject *_wrap_wxIEHtmlWin_GetStringSelection(PyObject *self, PyObject *
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -629,7 +628,7 @@ static PyObject *_wrap_wxIEHtmlWin_GetText(PyObject *self, PyObject *args, PyObj
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -752,8 +751,8 @@ static PyObject *_wrap_wxIEHtmlWin_GoSearch(PyObject *self, PyObject *args, PyOb
return _resultobj;
}
#define wxIEHtmlWin_Refresh(_swigobj,_swigarg0) (_swigobj->Refresh(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_Refresh(PyObject *self, PyObject *args, PyObject *kwargs) {
#define wxIEHtmlWin_RefreshPage(_swigobj,_swigarg0) (_swigobj->Refresh(_swigarg0))
static PyObject *_wrap_wxIEHtmlWin_RefreshPage(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxIEHtmlWin * _arg0;
@@ -762,18 +761,18 @@ static PyObject *_wrap_wxIEHtmlWin_Refresh(PyObject *self, PyObject *args, PyObj
char *_kwnames[] = { "self","level", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxIEHtmlWin_Refresh",_kwnames,&_argo0,&_arg1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxIEHtmlWin_RefreshPage",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxIEHtmlWin_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_Refresh. Expected _wxIEHtmlWin_p.");
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxIEHtmlWin_RefreshPage. Expected _wxIEHtmlWin_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxIEHtmlWin_Refresh(_arg0,_arg1);
_result = (bool )wxIEHtmlWin_RefreshPage(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
@@ -811,7 +810,7 @@ static PyObject *_wrap_wxIEHtmlWin_Stop(PyObject *self, PyObject *args, PyObject
static PyMethodDef iewincMethods[] = {
{ "wxIEHtmlWin_Stop", (PyCFunction) _wrap_wxIEHtmlWin_Stop, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_Refresh", (PyCFunction) _wrap_wxIEHtmlWin_Refresh, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_RefreshPage", (PyCFunction) _wrap_wxIEHtmlWin_RefreshPage, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GoSearch", (PyCFunction) _wrap_wxIEHtmlWin_GoSearch, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GoHome", (PyCFunction) _wrap_wxIEHtmlWin_GoHome, METH_VARARGS | METH_KEYWORDS },
{ "wxIEHtmlWin_GoForward", (PyCFunction) _wrap_wxIEHtmlWin_GoForward, METH_VARARGS | METH_KEYWORDS },

View File

@@ -117,7 +117,7 @@ public:
bool GoForward();
bool GoHome();
bool GoSearch();
bool Refresh(wxIEHtmlRefreshLevel level);
%name(RefreshPage)bool Refresh(wxIEHtmlRefreshLevel level);
bool Stop();
};

View File

@@ -125,8 +125,8 @@ class wxIEHtmlWinPtr(wxWindowPtr):
def GoSearch(self, *_args, **_kwargs):
val = apply(iewinc.wxIEHtmlWin_GoSearch,(self,) + _args, _kwargs)
return val
def Refresh(self, *_args, **_kwargs):
val = apply(iewinc.wxIEHtmlWin_Refresh,(self,) + _args, _kwargs)
def RefreshPage(self, *_args, **_kwargs):
val = apply(iewinc.wxIEHtmlWin_RefreshPage,(self,) + _args, _kwargs)
return val
def Stop(self, *_args, **_kwargs):
val = apply(iewinc.wxIEHtmlWin_Stop,(self,) + _args, _kwargs)

View File

@@ -33,7 +33,7 @@ END_EVENT_TABLE()
class wxActiveX;
class FrameSite :
class FrameSite :
public IOleClientSite,
public IOleInPlaceSiteEx,
public IOleInPlaceFrame,
@@ -60,7 +60,7 @@ public:
STDMETHODIMP RequestBorderSpace(LPCBORDERWIDTHS);
STDMETHODIMP SetBorderSpace(LPCBORDERWIDTHS);
STDMETHODIMP SetActiveObject(IOleInPlaceActiveObject*, LPCOLESTR);
//IOleInPlaceFrame
STDMETHODIMP InsertMenus(HMENU, LPOLEMENUGROUPWIDTHS);
STDMETHODIMP SetMenu(HMENU, HOLEMENU, HWND);
@@ -73,7 +73,7 @@ public:
STDMETHODIMP CanInPlaceActivate();
STDMETHODIMP OnInPlaceActivate();
STDMETHODIMP OnUIActivate();
STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**,
STDMETHODIMP GetWindowContext(IOleInPlaceFrame**, IOleInPlaceUIWindow**,
LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO);
STDMETHODIMP Scroll(SIZE);
STDMETHODIMP OnUIDeactivate(BOOL);
@@ -119,7 +119,7 @@ public:
STDMETHODIMP GetObject(LPOLESTR, DWORD, IBindCtx*, REFIID, void**);
STDMETHODIMP GetObjectStorage(LPOLESTR, IBindCtx*, REFIID, void**);
STDMETHODIMP IsRunning(LPOLESTR);
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR**, unsigned int, LCID, DISPID*);
STDMETHODIMP GetTypeInfo(unsigned int, LCID, ITypeInfo**);
@@ -148,7 +148,7 @@ protected:
bool m_bInPlaceActive;
bool m_bUIActive;
bool m_bWindowless;
LCID m_nAmbientLocale;
@@ -225,14 +225,14 @@ wxActiveX::~wxActiveX()
};
m_connections.clear();
if (m_oleInPlaceObject.Ok())
if (m_oleInPlaceObject.Ok())
{
m_oleInPlaceObject->InPlaceDeactivate();
m_oleInPlaceObject->UIDeactivate();
}
if (m_oleObject.Ok())
if (m_oleObject.Ok())
{
if (m_docAdviseCookie != 0)
m_oleObject->Unadvise(m_docAdviseCookie);
@@ -268,11 +268,11 @@ void wxActiveX::CreateActiveX(REFCLSID clsid)
GetTypeInfo();
// Get IOleObject interface
hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX);
hret = m_oleObject.QueryInterface(IID_IOleObject, m_ActiveX);
wxASSERT(SUCCEEDED(hret));
// get IViewObject Interface
hret = m_viewObject.QueryInterface(IID_IViewObject, m_ActiveX);
hret = m_viewObject.QueryInterface(IID_IViewObject, m_ActiveX);
wxASSERT(SUCCEEDED(hret));
// document advise
@@ -529,23 +529,23 @@ private:
public:
wxActiveXEvents(wxActiveX *ax) : m_activeX(ax) {}
virtual ~wxActiveXEvents()
virtual ~wxActiveXEvents()
{
}
//IDispatch
STDMETHODIMP GetIDsOfNames(REFIID r, OLECHAR** o, unsigned int i, LCID l, DISPID* d)
{
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfo(unsigned int i, LCID l, ITypeInfo** t)
{
{
return E_NOTIMPL;
};
STDMETHODIMP GetTypeInfoCount(unsigned int* i)
{
{
return E_NOTIMPL;
};
@@ -591,7 +591,7 @@ public:
if (px.IsOut())
{
wxVariant& vx = event.m_params[nArg - i - 1];
VariantToMSWVariant(vx, va);
};
};
@@ -605,7 +605,7 @@ public:
WORD wFlags, DISPPARAMS * pDispParams,
VARIANT * pVarResult, EXCEPINFO * pExcepInfo,
unsigned int * puArgErr)
{
{
if (wFlags & (DISPATCH_PROPERTYGET | DISPATCH_PROPERTYPUT | DISPATCH_PROPERTYPUTREF))
return E_NOTIMPL;
@@ -616,7 +616,7 @@ public:
if (mid == m_activeX->m_eventsIdx.end())
return S_OK;
int funcIdx = mid->second;
int funcIdx = mid->second;
wxActiveX::FuncX &func = m_activeX->m_events[funcIdx];
@@ -697,12 +697,12 @@ wxVariant& wxActiveXEvent::operator[] (wxString name)
return m_params[i];
};
wxString err = "wxActiveXEvent::operator[] invalid name <" + name + ">";
err += "\r\nValid Names = :\r\n";
wxString err = wxT("wxActiveXEvent::operator[] invalid name <") + name + wxT(">");
err += wxT("\r\nValid Names = :\r\n");
for (i = 0; i < m_params.GetCount(); i++)
{
err += m_params[i].GetName();
err += "\r\n";
err += wxT("\r\n");
};
wxASSERT_MSG(false, err);
@@ -713,15 +713,15 @@ wxVariant& wxActiveXEvent::operator[] (wxString name)
void wxActiveX::GetTypeInfo()
{
/*
We are currently only interested in the IDispatch interface
We are currently only interested in the IDispatch interface
to the control. For dual interfaces (TypeKind = TKIND_INTERFACE)
we should drill down through the inheritance
we should drill down through the inheritance
(using TYPEATTR->cImplTypes) and GetRefTypeOfImplType(n)
and retrieve all the func names etc that way, then generate a C++
and retrieve all the func names etc that way, then generate a C++
header file for it.
But we don't do this and probably never will, so if we have a DUAL
interface then we query for the IDispatch
But we don't do this and probably never will, so if we have a DUAL
interface then we query for the IDispatch
via GetRefTypeOfImplType(-1).
*/
@@ -772,12 +772,12 @@ void wxActiveX::GetTypeInfo()
{
if (impTypeFlags & IMPLTYPEFLAG_FSOURCE)
{
WXOLE_TRACEOUT("Default Event Sink");
WXOLE_TRACEOUT(wxT("Default Event Sink"));
defEventSink = true;
}
else
{
WXOLE_TRACEOUT("Default Interface");
WXOLE_TRACEOUT(wxT("Default Interface"));
}
};
@@ -804,7 +804,7 @@ void wxActiveX::GetTypeInfo(ITypeInfo *ti, bool defEventSink)
if (ta->typekind == TKIND_DISPATCH)
{
WXOLE_TRACEOUT("GUID = " << GetIIDName(ta->guid).c_str());
WXOLE_TRACEOUT(wxT("GUID = ") << GetIIDName(ta->guid).c_str());
if (defEventSink)
{
@@ -831,7 +831,7 @@ void wxActiveX::GetTypeInfo(ITypeInfo *ti, bool defEventSink)
{
wxString name = anames[0];
WXOLE_TRACEOUT("Name " << i << " = " << name.c_str());
WXOLE_TRACEOUT(wxT("Name ") << i << wxT(" = ") << name.c_str());
SysFreeString(anames[0]);
if (defEventSink)
@@ -901,11 +901,11 @@ HRESULT wxActiveX::ConnectAdvise(REFIID riid, IUnknown *events)
wxAutoOleInterface<IConnectionPointContainer> cpContainer(IID_IConnectionPointContainer, m_ActiveX);
if (! cpContainer.Ok())
return E_FAIL;
HRESULT hret = cpContainer->FindConnectionPoint(riid, cp.GetRef());
if (! SUCCEEDED(hret))
return hret;
hret = cp->Advise(events, &adviseCookie);
if (SUCCEEDED(hret))
@@ -979,7 +979,7 @@ void wxActiveX::OnSize(wxSizeEvent& event)
m_oleObject->SetExtent(DVASPECT_CONTENT, &sz);
};
if (m_oleInPlaceObject.Ok())
if (m_oleInPlaceObject.Ok())
m_oleInPlaceObject->SetObjectRects(&posRect, &posRect);
}
@@ -1002,7 +1002,7 @@ void wxActiveX::OnPaint(wxPaintEvent& event)
::RedrawWindow(m_oleObjectHWND, NULL, NULL, RDW_INTERNALPAINT);
{
RECTL *prcBounds = (RECTL *) &posRect;
m_viewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL,
m_viewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, NULL,
(HDC)dc.GetHDC(), prcBounds, NULL, NULL, 0);
}
}
@@ -1018,11 +1018,11 @@ void wxActiveX::OnPaint(wxPaintEvent& event)
void wxActiveX::OnMouse(wxMouseEvent& event)
{
if (m_oleObjectHWND == NULL)
{
wxLogTrace(wxT("no oleInPlaceObject"));
event.Skip();
return;
if (m_oleObjectHWND == NULL)
{
wxLogTrace(wxT("no oleInPlaceObject"));
event.Skip();
return;
}
wxLogTrace(wxT("mouse event"));
@@ -1031,52 +1031,52 @@ void wxActiveX::OnMouse(wxMouseEvent& event)
LPARAM lParam = 0;
LRESULT lResult = 0;
if (event.m_metaDown)
if (event.m_metaDown)
wParam |= MK_CONTROL;
if (event.m_shiftDown)
if (event.m_shiftDown)
wParam |= MK_SHIFT;
if (event.m_leftDown)
if (event.m_leftDown)
wParam |= MK_LBUTTON;
if (event.m_middleDown)
if (event.m_middleDown)
wParam |= MK_MBUTTON;
if (event.m_rightDown)
if (event.m_rightDown)
wParam |= MK_RBUTTON;
lParam = event.m_x << 16;
lParam |= event.m_y;
if (event.LeftDown())
if (event.LeftDown())
msg = WM_LBUTTONDOWN;
else if (event.LeftDClick())
else if (event.LeftDClick())
msg = WM_LBUTTONDBLCLK;
else if (event.LeftUp())
else if (event.LeftUp())
msg = WM_LBUTTONUP;
else if (event.MiddleDown())
else if (event.MiddleDown())
msg = WM_MBUTTONDOWN;
else if (event.MiddleDClick())
else if (event.MiddleDClick())
msg = WM_MBUTTONDBLCLK;
else if (event.MiddleUp())
else if (event.MiddleUp())
msg = WM_MBUTTONUP;
else if (event.RightDown())
else if (event.RightDown())
msg = WM_RBUTTONDOWN;
else if (event.RightDClick())
else if (event.RightDClick())
msg = WM_RBUTTONDBLCLK;
else if (event.RightUp())
else if (event.RightUp())
msg = WM_RBUTTONUP;
else if (event.Moving() || event.Dragging())
else if (event.Moving() || event.Dragging())
msg = WM_MOUSEMOVE;
wxString log;
if (msg == 0)
{
if (msg == 0)
{
wxLogTrace(wxT("no message"));
event.Skip(); return;
event.Skip(); return;
};
if (!::SendMessage(m_oleObjectHWND, msg, wParam, lParam))
{
if (!::SendMessage(m_oleObjectHWND, msg, wParam, lParam))
{
wxLogTrace(wxT("msg not delivered"));
event.Skip();
return;
event.Skip();
return;
};
wxLogTrace(wxT("msg sent"));
@@ -1106,13 +1106,13 @@ long wxActiveX::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
void wxActiveX::OnSetFocus(wxFocusEvent& event)
{
if (m_oleInPlaceActiveObject.Ok())
if (m_oleInPlaceActiveObject.Ok())
m_oleInPlaceActiveObject->OnFrameWindowActivate(TRUE);
}
void wxActiveX::OnKillFocus(wxFocusEvent& event)
{
if (m_oleInPlaceActiveObject.Ok())
if (m_oleInPlaceActiveObject.Ok())
m_oleInPlaceActiveObject->OnFrameWindowActivate(FALSE);
}
@@ -1132,7 +1132,7 @@ FrameSite::FrameSite(wxActiveX * win)
m_bAmbientShowHatching = true;
m_bAmbientShowGrabHandles = true;
m_bAmbientAppearance = true;
m_hDCBuffer = NULL;
m_hWndParent = (HWND)m_window->GetHWND();
}
@@ -1175,7 +1175,7 @@ HRESULT FrameSite::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
HRESULT hr;
if (pVarResult == NULL)
if (pVarResult == NULL)
return E_INVALIDARG;
//The most common case is boolean, use as an initial type
@@ -1251,7 +1251,7 @@ HRESULT FrameSite::Invoke(DISPID dispIdMember, REFIID riid, LCID lcid,
HRESULT FrameSite::GetWindow(HWND * phwnd)
{
WXOLE_TRACE("IOleWindow::GetWindow");
if (phwnd == NULL)
if (phwnd == NULL)
return E_INVALIDARG;
(*phwnd) = m_hWndParent;
return S_OK;
@@ -1268,7 +1268,7 @@ HRESULT FrameSite::ContextSensitiveHelp(BOOL fEnterMode)
HRESULT FrameSite::GetBorder(LPRECT lprectBorder)
{
WXOLE_TRACE("IOleInPlaceUIWindow::GetBorder");
if (lprectBorder == NULL)
if (lprectBorder == NULL)
return E_INVALIDARG;
return INPLACE_E_NOTOOLSPACE;
}
@@ -1276,7 +1276,7 @@ HRESULT FrameSite::GetBorder(LPRECT lprectBorder)
HRESULT FrameSite::RequestBorderSpace(LPCBORDERWIDTHS pborderwidths)
{
WXOLE_TRACE("IOleInPlaceUIWindow::RequestBorderSpace");
if (pborderwidths == NULL)
if (pborderwidths == NULL)
return E_INVALIDARG;
return INPLACE_E_NOTOOLSPACE;
}
@@ -1373,9 +1373,9 @@ HRESULT FrameSite::GetWindowContext(IOleInPlaceFrame **ppFrame,
if (ppFrame == NULL || ppDoc == NULL || lprcPosRect == NULL ||
lprcClipRect == NULL || lpFrameInfo == NULL)
{
if (ppFrame != NULL)
if (ppFrame != NULL)
(*ppFrame) = NULL;
if (ppDoc != NULL)
if (ppDoc != NULL)
(*ppDoc) = NULL;
return E_INVALIDARG;
}
@@ -1465,7 +1465,7 @@ HRESULT FrameSite::OnInPlaceActivateEx(BOOL * pfNoRedraw, DWORD dwFlags)
{
WXOLE_TRACE("IOleInPlaceSiteEx::OnInPlaceActivateEx");
OleLockRunning(m_window->m_ActiveX, TRUE, FALSE);
if (pfNoRedraw)
if (pfNoRedraw)
(*pfNoRedraw) = FALSE;
return S_OK;
}
@@ -1502,9 +1502,9 @@ HRESULT FrameSite::GetMoniker(DWORD dwAssign, DWORD dwWhichMoniker,
HRESULT FrameSite::GetContainer(LPOLECONTAINER * ppContainer)
{
WXOLE_TRACE("IOleClientSite::GetContainer");
if (ppContainer == NULL)
if (ppContainer == NULL)
return E_INVALIDARG;
HRESULT hr = QueryInterface(IID_IOleContainer, (void**)(ppContainer));
wxASSERT(SUCCEEDED(hr));
@@ -1557,26 +1557,26 @@ HRESULT FrameSite::LockContainer(BOOL fLock)
//IOleItemContainer
HRESULT FrameSite::GetObject(LPOLESTR pszItem, DWORD dwSpeedNeeded,
HRESULT FrameSite::GetObject(LPOLESTR pszItem, DWORD dwSpeedNeeded,
IBindCtx * pbc, REFIID riid, void ** ppvObject)
{
WXOLE_TRACE("IOleItemContainer::GetObject");
if (pszItem == NULL)
if (pszItem == NULL)
return E_INVALIDARG;
if (ppvObject == NULL)
if (ppvObject == NULL)
return E_INVALIDARG;
*ppvObject = NULL;
return MK_E_NOOBJECT;
}
HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
REFIID riid, void ** ppvStorage)
{
WXOLE_TRACE("IOleItemContainer::GetObjectStorage");
if (pszItem == NULL)
if (pszItem == NULL)
return E_INVALIDARG;
if (ppvStorage == NULL)
if (ppvStorage == NULL)
return E_INVALIDARG;
*ppvStorage = NULL;
@@ -1586,7 +1586,7 @@ HRESULT FrameSite::GetObjectStorage(LPOLESTR pszItem, IBindCtx * pbc,
HRESULT FrameSite::IsRunning(LPOLESTR pszItem)
{
WXOLE_TRACE("IOleItemContainer::IsRunning");
if (pszItem == NULL)
if (pszItem == NULL)
return E_INVALIDARG;
return MK_E_NOOBJECT;
@@ -1651,7 +1651,7 @@ HRESULT FrameSite::ShowPropertyFrame()
//IOleCommandTarget
HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
OLECMD * prgCmds, OLECMDTEXT * pCmdTet)
{
WXOLE_TRACE("IOleCommandTarget::QueryStatus");
@@ -1670,8 +1670,8 @@ HRESULT FrameSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds,
return S_OK;
}
HRESULT FrameSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID,
DWORD nCmdExecOpt, VARIANTARG * pVaIn,
HRESULT FrameSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID,
DWORD nCmdExecOpt, VARIANTARG * pVaIn,
VARIANTARG * pVaOut)
{
WXOLE_TRACE("IOleCommandTarget::Exec");
@@ -1775,49 +1775,49 @@ wxString OLEHResultToString(HRESULT hr)
switch (hr)
{
case S_OK:
return "";
return wxEmptyString;
case OLECMDERR_E_UNKNOWNGROUP:
return "The pguidCmdGroup parameter is not NULL but does not specify a recognized command group.";
return wxT("The pguidCmdGroup parameter is not NULL but does not specify a recognized command group.");
case OLECMDERR_E_NOTSUPPORTED:
return "The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup.";
return wxT("The nCmdID parameter is not a valid command in the group identified by pguidCmdGroup.");
case OLECMDERR_E_DISABLED:
return "The command identified by nCmdID is currently disabled and cannot be executed.";
return wxT("The command identified by nCmdID is currently disabled and cannot be executed.");
case OLECMDERR_E_NOHELP:
return "The caller has asked for help on the command identified by nCmdID, but no help is available.";
return wxT("The caller has asked for help on the command identified by nCmdID, but no help is available.");
case OLECMDERR_E_CANCELED:
return "The user canceled the execution of the command.";
return wxT("The user canceled the execution of the command.");
case E_INVALIDARG:
return "E_INVALIDARG";
return wxT("E_INVALIDARG");
case E_OUTOFMEMORY:
return "E_OUTOFMEMORY";
return wxT("E_OUTOFMEMORY");
case E_NOINTERFACE:
return "E_NOINTERFACE";
return wxT("E_NOINTERFACE");
case E_UNEXPECTED:
return "E_UNEXPECTED";
return wxT("E_UNEXPECTED");
case STG_E_INVALIDFLAG:
return "STG_E_INVALIDFLAG";
return wxT("STG_E_INVALIDFLAG");
case E_FAIL:
return "E_FAIL";
return wxT("E_FAIL");
case E_NOTIMPL:
return "E_NOTIMPL";
return wxT("E_NOTIMPL");
default:
{
char buf[64];
sprintf(buf, "Unknown - 0x%X", hr);
return wxString(buf);
wxString buf;
buf.Printf(wxT("Unknown - 0x%X"), hr);
return buf;
}
};
};
@@ -1826,7 +1826,7 @@ wxString OLEHResultToString(HRESULT hr)
wxString GetIIDName(REFIID riid)
{
// an association between symbolic name and numeric value of an IID
struct KNOWN_IID
struct KNOWN_IID
{
const IID *pIid;
const wxChar *szName;
@@ -1836,7 +1836,7 @@ wxString GetIIDName(REFIID riid)
#define ADD_KNOWN_IID(name) { &IID_I##name, _T(#name) }
#define ADD_KNOWN_GUID(name) { &name, _T(#name) }
static const KNOWN_IID aKnownIids[] =
static const KNOWN_IID aKnownIids[] =
{
ADD_KNOWN_IID(AdviseSink),
ADD_KNOWN_IID(AdviseSink2),
@@ -1930,9 +1930,9 @@ wxString GetIIDName(REFIID riid)
#undef ADD_KNOWN_GUID
// try to find the interface in the table
for ( size_t ui = 0; ui < WXSIZEOF(aKnownIids); ui++ )
for ( size_t ui = 0; ui < WXSIZEOF(aKnownIids); ui++ )
{
if ( riid == *aKnownIids[ui].pIid )
if ( riid == *aKnownIids[ui].pIid )
{
return aKnownIids[ui].szName;
}
@@ -1948,5 +1948,5 @@ wxString GetIIDName(REFIID riid)
return s;
}
else
return "StringFromIID() error";
return wxT("StringFromIID() error");
}

View File

@@ -1,15 +1,15 @@
/*
* FILE : contrib/ogl/ogl.cpp
*
*
* This file was automatically generated by :
* Simplified Wrapper and Interface Generator (SWIG)
* Version 1.1 (Build 883)
*
*
* Portions Copyright (c) 1995-1998
* The University of Utah and The Regents of the University of California.
* Permission is granted to distribute this file in any manner provided
* this notice remains intact.
*
*
* Do not make changes to this file--changes will be lost!
*
*/
@@ -19,6 +19,8 @@
/* Implementation : PYTHON */
#define SWIGPYTHON
#include "Python.h"
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
@@ -36,12 +38,9 @@
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
@@ -188,19 +187,20 @@ PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
//---------------------------------------------------------------------------
PyObject* wxPy_ConvertShapeList(wxListBase* list, const char* className) {
PyObject* wxPy_ConvertShapeList(wxListBase* listbase, const char* className) {
wxList* list = (wxList*)listbase;
PyObject* pyList;
PyObject* pyObj;
wxObject* wxObj;
wxNode* node = list->First();
wxNode* node = list->GetFirst();
wxPyBeginBlockThreads();
pyList = PyList_New(0);
while (node) {
wxObj = node->Data();
wxObj = node->GetData();
pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj);
PyList_Append(pyList, pyObj);
node = node->Next();
node = node->GetNext();
}
wxPyEndBlockThreads();
return pyList;
@@ -239,7 +239,7 @@ static PyObject *_wrap_wxOGLInitialize(PyObject *self, PyObject *args, PyObject
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxOGLInitialize",_kwnames))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxOGLInitialize",_kwnames))
return NULL;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -257,7 +257,7 @@ static PyObject *_wrap_wxOGLCleanUp(PyObject *self, PyObject *args, PyObject *kw
char *_kwnames[] = { NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxOGLCleanUp",_kwnames))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":wxOGLCleanUp",_kwnames))
return NULL;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
@@ -386,7 +386,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C"
extern "C"
#endif
SWIGEXPORT(void) initoglc() {
PyObject *m, *d;

View File

@@ -19,6 +19,8 @@
/* Implementation : PYTHON */
#define SWIGPYTHON
#include "Python.h"
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
@@ -36,12 +38,9 @@
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
@@ -467,7 +466,7 @@ static PyObject *_wrap_wxShapeRegion_GetText(PyObject *self, PyObject *args, PyO
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -759,7 +758,7 @@ static PyObject *_wrap_wxShapeRegion_GetName(PyObject *self, PyObject *args, PyO
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -796,7 +795,7 @@ static PyObject *_wrap_wxShapeRegion_GetColour(PyObject *self, PyObject *args, P
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -904,7 +903,7 @@ static PyObject *_wrap_wxShapeRegion_GetPenColour(PyObject *self, PyObject *args
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -1489,8 +1488,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnDraw(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnDraw. Expected _wxDC_p.");
return NULL;
}
@@ -1526,8 +1524,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnDrawContents(PyObject *self, P
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnDrawContents. Expected _wxDC_p.");
return NULL;
}
@@ -1565,8 +1562,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnDrawBranches(PyObject *self, P
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnDrawBranches. Expected _wxDC_p.");
return NULL;
}
@@ -1603,8 +1599,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnMoveLinks(PyObject *self, PyOb
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnMoveLinks. Expected _wxDC_p.");
return NULL;
}
@@ -1640,8 +1635,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnErase(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnErase. Expected _wxDC_p.");
return NULL;
}
@@ -1677,8 +1671,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnEraseContents(PyObject *self,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnEraseContents. Expected _wxDC_p.");
return NULL;
}
@@ -1714,8 +1707,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnHighlight(PyObject *self, PyOb
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnHighlight. Expected _wxDC_p.");
return NULL;
}
@@ -1884,8 +1876,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnMovePre(PyObject *self, PyObje
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnMovePre. Expected _wxDC_p.");
return NULL;
}
@@ -1927,8 +1918,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnMovePost(PyObject *self, PyObj
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnMovePost. Expected _wxDC_p.");
return NULL;
}
@@ -2167,8 +2157,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnDrawOutline(PyObject *self, Py
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnDrawOutline. Expected _wxDC_p.");
return NULL;
}
@@ -2204,8 +2193,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnDrawControlPoints(PyObject *se
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnDrawControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -2241,8 +2229,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnEraseControlPoints(PyObject *s
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnEraseControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -2280,8 +2267,7 @@ static PyObject *_wrap_wxPyShapeEvtHandler_base_OnMoveLink(PyObject *self, PyObj
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeEvtHandler_base_OnMoveLink. Expected _wxDC_p.");
return NULL;
}
@@ -4524,8 +4510,7 @@ static PyObject *_wrap_wxPyShape_Move(PyObject *self, PyObject *args, PyObject *
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_Move. Expected _wxDC_p.");
return NULL;
}
@@ -4562,8 +4547,7 @@ static PyObject *_wrap_wxPyShape_Erase(PyObject *self, PyObject *args, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_Erase. Expected _wxDC_p.");
return NULL;
}
@@ -4599,8 +4583,7 @@ static PyObject *_wrap_wxPyShape_EraseContents(PyObject *self, PyObject *args, P
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_EraseContents. Expected _wxDC_p.");
return NULL;
}
@@ -4636,8 +4619,7 @@ static PyObject *_wrap_wxPyShape_Draw(PyObject *self, PyObject *args, PyObject *
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_Draw. Expected _wxDC_p.");
return NULL;
}
@@ -4701,8 +4683,7 @@ static PyObject *_wrap_wxPyShape_MoveLinks(PyObject *self, PyObject *args, PyObj
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_MoveLinks. Expected _wxDC_p.");
return NULL;
}
@@ -4738,8 +4719,7 @@ static PyObject *_wrap_wxPyShape_DrawContents(PyObject *self, PyObject *args, Py
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_DrawContents. Expected _wxDC_p.");
return NULL;
}
@@ -5158,8 +5138,7 @@ static PyObject *_wrap_wxPyShape_FormatText(PyObject *self, PyObject *args, PyOb
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_FormatText. Expected _wxDC_p.");
return NULL;
}
@@ -5397,7 +5376,7 @@ static PyObject *_wrap_wxPyShape_GetTextColour(PyObject *self, PyObject *args, P
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -5503,7 +5482,7 @@ static PyObject *_wrap_wxPyShape_GetRegionName(PyObject *self, PyObject *args, P
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -5788,8 +5767,7 @@ static PyObject *_wrap_wxPyShape_FindRegionNames(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxStringList_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxStringList_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_FindRegionNames. Expected _wxStringList_p.");
return NULL;
}
@@ -6173,8 +6151,7 @@ static PyObject *_wrap_wxPyShape_EraseLinks(PyObject *self, PyObject *args, PyOb
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_EraseLinks. Expected _wxDC_p.");
return NULL;
}
@@ -6214,8 +6191,7 @@ static PyObject *_wrap_wxPyShape_DrawLinks(PyObject *self, PyObject *args, PyObj
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_DrawLinks. Expected _wxDC_p.");
return NULL;
}
@@ -6257,8 +6233,7 @@ static PyObject *_wrap_wxPyShape_MoveLineToNewAttachment(PyObject *self, PyObjec
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_MoveLineToNewAttachment. Expected _wxDC_p.");
return NULL;
}
@@ -6889,8 +6864,7 @@ static PyObject *_wrap_wxPyShape_Copy(PyObject *self, PyObject *args, PyObject *
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPyShape_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPyShape_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_Copy. Expected _wxPyShape_p.");
return NULL;
}
@@ -6926,8 +6900,7 @@ static PyObject *_wrap_wxPyShape_CopyWithHandler(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPyShape_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPyShape_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_CopyWithHandler. Expected _wxPyShape_p.");
return NULL;
}
@@ -7050,8 +7023,7 @@ static PyObject *_wrap_wxPyShape_Recentre(PyObject *self, PyObject *args, PyObje
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_Recentre. Expected _wxDC_p.");
return NULL;
}
@@ -7087,8 +7059,7 @@ static PyObject *_wrap_wxPyShape_ClearPointList(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxList_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxList_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_ClearPointList. Expected _wxList_p.");
return NULL;
}
@@ -7212,8 +7183,7 @@ static PyObject *_wrap_wxPyShape_base_OnDraw(PyObject *self, PyObject *args, PyO
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnDraw. Expected _wxDC_p.");
return NULL;
}
@@ -7249,8 +7219,7 @@ static PyObject *_wrap_wxPyShape_base_OnDrawContents(PyObject *self, PyObject *a
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnDrawContents. Expected _wxDC_p.");
return NULL;
}
@@ -7288,8 +7257,7 @@ static PyObject *_wrap_wxPyShape_base_OnDrawBranches(PyObject *self, PyObject *a
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnDrawBranches. Expected _wxDC_p.");
return NULL;
}
@@ -7326,8 +7294,7 @@ static PyObject *_wrap_wxPyShape_base_OnMoveLinks(PyObject *self, PyObject *args
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnMoveLinks. Expected _wxDC_p.");
return NULL;
}
@@ -7363,8 +7330,7 @@ static PyObject *_wrap_wxPyShape_base_OnErase(PyObject *self, PyObject *args, Py
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnErase. Expected _wxDC_p.");
return NULL;
}
@@ -7400,8 +7366,7 @@ static PyObject *_wrap_wxPyShape_base_OnEraseContents(PyObject *self, PyObject *
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnEraseContents. Expected _wxDC_p.");
return NULL;
}
@@ -7437,8 +7402,7 @@ static PyObject *_wrap_wxPyShape_base_OnHighlight(PyObject *self, PyObject *args
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnHighlight. Expected _wxDC_p.");
return NULL;
}
@@ -7607,8 +7571,7 @@ static PyObject *_wrap_wxPyShape_base_OnMovePre(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnMovePre. Expected _wxDC_p.");
return NULL;
}
@@ -7650,8 +7613,7 @@ static PyObject *_wrap_wxPyShape_base_OnMovePost(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnMovePost. Expected _wxDC_p.");
return NULL;
}
@@ -7890,8 +7852,7 @@ static PyObject *_wrap_wxPyShape_base_OnDrawOutline(PyObject *self, PyObject *ar
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnDrawOutline. Expected _wxDC_p.");
return NULL;
}
@@ -7927,8 +7888,7 @@ static PyObject *_wrap_wxPyShape_base_OnDrawControlPoints(PyObject *self, PyObje
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnDrawControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -7964,8 +7924,7 @@ static PyObject *_wrap_wxPyShape_base_OnEraseControlPoints(PyObject *self, PyObj
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnEraseControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -8003,8 +7962,7 @@ static PyObject *_wrap_wxPyShape_base_OnMoveLink(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_base_OnMoveLink. Expected _wxDC_p.");
return NULL;
}

View File

@@ -303,7 +303,7 @@ public:
void ClearText(int regionId = 0);
void RemoveLine(wxPyLineShape *line);
#ifdef PROLOGIO
#ifdef wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause);
void ReadAttributes(wxExpr *clause);
void ReadConstraints(wxExpr *clause, wxExprDatabase *database);

View File

@@ -19,6 +19,8 @@
/* Implementation : PYTHON */
#define SWIGPYTHON
#include "Python.h"
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
@@ -36,12 +38,9 @@
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
@@ -199,8 +198,7 @@ static PyObject *_wrap_wxDiagram_Clear(PyObject *self, PyObject *args, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDiagram_Clear. Expected _wxDC_p.");
return NULL;
}
@@ -268,8 +266,7 @@ static PyObject *_wrap_wxDiagram_DrawOutline(PyObject *self, PyObject *args, PyO
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDiagram_DrawOutline. Expected _wxDC_p.");
return NULL;
}
@@ -552,156 +549,6 @@ static PyObject *_wrap_wxDiagram_InsertShape(PyObject *self, PyObject *args, PyO
return _resultobj;
}
#define wxDiagram_LoadFile(_swigobj,_swigarg0) (_swigobj->LoadFile(_swigarg0))
static PyObject *_wrap_wxDiagram_LoadFile(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxDiagram * _arg0;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","filename", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDiagram_LoadFile",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDiagram_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDiagram_LoadFile. Expected _wxDiagram_p.");
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxDiagram_LoadFile(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
#define wxDiagram_ReadContainerGeometry(_swigobj,_swigarg0) (_swigobj->ReadContainerGeometry(_swigarg0))
static PyObject *_wrap_wxDiagram_ReadContainerGeometry(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxDiagram * _arg0;
wxExprDatabase * _arg1;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","database", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDiagram_ReadContainerGeometry",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDiagram_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDiagram_ReadContainerGeometry. Expected _wxDiagram_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxExprDatabase_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDiagram_ReadContainerGeometry. Expected _wxExprDatabase_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxDiagram_ReadContainerGeometry(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxDiagram_ReadLines(_swigobj,_swigarg0) (_swigobj->ReadLines(_swigarg0))
static PyObject *_wrap_wxDiagram_ReadLines(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxDiagram * _arg0;
wxExprDatabase * _arg1;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","database", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDiagram_ReadLines",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDiagram_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDiagram_ReadLines. Expected _wxDiagram_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxExprDatabase_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDiagram_ReadLines. Expected _wxExprDatabase_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxDiagram_ReadLines(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxDiagram_ReadNodes(_swigobj,_swigarg0) (_swigobj->ReadNodes(_swigarg0))
static PyObject *_wrap_wxDiagram_ReadNodes(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxDiagram * _arg0;
wxExprDatabase * _arg1;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","database", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDiagram_ReadNodes",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDiagram_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDiagram_ReadNodes. Expected _wxDiagram_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxExprDatabase_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDiagram_ReadNodes. Expected _wxExprDatabase_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxDiagram_ReadNodes(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxDiagram_RecentreAll(_swigobj,_swigarg0) (_swigobj->RecentreAll(_swigarg0))
static PyObject *_wrap_wxDiagram_RecentreAll(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -722,8 +569,7 @@ static PyObject *_wrap_wxDiagram_RecentreAll(PyObject *self, PyObject *args, PyO
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDiagram_RecentreAll. Expected _wxDC_p.");
return NULL;
}
@@ -759,8 +605,7 @@ static PyObject *_wrap_wxDiagram_Redraw(PyObject *self, PyObject *args, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDiagram_Redraw. Expected _wxDC_p.");
return NULL;
}
@@ -841,45 +686,6 @@ static PyObject *_wrap_wxDiagram_RemoveShape(PyObject *self, PyObject *args, PyO
return _resultobj;
}
#define wxDiagram_SaveFile(_swigobj,_swigarg0) (_swigobj->SaveFile(_swigarg0))
static PyObject *_wrap_wxDiagram_SaveFile(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
bool _result;
wxDiagram * _arg0;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","filename", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDiagram_SaveFile",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDiagram_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDiagram_SaveFile. Expected _wxDiagram_p.");
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (bool )wxDiagram_SaveFile(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} _resultobj = Py_BuildValue("i",_result);
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
#define wxDiagram_SetCanvas(_swigobj,_swigarg0) (_swigobj->SetCanvas(_swigarg0))
static PyObject *_wrap_wxDiagram_SetCanvas(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -1777,8 +1583,7 @@ static PyObject *_wrap_wxPyShapeCanvas_Redraw(PyObject *self, PyObject *args, Py
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShapeCanvas_Redraw. Expected _wxDC_p.");
return NULL;
}
@@ -1948,15 +1753,10 @@ static PyMethodDef oglcanvascMethods[] = {
{ "wxDiagram_SetMouseTolerance", (PyCFunction) _wrap_wxDiagram_SetMouseTolerance, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_SetGridSpacing", (PyCFunction) _wrap_wxDiagram_SetGridSpacing, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_SetCanvas", (PyCFunction) _wrap_wxDiagram_SetCanvas, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_SaveFile", (PyCFunction) _wrap_wxDiagram_SaveFile, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_RemoveShape", (PyCFunction) _wrap_wxDiagram_RemoveShape, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_RemoveAllShapes", (PyCFunction) _wrap_wxDiagram_RemoveAllShapes, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_Redraw", (PyCFunction) _wrap_wxDiagram_Redraw, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_RecentreAll", (PyCFunction) _wrap_wxDiagram_RecentreAll, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_ReadNodes", (PyCFunction) _wrap_wxDiagram_ReadNodes, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_ReadLines", (PyCFunction) _wrap_wxDiagram_ReadLines, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_ReadContainerGeometry", (PyCFunction) _wrap_wxDiagram_ReadContainerGeometry, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_LoadFile", (PyCFunction) _wrap_wxDiagram_LoadFile, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_InsertShape", (PyCFunction) _wrap_wxDiagram_InsertShape, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_GetSnapToGrid", (PyCFunction) _wrap_wxDiagram_GetSnapToGrid, METH_VARARGS | METH_KEYWORDS },
{ "wxDiagram_GetQuickEditMode", (PyCFunction) _wrap_wxDiagram_GetQuickEditMode, METH_VARARGS | METH_KEYWORDS },

View File

@@ -71,8 +71,13 @@ public:
bool GetQuickEditMode();
bool GetSnapToGrid();
void InsertShape(wxPyShape *shape);
bool LoadFile(const wxString& filename);
#ifdef wxUSE_PROLOGIO
bool LoadFile(const wxString& filename);
bool SaveFile(const wxString& filename);
#endif
#ifdef wxUSE_PROLOGIO
// **** Have to deal with wxExpr and wxExprDatabase first...
//void OnDatabaseLoad(wxExprDatabase& database);
//void OnDatabaseSave(wxExprDatabase& database);
@@ -80,16 +85,18 @@ public:
//bool OnHeaderSave(wxExprDatabase& database, wxExpr& expr);
//bool OnShapeLoad(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
//bool OnShapeSave(wxExprDatabase& database, wxPyShape& shape, wxExpr& expr);
#endif
#ifdef wxUSE_PROLOGIO
void ReadContainerGeometry(wxExprDatabase& database);
void ReadLines(wxExprDatabase& database);
void ReadNodes(wxExprDatabase& database);
#endif
void RecentreAll(wxDC& dc);
void Redraw(wxDC& dc);
void RemoveAllShapes();
void RemoveShape(wxPyShape* shape);
bool SaveFile(const wxString& filename);
void SetCanvas(wxPyShapeCanvas* canvas);
void SetGridSpacing(double spacing);
void SetMouseTolerance(int tolerance);

View File

@@ -88,18 +88,6 @@ class wxDiagramPtr(wxObjectPtr):
def InsertShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_InsertShape,(self,) + _args, _kwargs)
return val
def LoadFile(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_LoadFile,(self,) + _args, _kwargs)
return val
def ReadContainerGeometry(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_ReadContainerGeometry,(self,) + _args, _kwargs)
return val
def ReadLines(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_ReadLines,(self,) + _args, _kwargs)
return val
def ReadNodes(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_ReadNodes,(self,) + _args, _kwargs)
return val
def RecentreAll(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_RecentreAll,(self,) + _args, _kwargs)
return val
@@ -112,9 +100,6 @@ class wxDiagramPtr(wxObjectPtr):
def RemoveShape(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_RemoveShape,(self,) + _args, _kwargs)
return val
def SaveFile(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_SaveFile,(self,) + _args, _kwargs)
return val
def SetCanvas(self, *_args, **_kwargs):
val = apply(oglcanvasc.wxDiagram_SetCanvas,(self,) + _args, _kwargs)
return val

File diff suppressed because it is too large Load Diff

View File

@@ -46,16 +46,17 @@ public:
~wxPseudoMetaFile();
void Draw(wxDC& dc, double xoffset, double yoffset);
#ifdef wxUSE_PROLOGIO
void WriteAttributes(wxExpr *clause, int whichAngle);
void ReadAttributes(wxExpr *clause, int whichAngle);
#endif
void Clear();
void Copy(wxPseudoMetaFile& copy);
void Scale(double sx, double sy);
void ScaleTo(double w, double h);
void Translate(double x, double y);
void Rotate(double x, double y, double theta);
bool LoadFromMetaFile(char* filename, double *width, double *height);
bool LoadFromMetaFile(const wxString& filename, double *width, double *height);
void GetBounds(double *minX, double *minY, double *maxX, double *maxY);
void CalculateSize(wxPyDrawnShape* shape);
@@ -280,7 +281,7 @@ public:
wxPseudoMetaFile& GetMetaFile();
double GetRotation();
bool LoadFromMetaFile(char * filename);
bool LoadFromMetaFile(const wxString& filename);
void Rotate(double x, double y, double theta);
void SetClippingRect(const wxRect& rect);
void SetDrawnBackgroundColour(const wxColour& colour);

View File

@@ -49,18 +49,15 @@ class wxPseudoMetaFilePtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,oglshapesc=oglshapesc):
if self.thisown == 1 :
oglshapesc.delete_wxPseudoMetaFile(self)
def __del__(self, delfunc=oglshapesc.delete_wxPseudoMetaFile):
if self.thisown == 1:
try:
delfunc(self)
except:
pass
def Draw(self, *_args, **_kwargs):
val = apply(oglshapesc.wxPseudoMetaFile_Draw,(self,) + _args, _kwargs)
return val
def WriteAttributes(self, *_args, **_kwargs):
val = apply(oglshapesc.wxPseudoMetaFile_WriteAttributes,(self,) + _args, _kwargs)
return val
def ReadAttributes(self, *_args, **_kwargs):
val = apply(oglshapesc.wxPseudoMetaFile_ReadAttributes,(self,) + _args, _kwargs)
return val
def Clear(self, *_args, **_kwargs):
val = apply(oglshapesc.wxPseudoMetaFile_Clear,(self,) + _args, _kwargs)
return val

View File

@@ -19,6 +19,8 @@
/* Implementation : PYTHON */
#define SWIGPYTHON
#include "Python.h"
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
@@ -36,12 +38,9 @@
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
@@ -210,8 +209,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnDraw(PyObject *self, PyObject *ar
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnDraw. Expected _wxDC_p.");
return NULL;
}
@@ -247,8 +245,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnDrawContents(PyObject *self, PyOb
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnDrawContents. Expected _wxDC_p.");
return NULL;
}
@@ -286,8 +283,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnDrawBranches(PyObject *self, PyOb
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnDrawBranches. Expected _wxDC_p.");
return NULL;
}
@@ -324,8 +320,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnMoveLinks(PyObject *self, PyObjec
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnMoveLinks. Expected _wxDC_p.");
return NULL;
}
@@ -361,8 +356,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnErase(PyObject *self, PyObject *a
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnErase. Expected _wxDC_p.");
return NULL;
}
@@ -398,8 +392,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnEraseContents(PyObject *self, PyO
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnEraseContents. Expected _wxDC_p.");
return NULL;
}
@@ -435,8 +428,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnHighlight(PyObject *self, PyObjec
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnHighlight. Expected _wxDC_p.");
return NULL;
}
@@ -605,8 +597,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnMovePre(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnMovePre. Expected _wxDC_p.");
return NULL;
}
@@ -648,8 +639,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnMovePost(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnMovePost. Expected _wxDC_p.");
return NULL;
}
@@ -888,8 +878,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnDrawOutline(PyObject *self, PyObj
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnDrawOutline. Expected _wxDC_p.");
return NULL;
}
@@ -925,8 +914,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnDrawControlPoints(PyObject *self,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnDrawControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -962,8 +950,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnEraseControlPoints(PyObject *self
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnEraseControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -1001,8 +988,7 @@ static PyObject *_wrap_wxPyEllipseShape_base_OnMoveLink(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyEllipseShape_base_OnMoveLink. Expected _wxDC_p.");
return NULL;
}
@@ -1322,8 +1308,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnDraw(PyObject *self, PyObject *arg
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnDraw. Expected _wxDC_p.");
return NULL;
}
@@ -1359,8 +1344,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnDrawContents(PyObject *self, PyObj
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnDrawContents. Expected _wxDC_p.");
return NULL;
}
@@ -1398,8 +1382,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnDrawBranches(PyObject *self, PyObj
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnDrawBranches. Expected _wxDC_p.");
return NULL;
}
@@ -1436,8 +1419,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnMoveLinks(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnMoveLinks. Expected _wxDC_p.");
return NULL;
}
@@ -1473,8 +1455,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnErase(PyObject *self, PyObject *ar
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnErase. Expected _wxDC_p.");
return NULL;
}
@@ -1510,8 +1491,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnEraseContents(PyObject *self, PyOb
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnEraseContents. Expected _wxDC_p.");
return NULL;
}
@@ -1547,8 +1527,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnHighlight(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnHighlight. Expected _wxDC_p.");
return NULL;
}
@@ -1717,8 +1696,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnMovePre(PyObject *self, PyObject *
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnMovePre. Expected _wxDC_p.");
return NULL;
}
@@ -1760,8 +1738,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnMovePost(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnMovePost. Expected _wxDC_p.");
return NULL;
}
@@ -2000,8 +1977,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnDrawOutline(PyObject *self, PyObje
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnDrawOutline. Expected _wxDC_p.");
return NULL;
}
@@ -2037,8 +2013,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnDrawControlPoints(PyObject *self,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnDrawControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -2074,8 +2049,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnEraseControlPoints(PyObject *self,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnEraseControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -2113,8 +2087,7 @@ static PyObject *_wrap_wxPyCircleShape_base_OnMoveLink(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyCircleShape_base_OnMoveLink. Expected _wxDC_p.");
return NULL;
}
@@ -2628,7 +2601,7 @@ static PyObject *_wrap_wxArrowHead_GetName(PyObject *self, PyObject *args, PyObj
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -3149,8 +3122,7 @@ static PyObject *_wrap_wxPyLineShape_DrawArrow(PyObject *self, PyObject *args, P
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_DrawArrow. Expected _wxDC_p.");
return NULL;
}
@@ -3291,8 +3263,7 @@ static PyObject *_wrap_wxPyLineShape_DrawArrows(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_DrawArrows. Expected _wxDC_p.");
return NULL;
}
@@ -3332,8 +3303,7 @@ static PyObject *_wrap_wxPyLineShape_DrawRegion(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_DrawRegion. Expected _wxDC_p.");
return NULL;
}
@@ -3380,8 +3350,7 @@ static PyObject *_wrap_wxPyLineShape_EraseRegion(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_EraseRegion. Expected _wxDC_p.");
return NULL;
}
@@ -3863,7 +3832,7 @@ static PyObject *_wrap_wxPyLineShape_GetLabelPosition(PyObject *self, PyObject *
#define wxPyLineShape_GetNextControlPoint(_swigobj,_swigarg0) (_swigobj->GetNextControlPoint(_swigarg0))
static PyObject *_wrap_wxPyLineShape_GetNextControlPoint(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPoint * _result;
wxRealPoint * _result;
wxPyLineShape * _arg0;
wxPyShape * _arg1;
PyObject * _argo0 = 0;
@@ -3890,12 +3859,12 @@ static PyObject *_wrap_wxPyLineShape_GetNextControlPoint(PyObject *self, PyObjec
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxPoint *)wxPyLineShape_GetNextControlPoint(_arg0,_arg1);
_result = (wxRealPoint *)wxPyLineShape_GetNextControlPoint(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxPoint_p");
SWIG_MakePtr(_ptemp, (char *) _result,"_wxRealPoint_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
@@ -4465,8 +4434,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnDraw(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnDraw. Expected _wxDC_p.");
return NULL;
}
@@ -4502,8 +4470,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnDrawContents(PyObject *self, PyObjec
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnDrawContents. Expected _wxDC_p.");
return NULL;
}
@@ -4541,8 +4508,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnDrawBranches(PyObject *self, PyObjec
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnDrawBranches. Expected _wxDC_p.");
return NULL;
}
@@ -4579,8 +4545,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnMoveLinks(PyObject *self, PyObject *
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnMoveLinks. Expected _wxDC_p.");
return NULL;
}
@@ -4616,8 +4581,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnErase(PyObject *self, PyObject *args
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnErase. Expected _wxDC_p.");
return NULL;
}
@@ -4653,8 +4617,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnEraseContents(PyObject *self, PyObje
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnEraseContents. Expected _wxDC_p.");
return NULL;
}
@@ -4690,8 +4653,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnHighlight(PyObject *self, PyObject *
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnHighlight. Expected _wxDC_p.");
return NULL;
}
@@ -4860,8 +4822,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnMovePre(PyObject *self, PyObject *ar
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnMovePre. Expected _wxDC_p.");
return NULL;
}
@@ -4903,8 +4864,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnMovePost(PyObject *self, PyObject *a
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnMovePost. Expected _wxDC_p.");
return NULL;
}
@@ -5143,8 +5103,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnDrawOutline(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnDrawOutline. Expected _wxDC_p.");
return NULL;
}
@@ -5180,8 +5139,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnDrawControlPoints(PyObject *self, Py
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnDrawControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -5217,8 +5175,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnEraseControlPoints(PyObject *self, P
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnEraseControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -5256,8 +5213,7 @@ static PyObject *_wrap_wxPyLineShape_base_OnMoveLink(PyObject *self, PyObject *a
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyLineShape_base_OnMoveLink. Expected _wxDC_p.");
return NULL;
}
@@ -5758,8 +5714,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnDraw(PyObject *self, PyObject *ar
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnDraw. Expected _wxDC_p.");
return NULL;
}
@@ -5795,8 +5750,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnDrawContents(PyObject *self, PyOb
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnDrawContents. Expected _wxDC_p.");
return NULL;
}
@@ -5834,8 +5788,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnDrawBranches(PyObject *self, PyOb
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnDrawBranches. Expected _wxDC_p.");
return NULL;
}
@@ -5872,8 +5825,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnMoveLinks(PyObject *self, PyObjec
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnMoveLinks. Expected _wxDC_p.");
return NULL;
}
@@ -5909,8 +5861,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnErase(PyObject *self, PyObject *a
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnErase. Expected _wxDC_p.");
return NULL;
}
@@ -5946,8 +5897,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnEraseContents(PyObject *self, PyO
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnEraseContents. Expected _wxDC_p.");
return NULL;
}
@@ -5983,8 +5933,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnHighlight(PyObject *self, PyObjec
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnHighlight. Expected _wxDC_p.");
return NULL;
}
@@ -6153,8 +6102,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnMovePre(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnMovePre. Expected _wxDC_p.");
return NULL;
}
@@ -6196,8 +6144,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnMovePost(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnMovePost. Expected _wxDC_p.");
return NULL;
}
@@ -6436,8 +6383,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnDrawOutline(PyObject *self, PyObj
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnDrawOutline. Expected _wxDC_p.");
return NULL;
}
@@ -6473,8 +6419,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnDrawControlPoints(PyObject *self,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnDrawControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -6510,8 +6455,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnEraseControlPoints(PyObject *self
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnEraseControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -6549,8 +6493,7 @@ static PyObject *_wrap_wxPyPolygonShape_base_OnMoveLink(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyPolygonShape_base_OnMoveLink. Expected _wxDC_p.");
return NULL;
}
@@ -6899,8 +6842,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnDraw(PyObject *self, PyObject *args,
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnDraw. Expected _wxDC_p.");
return NULL;
}
@@ -6936,8 +6878,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnDrawContents(PyObject *self, PyObjec
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnDrawContents. Expected _wxDC_p.");
return NULL;
}
@@ -6975,8 +6916,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnDrawBranches(PyObject *self, PyObjec
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnDrawBranches. Expected _wxDC_p.");
return NULL;
}
@@ -7013,8 +6953,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnMoveLinks(PyObject *self, PyObject *
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnMoveLinks. Expected _wxDC_p.");
return NULL;
}
@@ -7050,8 +6989,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnErase(PyObject *self, PyObject *args
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnErase. Expected _wxDC_p.");
return NULL;
}
@@ -7087,8 +7025,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnEraseContents(PyObject *self, PyObje
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnEraseContents. Expected _wxDC_p.");
return NULL;
}
@@ -7124,8 +7061,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnHighlight(PyObject *self, PyObject *
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnHighlight. Expected _wxDC_p.");
return NULL;
}
@@ -7294,8 +7230,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnMovePre(PyObject *self, PyObject *ar
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnMovePre. Expected _wxDC_p.");
return NULL;
}
@@ -7337,8 +7272,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnMovePost(PyObject *self, PyObject *a
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnMovePost. Expected _wxDC_p.");
return NULL;
}
@@ -7577,8 +7511,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnDrawOutline(PyObject *self, PyObject
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnDrawOutline. Expected _wxDC_p.");
return NULL;
}
@@ -7614,8 +7547,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnDrawControlPoints(PyObject *self, Py
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnDrawControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -7651,8 +7583,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnEraseControlPoints(PyObject *self, P
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnEraseControlPoints. Expected _wxDC_p.");
return NULL;
}
@@ -7690,8 +7621,7 @@ static PyObject *_wrap_wxPyTextShape_base_OnMoveLink(PyObject *self, PyObject *a
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyTextShape_base_OnMoveLink. Expected _wxDC_p.");
return NULL;
}

View File

@@ -209,7 +209,7 @@ public:
void GetEnds(double *OUTPUT, double *OUTPUT, double *OUTPUT, double *OUTPUT);
wxPyShape * GetFrom();
void GetLabelPosition(int position, double *OUTPUT, double *OUTPUT);
wxPoint * GetNextControlPoint(wxPyShape *shape);
wxRealPoint * GetNextControlPoint(wxPyShape *shape);
wxPyShape * GetTo();
void Initialise();
void InsertLineControlPoint(wxDC* dc);

View File

@@ -257,9 +257,12 @@ class wxArrowHeadPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,oglshapes2c=oglshapes2c):
if self.thisown == 1 :
oglshapes2c.delete_wxArrowHead(self)
def __del__(self, delfunc=oglshapes2c.delete_wxArrowHead):
if self.thisown == 1:
try:
delfunc(self)
except:
pass
def _GetType(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxArrowHead__GetType,(self,) + _args, _kwargs)
return val
@@ -393,7 +396,7 @@ class wxPyLineShapePtr(wxPyShapePtr):
return val
def GetNextControlPoint(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetNextControlPoint,(self,) + _args, _kwargs)
if val: val = wxPointPtr(val)
if val: val = wxRealPointPtr(val)
return val
def GetTo(self, *_args, **_kwargs):
val = apply(oglshapes2c.wxPyLineShape_GetTo,(self,) + _args, _kwargs)

View File

@@ -3,5 +3,5 @@
wx.wxStyledTextEventPtr = wxStyledTextEventPtr
wx.wxStyledTextCtrlPtr = wxStyledTextCtrlPtr
wxSTC_CARET_CENTER = wxSTC_CARET_STRICT
# This constant no longer exists in Scintilla, but I'll put it here for a while to avoid disrupting user code...
wxSTC_CARET_CENTER = 0

View File

@@ -4,3 +4,35 @@
wxTheXmlResource = wxXmlResource_Get()
wx.wxXmlNodePtr = wxXmlNodePtr
#----------------------------------------------------------------------
# Create a factory for handling the subclass property of the object tag.
def _my_import(name):
mod = __import__(name)
components = name.split('.')
for comp in components[1:]:
mod = getattr(mod, comp)
return mod
class wxXmlSubclassFactory_Python(wxXmlSubclassFactory):
def __init__(self):
wxXmlSubclassFactory.__init__(self)
def Create(self, className):
assert className.find('.') != -1, "Module name must be specified!"
mname = className[:className.rfind('.')]
cname = className[className.rfind('.')+1:]
module = _my_import(mname)
klass = getattr(module, cname)
inst = klass()
return inst
wxXmlResource_AddSubclassFactory(wxXmlSubclassFactory_Python())

View File

@@ -19,6 +19,8 @@
/* Implementation : PYTHON */
#define SWIGPYTHON
#include "Python.h"
#include <string.h>
#include <stdlib.h>
/* Definitions for Windows/Unix exporting */
@@ -36,12 +38,9 @@
# define SWIGEXPORT(a) a
#endif
#include "Python.h"
#ifdef __cplusplus
extern "C" {
#endif
extern void SWIG_MakePtr(char *, void *, char *);
extern void SWIG_RegisterMapping(char *, char *, void *(*)(void *));
extern char *SWIG_GetPtr(char *, void **, char *);
@@ -98,6 +97,16 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
static const wxString wxPyBitmapString(wxT("bitmap"));
static const wxString wxPyIconString(wxT("icon"));
static const wxString wxPyFontString(wxT("font"));
class wxPyXmlSubclassFactory : public wxXmlSubclassFactory
{
public:
wxPyXmlSubclassFactory() {}
DEC_PYCALLBACK_OBJECT_STRING_pure(Create);
PYPRIVATE;
};
IMP_PYCALLBACK_OBJECT_STRING_pure(wxPyXmlSubclassFactory, wxXmlSubclassFactory, Create);
// C++ version of Python aware wxXmlResourceHandler, for the pure virtual
// callbacks, as well as to make some protected things public so they can
// be wrapped.
@@ -111,34 +120,6 @@ public:
DEC_PYCALLBACK_OBJECT__pure(DoCreateResource);
DEC_PYCALLBACK_BOOL_NODE_pure(CanHandle);
// wxObject* DoCreateResource() {
// wxObject* rv = NULL;
// wxPyBeginBlockThreads();
// if (wxPyCBH_findCallback(m_myInst, "DoCreateResource")) {
// PyObject* ro;
// ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
// if (ro) {
// SWIG_GetPtrObj(ro, (void **)&rv, "_wxObject_p");
// Py_DECREF(ro);
// }
// }
// wxPyEndBlockThreads();
// return rv;
// }
// bool CanHandle(wxXmlNode* a) {
// bool rv=FALSE;
// wxPyBeginBlockThreads();
// if (wxPyCBH_findCallback(m_myInst, "CanHandle")) {
// PyObject* obj = wxPyConstructObject((void*)a, "wxXmlNode", 0);
// rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));
// Py_DECREF(obj);
// }
// wxPyEndBlockThreads();
// return rv;
// }
// accessors for protected members
@@ -576,6 +557,33 @@ static PyObject *_wrap_wxXmlResource_ClearHandlers(PyObject *self, PyObject *arg
return _resultobj;
}
static PyObject *_wrap_wxXmlResource_AddSubclassFactory(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPyXmlSubclassFactory * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "factory", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxXmlResource_AddSubclassFactory",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlSubclassFactory_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResource_AddSubclassFactory. Expected _wxPyXmlSubclassFactory_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxXmlResource::AddSubclassFactory(_arg0);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxXmlResource_LoadMenu(_swigobj,_swigarg0) (_swigobj->LoadMenu(_swigarg0))
static PyObject *_wrap_wxXmlResource_LoadMenu(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -1521,6 +1529,99 @@ static PyObject *_wrap_wxXmlResource_GetFlags(PyObject *self, PyObject *args, Py
return _resultobj;
}
#define wxXmlResource_SetFlags(_swigobj,_swigarg0) (_swigobj->SetFlags(_swigarg0))
static PyObject *_wrap_wxXmlResource_SetFlags(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxXmlResource * _arg0;
int _arg1;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","flags", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi:wxXmlResource_SetFlags",_kwnames,&_argo0,&_arg1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlResource_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlResource_SetFlags. Expected _wxXmlResource_p.");
return NULL;
}
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxXmlResource_SetFlags(_arg0,_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define new_wxXmlSubclassFactory() (new wxPyXmlSubclassFactory())
static PyObject *_wrap_new_wxXmlSubclassFactory(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPyXmlSubclassFactory * _result;
char *_kwnames[] = { NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,":new_wxXmlSubclassFactory",_kwnames))
return NULL;
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
_result = (wxPyXmlSubclassFactory *)new_wxXmlSubclassFactory();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxPyXmlSubclassFactory_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxXmlSubclassFactory__setCallbackInfo(_swigobj,_swigarg0,_swigarg1) (_swigobj->_setCallbackInfo(_swigarg0,_swigarg1))
static PyObject *_wrap_wxXmlSubclassFactory__setCallbackInfo(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxPyXmlSubclassFactory * _arg0;
PyObject * _arg1;
PyObject * _arg2;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","self","_class", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxXmlSubclassFactory__setCallbackInfo",_kwnames,&_argo0,&_obj1,&_obj2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxPyXmlSubclassFactory_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlSubclassFactory__setCallbackInfo. Expected _wxPyXmlSubclassFactory_p.");
return NULL;
}
}
{
_arg1 = _obj1;
}
{
_arg2 = _obj2;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxXmlSubclassFactory__setCallbackInfo(_arg0,_arg1,_arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define new_wxXmlProperty(_swigarg0,_swigarg1,_swigarg2) (new wxXmlProperty(_swigarg0,_swigarg1,_swigarg2))
static PyObject *_wrap_new_wxXmlProperty(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -1606,7 +1707,7 @@ static PyObject *_wrap_wxXmlProperty_GetName(PyObject *self, PyObject *args, PyO
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -1643,7 +1744,7 @@ static PyObject *_wrap_wxXmlProperty_GetValue(PyObject *self, PyObject *args, Py
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -2260,7 +2361,7 @@ static PyObject *_wrap_wxXmlNode_GetName(PyObject *self, PyObject *args, PyObjec
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -2297,7 +2398,7 @@ static PyObject *_wrap_wxXmlNode_GetContent(PyObject *self, PyObject *args, PyOb
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -2488,7 +2589,7 @@ static PyObject *_wrap_wxXmlNode_GetPropVal(PyObject *self, PyObject *args, PyOb
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -3143,8 +3244,7 @@ static PyObject *_wrap_wxXmlDocument_SaveToStream(PyObject *self, PyObject *args
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxOutputStream_p")) {
if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxOutputStream_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxXmlDocument_SaveToStream. Expected _wxOutputStream_p.");
return NULL;
}
@@ -3248,7 +3348,7 @@ static PyObject *_wrap_wxXmlDocument_GetVersion(PyObject *self, PyObject *args,
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -3285,7 +3385,7 @@ static PyObject *_wrap_wxXmlDocument_GetFileEncoding(PyObject *self, PyObject *a
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -3443,7 +3543,7 @@ static PyObject *_wrap_wxXmlDocument_GetEncoding(PyObject *self, PyObject *args,
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -3454,6 +3554,51 @@ static PyObject *_wrap_wxXmlDocument_GetEncoding(PyObject *self, PyObject *args,
return _resultobj;
}
static void wxXmlDocument_SetEncoding(wxXmlDocument *self,const wxString & enc) {
#if wxUSE_UNICODE
// do nothing
#else
self->SetEncoding(enc);
#endif
}
static PyObject *_wrap_wxXmlDocument_SetEncoding(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxXmlDocument * _arg0;
wxString * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
char *_kwnames[] = { "self","enc", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxXmlDocument_SetEncoding",_kwnames,&_argo0,&_obj1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxXmlDocument_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxXmlDocument_SetEncoding. Expected _wxXmlDocument_p.");
return NULL;
}
}
{
_arg1 = wxString_in_helper(_obj1);
if (_arg1 == NULL)
return NULL;
}
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
wxXmlDocument_SetEncoding(_arg0,*_arg1);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) return NULL;
} Py_INCREF(Py_None);
_resultobj = Py_None;
{
if (_obj1)
delete _arg1;
}
return _resultobj;
}
static void *SwigwxPyXmlResourceHandlerTowxObject(void *ptr) {
wxPyXmlResourceHandler *src;
wxObject *dest;
@@ -3714,7 +3859,7 @@ static PyObject *_wrap_wxXmlResourceHandler_GetClass(PyObject *self, PyObject *a
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -3920,7 +4065,7 @@ static PyObject *_wrap_wxXmlResourceHandler_GetNodeContent(PyObject *self, PyObj
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -4049,7 +4194,7 @@ static PyObject *_wrap_wxXmlResourceHandler_GetParamValue(PyObject *self, PyObje
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -4209,7 +4354,7 @@ static PyObject *_wrap_wxXmlResourceHandler_GetText(PyObject *self, PyObject *ar
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -4278,7 +4423,7 @@ static PyObject *_wrap_wxXmlResourceHandler_GetName(PyObject *self, PyObject *ar
if (PyErr_Occurred()) return NULL;
}{
#if wxUSE_UNICODE
_resultobj = PyUnicode_FromUnicode(_result->c_str(), _result->Len());
_resultobj = PyUnicode_FromWideChar(_result->c_str(), _result->Len());
#else
_resultobj = PyString_FromStringAndSize(_result->c_str(), _result->Len());
#endif
@@ -4569,8 +4714,7 @@ static PyObject *_wrap_wxXmlResourceHandler_GetBitmap(PyObject *self, PyObject *
return NULL;
}
if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArtClient_p")) {
if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArtClient_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResourceHandler_GetBitmap. Expected _wxArtClient_p.");
return NULL;
}
@@ -4629,8 +4773,7 @@ static PyObject *_wrap_wxXmlResourceHandler_GetIcon(PyObject *self, PyObject *ar
return NULL;
}
if (_argo2) {
if (_argo2 == Py_None) { _arg2 = NULL; }
else if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArtClient_p")) {
if (SWIG_GetPtrObj(_argo2,(void **) &_arg2,"_wxArtClient_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 3 of wxXmlResourceHandler_GetIcon. Expected _wxArtClient_p.");
return NULL;
}
@@ -4942,6 +5085,7 @@ static PyMethodDef xrccMethods[] = {
{ "wxXmlResourceHandler_CreateResource", (PyCFunction) _wrap_wxXmlResourceHandler_CreateResource, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResourceHandler__setCallbackInfo", (PyCFunction) _wrap_wxXmlResourceHandler__setCallbackInfo, METH_VARARGS | METH_KEYWORDS },
{ "new_wxXmlResourceHandler", (PyCFunction) _wrap_new_wxXmlResourceHandler, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlDocument_SetEncoding", (PyCFunction) _wrap_wxXmlDocument_SetEncoding, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlDocument_GetEncoding", (PyCFunction) _wrap_wxXmlDocument_GetEncoding, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlDocument_SetFileEncoding", (PyCFunction) _wrap_wxXmlDocument_SetFileEncoding, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlDocument_SetVersion", (PyCFunction) _wrap_wxXmlDocument_SetVersion, METH_VARARGS | METH_KEYWORDS },
@@ -4990,6 +5134,9 @@ static PyMethodDef xrccMethods[] = {
{ "wxXmlProperty_GetValue", (PyCFunction) _wrap_wxXmlProperty_GetValue, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlProperty_GetName", (PyCFunction) _wrap_wxXmlProperty_GetName, METH_VARARGS | METH_KEYWORDS },
{ "new_wxXmlProperty", (PyCFunction) _wrap_new_wxXmlProperty, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlSubclassFactory__setCallbackInfo", (PyCFunction) _wrap_wxXmlSubclassFactory__setCallbackInfo, METH_VARARGS | METH_KEYWORDS },
{ "new_wxXmlSubclassFactory", (PyCFunction) _wrap_new_wxXmlSubclassFactory, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_SetFlags", (PyCFunction) _wrap_wxXmlResource_SetFlags, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_GetFlags", (PyCFunction) _wrap_wxXmlResource_GetFlags, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_Set", (PyCFunction) _wrap_wxXmlResource_Set, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_Get", (PyCFunction) _wrap_wxXmlResource_Get, METH_VARARGS | METH_KEYWORDS },
@@ -5011,6 +5158,7 @@ static PyMethodDef xrccMethods[] = {
{ "wxXmlResource_LoadMenuBarOnFrame", (PyCFunction) _wrap_wxXmlResource_LoadMenuBarOnFrame, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_LoadMenuBar", (PyCFunction) _wrap_wxXmlResource_LoadMenuBar, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_LoadMenu", (PyCFunction) _wrap_wxXmlResource_LoadMenu, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_AddSubclassFactory", (PyCFunction) _wrap_wxXmlResource_AddSubclassFactory, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_ClearHandlers", (PyCFunction) _wrap_wxXmlResource_ClearHandlers, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_InsertHandler", (PyCFunction) _wrap_wxXmlResource_InsertHandler, METH_VARARGS | METH_KEYWORDS },
{ "wxXmlResource_AddHandler", (PyCFunction) _wrap_wxXmlResource_AddHandler, METH_VARARGS | METH_KEYWORDS },

View File

@@ -48,6 +48,9 @@
static const wxString wxPyIconString(wxT("icon"));
static const wxString wxPyFontString(wxT("font"));
%}
class wxPyXmlSubclassFactory;
//---------------------------------------------------------------------------
enum wxXmlResourceFlags
@@ -128,6 +131,12 @@ public:
// Removes all handlers
void ClearHandlers();
// Registers subclasses factory for use in XRC. This function is not meant
// for public use, please see the comment above wxXmlSubclassFactory
// definition.
static void AddSubclassFactory(wxPyXmlSubclassFactory *factory);
// Loads menu from resource. Returns NULL on failure.
wxMenu *LoadMenu(const wxString& name);
@@ -199,6 +208,9 @@ public:
// Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING.
int GetFlags();
// Set flags after construction.
void SetFlags(int flags) { m_flags = flags; }
};
//----------------------------------------------------------------------
@@ -215,6 +227,31 @@ XMLCTRL = XRCCTRL
"
//----------------------------------------------------------------------
// wxXmlSubclassFactory
%{
class wxPyXmlSubclassFactory : public wxXmlSubclassFactory
{
public:
wxPyXmlSubclassFactory() {}
DEC_PYCALLBACK_OBJECT_STRING_pure(Create);
PYPRIVATE;
};
IMP_PYCALLBACK_OBJECT_STRING_pure(wxPyXmlSubclassFactory, wxXmlSubclassFactory, Create);
%}
%name(wxXmlSubclassFactory)class wxPyXmlSubclassFactory {
public:
wxPyXmlSubclassFactory();
void _setCallbackInfo(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxXmlSubclassFactory)"
};
//----------------------------------------------------------------------
// In order to provide wrappers for wxXmlResourceHandler we need to also
// provide the classes for representing and parsing XML.
@@ -374,6 +411,13 @@ public:
return self->GetEncoding();
#endif
}
void SetEncoding(const wxString& enc) {
#if wxUSE_UNICODE
// do nothing
#else
self->SetEncoding(enc);
#endif
}
}
};
@@ -396,34 +440,6 @@ public:
DEC_PYCALLBACK_OBJECT__pure(DoCreateResource);
DEC_PYCALLBACK_BOOL_NODE_pure(CanHandle);
// wxObject* DoCreateResource() {
// wxObject* rv = NULL;
// wxPyBeginBlockThreads();
// if (wxPyCBH_findCallback(m_myInst, "DoCreateResource")) {
// PyObject* ro;
// ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
// if (ro) {
// SWIG_GetPtrObj(ro, (void **)&rv, "_wxObject_p");
// Py_DECREF(ro);
// }
// }
// wxPyEndBlockThreads();
// return rv;
// }
// bool CanHandle(wxXmlNode* a) {
// bool rv=FALSE;
// wxPyBeginBlockThreads();
// if (wxPyCBH_findCallback(m_myInst, "CanHandle")) {
// PyObject* obj = wxPyConstructObject((void*)a, "wxXmlNode", 0);
// rv = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj));
// Py_DECREF(obj);
// }
// wxPyEndBlockThreads();
// return rv;
// }
// accessors for protected members

View File

@@ -56,9 +56,12 @@ class wxXmlResourcePtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,xrcc=xrcc):
if self.thisown == 1 :
xrcc.delete_wxXmlResource(self)
def __del__(self, delfunc=xrcc.delete_wxXmlResource):
if self.thisown == 1:
try:
delfunc(self)
except:
pass
def Load(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_Load,(self,) + _args, _kwargs)
return val
@@ -135,6 +138,9 @@ class wxXmlResourcePtr(wxObjectPtr):
def GetFlags(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_GetFlags,(self,) + _args, _kwargs)
return val
def SetFlags(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlResource_SetFlags,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxXmlResource instance at %s>" % (self.this,)
class wxXmlResource(wxXmlResourcePtr):
@@ -152,6 +158,24 @@ def wxEmptyXmlResource(*_args,**_kwargs):
return val
class wxXmlSubclassFactoryPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def _setCallbackInfo(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlSubclassFactory__setCallbackInfo,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxXmlSubclassFactory instance at %s>" % (self.this,)
class wxXmlSubclassFactory(wxXmlSubclassFactoryPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(xrcc.new_wxXmlSubclassFactory,_args,_kwargs)
self.thisown = 1
self._setCallbackInfo(self, wxXmlSubclassFactory)
class wxXmlPropertyPtr :
def __init__(self,this):
self.this = this
@@ -189,9 +213,12 @@ class wxXmlNodePtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,xrcc=xrcc):
if self.thisown == 1 :
xrcc.delete_wxXmlNode(self)
def __del__(self, delfunc=xrcc.delete_wxXmlNode):
if self.thisown == 1:
try:
delfunc(self)
except:
pass
def AddChild(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlNode_AddChild,(self,) + _args, _kwargs)
return val
@@ -281,9 +308,12 @@ class wxXmlDocumentPtr(wxObjectPtr):
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,xrcc=xrcc):
if self.thisown == 1 :
xrcc.delete_wxXmlDocument(self)
def __del__(self, delfunc=xrcc.delete_wxXmlDocument):
if self.thisown == 1:
try:
delfunc(self)
except:
pass
def Load(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlDocument_Load,(self,) + _args, _kwargs)
return val
@@ -321,6 +351,9 @@ class wxXmlDocumentPtr(wxObjectPtr):
def GetEncoding(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlDocument_GetEncoding,(self,) + _args, _kwargs)
return val
def SetEncoding(self, *_args, **_kwargs):
val = apply(xrcc.wxXmlDocument_SetEncoding,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxXmlDocument instance at %s>" % (self.this,)
class wxXmlDocument(wxXmlDocumentPtr):
@@ -474,6 +507,8 @@ class wxXmlResourceHandler(wxXmlResourceHandlerPtr):
#-------------- FUNCTION WRAPPERS ------------------
wxXmlResource_AddSubclassFactory = xrcc.wxXmlResource_AddSubclassFactory
wxXmlResource_GetXRCID = xrcc.wxXmlResource_GetXRCID
def wxXmlResource_Get(*_args, **_kwargs):
@@ -515,3 +550,35 @@ wxXML_HTML_DOCUMENT_NODE = xrcc.wxXML_HTML_DOCUMENT_NODE
wxTheXmlResource = wxXmlResource_Get()
wx.wxXmlNodePtr = wxXmlNodePtr
#----------------------------------------------------------------------
# Create a factory for handling the subclass property of the object tag.
def _my_import(name):
mod = __import__(name)
components = name.split('.')
for comp in components[1:]:
mod = getattr(mod, comp)
return mod
class wxXmlSubclassFactory_Python(wxXmlSubclassFactory):
def __init__(self):
wxXmlSubclassFactory.__init__(self)
def Create(self, className):
assert className.find('.') != -1, "Module name must be specified!"
mname = className[:className.rfind('.')]
cname = className[className.rfind('.')+1:]
module = _my_import(mname)
klass = getattr(module, cname)
inst = klass()
return inst
wxXmlResource_AddSubclassFactory(wxXmlSubclassFactory_Python())

View File

@@ -1,6 +1,9 @@
*.pyc
.DS_Store
._demo.py
.emacs.desktop
.gdb_history
.setup.sh
b.bat
hangman_dict.txt
mimetypes_wdr

View File

@@ -1,4 +1,4 @@
import sys, string
import sys
from wxPython.wx import *
from wxPython.html import *
@@ -46,12 +46,12 @@ demo item so you can learn how to use the classes yourself.</p>
def __init__(self, parent):
wxDialog.__init__(self, parent, -1, 'About the wxPython demo',)
html = wxHtmlWindow(self, -1, size=(420, -1))
py_version = string.split(sys.version)[0]
py_version = sys.version.split()[0]
html.SetPage(self.text % (wx.__version__, py_version))
btn = html.FindWindowById(wxID_OK)
btn.SetDefault()
ir = html.GetInternalRepresentation()
html.SetSize( (ir.GetWidth()+5, ir.GetHeight()+5) )
html.SetSize( (ir.GetWidth()+25, ir.GetHeight()+25) )
self.SetClientSize(html.GetSize())
self.CentreOnParent(wxBOTH)

View File

@@ -62,7 +62,7 @@ class TestPanel(wxPanel):
sizer.Add(btnSizer, 0, wxEXPAND)
self.SetSizer(sizer)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
EVT_WINDOW_DESTROY(self, self.OnDestroy)
@@ -121,7 +121,7 @@ if __name__ == '__main__':
app = wxPySimpleApp()
frame = TestFrame()
frame.Show(true)
frame.Show(True)
app.MainLoop()

View File

@@ -101,12 +101,18 @@ class TestPanel(wxWindow):
self.location.Append(self.current)
self.SetSizer(sizer)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
EVT_SIZE(self, self.OnSize)
EVT_WINDOW_DESTROY(self, self.OnDestroy)
def ShutdownDemo(self):
# put the frame title back
if self.frame:
self.frame.SetTitle(self.titleBase)
def OnDestroy(self, evt):
if self.ie:
self.ie.Cleanup()
@@ -224,7 +230,7 @@ if __name__ == '__main__':
app = wxPySimpleApp()
frame = TestFrame()
frame.Show(true)
frame.Show(True)
app.MainLoop()

View File

@@ -18,7 +18,6 @@
from wxPython.wx import *
from wxPython.lib.colourselect import *
import string
#----------------------------------------------------------------------------
@@ -26,7 +25,7 @@ class TestColourSelect(wxPanel):
def __init__(self, parent, log):
self.log = log
wxPanel.__init__(self, parent, -1)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
mainSizer = wxBoxSizer(wxVERTICAL)
self.SetSizer(mainSizer)
t = wxStaticText(self, -1,
@@ -86,7 +85,7 @@ class TestColourSelect(wxPanel):
colour = button.GetColour() # get the colour selection button result
result.append(name + ": " + str(colour)) # create string list for easy viewing of results
out_result = string.joinfields(result, ', ')
out_result = ', '.join(result)
self.log.WriteText("Colour Results: " + out_result + "\n")
#---------------------------------------------------------------------------

View File

@@ -53,7 +53,7 @@ class TestPanel(wxPanel):
border = wxBoxSizer(wxVERTICAL)
border.Add(sizer, 0, wxALL, 25)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(border)
self.Layout()

View File

@@ -124,7 +124,8 @@ class DoodleDropTarget(wxPyDropTarget):
self.dv = window
# specify the type of data we will accept
self.data = wxCustomDataObject(wxCustomDataFormat("DoodleLines"))
self.df = wxCustomDataFormat("DoodleLines")
self.data = wxCustomDataObject(self.df)
self.SetDataObject(self.data)
@@ -138,7 +139,7 @@ class DoodleDropTarget(wxPyDropTarget):
def OnDrop(self, x, y):
self.log.WriteText("OnDrop: %d %d\n" % (x, y))
return true
return True
def OnDragOver(self, x, y, d):
#self.log.WriteText("OnDragOver: %d, %d, %d\n" % (x, y, d))
@@ -153,7 +154,7 @@ class DoodleDropTarget(wxPyDropTarget):
# Called when OnDrop returns true. We need to get the data and
# Called when OnDrop returns True. We need to get the data and
# do something with it.
def OnData(self, x, y, d):
self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
@@ -205,7 +206,7 @@ class CustomDnDPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False))
# Make the controls
text1 = wxStaticText(self, -1,
@@ -217,9 +218,9 @@ class CustomDnDPanel(wxPanel):
)
rb1 = wxRadioButton(self, -1, "Draw", style=wxRB_GROUP)
rb1.SetValue(true)
rb1.SetValue(True)
rb2 = wxRadioButton(self, -1, "Drag")
rb2.SetValue(false)
rb2.SetValue(False)
text2 = wxStaticText(self, -1,
"The lower window is accepting a\n"
@@ -249,7 +250,7 @@ class CustomDnDPanel(wxPanel):
sizer.Add(dndsizer, 1, wxEXPAND)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(sizer)
# Events
@@ -269,12 +270,12 @@ class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
sizer = wxBoxSizer(wxVERTICAL)
msg = "Custom Drag-And-Drop"
text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE)
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false))
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, False))
text.SetLabel(msg)
w,h = text.GetTextExtent(msg)
text.SetSize(wxSize(w,h+1))
@@ -303,8 +304,9 @@ if __name__ == '__main__':
class TestApp(wxApp):
def OnInit(self):
wxInitAllImageHandlers()
self.MakeFrame()
return true
return True
def MakeFrame(self, event=None):
frame = wxFrame(None, -1, "Custom Drag and Drop", size=(550,400))
@@ -315,7 +317,7 @@ if __name__ == '__main__':
frame.SetMenuBar(mb)
EVT_MENU(frame, 6543, self.MakeFrame)
panel = TestPanel(frame, DummyLog())
frame.Show(true)
frame.Show(True)
self.SetTopWindow(frame)
@@ -326,21 +328,20 @@ if __name__ == '__main__':
#----------------------------------------------------------------------
overview = """<html><body>
This demo shows Drag and Drop using a custom data type and a custom
data object. A type called "DoodleLines" is created and a Python
Pickle of a list is actually transfered in the drag and drop
opperation.
A second data object is also created containing a bitmap of the image
and is made available to any drop target that accepts bitmaps, such as
MS Word.
overview = """\
This demo shows Drag and Drop using a custom data type and a custom data object. A type called "DoodleLines" is created and a Python Pickle of a list is actually transfered in the drag and drop opperation.
A second data object is also created containing a bitmap of the image and is made available to any drop target that accepts bitmaps, such as MS Word.
The two data objects are combined in a wxDataObjectComposite and the rest is handled by the framework.
The two data objects are combined in a wxDataObjectComposite and the
rest is handled by the framework.
</body></html>
"""

View File

@@ -88,13 +88,13 @@ if __name__ == "__main__":
# Create an instance of our customized Frame class
frame = MyFrame(None, -1, "This is a test")
frame.Show(true)
frame.Show(True)
# Tell wxWindows that this is our main window
self.SetTopWindow(frame)
# Return a success flag
return true
return True
app = MyApp(0) # Create an instance of the application class
@@ -107,7 +107,7 @@ if __name__ == "__main__":
def runTest(frame, nb, log):
win = MyFrame(frame, -1, "This is a test")
frame.otherWin = win
win.Show(true)
win.Show(True)
overview = """\

View File

@@ -8,7 +8,7 @@ class ClipTextPanel(wxPanel):
wxPanel.__init__(self, parent, -1)
self.log = log
#self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
#self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False))
sizer = wxBoxSizer(wxVERTICAL)
sizer.Add(wxStaticText(self, -1,
@@ -28,7 +28,7 @@ class ClipTextPanel(wxPanel):
EVT_BUTTON(self, 6051, self.OnPaste)
EVT_BUTTON(self, 6052, self.OnCopyBitmap)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(sizer)
@@ -86,7 +86,7 @@ class OtherDropTarget(wxPyDropTarget):
def OnDrop(self, x, y):
self.log.WriteText("OnDrop: %d %d\n" % (x, y))
return true
return True
def OnData(self, x, y, d):
self.log.WriteText("OnData: %d, %d, %d\n" % (x, y, d))
@@ -128,7 +128,7 @@ class FileDropPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
#self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
#self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False))
sizer = wxBoxSizer(wxVERTICAL)
sizer.Add(wxStaticText(self, -1, " \nDrag some files here:"),
@@ -148,7 +148,7 @@ class FileDropPanel(wxPanel):
self.text2.SetDropTarget(dt)
sizer.Add(self.text2, 1, wxEXPAND)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(sizer)
@@ -166,12 +166,12 @@ class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
outsideSizer = wxBoxSizer(wxVERTICAL)
msg = "Clipboard / Drag-And-Drop"
text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE)
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false))
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, False))
text.SetLabel(msg)
w,h = text.GetTextExtent(msg)
text.SetSize(wxSize(w,h+1))

View File

@@ -46,6 +46,43 @@ def makeRandomLines(num, w, h):
return pnts
def makeRandomRectangles(num, W, H):
rects = []
for i in range(num):
w = whrandom.randint(10, W/2)
h = whrandom.randint(10, H/2)
x = whrandom.randint(0, W - w)
y = whrandom.randint(0, H - h)
rects.append( (x, y, w, h) )
return rects
def makeRandomText(num):
Np = 8 # number of charcters in text
text = []
for i in range(num):
word = []
for i in range(Np):
c = chr( whrandom.randint(48, 122) )
word.append( c )
text.append( "".join(word) )
return text
def makeRandomPolygons(num, W, H):
Np = 8 # number of points per polygon
polys = []
for i in range(num):
poly = []
for i in range(Np):
x = whrandom.randint(0, W)
y = whrandom.randint(0, H)
poly.append( (x,y) )
polys.append( poly )
return polys
def makeRandomPens(num, cache):
pens = []
for i in range(num):
@@ -57,62 +94,278 @@ def makeRandomPens(num, cache):
return pens
class TestPanel(wxPanel):
def __init__(self, parent, size, log):
wxPanel.__init__(self, parent, -1, size=size)
def makeRandomBrushes(num, cache):
brushes = []
for i in range(num):
c = whrandom.choice(colours)
if not cache.has_key(c):
cache[c] = wxBrush(c)
brushes.append( cache[c] )
return brushes
def makeRandomColors(num):
colors = []
for i in range(num):
c = whrandom.choice(colours)
colors.append(wxNamedColor(c))
return colors
pencache = {}
brushcache = {}
points = None
lines = None
rectangles = None
polygons = None
text = None
pens = None
brushes = None
colors1 = None
colors2 = None
def Init(w, h, n):
global pencache
global brushcache
global points
global lines
global rectangles
global polygons
global text
global pens
global brushes
global colors1
global colors2
# make some lists of random shapes
points = makeRandomPoints(n, w, h)
try:
import Numeric
Apoints = Numeric.array(points)
except:
pass
lines = makeRandomLines(n, w, h)
rectangles = makeRandomRectangles(n, w, h)
polygons = makeRandomPolygons(n, w, h)
text = makeRandomText(n)
# make some random pens and brushes
pens = makeRandomPens(n, pencache)
brushes = makeRandomBrushes(n, brushcache)
# make some random color lists
colors1 = makeRandomColors(n)
colors2 = makeRandomColors(n)
def TestPoints(dc,log):
dc.BeginDrawing()
start = time.time()
dc.SetPen(wxPen("BLACK", 4))
dc.DrawPointList(points)
dc.DrawPointList(points, wxPen("RED", 2))
dc.DrawPointList(points, pens)
dc.EndDrawing()
log.write("DrawTime: %s seconds with DrawPointList\n" % (time.time() - start))
def TestArrayPoints(dc,log):
try:
import Numeric
dc.BeginDrawing()
start = time.time()
dc.SetPen(wxPen("BLACK", 1))
for i in range(1):
dc.DrawPointList(Apoints)
#dc.DrawPointList(Apoints, wxPen("RED", 2))
#dc.DrawPointList(Apoints, pens)
dc.EndDrawing()
log.write("DrawTime: %s seconds with DrawPointList an Numpy Array\n" % (time.time() - start))
except ImportError:
log.write("Couldn't import Numeric")
pass
def TestLines(dc,log):
dc.BeginDrawing()
start = time.time()
dc.SetPen(wxPen("BLACK", 2))
dc.DrawLineList(lines)
dc.DrawLineList(lines, wxPen("RED", 2))
dc.DrawLineList(lines, pens)
dc.EndDrawing()
log.write("DrawTime: %s seconds with DrawLineList\n" % (time.time() - start))
def TestRectangles(dc,log):
dc.BeginDrawing()
start = time.time()
dc.SetPen( wxPen("BLACK",1) )
dc.SetBrush( wxBrush("RED") )
dc.DrawRectangleList(rectangles)
dc.DrawRectangleList(rectangles,pens)
dc.DrawRectangleList(rectangles,pens[0],brushes)
dc.DrawRectangleList(rectangles,pens,brushes[0])
dc.DrawRectangleList(rectangles,None,brushes)
## for i in range(10):
## #dc.DrawRectangleList(rectangles,pens,brushes)
## dc.DrawRectangleList(rectangles)
dc.EndDrawing()
log.write("DrawTime: %s seconds with DrawRectanglesList\n" % (time.time() - start))
def TestEllipses(dc,log):
dc.BeginDrawing()
start = time.time()
dc.SetPen( wxPen("BLACK",1) )
dc.SetBrush( wxBrush("RED") )
dc.DrawEllipseList(rectangles)
dc.DrawEllipseList(rectangles,pens)
dc.DrawEllipseList(rectangles,pens[0],brushes)
dc.DrawEllipseList(rectangles,pens,brushes[0])
dc.DrawEllipseList(rectangles,None,brushes)
dc.DrawEllipseList(rectangles,pens,brushes)
dc.EndDrawing()
log.write("DrawTime: %s seconds with DrawEllipsesList\n" % (time.time() - start))
def TestRectanglesArray(dc,log):
try:
import Numeric
Apoints = Numeric.array(rectangles)
dc.BeginDrawing()
start = time.time()
dc.SetPen(wxPen("BLACK", 1))
dc.DrawRectangleList(rectangles)
dc.DrawRectangleList(rectangles,pens)
dc.DrawRectangleList(rectangles,pens[0],brushes)
dc.DrawRectangleList(rectangles,pens,brushes[0])
dc.DrawRectangleList(rectangles,None,brushes)
## for i in range(10):
## #dc.DrawRectangleList(rectangles,pens,brushes)
## dc.DrawRectangleList(rectangles)
dc.EndDrawing()
log.write("DrawTime: %s seconds with DrawRectangleList and Numpy Array\n" % (time.time() - start))
except ImportError:
log.write("Couldn't import Numeric")
pass
def TestRectanglesLoop(dc,log):
dc.BeginDrawing()
start = time.time()
dc.DrawRectangleList(rectangles,pens,brushes)
log.write("DrawTime: %s seconds with DrawRectanglesList\n" % (time.time() - start))
start = time.time()
for i in range(len(rectangles)):
dc.SetPen( pens[i] )
dc.SetBrush( brushes[i] )
dc.DrawRectangle(rectangles[i][0],rectangles[i][1],rectangles[i][2],rectangles[i][3])
dc.EndDrawing()
log.write("DrawTime: %s seconds with Python loop\n" % (time.time() - start))
def TestPolygons(dc,log):
dc.BeginDrawing()
start = time.time()
dc.SetPen(wxPen("BLACK", 1))
dc.DrawPolygonList(polygons)
dc.DrawPolygonList(polygons,pens)
dc.DrawPolygonList(polygons,pens[0],brushes)
dc.DrawPolygonList(polygons,pens,brushes[0])
dc.DrawPolygonList(polygons,None,brushes)
log.write("DrawTime: %s seconds with DrawPolygonList\n" % (time.time() - start))
dc.EndDrawing()
def TestText(dc,log):
dc.BeginDrawing()
start = time.time()
# NOTE: you need to set BackgroundMode for the background colors to be used.
dc.SetBackgroundMode(wxSOLID)
foreground = colors1
background = colors2
dc.DrawTextList(text, points, foreground, background)
log.write("DrawTime: %s seconds with DrawTextList\n" % (time.time() - start))
dc.EndDrawing()
class TestNB(wxNotebook):
def __init__(self, parent, id, log):
style = wxNB_BOTTOM
if wxPlatform == "__WXMAC__":
style = 0
wxNotebook.__init__(self, parent, id, style=style)
self.log = log
win = DrawPanel(self, TestEllipses, log)
self.AddPage(win, 'Ellipses')
win = DrawPanel(self, TestText, log)
self.AddPage(win, 'Text')
win = DrawPanel(self, TestPolygons, log)
self.AddPage(win, 'Polygons')
win = DrawPanel(self, TestPoints, log)
self.AddPage(win, 'Points')
win = DrawPanel(self, TestLines, log)
self.AddPage(win, 'Lines')
win = DrawPanel(self, TestRectangles, log)
self.AddPage(win, 'Rectangles')
class DrawPanel(wxPanel):
def __init__(self, parent, drawFun, log):
wxPanel.__init__(self, parent, -1)
self.SetBackgroundColour(wxWHITE)
w = size.width
h = size.height
pencache = {}
# make some lists of random points
self.pnts1 = makeRandomPoints(1000, w, h)
self.pnts2 = makeRandomPoints(1000, w, h)
self.pnts3 = makeRandomPoints(1000, w, h)
self.pens1 = makeRandomPens(1000, pencache)
# and now some lines
self.lines1 = makeRandomLines(500, w, h)
self.lines2 = makeRandomLines(500, w, h)
self.lines3 = makeRandomLines(500, w, h)
self.pens2 = makeRandomPens(500, pencache)
self.log = log
self.drawFun = drawFun
EVT_PAINT(self, self.OnPaint)
def OnPaint(self, evt):
dc = wxPaintDC(self)
dc.BeginDrawing()
start = time.time()
dc.Clear()
self.drawFun(dc,self.log)
dc.SetPen(wxPen("BLACK", 1))
dc.DrawPointList(self.pnts1)
dc.DrawPointList(self.pnts2, wxPen("RED", 2))
dc.DrawPointList(self.pnts3, self.pens1)
dc.SetPen(wxPen("BLACK", 1))
dc.DrawLineList(self.lines1)
dc.DrawLineList(self.lines2, wxPen("RED", 2))
dc.DrawLineList(self.lines3, self.pens2)
dc.EndDrawing()
self.log.write("DrawTime: %s seconds\n" % (time.time() - start))
self.log.write("GetBoundingBox: %s\n" % (dc.GetBoundingBox(), ))
#----------------------------------------------------------------------
def runTest(frame, nb, log):
w = nb.GetClientSize().width
h = nb.GetClientSize().height
if w < 300: w = 300
if h < 300: h = 300
win = wxPanel(nb, -1)
tp = TestPanel(win, wxSize(w, h), log)
def OnPanelSize(evt, tp=tp):
tp.SetSize(evt.GetSize())
EVT_SIZE(win, OnPanelSize)
if w < 600: w = 600
if h < 400: h = 400
Init(w, h, 200)
win = TestNB(nb, -1, log)
return win
#----------------------------------------------------------------------
@@ -136,4 +389,30 @@ drawing routines. Currently they are:
(x1,y1, x2,y2) andd pens is either None, a single pen or a list
of pens.
<pre>
DrawRectangleList(rectangles, pens=None, brushes=None)
</pre>
<pre>
DrawEllipseList(ellipses, pens=None, brushes=None)
</pre>
<pre>
DrawPolygonList(polygons, pens=None, brushes=None)
</pre>
<pre>
DrawTextList(textList, coords, foregrounds = None, backgrounds = None)
</pre>
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])])

View File

@@ -14,14 +14,14 @@ ID_BUTTON_wxPyNonFatalErrorDialog = 10004
ID_BUTTON_wxPyFatalErrorDialogWithTraceback = 10005
ID_BUTTON_wxPyNonFatalErrorDialogWithTraceback = 10006
def ErrorDialogsDemoPanelFunc( parent, call_fit = true, set_sizer = true ):
def ErrorDialogsDemoPanelFunc( parent, call_fit = True, set_sizer = True ):
item0 = wxBoxSizer( wxVERTICAL )
item1 = wxStaticText( parent, ID_TEXT, "Please select one of the buttons below for an example using explicit errors...", wxDefaultPosition, wxDefaultSize, 0 )
item0.AddWindow( item1, 0, wxALIGN_CENTRE|wxALL, 5 )
item2 = wxFlexGridSizer( 0, 2, 0, 0 )
item3 = wxButton( parent, ID_BUTTON_wxPyNonFatalError, "wxPyNonFatalError", wxDefaultPosition, wxDefaultSize, 0 )
item2.AddWindow( item3, 0, wxALIGN_CENTRE|wxALL, 5 )
@@ -34,7 +34,7 @@ def ErrorDialogsDemoPanelFunc( parent, call_fit = true, set_sizer = true ):
item0.AddWindow( item5, 0, wxALIGN_CENTRE|wxALL, 5 )
item6 = wxFlexGridSizer( 0, 2, 0, 0 )
item7 = wxButton( parent, ID_BUTTON_wxPyFatalErrorDialog, "wxPyFatalErrorDialog", wxDefaultPosition, wxDefaultSize, 0 )
item6.AddWindow( item7, 0, wxALIGN_CENTRE|wxALL, 5 )
@@ -51,16 +51,16 @@ def ErrorDialogsDemoPanelFunc( parent, call_fit = true, set_sizer = true ):
item0.AddSizer( item6, 0, wxALIGN_CENTRE|wxALL, 5 )
item11 = wxFlexGridSizer( 0, 2, 0, 0 )
item0.AddSizer( item11, 0, wxALIGN_CENTRE|wxALL, 5 )
if set_sizer == true:
parent.SetAutoLayout( true )
if set_sizer == True:
parent.SetAutoLayout( True )
parent.SetSizer( item0 )
if call_fit == true:
if call_fit == True:
item0.Fit( parent )
item0.SetSizeHints( parent )
return item0
# Menu bar functions
@@ -105,8 +105,8 @@ class MyPanel(wxPanel):
EVT_BUTTON(self,
ID_BUTTON_wxPyNonFatalErrorDialogWithTraceback,
self.DoDialog)
EVT_CLOSE(self,self.OnClose)
IndexFromID = {
ID_BUTTON_wxPyFatalErrorDialog: 3,
ID_BUTTON_wxPyFatalErrorDialogWithTraceback: 2,
@@ -138,10 +138,11 @@ class MyPanel(wxPanel):
print "%s.DoDialog(): testing %s..." % (self,sys.stderr)
this_will_generate_a_NameError_exception
def OnClose(self,evt):
def ShutdownDemo(self):
for d in self.dialogs:
d.Destroy ()
self.Destroy ()
d.Destroy()
class MyFrame(wxFrame):
def __init__(self,parent=None):
@@ -158,9 +159,9 @@ class MyFrame(wxFrame):
class MyApp(wxApp):
def OnInit(self):
frame = MyFrame()
frame.Show(true)
frame.Show(True)
self.SetTopWindow(frame)
return true
return True
def runTest(pframe, nb, log):
panel = MyPanel(nb)

View File

@@ -0,0 +1,287 @@
#---------------------------------------------------------------------------
# Name: EventManager.py
# Purpose: A module to demonstrate wxPython.lib.evtmgr.EventManager.
#
# Author: Robb Shecter (robb@acm.org)
#
# Created: 16-December-2002
# Copyright: (c) 2002 by Robb Shecter (robb@acm.org)
# Licence: wxWindows license
#---------------------------------------------------------------------------
from wxPython.wx import *
from wxPython.lib.evtmgr import eventManager
#----------------------------------------------------------------------
class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.log = log
fsize = self.GetFont().GetPointSize()
f1 = wxFont(fsize+0, wxSWISS, wxNORMAL, wxNORMAL)
f2 = wxFont(fsize+2, wxSWISS, wxNORMAL, wxBOLD)
f3 = wxFont(fsize+6, wxSWISS, wxNORMAL, wxBOLD)
title1 = wxStaticText(self, -1, 'EventManager')
title1.SetFont(f3)
txt = """\
This demo shows (1) basic uses and features of the EventManager, as well
as (2) how it helps with a real-world task: creating independent, object-
oriented components."""
message0 = wxStaticText(self, -1, txt)
message0.SetFont(f1)
title2 = wxStaticText(self, -1, 'Event Listeners')
title2.SetFont(f2)
txt = """\
These objects listen to motion events from the target window, using the ability
to register one event with multiple listeners. They also register for mouse events
on themselves to implement toggle-button functionality."""
message1 = wxStaticText(self, -1, txt)
message1.SetFont(f1)
title3 = wxStaticText(self, -1, 'Target Window')
title3.SetFont(f2)
txt = """\
A passive window that's used as an event generator. Move the mouse over it to
send events to the listeners above."""
message2 = wxStaticText(self, -1, txt)
message2.SetFont(f1)
targetPanel = Tile(self, log, bgColor=wxColor(80,10,10), active=0)
buttonPanel = wxPanel(self ,-1)
sizer = wxBoxSizer(wxHORIZONTAL)
target = targetPanel.tile
sizer.Add(0,0,1)
for factor in [0.2, 0.3, 0.4, 0.5, 0.6, 0.7]:
sizer.Add(Tile(buttonPanel, log, factor-0.05, target), 0, wxALIGN_CENTER)
sizer.Add(0,0,1)
sizer.Add(Tile(buttonPanel, log, factor, target), 0, wxALIGN_CENTER)
sizer.Add(0,0,1)
buttonPanel.SetAutoLayout(1)
buttonPanel.SetSizer(sizer)
sizer.Fit(buttonPanel)
sizer = wxBoxSizer(wxVERTICAL)
sizer.Add(title1, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, 6)
sizer.Add(message0, 0, wxALIGN_CENTER | wxALL, 6)
sizer.Add(title2, 0, wxALIGN_CENTER | wxLEFT | wxTOP | wxRIGHT, 16)
sizer.Add(message1, 0, wxALIGN_CENTER | wxALL, 6)
sizer.Add(buttonPanel, 0, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 16)
sizer.Add(title3, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, 16)
sizer.Add(message2, 0, wxALIGN_CENTER | wxALL, 6)
sizer.Add(targetPanel, 2, wxEXPAND | wxLEFT | wxBOTTOM | wxRIGHT, 16)
self.SetAutoLayout(1)
self.SetSizer(sizer)
class Tile(wxPanel):
"""
This outer class is responsible for changing
its border color in response to certain mouse
events over its contained 'InnerTile'.
"""
normal = wxColor(150,150,150)
active = wxColor(250,245,245)
hover = wxColor(210,220,210)
def __init__(self, parent, log, factor=1, thingToWatch=None, bgColor=None, active=1, size=(38,38), borderWidth=3):
wxPanel.__init__(self, parent, -1, size=size, style=wxCLIP_CHILDREN)
self.tile = InnerTile(self, log, factor, thingToWatch, bgColor)
self.log = log
sizer = wxBoxSizer(wxHORIZONTAL)
sizer.Add(self.tile, 1, wxEXPAND | wxALL, borderWidth)
self.SetAutoLayout(1)
self.SetSizer(sizer)
self.Layout()
self.SetBackgroundColour(Tile.normal)
if active:
# Register myself for mouse events over self.tile in order to
# create typical button/hyperlink visual effects.
eventManager.Register(self.setHover, EVT_ENTER_WINDOW, self.tile)
eventManager.Register(self.setNormal, EVT_LEAVE_WINDOW, self.tile)
eventManager.Register(self.setActive, EVT_LEFT_DOWN, self.tile)
eventManager.Register(self.setHover, EVT_LEFT_UP, self.tile)
def setHover(self, event):
self.SetBackgroundColour(Tile.hover)
self.Refresh()
def setActive(self, event):
self.SetBackgroundColour(Tile.active)
self.Refresh()
def setNormal(self, event):
self.SetBackgroundColour(Tile.normal)
self.Refresh()
class InnerTile(wxPanel):
IDLE_COLOR = wxColor( 80, 10, 10)
START_COLOR = wxColor(200, 70, 50)
FINAL_COLOR = wxColor( 20, 80,240)
OFF_COLOR = wxColor(185,190,185)
# Some pre-computation.
DELTAS = map(lambda a,b: b-a, START_COLOR.Get(), FINAL_COLOR.Get())
START_COLOR_TUPLE = START_COLOR.Get()
"""
This inner panel changes its color in reaction to mouse
events over the 'thingToWatch'.
"""
def __init__(self, parent, log, factor, thingToWatch=None, bgColor=None):
wxPanel.__init__(self, parent, -1)
self.log=log
if bgColor:
self.SetBackgroundColour(bgColor)
if thingToWatch:
self.factor = factor
self.thingToWatch = thingToWatch
self.state = 0
self.toggleOnOff()
# Watch for the mouse click to enable/disable myself.
eventManager.Register(self.toggleOnOff, EVT_LEFT_UP, self)
def toggleOnOff(self, event=None):
# Implement being on or off by registering and
# de-registering self.makeColor() from the event manager.
if self.state:
eventManager.DeregisterListener(self.makeColor)
else:
eventManager.Register(self.makeColor, EVT_MOTION, self.thingToWatch)
self.state = 1 - self.state
self.resetColor()
def resetColor(self, event=None):
if self.state:
self.setColor(InnerTile.IDLE_COLOR)
else:
self.setColor(InnerTile.OFF_COLOR)
def setColor(self, color):
self.SetBackgroundColour(color)
self.Refresh()
def makeColor(self, mouseEvent):
self.makeColorFromTuple(mouseEvent.GetPositionTuple())
def makeColorFromTuple(self, (x, y)):
MAX = 180.0
scaled = min((x + y) * self.factor, MAX) # In range [0..MAX]
percent = scaled / MAX
r = InnerTile.START_COLOR_TUPLE[0] + (InnerTile.DELTAS[0] * percent)
g = InnerTile.START_COLOR_TUPLE[1] + (InnerTile.DELTAS[1] * percent)
b = InnerTile.START_COLOR_TUPLE[2] + (InnerTile.DELTAS[2] * percent)
self.setColor(wxColor(r,g,b))
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
overview = """<html><body>
<h2>EventManager</h2>
<p> The goal of the EventManager is to make wxWindows events more
'Pythonic' (ie. object-oriented) and easier to work with, without
impacting performance. It offers these features:
<p>
<ul>
<li> Allows any number of listeners to register for a single
event. (In addition to the standard wxPython feature of a single
listener being able to respond to many events.)
<li> Makes it easy to disconnect and reconnect listeners. This
has the effect of reducing the need for case-based branching in
application code.
<li> Has an object-oriented API. Programmers register to get
events directly from the objects that generate them, instead of
using ID numbers.
</ul>
<h3>Usage</h3>
<p>The EventManager class has three public methods. First get a
reference to it:
<PRE>
from wxPython.lib.evtmgr import eventManager
</PRE>
<p>...and then invoke any of the following methods. These methods are
'safe'; duplicate registrations or de-registrations will have no
effect.
<p><b>Registering a listener:</b>
<PRE>
eventManager.Register(listener, event, event-source)
</PRE>
<p><b>De-registering by window:</b>
<PRE>
eventManager.DeregisterWindow(event-source)
</PRE>
<p><b>De-registering by listener:</b>
<PRE>
eventManager.DeregisterListener(listener)
</PRE>
<p><b>Simple Example:</b>
<PRE>
from wxPython.lib.evtmgr import eventManager
aButton = wxButton(somePanel, -1, 'Click me')
eventManager.Register(self.someMethod, EVT_BUTTON, aButton)
</PRE>
<p> See the demo code as well as the documentation in the source of
<tt>wxPython.lib.evtmgr</tt> for more details.
<p>
by Robb Shecter (robb@acm.org)
</body></html>
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])])

View File

@@ -36,6 +36,5 @@ def runTest(frame, nb, log):
import string
overview = string.replace(fancytext.__doc__, "<", "&lt;")
overview = fancytext.__doc__.replace("<", "&lt;")

View File

@@ -3,44 +3,40 @@ from wxPython.wx import *
#----------------------------------------------------------------------
## class MyFontEnumerator(wxFontEnumerator):
## def __init__(self, list):
## wxFontEnumerator.__init__(self)
## self.list = list
## def OnFacename(self, face):
## self.list.append(face)
## return true
class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
## list = []
## e = MyFontEnumerator(list)
## e.EnumerateFacenames()
e = wxFontEnumerator()
e.EnumerateFacenames()
list = e.GetFacenames()
list.sort()
wxStaticText(self, -1, "Face names:", (15, 50), (65, 18))
self.lb1 = wxListBox(self, -1, (80, 50), (200, 250),
s1 = wxStaticText(self, -1, "Face names:")
self.lb1 = wxListBox(self, -1, wxDefaultPosition, (200, 250),
list, wxLB_SINGLE)
EVT_LISTBOX(self, self.lb1.GetId(), self.OnSelect)
self.txt = wxStaticText(self, -1, "Sample text...", (285, 50))
row = wxBoxSizer(wxHORIZONTAL)
row.Add(s1, 0, wxALL, 5)
row.Add(self.lb1, 0, wxALL, 5)
row.Add(self.txt, 0, wxALL, 5)
sizer = wxBoxSizer(wxVERTICAL)
sizer.Add(row, 0, wxALL, 30)
self.SetSizer(sizer)
self.Layout()
self.lb1.SetSelection(0)
def OnSelect(self, evt):
face = self.lb1.GetStringSelection()
font = wxFont(28, wxDEFAULT, wxNORMAL, wxNORMAL, false, face)
font = wxFont(28, wxDEFAULT, wxNORMAL, wxNORMAL, False, face)
self.txt.SetFont(font)
self.txt.SetSize(self.txt.GetBestSize())
@@ -64,9 +60,12 @@ def runTest(frame, nb, log):
overview = """\
wxFontEnumerator enumerates either all available fonts on the system or only the ones with given attributes - either only fixed-width (suited for use in programs such as terminal emulators and the like) or the fonts available in the given encoding.
overview = """<html><body>
wxFontEnumerator enumerates either all available fonts on the system or only
the ones with given attributes - either only fixed-width (suited for use in
programs such as terminal emulators and the like) or the fonts available in
the given encoding.
</body></html>
"""

View File

@@ -28,12 +28,12 @@ class TestPanel(wxPanel):
b = wxGenButton(self, -1, 'disabled')
EVT_BUTTON(self, b.GetId(), self.OnButton)
b.Enable(false)
b.Enable(False)
sizer.Add(b)
b = wxGenButton(self, -1, 'bigger')
EVT_BUTTON(self, b.GetId(), self.OnBiggerButton)
b.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, false))
b.SetFont(wxFont(20, wxSWISS, wxNORMAL, wxBOLD, False))
b.SetBezelWidth(5)
###b.SetBestSize()
b.SetBackgroundColour("Navy")
@@ -46,6 +46,12 @@ class TestPanel(wxPanel):
EVT_BUTTON(self, b.GetId(), self.OnButton)
sizer.Add(b)
bmp = images.getTest2Bitmap()
b = wxGenBitmapButton(self, -1, bmp)
EVT_BUTTON(self, b.GetId(), self.OnButton)
sizer.Add(b)
b.Enable(False)
b = wxGenBitmapButton(self, -1, None)
EVT_BUTTON(self, b.GetId(), self.OnButton)
bmp = images.getBulb1Bitmap()
@@ -58,7 +64,6 @@ class TestPanel(wxPanel):
b.SetBitmapSelected(bmp)
b.SetBestSize()
sizer.Add(b)
sizer.Add(10,10)
b = wxGenToggleButton(self, -1, "Toggle Button")
EVT_BUTTON(self, b.GetId(), self.OnToggleButton)
@@ -74,7 +79,7 @@ class TestPanel(wxPanel):
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
b.SetBitmapSelected(bmp)
b.SetToggle(true)
b.SetToggle(True)
b.SetBestSize()
sizer.Add(b)
@@ -88,7 +93,7 @@ class TestPanel(wxPanel):
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
b.SetBitmapSelected(bmp)
b.SetUseFocusIndicator(false)
b.SetUseFocusIndicator(False)
b.SetBestSize()
sizer.Add(b)
@@ -128,3 +133,11 @@ def runTest(frame, nb, log):
import wxPython.lib.buttons
overview = wxPython.lib.buttons.__doc__
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])])

View File

@@ -2,6 +2,7 @@
from wxPython.wx import *
from wxPython.grid import *
import string
#---------------------------------------------------------------------------
class MyCellEditor(wxPyGridCellEditor):
"""
@@ -86,16 +87,16 @@ class MyCellEditor(wxPyGridCellEditor):
def EndEdit(self, row, col, grid):
"""
Complete the editing of the current cell. Returns true if the value
Complete the editing of the current cell. Returns True if the value
has changed. If necessary, the control may be destroyed.
*Must Override*
"""
self.log.write("MyCellEditor: EndEdit (%d,%d)\n" % (row, col))
changed = false
changed = False
val = self._tc.GetValue()
if val != self.startValue:
changed = true
changed = True
grid.GetTable().SetValue(row, col, val) # update the table
self.startValue = ''
@@ -115,7 +116,7 @@ class MyCellEditor(wxPyGridCellEditor):
def IsAcceptedKey(self, evt):
"""
Return TRUE to allow the given key to start editing: the base class
Return True to allow the given key to start editing: the base class
version only checks that the event has no modifiers. F2 is special
and will always start the editor.
"""
@@ -143,12 +144,13 @@ class MyCellEditor(wxPyGridCellEditor):
elif key < 256 and key >= 0 and chr(key) in string.printable:
ch = chr(key)
if not evt.ShiftDown():
ch = string.lower(ch)
ch = ch.lower()
if ch is not None:
# For this example, replace the text. Normally we would append it.
#self._tc.AppendText(ch)
self._tc.SetValue(ch)
self._tc.SetInsertionPointEnd()
else:
evt.Skip()
@@ -226,7 +228,7 @@ if __name__ == '__main__':
import sys
app = wxPySimpleApp()
frame = TestFrame(None, sys.stdout)
frame.Show(true)
frame.Show(True)
app.MainLoop()

View File

@@ -1,8 +1,6 @@
from wxPython.wx import *
from wxPython.grid import *
import string
#---------------------------------------------------------------------------
class CustomDataTable(wxPyGridTableBase):
@@ -45,7 +43,10 @@ class CustomDataTable(wxPyGridTableBase):
return len(self.data[0])
def IsEmptyCell(self, row, col):
return not self.data[row][col]
try:
return not self.data[row][col]
except IndexError:
return true
# Get/Set values in the table. The Python version of these
# methods can handle any data-type, (as long as the Editor and
@@ -90,11 +91,11 @@ class CustomDataTable(wxPyGridTableBase):
# editor and renderer. This allows you to enforce some type-safety
# in the grid.
def CanGetValueAs(self, row, col, typeName):
colType = string.split(self.dataTypes[col], ':')[0]
colType = self.dataTypes[col].split(':')[0]
if typeName == colType:
return true
else:
return false
return False
def CanSetValueAs(self, row, col, typeName):
return self.CanGetValueAs(row, col, typeName)
@@ -120,7 +121,7 @@ class CustTableGrid(wxGrid):
self.SetRowLabelSize(0)
self.SetMargins(0,0)
self.AutoSizeColumns(false)
self.AutoSizeColumns(False)
EVT_GRID_CELL_LEFT_DCLICK(self, self.OnLeftDClick)
@@ -138,8 +139,22 @@ class CustTableGrid(wxGrid):
class TestFrame(wxFrame):
def __init__(self, parent, log):
wxFrame.__init__(self, parent, -1, "Custom Table, data driven Grid Demo", size=(640,480))
grid = CustTableGrid(self, log)
p = wxPanel(self, -1, style=0)
grid = CustTableGrid(p, log)
b = wxButton(p, -1, "Another Control...")
b.SetDefault()
EVT_BUTTON(self, b.GetId(), self.OnButton)
EVT_SET_FOCUS(b, self.OnButtonFocus)
bs = wxBoxSizer(wxVERTICAL)
bs.Add(grid, 1, wxGROW|wxALL, 5)
bs.Add(b)
p.SetSizer(bs)
def OnButton(self, evt):
print "button selected"
def OnButtonFocus(self, evt):
print "button focus"
#---------------------------------------------------------------------------

View File

@@ -0,0 +1,193 @@
from wxPython.wx import *
from wxPython.grid import *
from wxPython.lib.gridmovers import wxGridColMover, EVT_GRID_COL_MOVE
from wxPython.lib.gridmovers import wxGridRowMover, EVT_GRID_ROW_MOVE
#---------------------------------------------------------------------------
class CustomDataTable(wxPyGridTableBase):
"""
"""
def __init__(self, log):
wxPyGridTableBase.__init__(self)
self.log = log
self.identifiers = ['id','ds','sv','pr','pl','op','fx','ts']
self.rowLabels = ['Row1','Row2','Row3']
self.colLabels = {'id':'ID','ds':'Description','sv':'Severity',
'pr':'Priority','pl':'Platform','op':'Opened?',
'fx':'Fixed?','ts':'Tested?'}
self.data = [{'id':1010,
'ds':"The foo doesn't bar",
'sv':"major",
'pr':1,
'pl':'MSW',
'op':1,
'fx':1,
'ts':1
},
{'id':1011,
'ds':"I've got a wicket in my wocket",
'sv':"wish list",
'pr':2,
'pl':'other',
'op':0,
'fx':0,
'ts':0
},
{'id':1012,
'ds':"Rectangle() returns a triangle",
'sv':"critical",
'pr':5,
'pl':'all',
'op':0,
'fx':0,
'ts':0
}
]
#--------------------------------------------------
# required methods for the wxPyGridTableBase interface
def GetNumberRows(self):
return len(self.data)
def GetNumberCols(self):
return len(self.identifiers)
def IsEmptyCell(self, row, col):
id = self.identifiers[col]
return not self.data[row][id]
def GetValue(self, row, col):
id = self.identifiers[col]
return self.data[row][id]
def SetValue(self, row, col, value):
id = self.identifiers[col]
self.data[row][id] = value
#--------------------------------------------------
# Some optional methods
# Called when the grid needs to display column labels
def GetColLabelValue(self, col):
id = self.identifiers[col]
return self.colLabels[id]
# Called when the grid needs to display row labels
def GetRowLabelValue(self,row):
return self.rowLabels[row]
#--------------------------------------------------
# Methods added for demo purposes.
# The physical moving of the cols/rows is left to the implementer.
# Because of the dynamic nature of a wxGrid the physical moving of
# columns differs from implementation to implementation
# Move the column
def MoveColumn(self,frm,to):
grid = self.GetView()
if grid:
# Move the identifiers
old = self.identifiers[frm]
del self.identifiers[frm]
if to > frm:
self.identifiers.insert(to-1,old)
else:
self.identifiers.insert(to,old)
# Notify the grid
grid.BeginBatch()
msg = wxGridTableMessage(self,wxGRIDTABLE_NOTIFY_COLS_DELETED,
frm,1)
grid.ProcessTableMessage(msg)
msg = wxGridTableMessage(self,wxGRIDTABLE_NOTIFY_COLS_INSERTED,
to,1)
grid.ProcessTableMessage(msg)
grid.EndBatch()
# Move the row
def MoveRow(self,frm,to):
grid = self.GetView()
if grid:
# Move the rowLabels and data rows
oldLabel = self.rowLabels[frm]
oldData = self.data[frm]
del self.rowLabels[frm]
del self.data[frm]
if to > frm:
self.rowLabels.insert(to-1,oldLabel)
self.data.insert(to-1,oldData)
else:
self.rowLabels.insert(to,oldLabel)
self.data.insert(to,oldData)
# Notify the grid
grid.BeginBatch()
msg = wxGridTableMessage(self,wxGRIDTABLE_NOTIFY_ROWS_DELETED,
frm,1)
grid.ProcessTableMessage(msg)
msg = wxGridTableMessage(self,wxGRIDTABLE_NOTIFY_ROWS_INSERTED,
to,1)
grid.ProcessTableMessage(msg)
grid.EndBatch()
#---------------------------------------------------------------------------
class DragableGrid(wxGrid):
def __init__(self, parent, log):
wxGrid.__init__(self, parent, -1)
table = CustomDataTable(log)
# The second parameter means that the grid is to take ownership of the
# table and will destroy it when done. Otherwise you would need to keep
# a reference to it and call it's Destroy method later.
self.SetTable(table, True)
# Enable Column moving
wxGridColMover(self)
EVT_GRID_COL_MOVE(self,self.GetId(),self.OnColMove)
# Enable Row moving
wxGridRowMover(self)
EVT_GRID_ROW_MOVE(self,self.GetId(),self.OnRowMove)
# Event method called when a column move needs to take place
def OnColMove(self,evt):
frm = evt.GetMoveColumn() # Column being moved
to = evt.GetBeforeColumn() # Before which column to insert
self.GetTable().MoveColumn(frm,to)
# Event method called when a row move needs to take place
def OnRowMove(self,evt):
frm = evt.GetMoveRow() # Row being moved
to = evt.GetBeforeRow() # Before which row to insert
self.GetTable().MoveRow(frm,to)
#---------------------------------------------------------------------------
class TestFrame(wxFrame):
def __init__(self, parent, log):
wxFrame.__init__(self, parent, -1, "Custom Table, data driven Grid Demo", size=(640,480))
grid = DragableGrid(self, log)
#---------------------------------------------------------------------------
if __name__ == '__main__':
import sys
app = wxPySimpleApp()
frame = TestFrame(None, sys.stdout)
frame.Show(True)
app.MainLoop()
#---------------------------------------------------------------------------

View File

@@ -55,7 +55,7 @@ if __name__ == '__main__':
import sys
app = wxPySimpleApp()
frame = TestFrame(None, sys.stdout)
frame.Show(true)
frame.Show(True)
app.MainLoop()

View File

@@ -23,7 +23,7 @@ class HugeTable(wxPyGridTableBase):
return 10000
def IsEmptyCell(self, row, col):
return false
return False
def GetValue(self, row, col):
return str( (row, col) )
@@ -45,7 +45,15 @@ class HugeTableGrid(wxGrid):
# The second parameter means that the grid is to take ownership of the
# table and will destroy it when done. Otherwise you would need to keep
# a reference to it and call it's Destroy method later.
self.SetTable(table, true)
self.SetTable(table, True)
EVT_GRID_CELL_RIGHT_CLICK(self, self.OnRightDown) #added
def OnRightDown(self, event): #added
print "hello"
print self.GetSelectedRows() #added
@@ -56,7 +64,7 @@ class TestFrame(wxFrame):
wxFrame.__init__(self, parent, -1, "Huge (virtual) Table Demo", size=(640,480))
grid = HugeTableGrid(self, log)
grid.SetReadOnly(5,5, true)
grid.SetReadOnly(5,5, True)
#---------------------------------------------------------------------------
@@ -64,7 +72,7 @@ if __name__ == '__main__':
import sys
app = wxPySimpleApp()
frame = TestFrame(None, sys.stdout)
frame.Show(true)
frame.Show(True)
app.MainLoop()

View File

@@ -13,8 +13,8 @@ class SimpleGrid(wxGrid): ##, wxGridAutoEditMixin):
EVT_IDLE(self, self.OnIdle)
self.CreateGrid(25, 25)
##self.EnableEditing(false)
self.CreateGrid(25, 25) #, wxGrid.wxGridSelectRows)
##self.EnableEditing(False)
# simple cell formatting
self.SetColSize(3, 200)
@@ -26,9 +26,9 @@ class SimpleGrid(wxGrid): ##, wxGridAutoEditMixin):
self.SetCellFont(0, 0, wxFont(12, wxROMAN, wxITALIC, wxNORMAL))
self.SetCellTextColour(1, 1, wxRED)
self.SetCellBackgroundColour(2, 2, wxCYAN)
self.SetReadOnly(3, 3, true)
self.SetReadOnly(3, 3, True)
self.SetCellEditor(5, 0, wxGridCellNumberEditor())
self.SetCellEditor(5, 0, wxGridCellNumberEditor(1,1000))
self.SetCellValue(5, 0, "123")
self.SetCellEditor(6, 0, wxGridCellFloatEditor())
self.SetCellValue(6, 0, "123.34")
@@ -53,6 +53,18 @@ class SimpleGrid(wxGrid): ##, wxGridAutoEditMixin):
self.SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_BOTTOM)
#self.SetDefaultCellOverflow(False)
#r = wxGridCellAutoWrapStringRenderer()
#self.SetCellRenderer(9, 1, r)
# overflow cells
self.SetCellValue( 9, 1, "This default cell will overflow into neighboring cells, but not if you turn overflow off.");
self.SetCellSize(11, 1, 3, 3);
self.SetCellAlignment(11, 1, wxALIGN_CENTRE, wxALIGN_CENTRE);
self.SetCellValue(11, 1, "This cell is set to span 3 rows and 3 columns");
# test all the events
EVT_GRID_CELL_LEFT_CLICK(self, self.OnCellLeftClick)
EVT_GRID_CELL_RIGHT_CLICK(self, self.OnCellRightClick)
@@ -216,7 +228,7 @@ if __name__ == '__main__':
import sys
app = wxPySimpleApp()
frame = TestFrame(None, sys.stdout)
frame.Show(true)
frame.Show(True)
app.MainLoop()

View File

@@ -1,7 +1,7 @@
from wxPython.wx import *
from wxPython.grid import *
import string, random
import random
#---------------------------------------------------------------------------
@@ -60,7 +60,7 @@ editorDemoData = [
('wxGridCellBoolEditor', '1', wxGridCellBoolEditor, ()),
('wxGridCellChoiceEditor', 'one', wxGridCellChoiceEditor, (['one', 'two', 'three', 'four',
'kick', 'Microsoft', 'out the',
'door'], false)),
'door'], False)),
]
@@ -139,15 +139,15 @@ Renderers used together.
attr = wxGridCellAttr()
attr.SetFont(font)
attr.SetBackgroundColour(wxLIGHT_GREY)
attr.SetReadOnly(true)
attr.SetReadOnly(True)
attr.SetAlignment(wxRIGHT, -1)
self.SetColAttr(renCol, attr)
attr.IncRef()
self.SetColAttr(edCol, attr)
# There is a bug in wxGTK for this method...
self.AutoSizeColumns(true)
self.AutoSizeRows(true)
self.AutoSizeColumns(True)
self.AutoSizeRows(True)
EVT_GRID_CELL_LEFT_DCLICK(self, self.OnLeftDClick)
@@ -174,7 +174,7 @@ if __name__ == '__main__':
import sys
app = wxPySimpleApp()
frame = TestFrame(None, sys.stdout)
frame.Show(true)
frame.Show(True)
app.MainLoop()

View File

@@ -21,38 +21,38 @@ class AnchorsDemoFrame(wxFrame):
self._init_utils()
self.mainPanel = wxPanel(size = wxSize(320, 160), parent = self, id = wxID_ANCHORSDEMOFRAMEMAINPANEL, name = 'panel1', style = wxTAB_TRAVERSAL | wxCLIP_CHILDREN, pos = wxPoint(0, 0))
self.mainPanel.SetAutoLayout(true)
self.mainPanel.SetAutoLayout(True)
self.okButton = wxButton(label = 'OK', id = wxID_ANCHORSDEMOFRAMEOKBUTTON, parent = self.mainPanel, name = 'okButton', size = wxSize(72, 24), style = 0, pos = wxPoint(240, 128))
self.okButton.SetConstraints(LayoutAnchors(self.okButton, false, false, true, true))
self.okButton.SetConstraints(LayoutAnchors(self.okButton, False, False, True, True))
EVT_BUTTON(self.okButton, wxID_ANCHORSDEMOFRAMEOKBUTTON, self.OnOkButtonButton)
self.backgroundPanel = wxPanel(size = wxSize(304, 80), parent = self.mainPanel, id = wxID_ANCHORSDEMOFRAMEBACKGROUNDPANEL, name = 'backgroundPanel', style = wxSIMPLE_BORDER | wxCLIP_CHILDREN, pos = wxPoint(8, 40))
self.backgroundPanel.SetBackgroundColour(wxColour(255, 255, 255))
self.backgroundPanel.SetConstraints(LayoutAnchors(self.backgroundPanel, true, true, true, true))
self.backgroundPanel.SetConstraints(LayoutAnchors(self.backgroundPanel, True, True, True, True))
self.anchoredPanel = wxPanel(size = wxSize(88, 48), id = wxID_ANCHORSDEMOFRAMEANCHOREDPANEL, parent = self.backgroundPanel, name = 'anchoredPanel', style = wxSIMPLE_BORDER, pos = wxPoint(104, 16))
self.anchoredPanel.SetBackgroundColour(wxColour(0, 0, 222))
self.anchoredPanel.SetConstraints(LayoutAnchors(self.anchoredPanel, false, false, false, false))
self.anchoredPanel.SetConstraints(LayoutAnchors(self.anchoredPanel, False, False, False, False))
self.leftCheckBox = wxCheckBox(label = 'Left', id = wxID_ANCHORSDEMOFRAMELEFTCHECKBOX, parent = self.mainPanel, name = 'leftCheckBox', size = wxSize(40, 16), style = 0, pos = wxPoint(8, 8))
self.leftCheckBox.SetConstraints(LayoutAnchors(self.leftCheckBox, false, true, false, false))
self.leftCheckBox.SetConstraints(LayoutAnchors(self.leftCheckBox, False, True, False, False))
EVT_CHECKBOX(self.leftCheckBox, wxID_ANCHORSDEMOFRAMELEFTCHECKBOX, self.OnCheckboxCheckbox)
self.topCheckBox = wxCheckBox(label = 'Top', id = wxID_ANCHORSDEMOFRAMETOPCHECKBOX, parent = self.mainPanel, name = 'topCheckBox', size = wxSize(40, 16), style = 0, pos = wxPoint(88, 8))
self.topCheckBox.SetConstraints(LayoutAnchors(self.topCheckBox, false, true, false, false))
self.topCheckBox.SetConstraints(LayoutAnchors(self.topCheckBox, False, True, False, False))
EVT_CHECKBOX(self.topCheckBox, wxID_ANCHORSDEMOFRAMETOPCHECKBOX, self.OnCheckboxCheckbox)
self.rightCheckBox = wxCheckBox(label = 'Right', id = wxID_ANCHORSDEMOFRAMERIGHTCHECKBOX, parent = self.mainPanel, name = 'rightCheckBox', size = wxSize(48, 16), style = 0, pos = wxPoint(168, 8))
self.rightCheckBox.SetConstraints(LayoutAnchors(self.rightCheckBox, false, true, false, false))
self.rightCheckBox.SetConstraints(LayoutAnchors(self.rightCheckBox, False, True, False, False))
EVT_CHECKBOX(self.rightCheckBox, wxID_ANCHORSDEMOFRAMERIGHTCHECKBOX, self.OnCheckboxCheckbox)
self.bottomCheckBox = wxCheckBox(label = 'Bottom', id = wxID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX, parent = self.mainPanel, name = 'bottomCheckBox', size = wxSize(56, 16), style = 0, pos = wxPoint(248, 8))
self.bottomCheckBox.SetConstraints(LayoutAnchors(self.bottomCheckBox, false, true, false, false))
self.bottomCheckBox.SetConstraints(LayoutAnchors(self.bottomCheckBox, False, True, False, False))
EVT_CHECKBOX(self.bottomCheckBox, wxID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX, self.OnCheckboxCheckbox)
self.helpStaticText = wxStaticText(label = 'Select anchor options above, then resize window to see the effect', id = wxID_ANCHORSDEMOFRAMEHELPSTATICTEXT, parent = self.mainPanel, name = 'helpStaticText', size = wxSize(224, 24), style = wxST_NO_AUTORESIZE, pos = wxPoint(8, 128))
self.helpStaticText.SetConstraints(LayoutAnchors(self.helpStaticText, true, false, true, true))
self.helpStaticText.SetConstraints(LayoutAnchors(self.helpStaticText, True, False, True, True))
def __init__(self, parent):
self._init_ctrls(parent)
@@ -71,7 +71,7 @@ class AnchorsDemoFrame(wxFrame):
def runTest(frame, nb, log):
win = AnchorsDemoFrame(frame)
frame.otherWin = win
win.Show(true)
win.Show(True)

View File

@@ -8,7 +8,7 @@ class TestLayoutf(wxPanel):
def __init__(self, parent):
wxPanel.__init__(self, parent, -1)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
EVT_BUTTON(self, 100, self.OnButton)
self.panelA = wxWindow(self, -1, wxPyDefaultPosition, wxPyDefaultSize, wxSIMPLE_BORDER)

View File

@@ -3,6 +3,9 @@
from wxPython.wx import *
from wxScrolledWindow import MyCanvas
import images
SHOW_BACKGROUND = 1
#----------------------------------------------------------------------
class MyParentFrame(wxMDIParentFrame):
@@ -24,16 +27,38 @@ class MyParentFrame(wxMDIParentFrame):
EVT_MENU(self, 5000, self.OnNewWindow)
EVT_MENU(self, 5001, self.OnExit)
if SHOW_BACKGROUND:
self.bg_bmp = images.getGridBGBitmap()
EVT_ERASE_BACKGROUND(self.GetClientWindow(), self.OnEraseBackground)
def OnExit(self, evt):
self.Close(true)
self.Close(True)
def OnNewWindow(self, evt):
self.winCount = self.winCount + 1
win = wxMDIChildFrame(self, -1, "Child Window: %d" % self.winCount)
canvas = MyCanvas(win)
win.Show(true)
win.Show(True)
def OnEraseBackground(self, evt):
dc = evt.GetDC()
if not dc:
dc = wxClientDC(self.GetClientWindow())
# tile the background bitmap
sz = self.GetClientSize()
w = self.bg_bmp.GetWidth()
h = self.bg_bmp.GetHeight()
x = 0
while x < sz.width:
y = 0
while y < sz.height:
dc.DrawBitmap(self.bg_bmp, x, y)
y = y + h
x = x + w
#----------------------------------------------------------------------
@@ -43,9 +68,9 @@ if __name__ == '__main__':
def OnInit(self):
wxInitAllImageHandlers()
frame = MyParentFrame()
frame.Show(true)
frame.Show(True)
self.SetTopWindow(frame)
return true
return True
app = MyApp(0)

View File

@@ -44,7 +44,7 @@ class MyParentFrame(wxMDIParentFrame):
win.SetOrientation(wxLAYOUT_HORIZONTAL)
win.SetAlignment(wxLAYOUT_TOP)
win.SetBackgroundColour(wxColour(255, 0, 0))
win.SetSashVisible(wxSASH_BOTTOM, true)
win.SetSashVisible(wxSASH_BOTTOM, True)
self.topWindow = win
@@ -55,7 +55,7 @@ class MyParentFrame(wxMDIParentFrame):
win.SetOrientation(wxLAYOUT_HORIZONTAL)
win.SetAlignment(wxLAYOUT_BOTTOM)
win.SetBackgroundColour(wxColour(0, 0, 255))
win.SetSashVisible(wxSASH_TOP, true)
win.SetSashVisible(wxSASH_TOP, True)
self.bottomWindow = win
@@ -66,7 +66,7 @@ class MyParentFrame(wxMDIParentFrame):
win.SetOrientation(wxLAYOUT_VERTICAL)
win.SetAlignment(wxLAYOUT_LEFT)
win.SetBackgroundColour(wxColour(0, 255, 0))
win.SetSashVisible(wxSASH_RIGHT, TRUE)
win.SetSashVisible(wxSASH_RIGHT, True)
win.SetExtraBorderSize(10)
textWindow = wxTextCtrl(win, -1, "", wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE|wxSUNKEN_BORDER)
@@ -81,7 +81,7 @@ class MyParentFrame(wxMDIParentFrame):
win.SetOrientation(wxLAYOUT_VERTICAL)
win.SetAlignment(wxLAYOUT_LEFT)
win.SetBackgroundColour(wxColour(0, 255, 255))
win.SetSashVisible(wxSASH_RIGHT, TRUE)
win.SetSashVisible(wxSASH_RIGHT, True)
self.leftWindow2 = win
@@ -113,14 +113,14 @@ class MyParentFrame(wxMDIParentFrame):
def OnExit(self, evt):
self.Close(true)
self.Close(True)
def OnNewWindow(self, evt):
self.winCount = self.winCount + 1
win = wxMDIChildFrame(self, -1, "Child Window: %d" % self.winCount)
canvas = MyCanvas(win)
win.Show(true)
win.Show(True)
#----------------------------------------------------------------------
@@ -130,9 +130,9 @@ if __name__ == '__main__':
def OnInit(self):
wxInitAllImageHandlers()
frame = MyParentFrame()
frame.Show(true)
frame.Show(True)
self.SetTopWindow(frame)
return true
return True
app = MyApp(0)

View File

@@ -11,7 +11,7 @@
# Licence: wxWindows license
#----------------------------------------------------------------------------
import sys, os, time, string
import sys, os, time
from wxPython.wx import *
from wxPython.html import wxHtmlWindow
@@ -19,27 +19,19 @@ from wxPython.html import wxHtmlWindow
import images
#---------------------------------------------------------------------------
_treeList = [
# new stuff
('New since last release', [
'RowColSizer',
'Unicode',
'wxFileHistory',
'wxGenericDirCtrl',
'wxImageFromStream',
'wxArtProvider',
'ScrolledPanel',
'wxMenu',
'wxIEHtmlWin',
'wxKeyEvents',
'wxWizard',
'wxXmlResourceHandler',
('Recent Additions', [
'wxIntCtrl',
'wxPyColourChooser',
'wxScrolledPanel',
]),
# managed windows == things with a caption you can close
# managed windows == things with a (optional) caption you can close
('Base Frames and Dialogs', [
'wxDialog',
'wxFrame',
@@ -88,14 +80,15 @@ _treeList = [
'wxNotebook',
'wxPopupWindow',
'wxRadioBox',
'wxRadioButton',
'wxSashWindow',
'wxSlider',
'wxScrolledWindow',
'wxSplitterWindow',
'wxSlider',
'wxSpinButton',
'wxSpinCtrl',
'wxStaticText',
'wxSplitterWindow',
'wxStaticBitmap',
'wxStaticText',
'wxStatusBar',
'wxTextCtrl',
'wxToggleButton',
@@ -106,6 +99,9 @@ _treeList = [
# controls coming from other librairies
('More Windows/Controls', [
#'wxFloatBar', deprecated
#'wxMVCTree', deprecated
#'wxRightTextCtrl', deprecated as we have wxTE_RIGHT now.
'ColourSelect',
'ContextHelp',
'FancyText',
@@ -115,20 +111,23 @@ _treeList = [
'PyCrustWithFilling',
'SplitTree',
'TablePrint',
'Throbber',
'wxCalendar',
'wxCalendarCtrl',
'wxPyColourChooser',
'wxDynamicSashWindow',
'wxEditableListBox',
'wxEditor',
#'wxFloatBar', deprecated
'wxHtmlWindow',
'wxIEHtmlWin',
'wxIntCtrl',
'wxLEDNumberCtrl',
'wxMimeTypesManager',
#'wxMVCTree', deprecated
'wxRightTextCtrl',
'wxMultiSash',
'wxPopupControl',
'wxStyledTextCtrl_1',
'wxStyledTextCtrl_2',
'wxTimeCtrl',
]),
# How to lay out the controls in a frame/dialog
@@ -136,22 +135,23 @@ _treeList = [
'LayoutAnchors',
'Layoutf',
'RowColSizer',
'ScrolledPanel',
'Sizers',
'wxLayoutConstraints',
'wxScrolledPanel',
'wxXmlResource',
'wxXmlResourceHandler',
]),
# ditto
('Process and Events', [
'EventManager',
'infoframe',
'OOR',
'PythonEvents',
'Threads',
'wxKeyEvents',
'wxProcess',
'wxTimer',
'wxKeyEvents',
]),
# Clipboard and DnD
@@ -162,12 +162,13 @@ _treeList = [
]),
# Images
('Images', [
('Using Images', [
'Throbber',
'wxArtProvider',
'wxDragImage',
'wxImage',
'wxImageFromStream',
'wxMask',
'wxArtProvider',
]),
# Other stuff
@@ -177,6 +178,7 @@ _treeList = [
'DrawXXXList',
'FontEnumerator',
'PrintFramework',
'Throbber',
'Unicode',
'wxFileHistory',
'wxJoystick',
@@ -212,7 +214,8 @@ class MyLog(wxPyLog):
if self.logTime:
message = time.strftime("%X", time.localtime(timeStamp)) + \
": " + message
self.tc.AppendText(message + '\n')
if self.tc:
self.tc.AppendText(message + '\n')
class MyTP(wxPyTipProvider):
@@ -223,7 +226,7 @@ class MyTP(wxPyTipProvider):
def opj(path):
"""Convert paths to the platform-specific separator"""
return apply(os.path.join, tuple(string.split(path, '/')))
return apply(os.path.join, tuple(path.split('/')))
#---------------------------------------------------------------------------
@@ -237,6 +240,7 @@ class wxPythonDemo(wxFrame):
self.cwd = os.getcwd()
self.curOverview = ""
self.window = None
icon = images.getMondrianIcon()
self.SetIcon(icon)
@@ -250,9 +254,9 @@ class wxPythonDemo(wxFrame):
EVT_MENU(self.tbicon, self.TBMENU_RESTORE, self.OnTaskBarActivate)
EVT_MENU(self.tbicon, self.TBMENU_CLOSE, self.OnTaskBarClose)
wxCallAfter(self.ShowTip)
self.otherWin = None
self.showTip = true
EVT_IDLE(self, self.OnIdle)
EVT_CLOSE(self, self.OnCloseWindow)
EVT_ICONIZE(self, self.OnIconfiy)
@@ -268,8 +272,8 @@ class wxPythonDemo(wxFrame):
EVT_ERASE_BACKGROUND(splitter, EmptyHandler)
EVT_ERASE_BACKGROUND(splitter2, EmptyHandler)
# Prevent TreeCtrl from displaying all items after destruction when true
self.dying = false
# Prevent TreeCtrl from displaying all items after destruction when True
self.dying = False
# Make a File menu
self.mainmenu = wxMenuBar()
@@ -277,6 +281,7 @@ class wxPythonDemo(wxFrame):
exitID = wxNewId()
menu.Append(exitID, 'E&xit\tAlt-X', 'Get the heck outta here!')
EVT_MENU(self, exitID, self.OnFileExit)
wxApp_SetMacExitMenuItemId(exitID)
self.mainmenu.Append(menu, '&File')
# Make a Demo menu
@@ -293,16 +298,33 @@ class wxPythonDemo(wxFrame):
# Make a Help menu
helpID = wxNewId()
findID = wxNewId()
findnextID = wxNewId()
menu = wxMenu()
menu.Append(findID, '&Find\tCtrl-F', 'Find in the Demo Code')
menu.Append(findnextID, 'Find &Next\tF3', 'Find Next')
menu.AppendSeparator()
menu.Append(helpID, '&About\tCtrl-H', 'wxPython RULES!!!')
wxApp_SetMacAboutMenuItemId(helpID)
EVT_MENU(self, helpID, self.OnHelpAbout)
EVT_MENU(self, findID, self.OnHelpFind)
EVT_MENU(self, findnextID, self.OnFindNext)
EVT_COMMAND_FIND(self, -1, self.OnFind)
EVT_COMMAND_FIND_NEXT(self, -1, self.OnFind)
EVT_COMMAND_FIND_CLOSE(self, -1 , self.OnFindClose)
self.mainmenu.Append(menu, '&Help')
self.SetMenuBar(self.mainmenu)
# set the menu accellerator table...
aTable = wxAcceleratorTable([(wxACCEL_ALT, ord('X'), exitID),
(wxACCEL_CTRL, ord('H'), helpID)])
self.SetAcceleratorTable(aTable)
self.finddata = wxFindReplaceData()
if 0:
# This is another way to set Accelerators, in addition to
# using the '\t<key>' syntax in the menu items.
aTable = wxAcceleratorTable([(wxACCEL_ALT, ord('X'), exitID),
(wxACCEL_CTRL, ord('H'), helpID),
(wxACCEL_CTRL, ord('F'), findID),
(wxACCEL_NORMAL, WXK_F3, findnextID)])
self.SetAcceleratorTable(aTable)
# Create a TreeCtrl
@@ -358,7 +380,8 @@ class wxPythonDemo(wxFrame):
# Set up a TextCtrl on the Demo Code Notebook page
self.txt = wxTextCtrl(self.nb, -1,
style = wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL)
style = wxTE_MULTILINE|wxTE_READONLY|
wxHSCROLL|wxTE_RICH2|wxTE_NOHIDESEL)
self.nb.AddPage(self.txt, "Demo Code")
@@ -376,16 +399,14 @@ class wxPythonDemo(wxFrame):
#wxLog_SetActiveTarget(wxLogStderr())
#wxLog_SetTraceMask(wxTraceMessages)
self.Show(true)
self.Show(True)
# add the windows to the splitter and split it.
splitter2.SplitHorizontally(self.nb, self.log)
splitter.SplitVertically(self.tree, splitter2)
splitter2.SplitHorizontally(self.nb, self.log, 450)
splitter.SplitVertically(self.tree, splitter2, 180)
splitter.SetSashPosition(180, true)
splitter.SetMinimumPaneSize(20)
splitter2.SetSashPosition(450, true)
splitter2.SetMinimumPaneSize(20)
@@ -453,6 +474,11 @@ class wxPythonDemo(wxFrame):
if self.nb.GetPageCount() == 3:
if self.nb.GetSelection() == 2:
self.nb.SetSelection(0)
# inform the window that it's time to quit if it cares
if self.window is not None:
if hasattr(self.window, "ShutdownDemo"):
self.window.ShutdownDemo()
wxSafeYield() # in case the page has pending events
self.nb.DeletePage(2)
if itemText == self.overviewText:
@@ -478,7 +504,7 @@ class wxPythonDemo(wxFrame):
wxSafeYield()
self.window = module.runTest(self, self.nb, self) ###
if self.window:
if self.window is not None:
self.nb.AddPage(self.window, 'Demo')
self.nb.SetSelection(2)
self.nb.Refresh() # without this wxMac has troubles showing the just added page
@@ -507,7 +533,7 @@ class wxPythonDemo(wxFrame):
self.curOverview = text
lead = text[:6]
if lead != '<html>' and lead != '<HTML>':
text = string.join(string.split(text, '\n'), '<br>')
text = '<br>'.join(text.split('\n'))
self.ovr.SetPage(text)
self.nb.SetPageText(0, name)
@@ -516,17 +542,61 @@ class wxPythonDemo(wxFrame):
def OnFileExit(self, *event):
self.Close()
def OnHelpAbout(self, event):
from About import MyAboutBox
about = MyAboutBox(self)
about.ShowModal()
about.Destroy()
def OnHelpFind(self, event):
self.nb.SetSelection(1)
self.finddlg = wxFindReplaceDialog(self, self.finddata, "Find",
wxFR_NOUPDOWN |
wxFR_NOMATCHCASE |
wxFR_NOWHOLEWORD)
self.finddlg.Show(True)
def OnFind(self, event):
self.nb.SetSelection(1)
end = self.txt.GetLastPosition()
textstring = self.txt.GetRange(0, end).lower()
start = self.txt.GetSelection()[1]
findstring = self.finddata.GetFindString().lower()
loc = textstring.find(findstring, start)
if loc == -1 and start != 0:
# string not found, start at beginning
start = 0
loc = textstring.find(findstring, start)
if loc == -1:
dlg = wxMessageDialog(self, 'Find String Not Found',
'Find String Not Found in Demo File',
wxOK | wxICON_INFORMATION)
dlg.ShowModal()
dlg.Destroy()
if self.finddlg:
if loc == -1:
self.finddlg.SetFocus()
return
else:
self.finddlg.Destroy()
self.txt.SetSelection(loc, loc + len(findstring))
self.txt.ShowPosition(loc)
def OnFindNext(self, event):
if self.finddata.GetFindString():
self.OnFind(event)
else:
self.OnHelpFind(event)
def OnFindClose(self, event):
event.GetDialog().Destroy()
#---------------------------------------------
def OnCloseWindow(self, event):
self.dying = true
self.dying = True
self.window = None
self.mainmenu = None
if hasattr(self, "tbicon"):
@@ -541,10 +611,6 @@ class wxPythonDemo(wxFrame):
self.window = self.otherWin
self.otherWin = None
if self.showTip:
self.ShowTip()
self.showTip = false
#---------------------------------------------
def ShowTip(self):
@@ -575,9 +641,9 @@ class wxPythonDemo(wxFrame):
#---------------------------------------------
def OnTaskBarActivate(self, evt):
if self.IsIconized():
self.Iconize(false)
self.Iconize(False)
if not self.IsShown():
self.Show(true)
self.Show(True)
self.Raise()
#---------------------------------------------
@@ -628,7 +694,7 @@ class MySplashScreen(wxSplashScreen):
def OnClose(self, evt):
frame = wxPythonDemo(None, -1, "wxPython: (A Demonstration)")
frame.Show(true)
frame.Show()
evt.Skip() # Make sure the default handler runs too...
@@ -638,10 +704,15 @@ class MyApp(wxApp):
Create and show the splash screen. It will then create and show
the main frame when it is time to do so.
"""
#import locale
#self.locale = wxLocale(wxLANGUAGE_FRENCH)
#locale.setlocale(locale.LC_ALL, 'fr')
wxInitAllImageHandlers()
splash = MySplashScreen()
splash.Show()
return true
return True

View File

@@ -30,7 +30,7 @@ class TestPanel(wxPanel):
sizer.Add(btns, 0, wxEXPAND|wxALL, 15)
self.SetSizer(sizer)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.sizer = sizer # save it for testing later

View File

@@ -33,9 +33,9 @@ class MyPrintout(wxPrintout):
def HasPage(self, page):
self.log.WriteText("wxPrintout.HasPage: %d\n" % page)
if page <= 2:
return true
return True
else:
return false
return False
def GetPageInfo(self):
self.log.WriteText("wxPrintout.GetPageInfo\n")
@@ -82,7 +82,7 @@ class MyPrintout(wxPrintout):
self.canvas.DoDrawing(dc)
dc.DrawText("Page: %d" % page, marginX/2, maxY-marginY)
return true
return True
#----------------------------------------------------------------------
@@ -117,14 +117,14 @@ class TestPrintPanel(wxPanel):
self.box.Add(subbox, 0, wxGROW)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(self.box)
def OnPrintSetup(self, event):
printerDialog = wxPrintDialog(self)
printerDialog.GetPrintDialogData().SetPrintData(self.printData)
printerDialog.GetPrintDialogData().SetSetupDialog(true)
printerDialog.GetPrintDialogData().SetSetupDialog(True)
printerDialog.ShowModal();
self.printData = printerDialog.GetPrintDialogData().GetPrintData()
printerDialog.Destroy()
@@ -144,7 +144,7 @@ class TestPrintPanel(wxPanel):
frame.Initialize()
frame.SetPosition(self.frame.GetPosition())
frame.SetSize(self.frame.GetSize())
frame.Show(true)
frame.Show(True)

View File

@@ -50,7 +50,7 @@ class TestPanel(wxPanel):
sizer.AddSpacer(10,10, pos=(13,1))
self.SetSizer(sizer)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
#----------------------------------------------------------------------
@@ -67,3 +67,9 @@ import wxPython.lib.rcsizer
overview = wxPython.lib.rcsizer.__doc__
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])])

View File

@@ -1,97 +0,0 @@
from wxPython.wx import *
#----------------------------------------------------------------------
text = "one two buckle my shoe three four shut the door five six pick up sticks seven eight lay them straight nine ten big fat hen"
class ScrolledPanel(wxScrolledWindow):
def __init__(self, parent, log):
self.log = log
wxScrolledWindow.__init__(self, parent, -1,
style = wxTAB_TRAVERSAL)
box = wxBoxSizer(wxVERTICAL)
box.Add(wxStaticText(self, -1,
"This sample shows how to make a scrollable data entry \n"
"form by using a wxSizer in a wxScrolledWindow."),
0, wxCENTER|wxALL, 5)
box.Add(wxStaticLine(self, -1), 0, wxEXPAND|wxALL, 5)
fgs = wxFlexGridSizer(cols=2, vgap=4, hgap=4)
fgs.AddGrowableCol(1)
# Add some spacers
fgs.Add(75, 10)
fgs.Add(150, 10)
for word in text.split():
label = wxStaticText(self, -1, word+":")
tc = wxTextCtrl(self, -1, word)
fgs.Add(label, flag=wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL)
fgs.Add(tc, flag=wxEXPAND)
box.Add(fgs, 1)
box.Add(10, 40) # some more empty space at the bottom
self.SetSizer(box)
# The following is all that is needed to integrate the sizer and the
# scrolled window. In this case we will only support vertical scrolling.
self.EnableScrolling(false, true)
self.SetScrollRate(0, 20)
box.SetVirtualSizeHints(self)
EVT_CHILD_FOCUS(self, self.OnChildFocus)
wxCallAfter(self.Scroll, 0, 0) # scroll back to top after initial events
def OnChildFocus(self, evt):
# If the child window that gets the focus is not visible,
# this handler will try to scroll enough to see it. If you
# need to handle horizontal auto-scrolling too then this will
# need adapted.
evt.Skip()
child = evt.GetWindow()
sppu_y = self.GetScrollPixelsPerUnit()[1]
vs_y = self.GetViewStart()[1]
cpos = child.GetPosition()
csz = child.GetSize()
# is it above the top?
if cpos.y < 0:
new_vs = cpos.y / sppu_y
self.Scroll(-1, new_vs)
# is it below the bottom ?
if cpos.y + csz.height > self.GetClientSize().height:
diff = (cpos.y + csz.height - self.GetClientSize().height) / sppu_y
self.Scroll(-1, vs_y + diff + 1)
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = ScrolledPanel(nb, log)
return win
#----------------------------------------------------------------------
overview = """<html><body>
This sample shows how to make a scrollable data entry form by
using a wxSizer in a wxScrolledWindow.
</body></html>
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])])

View File

@@ -479,16 +479,16 @@ class TestFrame(wxFrame):
self.SetStatusText("Resize this frame to see how the sizers respond...")
self.sizer.Fit(self)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(self.sizer)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.MakeModal(false)
self.MakeModal(False)
self.Destroy()
def OnButton(self, event):
self.Close(true)
self.Close(True)
#----------------------------------------------------------------------
@@ -531,8 +531,8 @@ class TestSelectionPanel(wxPanel):
if func:
win = TestFrame(self, title, func)
win.CentreOnParent(wxBOTH)
win.Show(true)
win.MakeModal(true)
win.Show(True)
win.MakeModal(True)
#----------------------------------------------------------------------
@@ -555,12 +555,12 @@ if __name__ == '__main__':
def __init__(self):
wxFrame.__init__(self, None, -1, "Testing...")
self.CreateStatusBar()
mainmenu = wxMenuBar()
menu = wxMenu()
menu.Append(200, 'E&xit', 'Get the heck outta here!')
mainmenu.Append(menu, "&File")
self.SetMenuBar(mainmenu)
self.CreateStatusBar()
mainmenu = wxMenuBar()
menu = wxMenu()
menu.Append(200, 'E&xit', 'Get the heck outta here!')
mainmenu.Append(menu, "&File")
self.SetMenuBar(mainmenu)
EVT_MENU(self, 200, self.OnExit)
self.panel = TestSelectionPanel(self, self)
self.SetSize(wxSize(400, 380))
@@ -570,15 +570,15 @@ if __name__ == '__main__':
self.Destroy()
def OnExit(self, event):
self.Close(true)
self.Close(True)
class TestApp(wxApp):
def OnInit(self):
frame = MainFrame()
frame.Show(true)
frame.Show(True)
self.SetTopWindow(frame)
return true
return True
app = TestApp(0)
app.MainLoop()

View File

@@ -170,22 +170,22 @@ class AppStatusBar(wxStatusBar):
# This is a simple timer class to start a function after a short delay;
class QuickTimer(wxTimer):
def __init__(self, func, wait=100):
wxTimer.__init__(self)
self.callback = func
self.Start(wait); # wait .1 second (.001 second doesn't work. why?)
wxTimer.__init__(self)
self.callback = func
self.Start(wait); # wait .1 second (.001 second doesn't work. why?)
def Notify(self):
self.Stop();
apply(self.callback, ());
self.Stop();
apply(self.callback, ());
class AppFrame(wxFrame):
def __init__(self, parent, id, title):
wxFrame.__init__(self, parent, id, title, wxPyDefaultPosition,
wxSize(650, 250))
# if the window manager closes the window:
EVT_CLOSE(self, self.OnCloseWindow);
# if the window manager closes the window:
EVT_CLOSE(self, self.OnCloseWindow);
# Now Create the menu bar and items
# Now Create the menu bar and items
self.mainmenu = wxMenuBar()
menu = wxMenu()
@@ -201,52 +201,52 @@ class AppFrame(wxFrame):
EVT_MENU(self, 212, self.OnViewArticle)
self.mainmenu.Append(menu, '&View')
menu = wxMenu()
menu.Append(220, '&Internal', 'Use internal text browser',TRUE)
menu.Check(220, true)
menu.Append(220, '&Internal', 'Use internal text browser',True)
menu.Check(220, True)
self.UseInternal = 1;
EVT_MENU(self, 220, self.OnBrowserInternal)
menu.Append(222, '&Settings...', 'External browser Settings')
EVT_MENU(self, 222, self.OnBrowserSettings)
self.mainmenu.Append(menu, '&Browser')
menu = wxMenu()
menu.Append(230, '&About', 'Some documentation');
EVT_MENU(self, 230, self.OnAbout)
self.mainmenu.Append(menu, '&Help')
menu = wxMenu()
menu.Append(230, '&About', 'Some documentation');
EVT_MENU(self, 230, self.OnAbout)
self.mainmenu.Append(menu, '&Help')
self.SetMenuBar(self.mainmenu)
if wxPlatform == '__WXGTK__':
# I like lynx. Also Netscape 4.5 doesn't react to my cmdline opts
self.BrowserSettings = "xterm -e lynx %s &"
elif wxPlatform == '__WXMSW__':
# netscape 4.x likes to hang out here...
self.BrowserSettings = '\\progra~1\\Netscape\\Communicator\\Program\\netscape.exe %s'
else:
# a wild guess...
self.BrowserSettings = 'netscape %s'
if wxPlatform == '__WXGTK__':
# I like lynx. Also Netscape 4.5 doesn't react to my cmdline opts
self.BrowserSettings = "xterm -e lynx %s &"
elif wxPlatform == '__WXMSW__':
# netscape 4.x likes to hang out here...
self.BrowserSettings = '\\progra~1\\Netscape\\Communicator\\Program\\netscape.exe %s'
else:
# a wild guess...
self.BrowserSettings = 'netscape %s'
# A status bar to tell people what's happening
self.sb = AppStatusBar(self)
# A status bar to tell people what's happening
self.sb = AppStatusBar(self)
self.SetStatusBar(self.sb)
self.list = wxListCtrl(self, 1100, style=wxLC_REPORT)
self.list.InsertColumn(0, 'Subject')
self.list.InsertColumn(1, 'Date')
self.list.InsertColumn(2, 'Posted by')
self.list.InsertColumn(3, 'Comments')
self.list.InsertColumn(0, 'Subject')
self.list.InsertColumn(1, 'Date')
self.list.InsertColumn(2, 'Posted by')
self.list.InsertColumn(3, 'Comments')
self.list.SetColumnWidth(0, 300)
self.list.SetColumnWidth(1, 150)
self.list.SetColumnWidth(2, 100)
self.list.SetColumnWidth(3, 100)
EVT_LIST_ITEM_SELECTED(self, 1100, self.OnItemSelected)
EVT_LEFT_DCLICK(self.list, self.OnLeftDClick)
EVT_LEFT_DCLICK(self.list, self.OnLeftDClick)
self.logprint("Connecting to slashdot... Please wait.")
# wxYield doesn't yet work here. That's why we use a timer
# to make sure that we see some GUI stuff before the slashdot
# file is transfered.
self.timer = QuickTimer(self.DoRefresh, 1000)
self.logprint("Connecting to slashdot... Please wait.")
# wxYield doesn't yet work here. That's why we use a timer
# to make sure that we see some GUI stuff before the slashdot
# file is transfered.
self.timer = QuickTimer(self.DoRefresh, 1000)
def logprint(self, x):
self.sb.logprint(x)
@@ -268,44 +268,44 @@ class AppFrame(wxFrame):
self.list.SetStringItem(i, 3, article[6])
self.url.append(article[1])
i = i + 1
self.logprint("File retrieved OK.")
self.logprint("File retrieved OK.")
def OnViewRefresh(self, event):
self.logprint("Connecting to slashdot... Please wait.");
wxYield()
self.DoRefresh()
self.logprint("Connecting to slashdot... Please wait.");
wxYield()
self.DoRefresh()
def DoViewIndex(self):
if self.UseInternal:
self.view = HTMLTextView(self, -1, 'slashdot.org',
'http://slashdot.org')
self.view.Show(true)
self.view.Show(True)
else:
self.logprint(self.BrowserSettings % ('http://slashdot.org'))
#os.system(self.BrowserSettings % ('http://slashdot.org'))
wxExecute(self.BrowserSettings % ('http://slashdot.org'))
self.logprint("OK")
self.logprint("OK")
def OnViewIndex(self, event):
self.logprint("Starting browser... Please wait.")
wxYield()
self.DoViewIndex()
self.logprint("Starting browser... Please wait.")
wxYield()
self.DoViewIndex()
def DoViewArticle(self):
if self.current<0: return
url = self.url[self.current]
if self.UseInternal:
self.view = HTMLTextView(self, -1, url, url)
self.view.Show(true)
self.view.Show(True)
else:
self.logprint(self.BrowserSettings % (url))
os.system(self.BrowserSettings % (url))
self.logprint("OK")
self.logprint("OK")
def OnViewArticle(self, event):
self.logprint("Starting browser... Please wait.")
wxYield()
self.DoViewArticle()
self.logprint("Starting browser... Please wait.")
wxYield()
self.DoViewArticle()
def OnBrowserInternal(self, event):
if self.mainmenu.Checked(220):
@@ -319,28 +319,28 @@ class AppFrame(wxFrame):
self.BrowserSettings = dlg.GetValue()
def OnAbout(self, event):
dlg = wxMessageDialog(self, __doc__, "wxSlash", wxOK | wxICON_INFORMATION)
dlg.ShowModal()
dlg = wxMessageDialog(self, __doc__, "wxSlash", wxOK | wxICON_INFORMATION)
dlg.ShowModal()
def OnItemSelected(self, event):
self.current = event.m_itemIndex
self.logprint("URL: %s" % (self.url[self.current]))
def OnLeftDClick(self, event):
(x,y) = event.Position();
# Actually, we should convert x,y to logical coords using
# a dc, but only for a wxScrolledWindow widget.
# Now wxGTK derives wxListCtrl from wxScrolledWindow,
# and wxMSW from wxControl... So that doesn't work.
#dc = wxClientDC(self.list)
##self.list.PrepareDC(dc)
#x = dc.DeviceToLogicalX( event.GetX() )
#y = dc.DeviceToLogicalY( event.GetY() )
id = self.list.HitTest(wxPoint(x,y))
#print "Double click at %d %d" % (x,y), id
# Okay, we got a double click. Let's assume it's the current selection
wxYield()
self.OnViewArticle(event)
(x,y) = event.Position();
# Actually, we should convert x,y to logical coords using
# a dc, but only for a wxScrolledWindow widget.
# Now wxGTK derives wxListCtrl from wxScrolledWindow,
# and wxMSW from wxControl... So that doesn't work.
#dc = wxClientDC(self.list)
##self.list.PrepareDC(dc)
#x = dc.DeviceToLogicalX( event.GetX() )
#y = dc.DeviceToLogicalY( event.GetY() )
id = self.list.HitTest(wxPoint(x,y))
#print "Double click at %d %d" % (x,y), id
# Okay, we got a double click. Let's assume it's the current selection
wxYield()
self.OnViewArticle(event)
def OnCloseWindow(self, event):
self.Destroy()
@@ -353,9 +353,9 @@ if __name__ == '__main__':
class MyApp(wxApp):
def OnInit(self):
frame = AppFrame(None, -1, "Slashdot Breaking News")
frame.Show(true)
frame.Show(True)
self.SetTopWindow(frame)
return true
return True
app = MyApp(0)
app.MainLoop()
@@ -368,7 +368,7 @@ if __name__ == '__main__':
def runTest(frame, nb, log):
win = AppFrame(None, -1, "Slashdot Breaking News")
frame.otherWin = win
win.Show(true)
win.Show(True)
overview = __doc__

View File

@@ -76,23 +76,26 @@ class TestPanel(wxPanel):
wxNO_BORDER )
valueWindow = TestValueWindow(splitter, -1, style=wxNO_BORDER)
splitter.SplitVertically(tree, valueWindow)
splitter.SetSashPosition(150)
splitter.SplitVertically(tree, valueWindow, 150)
scroller.SetTargetWindow(tree)
scroller.EnableScrolling(FALSE, FALSE)
scroller.EnableScrolling(False, False)
valueWindow.SetTreeCtrl(tree)
tree.SetCompanionWindow(valueWindow)
sizer = wxBoxSizer(wxVERTICAL)
sizer.Add(scroller, 1, wxEXPAND|wxALL, 25)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(sizer)
#----------------------------------------------------------------------
def runTest(frame, nb, log):
if wxPlatform == "__WXMAC__":
wxMessageBox("This demo currently fails on the Mac. The problem is being looked into...", "Sorry")
return
win = TestPanel(nb, log)
return win

View File

@@ -31,7 +31,7 @@ class TablePanel(wxPanel):
box.Add(btn, 0, wxALIGN_CENTER|wxALL, 15)
EVT_BUTTON(self, k, self.OnButton)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(box)
def OnButton(self, evt):
@@ -47,11 +47,11 @@ class TablePanel(wxPanel):
data = []
while 1:
text = file.readline()
text = string.strip(text)
text = text.strip()
if not text:
break
list_val = string.splitfields(text,'\t')
list_val = text.split('\t')
data.append(list_val)
file.close()

View File

@@ -30,11 +30,11 @@ class CalcBarThread:
self.val = val
def Start(self):
self.keepGoing = self.running = true
self.keepGoing = self.running = True
thread.start_new_thread(self.Run, ())
def Stop(self):
self.keepGoing = false
self.keepGoing = False
def IsRunning(self):
return self.running
@@ -57,7 +57,7 @@ class CalcBarThread:
if self.val < 0: self.val = 0
if self.val > 300: self.val = 300
self.running = false
self.running = False
#----------------------------------------------------------------------
@@ -172,7 +172,7 @@ class TestFrame(wxFrame):
sizer.Add(self.graph, 1, wxEXPAND)
self.SetSizer(sizer)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
sizer.Fit(self)
EVT_UPDATE_BARGRAPH(self, self.OnUpdate)
@@ -194,7 +194,7 @@ class TestFrame(wxFrame):
def OnUpdate(self, evt):
self.graph.SetValue(evt.barNum, evt.value)
self.graph.Refresh(false)
self.graph.Refresh(False)
def OnCloseWindow(self, evt):
@@ -217,7 +217,7 @@ class TestFrame(wxFrame):
def runTest(frame, nb, log):
win = TestFrame(frame, log)
frame.otherWin = win
win.Show(true)
win.Show(True)
return None
#----------------------------------------------------------------------

180
wxPython/demo/Throbber.py Normal file
View File

@@ -0,0 +1,180 @@
#
# Throbber.py - Cliff Wells <clifford.wells@attbi.com>
#
from wxPython.wx import *
from wxPython.lib.rcsizer import RowColSizer
from wxPython.lib.throbber import Throbber, __doc__ as docString
import throbImages # this was created using a modified version of img2py
#----------------------------------------------------------------------
class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.log = log
# create the throbbers
self.throbbers = {
'plain': { 'throbber': None,
'text': "Plain throbber." },
'reverse': { 'throbber': None,
'text': "This throbber runs in reverse and faster." },
'autoreverse': { 'throbber': None,
'text': "This throbber switches direction." },
'label': { 'throbber': None,
'text': "With a label." },
'overlay': { 'throbber': None,
'text': "With an overlayed image." },
'overlay+text': { 'throbber': None,
'text': "With a label and an overlayed image." },
}
images = [throbImages.catalog[i].getBitmap()
for i in throbImages.index
if i not in ['eclouds', 'logo']]
self.throbbers['plain']['throbber'] = Throbber(self, -1,
images, size=(36, 36),
frameDelay = 0.1)
self.throbbers['reverse']['throbber'] = Throbber(self, -1, images, #size=(36, 36),
frameDelay = 0.07)
self.throbbers['reverse']['throbber'].Reverse()
self.throbbers['autoreverse']['throbber'] = Throbber(self, -1,
images, #size=(36, 36),
frameDelay = 0.1,
reverse = True)
self.throbbers['autoreverse']['throbber'].sequence.append(0)
self.throbbers['label']['throbber'] = Throbber(self, -1,
images, #size=(36, 36),
frameDelay = 0.1,
label = 'Label')
self.throbbers['label']['throbber'].SetFont(wxFont(pointSize = 10,
family = wxDEFAULT,
style = wxNORMAL,
weight = wxBOLD))
self.throbbers['overlay']['throbber'] = Throbber(self, -1,
images, #size=(36, 36),
frameDelay = 0.1,
overlay = throbImages.catalog['logo'].getBitmap())
self.throbbers['overlay+text']['throbber'] = Throbber(self, -1,
images, #size=(36, 36),
frameDelay = 0.1,
overlay = throbImages.catalog['logo'].getBitmap(),
label = "Python!")
self.throbbers['overlay+text']['throbber'].SetFont(wxFont(pointSize = 8,
family = wxDEFAULT,
style = wxNORMAL,
weight = wxBOLD))
# this throbber is created using a single, composite image
self.otherThrobber = Throbber(self, -1,
throbImages.catalog['eclouds'].getBitmap(), #size=(48, 48),
frameDelay = 0.15,
frames = 12,
frameWidth = 48,
label = "Stop")
EVT_LEFT_DOWN(self.otherThrobber, self.OnClickThrobber)
box = wxBoxSizer(wxVERTICAL)
sizer = RowColSizer()
box.Add(sizer, 1, wxEXPAND|wxALL, 5)
sizer.AddGrowableCol(1)
sizer.Add(self.otherThrobber, row = 0, col = 2, rowspan = 4, flag = wxALIGN_CENTER_VERTICAL)
row = 2
# use a list so we can keep our order
for t in ['plain', 'reverse', 'autoreverse', 'label', 'overlay', 'overlay+text']:
sizer.Add(self.throbbers[t]['throbber'], row = row, col = 0, flag = wxALIGN_CENTER|wxALL, border=2)
sizer.Add(wxStaticText(self, -1, self.throbbers[t]['text']), row = row, col = 1,
flag = wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT)
row += 1
# start and stop buttons
startButton = wxButton(self, -1, "Start")
EVT_BUTTON(self, startButton.GetId(), self.OnStartAnimation)
stopButton = wxButton(self, -1, "Stop")
EVT_BUTTON(self, stopButton.GetId(), self.OnStopAnimation)
buttonBox = wxBoxSizer(wxHORIZONTAL)
buttonBox.AddMany([
(startButton, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5),
(stopButton, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5),
])
sizer.Add(buttonBox,
row = len(self.throbbers) + 3,
col = 0,
colspan = 3,
flag = wxALIGN_CENTER)
self.SetSizer(box)
self.SetAutoLayout(True)
self.Layout()
sizer.SetSizeHints(self)
sizer.Fit(self)
for t in self.throbbers.keys():
self.throbbers[t]['throbber'].Start()
self.otherThrobber.Start()
self.otherThrobber.Reverse()
EVT_WINDOW_DESTROY(self, self.OnDestroy)
def OnDestroy(self, event):
self.log.write("got destroy event")
event.Skip()
def OnStartAnimation(self, event):
for t in self.throbbers.keys():
self.throbbers[t]['throbber'].Start()
def OnStopAnimation(self, event):
for t in self.throbbers.keys():
self.throbbers[t]['throbber'].Rest()
def OnClickThrobber(self, event):
if self.otherThrobber.Running():
self.otherThrobber.Rest()
self.otherThrobber.SetLabel("Start")
else:
self.otherThrobber.Start()
self.otherThrobber.SetLabel("Stop")
def ShutdownDemo(self):
self.otherThrobber.Rest()
for t in self.throbbers.keys():
self.throbbers[t]['throbber'].Rest()
#----------------------------------------------------------------------
def runTest(frame, nb, log):
if wxPlatform == "__WXMAC__":
wxMessageBox("This demo currently fails on the Mac.",
"Sorry")
return
else:
win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
overview = """<html><body>
<h4><center>Throbber</center></h4>
<p>%s</p>
</body></html>
""" % docString
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])])

View File

@@ -30,12 +30,12 @@ class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
outsideSizer = wxBoxSizer(wxVERTICAL)
msg = "Drag-And-Drop of URLs"
text = wxStaticText(self, -1, "", style=wxALIGN_CENTRE)
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, false))
text.SetFont(wxFont(24, wxSWISS, wxNORMAL, wxBOLD, False))
text.SetLabel(msg)
w,h = text.GetTextExtent(msg)
text.SetSize(wxSize(w,h+1))
@@ -44,7 +44,7 @@ class TestPanel(wxPanel):
outsideSizer.Add(wxStaticLine(self, -1), 0, wxEXPAND)
outsideSizer.Add(20,20)
self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, false))
self.SetFont(wxFont(10, wxSWISS, wxNORMAL, wxBOLD, False))
inSizer = wxFlexGridSizer(2, 2, 5, 5)
inSizer.AddGrowableCol(0)

View File

@@ -56,7 +56,7 @@ class TestPanel(wxPanel):
else:
f = self.GetFont()
font = wxFont(14, f.GetFamily(), f.GetStyle(), wxBOLD, false,
font = wxFont(14, f.GetFamily(), f.GetStyle(), wxBOLD, False,
f.GetFaceName(), f.GetEncoding())
self.AddLine(box)
@@ -79,7 +79,7 @@ class TestPanel(wxPanel):
border = wxBoxSizer(wxVERTICAL)
border.Add(box, 1, wxEXPAND|wxALL, 10)
self.SetAutoLayout(true)
self.SetAutoLayout(True)
self.SetSizer(border)

View File

@@ -1,5 +1,5 @@
import string, sys
import sys
py2 = sys.version[0] == '2'
@@ -11,9 +11,9 @@ try:
else:
from xml.parsers import pyexpat
parsermodule = pyexpat
haveXML = true
haveXML = True
except ImportError:
haveXML = false
haveXML = False
#----------------------------------------------------------------------
@@ -76,7 +76,7 @@ else:
self.nodeStack = self.nodeStack[:-1]
def CharacterData(self, data ):
if string.strip(data):
if data.strip():
if py2:
data = data.encode()
self.AppendItem(self.nodeStack[-1], data)

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

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