Compare commits

..

1 Commits

Author SHA1 Message Date
Bryan Petty
ee3ad6dd6e This commit was manufactured by cvs2svn to create tag 'wxPy_2_3b1'.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/wxPy_2_3b1@8905 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2000-12-11 04:00:06 +00:00
263 changed files with 5511 additions and 35075 deletions

View File

@@ -55,6 +55,10 @@ 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.)
NOTE: There probably isn't going to be an official 2.2.2 release
for wxMSW so I have taken a snapshot of my workspace and made it
available at http://alldunn.com/wxPython/dist/others/
C. 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:
@@ -76,6 +80,7 @@ D. Change to the wx2\include\wx\msw directory and copy setup0.h to
wxUSE_NEW_GRID 1
wxUSE_GLOBAL_MEMORY_OPERATORS 0
wxUSE_LIBTIFF 1
wxUSE_GLCANVAS 1
wxDIALOG_UNIT_COMPATIBILITY 0
I also turn off the following as they are not currently used in
@@ -88,17 +93,11 @@ D. Change to the wx2\include\wx\msw directory and copy setup0.h to
wxUSE_DIALUP_MANAGER 0
wxUSE_DYNLIB_CLASS 0
wxUSE_DOC_VIEW_ARCHITECTURE 0
wxUSE_MDI_ARCHITECTURE 0
wxUSE_PLOT 0
wxUSE_POSTSCRIPT_ARCHITECTURE_IN_MSW 0
** NEW **
Be sure that wxUSE_GLCANVAS is defined to be 0 as wxPython now
keeps its own copy of the glcanvas sources and expects that it is
not in the main library. This is done to reduce the number of
dependant DLLs on the core library and therefore help reduce
startup time.
2. Build the wxWindows DLL
@@ -156,7 +155,7 @@ B. There are three different types of wxWindows DLLs that can be
C. Change to the wx2\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 pch USE_GLCANVAS=1 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

View File

@@ -2,75 +2,7 @@ CHANGES.txt for wxPython
----------------------------------------------------------------------
?????
-----
Removed initial startup dependency on the OpenGL DLLs so only the
glcanvasc.pyd depends on them.
Changed wxFont, wxPen, wxBrush to not implicitly use the
wxThe[Font|Pen|Brush]List behind the scenes, but to use normal ctor
and dtors.
Exposed the wxThe[Font|Pen|Brush]List to wxPython.
Also added wxTheColourDatabase and added a library module (in the
wxPython.lib.colourdb module) to load LOTS more colour names into the
colour database.
Added wxWakeUpMainThread, wxMutexGuiEnter, wxMutexGuiLeave,
wxMutexGuiLocker and wxThread_IsMain to assist with dealing with GUI
access from non-GUI threads.
wxPyOnDemandOutputWindow is now (more) thread safe if non-GUI threads
use print, sys.stdout.write, etc.
Added CreateTextSizer and CreateButtonSizer to wxDialog
Added wxPython/lib/infoframe.py from Chris Fama. It contains a class
that can be used in place of wxPyOnDemandOutputWindow.
Added colourselect.py, imagebrowser.py and an updated calendar.py to
wxPython/lib from Lorne White.
Added patch to wxPoint_LIST_helper from Tim Hochberg that should make
it gobs faster in certain situations.
Added tools that will take an image file in a wx supported format and
convert it to data embedded in a Python source file. The image is
converted to XPM format (with its transparency mask intact, if there
is one) which is essentially a list of strings containing info about
each pixel. It is then pickled and optionally compressed and written
to a Python source file along with functions to convert it to either a
wxBitmap or a wxImage. See wxPython/demo/images.py for examples, and
wxPython/Tools/img2py.py for the implementation.
Fixed wxStyledTextCtrl to be much faster on wxGTK. There was some
experimental code that got left in place that ended up causing way too
many refreshes.
A couple more hacks in my_distutils.py so wxPython can be built with
the distutils that comes with Python 2.1.
Added a ton of missing methods for wxPrintData.
Switched to InnoSetup for MSW distributions.
Added wxToggleButton.
Fixed bug that prevented wxTreeCtrl.OnCompareItems from being called.
2.2.6
-----
No changes happened in the Python wrappers for this release, only
changes and fixes in the wxWindows library.
2.2.5
2.3b1
-----
New typemaps for wxString when compiling for Python 2.0 and beyond
@@ -83,7 +15,7 @@ Fixed the generic buttons so tool tips work for them.
Fixed a bug in the demo's tree control.
Added a listbox to the listbox demo that shows how to find items with
a matching prefix as keys are typed.
a patching prefix as keys are typed.
Added code to the wxListCtrl demo to show how to get text from a
column in report mode.
@@ -101,33 +33,6 @@ Added wxNotifyEvent.Allow()
Fixed GOBS of reference leaks.
Massive code changes and cleanup to allow wxPython to be split into
multiple extension modules again. A Python CObject is used to allow
the "export" of SWIG functions and other common helper functions from
the wxc module to other modules, even if they are in separate shared
libraries. Should also be usable from 3rd party code, just include
wxPython/src/export.h
Changed the default setup so the following are built as separate
extension modules: calendar, glcanvas, grid, html, ogl, stc, and
utils. Will probably add more later.
Changed the wxPrinterDC to use the new constructor taking a
wxPrintData object. The old ctor is still there using the
wxPrinterDC2 name.
Added wxPython.lib.anchors.py from Riaan Booysen. It contains a class
that implements Delphi's Anchors with wxLayoutConstraints.
Added wxPython.lib.fancytext from Timothy Hochberg.
Changed the GenericButtons to send their event in idle time, so the
mouse won't be captured when the event handler is called.
Added wxPython.lib.rpcMixin from Greg Landrum, although it's not
integrated with the demo yet. It allows a wxPython GUI to be an
XML-RPC server.
New in 2.2.2

View File

@@ -2,11 +2,6 @@ include *.txt
include my_distutils.py
## include my_install_data.py
include licence/*.txt
include b
include b.bat
include SWIG/*
exclude SWIG/CVS/*
include demo/*.py
include demo/bitmaps/*.bmp
@@ -14,11 +9,6 @@ include demo/bitmaps/*.ico
include demo/bitmaps/*.gif
include demo/bitmaps/*.png
include demo/bitmaps/*.jpg
include demo/bmp_source/*.bmp
include demo/bmp_source/*.ico
include demo/bmp_source/*.gif
include demo/bmp_source/*.png
include demo/bmp_source/*.jpg
include demo/README.txt
include demo/*.xml
include demo/data/*.png
@@ -30,17 +20,6 @@ include demo/data/*.i
include demo/data/*.h
include demo/data/*.py
include samples/doodle/*.txt
include samples/doodle/*.py
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 wxPython/lib/*.py
include wxPython/lib/*.txt
include wxPython/lib/editor/*.py
@@ -48,6 +27,7 @@ include wxPython/lib/editor/*.txt
exclude wxPython/*
exclude tests
exclude SWIG
include src/*.i
include src/*.py

View File

@@ -50,7 +50,7 @@ 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
http://lists.sourceforge.net/mailman/listinfo/wxpython-users
Or you can send mail directly to the list using this address:
@@ -73,7 +73,6 @@ Please also see the following files in this directory:
licence/* Text of the wxWindows license.
-----------------
Robin Dunn
robin@alldunn.com
@@ -84,5 +83,3 @@ robin@alldunn.com

View File

@@ -6,9 +6,6 @@ if [ "$1" = "15" ]; then
elif [ "$1" = "20" ]; then
PYVER=2.0
shift
elif [ "$1" = "21" ]; then
PYVER=2.1
shift
fi
@@ -24,11 +21,6 @@ if [ "$1" = "c" ]; then
CMD="$SETUP $FLAGS $OTHERFLAGS clean"
OTHERCMD="rm -f wxPython/*.so"
# "d" --> clean extension modules only
elif [ "$1" = "d" ]; then
shift
CMD="rm -f wxPython/*.so"
# "i" --> install
elif [ "$1" = "i" ]; then
shift
@@ -41,31 +33,8 @@ elif [ "$1" = "s" ]; then
# "r" --> rpm dist
elif [ "$1" = "r" ]; then
# save the original
cp setup.py setup.py.save
# fix up setup.py the way we want...
sed "s/BUILD_GLCANVAS = /BUILD_GLCANVAS = 0 #/" < setup.py.save > setup.py.temp
sed "s/GL_ONLY = /GL_ONLY = 1 #/" < setup.py.temp > setup.py
# build wxPython-gl RPM
$SETUP $OTHERFLAGS bdist_rpm --binary-only --doc-files README.txt
rm dist/wxPython-gl*.tar.gz
# Build wxPython RPM
cp setup.py setup.py.temp
sed "s/GL_ONLY = /GL_ONLY = 0 #/" < setup.py.temp > setup.py
$SETUP $OTHERFLAGS bdist_rpm
# put the oringal back
cp setup.py.save setup.py
rm setup.py.*
# rebuild the source dist without the munched up setup.py
$SETUP $OTHERFLAGS sdist
exit 0
shift
CMD="$SETUP $OTHERFLAGS bdist_rpm"
# (no command arg) --> normal build for development
else

View File

@@ -5,17 +5,14 @@ set FLAGS=USE_SWIG=1 IN_CVS_TREE=1
rem Use non-default python?
iff "%1" == "15" .or. "%1" == "20" .or. "%1" == "21" then
set PYTHON=c:\tools\python%1%\python.exe
iff "%1" == "15" .or. "%1" == "20" then
set SETUP=c:\tools\python%1%\python.exe -u setup.py
shift
else
set PYTHON=python
set SETUP=python -u setup.py
endiff
set SETUP=%PYTHON% -u setup.py
%PYTHON% -c "import sys;print '\n', sys.version, '\n'"
rem "c" --> clean
iff "%1" == "c" then
@@ -33,11 +30,6 @@ elseiff "%1" == "i" then
shift
set CMD=%SETUP% build install
rem "r" --> make installer
elseiff "%1" == "r" then
shift
set CMD=%PYTHON% distrib\make_installer.py
rem "s" --> source dist
elseiff "%1" == "s" then
shift

View File

@@ -14,13 +14,8 @@
%module glcanvas
%{
#include "export.h"
#ifdef __WXMSW__
#include "myglcanvas.h"
#else
#include "helpers.h"
#include <wx/glcanvas.h>
#endif
%}
//---------------------------------------------------------------------------
@@ -40,6 +35,14 @@
%extern events.i
%{
#if defined(__WXMSW__)
static wxString wxPyEmptyStr("");
static wxPoint wxPyDefaultPosition(-1, -1);
static wxSize wxPyDefaultSize(-1, -1);
#endif
%}
%pragma(python) code = "import wx"
//---------------------------------------------------------------------------
@@ -96,8 +99,8 @@ public:
class wxGLCanvas : public wxScrolledWindow {
public:
wxGLCanvas(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxPoint& pos = wxPyDefaultPosition,
const wxSize& size = wxPyDefaultSize, long style = 0,
const char* name = "GLCanvas",
int *attribList = NULL,
const wxPalette& palette = wxNullPalette);

View File

@@ -55,22 +55,17 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "glcanvasc"
#include "export.h"
#ifdef __WXMSW__
#include "myglcanvas.h"
#else
#include "helpers.h"
#include <wx/glcanvas.h>
#endif
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyList_Check(target)) {
o2 = target;
target = PyList_New(0);
@@ -87,32 +82,34 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "string type is required for parameter";
static char* wxStringErrorMsg = "string type is required for parameter";
#if defined(__WXMSW__)
static wxString wxPyEmptyStr("");
static wxPoint wxPyDefaultPosition(-1, -1);
static wxSize wxPyDefaultSize(-1, -1);
#endif
#ifdef __cplusplus
extern "C" {
@@ -470,8 +467,8 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *
wxGLCanvas * _result;
wxWindow * _arg0;
wxWindowID _arg1 = (wxWindowID ) -1;
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
wxPoint * _arg2 = (wxPoint *) &wxPyDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxPyDefaultSize;
long _arg4 = (long ) 0;
char * _arg5 = (char *) "GLCanvas";
int * _arg6 = (int *) NULL;
@@ -734,7 +731,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPyProcess","_class_wxPyProcess",0},
{ "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0},
{ "_wxImageHandler","_class_wxImageHandler",0},
{ "_wxMutexGuiLocker","_class_wxMutexGuiLocker",0},
{ "_wxLog","_class_wxLog",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_wxMask","_class_wxMask",0},
@@ -750,7 +746,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObject","_class_wxDataObject",0},
{ "_class_wxPyFontEnumerator","_wxPyFontEnumerator",0},
{ "_wxStaticBox","_class_wxStaticBox",0},
{ "_wxColourDatabase","_class_wxColourDatabase",0},
{ "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
{ "_wxPyDropSource","_class_wxPyDropSource",0},
{ "_wxChoice","_class_wxChoice",0},
@@ -831,7 +826,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxStaticLine","_class_wxStaticLine",0},
{ "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0},
{ "_wxBrush","_class_wxBrush",0},
{ "_wxToggleButton","_class_wxToggleButton",0},
{ "_wxMiniFrame","_class_wxMiniFrame",0},
{ "_class_wxNotebookEvent","_wxNotebookEvent",0},
{ "_class_wxPyPrintout","_wxPyPrintout",0},
@@ -868,7 +862,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxZipFSHandler","_wxZipFSHandler",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxPenList","_class_wxPenList",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
{ "_wxTimerEvent","_class_wxTimerEvent",0},
@@ -883,7 +876,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMessageDialog","_class_wxMessageDialog",0},
{ "_class_wxValidator","_wxValidator",0},
{ "_class_wxPyEvent","_wxPyEvent",0},
{ "_class_wxMutexGuiLocker","_wxMutexGuiLocker",0},
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
{ "_wxConfig","_class_wxConfig",0},
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
@@ -896,7 +888,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxToolBar","_wxToolBar",0},
{ "_wxDropTarget","_class_wxDropTarget",0},
{ "_class_wxStaticLine","_wxStaticLine",0},
{ "_class_wxColourDatabase","_wxColourDatabase",0},
{ "_wxScrollEvent","_class_wxScrollEvent",0},
{ "_wxToolBarToolBase","_class_wxToolBarToolBase",0},
{ "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0},
@@ -925,11 +916,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxScrollWinEvent","_class_wxScrollWinEvent",0},
{ "_wxGenericDragImage","_class_wxGenericDragImage",0},
{ "_class_wxProgressDialog","_wxProgressDialog",0},
{ "_class_wxBrushList","_wxBrushList",0},
{ "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
{ "_wxPyInputStream","_class_wxPyInputStream",0},
{ "_wxPyApp","_class_wxPyApp",0},
{ "_class_wxPenList","_wxPenList",0},
{ "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
{ "_class_wxOutputStream","_wxOutputStream",0},
{ "_wxLogTextCtrl","_class_wxLogTextCtrl",0},
@@ -992,9 +981,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxFontList","_class_wxFontList",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxJoystick","_class_wxJoystick",0},
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
{ "_wxClientDC","_class_wxClientDC",0},
{ "_wxMouseEvent","_class_wxMouseEvent",0},
@@ -1157,7 +1146,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
{ "_class_wxTipProvider","_wxTipProvider",0},
{ "_class_wxToggleButton","_wxToggleButton",0},
{ "_class_wxMiniFrame","_wxMiniFrame",0},
{ "_wxFontDialog","_class_wxFontDialog",0},
{ "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0},
@@ -1176,13 +1164,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxFontList","_wxFontList",0},
{ "_class_wxJoystick","_wxJoystick",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_class_wxGLCanvas","_wxGLCanvas",0},
{ "_wxBrushList","_class_wxBrushList",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxLogNull","_wxLogNull",0},
{ "_class_wxSize","_wxSize",0},

View File

@@ -55,22 +55,17 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "glcanvasc"
#include "export.h"
#ifdef __WXMSW__
#include "myglcanvas.h"
#else
#include "helpers.h"
#include <wx/glcanvas.h>
#endif
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyList_Check(target)) {
o2 = target;
target = PyList_New(0);
@@ -87,32 +82,34 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "string type is required for parameter";
static char* wxStringErrorMsg = "string type is required for parameter";
#if defined(__WXMSW__)
static wxString wxPyEmptyStr("");
static wxPoint wxPyDefaultPosition(-1, -1);
static wxSize wxPyDefaultSize(-1, -1);
#endif
#ifdef __cplusplus
extern "C" {
@@ -344,8 +341,8 @@ static PyObject *_wrap_new_wxGLCanvas(PyObject *self, PyObject *args, PyObject *
wxGLCanvas * _result;
wxWindow * _arg0;
wxWindowID _arg1 = (wxWindowID ) -1;
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
wxPoint * _arg2 = (wxPoint *) &wxPyDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxPyDefaultSize;
long _arg4 = (long ) 0;
char * _arg5 = (char *) "GLCanvas";
int * _arg6 = (int *) NULL;
@@ -604,7 +601,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPyProcess","_class_wxPyProcess",0},
{ "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0},
{ "_wxImageHandler","_class_wxImageHandler",0},
{ "_wxMutexGuiLocker","_class_wxMutexGuiLocker",0},
{ "_wxLog","_class_wxLog",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_wxMask","_class_wxMask",0},
@@ -620,7 +616,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObject","_class_wxDataObject",0},
{ "_class_wxPyFontEnumerator","_wxPyFontEnumerator",0},
{ "_wxStaticBox","_class_wxStaticBox",0},
{ "_wxColourDatabase","_class_wxColourDatabase",0},
{ "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
{ "_wxPyDropSource","_class_wxPyDropSource",0},
{ "_wxChoice","_class_wxChoice",0},
@@ -664,9 +659,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxRealPoint","_wxRealPoint",0},
{ "_wxNavigationKeyEvent","_class_wxNavigationKeyEvent",0},
{ "_wxPNMHandler","_class_wxPNMHandler",0},
{ "_wxPrinterDC","_class_wxPrinterDC",0},
{ "_wxWindowCreateEvent","_class_wxWindowCreateEvent",0},
{ "_wxLogGui","_class_wxLogGui",0},
{ "_wxPrinterDC","_class_wxPrinterDC",0},
{ "_class_wxMenuItem","_wxMenuItem",0},
{ "_class_wxPaintEvent","_wxPaintEvent",0},
{ "_wxSysColourChangedEvent","_class_wxSysColourChangedEvent",0},
@@ -701,7 +696,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxStaticLine","_class_wxStaticLine",0},
{ "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0},
{ "_wxBrush","_class_wxBrush",0},
{ "_wxToggleButton","_class_wxToggleButton",0},
{ "_wxMiniFrame","_class_wxMiniFrame",0},
{ "_class_wxNotebookEvent","_wxNotebookEvent",0},
{ "_class_wxPyPrintout","_wxPyPrintout",0},
@@ -738,7 +732,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxZipFSHandler","_wxZipFSHandler",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxPenList","_class_wxPenList",0},
{ "_wxTaskBarIcon","_class_wxTaskBarIcon",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
@@ -754,7 +747,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMessageDialog","_class_wxMessageDialog",0},
{ "_class_wxValidator","_wxValidator",0},
{ "_class_wxPyEvent","_wxPyEvent",0},
{ "_class_wxMutexGuiLocker","_wxMutexGuiLocker",0},
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
{ "_wxConfig","_class_wxConfig",0},
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
@@ -767,7 +759,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxToolBar","_wxToolBar",0},
{ "_wxDropTarget","_class_wxDropTarget",0},
{ "_class_wxStaticLine","_wxStaticLine",0},
{ "_class_wxColourDatabase","_wxColourDatabase",0},
{ "_wxScrollEvent","_class_wxScrollEvent",0},
{ "_wxToolBarToolBase","_class_wxToolBarToolBase",0},
{ "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0},
@@ -796,11 +787,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxScrollWinEvent","_class_wxScrollWinEvent",0},
{ "_wxGenericDragImage","_class_wxGenericDragImage",0},
{ "_class_wxProgressDialog","_wxProgressDialog",0},
{ "_class_wxBrushList","_wxBrushList",0},
{ "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
{ "_wxPyInputStream","_class_wxPyInputStream",0},
{ "_wxPyApp","_class_wxPyApp",0},
{ "_class_wxPenList","_wxPenList",0},
{ "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
{ "_class_wxOutputStream","_wxOutputStream",0},
{ "_wxLogTextCtrl","_class_wxLogTextCtrl",0},
@@ -864,7 +853,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxFontList","_class_wxFontList",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxJoystick","_class_wxJoystick",0},
@@ -990,12 +978,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPyApp","_wxPyApp",0},
{ "_wxSize","_class_wxSize",0},
{ "_wxRegionIterator","_class_wxRegionIterator",0},
{ "_class_wxPrinterDC","_wxPrinterDC",0},
{ "_class_wxPyTextDataObject","_wxPyTextDataObject",0},
{ "_class_wxLogTextCtrl","_wxLogTextCtrl",0},
{ "_class_wxLogGui","_wxLogGui",0},
{ "_class_wxMDIParentFrame","_wxMDIParentFrame",0},
{ "_wxPyTreeItemData","_class_wxPyTreeItemData",0},
{ "_class_wxPrinterDC","_wxPrinterDC",0},
{ "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0},
{ "_class_wxTimeSpan","_wxTimeSpan",0},
{ "_class_wxPyFileSystemHandler","_wxPyFileSystemHandler",0},
@@ -1032,7 +1020,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
{ "_class_wxTipProvider","_wxTipProvider",0},
{ "_class_wxToggleButton","_wxToggleButton",0},
{ "_class_wxMiniFrame","_wxMiniFrame",0},
{ "_wxFontDialog","_class_wxFontDialog",0},
{ "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0},
@@ -1051,14 +1038,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxFontList","_wxFontList",0},
{ "_class_wxJoystick","_wxJoystick",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_class_wxGLCanvas","_wxGLCanvas",0},
{ "_wxBrushList","_class_wxBrushList",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxLogNull","_wxLogNull",0},
{ "_class_wxSize","_wxSize",0},

View File

@@ -1,720 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: glcanvas.cpp
// Purpose: wxGLCanvas, for using OpenGL with wxWindows under MS Windows
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma implementation "glcanvas.h"
#endif
#include "wx/wxprec.h"
#if defined(__BORLANDC__)
#pragma hdrstop
#endif
#include <wx/setup.h>
#undef wxUSE_GLCANVAS
#define wxUSE_GLCANVAS 1
#if wxUSE_GLCANVAS
#ifndef WX_PRECOMP
#include <wx/frame.h>
#endif
#include <wx/msw/private.h>
#include <wx/settings.h>
#include <wx/log.h>
#include "myglcanvas.h"
wxChar wxGLCanvasClassName[] = wxT("wxGLCanvasClass");
LRESULT WXDLLEXPORT APIENTRY _EXPORT wxWndProc(HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
/*
* GLContext implementation
*/
wxGLContext::wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette)
{
m_window = win;
m_hDC = win->GetHDC();
m_glContext = wglCreateContext((HDC) m_hDC);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
wglMakeCurrent((HDC) m_hDC, m_glContext);
}
wxGLContext::wxGLContext(
bool isRGB, wxGLCanvas *win,
const wxPalette& palette,
const wxGLContext *other /* for sharing display lists */
)
{
m_window = win;
m_hDC = win->GetHDC();
m_glContext = wglCreateContext((HDC) m_hDC);
wxCHECK_RET( m_glContext, wxT("Couldn't create OpenGl context") );
if( other != 0 )
wglShareLists( other->m_glContext, m_glContext );
wglMakeCurrent((HDC) m_hDC, m_glContext);
}
wxGLContext::~wxGLContext()
{
if (m_glContext)
{
wglMakeCurrent(NULL, NULL);
wglDeleteContext(m_glContext);
}
}
void wxGLContext::SwapBuffers()
{
if (m_glContext)
{
wglMakeCurrent((HDC) m_hDC, m_glContext);
::SwapBuffers((HDC) m_hDC); //blits the backbuffer into DC
}
}
void wxGLContext::SetCurrent()
{
if (m_glContext)
{
wglMakeCurrent((HDC) m_hDC, m_glContext);
}
/*
setupPixelFormat(hDC);
setupPalette(hDC);
*/
}
void wxGLContext::SetColour(const char *colour)
{
float r = 0.0;
float g = 0.0;
float b = 0.0;
wxColour *col = wxTheColourDatabase->FindColour(colour);
if (col)
{
r = (float)(col->Red()/256.0);
g = (float)(col->Green()/256.0);
b = (float)(col->Blue()/256.0);
glColor3f( r, g, b);
}
}
/*
* wxGLCanvas implementation
*/
IMPLEMENT_CLASS(wxGLCanvas, wxScrolledWindow)
BEGIN_EVENT_TABLE(wxGLCanvas, wxScrolledWindow)
EVT_SIZE(wxGLCanvas::OnSize)
EVT_PALETTE_CHANGED(wxGLCanvas::OnPaletteChanged)
EVT_QUERY_NEW_PALETTE(wxGLCanvas::OnQueryNewPalette)
END_EVENT_TABLE()
wxGLCanvas::wxGLCanvas(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
int *attribList, const wxPalette& palette) : wxScrolledWindow()
{
m_glContext = (wxGLContext*) NULL;
bool ret = Create(parent, id, pos, size, style, name);
if ( ret )
{
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
}
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
SetupPixelFormat(attribList);
SetupPalette(palette);
m_glContext = new wxGLContext(TRUE, this, palette);
}
wxGLCanvas::wxGLCanvas( wxWindow *parent,
const wxGLContext *shared, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
int *attribList, const wxPalette& palette )
: wxScrolledWindow()
{
m_glContext = (wxGLContext*) NULL;
bool ret = Create(parent, id, pos, size, style, name);
if ( ret )
{
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
}
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
SetupPixelFormat(attribList);
SetupPalette(palette);
m_glContext = new wxGLContext(TRUE, this, palette, shared );
}
// Not very useful for wxMSW, but this is to be wxGTK compliant
wxGLCanvas::wxGLCanvas( wxWindow *parent, const wxGLCanvas *shared, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name,
int *attribList, const wxPalette& palette ):
wxScrolledWindow()
{
m_glContext = (wxGLContext*) NULL;
bool ret = Create(parent, id, pos, size, style, name);
if ( ret )
{
SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
}
m_hDC = (WXHDC) ::GetDC((HWND) GetHWND());
SetupPixelFormat(attribList);
SetupPalette(palette);
wxGLContext *sharedContext=0;
if (shared) sharedContext=shared->GetContext();
m_glContext = new wxGLContext(TRUE, this, palette, sharedContext );
}
wxGLCanvas::~wxGLCanvas()
{
if (m_glContext)
delete m_glContext;
::ReleaseDC((HWND) GetHWND(), (HDC) m_hDC);
}
// Replaces wxWindow::Create functionality, since we need to use a different window class
bool wxGLCanvas::Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name)
{
/*
Suggestion from Kelly Brock <kbrock@8cs.com> (not yet implemented):
OpenGL corruption fix is simple assuming it doesn't screw anything else
up. Add the following line to the top of the create function:
wxSize parentSize = GetClientSize();
All locations within the function that use 'size' are changed to
'parentSize'.
The above corrects the initial display corruption with the GeForce and
TNT2, not sure about other NVidia cards yet.
*/
static bool registeredGLCanvasClass = FALSE;
// We have to register a special window class because we need
// the CS_OWNDC style for GLCanvas.
/*
From Angel Popov <jumpo@bitex.com>
Here are two snips from a dicussion in the OpenGL Gamedev list that explains
how this problem can be fixed:
"There are 5 common DCs available in Win95. These are aquired when you call
GetDC or GetDCEx from a window that does _not_ have the OWNDC flag.
OWNDC flagged windows do not get their DC from the common DC pool, the issue
is they require 800 bytes each from the limited 64Kb local heap for GDI."
"The deal is, if you hold onto one of the 5 shared DC's too long (as GL apps
do), Win95 will actually "steal" it from you. MakeCurrent fails,
apparently, because Windows re-assigns the HDC to a different window. The
only way to prevent this, the only reliable means, is to set CS_OWNDC."
*/
if (!registeredGLCanvasClass)
{
WNDCLASS wndclass;
static const long styleNormal = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS | CS_OWNDC;
// the fields which are common to all classes
wndclass.lpfnWndProc = (WNDPROC)wxWndProc;
wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = sizeof( DWORD ); // VZ: what is this DWORD used for?
wndclass.hInstance = wxhInstance;
wndclass.hIcon = (HICON) NULL;
wndclass.hCursor = ::LoadCursor((HINSTANCE)NULL, IDC_ARROW);
wndclass.lpszMenuName = NULL;
// Register the GLCanvas class name
wndclass.hbrBackground = (HBRUSH)NULL;
wndclass.lpszClassName = wxGLCanvasClassName;
wndclass.style = styleNormal;
if ( !RegisterClass(&wndclass) )
{
wxLogLastError(wxT("RegisterClass(wxGLCanvasClass)"));
return FALSE;
}
registeredGLCanvasClass = TRUE;
}
wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindow without parent") );
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
return FALSE;
parent->AddChild(this);
DWORD msflags = 0;
if ( style & wxBORDER )
msflags |= WS_BORDER;
if ( style & wxTHICK_FRAME )
msflags |= WS_THICKFRAME;
/*
A general rule with OpenGL and Win32 is that any window that will have a
HGLRC built for it must have two flags: WS_CLIPCHILDREN & WS_CLIPSIBLINGS.
You can find references about this within the knowledge base and most OpenGL
books that contain the wgl function descriptions.
*/
msflags |= WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
// if ( style & wxCLIP_CHILDREN )
// msflags |= WS_CLIPCHILDREN;
msflags |= WS_CLIPCHILDREN;
bool want3D;
WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
// Even with extended styles, need to combine with WS_BORDER
// for them to look right.
if ( want3D || (m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER ) ||
(m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER))
{
msflags |= WS_BORDER;
}
// calculate the value to return from WM_GETDLGCODE handler
if ( GetWindowStyleFlag() & wxWANTS_CHARS )
{
// want everything: i.e. all keys and WM_CHAR message
m_lDlgCode = DLGC_WANTARROWS | DLGC_WANTCHARS |
DLGC_WANTTAB | DLGC_WANTMESSAGE;
}
MSWCreate(m_windowId, parent, wxGLCanvasClassName, this, NULL,
pos.x, pos.y,
WidthDefault(size.x), HeightDefault(size.y),
msflags, NULL, exStyle);
return TRUE;
}
void wxGLCanvas::SetupPixelFormat(int *attribList) // (HDC hDC)
{
int pixelFormat;
PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), /* size */
1, /* version */
PFD_SUPPORT_OPENGL |
PFD_DRAW_TO_WINDOW |
PFD_DOUBLEBUFFER, /* support double-buffering */
PFD_TYPE_RGBA, /* color type */
16, /* prefered color depth */
0, 0, 0, 0, 0, 0, /* color bits (ignored) */
0, /* no alpha buffer */
0, /* alpha bits (ignored) */
0, /* no accumulation buffer */
0, 0, 0, 0, /* accum bits (ignored) */
16, /* depth buffer */
0, /* no stencil buffer */
0, /* no auxiliary buffers */
PFD_MAIN_PLANE, /* main layer */
0, /* reserved */
0, 0, 0, /* no layer, visible, damage masks */
};
if (attribList) {
pfd.dwFlags &= ~PFD_DOUBLEBUFFER;
pfd.iPixelType = PFD_TYPE_COLORINDEX;
pfd.cColorBits = 0;
int arg=0;
while( (attribList[arg]!=0) )
{
switch( attribList[arg++] )
{
case WX_GL_RGBA:
pfd.iPixelType = PFD_TYPE_RGBA;
break;
case WX_GL_BUFFER_SIZE:
pfd.cColorBits = attribList[arg++];
break;
case WX_GL_LEVEL:
// this member looks like it may be obsolete
if (attribList[arg] > 0) {
pfd.iLayerType = PFD_OVERLAY_PLANE;
} else if (attribList[arg] < 0) {
pfd.iLayerType = PFD_UNDERLAY_PLANE;
} else {
pfd.iLayerType = PFD_MAIN_PLANE;
}
arg++;
break;
case WX_GL_DOUBLEBUFFER:
pfd.dwFlags |= PFD_DOUBLEBUFFER;
break;
case WX_GL_STEREO:
pfd.dwFlags |= PFD_STEREO;
break;
case WX_GL_AUX_BUFFERS:
pfd.cAuxBuffers = attribList[arg++];
break;
case WX_GL_MIN_RED:
pfd.cColorBits += (pfd.cRedBits = attribList[arg++]);
break;
case WX_GL_MIN_GREEN:
pfd.cColorBits += (pfd.cGreenBits = attribList[arg++]);
break;
case WX_GL_MIN_BLUE:
pfd.cColorBits += (pfd.cBlueBits = attribList[arg++]);
break;
case WX_GL_MIN_ALPHA:
// doesn't count in cColorBits
pfd.cAlphaBits = attribList[arg++];
break;
case WX_GL_DEPTH_SIZE:
pfd.cDepthBits = attribList[arg++];
break;
case WX_GL_STENCIL_SIZE:
pfd.cStencilBits = attribList[arg++];
break;
case WX_GL_MIN_ACCUM_RED:
pfd.cAccumBits += (pfd.cAccumRedBits = attribList[arg++]);
break;
case WX_GL_MIN_ACCUM_GREEN:
pfd.cAccumBits += (pfd.cAccumGreenBits = attribList[arg++]);
break;
case WX_GL_MIN_ACCUM_BLUE:
pfd.cAccumBits += (pfd.cAccumBlueBits = attribList[arg++]);
break;
case WX_GL_MIN_ACCUM_ALPHA:
pfd.cAccumBits += (pfd.cAccumAlphaBits = attribList[arg++]);
break;
default:
break;
}
}
}
pixelFormat = ChoosePixelFormat((HDC) m_hDC, &pfd);
if (pixelFormat == 0) {
MessageBox(WindowFromDC((HDC) m_hDC), wxT("ChoosePixelFormat failed."), wxT("Error"),
MB_ICONERROR | MB_OK);
exit(1);
}
if (SetPixelFormat((HDC) m_hDC, pixelFormat, &pfd) != TRUE) {
MessageBox(WindowFromDC((HDC) m_hDC), wxT("SetPixelFormat failed."), wxT("Error"),
MB_ICONERROR | MB_OK);
exit(1);
}
}
void wxGLCanvas::SetupPalette(const wxPalette& palette)
{
int pixelFormat = GetPixelFormat((HDC) m_hDC);
PIXELFORMATDESCRIPTOR pfd;
DescribePixelFormat((HDC) m_hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
if (pfd.dwFlags & PFD_NEED_PALETTE)
{
}
else
{
return;
}
m_palette = palette;
if ( !m_palette.Ok() )
{
m_palette = CreateDefaultPalette();
}
if (m_palette.Ok())
{
SelectPalette((HDC) m_hDC, (HPALETTE) m_palette.GetHPALETTE(), FALSE);
RealizePalette((HDC) m_hDC);
}
}
wxPalette wxGLCanvas::CreateDefaultPalette()
{
PIXELFORMATDESCRIPTOR pfd;
int paletteSize;
int pixelFormat = GetPixelFormat((HDC) m_hDC);
DescribePixelFormat((HDC) m_hDC, pixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
paletteSize = 1 << pfd.cColorBits;
LOGPALETTE* pPal =
(LOGPALETTE*) malloc(sizeof(LOGPALETTE) + paletteSize * sizeof(PALETTEENTRY));
pPal->palVersion = 0x300;
pPal->palNumEntries = paletteSize;
/* build a simple RGB color palette */
{
int redMask = (1 << pfd.cRedBits) - 1;
int greenMask = (1 << pfd.cGreenBits) - 1;
int blueMask = (1 << pfd.cBlueBits) - 1;
int i;
for (i=0; i<paletteSize; ++i) {
pPal->palPalEntry[i].peRed =
(((i >> pfd.cRedShift) & redMask) * 255) / redMask;
pPal->palPalEntry[i].peGreen =
(((i >> pfd.cGreenShift) & greenMask) * 255) / greenMask;
pPal->palPalEntry[i].peBlue =
(((i >> pfd.cBlueShift) & blueMask) * 255) / blueMask;
pPal->palPalEntry[i].peFlags = 0;
}
}
HPALETTE hPalette = CreatePalette(pPal);
free(pPal);
wxPalette palette;
palette.SetHPALETTE((WXHPALETTE) hPalette);
return palette;
}
void wxGLCanvas::SwapBuffers()
{
if (m_glContext)
m_glContext->SwapBuffers();
}
void wxGLCanvas::OnSize(wxSizeEvent& event)
{
int width, height;
GetClientSize(& width, & height);
if (m_glContext)
{
m_glContext->SetCurrent();
glViewport(0, 0, (GLint)width, (GLint)height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFrustum( -1.0, 1.0, -1.0, 1.0, 5.0, 15.0 );
glMatrixMode(GL_MODELVIEW);
}
}
void wxGLCanvas::SetCurrent()
{
if (m_glContext)
{
m_glContext->SetCurrent();
}
}
void wxGLCanvas::SetColour(const char *colour)
{
if (m_glContext)
m_glContext->SetColour(colour);
}
// TODO: Have to have this called by parent frame (?)
// So we need wxFrame to call OnQueryNewPalette for all children...
void wxGLCanvas::OnQueryNewPalette(wxQueryNewPaletteEvent& event)
{
/* realize palette if this is the current window */
if ( GetPalette()->Ok() ) {
::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE());
::SelectPalette((HDC) GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE);
::RealizePalette((HDC) GetHDC());
Refresh();
event.SetPaletteRealized(TRUE);
}
else
event.SetPaletteRealized(FALSE);
}
// I think this doesn't have to be propagated to child windows.
void wxGLCanvas::OnPaletteChanged(wxPaletteChangedEvent& event)
{
/* realize palette if this is *not* the current window */
if ( GetPalette() &&
GetPalette()->Ok() && (this != event.GetChangedWindow()) )
{
::UnrealizeObject((HPALETTE) GetPalette()->GetHPALETTE());
::SelectPalette((HDC) GetHDC(), (HPALETTE) GetPalette()->GetHPALETTE(), FALSE);
::RealizePalette((HDC) GetHDC());
Refresh();
}
}
/* Give extensions proper function names. */
/* EXT_vertex_array */
void glArrayElementEXT(GLint i)
{
}
void glColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
}
void glDrawArraysEXT(GLenum mode, GLint first, GLsizei count)
{
#ifdef GL_EXT_vertex_array
static PFNGLDRAWARRAYSEXTPROC proc = 0;
if ( !proc )
{
proc = (PFNGLDRAWARRAYSEXTPROC) wglGetProcAddress("glDrawArraysEXT");
}
if ( proc )
(* proc) (mode, first, count);
#endif
}
void glEdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean *pointer)
{
}
void glGetPointervEXT(GLenum pname, GLvoid* *params)
{
}
void glIndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
}
void glNormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
#ifdef GL_EXT_vertex_array
static PFNGLNORMALPOINTEREXTPROC proc = 0;
if ( !proc )
{
proc = (PFNGLNORMALPOINTEREXTPROC) wglGetProcAddress("glNormalPointerEXT");
}
if ( proc )
(* proc) (type, stride, count, pointer);
#endif
}
void glTexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
}
void glVertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer)
{
#ifdef GL_EXT_vertex_array
static PFNGLVERTEXPOINTEREXTPROC proc = 0;
if ( !proc )
{
proc = (PFNGLVERTEXPOINTEREXTPROC) wglGetProcAddress("glVertexPointerEXT");
}
if ( proc )
(* proc) (size, type, stride, count, pointer);
#endif
}
/* EXT_color_subtable */
void glColorSubtableEXT(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *table)
{
}
/* EXT_color_table */
void glColorTableEXT(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table)
{
}
void glCopyColorTableEXT(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
{
}
void glGetColorTableEXT(GLenum target, GLenum format, GLenum type, GLvoid *table)
{
}
void glGetColorTableParamaterfvEXT(GLenum target, GLenum pname, GLfloat *params)
{
}
void glGetColorTavleParameterivEXT(GLenum target, GLenum pname, GLint *params)
{
}
/* SGI_compiled_vertex_array */
void glLockArraysSGI(GLint first, GLsizei count)
{
}
void glUnlockArraysSGI()
{
}
/* SGI_cull_vertex */
void glCullParameterdvSGI(GLenum pname, GLdouble* params)
{
}
void glCullParameterfvSGI(GLenum pname, GLfloat* params)
{
}
/* SGI_index_func */
void glIndexFuncSGI(GLenum func, GLclampf ref)
{
}
/* SGI_index_material */
void glIndexMaterialSGI(GLenum face, GLenum mode)
{
}
/* WIN_swap_hint */
void glAddSwapHintRectWin(GLint x, GLint y, GLsizei width, GLsizei height)
{
}
#endif
// wxUSE_GLCANVAS

View File

@@ -1,141 +0,0 @@
/////////////////////////////////////////////////////////////////////////////
// Name: glcanvas.h
// Purpose: wxGLCanvas, for using OpenGL with wxWindows under Windows
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifdef __GNUG__
#pragma interface "glcanvas.h"
#endif
#ifndef _WX_GLCANVAS_H_
#define _WX_GLCANVAS_H_
#include <wx/setup.h>
#undef wxUSE_GLCANVAS
#define wxUSE_GLCANVAS 1
#if wxUSE_GLCANVAS
#include <wx/palette.h>
#include <wx/scrolwin.h>
#include <windows.h>
#include "gl/gl.h"
//---------------------------------------------------------------------------
// Constants for attriblist
//---------------------------------------------------------------------------
// The generic GL implementation doesn't support most of these options,
// such as stereo, auxiliary buffers, alpha channel, and accum buffer.
// Other implementations may actually support them.
enum
{
WX_GL_RGBA=1, /* use true color palette */
WX_GL_BUFFER_SIZE, /* bits for buffer if not WX_GL_RGBA */
WX_GL_LEVEL, /* 0 for main buffer, >0 for overlay, <0 for underlay */
WX_GL_DOUBLEBUFFER, /* use doublebuffer */
WX_GL_STEREO, /* use stereoscopic display */
WX_GL_AUX_BUFFERS, /* number of auxiliary buffers */
WX_GL_MIN_RED, /* use red buffer with most bits (> MIN_RED bits) */
WX_GL_MIN_GREEN, /* use green buffer with most bits (> MIN_GREEN bits) */
WX_GL_MIN_BLUE, /* use blue buffer with most bits (> MIN_BLUE bits) */
WX_GL_MIN_ALPHA, /* use blue buffer with most bits (> MIN_ALPHA bits) */
WX_GL_DEPTH_SIZE, /* bits for Z-buffer (0,16,32) */
WX_GL_STENCIL_SIZE, /* bits for stencil buffer */
WX_GL_MIN_ACCUM_RED, /* use red accum buffer with most bits (> MIN_ACCUM_RED bits) */
WX_GL_MIN_ACCUM_GREEN, /* use green buffer with most bits (> MIN_ACCUM_GREEN bits) */
WX_GL_MIN_ACCUM_BLUE, /* use blue buffer with most bits (> MIN_ACCUM_BLUE bits) */
WX_GL_MIN_ACCUM_ALPHA /* use blue buffer with most bits (> MIN_ACCUM_ALPHA bits) */
};
class wxGLCanvas; /* forward reference */
class wxGLContext: public wxObject
{
public:
wxGLContext(bool isRGB, wxGLCanvas *win, const wxPalette& palette = wxNullPalette);
wxGLContext(
bool isRGB, wxGLCanvas *win,
const wxPalette& WXUNUSED(palette),
const wxGLContext *other /* for sharing display lists */
);
~wxGLContext();
void SetCurrent();
void SetColour(const char *colour);
void SwapBuffers();
inline wxWindow* GetWindow() const { return m_window; }
inline WXHDC GetHDC() const { return m_hDC; }
inline HGLRC GetGLRC() const { return m_glContext; }
public:
HGLRC m_glContext;
WXHDC m_hDC;
wxWindow* m_window;
};
class wxGLCanvas: public wxScrolledWindow
{
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);
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",
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 );
~wxGLCanvas();
// Replaces wxWindow::Create functionality, since we need to use a different window class
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos, const wxSize& size, long style, const wxString& name);
void SetCurrent();
void SetColour(const char *colour);
void SwapBuffers();
void OnSize(wxSizeEvent& event);
void OnQueryNewPalette(wxQueryNewPaletteEvent& event);
void OnPaletteChanged(wxPaletteChangedEvent& event);
inline wxGLContext* GetContext() const { return m_glContext; }
inline WXHDC GetHDC() const { return m_hDC; }
void SetupPixelFormat(int *attribList = (int*) NULL);
void SetupPalette(const wxPalette& palette);
wxPalette CreateDefaultPalette();
inline wxPalette* GetPalette() const { return (wxPalette*) & m_palette; }
protected:
wxGLContext* m_glContext; // this is typedef-ed ptr, in fact
wxPalette m_palette;
WXHDC m_hDC;
DECLARE_EVENT_TABLE()
};
#endif
// wxUSE_GLCANVAS
#endif
// _WX_GLCANVAS_H_

View File

@@ -1,17 +0,0 @@
//----------------------------------------------------------------------
//
// For MSW I keep my own copy of the glcanvas code. This lets me build
// the main wxWindows library without OpenGL support and the DLL
// depenencies that go along with it. The DLL dependencies will then
// be localized to this extension module, will not need to be loaded
// when the core is started up, and won't make the core unrunnable on
// systems that don't have OpenGL.
//
//----------------------------------------------------------------------
#if defined(__WXMSW__)
#include "msw/myglcanvas.h"
#else
#include <wx/glcanvas.h>
#endif

View File

@@ -0,0 +1,24 @@
/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
# if defined(_MSC_VER)
# define SWIGEXPORT(a) __declspec(dllexport) a
# else
# if defined(__BORLANDC__)
# define SWIGEXPORT(a) a _export
# else
# define SWIGEXPORT(a) a
# endif
# endif
#else
# define SWIGEXPORT(a) a
#endif
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) initglcanvasc() {
}

View File

@@ -54,68 +54,6 @@ class wxPyControlPoint;
//---------------------------------------------------------------------------
// Typemaps just for OGL
// wxOGL doesn't use a ref-counted copy of pens and brushes, so we'll
// use the pen and brush lists to simulate that...
%typemap(python, in) wxPen* {
wxPen* temp;
if ($source) {
if ($source == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p.");
return NULL;
}
}
if (temp)
$target = wxThePenList->FindOrCreatePen(temp->GetColour(),
temp->GetWidth(),
temp->GetStyle());
else
$target = NULL;
}
%typemap(python, in) wxBrush* {
wxBrush* temp;
if ($source) {
if ($source == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxBrush_p.");
return NULL;
}
}
if (temp)
$target = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle());
else
$target = NULL;
}
%typemap(python, in) wxFont* {
wxFont* temp;
if ($source) {
if ($source == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj($source, (void **) &temp,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxFont_p.");
return NULL;
}
}
if (temp)
$target = wxTheFontList->FindOrCreateFont(temp->GetPointSize(),
temp->GetFamily(),
temp->GetStyle(),
temp->GetWeight(),
temp->GetUnderlined(),
temp->GetFaceName(),
temp->GetEncoding());
else
$target = NULL;
}
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------

View File

@@ -55,17 +55,17 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "oglc"
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyList_Check(target)) {
o2 = target;
target = PyList_New(0);
@@ -82,114 +82,29 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "string type is required for parameter";
#endif
//---------------------------------------------------------------------------
// This one will work for any class for the VERY generic cases, but beyond that
// the helper needs to know more about the type.
wxList* wxPy_wxListHelper(PyObject* pyList, char* className) {
bool doSave = wxPyRestoreThread();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPySaveThread(doSave);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPySaveThread(doSave);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
wxObject* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, className)) {
char errmsg[1024];
sprintf(errmsg, "Type error, expected list of %s objects", className);
PyErr_SetString(PyExc_TypeError, errmsg);
wxPySaveThread(doSave);
return NULL;
}
list->Append(wxo);
}
wxPySaveThread(doSave);
return list;
}
//---------------------------------------------------------------------------
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
bool doSave = wxPyRestoreThread();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPySaveThread(doSave);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPySaveThread(doSave);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
if (PyTuple_Check(pyo)) {
PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
list->Append((wxObject*) new wxRealPoint(val1, val2));
} else {
wxRealPoint* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, "_wxRealPoint_p")) {
PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
wxPySaveThread(doSave);
return NULL;
}
list->Append((wxObject*) new wxRealPoint(*wxo));
}
}
wxPySaveThread(doSave);
return list;
}
//---------------------------------------------------------------------------
static char* wxStringErrorMsg = "string type is required for parameter";
extern "C" SWIGEXPORT(void) initoglbasicc();
extern "C" SWIGEXPORT(void) initoglshapesc();
@@ -290,7 +205,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0},
{ "_wxImageHandler","_class_wxImageHandler",0},
{ "_class_wxPyRectangleShape","_wxPyRectangleShape",0},
{ "_wxMutexGuiLocker","_class_wxMutexGuiLocker",0},
{ "_wxLog","_class_wxLog",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_wxMask","_class_wxMask",0},
@@ -309,7 +223,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObject","_class_wxDataObject",0},
{ "_class_wxPyFontEnumerator","_wxPyFontEnumerator",0},
{ "_wxStaticBox","_class_wxStaticBox",0},
{ "_wxColourDatabase","_class_wxColourDatabase",0},
{ "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
{ "_wxPyDropSource","_class_wxPyDropSource",0},
{ "_wxChoice","_class_wxChoice",0},
@@ -393,7 +306,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxStaticLine","_class_wxStaticLine",0},
{ "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0},
{ "_wxBrush","_class_wxBrush",0},
{ "_wxToggleButton","_class_wxToggleButton",0},
{ "_wxMiniFrame","_class_wxMiniFrame",0},
{ "_class_wxNotebookEvent","_wxNotebookEvent",0},
{ "_class_wxPyPrintout","_wxPyPrintout",0},
@@ -433,7 +345,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxZipFSHandler","_wxZipFSHandler",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxPenList","_class_wxPenList",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxPyControlPoint","_class_wxPyControlPoint",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
@@ -449,7 +360,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMessageDialog","_class_wxMessageDialog",0},
{ "_class_wxValidator","_wxValidator",0},
{ "_class_wxPyEvent","_wxPyEvent",0},
{ "_class_wxMutexGuiLocker","_wxMutexGuiLocker",0},
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
{ "_wxConfig","_class_wxConfig",0},
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
@@ -464,7 +374,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxToolBar","_wxToolBar",0},
{ "_wxDropTarget","_class_wxDropTarget",0},
{ "_class_wxStaticLine","_wxStaticLine",0},
{ "_class_wxColourDatabase","_wxColourDatabase",0},
{ "_wxScrollEvent","_class_wxScrollEvent",0},
{ "_wxToolBarToolBase","_class_wxToolBarToolBase",0},
{ "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0},
@@ -496,11 +405,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPyShapeCanvas","_wxPyShapeCanvas",0},
{ "_wxGenericDragImage","_class_wxGenericDragImage",0},
{ "_class_wxProgressDialog","_wxProgressDialog",0},
{ "_class_wxBrushList","_wxBrushList",0},
{ "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
{ "_wxPyInputStream","_class_wxPyInputStream",0},
{ "_wxPyApp","_class_wxPyApp",0},
{ "_class_wxPenList","_wxPenList",0},
{ "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
{ "_class_wxOutputStream","_wxOutputStream",0},
{ "_wxLogTextCtrl","_class_wxLogTextCtrl",0},
@@ -562,9 +469,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxFontList","_class_wxFontList",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxJoystick","_class_wxJoystick",0},
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
{ "_class_wxPyCircleShape","_wxPyCircleShape",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -732,7 +639,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
{ "_class_wxTipProvider","_wxTipProvider",0},
{ "_class_wxToggleButton","_wxToggleButton",0},
{ "_class_wxMiniFrame","_wxMiniFrame",0},
{ "_wxFontDialog","_class_wxFontDialog",0},
{ "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0},
@@ -752,13 +658,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxFontList","_wxFontList",0},
{ "_class_wxJoystick","_wxJoystick",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_class_wxPyDividedShape","_wxPyDividedShape",0},
{ "_wxBrushList","_class_wxBrushList",0},
{ "_wxPyEllipseShape","_class_wxPyEllipseShape",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxLogNull","_wxLogNull",0},

View File

@@ -14,7 +14,7 @@
%module ogl
%{
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
%}
@@ -133,88 +133,10 @@ void wxOGLInitialize();
void wxOGLCleanUp();
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
%{
//---------------------------------------------------------------------------
// This one will work for any class for the VERY generic cases, but beyond that
// the helper needs to know more about the type.
wxList* wxPy_wxListHelper(PyObject* pyList, char* className) {
bool doSave = wxPyRestoreThread();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPySaveThread(doSave);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPySaveThread(doSave);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
wxObject* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, className)) {
char errmsg[1024];
sprintf(errmsg, "Type error, expected list of %s objects", className);
PyErr_SetString(PyExc_TypeError, errmsg);
wxPySaveThread(doSave);
return NULL;
}
list->Append(wxo);
}
wxPySaveThread(doSave);
return list;
}
//---------------------------------------------------------------------------
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
bool doSave = wxPyRestoreThread();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPySaveThread(doSave);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPySaveThread(doSave);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
if (PyTuple_Check(pyo)) {
PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
list->Append((wxObject*) new wxRealPoint(val1, val2));
} else {
wxRealPoint* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, "_wxRealPoint_p")) {
PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
wxPySaveThread(doSave);
return NULL;
}
list->Append((wxObject*) new wxRealPoint(*wxo));
}
}
wxPySaveThread(doSave);
return list;
}
//---------------------------------------------------------------------------
extern "C" SWIGEXPORT(void) initoglbasicc();
extern "C" SWIGEXPORT(void) initoglshapesc();
extern "C" SWIGEXPORT(void) initoglshapes2c();

View File

@@ -55,17 +55,17 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "oglbasicc"
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyList_Check(target)) {
o2 = target;
target = PyList_New(0);
@@ -82,33 +82,29 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "string type is required for parameter";
#endif
static char* wxStringErrorMsg = "string type is required for parameter";
WXSHAPE_IMP_CALLBACKS(wxPyShapeEvtHandler,wxShapeEvtHandler);
@@ -164,7 +160,7 @@ static PyObject *_wrap_wxShapeRegion_SetText(PyObject *self, PyObject *args, PyO
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -198,11 +194,11 @@ static PyObject *_wrap_wxShapeRegion_SetFont(PyObject *self, PyObject *args, PyO
wxShapeRegion * _arg0;
wxFont * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","f", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxShapeRegion_SetFont",_kwnames,&_argo0,&_obj1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxShapeRegion_SetFont",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -211,26 +207,13 @@ static PyObject *_wrap_wxShapeRegion_SetFont(PyObject *self, PyObject *args, PyO
return NULL;
}
}
{
wxFont* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxFont_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxShapeRegion_SetFont. Expected _wxFont_p.");
return NULL;
}
}
if (temp)
_arg1 = wxTheFontList->FindOrCreateFont(temp->GetPointSize(),
temp->GetFamily(),
temp->GetStyle(),
temp->GetWeight(),
temp->GetUnderlined(),
temp->GetFaceName(),
temp->GetEncoding());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxShapeRegion_SetFont(_arg0,_arg1);
@@ -408,7 +391,7 @@ static PyObject *_wrap_wxShapeRegion_SetName(PyObject *self, PyObject *args, PyO
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -459,7 +442,7 @@ static PyObject *_wrap_wxShapeRegion_SetColour(PyObject *self, PyObject *args, P
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -1011,7 +994,7 @@ static PyObject *_wrap_wxShapeRegion_SetPenColour(PyObject *self, PyObject *args
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -4310,11 +4293,11 @@ static PyObject *_wrap_wxPyShape_SetPen(PyObject *self, PyObject *args, PyObject
wxPyShape * _arg0;
wxPen * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","pen", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyShape_SetPen",_kwnames,&_argo0,&_obj1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyShape_SetPen",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -4323,22 +4306,13 @@ static PyObject *_wrap_wxPyShape_SetPen(PyObject *self, PyObject *args, PyObject
return NULL;
}
}
{
wxPen* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_SetPen. Expected _wxPen_p.");
return NULL;
}
}
if (temp)
_arg1 = wxThePenList->FindOrCreatePen(temp->GetColour(),
temp->GetWidth(),
temp->GetStyle());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPyShape_SetPen(_arg0,_arg1);
@@ -4355,11 +4329,11 @@ static PyObject *_wrap_wxPyShape_SetBrush(PyObject *self, PyObject *args, PyObje
wxPyShape * _arg0;
wxBrush * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","brush", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyShape_SetBrush",_kwnames,&_argo0,&_obj1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyShape_SetBrush",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -4368,20 +4342,13 @@ static PyObject *_wrap_wxPyShape_SetBrush(PyObject *self, PyObject *args, PyObje
return NULL;
}
}
{
wxBrush* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxBrush_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_SetBrush. Expected _wxBrush_p.");
return NULL;
}
}
if (temp)
_arg1 = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPyShape_SetBrush(_arg0,_arg1);
@@ -5031,7 +4998,7 @@ static PyObject *_wrap_wxPyShape_AddText(PyObject *self, PyObject *args, PyObjec
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -5187,7 +5154,7 @@ static PyObject *_wrap_wxPyShape_FormatText(PyObject *self, PyObject *args, PyOb
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -5279,11 +5246,11 @@ static PyObject *_wrap_wxPyShape_SetFont(PyObject *self, PyObject *args, PyObjec
wxFont * _arg1;
int _arg2 = (int ) 0;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","font","regionId", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPyShape_SetFont",_kwnames,&_argo0,&_obj1,&_arg2))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPyShape_SetFont",_kwnames,&_argo0,&_argo1,&_arg2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -5292,26 +5259,13 @@ static PyObject *_wrap_wxPyShape_SetFont(PyObject *self, PyObject *args, PyObjec
return NULL;
}
}
{
wxFont* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxFont_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyShape_SetFont. Expected _wxFont_p.");
return NULL;
}
}
if (temp)
_arg1 = wxTheFontList->FindOrCreateFont(temp->GetPointSize(),
temp->GetFamily(),
temp->GetStyle(),
temp->GetWeight(),
temp->GetUnderlined(),
temp->GetFaceName(),
temp->GetEncoding());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPyShape_SetFont(_arg0,_arg1,_arg2);
@@ -5381,7 +5335,7 @@ static PyObject *_wrap_wxPyShape_SetTextColour(PyObject *self, PyObject *args, P
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -5493,7 +5447,7 @@ static PyObject *_wrap_wxPyShape_SetRegionName(PyObject *self, PyObject *args, P
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -5578,7 +5532,7 @@ static PyObject *_wrap_wxPyShape_GetRegionId(PyObject *self, PyObject *args, PyO
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -5629,7 +5583,7 @@ static PyObject *_wrap_wxPyShape_NameRegions(PyObject *self, PyObject *args, PyO
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -5809,7 +5763,7 @@ static PyObject *_wrap_wxPyShape_FindRegion(PyObject *self, PyObject *args, PyOb
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -8452,7 +8406,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPyProcess","_class_wxPyProcess",0},
{ "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0},
{ "_wxImageHandler","_class_wxImageHandler",0},
{ "_wxMutexGuiLocker","_class_wxMutexGuiLocker",0},
{ "_wxLog","_class_wxLog",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_wxMask","_class_wxMask",0},
@@ -8468,7 +8421,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObject","_class_wxDataObject",0},
{ "_class_wxPyFontEnumerator","_wxPyFontEnumerator",0},
{ "_wxStaticBox","_class_wxStaticBox",0},
{ "_wxColourDatabase","_class_wxColourDatabase",0},
{ "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
{ "_wxPyDropSource","_class_wxPyDropSource",0},
{ "_wxChoice","_class_wxChoice",0},
@@ -8550,7 +8502,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxStaticLine","_class_wxStaticLine",0},
{ "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0},
{ "_wxBrush","_class_wxBrush",0},
{ "_wxToggleButton","_class_wxToggleButton",0},
{ "_wxMiniFrame","_class_wxMiniFrame",0},
{ "_class_wxNotebookEvent","_wxNotebookEvent",0},
{ "_class_wxPyPrintout","_wxPyPrintout",0},
@@ -8587,7 +8538,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxZipFSHandler","_wxZipFSHandler",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxPenList","_class_wxPenList",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
{ "_wxTimerEvent","_class_wxTimerEvent",0},
@@ -8602,7 +8552,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMessageDialog","_class_wxMessageDialog",0},
{ "_class_wxValidator","_wxValidator",0},
{ "_class_wxPyEvent","_wxPyEvent",0},
{ "_class_wxMutexGuiLocker","_wxMutexGuiLocker",0},
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
{ "_wxConfig","_class_wxConfig",0},
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
@@ -8615,7 +8564,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxToolBar","_wxToolBar",0},
{ "_wxDropTarget","_class_wxDropTarget",0},
{ "_class_wxStaticLine","_wxStaticLine",0},
{ "_class_wxColourDatabase","_wxColourDatabase",0},
{ "_wxScrollEvent","_class_wxScrollEvent",0},
{ "_wxToolBarToolBase","_class_wxToolBarToolBase",0},
{ "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0},
@@ -8645,11 +8593,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxScrollWinEvent","_class_wxScrollWinEvent",0},
{ "_wxGenericDragImage","_class_wxGenericDragImage",0},
{ "_class_wxProgressDialog","_wxProgressDialog",0},
{ "_class_wxBrushList","_wxBrushList",0},
{ "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
{ "_wxPyInputStream","_class_wxPyInputStream",0},
{ "_wxPyApp","_class_wxPyApp",0},
{ "_class_wxPenList","_wxPenList",0},
{ "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
{ "_class_wxOutputStream","_wxOutputStream",0},
{ "_wxLogTextCtrl","_class_wxLogTextCtrl",0},
@@ -8708,9 +8654,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxFontList","_class_wxFontList",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxJoystick","_class_wxJoystick",0},
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
{ "_wxClientDC","_class_wxClientDC",0},
{ "_wxMouseEvent","_class_wxMouseEvent",0},
@@ -8871,7 +8817,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
{ "_class_wxTipProvider","_wxTipProvider",0},
{ "_class_wxToggleButton","_wxToggleButton",0},
{ "_class_wxMiniFrame","_wxMiniFrame",0},
{ "_wxFontDialog","_class_wxFontDialog",0},
{ "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0},
@@ -8890,12 +8835,11 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxFontList","_wxFontList",0},
{ "_class_wxJoystick","_wxJoystick",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_wxBrushList","_class_wxBrushList",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxLogNull","_wxLogNull",0},
{ "_class_wxSize","_wxSize",0},

View File

@@ -14,7 +14,7 @@
%module oglbasic
%{
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
%}
@@ -231,11 +231,9 @@ public:
int GetAttachmentMode();
void SetId(long i);
long GetId();
void SetPen(wxPen *pen);
void SetBrush(wxBrush *brush);
// void SetClientData(wxObject *client_data);
// wxObject *GetClientData();
%addmethods {

View File

@@ -55,17 +55,17 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "oglcanvasc"
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyList_Check(target)) {
o2 = target;
target = PyList_New(0);
@@ -82,33 +82,29 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "string type is required for parameter";
#endif
static char* wxStringErrorMsg = "string type is required for parameter";
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragLeft);
IMP_PYCALLBACK__2DBLINT(wxPyShapeCanvas, wxShapeCanvas, OnBeginDragRight);
@@ -617,7 +613,7 @@ static PyObject *_wrap_wxDiagram_LoadFile(PyObject *self, PyObject *args, PyObje
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -911,7 +907,7 @@ static PyObject *_wrap_wxDiagram_SaveFile(PyObject *self, PyObject *args, PyObje
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -1125,16 +1121,20 @@ static PyObject *_wrap_wxDiagram_Snap(PyObject *self, PyObject *args, PyObject *
PyObject * _resultobj;
wxDiagram * _arg0;
double * _arg1;
double * _arg2;
PyObject * _argo0 = 0;
double temp;
PyObject * _obj1 = 0;
double * _arg2;
double temp0;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","INOUT","INOUT", NULL };
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxDiagram_Snap",_kwnames,&_argo0,&_obj1,&_obj2))
{
_arg1 = &temp;
}
{
_arg2 = &temp0;
}
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxDiagram_Snap",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1143,14 +1143,6 @@ static PyObject *_wrap_wxDiagram_Snap(PyObject *self, PyObject *args, PyObject *
return NULL;
}
}
{
temp = PyFloat_AsDouble(_obj1);
_arg1 = &temp;
}
{
temp0 = PyFloat_AsDouble(_obj2);
_arg2 = &temp0;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxDiagram_Snap(_arg0,_arg1,_arg2);
@@ -1209,8 +1201,8 @@ static PyObject *_wrap_new_wxPyShapeCanvas(PyObject *self, PyObject *args, PyObj
wxPyShapeCanvas * _result;
wxWindow * _arg0 = (wxWindow *) NULL;
wxWindowID _arg1 = (wxWindowID ) -1;
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
wxPoint * _arg2 = (wxPoint *) &wxPyDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxPyDefaultSize;
long _arg4 = (long ) wxBORDER;
PyObject * _argo0 = 0;
wxPoint temp;
@@ -1906,16 +1898,20 @@ static PyObject *_wrap_wxPyShapeCanvas_Snap(PyObject *self, PyObject *args, PyOb
PyObject * _resultobj;
wxPyShapeCanvas * _arg0;
double * _arg1;
double * _arg2;
PyObject * _argo0 = 0;
double temp;
PyObject * _obj1 = 0;
double * _arg2;
double temp0;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","INOUT","INOUT", NULL };
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OOO:wxPyShapeCanvas_Snap",_kwnames,&_argo0,&_obj1,&_obj2))
{
_arg1 = &temp;
}
{
_arg2 = &temp0;
}
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxPyShapeCanvas_Snap",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1924,14 +1920,6 @@ static PyObject *_wrap_wxPyShapeCanvas_Snap(PyObject *self, PyObject *args, PyOb
return NULL;
}
}
{
temp = PyFloat_AsDouble(_obj1);
_arg1 = &temp;
}
{
temp0 = PyFloat_AsDouble(_obj2);
_arg2 = &temp0;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPyShapeCanvas_Snap(_arg0,_arg1,_arg2);
@@ -2059,7 +2047,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPyProcess","_class_wxPyProcess",0},
{ "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0},
{ "_wxImageHandler","_class_wxImageHandler",0},
{ "_wxMutexGuiLocker","_class_wxMutexGuiLocker",0},
{ "_wxLog","_class_wxLog",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_wxMask","_class_wxMask",0},
@@ -2075,7 +2062,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObject","_class_wxDataObject",0},
{ "_class_wxPyFontEnumerator","_wxPyFontEnumerator",0},
{ "_wxStaticBox","_class_wxStaticBox",0},
{ "_wxColourDatabase","_class_wxColourDatabase",0},
{ "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
{ "_wxPyDropSource","_class_wxPyDropSource",0},
{ "_wxChoice","_class_wxChoice",0},
@@ -2157,7 +2143,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxStaticLine","_class_wxStaticLine",0},
{ "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0},
{ "_wxBrush","_class_wxBrush",0},
{ "_wxToggleButton","_class_wxToggleButton",0},
{ "_wxMiniFrame","_class_wxMiniFrame",0},
{ "_class_wxNotebookEvent","_wxNotebookEvent",0},
{ "_class_wxPyPrintout","_wxPyPrintout",0},
@@ -2195,7 +2180,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxZipFSHandler","_wxZipFSHandler",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxPenList","_class_wxPenList",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
{ "_wxTimerEvent","_class_wxTimerEvent",0},
@@ -2210,7 +2194,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMessageDialog","_class_wxMessageDialog",0},
{ "_class_wxValidator","_wxValidator",0},
{ "_class_wxPyEvent","_wxPyEvent",0},
{ "_class_wxMutexGuiLocker","_wxMutexGuiLocker",0},
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
{ "_wxConfig","_class_wxConfig",0},
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
@@ -2223,7 +2206,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxToolBar","_wxToolBar",0},
{ "_wxDropTarget","_class_wxDropTarget",0},
{ "_class_wxStaticLine","_wxStaticLine",0},
{ "_class_wxColourDatabase","_wxColourDatabase",0},
{ "_wxScrollEvent","_class_wxScrollEvent",0},
{ "_wxToolBarToolBase","_class_wxToolBarToolBase",0},
{ "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0},
@@ -2254,11 +2236,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPyShapeCanvas","_wxPyShapeCanvas",0},
{ "_wxGenericDragImage","_class_wxGenericDragImage",0},
{ "_class_wxProgressDialog","_wxProgressDialog",0},
{ "_class_wxBrushList","_wxBrushList",0},
{ "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
{ "_wxPyInputStream","_class_wxPyInputStream",0},
{ "_wxPyApp","_class_wxPyApp",0},
{ "_class_wxPenList","_wxPenList",0},
{ "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
{ "_class_wxOutputStream","_wxOutputStream",0},
{ "_wxLogTextCtrl","_class_wxLogTextCtrl",0},
@@ -2321,9 +2301,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxFontList","_class_wxFontList",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxJoystick","_class_wxJoystick",0},
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
{ "_wxClientDC","_class_wxClientDC",0},
{ "_wxMouseEvent","_class_wxMouseEvent",0},
@@ -2486,7 +2466,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
{ "_class_wxTipProvider","_wxTipProvider",0},
{ "_class_wxToggleButton","_wxToggleButton",0},
{ "_class_wxMiniFrame","_wxMiniFrame",0},
{ "_wxFontDialog","_class_wxFontDialog",0},
{ "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0},
@@ -2506,12 +2485,11 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxFontList","_wxFontList",0},
{ "_class_wxJoystick","_wxJoystick",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_wxBrushList","_class_wxBrushList",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxLogNull","_wxLogNull",0},
{ "_class_wxSize","_wxSize",0},

View File

@@ -14,7 +14,7 @@
%module oglcanvas
%{
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
%}
@@ -91,7 +91,7 @@ public:
void SetQuickEditMode(bool mode);
void SetSnapToGrid(bool snap);
void ShowAll(bool show);
void Snap(double *INOUT, double *INOUT);
void Snap(double *OUTPUT, double *OUTPUT);
};
@@ -112,8 +112,8 @@ public:
class wxPyShapeCanvas : public wxScrolledWindow {
public:
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxPoint& pos = wxPyDefaultPosition,
const wxSize& size = wxPyDefaultSize,
long style = wxBORDER);
void _setSelf(PyObject* self, PyObject* _class);
@@ -147,7 +147,7 @@ public:
void Redraw(wxDC& dc);
void RemoveShape(wxPyShape *shape);
void SetDiagram(wxDiagram *diagram);
void Snap(double *INOUT, double *INOUT);
void Snap(double *OUTPUT, double *OUTPUT);
};

View File

@@ -0,0 +1,103 @@
/////////////////////////////////////////////////////////////////////////////
// Name: oglhelpers.cpp
// Purpose: Some Helper functions to help in data conversions in OGL
//
// Author: Robin Dunn
//
// Created: 3-Sept-1999
// RCS-ID: $Id$
// Copyright: (c) 1998 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#include <Python.h>
#include "helpers.h"
//---------------------------------------------------------------------------
// This one will work for any class for the VERY generic cases, but beyond that
// the helper needs to know more about the type.
wxList* wxPy_wxListHelper(PyObject* pyList, char* className) {
bool doSave = wxPyRestoreThread();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPySaveThread(doSave);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPySaveThread(doSave);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
wxObject* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, className)) {
char errmsg[1024];
sprintf(errmsg, "Type error, expected list of %s objects", className);
PyErr_SetString(PyExc_TypeError, errmsg);
wxPySaveThread(doSave);
return NULL;
}
list->Append(wxo);
}
wxPySaveThread(doSave);
return list;
}
//---------------------------------------------------------------------------
wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
bool doSave = wxPyRestoreThread();
if (!PyList_Check(pyList)) {
PyErr_SetString(PyExc_TypeError, "Expected a list object.");
wxPySaveThread(doSave);
return NULL;
}
int count = PyList_Size(pyList);
wxList* list = new wxList;
if (! list) {
PyErr_SetString(PyExc_MemoryError, "Unable to allocate wxList object");
wxPySaveThread(doSave);
return NULL;
}
for (int x=0; x<count; x++) {
PyObject* pyo = PyList_GetItem(pyList, x);
if (PyTuple_Check(pyo)) {
PyObject* o1 = PyNumber_Float(PyTuple_GetItem(pyo, 0));
PyObject* o2 = PyNumber_Float(PyTuple_GetItem(pyo, 1));
double val1 = (o1 ? PyFloat_AsDouble(o1) : 0.0);
double val2 = (o2 ? PyFloat_AsDouble(o2) : 0.0);
list->Append((wxObject*) new wxRealPoint(val1, val2));
} else {
wxRealPoint* wxo = NULL;
if (SWIG_GetPtrObj(pyo, (void **)&wxo, "_wxRealPoint_p")) {
PyErr_SetString(PyExc_TypeError, "Type error, expected list of wxRealPoint objects or 2-tuples");
wxPySaveThread(doSave);
return NULL;
}
list->Append((wxObject*) new wxRealPoint(*wxo));
}
}
wxPySaveThread(doSave);
return list;
}
//---------------------------------------------------------------------------

View File

@@ -110,8 +110,8 @@ wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList);
class wxPyShapeCanvas : public wxShapeCanvas {
public:
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxPoint& pos = wxPyDefaultPosition,
const wxSize& size = wxPyDefaultSize,
long style = wxBORDER)
: wxShapeCanvas(parent, id, pos, size, style) {}

View File

@@ -55,17 +55,17 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "oglshapesc"
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyList_Check(target)) {
o2 = target;
target = PyList_New(0);
@@ -82,33 +82,29 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "string type is required for parameter";
#endif
static char* wxStringErrorMsg = "string type is required for parameter";
WXSHAPE_IMP_CALLBACKS(wxPyRectangleShape, wxRectangleShape);
@@ -707,11 +703,11 @@ static PyObject *_wrap_wxPseudoMetaFile_SetFillBrush(PyObject *self, PyObject *a
wxPseudoMetaFile * _arg0;
wxBrush * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","brush", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPseudoMetaFile_SetFillBrush",_kwnames,&_argo0,&_obj1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPseudoMetaFile_SetFillBrush",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -720,20 +716,13 @@ static PyObject *_wrap_wxPseudoMetaFile_SetFillBrush(PyObject *self, PyObject *a
return NULL;
}
}
{
wxBrush* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxBrush_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPseudoMetaFile_SetFillBrush. Expected _wxBrush_p.");
return NULL;
}
}
if (temp)
_arg1 = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPseudoMetaFile_SetFillBrush(_arg0,_arg1);
@@ -784,11 +773,11 @@ static PyObject *_wrap_wxPseudoMetaFile_SetOutlinePen(PyObject *self, PyObject *
wxPseudoMetaFile * _arg0;
wxPen * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","pen", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPseudoMetaFile_SetOutlinePen",_kwnames,&_argo0,&_obj1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPseudoMetaFile_SetOutlinePen",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -797,22 +786,13 @@ static PyObject *_wrap_wxPseudoMetaFile_SetOutlinePen(PyObject *self, PyObject *
return NULL;
}
}
{
wxPen* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPseudoMetaFile_SetOutlinePen. Expected _wxPen_p.");
return NULL;
}
}
if (temp)
_arg1 = wxThePenList->FindOrCreatePen(temp->GetColour(),
temp->GetWidth(),
temp->GetStyle());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPseudoMetaFile_SetOutlinePen(_arg0,_arg1);
@@ -1237,7 +1217,7 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawText(PyObject *self, PyObject *args,
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -1277,7 +1257,6 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawLines(PyObject *self, PyObject *args
int _arg1;
wxPoint * _arg2;
PyObject * _argo0 = 0;
int NPOINTS;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","points", NULL };
@@ -1293,13 +1272,18 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawLines(PyObject *self, PyObject *args
}
if (_obj2)
{
_arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS);
if (_arg2 == NULL) {
return NULL;
}
_arg2 = wxPoint_LIST_helper(_obj2);
if (_arg2 == NULL) {
return NULL;
}
}
{
_arg1 = NPOINTS;
if (_obj2) {
_arg1 = PyList_Size(_obj2);
}
else {
_arg1 = 0;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -1322,7 +1306,6 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawPolygon(PyObject *self, PyObject *ar
wxPoint * _arg2;
int _arg3 = (int ) 0;
PyObject * _argo0 = 0;
int NPOINTS;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","points","flags", NULL };
@@ -1338,13 +1321,18 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawPolygon(PyObject *self, PyObject *ar
}
if (_obj2)
{
_arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS);
if (_arg2 == NULL) {
return NULL;
}
_arg2 = wxPoint_LIST_helper(_obj2);
if (_arg2 == NULL) {
return NULL;
}
}
{
_arg1 = NPOINTS;
if (_obj2) {
_arg1 = PyList_Size(_obj2);
}
else {
_arg1 = 0;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -1366,7 +1354,6 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawSpline(PyObject *self, PyObject *arg
int _arg1;
wxPoint * _arg2;
PyObject * _argo0 = 0;
int NPOINTS;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","points", NULL };
@@ -1382,13 +1369,18 @@ static PyObject *_wrap_wxPseudoMetaFile_DrawSpline(PyObject *self, PyObject *arg
}
if (_obj2)
{
_arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS);
if (_arg2 == NULL) {
return NULL;
}
_arg2 = wxPoint_LIST_helper(_obj2);
if (_arg2 == NULL) {
return NULL;
}
}
{
_arg1 = NPOINTS;
if (_obj2) {
_arg1 = PyList_Size(_obj2);
}
else {
_arg1 = 0;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -1472,12 +1464,12 @@ static PyObject *_wrap_wxPseudoMetaFile_SetPen(PyObject *self, PyObject *args, P
wxPen * _arg1;
bool _arg2 = (bool ) FALSE;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
int tempbool2 = (int) FALSE;
char *_kwnames[] = { "self","pen","isOutline", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPseudoMetaFile_SetPen",_kwnames,&_argo0,&_obj1,&tempbool2))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPseudoMetaFile_SetPen",_kwnames,&_argo0,&_argo1,&tempbool2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1486,22 +1478,13 @@ static PyObject *_wrap_wxPseudoMetaFile_SetPen(PyObject *self, PyObject *args, P
return NULL;
}
}
{
wxPen* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPseudoMetaFile_SetPen. Expected _wxPen_p.");
return NULL;
}
}
if (temp)
_arg1 = wxThePenList->FindOrCreatePen(temp->GetColour(),
temp->GetWidth(),
temp->GetStyle());
else
_arg1 = NULL;
}
_arg2 = (bool ) tempbool2;
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -1520,12 +1503,12 @@ static PyObject *_wrap_wxPseudoMetaFile_SetBrush(PyObject *self, PyObject *args,
wxBrush * _arg1;
bool _arg2 = (bool ) FALSE;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
int tempbool2 = (int) FALSE;
char *_kwnames[] = { "self","brush","isFill", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPseudoMetaFile_SetBrush",_kwnames,&_argo0,&_obj1,&tempbool2))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPseudoMetaFile_SetBrush",_kwnames,&_argo0,&_argo1,&tempbool2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1534,20 +1517,13 @@ static PyObject *_wrap_wxPseudoMetaFile_SetBrush(PyObject *self, PyObject *args,
return NULL;
}
}
{
wxBrush* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxBrush_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPseudoMetaFile_SetBrush. Expected _wxBrush_p.");
return NULL;
}
}
if (temp)
_arg1 = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle());
else
_arg1 = NULL;
}
_arg2 = (bool ) tempbool2;
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -1565,11 +1541,11 @@ static PyObject *_wrap_wxPseudoMetaFile_SetFont(PyObject *self, PyObject *args,
wxPseudoMetaFile * _arg0;
wxFont * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","font", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPseudoMetaFile_SetFont",_kwnames,&_argo0,&_obj1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPseudoMetaFile_SetFont",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -1578,26 +1554,13 @@ static PyObject *_wrap_wxPseudoMetaFile_SetFont(PyObject *self, PyObject *args,
return NULL;
}
}
{
wxFont* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxFont_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPseudoMetaFile_SetFont. Expected _wxFont_p.");
return NULL;
}
}
if (temp)
_arg1 = wxTheFontList->FindOrCreateFont(temp->GetPointSize(),
temp->GetFamily(),
temp->GetStyle(),
temp->GetWeight(),
temp->GetUnderlined(),
temp->GetFaceName(),
temp->GetEncoding());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPseudoMetaFile_SetFont(_arg0,_arg1);
@@ -4190,7 +4153,7 @@ static PyObject *_wrap_wxPyBitmapShape_SetFilename(PyObject *self, PyObject *arg
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -5538,7 +5501,6 @@ static PyObject *_wrap_wxPyDrawnShape_DrawLines(PyObject *self, PyObject *args,
int _arg1;
wxPoint * _arg2;
PyObject * _argo0 = 0;
int NPOINTS;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","points", NULL };
@@ -5554,13 +5516,18 @@ static PyObject *_wrap_wxPyDrawnShape_DrawLines(PyObject *self, PyObject *args,
}
if (_obj2)
{
_arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS);
if (_arg2 == NULL) {
return NULL;
}
_arg2 = wxPoint_LIST_helper(_obj2);
if (_arg2 == NULL) {
return NULL;
}
}
{
_arg1 = NPOINTS;
if (_obj2) {
_arg1 = PyList_Size(_obj2);
}
else {
_arg1 = 0;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -5618,7 +5585,6 @@ static PyObject *_wrap_wxPyDrawnShape_DrawPolygon(PyObject *self, PyObject *args
wxPoint * _arg2;
int _arg3 = (int ) 0;
PyObject * _argo0 = 0;
int NPOINTS;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","points","flags", NULL };
@@ -5634,13 +5600,18 @@ static PyObject *_wrap_wxPyDrawnShape_DrawPolygon(PyObject *self, PyObject *args
}
if (_obj2)
{
_arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS);
if (_arg2 == NULL) {
return NULL;
}
_arg2 = wxPoint_LIST_helper(_obj2);
if (_arg2 == NULL) {
return NULL;
}
}
{
_arg1 = NPOINTS;
if (_obj2) {
_arg1 = PyList_Size(_obj2);
}
else {
_arg1 = 0;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -5733,7 +5704,6 @@ static PyObject *_wrap_wxPyDrawnShape_DrawSpline(PyObject *self, PyObject *args,
int _arg1;
wxPoint * _arg2;
PyObject * _argo0 = 0;
int NPOINTS;
PyObject * _obj2 = 0;
char *_kwnames[] = { "self","points", NULL };
@@ -5749,13 +5719,18 @@ static PyObject *_wrap_wxPyDrawnShape_DrawSpline(PyObject *self, PyObject *args,
}
if (_obj2)
{
_arg2 = wxPoint_LIST_helper(_obj2, &NPOINTS);
if (_arg2 == NULL) {
return NULL;
}
_arg2 = wxPoint_LIST_helper(_obj2);
if (_arg2 == NULL) {
return NULL;
}
}
{
_arg1 = NPOINTS;
if (_obj2) {
_arg1 = PyList_Size(_obj2);
}
else {
_arg1 = 0;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -5796,7 +5771,7 @@ static PyObject *_wrap_wxPyDrawnShape_DrawText(PyObject *self, PyObject *args, P
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -6081,12 +6056,12 @@ static PyObject *_wrap_wxPyDrawnShape_SetDrawnBrush(PyObject *self, PyObject *ar
wxBrush * _arg1;
bool _arg2 = (bool ) FALSE;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
int tempbool2 = (int) FALSE;
char *_kwnames[] = { "self","pen","isOutline", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPyDrawnShape_SetDrawnBrush",_kwnames,&_argo0,&_obj1,&tempbool2))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPyDrawnShape_SetDrawnBrush",_kwnames,&_argo0,&_argo1,&tempbool2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -6095,20 +6070,13 @@ static PyObject *_wrap_wxPyDrawnShape_SetDrawnBrush(PyObject *self, PyObject *ar
return NULL;
}
}
{
wxBrush* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxBrush_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxBrush_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyDrawnShape_SetDrawnBrush. Expected _wxBrush_p.");
return NULL;
}
}
if (temp)
_arg1 = wxTheBrushList->FindOrCreateBrush(temp->GetColour(), temp->GetStyle());
else
_arg1 = NULL;
}
_arg2 = (bool ) tempbool2;
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -6126,11 +6094,11 @@ static PyObject *_wrap_wxPyDrawnShape_SetDrawnFont(PyObject *self, PyObject *arg
wxPyDrawnShape * _arg0;
wxFont * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","font", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyDrawnShape_SetDrawnFont",_kwnames,&_argo0,&_obj1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyDrawnShape_SetDrawnFont",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -6139,26 +6107,13 @@ static PyObject *_wrap_wxPyDrawnShape_SetDrawnFont(PyObject *self, PyObject *arg
return NULL;
}
}
{
wxFont* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxFont_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxFont_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyDrawnShape_SetDrawnFont. Expected _wxFont_p.");
return NULL;
}
}
if (temp)
_arg1 = wxTheFontList->FindOrCreateFont(temp->GetPointSize(),
temp->GetFamily(),
temp->GetStyle(),
temp->GetWeight(),
temp->GetUnderlined(),
temp->GetFaceName(),
temp->GetEncoding());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPyDrawnShape_SetDrawnFont(_arg0,_arg1);
@@ -6176,12 +6131,12 @@ static PyObject *_wrap_wxPyDrawnShape_SetDrawnPen(PyObject *self, PyObject *args
wxPen * _arg1;
bool _arg2 = (bool ) FALSE;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
int tempbool2 = (int) FALSE;
char *_kwnames[] = { "self","pen","isOutline", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPyDrawnShape_SetDrawnPen",_kwnames,&_argo0,&_obj1,&tempbool2))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO|i:wxPyDrawnShape_SetDrawnPen",_kwnames,&_argo0,&_argo1,&tempbool2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -6190,22 +6145,13 @@ static PyObject *_wrap_wxPyDrawnShape_SetDrawnPen(PyObject *self, PyObject *args
return NULL;
}
}
{
wxPen* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyDrawnShape_SetDrawnPen. Expected _wxPen_p.");
return NULL;
}
}
if (temp)
_arg1 = wxThePenList->FindOrCreatePen(temp->GetColour(),
temp->GetWidth(),
temp->GetStyle());
else
_arg1 = NULL;
}
_arg2 = (bool ) tempbool2;
{
wxPy_BEGIN_ALLOW_THREADS;
@@ -7400,6 +7346,33 @@ static PyObject *_wrap_new_wxOGLConstraint(PyObject *self, PyObject *args, PyObj
return _resultobj;
}
#define delete_wxOGLConstraint(_swigobj) (delete _swigobj)
static PyObject *_wrap_delete_wxOGLConstraint(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxOGLConstraint * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:delete_wxOGLConstraint",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxOGLConstraint_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_wxOGLConstraint. Expected _wxOGLConstraint_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
delete_wxOGLConstraint(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxOGLConstraint_Evaluate(_swigobj) (_swigobj->Evaluate())
static PyObject *_wrap_wxOGLConstraint_Evaluate(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -10980,7 +10953,7 @@ static PyObject *_wrap_wxPyDivisionShape_SetLeftSideColour(PyObject *self, PyObj
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -11014,11 +10987,11 @@ static PyObject *_wrap_wxPyDivisionShape_SetLeftSidePen(PyObject *self, PyObject
wxPyDivisionShape * _arg0;
wxPen * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","pen", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyDivisionShape_SetLeftSidePen",_kwnames,&_argo0,&_obj1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyDivisionShape_SetLeftSidePen",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -11027,22 +11000,13 @@ static PyObject *_wrap_wxPyDivisionShape_SetLeftSidePen(PyObject *self, PyObject
return NULL;
}
}
{
wxPen* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyDivisionShape_SetLeftSidePen. Expected _wxPen_p.");
return NULL;
}
}
if (temp)
_arg1 = wxThePenList->FindOrCreatePen(temp->GetColour(),
temp->GetWidth(),
temp->GetStyle());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPyDivisionShape_SetLeftSidePen(_arg0,_arg1);
@@ -11148,7 +11112,7 @@ static PyObject *_wrap_wxPyDivisionShape_SetTopSideColour(PyObject *self, PyObje
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -11182,11 +11146,11 @@ static PyObject *_wrap_wxPyDivisionShape_SetTopSidePen(PyObject *self, PyObject
wxPyDivisionShape * _arg0;
wxPen * _arg1;
PyObject * _argo0 = 0;
PyObject * _obj1 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","pen", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyDivisionShape_SetTopSidePen",_kwnames,&_argo0,&_obj1))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxPyDivisionShape_SetTopSidePen",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -11195,22 +11159,13 @@ static PyObject *_wrap_wxPyDivisionShape_SetTopSidePen(PyObject *self, PyObject
return NULL;
}
}
{
wxPen* temp;
if (_obj1) {
if (_obj1 == Py_None) { temp = NULL; }
else if (SWIG_GetPtrObj(_obj1, (void **) &temp,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error, expected _wxPen_p.");
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxPen_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxPyDivisionShape_SetTopSidePen. Expected _wxPen_p.");
return NULL;
}
}
if (temp)
_arg1 = wxThePenList->FindOrCreatePen(temp->GetColour(),
temp->GetWidth(),
temp->GetStyle());
else
_arg1 = NULL;
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxPyDivisionShape_SetTopSidePen(_arg0,_arg1);
@@ -12373,6 +12328,7 @@ static PyMethodDef oglshapescMethods[] = {
{ "wxOGLConstraint_Equals", (PyCFunction) _wrap_wxOGLConstraint_Equals, METH_VARARGS | METH_KEYWORDS },
{ "wxOGLConstraint_SetSpacing", (PyCFunction) _wrap_wxOGLConstraint_SetSpacing, METH_VARARGS | METH_KEYWORDS },
{ "wxOGLConstraint_Evaluate", (PyCFunction) _wrap_wxOGLConstraint_Evaluate, METH_VARARGS | METH_KEYWORDS },
{ "delete_wxOGLConstraint", (PyCFunction) _wrap_delete_wxOGLConstraint, METH_VARARGS | METH_KEYWORDS },
{ "new_wxOGLConstraint", (PyCFunction) _wrap_new_wxOGLConstraint, METH_VARARGS | METH_KEYWORDS },
{ "wxPyDrawnShape_base_OnEndSize", (PyCFunction) _wrap_wxPyDrawnShape_base_OnEndSize, METH_VARARGS | METH_KEYWORDS },
{ "wxPyDrawnShape_base_OnBeginSize", (PyCFunction) _wrap_wxPyDrawnShape_base_OnBeginSize, METH_VARARGS | METH_KEYWORDS },
@@ -12644,7 +12600,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPyRectangleShape","_class_wxPyControlPoint",SwigwxPyControlPointTowxPyRectangleShape},
{ "_class_wxPyRectangleShape","_wxPyControlPoint",SwigwxPyControlPointTowxPyRectangleShape},
{ "_class_wxPyRectangleShape","_wxPyRectangleShape",0},
{ "_wxMutexGuiLocker","_class_wxMutexGuiLocker",0},
{ "_wxLog","_class_wxLog",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_wxMask","_class_wxMask",0},
@@ -12662,7 +12617,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObject","_class_wxDataObject",0},
{ "_class_wxPyFontEnumerator","_wxPyFontEnumerator",0},
{ "_wxStaticBox","_class_wxStaticBox",0},
{ "_wxColourDatabase","_class_wxColourDatabase",0},
{ "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
{ "_wxPyDropSource","_class_wxPyDropSource",0},
{ "_wxChoice","_class_wxChoice",0},
@@ -12760,7 +12714,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxStaticLine","_class_wxStaticLine",0},
{ "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0},
{ "_wxBrush","_class_wxBrush",0},
{ "_wxToggleButton","_class_wxToggleButton",0},
{ "_wxMiniFrame","_class_wxMiniFrame",0},
{ "_class_wxNotebookEvent","_wxNotebookEvent",0},
{ "_class_wxPyPrintout","_wxPyPrintout",0},
@@ -12799,7 +12752,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxZipFSHandler","_wxZipFSHandler",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxPenList","_class_wxPenList",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxPyControlPoint","_class_wxPyControlPoint",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
@@ -12815,7 +12767,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMessageDialog","_class_wxMessageDialog",0},
{ "_class_wxValidator","_wxValidator",0},
{ "_class_wxPyEvent","_wxPyEvent",0},
{ "_class_wxMutexGuiLocker","_wxMutexGuiLocker",0},
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
{ "_wxConfig","_class_wxConfig",0},
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
@@ -12830,7 +12781,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxToolBar","_wxToolBar",0},
{ "_wxDropTarget","_class_wxDropTarget",0},
{ "_class_wxStaticLine","_wxStaticLine",0},
{ "_class_wxColourDatabase","_wxColourDatabase",0},
{ "_wxScrollEvent","_class_wxScrollEvent",0},
{ "_wxToolBarToolBase","_class_wxToolBarToolBase",0},
{ "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0},
@@ -12860,11 +12810,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxScrollWinEvent","_class_wxScrollWinEvent",0},
{ "_wxGenericDragImage","_class_wxGenericDragImage",0},
{ "_class_wxProgressDialog","_wxProgressDialog",0},
{ "_class_wxBrushList","_wxBrushList",0},
{ "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
{ "_wxPyInputStream","_class_wxPyInputStream",0},
{ "_wxPyApp","_class_wxPyApp",0},
{ "_class_wxPenList","_wxPenList",0},
{ "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
{ "_class_wxOutputStream","_wxOutputStream",0},
{ "_wxLogTextCtrl","_class_wxLogTextCtrl",0},
@@ -12923,9 +12871,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxFontList","_class_wxFontList",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxJoystick","_class_wxJoystick",0},
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
{ "_wxClientDC","_class_wxClientDC",0},
{ "_wxMouseEvent","_class_wxMouseEvent",0},
@@ -13118,7 +13066,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
{ "_class_wxTipProvider","_wxTipProvider",0},
{ "_class_wxToggleButton","_wxToggleButton",0},
{ "_class_wxMiniFrame","_wxMiniFrame",0},
{ "_wxFontDialog","_class_wxFontDialog",0},
{ "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0},
@@ -13137,13 +13084,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxFontList","_wxFontList",0},
{ "_class_wxJoystick","_wxJoystick",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_class_wxPyDividedShape","_wxPyDividedShape",0},
{ "_wxBrushList","_class_wxBrushList",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxLogNull","_wxLogNull",0},
{ "_class_wxSize","_wxSize",0},

View File

@@ -14,7 +14,7 @@
%module oglshapes
%{
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
%}
@@ -337,8 +337,7 @@ public:
return rv;
}
}
//~wxOGLConstraint(); The wxCompositShape takes ownership of the constraint
~wxOGLConstraint();
bool Evaluate();
void SetSpacing(double x, double y);

View File

@@ -713,6 +713,9 @@ class wxOGLConstraintPtr :
def __init__(self,this):
self.this = this
self.thisown = 0
def __del__(self,oglshapesc=oglshapesc):
if self.thisown == 1 :
oglshapesc.delete_wxOGLConstraint(self)
def Evaluate(self, *_args, **_kwargs):
val = apply(oglshapesc.wxOGLConstraint_Evaluate,(self,) + _args, _kwargs)
return val

View File

@@ -55,17 +55,17 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "oglshapes2c"
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyList_Check(target)) {
o2 = target;
target = PyList_New(0);
@@ -82,33 +82,29 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "string type is required for parameter";
#endif
static char* wxStringErrorMsg = "string type is required for parameter";
WXSHAPE_IMP_CALLBACKS(wxPyEllipseShape, wxEllipseShape);
@@ -2969,7 +2965,7 @@ static PyObject *_wrap_wxPyLineShape_ClearArrow(PyObject *self, PyObject *args,
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -3126,7 +3122,7 @@ static PyObject *_wrap_wxPyLineShape_DeleteArrowHead(PyObject *self, PyObject *a
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -3371,7 +3367,7 @@ static PyObject *_wrap_wxPyLineShape_FindArrowHead(PyObject *self, PyObject *arg
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -7941,7 +7937,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxPyRectangleShape","_class_wxPyTextShape",SwigwxPyTextShapeTowxPyRectangleShape},
{ "_class_wxPyRectangleShape","_wxPyTextShape",SwigwxPyTextShapeTowxPyRectangleShape},
{ "_class_wxPyRectangleShape","_wxPyRectangleShape",0},
{ "_wxMutexGuiLocker","_class_wxMutexGuiLocker",0},
{ "_wxLog","_class_wxLog",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_wxMask","_class_wxMask",0},
@@ -7960,7 +7955,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObject","_class_wxDataObject",0},
{ "_class_wxPyFontEnumerator","_wxPyFontEnumerator",0},
{ "_wxStaticBox","_class_wxStaticBox",0},
{ "_wxColourDatabase","_class_wxColourDatabase",0},
{ "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
{ "_wxPyDropSource","_class_wxPyDropSource",0},
{ "_wxChoice","_class_wxChoice",0},
@@ -8056,7 +8050,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxStaticLine","_class_wxStaticLine",0},
{ "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0},
{ "_wxBrush","_class_wxBrush",0},
{ "_wxToggleButton","_class_wxToggleButton",0},
{ "_wxMiniFrame","_class_wxMiniFrame",0},
{ "_class_wxNotebookEvent","_wxNotebookEvent",0},
{ "_class_wxPyPrintout","_wxPyPrintout",0},
@@ -8095,7 +8088,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxZipFSHandler","_wxZipFSHandler",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxPenList","_class_wxPenList",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxPyControlPoint","_class_wxPyControlPoint",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
@@ -8111,7 +8103,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMessageDialog","_class_wxMessageDialog",0},
{ "_class_wxValidator","_wxValidator",0},
{ "_class_wxPyEvent","_wxPyEvent",0},
{ "_class_wxMutexGuiLocker","_wxMutexGuiLocker",0},
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
{ "_wxConfig","_class_wxConfig",0},
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
@@ -8126,7 +8117,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxToolBar","_wxToolBar",0},
{ "_wxDropTarget","_class_wxDropTarget",0},
{ "_class_wxStaticLine","_wxStaticLine",0},
{ "_class_wxColourDatabase","_wxColourDatabase",0},
{ "_wxScrollEvent","_class_wxScrollEvent",0},
{ "_wxToolBarToolBase","_class_wxToolBarToolBase",0},
{ "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0},
@@ -8157,11 +8147,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPyCircleShape","_class_wxPyCircleShape",0},
{ "_wxGenericDragImage","_class_wxGenericDragImage",0},
{ "_class_wxProgressDialog","_wxProgressDialog",0},
{ "_class_wxBrushList","_wxBrushList",0},
{ "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
{ "_wxPyInputStream","_class_wxPyInputStream",0},
{ "_wxPyApp","_class_wxPyApp",0},
{ "_class_wxPenList","_wxPenList",0},
{ "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
{ "_class_wxOutputStream","_wxOutputStream",0},
{ "_wxLogTextCtrl","_class_wxLogTextCtrl",0},
@@ -8223,9 +8211,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxFontList","_class_wxFontList",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxJoystick","_class_wxJoystick",0},
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
{ "_class_wxPyCircleShape","_wxPyCircleShape",0},
{ "_wxClientDC","_class_wxClientDC",0},
@@ -8413,7 +8401,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
{ "_class_wxTipProvider","_wxTipProvider",0},
{ "_class_wxToggleButton","_wxToggleButton",0},
{ "_class_wxMiniFrame","_wxMiniFrame",0},
{ "_wxFontDialog","_class_wxFontDialog",0},
{ "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0},
@@ -8432,13 +8419,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxFontList","_wxFontList",0},
{ "_class_wxJoystick","_wxJoystick",0},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_class_wxPyDividedShape","_wxPyDividedShape",0},
{ "_wxBrushList","_class_wxBrushList",0},
{ "_wxPyEllipseShape","_class_wxPyCircleShape",SwigwxPyCircleShapeTowxPyEllipseShape},
{ "_wxPyEllipseShape","_wxPyCircleShape",SwigwxPyCircleShapeTowxPyEllipseShape},
{ "_wxPyEllipseShape","_class_wxPyEllipseShape",0},

View File

@@ -14,7 +14,7 @@
%module oglshapes2
%{
#include "export.h"
#include "helpers.h"
#include "oglhelpers.h"
%}
@@ -207,9 +207,6 @@ public:
bool IsSpline();
void MakeLineControlPoints(int n);
// TODO:
// inline wxList *GetLineControlPoints() { return m_lineControlPoints; }
void SetAttachmentFrom(int fromAttach);
void SetAttachments(int fromAttach, int toAttach);
void SetAttachmentTo(int toAttach);

View File

@@ -0,0 +1,24 @@
/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
# if defined(_MSC_VER)
# define SWIGEXPORT(a) __declspec(dllexport) a
# else
# if defined(__BORLANDC__)
# define SWIGEXPORT(a) a _export
# else
# define SWIGEXPORT(a) a
# endif
# endif
#else
# define SWIGEXPORT(a) a
#endif
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) initoglc() {
}

View File

@@ -55,17 +55,17 @@ extern PyObject *SWIG_newvarlink(void);
#define SWIG_name "stc_c"
#include "export.h"
#include "helpers.h"
#include "wx/stc/stc.h"
static PyObject* l_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyList_Check(target)) {
o2 = target;
target = PyList_New(0);
@@ -82,33 +82,29 @@ static PyObject* t_output_helper(PyObject* target, PyObject* o) {
PyObject* o2;
PyObject* o3;
if (!target) {
if (!target) {
target = o;
} else if (target == Py_None) {
} else if (target == Py_None) {
Py_DECREF(Py_None);
target = o;
} else {
} else {
if (!PyTuple_Check(target)) {
o2 = target;
target = PyTuple_New(1);
PyTuple_SetItem(target, 0, o2);
}
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o3 = PyTuple_New(1);
PyTuple_SetItem(o3, 0, o);
o2 = target;
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
target = PySequence_Concat(o2, o3);
Py_DECREF(o2);
Py_DECREF(o3);
}
return target;
}
#if PYTHON_API_VERSION >= 1009
static char* wxStringErrorMsg = "String or Unicode type required";
#else
static char* wxStringErrorMsg = "string type is required for parameter";
#endif
static char* wxStringErrorMsg = "string type is required for parameter";
#ifdef __cplusplus
extern "C" {
#endif
@@ -214,7 +210,7 @@ static PyObject *_wrap_wxStyledTextCtrl_AddText(PyObject *self, PyObject *args,
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -265,7 +261,7 @@ static PyObject *_wrap_wxStyledTextCtrl_AddStyledText(PyObject *self, PyObject *
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -317,7 +313,7 @@ static PyObject *_wrap_wxStyledTextCtrl_InsertText(PyObject *self, PyObject *arg
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -2049,7 +2045,7 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetFaceName(PyObject *self, PyObjec
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -2501,7 +2497,7 @@ static PyObject *_wrap_wxStyledTextCtrl_SetWordChars(PyObject *self, PyObject *a
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -2869,7 +2865,7 @@ static PyObject *_wrap_wxStyledTextCtrl_AutoCompShow(PyObject *self, PyObject *a
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -3028,7 +3024,7 @@ static PyObject *_wrap_wxStyledTextCtrl_AutoCompStops(PyObject *self, PyObject *
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -3134,7 +3130,7 @@ static PyObject *_wrap_wxStyledTextCtrl_AutoCompSelect(PyObject *self, PyObject
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -3242,7 +3238,7 @@ static PyObject *_wrap_wxStyledTextCtrl_AutoCompSetFillUps(PyObject *self, PyObj
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -4167,7 +4163,7 @@ static PyObject *_wrap_wxStyledTextCtrl_FindText(PyObject *self, PyObject *args,
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1)
@@ -4746,7 +4742,7 @@ static PyObject *_wrap_wxStyledTextCtrl_ReplaceSelection(PyObject *self, PyObjec
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -5043,7 +5039,7 @@ static PyObject *_wrap_wxStyledTextCtrl_SetText(PyObject *self, PyObject *args,
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -5211,7 +5207,7 @@ static PyObject *_wrap_wxStyledTextCtrl_CallTipShow(PyObject *self, PyObject *ar
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -6277,7 +6273,7 @@ static PyObject *_wrap_wxStyledTextCtrl_SearchNext(PyObject *self, PyObject *arg
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -6329,7 +6325,7 @@ static PyObject *_wrap_wxStyledTextCtrl_SearchPrev(PyObject *self, PyObject *arg
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -6820,7 +6816,7 @@ static PyObject *_wrap_wxStyledTextCtrl_SetProperty(PyObject *self, PyObject *ar
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj1) && !PyUnicode_Check(_obj1)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj1, &tmpPtr, &tmpSize) == -1)
@@ -6838,7 +6834,7 @@ static PyObject *_wrap_wxStyledTextCtrl_SetProperty(PyObject *self, PyObject *ar
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -6894,7 +6890,7 @@ static PyObject *_wrap_wxStyledTextCtrl_SetKeyWords(PyObject *self, PyObject *ar
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -6973,7 +6969,7 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetSpec(PyObject *self, PyObject *a
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj2) && !PyUnicode_Check(_obj2)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj2, &tmpPtr, &tmpSize) == -1)
@@ -7069,7 +7065,7 @@ static PyObject *_wrap_wxStyledTextCtrl_StyleSetFontAttr(PyObject *self, PyObjec
#if PYTHON_API_VERSION >= 1009
char* tmpPtr; int tmpSize;
if (!PyString_Check(_obj3) && !PyUnicode_Check(_obj3)) {
PyErr_SetString(PyExc_TypeError, wxStringErrorMsg);
PyErr_SetString(PyExc_TypeError, "String or Unicode type required");
return NULL;
}
if (PyString_AsStringAndSize(_obj3, &tmpPtr, &tmpSize) == -1)
@@ -8572,7 +8568,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPyProcess","_class_wxPyProcess",0},
{ "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0},
{ "_wxImageHandler","_class_wxImageHandler",0},
{ "_wxMutexGuiLocker","_class_wxMutexGuiLocker",0},
{ "_wxLog","_class_wxLog",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_wxMask","_class_wxMask",0},
@@ -8589,7 +8584,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObject","_class_wxDataObject",0},
{ "_class_wxPyFontEnumerator","_wxPyFontEnumerator",0},
{ "_wxStaticBox","_class_wxStaticBox",0},
{ "_wxColourDatabase","_class_wxColourDatabase",0},
{ "_wxPyDataObjectSimple","_class_wxPyDataObjectSimple",0},
{ "_wxPyDropSource","_class_wxPyDropSource",0},
{ "_wxChoice","_class_wxChoice",0},
@@ -8667,7 +8661,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxStaticLine","_class_wxStaticLine",0},
{ "_class_wxLayoutAlgorithm","_wxLayoutAlgorithm",0},
{ "_wxBrush","_class_wxBrush",0},
{ "_wxToggleButton","_class_wxToggleButton",0},
{ "_wxMiniFrame","_class_wxMiniFrame",0},
{ "_class_wxNotebookEvent","_wxNotebookEvent",0},
{ "_class_wxPyPrintout","_wxPyPrintout",0},
@@ -8708,7 +8701,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxZipFSHandler","_wxZipFSHandler",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxPenList","_class_wxPenList",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
{ "_wxTimerEvent","_class_wxTimerEvent",0},
@@ -8723,7 +8715,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMessageDialog","_class_wxMessageDialog",0},
{ "_class_wxValidator","_wxValidator",0},
{ "_class_wxPyEvent","_wxPyEvent",0},
{ "_class_wxMutexGuiLocker","_wxMutexGuiLocker",0},
{ "_wxTextEntryDialog","_class_wxTextEntryDialog",0},
{ "_wxConfig","_class_wxConfig",0},
{ "_class_wxIconizeEvent","_wxIconizeEvent",0},
@@ -8736,7 +8727,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxToolBar","_wxToolBar",0},
{ "_wxDropTarget","_class_wxDropTarget",0},
{ "_class_wxStaticLine","_wxStaticLine",0},
{ "_class_wxColourDatabase","_wxColourDatabase",0},
{ "_wxScrollEvent","_class_wxScrollEvent",0},
{ "_wxToolBarToolBase","_class_wxToolBarToolBase",0},
{ "_wxCalculateLayoutEvent","_class_wxCalculateLayoutEvent",0},
@@ -8765,11 +8755,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxScrollWinEvent","_class_wxScrollWinEvent",0},
{ "_wxGenericDragImage","_class_wxGenericDragImage",0},
{ "_class_wxProgressDialog","_wxProgressDialog",0},
{ "_class_wxBrushList","_wxBrushList",0},
{ "_wxQueryNewPaletteEvent","_class_wxQueryNewPaletteEvent",0},
{ "_wxPyInputStream","_class_wxPyInputStream",0},
{ "_wxPyApp","_class_wxPyApp",0},
{ "_class_wxPenList","_wxPenList",0},
{ "_class_wxWindowCreateEvent","_wxWindowCreateEvent",0},
{ "_class_wxOutputStream","_wxOutputStream",0},
{ "_wxLogTextCtrl","_class_wxLogTextCtrl",0},
@@ -8831,9 +8819,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxCloseEvent","_wxCloseEvent",0},
{ "_wxSashEvent","_class_wxSashEvent",0},
{ "_wxBusyInfo","_class_wxBusyInfo",0},
{ "_wxFontList","_class_wxFontList",0},
{ "_class_wxMenuEvent","_wxMenuEvent",0},
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
{ "_wxJoystick","_class_wxJoystick",0},
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
{ "_wxClientDC","_class_wxClientDC",0},
{ "_wxMouseEvent","_class_wxMouseEvent",0},
@@ -8997,7 +8985,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxDataObjectComposite","_class_wxDataObjectComposite",0},
{ "_class_wxJoystickEvent","_wxJoystickEvent",0},
{ "_class_wxTipProvider","_wxTipProvider",0},
{ "_class_wxToggleButton","_wxToggleButton",0},
{ "_class_wxMiniFrame","_wxMiniFrame",0},
{ "_wxFontDialog","_class_wxFontDialog",0},
{ "_wxMemoryFSHandler","_class_wxMemoryFSHandler",0},
@@ -9016,14 +9003,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxGauge","_class_wxGauge",0},
{ "_class_wxCheckListBox","_wxCheckListBox",0},
{ "_class_wxBusyInfo","_wxBusyInfo",0},
{ "_class_wxFontList","_wxFontList",0},
{ "_class_wxJoystick","_wxJoystick",0},
{ "_class_wxCommandEvent","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent},
{ "_class_wxCommandEvent","_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent},
{ "_class_wxCommandEvent","_wxCommandEvent",0},
{ "_class_wxClientDC","_wxClientDC",0},
{ "_class_wxSizeEvent","_wxSizeEvent",0},
{ "_class_wxListCtrl","_wxListCtrl",0},
{ "_wxBrushList","_class_wxBrushList",0},
{ "_wxCustomDataObject","_class_wxCustomDataObject",0},
{ "_class_wxLogNull","_wxLogNull",0},
{ "_class_wxSize","_wxSize",0},
@@ -9141,7 +9127,7 @@ SWIGEXPORT(void) initstc_c() {
PyDict_SetItemString(d,"wxSTC_INDIC0_MASK", PyInt_FromLong((long) 32));
PyDict_SetItemString(d,"wxSTC_INDIC1_MASK", PyInt_FromLong((long) 64));
PyDict_SetItemString(d,"wxSTC_INDIC2_MASK", PyInt_FromLong((long) 128));
PyDict_SetItemString(d,"wxSTC_INDICS_MASK", PyInt_FromLong((long) 224));
PyDict_SetItemString(d,"wxSTC_INDICS_MASK", PyInt_FromLong((long) 32|64|128));
PyDict_SetItemString(d,"wxSTC_PRINT_NORMAL", PyInt_FromLong((long) 0));
PyDict_SetItemString(d,"wxSTC_PRINT_INVERTLIGHT", PyInt_FromLong((long) 1));
PyDict_SetItemString(d,"wxSTC_PRINT_BLACKONWHITE", PyInt_FromLong((long) 2));

View File

@@ -14,7 +14,7 @@
%{
#include "export.h"
#include "helpers.h"
#include "wx/stc/stc.h"
%}
@@ -34,6 +34,7 @@
// Get all our defs from the REAL header file.
%include stc.h
//%include SciLexer.h
//----------------------------------------------------------------------
// Python functions to act like the event macros

View File

@@ -0,0 +1,23 @@
/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
# if defined(_MSC_VER)
# define SWIGEXPORT(a) __declspec(dllexport) a
# else
# if defined(__BORLANDC__)
# define SWIGEXPORT(a) a _export
# else
# define SWIGEXPORT(a) a
# endif
# endif
#else
# define SWIGEXPORT(a) a
#endif
#ifdef __cplusplus
extern "C"
#endif
SWIGEXPORT(void) initstc_c() {
}

View File

@@ -29,7 +29,7 @@ sit back and enjoy. Be sure to take a peek at the source code for each
demo item so you can learn how to use the classes yourself.</p>
<p><b>wxPython</b> is brought to you by <b>Robin Dunn</b> and<br>
<b>Total Control Software</b>, Copyright (c) 1997-2001.</p>
<b>Total Control Software</b>, Copyright (c) 1997-2000.</p>
<p>
<font size="-1">Please see <i>license.txt</i> for licensing information.</font>

View File

@@ -29,7 +29,7 @@ if wxPlatform == '__WXMSW__':
#----------------------------------------------------------------------
class TestPanel(wxPanel):
def __init__(self, parent, log):
def __init__(self, parent):
wxPanel.__init__(self, parent, -1)
self.pdf = None
@@ -94,7 +94,7 @@ class TestPanel(wxPanel):
def runTest(frame, nb, log):
if wxPlatform == '__WXMSW__':
win = TestPanel(nb, log)
win = TestPanel(nb)
return win
else:
dlg = wxMessageDialog(frame, 'This demo only works on MSW.',
@@ -117,7 +117,6 @@ if __name__ == '__main__':
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.tp.pdf.Cleanup()
self.Destroy()

View File

@@ -1,114 +0,0 @@
from wxPython.wx import *
from wxPython.lib import colourdb
import images
# This loads a whole bunch of new color names and values
# into wxTheColourDatabase
colourdb.updateColourDB()
#----------------------------------------------------------------------
class TestWindow(wxScrolledWindow):
def __init__(self, parent):
wxScrolledWindow.__init__(self, parent, -1)
self.clrList = colourdb.getColourList()
self.bg_bmp = images.getGridBGBitmap()
EVT_PAINT(self, self.OnPaint)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
#self.SetBackgroundColour("WHITE")
self.font = wxFont(10, wxSWISS, wxNORMAL, wxNORMAL)
dc = wxClientDC(self)
dc.SetFont(self.font)
w,h,d,e = dc.GetFullTextExtent("Wy") # a wide character and one that decends
self.textHeight = h + d
self.lineHeight = self.textHeight + 5
self.cellWidth = w
numCells = 24
self.SetScrollbars(self.cellWidth, self.lineHeight, numCells, len(self.clrList) + 2)
def TileBackground(self, dc):
# tile the background bitmap
sz = self.GetClientSize()
w = self.bg_bmp.GetWidth()
h = self.bg_bmp.GetHeight()
# adjust for scrolled position
spx, spy = self.GetScrollPixelsPerUnit()
vsx, vsy = self.GetViewStart()
dx, dy = (spx * vsx) % w, (spy * vsy) % h
x = -dx
while x < sz.width:
y = -dy
while y < sz.height:
dc.DrawBitmap(self.bg_bmp, x, y)
y = y + h
x = x + w
def OnEraseBackground(self, evt):
dc = evt.GetDC()
if not dc:
dc = wxClientDC(self)
self.TileBackground(dc)
def OnPaint(self, evt):
dc = wxPaintDC(self)
self.PrepareDC(dc)
self.Draw(dc, self.GetUpdateRegion(), self.GetViewStart())
def Draw(self, dc, rgn=None, vs=None):
dc.BeginDrawing()
dc.SetTextForeground("BLACK")
dc.SetPen(wxPen("BLACK", 1, wxSOLID))
dc.SetFont(self.font)
colours = self.clrList
numColours = len(colours)
if rgn:
# determine the subset that have been exposed and needs drawn
rect = rgn.GetBox()
pixStart = vs[1]*self.lineHeight + rect.y
pixStop = pixStart + rect.height
start = pixStart / self.lineHeight - 1
stop = pixStop / self.lineHeight
else:
start = 0
stop = len(numColours)
for line in range(max(0,start), min(stop,numColours)):
clr = colours[line]
y = (line+1) * self.lineHeight + 2
dc.DrawText(clr, self.cellWidth, y)
brush = wxBrush(clr, wxSOLID)
dc.SetBrush(brush)
dc.DrawRectangle(12 * self.cellWidth, y, 6 * self.cellWidth, self.textHeight)
dc.EndDrawing()
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestWindow(nb)
return win
#----------------------------------------------------------------------
overview = """
"""

View File

@@ -1,117 +0,0 @@
#----------------------------------------------------------------------------
# Name: ColourSelect.py
# Purpose: Colour Selection control display testing on panel for wxPython demo
#
# Author: Lorne White (email: lorne.white@telusplanet.net)
#
# Version 0.5
# Date: Feb 26, 2001
# Licence: wxWindows license
#----------------------------------------------------------------------------
from wxPython.wx import *
from wxPython.lib.colourselect import *
import string
#---------------------------------------------------------------------------
class TestColourSelect(wxPanel):
def __init__(self, parent, log):
self.log = log
wxPanel.__init__(self, parent, -1)
wxStaticText(self, -1, "This example uses a colour selection control based on the wxButton and wxColourDialog Classes. Click Button to get Colour Values",
wxPoint(10, 20), wxSize(400, 60))
self.x_pos = 30
self.y_pos = 100
delta = 40
mID = NewId()
wxButton(self, mID, "Get All Colours", wxPoint(self.x_pos, self.y_pos))
EVT_BUTTON(self, mID, self.OnClick)
self.y_pos = self.y_pos + delta
wxStaticText(self, -1, "Default", wxPoint(self.x_pos, self.y_pos), wxSize(-1, -1)) # name
self.colour_def = ColourSelect(self, wxPoint(self.x_pos+100, self.y_pos)) # default colour selection control
self.y_pos = self.y_pos + delta
colours = [[255, 255, 0], [255, 0, 255], [0, 255, 0], [0, 0, 255]] # list of initial colours for display
self.names = names = [ "Default Size", "Another Size", "Another Colour", "Larger"] # display names
sizes = [ None, wxSize(60, 20), None, wxSize(60, 60)] # button sizes
self.set_val = []
for i in range(len(colours)):
wxStaticText(self, -1, names[i], wxPoint(self.x_pos, self.y_pos), wxSize(-1, -1)) # name
val = ColourSelect(self, wxPoint(self.x_pos+100, self.y_pos), colours[i], sizes[i]) # colour selection button
self.set_val.append(val) # store control for reference
self.y_pos = self.y_pos + delta
def OnClick(self, event):
result = []
colour = self.colour_def.GetColour() # default control value
result.append("Default: " + str(colour))
for i in range(len(self.set_val)):
val = self.set_val[i]
colour = val.GetColour() # get the colour selection button result
name = self.names[i]
result.append(name + ": " + str(colour)) # create string list for easy viewing of results
out_result = string.joinfields(result, ', ')
self.log.WriteText("Colour Results :" + out_result)
#---------------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestColourSelect(nb, log)
return win
#---------------------------------------------------------------------------
overview = """\
A checkbox is a labelled box which is either on (checkmark is visible) or off (no checkmark).
wxCheckBox()
-----------------------
Default constructor.
wxCheckBox(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& val, const wxString& name = "checkBox")
Constructor, creating and showing a checkbox.
Parameters
-------------------
parent = Parent window. Must not be NULL.
id = Checkbox identifier. A value of -1 indicates a default value.
label = Text to be displayed next to the checkbox.
pos = Checkbox position. If the position (-1, -1) is specified then a default position is chosen.
size = Checkbox size. If the default size (-1, -1) is specified then a default size is chosen.
style = Window style. See wxCheckBox.
validator = Window validator.
name = Window name.
"""

View File

@@ -1,41 +0,0 @@
from wxPython.wx import *
from wxPython.lib import fancytext
#----------------------------------------------------------------------
test_str = ('<font style="italic" family="swiss" color="red" weight="bold" >'
'some |<sup>23</sup> <angle/>text<sub>with <angle/> subscript</sub>'
'</font> some other text')
test_str2 = '<font family="swiss" color="dark green" size="40">big green text</font>'
class TestPanel(wxPanel):
def __init__(self, parent):
wxPanel.__init__(self, parent, -1)
EVT_PAINT(self, self.OnPaint)
def OnPaint(self, evt):
dc = wxPaintDC(self)
sz = fancytext.getExtent(test_str, dc)
fancytext.renderToDC(test_str, dc, 20, 20)
fancytext.renderToDC(test_str2, dc, 20, 20 + sz.height + 10)
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestPanel(nb)
return win
#----------------------------------------------------------------------
import string
overview = string.replace(fancytext.__doc__, "<", "&lt;")

View File

@@ -1,10 +1,6 @@
""" Demonstrate filebrowsebutton module of the wxPython.lib Library.
14.1.2001 Bernhard Reiter <bernhard@intevation.de>
Added demo for DirBrowseButton and improved overview text.
"""
from wxPython.wx import *
from wxPython.lib.filebrowsebutton import FileBrowseButton, FileBrowseButtonWithHistory,DirBrowseButton
from wxPython.lib.filebrowsebutton import FileBrowseButton, FileBrowseButtonWithHistory
#----------------------------------------------------------------------
@@ -19,9 +15,6 @@ class TestPanel(wxPanel):
wxSize(450, -1),
#changeCallback = self.fbbhCallback
)
self.dbb = DirBrowseButton(self, -1, wxPoint(20,80), wxSize(450,-1),
changeCallback = self.dbbCallback)
self.fbbh.SetHistory(['You', 'can', 'put', 'some', 'file', 'names', 'here'])
@@ -30,7 +23,6 @@ class TestPanel(wxPanel):
self.log.write('FileBrowseButton: %s\n' % evt.GetString())
def fbbhCallback(self, evt):
if hasattr(self, 'fbbh'):
value = evt.GetString()
@@ -39,10 +31,6 @@ class TestPanel(wxPanel):
history.append(value)
self.fbbh.SetHistory(history)
def dbbCallback(self, evt):
self.log.write('DirBrowseButton: %s\n' % evt.GetString())
#----------------------------------------------------------------------
@@ -54,23 +42,6 @@ def runTest(frame, nb, log):
#----------------------------------------------------------------------
overview = """<html><body>
<h2>class FileBrowseButton:</h2>
<small><pre>
%s
</pre></small>
<h2>class FileBrowseButtonWithHistory(FileBrowseButton):</h2>
<small><pre>
%s
</pre></small>
<h2>class DirBrowseButton(FileBrowseButton):</h2>
<small><pre>
%s
</pre></small>
</body><</html>
""" % ( FileBrowseButton.__doc__,
FileBrowseButtonWithHistory.__doc__ ,
str(DirBrowseButton.__doc__) )
overview = FileBrowseButton.__doc__

View File

@@ -3,7 +3,6 @@ from wxPython.wx import *
from wxPython.lib.buttons import wxGenButton, wxGenBitmapButton, \
wxGenToggleButton, wxGenBitmapToggleButton
import images
#----------------------------------------------------------------------
@@ -35,18 +34,18 @@ class TestPanel(wxPanel):
#b.SetUseFocusIndicator(false)
b.SetToolTipString("This is a BIG button...")
bmp = images.getTest2Bitmap()
bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP)
b = wxGenBitmapButton(self, -1, bmp, (10, 130))
EVT_BUTTON(self, b.GetId(), self.OnButton)
b = wxGenBitmapButton(self, -1, None, (140, 130))
EVT_BUTTON(self, b.GetId(), self.OnButton)
bmp = images.getBulb1Bitmap()
bmp = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP)
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
b.SetBitmapLabel(bmp)
bmp = images.getBulb2Bitmap()
bmp = wxBitmap('bitmaps/lb2.bmp', wxBITMAP_TYPE_BMP)
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
b.SetBitmapSelected(bmp)
@@ -58,11 +57,11 @@ class TestPanel(wxPanel):
b = wxGenBitmapToggleButton(self, -1, None, (140, 230))
EVT_BUTTON(self, b.GetId(), self.OnToggleButton)
bmp = images.getBulb1Bitmap()
bmp = wxBitmap('bitmaps/lb1.bmp', wxBITMAP_TYPE_BMP)
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
b.SetBitmapLabel(bmp)
bmp = images.getBulb2Bitmap()
bmp = wxBitmap('bitmaps/lb2.bmp', wxBITMAP_TYPE_BMP)
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
b.SetBitmapSelected(bmp)

View File

@@ -211,7 +211,6 @@ class GridEditorTest(wxGrid):
self.SetColSize(1, 150)
self.SetColSize(2, 150)
#---------------------------------------------------------------------------
class TestFrame(wxFrame):

View File

@@ -37,8 +37,6 @@ class SimpleGrid(wxGrid):
self.SetColLabelValue(1, "column")
self.SetColLabelValue(2, "labels")
self.SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_BOTTOM)
# test all the events
EVT_GRID_CELL_LEFT_CLICK(self, self.OnCellLeftClick)
EVT_GRID_CELL_RIGHT_CLICK(self, self.OnCellRightClick)

View File

@@ -1,40 +0,0 @@
#----------------------------------------------------------------------------
# Name: ImageBrowser.py
# Purpose: Image Selection dialog for wxPython demo
#
# Author: Lorne White (email: lorne.white@telusplanet.net)
#
# Version 0.5
# Date: Feb 26, 2001
# Licence: wxWindows license
#----------------------------------------------------------------------------
from wxPython.wx import *
from wxPython.lib.imagebrowser import *
import os
#---------------------------------------------------------------------------
def runTest(frame, nb, log):
dir = os.getcwd() # get working directory
initial_dir = os.path.join(dir, 'bitmaps') # set the initial directory for the demo bitmaps
win = ImageDialog(frame, initial_dir) # open the image browser dialog
win.Centre()
if win.ShowModal() == wxID_OK:
log.WriteText("You Selected File: " + win.GetFile()) # show the selected file
else:
log.WriteText("You pressed Cancel\n")
#---------------------------------------------------------------------------
overview = """\
"""

View File

@@ -1,140 +0,0 @@
from wxPython.wx import *
from wxPython.lib.anchors import LayoutAnchors
#----------------------------------------------------------------------
[wxID_ANCHORSDEMOFRAMEANCHOREDPANEL, wxID_ANCHORSDEMOFRAMEHELPSTATICTEXT,
wxID_ANCHORSDEMOFRAMEMAINPANEL, wxID_ANCHORSDEMOFRAMEBACKGROUNDPANEL,
wxID_ANCHORSDEMOFRAMERIGHTCHECKBOX, wxID_ANCHORSDEMOFRAMEOKBUTTON,
wxID_ANCHORSDEMOFRAMETOPCHECKBOX, wxID_ANCHORSDEMOFRAMEBOTTOMCHECKBOX,
wxID_ANCHORSDEMOFRAME, wxID_ANCHORSDEMOFRAMELEFTCHECKBOX,
] = map(lambda _init_ctrls: wxNewId(), range(10))
class AnchorsDemoFrame(wxFrame):
def _init_utils(self):
pass
def _init_ctrls(self, prnt):
wxFrame.__init__(self, size = wxSize(328, 187), id = wxID_ANCHORSDEMOFRAME, title = 'LayoutAnchors Demonstration', parent = prnt, name = 'AnchorsDemoFrame', style = wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN, pos = wxPoint(261, 123))
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.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))
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.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.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))
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))
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))
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))
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))
def __init__(self, parent):
self._init_ctrls(parent)
def OnCheckboxCheckbox(self, event):
self.anchoredPanel.SetConstraints(
LayoutAnchors(self.anchoredPanel,
self.leftCheckBox.GetValue(), self.topCheckBox.GetValue(),
self.rightCheckBox.GetValue(), self.bottomCheckBox.GetValue()) )
def OnOkButtonButton(self, event):
self.Close()
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = AnchorsDemoFrame(frame)
frame.otherWin = win
win.Show(true)
#----------------------------------------------------------------------
overview = """<html><body>
<h2>LayoutAnchors</h2>
A class that implements Delphi's Anchors with wxLayoutConstraints.
<p>
Anchored sides maintain the distance from the edge of the
control to the same edge of the parent.
When neither side is selected, the control keeps the same
relative position to both sides.
<p>
The current position and size of the control and it's parent
is used when setting up the constraints. To change the size or
position of an already anchored control, set the constraints to
None, reposition or resize and reapply the anchors.
<p>
Examples:
<p>
Let's anchor the right and bottom edge of a control and
resize it's parent.
<p>
<pre>
ctrl.SetConstraints(LayoutAnchors(ctrl, left=0, top=0, right=1, bottom=1))
+=========+ +===================+
| +-----+ | | |
| | * | -> | |
| +--*--+ | | +-----+ |
+---------+ | | * |
| +--*--+ |
+-------------------+
* = anchored edge
</pre>
<p>
When anchored on both sides the control will stretch horizontally.
<p>
<pre>
ctrl.SetConstraints(LayoutAnchors(ctrl, 1, 0, 1, 1))
+=========+ +===================+
| +-----+ | | |
| * * | -> | |
| +--*--+ | | +---------------+ |
+---------+ | * ctrl * |
| +-------*-------+ |
+-------------------+
* = anchored edge
</pre>
</html></body>
"""

View File

@@ -16,14 +16,11 @@ from wxPython.wx import *
from wxPython.lib.splashscreen import SplashScreen
from wxPython.html import wxHtmlWindow
import images
#---------------------------------------------------------------------------
_treeList = [
('New since last release', ['ColourSelect', 'ImageBrowser', 'infoframe',
'ColourDB', 'wxToggleButton',
('New since last release', ['wxProcess',
]),
('Managed Windows', ['wxFrame', 'wxDialog', 'wxMiniFrame']),
@@ -43,24 +40,24 @@ _treeList = [
'wxComboBox', 'wxGauge', 'wxListBox', 'wxListCtrl', 'wxTextCtrl',
'wxTreeCtrl', 'wxSpinButton', 'wxSpinCtrl', 'wxStaticText',
'wxStaticBitmap', 'wxRadioBox', 'wxSlider', 'wxToolBar',
'wxCalendarCtrl', 'wxToggleButton',
'wxCalendarCtrl',
]),
('Window Layout', ['wxLayoutConstraints', 'LayoutAnchors', 'Sizers', ]),
('Window Layout', ['wxLayoutConstraints', 'Sizers', ]),
('Miscellaneous', [ 'DragAndDrop', 'CustomDragAndDrop', 'FontEnumerator',
'wxTimer', 'wxValidator', 'wxGLCanvas', 'DialogUnits',
'wxImage', 'wxMask', 'PrintFramework', 'wxOGL',
'PythonEvents', 'Threads',
'ActiveXWrapper_Acrobat', 'ActiveXWrapper_IE',
'wxDragImage', "wxProcess", "FancyText",
'wxDragImage',
]),
('wxPython Library', ['Layoutf', 'wxScrolledMessageDialog',
'wxMultipleChoiceDialog', 'wxPlotCanvas', 'wxFloatBar',
'PyShell', 'wxCalendar', 'wxMVCTree', 'wxVTKRenderWindow',
'FileBrowseButton', 'GenericButtons', 'wxEditor',
'PyShellWindow', 'ColourSelect', 'ImageBrowser',
'PyShellWindow',
]),
('Cool Contribs', ['pyTree', 'hangman', 'SlashDot', 'XMLtreeview']),
@@ -78,17 +75,10 @@ class wxPythonDemo(wxFrame):
self.cwd = os.getcwd()
self.curOverview = ""
if 1:
icon = wxIconFromXPMData(images.getMondrianData())
else:
# another way to do it
bmp = images.getMondrianBitmap()
icon = wxEmptyIcon()
icon.CopyFromBitmap(bmp)
self.SetIcon(icon)
if wxPlatform == '__WXMSW__':
icon = wxIcon('bitmaps/mondrian.ico', wxBITMAP_TYPE_ICO)
self.SetIcon(icon)
# setup a taskbar icon, and catch some events from it
self.tbicon = wxTaskBarIcon()
self.tbicon.SetIcon(icon, "wxPython Demo")
@@ -101,8 +91,6 @@ class wxPythonDemo(wxFrame):
self.otherWin = None
EVT_IDLE(self, self.OnIdle)
EVT_CLOSE(self, self.OnCloseWindow)
EVT_ICONIZE(self, self.OnIconfiy)
EVT_MAXIMIZE(self, self.OnMaximize)
self.Centre(wxBOTH)
self.CreateStatusBar(1, wxST_SIZEGRIP)
@@ -184,7 +172,7 @@ class wxPythonDemo(wxFrame):
self.ovr = wxHtmlWindow(self.nb, -1, size=(400, 400))
self.nb.AddPage(self.ovr, "Overview")
else: # hopefully I can remove this hacky code soon, see bug #216861
else: # hopefully I can remove this hacky code soon
panel = wxPanel(self.nb, -1)
self.ovr = wxHtmlWindow(panel, -1, size=(400, 400))
self.nb.AddPage(panel, "Overview")
@@ -415,19 +403,6 @@ class wxPythonDemo(wxFrame):
wxGetApp().ProcessIdle()
#---------------------------------------------
def OnIconfiy(self, evt):
wxLogMessage("OnIconfiy")
evt.Skip()
#---------------------------------------------
def OnMaximize(self, evt):
wxLogMessage("OnMaximize")
evt.Skip()
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------

View File

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 545 B

View File

Before

Width:  |  Height:  |  Size: 990 B

After

Width:  |  Height:  |  Size: 990 B

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View File

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 630 B

View File

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 630 B

View File

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 630 B

View File

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 630 B

View File

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 630 B

View File

Before

Width:  |  Height:  |  Size: 630 B

After

Width:  |  Height:  |  Size: 630 B

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

View File

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 766 B

After

Width:  |  Height:  |  Size: 766 B

View File

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

View File

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

View File

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

View File

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

View File

Before

Width:  |  Height:  |  Size: 238 B

After

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 681 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -20,8 +20,6 @@ while line:
line = line[:-1]
sys.stdout.write('\nYou typed "%s"\n' % line)
sys.stdout.flush()
#sys.stderr.write('\nTyped you "%s" Yoda say...\n' % line)
#sys.stderr.flush()
line = sys.stdin.readline()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

View File

@@ -57,10 +57,6 @@ display some tiny nice image</TT>, he?</FONT>
this is text......
<BR><A HREF="pic.png"><IMG SRC="pic.png" ALT="Testing image image" HEIGHT=160 WIDTH=100 ALIGN=TEXTTOP></A> (try clicking on the image :-) and
this is text......
<br>
Here is a GIF: <IMG SRC="pic2.gif">
<BR>&nbsp;
<BR>&nbsp;
<UL>

View File

@@ -1,57 +0,0 @@
#!/usr/bin/env python
#----------------------------------------------------------------------
"""
This is a way to save the startup time when running img2py on lots of
files...
"""
import sys, string
sys.path.insert(0, "../tools")
import img2py
command_lines = [
" -n Mondrian bmp_source/mondrian.ico images.py",
"-a -n _10s_ bmp_source/10s.gif images.py",
"-a -n _01c_ bmp_source/01c.gif images.py",
"-a -n _12h_ bmp_source/12h.gif images.py",
"-a -n _13d_ bmp_source/13d.gif images.py",
"-a -n Background bmp_source/backgrnd.png images.py",
"-a -n TestStar -m #FFFFFF bmp_source/teststar.png images.py",
"-a -n TestStar2 bmp_source/teststar.png images.py",
"-a -n TestMask bmp_source/testmask.bmp images.py",
"-a -n Test2 bmp_source/test2.bmp images.py",
"-a -n Robin bmp_source/robin.jpg images.py",
"-a -n Bulb1 bmp_source/lb1.bmp images.py",
"-a -n Bulb2 bmp_source/lb2.bmp images.py",
"-a -n Calendar bmp_source/Calend.bmp images.py",
"-a -n DbDec bmp_source/DbDec.bmp images.py",
"-a -n Dec bmp_source/Dec.bmp images.py",
"-a -n Pt bmp_source/Pt.bmp images.py",
"-a -n DbInc bmp_source/DbInc.bmp images.py",
"-a -n Inc bmp_source/Inc.bmp images.py",
"-a -n New -m #C0C0C0 bmp_source/new.bmp images.py",
"-a -n Open -m #C0C0C0 bmp_source/open.bmp images.py",
"-a -n Copy -m #C0C0C0 bmp_source/copy.bmp images.py",
"-a -n Paste -m #C0C0C0 bmp_source/paste.bmp images.py",
"-a -n Tog1 -m #C0C0C0 bmp_source/tog1.bmp images.py",
"-a -n Tog2 -m #C0C0C0 bmp_source/tog2.bmp images.py",
"-a -n Smiles bmp_source/smiles.bmp images.py",
"-a -n GridBG bmp_source/GridBG.gif images.py",
]
for line in command_lines:
args = string.split(line)
img2py.main(args)

File diff suppressed because it is too large Load Diff

View File

@@ -1,95 +0,0 @@
from wxPython.wx import *
from wxPython.lib.infoframe import *
#----------------------------------------------------------------------
class MyFrame(wxFrame):
def __init__(self,output):
wxFrame.__init__(self,None,-1,"Close me...",size=(300,100))
menubar = wxMenuBar()
menu = wxMenu()
mID = NewId()
menu.Append(mID,"&Enable output","Display output frame")
EVT_MENU(self,mID,output.EnableOutput)
mID = NewId()
menu.Append(mID,"&Disable output","Close output frame")
EVT_MENU(self,mID,output.DisableOutput)
menubar.Append(menu,"&Output")
self.SetMenuBar(menubar)
output.SetParent(self)
output.SetOtherMenuBar(menubar,menuname="Output")
EVT_CLOSE(self,self.OnClose)
EVT_TIMER(self, -1, self.OnTimer)
self.timer = wxTimer(self, -1)
self.timer.Start(1000)
self.save_stdout = sys.stdout
sys.stdout = self.output = output
print "Hello!"
def OnClose(self,event):
sys.stdout = self.save_stdout
self.output.close()
self.timer.Stop()
self.timer = None
self.Destroy()
def OnTimer(self, evt):
print "This was printed with \"print\""
#----------------------------------------------------------------------
from wxPython.lib import infoframe
overview = infoframe.__doc__
def runTest(frame, nb, log):
"""
This method is used by the wxPython Demo Framework for integrating
this demo with the rest.
"""
win = MyFrame(wxPyInformationalMessagesFrame())
frame.otherWin = win
win.Show(1)
#----------------------------------------------------------------------
if __name__ == "__main__":
## class MyFrame(wxFrame):
## def __init__(self,output):
## wxFrame.__init__(self,None,-1,"Close me...",size=(300,100))
## EVT_CLOSE(self,self.OnClose)
## menubar = wxMenuBar()
## menu = wxMenu()
## mID = NewId()
## menu.Append(mID,"&Enable output","Display output frame")
## EVT_MENU(self,mID,output.EnableOutput)
## mID = NewId()
## menu.Append(mID,"&Disable output","Close output frame")
## EVT_MENU(self,mID,output.DisableOutput)
## menubar.Append(menu,"&Output")
## self.SetMenuBar(menubar)
## output.SetOtherMenuBar(menubar,menuname="Output")
## def OnClose(self,event):
## if isinstance(sys.stdout,wxPyInformationalMessagesFrame):
## sys.stdout.close()
## self.Destroy()
class MyApp(wxApp):
outputWindowClass = wxPyInformationalMessagesFrame
def OnInit(self):
frame = MyFrame(self.stdioWin)
frame.Show(TRUE)
self.SetTopWindow(frame)
if isinstance(sys.stdout,wxPyInformationalMessagesFrame):
sys.stdout.SetParent(frame)
#self.redirectStdio(None)# this is done automatically
# by the MyApp(1) call below
print "Starting.\n",
return true
app = MyApp(1)
app.MainLoop()

View File

@@ -24,7 +24,7 @@ beautifully documented...
"""
from wxPython import wx
import sys, string # Don't use it, but it's fun expanding :-)
import string # Don't use it, but it's fun expanding :-)
#----------------------------------------------------------------------
@@ -161,8 +161,7 @@ def runTest(frame, nb, log):
This method is used by the wxPython Demo Framework for integrating
this demo with the rest.
"""
#thisModule = __import__(__name__, globals())
thisModule = sys.modules[__name__]
thisModule = __import__(__name__, globals())
win = wx.wxFrame(frame, -1, "PyTreeItemData Test")
split = wx.wxSplitterWindow(win, -1)
tree = pyTree(split, -1, thisModule)

View File

@@ -1,8 +1,6 @@
from wxPython.wx import *
import images
#----------------------------------------------------------------------
class TestPanel(wxPanel):
@@ -21,7 +19,8 @@ class TestPanel(wxPanel):
b.SetToolTipString("This is a Hello button...")
bmp = images.getTest2Bitmap()
bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP)
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)

View File

@@ -4,16 +4,16 @@
#
# Author: Lorne White (email: lwhite1@planet.eon.net)
#
# Version 0.9
# Date: Feb 26, 2001
# Created:
# Version 0.8 2000/04/16
# Licence: wxWindows license
#----------------------------------------------------------------------------
from wxPython.wx import *
from wxPython.lib.calendar import wxCalendar, Month, PrtCalDraw, CalenDlg
from wxPython.lib.calendar import wxCalendar, Month, PrtCalDraw
import images
import os
dir_path = os.getcwd()
# highlighted days in month
@@ -51,19 +51,15 @@ class TestPanel(wxPanel):
self.calend = wxCalendar(self, -1, wxPoint(100, 50), wxSize(200, 180))
# start_month = 2 # preselect the date for calendar
# start_year = 2001
start_month = self.calend.GetMonth() # get the current month & year
start_year = self.calend.GetYear()
start_month = 11
start_year = 1999
# month list from DateTime module
monthlist = GetMonthList()
mID = NewId()
self.date = wxComboBox(self, mID, Month[start_month], wxPoint(100, 20), wxSize(90, -1), monthlist, wxCB_DROPDOWN)
EVT_COMBOBOX(self, mID, self.EvtComboBox)
self.date = wxComboBox(self, 10, Month[start_month], wxPoint(100, 20), wxSize(90, -1), monthlist, wxCB_DROPDOWN)
EVT_COMBOBOX(self, 10, self.EvtComboBox)
# set start month and year
@@ -86,59 +82,49 @@ class TestPanel(wxPanel):
# scroll bar for month selection
mID = NewId()
self.scroll = wxScrollBar(self, mID, wxPoint(100, 240), wxSize(200, 20), wxSB_HORIZONTAL)
self.scroll = wxScrollBar(self, 40, wxPoint(100, 240), wxSize(200, 20), wxSB_HORIZONTAL)
self.scroll.SetScrollbar(start_month-1, 1, 12, 1, TRUE)
EVT_COMMAND_SCROLL(self, mID, self.Scroll)
EVT_COMMAND_SCROLL(self, 40, self.Scroll)
# spin control for year selection
self.dtext = wxTextCtrl(self, -1, str(start_year), wxPoint(200, 20), wxSize(60, -1))
h = self.dtext.GetSize().height
mID = NewId()
self.spin = wxSpinButton(self, mID, wxPoint(270, 20), wxSize(h*2, h))
self.spin = wxSpinButton(self, 20, wxPoint(270, 20), wxSize(h*2, h))
self.spin.SetRange(1980, 2010)
self.spin.SetValue(start_year)
EVT_SPIN(self, mID, self.OnSpin)
EVT_SPIN(self, 20, self.OnSpin)
# button for calendar dialog test
wxStaticText(self, -1, "Test Calendar Dialog", wxPoint(350, 50), wxSize(150, -1))
mID = NewId()
bmp = images.getCalendarBitmap()
self.but = wxBitmapButton(self, mID, bmp, wxPoint(380, 80))#, wxSize(30, 30))
EVT_BUTTON(self, mID, self.TestDlg)
bmp = wxBitmap('bitmaps/Calend.bmp', wxBITMAP_TYPE_BMP)
self.but = wxBitmapButton(self, 60, bmp, wxPoint(380, 80))#, wxSize(30, 30))
EVT_BUTTON(self, 60, self.TestDlg)
# button for calendar window test
wxStaticText(self, -1, "Test Calendar Window", wxPoint(350, 150), wxSize(150, -1))
mID = NewId()
self.but = wxBitmapButton(self, mID, bmp, wxPoint(380, 180))#, wxSize(30, 30))
EVT_BUTTON(self, mID, self.TestFrame)
bmp = wxBitmap('bitmaps/Calend.bmp', wxBITMAP_TYPE_BMP)
self.but = wxBitmapButton(self, 160, bmp, wxPoint(380, 180))#, wxSize(30, 30))
EVT_BUTTON(self, 160, self.TestFrame)
wxStaticText(self, -1, "Test Calendar Print", wxPoint(350, 250), wxSize(150, -1))
mID = NewId()
self.but = wxBitmapButton(self, mID, bmp, wxPoint(380, 280))#, wxSize(30, 30))
EVT_BUTTON(self, mID, self.OnPreview)
bmp = wxBitmap('bitmaps/Calend.bmp', wxBITMAP_TYPE_BMP)
self.but = wxBitmapButton(self, 170, bmp, wxPoint(380, 280))#, wxSize(30, 30))
EVT_BUTTON(self, 170, self.OnPreview)
# calendar dialog
def TestDlg(self, event): # test the date dialog
dlg = CalenDlg(self)
def TestDlg(self, event):
dlg = CalenDlg(self, self.log)
dlg.Centre()
if dlg.ShowModal() == wxID_OK:
result = dlg.result
day = result[1]
month = result[2]
year = result[3]
new_date = str(month) + '/'+ str(day) + '/'+ str(year)
self.log.WriteText('Date Selected: %s\n' % new_date)
else:
self.log.WriteText('No Date Selected')
dlg.ShowModal()
dlg.Destroy()
# calendar window test
@@ -225,6 +211,105 @@ class TestPanel(wxPanel):
self.calend.SetCurrentDay()
self.ResetDisplay()
# test the calendar control in a dialog
class CalenDlg(wxDialog):
def __init__(self, parent, log):
self.log = log
wxDialog.__init__(self, parent, -1, "Test Calendar", wxPyDefaultPosition, wxSize(280, 300))
start_month = 2
start_year = 1999
# get month list from DateTime
monthlist = GetMonthList()
# select the month
self.date = wxComboBox(self, 100, Month[start_month], wxPoint(20, 20), wxSize(90, -1), monthlist, wxCB_DROPDOWN)
EVT_COMBOBOX(self, 100, self.EvtComboBox)
# alternate spin button to control the month
h = self.date.GetSize().height
self.m_spin = wxSpinButton(self, 120, wxPoint(120, 20), wxSize(h*2, h), wxSP_VERTICAL)
self.m_spin.SetRange(1, 12)
self.m_spin.SetValue(start_month)
EVT_SPIN(self, 120, self.OnMonthSpin)
# spin button to conrol the year
self.dtext = wxTextCtrl(self, -1, str(start_year), wxPoint(160, 20), wxSize(60, -1))
h = self.dtext.GetSize().height
self.y_spin = wxSpinButton(self, 20, wxPoint(220, 20), wxSize(h*2, h), wxSP_VERTICAL)
self.y_spin.SetRange(1980, 2010)
self.y_spin.SetValue(start_year)
EVT_SPIN(self, 20, self.OnYrSpin)
# set the calendar and attributes
self.calend = wxCalendar(self, -1, wxPoint(20, 60), wxSize(240, 200))
self.calend.SetMonth(start_month)
self.calend.SetYear(start_year)
self.calend.HideTitle()
self.calend.ShowWeekEnd()
self.ResetDisplay()
self.Connect(self.calend.GetId(), -1, 2100, self.MouseClick)
# log the mouse clicks
def MouseClick(self, evt):
text = '%s CLICK %02d/%02d/%d' % (evt.click, evt.day, evt.month, evt.year) # format date
self.log.WriteText('Date Selected: ' + text + '\n')
if evt.click == 'DLEFT':
self.EndModal(wxID_OK)
# month and year spin selection routines
def OnMonthSpin(self, event):
month = event.GetPosition()
if month >= 0 and month <= 12:
self.date.SetValue(Month[month])
self.calend.SetMonth(month)
self.calend.Refresh()
def OnYrSpin(self, event):
year = event.GetPosition()
self.dtext.SetValue(str(year))
self.calend.SetYear(year)
self.calend.Refresh()
def EvtComboBox(self, event):
name = event.GetString()
self.log.WriteText('EvtComboBox: %s\n' % name)
monthval = self.date.FindString(name)
self.m_spin.SetValue(monthval+1)
self.calend.SetMonth(monthval+1)
self.ResetDisplay()
# set the calendar for highlighted days
def ResetDisplay(self):
month = self.calend.GetMonth()
try:
set_days = test_days[month]
except:
set_days = [1, 5, 12]
self.calend.AddSelect([4, 11], 'BLUE', 'WHITE')
self.calend.SetSelDay(set_days)
self.calend.Refresh()
# test of full window calendar control functions
class CalendFrame(wxFrame):
@@ -314,25 +399,21 @@ class CalendFrame(wxFrame):
def MakeToolMenu(self):
tb = self.CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER)
mID = NewId()
SetToolPath(self, tb, mID, images.getDbDecBitmap(), 'Dec Year')
EVT_TOOL(self, mID, self.OnDecYear)
bmp_path = 'bitmaps/'
SetToolPath(self, tb, 10, bmp_path + 'DbDec.bmp', 'Dec Year')
EVT_TOOL(self, 10, self.OnDecYear)
mID = NewId()
SetToolPath(self, tb, mID, images.getDecBitmap(), 'Dec Month')
EVT_TOOL(self, mID, self.OnDecMonth)
SetToolPath(self, tb, 15, bmp_path + 'Dec.bmp', 'Dec Month')
EVT_TOOL(self, 15, self.OnDecMonth)
mID = NewId()
SetToolPath(self, tb, mID, images.getPtBitmap(), 'Current Month')
EVT_TOOL(self, mID, self.OnCurrent)
SetToolPath(self, tb, 30, bmp_path + 'Pt.bmp', 'Current Month')
EVT_TOOL(self, 30, self.OnCurrent)
mID = NewId()
SetToolPath(self, tb, mID, images.getIncBitmap(), 'Inc Month')
EVT_TOOL(self, mID, self.OnIncMonth)
SetToolPath(self, tb, 40, bmp_path + 'Inc.bmp', 'Inc Month')
EVT_TOOL(self, 40, self.OnIncMonth)
mID = NewId()
SetToolPath(self, tb, mID, images.getDbIncBitmap(), 'Inc Year')
EVT_TOOL(self, mID, self.OnIncYear)
SetToolPath(self, tb, 45, bmp_path + 'DbInc.bmp', 'Inc Year')
EVT_TOOL(self, 45, self.OnIncYear)
tb.Realize()
@@ -514,7 +595,9 @@ class PrintCalend:
self.ptheight = height
def SetToolPath(self, tb, id, bmp, title):
tb.AddSimpleTool(id, bmp, title, title)
global dir_path
tb.AddSimpleTool(id, wxBitmap(os.path.join(dir_path, bmp), wxBITMAP_TYPE_BMP),
title, title)
class SetPrintout(wxPrintout):
def __init__(self, canvas):

View File

@@ -15,8 +15,8 @@ class TestChoice(wxPanel):
wxPoint(15, 10))
wxStaticText(self, -1, "Select one:", wxPoint(15, 50), wxSize(75, 20))
wxChoice(self, 40, (80, 50), (95, 125),
choices = sampleList)
wxChoice(self, 40, wxPoint(80, 50), wxSize(95, 20), #wxDefaultSize,
sampleList)
EVT_CHOICE(self, 40, self.EvtChoice)
def EvtChoice(self, event):

View File

@@ -4,8 +4,9 @@ from wxPython.wx import *
#---------------------------------------------------------------------------
def runTest(frame, nb, log):
dlg = wxColourDialog(frame)
dlg.GetColourData().SetChooseFull(true)
data = wxColourData()
data.SetChooseFull(true)
dlg = wxColourDialog(frame, data)
if dlg.ShowModal() == wxID_OK:
data = dlg.GetColourData()
log.WriteText('You selected: %s\n' % str(data.GetColour().Get()))

View File

@@ -1,8 +1,6 @@
from wxPython.wx import *
import images
#----------------------------------------------------------------------
class DragShape:
@@ -49,14 +47,14 @@ class DragCanvas(wxScrolledWindow):
self.dragShape = None
self.SetCursor(wxStockCursor(wxCURSOR_ARROW))
self.bg_bmp = images.getBackgroundBitmap()
self.bg_bmp = wxBitmap('bitmaps/backgrnd.png', wxBITMAP_TYPE_PNG)
# Make a shape from an image and mask. This one will demo
# dragging outside the window
bmp = images.getTestStarBitmap()
#mask = wxMaskColour(bmp, wxWHITE)
#bmp.SetMask(mask)
bmp = wxBitmap('bitmaps/test_image.png', wxBITMAP_TYPE_PNG)
mask = wxMaskColour(bmp, wxWHITE)
bmp.SetMask(mask)
shape = DragShape(bmp)
shape.pos = wxPoint(5, 5)
shape.fullscreen = true
@@ -86,9 +84,8 @@ class DragCanvas(wxScrolledWindow):
# Make some shapes from some playing card images.
x = 200
for card in ['_01c_', '_12h_', '_13d_', '_10s_']:
bmpFunc = getattr(images, "get%sBitmap" % card)
bmp = bmpFunc()
for card in ['01c.gif', '10s.gif', '12h.gif', '13d.gif']:
bmp = wxBitmap('bitmaps/'+card, wxBITMAP_TYPE_GIF)
shape = DragShape(bmp)
shape.pos = wxPoint(x, 5)
self.shapes.append(shape)

View File

@@ -1,9 +1,6 @@
from wxPython.wx import *
from wxPython.lib.floatbar import *
import images
class TestFloatBar(wxFrame):
def __init__(self, parent, log):
wxFrame.__init__(self, parent, -1, 'Test ToolBar',
@@ -20,28 +17,32 @@ class TestFloatBar(wxFrame):
tb.SetFloatable(1)
tb.SetTitle("Floating!")
self.CreateStatusBar()
tb.AddSimpleTool(10, images.getNewBitmap(), "New", "Long help for 'New'")
tb.AddSimpleTool(10, wxBitmap('bitmaps/new.bmp', wxBITMAP_TYPE_BMP),
"New", "Long help for 'New'")
EVT_TOOL(self, 10, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 10, self.OnToolRClick)
tb.AddSimpleTool(20, images.getOpenBitmap(), "Open")
tb.AddSimpleTool(20, wxBitmap('bitmaps/open.bmp', wxBITMAP_TYPE_BMP),
"Open")
EVT_TOOL(self, 20, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 20, self.OnToolRClick)
tb.AddSeparator()
tb.AddSimpleTool(30, images.getCopyBitmap(), "Copy")
tb.AddSimpleTool(30, wxBitmap('bitmaps/copy.bmp', wxBITMAP_TYPE_BMP),
"Copy")
EVT_TOOL(self, 30, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 30, self.OnToolRClick)
tb.AddSimpleTool(40, images.getPasteBitmap(), "Paste")
tb.AddSimpleTool(40, wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP),
"Paste")
EVT_TOOL(self, 40, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 40, self.OnToolRClick)
tb.AddSeparator()
tb.AddTool(60, images.getTog1Bitmap(), images.getTog2Bitmap(),
tb.AddTool(60, wxBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP),
wxBitmap('bitmaps/tog2.bmp', wxBITMAP_TYPE_BMP),
shortHelpString="Toggle with 2 bitmaps", isToggle=true)
EVT_TOOL(self, 60, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 60, self.OnToolRClick)

View File

@@ -66,7 +66,7 @@ class TestListBox(wxPanel):
EVT_LISTBOX(self, 60, self.EvtListBox)
EVT_LISTBOX_DCLICK(self, 60, self.EvtListBoxDClick)
EVT_RIGHT_UP(self.lb1, self.EvtRightButton)
self.lb1.SetSelection(3)
self.lb1.SetSelection(0)
wxStaticText(self, -1, "Select many:", wxPoint(200, 50), wxSize(65, 18))

View File

@@ -57,7 +57,6 @@ musicdata = {
39: ("Yes", "Rhythm Of Love", "Rock"),
}
import images
class TestListCtrlPanel(wxPanel):
def __init__(self, parent, log):
@@ -67,7 +66,7 @@ class TestListCtrlPanel(wxPanel):
tID = wxNewId()
self.il = wxImageList(16, 16)
bmp = images.getSmilesBitmap()
bmp = wxBitmap('bitmaps/smiles.bmp', wxBITMAP_TYPE_BMP)
idx1 = self.il.AddWithColourMask(bmp, wxWHITE)
self.list = wxListCtrl(self, tID,

View File

@@ -26,21 +26,19 @@ logicList = [
('wxXOR', wxXOR),
]
import images
class TestMaskWindow(wxScrolledWindow):
def __init__(self, parent):
wxScrolledWindow.__init__(self, parent, -1)
self.SetBackgroundColour(wxColour(0,128,0))
# A reference bitmap that we won't mask
self.bmp_nomask = images.getTestStar2Bitmap()
self.bmp_nomask = wxBitmap('bitmaps/test_image.png', wxBITMAP_TYPE_PNG)
# One that we will
self.bmp_withmask = images.getTestStar2Bitmap()
self.bmp_withmask = wxBitmap('bitmaps/test_image.png', wxBITMAP_TYPE_PNG)
# this mask comes from a monochrome bitmap
self.bmp_themask = images.getTestMaskBitmap()
self.bmp_themask = wxBitmap('bitmaps/test_mask.bmp', wxBITMAP_TYPE_BMP)
self.bmp_themask.SetDepth(1)
mask = wxMask(self.bmp_themask)
@@ -49,7 +47,7 @@ class TestMaskWindow(wxScrolledWindow):
# Now we'll create a mask in a bit of an easier way, by picking a
# colour in the image that is to be the transparent colour.
self.bmp_withcolourmask = images.getTestStar2Bitmap()
self.bmp_withcolourmask = wxBitmap('bitmaps/test_image.png', wxBITMAP_TYPE_PNG)
mask = wxMaskColour(self.bmp_withcolourmask, wxWHITE)
self.bmp_withcolourmask.SetMask(mask)

View File

@@ -2,8 +2,6 @@
from wxPython.wx import *
from wxPython.ogl import *
import images
#----------------------------------------------------------------------
# This creates some pens and brushes that the OGL library uses.
@@ -51,6 +49,7 @@ class MyEvtHandler(wxShapeEvtHandler):
self.log = log
self.statbarFrame = frame
def UpdateStatusBar(self, shape):
x,y = shape.GetX(), shape.GetY()
width, height = shape.GetBoundingBoxMax()
@@ -127,7 +126,6 @@ class TestWindow(wxShapeCanvas):
self.SetDiagram(self.diagram)
self.diagram.SetCanvas(self)
self.shapes = []
self.save_gdi = []
rRectBrush = wxBrush(wxNamedColour("MEDIUM TURQUOISE"), wxSOLID)
@@ -136,14 +134,6 @@ class TestWindow(wxShapeCanvas):
self.MyAddShape(DiamondShape(90, 90), 345, 235, wxPen(wxBLUE, 3, wxDOT), wxRED_BRUSH, "Polygon")
self.MyAddShape(RoundedRectangleShape(95,70), 140, 255, wxPen(wxRED, 1), rRectBrush, "Rounded Rect")
bmp = images.getTest2Bitmap()
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
s = wxBitmapShape()
s.SetBitmap(bmp)
self.MyAddShape(s, 225, 150, None, None, "Bitmap")
dc = wxClientDC(self)
self.PrepareDC(dc)
for x in range(len(self.shapes)):
@@ -168,13 +158,13 @@ class TestWindow(wxShapeCanvas):
def MyAddShape(self, shape, x, y, pen, brush, text):
shape.SetDraggable(true, true)
shape.SetDraggable(true)
shape.SetCanvas(self)
shape.SetX(x)
shape.SetY(y)
if pen: shape.SetPen(pen)
if brush: shape.SetBrush(brush)
if text: shape.AddText(text)
shape.SetPen(pen)
shape.SetBrush(brush)
shape.AddText(text)
#shape.SetShadowMode(SHADOW_RIGHT)
self.diagram.AddShape(shape)
shape.Show(true)
@@ -187,7 +177,6 @@ class TestWindow(wxShapeCanvas):
self.shapes.append(shape)
def __del__(self):
for shape in self.diagram.GetShapeList():
if shape.GetParent() == None:

View File

@@ -15,7 +15,7 @@ class TestSashWindow(wxPanel):
self.log = log
# will occupy the space not used by the Layout Algorithm
# will accupy the space not uised by the Layout Algorithm
self.remainingSpace = wxPanel(self, -1, style=wxSUNKEN_BORDER)
EVT_SASH_DRAGGED_RANGE(self, self.ID_WINDOW_TOP,

View File

@@ -1,8 +1,6 @@
from wxPython.wx import *
import images
#---------------------------------------------------------------------------
class MyCanvas(wxScrolledWindow):
@@ -22,7 +20,7 @@ class MyCanvas(wxScrolledWindow):
self.SetCursor(wxStockCursor(wxCURSOR_PENCIL))
bmp = images.getTest2Bitmap()
bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP)
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
self.bmp = bmp
@@ -44,14 +42,16 @@ class MyCanvas(wxScrolledWindow):
def DoDrawing(self, dc):
dc.BeginDrawing()
dc.SetPen(wxPen(wxNamedColour('RED')))
pen1 = wxPen(wxNamedColour('RED'))
dc.SetPen(pen1)
dc.DrawRectangle(5, 5, 50, 50)
dc.SetBrush(wxLIGHT_GREY_BRUSH)
dc.SetPen(wxPen(wxNamedColour('BLUE'), 4))
dc.DrawRectangle(15, 15, 50, 50)
dc.SetFont(wxFont(14, wxSWISS, wxNORMAL, wxNORMAL))
font = wxFont(14, wxSWISS, wxNORMAL, wxNORMAL)
dc.SetFont(font)
dc.SetTextForeground(wxColour(0xFF, 0x20, 0xFF))
te = dc.GetTextExtent("Hello World")
dc.DrawText("Hello World", 60, 65)
@@ -81,9 +81,12 @@ class MyCanvas(wxScrolledWindow):
dc.DrawRectangle(50,500,50,50)
dc.DrawRectangle(100,500,50,50)
dc.SetPen(wxPen(wxNamedColour('RED')))
dc.SetPen(pen1)
dc.DrawEllipticArc(200, 500, 50, 75, 0, 90)
#from wxPython import dch
#dch.FillRect(dc, wxRect(50, 400, 50, 50), wxBLACK)
self.DrawSavedLines(dc)
dc.EndDrawing()
@@ -127,27 +130,6 @@ class MyCanvas(wxScrolledWindow):
self.curLine = []
self.ReleaseMouse()
## This is an example of what to do for the EVT_MOUSEWHEEL event,
## but since wxScrolledWindow does this already it's not
## necessary to do it ourselves.
## wheelScroll = 0
## def OnWheel(self, evt):
## delta = evt.GetWheelDelta()
## rot = evt.GetWheelRotation()
## linesPer = evt.GetLinesPerAction()
## ws = self.wheelScroll
## ws = ws + rot
## lines = ws / delta
## ws = ws - lines * delta
## self.wheelScroll = ws
## if lines != 0:
## lines = lines * linesPer
## vsx, vsy = self.GetViewStart()
## scrollTo = vsy - lines
## self.Scroll(-1, scrollTo)
#---------------------------------------------------------------------------
def runTest(frame, nb, log):

View File

@@ -2,7 +2,6 @@
from wxPython.wx import *
import string
import images
#----------------------------------------------------------------------
@@ -14,17 +13,11 @@ class TestPanel(wxPanel):
wxStaticText(self, -1, "This is a wxStaticBitmap.", wxPoint(45, 15))
bmp = images.getTest2Bitmap()
mask = wxMaskColour(bmp, wxBLUE)
bmp.SetMask(mask)
bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP)
wxStaticBitmap(self, -1, bmp, wxPoint(80, 50),
wxSize(bmp.GetWidth(), bmp.GetHeight()))
bmp = images.getRobinBitmap()
wxStaticBitmap(self, -1, bmp, (80, 150))
wxStaticText(self, -1, "Hey, if Ousterhout can do it, so can I.",
(200, 175))
#----------------------------------------------------------------------

View File

@@ -96,19 +96,8 @@ class MySTC(wxStyledTextCtrl):
#----------------------------------------------------------------------
_USE_PANEL = 1
def runTest(frame, nb, log):
if not _USE_PANEL:
ed = p = MySTC(nb, -1, log)
else:
p = wxPanel(nb, -1)
ed = MySTC(p, -1, log)
s = wxBoxSizer(wxHORIZONTAL)
s.Add(ed, 1, wxEXPAND)
p.SetSizer(s)
p.SetAutoLayout(true)
ed = MySTC(nb, -1, log)
ed.SetText(demoText)
ed.EmptyUndoBuffer()
@@ -169,7 +158,7 @@ def runTest(frame, nb, log):
ed.SetStyling(10, wxSTC_INDIC2_MASK | wxSTC_INDIC1_MASK)
return p
return ed

View File

@@ -12,7 +12,7 @@ demoText = """\
"""
wxSTC_CMD_ZOOMIN
#----------------------------------------------------------------------
@@ -40,9 +40,6 @@ class PythonSTC(wxStyledTextCtrl):
def __init__(self, parent, ID):
wxStyledTextCtrl.__init__(self, parent, ID)
self.CmdKeyAssign(ord('B'), wxSTC_SCMOD_CTRL, wxSTC_CMD_ZOOMIN)
self.CmdKeyAssign(ord('N'), wxSTC_SCMOD_CTRL, wxSTC_CMD_ZOOMOUT)
self.SetLexer(wxSTC_LEX_PYTHON)
self.SetKeyWords(0, string.join(keyword.kwlist))
@@ -265,29 +262,18 @@ class PythonSTC(wxStyledTextCtrl):
#----------------------------------------------------------------------
_USE_PANEL = 1
def runTest(frame, nb, log):
if not _USE_PANEL:
ed = p = PythonSTC(nb, -1)
else:
p = wxPanel(nb, -1)
ed = PythonSTC(p, -1)
s = wxBoxSizer(wxHORIZONTAL)
s.Add(ed, 1, wxEXPAND)
p.SetSizer(s)
p.SetAutoLayout(true)
ed = PythonSTC(nb, -1)
ed.SetText(demoText + open('Main.py').read())
ed.EmptyUndoBuffer()
ed.Colourise(0, -1)
# line numbers in the margin
ed.SetMarginType(1, wxSTC_MARGIN_NUMBER)
ed.SetMarginWidth(1, 25)
return p
return ed

View File

@@ -26,5 +26,25 @@ def runTest(frame, nb, log):
overview = """\
This class represents a dialog that requests a one-line text string from the user. It is implemented as a generic wxWindows dialog.
wxTextEntryDialog()
----------------------------------
wxTextEntryDialog(wxWindow* parent, const wxString& message, const wxString& caption = "Please enter text", const wxString& defaultValue = "", long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition)
Constructor. Use wxTextEntryDialog::ShowModal to show the dialog.
Parameters
-------------------
parent = Parent window.
message = Message to show on the dialog.
defaultValue = The default value, which may be the empty string.
style = A dialog style, specifying the buttons (wxOK, wxCANCEL) and an optional wxCENTRE style.
pos = Dialog position.
"""

View File

@@ -1,36 +0,0 @@
from wxPython.wx import *
#----------------------------------------------------------------------
class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.log = log
panel = wxPanel(self, -1)
buttons = wxBoxSizer(wxHORIZONTAL)
for word in string.split("These are toggle buttons"):
b = wxToggleButton(panel, -1, word)
EVT_TOGGLEBUTTON(self, b.GetId(), self.OnToggle)
buttons.Add(b, flag=wxALL, border=5)
panel.SetAutoLayout(true)
panel.SetSizer(buttons)
buttons.Fit(panel)
panel.Move((50,50))
def OnToggle(self, evt):
self.log.write("Button %d toggled\n" % evt.GetId())
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
overview = """\
"""

View File

@@ -1,8 +1,6 @@
from wxPython.wx import *
import images
#---------------------------------------------------------------------------
class TestToolBar(wxFrame):
@@ -15,37 +13,38 @@ class TestToolBar(wxFrame):
wxWindow(self, -1).SetBackgroundColour(wxNamedColour("WHITE"))
tb = self.CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER|wxTB_FLAT)
tb = self.CreateToolBar(wxTB_HORIZONTAL|wxNO_BORDER) #|wxTB_FLAT)
#tb = wxToolBarSimple(self, -1, wxDefaultPosition, wxDefaultSize,
# wxTB_HORIZONTAL | wxNO_BORDER | wxTB_FLAT)
#self.SetToolBar(tb)
self.CreateStatusBar()
tb.AddSimpleTool(10, images.getNewBitmap(), "New", "Long help for 'New'")
tb.AddSimpleTool(10, wxBitmap('bitmaps/new.bmp', wxBITMAP_TYPE_BMP),
"New", "Long help for 'New'")
EVT_TOOL(self, 10, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 10, self.OnToolRClick)
tb.AddSimpleTool(20, images.getOpenBitmap(), "Open", "Long help for 'Open'")
tb.AddSimpleTool(20, wxBitmap('bitmaps/open.bmp', wxBITMAP_TYPE_BMP),
"Open", "Long help for 'Open'")
EVT_TOOL(self, 20, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 20, self.OnToolRClick)
tb.AddSeparator()
tb.AddSimpleTool(30, images.getCopyBitmap(), "Copy", "Long help for 'Copy'")
tb.AddSimpleTool(30, wxBitmap('bitmaps/copy.bmp', wxBITMAP_TYPE_BMP),
"Copy", "Long help for 'Copy'")
EVT_TOOL(self, 30, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 30, self.OnToolRClick)
tb.AddSimpleTool(40, images.getPasteBitmap(), "Paste", "Long help for 'Paste'")
tb.AddSimpleTool(40, wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP),
"Paste", "Long help for 'Paste'")
EVT_TOOL(self, 40, self.OnToolClick)
EVT_TOOL_RCLICKED(self, 40, self.OnToolRClick)
tb.AddSeparator()
tool = tb.AddTool(50, images.getTog1Bitmap(),
tool = tb.AddTool(50, wxBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP),
shortHelpString="Toggle this", isToggle=true)
EVT_TOOL(self, 50, self.OnToolClick)
tb.AddTool(60, images.getTog1Bitmap(), images.getTog2Bitmap(),
tb.AddTool(60, wxBitmap('bitmaps/tog1.bmp', wxBITMAP_TYPE_BMP),
wxBitmap('bitmaps/tog2.bmp', wxBITMAP_TYPE_BMP),
shortHelpString="Toggle with 2 bitmaps", isToggle=true)
EVT_TOOL(self, 60, self.OnToolClick)
@@ -75,8 +74,6 @@ class TestToolBar(wxFrame):
self.log.WriteText('OnToolEnter: %s, %s\n' % (event.GetId(), event.GetInt()))
if self.timer is None:
self.timer = wxTimer(self)
if self.timer.IsRunning():
self.timer.Stop()
self.timer.Start(2000)
event.Skip()

View File

@@ -6,14 +6,13 @@ import string
#---------------------------------------------------------------------------
class MyTreeCtrl(wxTreeCtrl):
def __init__(self, parent, id, pos, size, style, log):
def __init__(self, parent, id, pos, size, style):
wxTreeCtrl.__init__(self, parent, id, pos, size, style)
self.log = log
def OnCompareItems(self, item1, item2):
t1 = self.GetItemText(item1)
t2 = self.GetItemText(item2)
self.log.WriteText('compare: ' + t1 + '<>' + t2 + '\n')
if t1 < t2: return -1
if t1 == t2: return 0
return 1
@@ -30,16 +29,14 @@ class TestTreeCtrlPanel(wxPanel):
tID = NewId()
self.tree = MyTreeCtrl(self, tID, wxDefaultPosition, wxDefaultSize,
wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS# | wxTR_MULTIPLE
, self.log)
wxTR_HAS_BUTTONS | wxTR_EDIT_LABELS)# | wxTR_MULTIPLE)
#import images
#il = wxImageList(16, 16)
#idx1 = il.Add(images.getSmilesBitmap())
#idx2 = il.Add(images.getOpenBitmap())
#idx3 = il.Add(images.getNewBitmap())
#idx4 = il.Add(images.getCopyBitmap())
#idx5 = il.Add(images.getPasteBitmap())
#idx1 = il.Add(wxBitmap('bitmaps/smiles.bmp', wxBITMAP_TYPE_BMP))
#idx2 = il.Add(wxBitmap('bitmaps/open.bmp', wxBITMAP_TYPE_BMP))
#idx3 = il.Add(wxBitmap('bitmaps/new.bmp', wxBITMAP_TYPE_BMP))
#idx4 = il.Add(wxBitmap('bitmaps/copy.bmp', wxBITMAP_TYPE_BMP))
#idx5 = il.Add(wxBitmap('bitmaps/paste.bmp', wxBITMAP_TYPE_BMP))
#self.tree.SetImageList(il)
#self.il = il

View File

@@ -1,261 +0,0 @@
"""
This script will generate a setup script for InnoSetup and then run it
to make the installer executable. If all goes right the proper versions
of Python and wxWindows (including hybrid/final settings) will all be
calculated based on what wxc.pyd imports and an appropriate installer
will be created.
"""
import os, string
KEEP_TEMPS = 0
#----------------------------------------------------------------------
ISS_Template = r'''
;;------------------------------------------------------------
[Setup]
AppName = wxPython
AppVerName = wxPython %(VERSION)s
OutputBaseFilename = wxPython-%(VERSION)s-%(PYVER)s
AppCopyright = Copyright <20> 2001 Total Control Software
DefaultDirName = {code:GetPythonDir|c:\DoNotInstallHere}
DefaultGroupName = wxPython %(SHORTVER)s for Python %(PYTHONVER)s
AlwaysCreateUninstallIcon = yes
;; SourceDir = .
;; OutputDir is relative to SourceDir
OutputDir = dist
WizardStyle = modern
UninstallStyle = modern
DisableStartupPrompt = true
CompressLevel = 9
DirExistsWarning = no
DisableReadyMemo = true
DisableReadyPage = true
;;DisableDirPage = true
DisableProgramGroupPage = true
DisableAppendDir = true
UninstallFilesDir = {app}\wxPython
AppPublisherURL = http://wxPython.org/
LicenseFile = licence\licence.txt
CodeFile = %(IFSFILE)s
;;------------------------------------------------------------
;;[Dirs]
;;Name: "{app}\"
;;------------------------------------------------------------
[Components]
Name: core; Description: "wxPython modules and library"; Types: full compact custom; Flags: fixed
Name: docs; Description: "Documentation"; Types: full
Name: demo; Description: "Demo application"; Types: full
Name: samples; Description: "Sample applications"; Types: full
Name: tools; Description: "Tools"; Types: full
;;------------------------------------------------------------
[Files]
Source: "%(SYSDIR)s\MSVCRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core
Source: "%(SYSDIR)s\MSVCIRT.dll"; DestDir: "{sys}"; CopyMode: alwaysskipifsameorolder; Flags: sharedfile uninsneveruninstall restartreplace; Components: core
Source: "%(WXDIR)s\lib\%(WXDLL)s"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\wxc.pyd"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\gridc.pyd"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\htmlc.pyd"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\utilsc.pyd"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\calendarc.pyd"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\glcanvasc.pyd"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\oglc.pyd"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\stc_c.pyd"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\*.py"; DestDir: "{app}\wxPython"; Components: core
Source: "wxPython\lib\*.py"; DestDir: "{app}\wxPython\lib"; Components: core
Source: "wxPython\lib\editor\*.py"; DestDir: "{app}\wxPython\lib\editor"; Components: core
Source: "wxPython\lib\editor\*.txt"; DestDir: "{app}\wxPython\lib\editor"; Components: core
Source: "demo\*.py"; DestDir: "{app}\wxPython\demo"; Components: demo
Source: "demo\*.xml"; DestDir: "{app}\wxPython\demo"; Components: demo
Source: "demo\*.txt"; DestDir: "{app}\wxPython\demo"; Components: demo
Source: "demo\bitmaps\*.gif"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
Source: "demo\bitmaps\*.bmp"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
Source: "demo\bitmaps\*.jpg"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
Source: "demo\bitmaps\*.png"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
Source: "demo\bitmaps\*.ico"; DestDir: "{app}\wxPython\demo\bitmaps"; Components: demo
Source: "demo\data\*.htm"; DestDir: "{app}\wxPython\demo\data"; Components: demo
Source: "demo\data\*.html"; DestDir: "{app}\wxPython\demo\data"; Components: demo
Source: "demo\data\*.py"; DestDir: "{app}\wxPython\demo\data"; Components: demo
Source: "demo\data\*.png"; DestDir: "{app}\wxPython\demo\data"; Components: demo
Source: "demo\data\*.bmp"; DestDir: "{app}\wxPython\demo\data"; Components: demo
Source: "demo\data\*.i"; DestDir: "{app}\wxPython\demo\data"; Components: demo
Source: "demo\data\*.h"; DestDir: "{app}\wxPython\demo\data"; Components: demo
Source: "demo\data\*.txt"; DestDir: "{app}\wxPython\demo\data"; Components: demo
Source: "README.txt"; DestDir: "{app}\wxPython\docs"; Flags: isreadme; Components: core
Source: "CHANGES.txt"; DestDir: "{app}\wxPython\docs"; Components: core
Source: "licence\*.txt"; DestDir: "{app}\wxPython\docs\licence"; Components: core
Source: "%(WXDIR)s\docs\htmlhelp\wx.chm"; DestDir: "{app}\wxPython\docs"; Components: docs
Source: "%(WXDIR)s\docs\htmlhelp\ogl.chm"; DestDir: "{app}\wxPython\docs"; Components: docs
Source: "tools\*.py"; DestDir: "{app}\wxPython\tools"; Components: tools
Source: "samples\doodle\*.py"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
Source: "samples\doodle\*.txt"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
Source: "samples\doodle\sample.ddl"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
Source: "samples\doodle\superdoodle.iss"; DestDir: "{app}\wxPython\samples\doodle"; Components: samples
Source: "samples\wxProject\*.txt"; DestDir: "{app}\wxPython\samples\wxProject"; Components: samples
Source: "samples\wxProject\*.py"; DestDir: "{app}\wxPython\samples\wxProject"; Components: samples
Source: "samples\stxview\*.py"; DestDir: "{app}\wxPython\samples\stxview"; Components: samples
Source: "samples\stxview\*.stx"; DestDir: "{app}\wxPython\samples\stxview"; Components: samples
Source: "samples\stxview\*.txt"; DestDir: "{app}\wxPython\samples\stxview"; Components: samples
Source: "samples\stxview\StructuredText\*.py"; DestDir: "{app}\wxPython\samples\stxview\StructuredText"; Components: samples
;;------------------------------------------------------------
[Icons]
Name: "{group}\Run the DEMO"; Filename: "{code:GetPythonDir}\pythonw.exe"; WorkingDir: "{app}\wxPython\demo"; Parameters: "demo.py";
Name: "{group}\wxWindows Referece"; Filename: "{app}\wxPython\docs\wx.chm";
Name: "{group}\wxOGL Referece"; Filename: "{app}\wxPython\docs\ogl.chm";
Name: "{group}\licence.txt"; Filename: "{app}\wxPython\docs\licence\licence.txt";
Name: "{group}\README.txt"; Filename: "{app}\wxPython\docs\README.txt";
Name: "{group}\CHANGES.txt"; Filename: "{app}\wxPython\docs\CHANGES.txt";
Name: "{group}\Sample Apps"; Filename: "{app}\wxPython\samples"; Components: samples
;;Name: "{group}\Uninstall wxPython"; Filename: "{app}\wxPython\unins000.exe"; WorkingDir: "{app}\wxPython";
;;------------------------------------------------------------
[UninstallDelete]
Type: files; Name: "{app}\wxPython\*.pyc";
Type: files; Name: "{app}\wxPython\*.pyo";
Type: files; Name: "{app}\wxPython\lib\*.pyc";
Type: files; Name: "{app}\wxPython\lib\*.pyo";
Type: files; Name: "{app}\wxPython\lib\editor\*.pyc";
Type: files; Name: "{app}\wxPython\lib\editor\*.pyo";
Type: files; Name: "{app}\wxPython\demo\*.pyc";
Type: files; Name: "{app}\wxPython\demo\*.pyo";
Type: files; Name: "{app}\wxPython\demo\data\showTips";
Type: files; Name: "{app}\wxPython\tools\*.pyc";
Type: files; Name: "{app}\wxPython\tools\*.pyo";
Type: files; Name: "{app}\wxPython\samples\doodle\*.pyc";
Type: files; Name: "{app}\wxPython\samples\doodle\*.pyo";
Type: files; Name: "{app}\wxPython\samples\wxProject\*.pyc";
Type: files; Name: "{app}\wxPython\samples\wxProject\*.pyo";
Type: files; Name: "{app}\wxPython\samples\stxview\*.pyc";
Type: files; Name: "{app}\wxPython\samples\stxview\*.pyo";
Type: files; Name: "{app}\wxPython\samples\stxview\StructuredText\*.pyc";
Type: files; Name: "{app}\wxPython\samples\stxview\StructuredText\*.pyo";
'''
#----------------------------------------------------------------------
IFS_Template = r"""
program Setup;
var
PythonDir : String;
function InitializeSetup(): Boolean;
begin
if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
'Software\Python\PythonCore\%(PYTHONVER)s\InstallPath',
'', PythonDir) then begin
MsgBox('No installation of Python %(PYTHONVER)s found. Aborting...',
mbConfirmation, MB_OK);
Result := false;
end else
Result := true;
end;
function GetPythonDir(Default: String): String;
begin
Result := PythonDir;
end;
begin
end.
"""
#----------------------------------------------------------------------
def find_DLLs():
WXDLL = PYTHONVER = None
proc = os.popen(r"dumpbin /imports wxPython\wxc.pyd", "r")
lines = proc.readlines()
proc.close()
for line in lines:
if line[:6] == " wx":
WXDLL = string.strip(line)
if line[:10] == " python":
PYTHONVER = line[10] + '.' + line[11]
if WXDLL and PYTHONVER:
return WXDLL, PYTHONVER
#----------------------------------------------------------------------
def main():
verglob = {}
execfile("wxPython/__version__.py", verglob)
VERSION = verglob["ver"]
SHORTVER = VERSION[:3]
WXDLL, PYTHONVER = find_DLLs()
PYVER = "Py" + PYTHONVER[0] + PYTHONVER[2]
WXDIR = os.environ["WXWIN"]
WXPYDIR = os.path.join(WXDIR, "wxPython")
SYSDIR = r"C:\WINNT\SYSTEM32"
ISSFILE = "__wxPython.iss"
IFSFILE = "__wxPython.ifs"
if string.find(WXDLL, "h") != -1:
PYVER = PYVER + "-hybrid"
f = open(ISSFILE, "w")
f.write(ISS_Template % vars())
f.close()
f = open(IFSFILE, "w")
f.write(IFS_Template % vars())
f.close()
os.system(r"C:\TOOLS\InnoSetup2Ex\ISCC.exe %s" % ISSFILE)
if not KEEP_TEMPS:
os.remove(ISSFILE)
os.remove(IFSFILE)
#----------------------------------------------------------------------
if __name__ == "__main__":
main()
#----------------------------------------------------------------------

View File

@@ -15,7 +15,6 @@ mkdir _distrib_tgz
mkdir _distrib_tgz/wxPython-$1
cp -R demo _distrib_tgz/wxPython-$1
cp -R samples _distrib_tgz/wxPython-$1
# do some cleanup
rm -rf `find _distrib_tgz/wxPython-$1 -name CVS`

Binary file not shown.

View File

@@ -1,7 +1,7 @@
Document Type: WSE
item: Global
Version=6.01
Title=wxPython 2.2 Installation
Title=wxPython 2.3 Installation
Flags=10010111
Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Japanese Font Name=MS Gothic
@@ -17,7 +17,7 @@ item: Global
Patch Flags=0000000000001001
Patch Threshold=85
Patch Memory=4000
EXE Filename=wxPython-2.2.5-PyXX.exe
EXE Filename=wxPython-2.3b1.exe
FTP Cluster Size=20
Per-User Version ID=1
Dialogs Version=6
@@ -55,12 +55,12 @@ item: End Block
end
item: Set Variable
Variable=APPTITLE
Value=wxPython 2.2
Value=wxPython 2.3
Flags=10000000
end
item: Set Variable
Variable=GROUP
Value=wxPython 2.2
Value=wxPython 2.3
Flags=10000000
end
item: Set Variable
@@ -72,17 +72,17 @@ item: Set Variable
Value=wxPython
Flags=10000000
end
item: Check Configuration
Flags=10111011
end
item: Remark
end
item: Set Variable
Variable=PYTHONVER
Value=1.5
Value=2.0
end
item: Remark
end
item: Check Configuration
Flags=10111011
end
item: Get Registry Key Value
Variable=PYTHONDIR
Key=SOFTWARE\Python\PythonCore\%PYTHONVER%\InstallPath
@@ -814,8 +814,8 @@ item: Install File
Flags=0000001010000011
end
item: Install File
Source=c:\projects\wx\lib\wx22_5.dll
Destination=%MAINDIR%\wxPython\wx22_5.dll
Source=c:\projects\wx\lib\wx23_0.dll
Destination=%MAINDIR%\wxPython\wx23_0.dll
Flags=0000000010010010
end
item: Install File
@@ -909,7 +909,7 @@ item: Install File
Flags=0000000010000010
end
item: Install File
Source=c:\Projects\wx\wxPython\demo\data\*.html
Source=c:\Projects\wx\wxPython\demo\data\*.htm
Destination=%MAINDIR%\wxPython\demo\data
Description=Demos
Flags=0000000010000010
@@ -965,7 +965,7 @@ item: Install File
Flags=0000000010000010
end
item: Install File
Source=c:\PROJECTS\wx\docs\htmlhelp\ogl.chm
Source=c:\PROJECTS\wx\docs\html\ogl\ogl.chm
Destination=%MAINDIR%\wxPython\docs\ogl.chm
Description=wxPython documentation
Flags=0000000010000010

View File

@@ -1,4 +0,0 @@
find . | grep -v "/CVS" | grep -v "./build/" | grep -v "./distrib/" | grep -v ".pyd" | grep -v ".pdb" | grep -v "contrib/ogl/contrib" | grep -v "contrib/stc/contrib" | zip -@ wxPython.zip

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